[saga] 02/05: Imported Upstream version 2.1.2+dfsg

Johan Van de Wauw johanvdw-guest at moszumanska.debian.org
Thu Jun 12 23:18:16 UTC 2014


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

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

commit b91b676f2c9cd668cda3679897bda6090f4fd767
Author: Johan Van de Wauw <johan.vandewauw at gmail.com>
Date:   Fri Jun 13 00:03:02 2014 +0200

    Imported Upstream version 2.1.2+dfsg
---
 AUTHORS                                            |    14 +-
 COPYING                                            |    77 +
 Makefile.in                                        |   185 +-
 README                                             |     2 +-
 aclocal.m4                                         |   384 +-
 config.guess                                       |   373 +-
 config.h.in                                        |     3 +
 config.sub                                         |   210 +-
 configure                                          | 15262 ++++++++-----------
 configure.ac                                       |   147 +-
 depcomp                                            |   189 +-
 install-sh                                         |    35 +-
 ltmain.sh                                          |  4017 +++--
 m4/libtool.m4                                      |  2252 ++-
 m4/ltoptions.m4                                    |    32 +-
 m4/ltversion.m4                                    |    12 +-
 m4/lt~obsolete.m4                                  |    12 +-
 missing                                            |   148 +-
 py-compile                                         |    50 +-
 src/Makefile.am                                    |     2 +-
 src/Makefile.in                                    |   115 +-
 src/modules/Makefile.am                            |     2 +-
 src/modules/Makefile.in                            |   115 +-
 src/modules/climate/Makefile.in                    |   113 +-
 src/modules/climate/climate_tools/Makefile.in      |   114 +-
 src/modules/contrib/Makefile.am                    |     1 +
 src/modules/contrib/Makefile.in                    |   634 +
 .../contrib/contrib_peregro}/A1WiTh.cpp            |     0
 .../contrib/contrib_peregro}/A1WiTh.h              |     0
 .../contrib/contrib_peregro}/A2WiTh.cpp            |     0
 .../contrib/contrib_peregro}/A2WiTh.h              |     0
 .../contrib/contrib_peregro}/A3WiTh.cpp            |     0
 .../contrib/contrib_peregro}/A3WiTh.h              |     0
 .../contrib/contrib_peregro}/AvWiMa1.cpp           |     0
 .../contrib/contrib_peregro}/AvWiMa1.h             |     0
 .../contrib/contrib_peregro}/AvWiMa2.cpp           |     0
 .../contrib/contrib_peregro}/AvWiMa2.h             |     0
 .../contrib/contrib_peregro}/MLB_Interface.cpp     |     0
 .../contrib/contrib_peregro/MLB_Interface.h        |    26 +
 src/modules/contrib/contrib_peregro/Makefile.am    |    36 +
 src/modules/contrib/contrib_peregro/Makefile.in    |   654 +
 .../contrib/contrib_peregro}/destriping1.cpp       |     0
 .../contrib/contrib_peregro}/destriping1.h         |     0
 .../contrib/contrib_peregro}/destriping2.cpp       |     0
 .../contrib/contrib_peregro}/destriping2.h         |     0
 .../contrib/contrib_peregro}/directional1.cpp      |     0
 .../contrib/contrib_peregro}/directional1.h        |     0
 src/modules/db/Makefile.am                         |    13 +
 src/modules/db/Makefile.in                         |   637 +
 src/modules/db/db_odbc/MLB_Interface.cpp           |   155 +
 src/modules/db/db_odbc/MLB_Interface.h             |    78 +
 src/modules/db/db_odbc/Makefile.am                 |    26 +
 src/modules/db/db_odbc/Makefile.in                 |   639 +
 src/modules/db/db_odbc/get_connection.cpp          |   523 +
 src/modules/db/db_odbc/get_connection.h            |   209 +
 src/modules/db/db_odbc/odbc.cpp                    |  1654 ++
 src/modules/db/db_odbc/odbc.h                      |   291 +
 .../db/io_odbc => modules/db/db_odbc}/otlv4.h      |     0
 src/modules/db/db_odbc/table.cpp                   |   476 +
 src/modules/db/db_odbc/table.h                     |   215 +
 src/modules/db/db_pgsql/MLB_Interface.cpp          |   148 +
 src/modules/db/db_pgsql/MLB_Interface.h            |    86 +
 src/modules/db/db_pgsql/Makefile.am                |    29 +
 src/modules/db/db_pgsql/Makefile.in                |   644 +
 src/modules/db/db_pgsql/db_pgsql.cpp               |  1858 +++
 src/modules/db/db_pgsql/db_pgsql.h                 |   268 +
 src/modules/db/db_pgsql/get_connection.cpp         |   583 +
 src/modules/db/db_pgsql/get_connection.h           |   225 +
 src/modules/db/db_pgsql/pgis_raster.cpp            |   337 +
 src/modules/db/db_pgsql/pgis_raster.h              |   149 +
 src/modules/db/db_pgsql/pgis_shapes.cpp            |   445 +
 src/modules/db/db_pgsql/pgis_shapes.h              |   151 +
 src/modules/db/db_pgsql/table.cpp                  |   489 +
 src/modules/db/db_pgsql/table.h                    |   213 +
 src/{modules_io => modules}/docs/Makefile.am       |     0
 src/modules/docs/Makefile.in                       |   634 +
 src/modules/docs/docs_html/CreateWebContent.cpp    |   181 +
 src/modules/docs/docs_html/CreateWebContent.h      |    56 +
 .../docs/docs_html/MLB_Interface.cpp               |     0
 .../docs/docs_html/MLB_Interface.h                 |     0
 .../docs/docs_html/Makefile.am                     |     0
 src/modules/docs/docs_html/Makefile.in             |   641 +
 .../docs/docs_html/doc_html.cpp                    |     0
 .../docs/docs_html/doc_html.h                      |     0
 .../docs/docs_html/doc_svg.cpp                     |     0
 .../docs/docs_html/doc_svg.h                       |     0
 src/modules/docs/docs_html/svg_interactive_map.cpp |  2897 ++++
 .../docs/docs_html/svg_interactive_map.h           |     0
 .../docs/docs_pdf/MLB_Interface.cpp                |     0
 .../docs/docs_pdf/MLB_Interface.h                  |     0
 .../docs/docs_pdf/Makefile.am                      |     0
 src/modules/docs/docs_pdf/Makefile.in              |   646 +
 .../docs/docs_pdf/Profile_Cross_Sections.cpp       |  1459 ++
 src/modules/docs/docs_pdf/Profile_Cross_Sections.h |    92 +
 .../docs/docs_pdf/Shapes_Report.cpp                |     0
 .../docs/docs_pdf/Shapes_Report.h                  |     0
 src/modules/docs/docs_pdf/Shapes_Summary.cpp       |   575 +
 src/modules/docs/docs_pdf/Shapes_Summary.h         |    98 +
 .../docs/docs_pdf/doc_pdf.cpp                      |     0
 .../docs/docs_pdf/doc_pdf.h                        |     0
 src/modules/garden/Makefile.am                     |     5 +
 src/modules/garden/Makefile.in                     |   636 +
 .../garden_3d_viewer/3d_viewer_globe_grid.cpp      |   634 +
 .../garden/garden_3d_viewer/3d_viewer_globe_grid.h |   106 +
 .../garden_3d_viewer/3d_viewer_multiple_grids.cpp  |   511 +
 .../garden_3d_viewer/3d_viewer_multiple_grids.h    |   106 +
 .../garden_3d_viewer/3d_viewer_pointcloud.cpp      |   956 ++
 .../garden/garden_3d_viewer/3d_viewer_pointcloud.h |   106 +
 .../garden/garden_3d_viewer/3d_viewer_shapes.cpp   |   494 +
 .../garden/garden_3d_viewer/3d_viewer_shapes.h     |   106 +
 .../garden/garden_3d_viewer/3d_viewer_tin.cpp      |   809 +
 .../garden/garden_3d_viewer/3d_viewer_tin.h        |   106 +
 .../garden/garden_3d_viewer/MLB_Interface.cpp      |   132 +
 .../garden/garden_3d_viewer/MLB_Interface.h        |    83 +
 src/modules/garden/garden_3d_viewer/Makefile.am    |    30 +
 src/modules/garden/garden_3d_viewer/Makefile.in    |   645 +
 .../garden/garden_fractals}/Bifurcation.cpp        |     0
 .../garden/garden_fractals}/Bifurcation.h          |     0
 .../garden_fractals}/Gaussian_Landscapes.cpp       |     0
 .../garden/garden_fractals}/Gaussian_Landscapes.h  |     0
 .../garden_fractals}/Grid_FractalDimension.cpp     |     0
 .../garden_fractals}/Grid_FractalDimension.h       |     0
 .../garden/garden_fractals}/MLB_Interface.cpp      |     0
 src/modules/garden/garden_fractals/MLB_Interface.h |    78 +
 src/modules/garden/garden_fractals/Makefile.am     |    32 +
 src/modules/garden/garden_fractals/Makefile.in     |   648 +
 .../garden/garden_fractals}/Mandelbrot.cpp         |     0
 .../garden/garden_fractals}/Mandelbrot.h           |     0
 .../garden/garden_fractals}/Newton.cpp             |     0
 .../garden/garden_fractals}/Newton.h               |     0
 .../garden/garden_fractals}/Pythagoras_Tree.cpp    |     0
 .../garden/garden_fractals}/Pythagoras_Tree.h      |     0
 .../garden/garden_games}/MLB_Interface.cpp         |     0
 src/modules/garden/garden_games/MLB_Interface.h    |    74 +
 src/modules/garden/garden_games/Makefile.am        |    25 +
 src/modules/garden/garden_games/Makefile.in        |   637 +
 .../garden/garden_games}/Mine_Sweeper.cpp          |     0
 .../garden/garden_games}/Mine_Sweeper.h            |     0
 .../garden/garden_games}/Mine_Sweeper_Res.cpp      |     0
 .../garden/garden_games}/Sudoku.cpp                |     0
 .../garden/garden_games}/Sudoku.h                  |     0
 .../garden_learn_to_program}/Exercise_01.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_01.h  |     0
 .../garden_learn_to_program}/Exercise_02.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_02.h  |     0
 .../garden_learn_to_program}/Exercise_03.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_03.h  |     0
 .../garden/garden_learn_to_program/Exercise_04.cpp |   446 +
 .../garden/garden_learn_to_program}/Exercise_04.h  |     0
 .../garden_learn_to_program}/Exercise_05.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_05.h  |     0
 .../garden_learn_to_program}/Exercise_06.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_06.h  |     0
 .../garden_learn_to_program}/Exercise_07.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_07.h  |     0
 .../garden/garden_learn_to_program/Exercise_08.cpp |   293 +
 .../garden/garden_learn_to_program}/Exercise_08.h  |     0
 .../garden_learn_to_program}/Exercise_09.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_09.h  |     0
 .../garden_learn_to_program}/Exercise_10.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_10.h  |     0
 .../garden_learn_to_program}/Exercise_11.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_11.h  |     0
 .../garden_learn_to_program}/Exercise_12.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_12.h  |     0
 .../garden_learn_to_program}/Exercise_13.cpp       |     0
 .../garden/garden_learn_to_program}/Exercise_13.h  |     0
 .../garden/garden_learn_to_program/Exercise_14.cpp |   376 +
 .../garden/garden_learn_to_program}/Exercise_14.h  |     0
 .../garden_learn_to_program}/MLB_Interface.cpp     |     0
 .../garden/garden_learn_to_program/MLB_Interface.h |    78 +
 .../garden/garden_learn_to_program/Makefile.am     |    48 +
 .../garden/garden_learn_to_program/Makefile.in     |   675 +
 .../garden/garden_webservices/MLB_Interface.cpp    |     0
 .../garden/garden_webservices/MLB_Interface.h      |     0
 .../garden/garden_webservices/Makefile.am          |     0
 src/modules/garden/garden_webservices/Makefile.in  |   635 +
 .../garden/garden_webservices/osm_import.cpp       |     0
 .../garden/garden_webservices/osm_import.h         |     0
 .../garden/garden_webservices/wms_import.cpp       |     0
 .../garden/garden_webservices/wms_import.h         |     0
 src/modules/grid/Makefile.in                       |   113 +-
 .../grid/grid_analysis/Cost_Anisotropic.cpp        |     4 +-
 src/modules/grid/grid_analysis/Cost_Anisotropic.h  |     4 +-
 src/modules/grid/grid_analysis/Cost_Isotropic.cpp  |     4 +-
 src/modules/grid/grid_analysis/Cost_Isotropic.h    |     4 +-
 src/modules/grid/grid_analysis/CoveredDistance.cpp |     4 +-
 src/modules/grid/grid_analysis/CoveredDistance.h   |     4 +-
 .../grid/grid_analysis/CrossClassification.cpp     |     4 +-
 .../grid/grid_analysis/CrossClassification.h       |     4 +-
 src/modules/grid/grid_analysis/Grid_AHP.cpp        |     4 +-
 src/modules/grid/grid_analysis/Grid_AHP.h          |     4 +-
 .../grid_analysis/Grid_Accumulation_Functions.cpp  |     4 +-
 .../grid/grid_analysis/Grid_AggregationIndex.cpp   |     4 +-
 .../grid/grid_analysis/Grid_AggregationIndex.h     |     4 +-
 src/modules/grid/grid_analysis/Grid_CVA.cpp        |     4 +-
 src/modules/grid/grid_analysis/Grid_CVA.h          |     4 +-
 .../grid_analysis/Grid_LayerOfMaximumValue.cpp     |     4 +-
 .../grid/grid_analysis/Grid_LayerOfMaximumValue.h  |     4 +-
 src/modules/grid/grid_analysis/Grid_Pattern.cpp    |     4 +-
 src/modules/grid/grid_analysis/Grid_Pattern.h      |     4 +-
 src/modules/grid/grid_analysis/Makefile.in         |   114 +-
 src/modules/grid/grid_analysis/owa.cpp             |     4 +-
 src/modules/grid/grid_analysis/owa.h               |     4 +-
 src/modules/grid/grid_calculus/Fuzzify.cpp         |     4 +-
 src/modules/grid/grid_calculus/Fuzzify.h           |     4 +-
 .../grid/grid_calculus/Grid_Random_Terrain.cpp     |     4 +-
 .../grid/grid_calculus/Grid_Random_Terrain.h       |     4 +-
 src/modules/grid/grid_calculus/MLB_Interface.cpp   |     9 +-
 src/modules/grid/grid_calculus/Makefile.am         |    11 +-
 src/modules/grid/grid_calculus/Makefile.in         |   201 +-
 .../grid/grid_calculus/gradient_cartes_polar.cpp   |     2 +-
 .../grid/grid_calculus/gradient_cartes_polar.h     |     2 +-
 src/modules/grid/grid_calculus/kff_synth.cpp       |   232 +
 src/modules/grid/grid_calculus/kff_synth.h         |   102 +
 src/modules/grid/grid_calculus_bsl/Makefile.in     |   114 +-
 src/modules/grid/grid_filter/FilterClumps.cpp      |     4 +-
 src/modules/grid/grid_filter/FilterClumps.h        |     4 +-
 src/modules/grid/grid_filter/Filter_Gauss.cpp      |     3 +-
 src/modules/grid/grid_filter/Filter_Rank.cpp       |     4 +-
 src/modules/grid/grid_filter/Filter_Sieve.cpp      |   278 +
 src/modules/grid/grid_filter/Filter_Sieve.h        |   120 +
 src/modules/grid/grid_filter/MLB_Interface.cpp     |    17 +-
 src/modules/grid/grid_filter/Makefile.am           |    19 +-
 src/modules/grid/grid_filter/Makefile.in           |   218 +-
 .../grid/grid_filter/bin_erosion_reconst.cpp       |   232 +
 src/modules/grid/grid_filter/bin_erosion_reconst.h |   108 +
 src/modules/grid/grid_filter/connect_analysis.cpp  |   413 +
 src/modules/grid/grid_filter/connect_analysis.h    |   102 +
 .../grid_filter/geodesic_morph_rec/bin_geovinc.c   |   234 +
 .../grid_filter/geodesic_morph_rec/bin_geovinc.h   |    90 +
 .../grid_filter/geodesic_morph_rec/combcontour.c   |   866 ++
 .../grid_filter/geodesic_morph_rec/combcontour.h   |   155 +
 .../grid/grid_filter/geodesic_morph_rec/errfunc.c  |   773 +
 .../grid/grid_filter/geodesic_morph_rec/errfunc.h  |   211 +
 .../grid/grid_filter/geodesic_morph_rec/geovinc.c  |   609 +
 .../grid/grid_filter/geodesic_morph_rec/geovinc.h  |    54 +
 .../grid_filter/geodesic_morph_rec/listfuncs.inc   |   920 ++
 .../grid/grid_filter/geodesic_morph_rec/rho.h      |    72 +
 .../grid/grid_filter/geodesic_morph_rec/spezfunc.c |  1228 ++
 .../grid/grid_filter/geodesic_morph_rec/spezfunc.h |   355 +
 .../grid/grid_filter/geodesic_morph_rec/storeorg.c |  2135 +++
 .../grid/grid_filter/geodesic_morph_rec/storeorg.h |   470 +
 src/modules/grid/grid_filter/geomrec.cpp           |   203 +
 src/modules/grid/grid_filter/geomrec.h             |   108 +
 .../Interpolation_NaturalNeighbour.cpp             |     8 +-
 src/modules/grid/grid_gridding/Makefile.in         |   114 +-
 .../grid/grid_spline/Gridding_Spline_CSA.cpp       |     4 +-
 src/modules/grid/grid_spline/Makefile.in           |   114 +-
 src/modules/grid/grid_tools/Grid_Buffer.cpp        |     4 +-
 src/modules/grid/grid_tools/Grid_Buffer.h          |     4 +-
 src/modules/grid/grid_tools/Grid_CombineGrids.cpp  |     4 +-
 src/modules/grid/grid_tools/Grid_CombineGrids.h    |     4 +-
 src/modules/grid/grid_tools/Grid_ConstantGrid.cpp  |     4 +-
 src/modules/grid/grid_tools/Grid_ConstantGrid.h    |     4 +-
 src/modules/grid/grid_tools/Grid_CropToData.cpp    |     4 +-
 src/modules/grid/grid_tools/Grid_CropToData.h      |     4 +-
 src/modules/grid/grid_tools/Grid_Cut.cpp           |   172 +-
 src/modules/grid/grid_tools/Grid_Cut.h             |     4 +-
 src/modules/grid/grid_tools/Grid_InvertNoData.cpp  |     4 +-
 src/modules/grid/grid_tools/Grid_InvertNoData.h    |     4 +-
 src/modules/grid/grid_tools/Grid_Merge.cpp         |    79 +-
 src/modules/grid/grid_tools/Grid_Merge.h           |     6 +-
 src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp |   396 +-
 src/modules/grid/grid_tools/Grid_Shrink_Expand.h   |    40 +-
 src/modules/grid/grid_tools/Grid_SortRaster.cpp    |     8 +-
 src/modules/grid/grid_tools/Grid_SortRaster.h      |     4 +-
 .../grid/grid_tools/Grid_ThresholdBuffer.cpp       |     4 +-
 src/modules/grid/grid_tools/Grid_ThresholdBuffer.h |     4 +-
 .../grid/grid_tools/Grid_Value_Reclassify.cpp      |    61 +-
 .../grid_tools/Grid_Value_Replace_Interactive.cpp  |     4 +-
 .../grid_tools/Grid_Value_Replace_Interactive.h    |     4 +-
 .../grid/grid_tools/GridsFromTableAndGrid.cpp      |     6 +-
 .../grid/grid_tools/GridsFromTableAndGrid.h        |     4 +-
 src/modules/grid/grid_tools/Makefile.in            |   114 +-
 .../grid_visualisation/Grid_Aspect_Slope_Map.cpp   |     4 +-
 .../grid/grid_visualisation/Grid_Color_Blend.cpp   |   220 +-
 .../grid/grid_visualisation/Grid_Color_Blend.h     |    38 +-
 .../grid_visualisation/Grid_Color_Triangle.cpp     |     8 +-
 .../grid/grid_visualisation/Grid_RGB_Composite.cpp |     8 +-
 src/modules/grid/grid_visualisation/Makefile.in    |   114 +-
 src/modules/imagery/Makefile.am                    |     1 +
 src/modules/imagery/Makefile.in                    |   634 +
 .../imagery_classification/MLB_Interface.cpp       |     0
 .../imagery_classification/MLB_Interface.h         |     0
 .../imagery}/imagery_classification/Makefile.am    |     0
 .../imagery/imagery_classification/Makefile.in     |   643 +
 .../imagery_classification/change_detection.cpp    |   500 +
 .../imagery_classification/change_detection.h      |     0
 .../classify_cluster_analysis.cpp                  |   847 +
 .../classify_cluster_analysis.h                    |     0
 .../imagery_classification/classify_supervised.cpp |     0
 .../imagery_classification/classify_supervised.h   |     0
 .../classify_supervised_polygons.cpp               |   431 +
 .../classify_supervised_polygons.h                 |   117 +
 .../imagery_classification/decision_tree.cpp       |     0
 .../imagery_classification/decision_tree.h         |     0
 .../imagery/imagery_opencv}/MLB_Interface.cpp      |     0
 .../imagery/imagery_opencv}/MLB_Interface.h        |     0
 src/modules/imagery/imagery_opencv/Makefile.am     |    31 +
 src/modules/imagery/imagery_opencv/Makefile.in     |   649 +
 .../imagery/imagery_opencv}/opencv.cpp             |     0
 .../imagery/imagery_opencv}/opencv.h               |     0
 .../imagery/imagery_opencv}/opencv_fourier.cpp     |     0
 .../imagery/imagery_opencv}/opencv_fourier.h       |     0
 .../imagery/imagery_opencv}/opencv_morphology.cpp  |     0
 .../imagery/imagery_opencv}/opencv_morphology.h    |     0
 .../imagery/imagery_opencv}/opencv_nnet.cpp        |     0
 .../imagery/imagery_opencv}/opencv_nnet.h          |     0
 .../imagery/imagery_opencv}/opencv_svd.cpp         |     0
 .../imagery/imagery_opencv}/opencv_svd.h           |     0
 .../imagery_photogrammetry/.deps/Colorisation.Plo  |     1 +
 .../imagery_photogrammetry/.deps/MLB_Interface.Plo |     1 +
 .../imagery_photogrammetry/.deps/Resection.Plo     |     1 +
 .../imagery_photogrammetry/.deps/methods.Plo       |     1 +
 .../imagery_photogrammetry/Colorisation.cpp        |   322 +
 .../imagery/imagery_photogrammetry/Colorisation.h  |    92 +
 .../imagery_photogrammetry/MLB_Interface.cpp       |   124 +
 .../imagery/imagery_photogrammetry/MLB_Interface.h |    68 +
 .../imagery/imagery_photogrammetry/Makefile.am     |    23 +
 .../imagery/imagery_photogrammetry/Makefile.in     |   635 +
 .../imagery/imagery_photogrammetry/Resection.cpp   |   564 +
 .../imagery/imagery_photogrammetry/Resection.h     |    91 +
 .../imagery/imagery_photogrammetry/methods.cpp     |   148 +
 .../imagery/imagery_photogrammetry/methods.h       |    93 +
 .../imagery}/imagery_rga/MLB_Interface.cpp         |     0
 .../imagery}/imagery_rga/MLB_Interface.h           |     0
 .../imagery}/imagery_rga/Makefile.am               |     0
 src/modules/imagery/imagery_rga/Makefile.in        |   631 +
 .../imagery}/imagery_rga/fast_region_growing.cpp   |     0
 .../imagery}/imagery_rga/fast_region_growing.h     |     0
 .../imagery_segmentation/MLB_Interface.cpp         |     0
 .../imagery}/imagery_segmentation/MLB_Interface.h  |     0
 .../imagery}/imagery_segmentation/Makefile.am      |     0
 .../imagery/imagery_segmentation/Makefile.in       |   642 +
 .../imagery}/imagery_segmentation/grid_seeds.cpp   |     0
 .../imagery}/imagery_segmentation/grid_seeds.h     |     0
 .../imagery/imagery_segmentation/rga_basic.cpp     |   665 +
 .../imagery}/imagery_segmentation/rga_basic.h      |     0
 .../imagery_segmentation/skeletonization.cpp       |   950 ++
 .../imagery_segmentation/skeletonization.h         |     0
 .../watershed_segmentation.cpp                     |   515 +
 .../imagery_segmentation/watershed_segmentation.h  |     0
 .../imagery}/imagery_svm/MLB_Interface.cpp         |     0
 .../imagery}/imagery_svm/MLB_Interface.h           |     0
 .../imagery}/imagery_svm/Makefile.am               |     0
 src/modules/imagery/imagery_svm/Makefile.in        |   630 +
 .../imagery}/imagery_svm/svm.cpp                   |     0
 .../imagery}/imagery_svm/svm.h                     |     0
 .../imagery}/imagery_svm/svm_grids.cpp             |     0
 .../imagery}/imagery_svm/svm_grids.h               |     0
 .../imagery/imagery_tools/Image_VI_Distance.cpp    |   284 +
 .../imagery/imagery_tools/Image_VI_Distance.h      |    87 +
 .../imagery/imagery_tools/Image_VI_Slope.cpp       |   329 +
 src/modules/imagery/imagery_tools/Image_VI_Slope.h |    89 +
 .../imagery/imagery_tools/MLB_Interface.cpp        |   142 +
 src/modules/imagery/imagery_tools/MLB_Interface.h  |    68 +
 .../imagery}/imagery_tools/Makefile.am             |     0
 src/modules/imagery/imagery_tools/Makefile.in      |   651 +
 src/modules/imagery/imagery_tools/evi.cpp          |   200 +
 src/modules/imagery/imagery_tools/evi.h            |   108 +
 src/modules/imagery/imagery_tools/landsat_acca.cpp |   889 ++
 src/modules/imagery/imagery_tools/landsat_acca.h   |   110 +
 src/modules/imagery/imagery_tools/landsat_toar.cpp |   786 +
 src/modules/imagery/imagery_tools/landsat_toar.h   |   114 +
 .../imagery}/imagery_tools/landsat_toar_core.cpp   |     0
 .../imagery}/imagery_tools/landsat_toar_core.h     |     0
 .../imagery/imagery_tools/pansharpening.cpp        |   811 +
 src/modules/imagery/imagery_tools/pansharpening.h  |   155 +
 src/modules/imagery/imagery_tools/tasseled_cap.cpp |   227 +
 src/modules/imagery/imagery_tools/tasseled_cap.h   |   108 +
 .../imagery/imagery_vigra}/MLB_Interface.cpp       |     0
 .../imagery/imagery_vigra}/MLB_Interface.h         |     0
 src/modules/imagery/imagery_vigra/Makefile.am      |    37 +
 src/modules/imagery/imagery_vigra/Makefile.in      |   663 +
 .../imagery/imagery_vigra}/vigra.cpp               |     0
 .../imagery/imagery_vigra}/vigra.h                 |     0
 .../imagery/imagery_vigra}/vigra_distance.cpp      |     0
 .../imagery/imagery_vigra}/vigra_distance.h        |     0
 .../imagery/imagery_vigra}/vigra_edges.cpp         |     0
 .../imagery/imagery_vigra}/vigra_edges.h           |     0
 .../imagery/imagery_vigra}/vigra_fft.cpp           |     0
 .../imagery/imagery_vigra}/vigra_fft.h             |     0
 .../imagery/imagery_vigra/vigra_morphology.cpp     |   203 +
 .../imagery/imagery_vigra}/vigra_morphology.h      |     0
 .../imagery/imagery_vigra/vigra_random_forest.cpp  |   683 +
 .../imagery/imagery_vigra/vigra_random_forest.h    |   121 +
 .../imagery/imagery_vigra}/vigra_smoothing.cpp     |     0
 .../imagery/imagery_vigra}/vigra_smoothing.h       |     0
 .../imagery/imagery_vigra}/vigra_watershed.cpp     |     0
 .../imagery/imagery_vigra}/vigra_watershed.h       |     0
 src/modules/io/Makefile.am                         |     5 +
 src/modules/io/Makefile.in                         |   637 +
 .../io}/io_esri_e00/ESRI_E00_Import.cpp            |     0
 .../io}/io_esri_e00/ESRI_E00_Import.h              |     0
 .../io}/io_esri_e00/MLB_Interface.cpp              |     0
 .../io}/io_esri_e00/MLB_Interface.h                |     0
 .../io}/io_esri_e00/Makefile.am                    |     0
 src/modules/io/io_esri_e00/Makefile.in             |   704 +
 .../io}/io_esri_e00/e00compr/cpl_conv.c            |     0
 .../io}/io_esri_e00/e00compr/cpl_conv.h            |     0
 .../io}/io_esri_e00/e00compr/cpl_error.c           |     0
 .../io}/io_esri_e00/e00compr/cpl_error.h           |     0
 .../io}/io_esri_e00/e00compr/cpl_port.h            |     0
 .../io}/io_esri_e00/e00compr/cpl_vsi.h             |     0
 .../io}/io_esri_e00/e00compr/cpl_vsisimple.c       |     0
 .../io}/io_esri_e00/e00compr/e00compr.h            |     0
 .../io}/io_esri_e00/e00compr/e00read.c             |     0
 .../io}/io_esri_e00/e00compr/e00write.c            |     0
 .../gdal => modules/io}/io_gdal/MLB_Interface.cpp  |     0
 .../gdal => modules/io}/io_gdal/MLB_Interface.h    |     0
 .../gdal => modules/io}/io_gdal/Makefile.am        |     0
 src/modules/io/io_gdal/Makefile.in                 |   659 +
 .../gdal => modules/io}/io_gdal/gdal_driver.cpp    |     0
 .../gdal => modules/io}/io_gdal/gdal_driver.h      |     0
 .../gdal => modules/io}/io_gdal/gdal_export.cpp    |     0
 .../gdal => modules/io}/io_gdal/gdal_export.h      |     0
 .../io}/io_gdal/gdal_export_geotiff.cpp            |     0
 .../io}/io_gdal/gdal_export_geotiff.h              |     0
 .../gdal => modules/io}/io_gdal/gdal_import.cpp    |     0
 .../gdal => modules/io}/io_gdal/gdal_import.h      |     0
 .../io}/io_gdal/gdal_import_netcdf.cpp             |     0
 .../io}/io_gdal/gdal_import_netcdf.h               |     0
 src/modules/io/io_gdal/ogr_driver.cpp              |   863 ++
 src/modules/io/io_gdal/ogr_driver.h                |   203 +
 .../gdal => modules/io}/io_gdal/ogr_export.cpp     |     0
 .../gdal => modules/io}/io_gdal/ogr_export.h       |     0
 .../gdal => modules/io}/io_gdal/ogr_export_kml.cpp |     0
 .../gdal => modules/io}/io_gdal/ogr_export_kml.h   |     0
 .../gdal => modules/io}/io_gdal/ogr_import.cpp     |     0
 .../gdal => modules/io}/io_gdal/ogr_import.h       |     0
 src/modules/io/io_gps/GPSBabel.cpp                 |   163 +
 src/modules/io/io_gps/GPSBabel.h                   |    39 +
 .../gps => modules/io}/io_gps/MLB_Interface.cpp    |     0
 .../gps => modules/io}/io_gps/MLB_Interface.h      |     0
 .../gps => modules/io}/io_gps/Makefile.am          |     0
 src/modules/io/io_gps/Makefile.in                  |   634 +
 src/modules/io/io_gps/gpx2shp.cpp                  |   145 +
 src/modules/io/io_gps/gpx2shp.h                    |    39 +
 .../grid => modules/io}/io_grid/MLB_Interface.cpp  |     0
 .../grid => modules/io}/io_grid/MLB_Interface.h    |     0
 .../grid => modules/io}/io_grid/Makefile.am        |     0
 src/modules/io/io_grid/Makefile.in                 |   663 +
 .../grid => modules/io}/io_grid/bmp_export.cpp     |     0
 .../grid => modules/io}/io_grid/bmp_export.h       |     0
 .../grid => modules/io}/io_grid/erdas_lan.cpp      |     0
 .../grid => modules/io}/io_grid/erdas_lan.h        |     0
 .../grid => modules/io}/io_grid/esri_arcinfo.cpp   |     0
 .../grid => modules/io}/io_grid/esri_arcinfo.h     |     0
 .../grid => modules/io}/io_grid/grid_table.cpp     |     0
 .../grid => modules/io}/io_grid/grid_table.h       |     0
 .../grid => modules/io}/io_grid/mola.cpp           |     0
 src/{modules_io/grid => modules/io}/io_grid/mola.h |     0
 .../grid => modules/io}/io_grid/raw.cpp            |     0
 src/{modules_io/grid => modules/io}/io_grid/raw.h  |     0
 .../grid => modules/io}/io_grid/srtm30.cpp         |     0
 .../grid => modules/io}/io_grid/srtm30.h           |     0
 .../grid => modules/io}/io_grid/surfer.cpp         |     0
 .../grid => modules/io}/io_grid/surfer.h           |     0
 .../grid => modules/io}/io_grid/usgs_srtm.cpp      |     0
 .../grid => modules/io}/io_grid/usgs_srtm.h        |     0
 .../grid => modules/io}/io_grid/wrf.cpp            |     0
 src/{modules_io/grid => modules/io}/io_grid/wrf.h  |     0
 src/modules/io/io_grid/xyz.cpp                     |   391 +
 src/modules/io/io_grid/xyz.h                       |   138 +
 .../io}/io_grid_grib2/MLB_Interface.cpp            |     0
 .../io}/io_grid_grib2/MLB_Interface.h              |     0
 .../grid => modules/io}/io_grid_grib2/Makefile.am  |     0
 src/modules/io/io_grid_grib2/Makefile.in           |  1063 ++
 .../io/io_grid_grib2/g2clib-1.0.4/cmplxpack.c      |    78 +
 .../io/io_grid_grib2/g2clib-1.0.4/compack.c        |   419 +
 .../io/io_grid_grib2/g2clib-1.0.4/comunpack.c      |   333 +
 .../io/io_grid_grib2/g2clib-1.0.4/dec_jpeg2000.c   |   147 +
 .../io/io_grid_grib2/g2clib-1.0.4/dec_png.c        |   144 +
 .../io/io_grid_grib2/g2clib-1.0.4/drstemplates.c   |   157 +
 .../io/io_grid_grib2/g2clib-1.0.4/drstemplates.h   |    72 +
 .../io/io_grid_grib2/g2clib-1.0.4/enc_jpeg2000.c   |   190 +
 .../io/io_grid_grib2/g2clib-1.0.4/enc_png.c        |   138 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_addfield.c    |   513 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_addgrid.c     |   246 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_addlocal.c    |   150 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_create.c      |   130 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_free.c        |    47 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_getfld.c      |   553 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_gribend.c     |   125 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_info.c        |   193 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_miss.c        |    72 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack1.c     |   102 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack2.c     |    82 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack3.c     |   216 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack4.c     |   187 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack5.c     |   154 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack6.c     |   100 +
 .../io/io_grid_grib2/g2clib-1.0.4/g2_unpack7.c     |   154 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/gbits.c  |   127 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/getdim.c |   130 +
 .../io/io_grid_grib2/g2clib-1.0.4/getpoly.c        |    83 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/grib2.h  |   254 +
 .../io/io_grid_grib2/g2clib-1.0.4/gridtemplates.c  |   176 +
 .../io/io_grid_grib2/g2clib-1.0.4/gridtemplates.h  |    99 +
 .../io/io_grid_grib2/g2clib-1.0.4/int_power.c      |    33 +
 .../io/io_grid_grib2/g2clib-1.0.4/jpcpack.c        |   178 +
 .../io/io_grid_grib2/g2clib-1.0.4/jpcunpack.c      |    75 +
 .../io/io_grid_grib2/g2clib-1.0.4/misspack.c       |   535 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/mkieee.c |   126 +
 .../io/io_grid_grib2/g2clib-1.0.4/pack_gp.c        |  1450 ++
 .../io/io_grid_grib2/g2clib-1.0.4/pdstemplates.c   |   271 +
 .../io/io_grid_grib2/g2clib-1.0.4/pdstemplates.h   |   121 +
 .../io/io_grid_grib2/g2clib-1.0.4/pngpack.c        |   165 +
 .../io/io_grid_grib2/g2clib-1.0.4/pngunpack.c      |    79 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/rdieee.c |    81 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/reduce.c |   413 +
 src/modules/io/io_grid_grib2/g2clib-1.0.4/seekgb.c |    83 +
 .../io/io_grid_grib2/g2clib-1.0.4/simpack.c        |   184 +
 .../io/io_grid_grib2/g2clib-1.0.4/simunpack.c      |    79 +
 .../io/io_grid_grib2/g2clib-1.0.4/specpack.c       |   131 +
 .../io/io_grid_grib2/g2clib-1.0.4/specunpack.c     |   118 +
 .../io}/io_grid_grib2/grib2_import.cpp             |     0
 .../io}/io_grid_grib2/grib2_import.h               |     0
 src/modules/io/io_grid_image/MLB_Interface.cpp     |   129 +
 src/modules/io/io_grid_image/MLB_Interface.h       |    85 +
 src/modules/io/io_grid_image/Makefile.am           |    27 +
 src/modules/io/io_grid_image/Makefile.in           |   637 +
 src/modules/io/io_grid_image/grid_export.cpp       |   562 +
 src/modules/io/io_grid_image/grid_export.h         |   113 +
 src/modules/io/io_grid_image/grid_import.cpp       |   433 +
 src/modules/io/io_grid_image/grid_import.h         |   113 +
 src/modules/io/io_grid_image/grid_to_kml.cpp       |   342 +
 src/modules/io/io_grid_image/grid_to_kml.h         |   111 +
 .../io}/io_shapes/MLB_Interface.cpp                |     0
 .../io}/io_shapes/MLB_Interface.h                  |     0
 .../shapes => modules/io}/io_shapes/Makefile.am    |     0
 src/modules/io/io_shapes/Makefile.in               |   674 +
 .../shapes => modules/io}/io_shapes/atlas_bna.cpp  |     0
 .../shapes => modules/io}/io_shapes/atlas_bna.h    |     0
 .../shapes => modules/io}/io_shapes/generate.cpp   |     0
 .../shapes => modules/io}/io_shapes/generate.h     |     0
 .../shapes => modules/io}/io_shapes/gpx.cpp        |     0
 .../shapes => modules/io}/io_shapes/gpx.h          |     0
 .../shapes => modules/io}/io_shapes/gstat.cpp      |     0
 .../shapes => modules/io}/io_shapes/gstat.h        |     0
 .../io}/io_shapes/pointcloud_from_file.cpp         |     0
 .../io}/io_shapes/pointcloud_from_file.h           |     0
 .../io}/io_shapes/pointcloud_from_text_file.cpp    |     0
 .../io}/io_shapes/pointcloud_from_text_file.h      |     0
 .../io}/io_shapes/pointcloud_to_text_file.cpp      |     0
 .../io}/io_shapes/pointcloud_to_text_file.h        |     0
 .../shapes => modules/io}/io_shapes/stl.cpp        |     0
 .../shapes => modules/io}/io_shapes/stl.h          |     0
 .../shapes => modules/io}/io_shapes/surfer_bln.cpp |     0
 .../shapes => modules/io}/io_shapes/surfer_bln.h   |     0
 .../shapes => modules/io}/io_shapes/svg.cpp        |     0
 .../shapes => modules/io}/io_shapes/svg.h          |     0
 .../shapes => modules/io}/io_shapes/wasp_map.cpp   |     0
 .../shapes => modules/io}/io_shapes/wasp_map.h     |     0
 .../shapes => modules/io}/io_shapes/wktb.cpp       |     0
 .../shapes => modules/io}/io_shapes/wktb.h         |     0
 .../shapes => modules/io}/io_shapes/xyz.cpp        |     0
 .../shapes => modules/io}/io_shapes/xyz.h          |     0
 .../io}/io_shapes_dxf/MLB_Interface.cpp            |     0
 .../io}/io_shapes_dxf/MLB_Interface.h              |     0
 .../io}/io_shapes_dxf/Makefile.am                  |     0
 src/modules/io/io_shapes_dxf/Makefile.in           |   660 +
 .../io}/io_shapes_dxf/dxf_import.cpp               |     0
 .../io}/io_shapes_dxf/dxf_import.h                 |     0
 .../io}/io_shapes_dxf/dxflib/dl_attributes.h       |     0
 .../io}/io_shapes_dxf/dxflib/dl_codes.h            |     0
 .../io}/io_shapes_dxf/dxflib/dl_creationadapter.h  |     0
 .../io_shapes_dxf/dxflib/dl_creationinterface.h    |     0
 .../io}/io_shapes_dxf/dxflib/dl_dxf.cpp            |     0
 .../io}/io_shapes_dxf/dxflib/dl_dxf.h              |     0
 .../io}/io_shapes_dxf/dxflib/dl_entities.h         |     0
 .../io}/io_shapes_dxf/dxflib/dl_exception.h        |     0
 .../io}/io_shapes_dxf/dxflib/dl_extrusion.h        |     0
 .../io}/io_shapes_dxf/dxflib/dl_writer.h           |     0
 .../io}/io_shapes_dxf/dxflib/dl_writer_ascii.cpp   |     0
 .../io}/io_shapes_dxf/dxflib/dl_writer_ascii.h     |     0
 .../io}/io_shapes_las/MLB_Interface.cpp            |     0
 .../io}/io_shapes_las/MLB_Interface.h              |     0
 .../io}/io_shapes_las/Makefile.am                  |     0
 src/modules/io/io_shapes_las/Makefile.in           |   642 +
 .../io}/io_shapes_las/las_export.cpp               |     0
 .../io}/io_shapes_las/las_export.h                 |     0
 .../io}/io_shapes_las/las_import.cpp               |     0
 .../io}/io_shapes_las/las_import.h                 |     0
 .../io}/io_shapes_las/las_info.cpp                 |     0
 .../shapes => modules/io}/io_shapes_las/las_info.h |     0
 .../io}/io_table/MLB_Interface.cpp                 |     0
 .../table => modules/io}/io_table/MLB_Interface.h  |     0
 .../table => modules/io}/io_table/Makefile.am      |     0
 src/modules/io/io_table/Makefile.in                |   631 +
 .../table => modules/io}/io_table/io_table_txt.cpp |     0
 .../table => modules/io}/io_table/io_table_txt.h   |     0
 src/modules/io/io_virtual/MLB_Interface.cpp        |   128 +
 src/modules/io/io_virtual/MLB_Interface.h          |    85 +
 src/modules/io/io_virtual/Makefile.am              |    31 +
 src/modules/io/io_virtual/Makefile.in              |   643 +
 src/modules/io/io_virtual/pc_create_spcvf.cpp      |   330 +
 src/modules/io/io_virtual/pc_create_spcvf.h        |   111 +
 src/modules/io/io_virtual/pc_get_subset_spcvf.cpp  |   385 +
 src/modules/io/io_virtual/pc_get_subset_spcvf.h    |   113 +
 .../io/io_virtual/pc_tileshape_from_spcvf.cpp      |   225 +
 .../io/io_virtual/pc_tileshape_from_spcvf.h        |   111 +
 src/modules/pointcloud/Makefile.in                 |   113 +-
 .../pointcloud/pointcloud_tools/Makefile.in        |   114 +-
 .../pointcloud_tools/pc_attribute_calculator.cpp   |    16 +-
 src/modules/pointcloud/pointcloud_tools/pc_cut.cpp |    20 +-
 .../pointcloud/pointcloud_viewer/Makefile.in       |   114 +-
 .../pointcloud_viewer/points_view_control.cpp      |    17 +-
 .../pointcloud_viewer/points_view_dialog.cpp       |     4 +-
 src/modules/projection/Makefile.am                 |     1 +
 src/modules/projection/Makefile.in                 |   634 +
 .../projection}/pj_georeference/Collect_Points.cpp |     0
 .../projection}/pj_georeference/Collect_Points.h   |     0
 .../projection}/pj_georeference/Georef_Engine.cpp  |     0
 .../projection}/pj_georeference/Georef_Engine.h    |     0
 .../projection}/pj_georeference/Georef_Grid.cpp    |     0
 .../projection}/pj_georeference/Georef_Grid.h      |     0
 .../projection}/pj_georeference/Georef_Shapes.cpp  |     0
 .../projection}/pj_georeference/Georef_Shapes.h    |     0
 .../projection}/pj_georeference/MLB_Interface.cpp  |     0
 .../projection}/pj_georeference/MLB_Interface.h    |     0
 .../projection}/pj_georeference/Makefile.am        |     0
 src/modules/projection/pj_georeference/Makefile.in |   652 +
 .../pj_georeference/direct_georeferencing.cpp      |     0
 .../pj_georeference/direct_georeferencing.h        |     0
 .../pj_georeference/georef_grid_move.cpp           |     0
 .../projection}/pj_georeference/georef_grid_move.h |     0
 .../pj_georeference/set_grid_georeference.cpp      |     0
 .../pj_georeference/set_grid_georeference.h        |     0
 src/modules/projection/pj_proj4/MLB_Interface.cpp  |   158 +
 .../projection}/pj_proj4/MLB_Interface.h           |     0
 src/modules/projection/pj_proj4/Makefile.am        |    42 +
 src/modules/projection/pj_proj4/Makefile.in        |   665 +
 .../projection}/pj_proj4/PROJ4_Base.cpp            |     0
 .../projection}/pj_proj4/PROJ4_Base.h              |     0
 .../projection}/pj_proj4/PROJ4_Grid.cpp            |     0
 .../projection}/pj_proj4/PROJ4_Grid.h              |     0
 .../projection}/pj_proj4/PROJ4_Shapes.cpp          |     0
 .../projection}/pj_proj4/PROJ4_Shapes.h            |     0
 src/modules/projection/pj_proj4/crs_assign.cpp     |   178 +
 .../projection}/pj_proj4/crs_assign.h              |     0
 src/modules/projection/pj_proj4/crs_base.cpp       |  1100 ++
 src/modules/projection/pj_proj4/crs_base.h         |   160 +
 src/modules/projection/pj_proj4/crs_indicatrix.cpp |   295 +
 src/modules/projection/pj_proj4/crs_indicatrix.h   |   109 +
 src/modules/projection/pj_proj4/crs_transform.cpp  |   302 +
 src/modules/projection/pj_proj4/crs_transform.h    |   126 +
 .../projection/pj_proj4/crs_transform_grid.cpp     |   807 +
 .../projection/pj_proj4/crs_transform_grid.h       |   125 +
 .../projection/pj_proj4/crs_transform_shapes.cpp   |   254 +
 .../projection/pj_proj4/crs_transform_shapes.h     |   103 +
 src/modules/projection/pj_proj4/gcs_graticule.cpp  |   592 +
 src/modules/projection/pj_proj4/gcs_graticule.h    |   113 +
 .../projection}/pj_proj4/gcs_lon_range.cpp         |     0
 .../projection}/pj_proj4/gcs_lon_range.h           |     0
 src/modules/shapes/Makefile.in                     |   113 +-
 .../shapes/shapes_grid/Grid_Classes_To_Shapes.cpp  |     4 +-
 src/modules/shapes/shapes_grid/Makefile.in         |   114 +-
 src/modules/shapes/shapes_lines/MLB_Interface.cpp  |     9 +-
 src/modules/shapes/shapes_lines/Makefile.am        |     2 +
 src/modules/shapes/shapes_lines/Makefile.in        |   120 +-
 .../shapes/shapes_lines/line_split_with_lines.cpp  |   235 +
 .../shapes/shapes_lines/line_split_with_lines.h    |   108 +
 .../shapes/shapes_points/AddCoordinates.cpp        |     4 +-
 src/modules/shapes/shapes_points/AddCoordinates.h  |     4 +-
 src/modules/shapes/shapes_points/CountPoints.cpp   |     4 +-
 src/modules/shapes/shapes_points/CountPoints.h     |     4 +-
 .../shapes/shapes_points/CreatePointGrid.cpp       |     4 +-
 src/modules/shapes/shapes_points/CreatePointGrid.h |     4 +-
 .../shapes/shapes_points/DistanceMatrix.cpp        |   276 +-
 src/modules/shapes/shapes_points/DistanceMatrix.h  |    43 +-
 .../shapes/shapes_points/FitNPointsToShape.cpp     |     4 +-
 .../shapes/shapes_points/FitNPointsToShape.h       |     4 +-
 src/modules/shapes/shapes_points/Makefile.in       |   114 +-
 .../shapes/shapes_points/Points_From_Lines.cpp     |     4 +-
 .../shapes/shapes_points/Points_From_Lines.h       |     4 +-
 .../shapes/shapes_points/Points_From_Table.cpp     |     4 +-
 .../shapes/shapes_points/Points_From_Table.h       |     4 +-
 .../shapes_points/add_polygon_attributes.cpp       |    27 +-
 src/modules/shapes/shapes_points/convex_hull.cpp   |    34 +-
 src/modules/shapes/shapes_points/convex_hull.h     |     2 +-
 .../shapes/shapes_polygons/MLB_Interface.cpp       |    11 +-
 src/modules/shapes/shapes_polygons/Makefile.am     |     6 +-
 src/modules/shapes/shapes_polygons/Makefile.in     |   127 +-
 .../shapes/shapes_polygons/Polygon_Geometrics.cpp  |     4 +-
 .../shapes/shapes_polygons/Polygon_Geometrics.h    |     4 +-
 .../Polygon_StatisticsFromPoints.cpp               |     4 +-
 .../shapes_polygons/Polygon_StatisticsFromPoints.h |     4 +-
 .../shapes/shapes_polygons/Polygon_Union.cpp       |    31 +-
 src/modules/shapes/shapes_polygons/Polygon_Union.h |     6 +-
 .../shapes_polygons/add_point_attributes.cpp       |   265 +
 .../shapes/shapes_polygons/add_point_attributes.h  |    95 +
 .../shapes/shapes_polygons/polygon_flatten.cpp     |   229 +
 .../shapes/shapes_polygons/polygon_flatten.h       |   108 +
 src/modules/shapes/shapes_polygons/shape_index.cpp |    24 +-
 .../shapes/shapes_tools/CreateChartLayer.cpp       |     4 +-
 src/modules/shapes/shapes_tools/CreateChartLayer.h |     4 +-
 .../shapes/shapes_tools/GraticuleBuilder.cpp       |     4 +-
 src/modules/shapes/shapes_tools/GraticuleBuilder.h |     4 +-
 src/modules/shapes/shapes_tools/MLB_Interface.cpp  |     3 +-
 src/modules/shapes/shapes_tools/Makefile.in        |   114 +-
 .../shapes_tools/NewLayerFromSelectedShapes.cpp    |     4 +-
 .../shapes_tools/NewLayerFromSelectedShapes.h      |     4 +-
 src/modules/shapes/shapes_tools/QueryBuilder.cpp   |     4 +-
 src/modules/shapes/shapes_tools/QueryBuilder.h     |     4 +-
 src/modules/shapes/shapes_tools/SearchInTable.cpp  |     4 +-
 src/modules/shapes/shapes_tools/SearchInTable.h    |     4 +-
 src/modules/shapes/shapes_tools/SelectByTheme.cpp  |     4 +-
 src/modules/shapes/shapes_tools/SelectByTheme.h    |     4 +-
 src/modules/shapes/shapes_tools/SeparateShapes.cpp |     4 +-
 src/modules/shapes/shapes_tools/SeparateShapes.h   |     4 +-
 src/modules/shapes/shapes_tools/Shapes_Merge.cpp   |   394 +-
 src/modules/shapes/shapes_tools/Shapes_Merge.h     |    60 +-
 .../shapes/shapes_tools/TransformShapes.cpp        |     4 +-
 src/modules/shapes/shapes_tools/TransformShapes.h  |     4 +-
 .../shapes/shapes_tools/shapes_split_randomly.cpp  |    79 +-
 .../shapes/shapes_tools/shapes_split_randomly.h    |     3 +-
 src/modules/shapes/shapes_transect/Makefile.in     |   114 +-
 src/modules/simulation/Makefile.am                 |     1 +
 src/modules/simulation/Makefile.in                 |   634 +
 .../simulation}/sim_cellular_automata/Life.cpp     |     0
 .../simulation}/sim_cellular_automata/Life.h       |     0
 .../sim_cellular_automata/MLB_Interface.cpp        |     0
 .../sim_cellular_automata/MLB_Interface.h          |     0
 .../simulation}/sim_cellular_automata/Makefile.am  |     0
 .../simulation/sim_cellular_automata/Makefile.in   |   636 +
 .../simulation/sim_cellular_automata/Wator.cpp     |   493 +
 .../simulation/sim_cellular_automata/Wator.h       |   117 +
 .../sim_ecosystems_hugget/Hugget_01.cpp            |     0
 .../simulation}/sim_ecosystems_hugget/Hugget_01.h  |     0
 .../sim_ecosystems_hugget/Hugget_02.cpp            |     0
 .../simulation}/sim_ecosystems_hugget/Hugget_02.h  |     0
 .../sim_ecosystems_hugget/Hugget_03.cpp            |     0
 .../simulation}/sim_ecosystems_hugget/Hugget_03.h  |     0
 .../sim_ecosystems_hugget/MLB_Interface.cpp        |     0
 .../sim_ecosystems_hugget/MLB_Interface.h          |     0
 .../simulation}/sim_ecosystems_hugget/Makefile.am  |     0
 .../simulation/sim_ecosystems_hugget/Makefile.in   |   639 +
 .../simulation}/sim_erosion/MLB_Interface.cpp      |     0
 .../simulation}/sim_erosion/MLB_Interface.h        |     0
 src/modules/simulation/sim_erosion/MMF_SAGA.cpp    |  1180 ++
 .../simulation}/sim_erosion/MMF_SAGA.h             |     0
 .../simulation}/sim_erosion/Makefile.am            |     0
 src/modules/simulation/sim_erosion/Makefile.in     |   631 +
 .../sim_hydrology/DVWK_SoilMoisture.cpp            |     0
 .../simulation}/sim_hydrology/DVWK_SoilMoisture.h  |     0
 src/modules/simulation/sim_hydrology/KinWav_D8.cpp |   550 +
 .../simulation}/sim_hydrology/KinWav_D8.h          |     0
 .../simulation}/sim_hydrology/MLB_Interface.cpp    |     0
 .../simulation}/sim_hydrology/MLB_Interface.h      |     0
 .../simulation}/sim_hydrology/Makefile.am          |     0
 src/modules/simulation/sim_hydrology/Makefile.in   |   648 +
 .../sim_hydrology/WaterRetentionCapacity.cpp       |   269 +
 .../sim_hydrology/WaterRetentionCapacity.h         |    52 +
 src/modules/simulation/sim_hydrology/idw.cpp       |    97 +
 src/modules/simulation/sim_hydrology/idw.h         |    46 +
 src/modules/simulation/sim_hydrology/topmodel.cpp  |   712 +
 .../simulation}/sim_hydrology/topmodel.h           |     0
 .../simulation/sim_hydrology/topmodel_values.cpp   |   345 +
 .../simulation}/sim_hydrology/topmodel_values.h    |     0
 .../simulation/sim_ihacres}/MLB_Interface.cpp      |     0
 src/modules/simulation/sim_ihacres/MLB_Interface.h |    91 +
 src/modules/simulation/sim_ihacres/Makefile.am     |    40 +
 src/modules/simulation/sim_ihacres/Makefile.in     |   661 +
 .../simulation/sim_ihacres}/convert_sl.cpp         |     0
 .../simulation/sim_ihacres}/convert_sl.h           |     0
 .../simulation/sim_ihacres}/ihacres_basin.cpp      |     0
 .../simulation/sim_ihacres}/ihacres_basin.h        |     0
 .../simulation/sim_ihacres/ihacres_cal2.cpp        |  1117 ++
 .../simulation/sim_ihacres}/ihacres_cal2.h         |     0
 .../simulation/sim_ihacres}/ihacres_elev.cpp       |     0
 .../simulation/sim_ihacres}/ihacres_elev.h         |     0
 .../simulation/sim_ihacres}/ihacres_elev_bands.cpp |     0
 .../simulation/sim_ihacres}/ihacres_elev_bands.h   |     0
 .../simulation/sim_ihacres}/ihacres_elev_cal.cpp   |     0
 .../simulation/sim_ihacres}/ihacres_elev_cal.h     |     0
 .../simulation/sim_ihacres}/ihacres_eq.cpp         |     0
 .../simulation/sim_ihacres}/ihacres_eq.h           |     0
 .../simulation/sim_ihacres}/ihacres_v1.cpp         |     0
 .../simulation/sim_ihacres}/ihacres_v1.h           |     0
 .../simulation/sim_ihacres}/model_tools.cpp        |     0
 .../simulation/sim_ihacres}/model_tools.h          |     0
 .../simulation/sim_ihacres}/snow_module.cpp        |     0
 .../simulation/sim_ihacres}/snow_module.h          |     0
 src/modules/statistics/Makefile.am                 |     5 +
 src/modules/statistics/Makefile.in                 |   636 +
 .../GSGrid_Directional_Statistics.cpp              |   367 +
 .../GSGrid_Directional_Statistics.h                |   113 +
 .../statistics_grid/GSGrid_Residuals.cpp           |   238 +
 .../statistics/statistics_grid/GSGrid_Residuals.h  |   115 +
 .../statistics_grid/GSGrid_Statistics.cpp          |   390 +
 .../statistics/statistics_grid/GSGrid_Statistics.h |   127 +
 .../statistics/statistics_grid/GSGrid_Variance.cpp |   347 +
 .../statistics/statistics_grid/GSGrid_Variance.h   |   127 +
 .../statistics_grid/GSGrid_Variance_Radius.cpp     |   343 +
 .../statistics_grid/GSGrid_Variance_Radius.h       |   123 +
 .../statistics_grid/GSGrid_Zonal_Statistics.cpp    |   581 +
 .../statistics_grid/GSGrid_Zonal_Statistics.h      |   178 +
 .../statistics/statistics_grid/MLB_Interface.cpp   |   148 +
 .../statistics/statistics_grid/MLB_Interface.h     |    78 +
 src/modules/statistics/statistics_grid/Makefile.am |    42 +
 src/modules/statistics/statistics_grid/Makefile.in |   666 +
 .../statistics_grid/fast_representativeness.cpp    |   604 +
 .../statistics_grid}/fast_representativeness.h     |     0
 .../statistics_grid/grid_autocorrelation.cpp       |   213 +
 .../statistics_grid/grid_autocorrelation.h         |    91 +
 .../statistics_grid/grid_latlon_statistics.cpp     |   217 +
 .../statistics_grid/grid_latlon_statistics.h       |   116 +
 .../statistics/statistics_grid/grid_pca.cpp        |   605 +
 src/modules/statistics/statistics_grid/grid_pca.h  |   135 +
 .../statistics_grid/multiband_variation.cpp        |   276 +
 .../statistics_grid/multiband_variation.h          |   115 +
 .../statistics_kriging}/MLB_Interface.cpp          |     0
 .../statistics/statistics_kriging/MLB_Interface.h  |    78 +
 .../statistics/statistics_kriging/Makefile.am      |    44 +
 .../statistics/statistics_kriging/Makefile.in      |   670 +
 .../statistics_kriging}/_kriging_base.cpp          |     0
 .../statistics/statistics_kriging/_kriging_base.h  |   142 +
 .../statistics_kriging}/_kriging_ordinary.cpp      |     0
 .../statistics_kriging/_kriging_ordinary.h         |   118 +
 .../_kriging_ordinary_global.cpp                   |     0
 .../statistics_kriging/_kriging_ordinary_global.h  |   113 +
 .../statistics_kriging}/_kriging_universal.cpp     |     0
 .../statistics_kriging/_kriging_universal.h        |   118 +
 .../_kriging_universal_global.cpp                  |     0
 .../statistics_kriging/_kriging_universal_global.h |   118 +
 .../statistics_kriging}/kriging_base.cpp           |     0
 .../statistics/statistics_kriging}/kriging_base.h  |     0
 .../statistics_kriging}/kriging_ordinary.cpp       |     0
 .../statistics_kriging}/kriging_ordinary.h         |     0
 .../kriging_ordinary_global.cpp                    |     0
 .../statistics_kriging}/kriging_ordinary_global.h  |     0
 .../statistics_kriging}/kriging_universal.cpp      |     0
 .../statistics_kriging}/kriging_universal.h        |     0
 .../kriging_universal_global.cpp                   |     0
 .../statistics_kriging}/kriging_universal_global.h |     0
 .../statistics_kriging}/semivariogram.cpp          |     0
 .../statistics/statistics_kriging}/semivariogram.h |     0
 .../statistics_kriging}/variogram_dialog.cpp       |     0
 .../statistics_kriging}/variogram_dialog.h         |     0
 .../statistics_points/GSPoints_Distances.cpp       |   166 +
 .../statistics_points/GSPoints_Distances.h         |   100 +
 .../GSPoints_Pattern_Analysis.cpp                  |   251 +
 .../statistics_points/GSPoints_Pattern_Analysis.h  |   100 +
 .../statistics_points/GSPoints_Semi_Variances.cpp  |   259 +
 .../statistics_points/GSPoints_Semi_Variances.h    |   105 +
 .../statistics_points/GSPoints_Variogram_Cloud.cpp |   223 +
 .../statistics_points/GSPoints_Variogram_Cloud.h   |   103 +
 .../GSPoints_Variogram_Surface.cpp                 |   236 +
 .../statistics_points/GSPoints_Variogram_Surface.h |   103 +
 .../statistics/statistics_points/MLB_Interface.cpp |   133 +
 .../statistics/statistics_points/MLB_Interface.h   |    78 +
 .../statistics/statistics_points/Makefile.am       |    30 +
 .../statistics/statistics_points/Makefile.in       |   647 +
 .../statistics_regression/MLB_Interface.cpp        |   158 +
 .../statistics_regression/MLB_Interface.h          |    78 +
 .../statistics/statistics_regression/Makefile.am   |    46 +
 .../statistics/statistics_regression/Makefile.in   |   675 +
 .../grid_multi_grid_regression.cpp                 |   445 +
 .../grid_multi_grid_regression.h                   |   108 +
 .../statistics_regression/grids_trend_polynom.cpp  |   304 +
 .../statistics_regression/grids_trend_polynom.h    |   105 +
 .../statistics_regression/gw_multi_regression.cpp  |   585 +
 .../statistics_regression/gw_multi_regression.h    |   133 +
 .../gw_multi_regression_grid.cpp                   |   739 +
 .../gw_multi_regression_grid.h                     |   131 +
 .../gw_multi_regression_points.cpp                 |   524 +
 .../gw_multi_regression_points.h                   |   129 +
 .../statistics_regression/gw_regression.cpp        |   417 +
 .../statistics_regression/gw_regression.h          |   127 +
 .../statistics_regression/gw_regression_grid.cpp   |   469 +
 .../statistics_regression/gw_regression_grid.h     |   124 +
 .../statistics_regression/gwr_grid_downscaling.cpp |   561 +
 .../statistics_regression/gwr_grid_downscaling.h   |   117 +
 .../point_grid_regression.cpp                      |   333 +
 .../statistics_regression/point_grid_regression.h  |   110 +
 .../point_multi_grid_regression.cpp                |   607 +
 .../point_multi_grid_regression.h                  |   112 +
 .../statistics_regression/point_trend_surface.cpp  |   485 +
 .../statistics_regression/point_trend_surface.h    |   117 +
 .../table_regression_multiple.cpp                  |   482 +
 .../table_regression_multiple.h                    |   117 +
 .../statistics_regression/table_trend.cpp          |   280 +
 .../statistics/statistics_regression/table_trend.h |   123 +
 src/modules/table/Makefile.in                      |   113 +-
 src/modules/table/table_calculus/Makefile.in       |   114 +-
 .../table/table_calculus/Table_Calculator.cpp      |     4 +-
 .../table/table_calculus/Table_Calculator.h        |     4 +-
 src/modules/table/table_calculus/table_pca.cpp     |     4 +-
 src/modules/table/table_calculus/table_pca.h       |     4 +-
 src/modules/table/table_tools/Makefile.in          |   114 +-
 src/modules/terrain_analysis/Makefile.am           |     1 +
 src/modules/terrain_analysis/Makefile.in           |   634 +
 .../ta_channels/ChannelNetwork.cpp                 |   805 +
 .../terrain_analysis/ta_channels/ChannelNetwork.h  |     0
 .../ta_channels/ChannelNetwork_Altitude.cpp        |   474 +
 .../ta_channels/ChannelNetwork_Altitude.h          |     0
 .../ta_channels/ChannelNetwork_Distance.cpp        |   577 +
 .../ta_channels/ChannelNetwork_Distance.h          |   127 +
 .../ta_channels/D8_Flow_Analysis.cpp               |     0
 .../ta_channels/D8_Flow_Analysis.h                 |     0
 .../terrain_analysis/ta_channels/MLB_Interface.cpp |     0
 .../terrain_analysis/ta_channels/MLB_Interface.h   |     0
 .../terrain_analysis/ta_channels/Makefile.am       |     0
 .../terrain_analysis/ta_channels/Makefile.in       |   652 +
 .../terrain_analysis/ta_channels/Strahler.cpp      |   115 +
 .../terrain_analysis/ta_channels/Strahler.h        |    47 +
 .../terrain_analysis/ta_channels/Watersheds.cpp    |   231 +
 .../terrain_analysis/ta_channels/Watersheds.h      |     0
 .../ta_channels/Watersheds_ext.cpp                 |   739 +
 .../terrain_analysis/ta_channels/Watersheds_ext.h  |    70 +
 .../terrain_analysis/ta_compound/MLB_Interface.cpp |     0
 .../terrain_analysis/ta_compound/MLB_Interface.h   |     0
 .../terrain_analysis/ta_compound/Makefile.am       |     0
 .../terrain_analysis/ta_compound/Makefile.in       |   631 +
 .../terrain_analysis/ta_compound/TA_Standard.cpp   |   348 +
 .../terrain_analysis/ta_compound/TA_Standard.h     |     0
 .../terrain_analysis/ta_hydrology/CellBalance.cpp  |   259 +
 .../terrain_analysis/ta_hydrology/CellBalance.h    |    51 +
 .../ta_hydrology/EdgeContamination.cpp             |   202 +
 .../ta_hydrology/EdgeContamination.h               |    70 +
 .../ta_hydrology/Erosion_LS_Fields.cpp             |   808 +
 .../ta_hydrology/Erosion_LS_Fields.h               |     0
 src/modules/terrain_analysis/ta_hydrology/Flow.cpp |   866 ++
 .../terrain_analysis/ta_hydrology/Flow.h           |     0
 .../terrain_analysis/ta_hydrology/FlowDepth.cpp    |   358 +
 .../terrain_analysis/ta_hydrology/FlowDepth.h      |    60 +
 .../ta_hydrology/Flow_AreaDownslope.cpp            |     0
 .../ta_hydrology/Flow_AreaDownslope.h              |     0
 .../ta_hydrology/Flow_AreaUpslope.cpp              |   601 +
 .../ta_hydrology/Flow_AreaUpslope.h                |     0
 .../terrain_analysis/ta_hydrology/Flow_BRM.h       |     0
 .../ta_hydrology/Flow_Distance.cpp                 |   305 +
 .../terrain_analysis/ta_hydrology/Flow_Distance.h  |     0
 .../ta_hydrology/Flow_Parallel.cpp                 |  1175 ++
 .../terrain_analysis/ta_hydrology/Flow_Parallel.h  |     0
 .../ta_hydrology/Flow_RecursiveDown.cpp            |   737 +
 .../ta_hydrology/Flow_RecursiveDown.h              |     0
 .../ta_hydrology/Flow_RecursiveUp.cpp              |   471 +
 .../ta_hydrology/Flow_RecursiveUp.h                |     0
 .../terrain_analysis/ta_hydrology/Helper.cpp       |   392 +
 src/modules/terrain_analysis/ta_hydrology/Helper.h |    40 +
 .../ta_hydrology/IsochronesConst.cpp               |   154 +
 .../ta_hydrology/IsochronesConst.h                 |    48 +
 .../ta_hydrology/IsochronesVar.cpp                 |   361 +
 .../terrain_analysis/ta_hydrology/IsochronesVar.h  |    62 +
 .../terrain_analysis/ta_hydrology/LakeFlood.cpp    |     0
 .../terrain_analysis/ta_hydrology/LakeFlood.h      |     0
 .../ta_hydrology/LakeFloodInteractive.cpp          |     0
 .../ta_hydrology/MLB_Interface.cpp                 |   174 +
 .../terrain_analysis/ta_hydrology/MLB_Interface.h  |     0
 .../terrain_analysis/ta_hydrology/Makefile.am      |    68 +
 .../terrain_analysis/ta_hydrology/Makefile.in      |   708 +
 .../ta_hydrology/SAGA_Wetness_Index.cpp            |   983 ++
 .../ta_hydrology/SAGA_Wetness_Index.h              |     0
 .../terrain_analysis/ta_hydrology/Sinuosity.cpp    |   161 +
 .../terrain_analysis/ta_hydrology/Sinuosity.h      |    51 +
 .../terrain_analysis/ta_hydrology/SlopeLength.cpp  |   155 +
 .../terrain_analysis/ta_hydrology/SlopeLength.h    |    70 +
 .../ta_hydrology/TopographicIndices.cpp            |     0
 .../ta_hydrology/TopographicIndices.h              |     0
 .../ta_hydrology/flow_by_slope.cpp                 |   312 +
 .../terrain_analysis/ta_hydrology/flow_by_slope.h  |   122 +
 .../ta_hydrology/flow_massflux.cpp                 |     0
 .../terrain_analysis/ta_hydrology/flow_massflux.h  |     0
 .../terrain_analysis/ta_hydrology/flow_width.cpp   |     0
 .../terrain_analysis/ta_hydrology/flow_width.h     |     0
 .../ta_hydrology/melton_ruggedness.cpp             |   188 +
 .../ta_hydrology/melton_ruggedness.h               |     0
 .../terrain_analysis/ta_lighting/HillShade.cpp     |     0
 .../terrain_analysis/ta_lighting/HillShade.h       |     0
 .../terrain_analysis/ta_lighting/MLB_Interface.cpp |     0
 .../terrain_analysis/ta_lighting/MLB_Interface.h   |     0
 .../terrain_analysis/ta_lighting/Makefile.am       |     0
 .../terrain_analysis/ta_lighting/Makefile.in       |   655 +
 .../ta_lighting/SolarRadiation.cpp                 |  1437 ++
 .../terrain_analysis/ta_lighting/SolarRadiation.h  |     0
 .../ta_lighting/Visibility_BASE.cpp                |     0
 .../terrain_analysis/ta_lighting/Visibility_BASE.h |     0
 .../ta_lighting/Visibility_Point.cpp               |     0
 .../ta_lighting/Visibility_Point.h                 |     0
 .../ta_lighting/Visibility_Points.cpp              |     0
 .../ta_lighting/Visibility_Points.h                |     0
 .../ta_lighting/topographic_correction.cpp         |   417 +
 .../ta_lighting/topographic_correction.h           |     0
 .../ta_lighting/topographic_openness.cpp           |     0
 .../ta_lighting/topographic_openness.h             |     0
 .../terrain_analysis/ta_lighting/view_shed.cpp     |   434 +
 .../terrain_analysis/ta_lighting/view_shed.h       |     0
 .../ta_morphometry/Convergence.cpp                 |     0
 .../terrain_analysis/ta_morphometry/Convergence.h  |     0
 .../ta_morphometry/Convergence_Radius.cpp          |     0
 .../ta_morphometry/Convergence_Radius.h            |     0
 .../ta_morphometry/Curvature_Classification.cpp    |   265 +
 .../ta_morphometry/Curvature_Classification.h      |   116 +
 .../terrain_analysis/ta_morphometry/Hypsometry.cpp |   421 +
 .../terrain_analysis/ta_morphometry/Hypsometry.h   |   114 +
 .../ta_morphometry/MLB_Interface.cpp               |     0
 .../ta_morphometry/MLB_Interface.h                 |     0
 .../terrain_analysis/ta_morphometry/Makefile.am    |     0
 .../terrain_analysis/ta_morphometry/Makefile.in    |   702 +
 .../ta_morphometry/Morphometry.cpp                 |   945 ++
 .../terrain_analysis/ta_morphometry/Morphometry.h  |     0
 .../ta_morphometry/ProtectionIndex.cpp             |   123 +
 .../ta_morphometry/ProtectionIndex.h               |    41 +
 .../terrain_analysis/ta_morphometry/RealArea.cpp   |    60 +
 .../terrain_analysis/ta_morphometry/RealArea.h     |    35 +
 .../ta_morphometry/SurfaceSpecificPoints.cpp       |   514 +
 .../ta_morphometry/SurfaceSpecificPoints.h         |     0
 .../ta_morphometry/air_flow_height.cpp             |     0
 .../ta_morphometry/air_flow_height.h               |     0
 .../ta_morphometry/anisotropic_heating.cpp         |     0
 .../ta_morphometry/anisotropic_heating.h           |     0
 .../ta_morphometry/distance_gradient.cpp           |     0
 .../ta_morphometry/distance_gradient.h             |     0
 .../ta_morphometry/fuzzy_landform_elements.cpp     |     0
 .../ta_morphometry/fuzzy_landform_elements.h       |     0
 .../ta_morphometry/land_surface_temperature.cpp    |     0
 .../ta_morphometry/land_surface_temperature.h      |     0
 .../ta_morphometry/mass_balance_index.cpp          |     0
 .../ta_morphometry/mass_balance_index.h            |     0
 .../terrain_analysis/ta_morphometry/mrvbf.cpp      |     0
 .../terrain_analysis/ta_morphometry/mrvbf.h        |     0
 .../ta_morphometry/param_scale.cpp                 |     0
 .../terrain_analysis/ta_morphometry/param_scale.h  |     0
 .../ta_morphometry/relative_heights.cpp            |  1479 ++
 .../ta_morphometry/relative_heights.h              |     0
 .../terrain_analysis/ta_morphometry/ruggedness.cpp |     0
 .../terrain_analysis/ta_morphometry/ruggedness.h   |     0
 .../ta_morphometry/tc_iwahashi_pike.cpp            |     0
 .../ta_morphometry/tc_iwahashi_pike.h              |     0
 .../terrain_analysis/ta_morphometry/top_hat.cpp    |     0
 .../terrain_analysis/ta_morphometry/top_hat.h      |     0
 .../terrain_analysis/ta_morphometry/tpi.cpp        |   481 +
 .../terrain_analysis/ta_morphometry/tpi.h          |     0
 .../ta_morphometry/wind_effect.cpp                 |     0
 .../terrain_analysis/ta_morphometry/wind_effect.h  |     0
 .../terrain_analysis/ta_preprocessor/FillSinks.cpp |     0
 .../terrain_analysis/ta_preprocessor/FillSinks.h   |     0
 .../ta_preprocessor/FillSinks_WL.cpp               |   293 +
 .../ta_preprocessor/FillSinks_WL.h                 |     0
 .../ta_preprocessor/FillSinks_WL_XXL.cpp           |   226 +
 .../ta_preprocessor/Flat_Detection.cpp             |     0
 .../ta_preprocessor/Flat_Detection.h               |     0
 .../ta_preprocessor/MLB_Interface.cpp              |     0
 .../ta_preprocessor/MLB_Interface.h                |     0
 .../terrain_analysis/ta_preprocessor/Makefile.am   |     0
 .../terrain_analysis/ta_preprocessor/Makefile.in   |   650 +
 .../ta_preprocessor/Pit_Eliminator.cpp             |     0
 .../ta_preprocessor/Pit_Eliminator.h               |     0
 .../ta_preprocessor/Pit_Router.cpp                 |  1133 ++
 .../terrain_analysis/ta_preprocessor/Pit_Router.h  |     0
 .../ta_preprocessor/burn_in_streams.cpp            |     0
 .../ta_preprocessor/burn_in_streams.h              |     0
 .../ta_profiles/Grid_Cross_Profiles.cpp            |     0
 .../ta_profiles/Grid_Cross_Profiles.h              |     0
 .../ta_profiles/Grid_Flow_Profile.cpp              |     0
 .../ta_profiles/Grid_Flow_Profile.h                |     0
 .../terrain_analysis/ta_profiles/Grid_Profile.cpp  |     0
 .../terrain_analysis/ta_profiles/Grid_Profile.h    |     0
 .../ta_profiles/Grid_ProfileFromPoints.cpp         |   163 +
 .../ta_profiles/Grid_ProfileFromPoints.h           |    38 +
 .../ta_profiles/Grid_Profile_From_Lines.cpp        |     0
 .../ta_profiles/Grid_Profile_From_Lines.h          |     0
 .../ta_profiles/Grid_Swath_Profile.cpp             |     0
 .../ta_profiles/Grid_Swath_Profile.h               |     0
 .../terrain_analysis/ta_profiles/MLB_Interface.cpp |     0
 .../terrain_analysis/ta_profiles/MLB_Interface.h   |     0
 .../terrain_analysis/ta_profiles/Makefile.am       |     0
 .../terrain_analysis/ta_profiles/Makefile.in       |   649 +
 .../ta_slope_stability/ANGMAP_01.cpp               |   226 +
 .../ta_slope_stability/ANGMAP_01.h                 |    96 +
 .../ta_slope_stability/MLB_Interface.cpp           |   137 +
 .../ta_slope_stability/MLB_Interface.h             |    83 +
 .../ta_slope_stability/Makefile.am                 |    32 +
 .../ta_slope_stability/Makefile.in                 |   649 +
 .../ta_slope_stability/SHALSTAB_01.cpp             |   513 +
 .../ta_slope_stability/SHALSTAB_01.h               |    96 +
 .../ta_slope_stability/Safetyfactor_01.cpp         |   462 +
 .../ta_slope_stability/Safetyfactor_01.h           |    96 +
 .../ta_slope_stability/TOBIA_01.cpp                |   290 +
 .../terrain_analysis/ta_slope_stability/TOBIA_01.h |    96 +
 .../ta_slope_stability/WEDGEFAIL_01.cpp            |   329 +
 .../ta_slope_stability/WEDGEFAIL_01.h              |    96 +
 .../ta_slope_stability/WETNESS_01.cpp              |   449 +
 .../ta_slope_stability/WETNESS_01.h                |    96 +
 src/modules/tin/Makefile.in                        |   113 +-
 src/modules/tin/tin_tools/Makefile.in              |   114 +-
 .../tin_tools/TIN_From_Grid_Specific_Points.cpp    |     4 +-
 src/modules/tin/tin_viewer/Makefile.in             |   114 +-
 src/modules_contrib/Makefile.am                    |     1 -
 src/modules_contrib/Makefile.in                    |   589 -
 src/modules_contrib/contrib_a_perego/Makefile.am   |     1 -
 src/modules_contrib/contrib_a_perego/Makefile.in   |   589 -
 .../contrib_a_perego/MLB_Interface.h               |    33 -
 .../contrib_a_perego/contrib_a_perego/Makefile.am  |    36 -
 .../contrib_a_perego/contrib_a_perego/Makefile.in  |   600 -
 src/modules_contrib/contrib_s_liersch/Makefile.am  |     1 -
 src/modules_contrib/contrib_s_liersch/Makefile.in  |   589 -
 .../contrib_s_liersch/ihacres/MLB_Interface.h      |    98 -
 .../contrib_s_liersch/ihacres/Makefile.am          |    40 -
 .../contrib_s_liersch/ihacres/Makefile.in          |   607 -
 .../contrib_s_liersch/ihacres/ihacres_cal2.cpp     |  1122 --
 src/modules_contrib/garden/Makefile.am             |     5 -
 src/modules_contrib/garden/Makefile.in             |   590 -
 .../garden_3d_viewer/3d_multigrid_view_control.cpp |  1016 --
 .../garden_3d_viewer/3d_multigrid_view_control.h   |   203 -
 .../garden_3d_viewer/3d_multigrid_view_dialog.cpp  |   262 -
 .../garden_3d_viewer/3d_multigrid_view_dialog.h    |   137 -
 .../garden_3d_viewer/3d_multigrid_view_module.cpp  |   132 -
 .../garden_3d_viewer/3d_multigrid_view_module.h    |    98 -
 .../garden_3d_viewer/3dshapes_view_control.cpp     |  1055 --
 .../garden_3d_viewer/3dshapes_view_control.h       |   204 -
 .../garden_3d_viewer/3dshapes_view_dialog.cpp      |   268 -
 .../garden/garden_3d_viewer/3dshapes_view_dialog.h |   137 -
 .../garden_3d_viewer/3dshapes_view_module.cpp      |   145 -
 .../garden/garden_3d_viewer/3dshapes_view_module.h |    98 -
 .../garden/garden_3d_viewer/MLB_Interface.cpp      |   125 -
 .../garden/garden_3d_viewer/MLB_Interface.h        |    83 -
 .../garden/garden_3d_viewer/Makefile.am            |    32 -
 .../garden/garden_3d_viewer/Makefile.in            |   595 -
 .../garden/garden_webservices/Makefile.in          |   581 -
 src/modules_geostatistics/Makefile.am              |     1 -
 src/modules_geostatistics/Makefile.in              |   589 -
 .../geostatistics/Makefile.am                      |     5 -
 .../geostatistics/Makefile.in                      |   591 -
 .../GSGrid_Directional_Statistics.cpp              |   367 -
 .../GSGrid_Directional_Statistics.h                |   113 -
 .../geostatistics_grid/GSGrid_Residuals.cpp        |   233 -
 .../geostatistics_grid/GSGrid_Residuals.h          |   115 -
 .../geostatistics_grid/GSGrid_Statistics.cpp       |   390 -
 .../geostatistics_grid/GSGrid_Statistics.h         |   127 -
 .../geostatistics_grid/GSGrid_Variance.cpp         |   347 -
 .../geostatistics_grid/GSGrid_Variance.h           |   127 -
 .../geostatistics_grid/GSGrid_Variance_Radius.cpp  |   343 -
 .../geostatistics_grid/GSGrid_Variance_Radius.h    |   123 -
 .../geostatistics_grid/GSGrid_Zonal_Statistics.cpp |   581 -
 .../geostatistics_grid/GSGrid_Zonal_Statistics.h   |   178 -
 .../geostatistics_grid/MLB_Interface.cpp           |   148 -
 .../geostatistics_grid/MLB_Interface.h             |    85 -
 .../geostatistics/geostatistics_grid/Makefile.am   |    42 -
 .../geostatistics/geostatistics_grid/Makefile.in   |   613 -
 .../geostatistics_grid/fast_representativeness.cpp |   604 -
 .../geostatistics_grid/grid_autocorrelation.cpp    |   213 -
 .../geostatistics_grid/grid_autocorrelation.h      |    91 -
 .../geostatistics_grid/grid_latlon_statistics.cpp  |   217 -
 .../geostatistics_grid/grid_latlon_statistics.h    |   116 -
 .../geostatistics/geostatistics_grid/grid_pca.cpp  |   605 -
 .../geostatistics/geostatistics_grid/grid_pca.h    |   135 -
 .../geostatistics_grid/multiband_variation.cpp     |   276 -
 .../geostatistics_grid/multiband_variation.h       |   115 -
 .../geostatistics_kriging/MLB_Interface.h          |    85 -
 .../geostatistics_kriging/Makefile.am              |    44 -
 .../geostatistics_kriging/Makefile.in              |   617 -
 .../geostatistics_kriging/_kriging_base.h          |   142 -
 .../geostatistics_kriging/_kriging_ordinary.h      |   118 -
 .../_kriging_ordinary_global.h                     |   113 -
 .../geostatistics_kriging/_kriging_universal.h     |   118 -
 .../_kriging_universal_global.h                    |   118 -
 .../geostatistics_points/GSPoints_Distances.cpp    |   166 -
 .../geostatistics_points/GSPoints_Distances.h      |   100 -
 .../GSPoints_Pattern_Analysis.cpp                  |   251 -
 .../GSPoints_Pattern_Analysis.h                    |   100 -
 .../GSPoints_Semi_Variances.cpp                    |   259 -
 .../geostatistics_points/GSPoints_Semi_Variances.h |   105 -
 .../GSPoints_Variogram_Cloud.cpp                   |   223 -
 .../GSPoints_Variogram_Cloud.h                     |   103 -
 .../GSPoints_Variogram_Surface.cpp                 |   236 -
 .../GSPoints_Variogram_Surface.h                   |   103 -
 .../geostatistics_points/MLB_Interface.cpp         |   133 -
 .../geostatistics_points/MLB_Interface.h           |    85 -
 .../geostatistics/geostatistics_points/Makefile.am |    30 -
 .../geostatistics/geostatistics_points/Makefile.in |   593 -
 .../geostatistics_regression/MLB_Interface.cpp     |   158 -
 .../geostatistics_regression/MLB_Interface.h       |    85 -
 .../geostatistics_regression/Makefile.am           |    46 -
 .../geostatistics_regression/Makefile.in           |   621 -
 .../grid_multi_grid_regression.cpp                 |   445 -
 .../grid_multi_grid_regression.h                   |   108 -
 .../grids_trend_polynom.cpp                        |   304 -
 .../geostatistics_regression/grids_trend_polynom.h |   105 -
 .../gw_multi_regression.cpp                        |   585 -
 .../geostatistics_regression/gw_multi_regression.h |   133 -
 .../gw_multi_regression_grid.cpp                   |   739 -
 .../gw_multi_regression_grid.h                     |   131 -
 .../gw_multi_regression_points.cpp                 |   524 -
 .../gw_multi_regression_points.h                   |   129 -
 .../geostatistics_regression/gw_regression.cpp     |   417 -
 .../geostatistics_regression/gw_regression.h       |   127 -
 .../gw_regression_grid.cpp                         |   469 -
 .../geostatistics_regression/gw_regression_grid.h  |   124 -
 .../gwr_grid_downscaling.cpp                       |   561 -
 .../gwr_grid_downscaling.h                         |   117 -
 .../point_grid_regression.cpp                      |   333 -
 .../point_grid_regression.h                        |   110 -
 .../point_multi_grid_regression.cpp                |   607 -
 .../point_multi_grid_regression.h                  |   112 -
 .../point_trend_surface.cpp                        |   485 -
 .../geostatistics_regression/point_trend_surface.h |   117 -
 .../table_regression_multiple.cpp                  |   482 -
 .../table_regression_multiple.h                    |   117 -
 .../geostatistics_regression/table_trend.cpp       |   280 -
 .../geostatistics_regression/table_trend.h         |   123 -
 src/modules_images/Makefile.am                     |     1 -
 src/modules_images/Makefile.in                     |   589 -
 src/modules_images/modules_imagery/Makefile.am     |     1 -
 src/modules_images/modules_imagery/Makefile.in     |   589 -
 .../imagery_classification/Makefile.in             |   589 -
 .../imagery_classification/change_detection.cpp    |   500 -
 .../classify_cluster_analysis.cpp                  |   847 -
 .../classify_supervised_polygons.cpp               |   468 -
 .../classify_supervised_polygons.h                 |   118 -
 .../modules_imagery/imagery_rga/Makefile.in        |   577 -
 .../imagery_segmentation/Makefile.in               |   588 -
 .../imagery_segmentation/rga_basic.cpp             |   665 -
 .../imagery_segmentation/skeletonization.cpp       |   950 --
 .../watershed_segmentation.cpp                     |   515 -
 .../modules_imagery/imagery_svm/Makefile.in        |   576 -
 .../imagery_tools/Image_VI_Distance.cpp            |   284 -
 .../imagery_tools/Image_VI_Distance.h              |    87 -
 .../imagery_tools/Image_VI_Slope.cpp               |   329 -
 .../modules_imagery/imagery_tools/Image_VI_Slope.h |    89 -
 .../imagery_tools/MLB_Interface.cpp                |   142 -
 .../modules_imagery/imagery_tools/MLB_Interface.h  |    68 -
 .../modules_imagery/imagery_tools/Makefile.in      |   597 -
 .../modules_imagery/imagery_tools/evi.cpp          |   200 -
 .../modules_imagery/imagery_tools/evi.h            |   108 -
 .../modules_imagery/imagery_tools/landsat_acca.cpp |   889 --
 .../modules_imagery/imagery_tools/landsat_acca.h   |   110 -
 .../modules_imagery/imagery_tools/landsat_toar.cpp |   786 -
 .../modules_imagery/imagery_tools/landsat_toar.h   |   114 -
 .../imagery_tools/pansharpening.cpp                |   811 -
 .../modules_imagery/imagery_tools/pansharpening.h  |   155 -
 .../modules_imagery/imagery_tools/tasseled_cap.cpp |   227 -
 .../modules_imagery/imagery_tools/tasseled_cap.h   |   108 -
 src/modules_images/modules_opencv/Makefile.am      |     1 -
 src/modules_images/modules_opencv/Makefile.in      |   589 -
 .../modules_opencv/opencv/Makefile.am              |    31 -
 .../modules_opencv/opencv/Makefile.in              |   595 -
 src/modules_images/modules_vigra/Makefile.am       |     1 -
 src/modules_images/modules_vigra/Makefile.in       |   589 -
 src/modules_images/modules_vigra/vigra/Makefile.am |    37 -
 src/modules_images/modules_vigra/vigra/Makefile.in |   608 -
 .../modules_vigra/vigra/vigra_morphology.cpp       |   203 -
 .../modules_vigra/vigra/vigra_random_forest.cpp    |   587 -
 .../modules_vigra/vigra/vigra_random_forest.h      |   119 -
 src/modules_io/Makefile.am                         |     1 -
 src/modules_io/Makefile.in                         |   589 -
 src/modules_io/db/Makefile.am                      |    13 -
 src/modules_io/db/Makefile.in                      |   592 -
 src/modules_io/db/io_odbc/MLB_Interface.cpp        |   155 -
 src/modules_io/db/io_odbc/MLB_Interface.h          |    78 -
 src/modules_io/db/io_odbc/Makefile.am              |    26 -
 src/modules_io/db/io_odbc/Makefile.in              |   585 -
 src/modules_io/db/io_odbc/get_connection.cpp       |   523 -
 src/modules_io/db/io_odbc/get_connection.h         |   209 -
 src/modules_io/db/io_odbc/odbc.cpp                 |  1654 --
 src/modules_io/db/io_odbc/odbc.h                   |   291 -
 src/modules_io/db/io_odbc/table.cpp                |   476 -
 src/modules_io/db/io_odbc/table.h                  |   215 -
 src/modules_io/db/io_pgsql/MLB_Interface.cpp       |   148 -
 src/modules_io/db/io_pgsql/MLB_Interface.h         |    86 -
 src/modules_io/db/io_pgsql/Makefile.am             |    29 -
 src/modules_io/db/io_pgsql/Makefile.in             |   590 -
 src/modules_io/db/io_pgsql/get_connection.cpp      |   583 -
 src/modules_io/db/io_pgsql/get_connection.h        |   225 -
 src/modules_io/db/io_pgsql/io_pgsql.cpp            |  1858 ---
 src/modules_io/db/io_pgsql/io_pgsql.h              |   268 -
 src/modules_io/db/io_pgsql/pgis_raster.cpp         |   337 -
 src/modules_io/db/io_pgsql/pgis_raster.h           |   149 -
 src/modules_io/db/io_pgsql/pgis_shapes.cpp         |   445 -
 src/modules_io/db/io_pgsql/pgis_shapes.h           |   151 -
 src/modules_io/db/io_pgsql/table.cpp               |   489 -
 src/modules_io/db/io_pgsql/table.h                 |   213 -
 src/modules_io/docs/Makefile.in                    |   589 -
 src/modules_io/docs/docs_html/CreateWebContent.cpp |   181 -
 src/modules_io/docs/docs_html/CreateWebContent.h   |    56 -
 src/modules_io/docs/docs_html/Makefile.in          |   587 -
 .../docs/docs_html/svg_interactive_map.cpp         |  2897 ----
 src/modules_io/docs/docs_pdf/Makefile.in           |   592 -
 .../docs/docs_pdf/Profile_Cross_Sections.cpp       |  1459 --
 .../docs/docs_pdf/Profile_Cross_Sections.h         |    92 -
 src/modules_io/docs/docs_pdf/Shapes_Summary.cpp    |   575 -
 src/modules_io/docs/docs_pdf/Shapes_Summary.h      |    98 -
 src/modules_io/esri_e00/Makefile.am                |     1 -
 src/modules_io/esri_e00/Makefile.in                |   589 -
 src/modules_io/esri_e00/io_esri_e00/Makefile.in    |   650 -
 src/modules_io/gdal/Makefile.am                    |     1 -
 src/modules_io/gdal/Makefile.in                    |   589 -
 src/modules_io/gdal/io_gdal/Makefile.in            |   605 -
 src/modules_io/gdal/io_gdal/ogr_driver.cpp         |   818 -
 src/modules_io/gdal/io_gdal/ogr_driver.h           |   202 -
 src/modules_io/gps/Makefile.am                     |     1 -
 src/modules_io/gps/Makefile.in                     |   589 -
 src/modules_io/gps/io_gps/GPSBabel.cpp             |   163 -
 src/modules_io/gps/io_gps/GPSBabel.h               |    39 -
 src/modules_io/gps/io_gps/Makefile.in              |   580 -
 src/modules_io/gps/io_gps/gpx2shp.cpp              |   145 -
 src/modules_io/gps/io_gps/gpx2shp.h                |    39 -
 src/modules_io/grid/Makefile.am                    |     5 -
 src/modules_io/grid/Makefile.in                    |   590 -
 src/modules_io/grid/io_grid/Makefile.in            |   609 -
 src/modules_io/grid/io_grid/xyz.cpp                |   385 -
 src/modules_io/grid/io_grid/xyz.h                  |   137 -
 src/modules_io/grid/io_grid_grib2/Makefile.in      |  1009 --
 .../grid/io_grid_image/MLB_Interface.cpp           |   129 -
 src/modules_io/grid/io_grid_image/MLB_Interface.h  |    85 -
 src/modules_io/grid/io_grid_image/Makefile.am      |    25 -
 src/modules_io/grid/io_grid_image/Makefile.in      |   580 -
 src/modules_io/grid/io_grid_image/grid_export.cpp  |   542 -
 src/modules_io/grid/io_grid_image/grid_export.h    |   113 -
 src/modules_io/grid/io_grid_image/grid_import.cpp  |   433 -
 src/modules_io/grid/io_grid_image/grid_import.h    |   113 -
 src/modules_io/shapes/Makefile.am                  |     1 -
 src/modules_io/shapes/Makefile.in                  |   589 -
 src/modules_io/shapes/io_shapes/Makefile.in        |   620 -
 src/modules_io/shapes/io_shapes_dxf/Makefile.in    |   606 -
 src/modules_io/shapes/io_shapes_las/Makefile.in    |   588 -
 src/modules_io/table/Makefile.am                   |     1 -
 src/modules_io/table/Makefile.in                   |   589 -
 src/modules_io/table/io_table/Makefile.in          |   577 -
 src/modules_lectures/Makefile.am                   |     1 -
 src/modules_lectures/Makefile.in                   |   589 -
 src/modules_lectures/lectures/Makefile.am          |     1 -
 src/modules_lectures/lectures/Makefile.in          |   589 -
 .../lectures/lectures_introduction/Exercise_04.cpp |   449 -
 .../lectures/lectures_introduction/Exercise_08.cpp |   293 -
 .../lectures/lectures_introduction/Exercise_14.cpp |   376 -
 .../lectures/lectures_introduction/MLB_Interface.h |    85 -
 .../lectures/lectures_introduction/Makefile.am     |    48 -
 .../lectures/lectures_introduction/Makefile.in     |   621 -
 src/modules_projection/Makefile.am                 |     1 -
 src/modules_projection/Makefile.in                 |   589 -
 src/modules_projection/pj_georeference/Makefile.am |     1 -
 src/modules_projection/pj_georeference/Makefile.in |   589 -
 .../pj_georeference/pj_georeference/Makefile.in    |   598 -
 src/modules_projection/pj_proj4/Makefile.am        |     1 -
 src/modules_projection/pj_proj4/Makefile.in        |   589 -
 .../pj_proj4/pj_proj4/MLB_Interface.cpp            |   150 -
 .../pj_proj4/pj_proj4/Makefile.am                  |    38 -
 .../pj_proj4/pj_proj4/Makefile.in                  |   604 -
 .../pj_proj4/pj_proj4/crs_assign.cpp               |   174 -
 .../pj_proj4/pj_proj4/crs_base.cpp                 |   908 --
 .../pj_proj4/pj_proj4/crs_base.h                   |   113 -
 .../pj_proj4/pj_proj4/crs_transform.cpp            |   258 -
 .../pj_proj4/pj_proj4/crs_transform.h              |   121 -
 .../pj_proj4/pj_proj4/crs_transform_grid.cpp       |   792 -
 .../pj_proj4/pj_proj4/crs_transform_grid.h         |   125 -
 .../pj_proj4/pj_proj4/crs_transform_shapes.cpp     |   255 -
 .../pj_proj4/pj_proj4/crs_transform_shapes.h       |   103 -
 src/modules_recreations/Makefile.am                |     1 -
 src/modules_recreations/Makefile.in                |   589 -
 src/modules_recreations/recreations/Makefile.am    |     1 -
 src/modules_recreations/recreations/Makefile.in    |   589 -
 .../recreations_fractals/MLB_Interface.h           |    85 -
 .../recreations/recreations_fractals/Makefile.am   |    32 -
 .../recreations/recreations_fractals/Makefile.in   |   595 -
 .../recreations/recreations_games/MLB_Interface.h  |    81 -
 .../recreations/recreations_games/Makefile.am      |    25 -
 .../recreations/recreations_games/Makefile.in      |   584 -
 src/modules_simulation/Makefile.am                 |     1 -
 src/modules_simulation/Makefile.in                 |   589 -
 .../cellular_automata/Makefile.am                  |     1 -
 .../cellular_automata/Makefile.in                  |   589 -
 .../sim_cellular_automata/Makefile.in              |   582 -
 .../sim_cellular_automata/Wator.cpp                |   497 -
 .../sim_cellular_automata/Wator.h                  |   117 -
 src/modules_simulation/ecosystems/Makefile.am      |     1 -
 src/modules_simulation/ecosystems/Makefile.in      |   589 -
 .../ecosystems/sim_ecosystems_hugget/Makefile.in   |   585 -
 src/modules_simulation/erosion/Makefile.am         |     1 -
 src/modules_simulation/erosion/Makefile.in         |   589 -
 .../erosion/sim_erosion/MMF_SAGA.cpp               |  1180 --
 .../erosion/sim_erosion/Makefile.in                |   577 -
 src/modules_simulation/hydrology/Makefile.am       |     1 -
 src/modules_simulation/hydrology/Makefile.in       |   589 -
 .../hydrology/sim_hydrology/KinWav_D8.cpp          |   550 -
 .../hydrology/sim_hydrology/Makefile.in            |   594 -
 .../sim_hydrology/WaterRetentionCapacity.cpp       |   269 -
 .../sim_hydrology/WaterRetentionCapacity.h         |    52 -
 .../hydrology/sim_hydrology/idw.cpp                |    97 -
 .../hydrology/sim_hydrology/idw.h                  |    46 -
 .../hydrology/sim_hydrology/topmodel.cpp           |   712 -
 .../hydrology/sim_hydrology/topmodel_values.cpp    |   345 -
 src/modules_terrain_analysis/Makefile.am           |     1 -
 src/modules_terrain_analysis/Makefile.in           |   589 -
 .../terrain_analysis/Makefile.am                   |     1 -
 .../terrain_analysis/Makefile.in                   |   589 -
 .../ta_channels/ChannelNetwork.cpp                 |   805 -
 .../ta_channels/ChannelNetwork_Altitude.cpp        |   474 -
 .../ta_channels/ChannelNetwork_Distance.cpp        |   389 -
 .../ta_channels/ChannelNetwork_Distance.h          |   118 -
 .../terrain_analysis/ta_channels/Makefile.in       |   598 -
 .../terrain_analysis/ta_channels/Strahler.cpp      |   115 -
 .../terrain_analysis/ta_channels/Strahler.h        |    47 -
 .../terrain_analysis/ta_channels/Watersheds.cpp    |   231 -
 .../ta_channels/Watersheds_ext.cpp                 |   739 -
 .../terrain_analysis/ta_channels/Watersheds_ext.h  |    70 -
 .../terrain_analysis/ta_compound/Makefile.in       |   577 -
 .../terrain_analysis/ta_compound/TA_Standard.cpp   |   346 -
 .../terrain_analysis/ta_hydrology/CellBalance.cpp  |   259 -
 .../terrain_analysis/ta_hydrology/CellBalance.h    |    51 -
 .../ta_hydrology/EdgeContamination.cpp             |   202 -
 .../ta_hydrology/EdgeContamination.h               |    70 -
 .../ta_hydrology/Erosion_LS_Fields.cpp             |   806 -
 .../terrain_analysis/ta_hydrology/Flow.cpp         |   866 --
 .../terrain_analysis/ta_hydrology/FlowDepth.cpp    |   358 -
 .../terrain_analysis/ta_hydrology/FlowDepth.h      |    60 -
 .../ta_hydrology/Flow_AreaUpslope.cpp              |   602 -
 .../ta_hydrology/Flow_Distance.cpp                 |   305 -
 .../ta_hydrology/Flow_Parallel.cpp                 |  1175 --
 .../ta_hydrology/Flow_RecursiveDown.cpp            |   737 -
 .../ta_hydrology/Flow_RecursiveUp.cpp              |   471 -
 .../terrain_analysis/ta_hydrology/Helper.cpp       |   392 -
 .../terrain_analysis/ta_hydrology/Helper.h         |    40 -
 .../ta_hydrology/IsochronesConst.cpp               |   154 -
 .../ta_hydrology/IsochronesConst.h                 |    48 -
 .../ta_hydrology/IsochronesVar.cpp                 |   361 -
 .../terrain_analysis/ta_hydrology/IsochronesVar.h  |    62 -
 .../ta_hydrology/MLB_Interface.cpp                 |   171 -
 .../terrain_analysis/ta_hydrology/Makefile.am      |    66 -
 .../terrain_analysis/ta_hydrology/Makefile.in      |   650 -
 .../ta_hydrology/SAGA_Wetness_Index.cpp            |   975 --
 .../terrain_analysis/ta_hydrology/Sinuosity.cpp    |   161 -
 .../terrain_analysis/ta_hydrology/Sinuosity.h      |    51 -
 .../terrain_analysis/ta_hydrology/SlopeLength.cpp  |   155 -
 .../terrain_analysis/ta_hydrology/SlopeLength.h    |    70 -
 .../ta_hydrology/melton_ruggedness.cpp             |   188 -
 .../terrain_analysis/ta_lighting/Makefile.in       |   601 -
 .../ta_lighting/SolarRadiation.cpp                 |  1437 --
 .../ta_lighting/topographic_correction.cpp         |   417 -
 .../terrain_analysis/ta_lighting/view_shed.cpp     |   433 -
 .../ta_morphometry/Curvature_Classification.cpp    |   209 -
 .../ta_morphometry/Curvature_Classification.h      |   107 -
 .../terrain_analysis/ta_morphometry/Hypsometry.cpp |   374 -
 .../terrain_analysis/ta_morphometry/Hypsometry.h   |   112 -
 .../terrain_analysis/ta_morphometry/Makefile.in    |   648 -
 .../ta_morphometry/Morphometry.cpp                 |   944 --
 .../ta_morphometry/ProtectionIndex.cpp             |   123 -
 .../ta_morphometry/ProtectionIndex.h               |    41 -
 .../terrain_analysis/ta_morphometry/RealArea.cpp   |    60 -
 .../terrain_analysis/ta_morphometry/RealArea.h     |    35 -
 .../ta_morphometry/SurfaceSpecificPoints.cpp       |   514 -
 .../ta_morphometry/relative_heights.cpp            |  1479 --
 .../terrain_analysis/ta_morphometry/tpi.cpp        |   476 -
 .../ta_preprocessor/FillSinks_WL.cpp               |   293 -
 .../ta_preprocessor/FillSinks_WL_XXL.cpp           |   226 -
 .../terrain_analysis/ta_preprocessor/Makefile.in   |   597 -
 .../ta_preprocessor/Pit_Router.cpp                 |  1134 --
 .../ta_profiles/Grid_ProfileFromPoints.cpp         |   163 -
 .../ta_profiles/Grid_ProfileFromPoints.h           |    38 -
 .../terrain_analysis/ta_profiles/Makefile.in       |   595 -
 src/saga_core/Makefile.in                          |   113 +-
 src/saga_core/saga_api/Makefile.am                 |    23 +-
 src/saga_core/saga_api/Makefile.in                 |   209 +-
 src/saga_core/saga_api/api_core.h                  |    70 +-
 src/saga_core/saga_api/api_file.cpp                |    12 +-
 src/saga_core/saga_api/api_string.cpp              |    21 +-
 src/saga_core/saga_api/api_translator.cpp          |    74 +-
 src/saga_core/saga_api/clipper.cpp                 |  2114 ++-
 src/saga_core/saga_api/clipper.hpp                 |   101 +-
 src/saga_core/saga_api/compatibility.h             |   382 +
 src/saga_core/saga_api/data_manager.cpp            |     8 +-
 src/saga_core/saga_api/geo_tools.h                 |    73 +-
 src/saga_core/saga_api/grid.cpp                    |    35 +-
 src/saga_core/saga_api/grid.h                      |    76 +-
 src/saga_core/saga_api/grid_io.cpp                 |    18 +-
 src/saga_core/saga_api/grid_memory.cpp             |   226 +-
 src/saga_core/saga_api/grid_operation.cpp          |     4 +-
 src/saga_core/saga_api/grid_system.cpp             |     4 +-
 src/saga_core/saga_api/mat_formula.cpp             |     6 +-
 src/saga_core/saga_api/mat_matrix.cpp              |  4171 +++--
 src/saga_core/saga_api/mat_tools.cpp               |    82 +-
 src/saga_core/saga_api/mat_tools.h                 |  2892 ++--
 src/saga_core/saga_api/module.cpp                  |    27 +-
 src/saga_core/saga_api/module.h                    |    16 +-
 src/saga_core/saga_api/module_grid.cpp             |    24 +-
 src/saga_core/saga_api/module_library.cpp          |    24 +-
 src/saga_core/saga_api/module_library.h            |     8 +-
 src/saga_core/saga_api/parameter_data.cpp          |    54 +-
 src/saga_core/saga_api/parameters.cpp              |    10 +-
 src/saga_core/saga_api/parameters.h                |     6 +-
 src/saga_core/saga_api/projections.cpp             |   288 +-
 src/saga_core/saga_api/saga_api.h                  |     2 +-
 src/saga_core/saga_api/shapes.h                    |     4 +-
 src/saga_core/saga_api/shapes_polygons.cpp         |     8 +-
 src/saga_core/saga_api/table.h                     |     5 +-
 src/saga_core/saga_api/table_record.cpp            |    11 +-
 src/saga_core/saga_cmd/Makefile.am                 |     5 +-
 src/saga_core/saga_cmd/Makefile.in                 |   132 +-
 src/saga_core/saga_cmd/man/Makefile.in             |    80 +-
 src/saga_core/saga_cmd/module_library.cpp          |    14 +-
 src/saga_core/saga_cmd/module_library.h            |     4 +-
 src/saga_core/saga_cmd/saga_cmd.cpp                |    70 +-
 src/saga_core/saga_gdi/3d_view.h                   |   260 +
 src/saga_core/saga_gdi/3d_view_canvas.cpp          |   702 +
 src/saga_core/saga_gdi/3d_view_dialog.cpp          |   331 +
 src/saga_core/saga_gdi/3d_view_panel.cpp           |   787 +
 src/saga_core/saga_gdi/3d_view_projector.cpp       |   229 +
 src/saga_core/saga_gdi/3d_view_tools.h             |   227 +
 src/saga_core/saga_gdi/Makefile.am                 |    16 +
 src/saga_core/saga_gdi/Makefile.in                 |   162 +-
 src/saga_core/saga_gdi/sgdi_core.h                 |    99 +
 src/saga_core/saga_gdi/sgdi_helper.h               |    10 +-
 src/saga_core/saga_gui/Makefile.am                 |    18 +-
 src/saga_core/saga_gui/Makefile.in                 |   282 +-
 src/saga_core/saga_gui/active.cpp                  |   124 +-
 src/saga_core/saga_gui/active_attributes.cpp       |   114 +-
 src/saga_core/saga_gui/active_attributes.h         |    22 +-
 src/saga_core/saga_gui/active_history.cpp          |    92 +-
 src/saga_core/saga_gui/active_legend.cpp           |     4 +-
 src/saga_core/saga_gui/active_parameters.cpp       |    24 +-
 src/saga_core/saga_gui/active_parameters.h         |     3 +-
 src/saga_core/saga_gui/data_source.cpp             |    11 +-
 src/saga_core/saga_gui/data_source_odbc.cpp        |     6 +-
 src/saga_core/saga_gui/data_source_pgsql.cpp       |    72 +-
 src/saga_core/saga_gui/dc_helper.cpp               |   221 +-
 src/saga_core/saga_gui/dc_helper.h                 |    24 +-
 src/saga_core/saga_gui/dlg_about.cpp               |   154 +-
 src/saga_core/saga_gui/dlg_base.cpp                |    26 +-
 src/saga_core/saga_gui/dlg_base.h                  |     9 +-
 src/saga_core/saga_gui/dlg_list_base.cpp           |   134 +-
 src/saga_core/saga_gui/dlg_list_base.h             |    19 +-
 src/saga_core/saga_gui/dlg_list_grid.cpp           |   124 +-
 src/saga_core/saga_gui/dlg_list_grid.h             |     8 +-
 src/saga_core/saga_gui/dlg_list_pointcloud.cpp     |    59 +-
 src/saga_core/saga_gui/dlg_list_pointcloud.h       |     5 +-
 src/saga_core/saga_gui/dlg_list_shapes.cpp         |    71 +-
 src/saga_core/saga_gui/dlg_list_shapes.h           |     7 +-
 src/saga_core/saga_gui/dlg_list_table.cpp          |    59 +-
 src/saga_core/saga_gui/dlg_list_table.h            |     5 +-
 src/saga_core/saga_gui/dlg_list_tin.cpp            |    59 +-
 src/saga_core/saga_gui/dlg_list_tin.h              |     5 +-
 src/saga_core/saga_gui/dlg_table.cpp               |    20 +-
 src/saga_core/saga_gui/dlg_table.h                 |    20 +-
 src/saga_core/saga_gui/helper.cpp                  |   218 +-
 src/saga_core/saga_gui/helper.h                    |    11 +-
 src/saga_core/saga_gui/info_messages.cpp           |    15 +-
 src/saga_core/saga_gui/man/Makefile.in             |    80 +-
 src/saga_core/saga_gui/parameters_control.cpp      |   173 +-
 src/saga_core/saga_gui/parameters_control.h        |    15 +-
 src/saga_core/saga_gui/parameters_properties.cpp   |   142 +-
 src/saga_core/saga_gui/parameters_properties.h     |     8 +-
 src/saga_core/saga_gui/project.cpp                 |   368 +-
 src/saga_core/saga_gui/project.h                   |    12 +-
 src/saga_core/saga_gui/res/saga.ger.txt            |   642 +-
 src/saga_core/saga_gui/res/saga.lng.txt            |   626 +-
 .../saga_gui/res/xpm/tb_map_north_arrow.xpm        |    23 +
 .../saga_gui/res/xpm/wksp_map_graticule.xpm        |    30 +
 src/saga_core/saga_gui/res_commands.cpp            |    83 +-
 src/saga_core/saga_gui/res_commands.h              |    30 +-
 src/saga_core/saga_gui/res_controls.h              |     4 +-
 src/saga_core/saga_gui/res_dialogs.cpp             |     8 +-
 src/saga_core/saga_gui/res_images.cpp              |     6 +-
 src/saga_core/saga_gui/res_images.h                |     4 +-
 src/saga_core/saga_gui/saga.cpp                    |    72 +-
 src/saga_core/saga_gui/saga.h                      |    12 +-
 src/saga_core/saga_gui/saga_frame.cpp              |   100 +-
 src/saga_core/saga_gui/view_base.cpp               |    67 +-
 src/saga_core/saga_gui/view_base.h                 |    25 +-
 src/saga_core/saga_gui/view_histogram.cpp          |    77 +-
 src/saga_core/saga_gui/view_histogram.h            |    14 +-
 src/saga_core/saga_gui/view_layout.cpp             |    36 +-
 src/saga_core/saga_gui/view_layout.h               |    25 +-
 src/saga_core/saga_gui/view_map.cpp                |    78 +-
 src/saga_core/saga_gui/view_map.h                  |    54 +-
 src/saga_core/saga_gui/view_map_3d.cpp             |    63 +-
 src/saga_core/saga_gui/view_map_3d.h               |    49 +-
 src/saga_core/saga_gui/view_map_3d_image.cpp       |     4 +-
 src/saga_core/saga_gui/view_map_control.cpp        |    51 +-
 src/saga_core/saga_gui/view_map_control.h          |     8 +-
 src/saga_core/saga_gui/view_scatterplot.cpp        |    88 +-
 src/saga_core/saga_gui/view_scatterplot.h          |    47 +-
 src/saga_core/saga_gui/view_table.cpp              |    52 +-
 src/saga_core/saga_gui/view_table.h                |    32 +-
 src/saga_core/saga_gui/view_table_control.cpp      |    78 +-
 src/saga_core/saga_gui/view_table_control.h        |    20 +-
 src/saga_core/saga_gui/view_table_diagram.cpp      |    32 +-
 src/saga_core/saga_gui/view_table_diagram.h        |    12 +-
 src/saga_core/saga_gui/wksp.cpp                    |    48 +-
 src/saga_core/saga_gui/wksp_base_control.cpp       |   241 +-
 src/saga_core/saga_gui/wksp_base_control.h         |    13 +-
 src/saga_core/saga_gui/wksp_base_item.cpp          |     9 +-
 src/saga_core/saga_gui/wksp_base_item.h            |     6 +-
 src/saga_core/saga_gui/wksp_data_item.cpp          |    72 +-
 src/saga_core/saga_gui/wksp_data_item.h            |    10 +-
 src/saga_core/saga_gui/wksp_data_layers.cpp        |   457 +-
 src/saga_core/saga_gui/wksp_data_layers.h          |    65 +-
 src/saga_core/saga_gui/wksp_data_manager.cpp       |   482 +-
 src/saga_core/saga_gui/wksp_data_manager.h         |    11 +-
 src/saga_core/saga_gui/wksp_data_menu_file.cpp     |    10 +-
 src/saga_core/saga_gui/wksp_data_menu_files.cpp    |    18 +-
 src/saga_core/saga_gui/wksp_grid.cpp               |    94 +-
 src/saga_core/saga_gui/wksp_grid.h                 |    14 +-
 src/saga_core/saga_gui/wksp_layer.cpp              |    90 +-
 src/saga_core/saga_gui/wksp_layer.h                |    33 +-
 src/saga_core/saga_gui/wksp_layer_classify.cpp     |     8 +-
 src/saga_core/saga_gui/wksp_map.cpp                |   646 +-
 src/saga_core/saga_gui/wksp_map.h                  |    30 +-
 src/saga_core/saga_gui/wksp_map_buttons.cpp        |   373 +-
 src/saga_core/saga_gui/wksp_map_buttons.h          |    57 +-
 src/saga_core/saga_gui/wksp_map_control.cpp        |   144 +-
 src/saga_core/saga_gui/wksp_map_control.h          |     4 +-
 src/saga_core/saga_gui/wksp_map_graticule.cpp      |   625 +
 src/saga_core/saga_gui/wksp_map_graticule.h        |   131 +
 src/saga_core/saga_gui/wksp_map_layer.cpp          |    26 +-
 src/saga_core/saga_gui/wksp_map_manager.cpp        |   134 +-
 src/saga_core/saga_gui/wksp_map_manager.h          |    29 +-
 src/saga_core/saga_gui/wksp_module.cpp             |   169 +-
 src/saga_core/saga_gui/wksp_module_library.cpp     |     6 +-
 src/saga_core/saga_gui/wksp_module_manager.cpp     |   227 +-
 src/saga_core/saga_gui/wksp_module_manager.h       |     5 +-
 src/saga_core/saga_gui/wksp_module_menu.cpp        |     4 +-
 src/saga_core/saga_gui/wksp_pointcloud.cpp         |    41 +-
 src/saga_core/saga_gui/wksp_pointcloud.h           |    12 +-
 src/saga_core/saga_gui/wksp_shapes.cpp             |   307 +-
 src/saga_core/saga_gui/wksp_shapes.h               |   109 +-
 src/saga_core/saga_gui/wksp_shapes_edit.cpp        |   587 +-
 src/saga_core/saga_gui/wksp_shapes_line.cpp        |   117 +-
 src/saga_core/saga_gui/wksp_shapes_line.h          |    16 +-
 src/saga_core/saga_gui/wksp_shapes_point.cpp       |    62 +-
 src/saga_core/saga_gui/wksp_shapes_point.h         |    12 +-
 src/saga_core/saga_gui/wksp_shapes_points.cpp      |    14 +-
 src/saga_core/saga_gui/wksp_shapes_points.h        |     6 +-
 src/saga_core/saga_gui/wksp_shapes_polygon.cpp     |   108 +-
 src/saga_core/saga_gui/wksp_shapes_polygon.h       |    19 +-
 src/saga_core/saga_gui/wksp_table.cpp              |    42 +-
 src/saga_core/saga_gui/wksp_table.h                |     7 +-
 src/saga_core/saga_gui/wksp_tin.cpp                |    25 +-
 src/saga_core/saga_gui/wksp_tin.h                  |    13 +-
 1631 files changed, 177659 insertions(+), 147629 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 751132c..642238c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,20 +1,20 @@
 _______________________________________________________________________________
 
-         SAGA 2.1.1 - System for Automated Geoscientific Analyses
+         SAGA 2.1.2 - System for Automated Geoscientific Analyses
                          http://www.saga-gis.org
 _______________________________________________________________________________
 
 AUTHORS
 _______________________________________________________________________________
 
-Date: November, 3th 2013
+Date: January, 10th 2014
 
 
 A. SAGA GUI - SAGA Graphical User Interface
 -------------------------------------------
 
-Copyrights (c) 2005-2013 by Olaf Conrad
-Portions (c) 2008-2013 by Volker Wichmann
+Copyrights (c) 2005-2014 by Olaf Conrad
+Portions (c) 2008-2014 by Volker Wichmann
 
 GNU General Public License (GPL)
 
@@ -22,7 +22,7 @@ GNU General Public License (GPL)
 B. SAGA CMD - SAGA Command Line Processor
 -----------------------------------------
 
-Copyrights (c) 2005-2013 by Olaf Conrad
+Copyrights (c) 2005-2014 by Olaf Conrad
 
 GNU General Public License (GPL)
 
@@ -30,8 +30,8 @@ GNU General Public License (GPL)
 C. SAGA API - SAGA Application Programming Interface
 ----------------------------------------------------
 
-Copyrights (c) 2002-2013 by Olaf Conrad
-Portions (c) 2008-2013 by Volker Wichmann
+Copyrights (c) 2002-2014 by Olaf Conrad
+Portions (c) 2008-2014 by Volker Wichmann
 Portions (c) 2005-2006 by Victor Olaya
 Portions (c) 2002 by Andre Ringeler
 
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..f3a3790
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,77 @@
+Copyright and License Statement
+_______________________________________________________________________________
+
+
+The System for Automated Geoscientific Analyses (SAGA) is copyright by the
+authors listed below.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License (GPL) and the GNU Lesser General
+Public License (LGPL) as published by the Free Software Foundation.
+
+_______________________________________________________________________________
+
+------------------------------------------
+ SAGA GUI - SAGA Graphical User Interface
+------------------------------------------
+
+Copyrights (c) 2005-2014 by Olaf Conrad
+Portions (c) 2008-2014 by Volker Wichmann
+
+GNU General Public License (GPL)
+
+
+----------------------------------------
+ SAGA CMD - SAGA Command Line Processor
+----------------------------------------
+
+Copyrights (c) 2005-2014 by Olaf Conrad
+
+GNU General Public License (GPL)
+
+
+---------------------------------------------------
+ SAGA API - SAGA Application Programming Interface
+---------------------------------------------------
+
+Copyrights (c) 2002-2014 by Olaf Conrad
+Portions (c) 2008-2014 by Volker Wichmann
+Portions (c) 2005-2006 by Victor Olaya
+Portions (c) 2002 by Andre Ringeler
+
+GNU Lesser General Public License (LGPL)
+
+
+--------------
+ SAGA Modules
+--------------
+
+Please have a look at the module descriptions supplied with each module on
+information about the responsible authors and the licenses used. Most modules
+are licensed under the GNU General Public License (GPL).
+
+
+_______________________________________________________________________________
+
+This program 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 (GPL) and GNU Lesser
+General Public License (LGPL) for more details.
+
+You should have received a copy of both licenses along with this program; if
+not, write to the
+
+    Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor
+    Boston, MA 02110-1301, USA
+
+
+_______________________________________________________________________________
+
+Questions regarding SAGA GIS should be directed to one of the SAGA forums or
+the developer mailing list available here:
+
+https://sourceforge.net/projects/saga-gis/
+
+Project homepage:  http://www.saga-gis.org/
+
diff --git a/Makefile.in b/Makefile.in
index 66cc02c..2658c64 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -36,8 +52,9 @@ host_triplet = @host@
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
-	$(top_srcdir)/configure AUTHORS ChangeLog NEWS config.guess \
-	config.sub depcomp install-sh ltmain.sh missing py-compile
+	$(top_srcdir)/configure AUTHORS COPYING ChangeLog NEWS \
+	config.guess config.sub depcomp install-sh ltmain.sh missing \
+	py-compile
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -64,21 +81,30 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
 	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir dist dist-all distcheck
+	cscope distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -106,7 +132,10 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -130,6 +159,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -157,6 +187,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -169,6 +200,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -198,6 +230,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -231,7 +264,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -259,7 +291,7 @@ all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
@@ -295,10 +327,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-	else :; fi
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -321,11 +351,11 @@ distclean-libtool:
 	-rm -f libtool config.lt
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -389,6 +419,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -452,8 +486,32 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+	-rm -f cscope.files
+
+cscope.files: clean-cscope cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
@@ -489,13 +547,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -524,36 +579,36 @@ distdir: $(DISTFILES)
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__post_remove_distdir)
 
-dist-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__remove_distdir)
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__post_remove_distdir)
 
 dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -564,8 +619,8 @@ distcheck: dist
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -575,7 +630,7 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod u+w $(distdir)
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
@@ -585,6 +640,7 @@ distcheck: dist
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -608,13 +664,21 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
 	  && cd "$$am__cwd" \
 	  || exit 1
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@$(am__cd) '$(distuninstallcheck_dir)' \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -645,10 +709,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -731,13 +800,15 @@ ps-am:
 uninstall-am:
 
 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	ctags-recursive install-am install-strip tags-recursive
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-	distcheck distclean distclean-generic distclean-hdr \
+	all all-am am--refresh check check-am clean clean-cscope \
+	clean-generic clean-libtool cscope cscopelist \
+	cscopelist-recursive ctags ctags-recursive dist dist-all \
+	dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-generic distclean-hdr \
 	distclean-libtool distclean-tags distcleancheck distdir \
 	distuninstallcheck dvi dvi-am html html-am info info-am \
 	install install-am install-data install-data-am install-dvi \
diff --git a/README b/README
index 3f79c88..7a83ca4 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 _______________________________________________________________________________
 
-         SAGA 2.1.1 - System for Automated Geoscientific Analyses
+         SAGA 2.1.2 - System for Automated Geoscientific Analyses
 _______________________________________________________________________________
 
 * Introduction
diff --git a/aclocal.m4 b/aclocal.m4
index 7afc6f5..f20618b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.12.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,28 +13,30 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
-[m4_warning([this file was generated for autoconf 2.63.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 8
+
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.12'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.12.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -50,22 +52,24 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.12.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -84,7 +88,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -110,22 +114,21 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# serial 10
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -144,16 +147,15 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
+# serial 17
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -163,7 +165,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -176,12 +178,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -189,8 +192,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -229,16 +233,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -247,16 +251,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -304,7 +308,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -314,28 +318,34 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 5
+# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
@@ -354,7 +364,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -366,21 +376,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -398,7 +406,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -408,14 +416,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 16
+# serial 19
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -461,31 +468,37 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+[$0: two- and three-arguments forms are deprecated.  For more info, see:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
@@ -496,28 +509,35 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
 			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-		  [_AM_DEPENDENCIES(CC)],
-		  [define([AC_PROG_CC],
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES([CC])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-		  [_AM_DEPENDENCIES(CXX)],
-		  [define([AC_PROG_CXX],
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-		  [_AM_DEPENDENCIES(OBJC)],
-		  [define([AC_PROG_OBJC],
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+dnl Support for Objective C++ was only introduced in Autoconf 2.65,
+dnl but we still cater to Autoconf 2.62.
+m4_ifdef([AC_PROG_OBJCXX],
+[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
 ])
 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
@@ -545,12 +565,14 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 8
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -564,9 +586,9 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -589,13 +611,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -614,7 +636,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -641,14 +663,13 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
+# serial 7
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -678,45 +699,19 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -724,13 +719,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -741,13 +736,14 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 9
+
 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 # ---------------------------------------------------------------------------
 # Adds support for distributing Python modules and packages.  To
@@ -775,8 +771,10 @@ AC_DEFUN([AM_PATH_PYTHON],
   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
   dnl supported. (2.0 was released on October 16, 2000).
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-                    [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl
-python2.1 python2.0])
+[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
+ python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
+
+  AC_ARG_VAR([PYTHON], [the Python interpreter])
 
   m4_if([$1],[],[
     dnl No version check is needed.
@@ -789,10 +787,11 @@ python2.1 python2.0])
     dnl A version check is needed.
     if test -n "$PYTHON"; then
       # If the user set $PYTHON, use it and don't search something else.
-      AC_MSG_CHECKING([whether $PYTHON version >= $1])
+      AC_MSG_CHECKING([whether $PYTHON version is >= $1])
       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
-			      [AC_MSG_RESULT(yes)],
-			      [AC_MSG_ERROR(too old)])
+			      [AC_MSG_RESULT([yes])],
+			      [AC_MSG_RESULT([no])
+			       AC_MSG_ERROR([Python interpreter is too old])])
       am_display_PYTHON=$PYTHON
     else
       # Otherwise, try each interpreter until we find one that satisfies
@@ -848,9 +847,7 @@ python2.1 python2.0])
   dnl   site-packages directory, not the python standard library
   dnl   directory like in previous automake betas.  This behavior
   dnl   is more consistent with lispdir.m4 for example.
-  dnl Query distutils for this directory.  distutils does not exist in
-  dnl Python 1.5, so we fall back to the hardcoded directory if it
-  dnl doesn't work.
+  dnl Query distutils for this directory.
   AC_CACHE_CHECK([for $am_display_PYTHON script directory],
     [am_cv_python_pythondir],
     [if test "x$prefix" = xNONE
@@ -859,8 +856,7 @@ python2.1 python2.0])
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -886,9 +882,7 @@ python2.1 python2.0])
 
   dnl pyexecdir -- directory for installing python extension modules
   dnl   (shared libraries)
-  dnl Query distutils for this directory.  distutils does not exist in
-  dnl Python 1.5, so we fall back to the hardcoded directory if it
-  dnl doesn't work.
+  dnl Query distutils for this directory.
   AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
     [am_cv_python_pyexecdir],
     [if test "x$exec_prefix" = xNONE
@@ -897,8 +891,7 @@ python2.1 python2.0])
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -946,12 +939,14 @@ for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
 sys.exit(sys.hexversion < minverhex)"
   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_RUN_LOG(COMMAND)
 # -------------------
 # Run COMMAND, save the exit status in ac_status, and log it.
@@ -965,22 +960,18 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 9
 
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -991,32 +982,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -1026,43 +1025,61 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -1071,24 +1088,24 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -1099,10 +1116,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
@@ -1110,7 +1128,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive])
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
+# Solaris sh will not grok spaces in the rhs of '-'.
 for _am_tool in $_am_tools
 do
   case $_am_tool in
diff --git a/config.guess b/config.guess
index dc84c68..de8e6dd 100755
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-11-20'
+timestamp='2012-02-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ timestamp='2009-11-20'
 # 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 - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -56,8 +54,9 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,12 +138,22 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_MACHINE}" in
+  i?86)
+     test -z "$VENDOR" && VENDOR=pc
+     ;;
+  *)
+     test -z "$VENDOR" && VENDOR=unknown
+     ;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -180,7 +189,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-	        os=netbsd
+		os=netbsd
 		;;
 	esac
 	# The OS release
@@ -203,19 +212,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
 	exit ;;
     *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
 	exit ;;
     *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
 	exit ;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
 	exit ;;
     *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
 	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
@@ -223,7 +232,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 		;;
 	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 		;;
 	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +278,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
@@ -280,13 +292,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo alpha-dec-winnt3.5
 	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
+	echo m68k-${VENDOR}-sysv4
 	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
+	echo ${UNAME_MACHINE}-${VENDOR}-amigaos
 	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
+	echo ${UNAME_MACHINE}-${VENDOR}-morphos
 	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
@@ -295,13 +307,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo s390-ibm-zvmoe
 	exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
     arm:riscos:*:*|arm:RISCOS:*:*)
-	echo arm-unknown-riscos
+	echo arm-${VENDOR}-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
@@ -394,23 +406,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-${VENDOR}-mint${UNAME_RELEASE}
+	exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
 	exit ;;
@@ -480,8 +492,8 @@ EOF
 	echo m88k-motorola-sysv3
 	exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -494,7 +506,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -551,7 +563,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -594,52 +606,52 @@ EOF
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+			esac ;;
+		    esac
 		fi
 		if [ "${HP_ARCH}" = "" ]; then
 		    eval $set_cc_for_build
-		    sed 's/^              //' << EOF >$dummy.c
+		    sed 's/^		//' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-              	{
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-              	case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-              	    switch (bits)
-              		{
-              		case 64: puts ("hppa2.0w"); break;
-              		case 32: puts ("hppa2.0n"); break;
-              		default: puts ("hppa2.0"); break;
-              		} break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-              	    puts ("hppa2.0"); break;
-              #endif
-              	default: puts ("hppa1.0"); break;
-              	}
-                  exit (0);
-              }
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
 EOF
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -720,9 +732,9 @@ EOF
 	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	    echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
 	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
+	    echo ${UNAME_MACHINE}-${VENDOR}-osf1
 	fi
 	exit ;;
     parisc*:Lites*:*:*)
@@ -730,22 +742,22 @@ EOF
 	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit ;;
+	exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit ;;
+	exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit ;;
+	exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit ;;
+	exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit ;;
+	exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
@@ -769,32 +781,31 @@ EOF
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 	exit ;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
 	exit ;;
     *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
 	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	esac
 	exit ;;
     i*:CYGWIN*:*)
@@ -803,23 +814,26 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
     i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
 	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
     *:Interix*:*)
-    	case ${UNAME_MACHINE} in
+	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
 	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
+		echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
 		exit ;;
 	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
+		echo ia64-${VENDOR}-interix${UNAME_RELEASE}
 		exit ;;
 	esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
@@ -838,25 +852,32 @@ EOF
 	echo ${UNAME_MACHINE}-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
+	echo x86_64-${VENDOR}-cygwin
 	exit ;;
     p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
+	echo powerpcle-${VENDOR}-cygwin
 	exit ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -866,32 +887,41 @@ EOF
 	  EV6)   UNAME_MACHINE=alphaev6 ;;
 	  EV67)  UNAME_MACHINE=alphaev67 ;;
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
+	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
+	    else
+		echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabihf
+	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	LIBC=gnu
@@ -905,13 +935,13 @@ EOF
 	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -930,51 +960,54 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-${VENDOR}-linux-gnu
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-${VENDOR}-linux-gnu
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
+	  PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
+	  *)    echo hppa-${VENDOR}-linux-gnu ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-${VENDOR}-linux-gnu
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-${VENDOR}-linux-gnu
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     vax:Linux:*:*)
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -983,11 +1016,11 @@ EOF
 	echo i386-sequent-sysv4
 	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+	# Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit ;;
     i*86:OS/2:*:*)
@@ -996,16 +1029,16 @@ EOF
 	echo ${UNAME_MACHINE}-pc-os2-emx
 	exit ;;
     i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
+	echo ${UNAME_MACHINE}-${VENDOR}-stop
 	exit ;;
     i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
+	echo ${UNAME_MACHINE}-${VENDOR}-atheos
 	exit ;;
     i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
 	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
+	echo i386-${VENODR}-lynxos${UNAME_RELEASE}
 	exit ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
@@ -1019,13 +1052,13 @@ EOF
 	fi
 	exit ;;
     i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
@@ -1047,13 +1080,13 @@ EOF
 	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
 	# Note: whatever this is, it MUST be the same as what config.sub
 	# prints for the "djgpp" host, or else GDB configury will decide that
 	# this is a cross-build.
 	echo i586-pc-msdosdjgpp
-        exit ;;
+	exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1064,7 +1097,7 @@ EOF
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	  echo i860-${VENODR}-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
 	exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1088,8 +1121,8 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
 	OS_REL='.3'
 	test -r /etc/.relid \
@@ -1101,19 +1134,19 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
 	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit ;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
@@ -1132,10 +1165,10 @@ EOF
 		echo ns32k-sni-sysv
 	fi
 	exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel at ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
@@ -1161,11 +1194,11 @@ EOF
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-	        echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv${UNAME_RELEASE}
 	else
-	        echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-${VENDOR}-sysv${UNAME_RELEASE}
 	fi
-        exit ;;
+	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
 	exit ;;
@@ -1230,6 +1263,9 @@ EOF
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
@@ -1254,13 +1290,13 @@ EOF
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
+	echo ${UNAME_MACHINE}-${VENDOR}-plan9
 	exit ;;
     *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
+	echo pdp10-${VENDOR}-tops10
 	exit ;;
     *:TENEX:*:*)
-	echo pdp10-unknown-tenex
+	echo pdp10-${VENDOR}-tenex
 	exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
@@ -1269,19 +1305,19 @@ EOF
 	echo pdp10-xkl-tops20
 	exit ;;
     *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
+	echo pdp10-${VENDOR}-tops20
 	exit ;;
     *:ITS:*:*)
-	echo pdp10-unknown-its
+	echo pdp10-${VENDOR}-its
 	exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux${UNAME_RELEASE}
 	exit ;;
     *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit ;;
     *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
@@ -1299,6 +1335,9 @@ EOF
     i*86:AROS:*:*)
 	echo ${UNAME_MACHINE}-pc-aros
 	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR}-esx
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1321,11 +1360,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+	"4"
 #else
-	  ""
+	""
 #endif
-         ); exit (0);
+	); exit (0);
 #endif
 #endif
 
diff --git a/config.h.in b/config.h.in
index d422fb0..2234daa 100644
--- a/config.h.in
+++ b/config.h.in
@@ -134,6 +134,9 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
diff --git a/config.sub b/config.sub
index 2a55a50..59bb593 100755
--- a/config.sub
+++ b/config.sub
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-11-20'
+timestamp='2012-04-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@ timestamp='2009-11-20'
 # 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 - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -75,8 +73,9 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,13 +122,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -156,8 +160,8 @@ case $os in
 		os=
 		basic_machine=$1
 		;;
-        -bluegene*)
-	        os=-cnk
+	-bluegene*)
+		os=-cnk
 		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
@@ -173,10 +177,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -221,6 +225,12 @@ case $os in
 	-isc*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
 	-lynx*)
 		os=-lynxos
 		;;
@@ -245,17 +255,22 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 	| maxq | mb | microblaze | mcore | mep | metag \
@@ -281,29 +296,39 @@ case $basic_machine in
 	| moxie \
 	| mt \
 	| msp430 \
+	| nds32 | nds32le | nds32be \
 	| nios | nios2 \
 	| ns16k | ns32k \
+	| open8 \
 	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| rx \
+	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
-	| v850 | v850e \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -313,6 +338,21 @@ case $basic_machine in
 		basic_machine=mt-unknown
 		;;
 
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -327,21 +367,25 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -367,25 +411,29 @@ case $basic_machine in
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
 	| nios-* | nios2-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* | rx-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
 	| tron-* \
 	| ubicom32-* \
-	| v850-* | v850e-* | vax-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
 	| z8k-* | z80-*)
@@ -410,7 +458,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -480,11 +528,20 @@ case $basic_machine in
 		basic_machine=powerpc-ibm
 		os=-cnk
 		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
-        cegcc)
+	cegcc)
 		basic_machine=arm-unknown
 		os=-cegcc
 		;;
@@ -516,7 +573,7 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16)
+	cr16 | cr16-*)
 		basic_machine=cr16-unknown
 		os=-elf
 		;;
@@ -674,7 +731,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -732,7 +788,7 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-        microblaze)
+	microblaze)
 		basic_machine=microblaze-xilinx
 		;;
 	mingw32)
@@ -771,10 +827,18 @@ case $basic_machine in
 	ms1-*)
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -839,6 +903,12 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -921,9 +991,10 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc)	basic_machine=powerpc-unknown
+	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -1017,6 +1088,9 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -1073,20 +1147,8 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
-		;;
 	tile*)
-		basic_machine=tile-unknown
+		basic_machine=$basic_machine-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1156,6 +1218,9 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1253,11 +1318,11 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+	# First match some system type aliases
+	# that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
-        -auroraux)
-	        os=-auroraux
+	-auroraux)
+		os=-auroraux
 		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1293,8 +1358,9 @@ case $os in
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1341,7 +1407,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1390,7 +1456,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1435,6 +1501,8 @@ case $os in
 	-dicos*)
 		os=-dicos
 		;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1457,10 +1525,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+	score-*)
 		os=-elf
 		;;
-        spu-*)
+	spu-*)
 		os=-elf
 		;;
 	*-acorn)
@@ -1472,8 +1540,17 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-        c4x-* | tic4x-*)
-        	os=-coff
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1493,14 +1570,11 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
 		;;
-        mep-*)
+	mep-*)
 		os=-elf
 		;;
 	mips*-cisco)
@@ -1527,7 +1601,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
diff --git a/configure b/configure
index 03e3418..668458f 100755
--- a/configure
+++ b/configure
@@ -1,20 +1,22 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for saga 2.1.1.
+# Generated by GNU Autoconf 2.69 for saga 2.1.2.
 #
 # Report bugs to <BUG-REPORT-ADDRESS>.
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -22,23 +24,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
 fi
 
 
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
 as_nl='
 '
 export as_nl
@@ -46,7 +40,13 @@ export as_nl
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -57,7 +57,7 @@ else
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in
+      case $arg in #(
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -80,13 +80,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
   }
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
 
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
@@ -96,15 +89,16 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -116,12 +110,16 @@ if test "x$as_myself" = x; then
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
+  exit 1
 fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
@@ -133,7 +131,302 @@ export LC_ALL
 LANGUAGE=C
 export LANGUAGE
 
-# Required to use basename.
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and BUG-REPORT-ADDRESS
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -147,8 +440,12 @@ else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -168,566 +465,115 @@ $as_echo X/"$0" |
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 
-if test "x$CONFIG_SHELL" = x; then
-  if (eval ":") 2>/dev/null; then
-  as_have_required=yes
-else
-  as_have_required=no
-fi
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
-  if test $as_have_required = yes &&	 (eval ":
-(as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
 }
 
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
 
-if as_func_ret_success; then
-  :
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
 else
-  exitcode=1
-  echo as_func_ret_success failed.
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
 fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
-  exitcode=1
-  echo positional parameters were not saved.
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
 fi
 
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=\$LINENO
-  as_lineno_2=\$LINENO
-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
-  :
-else
-  as_candidate_shells=
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  case $as_dir in
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
-	   done;;
-       esac
-done
-IFS=$as_save_IFS
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
-      for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells that exist, to save several forks.
-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		{ ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
-fi
+SHELL=${CONFIG_SHELL-/bin/sh}
 
 
-:
-_ASEOF
-}; then
-  CONFIG_SHELL=$as_shell
-	       as_have_required=yes
-	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
-fi
-
-
-:
-(as_func_return () {
-  (exit $1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
-  break
-fi
-
-fi
-
-      done
-
-      if test "x$CONFIG_SHELL" != x; then
-  for as_var in BASH_ENV ENV
-	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-	done
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
-    if test $as_have_required = no; then
-  echo This script requires a shell more modern than all the
-      echo shells that I found on your system.  Please install a
-      echo modern shell, or manually run the script under such a
-      echo shell if you do have one.
-      { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell bug-autoconf at gnu.org about your system,
-  echo including any error possibly output before this message.
-  echo This can help us improve future autoconf versions.
-  echo Configuration will now proceed without shell functions.
-}
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
-  case `echo 'x\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -p'
-  fi
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-$*
-_LT_EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
-
-	  if test "$prev" != 'sed 50q "$0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
 #
 # Initializations.
@@ -740,14 +586,14 @@ cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Identity of this package.
 PACKAGE_NAME='saga'
 PACKAGE_TARNAME='saga'
-PACKAGE_VERSION='2.1.1'
-PACKAGE_STRING='saga 2.1.1'
+PACKAGE_VERSION='2.1.2'
+PACKAGE_STRING='saga 2.1.2'
 PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
+PACKAGE_URL=''
 
 ac_unique_file="src/saga_core/saga_gui/wksp_data_menu_files.cpp"
 # Factoring default headers for most tests.
@@ -847,9 +693,11 @@ OTOOL
 LIPO
 NMEDIT
 DSYMUTIL
-lt_ECHO
+MANIFEST_TOOL
 RANLIB
+ac_ct_AR
 AR
+DLLTOOL
 OBJDUMP
 LN_S
 NM
@@ -878,6 +726,7 @@ CC
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -944,6 +793,7 @@ bindir
 program_transform_name
 prefix
 exec_prefix
+PACKAGE_URL
 PACKAGE_BUGREPORT
 PACKAGE_STRING
 PACKAGE_VERSION
@@ -960,6 +810,7 @@ enable_static
 with_pic
 enable_fast_install
 with_gnu_ld
+with_sysroot
 enable_libtool_lock
 with_local
 with_postgresql
@@ -982,6 +833,7 @@ CC
 CFLAGS
 CPP
 CXXCPP
+PYTHON
 PYTHON_VERSION'
 
 
@@ -1045,8 +897,9 @@ do
   fi
 
   case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -1091,8 +944,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1118,8 +970,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1323,8 +1174,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1340,8 +1190,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1371,17 +1220,17 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
@@ -1390,7 +1239,7 @@ Try \`$0 --help' for more information." >&2
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1398,15 +1247,13 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
-   { (exit 1); exit 1; }; } ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1429,8 +1276,7 @@ do
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1444,8 +1290,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1460,11 +1304,9 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: working directory cannot be determined" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1503,13 +1345,11 @@ else
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
-   { (exit 1); exit 1; }; }
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1535,7 +1375,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.1.1 to adapt to many kinds of systems.
+\`configure' configures saga 2.1.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1549,7 +1389,7 @@ Configuration:
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1605,7 +1445,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of saga 2.1.1:";;
+     short | recursive ) echo "Configuration of saga 2.1.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1613,8 +1453,10 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -1629,9 +1471,11 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic              try to use only PIC/non-PIC objects [default=use
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot=DIR Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).
   --with-local=dir        search /usr/local or other directory for includes and libs
   --with-postgresql=[ARG] use PostgreSQL library [default=yes], optionally
                           specify path to pg_config
@@ -1642,12 +1486,13 @@ Some influential environment variables:
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CC          C compiler command
   CFLAGS      C compiler flags
   CPP         C preprocessor
   CXXCPP      C++ preprocessor
+  PYTHON      the Python interpreter
   PYTHON_VERSION
               The installed Python version to use, for example '2.3'. This
               string will be appended to the Python interpreter canonical
@@ -1719,36 +1564,566 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-saga configure 2.1.1
-generated by GNU Autoconf 2.63
+saga configure 2.1.2
+generated by GNU Autoconf 2.69
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
   exit
 fi
-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.1.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
 
-  $ $0 $@
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
 
-_ACEOF
-exec 5>>config.log
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
 {
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## --------------------------------- ##
+## Report this to BUG-REPORT-ADDRESS ##
+## --------------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+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.1.2, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
 uname -s = `(uname -s) 2>/dev/null || echo unknown`
 uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
@@ -1770,8 +2145,8 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  $as_echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
 IFS=$as_save_IFS
 
 } >&5
@@ -1808,9 +2183,9 @@ do
       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1826,13 +2201,13 @@ do
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -1844,11 +2219,9 @@ trap 'exit_status=$?
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -1857,13 +2230,13 @@ _ASBOX
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -1882,11 +2255,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -1899,11 +2270,9 @@ _ASBOX
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -1917,11 +2286,9 @@ _ASBOX
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -1935,46 +2302,53 @@ _ASBOX
     exit $exit_status
 ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
+$as_echo "/* confdefs.h */" > confdefs.h
+
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer an explicitly selected file to automatically selected ones.
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -1985,19 +2359,23 @@ fi
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test -r "$ac_site_file"; then
-    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
@@ -2005,7 +2383,7 @@ $as_echo "$as_me: loading cache $cache_file" >&6;}
     esac
   fi
 else
-  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
 $as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -2020,11 +2398,11 @@ for ac_var in $ac_precious_vars; do
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
@@ -2034,17 +2412,17 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
 	ac_old_val_w=`echo x $ac_old_val`
 	ac_new_val_w=`echo x $ac_new_val`
 	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
 	  ac_cache_corrupted=:
 	else
-	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
 	  eval $ac_var=\$ac_old_val
 	fi
-	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
@@ -2056,43 +2434,20 @@ $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2105,7 +2460,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_config_headers="$ac_config_headers config.h"
 
 
-am__api_version='1.11'
+am__api_version='1.12'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2124,9 +2479,7 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -2152,10 +2505,10 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 # Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2163,11 +2516,11 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -2175,7 +2528,7 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -2204,7 +2557,7 @@ case $as_dir/ in
     ;;
 esac
 
-done
+  done
 IFS=$as_save_IFS
 
 rm -rf conftest.one conftest.two conftest.dir
@@ -2220,7 +2573,7 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
 $as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2231,68 +2584,73 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
-$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
-   { (exit 1); exit 1; }; };;
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
-$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
-   { (exit 1); exit 1; }; };;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&5
-$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
    # Ok.
    :
 else
-   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-$as_echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
-   { (exit 1); exit 1; }; }
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
 fi
-{ $as_echo "$as_me:$LINENO: result: yes" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2319,8 +2677,8 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -2332,17 +2690,17 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
+if ${ac_cv_prog_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -2353,24 +2711,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
 $as_echo "$STRIP" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2380,9 +2738,9 @@ if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -2393,24 +2751,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
 $as_echo "$ac_ct_STRIP" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2419,7 +2777,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -2432,10 +2790,10 @@ fi
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 
-{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2443,9 +2801,9 @@ for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in mkdir gmkdir; do
+    for ac_prog in mkdir gmkdir; do
 	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
 	     'mkdir (GNU coreutils) '* | \
 	     'mkdir (coreutils) '* | \
@@ -2455,11 +2813,12 @@ do
 	   esac
 	 done
        done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 
+  test -d ./--version && rmdir ./--version
   if test "${ac_cv_path_mkdir+set}" = set; then
     MKDIR_P="$ac_cv_path_mkdir -p"
   else
@@ -2467,26 +2826,19 @@ fi
     # value for MKDIR_P within a source directory, because that will
     # break other packages using the cache if that directory is
     # removed, or if the value is a relative name.
-    test -d ./--version && rmdir ./--version
     MKDIR_P="$ac_install_sh -d"
   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -2497,24 +2849,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
 $as_echo "$AWK" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2522,11 +2874,11 @@ fi
   test -n "$AWK" && break
 done
 
-{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -2534,7 +2886,7 @@ SHELL = /bin/sh
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -2544,11 +2896,11 @@ esac
 rm -f conftest.make
 fi
 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
   SET_MAKE=
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
@@ -2568,9 +2920,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
   am__isrc=' -I$(srcdir)'
   # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
-    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
   fi
 fi
 
@@ -2586,7 +2936,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='saga'
- VERSION='2.1.1'
+ VERSION='2.1.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2614,20 +2964,21 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+mkdir_p="$MKDIR_P"
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
 
-
-{ $as_echo "$as_me:$LINENO: checking how to create a ustar tar archive" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
 $as_echo_n "checking how to create a ustar tar archive... " >&6; }
 # Loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar plaintar pax cpio none'
 _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
+# Solaris sh will not grok spaces in the rhs of '-'.
 for _am_tool in $_am_tools
 do
   case $_am_tool in
@@ -2694,13 +3045,13 @@ do
 done
 rm -rf conftest.dir
 
-if test "${am_cv_prog_tar_ustar+set}" = set; then
+if ${am_cv_prog_tar_ustar+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   am_cv_prog_tar_ustar=$_am_tool
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $am_cv_prog_tar_ustar" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
 $as_echo "$am_cv_prog_tar_ustar" >&6; }
 
 
@@ -2724,9 +3075,9 @@ if test -z "$CXX"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
+if ${ac_cv_prog_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
@@ -2737,24 +3088,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
 $as_echo "$CXX" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2768,9 +3119,9 @@ if test -z "$CXX"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
@@ -2781,24 +3132,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
 $as_echo "$ac_ct_CXX" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2811,7 +3162,7 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -2822,48 +3173,31 @@ fi
   fi
 fi
 # Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2879,8 +3213,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5
-$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
+$as_echo_n "checking whether the C++ compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -2896,17 +3230,17 @@ do
 done
 rm -f $ac_rmfiles
 
-if { (ac_try="$ac_link_default"
+if { { ac_try="$ac_link_default"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
@@ -2923,7 +3257,7 @@ do
 	# certainly right.
 	break;;
     *.* )
-        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
 	then :; else
 	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	fi
@@ -2942,84 +3276,41 @@ test "$ac_cv_exeext" = no && ac_cv_exeext=
 else
   ac_file=''
 fi
-
-{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-if test -z "$ac_file"; then
-  $as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: C++ compiler cannot create executables
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C++ compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }; }
+as_fn_error 77 "C++ compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
+$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5
-$as_echo_n "checking whether the C++ compiler works... " >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run C++ compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run C++ compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
-if { (ac_try="$ac_link"
+if { { ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3034,32 +3325,83 @@ for ac_file in conftest.exe conftest conftest.*; do
   esac
 done
 else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
-rm -f conftest$ac_cv_exeext
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3071,17 +3413,17 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
@@ -3094,31 +3436,23 @@ else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3132,37 +3466,16 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GXX=yes
@@ -3171,20 +3484,16 @@ else
 fi
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
+if ${ac_cv_prog_cxx_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
    ac_cxx_werror_flag=yes
    ac_cv_prog_cxx_g=no
    CXXFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3195,35 +3504,11 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_cv_prog_cxx_g=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CXXFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3234,36 +3519,12 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_compile "$LINENO"; then :
 
-	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 	 CXXFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3274,42 +3535,17 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_cv_prog_cxx_g=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
 $as_echo "$ac_cv_prog_cxx_g" >&6; }
 if test "$ac_test_CXXFLAGS" = set; then
   CXXFLAGS=$ac_save_CXXFLAGS
@@ -3343,14 +3579,14 @@ am__doit:
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
 $as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -3371,18 +3607,19 @@ if test "$am__include" = "#"; then
 fi
 
 
-{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
 $as_echo "$_am_result" >&6; }
 rm -f confinc confmf
 
 # Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
+if test "${enable_dependency_tracking+set}" = set; then :
   enableval=$enable_dependency_tracking;
 fi
 
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -3396,17 +3633,18 @@ fi
 
 depcc="$CXX"  am_compiler_list=
 
-{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3440,16 +3678,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -3458,16 +3696,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -3506,7 +3744,7 @@ else
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
@@ -3529,9 +3767,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3542,24 +3780,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3569,9 +3807,9 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3582,24 +3820,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3608,7 +3846,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -3622,9 +3860,9 @@ if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3635,24 +3873,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3662,9 +3900,9 @@ fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3676,18 +3914,18 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -3706,10 +3944,10 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3721,9 +3959,9 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3734,24 +3972,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3765,9 +4003,9 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3778,24 +4016,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3808,7 +4046,7 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -3819,62 +4057,42 @@ fi
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3888,37 +4106,16 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GCC=yes
@@ -3927,20 +4124,16 @@ else
 fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3951,35 +4144,11 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3990,36 +4159,12 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_compile "$LINENO"; then :
 
-	ac_c_werror_flag=$ac_save_c_werror_flag
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
 	 CFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4030,42 +4175,17 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
 $as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -4082,23 +4202,18 @@ else
     CFLAGS=
   fi
 fi
-{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4150,32 +4265,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
 	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+  if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_c89=$ac_arg
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
@@ -4186,17 +4278,19 @@ fi
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
 $as_echo "none needed" >&6; } ;;
   xno)
-    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
 $as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -4206,17 +4300,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CC"   am_compiler_list=
 
-{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4250,16 +4345,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4268,16 +4363,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4316,7 +4411,7 @@ else
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
@@ -4331,109 +4426,17 @@ else
 fi
 
 
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 case `pwd` in
   *\ * | *\	*)
-    { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
 esac
 
 
 
-macro_version='2.2.6b'
-macro_revision='1.3017'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -4451,35 +4454,27 @@ ltmain="$ac_aux_dir/ltmain.sh"
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
-{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-$as_echo "$as_me: error: invalid value of canonical build" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -4495,28 +4490,24 @@ IFS=$ac_save_IFS
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-$as_echo "$as_me: error: invalid value of canonical host" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -4532,9 +4523,78 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then
+if ${ac_cv_path_SED+:} false; then :
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -4542,7 +4602,7 @@ else
        ac_script="$ac_script$as_nl$ac_script"
      done
      echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     $as_unset ac_script || ac_script=
+     { ac_script=; unset ac_script;}
      if test -z "$SED"; then
   ac_path_SED_found=false
   # Loop through the user's path and test for each of PROGNAME-LIST
@@ -4551,10 +4611,10 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in sed gsed; do
+    for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+      as_fn_executable_p "$ac_path_SED" || continue
 # Check for GNU ac_path_SED and select it if it is found.
   # Check for GNU $ac_path_SED
 case `"$ac_path_SED" --version 2>&1` in
@@ -4571,7 +4631,7 @@ case `"$ac_path_SED" --version 2>&1` in
     $as_echo '' >> "conftest.nl"
     "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_SED_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_SED="$ac_path_SED"
@@ -4586,19 +4646,17 @@ esac
       $ac_path_SED_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_SED"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
-$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
   fi
 else
   ac_cv_path_SED=$SED
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
 $as_echo "$ac_cv_path_SED" >&6; }
  SED="$ac_cv_path_SED"
   rm -f conftest.sed
@@ -4616,9 +4674,9 @@ Xsed="$SED -e 1s/^X//"
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -4629,10 +4687,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in grep ggrep; do
+    for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4649,7 +4707,7 @@ case `"$ac_path_GREP" --version 2>&1` in
     $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_GREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_GREP="$ac_path_GREP"
@@ -4664,26 +4722,24 @@ esac
       $ac_path_GREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
 $as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4697,10 +4753,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in egrep; do
+    for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -4717,7 +4773,7 @@ case `"$ac_path_EGREP" --version 2>&1` in
     $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_EGREP="$ac_path_EGREP"
@@ -4732,12 +4788,10 @@ esac
       $ac_path_EGREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -4745,14 +4799,14 @@ fi
 
    fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
 $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
 $as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then
+if ${ac_cv_path_FGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
@@ -4766,10 +4820,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in fgrep; do
+    for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+      as_fn_executable_p "$ac_path_FGREP" || continue
 # Check for GNU ac_path_FGREP and select it if it is found.
   # Check for GNU $ac_path_FGREP
 case `"$ac_path_FGREP" --version 2>&1` in
@@ -4786,7 +4840,7 @@ case `"$ac_path_FGREP" --version 2>&1` in
     $as_echo 'FGREP' >> "conftest.nl"
     "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_FGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_FGREP="$ac_path_FGREP"
@@ -4801,12 +4855,10 @@ esac
       $ac_path_FGREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_FGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_FGREP=$FGREP
@@ -4814,7 +4866,7 @@ fi
 
    fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
 $as_echo "$ac_cv_path_FGREP" >&6; }
  FGREP="$ac_cv_path_FGREP"
 
@@ -4840,7 +4892,7 @@ test -z "$GREP" && GREP=grep
 
 
 # Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
+if test "${with_gnu_ld+set}" = set; then :
   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
@@ -4849,7 +4901,7 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
@@ -4879,13 +4931,13 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
-  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if test "${lt_cv_path_LD+set}" = set; then
+if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
@@ -4916,18 +4968,16 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
+if ${lt_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
@@ -4940,7 +4990,7 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
@@ -4952,9 +5002,9 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
+if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
@@ -5001,20 +5051,23 @@ else
   : ${lt_cv_path_NM=no}
 fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
 if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+if ${ac_cv_prog_DUMPBIN+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$DUMPBIN"; then
@@ -5025,24 +5078,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 DUMPBIN=$ac_cv_prog_DUMPBIN
 if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
 $as_echo "$DUMPBIN" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5052,13 +5105,13 @@ fi
 fi
 if test -z "$DUMPBIN"; then
   ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  for ac_prog in dumpbin "link -dump"
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_DUMPBIN"; then
@@ -5069,24 +5122,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
 if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
 $as_echo "$ac_ct_DUMPBIN" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5099,7 +5152,7 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -5107,6 +5160,15 @@ esac
   fi
 fi
 
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
 
   if test "$DUMPBIN" != ":"; then
     NM="$DUMPBIN"
@@ -5119,44 +5181,44 @@ test -z "$NM" && NM=nm
 
 
 
-{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if test "${lt_cv_nm_interface+set}" = set; then
+if ${lt_cv_nm_interface+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:5129: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5132: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5135: output\"" >&5)
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
   fi
   rm -f conftest*
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
 $as_echo "$lt_cv_nm_interface" >&6; }
 
-{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
 $as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
 $as_echo "no, using $LN_S" >&6; }
 fi
 
 # find the maximum length of command line arguments
-{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     i=0
@@ -5189,6 +5251,11 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
   amigaos*)
     # On AmigaOS with pdksh, this test takes hours, literally.
     # So we just punt and use a minimum line length of 8192.
@@ -5214,6 +5281,11 @@ else
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -5253,8 +5325,8 @@ else
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
@@ -5274,10 +5346,10 @@ else
 fi
 
 if test -n $lt_cv_sys_max_cmd_len ; then
-  { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: none" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
 $as_echo "none" >&6; }
 fi
 max_cmd_len=$lt_cv_sys_max_cmd_len
@@ -5291,27 +5363,27 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
-{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
 # Try some XSI features
 xsi_shell=no
 ( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
     && eval 'test $(( 1 + 1 )) -eq 2 \
     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
   && xsi_shell=yes
-{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
 $as_echo "$xsi_shell" >&6; }
 
 
-{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
 lt_shell_append=no
 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
     >/dev/null 2>&1 \
   && lt_shell_append=yes
-{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
 $as_echo "$lt_shell_append" >&6; }
 
 
@@ -5346,14 +5418,88 @@ esac
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
 $as_echo_n "checking for $LD option to reload object files... " >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
+if ${lt_cv_ld_reload_flag+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_ld_reload_flag='-r'
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
 $as_echo "$lt_cv_ld_reload_flag" >&6; }
 reload_flag=$lt_cv_ld_reload_flag
 case $reload_flag in
@@ -5362,6 +5508,11 @@ case $reload_flag in
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
   darwin*)
     if test "$GCC" = yes; then
       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -5382,9 +5533,9 @@ esac
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+if ${ac_cv_prog_OBJDUMP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OBJDUMP"; then
@@ -5395,24 +5546,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 OBJDUMP=$ac_cv_prog_OBJDUMP
 if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
 $as_echo "$OBJDUMP" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5422,9 +5573,9 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
   ac_ct_OBJDUMP=$OBJDUMP
   # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OBJDUMP"; then
@@ -5435,24 +5586,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
 if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
 $as_echo "$ac_ct_OBJDUMP" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5461,7 +5612,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -5481,9 +5632,9 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
 
 
 
-{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
+if ${lt_cv_deplibs_check_method+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_file_magic_cmd='$MAGIC_CMD'
@@ -5525,16 +5676,18 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
 
-cegcc)
+cegcc*)
   # use the weaker test based on 'objdump'. See mingw*.
   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
@@ -5564,6 +5717,10 @@ gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
   case $host_cpu in
@@ -5572,11 +5729,11 @@ hpux10.20* | hpux11*)
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     ;;
   hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
     lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   esac
@@ -5597,8 +5754,8 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -5677,8 +5834,23 @@ tpf*)
 esac
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
 $as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -5694,12 +5866,166 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
+if ${ac_cv_prog_AR+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AR"; then
@@ -5710,36 +6036,40 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
 $as_echo "$AR" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
+    test -n "$AR" && break
+  done
 fi
-if test -z "$ac_cv_prog_AR"; then
+if test -z "$AR"; then
   ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_AR"; then
@@ -5750,48 +6080,108 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AR="ar"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
 $as_echo "$ac_ct_AR" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
+
+  test -n "$ac_ct_AR" && break
+done
+
   if test "x$ac_ct_AR" = x; then
     AR="false"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     AR=$ac_ct_AR
   fi
-else
-  AR="$ac_cv_prog_AR"
 fi
 
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
 
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
 
 
 
@@ -5802,9 +6192,9 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
+if ${ac_cv_prog_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -5815,24 +6205,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
 $as_echo "$STRIP" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5842,9 +6232,9 @@ if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -5855,24 +6245,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
 $as_echo "$ac_ct_STRIP" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5881,7 +6271,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -5901,9 +6291,9 @@ test -z "$STRIP" && STRIP=:
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
+if ${ac_cv_prog_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -5914,24 +6304,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
 $as_echo "$RANLIB" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5941,9 +6331,9 @@ if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -5954,24 +6344,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
 $as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5980,7 +6370,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -6005,15 +6395,27 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
 
 
 
@@ -6058,9 +6460,9 @@ compiler=$CC
 
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6121,8 +6523,8 @@ esac
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -6146,6 +6548,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -6158,6 +6561,7 @@ for ac_symprfx in "" "_"; do
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
   fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -6176,18 +6580,18 @@ void nm_test_func(void){}
 int main(){nm_test_var='a';nm_test_func();return(0);}
 _LT_EOF
 
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
-  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s "$nlist"; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
 	mv -f "$nlist"T "$nlist"
@@ -6199,6 +6603,18 @@ _LT_EOF
       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -6210,7 +6626,7 @@ _LT_EOF
 	  cat <<_LT_EOF >> conftest.$ac_ext
 
 /* The mapping between symbol names and symbols.  */
-const struct {
+LT_DLSYM_CONST struct {
   const char *name;
   void       *address;
 }
@@ -6236,19 +6652,19 @@ static const void *lt_preloaded_setup() {
 _LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
 	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
 	else
 	  echo "cannot find nm_test_func in $nlist" >&5
 	fi
@@ -6278,13 +6694,22 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
   lt_cv_sys_global_symbol_to_cdecl=
 fi
 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { $as_echo "$as_me:$LINENO: result: failed" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
 $as_echo "failed" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: ok" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
 $as_echo "ok" >&6; }
 fi
 
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
 
 
 
@@ -6307,8 +6732,47 @@ fi
 
 
 
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
 # Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
+if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
 fi
 
@@ -6320,11 +6784,11 @@ case $host in
 ia64-*-hpux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
 	HPUX_IA64_MODE="32"
@@ -6338,12 +6802,12 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6341 "configure"' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
     if test "$lt_cv_prog_gnu_ld" = yes; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
@@ -6377,11 +6841,11 @@ x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
     case `/usr/bin/file conftest.o` in
       *32-bit*)
 	case $host in
@@ -6430,9 +6894,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
+if ${lt_cv_cc_needs_belf+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_ext=c
@@ -6441,11 +6905,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-     cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -6456,38 +6916,13 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   lt_cv_cc_needs_belf=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	lt_cv_cc_needs_belf=no
+  lt_cv_cc_needs_belf=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
      ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6495,25 +6930,38 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
 	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
 	  LD="${LD-ld} -64"
@@ -6529,92 +6977,209 @@ esac
 
 need_locks="$enable_libtool_lock"
 
-
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -6627,9 +7192,9 @@ fi
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then
+if ${ac_cv_prog_NMEDIT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NMEDIT"; then
@@ -6640,24 +7205,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 NMEDIT=$ac_cv_prog_NMEDIT
 if test -n "$NMEDIT"; then
-  { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
 $as_echo "$NMEDIT" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6667,9 +7232,9 @@ if test -z "$ac_cv_prog_NMEDIT"; then
   ac_ct_NMEDIT=$NMEDIT
   # Extract the first word of "nmedit", so it can be a program name with args.
 set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_NMEDIT"; then
@@ -6680,24 +7245,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
 if test -n "$ac_ct_NMEDIT"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
 $as_echo "$ac_ct_NMEDIT" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6706,7 +7271,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -6719,9 +7284,9 @@ fi
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
 set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LIPO+set}" = set; then
+if ${ac_cv_prog_LIPO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$LIPO"; then
@@ -6732,24 +7297,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 LIPO=$ac_cv_prog_LIPO
 if test -n "$LIPO"; then
-  { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
 $as_echo "$LIPO" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6759,9 +7324,9 @@ if test -z "$ac_cv_prog_LIPO"; then
   ac_ct_LIPO=$LIPO
   # Extract the first word of "lipo", so it can be a program name with args.
 set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_LIPO"; then
@@ -6772,24 +7337,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_LIPO="lipo"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
 if test -n "$ac_ct_LIPO"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
 $as_echo "$ac_ct_LIPO" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6798,7 +7363,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -6811,9 +7376,9 @@ fi
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL+set}" = set; then
+if ${ac_cv_prog_OTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OTOOL"; then
@@ -6824,24 +7389,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 OTOOL=$ac_cv_prog_OTOOL
 if test -n "$OTOOL"; then
-  { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
 $as_echo "$OTOOL" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6851,9 +7416,9 @@ if test -z "$ac_cv_prog_OTOOL"; then
   ac_ct_OTOOL=$OTOOL
   # Extract the first word of "otool", so it can be a program name with args.
 set dummy otool; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OTOOL"; then
@@ -6864,24 +7429,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL="otool"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
 if test -n "$ac_ct_OTOOL"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
 $as_echo "$ac_ct_OTOOL" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6890,7 +7455,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -6903,9 +7468,9 @@ fi
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
 set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL64+set}" = set; then
+if ${ac_cv_prog_OTOOL64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OTOOL64"; then
@@ -6916,24 +7481,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 OTOOL64=$ac_cv_prog_OTOOL64
 if test -n "$OTOOL64"; then
-  { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
 $as_echo "$OTOOL64" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6943,9 +7508,9 @@ if test -z "$ac_cv_prog_OTOOL64"; then
   ac_ct_OTOOL64=$OTOOL64
   # Extract the first word of "otool64", so it can be a program name with args.
 set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OTOOL64"; then
@@ -6956,24 +7521,24 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL64="otool64"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
 if test -n "$ac_ct_OTOOL64"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
 $as_echo "$ac_ct_OTOOL64" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6982,7 +7547,7 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -7018,9 +7583,9 @@ fi
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
 $as_echo_n "checking for -single_module linker flag... " >&6; }
-if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
@@ -7036,7 +7601,13 @@ else
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&5
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -7045,22 +7616,19 @@ else
 	rm -f conftest.*
       fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-    { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_ld_exported_symbols_list=no
       save_LDFLAGS=$LDFLAGS
       echo "_main" > conftest.sym
       LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -7071,43 +7639,53 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   lt_cv_ld_exported_symbols_list=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	lt_cv_ld_exported_symbols_list=no
+  lt_cv_ld_exported_symbols_list=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 	LDFLAGS="$save_LDFLAGS"
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&5
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
@@ -7135,7 +7713,7 @@ $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
     else
       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test "$DSYMUTIL" != ":"; then
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -7148,14 +7726,14 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -7170,11 +7748,7 @@ do
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -7183,78 +7757,34 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -7266,7 +7796,7 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
 $as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -7277,11 +7807,7 @@ do
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -7290,87 +7816,40 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
 else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -7380,16 +7859,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -7404,48 +7879,23 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
+  ac_cv_header_stdc=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -7455,18 +7905,14 @@ fi
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+  $EGREP "free" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -7476,14 +7922,10 @@ fi
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -7510,992 +7952,248 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
 
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+  ac_cv_header_stdc=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
 fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
 $as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
+fi
 
+done
 
 
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
 
+fi
 
+done
 
 
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
 
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
 
-	eval "$as_ac_Header=no"
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
+# Set options
 
 
-for ac_header in dlfcn.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
 
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+        enable_dlopen=no
 
-	eval "$as_ac_Header=no"
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+  enable_win32_dll=no
+
 
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
 fi
 
-done
 
 
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  enable_static=yes
 fi
 
 
-  test -n "$ac_ct_CXX" && break
-done
 
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
 
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
 
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_compiler_gnu=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_compiler_gnu=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+	IFS="$lt_save_ifs"
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  GXX=
+  pic_mode=default
 fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cxx_g=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+test -z "$pic_mode" && pic_mode=default
 
-	CXXFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cxx_g=yes
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  enable_fast_install=yes
+fi
 
 
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-depcc="$CXX"  am_compiler_list=
 
-{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
 
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
 
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
 
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CXX_dependencies_compiler_type=none
-fi
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
 
 
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  # Broken: success on invalid input.
-continue
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
 
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
 
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
-else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
-fi
 
-rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  # Broken: success on invalid input.
-continue
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
 
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-_lt_caught_CXX_error=yes; }
-fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-else
-  _lt_caught_CXX_error=yes
-fi
 
 
 
 
 
-# Set options
 
 
 
-        enable_dlopen=no
 
 
-  enable_win32_dll=no
 
 
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_shared=yes
-fi
 
 
 
 
+test -z "$LN_S" && LN_S="ln -s"
 
 
 
 
 
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_static=yes
-fi
 
 
 
@@ -8505,206 +8203,81 @@ fi
 
 
 
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
 
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then
-  withval=$with_pic; pic_mode="$withval"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  pic_mode=default
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
 fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
 
 
 
 
 
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
 
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
 
 
 
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
 
+# Global variables:
+ofile=libtool
+can_build_shared=yes
 
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
 
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
 
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if test "${lt_cv_objdir+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
 
 # Only perform the check for file, if the check method requires it
@@ -8712,9 +8285,9 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file
 case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $MAGIC_CMD in
@@ -8765,10 +8338,10 @@ fi
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -8778,9 +8351,9 @@ fi
 
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
-    { $as_echo "$as_me:$LINENO: checking for file" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
 $as_echo_n "checking for file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $MAGIC_CMD in
@@ -8831,10 +8404,10 @@ fi
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -8913,11 +8486,16 @@ if test -n "$compiler"; then
 lt_prog_compiler_no_builtin_flag=
 
 if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
 
-  { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_rtti_exceptions=no
@@ -8933,15 +8511,15 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8936: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8940: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
@@ -8950,7 +8528,7 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
@@ -8970,8 +8548,6 @@ fi
 lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
-{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
@@ -9019,6 +8595,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_pic='-fno-common'
       ;;
 
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
     hpux*)
       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
@@ -9061,6 +8643,15 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_pic='-fPIC'
       ;;
     esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
   else
     # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
@@ -9102,7 +8693,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9123,7 +8714,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	lt_prog_compiler_pic='--shared'
 	lt_prog_compiler_static='--static'
 	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl='-Wl,-Wl,,'
+	lt_prog_compiler_pic='-PIC'
+	lt_prog_compiler_static='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	lt_prog_compiler_wl='-Wl,'
@@ -9135,25 +8732,40 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static='-non_shared'
         ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-qpic'
 	lt_prog_compiler_static='-qstaticlink'
 	;;
       *)
 	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Qoption ld '
+	  ;;
 	*Sun\ C*)
 	  # Sun C 5.9
 	  lt_prog_compiler_pic='-KPIC'
 	  lt_prog_compiler_static='-Bstatic'
 	  lt_prog_compiler_wl='-Wl,'
 	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic='-KPIC'
+        *Intel*\ [CF]*Compiler*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fPIC'
+	  lt_prog_compiler_static='-static'
+	  ;;
+	*Portland\ Group*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fpic'
 	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl=''
 	  ;;
 	esac
 	;;
@@ -9185,7 +8797,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
       case $cc_basename in
-      f77* | f90* | f95*)
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
 	lt_prog_compiler_wl='-Qoption ld ';;
       *)
 	lt_prog_compiler_wl='-Wl,';;
@@ -9242,21 +8854,25 @@ case $host_os in
     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
     ;;
 esac
-{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic"; then
-  { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works=no
@@ -9272,15 +8888,15 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9275: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9279: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works=yes
@@ -9289,7 +8905,7 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
@@ -9309,13 +8925,18 @@ fi
 
 
 
+
+
+
+
+
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works+set}" = set; then
+if ${lt_cv_prog_compiler_static_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
@@ -9328,7 +8949,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works=yes
@@ -9341,7 +8962,7 @@ else
    LDFLAGS="$save_LDFLAGS"
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
@@ -9356,9 +8977,9 @@ fi
 
 
 
-  { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+if ${lt_cv_prog_compiler_c_o+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o=no
@@ -9377,16 +8998,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9380: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9384: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
@@ -9403,7 +9024,7 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
@@ -9411,9 +9032,9 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
-  { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+if ${lt_cv_prog_compiler_c_o+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o=no
@@ -9432,16 +9053,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9435: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9439: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
@@ -9458,7 +9079,7 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
@@ -9467,7 +9088,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
   hard_links=yes
   $RM conftest*
@@ -9475,10 +9096,10 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
   if test "$hard_links" = no; then
-    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
@@ -9491,7 +9112,7 @@ fi
 
 
 
-  { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
   runpath_var=
@@ -9507,7 +9128,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   hardcode_direct=no
   hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
@@ -9554,7 +9174,33 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   esac
 
   ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
   if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -9572,6 +9218,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     fi
     supports_anon_versioning=no
     case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -9587,11 +9234,12 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
 *** to be unable to reliably create shared libraries on AIX.
 *** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
 _LT_EOF
       fi
@@ -9627,10 +9275,12 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -9648,6 +9298,11 @@ _LT_EOF
       fi
       ;;
 
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
@@ -9663,7 +9318,7 @@ _LT_EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -9673,15 +9328,16 @@ _LT_EOF
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
 	 && test "$tmp_diet" = no
       then
-	tmp_addflag=
+	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -9692,13 +9348,17 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
-	xl[cC]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
@@ -9714,17 +9374,16 @@ _LT_EOF
         fi
 
 	case $cc_basename in
-	xlf*)
+	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec=
-	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
 	  if test "x$supports_anon_versioning" = xyes; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
 	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -9738,8 +9397,8 @@ _LT_EOF
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -9757,8 +9416,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9804,8 +9463,8 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9845,8 +9504,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
 	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
@@ -9933,11 +9594,13 @@ _LT_EOF
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9948,54 +9611,34 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_link "$LINENO"; then :
 
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
 
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
       else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
@@ -10004,11 +9647,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -10019,59 +9664,44 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_link "$LINENO"; then :
 
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
 
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag=' ${wl}-bernotok'
 	  allow_undefined_flag=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec='$convenience'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec='$convenience'
+	  fi
 	  archive_cmds_need_lc=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
 	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
@@ -10103,20 +9733,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      allow_undefined_flag=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_from_new_cmds='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes=yes
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	always_export_symbols=yes
+	file_list_spec='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+	enable_shared_with_static_runtimes=yes
+	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds='chmod 644 $oldlib'
+	postlink_cmds='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes=yes
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -10126,7 +9800,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  whole_archive_flag_spec=''
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec=''
+  fi
   link_all_deplibs=yes
   allow_undefined_flag="$_lt_dar_allow_undefined"
   case $cc_basename in
@@ -10134,7 +9813,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
+    output_verbose_link_cmd=func_echo_all
     archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
     archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
@@ -10152,10 +9831,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       ;;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -10168,7 +9843,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
       hardcode_minus_L=yes
@@ -10177,7 +9852,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
     freebsd* | dragonfly*)
-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
       hardcode_shlibpath_var=no
@@ -10185,7 +9860,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     hpux9*)
       if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
@@ -10200,14 +9875,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
       if test "$with_gnu_ld" = no; then
 	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_flag_spec_ld='+b $libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
@@ -10219,16 +9893,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
@@ -10240,7 +9914,46 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
 	  ;;
 	esac
       fi
@@ -10268,52 +9981,39 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        cat >conftest.$ac_ext <<_ACEOF
-int foo(void) {}
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  lt_cv_irix_exported_symbol=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-        LDFLAGS="$save_LDFLAGS"
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
@@ -10375,17 +10075,17 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
       old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
@@ -10395,13 +10095,13 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10414,9 +10114,9 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       no_undefined_flag=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
@@ -10565,7 +10265,7 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
     fi
   fi
 
-{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
 test "$ld_shlibs" = no && can_build_shared=no
 
@@ -10602,46 +10302,52 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl
-	pic_flag=$lt_prog_compiler_pic
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag
-        allow_undefined_flag=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl
+	  pic_flag=$lt_prog_compiler_pic
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag
+	  allow_undefined_flag=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
   (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc=no
-        else
-	  archive_cmds_need_lc=yes
-        fi
-        allow_undefined_flag=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-$as_echo "$archive_cmds_need_lc" >&6; }
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc=no
+	  else
+	    lt_cv_archive_cmds_need_lc=yes
+	  fi
+	  allow_undefined_flag=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
       ;;
     esac
   fi
@@ -10799,12 +10505,7 @@ esac
 
 
 
-
-
-
-
-
-  { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
 if test "$GCC" = yes; then
@@ -10812,16 +10513,23 @@ if test "$GCC" = yes; then
     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
     *) lt_awk_arg="/^libraries:/" ;;
   esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
   lt_tmp_lt_search_path_spec=
@@ -10834,7 +10542,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -10854,7 +10562,13 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[lt_foo]++; }
   if (lt_freq[lt_foo] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
@@ -10880,7 +10594,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -10889,7 +10603,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -10942,7 +10656,7 @@ amigaos*)
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
@@ -10954,7 +10668,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -10973,8 +10687,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -10995,36 +10710,83 @@ cygwin* | mingw* | pw32* | cegcc*)
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -11045,7 +10807,7 @@ darwin* | rhapsody*)
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -11053,10 +10815,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -11064,7 +10822,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -11082,7 +10840,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -11102,12 +10860,26 @@ freebsd* | dragonfly*)
   ;;
 
 gnu*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -11153,12 +10925,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[3-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -11174,7 +10948,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -11211,9 +10985,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11221,16 +10995,17 @@ linux* | k*bsd*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+
   # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -11241,56 +11016,29 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
-  shlibpath_overrides_runpath=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
 fi
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
 
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -11321,7 +11069,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -11390,7 +11138,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11415,7 +11163,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -11439,7 +11187,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -11470,7 +11218,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11480,7 +11228,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -11490,7 +11238,7 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
@@ -11592,7 +11340,12 @@ fi
 
 
 
-  { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" ||
@@ -11617,7 +11370,7 @@ else
   # directories.
   hardcode_action=unsupported
 fi
-{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
 if test "$hardcode_action" = relink ||
@@ -11662,18 +11415,14 @@ else
 
   darwin*)
   # if libdl is installed we need to link against it
-    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+if ${ac_cv_lib_dl_dlopen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -11691,43 +11440,18 @@ return dlopen ();
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_dl_dlopen=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dl_dlopen=no
+  ac_cv_lib_dl_dlopen=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
 
@@ -11740,33 +11464,19 @@ fi
     ;;
 
   *)
-    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
-$as_echo_n "checking for shl_load... " >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -11775,13 +11485,6 @@ cat >>conftest.$ac_ext <<_ACEOF
 extern "C"
 #endif
 char shl_load ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_shl_load || defined __stub___shl_load
-choke me
-#endif
-
 int
 main ()
 {
@@ -11790,56 +11493,32 @@ return shl_load ();
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_shl_load=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_shl_load=no
+  ac_cv_lib_dld_shl_load=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-$as_echo "$ac_cv_func_shl_load" >&6; }
-if test "x$ac_cv_func_shl_load" = x""yes; then
-  lt_cv_dlopen="shl_load"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
 else
-  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -11848,222 +11527,37 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char shl_load ();
+char dlopen ();
 int
 main ()
 {
-return shl_load ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dld_shl_load=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dld_shl_load=no
+  ac_cv_lib_dl_dlopen=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
-  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
-$as_echo_n "checking for dlopen... " >&6; }
-if test "${ac_cv_func_dlopen+set}" = set; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_dlopen || defined __stub___dlopen
-choke me
-#endif
-
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_dlopen=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_dlopen=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-$as_echo "$ac_cv_func_dlopen" >&6; }
-if test "x$ac_cv_func_dlopen" = x""yes; then
-  lt_cv_dlopen="dlopen"
-else
-  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dl_dlopen=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -12081,57 +11575,28 @@ return dlopen ();
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_svld_dlopen=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_svld_dlopen=no
+  ac_cv_lib_svld_dlopen=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
-  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+if ${ac_cv_lib_dld_dld_link+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -12149,43 +11614,18 @@ return dld_link ();
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_dld_dld_link=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dld_dld_link=no
+  ac_cv_lib_dld_dld_link=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
 fi
 
@@ -12224,9 +11664,9 @@ fi
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then
+if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
@@ -12235,7 +11675,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12238 "configure"
+#line $LINENO "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12276,7 +11716,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -12285,7 +11731,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
       /* dlclose (self); */
     }
   else
@@ -12294,11 +11744,11 @@ int main ()
   return status;
 }
 _LT_EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -12315,14 +11765,14 @@ rm -fr conftest*
 
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
     if test "x$lt_cv_dlopen_self" = xyes; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then
+if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
@@ -12331,7 +11781,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12334 "configure"
+#line $LINENO "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12372,7 +11822,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -12381,7 +11837,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
       /* dlclose (self); */
     }
   else
@@ -12390,11 +11850,11 @@ int main ()
   return status;
 }
 _LT_EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -12411,7 +11871,7 @@ rm -fr conftest*
 
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
@@ -12450,12 +11910,12 @@ fi
 
 striplib=
 old_striplib=
-{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
 # FIXME - insert some real tests, host_os isn't really good enough
@@ -12464,15 +11924,15 @@ else
     if test -n "$STRIP" ; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
-      { $as_echo "$as_me:$LINENO: result: yes" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
     else
-      { $as_echo "$as_me:$LINENO: result: no" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     fi
     ;;
   *)
-    { $as_echo "$as_me:$LINENO: result: no" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     ;;
   esac
@@ -12490,12 +11950,12 @@ fi
 
 
   # Report which library types will actually be built
-  { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
 $as_echo "$can_build_shared" >&6; }
 
-  { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
   test "$can_build_shared" = "no" && enable_shared=no
 
@@ -12516,14 +11976,14 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
     fi
     ;;
   esac
-  { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
 $as_echo "$enable_shared" >&6; }
 
-  { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
   test "$enable_shared" = yes || enable_static=yes
-  { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
 
@@ -12538,55 +11998,195 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 CC="$lt_save_CC"
 
-
-ac_ext=cpp
+      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
 
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-# Source file extension for C++ test sources.
-ac_ext=cpp
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
 
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
 
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
 
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 
 
@@ -12619,6 +12219,7 @@ $RM -r conftest*
 
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
   lt_save_LD=$LD
   lt_save_GCC=$GCC
   GCC=$GXX
@@ -12636,6 +12237,7 @@ $RM -r conftest*
   fi
   test -z "${LDCXX+set}" || LD=$LDCXX
   CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
   compiler=$CC
   compiler_CXX=$CC
   for cc_temp in $compiler""; do
@@ -12646,7 +12248,7 @@ $RM -r conftest*
     *) break;;
   esac
 done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
 
   if test -n "$compiler"; then
@@ -12664,7 +12266,7 @@ cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
 # Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
+if test "${with_gnu_ld+set}" = set; then :
   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
@@ -12673,7 +12275,7 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
@@ -12703,13 +12305,13 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
-  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if test "${lt_cv_path_LD+set}" = set; then
+if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
@@ -12740,18 +12342,16 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
+if ${lt_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
@@ -12764,7 +12364,7 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
@@ -12777,8 +12377,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
       if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
         export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -12810,7 +12410,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
       # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
     else
       GXX=no
@@ -12819,7 +12419,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
     fi
 
     # PORTME: fill in a description of your system's C++ link characteristics
-    { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
     ld_shlibs_CXX=yes
     case $host_os in
@@ -12920,11 +12520,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
           allow_undefined_flag_CXX='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+          if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -12935,55 +12537,35 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_link "$LINENO"; then :
 
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
 
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
 
           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         else
           if test "$host_cpu" = ia64; then
 	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
@@ -12992,11 +12574,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
-	    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	    if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -13007,59 +12591,44 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_link "$LINENO"; then :
 
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
 
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
 
 	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
 	    no_undefined_flag_CXX=' ${wl}-bernotok'
 	    allow_undefined_flag_CXX=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    whole_archive_flag_spec_CXX='$convenience'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
 	    archive_cmds_need_lc_CXX=yes
 	    # This is similar to how AIX traditionally builds its shared
 	    # libraries.
@@ -13089,28 +12658,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         ;;
 
       cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-        # as there is no search path for DLLs.
-        hardcode_libdir_flag_spec_CXX='-L$libdir'
-        allow_undefined_flag_CXX=unsupported
-        always_export_symbols_CXX=no
-        enable_shared_with_static_runtimes_CXX=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          ld_shlibs_CXX=no
-        fi
-        ;;
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX=' '
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=yes
+	  file_list_spec_CXX='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+	  enable_shared_with_static_runtimes_CXX=yes
+	  # Don't use ranlib
+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=no
+	  enable_shared_with_static_runtimes_CXX=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    ld_shlibs_CXX=no
+	  fi
+	  ;;
+	esac
+	;;
       darwin* | rhapsody*)
 
 
@@ -13118,7 +12734,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
   hardcode_direct_CXX=no
   hardcode_automatic_CXX=yes
   hardcode_shlibpath_var_CXX=unsupported
-  whole_archive_flag_spec_CXX=''
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
   link_all_deplibs_CXX=yes
   allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
   case $cc_basename in
@@ -13126,7 +12747,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
+    output_verbose_link_cmd=func_echo_all
     archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
     archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
@@ -13160,7 +12781,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         esac
         ;;
 
-      freebsd[12]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
 	# switch to ELF
         ld_shlibs_CXX=no
@@ -13179,6 +12800,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       gnu*)
         ;;
 
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
+
       hpux9*)
         hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
         hardcode_libdir_separator_CXX=:
@@ -13203,11 +12829,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
             if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               ld_shlibs_CXX=no
@@ -13268,7 +12894,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
 	    if test "$GXX" = yes; then
@@ -13278,10 +12904,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -13311,7 +12937,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -13322,9 +12948,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           *)
 	    if test "$GXX" = yes; then
 	      if test "$with_gnu_ld" = no; then
-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	      else
-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
 	      fi
 	    fi
 	    link_all_deplibs_CXX=yes
@@ -13335,7 +12961,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -13353,7 +12979,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
 	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
 	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -13390,26 +13016,26 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
-	    *pgCC\ [1-5]* | *pgcpp\ [1-5]*)
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
 	      prelink_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      old_archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
 		$RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
-	    *) # Version 6 will use weak symbols
+	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
@@ -13417,7 +13043,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
 	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
 	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
@@ -13436,9 +13062,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
-	  xl*)
+	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
 	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -13458,13 +13084,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
 	      hardcode_libdir_flag_spec_CXX='-R$libdir'
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	      compiler_needs_object_CXX=yes
 
 	      # Not sure whether something based on
 	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
 	      # would be better.
-	      output_verbose_link_cmd='echo'
+	      output_verbose_link_cmd='func_echo_all'
 
 	      # Archives containing C++ object files must be created using
 	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -13533,7 +13159,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    export_dynamic_flag_spec_CXX='${wl}-E'
 	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 	  fi
-	  output_verbose_link_cmd=echo
+	  output_verbose_link_cmd=func_echo_all
 	else
 	  ld_shlibs_CXX=no
 	fi
@@ -13568,15 +13194,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    case $host in
 	      osf3*)
 	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 		;;
 	      *)
 	        allow_undefined_flag_CXX=' -expect_unresolved \*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
 	          $RM $lib.exp'
 	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
 		;;
@@ -13592,17 +13218,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
 	      case $host in
 	        osf3*)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	        *)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	      esac
 
@@ -13612,7 +13238,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	      # Commands to make compiler produce verbose output that lists
 	      # what "hidden" libraries, object files and flags are used when
 	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
 	    else
 	      # FIXME: insert proper C++ library support
@@ -13648,7 +13274,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
       solaris*)
         case $cc_basename in
-          CC*)
+          CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
             archive_cmds_need_lc_CXX=yes
 	    no_undefined_flag_CXX=' -zdefs'
@@ -13669,7 +13295,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    esac
 	    link_all_deplibs_CXX=yes
 
-	    output_verbose_link_cmd='echo'
+	    output_verbose_link_cmd='func_echo_all'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -13689,14 +13315,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
 	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
 	        # platform.
@@ -13707,7 +13333,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
 	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
@@ -13761,6 +13387,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           CC*)
 	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+	      '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+	      '"$reload_cmds_CXX"
 	    ;;
 	  *)
 	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
@@ -13794,7 +13424,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         ;;
     esac
 
-    { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
     test "$ld_shlibs_CXX" = no && can_build_shared=no
 
@@ -13822,11 +13452,19 @@ private:
 };
 _LT_EOF
 
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
   # Parse the compiler output and extract the necessary
   # objects, libraries and library flags.
 
@@ -13835,7 +13473,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
+    case ${prev}${p} in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
@@ -13844,13 +13482,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
           test $p = "-R"; then
 	 prev=$p
 	 continue
-       else
-	 prev=
        fi
 
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
        if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
+	 case ${prev} in
+	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
@@ -13870,8 +13517,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
 	 fi
        fi
+       prev=
        ;;
 
+    *.lto.$objext) ;; # Ignore GCC LTO objects
     *.$objext)
        # This assumes that the test object file only shows up
        # once in the compiler output.
@@ -13907,6 +13556,7 @@ else
 fi
 
 $RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
 
 # PORTME: override above test on systems where it is broken
 case $host_os in
@@ -13942,7 +13592,7 @@ linux*)
 
 solaris*)
   case $cc_basename in
-  CC*)
+  CC* | sunCC*)
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as
@@ -14007,8 +13657,6 @@ fi
 lt_prog_compiler_pic_CXX=
 lt_prog_compiler_static_CXX=
 
-{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -14058,6 +13706,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       # DJGPP does not support shared libraries at all
       lt_prog_compiler_pic_CXX=
       ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
     interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -14107,6 +13760,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	  ;;
 	esac
 	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+	;;
       dgux*)
 	case $cc_basename in
 	  ec++*)
@@ -14163,7 +13821,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -14196,8 +13854,8 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    lt_prog_compiler_pic_CXX=
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-qpic'
 	    lt_prog_compiler_static_CXX='-qstaticlink'
@@ -14259,7 +13917,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	;;
       solaris*)
 	case $cc_basename in
-	  CC*)
+	  CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-Bstatic'
@@ -14324,18 +13982,25 @@ case $host_os in
     lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
     ;;
 esac
-{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
-
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_CXX"; then
-  { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works_CXX=no
@@ -14351,15 +14016,15 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14354: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14358: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works_CXX=yes
@@ -14368,7 +14033,7 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
 
 if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
@@ -14385,13 +14050,15 @@ fi
 
 
 
+
+
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works_CXX=no
@@ -14404,7 +14071,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works_CXX=yes
@@ -14417,7 +14084,7 @@ else
    LDFLAGS="$save_LDFLAGS"
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
 
 if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
@@ -14429,9 +14096,9 @@ fi
 
 
 
-    { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o_CXX=no
@@ -14450,16 +14117,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14453: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14457: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
@@ -14476,14 +14143,14 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
 
 
-    { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o_CXX=no
@@ -14502,16 +14169,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14505: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14509: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
@@ -14528,7 +14195,7 @@ else
    $RM conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
 
@@ -14537,7 +14204,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
   hard_links=yes
   $RM conftest*
@@ -14545,10 +14212,10 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
   if test "$hard_links" = no; then
-    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
@@ -14558,33 +14225,43 @@ fi
 
 
 
-    { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   case $host_os in
   aix[4-9]*)
     # If we're using GNU nm, then we don't want the "-C" option.
     # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
       export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
     export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
+    ;;
   cygwin* | mingw* | cegcc*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    case $cc_basename in
+    cl*)
+      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+      ;;
+    esac
+    ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    ;;
   esac
-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
 
-{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
 test "$ld_shlibs_CXX" = no && can_build_shared=no
 
@@ -14612,46 +14289,52 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_CXX
-	pic_flag=$lt_prog_compiler_pic_CXX
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-        allow_undefined_flag_CXX=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
   (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_CXX=no
-        else
-	  archive_cmds_need_lc_CXX=yes
-        fi
-        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-$as_echo "$archive_cmds_need_lc_CXX" >&6; }
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
       ;;
     esac
   fi
@@ -14719,9 +14402,7 @@ esac
 
 
 
-
-
-    { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
 library_names_spec=
@@ -14746,7 +14427,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -14755,7 +14436,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -14808,7 +14489,7 @@ amigaos*)
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
@@ -14820,7 +14501,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -14839,8 +14520,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -14861,36 +14543,82 @@ cygwin* | mingw* | pw32* | cegcc*)
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -14910,7 +14638,7 @@ darwin* | rhapsody*)
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -14918,10 +14646,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -14929,7 +14653,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -14947,7 +14671,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -14967,12 +14691,26 @@ freebsd* | dragonfly*)
   ;;
 
 gnu*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -15018,12 +14756,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[3-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -15039,7 +14779,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -15076,1298 +14816,276 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
-       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
-  shlibpath_overrides_runpath=yes
-fi
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
-   test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-        ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-# Checks for libraries.
-{ $as_echo "$as_me:$LINENO: checking for cvGetRows in -lcv" >&5
-$as_echo_n "checking for cvGetRows in -lcv... " >&6; }
-if test "${ac_cv_lib_cv_cvGetRows+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cvGetRows ();
-int
-main ()
-{
-return cvGetRows ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_cv_cvGetRows=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_cv_cvGetRows=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cv_cvGetRows" >&5
-$as_echo "$ac_cv_lib_cv_cvGetRows" >&6; }
-if test "x$ac_cv_lib_cv_cvGetRows" = x""yes; then
-  CVFOUND=1
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking for Set_Mercator_Coordinates in -lgeotrans" >&5
-$as_echo_n "checking for Set_Mercator_Coordinates in -lgeotrans... " >&6; }
-if test "${ac_cv_lib_geotrans_Set_Mercator_Coordinates+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgeotrans  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char Set_Mercator_Coordinates ();
-int
-main ()
-{
-return Set_Mercator_Coordinates ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_geotrans_Set_Mercator_Coordinates=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_geotrans_Set_Mercator_Coordinates=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_geotrans_Set_Mercator_Coordinates" >&5
-$as_echo "$ac_cv_lib_geotrans_Set_Mercator_Coordinates" >&6; }
-if test "x$ac_cv_lib_geotrans_Set_Mercator_Coordinates" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGEOTRANS 1
-_ACEOF
-
-  LIBS="-lgeotrans $LIBS"
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for fftw_execute in -lfftw3" >&5
-$as_echo_n "checking for fftw_execute in -lfftw3... " >&6; }
-if test "${ac_cv_lib_fftw3_fftw_execute+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfftw3  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char fftw_execute ();
-int
-main ()
-{
-return fftw_execute ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_fftw3_fftw_execute=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_fftw3_fftw_execute=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_fftw3_fftw_execute" >&5
-$as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; }
-if test "x$ac_cv_lib_fftw3_fftw_execute" = x""yes; then
-  FFTWFOUND=1
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for jas_calloc in -ljasper" >&5
-$as_echo_n "checking for jas_calloc in -ljasper... " >&6; }
-if test "${ac_cv_lib_jasper_jas_calloc+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljasper  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char jas_calloc ();
-int
-main ()
-{
-return jas_calloc ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_jasper_jas_calloc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_jasper_jas_calloc=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jasper_jas_calloc" >&5
-$as_echo "$ac_cv_lib_jasper_jas_calloc" >&6; }
-if test "x$ac_cv_lib_jasper_jas_calloc" = x""yes; then
-  JASPERFOUND=1
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for LAS_GetVersion in -llas" >&5
-$as_echo_n "checking for LAS_GetVersion in -llas... " >&6; }
-if test "${ac_cv_lib_las_LAS_GetVersion+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-llas  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char LAS_GetVersion ();
-int
-main ()
-{
-return LAS_GetVersion ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_las_LAS_GetVersion=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_las_LAS_GetVersion=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_las_LAS_GetVersion" >&5
-$as_echo "$ac_cv_lib_las_LAS_GetVersion" >&6; }
-if test "x$ac_cv_lib_las_LAS_GetVersion" = x""yes; then
-  LASFOUND=1
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for HPDF_Pages_New in -lhpdf" >&5
-$as_echo_n "checking for HPDF_Pages_New in -lhpdf... " >&6; }
-if test "${ac_cv_lib_hpdf_HPDF_Pages_New+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lhpdf  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char HPDF_Pages_New ();
-int
-main ()
-{
-return HPDF_Pages_New ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_hpdf_HPDF_Pages_New=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_hpdf_HPDF_Pages_New=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hpdf_HPDF_Pages_New" >&5
-$as_echo "$ac_cv_lib_hpdf_HPDF_Pages_New" >&6; }
-if test "x$ac_cv_lib_hpdf_HPDF_Pages_New" = x""yes; then
-  HARUFOUND=1
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for SQLFetch in -lodbc" >&5
-$as_echo_n "checking for SQLFetch in -lodbc... " >&6; }
-if test "${ac_cv_lib_odbc_SQLFetch+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lodbc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char SQLFetch ();
-int
-main ()
-{
-return SQLFetch ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_odbc_SQLFetch=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_odbc_SQLFetch=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_odbc_SQLFetch" >&5
-$as_echo "$ac_cv_lib_odbc_SQLFetch" >&6; }
-if test "x$ac_cv_lib_odbc_SQLFetch" = x""yes; then
-  ODBCFOUND=1
-else
-  ODBC \(libodbc\) library not found
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for pj_is_latlong in -lproj" >&5
-$as_echo_n "checking for pj_is_latlong in -lproj... " >&6; }
-if test "${ac_cv_lib_proj_pj_is_latlong+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lproj  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pj_is_latlong ();
-int
-main ()
-{
-return pj_is_latlong ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_proj_pj_is_latlong=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_proj_pj_is_latlong=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_proj_pj_is_latlong" >&5
-$as_echo "$ac_cv_lib_proj_pj_is_latlong" >&6; }
-if test "x$ac_cv_lib_proj_pj_is_latlong" = x""yes; then
-  PROJFOUND=1
-fi
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
 
-{ $as_echo "$as_me:$LINENO: checking for VIGRA_RGBE_ReadPixels_Raw in -lvigraimpex" >&5
-$as_echo_n "checking for VIGRA_RGBE_ReadPixels_Raw in -lvigraimpex... " >&6; }
-if test "${ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw+set}" = set; then
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvigraimpex  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char VIGRA_RGBE_ReadPixels_Raw ();
 int
 main ()
 {
-return VIGRA_RGBE_ReadPixels_Raw ();
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw=no
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" >&5
-$as_echo "$ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" >&6; }
-if test "x$ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" = x""yes; then
-  VIGRAFOUND=1
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for omp_get_num_threads in -lgomp" >&5
-$as_echo_n "checking for omp_get_num_threads in -lgomp... " >&6; }
-if test "${ac_cv_lib_gomp_omp_get_num_threads+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgomp  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char omp_get_num_threads ();
-int
-main ()
-{
-return omp_get_num_threads ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_gomp_omp_get_num_threads=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
 
-	ac_cv_lib_gomp_omp_get_num_threads=no
-fi
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gomp_omp_get_num_threads" >&5
-$as_echo "$ac_cv_lib_gomp_omp_get_num_threads" >&6; }
-if test "x$ac_cv_lib_gomp_omp_get_num_threads" = x""yes; then
-  GOMPFOUND=1
-fi
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
 
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
 
-# Checks for header files.
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
 
-int
-main ()
-{
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_stdc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
 
-	ac_cv_header_stdc=no
-fi
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
+rdos*)
+  dynamic_linker=no
+  ;;
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
 
-fi
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
 
-fi
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
+*)
+  dynamic_linker=no
+  ;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
 
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
 fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
 
-fi
 
 
 
@@ -16375,2535 +15093,1541 @@ fi
 
 
 
-for ac_header in float.h malloc.h memory.h stdlib.h string.h unistd.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_header_compiler=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## --------------------------------- ##
-## Report this to BUG-REPORT-ADDRESS ##
-## --------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
 
-for ac_header in wchar.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_header_compiler=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## --------------------------------- ##
-## Report this to BUG-REPORT-ADDRESS ##
-## --------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
-# todo: check for headers of the libraries above
 
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-#include <stdbool.h>
-#ifndef bool
- "error: bool is not defined"
-#endif
-#ifndef false
- "error: false is not defined"
-#endif
-#if false
- "error: false is not 0"
-#endif
-#ifndef true
- "error: true is not defined"
-#endif
-#if true != 1
- "error: true is not 1"
-#endif
-#ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
-#endif
 
-	struct s { _Bool s: 1; _Bool t; } s;
-
-	char a[true == 1 ? 1 : -1];
-	char b[false == 0 ? 1 : -1];
-	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-	char d[(bool) 0.5 == true ? 1 : -1];
-	bool e = &s;
-	char f[(_Bool) 0.0 == false ? 1 : -1];
-	char g[true];
-	char h[sizeof (_Bool)];
-	char i[sizeof s.t];
-	enum { j = false, k = true, l = false * true, m = true * 256 };
-	/* The following fails for
-	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-	_Bool n[m];
-	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
-	/* Catch a bug in an HP-UX C compiler.  See
-	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-	 */
-	_Bool q = true;
-	_Bool *pq = &q;
 
-int
-main ()
-{
 
-	*pq |= q;
-	*pq |= ! q;
-	/* Refer to every declared value, to avoid compiler optimizations.  */
-	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-		+ !m + !n + !o + !p + !q + !pq);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_header_stdbool_h=yes
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdbool_h=no
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-{ $as_echo "$as_me:$LINENO: checking for _Bool" >&5
-$as_echo_n "checking for _Bool... " >&6; }
-if test "${ac_cv_type__Bool+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type__Bool=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof (_Bool))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof ((_Bool)))
-	  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type__Bool=yes
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
 
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-$as_echo "$ac_cv_type__Bool" >&6; }
-if test "x$ac_cv_type__Bool" = x""yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
 
+  fi # test -n "$compiler"
 
-fi
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
 
-if test $ac_cv_header_stdbool_h = yes; then
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STDBOOL_H 1
-_ACEOF
 
-fi
 
-{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset cs;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_const=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_c_const=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define const /**/
-_ACEOF
 
-fi
 
-{ $as_echo "$as_me:$LINENO: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
 
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_inline=$ac_kw
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
 
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
+        ac_config_commands="$ac_config_commands libtool"
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
 
 
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
 
-{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
-$as_echo_n "checking for size_t... " >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
+# Only expand once:
+
+
+
+# Checks for libraries.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cvGetRows in -lcv" >&5
+$as_echo_n "checking for cvGetRows in -lcv... " >&6; }
+if ${ac_cv_lib_cv_cvGetRows+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_size_t=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcv  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cvGetRows ();
 int
 main ()
 {
-if (sizeof (size_t))
-       return 0;
+return cvGetRows ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_cv_cvGetRows=yes
+else
+  ac_cv_lib_cv_cvGetRows=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cv_cvGetRows" >&5
+$as_echo "$ac_cv_lib_cv_cvGetRows" >&6; }
+if test "x$ac_cv_lib_cv_cvGetRows" = xyes; then :
+  CVFOUND=1
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Set_Mercator_Coordinates in -lgeotrans" >&5
+$as_echo_n "checking for Set_Mercator_Coordinates in -lgeotrans... " >&6; }
+if ${ac_cv_lib_geotrans_Set_Mercator_Coordinates+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgeotrans  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char Set_Mercator_Coordinates ();
 int
 main ()
 {
-if (sizeof ((size_t)))
-	  return 0;
+return Set_Mercator_Coordinates ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_size_t=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_geotrans_Set_Mercator_Coordinates=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  ac_cv_lib_geotrans_Set_Mercator_Coordinates=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-$as_echo "$ac_cv_type_size_t" >&6; }
-if test "x$ac_cv_type_size_t" = x""yes; then
-  :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_geotrans_Set_Mercator_Coordinates" >&5
+$as_echo "$ac_cv_lib_geotrans_Set_Mercator_Coordinates" >&6; }
+if test "x$ac_cv_lib_geotrans_Set_Mercator_Coordinates" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEOTRANS 1
 _ACEOF
 
+  LIBS="-lgeotrans $LIBS"
+
 fi
 
-{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5
+$as_echo_n "checking for fftw_execute in -lfftw3... " >&6; }
+if ${ac_cv_lib_fftw3_fftw_execute+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfftw3  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <time.h>
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fftw_execute ();
 int
 main ()
 {
-struct tm tm;
-				     int *p = &tm.tm_sec;
-				     return !p;
+return fftw_execute ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_struct_tm=time.h
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_fftw3_fftw_execute=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_struct_tm=sys/time.h
+  ac_cv_lib_fftw3_fftw_execute=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
-if test $ac_cv_struct_tm = sys/time.h; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TM_IN_SYS_TIME 1
-_ACEOF
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_execute" >&5
+$as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; }
+if test "x$ac_cv_lib_fftw3_fftw_execute" = xyes; then :
+  FFTWFOUND=1
 fi
 
-
-# Checks for platform characteristics.
-
- { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jas_calloc in -ljasper" >&5
+$as_echo_n "checking for jas_calloc in -ljasper... " >&6; }
+if ${ac_cv_lib_jasper_jas_calloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-	       not a universal capable compiler
-	     #endif
-	     typedef int dummy;
-
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-
-	# Check for potential -arch flags.  It is not universal unless
-	# there are some -arch flags.  Note that *ppc* also matches
-	# ppc64.  This check is also rather less than ideal.
-	case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
-	  *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
-	esac
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljasper  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-	     #include <sys/param.h>
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jas_calloc ();
 int
 main ()
 {
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-		     && LITTLE_ENDIAN)
-	      bogus endian macros
-	     #endif
-
+return jas_calloc ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_jasper_jas_calloc=yes
+else
+  ac_cv_lib_jasper_jas_calloc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jasper_jas_calloc" >&5
+$as_echo "$ac_cv_lib_jasper_jas_calloc" >&6; }
+if test "x$ac_cv_lib_jasper_jas_calloc" = xyes; then :
+  JASPERFOUND=1
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LAS_GetVersion in -llas" >&5
+$as_echo_n "checking for LAS_GetVersion in -llas... " >&6; }
+if ${ac_cv_lib_las_LAS_GetVersion+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llas  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-		#include <sys/param.h>
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char LAS_GetVersion ();
 int
 main ()
 {
-#if BYTE_ORDER != BIG_ENDIAN
-		 not big endian
-		#endif
-
+return LAS_GetVersion ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_bigendian=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_las_LAS_GetVersion=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_bigendian=no
+  ac_cv_lib_las_LAS_GetVersion=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_las_LAS_GetVersion" >&5
+$as_echo "$ac_cv_lib_las_LAS_GetVersion" >&6; }
+if test "x$ac_cv_lib_las_LAS_GetVersion" = xyes; then :
+  LASFOUND=1
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HPDF_Pages_New in -lhpdf" >&5
+$as_echo_n "checking for HPDF_Pages_New in -lhpdf... " >&6; }
+if ${ac_cv_lib_hpdf_HPDF_Pages_New+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lhpdf  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char HPDF_Pages_New ();
+int
+main ()
+{
+return HPDF_Pages_New ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_hpdf_HPDF_Pages_New=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  ac_cv_lib_hpdf_HPDF_Pages_New=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hpdf_HPDF_Pages_New" >&5
+$as_echo "$ac_cv_lib_hpdf_HPDF_Pages_New" >&6; }
+if test "x$ac_cv_lib_hpdf_HPDF_Pages_New" = xyes; then :
+  HARUFOUND=1
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLFetch in -lodbc" >&5
+$as_echo_n "checking for SQLFetch in -lodbc... " >&6; }
+if ${ac_cv_lib_odbc_SQLFetch+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lodbc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SQLFetch ();
 int
 main ()
 {
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-	      bogus endian macros
-	     #endif
-
+return SQLFetch ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_odbc_SQLFetch=yes
+else
+  ac_cv_lib_odbc_SQLFetch=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLFetch" >&5
+$as_echo "$ac_cv_lib_odbc_SQLFetch" >&6; }
+if test "x$ac_cv_lib_odbc_SQLFetch" = xyes; then :
+  ODBCFOUND=1
+else
+  ODBC \(libodbc\) library not found
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_is_latlong in -lproj" >&5
+$as_echo_n "checking for pj_is_latlong in -lproj... " >&6; }
+if ${ac_cv_lib_proj_pj_is_latlong+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lproj  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pj_is_latlong ();
 int
 main ()
 {
-#ifndef _BIG_ENDIAN
-		 not big endian
-		#endif
-
+return pj_is_latlong ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_bigendian=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_proj_pj_is_latlong=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_bigendian=no
+  ac_cv_lib_proj_pj_is_latlong=no
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proj_pj_is_latlong" >&5
+$as_echo "$ac_cv_lib_proj_pj_is_latlong" >&6; }
+if test "x$ac_cv_lib_proj_pj_is_latlong" = xyes; then :
+  PROJFOUND=1
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then
-  # Try to guess by grepping values from an object file.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VIGRA_RGBE_ReadPixels_Raw in -lvigraimpex" >&5
+$as_echo_n "checking for VIGRA_RGBE_ReadPixels_Raw in -lvigraimpex... " >&6; }
+if ${ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lvigraimpex  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-short int ascii_mm[] =
-		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-		short int ascii_ii[] =
-		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-		int use_ascii (int i) {
-		  return ascii_mm[i] + ascii_ii[i];
-		}
-		short int ebcdic_ii[] =
-		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-		short int ebcdic_mm[] =
-		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-		int use_ebcdic (int i) {
-		  return ebcdic_mm[i] + ebcdic_ii[i];
-		}
-		extern int foo;
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char VIGRA_RGBE_ReadPixels_Raw ();
 int
 main ()
 {
-return use_ascii (foo) == use_ebcdic (foo);
+return VIGRA_RGBE_ReadPixels_Raw ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-	      ac_cv_c_bigendian=yes
-	    fi
-	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-	      if test "$ac_cv_c_bigendian" = unknown; then
-		ac_cv_c_bigendian=no
-	      else
-		# finding both strings is unlikely to happen, but who knows?
-		ac_cv_c_bigendian=unknown
-	      fi
-	    fi
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" >&5
+$as_echo "$ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" >&6; }
+if test "x$ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" = xyes; then :
+  VIGRAFOUND=1
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for omp_get_num_threads in -lgomp" >&5
+$as_echo_n "checking for omp_get_num_threads in -lgomp... " >&6; }
+if ${ac_cv_lib_gomp_omp_get_num_threads+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgomp  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char omp_get_num_threads ();
 int
 main ()
 {
-
-	     /* Are we little or big endian?  From Harbison&Steele.  */
-	     union
-	     {
-	       long int l;
-	       char c[sizeof (long int)];
-	     } u;
-	     u.l = 1;
-	     return u.c[sizeof (long int) - 1] == 1;
-
+return omp_get_num_threads ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=no
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gomp_omp_get_num_threads=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
+  ac_cv_lib_gomp_omp_get_num_threads=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-
-    fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gomp_omp_get_num_threads" >&5
+$as_echo "$ac_cv_lib_gomp_omp_get_num_threads" >&6; }
+if test "x$ac_cv_lib_gomp_omp_get_num_threads" = xyes; then :
+  GOMPFOUND=1
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
-;; #(
-   no)
-      ;; #(
-   universal)
-
-cat >>confdefs.h <<\_ACEOF
-#define AC_APPLE_UNIVERSAL_BUILD 1
-_ACEOF
-
-     ;; #(
-   *)
-     { { $as_echo "$as_me:$LINENO: error: unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-$as_echo "$as_me: error: unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
- esac
 
 
-# Checks for library functions.
-
-for ac_header in stdlib.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+int
+main ()
+{
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+  ac_cv_header_stdc=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## --------------------------------- ##
-## Report this to BUG-REPORT-ADDRESS ##
-## --------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_stdc=no
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+rm -f conftest*
 
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
 
+else
+  ac_cv_header_stdc=no
 fi
+rm -f conftest*
 
-done
+fi
 
-{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_malloc_0_nonnull=no
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
-char *malloc ();
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
 
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-return ! malloc (0);
-  ;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_malloc_0_nonnull=yes
+if ac_fn_c_try_run "$LINENO"; then :
+
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-( exit $ac_status )
-ac_cv_func_malloc_0_nonnull=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 1
-_ACEOF
 
-else
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 0
+for ac_header in float.h malloc.h memory.h stdlib.h string.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-   case " $LIBOBJS " in
-  *" malloc.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
- ;;
-esac
+fi
 
+done
 
-cat >>confdefs.h <<\_ACEOF
-#define malloc rpl_malloc
+for ac_header in wchar.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default"
+if test "x$ac_cv_header_wchar_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_WCHAR_H 1
 _ACEOF
 
 fi
 
+done
 
+# todo: check for headers of the libraries above
 
-{ $as_echo "$as_me:$LINENO: checking for working memcmp" >&5
-$as_echo_n "checking for working memcmp... " >&6; }
-if test "${ac_cv_func_memcmp_working+set}" = set; then
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_memcmp_working=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
+
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
+
 int
 main ()
 {
 
-  /* Some versions of memcmp are not 8-bit clean.  */
-  char c0 = '\100', c1 = '\200', c2 = '\201';
-  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
-    return 1;
-
-  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
-     or more and with at least one buffer not starting on a 4-byte boundary.
-     William Lewis provided this test program.   */
-  {
-    char foo[21];
-    char bar[21];
-    int i;
-    for (i = 0; i < 4; i++)
-      {
-	char *a = foo + i;
-	char *b = bar + i;
-	strcpy (a, "--------01111111");
-	strcpy (b, "--------10000000");
-	if (memcmp (a, b, 16) >= 0)
-	  return 1;
-      }
-    return 0;
-  }
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_memcmp_working=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdbool_h=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_memcmp_working=no
+  ac_cv_header_stdbool_h=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
 
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
-$as_echo "$ac_cv_func_memcmp_working" >&6; }
-test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
-  *" memcmp.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
- ;;
-esac
 
 
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
 
-for ac_header in stdlib.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_header_compiler=no
+int
+main ()
+{
+
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
+else
+  ac_cv_c_const=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
 
-  ac_header_preproc=no
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## --------------------------------- ##
-## Report this to BUG-REPORT-ADDRESS ##
-## --------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
     ;;
 esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
 _ACEOF
 
 fi
 
-done
-
-{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5
-$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_realloc_0_nonnull=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *realloc ();
-#endif
+#include <sys/types.h>
+#include <time.h>
 
 int
 main ()
 {
-return ! realloc (0, 0);
+struct tm tm;
+				     int *p = &tm.tm_sec;
+				     return !p;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_realloc_0_nonnull=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_struct_tm=time.h
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_realloc_0_nonnull=no
+  ac_cv_struct_tm=sys/time.h
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
 
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
-if test $ac_cv_func_realloc_0_nonnull = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_REALLOC 1
-_ACEOF
 
+# Checks for platform characteristics.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_REALLOC 0
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-   case " $LIBOBJS " in
-  *" realloc.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
- ;;
-esac
+	# Check for potential -arch flags.  It is not universal unless
+	# there are at least two -arch flags with different values.
+	ac_arch=
+	ac_prev=
+	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+	 if test -n "$ac_prev"; then
+	   case $ac_word in
+	     i?86 | x86_64 | ppc | ppc64)
+	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+		 ac_arch=$ac_word
+	       else
+		 ac_cv_c_bigendian=universal
+		 break
+	       fi
+	       ;;
+	   esac
+	   ac_prev=
+	 elif test "x$ac_word" = "x-arch"; then
+	   ac_prev=arch
+	 fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+	     #include <sys/param.h>
 
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+		     && LITTLE_ENDIAN)
+	      bogus endian macros
+	     #endif
 
-cat >>confdefs.h <<\_ACEOF
-#define realloc rpl_realloc
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+		#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+		 not big endian
+		#endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+	      bogus endian macros
+	     #endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+		 not big endian
+		#endif
 
-{ $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
-$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
 else
-  rm -f conftest.sym conftest.file
-echo >conftest.file
-if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+		short int ascii_ii[] =
+		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+		int use_ascii (int i) {
+		  return ascii_mm[i] + ascii_ii[i];
+		}
+		short int ebcdic_ii[] =
+		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+		short int ebcdic_mm[] =
+		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+		int use_ebcdic (int i) {
+		  return ebcdic_mm[i] + ebcdic_ii[i];
+		}
+		extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+	      ac_cv_c_bigendian=yes
+	    fi
+	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+	      if test "$ac_cv_c_bigendian" = unknown; then
+		ac_cv_c_bigendian=no
+	      else
+		# finding both strings is unlikely to happen, but who knows?
+		ac_cv_c_bigendian=unknown
+	      fi
+	    fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
 main ()
 {
-struct stat sbuf;
-     /* Linux will dereference the symlink and fail.
-	That is better in the sense that it means we will not
-	have to compile and use the lstat wrapper.  */
-     return lstat ("conftest.sym/", &sbuf) == 0;
+
+	     /* Are we little or big endian?  From Harbison&Steele.  */
+	     union
+	     {
+	       long int l;
+	       char c[sizeof (long int)];
+	     } u;
+	     u.l = 1;
+	     return u.c[sizeof (long int) - 1] == 1;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_lstat_dereferences_slashed_symlink=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_bigendian=no
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+  ac_cv_c_bigendian=yes
 fi
-
-
-else
-  # If the `ln -s' command failed, then we probably don't even
-  # have an lstat function.
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f conftest.sym conftest.file
 
+    fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
 
-test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
 
 
-if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-  case " $LIBOBJS " in
-  *" lstat.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
- ;;
-esac
+# Checks for library functions.
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
-$as_echo_n "checking whether stat accepts an empty string... " >&6; }
-if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_stat_empty_string_bug=yes
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_malloc_0_nonnull=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
 int
 main ()
 {
-struct stat sbuf;
-  return stat ("", &sbuf) == 0;
+return ! malloc (0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_stat_empty_string_bug=no
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_malloc_0_nonnull=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_stat_empty_string_bug=yes
+  ac_cv_func_malloc_0_nonnull=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
-$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
-if test $ac_cv_func_stat_empty_string_bug = yes; then
-  case " $LIBOBJS " in
-  *" stat.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS stat.$ac_objext"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+
+else
+  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
  ;;
 esac
 
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STAT_EMPTY_STRING_BUG 1
-_ACEOF
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for working strtod" >&5
-$as_echo_n "checking for working strtod... " >&6; }
-if test "${ac_cv_func_strtod+set}" = set; then
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
+$as_echo_n "checking for working memcmp... " >&6; }
+if ${ac_cv_func_memcmp_working+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_strtod=no
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_memcmp_working=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
 $ac_includes_default
-#ifndef strtod
-double strtod ();
-#endif
 int
-main()
+main ()
 {
-  {
-    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
-    char *string = " +69";
-    char *term;
-    double value;
-    value = strtod (string, &term);
-    if (value != 69 || term != (string + 4))
-      return 1;
-  }
 
+  /* Some versions of memcmp are not 8-bit clean.  */
+  char c0 = '\100', c1 = '\200', c2 = '\201';
+  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+    return 1;
+
+  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+     or more and with at least one buffer not starting on a 4-byte boundary.
+     William Lewis provided this test program.   */
   {
-    /* Under Solaris 2.4, strtod returns the wrong value for the
-       terminating character under some conditions.  */
-    char *string = "NaN";
-    char *term;
-    strtod (string, &term);
-    if (term != string && *(term - 1) == 0)
-      return 1;
+    char foo[21];
+    char bar[21];
+    int i;
+    for (i = 0; i < 4; i++)
+      {
+	char *a = foo + i;
+	char *b = bar + i;
+	strcpy (a, "--------01111111");
+	strcpy (b, "--------10000000");
+	if (memcmp (a, b, 16) >= 0)
+	  return 1;
+      }
+    return 0;
   }
-  return 0;
-}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_strtod=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_strtod=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5
-$as_echo "$ac_cv_func_strtod" >&6; }
-if test $ac_cv_func_strtod = no; then
-  case " $LIBOBJS " in
-  *" strtod.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
- ;;
-esac
-
-{ $as_echo "$as_me:$LINENO: checking for pow" >&5
-$as_echo_n "checking for pow... " >&6; }
-if test "${ac_cv_func_pow+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define pow to an innocuous variant, in case <limits.h> declares pow.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define pow innocuous_pow
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char pow (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef pow
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pow ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_pow || defined __stub___pow
-choke me
-#endif
-
-int
-main ()
-{
-return pow ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_pow=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_memcmp_working=yes
+else
+  ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-	ac_cv_func_pow=no
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
+$as_echo "$ac_cv_func_memcmp_working" >&6; }
+test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+  *" memcmp.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
+esac
+
+
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5
-$as_echo "$ac_cv_func_pow" >&6; }
 
-if test $ac_cv_func_pow = no; then
-  { $as_echo "$as_me:$LINENO: checking for pow in -lm" >&5
-$as_echo_n "checking for pow in -lm... " >&6; }
-if test "${ac_cv_lib_m_pow+set}" = set; then
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_realloc_0_nonnull=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
 #endif
-char pow ();
+
 int
 main ()
 {
-return pow ();
+return ! realloc (0, 0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_m_pow=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_m_pow=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
-$as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = x""yes; then
-  POW_LIB=-lm
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_realloc_0_nonnull=yes
 else
-  { $as_echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5
-$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
+  ac_cv_func_realloc_0_nonnull=no
 fi
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then :
 
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
 
-for ac_func in vprintf
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+  $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+   case " $LIBOBJS " in
+  *" realloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef $ac_func
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
+fi
 
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
+if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f conftest.sym conftest.file
+echo >conftest.file
+if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_lstat_dereferences_slashed_symlink=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
 int
 main ()
 {
-return $ac_func ();
+struct stat sbuf;
+     /* Linux will dereference the symlink and fail, as required by POSIX.
+	That is better in the sense that it means we will not
+	have to compile and use the lstat wrapper.  */
+     return lstat ("conftest.sym/", &sbuf) == 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_lstat_dereferences_slashed_symlink=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-	eval "$as_ac_var=no"
+else
+  # If the `ln -s' command failed, then we probably don't even
+  # have an lstat function.
+  ac_cv_func_lstat_dereferences_slashed_symlink=no
 fi
+rm -f conftest.sym conftest.file
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
 
-{ $as_echo "$as_me:$LINENO: checking for _doprnt" >&5
-$as_echo_n "checking for _doprnt... " >&6; }
-if test "${ac_cv_func__doprnt+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define _doprnt innocuous__doprnt
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef _doprnt
+if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
+  case " $LIBOBJS " in
+  *" lstat.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
+esac
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char _doprnt ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub__doprnt || defined __stub____doprnt
-choke me
-#endif
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
+$as_echo_n "checking whether stat accepts an empty string... " >&6; }
+if ${ac_cv_func_stat_empty_string_bug+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_stat_empty_string_bug=yes
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
 int
 main ()
 {
-return _doprnt ();
+struct stat sbuf;
+  return stat ("", &sbuf) == 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func__doprnt=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_stat_empty_string_bug=no
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func__doprnt=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_func_stat_empty_string_bug=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
-$as_echo "$ac_cv_func__doprnt" >&6; }
-if test "x$ac_cv_func__doprnt" = x""yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DOPRNT 1
-_ACEOF
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
 fi
-done
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
+$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
+if test $ac_cv_func_stat_empty_string_bug = yes; then
+  case " $LIBOBJS " in
+  *" stat.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS stat.$ac_objext"
+ ;;
+esac
 
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STAT_EMPTY_STRING_BUG 1
+_ACEOF
 
+fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
+$as_echo_n "checking for working strtod... " >&6; }
+if ${ac_cv_func_strtod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_strtod=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+$ac_includes_default
+#ifndef strtod
+double strtod ();
+#endif
+int
+main()
+{
+  {
+    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
+    char *string = " +69";
+    char *term;
+    double value;
+    value = strtod (string, &term);
+    if (value != 69 || term != (string + 4))
+      return 1;
+  }
 
+  {
+    /* Under Solaris 2.4, strtod returns the wrong value for the
+       terminating character under some conditions.  */
+    char *string = "NaN";
+    char *term;
+    strtod (string, &term);
+    if (term != string && *(term - 1) == 0)
+      return 1;
+  }
+  return 0;
+}
 
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_strtod=yes
+else
+  ac_cv_func_strtod=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
+$as_echo "$ac_cv_func_strtod" >&6; }
+if test $ac_cv_func_strtod = no; then
+  case " $LIBOBJS " in
+  *" strtod.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
+ ;;
+esac
 
+ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
+if test "x$ac_cv_func_pow" = xyes; then :
 
+fi
 
-for ac_func in floor memmove memset modf pow sqrt strchr strdup strerror strrchr strstr strtol
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+if test $ac_cv_func_pow = no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
+$as_echo_n "checking for pow in -lm... " >&6; }
+if ${ac_cv_lib_m_pow+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -18911,62 +16635,61 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
+char pow ();
 int
 main ()
 {
-return $ac_func ();
+return pow ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_pow=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_lib_m_pow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
+$as_echo "$ac_cv_lib_m_pow" >&6; }
+if test "x$ac_cv_lib_m_pow" = xyes; then :
+  POW_LIB=-lm
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
+$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
+fi
 
-	eval "$as_ac_var=no"
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
+
+for ac_func in vprintf
+do :
+  ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
+if test "x$ac_cv_func_vprintf" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF 1
+_ACEOF
+
+ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = xyes; then :
+
+$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+
+fi
+
+fi
+done
+
+
+for ac_func in floor memmove memset modf pow sqrt strchr strdup strerror strrchr strstr strtol
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -18976,12 +16699,12 @@ done
 
 
 # add a local directory as base for libs and include files
-{ $as_echo "$as_me:$LINENO: checking for local include/lib path" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for local include/lib path" >&5
 $as_echo_n "checking for local include/lib path... " >&6; }
 
 
 # Check whether --with-local was given.
-if test "${with_local+set}" = set; then
+if test "${with_local+set}" = set; then :
   withval=$with_local;
 fi
 
@@ -18994,7 +16717,7 @@ if test "$with_local" != "no" -a "$with_local" != "" ; then
     ADD_PREFIX=$with_local
   fi
 
-  { $as_echo "$as_me:$LINENO: result: adding $ADD_PREFIX" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding $ADD_PREFIX" >&5
 $as_echo "adding $ADD_PREFIX" >&6; }
 
   LOCAL_LIBS="-L$ADD_PREFIX/lib"
@@ -19005,7 +16728,7 @@ $as_echo "adding $ADD_PREFIX" >&6; }
   LOCAL_INCS=$LOCAL_INCS
 
 else
-  { $as_echo "$as_me:$LINENO: result: none" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
 $as_echo "none" >&6; }
 fi
 
@@ -19023,9 +16746,7 @@ else
 fi
 
 else
-  { { $as_echo "$as_me:$LINENO: error: SAGA requires a unicode build of wxGTK" >&5
-$as_echo "$as_me: error: SAGA requires a unicode build of wxGTK" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "SAGA requires a unicode build of wxGTK" "$LINENO" 5
   exit
 fi
 
@@ -19033,7 +16754,7 @@ fi
 
 
 # Check whether --with-postgresql was given.
-if test "${with_postgresql+set}" = set; then
+if test "${with_postgresql+set}" = set; then :
   withval=$with_postgresql;
         if test "$withval" = "no"; then
             want_postgresql="no"
@@ -19060,9 +16781,9 @@ fi
         if test -z "$PG_CONFIG" -o test; then
             # Extract the first word of "pg_config", so it can be a program name with args.
 set dummy pg_config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PG_CONFIG+set}" = set; then
+if ${ac_cv_path_PG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PG_CONFIG in
@@ -19075,14 +16796,14 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -19090,10 +16811,10 @@ esac
 fi
 PG_CONFIG=$ac_cv_path_PG_CONFIG
 if test -n "$PG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
 $as_echo "$PG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19101,26 +16822,26 @@ fi
         fi
 
         if test ! -x "$PG_CONFIG"; then
-            { $as_echo "$as_me:$LINENO: WARNING: $PG_CONFIG does not exist or it is not an executable file" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $PG_CONFIG does not exist or it is not an executable file" >&5
 $as_echo "$as_me: WARNING: $PG_CONFIG does not exist or it is not an executable file" >&2;}
-            { $as_echo "$as_me:$LINENO: WARNING: PostgreSQL support disabled" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PostgreSQL support disabled" >&5
 $as_echo "$as_me: WARNING: PostgreSQL support disabled" >&2;}
-            { $as_echo "$as_me:$LINENO: WARNING: In case you like to enable it, verify that you have the" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: In case you like to enable it, verify that you have the" >&5
 $as_echo "$as_me: WARNING: In case you like to enable it, verify that you have the" >&2;}
-            { $as_echo "$as_me:$LINENO: WARNING: PostgreSQL development package installed; in case you have," >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PostgreSQL development package installed; in case you have," >&5
 $as_echo "$as_me: WARNING: PostgreSQL development package installed; in case you have," >&2;}
-            { $as_echo "$as_me:$LINENO: WARNING: but your pg_config is stored in a special location, provide" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: but your pg_config is stored in a special location, provide" >&5
 $as_echo "$as_me: WARNING: but your pg_config is stored in a special location, provide" >&2;}
-            { $as_echo "$as_me:$LINENO: WARNING: the full path with configure, e.g.:" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the full path with configure, e.g.:" >&5
 $as_echo "$as_me: WARNING: the full path with configure, e.g.:" >&2;}
-            { $as_echo "$as_me:$LINENO: WARNING: '--with-postgresql=/usr/pgsql-9.1/bin/pg_config'" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '--with-postgresql=/usr/pgsql-9.1/bin/pg_config'" >&5
 $as_echo "$as_me: WARNING: '--with-postgresql=/usr/pgsql-9.1/bin/pg_config'" >&2;}
             PG_CONFIG="no"
             found_postgresql="no"
         fi
 
         if test "$PG_CONFIG" != "no"; then
-            { $as_echo "$as_me:$LINENO: checking for PostgreSQL libraries" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PostgreSQL libraries" >&5
 $as_echo_n "checking for PostgreSQL libraries... " >&6; }
 
             POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
@@ -19129,13 +16850,11 @@ $as_echo_n "checking for PostgreSQL libraries... " >&6; }
             POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
 
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_POSTGRESQL 1
-_ACEOF
+$as_echo "#define HAVE_POSTGRESQL 1" >>confdefs.h
 
 
             found_postgresql="yes"
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
         else
             found_postgresql="no"
@@ -19149,7 +16868,7 @@ $as_echo "yes" >&6; }
 
     if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then
 
-        { $as_echo "$as_me:$LINENO: checking if PostgreSQL version is >= $postgresql_version_req" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PostgreSQL version is >= $postgresql_version_req" >&5
 $as_echo_n "checking if PostgreSQL version is >= $postgresql_version_req... " >&6; }
 
                         postgresql_version_req_major=`expr $postgresql_version_req : '\([0-9]*\)'`
@@ -19176,10 +16895,10 @@ $as_echo_n "checking if PostgreSQL version is >= $postgresql_version_req... " >&
 
         postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number`
         if test "$postgresql_version_check" = "1"; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
         fi
     fi
@@ -19204,13 +16923,11 @@ fi
 
 # debug
 # Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then
+if test "${enable_debug+set}" = set; then :
   enableval=$enable_debug; case "${enableval}" in
         yes) debug=true ;;
         no)  debug=false ;;
-        *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5
-$as_echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;}
-   { (exit 1); exit 1; }; } ;;
+        *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
       esac
 else
   debug=false
@@ -19227,13 +16944,11 @@ fi
 
 # gui
 # Check whether --enable-gui was given.
-if test "${enable_gui+set}" = set; then
+if test "${enable_gui+set}" = set; then :
   enableval=$enable_gui; case "${enableval}" in
      	yes) gui=true ;;
 	no) gui=false ;;
-	*) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-gui" >&5
-$as_echo "$as_me: error: bad value ${enableval} for --disable-gui" >&2;}
-   { (exit 1); exit 1; }; } ;;
+	*) as_fn_error $? "bad value ${enableval} for --disable-gui" "$LINENO" 5 ;;
       esac
 else
   gui=true
@@ -19249,27 +16964,23 @@ fi
 
 
   if test $gui = "false" ; then
-    { $as_echo "$as_me:$LINENO: result:         GUI and interactive modules will NOT be built" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         GUI and interactive modules will NOT be built" >&5
 $as_echo "        GUI and interactive modules will NOT be built" >&6; }
   else
 
-cat >>confdefs.h <<\_ACEOF
-#define WITH_GUI 1
-_ACEOF
+$as_echo "#define WITH_GUI 1" >>confdefs.h
 
-    { $as_echo "$as_me:$LINENO: result:         GUI and interactive modules will be built" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         GUI and interactive modules will be built" >&5
 $as_echo "        GUI and interactive modules will be built" >&6; }
   fi
 
 # odbc
 # Check whether --enable-odbc was given.
-if test "${enable_odbc+set}" = set; then
+if test "${enable_odbc+set}" = set; then :
   enableval=$enable_odbc; case "${enableval}" in
      	yes) odbc=true ;;
 	no) odbc=false ;;
-	*) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-odbc" >&5
-$as_echo "$as_me: error: bad value ${enableval} for --disable-odbc" >&2;}
-   { (exit 1); exit 1; }; } ;;
+	*) as_fn_error $? "bad value ${enableval} for --disable-odbc" "$LINENO" 5 ;;
       esac
 else
   odbc=true
@@ -19285,28 +16996,24 @@ fi
 
 
   if test $odbc = "false" ; then
-    { $as_echo "$as_me:$LINENO: result:         ODBC support will NOT be built" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         ODBC support will NOT be built" >&5
 $as_echo "        ODBC support will NOT be built" >&6; }
   else
 
-cat >>confdefs.h <<\_ACEOF
-#define WITH_ODBC 1
-_ACEOF
+$as_echo "#define WITH_ODBC 1" >>confdefs.h
 
-    { $as_echo "$as_me:$LINENO: result:         ODBC support will be built" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         ODBC support will be built" >&5
 $as_echo "        ODBC support will be built" >&6; }
   fi
 
 
 # openmp
 # Check whether --enable-openmp was given.
-if test "${enable_openmp+set}" = set; then
+if test "${enable_openmp+set}" = set; then :
   enableval=$enable_openmp; case "${enableval}" in
         yes) openmp=true ;;
         no)  openmp=false ;;
-        *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-openmp" >&5
-$as_echo "$as_me: error: bad value ${enableval} for --disable-openmp" >&2;}
-   { (exit 1); exit 1; }; } ;;
+        *) as_fn_error $? "bad value ${enableval} for --disable-openmp" "$LINENO" 5 ;;
       esac
 else
   openmp=true
@@ -19322,16 +17029,16 @@ fi
 
 
   if test $openmp = "false" ; then
-    { $as_echo "$as_me:$LINENO: result:         OpenMP support disabled" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         OpenMP support disabled" >&5
 $as_echo "        OpenMP support disabled" >&6; }
       GOMPFLAGS=""
   else
     if test -n "$GOMPFOUND" ; then
-      { $as_echo "$as_me:$LINENO: result:         Building with OpenMP support using libgomp" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result:         Building with OpenMP support using libgomp" >&5
 $as_echo "        Building with OpenMP support using libgomp" >&6; }
-      GOMPFLAGS="-fopenmp"
+      GOMPFLAGS="-fopenmp -lgomp"
     else
-      { $as_echo "$as_me:$LINENO: result:         libgomp not found, OpenMP support disabled" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result:         libgomp not found, OpenMP support disabled" >&5
 $as_echo "        libgomp not found, OpenMP support disabled" >&6; }
       GOMPFLAGS=""
     fi
@@ -19374,12 +17081,12 @@ fi
 
 
   if test -n "$HARUFOUND" ; then
-    { $as_echo "$as_me:$LINENO: result:         using lhpdf (libharu) from system libs." >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         using lhpdf (libharu) from system libs." >&5
 $as_echo "        using lhpdf (libharu) from system libs." >&6; }
     DISABLELIBHARU=""
     HARU_LIB="-lhpdf"
   else
-    { $as_echo "$as_me:$LINENO: result:         libharu was not found, pdf creation will be disabled" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:         libharu was not found, pdf creation will be disabled" >&5
 $as_echo "        libharu was not found, pdf creation will be disabled" >&6; }
     DISABLELIBHARU="-D_SAGA_DONOTUSE_HARU"
     HARU_LIB=""
@@ -19389,13 +17096,11 @@ $as_echo "        libharu was not found, pdf creation will be disabled" >&6; }
 
 
 # Check whether --enable-python was given.
-if test "${enable_python+set}" = set; then
+if test "${enable_python+set}" = set; then :
   enableval=$enable_python; case "${enableval}" in
         yes) python=true ;;
         no)  python=false ;;
-        *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-python" >&5
-$as_echo "$as_me: error: bad value ${enableval} for --enable-python" >&2;}
-   { (exit 1); exit 1; }; } ;;
+        *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;;
       esac
 else
   python=false
@@ -19414,15 +17119,17 @@ if test x$python = xtrue; then
 
 
 
+
+
         # Find any Python interpreter.
     if test -z "$PYTHON"; then
-      for ac_prog in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0
+      for ac_prog in python python2 python3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHON+set}" = set; then
+if ${ac_cv_path_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHON in
@@ -19435,14 +17142,14 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -19450,10 +17157,10 @@ esac
 fi
 PYTHON=$ac_cv_path_PYTHON
 if test -n "$PYTHON"; then
-  { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
 $as_echo "$PYTHON" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19467,20 +17174,18 @@ test -n "$PYTHON" || PYTHON=":"
 
 
   if test "$PYTHON" = :; then
-      { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5
-$as_echo "$as_me: error: no suitable Python interpreter found" >&2;}
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5
   else
 
 
-  { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5
 $as_echo_n "checking for $am_display_PYTHON version... " >&6; }
-if test "${am_cv_python_version+set}" = set; then
+if ${am_cv_python_version+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`
 fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
 $as_echo "$am_cv_python_version" >&6; }
   PYTHON_VERSION=$am_cv_python_version
 
@@ -19492,23 +17197,23 @@ $as_echo "$am_cv_python_version" >&6; }
 
 
 
-  { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5
 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; }
-if test "${am_cv_python_platform+set}" = set; then
+if ${am_cv_python_platform+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`
 fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5
 $as_echo "$am_cv_python_platform" >&6; }
   PYTHON_PLATFORM=$am_cv_python_platform
 
 
 
 
-                { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
-if test "${am_cv_python_pythondir+set}" = set; then
+if ${am_cv_python_pythondir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$prefix" = xNONE
@@ -19517,8 +17222,7 @@ else
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -19535,7 +17239,7 @@ else
      esac
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5
 $as_echo "$am_cv_python_pythondir" >&6; }
   pythondir=$am_cv_python_pythondir
 
@@ -19544,9 +17248,9 @@ $as_echo "$am_cv_python_pythondir" >&6; }
   pkgpythondir=\${pythondir}/$PACKAGE
 
 
-            { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
-if test "${am_cv_python_pyexecdir+set}" = set; then
+if ${am_cv_python_pyexecdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$exec_prefix" = xNONE
@@ -19555,8 +17259,7 @@ else
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null ||
-     echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -19573,7 +17276,7 @@ else
      esac
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5
 $as_echo "$am_cv_python_pyexecdir" >&6; }
   pyexecdir=$am_cv_python_pyexecdir
 
@@ -19586,8 +17289,6 @@ $as_echo "$am_cv_python_pyexecdir" >&6; }
   fi
 
 
-# PYTHON_EXTRA_LIBS='-lgomp'
-# PYTHON_EXTRA_LDFLAGS='-lgomp'
 
 	#
 	# Allow the use of a (user set) custom python version
@@ -19596,9 +17297,9 @@ $as_echo "$am_cv_python_pyexecdir" >&6; }
 
 	# Extract the first word of "python[$PYTHON_VERSION]", so it can be a program name with args.
 set dummy python$PYTHON_VERSION; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PYTHON+set}" = set; then
+if ${ac_cv_path_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHON in
@@ -19611,14 +17312,14 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -19626,46 +17327,34 @@ esac
 fi
 PYTHON=$ac_cv_path_PYTHON
 if test -n "$PYTHON"; then
-  { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
 $as_echo "$PYTHON" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 	if test -z "$PYTHON"; then
-	   { { $as_echo "$as_me:$LINENO: error: Cannot find python$PYTHON_VERSION in your system path" >&5
-$as_echo "$as_me: error: Cannot find python$PYTHON_VERSION in your system path" >&2;}
-   { (exit 1); exit 1; }; }
+	   as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5
 	   PYTHON_VERSION=""
 	fi
 
 	#
 	# Check for a version of Python >= 2.1.0
 	#
-	{ $as_echo "$as_me:$LINENO: checking for a version of Python >= '2.1.0'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5
 $as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; }
 	ac_supports_python_ver=`$PYTHON -c "import sys; \
 		ver = sys.version.split ()[0]; \
 		print (ver >= '2.1.0')"`
 	if test "$ac_supports_python_ver" != "True"; then
 		if test -z "$PYTHON_NOVERSIONCHECK"; then
-			{ $as_echo "$as_me:$LINENO: result: no" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-			{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+			{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error:
-This version of the AC_PYTHON_DEVEL macro
-doesn't work properly with versions of Python before
-2.1.0. You may need to re-run configure, setting the
-variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
-PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
-Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
-to something else than an empty string.
-
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error:
+as_fn_error $? "
 This version of the AC_PYTHON_DEVEL macro
 doesn't work properly with versions of Python before
 2.1.0. You may need to re-run configure, setting the
@@ -19674,14 +17363,13 @@ PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
 Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
 to something else than an empty string.
 
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+See \`config.log' for more details" "$LINENO" 5; }
 		else
-			{ $as_echo "$as_me:$LINENO: result: skip at user request" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5
 $as_echo "skip at user request" >&6; }
 		fi
 	else
-		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 	fi
 
@@ -19689,28 +17377,22 @@ $as_echo "yes" >&6; }
 	# if the macro parameter ``version'' is set, honour it
 	#
 	if test -n ""; then
-		{ $as_echo "$as_me:$LINENO: checking for a version of Python " >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python " >&5
 $as_echo_n "checking for a version of Python ... " >&6; }
 		ac_supports_python_ver=`$PYTHON -c "import sys; \
 			ver = sys.version.split ()[0]; \
 			print (ver )"`
 		if test "$ac_supports_python_ver" = "True"; then
-		   { $as_echo "$as_me:$LINENO: result: yes" >&5
+		   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 		else
-			{ $as_echo "$as_me:$LINENO: result: no" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-			{ { $as_echo "$as_me:$LINENO: error: this package requires Python .
-If you have it installed, but it isn't the default Python
-interpreter in your system path, please pass the PYTHON_VERSION
-variable to configure. See \`\`configure --help'' for reference.
-" >&5
-$as_echo "$as_me: error: this package requires Python .
+			as_fn_error $? "this package requires Python .
 If you have it installed, but it isn't the default Python
 interpreter in your system path, please pass the PYTHON_VERSION
 variable to configure. See \`\`configure --help'' for reference.
-" >&2;}
-   { (exit 1); exit 1; }; }
+" "$LINENO" 5
 			PYTHON_VERSION=""
 		fi
 	fi
@@ -19718,29 +17400,25 @@ variable to configure. See \`\`configure --help'' for reference.
 	#
 	# Check if you have distutils, else fail
 	#
-	{ $as_echo "$as_me:$LINENO: checking for the distutils Python package" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
 $as_echo_n "checking for the distutils Python package... " >&6; }
 	ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
 	if test -z "$ac_distutils_result"; then
-		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 	else
-		{ $as_echo "$as_me:$LINENO: result: no" >&5
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-		{ { $as_echo "$as_me:$LINENO: error: cannot import Python module \"distutils\".
+		as_fn_error $? "cannot import Python module \"distutils\".
 Please check your Python installation. The error was:
-$ac_distutils_result" >&5
-$as_echo "$as_me: error: cannot import Python module \"distutils\".
-Please check your Python installation. The error was:
-$ac_distutils_result" >&2;}
-   { (exit 1); exit 1; }; }
+$ac_distutils_result" "$LINENO" 5
 		PYTHON_VERSION=""
 	fi
 
 	#
 	# Check for Python include path
 	#
-	{ $as_echo "$as_me:$LINENO: checking for Python include path" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5
 $as_echo_n "checking for Python include path... " >&6; }
 	if test -z "$PYTHON_CPPFLAGS"; then
 		python_path=`$PYTHON -c "import distutils.sysconfig; \
@@ -19756,14 +17434,14 @@ $as_echo_n "checking for Python include path... " >&6; }
 		fi
 		PYTHON_CPPFLAGS=$python_path
 	fi
-	{ $as_echo "$as_me:$LINENO: result: $PYTHON_CPPFLAGS" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5
 $as_echo "$PYTHON_CPPFLAGS" >&6; }
 
 
 	#
 	# Check for Python library path
 	#
-	{ $as_echo "$as_me:$LINENO: checking for Python library path" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5
 $as_echo_n "checking for Python library path... " >&6; }
 	if test -z "$PYTHON_LDFLAGS"; then
 		# (makes two attempts to ensure we've got a version number
@@ -19834,66 +17512,61 @@ EOD`
 		fi
 
 		if test -z "PYTHON_LDFLAGS"; then
-			{ { $as_echo "$as_me:$LINENO: error:
-  Cannot determine location of your Python DSO. Please check it was installed with
-  dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand.
-			" >&5
-$as_echo "$as_me: error:
+			as_fn_error $? "
   Cannot determine location of your Python DSO. Please check it was installed with
   dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand.
-			" >&2;}
-   { (exit 1); exit 1; }; }
+			" "$LINENO" 5
 		fi
 	fi
-	{ $as_echo "$as_me:$LINENO: result: $PYTHON_LDFLAGS" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5
 $as_echo "$PYTHON_LDFLAGS" >&6; }
 
 
 	#
 	# Check for site packages
 	#
-	{ $as_echo "$as_me:$LINENO: checking for Python site-packages path" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5
 $as_echo_n "checking for Python site-packages path... " >&6; }
 	if test -z "$PYTHON_SITE_PKG"; then
 		PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
 			print (distutils.sysconfig.get_python_lib(0,0));"`
 	fi
-	{ $as_echo "$as_me:$LINENO: result: $PYTHON_SITE_PKG" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5
 $as_echo "$PYTHON_SITE_PKG" >&6; }
 
 
 	#
 	# libraries which must be linked in when embedding
 	#
-	{ $as_echo "$as_me:$LINENO: checking python extra libraries" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5
 $as_echo_n "checking python extra libraries... " >&6; }
 	if test -z "$PYTHON_EXTRA_LIBS"; then
 	   PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
                 conf = distutils.sysconfig.get_config_var; \
                 print (conf('LIBS'))"`
 	fi
-	{ $as_echo "$as_me:$LINENO: result: $PYTHON_EXTRA_LIBS" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5
 $as_echo "$PYTHON_EXTRA_LIBS" >&6; }
 
 
 	#
 	# linking flags needed when embedding
 	#
-	{ $as_echo "$as_me:$LINENO: checking python extra linking flags" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5
 $as_echo_n "checking python extra linking flags... " >&6; }
 	if test -z "$PYTHON_EXTRA_LDFLAGS"; then
 		PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
 			conf = distutils.sysconfig.get_config_var; \
 			print (conf('LINKFORSHARED'))"`
 	fi
-	{ $as_echo "$as_me:$LINENO: result: $PYTHON_EXTRA_LDFLAGS" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5
 $as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; }
 
 
 	#
 	# final check to see if everything compiles alright
 	#
-	{ $as_echo "$as_me:$LINENO: checking consistency of all components of python development environment" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5
 $as_echo_n "checking consistency of all components of python development environment... " >&6; }
 	# save current global flags
 	ac_save_LIBS="$LIBS"
@@ -19906,14 +17579,10 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-	cat >conftest.$ac_ext <<_ACEOF
-
-		/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <Python.h>
+
+		#include <Python.h>
 int
 main ()
 {
@@ -19923,38 +17592,13 @@ Py_Initialize();
 }
 
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   pythonexists=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	pythonexists=no
+  pythonexists=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 	ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -19965,25 +17609,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 	CPPFLAGS="$ac_save_CPPFLAGS"
 	LIBS="$ac_save_LIBS"
 
-	{ $as_echo "$as_me:$LINENO: result: $pythonexists" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5
 $as_echo "$pythonexists" >&6; }
 
         if test ! "x$pythonexists" = "xyes"; then
-	   { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+	   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error:
-  Could not link test program to Python. Maybe the main Python library has been
-  installed in some non-standard library path. If so, pass it to configure,
-  via the LDFLAGS environment variable.
-  Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\"
-  ============================================================================
-   ERROR!
-   You probably have to install the development version of the Python package
-   for your distribution.  The exact name of this package varies among them.
-  ============================================================================
-
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error:
+as_fn_error $? "
   Could not link test program to Python. Maybe the main Python library has been
   installed in some non-standard library path. If so, pass it to configure,
   via the LDFLAGS environment variable.
@@ -19994,8 +17626,7 @@ $as_echo "$as_me: error:
    for your distribution.  The exact name of this package varies among them.
   ============================================================================
 
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }; }
+See \`config.log' for more details" "$LINENO" 5; }
 	  PYTHON_VERSION=""
 	fi
 
@@ -20010,9 +17641,9 @@ See \`config.log' for more details." >&2;}
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SWIG+set}" = set; then
+if ${ac_cv_path_SWIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $SWIG in
@@ -20025,14 +17656,14 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -20040,10 +17671,10 @@ esac
 fi
 SWIG=$ac_cv_path_SWIG
 if test -n "$SWIG"; then
-  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
 $as_echo "$SWIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -20054,10 +17685,10 @@ done
         if test -z "$SWIG" ; then
                 :
         elif test -n "1.3.17" ; then
-                { $as_echo "$as_me:$LINENO: checking SWIG version" >&5
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
 $as_echo_n "checking SWIG version... " >&6; }
                 swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
-                { $as_echo "$as_me:$LINENO: result: $swig_version" >&5
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
 $as_echo "$swig_version" >&6; }
                 if test -n "$swig_version" ; then
                         # Calculate the required version number components
@@ -20101,20 +17732,20 @@ $as_echo "$swig_version" >&6; }
                             \+ $available_minor \* 100 \+ $available_patch`
 
                         if test $available_swig_vernum -lt $required_swig_vernum; then
-                                { $as_echo "$as_me:$LINENO: WARNING: SWIG version >= 1.3.17 is required.  You have $swig_version." >&5
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.17 is required.  You have $swig_version." >&5
 $as_echo "$as_me: WARNING: SWIG version >= 1.3.17 is required.  You have $swig_version." >&2;}
                                 SWIG=''
 
                         else
-                                { $as_echo "$as_me:$LINENO: checking for SWIG library" >&5
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
 $as_echo_n "checking for SWIG library... " >&6; }
                                 SWIG_LIB=`$SWIG -swiglib`
-                                { $as_echo "$as_me:$LINENO: result: $SWIG_LIB" >&5
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
 $as_echo "$SWIG_LIB" >&6; }
 
                         fi
                 else
-                        { $as_echo "$as_me:$LINENO: WARNING: cannot determine SWIG version" >&5
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
 $as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
                         SWIG=''
 
@@ -20138,7 +17769,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/grid/Makefile src/modules/grid/grid_analysis/Makefile src/modules/grid/grid_calculus/Makefile src/modules/gr [...]
+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
@@ -20167,13 +17798,13 @@ _ACEOF
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -20181,8 +17812,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
   (set) 2>&1 |
     case $as_nl`(ac_space=' '; set) 2>&1` in #(
     *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -20204,12 +17835,23 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
-      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
-    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
@@ -20223,20 +17865,29 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -20246,119 +17897,71 @@ else
 fi
 
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
 if test -z "${SAGA_UNICODE_TRUE}" && test -z "${SAGA_UNICODE_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"SAGA_UNICODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"SAGA_UNICODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"SAGA_UNICODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${HAVE_POSTGRESQL_TRUE}" && test -z "${HAVE_POSTGRESQL_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_POSTGRESQL\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"HAVE_POSTGRESQL\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"HAVE_POSTGRESQL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${WITH_GUI_TRUE}" && test -z "${WITH_GUI_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_GUI\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WITH_GUI\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"WITH_GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${WITH_ODBC_TRUE}" && test -z "${WITH_ODBC_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_ODBC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WITH_ODBC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"WITH_ODBC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${OPENMP_TRUE}" && test -z "${OPENMP_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"OPENMP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"OPENMP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"OPENMP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${HAVE_CV_TRUE}" && test -z "${HAVE_CV_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_CV\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"HAVE_CV\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"HAVE_CV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${HAVE_LLAS_TRUE}" && test -z "${HAVE_LLAS_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LLAS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"HAVE_LLAS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"HAVE_LLAS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${HAVE_VIGRA_TRUE}" && test -z "${HAVE_VIGRA_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_VIGRA\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"HAVE_VIGRA\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"HAVE_VIGRA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${HAVE_HARU_TRUE}" && test -z "${HAVE_HARU_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_HARU\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"HAVE_HARU\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"HAVE_HARU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${SAGA_PYTHON_TRUE}" && test -z "${SAGA_PYTHON_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"SAGA_PYTHON\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"SAGA_PYTHON\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"SAGA_PYTHON\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -20368,17 +17971,18 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -20386,23 +17990,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
 fi
 
 
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
 as_nl='
 '
 export as_nl
@@ -20410,7 +18006,13 @@ export as_nl
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -20421,7 +18023,7 @@ else
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in
+      case $arg in #(
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -20444,13 +18046,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
   }
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
 
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
@@ -20460,15 +18055,16 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -20480,12 +18076,16 @@ if test "x$as_myself" = x; then
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
+  exit 1
 fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
@@ -20497,7 +18097,89 @@ export LC_ALL
 LANGUAGE=C
 export LANGUAGE
 
-# Required to use basename.
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -20511,8 +18193,12 @@ else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -20532,76 +18218,25 @@ $as_echo X/"$0" |
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -20616,49 +18251,85 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -20668,13 +18339,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 
-# Save the log message, to keep $[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # 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.1.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
+This file was extended by saga $as_me 2.1.2, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -20706,13 +18383,15 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
 
-Usage: $0 [OPTION]... [FILE]...
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
   -q, --quiet, --silent
                    do not print progress messages
   -d, --debug      don't remove temporary files
@@ -20731,16 +18410,17 @@ $config_headers
 Configuration commands:
 $config_commands
 
-Report bugs to <bug-autoconf at gnu.org>."
+Report bugs to <BUG-REPORT-ADDRESS>."
 
 _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.1.1
-configured by $0, generated by GNU Autoconf 2.63,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+saga config.status 2.1.2
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -20758,11 +18438,16 @@ ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -20776,27 +18461,29 @@ do
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    { $as_echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; };;
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
@@ -20804,11 +18491,10 @@ Try \`$0 --help' for more information." >&2
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { $as_echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; } ;;
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
 
-  *) ac_config_targets="$ac_config_targets $1"
+  *) as_fn_append ac_config_targets " $1"
      ac_need_defaults=false ;;
 
   esac
@@ -20825,7 +18511,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -20859,184 +18545,208 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
 sed_quote_subst='$sed_quote_subst'
 double_quote_subst='$double_quote_subst'
 delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
-enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
-host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
-host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
-host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
-build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
-build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
-build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
-SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
-Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
-GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
-EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
-FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
-LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
-NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
-LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
-exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
-AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
-GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
-SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
-ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
-need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
-LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
-libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
-version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
-striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`'
-predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`'
-postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
 
 LTCC='$LTCC'
 LTCFLAGS='$LTCFLAGS'
 compiler='$compiler_DEFAULT'
 
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
 # Quote evaled strings.
-for var in SED \
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
 GREP \
 EGREP \
 FGREP \
@@ -21049,8 +18759,13 @@ reload_flag \
 OBJDUMP \
 deplibs_check_method \
 file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
 AR \
 AR_FLAGS \
+archiver_list_spec \
 STRIP \
 RANLIB \
 CC \
@@ -21060,14 +18775,14 @@ lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-SHELL \
-ECHO \
+nm_file_list_spec \
 lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
 lt_prog_compiler_pic \
+lt_prog_compiler_wl \
 lt_prog_compiler_static \
 lt_cv_prog_compiler_c_o \
 need_locks \
+MANIFEST_TOOL \
 DSYMUTIL \
 NMEDIT \
 LIPO \
@@ -21081,9 +18796,7 @@ with_gnu_ld \
 allow_undefined_flag \
 no_undefined_flag \
 hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
 hardcode_libdir_separator \
-fix_srcfile_path \
 exclude_expsyms \
 include_expsyms \
 file_list_spec \
@@ -21091,6 +18804,7 @@ variables_saved_for_relink \
 libname_spec \
 library_names_spec \
 soname_spec \
+install_override_mode \
 finish_eval \
 old_striplib \
 striplib \
@@ -21101,10 +18815,11 @@ predeps \
 postdeps \
 compiler_lib_search_path \
 LD_CXX \
+reload_flag_CXX \
 compiler_CXX \
 lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_wl_CXX \
 lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
 lt_prog_compiler_static_CXX \
 lt_cv_prog_compiler_c_o_CXX \
 export_dynamic_flag_spec_CXX \
@@ -21114,9 +18829,7 @@ with_gnu_ld_CXX \
 allow_undefined_flag_CXX \
 no_undefined_flag_CXX \
 hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_flag_spec_ld_CXX \
 hardcode_libdir_separator_CXX \
-fix_srcfile_path_CXX \
 exclude_expsyms_CXX \
 include_expsyms_CXX \
 file_list_spec_CXX \
@@ -21126,9 +18839,9 @@ postdep_objects_CXX \
 predeps_CXX \
 postdeps_CXX \
 compiler_lib_search_path_CXX; do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -21150,11 +18863,13 @@ module_cmds \
 module_expsym_cmds \
 export_symbols_cmds \
 prelink_cmds \
+postlink_cmds \
 postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
 sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
 old_archive_cmds_CXX \
 old_archive_from_new_cmds_CXX \
 old_archive_from_expsyms_cmds_CXX \
@@ -21163,10 +18878,11 @@ archive_expsym_cmds_CXX \
 module_cmds_CXX \
 module_expsym_cmds_CXX \
 export_symbols_cmds_CXX \
-prelink_cmds_CXX; do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -21174,12 +18890,6 @@ prelink_cmds_CXX; do
     esac
 done
 
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\$0 --fallback-echo"')  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
-  ;;
-esac
-
 ac_aux_dir='$ac_aux_dir'
 xsi_shell='$xsi_shell'
 lt_shell_append='$lt_shell_append'
@@ -21225,6 +18935,20 @@ do
     "src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;;
     "src/modules/climate/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/climate/Makefile" ;;
     "src/modules/climate/climate_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/climate/climate_tools/Makefile" ;;
+    "src/modules/contrib/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/contrib/Makefile" ;;
+    "src/modules/contrib/contrib_peregro/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/contrib/contrib_peregro/Makefile" ;;
+    "src/modules/db/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/db/Makefile" ;;
+    "src/modules/db/db_odbc/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/db/db_odbc/Makefile" ;;
+    "src/modules/db/db_pgsql/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/db/db_pgsql/Makefile" ;;
+    "src/modules/docs/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/docs/Makefile" ;;
+    "src/modules/docs/docs_html/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/docs/docs_html/Makefile" ;;
+    "src/modules/docs/docs_pdf/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/docs/docs_pdf/Makefile" ;;
+    "src/modules/garden/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/garden/Makefile" ;;
+    "src/modules/garden/garden_3d_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/garden/garden_3d_viewer/Makefile" ;;
+    "src/modules/garden/garden_fractals/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/garden/garden_fractals/Makefile" ;;
+    "src/modules/garden/garden_games/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/garden/garden_games/Makefile" ;;
+    "src/modules/garden/garden_learn_to_program/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/garden/garden_learn_to_program/Makefile" ;;
+    "src/modules/garden/garden_webservices/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/garden/garden_webservices/Makefile" ;;
     "src/modules/grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/Makefile" ;;
     "src/modules/grid/grid_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_analysis/Makefile" ;;
     "src/modules/grid/grid_calculus/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_calculus/Makefile" ;;
@@ -21234,9 +18958,33 @@ do
     "src/modules/grid/grid_spline/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_spline/Makefile" ;;
     "src/modules/grid/grid_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_tools/Makefile" ;;
     "src/modules/grid/grid_visualisation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_visualisation/Makefile" ;;
+    "src/modules/imagery/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/Makefile" ;;
+    "src/modules/imagery/imagery_classification/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_classification/Makefile" ;;
+    "src/modules/imagery/imagery_opencv/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_opencv/Makefile" ;;
+    "src/modules/imagery/imagery_photogrammetry/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_photogrammetry/Makefile" ;;
+    "src/modules/imagery/imagery_rga/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_rga/Makefile" ;;
+    "src/modules/imagery/imagery_segmentation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_segmentation/Makefile" ;;
+    "src/modules/imagery/imagery_svm/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_svm/Makefile" ;;
+    "src/modules/imagery/imagery_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_tools/Makefile" ;;
+    "src/modules/imagery/imagery_vigra/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/imagery/imagery_vigra/Makefile" ;;
+    "src/modules/io/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/Makefile" ;;
+    "src/modules/io/io_esri_e00/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_esri_e00/Makefile" ;;
+    "src/modules/io/io_gdal/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_gdal/Makefile" ;;
+    "src/modules/io/io_gps/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_gps/Makefile" ;;
+    "src/modules/io/io_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_grid/Makefile" ;;
+    "src/modules/io/io_grid_grib2/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_grid_grib2/Makefile" ;;
+    "src/modules/io/io_grid_image/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_grid_image/Makefile" ;;
+    "src/modules/io/io_shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_shapes/Makefile" ;;
+    "src/modules/io/io_shapes_dxf/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_shapes_dxf/Makefile" ;;
+    "src/modules/io/io_shapes_las/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_shapes_las/Makefile" ;;
+    "src/modules/io/io_table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_table/Makefile" ;;
+    "src/modules/io/io_virtual/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/io/io_virtual/Makefile" ;;
     "src/modules/pointcloud/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/pointcloud/Makefile" ;;
     "src/modules/pointcloud/pointcloud_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/pointcloud/pointcloud_tools/Makefile" ;;
     "src/modules/pointcloud/pointcloud_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/pointcloud/pointcloud_viewer/Makefile" ;;
+    "src/modules/projection/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/projection/Makefile" ;;
+    "src/modules/projection/pj_georeference/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/projection/pj_georeference/Makefile" ;;
+    "src/modules/projection/pj_proj4/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/projection/pj_proj4/Makefile" ;;
     "src/modules/shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/Makefile" ;;
     "src/modules/shapes/shapes_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_grid/Makefile" ;;
     "src/modules/shapes/shapes_lines/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_lines/Makefile" ;;
@@ -21244,96 +18992,35 @@ do
     "src/modules/shapes/shapes_polygons/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_polygons/Makefile" ;;
     "src/modules/shapes/shapes_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_tools/Makefile" ;;
     "src/modules/shapes/shapes_transect/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_transect/Makefile" ;;
+    "src/modules/simulation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/Makefile" ;;
+    "src/modules/simulation/sim_cellular_automata/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_cellular_automata/Makefile" ;;
+    "src/modules/simulation/sim_ecosystems_hugget/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_ecosystems_hugget/Makefile" ;;
+    "src/modules/simulation/sim_erosion/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_erosion/Makefile" ;;
+    "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/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" ;;
+    "src/modules/statistics/statistics_points/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/statistics/statistics_points/Makefile" ;;
+    "src/modules/statistics/statistics_regression/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/statistics/statistics_regression/Makefile" ;;
     "src/modules/table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/table/Makefile" ;;
     "src/modules/table/table_calculus/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/table/table_calculus/Makefile" ;;
     "src/modules/table/table_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/table/table_tools/Makefile" ;;
+    "src/modules/terrain_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/Makefile" ;;
+    "src/modules/terrain_analysis/ta_channels/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_channels/Makefile" ;;
+    "src/modules/terrain_analysis/ta_compound/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_compound/Makefile" ;;
+    "src/modules/terrain_analysis/ta_hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_hydrology/Makefile" ;;
+    "src/modules/terrain_analysis/ta_lighting/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_lighting/Makefile" ;;
+    "src/modules/terrain_analysis/ta_morphometry/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_morphometry/Makefile" ;;
+    "src/modules/terrain_analysis/ta_preprocessor/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_preprocessor/Makefile" ;;
+    "src/modules/terrain_analysis/ta_profiles/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_profiles/Makefile" ;;
+    "src/modules/terrain_analysis/ta_slope_stability/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/terrain_analysis/ta_slope_stability/Makefile" ;;
     "src/modules/tin/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/tin/Makefile" ;;
     "src/modules/tin/tin_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/tin/tin_tools/Makefile" ;;
     "src/modules/tin/tin_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/tin/tin_viewer/Makefile" ;;
-    "src/modules_contrib/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/Makefile" ;;
-    "src/modules_contrib/contrib_a_perego/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_a_perego/Makefile" ;;
-    "src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile" ;;
-    "src/modules_contrib/contrib_s_liersch/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_s_liersch/Makefile" ;;
-    "src/modules_contrib/contrib_s_liersch/ihacres/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_s_liersch/ihacres/Makefile" ;;
-    "src/modules_contrib/garden/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/garden/Makefile" ;;
-    "src/modules_contrib/garden/garden_3d_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/garden/garden_3d_viewer/Makefile" ;;
-    "src/modules_contrib/garden/garden_webservices/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/garden/garden_webservices/Makefile" ;;
-    "src/modules_geostatistics/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/Makefile" ;;
-    "src/modules_geostatistics/geostatistics/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/Makefile" ;;
-    "src/modules_geostatistics/geostatistics/geostatistics_points/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_points/Makefile" ;;
-    "src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile" ;;
-    "src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile" ;;
-    "src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile" ;;
-    "src/modules_images/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/Makefile" ;;
-    "src/modules_images/modules_imagery/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/Makefile" ;;
-    "src/modules_images/modules_imagery/imagery_classification/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_classification/Makefile" ;;
-    "src/modules_images/modules_imagery/imagery_rga/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_rga/Makefile" ;;
-    "src/modules_images/modules_imagery/imagery_segmentation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_segmentation/Makefile" ;;
-    "src/modules_images/modules_imagery/imagery_svm/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_svm/Makefile" ;;
-    "src/modules_images/modules_imagery/imagery_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_tools/Makefile" ;;
-    "src/modules_images/modules_opencv/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_opencv/Makefile" ;;
-    "src/modules_images/modules_opencv/opencv/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_opencv/opencv/Makefile" ;;
-    "src/modules_images/modules_vigra/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_vigra/Makefile" ;;
-    "src/modules_images/modules_vigra/vigra/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_vigra/vigra/Makefile" ;;
-    "src/modules_io/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/Makefile" ;;
-    "src/modules_io/esri_e00/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/esri_e00/Makefile" ;;
-    "src/modules_io/esri_e00/io_esri_e00/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/esri_e00/io_esri_e00/Makefile" ;;
-    "src/modules_io/db/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/db/Makefile" ;;
-    "src/modules_io/db/io_odbc/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/db/io_odbc/Makefile" ;;
-    "src/modules_io/db/io_pgsql/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/db/io_pgsql/Makefile" ;;
-    "src/modules_io/docs/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/docs/Makefile" ;;
-    "src/modules_io/docs/docs_html/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/docs/docs_html/Makefile" ;;
-    "src/modules_io/docs/docs_pdf/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/docs/docs_pdf/Makefile" ;;
-    "src/modules_io/gdal/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gdal/Makefile" ;;
-    "src/modules_io/gdal/io_gdal/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gdal/io_gdal/Makefile" ;;
-    "src/modules_io/grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/Makefile" ;;
-    "src/modules_io/grid/io_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/io_grid/Makefile" ;;
-    "src/modules_io/grid/io_grid_image/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/io_grid_image/Makefile" ;;
-    "src/modules_io/grid/io_grid_grib2/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/io_grid_grib2/Makefile" ;;
-    "src/modules_io/gps/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gps/Makefile" ;;
-    "src/modules_io/gps/io_gps/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gps/io_gps/Makefile" ;;
-    "src/modules_io/shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/Makefile" ;;
-    "src/modules_io/shapes/io_shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/io_shapes/Makefile" ;;
-    "src/modules_io/shapes/io_shapes_dxf/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/io_shapes_dxf/Makefile" ;;
-    "src/modules_io/shapes/io_shapes_las/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/io_shapes_las/Makefile" ;;
-    "src/modules_io/table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/table/Makefile" ;;
-    "src/modules_io/table/io_table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/table/io_table/Makefile" ;;
-    "src/modules_lectures/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_lectures/Makefile" ;;
-    "src/modules_lectures/lectures/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_lectures/lectures/Makefile" ;;
-    "src/modules_lectures/lectures/lectures_introduction/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_lectures/lectures/lectures_introduction/Makefile" ;;
-    "src/modules_projection/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/Makefile" ;;
-    "src/modules_projection/pj_georeference/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_georeference/Makefile" ;;
-    "src/modules_projection/pj_georeference/pj_georeference/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_georeference/pj_georeference/Makefile" ;;
-    "src/modules_projection/pj_proj4/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_proj4/Makefile" ;;
-    "src/modules_projection/pj_proj4/pj_proj4/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_proj4/pj_proj4/Makefile" ;;
-    "src/modules_recreations/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/Makefile" ;;
-    "src/modules_recreations/recreations/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/recreations/Makefile" ;;
-    "src/modules_recreations/recreations/recreations_fractals/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/recreations/recreations_fractals/Makefile" ;;
-    "src/modules_recreations/recreations/recreations_games/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/recreations/recreations_games/Makefile" ;;
-    "src/modules_simulation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/Makefile" ;;
-    "src/modules_simulation/erosion/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/erosion/Makefile" ;;
-    "src/modules_simulation/erosion/sim_erosion/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/erosion/sim_erosion/Makefile" ;;
-    "src/modules_simulation/hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/hydrology/Makefile" ;;
-    "src/modules_simulation/hydrology/sim_hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/hydrology/sim_hydrology/Makefile" ;;
-    "src/modules_simulation/cellular_automata/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/cellular_automata/Makefile" ;;
-    "src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile" ;;
-    "src/modules_simulation/ecosystems/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/ecosystems/Makefile" ;;
-    "src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile" ;;
-    "src/modules_simulation/fire/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/fire/Makefile" ;;
-    "src/modules_simulation/fire/sim_fire_spreading/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/fire/sim_fire_spreading/Makefile" ;;
-    "src/modules_terrain_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile" ;;
-    "src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile" ;;
-
-  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -21356,26 +19043,24 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
+  trap 'as_fn_exit 1' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} ||
-{
-   $as_echo "$as_me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -21383,7 +19068,13 @@ $debug ||
 if test -n "$CONFIG_FILES"; then
 
 
-ac_cr='
'
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
   ac_cs_awk_cr='\\r'
@@ -21391,7 +19082,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -21400,24 +19091,18 @@ _ACEOF
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -21425,7 +19110,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -21439,7 +19124,7 @@ s/'"$ac_delim"'$//
 t delim
 :nl
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -21453,7 +19138,7 @@ s/.\{148\}//
 t nl
 :delim
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
@@ -21473,7 +19158,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -21505,23 +19190,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-   { (exit 1); exit 1; }; }
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
@@ -21533,7 +19224,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -21545,13 +19236,11 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -21636,9 +19325,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
-$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -21651,9 +19338,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
-$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
-   { (exit 1); exit 1; }; };;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -21672,7 +19357,7 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -21681,12 +19366,10 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-   { (exit 1); exit 1; }; };;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
+      as_fn_append ac_file_inputs " '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
@@ -21697,7 +19380,7 @@ $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
 	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
 $as_echo "$as_me: creating $ac_file" >&6;}
     fi
     # Neutralize special characters interpreted by sed in replacement strings.
@@ -21709,10 +19392,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; } ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -21740,47 +19421,7 @@ $as_echo X"$ac_file" |
 	    q
 	  }
 	  s/.*/./; q'`
-  { as_dir="$ac_dir"
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-   { (exit 1); exit 1; }; }; }
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
 case "$ac_dir" in
@@ -21837,7 +19478,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
-
 ac_sed_dataroot='
 /datarootdir/ {
   p
@@ -21847,12 +19487,11 @@ ac_sed_dataroot='
 /@docdir@/p
 /@infodir@/p
 /@localedir@/p
-/@mandir@/p
-'
+/@mandir@/p'
 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -21862,7 +19501,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   s&@infodir@&$infodir&g
   s&@localedir@&$localedir&g
   s&@mandir@&$mandir&g
-    s&\\\${datarootdir}&$datarootdir&g' ;;
+  s&\\\${datarootdir}&$datarootdir&g' ;;
 esac
 _ACEOF
 
@@ -21890,27 +19529,24 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -21919,27 +19555,21 @@ $as_echo "$as_me: error: could not create $ac_file" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
-$as_echo "$as_me: error: could not create -" >&2;}
-   { (exit 1); exit 1; }; }
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
 _am_arg="$ac_file"
@@ -21977,7 +19607,7 @@ $as_echo X"$_am_arg" |
 	  s/.*/./; q'`/stamp-h$_am_stamp_count
  ;;
 
-  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
 $as_echo "$as_me: executing $ac_file commands" >&6;}
  ;;
   esac
@@ -21998,7 +19628,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -22032,21 +19662,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
@@ -22072,47 +19700,7 @@ $as_echo X"$file" |
 	    q
 	  }
 	  s/.*/./; q'`
-      { as_dir=$dirpart/$fdir
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-   { (exit 1); exit 1; }; }; }
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
       # echo "creating $dirpart/$file"
       echo '# dummy' > "$dirpart/$file"
     done
@@ -22140,7 +19728,8 @@ $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -22188,6 +19777,15 @@ pic_mode=$pic_mode
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
 # The host system.
 host_alias=$host_alias
 host=$host
@@ -22237,9 +19835,11 @@ SP2NL=$lt_lt_SP2NL
 # turn newlines into spaces.
 NL2SP=$lt_lt_NL2SP
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
 
 # An object symbol dumper.
 OBJDUMP=$lt_OBJDUMP
@@ -22247,13 +19847,30 @@ OBJDUMP=$lt_OBJDUMP
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
 
-# Command to use when deplibs_check_method == "file_magic".
+# Command to use when deplibs_check_method = "file_magic".
 file_magic_cmd=$lt_file_magic_cmd
 
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
 # The archiver.
 AR=$lt_AR
+
+# Flags to create an archive.
 AR_FLAGS=$lt_AR_FLAGS
 
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
 # A symbol stripping program.
 STRIP=$lt_STRIP
 
@@ -22262,6 +19879,9 @@ RANLIB=$lt_RANLIB
 old_postinstall_cmds=$lt_old_postinstall_cmds
 old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
 # A C compiler.
 LTCC=$lt_CC
 
@@ -22280,14 +19900,14 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
 
-# An echo program that does not interpret backslashes.
-ECHO=$lt_ECHO
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
 # Used to examine libraries when file_magic_cmd begins with "file".
 MAGIC_CMD=$MAGIC_CMD
@@ -22295,6 +19915,9 @@ MAGIC_CMD=$MAGIC_CMD
 # Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
 DSYMUTIL=$lt_DSYMUTIL
 
@@ -22351,6 +19974,9 @@ library_names_spec=$lt_library_names_spec
 # The coded name of the library, if different from the real name.
 soname_spec=$lt_soname_spec
 
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
 # Command to use after installation of a shared archive.
 postinstall_cmds=$lt_postinstall_cmds
 
@@ -22390,6 +20016,10 @@ striplib=$lt_striplib
 # The linker used to build libraries.
 LD=$lt_LD
 
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
 # Commands used to build an old-style archive.
 old_archive_cmds=$lt_old_archive_cmds
 
@@ -22402,12 +20032,12 @@ with_gcc=$GCC
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
 # Additional compiler flags for building library objects.
 pic_flag=$lt_lt_prog_compiler_pic
 
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
 # Compiler flag to prevent dynamic linking.
 link_static_flag=$lt_lt_prog_compiler_static
 
@@ -22457,10 +20087,6 @@ no_undefined_flag=$lt_no_undefined_flag
 # This must work even if \$libdir does not exist
 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
@@ -22494,9 +20120,6 @@ inherit_rpath=$inherit_rpath
 # Whether libtool must link a program against all its dependency libraries.
 link_all_deplibs=$link_all_deplibs
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
 # Set to "yes" if exported symbols are required.
 always_export_symbols=$always_export_symbols
 
@@ -22512,6 +20135,9 @@ include_expsyms=$lt_include_expsyms
 # Commands necessary for linking programs (against libraries) with templates.
 prelink_cmds=$lt_prelink_cmds
 
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
 # Specify filename containing input files.
 file_list_spec=$lt_file_list_spec
 
@@ -22558,212 +20184,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
   # text mode, it properly converts lines to CR/LF.  This bash problem
   # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
-
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1+=\$2"
-}
-_LT_EOF
-    ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1=\$$1\$2"
-}
-
-_LT_EOF
-    ;;
-  esac
-
-
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" ||
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+   mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
@@ -22775,6 +20358,10 @@ _LT_EOF
 # The linker used to build libraries.
 LD=$lt_LD_CXX
 
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
 # Commands used to build an old-style archive.
 old_archive_cmds=$lt_old_archive_cmds_CXX
 
@@ -22787,12 +20374,12 @@ with_gcc=$GCC_CXX
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
 # Additional compiler flags for building library objects.
 pic_flag=$lt_lt_prog_compiler_pic_CXX
 
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
 # Compiler flag to prevent dynamic linking.
 link_static_flag=$lt_lt_prog_compiler_static_CXX
 
@@ -22842,10 +20429,6 @@ no_undefined_flag=$lt_no_undefined_flag_CXX
 # This must work even if \$libdir does not exist
 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
 
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
 
@@ -22879,9 +20462,6 @@ inherit_rpath=$inherit_rpath_CXX
 # Whether libtool must link a program against all its dependency libraries.
 link_all_deplibs=$link_all_deplibs_CXX
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path_CXX
-
 # Set to "yes" if exported symbols are required.
 always_export_symbols=$always_export_symbols_CXX
 
@@ -22897,6 +20477,9 @@ include_expsyms=$lt_include_expsyms_CXX
 # Commands necessary for linking programs (against libraries) with templates.
 prelink_cmds=$lt_prelink_cmds_CXX
 
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
 # Specify filename containing input files.
 file_list_spec=$lt_file_list_spec_CXX
 
@@ -22926,15 +20509,12 @@ _LT_EOF
 done # for ac_tag
 
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -22955,10 +20535,10 @@ if test "$no_create" != yes; then
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
diff --git a/configure.ac b/configure.ac
index 6b5a8c0..afa2cc7 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
-# $Id: configure.ac 1861 2013-10-22 15:47:31Z oconrad $
+# $Id: configure.ac 2100 2014-04-19 12:27:42Z reklov_w $
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(saga, 2.1.1, BUG-REPORT-ADDRESS)
+AC_INIT(saga, 2.1.2, 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])
@@ -158,7 +158,7 @@ AC_ARG_ENABLE(openmp,
   else
     if test -n "$GOMPFOUND" ; then 
       AC_MSG_RESULT([        Building with OpenMP support using libgomp])
-      GOMPFLAGS="-fopenmp"
+      GOMPFLAGS="-fopenmp -lgomp"
     else 
       AC_MSG_RESULT([        libgomp not found, OpenMP support disabled]) 
       GOMPFLAGS=""
@@ -196,8 +196,6 @@ AC_ARG_ENABLE(python,
       AM_CONDITIONAL(SAGA_PYTHON, test x$python = xtrue)
 if test x$python = xtrue; then
 AM_PATH_PYTHON
-# PYTHON_EXTRA_LIBS='-lgomp'
-# PYTHON_EXTRA_LDFLAGS='-lgomp'
 AX_PYTHON_DEVEL([])
 
 AX_PKG_SWIG(1.3.17,[],[])
@@ -217,6 +215,20 @@ AC_OUTPUT(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/Makefile \
+	src/modules/db/db_pgsql/Makefile \
+	src/modules/docs/Makefile \
+	src/modules/docs/docs_html/Makefile \
+	src/modules/docs/docs_pdf/Makefile \
+	src/modules/garden/Makefile \
+	src/modules/garden/garden_3d_viewer/Makefile \
+	src/modules/garden/garden_fractals/Makefile \
+	src/modules/garden/garden_games/Makefile \
+	src/modules/garden/garden_learn_to_program/Makefile \
+	src/modules/garden/garden_webservices/Makefile \
 	src/modules/grid/Makefile \
 	src/modules/grid/grid_analysis/Makefile \
 	src/modules/grid/grid_calculus/Makefile \
@@ -226,9 +238,33 @@ AC_OUTPUT(Makefile \
 	src/modules/grid/grid_spline/Makefile \
 	src/modules/grid/grid_tools/Makefile \
 	src/modules/grid/grid_visualisation/Makefile \
+	src/modules/imagery/Makefile \
+	src/modules/imagery/imagery_classification/Makefile \
+	src/modules/imagery/imagery_opencv/Makefile \
+	src/modules/imagery/imagery_photogrammetry/Makefile \
+	src/modules/imagery/imagery_rga/Makefile \
+	src/modules/imagery/imagery_segmentation/Makefile \
+	src/modules/imagery/imagery_svm/Makefile \
+	src/modules/imagery/imagery_tools/Makefile \
+	src/modules/imagery/imagery_vigra/Makefile \
+	src/modules/io/Makefile \
+	src/modules/io/io_esri_e00/Makefile \
+	src/modules/io/io_gdal/Makefile \
+	src/modules/io/io_gps/Makefile \
+	src/modules/io/io_grid/Makefile \
+	src/modules/io/io_grid_grib2/Makefile \
+	src/modules/io/io_grid_image/Makefile \
+	src/modules/io/io_shapes/Makefile \
+	src/modules/io/io_shapes_dxf/Makefile \
+	src/modules/io/io_shapes_las/Makefile \
+	src/modules/io/io_table/Makefile \
+	src/modules/io/io_virtual/Makefile \
 	src/modules/pointcloud/Makefile \
 	src/modules/pointcloud/pointcloud_tools/Makefile \
 	src/modules/pointcloud/pointcloud_viewer/Makefile \
+	src/modules/projection/Makefile \
+	src/modules/projection/pj_georeference/Makefile \
+	src/modules/projection/pj_proj4/Makefile \
 	src/modules/shapes/Makefile \
 	src/modules/shapes/shapes_grid/Makefile \
 	src/modules/shapes/shapes_lines/Makefile \
@@ -236,90 +272,31 @@ AC_OUTPUT(Makefile \
 	src/modules/shapes/shapes_polygons/Makefile \
 	src/modules/shapes/shapes_tools/Makefile \
 	src/modules/shapes/shapes_transect/Makefile \
+	src/modules/simulation/Makefile \
+	src/modules/simulation/sim_cellular_automata/Makefile \
+	src/modules/simulation/sim_ecosystems_hugget/Makefile \
+	src/modules/simulation/sim_erosion/Makefile \
+	src/modules/simulation/sim_fire_spreading/Makefile \
+	src/modules/simulation/sim_hydrology/Makefile \
+	src/modules/simulation/sim_ihacres/Makefile \
+	src/modules/statistics/Makefile \
+	src/modules/statistics/statistics_grid/Makefile \
+	src/modules/statistics/statistics_kriging/Makefile \
+	src/modules/statistics/statistics_points/Makefile \
+	src/modules/statistics/statistics_regression/Makefile \
 	src/modules/table/Makefile \
 	src/modules/table/table_calculus/Makefile \
 	src/modules/table/table_tools/Makefile \
+	src/modules/terrain_analysis/Makefile \
+	src/modules/terrain_analysis/ta_channels/Makefile \
+	src/modules/terrain_analysis/ta_compound/Makefile \
+	src/modules/terrain_analysis/ta_hydrology/Makefile \
+	src/modules/terrain_analysis/ta_lighting/Makefile \
+	src/modules/terrain_analysis/ta_morphometry/Makefile \
+	src/modules/terrain_analysis/ta_preprocessor/Makefile \
+	src/modules/terrain_analysis/ta_profiles/Makefile \
+	src/modules/terrain_analysis/ta_slope_stability/Makefile \
 	src/modules/tin/Makefile \
 	src/modules/tin/tin_tools/Makefile \
 	src/modules/tin/tin_viewer/Makefile \
-	src/modules_contrib/Makefile \
-	src/modules_contrib/contrib_a_perego/Makefile \
-	src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile \
-	src/modules_contrib/contrib_s_liersch/Makefile \
-	src/modules_contrib/contrib_s_liersch/ihacres/Makefile \
-	src/modules_contrib/garden/Makefile \
-	src/modules_contrib/garden/garden_3d_viewer/Makefile \
-	src/modules_contrib/garden/garden_webservices/Makefile \
-	src/modules_geostatistics/Makefile \
-	src/modules_geostatistics/geostatistics/Makefile \
-	src/modules_geostatistics/geostatistics/geostatistics_points/Makefile \
-	src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile \
-	src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile \
-	src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile \
-	src/modules_images/Makefile \
-	src/modules_images/modules_imagery/Makefile \
-	src/modules_images/modules_imagery/imagery_classification/Makefile \
-	src/modules_images/modules_imagery/imagery_rga/Makefile \
-	src/modules_images/modules_imagery/imagery_segmentation/Makefile \
-	src/modules_images/modules_imagery/imagery_svm/Makefile \
-	src/modules_images/modules_imagery/imagery_tools/Makefile \
-	src/modules_images/modules_opencv/Makefile \
-	src/modules_images/modules_opencv/opencv/Makefile \
-	src/modules_images/modules_vigra/Makefile \
-	src/modules_images/modules_vigra/vigra/Makefile \
-	src/modules_io/Makefile \
-	src/modules_io/esri_e00/Makefile \
-	src/modules_io/esri_e00/io_esri_e00/Makefile \
-	src/modules_io/db/Makefile \
-	src/modules_io/db/io_odbc/Makefile \
-	src/modules_io/db/io_pgsql/Makefile \
-	src/modules_io/docs/Makefile \
-	src/modules_io/docs/docs_html/Makefile \
-	src/modules_io/docs/docs_pdf/Makefile \
-	src/modules_io/gdal/Makefile \
-	src/modules_io/gdal/io_gdal/Makefile \
-	src/modules_io/grid/Makefile \
-	src/modules_io/grid/io_grid/Makefile \
-	src/modules_io/grid/io_grid_image/Makefile \
-	src/modules_io/grid/io_grid_grib2/Makefile \
-	src/modules_io/gps/Makefile \
-	src/modules_io/gps/io_gps/Makefile \
-	src/modules_io/shapes/Makefile \
-	src/modules_io/shapes/io_shapes/Makefile \
-	src/modules_io/shapes/io_shapes_dxf/Makefile \
-	src/modules_io/shapes/io_shapes_las/Makefile \
-	src/modules_io/table/Makefile \
-	src/modules_io/table/io_table/Makefile \
-	src/modules_lectures/Makefile \
-	src/modules_lectures/lectures/Makefile \
-	src/modules_lectures/lectures/lectures_introduction/Makefile \
-	src/modules_projection/Makefile \
-	src/modules_projection/pj_georeference/Makefile \
-	src/modules_projection/pj_georeference/pj_georeference/Makefile \
-	src/modules_projection/pj_proj4/Makefile \
-	src/modules_projection/pj_proj4/pj_proj4/Makefile \
-	src/modules_recreations/Makefile \
-	src/modules_recreations/recreations/Makefile \
-	src/modules_recreations/recreations/recreations_fractals/Makefile \
-	src/modules_recreations/recreations/recreations_games/Makefile \
-	src/modules_simulation/Makefile \
-	src/modules_simulation/erosion/Makefile \
-	src/modules_simulation/erosion/sim_erosion/Makefile \
-	src/modules_simulation/hydrology/Makefile \
-	src/modules_simulation/hydrology/sim_hydrology/Makefile \
-	src/modules_simulation/cellular_automata/Makefile \
-	src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile \
-	src/modules_simulation/ecosystems/Makefile \
-	src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile \
-	src/modules_simulation/fire/Makefile \
-	src/modules_simulation/fire/sim_fire_spreading/Makefile \
-	src/modules_terrain_analysis/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile \
-	src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile \
 )
diff --git a/depcomp b/depcomp
index df8eea7..debb6ff 100755
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
 # 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
@@ -28,7 +27,7 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -40,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -57,6 +56,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -90,10 +95,24 @@ if test "$depmode" = msvcmsys; then
    # This is just like msvisualcpp but w/o cygpath translation.
    # Just convert the backslash-escaped backslashes to single forward
    # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
+   cygpath_u='sed s,\\\\,/,g'
    depmode=msvisualcpp
 fi
 
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+   gccflag=-qmakedep=gcc,-MF
+   depmode=gcc
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
@@ -148,20 +167,21 @@ gcc)
 ## The second -e expression handles DOS-style file names with drive letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+  tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -193,18 +213,15 @@ sgi)
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    >> "$depfile"
   else
@@ -216,10 +233,17 @@ sgi)
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
@@ -249,12 +273,11 @@ aix)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
+    # Each line is of the form 'foo.o: dependent.h'.
     # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
     sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -265,23 +288,26 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+  # However on
+  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   # ICC 7.0 will fill foo.d with something like
   #    foo.o: sub/foo.c
   #    foo.o: sub/foo.h
-  # which is wrong.  We want:
+  # which is wrong.  We want
   #    sub/foo.o: sub/foo.c
   #    sub/foo.o: sub/foo.h
   #    sub/foo.c:
   #    sub/foo.h:
   # ICC 7.1 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\':
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-
+  # tcc 0.9.26 (FIXME still under development at the moment of writing)
+  # will emit a similar output, but also prepend the continuation lines
+  # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
@@ -290,15 +316,21 @@ icc)
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Each line is of the form 'foo.o: dependent.h',
+  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
+  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
+    < "$tmpdepfile" > "$depfile"
+  sed '
+    s/[ '"$tab"'][ '"$tab"']*/ /g
+    s/^ *//
+    s/ *\\*$//
+    s/^[^:]*: *//
+    /^$/d
+    /:$/d
+    s/$/ :/
+  ' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -334,7 +366,7 @@ hp2)
   done
   if test -f "$tmpdepfile"; then
     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
 	       s/^ *//
 	       s/ \\*$//
@@ -349,9 +381,9 @@ hp2)
 
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
+   # dependencies in 'foo.d' instead, so we check for that too.
    # Subdirectories are respected.
    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    test "x$dir" = "x$object" && dir=
@@ -397,14 +429,59 @@ tru64)
    done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -422,7 +499,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,15 +519,14 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
+  tr ' ' "$nl" < "$tmpdepfile" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -503,9 +579,10 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -525,7 +602,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -594,8 +671,8 @@ msvisualcpp)
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/install-sh b/install-sh
index 6781b98..377bb86 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
 	shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
 	      if test -z "$dir_arg" || {
 		   # Check for POSIX incompatibilities with -m.
 		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
+		   # other-writable bit of parent directory when it shouldn't.
 		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
 		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
 		   case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
 	/*) prefix='/';;
-	-*) prefix='./';;
+	[-=\(\)!]*) prefix='./';;
 	*)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-	test -z "$d" && continue
+	test X"$d" = X && continue
 
 	prefix=$prefix$d
 	if test -d "$prefix"; then
diff --git a/ltmain.sh b/ltmain.sh
old mode 100755
new mode 100644
index a72f2fd..63ae69d
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,9 +1,9 @@
-# Generated from ltmain.m4sh.
 
-# ltmain.sh (GNU libtool) 2.2.6b
+# libtool (GNU libtool) 2.4.2
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -32,50 +32,57 @@
 #
 # Provide generalized library-building support services.
 #
-#     --config             show all configuration variables
-#     --debug              enable verbose shell tracing
-# -n, --dry-run            display commands without modifying any files
-#     --features           display basic configuration information and exit
-#     --mode=MODE          use operation mode MODE
-#     --preserve-dup-deps  don't remove duplicate dependency libraries
-#     --quiet, --silent    don't print informational messages
-#     --tag=TAG            use configuration variables from tag TAG
-# -v, --verbose            print informational messages (default)
-#     --version            print version information
-# -h, --help               print short or long help message
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --no-warn            don't display warning messages
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
 #
 # MODE must be one of the following:
 #
-#       clean              remove files from the build directory
-#       compile            compile a source file into a libtool object
-#       execute            automatically set library path, then run a program
-#       finish             complete the installation of libtool libraries
-#       install            install libraries or executables
-#       link               create a library or an executable
-#       uninstall          remove libraries from an installed directory
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
 #
-# MODE-ARGS vary depending on the MODE.
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
 #
 # When reporting a bug, please describe a test case to reproduce it and
 # include the following information:
 #
-#       host-triplet:	$host
-#       shell:		$SHELL
-#       compiler:		$LTCC
-#       compiler flags:		$LTCFLAGS
-#       linker:		$LD (gnu? $with_gnu_ld)
-#       $progname:		(GNU libtool) 2.2.6b
-#       automake:		$automake_version
-#       autoconf:		$autoconf_version
+#         host-triplet:	$host
+#         shell:		$SHELL
+#         compiler:		$LTCC
+#         compiler flags:		$LTCFLAGS
+#         linker:		$LD (gnu? $with_gnu_ld)
+#         $progname:	(GNU libtool) 2.4.2
+#         automake:	$automake_version
+#         autoconf:	$autoconf_version
 #
 # Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
-PROGRAM=ltmain.sh
+PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.2.6b
+VERSION=2.4.2
 TIMESTAMP=""
-package_revision=1.3017
+package_revision=1.3337
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -91,10 +98,15 @@ fi
 BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
 # NLS nuisances: We save the old values to restore during execute mode.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
 lt_user_locale=
 lt_safe_locale=
 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
@@ -107,24 +119,28 @@ do
 	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 	fi"
 done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
 
 $lt_unset CDPATH
 
 
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
 
 
 
 : ${CP="cp -f"}
-: ${ECHO="echo"}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="/bin/sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -144,6 +160,27 @@ IFS=" 	$lt_nl"
 dirname="s,/[^/]*$,,"
 basename="s,^.*/,,"
 
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
 # func_dirname_and_basename file append nondir_replacement
 # perform func_basename and func_dirname in a single function
 # call:
@@ -158,33 +195,183 @@ basename="s,^.*/,,"
 # those functions but instead duplicate the functionality here.
 func_dirname_and_basename ()
 {
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+		s@/\./@/@g
+		t dotsl
+		s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 }
 
-# Generated shell functions inserted here.
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
 
 # The name of this program:
-# In the unlikely event $progname began with a '-', it would play havoc with
-# func_echo (imagine progname=-n), so we prepend ./ in that case:
 func_dirname_and_basename "$progpath"
 progname=$func_basename_result
-case $progname in
-  -*) progname=./$progname ;;
-esac
 
 # Make sure we have an absolute path for reexecution:
 case $progpath in
@@ -196,7 +383,7 @@ case $progpath in
      ;;
   *)
      save_IFS="$IFS"
-     IFS=:
+     IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
        IFS="$save_IFS"
        test -x "$progdir/$progname" && break
@@ -215,6 +402,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
 # Same as above, but do not quote variable references.
 double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
 # Re-`\' parameter expansions in output of double_quote_subst that were
 # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
 # in input to double_quote_subst, that '$' was protected from expansion.
@@ -243,7 +439,7 @@ opt_warning=:
 # name if it has been set yet.
 func_echo ()
 {
-    $ECHO "$progname${mode+: }$mode: $*"
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
 }
 
 # func_verbose arg...
@@ -258,18 +454,25 @@ func_verbose ()
     :
 }
 
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
 # func_error arg...
 # Echo program name prefixed message to standard error.
 func_error ()
 {
-    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
 }
 
 # func_warning arg...
 # Echo program name prefixed warning message to standard error.
 func_warning ()
 {
-    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
 
     # bash bug again:
     :
@@ -326,9 +529,9 @@ func_mkdir_p ()
         case $my_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
       done
-      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
 
       save_mkdir_p_IFS="$IFS"; IFS=':'
       for my_dir in $my_dir_list; do
@@ -378,7 +581,7 @@ func_mktempdir ()
         func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
     fi
 
-    $ECHO "X$my_tmpdir" | $Xsed
+    $ECHO "$my_tmpdir"
 }
 
 
@@ -392,7 +595,7 @@ func_quote_for_eval ()
 {
     case $1 in
       *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
       *)
         func_quote_for_eval_unquoted_result="$1" ;;
     esac
@@ -419,7 +622,7 @@ func_quote_for_expand ()
 {
     case $1 in
       *[\\\`\"]*)
-	my_arg=`$ECHO "X$1" | $Xsed \
+	my_arg=`$ECHO "$1" | $SED \
 	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
         my_arg="$1" ;;
@@ -488,15 +691,39 @@ func_show_eval_locale ()
     fi
 }
 
-
-
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
+  esac
+}
 
 
 # func_version
 # Echo version message to standard output and exit.
 func_version ()
 {
-    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+    $opt_debug
+
+    $SED -n '/(C)/!b go
+	:more
+	/\./!{
+	  N
+	  s/\n# / /
+	  b more
+	}
+	:go
+	/^# '$PROGRAM' (GNU /,/# warranty; / {
         s/^# //
 	s/^# *$//
         s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
@@ -509,22 +736,28 @@ func_version ()
 # Echo short help message to standard output and exit.
 func_usage ()
 {
-    $SED -n '/^# Usage:/,/# -h/ {
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
         s/^# //
 	s/^# *$//
 	s/\$progname/'$progname'/
 	p
     }' < "$progpath"
-    $ECHO
+    echo
     $ECHO "run \`$progname --help | more' for full usage"
     exit $?
 }
 
-# func_help
-# Echo long help message to standard output and exit.
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
 func_help ()
 {
+    $opt_debug
+
     $SED -n '/^# Usage:/,/# Report bugs to/ {
+	:print
         s/^# //
 	s/^# *$//
 	s*\$progname*'$progname'*
@@ -534,11 +767,18 @@ func_help ()
 	s*\$LTCFLAGS*'"$LTCFLAGS"'*
 	s*\$LD*'"$LD"'*
 	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
 	p
-     }' < "$progpath"
-    exit $?
+	d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
 }
 
 # func_missing_arg argname
@@ -546,63 +786,106 @@ func_help ()
 # exit_cmd.
 func_missing_arg ()
 {
-    func_error "missing argument for $1"
+    $opt_debug
+
+    func_error "missing argument for $1."
     exit_cmd=exit
 }
 
-exit_cmd=:
 
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
 
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
+
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
 
 
 
-# Check that we have a working $ECHO.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell, and then maybe $ECHO will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
 
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
 
 magic="%%%MAGIC variable%%%"
 magic_exe="%%%MAGIC EXE variable%%%"
 
 # Global variables.
-# $mode is unset
 nonopt=
-execute_dlfiles=
 preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 extracted_archives=
 extracted_serial=0
 
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
-
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
 exec_cmd=
 
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
 # func_fatal_configuration arg...
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
@@ -636,16 +919,16 @@ func_config ()
 # Display the features supported by this script.
 func_features ()
 {
-    $ECHO "host: $host"
+    echo "host: $host"
     if test "$build_libtool_libs" = yes; then
-      $ECHO "enable shared libraries"
+      echo "enable shared libraries"
     else
-      $ECHO "disable shared libraries"
+      echo "disable shared libraries"
     fi
     if test "$build_old_libs" = yes; then
-      $ECHO "enable static libraries"
+      echo "enable static libraries"
     else
-      $ECHO "disable static libraries"
+      echo "disable static libraries"
     fi
 
     exit $?
@@ -692,117 +975,209 @@ func_enable_tag ()
   esac
 }
 
-# Parse options once, thoroughly.  This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
 {
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
 
-  # Shorthand for --mode=foo, only valid as the first argument
-  case $1 in
-  clean|clea|cle|cl)
-    shift; set dummy --mode clean ${1+"$@"}; shift
-    ;;
-  compile|compil|compi|comp|com|co|c)
-    shift; set dummy --mode compile ${1+"$@"}; shift
-    ;;
-  execute|execut|execu|exec|exe|ex|e)
-    shift; set dummy --mode execute ${1+"$@"}; shift
-    ;;
-  finish|finis|fini|fin|fi|f)
-    shift; set dummy --mode finish ${1+"$@"}; shift
-    ;;
-  install|instal|insta|inst|ins|in|i)
-    shift; set dummy --mode install ${1+"$@"}; shift
-    ;;
-  link|lin|li|l)
-    shift; set dummy --mode link ${1+"$@"}; shift
-    ;;
-  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-    shift; set dummy --mode uninstall ${1+"$@"}; shift
-    ;;
-  esac
 
-  # Parse non-mode specific arguments:
-  while test "$#" -gt 0; do
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
     opt="$1"
     shift
-
     case $opt in
-      --config)		func_config					;;
-
-      --debug)		preserve_args="$preserve_args $opt"
+      --debug|-x)	opt_debug='set -x'
 			func_echo "enabling shell trace mode"
-			opt_debug='set -x'
 			$opt_debug
 			;;
-
-      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			execute_dlfiles="$execute_dlfiles $1"
-			shift
+      --dry-run|--dryrun|-n)
+			opt_dry_run=:
 			;;
-
-      --dry-run | -n)	opt_dry_run=:					;;
-      --features)       func_features					;;
-      --finish)		mode="finish"					;;
-
-      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			case $1 in
-			  # Valid mode arguments:
-			  clean)	;;
-			  compile)	;;
-			  execute)	;;
-			  finish)	;;
-			  install)	;;
-			  link)		;;
-			  relink)	;;
-			  uninstall)	;;
-
-			  # Catch anything else as an error
-			  *) func_error "invalid argument for $opt"
-			     exit_cmd=exit
-			     break
-			     ;;
-		        esac
-
-			mode="$1"
+      --config)
+			opt_config=:
+func_config
+			;;
+      --dlopen|-dlopen)
+			optarg="$1"
+			opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
 			shift
 			;;
-
       --preserve-dup-deps)
-			opt_duplicate_deps=:				;;
-
-      --quiet|--silent)	preserve_args="$preserve_args $opt"
-			opt_silent=:
+			opt_preserve_dup_deps=:
 			;;
-
-      --verbose| -v)	preserve_args="$preserve_args $opt"
+      --features)
+			opt_features=:
+func_features
+			;;
+      --finish)
+			opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+			;;
+      --help)
+			opt_help=:
+			;;
+      --help-all)
+			opt_help_all=:
+opt_help=': help-all'
+			;;
+      --mode)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+			shift
+			;;
+      --no-silent|--no-quiet)
 			opt_silent=false
+func_append preserve_args " $opt"
 			;;
-
-      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			preserve_args="$preserve_args $opt $1"
-			func_enable_tag "$1"	# tagname is set here
+      --no-warning|--no-warn)
+			opt_warning=false
+func_append preserve_args " $opt"
+			;;
+      --no-verbose)
+			opt_verbose=false
+func_append preserve_args " $opt"
+			;;
+      --silent|--quiet)
+			opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+			;;
+      --verbose|-v)
+			opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+			;;
+      --tag)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
 			shift
 			;;
 
+      -\?|-h)		func_usage				;;
+      --help)		func_help				;;
+      --version)	func_version				;;
+
       # Separate optargs to long options:
-      -dlopen=*|--mode=*|--tag=*)
-			func_opt_split "$opt"
-			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+      --*=*)
+			func_split_long_opt "$opt"
+			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
 			shift
 			;;
 
-      -\?|-h)		func_usage					;;
-      --help)		opt_help=:					;;
-      --version)	func_version					;;
-
-      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
-
-      *)		nonopt="$opt"
-			break
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+			func_split_short_opt "$opt"
+			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+			shift
 			;;
+
+      --)		break					;;
+      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
+      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
     esac
   done
 
+  # Validate options:
+
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
+
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
 
   case $host in
     *cygwin* | *mingw* | *pw32* | *cegcc*)
@@ -810,82 +1185,44 @@ func_enable_tag ()
       opt_duplicate_compiler_generated_deps=:
       ;;
     *)
-      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
       ;;
   esac
 
-  # Having warned about all mis-specified options, bail out if
-  # anything was wrong.
-  $exit_cmd $EXIT_FAILURE
-}
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
 
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
     fi
 
-    exit $EXIT_MISMATCH
-  fi
-}
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-$opt_help || {
-  # Sanity checks first:
-  func_check_version_match
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
 
-  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-    func_fatal_configuration "not configured to build any kind of library"
-  fi
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
 
-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
 
 
-  # Darwin sucks
-  eval std_shrext=\"$shrext_cmds\"
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
 
 
-  # Only execute mode is allowed to have -dlopen flags.
-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    func_error "unrecognized option \`-dlopen'"
-    $ECHO "$help" 1>&2
-    exit $EXIT_FAILURE
-  fi
 
-  # Change the help message to a mode-specific one.
-  generic_help="$help"
-  help="Try \`$progname --help --mode=$mode' for more information."
-}
 
+## ----------- ##
+##    Main.    ##
+## ----------- ##
 
 # func_lalib_p file
 # True iff FILE is a libtool `.la' library or `.lo' object file.
@@ -950,12 +1287,9 @@ func_ltwrapper_executable_p ()
 # temporary ltwrapper_script.
 func_ltwrapper_scriptname ()
 {
-    func_ltwrapper_scriptname_result=""
-    if func_ltwrapper_executable_p "$1"; then
-	func_dirname_and_basename "$1" "" "."
-	func_stripname '' '.exe' "$func_basename_result"
-	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-    fi
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
 }
 
 # func_ltwrapper_p file
@@ -1001,6 +1335,37 @@ func_source ()
 }
 
 
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case "$lt_sysroot:$1" in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result="=$func_stripname_result"
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
 # func_infer_tag arg
 # Infer tagged configuration to use if any are available and
 # if one wasn't chosen via the "--tag" command line option.
@@ -1013,13 +1378,15 @@ func_infer_tag ()
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
-        func_quote_for_eval "$arg"
-	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	func_append_quoted CC_quoted "$arg"
       done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
       case $@ in
       # Blanks in the command may have been stripped by the calling shell,
       # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
       # Blanks at the start of $base_compile will cause this to fail
       # if we don't check for them as well.
       *)
@@ -1030,11 +1397,13 @@ func_infer_tag ()
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
-	      func_quote_for_eval "$arg"
-	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	      func_append_quoted CC_quoted "$arg"
 	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
 	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
 	      # The compiler in the base compile command matches
 	      # the one in the tagged configuration.
 	      # Assume this is the tagged configuration we want.
@@ -1097,6 +1466,486 @@ EOF
     }
 }
 
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$lt_sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $opt_debug
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=""
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $opt_debug
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $opt_debug
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  \`$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result="$1"
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $opt_debug
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  \`$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result="$3"
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $opt_debug
+  case $4 in
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $opt_debug
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $opt_debug
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $opt_debug
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $opt_debug
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
@@ -1137,12 +1986,12 @@ func_mode_compile ()
 	  ;;
 
 	-pie | -fpie | -fPIE)
-          pie_flag="$pie_flag $arg"
+          func_append pie_flag " $arg"
 	  continue
 	  ;;
 
 	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  later="$later $arg"
+	  func_append later " $arg"
 	  continue
 	  ;;
 
@@ -1163,15 +2012,14 @@ func_mode_compile ()
 	  save_ifs="$IFS"; IFS=','
 	  for arg in $args; do
 	    IFS="$save_ifs"
-	    func_quote_for_eval "$arg"
-	    lastarg="$lastarg $func_quote_for_eval_result"
+	    func_append_quoted lastarg "$arg"
 	  done
 	  IFS="$save_ifs"
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
 	  # Add the arguments to base_compile.
-	  base_compile="$base_compile $lastarg"
+	  func_append base_compile " $lastarg"
 	  continue
 	  ;;
 
@@ -1187,8 +2035,7 @@ func_mode_compile ()
       esac    #  case $arg_mode
 
       # Aesthetically quote the previous argument.
-      func_quote_for_eval "$lastarg"
-      base_compile="$base_compile $func_quote_for_eval_result"
+      func_append_quoted base_compile "$lastarg"
     done # for arg
 
     case $arg_mode in
@@ -1213,7 +2060,7 @@ func_mode_compile ()
     *.[cCFSifmso] | \
     *.ada | *.adb | *.ads | *.asm | \
     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
       func_xform "$libobj"
       libobj=$func_xform_result
       ;;
@@ -1288,7 +2135,7 @@ func_mode_compile ()
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
     if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
       lockfile="$output_obj.lock"
     else
       output_obj=
@@ -1319,17 +2166,16 @@ compiler."
 	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
-      removelist="$removelist $output_obj"
+      func_append removelist " $output_obj"
       $ECHO "$srcfile" > "$lockfile"
     fi
 
     $opt_dry_run || $RM $removelist
-    removelist="$removelist $lockfile"
+    func_append removelist " $lockfile"
     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
 
-    if test -n "$fix_srcfile_path"; then
-      eval srcfile=\"$fix_srcfile_path\"
-    fi
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
     func_quote_for_eval "$srcfile"
     qsrcfile=$func_quote_for_eval_result
 
@@ -1349,7 +2195,7 @@ compiler."
 
       if test -z "$output_obj"; then
 	# Place PIC objects in $objdir
-	command="$command -o $lobj"
+	func_append command " -o $lobj"
       fi
 
       func_show_eval_locale "$command"	\
@@ -1396,11 +2242,11 @@ compiler."
 	command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
-	command="$command -o $obj"
+	func_append command " -o $obj"
       fi
 
       # Suppress compiler output if we already did a PIC compilation.
-      command="$command$suppress_output"
+      func_append command "$suppress_output"
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
@@ -1445,13 +2291,13 @@ compiler."
 }
 
 $opt_help || {
-test "$mode" = compile && func_mode_compile ${1+"$@"}
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
 {
     # We need to display help for each of the modes.
-    case $mode in
+    case $opt_mode in
       "")
         # Generic help is extracted from the usage comments
         # at the start of this file.
@@ -1482,10 +2328,11 @@ This mode accepts the following additional options:
 
   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
   -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
   -shared           do not build a \`.o' file suitable for static linking
   -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
 
 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
 from the given SOURCEFILE.
@@ -1538,7 +2385,7 @@ either the \`install' or \`cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
-  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
 
 The rest of the components are interpreted as arguments to that command (only
 BSD-compatible install options are recognized)."
@@ -1558,6 +2405,8 @@ The following components of LINK-COMMAND are treated specially:
 
   -all-static       do not do any dynamic linking at all
   -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
@@ -1586,6 +2435,11 @@ The following components of LINK-COMMAND are treated specially:
   -version-info CURRENT[:REVISION[:AGE]]
                     specify library version info [each variable defaults to 0]
   -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
 All other options (arguments beginning with \`-') are ignored.
 
@@ -1619,18 +2473,44 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$mode'"
+        func_fatal_help "invalid operation mode \`$opt_mode'"
         ;;
     esac
 
-    $ECHO
+    echo
     $ECHO "Try \`$progname --help' for more information about other modes."
-
-    exit $?
 }
 
-  # Now that we've collected a possible --mode arg, show help if necessary
-  $opt_help && func_mode_help
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
 
 
 # func_mode_execute arg...
@@ -1643,13 +2523,16 @@ func_mode_execute ()
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
+    for file in $opt_dlopen; do
       test -f "$file" \
 	|| func_fatal_help "\`$file' is not a file"
 
       dir=
       case $file in
       *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
 	  || func_fatal_help "\`$lib' is not a valid libtool archive"
@@ -1671,7 +2554,7 @@ func_mode_execute ()
 	dir="$func_dirname_result"
 
 	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
+	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
 	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
@@ -1712,7 +2595,7 @@ func_mode_execute ()
     for file
     do
       case $file in
-      -*) ;;
+      -* | *.la | *.lo ) ;;
       *)
 	# Do a test to see if this is really a libtool program.
 	if func_ltwrapper_script_p "$file"; then
@@ -1728,8 +2611,7 @@ func_mode_execute ()
 	;;
       esac
       # Quote arguments (to preserve shell metacharacters).
-      func_quote_for_eval "$file"
-      args="$args $func_quote_for_eval_result"
+      func_append_quoted args "$file"
     done
 
     if test "X$opt_dry_run" = Xfalse; then
@@ -1754,29 +2636,66 @@ func_mode_execute ()
       # Display what would be done.
       if test -n "$shlibpath_var"; then
 	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	$ECHO "export $shlibpath_var"
+	echo "export $shlibpath_var"
       fi
       $ECHO "$cmd$args"
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$mode" = execute && func_mode_execute ${1+"$@"}
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
     $opt_debug
-    libdirs="$nonopt"
+    libs=
+    libdirs=
     admincmds=
 
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+	func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+	if func_lalib_unsafe_p "$opt"; then
+	  func_append libs " $opt"
+	else
+	  func_warning "\`$opt' is not a valid libtool archive"
+	fi
+
+      else
+	func_fatal_error "invalid argument \`$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	    > $tmpdir/tmp-la
+	  mv -f $tmpdir/tmp-la $lib
+	done
+        ${RM}r "$tmpdir"
+      fi
+    fi
 
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       for libdir in $libdirs; do
 	if test -n "$finish_cmds"; then
 	  # Do each command in the finish commands.
@@ -1786,7 +2705,7 @@ func_mode_finish ()
 	if test -n "$finish_eval"; then
 	  # Do the single finish_eval.
 	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
        $cmds"
 	fi
       done
@@ -1795,53 +2714,55 @@ func_mode_finish ()
     # Exit here if they wanted silent mode.
     $opt_silent && exit $EXIT_SUCCESS
 
-    $ECHO "X----------------------------------------------------------------------" | $Xsed
-    $ECHO "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $ECHO "   $libdir"
-    done
-    $ECHO
-    $ECHO "If you ever happen to want to link against installed libraries"
-    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
-    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $ECHO "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $ECHO "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $ECHO "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+	$ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+	libdir=LIBDIR
+	eval flag=\"$hardcode_libdir_flag_spec\"
 
-      $ECHO "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $ECHO "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $ECHO
+	$ECHO "   - use the \`$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+	$ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      fi
+      echo
 
-    $ECHO "See any operating system documentation about shared libraries for"
-    case $host in
-      solaris2.[6789]|solaris2.1[0-9])
-        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	$ECHO "pages."
-	;;
-      *)
-        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
-        ;;
-    esac
-    $ECHO "X----------------------------------------------------------------------" | $Xsed
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+	solaris2.[6789]|solaris2.1[0-9])
+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	  echo "pages."
+	  ;;
+	*)
+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
+	  ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
     exit $EXIT_SUCCESS
 }
 
-test "$mode" = finish && func_mode_finish ${1+"$@"}
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
@@ -1852,7 +2773,7 @@ func_mode_install ()
     # install_prog (especially on Windows NT).
     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
        # Allow the use of GNU shtool's install command.
-       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+       case $nonopt in *shtool*) :;; *) false;; esac; then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -1866,7 +2787,12 @@ func_mode_install ()
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
     func_quote_for_eval "$arg"
-    install_prog="$install_prog$func_quote_for_eval_result"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
 
     # We need to accept at least all the BSD install flags.
     dest=
@@ -1876,10 +2802,12 @@ func_mode_install ()
     install_type=
     isdir=no
     stripme=
+    no_mode=:
     for arg
     do
+      arg2=
       if test -n "$dest"; then
-	files="$files $dest"
+	func_append files " $dest"
 	dest=$arg
 	continue
       fi
@@ -1887,10 +2815,9 @@ func_mode_install ()
       case $arg in
       -d) isdir=yes ;;
       -f)
-	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
 	;;
       -g | -m | -o)
 	prev=$arg
@@ -1904,6 +2831,10 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
+	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
 	  prev=
 	else
 	  dest=$arg
@@ -1914,7 +2845,11 @@ func_mode_install ()
 
       # Aesthetically quote the argument.
       func_quote_for_eval "$arg"
-      install_prog="$install_prog $func_quote_for_eval_result"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
     done
 
     test -z "$install_prog" && \
@@ -1923,6 +2858,13 @@ func_mode_install ()
     test -n "$prev" && \
       func_fatal_help "the \`$prev' option requires an argument"
 
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
     if test -z "$files"; then
       if test -z "$dest"; then
 	func_fatal_help "no file or destination specified"
@@ -1977,10 +2919,13 @@ func_mode_install ()
       case $file in
       *.$libext)
 	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
+	func_append staticlibs " $file"
 	;;
 
       *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
 	  || func_fatal_help "\`$file' is not a valid libtool archive"
@@ -1994,23 +2939,23 @@ func_mode_install ()
 	if test "X$destdir" = "X$libdir"; then
 	  case "$current_libdirs " in
 	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  *) func_append current_libdirs " $libdir" ;;
 	  esac
 	else
 	  # Note the libdir as a future libdir.
 	  case "$future_libdirs " in
 	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  *) func_append future_libdirs " $libdir" ;;
 	  esac
 	fi
 
 	func_dirname "$file" "/" ""
 	dir="$func_dirname_result"
-	dir="$dir$objdir"
+	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
 	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
 
 	  # Don't allow the user to place us outside of our expected
 	  # location b/c this prevents finding dependent libraries that
@@ -2023,9 +2968,9 @@ func_mode_install ()
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 	  else
-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
 	  func_warning "relinking \`$file'"
@@ -2043,7 +2988,7 @@ func_mode_install ()
 	  test -n "$relink_command" && srcname="$realname"T
 
 	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
 	  tstripme="$stripme"
 	  case $host_os in
@@ -2083,7 +3028,7 @@ func_mode_install ()
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
 	;;
 
       *.lo)
@@ -2183,7 +3128,7 @@ func_mode_install ()
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
 	    if test -n "$libdir" && test ! -f "$libfile"; then
 	      func_warning "\`$lib' has not been installed in \`$libdir'"
 	      finalize=no
@@ -2202,7 +3147,7 @@ func_mode_install ()
 		file="$func_basename_result"
 	        outputname="$tmpdir/$file"
 	        # Replace the output file specification.
-	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
 	        $opt_silent || {
 	          func_quote_for_expand "$relink_command"
@@ -2221,7 +3166,7 @@ func_mode_install ()
 	    }
 	  else
 	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
 	  fi
 	fi
 
@@ -2257,11 +3202,13 @@ func_mode_install ()
 
       # Set up the ranlib parameters.
       oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
 
       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
 
       if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $oldlib" 'exit $?'
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
       fi
 
       # Do each command in the postinstall commands.
@@ -2280,7 +3227,7 @@ func_mode_install ()
     fi
 }
 
-test "$mode" = install && func_mode_install ${1+"$@"}
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -2323,6 +3270,22 @@ func_generate_dlsyms ()
 extern \"C\" {
 #endif
 
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
 /* External symbol declarations for the compiler. */\
 "
 
@@ -2332,10 +3295,11 @@ extern \"C\" {
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
 	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
-	    func_verbose "extracting global C symbols from \`$progfile'"
-	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
 	  if test -n "$exclude_expsyms"; then
@@ -2371,7 +3335,7 @@ extern \"C\" {
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
-	        *cygwin | *mingw* | *cegcc* )
+	        *cygwin* | *mingw* | *cegcc* )
 	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
 	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
 	          ;;
@@ -2384,10 +3348,52 @@ extern \"C\" {
 	  func_verbose "extracting global C symbols from \`$dlprefile'"
 	  func_basename "$dlprefile"
 	  name="$func_basename_result"
-	  $opt_dry_run || {
-	    eval '$ECHO ": $name " >> "$nlist"'
-	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	  }
+          case $host in
+	    *cygwin* | *mingw* | *cegcc* )
+	      # if an import library, we need to obtain dlname
+	      if func_win32_import_lib_p "$dlprefile"; then
+	        func_tr_sh "$dlprefile"
+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
+	        dlprefile_dlbasename=""
+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+	          # Use subshell, to avoid clobbering current variable values
+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+	          if test -n "$dlprefile_dlname" ; then
+	            func_basename "$dlprefile_dlname"
+	            dlprefile_dlbasename="$func_basename_result"
+	          else
+	            # no lafile. user explicitly requested -dlpreopen <import library>.
+	            $sharedlib_from_linklib_cmd "$dlprefile"
+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
+	          fi
+	        fi
+	        $opt_dry_run || {
+	          if test -n "$dlprefile_dlbasename" ; then
+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+	          else
+	            func_warning "Could not compute DLL name from $name"
+	            eval '$ECHO ": $name " >> "$nlist"'
+	          fi
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+	        }
+	      else # not an import lib
+	        $opt_dry_run || {
+	          eval '$ECHO ": $name " >> "$nlist"'
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	        }
+	      fi
+	    ;;
+	    *)
+	      $opt_dry_run || {
+	        eval '$ECHO ": $name " >> "$nlist"'
+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	      }
+	    ;;
+          esac
 	done
 
 	$opt_dry_run || {
@@ -2415,36 +3421,19 @@ extern \"C\" {
 	  if test -f "$nlist"S; then
 	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
 	  else
-	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
 typedef struct {
   const char *name;
   void *address;
 } lt_dlsymlist;
-"
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc* )
-	    $ECHO >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs.  */"
-	    lt_dlsym_const= ;;
-	  *osf5*)
-	    echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
-	    lt_dlsym_const= ;;
-	  *)
-	    lt_dlsym_const=const ;;
-	  esac
-
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
+extern LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
+LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
 {\
   { \"$my_originator\", (void *) 0 },"
@@ -2457,7 +3446,7 @@ lt_${my_prefix}_LTX_preloaded_symbols[] =
 	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
 	    ;;
 	  esac
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+	  echo >> "$output_objdir/$my_dlsyms" "\
   {0, (void *) 0}
 };
 
@@ -2484,7 +3473,7 @@ static const void *lt_preloaded_setup() {
 	  # linked before any other PIC object.  But we must not use
 	  # pic_flag when linking with -static.  The problem exists in
 	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
@@ -2500,7 +3489,7 @@ static const void *lt_preloaded_setup() {
 	for arg in $LTCFLAGS; do
 	  case $arg in
 	  -pie | -fpie | -fPIE) ;;
-	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  *) func_append symtab_cflags " $arg" ;;
 	  esac
 	done
 
@@ -2515,16 +3504,16 @@ static const void *lt_preloaded_setup() {
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 	  else
-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 	  fi
 	  ;;
 	*)
-	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 	  ;;
 	esac
 	;;
@@ -2538,8 +3527,8 @@ static const void *lt_preloaded_setup() {
       # really was required.
 
       # Nullify the symbol file.
-      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
     fi
 }
 
@@ -2549,6 +3538,7 @@ static const void *lt_preloaded_setup() {
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
   $opt_debug
@@ -2559,9 +3549,11 @@ func_win32_libid ()
     win32_libid_type="x86 archive import"
     ;;
   *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
 	$SED -n -e '
 	    1,100{
 		/ I /{
@@ -2590,6 +3582,131 @@ func_win32_libid ()
   $ECHO "$win32_libid_type"
 }
 
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $opt_debug
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $opt_debug
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[	 ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1" ; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=""
+  fi
+}
 
 
 # func_extract_an_archive dir oldlib
@@ -2598,7 +3715,18 @@ func_extract_an_archive ()
     $opt_debug
     f_ex_an_ar_dir="$1"; shift
     f_ex_an_ar_oldlib="$1"
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
      :
     else
@@ -2669,7 +3797,7 @@ func_extract_archives ()
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
 	      $LIPO -create -output "$darwin_file" $darwin_files
 	    done # $darwin_filelist
 	    $RM -rf unfat-$$
@@ -2684,25 +3812,30 @@ func_extract_archives ()
         func_extract_an_archive "$my_xdir" "$my_xabs"
 	;;
       esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
     func_extract_archives_result="$my_oldobjs"
 }
 
 
-
-# func_emit_wrapper_part1 [arg=no]
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
 #
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
 {
-	func_emit_wrapper_part1_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_part1_arg1=$1
-	fi
+	func_emit_wrapper_arg1=${1-no}
 
 	$ECHO "\
 #! $SHELL
@@ -2718,7 +3851,6 @@ func_emit_wrapper_part1 ()
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'
 
 # Be Bourne compatible
@@ -2749,31 +3881,135 @@ if test \"\$libtool_install_magic\" = \"$magic\"; then
 else
   # When we are sourced in execute mode, \$file and \$ECHO are already set.
   if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    ECHO=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$ECHO works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$ECHO will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
 "
-	$ECHO "\
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
 
   # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
 
   # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
   while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
 
     # If there was a directory component, then change thisdir.
     if test \"x\$destdir\" != \"x\$file\"; then
@@ -2783,30 +4019,13 @@ else
       esac
     fi
 
-    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
   done
-"
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
-	func_emit_wrapper_part2_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_part2_arg1=$1
-	fi
-
-	$ECHO "\
 
   # Usually 'no', except on cygwin/mingw when embedded into
   # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
     # special case for '.'
     if test \"\$thisdir\" = \".\"; then
@@ -2814,7 +4033,7 @@ func_emit_wrapper_part2 ()
     fi
     # remove .libs from thisdir
     case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
     $objdir )   thisdir=. ;;
     esac
   fi
@@ -2869,6 +4088,18 @@ func_emit_wrapper_part2 ()
 
   if test -f \"\$progdir/\$program\"; then"
 
+	# fixup the dll searchpath if we need to.
+	#
+	# Fix the DLL searchpath if we need to.  Do this before prepending
+	# to shlibpath, because on Windows, both are PATH and uninstalled
+	# libraries must come first.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
 	# Export our shlibpath_var if we have one.
 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
@@ -2877,253 +4108,28 @@ func_emit_wrapper_part2 ()
 
     # Some systems cannot cope with colon-terminated $shlibpath_var
     # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
 
     export $shlibpath_var
 "
 	fi
 
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
 	$ECHO "\
     if test \"\$libtool_execute_magic\" != \"$magic\"; then
       # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2* | *-cegcc*)
-	  $ECHO "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-	  ;;
-
-	*)
-	  $ECHO "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-	  ;;
-	esac
-	$ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
+      func_exec_program \${1+\"\$@\"}
     fi
   else
     # The program doesn't exist.
     \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
   fi
 fi\
 "
 }
-# end: func_emit_wrapper_part2
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_arg1=$1
-	fi
-
-	# split this up so that func_emit_cwrapperexe_src
-	# can call each part independently.
-	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
-	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-}
-
-
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-#    $build          $host
-#    mingw (msys)    mingw  [e.g. native]
-#    cygwin          mingw
-#    *nix + wine     mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin.  Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
-  func_to_host_path_result="$1"
-  if test -n "$1" ; then
-    case $host in
-      *mingw* )
-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-        case $build in
-          *mingw* ) # actually, msys
-            # awkward: cmd appends spaces to result
-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          *cygwin* )
-            func_to_host_path_tmp1=`cygpath -w "$1"`
-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          * )
-            # Unfortunately, winepath does not exit with a non-zero
-            # error code, so we are forced to check the contents of
-            # stdout. On the other hand, if the command is not
-            # found, the shell will set an exit code of 127 and print
-            # *an error message* to stdout. So we must check for both
-            # error code of zero AND non-empty stdout, which explains
-            # the odd construction:
-            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
-            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
-              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-                $SED -e "$lt_sed_naive_backslashify"`
-            else
-              # Allow warning below.
-              func_to_host_path_result=""
-            fi
-            ;;
-        esac
-        if test -z "$func_to_host_path_result" ; then
-          func_error "Could not determine host path corresponding to"
-          func_error "  '$1'"
-          func_error "Continuing, but uninstalled executables may not work."
-          # Fallback:
-          func_to_host_path_result="$1"
-        fi
-        ;;
-    esac
-  fi
-}
-# end: func_to_host_path
 
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-#    $build          $host
-#    mingw (msys)    mingw  [e.g. native]
-#    cygwin          mingw
-#    *nix + wine     mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
-  func_to_host_pathlist_result="$1"
-  if test -n "$1" ; then
-    case $host in
-      *mingw* )
-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-        # Remove leading and trailing path separator characters from
-        # ARG. msys behavior is inconsistent here, cygpath turns them
-        # into '.;' and ';.', and winepath ignores them completely.
-        func_to_host_pathlist_tmp2="$1"
-        # Once set for this call, this variable should not be
-        # reassigned. It is used in tha fallback case.
-        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
-          $SED -e 's|^:*||' -e 's|:*$||'`
-        case $build in
-          *mingw* ) # Actually, msys.
-            # Awkward: cmd appends spaces to result.
-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          *cygwin* )
-            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          * )
-            # unfortunately, winepath doesn't convert pathlists
-            func_to_host_pathlist_result=""
-            func_to_host_pathlist_oldIFS=$IFS
-            IFS=:
-            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
-              IFS=$func_to_host_pathlist_oldIFS
-              if test -n "$func_to_host_pathlist_f" ; then
-                func_to_host_path "$func_to_host_pathlist_f"
-                if test -n "$func_to_host_path_result" ; then
-                  if test -z "$func_to_host_pathlist_result" ; then
-                    func_to_host_pathlist_result="$func_to_host_path_result"
-                  else
-                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
-                  fi
-                fi
-              fi
-              IFS=:
-            done
-            IFS=$func_to_host_pathlist_oldIFS
-            ;;
-        esac
-        if test -z "$func_to_host_pathlist_result" ; then
-          func_error "Could not determine the host path(s) corresponding to"
-          func_error "  '$1'"
-          func_error "Continuing, but uninstalled executables may not work."
-          # Fallback. This may break if $1 contains DOS-style drive
-          # specifications. The fix is not to complicate the expression
-          # below, but for the user to provide a working wine installation
-          # with winepath so that path translation in the cross-to-mingw
-          # case works properly.
-          lt_replace_pathsep_nix_to_dos="s|:|;|g"
-          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
-            $SED -e "$lt_replace_pathsep_nix_to_dos"`
-        fi
-        # Now, add the leading and trailing path separators back
-        case "$1" in
-          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
-            ;;
-        esac
-        case "$1" in
-          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
-            ;;
-        esac
-        ;;
-    esac
-  fi
-}
-# end: func_to_host_pathlist
 
 # func_emit_cwrapperexe_src
 # emit the source code for a wrapper executable on stdout
@@ -3141,31 +4147,23 @@ func_emit_cwrapperexe_src ()
 
    This wrapper executable should never be moved out of the build directory.
    If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "$SHELL $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
 */
 EOF
 	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef _MSC_VER
 # include <direct.h>
 # include <process.h>
 # include <io.h>
-# define setmode _setmode
 #else
 # include <unistd.h>
 # include <stdint.h>
 # ifdef __CYGWIN__
 #  include <io.h>
-#  define HAVE_SETENV
-#  ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-#  endif
 # endif
 #endif
 #include <malloc.h>
@@ -3177,6 +4175,44 @@ int setenv (const char *, const char *, int);
 #include <fcntl.h>
 #include <sys/stat.h>
 
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
 #elif defined(MAXPATHLEN)
@@ -3192,14 +4228,7 @@ int setenv (const char *, const char *, int);
 # define S_IXGRP 0
 #endif
 
-#ifdef _MSC_VER
-# define S_IXUSR _S_IEXEC
-# define stat _stat
-# ifndef _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#endif
-
+/* path handling portability macros */
 #ifndef DIR_SEPARATOR
 # define DIR_SEPARATOR '/'
 # define PATH_SEPARATOR ':'
@@ -3230,10 +4259,6 @@ int setenv (const char *, const char *, int);
 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
 #endif /* PATH_SEPARATOR_2 */
 
-#ifdef __CYGWIN__
-# define FOPEN_WB "wb"
-#endif
-
 #ifndef FOPEN_WB
 # define FOPEN_WB "w"
 #endif
@@ -3246,22 +4271,13 @@ int setenv (const char *, const char *, int);
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
-#undef LTWRAPPER_DEBUGPRINTF
-#if defined DEBUGWRAPPER
-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-static void
-ltwrapper_debugprintf (const char *fmt, ...)
-{
-    va_list args;
-    va_start (args, fmt);
-    (void) vfprintf (stderr, fmt, args);
-    va_end (args);
-}
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
 #else
-# define LTWRAPPER_DEBUGPRINTF(args)
+static int lt_debug = 0;
 #endif
 
-const char *program_name = NULL;
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
 
 void *xmalloc (size_t num);
 char *xstrdup (const char *string);
@@ -3271,41 +4287,27 @@ char *chase_symlinks (const char *pathspec);
 int make_executable (const char *path);
 int check_executable (const char *path);
 char *strendzap (char *str, const char *pat);
-void lt_fatal (const char *message, ...);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
 void lt_setenv (const char *name, const char *value);
 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_opt_process_env_set (const char *arg);
-void lt_opt_process_env_prepend (const char *arg);
-void lt_opt_process_env_append (const char *arg);
-int lt_split_name_value (const char *arg, char** name, char** value);
 void lt_update_exe_path (const char *name, const char *value);
 void lt_update_lib_path (const char *name, const char *value);
-
-static const char *script_text_part1 =
-EOF
-
-	    func_emit_wrapper_part1 yes |
-	        $SED -e 's/\([\\"]\)/\\\1/g' \
-	             -e 's/^/  "/' -e 's/$/\\n"/'
-	    echo ";"
-	    cat <<EOF
-
-static const char *script_text_part2 =
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
 EOF
-	    func_emit_wrapper_part2 yes |
-	        $SED -e 's/\([\\"]\)/\\\1/g' \
-	             -e 's/^/  "/' -e 's/$/\\n"/'
-	    echo ";"
 
 	    cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
+volatile const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
 	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_pathlist "$temp_rpath"
+              func_to_host_path "$temp_rpath"
 	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
 EOF
 	    else
 	      cat <<"EOF"
@@ -3314,10 +4316,10 @@ EOF
 	    fi
 
 	    if test -n "$dllsearchpath"; then
-              func_to_host_pathlist "$dllsearchpath:"
+              func_to_host_path "$dllsearchpath:"
 	      cat <<EOF
 const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
 EOF
 	    else
 	      cat <<"EOF"
@@ -3340,24 +4342,10 @@ EOF
 	    cat <<"EOF"
 
 #define LTWRAPPER_OPTION_PREFIX         "--lt-"
-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
 
-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
 static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-
-static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
-  /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
-static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
-  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
-static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
-  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
 
 int
 main (int argc, char *argv[])
@@ -3374,10 +4362,13 @@ main (int argc, char *argv[])
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+  newargz = XMALLOC (char *, argc + 1);
 
-  /* very simple arg parsing; don't want to rely on getopt */
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
   for (i = 1; i < argc; i++)
     {
       if (strcmp (argv[i], dumpscript_opt) == 0)
@@ -3391,25 +4382,57 @@ EOF
 	      esac
 
 	    cat <<"EOF"
-	  printf ("%s", script_text_part1);
-	  printf ("%s", script_text_part2);
+	  lt_dump_script (stdout);
 	  return 0;
 	}
+      if (strcmp (argv[i], debug_opt) == 0)
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
     }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
 
-  newargz = XMALLOC (char *, argc + 1);
   tmp_pathspec = find_executable (argv[0]);
   if (tmp_pathspec == NULL)
-    lt_fatal ("Couldn't find %s", argv[0]);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
-			  tmp_pathspec));
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
 
   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
-			  actual_cwrapper_path));
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
   XFREE (tmp_pathspec);
 
-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
   strendzap (actual_cwrapper_path, actual_cwrapper_name);
 
   /* wrapper name transforms */
@@ -3427,8 +4450,9 @@ EOF
   target_name = tmp_pathspec;
   tmp_pathspec = 0;
 
-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
-			  target_name));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
 EOF
 
 	    cat <<EOF
@@ -3478,80 +4502,19 @@ EOF
 
   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
 
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
-        {
-          if (argv[i][env_set_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_set_opt_len + 1;
-              lt_opt_process_env_set (p);
-            }
-          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_set (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_set_opt);
-          continue;
-        }
-      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
-        {
-          if (argv[i][env_prepend_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_prepend_opt_len + 1;
-              lt_opt_process_env_prepend (p);
-            }
-          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_prepend_opt);
-          continue;
-        }
-      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
-        {
-          if (argv[i][env_append_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_append_opt_len + 1;
-              lt_opt_process_env_append (p);
-            }
-          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_append (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_append_opt);
-          continue;
-        }
-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
   for (i = 0; i < newargc; i++)
     {
-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
     }
 
 EOF
@@ -3560,11 +4523,14 @@ EOF
 	      mingw*)
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
       return 127;
     }
   return rval;
@@ -3586,7 +4552,7 @@ xmalloc (size_t num)
 {
   void *p = (void *) malloc (num);
   if (!p)
-    lt_fatal ("Memory exhausted");
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
 
   return p;
 }
@@ -3620,8 +4586,8 @@ check_executable (const char *path)
 {
   struct stat st;
 
-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
   if ((!path) || (!*path))
     return 0;
 
@@ -3638,8 +4604,8 @@ make_executable (const char *path)
   int rval = 0;
   struct stat st;
 
-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
   if ((!path) || (!*path))
     return 0;
 
@@ -3665,8 +4631,8 @@ find_executable (const char *wrapper)
   int tmp_len;
   char *concat_name;
 
-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
 
   if ((wrapper == NULL) || (*wrapper == '\0'))
     return NULL;
@@ -3719,7 +4685,8 @@ find_executable (const char *wrapper)
 		{
 		  /* empty path: current directory */
 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal ("getcwd failed");
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
 		  tmp_len = strlen (tmp);
 		  concat_name =
 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
@@ -3744,7 +4711,8 @@ find_executable (const char *wrapper)
     }
   /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
   tmp_len = strlen (tmp);
   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
   memcpy (concat_name, tmp, tmp_len);
@@ -3770,8 +4738,9 @@ chase_symlinks (const char *pathspec)
   int has_symlinks = 0;
   while (strlen (tmp_pathspec) && !has_symlinks)
     {
-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
-			      tmp_pathspec));
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
       if (lstat (tmp_pathspec, &s) == 0)
 	{
 	  if (S_ISLNK (s.st_mode) != 0)
@@ -3793,8 +4762,9 @@ chase_symlinks (const char *pathspec)
 	}
       else
 	{
-	  char *errstr = strerror (errno);
-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
 	}
     }
   XFREE (tmp_pathspec);
@@ -3807,7 +4777,8 @@ chase_symlinks (const char *pathspec)
   tmp_pathspec = realpath (pathspec, buf);
   if (tmp_pathspec == 0)
     {
-      lt_fatal ("Could not follow symlinks for %s", pathspec);
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
     }
   return xstrdup (tmp_pathspec);
 #endif
@@ -3833,11 +4804,25 @@ strendzap (char *str, const char *pat)
   return str;
 }
 
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
 static void
-lt_error_core (int exit_status, const char *mode,
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
 	       const char *message, va_list ap)
 {
-  fprintf (stderr, "%s: %s: ", program_name, mode);
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
   vfprintf (stderr, message, ap);
   fprintf (stderr, ".\n");
 
@@ -3846,20 +4831,32 @@ lt_error_core (int exit_status, const char *mode,
 }
 
 void
-lt_fatal (const char *message, ...)
+lt_fatal (const char *file, int line, const char *message, ...)
 {
   va_list ap;
   va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
   va_end (ap);
 }
 
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
 void
 lt_setenv (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
   {
 #ifdef HAVE_SETENV
     /* always make a copy, for consistency with !HAVE_SETENV */
@@ -3904,95 +4901,12 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   return new_value;
 }
 
-int
-lt_split_name_value (const char *arg, char** name, char** value)
-{
-  const char *p;
-  int len;
-  if (!arg || !*arg)
-    return 1;
-
-  p = strchr (arg, (int)'=');
-
-  if (!p)
-    return 1;
-
-  *value = xstrdup (++p);
-
-  len = strlen (arg) - strlen (*value);
-  *name = XMALLOC (char, len);
-  strncpy (*name, arg, len-1);
-  (*name)[len - 1] = '\0';
-
-  return 0;
-}
-
-void
-lt_opt_process_env_set (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
-    }
-
-  lt_setenv (name, value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_opt_process_env_prepend (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-  char *new_value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
-    }
-
-  new_value = lt_extend_str (getenv (name), value, 0);
-  lt_setenv (name, new_value);
-  XFREE (new_value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_opt_process_env_append (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-  char *new_value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
-    }
-
-  new_value = lt_extend_str (getenv (name), value, 1);
-  lt_setenv (name, new_value);
-  XFREE (new_value);
-  XFREE (name);
-  XFREE (value);
-}
-
 void
 lt_update_exe_path (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
 
   if (name && *name && value && *value)
     {
@@ -4011,9 +4925,9 @@ lt_update_exe_path (const char *name, const char *value)
 void
 lt_update_lib_path (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
 
   if (name && *name && value && *value)
     {
@@ -4023,11 +4937,158 @@ lt_update_lib_path (const char *name, const char *value)
     }
 }
 
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
 
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
 EOF
 }
 # end: func_emit_cwrapperexe_src
 
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
@@ -4072,6 +5133,7 @@ func_mode_link ()
     new_inherited_linker_flags=
 
     avoid_version=no
+    bindir=
     dlfiles=
     dlprefiles=
     dlself=no
@@ -4164,6 +5226,11 @@ func_mode_link ()
 	esac
 
 	case $prev in
+	bindir)
+	  bindir="$arg"
+	  prev=
+	  continue
+	  ;;
 	dlfiles|dlprefiles)
 	  if test "$preload" = no; then
 	    # Add the symbol object into the linking commands.
@@ -4195,9 +5262,9 @@ func_mode_link ()
 	    ;;
 	  *)
 	    if test "$prev" = dlfiles; then
-	      dlfiles="$dlfiles $arg"
+	      func_append dlfiles " $arg"
 	    else
-	      dlprefiles="$dlprefiles $arg"
+	      func_append dlprefiles " $arg"
 	    fi
 	    prev=
 	    continue
@@ -4221,7 +5288,7 @@ func_mode_link ()
 	    *-*-darwin*)
 	      case "$deplibs " in
 		*" $qarg.ltframework "*) ;;
-		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
 		   ;;
 	      esac
 	      ;;
@@ -4240,7 +5307,7 @@ func_mode_link ()
 	    moreargs=
 	    for fil in `cat "$save_arg"`
 	    do
-#	      moreargs="$moreargs $fil"
+#	      func_append moreargs " $fil"
 	      arg=$fil
 	      # A libtool-controlled object.
 
@@ -4269,7 +5336,7 @@ func_mode_link ()
 
 		  if test "$prev" = dlfiles; then
 		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles="$dlfiles $pic_object"
+		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
 		    else
@@ -4281,7 +5348,7 @@ func_mode_link ()
 		  # CHECK ME:  I think I busted this.  -Ossama
 		  if test "$prev" = dlprefiles; then
 		    # Preload the old-style object.
-		    dlprefiles="$dlprefiles $pic_object"
+		    func_append dlprefiles " $pic_object"
 		    prev=
 		  fi
 
@@ -4351,12 +5418,12 @@ func_mode_link ()
 	  if test "$prev" = rpath; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
-	    *) rpath="$rpath $arg" ;;
+	    *) func_append rpath " $arg" ;;
 	    esac
 	  else
 	    case "$xrpath " in
 	    *" $arg "*) ;;
-	    *) xrpath="$xrpath $arg" ;;
+	    *) func_append xrpath " $arg" ;;
 	    esac
 	  fi
 	  prev=
@@ -4368,28 +5435,28 @@ func_mode_link ()
 	  continue
 	  ;;
 	weak)
-	  weak_libs="$weak_libs $arg"
+	  func_append weak_libs " $arg"
 	  prev=
 	  continue
 	  ;;
 	xcclinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $qarg"
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
 	  prev=
 	  func_append compile_command " $qarg"
 	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
 	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
+	  func_append compiler_flags " $qarg"
 	  prev=
 	  func_append compile_command " $qarg"
 	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
 	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
 	  prev=
 	  func_append compile_command " $wl$qarg"
 	  func_append finalize_command " $wl$qarg"
@@ -4425,6 +5492,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -bindir)
+	prev=bindir
+	continue
+	;;
+
       -dlopen)
 	prev=dlfiles
 	continue
@@ -4475,15 +5547,16 @@ func_mode_link ()
 	;;
 
       -L*)
-	func_stripname '-L' '' "$arg"
-	dir=$func_stripname_result
-	if test -z "$dir"; then
+	func_stripname "-L" '' "$arg"
+	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
 	    func_fatal_error "require no space between \`-L' and \`$1'"
 	  else
 	    func_fatal_error "need path for \`-L' option"
 	  fi
 	fi
+	func_resolve_sysroot "$func_stripname_result"
+	dir=$func_resolve_sysroot_result
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -4495,24 +5568,30 @@ func_mode_link ()
 	  ;;
 	esac
 	case "$deplibs " in
-	*" -L$dir "*) ;;
+	*" -L$dir "* | *" $arg "*)
+	  # Will only happen for absolute or sysroot arguments
+	  ;;
 	*)
-	  deplibs="$deplibs -L$dir"
-	  lib_search_path="$lib_search_path $dir"
+	  # Preserve sysroot, but never include relative directories
+	  case $dir in
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
+	  esac
+	  func_append lib_search_path " $dir"
 	  ;;
 	esac
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
 	  ::) dllsearchpath=$dir;;
-	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  *) func_append dllsearchpath ":$dir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
 	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  *) func_append dllsearchpath ":$testbindir";;
 	  esac
 	  ;;
 	esac
@@ -4522,7 +5601,7 @@ func_mode_link ()
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
@@ -4536,7 +5615,7 @@ func_mode_link ()
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs System.ltframework"
+	    func_append deplibs " System.ltframework"
 	    continue
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
@@ -4556,7 +5635,7 @@ func_mode_link ()
 	   ;;
 	 esac
 	fi
-	deplibs="$deplibs $arg"
+	func_append deplibs " $arg"
 	continue
 	;;
 
@@ -4568,21 +5647,22 @@ func_mode_link ()
       # Tru64 UNIX uses -model [arg] to determine the layout of C++
       # classes, name mangling, and exception handling.
       # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot)
-	compiler_flags="$compiler_flags $arg"
+      -model|-arch|-isysroot|--sysroot)
+	func_append compiler_flags " $arg"
 	func_append compile_command " $arg"
 	func_append finalize_command " $arg"
 	prev=xcompiler
 	continue
 	;;
 
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
-	compiler_flags="$compiler_flags $arg"
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	func_append compiler_flags " $arg"
 	func_append compile_command " $arg"
 	func_append finalize_command " $arg"
 	case "$new_inherited_linker_flags " in
 	    *" $arg "*) ;;
-	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
 	esac
 	continue
 	;;
@@ -4649,13 +5729,17 @@ func_mode_link ()
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	=*)
+	  func_stripname '=' '' "$dir"
+	  dir=$lt_sysroot$func_stripname_result
+	  ;;
 	*)
 	  func_fatal_error "only absolute run-paths are allowed"
 	  ;;
 	esac
 	case "$xrpath " in
 	*" $dir "*) ;;
-	*) xrpath="$xrpath $dir" ;;
+	*) func_append xrpath " $dir" ;;
 	esac
 	continue
 	;;
@@ -4708,8 +5792,8 @@ func_mode_link ()
 	for flag in $args; do
 	  IFS="$save_ifs"
           func_quote_for_eval "$flag"
-	  arg="$arg $wl$func_quote_for_eval_result"
-	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
@@ -4724,9 +5808,9 @@ func_mode_link ()
 	for flag in $args; do
 	  IFS="$save_ifs"
           func_quote_for_eval "$flag"
-	  arg="$arg $wl$func_quote_for_eval_result"
-	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
-	  linker_flags="$linker_flags $func_quote_for_eval_result"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
@@ -4754,23 +5838,27 @@ func_mode_link ()
 	arg="$func_quote_for_eval_result"
 	;;
 
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -F/path gives path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
-      # @file GCC response files
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
         func_quote_for_eval "$arg"
 	arg="$func_quote_for_eval_result"
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
-        compiler_flags="$compiler_flags $arg"
+        func_append compiler_flags " $arg"
         continue
         ;;
 
@@ -4782,7 +5870,7 @@ func_mode_link ()
 
       *.$objext)
 	# A standard object.
-	objs="$objs $arg"
+	func_append objs " $arg"
 	;;
 
       *.lo)
@@ -4813,7 +5901,7 @@ func_mode_link ()
 
 	    if test "$prev" = dlfiles; then
 	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles="$dlfiles $pic_object"
+		func_append dlfiles " $pic_object"
 		prev=
 		continue
 	      else
@@ -4825,7 +5913,7 @@ func_mode_link ()
 	    # CHECK ME:  I think I busted this.  -Ossama
 	    if test "$prev" = dlprefiles; then
 	      # Preload the old-style object.
-	      dlprefiles="$dlprefiles $pic_object"
+	      func_append dlprefiles " $pic_object"
 	      prev=
 	    fi
 
@@ -4870,24 +5958,25 @@ func_mode_link ()
 
       *.$libext)
 	# An archive.
-	deplibs="$deplibs $arg"
-	old_deplibs="$old_deplibs $arg"
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
 	continue
 	;;
 
       *.la)
 	# A libtool-controlled library.
 
+	func_resolve_sysroot "$arg"
 	if test "$prev" = dlfiles; then
 	  # This library was specified with -dlopen.
-	  dlfiles="$dlfiles $arg"
+	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
 	elif test "$prev" = dlprefiles; then
 	  # The library was specified with -dlpreopen.
-	  dlprefiles="$dlprefiles $arg"
+	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
 	else
-	  deplibs="$deplibs $arg"
+	  func_append deplibs " $func_resolve_sysroot_result"
 	fi
 	continue
 	;;
@@ -4925,7 +6014,7 @@ func_mode_link ()
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
@@ -4934,6 +6023,8 @@ func_mode_link ()
 
     func_dirname "$output" "/" ""
     output_objdir="$func_dirname_result$objdir"
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
     func_mkdir_p "$output_objdir"
 
@@ -4954,12 +6045,12 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_duplicate_deps ; then
+      if $opt_preserve_dup_deps ; then
 	case "$libs " in
-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
       fi
-      libs="$libs $deplib"
+      func_append libs " $deplib"
     done
 
     if test "$linkmode" = lib; then
@@ -4972,9 +6063,9 @@ func_mode_link ()
       if $opt_duplicate_compiler_generated_deps; then
 	for pre_post_dep in $predeps $postdeps; do
 	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
 	  esac
-	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	  func_append pre_post_deps " $pre_post_dep"
 	done
       fi
       pre_post_deps=
@@ -5041,17 +6132,19 @@ func_mode_link ()
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
 	  dependency_libs=
+	  func_resolve_sysroot "$lib"
 	  case $lib in
-	  *.la)	func_source "$lib" ;;
+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
 	  esac
 
 	  # Collect preopened libtool deplibs, except any this library
 	  # has declared as weak libs
 	  for deplib in $dependency_libs; do
-            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
 	    case " $weak_libs " in
 	    *" $deplib_base "*) ;;
-	    *) deplibs="$deplibs $deplib" ;;
+	    *) func_append deplibs " $deplib" ;;
 	    esac
 	  done
 	done
@@ -5067,16 +6160,17 @@ func_mode_link ()
 	lib=
 	found=no
 	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	    compiler_flags="$compiler_flags $deplib"
+	    func_append compiler_flags " $deplib"
 	    if test "$linkmode" = lib ; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
 		esac
 	    fi
 	  fi
@@ -5161,7 +6255,7 @@ func_mode_link ()
 	    if test "$linkmode" = lib ; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
 		esac
 	    fi
 	  fi
@@ -5174,7 +6268,8 @@ func_mode_link ()
 	    test "$pass" = conv && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
-	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
 	    if test "$pass" = conv; then
@@ -5188,7 +6283,8 @@ func_mode_link ()
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
 	    func_stripname '-L' '' "$deplib"
-	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
 	    func_warning "\`-L' is ignored for archives/objects"
@@ -5199,17 +6295,21 @@ func_mode_link ()
 	-R*)
 	  if test "$pass" = link; then
 	    func_stripname '-R' '' "$deplib"
-	    dir=$func_stripname_result
+	    func_resolve_sysroot "$func_stripname_result"
+	    dir=$func_resolve_sysroot_result
 	    # Make sure the xrpath contains only unique directories.
 	    case "$xrpath " in
 	    *" $dir "*) ;;
-	    *) xrpath="$xrpath $dir" ;;
+	    *) func_append xrpath " $dir" ;;
 	    esac
 	  fi
 	  deplibs="$deplib $deplibs"
 	  continue
 	  ;;
-	*.la) lib="$deplib" ;;
+	*.la)
+	  func_resolve_sysroot "$deplib"
+	  lib=$func_resolve_sysroot_result
+	  ;;
 	*.$libext)
 	  if test "$pass" = conv; then
 	    deplibs="$deplib $deplibs"
@@ -5227,7 +6327,7 @@ func_mode_link ()
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
 		    valid_a_lib=yes
 		  fi
@@ -5237,15 +6337,15 @@ func_mode_link ()
 		;;
 	      esac
 	      if test "$valid_a_lib" != yes; then
-		$ECHO
+		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
-		$ECHO "*** that it is just a static archive that I should not use here."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
 	      else
-		$ECHO
+		echo
 		$ECHO "*** Warning: Linking the shared library $output against the"
 		$ECHO "*** static library $deplib is not portable!"
 		deplibs="$deplib $deplibs"
@@ -5272,11 +6372,11 @@ func_mode_link ()
 	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
-	      newdlprefiles="$newdlprefiles $deplib"
+	      func_append newdlprefiles " $deplib"
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    else
-	      newdlfiles="$newdlfiles $deplib"
+	      func_append newdlfiles " $deplib"
 	    fi
 	  fi
 	  continue
@@ -5318,20 +6418,20 @@ func_mode_link ()
 
 	# Convert "-framework foo" to "foo.ltframework"
 	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
 	    case " $new_inherited_linker_flags " in
 	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
 	    esac
 	  done
 	fi
-	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	if test "$linkmode,$pass" = "lib,link" ||
 	   test "$linkmode,$pass" = "prog,scan" ||
 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
 	if test "$pass" = conv; then
@@ -5342,20 +6442,20 @@ func_mode_link ()
 	      func_fatal_error "cannot find name of link library for \`$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
-	    convenience="$convenience $ladir/$objdir/$old_library"
-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
 	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    deplibs="$deplib $deplibs"
-	    if $opt_duplicate_deps ; then
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
 	    fi
-	    tmp_libs="$tmp_libs $deplib"
+	    func_append tmp_libs " $deplib"
 	  done
 	  continue
 	fi # $pass = conv
@@ -5363,9 +6463,15 @@ func_mode_link ()
 
 	# Get the name of the library we link against.
 	linklib=
-	for l in $old_library $library_names; do
-	  linklib="$l"
-	done
+	if test -n "$old_library" &&
+	   { test "$prefer_static_libs" = yes ||
+	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	  linklib=$old_library
+	else
+	  for l in $old_library $library_names; do
+	    linklib="$l"
+	  done
+	fi
 	if test -z "$linklib"; then
 	  func_fatal_error "cannot find name of link library for \`$lib'"
 	fi
@@ -5382,9 +6488,9 @@ func_mode_link ()
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
 	    # bomb out in the load deplibs phase.
-	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	    func_append dlprefiles " $lib $dependency_libs"
 	  else
-	    newdlfiles="$newdlfiles $lib"
+	    func_append newdlfiles " $lib"
 	  fi
 	  continue
 	fi # $pass = dlopen
@@ -5406,14 +6512,14 @@ func_mode_link ()
 
 	# Find the relevant object directory and library name.
 	if test "X$installed" = Xyes; then
-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 	    func_warning "library \`$lib' was moved."
 	    dir="$ladir"
 	    absdir="$abs_ladir"
 	    libdir="$abs_ladir"
 	  else
-	    dir="$libdir"
-	    absdir="$libdir"
+	    dir="$lt_sysroot$libdir"
+	    absdir="$lt_sysroot$libdir"
 	  fi
 	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
 	else
@@ -5421,12 +6527,12 @@ func_mode_link ()
 	    dir="$ladir"
 	    absdir="$abs_ladir"
 	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
+	    func_append notinst_path " $abs_ladir"
 	  else
 	    dir="$ladir/$objdir"
 	    absdir="$abs_ladir/$objdir"
 	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
+	    func_append notinst_path " $abs_ladir"
 	  fi
 	fi # $installed = yes
 	func_stripname 'lib' '.la' "$laname"
@@ -5437,20 +6543,46 @@ func_mode_link ()
 	  if test -z "$libdir" && test "$linkmode" = prog; then
 	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
 	  fi
-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
-	  # are required to link).
-	  if test -n "$old_library"; then
-	    newdlprefiles="$newdlprefiles $dir/$old_library"
-	    # Keep a list of preopened convenience libraries to check
-	    # that they are being used correctly in the link pass.
-	    test -z "$libdir" && \
-		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
-	  elif test -n "$dlname"; then
-	    newdlprefiles="$newdlprefiles $dir/$dlname"
-	  else
-	    newdlprefiles="$newdlprefiles $dir/$linklib"
-	  fi
+	  case "$host" in
+	    # special handling for platforms with PE-DLLs.
+	    *cygwin* | *mingw* | *cegcc* )
+	      # Linker will automatically link against shared library if both
+	      # static and shared are present.  Therefore, ensure we extract
+	      # symbols from the import library if a shared library is present
+	      # (otherwise, the dlopen module name will be incorrect).  We do
+	      # this by putting the import library name into $newdlprefiles.
+	      # We recover the dlopen module name by 'saving' the la file
+	      # name in a special purpose variable, and (later) extracting the
+	      # dlname from the la file.
+	      if test -n "$dlname"; then
+	        func_tr_sh "$dir/$linklib"
+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+	        func_append newdlprefiles " $dir/$linklib"
+	      else
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      fi
+	    ;;
+	    * )
+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
+	      # are required to link).
+	      if test -n "$old_library"; then
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
+	      elif test -n "$dlname"; then
+	        func_append newdlprefiles " $dir/$dlname"
+	      else
+	        func_append newdlprefiles " $dir/$linklib"
+	      fi
+	    ;;
+	  esac
 	fi # $pass = dlpreopen
 
 	if test -z "$libdir"; then
@@ -5468,7 +6600,7 @@ func_mode_link ()
 
 
 	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path="$newlib_search_path $ladir"
+	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
 	  linkalldeplibs=no
@@ -5481,7 +6613,8 @@ func_mode_link ()
 	  for deplib in $dependency_libs; do
 	    case $deplib in
 	    -L*) func_stripname '-L' '' "$deplib"
-	         newlib_search_path="$newlib_search_path $func_stripname_result"
+	         func_resolve_sysroot "$func_stripname_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
@@ -5492,12 +6625,12 @@ func_mode_link ()
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_duplicate_deps ; then
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
 	    fi
-	    tmp_libs="$tmp_libs $deplib"
+	    func_append tmp_libs " $deplib"
 	  done # for deplib
 	  continue
 	fi # $linkmode = prog...
@@ -5512,7 +6645,7 @@ func_mode_link ()
 	      # Make sure the rpath contains only unique directories.
 	      case "$temp_rpath:" in
 	      *"$absdir:"*) ;;
-	      *) temp_rpath="$temp_rpath$absdir:" ;;
+	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
 	    fi
 
@@ -5524,7 +6657,7 @@ func_mode_link ()
 	    *)
 	      case "$compile_rpath " in
 	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
+	      *) func_append compile_rpath " $absdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5533,7 +6666,7 @@ func_mode_link ()
 	    *)
 	      case "$finalize_rpath " in
 	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
+	      *) func_append finalize_rpath " $libdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5558,12 +6691,12 @@ func_mode_link ()
 	  case $host in
 	  *cygwin* | *mingw* | *cegcc*)
 	      # No point in relinking DLLs because paths are not encoded
-	      notinst_deplibs="$notinst_deplibs $lib"
+	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
 	    if test "$installed" = no; then
-	      notinst_deplibs="$notinst_deplibs $lib"
+	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
 	    ;;
@@ -5580,7 +6713,7 @@ func_mode_link ()
 	    fi
 	  done
 	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
-	    $ECHO
+	    echo
 	    if test "$linkmode" = prog; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
@@ -5598,7 +6731,7 @@ func_mode_link ()
 	    *)
 	      case "$compile_rpath " in
 	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
+	      *) func_append compile_rpath " $absdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5607,7 +6740,7 @@ func_mode_link ()
 	    *)
 	      case "$finalize_rpath " in
 	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
+	      *) func_append finalize_rpath " $libdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5661,7 +6794,7 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$mode" != relink; then
+	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
@@ -5683,9 +6816,9 @@ func_mode_link ()
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
 			if test -z "$old_library" ; then
-			  $ECHO
-			  $ECHO "*** And there doesn't seem to be a static archive available"
-			  $ECHO "*** The link will probably fail, sorry"
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
 			else
 			  add="$dir/$old_library"
 			fi
@@ -5712,12 +6845,12 @@ func_mode_link ()
 	         test "$hardcode_direct_absolute" = no; then
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
+		add_dir="-L$absdir"
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
 		    [\\/]*)
-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
 		      ;;
 		  esac
 		fi
@@ -5739,7 +6872,7 @@ func_mode_link ()
 	    if test -n "$add_shlibpath"; then
 	      case :$compile_shlibpath: in
 	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
 	    if test "$linkmode" = prog; then
@@ -5753,13 +6886,13 @@ func_mode_link ()
 		 test "$hardcode_shlibpath_var" = yes; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
 		esac
 	      fi
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$mode" = relink; then
+	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
@@ -5773,7 +6906,7 @@ func_mode_link ()
 	    elif test "$hardcode_shlibpath_var" = yes; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
 	      add="-l$name"
 	    elif test "$hardcode_automatic" = yes; then
@@ -5790,7 +6923,7 @@ func_mode_link ()
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
 		  [\\/]*)
-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
 		    ;;
 		esac
 	      fi
@@ -5825,21 +6958,21 @@ func_mode_link ()
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
-	    $ECHO
+	    echo
 	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
-	    $ECHO "*** I have the capability to make that library automatically link in when"
-	    $ECHO "*** you link to this library.  But I can only do this if you have a"
-	    $ECHO "*** shared version of the library, which you do not appear to have."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
 	    if test "$module" = yes; then
-	      $ECHO "*** But as you try to build a module library, libtool will still create "
-	      $ECHO "*** a static module, that should work as long as the dlopening application"
-	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
-		$ECHO
-		$ECHO "*** However, this would only work if libtool was able to extract symbol"
-		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$ECHO "*** not find such a program.  So, this module is probably useless."
-		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
 	      fi
 	      if test "$build_old_libs" = no; then
 		build_libtool_libs=module
@@ -5867,37 +7000,46 @@ func_mode_link ()
 	           temp_xrpath=$func_stripname_result
 		   case " $xrpath " in
 		   *" $temp_xrpath "*) ;;
-		   *) xrpath="$xrpath $temp_xrpath";;
+		   *) func_append xrpath " $temp_xrpath";;
 		   esac;;
-	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
 	    dependency_libs="$temp_deplibs"
 	  fi
 
-	  newlib_search_path="$newlib_search_path $absdir"
+	  func_append newlib_search_path " $absdir"
 	  # Link against this library
 	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    newdependency_libs="$deplib $newdependency_libs"
-	    if $opt_duplicate_deps ; then
+	    case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
 	      esac
 	    fi
-	    tmp_libs="$tmp_libs $deplib"
+	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
 	  if test "$link_all_deplibs" != no; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
+	      path=
 	      case $deplib in
 	      -L*) path="$deplib" ;;
 	      *.la)
+	        func_resolve_sysroot "$deplib"
+	        deplib=$func_resolve_sysroot_result
 	        func_dirname "$deplib" "" "."
-		dir="$func_dirname_result"
+		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
@@ -5924,8 +7066,8 @@ func_mode_link ()
                       if test -z "$darwin_install_name"; then
                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
 		      path=
 		    fi
 		  fi
@@ -5958,7 +7100,7 @@ func_mode_link ()
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
-	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
       dependency_libs="$newdependency_libs"
@@ -5975,7 +7117,7 @@ func_mode_link ()
 	  for dir in $newlib_search_path; do
 	    case "$lib_search_path " in
 	    *" $dir "*) ;;
-	    *) lib_search_path="$lib_search_path $dir" ;;
+	    *) func_append lib_search_path " $dir" ;;
 	    esac
 	  done
 	  newlib_search_path=
@@ -6033,10 +7175,10 @@ func_mode_link ()
 	    -L*)
 	      case " $tmp_libs " in
 	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      *) func_append tmp_libs " $deplib" ;;
 	      esac
 	      ;;
-	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    *) func_append tmp_libs " $deplib" ;;
 	    esac
 	  done
 	  eval $var=\"$tmp_libs\"
@@ -6052,7 +7194,7 @@ func_mode_link ()
 	  ;;
 	esac
 	if test -n "$i" ; then
-	  tmp_libs="$tmp_libs $i"
+	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
@@ -6093,7 +7235,7 @@ func_mode_link ()
       # Now set the variables for building old libraries.
       build_libtool_libs=no
       oldlibs="$output"
-      objs="$objs$old_deplibs"
+      func_append objs "$old_deplibs"
       ;;
 
     lib)
@@ -6126,10 +7268,10 @@ func_mode_link ()
 	if test "$deplibs_check_method" != pass_all; then
 	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
 	else
-	  $ECHO
+	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
 	  $ECHO "*** objects $objs is not portable!"
-	  libobjs="$libobjs $objs"
+	  func_append libobjs " $objs"
 	fi
       fi
 
@@ -6188,13 +7330,14 @@ func_mode_link ()
 	  # which has an extra 1 added just for fun
 	  #
 	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
 	  darwin|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
 	    age="$number_minor"
 	    revision="$number_revision"
 	    ;;
-	  freebsd-aout|freebsd-elf|sunos)
+	  freebsd-aout|freebsd-elf|qnx|sunos)
 	    current="$number_major"
 	    revision="$number_minor"
 	    age="0"
@@ -6304,7 +7447,7 @@ func_mode_link ()
 	  versuffix="$major.$revision"
 	  ;;
 
-	linux)
+	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
@@ -6327,7 +7470,7 @@ func_mode_link ()
 	  done
 
 	  # Make executables depend on our current version.
-	  verstring="$verstring:${current}.0"
+	  func_append verstring ":${current}.0"
 	  ;;
 
 	qnx)
@@ -6395,10 +7538,10 @@ func_mode_link ()
       fi
 
       func_generate_dlsyms "$libname" "$libname" "yes"
-      libobjs="$libobjs $symfileobj"
+      func_append libobjs " $symfileobj"
       test "X$libobjs" = "X " && libobjs=
 
-      if test "$mode" != relink; then
+      if test "$opt_mode" != relink; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -6414,7 +7557,7 @@ func_mode_link ()
 		   continue
 		 fi
 	       fi
-	       removelist="$removelist $p"
+	       func_append removelist " $p"
 	       ;;
 	    *) ;;
 	  esac
@@ -6425,27 +7568,28 @@ func_mode_link ()
 
       # Now set the variables for building old libraries.
       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
       #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
-      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
       #done
 
       if test -n "$xrpath"; then
 	# If the user specified any rpath flags, then add them.
 	temp_xrpath=
 	for libdir in $xrpath; do
-	  temp_xrpath="$temp_xrpath -R$libdir"
+	  func_replace_sysroot "$libdir"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
 	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
 	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
@@ -6459,7 +7603,7 @@ func_mode_link ()
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
 	*" $lib "*) ;;
-	*) dlfiles="$dlfiles $lib" ;;
+	*) func_append dlfiles " $lib" ;;
 	esac
       done
 
@@ -6469,19 +7613,19 @@ func_mode_link ()
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
 	*" $lib "*) ;;
-	*) dlprefiles="$dlprefiles $lib" ;;
+	*) func_append dlprefiles " $lib" ;;
 	esac
       done
 
       if test "$build_libtool_libs" = yes; then
 	if test -n "$rpath"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # these systems don't actually have a c library (as such)!
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs System.ltframework"
+	    func_append deplibs " System.ltframework"
 	    ;;
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
@@ -6498,7 +7642,7 @@ func_mode_link ()
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
 	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs="$deplibs -lc"
+	      func_append deplibs " -lc"
 	    fi
 	    ;;
 	  esac
@@ -6547,7 +7691,7 @@ EOF
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
-		    newdeplibs="$newdeplibs $i"
+		    func_append newdeplibs " $i"
 		    i=""
 		    ;;
 		  esac
@@ -6558,21 +7702,21 @@ EOF
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs="$newdeplibs $i"
+		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
-		    $ECHO
+		    echo
 		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    $ECHO "*** I have the capability to make that library automatically link in when"
-		    $ECHO "*** you link to this library.  But I can only do this if you have a"
-		    $ECHO "*** shared version of the library, which I believe you do not have"
-		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
-		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
 		  fi
 		fi
 		;;
 	      *)
-		newdeplibs="$newdeplibs $i"
+		func_append newdeplibs " $i"
 		;;
 	      esac
 	    done
@@ -6590,7 +7734,7 @@ EOF
 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
-		      newdeplibs="$newdeplibs $i"
+		      func_append newdeplibs " $i"
 		      i=""
 		      ;;
 		    esac
@@ -6601,29 +7745,29 @@ EOF
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs="$newdeplibs $i"
+		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
-		      $ECHO
+		      echo
 		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      $ECHO "*** I have the capability to make that library automatically link in when"
-		      $ECHO "*** you link to this library.  But I can only do this if you have a"
-		      $ECHO "*** shared version of the library, which you do not appear to have"
-		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
-		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
 		    fi
 		  fi
 		else
 		  droppeddeps=yes
-		  $ECHO
+		  echo
 		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $ECHO "*** make it link in!  You will probably need to install it or some"
-		  $ECHO "*** library that it depends on before this library will be fully"
-		  $ECHO "*** functional.  Installing it before continuing would be even better."
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
 		fi
 		;;
 	      *)
-		newdeplibs="$newdeplibs $i"
+		func_append newdeplibs " $i"
 		;;
 	      esac
 	    done
@@ -6640,15 +7784,27 @@ EOF
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
+		  func_append newdeplibs " $a_deplib"
 		  a_deplib=""
 		  ;;
 		esac
 	      fi
 	      if test -n "$a_deplib" ; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
+		if test -n "$file_magic_glob"; then
+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+		else
+		  libnameglob=$libname
+		fi
+		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  if test "$want_nocaseglob" = yes; then
+		    shopt -s nocaseglob
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		    $nocaseglob
+		  else
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		  fi
 		  for potent_lib in $potential_libs; do
 		      # Follow soft links.
 		      if ls -lLd "$potent_lib" 2>/dev/null |
@@ -6665,13 +7821,13 @@ EOF
 			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
 			case $potliblink in
 			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs="$newdeplibs $a_deplib"
+			func_append newdeplibs " $a_deplib"
 			a_deplib=""
 			break 2
 		      fi
@@ -6680,12 +7836,12 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$ECHO
+		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because I did check the linker path looking for a file starting"
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
@@ -6696,7 +7852,7 @@ EOF
 	      ;;
 	    *)
 	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
+	      func_append newdeplibs " $a_deplib"
 	      ;;
 	    esac
 	  done # Gone through all deplibs.
@@ -6712,7 +7868,7 @@ EOF
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
+		  func_append newdeplibs " $a_deplib"
 		  a_deplib=""
 		  ;;
 		esac
@@ -6723,9 +7879,9 @@ EOF
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
 		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs="$newdeplibs $a_deplib"
+		      func_append newdeplibs " $a_deplib"
 		      a_deplib=""
 		      break 2
 		    fi
@@ -6734,12 +7890,12 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$ECHO
+		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because I did check the linker path looking for a file starting"
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
@@ -6750,32 +7906,32 @@ EOF
 	      ;;
 	    *)
 	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
+	      func_append newdeplibs " $a_deplib"
 	      ;;
 	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
 	  newdeplibs=""
-	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
-	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
 	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	    for i in $predeps $postdeps ; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
 	    done
 	  fi
-	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
-	     $GREP . >/dev/null; then
-	    $ECHO
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
 	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
-	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
 	    fi
-	    $ECHO "*** All declared inter-library dependencies are being dropped."
+	    echo "*** All declared inter-library dependencies are being dropped."
 	    droppeddeps=yes
-	  fi
+	    ;;
+	  esac
 	  ;;
 	esac
 	versuffix=$versuffix_save
@@ -6787,23 +7943,23 @@ EOF
 	case $host in
 	*-*-rhapsody* | *-*-darwin1.[012])
 	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
 	  ;;
 	esac
 
 	if test "$droppeddeps" = yes; then
 	  if test "$module" = yes; then
-	    $ECHO
-	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $ECHO "*** a static module, that should work as long as the dlopening"
-	    $ECHO "*** application is linked with the -dlopen flag."
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
 	    if test -z "$global_symbol_pipe"; then
-	      $ECHO
-	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
-	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $ECHO "*** not find such a program.  So, this module is probably useless."
-	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
 	    fi
 	    if test "$build_old_libs" = no; then
 	      oldlibs="$output_objdir/$libname.$libext"
@@ -6813,16 +7969,16 @@ EOF
 	      build_libtool_libs=no
 	    fi
 	  else
-	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
-	    $ECHO "*** automatically added whenever a program is linked with this library"
-	    $ECHO "*** or is declared to -dlopen it."
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
 
 	    if test "$allow_undefined" = no; then
-	      $ECHO
-	      $ECHO "*** Since this library must not contain undefined symbols,"
-	      $ECHO "*** because either the platform does not support them or"
-	      $ECHO "*** it was explicitly requested with -no-undefined,"
-	      $ECHO "*** libtool will only create a static version of it."
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
 	      if test "$build_old_libs" = no; then
 		oldlibs="$output_objdir/$libname.$libext"
 		build_libtool_libs=module
@@ -6839,9 +7995,9 @@ EOF
       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
       case $host in
 	*-*-darwin*)
-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	  ;;
       esac
 
@@ -6854,7 +8010,7 @@ EOF
 	*)
 	  case " $deplibs " in
 	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
+	    func_append new_libs " -L$path/$objdir" ;;
 	  esac
 	  ;;
 	esac
@@ -6864,10 +8020,10 @@ EOF
 	-L*)
 	  case " $new_libs " in
 	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
+	  *) func_append new_libs " $deplib" ;;
 	  esac
 	  ;;
-	*) new_libs="$new_libs $deplib" ;;
+	*) func_append new_libs " $deplib" ;;
 	esac
       done
       deplibs="$new_libs"
@@ -6879,15 +8035,22 @@ EOF
 
       # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then
+	# Remove ${wl} instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
 	if test "$hardcode_into_libs" = yes; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
 	  rpath="$finalize_rpath"
-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
+		func_replace_sysroot "$libdir"
+		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
 		  hardcode_libdirs="$libdir"
 		else
@@ -6896,18 +8059,18 @@ EOF
 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		    ;;
 		  *)
-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		    ;;
 		  esac
 		fi
 	      else
 		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath="$dep_rpath $flag"
+		func_append dep_rpath " $flag"
 	      fi
 	    elif test -n "$runpath_var"; then
 	      case "$perm_rpath " in
 	      *" $libdir "*) ;;
-	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      *) func_append perm_rpath " $libdir" ;;
 	      esac
 	    fi
 	  done
@@ -6915,17 +8078,13 @@ EOF
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-	    else
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-	    fi
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
 	    rpath=
 	    for dir in $perm_rpath; do
-	      rpath="$rpath$dir:"
+	      func_append rpath "$dir:"
 	    done
 	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
 	  fi
@@ -6933,7 +8092,7 @@ EOF
 	fi
 
 	shlibpath="$finalize_shlibpath"
-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -6959,18 +8118,18 @@ EOF
 	linknames=
 	for link
 	do
-	  linknames="$linknames $link"
+	  func_append linknames " $link"
 	done
 
 	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	test "X$libobjs" = "X " && libobjs=
 
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
 	  export_symbols="$output_objdir/$libname.uexp"
-	  delfiles="$delfiles $export_symbols"
+	  func_append delfiles " $export_symbols"
 	fi
 
 	orig_export_symbols=
@@ -7001,13 +8160,45 @@ EOF
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
 	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $cmds; do
+	    for cmd1 in $cmds; do
 	      IFS="$save_ifs"
-	      eval cmd=\"$cmd\"
-	      func_len " $cmd"
-	      len=$func_len_result
-	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	      # Take the normal branch if the nm_file_list_spec branch
+	      # doesn't work or if tool conversion is not needed.
+	      case $nm_file_list_spec~$to_tool_file_cmd in
+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+		  try_normal_branch=yes
+		  eval cmd=\"$cmd1\"
+		  func_len " $cmd"
+		  len=$func_len_result
+		  ;;
+		*)
+		  try_normal_branch=no
+		  ;;
+	      esac
+	      if test "$try_normal_branch" = yes \
+		 && { test "$len" -lt "$max_cmd_len" \
+		      || test "$max_cmd_len" -le -1; }
+	      then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      elif test -n "$nm_file_list_spec"; then
+		func_basename "$output"
+		output_la=$func_basename_result
+		save_libobjs=$libobjs
+		save_output=$output
+		output=${output_objdir}/${output_la}.nm
+		func_to_tool_file "$output"
+		libobjs=$nm_file_list_spec$func_to_tool_file_result
+		func_append delfiles " $output"
+		func_verbose "creating $NM input file list: $output"
+		for obj in $save_libobjs; do
+		  func_to_tool_file "$obj"
+		  $ECHO "$func_to_tool_file_result"
+		done > "$output"
+		eval cmd=\"$cmd1\"
 		func_show_eval "$cmd" 'exit $?'
+		output=$save_output
+		libobjs=$save_libobjs
 		skipped_export=false
 	      else
 		# The command line is too long to execute in one step.
@@ -7029,7 +8220,7 @@ EOF
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  tmp_export_symbols="$export_symbols"
 	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
 	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
@@ -7041,7 +8232,7 @@ EOF
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 	  export_symbols=$output_objdir/$libname.def
 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	fi
@@ -7051,7 +8242,7 @@ EOF
 	  case " $convenience " in
 	  *" $test_deplib "*) ;;
 	  *)
-	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    func_append tmp_deplibs " $test_deplib"
 	    ;;
 	  esac
 	done
@@ -7071,21 +8262,21 @@ EOF
 	    test "X$libobjs" = "X " && libobjs=
 	  else
 	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
+	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
-	    libobjs="$libobjs $func_extract_archives_result"
+	    func_append libobjs " $func_extract_archives_result"
 	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	fi
 
 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags="$linker_flags $flag"
+	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$mode" = relink; then
+	if test "$opt_mode" = relink; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
@@ -7130,7 +8321,8 @@ EOF
 	    save_libobjs=$libobjs
 	  fi
 	  save_output=$output
-	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+	  func_basename "$output"
+	  output_la=$func_basename_result
 
 	  # Clear the reloadable object creation command queue and
 	  # initialize k to one.
@@ -7143,13 +8335,16 @@ EOF
 	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
 	    output=${output_objdir}/${output_la}.lnkscript
 	    func_verbose "creating GNU ld script: $output"
-	    $ECHO 'INPUT (' > $output
+	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
 	    do
-	      $ECHO "$obj" >> $output
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
-	    $ECHO ')' >> $output
-	    delfiles="$delfiles $output"
+	    echo ')' >> $output
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$func_to_tool_file_result
 	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
 	    output=${output_objdir}/${output_la}.lnk
 	    func_verbose "creating linker input file list: $output"
@@ -7163,10 +8358,12 @@ EOF
 	    fi
 	    for obj
 	    do
-	      $ECHO "$obj" >> $output
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
-	    delfiles="$delfiles $output"
-	    output=$firstobj\"$file_list_spec$output\"
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
@@ -7190,17 +8387,19 @@ EOF
 		  # command to the queue.
 		  if test "$k" -eq 1 ; then
 		    # The first file doesn't have a previous command to add.
-		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
 		  else
 		    # All subsequent reloadable object files will link in
 		    # the last one created.
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
 		  last_robj=$output_objdir/$output_la-${k}.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
 		  output=$output_objdir/$output_la-${k}.$objext
-		  objlist=$obj
+		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
 		  len=$func_arith_result
@@ -7210,11 +8409,12 @@ EOF
 	      # reloadable object file.  All subsequent reloadable object
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
 	      if test -n "$last_robj"; then
 	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
 	      fi
-	      delfiles="$delfiles $output"
+	      func_append delfiles " $output"
 
 	    else
 	      output=
@@ -7248,7 +8448,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$mode" = relink; then
+		if test "$opt_mode" = relink; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -7269,7 +8469,7 @@ EOF
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	      tmp_export_symbols="$export_symbols"
 	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
@@ -7281,7 +8481,7 @@ EOF
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
@@ -7322,10 +8522,10 @@ EOF
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
 	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
-	  libobjs="$libobjs $func_extract_archives_result"
+	  func_append libobjs " $func_extract_archives_result"
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
@@ -7341,7 +8541,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$mode" = relink; then
+	    if test "$opt_mode" = relink; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -7353,7 +8553,7 @@ EOF
 	IFS="$save_ifs"
 
 	# Restore the uninstalled library and exit
-	if test "$mode" = relink; then
+	if test "$opt_mode" = relink; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -7434,18 +8634,21 @@ EOF
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 	else
 	  gentop="$output_objdir/${obj}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
 	fi
       fi
 
+      # If we're not building shared, we need to use non_pic_objs
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
       output="$obj"
       func_execute_cmds "$reload_cmds" 'exit $?'
@@ -7505,8 +8708,8 @@ EOF
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
 	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
 	;;
       esac
 
@@ -7517,14 +8720,14 @@ EOF
 	if test "$tagname" = CXX ; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      compile_command="$compile_command ${wl}-bind_at_load"
-	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	      func_append compile_command " ${wl}-bind_at_load"
+	      func_append finalize_command " ${wl}-bind_at_load"
 	    ;;
 	  esac
 	fi
 	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	;;
       esac
 
@@ -7538,7 +8741,7 @@ EOF
 	*)
 	  case " $compile_deplibs " in
 	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
+	    func_append new_libs " -L$path/$objdir" ;;
 	  esac
 	  ;;
 	esac
@@ -7548,17 +8751,17 @@ EOF
 	-L*)
 	  case " $new_libs " in
 	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
+	  *) func_append new_libs " $deplib" ;;
 	  esac
 	  ;;
-	*) new_libs="$new_libs $deplib" ;;
+	*) func_append new_libs " $deplib" ;;
 	esac
       done
       compile_deplibs="$new_libs"
 
 
-      compile_command="$compile_command $compile_deplibs"
-      finalize_command="$finalize_command $finalize_deplibs"
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
 
       if test -n "$rpath$xrpath"; then
 	# If the user specified any rpath flags, then add them.
@@ -7566,7 +8769,7 @@ EOF
 	  # This is the magic to use -rpath.
 	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
       fi
@@ -7585,18 +8788,18 @@ EOF
 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		;;
 	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		;;
 	      esac
 	    fi
 	  else
 	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
+	    func_append rpath " $flag"
 	  fi
 	elif test -n "$runpath_var"; then
 	  case "$perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  *) func_append perm_rpath " $libdir" ;;
 	  esac
 	fi
 	case $host in
@@ -7605,12 +8808,12 @@ EOF
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
-	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  *) func_append dllsearchpath ":$libdir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
 	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  *) func_append dllsearchpath ":$testbindir";;
 	  esac
 	  ;;
 	esac
@@ -7636,18 +8839,18 @@ EOF
 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		;;
 	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		;;
 	      esac
 	    fi
 	  else
 	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
+	    func_append rpath " $flag"
 	  fi
 	elif test -n "$runpath_var"; then
 	  case "$finalize_perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
 	  esac
 	fi
       done
@@ -7661,8 +8864,8 @@ EOF
 
       if test -n "$libobjs" && test "$build_old_libs" = yes; then
 	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
       func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
@@ -7674,15 +8877,15 @@ EOF
 
       wrappers_required=yes
       case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
       *cygwin* | *mingw* )
         if test "$build_libtool_libs" != yes; then
           wrappers_required=no
         fi
         ;;
-      *cegcc)
-        # Disable wrappers for cegcc, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
       *)
         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
           wrappers_required=no
@@ -7691,13 +8894,19 @@ EOF
       esac
       if test "$wrappers_required" = no; then
 	# Replace the output file specification.
-	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	link_command="$compile_command$compile_rpath"
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
 	func_show_eval "$link_command" 'exit_status=$?'
 
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
 	# Delete the generated files.
 	if test -f "$output_objdir/${outputname}S.${objext}"; then
 	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
@@ -7720,7 +8929,7 @@ EOF
 	  # We should set the runpath_var.
 	  rpath=
 	  for dir in $perm_rpath; do
-	    rpath="$rpath$dir:"
+	    func_append rpath "$dir:"
 	  done
 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
@@ -7728,7 +8937,7 @@ EOF
 	  # We should set the runpath_var.
 	  rpath=
 	  for dir in $finalize_perm_rpath; do
-	    rpath="$rpath$dir:"
+	    func_append rpath "$dir:"
 	  done
 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
@@ -7738,11 +8947,18 @@ EOF
 	# We don't need to create a wrapper script.
 	link_command="$compile_var$compile_command$compile_rpath"
 	# Replace the output file specification.
-	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
 	$opt_dry_run || $RM $output
 	# Link the executable and exit
 	func_show_eval "$link_command" 'exit $?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
 	exit $EXIT_SUCCESS
       fi
 
@@ -7757,7 +8973,7 @@ EOF
 	if test "$fast_install" != no; then
 	  link_command="$finalize_var$compile_command$finalize_rpath"
 	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
 	  else
 	    # fast_install is set to needless
 	    relink_command=
@@ -7769,13 +8985,19 @@ EOF
       fi
 
       # Replace the output file specification.
-      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
       # Delete the old output files.
       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
 
       func_show_eval "$link_command" 'exit $?'
 
+      if test -n "$postlink_cmds"; then
+	func_to_tool_file "$output_objdir/$outputname"
+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
       # Now create the wrapper script.
       func_verbose "creating $output"
 
@@ -7793,18 +9015,7 @@ EOF
 	  fi
 	done
 	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
-      fi
-
-      # Quote $ECHO for shipping.
-      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
-	case $progpath in
-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
-	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
-	esac
-	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
-      else
-	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
       fi
 
       # Only actually do things if not in dry run mode.
@@ -7884,7 +9095,7 @@ EOF
 	else
 	  oldobjs="$old_deplibs $non_pic_objects"
 	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    oldobjs="$oldobjs $symfileobj"
+	    func_append oldobjs " $symfileobj"
 	  fi
 	fi
 	addlibs="$old_convenience"
@@ -7892,10 +9103,10 @@ EOF
 
       if test -n "$addlibs"; then
 	gentop="$output_objdir/${outputname}x"
-	generated="$generated $gentop"
+	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
-	oldobjs="$oldobjs $func_extract_archives_result"
+	func_append oldobjs " $func_extract_archives_result"
       fi
 
       # Do each command in the archive commands.
@@ -7906,10 +9117,10 @@ EOF
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
 	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
-	  oldobjs="$oldobjs $func_extract_archives_result"
+	  func_append oldobjs " $func_extract_archives_result"
 	fi
 
 	# POSIX demands no paths to be encoded in archives.  We have
@@ -7925,9 +9136,9 @@ EOF
 	    done | sort | sort -uc >/dev/null 2>&1); then
 	  :
 	else
-	  $ECHO "copying selected object files to avoid basename conflicts..."
+	  echo "copying selected object files to avoid basename conflicts..."
 	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
 	  oldobjs=
@@ -7951,18 +9162,30 @@ EOF
 		esac
 	      done
 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      oldobjs="$oldobjs $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
 	      ;;
-	    *) oldobjs="$oldobjs $obj" ;;
+	    *) func_append oldobjs " $obj" ;;
 	    esac
 	  done
 	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
 	eval cmds=\"$old_archive_cmds\"
 
 	func_len " $cmds"
 	len=$func_len_result
 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  cmds=$old_archive_cmds
+	elif test -n "$archiver_list_spec"; then
+	  func_verbose "using command file archive linking..."
+	  for obj in $oldobjs
+	  do
+	    func_to_tool_file "$obj"
+	    $ECHO "$func_to_tool_file_result"
+	  done > $output_objdir/$libname.libcmd
+	  func_to_tool_file "$output_objdir/$libname.libcmd"
+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+	  cmds=$old_archive_cmds
 	else
 	  # the command line is too long to link in one step, link in parts
 	  func_verbose "using piecewise archive linking..."
@@ -8036,7 +9259,7 @@ EOF
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
       if test "$hardcode_automatic" = yes ; then
 	relink_command=
       fi
@@ -8056,12 +9279,23 @@ EOF
 	      *.la)
 		func_basename "$deplib"
 		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		func_resolve_sysroot "$deplib"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		newdependency_libs="$newdependency_libs $libdir/$name"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      -L*)
+		func_stripname -L '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
 		;;
-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      -R*)
+		func_stripname -R '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
+		;;
+	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
 	    dependency_libs="$newdependency_libs"
@@ -8075,9 +9309,9 @@ EOF
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlfiles="$newdlfiles $libdir/$name"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
-	      *) newdlfiles="$newdlfiles $lib" ;;
+	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
 	    dlfiles="$newdlfiles"
@@ -8094,7 +9328,7 @@ EOF
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlprefiles="$newdlprefiles $libdir/$name"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
@@ -8106,7 +9340,7 @@ EOF
 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
-	      newdlfiles="$newdlfiles $abs"
+	      func_append newdlfiles " $abs"
 	    done
 	    dlfiles="$newdlfiles"
 	    newdlprefiles=
@@ -8115,15 +9349,33 @@ EOF
 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
-	      newdlprefiles="$newdlprefiles $abs"
+	      func_append newdlprefiles " $abs"
 	    done
 	    dlprefiles="$newdlprefiles"
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
 	  tdlname=$dlname
 	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test "x$bindir" != x ;
+	      then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
@@ -8182,7 +9434,7 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$mode" = link || test "$mode" = relink; } &&
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
     func_mode_link ${1+"$@"}
 
 
@@ -8202,9 +9454,9 @@ func_mode_uninstall ()
     for arg
     do
       case $arg in
-      -f) RM="$RM $arg"; rmforce=yes ;;
-      -*) RM="$RM $arg" ;;
-      *) files="$files $arg" ;;
+      -f) func_append RM " $arg"; rmforce=yes ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
       esac
     done
 
@@ -8213,24 +9465,23 @@ func_mode_uninstall ()
 
     rmdirs=
 
-    origobjdir="$objdir"
     for file in $files; do
       func_dirname "$file" "" "."
       dir="$func_dirname_result"
       if test "X$dir" = X.; then
-	objdir="$origobjdir"
+	odir="$objdir"
       else
-	objdir="$dir/$origobjdir"
+	odir="$dir/$objdir"
       fi
       func_basename "$file"
       name="$func_basename_result"
-      test "$mode" = uninstall && objdir="$dir"
+      test "$opt_mode" = uninstall && odir="$dir"
 
-      # Remember objdir for removal later, being careful to avoid duplicates
-      if test "$mode" = clean; then
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test "$opt_mode" = clean; then
 	case " $rmdirs " in
-	  *" $objdir "*) ;;
-	  *) rmdirs="$rmdirs $objdir" ;;
+	  *" $odir "*) ;;
+	  *) func_append rmdirs " $odir" ;;
 	esac
       fi
 
@@ -8256,18 +9507,17 @@ func_mode_uninstall ()
 
 	  # Delete the libtool libraries and symlinks.
 	  for n in $library_names; do
-	    rmfiles="$rmfiles $objdir/$n"
+	    func_append rmfiles " $odir/$n"
 	  done
-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$mode" in
+	  case "$opt_mode" in
 	  clean)
-	    case "  $library_names " in
-	    # "  " in the beginning catches empty $dlname
+	    case " $library_names " in
 	    *" $dlname "*) ;;
-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
 	    esac
-	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
 	    ;;
 	  uninstall)
 	    if test -n "$library_names"; then
@@ -8295,19 +9545,19 @@ func_mode_uninstall ()
 	  # Add PIC object to the list of files to remove.
 	  if test -n "$pic_object" &&
 	     test "$pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$pic_object"
+	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
 	  if test -n "$non_pic_object" &&
 	     test "$non_pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$non_pic_object"
+	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$mode" = clean ; then
+	if test "$opt_mode" = clean ; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -8317,7 +9567,7 @@ func_mode_uninstall ()
 	    noexename=$func_stripname_result
 	    # $file with .exe has already been added to rmfiles,
 	    # add $file without .exe
-	    rmfiles="$rmfiles $file"
+	    func_append rmfiles " $file"
 	    ;;
 	  esac
 	  # Do a test to see if this is a libtool program.
@@ -8326,7 +9576,7 @@ func_mode_uninstall ()
 	      func_ltwrapper_scriptname "$file"
 	      relink_command=
 	      func_source $func_ltwrapper_scriptname_result
-	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
 	    else
 	      relink_command=
 	      func_source $dir/$noexename
@@ -8334,12 +9584,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
 	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles="$rmfiles $objdir/lt-$name"
+	      func_append rmfiles " $odir/lt-$name"
 	    fi
 	    if test "X$noexename" != "X$name" ; then
-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	      func_append rmfiles " $odir/lt-${noexename}.c"
 	    fi
 	  fi
 	fi
@@ -8347,7 +9597,6 @@ func_mode_uninstall ()
       esac
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
-    objdir="$origobjdir"
 
     # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
@@ -8359,16 +9608,16 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
     func_mode_uninstall ${1+"$@"}
 
-test -z "$mode" && {
+test -z "$opt_mode" && {
   help="$generic_help"
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$mode'"
+  func_fatal_help "invalid operation mode \`$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 671cde1..44e0ecf 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1,7 +1,8 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -10,7 +11,8 @@
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ])
 
-# serial 56 LT_INIT
+# serial 57 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -66,6 +68,7 @@ esac
 # ------------------
 AC_DEFUN([LT_INIT],
 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
 AC_BEFORE([$0], [LTDL_INIT])dnl
@@ -82,6 +85,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl
 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
 m4_require([_LT_PROG_LTMAIN])dnl
 
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
 dnl Parse OPTIONS
 _LT_SET_OPTIONS([$0], [$1])
 
@@ -118,7 +123,7 @@ m4_defun([_LT_CC_BASENAME],
     *) break;;
   esac
 done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 ])
 
 
@@ -138,6 +143,11 @@ m4_defun([_LT_FILEUTILS_DEFAULTS],
 m4_defun([_LT_SETUP],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl
 _LT_DECL([], [host_os], [0])dnl
@@ -160,10 +170,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
 dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
 m4_require([_LT_CMD_RELOAD])dnl
 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
 # See if we are running on zsh, and set the options which allow our
@@ -179,7 +192,6 @@ fi
 _LT_CHECK_OBJDIR
 
 m4_require([_LT_TAG_COMPILER])dnl
-_LT_PROG_ECHO_BACKSLASH
 
 case $host_os in
 aix3*)
@@ -193,23 +205,6 @@ aix3*)
   ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
 # Global variables:
 ofile=libtool
 can_build_shared=yes
@@ -250,6 +245,28 @@ _LT_CONFIG_COMMANDS
 ])# _LT_SETUP
 
 
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
 # _LT_PROG_LTMAIN
 # ---------------
 # Note that this code is called both from `configure', and `config.status'
@@ -408,7 +425,7 @@ m4_define([_lt_decl_all_varnames],
 # declaration there will have the same value as in `configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
 
 
 # _LT_CONFIG_STATUS_DECLARATIONS
@@ -418,7 +435,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE],
 # embedded single quotes properly.  In configure, this macro expands
 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
 #
-#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
     [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
@@ -517,12 +534,20 @@ LTCC='$LTCC'
 LTCFLAGS='$LTCFLAGS'
 compiler='$compiler_DEFAULT'
 
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
 # Quote evaled strings.
 for var in lt_decl_all_varnames([[ \
 ]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -533,9 +558,9 @@ done
 # Double-quote double-evaled strings.
 for var in lt_decl_all_varnames([[ \
 ]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -543,16 +568,38 @@ for var in lt_decl_all_varnames([[ \
     esac
 done
 
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\[$]0 --fallback-echo"')dnl "
-  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
-  ;;
-esac
-
 _LT_OUTPUT_LIBTOOL_INIT
 ])
 
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
 # ---------
@@ -562,20 +609,11 @@ _LT_OUTPUT_LIBTOOL_INIT
 AC_DEFUN([LT_OUTPUT],
 [: ${CONFIG_LT=./config.lt}
 AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
 
 cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
+lt_cl_silent=false
 exec AS_MESSAGE_LOG_FD>>config.log
 {
   echo
@@ -601,7 +639,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING.
 
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
@@ -646,15 +684,13 @@ chmod +x "$CONFIG_LT"
 # appending to config.log, which fails on DOS, as config.log is still kept
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
-if test "$no_create" != yes; then
-  lt_cl_success=:
-  test "$silent" = yes &&
-    lt_config_lt_args="$lt_config_lt_args --quiet"
-  exec AS_MESSAGE_LOG_FD>/dev/null
-  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-  exec AS_MESSAGE_LOG_FD>>config.log
-  $lt_cl_success || AS_EXIT(1)
-fi
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
 ])# LT_OUTPUT
 
 
@@ -717,15 +753,12 @@ _LT_EOF
   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
   # text mode, it properly converts lines to CR/LF.  This bash problem
   # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_XSI_SHELLFNS
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
 
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
+  _LT_PROG_REPLACE_SHELLFNS
 
-  mv -f "$cfgfile" "$ofile" ||
+   mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 ],
@@ -770,6 +803,7 @@ AC_DEFUN([LT_LANG],
 m4_case([$1],
   [C],			[_LT_LANG(C)],
   [C++],		[_LT_LANG(CXX)],
+  [Go],			[_LT_LANG(GO)],
   [Java],		[_LT_LANG(GCJ)],
   [Fortran 77],		[_LT_LANG(F77)],
   [Fortran],		[_LT_LANG(FC)],
@@ -791,6 +825,31 @@ m4_defun([_LT_LANG],
 ])# _LT_LANG
 
 
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
 # _LT_LANG_DEFAULT_CONFIG
 # -----------------------
 m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -821,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
        m4_ifdef([LT_PROG_GCJ],
 	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
 
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
 AC_PROVIDE_IFELSE([LT_PROG_RC],
   [LT_LANG(RC)],
   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -831,11 +894,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
 dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
 
 
 # _LT_TAG_COMPILER
@@ -921,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -929,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	rm -rf libconftest.dylib*
 	rm -f conftest.*
       fi])
+
     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
       [lt_cv_ld_exported_symbols_list],
       [lt_cv_ld_exported_symbols_list=no
@@ -940,6 +1012,34 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	[lt_cv_ld_exported_symbols_list=no])
 	LDFLAGS="$save_LDFLAGS"
     ])
+
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
@@ -967,7 +1067,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
     else
       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test "$DSYMUTIL" != ":"; then
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -977,8 +1077,8 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 ])
 
 
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
 # Checks for linker and compiler features on darwin
 m4_defun([_LT_DARWIN_LINKER_FEATURES],
 [
@@ -987,7 +1087,13 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
   _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
   case $cc_basename in
@@ -995,7 +1101,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
+    output_verbose_link_cmd=func_echo_all
     _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
     _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
@@ -1011,203 +1117,142 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   fi
 ])
 
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
 # Links a minimal program and checks the executable
 # for the system default hardcoded library path. In most cases,
 # this is /usr/lib:/lib, but when the MPI compilers are used
 # the location of the communication and MPI libs are included too.
 # If we don't find anything, use the default library path according
 # to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
 ])# _LT_SYS_MODULE_PATH_AIX
 
 
 # _LT_SHELL_INIT(ARG)
 # -------------------
 m4_define([_LT_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-	 [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_SHELL_INIT
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
 
 
 # _LT_PROG_ECHO_BACKSLASH
 # -----------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[_LT_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
 else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-[$]*
-_LT_EOF
-  exit 0
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
 fi
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
 
-	  if test "$prev" != 'sed 50q "[$]0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
 
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
 
-AC_SUBST(lt_ECHO)
-])
 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1],
-    [An echo program that does not interpret backslashes])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
 ])# _LT_PROG_ECHO_BACKSLASH
 
 
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
 # _LT_ENABLE_LOCK
 # ---------------
 m4_defun([_LT_ENABLE_LOCK],
@@ -1236,7 +1281,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     if test "$lt_cv_prog_gnu_ld" = yes; then
       case `/usr/bin/file conftest.$ac_objext` in
@@ -1329,14 +1374,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
 	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
 	  LD="${LD-ld} -64"
@@ -1354,14 +1412,47 @@ need_locks="$enable_libtool_lock"
 ])# _LT_ENABLE_LOCK
 
 
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	AC_TRY_EVAL([lt_ar_try])
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
 # _LT_CMD_OLD_ARCHIVE
 # -------------------
 m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
+[_LT_PROG_AR
 
 AC_CHECK_TOOL(STRIP, strip, :)
 test -z "$STRIP" && STRIP=:
@@ -1380,18 +1471,27 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
 _LT_DECL([], [old_postinstall_cmds], [2])
 _LT_DECL([], [old_postuninstall_cmds], [2])
 _LT_TAGDECL([], [old_archive_cmds], [2],
     [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
 ])# _LT_CMD_OLD_ARCHIVE
 
 
@@ -1416,15 +1516,15 @@ AC_CACHE_CHECK([$1], [$2],
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        $2=yes
@@ -1464,7 +1564,7 @@ AC_CACHE_CHECK([$1], [$2],
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          $2=yes
@@ -1527,6 +1627,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
   amigaos*)
     # On AmigaOS with pdksh, this test takes hours, literally.
     # So we just punt and use a minimum line length of 8192.
@@ -1552,6 +1657,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1591,8 +1701,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
@@ -1643,7 +1753,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-[#line __oline__ "configure"
+[#line $LINENO "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -1684,7 +1794,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -1693,7 +1809,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
       /* dlclose (self); */
     }
   else
@@ -1869,16 +1989,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
@@ -2037,6 +2157,7 @@ m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
@@ -2045,16 +2166,23 @@ if test "$GCC" = yes; then
     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
     *) lt_awk_arg="/^libraries:/" ;;
   esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
   lt_tmp_lt_search_path_spec=
@@ -2067,7 +2195,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -2087,7 +2215,13 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi])
@@ -2113,7 +2247,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -2122,7 +2256,7 @@ aix3*)
   ;;
 
 aix[[4-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -2175,7 +2309,7 @@ amigaos*)
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
@@ -2187,7 +2321,7 @@ beos*)
   ;;
 
 bsdi[[45]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -2206,8 +2340,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -2228,36 +2363,83 @@ cygwin* | mingw* | pw32* | cegcc*)
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -2278,7 +2460,7 @@ m4_if([$1], [],[
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -2286,10 +2468,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -2297,7 +2475,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
+    freebsd[[23]].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -2315,7 +2493,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2335,12 +2513,26 @@ freebsd* | dragonfly*)
   ;;
 
 gnu*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -2386,12 +2578,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[[3-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -2407,7 +2601,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -2444,9 +2638,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2454,29 +2648,31 @@ linux* | k*bsd*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+
   # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-       [shlibpath_overrides_runpath=yes])])
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+	 [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -2507,7 +2703,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -2576,7 +2772,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2601,7 +2797,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2625,7 +2821,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -2656,7 +2852,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2666,7 +2862,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2708,6 +2904,8 @@ _LT_DECL([], [library_names_spec], [1],
     The last name is the one that the linker finds with -lNAME]])
 _LT_DECL([], [soname_spec], [1],
     [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
 _LT_DECL([], [postinstall_cmds], [2],
     [Command to use after installation of a shared archive])
 _LT_DECL([], [postuninstall_cmds], [2],
@@ -2820,6 +3018,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
 
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
@@ -2941,6 +3140,11 @@ case $reload_flag in
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
   darwin*)
     if test "$GCC" = yes; then
       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -2949,8 +3153,8 @@ case $host_os in
     fi
     ;;
 esac
-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_DECL([], [reload_cmds], [2])dnl
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
 ])# _LT_CMD_RELOAD
 
 
@@ -3002,16 +3206,18 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
 
-cegcc)
+cegcc*)
   # use the weaker test based on 'objdump'. See mingw*.
   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
@@ -3041,6 +3247,10 @@ gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
   case $host_cpu in
@@ -3049,11 +3259,11 @@ hpux10.20* | hpux11*)
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     ;;
   hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
     lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   esac
@@ -3074,8 +3284,8 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3153,6 +3363,21 @@ tpf*)
   ;;
 esac
 ])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -3160,7 +3385,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 _LT_DECL([], [deplibs_check_method], [1],
     [Method to check whether dependent libraries are shared objects])
 _LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method == "file_magic"])
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
 ])# _LT_CHECK_MAGIC_METHOD
 
 
@@ -3217,7 +3446,19 @@ if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
-  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
   AC_SUBST([DUMPBIN])
   if test "$DUMPBIN" != ":"; then
     NM="$DUMPBIN"
@@ -3230,13 +3471,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
   [lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
   cat conftest.out >&AS_MESSAGE_LOG_FD
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -3251,15 +3492,76 @@ dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([AM_PROG_NM], [])
 dnl AC_DEFUN([AC_PROG_NM], [])
 
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
 
-# LT_LIB_M
-# --------
-# check for math library
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
 AC_DEFUN([LT_LIB_M],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 LIBM=
 case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
@@ -3287,7 +3589,12 @@ m4_defun([_LT_COMPILER_NO_RTTI],
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
 if test "$GCC" = yes; then
-  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
 
   _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
     lt_cv_prog_compiler_rtti_exceptions,
@@ -3304,6 +3611,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
 AC_REQUIRE([LT_PATH_LD])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -3371,8 +3679,8 @@ esac
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3396,6 +3704,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -3408,6 +3717,7 @@ for ac_symprfx in "" "_"; do
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
   fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -3429,7 +3739,7 @@ _LT_EOF
   if AC_TRY_EVAL(ac_compile); then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
 	mv -f "$nlist"T "$nlist"
@@ -3441,6 +3751,18 @@ _LT_EOF
       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _DLSYM_CONST const
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3452,7 +3774,7 @@ _LT_EOF
 	  cat <<_LT_EOF >> conftest.$ac_ext
 
 /* The mapping between symbol names and symbols.  */
-const struct {
+LT@&t at _DLSYM_CONST struct {
   const char *name;
   void       *address;
 }
@@ -3478,15 +3800,15 @@ static const void *lt_preloaded_setup() {
 _LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
 	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
 	else
 	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
 	fi
@@ -3519,6 +3841,13 @@ else
   AC_MSG_RESULT(ok)
 fi
 
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
@@ -3529,6 +3858,8 @@ _LT_DECL([global_symbol_to_c_name_address],
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
 
 
@@ -3540,7 +3871,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
 _LT_TAGVAR(lt_prog_compiler_static, $1)=
 
-AC_MSG_CHECKING([for $compiler option to produce PIC])
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -3591,6 +3921,11 @@ m4_if([$1], [CXX], [
       # DJGPP does not support shared libraries at all
       _LT_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
     interix[[3-9]]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -3640,6 +3975,12 @@ m4_if([$1], [CXX], [
 	  ;;
 	esac
 	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	m4_if([$1], [GCJ], [],
+	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	;;
       dgux*)
 	case $cc_basename in
 	  ec++*)
@@ -3696,7 +4037,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -3729,8 +4070,8 @@ m4_if([$1], [CXX], [
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
+	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
@@ -3792,7 +4133,7 @@ m4_if([$1], [CXX], [
 	;;
       solaris*)
 	case $cc_basename in
-	  CC*)
+	  CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -3896,6 +4237,12 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
     hpux*)
       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
@@ -3938,6 +4285,15 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
     esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
+      ;;
+    esac
   else
     # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
@@ -3980,7 +4336,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4001,7 +4357,13 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
 	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
+      nagfor*)
+	# NAG Fortran compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -4013,25 +4375,40 @@ m4_if([$1], [CXX], [
         # All Alpha code is PIC.
         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
 	;;
       *)
 	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	  ;;
 	*Sun\ C*)
 	  # Sun C 5.9
 	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+        *Intel*\ [[CF]]*Compiler*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	  ;;
+	*Portland\ Group*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
 	  ;;
 	esac
 	;;
@@ -4063,7 +4440,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       case $cc_basename in
-      f77* | f90* | f95*)
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
       *)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
@@ -4120,9 +4497,11 @@ case $host_os in
     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
     ;;
 esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-	[How to pass a linker flag through the compiler])
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
 
 #
 # Check to make sure the PIC flag actually works.
@@ -4141,6 +4520,8 @@ fi
 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
 	[Additional compiler flags for building library objects])
 
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
 #
 # Check to make sure the static flag actually works.
 #
@@ -4161,6 +4542,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
 m4_defun([_LT_LINKER_SHLIBS],
 [AC_REQUIRE([LT_PATH_LD])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -4169,27 +4551,37 @@ m4_require([_LT_TAG_COMPILER])dnl
 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 m4_if([$1], [CXX], [
   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
     # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
       _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
+    ;;
   cygwin* | mingw* | cegcc*)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    case $cc_basename in
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    ;;
   esac
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
 ], [
   runpath_var=
   _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -4204,7 +4596,6 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
   _LT_TAGVAR(hardcode_libdir_separator, $1)=
   _LT_TAGVAR(hardcode_minus_L, $1)=no
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4252,7 +4643,33 @@ dnl Note also adjust exclude_expsyms for C++ above.
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
   if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -4270,6 +4687,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     fi
     supports_anon_versioning=no
     case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -4285,11 +4703,12 @@ dnl Note also adjust exclude_expsyms for C++ above.
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
 *** to be unable to reliably create shared libraries on AIX.
 *** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
 _LT_EOF
       fi
@@ -4325,10 +4744,12 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -4346,6 +4767,11 @@ _LT_EOF
       fi
       ;;
 
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -4361,7 +4787,7 @@ _LT_EOF
       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | tpf* | k*bsd*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
       if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -4371,15 +4797,16 @@ _LT_EOF
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
 	 && test "$tmp_diet" = no
       then
-	tmp_addflag=
+	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -4390,13 +4817,17 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
-	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
@@ -4412,17 +4843,16 @@ _LT_EOF
         fi
 
 	case $cc_basename in
-	xlf*)
+	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
 	  if test "x$supports_anon_versioning" = xyes; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
 	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -4436,8 +4866,8 @@ _LT_EOF
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -4455,8 +4885,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4502,8 +4932,8 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4543,8 +4973,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
 	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
@@ -4631,9 +5063,9 @@ _LT_EOF
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        _LT_SYS_MODULE_PATH_AIX
+        _LT_SYS_MODULE_PATH_AIX([$1])
         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
       else
 	if test "$host_cpu" = ia64; then
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
@@ -4642,14 +5074,19 @@ _LT_EOF
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_SYS_MODULE_PATH_AIX([$1])
 	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
 	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
 	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
@@ -4681,20 +5118,64 @@ _LT_EOF
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	_LT_TAGVAR(always_export_symbols, $1)=yes
+	_LT_TAGVAR(file_list_spec, $1)='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	# FIXME: Should let the user specify the lib program.
+	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -4707,10 +5188,6 @@ _LT_EOF
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    freebsd1*)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -4723,7 +5200,7 @@ _LT_EOF
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -4732,7 +5209,7 @@ _LT_EOF
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
     freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
       _LT_TAGVAR(hardcode_direct, $1)=yes
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -4740,7 +5217,7 @@ _LT_EOF
 
     hpux9*)
       if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
@@ -4755,14 +5232,13 @@ _LT_EOF
       ;;
 
     hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
       if test "$with_gnu_ld" = no; then
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -4774,16 +5250,16 @@ _LT_EOF
       ;;
 
     hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
@@ -4795,7 +5271,14 @@ _LT_EOF
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	m4_if($1, [], [
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  _LT_LINKER_OPTION([if $CC understands -b],
+	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
@@ -4823,19 +5306,34 @@ _LT_EOF
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        AC_LINK_IFELSE(int foo(void) {},
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-        )
-        LDFLAGS="$save_LDFLAGS"
+	# This should be the same for all languages, so no per-tag cache variable.
+	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+	  [lt_cv_irix_exported_symbol],
+	  [save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   AC_LINK_IFELSE(
+	     [AC_LANG_SOURCE(
+	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+			      [C++], [[int foo (void) { return 0; }]],
+			      [Fortran 77], [[
+      subroutine foo
+      end]],
+			      [Fortran], [[
+      subroutine foo
+      end]])])],
+	      [lt_cv_irix_exported_symbol=yes],
+	      [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
@@ -4897,17 +5395,17 @@ _LT_EOF
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
       _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
@@ -4917,13 +5415,13 @@ _LT_EOF
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -4936,9 +5434,9 @@ _LT_EOF
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
@@ -5114,36 +5612,38 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-        _LT_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-        then
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+	[$RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+	  _LT_TAGVAR(allow_undefined_flag, $1)=
+	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+	  then
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	  else
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  fi
+	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+	])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
       ;;
     esac
   fi
@@ -5180,9 +5680,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
     [Flag to hardcode $libdir into a binary during linking.
     This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
-    [[If ld is used when linking, flag to hardcode $libdir into a binary
-    during linking.  This must work even if $libdir does not exist]])
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
@@ -5208,8 +5705,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
     to runtime path list])
 _LT_TAGDECL([], [link_all_deplibs], [0],
     [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
-    [Fix the shell variable $srcfile for the compiler])
 _LT_TAGDECL([], [always_export_symbols], [0],
     [Set to "yes" if exported symbols are required])
 _LT_TAGDECL([], [export_symbols_cmds], [2],
@@ -5220,6 +5715,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
     [Symbols that must always be exported])
 _LT_TAGDECL([], [prelink_cmds], [2],
     [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
 _LT_TAGDECL([], [file_list_spec], [1],
     [Specify filename containing input files])
 dnl FIXME: Not yet implemented
@@ -5313,37 +5810,22 @@ CC="$lt_save_CC"
 ])# _LT_LANG_C_CONFIG
 
 
-# _LT_PROG_CXX
-# ------------
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
 # _LT_LANG_CXX_CONFIG([TAG])
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
 # the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
 
 AC_LANG_PUSH(C++)
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
@@ -5355,7 +5837,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -5365,6 +5846,8 @@ _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -5396,6 +5879,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
   lt_save_LD=$LD
   lt_save_GCC=$GCC
   GCC=$GXX
@@ -5413,6 +5897,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   fi
   test -z "${LDCXX+set}" || LD=$LDCXX
   CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -5434,8 +5919,8 @@ if test "$_lt_caught_CXX_error" != yes; then
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
       if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5467,7 +5952,7 @@ if test "$_lt_caught_CXX_error" != yes; then
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
       # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
     else
       GXX=no
@@ -5576,10 +6061,10 @@ if test "$_lt_caught_CXX_error" != yes; then
           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          _LT_SYS_MODULE_PATH_AIX
+          _LT_SYS_MODULE_PATH_AIX([$1])
           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         else
           if test "$host_cpu" = ia64; then
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
@@ -5588,14 +6073,19 @@ if test "$_lt_caught_CXX_error" != yes; then
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
-	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_SYS_MODULE_PATH_AIX([$1])
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
 	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    fi
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	    # This is similar to how AIX traditionally builds its shared
 	    # libraries.
@@ -5625,28 +6115,75 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-        # as there is no search path for DLLs.
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-        _LT_TAGVAR(always_export_symbols, $1)=no
-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          _LT_TAGVAR(ld_shlibs, $1)=no
-        fi
-        ;;
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=yes
+	  _LT_TAGVAR(file_list_spec, $1)='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	  # Don't use ranlib
+	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=no
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	  ;;
+	esac
+	;;
       darwin* | rhapsody*)
         _LT_DARWIN_LINKER_FEATURES($1)
 	;;
@@ -5669,7 +6206,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         esac
         ;;
 
-      freebsd[[12]]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
 	# switch to ELF
         _LT_TAGVAR(ld_shlibs, $1)=no
@@ -5688,6 +6225,11 @@ if test "$_lt_caught_CXX_error" != yes; then
       gnu*)
         ;;
 
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
       hpux9*)
         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -5712,11 +6254,11 @@ if test "$_lt_caught_CXX_error" != yes; then
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
             if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -5777,7 +6319,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
 	    if test "$GXX" = yes; then
@@ -5787,10 +6329,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -5820,7 +6362,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -5831,9 +6373,9 @@ if test "$_lt_caught_CXX_error" != yes; then
           *)
 	    if test "$GXX" = yes; then
 	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -5844,7 +6386,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -5862,7 +6404,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5899,26 +6441,26 @@ if test "$_lt_caught_CXX_error" != yes; then
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
-	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
 		$RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
-	    *) # Version 6 will use weak symbols
+	    *) # Version 6 and above use weak symbols
 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
@@ -5926,7 +6468,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
@@ -5945,9 +6487,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
-	  xl*)
+	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5967,13 +6509,13 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
 	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
 	      # would be better.
-	      output_verbose_link_cmd='echo'
+	      output_verbose_link_cmd='func_echo_all'
 
 	      # Archives containing C++ object files must be created using
 	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -6042,7 +6584,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 	  fi
-	  output_verbose_link_cmd=echo
+	  output_verbose_link_cmd=func_echo_all
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6077,15 +6619,15 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    case $host in
 	      osf3*)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
 	          $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
@@ -6101,17 +6643,17 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	      esac
 
@@ -6121,7 +6663,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      # Commands to make compiler produce verbose output that lists
 	      # what "hidden" libraries, object files and flags are used when
 	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
 	    else
 	      # FIXME: insert proper C++ library support
@@ -6157,7 +6699,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
       solaris*)
         case $cc_basename in
-          CC*)
+          CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -6178,7 +6720,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    esac
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 
-	    output_verbose_link_cmd='echo'
+	    output_verbose_link_cmd='func_echo_all'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -6198,14 +6740,14 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
 	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
 	        # platform.
@@ -6216,7 +6758,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
@@ -6270,6 +6812,10 @@ if test "$_lt_caught_CXX_error" != yes; then
           CC*)
 	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+	      '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
 	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
@@ -6325,6 +6871,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   fi # test -n "$compiler"
 
   CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
   LDCXX=$LD
   LD=$lt_save_LD
   GCC=$lt_save_GCC
@@ -6339,6 +6886,29 @@ AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
 
 
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -6347,6 +6917,7 @@ AC_LANG_POP
 # objects, libraries and library flags.
 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
 # Dependencies to place before and after the object being linked:
 _LT_TAGVAR(predep_objects, $1)=
 _LT_TAGVAR(postdep_objects, $1)=
@@ -6396,7 +6967,20 @@ public class foo {
   }
 };
 _LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
 ])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
 dnl Parse the compiler output and extract the necessary
 dnl objects, libraries and library flags.
 if AC_TRY_EVAL(ac_compile); then
@@ -6408,7 +6992,7 @@ if AC_TRY_EVAL(ac_compile); then
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
+    case ${prev}${p} in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
@@ -6417,13 +7001,22 @@ if AC_TRY_EVAL(ac_compile); then
           test $p = "-R"; then
 	 prev=$p
 	 continue
-       else
-	 prev=
        fi
 
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
        if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
+	 case ${prev} in
+	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
@@ -6443,8 +7036,10 @@ if AC_TRY_EVAL(ac_compile); then
 	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
 	 fi
        fi
+       prev=
        ;;
 
+    *.lto.$objext) ;; # Ignore GCC LTO objects
     *.$objext)
        # This assumes that the test object file only shows up
        # once in the compiler output.
@@ -6480,6 +7075,7 @@ else
 fi
 
 $RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
 
 # PORTME: override above test on systems where it is broken
 m4_if([$1], [CXX],
@@ -6516,7 +7112,7 @@ linux*)
 
 solaris*)
   case $cc_basename in
-  CC*)
+  CC* | sunCC*)
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as
@@ -6560,32 +7156,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 ])# _LT_SYS_HIDDEN_LIBDEPS
 
 
-# _LT_PROG_F77
-# ------------
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
 # _LT_LANG_F77_CONFIG([TAG])
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
 
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -6595,7 +7175,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -6604,6 +7183,8 @@ _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -6643,7 +7224,9 @@ if test "$_lt_disable_F77" != yes; then
   # Allow CC to be a program name with arguments.
   lt_save_CC="$CC"
   lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -6697,38 +7280,24 @@ if test "$_lt_disable_F77" != yes; then
 
   GCC=$lt_save_GCC
   CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
 fi # test "$_lt_disable_F77" != yes
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
 
 
-# _LT_PROG_FC
-# -----------
-# Since AC_PROG_FC is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_FC],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
-AC_PROG_FC
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_FC
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_FC], [])
-
-
 # _LT_LANG_FC_CONFIG([TAG])
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
-[AC_REQUIRE([_LT_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
 
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -6738,7 +7307,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -6747,6 +7315,8 @@ _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -6786,7 +7356,9 @@ if test "$_lt_disable_FC" != yes; then
   # Allow CC to be a program name with arguments.
   lt_save_CC="$CC"
   lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
   compiler=$CC
   GCC=$ac_cv_fc_compiler_gnu
 
@@ -6842,7 +7414,8 @@ if test "$_lt_disable_FC" != yes; then
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC="$lt_save_CC"
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
 fi # test "$_lt_disable_FC" != yes
 
 AC_LANG_POP
@@ -6879,10 +7452,12 @@ _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=yes
 CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_TAGVAR(LD, $1)="$LD"
@@ -6892,6 +7467,8 @@ _LT_CC_BASENAME([$compiler])
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 
 ## CAVEAT EMPTOR:
 ## There is no encapsulation within the following macros, do not change
@@ -6911,10 +7488,82 @@ fi
 AC_LANG_RESTORE
 
 GCC=$lt_save_GCC
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_GCJ_CONFIG
 
 
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
 # _LT_LANG_RC_CONFIG([TAG])
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
@@ -6946,9 +7595,11 @@ _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
 CC=${RC-"windres"}
+CFLAGS=
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_CC_BASENAME([$compiler])
@@ -6961,7 +7612,8 @@ fi
 
 GCC=$lt_save_GCC
 AC_LANG_RESTORE
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_RC_CONFIG
 
 
@@ -6981,6 +7633,13 @@ dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
 
 
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
 # LT_PROG_RC
 # ----------
 AC_DEFUN([LT_PROG_RC],
@@ -7020,6 +7679,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
 AC_SUBST([OBJDUMP])
 ])
 
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
 
 # _LT_DECL_SED
 # ------------
@@ -7113,8 +7781,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
 # Try some XSI features
 xsi_shell=no
 ( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
     && eval 'test $(( 1 + 1 )) -eq 2 \
     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
   && xsi_shell=yes
@@ -7153,208 +7821,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $[*] ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
 
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
 
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
 
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
 
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
 
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
 
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
 
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
 
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$[@]"`
-}
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
 
-_LT_EOF
-esac
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
 
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]+=\$[2]"
-}
-_LT_EOF
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
     ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
     ;;
-  esac
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
 ])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index 34151a3..5d9acd8 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -1,13 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 6 ltoptions.m4
+# serial 7 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -125,7 +126,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll],
 [enable_win32_dll=yes
 
 case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
   AC_CHECK_TOOL(AS, as, false)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(OBJDUMP, objdump, false)
@@ -133,13 +134,13 @@ case $host in
 esac
 
 test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [0], [Assembler program])dnl
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
 
 test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
 
 test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
 ])# win32-dll
 
 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
@@ -325,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
 	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+	IFS="$lt_save_ifs"
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
     [pic_mode=default])
 
 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index f3c5309..07a8602 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -7,17 +7,17 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# Generated from ltversion.in.
+# @configure_input@
 
-# serial 3017 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.2.6b])
-m4_define([LT_PACKAGE_REVISION], [1.3017])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6b'
-macro_revision='1.3017'
+[macro_version='2.4.2'
+macro_revision='1.3337'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
index 637bb20..c573da9 100644
--- a/m4/lt~obsolete.m4
+++ b/m4/lt~obsolete.m4
@@ -1,13 +1,13 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 4 lt~obsolete.m4
+# serial 5 lt~obsolete.m4
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
@@ -77,7 +77,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
 m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
 m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
 m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
 m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
@@ -90,3 +89,10 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
 m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
 m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
 m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/missing b/missing
index 28055d2..9a55648 100755
--- a/missing
+++ b/missing
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.18; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -26,7 +25,7 @@ scriptversion=2009-04-28.21; # UTC
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
@@ -34,7 +33,7 @@ run=:
 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
-# In the cases where this matters, `missing' is being run in the
+# In the cases where this matters, 'missing' is being run in the
 # srcdir already.
 if test -f configure.ac; then
   configure_ac=configure.ac
@@ -65,7 +64,7 @@ case $1 in
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
 error status if there is no known handling for PROGRAM.
 
 Options:
@@ -74,21 +73,20 @@ Options:
   --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
+  aclocal      touch file 'aclocal.m4'
+  autoconf     touch file 'configure'
+  autoheader   touch file 'config.h.in'
   autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
+  automake     touch all 'Makefile.in' files
+  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
+  flex         create 'lex.yy.c', if possible, from existing .c
   help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
+  lex          create 'lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
 
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
@@ -100,8 +98,8 @@ Send bug reports to <bug-automake at gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
@@ -122,22 +120,13 @@ case $1 in
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
        exit 1
     elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
        # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # running '$TOOL --version' or '$TOOL --help' to check whether
        # $TOOL exists and not knowing $TOOL uses missing.
        exit 1
     fi
@@ -149,27 +138,27 @@ esac
 case $program in
   aclocal*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
+         to install the Automake and Perl packages.  Grab them from
          any GNU archive site."
     touch aclocal.m4
     ;;
 
   autoconf*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+WARNING: '$1' is $msg.  You should only need it if
+         you modified '${configure_ac}'.  You might want to install the
+         Autoconf and GNU m4 packages.  Grab them from any GNU
          archive site."
     touch configure
     ;;
 
   autoheader*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acconfig.h' or '${configure_ac}'.  You might want
+         to install the Autoconf and GNU m4 packages.  Grab them
          from any GNU archive site."
     files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
     test -z "$files" && files="config.h"
@@ -186,9 +175,9 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   automake*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
+         You might want to install the Automake and Perl packages.
          Grab them from any GNU archive site."
     find . -type f -name Makefile.am -print |
 	   sed 's/\.am$/.in/' |
@@ -197,10 +186,10 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   autom4te*)
     echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
+WARNING: '$1' is needed, but is $msg.
          You might have modified some files without having the
          proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
+         You can get '$1' as part of Autoconf from any GNU
          archive site."
 
     file=`echo "$*" | sed -n "$sed_output"`
@@ -220,13 +209,13 @@ WARNING: \`$1' is needed, but is $msg.
 
   bison*|yacc*)
     echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
+WARNING: '$1' $msg.  You should only need it if
+         you modified a '.y' file.  You may need the Bison package
          in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
+         Bison from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -250,13 +239,13 @@ WARNING: \`$1' $msg.  You should only need it if
 
   lex*|flex*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.l' file.  You may need the Flex package
          in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
+         Flex from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -273,10 +262,10 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   help2man*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
+WARNING: '$1' is $msg.  You should only need it if
 	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
+	 Help2man package in order for those modifications to take
+	 effect.  You can get Help2man from any GNU archive site."
 
     file=`echo "$*" | sed -n "$sed_output"`
     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
@@ -291,12 +280,12 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   makeinfo*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.texi' or '.texinfo' file, or any other file
          indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
+         call might also be the consequence of using a buggy 'make' (AIX,
+         DU, IRIX).  You might want to install the Texinfo package or
+         the GNU make package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
     file=`echo "$*" | sed -n "$sed_output"`
     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
@@ -318,49 +307,14 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
+WARNING: '$1' is needed, and is $msg.
          You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
+         proper tools for further handling them.  Check the 'README' file,
          it often tells you about the needed prerequisites for installing
          this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
+         some other package would contain this missing '$1' program."
     exit 1
     ;;
 esac
diff --git a/py-compile b/py-compile
index 3f9d05b..699e28f 100755
--- a/py-compile
+++ b/py-compile
@@ -1,10 +1,9 @@
 #!/bin/sh
 # py-compile - Compile a Python program
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-06-08.12; # UTC
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000-2012 Free Software Foundation, Inc.
 
 # 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
@@ -32,28 +31,36 @@ if [ -z "$PYTHON" ]; then
   PYTHON=python
 fi
 
+me=py-compile
+
+usage_error ()
+{
+  echo "$me: $*" >&2
+  echo "Try \`$me --help' for more information." >&2
+  exit 1
+}
+
 basedir=
 destdir=
-files=
 while test $# -ne 0; do
   case "$1" in
     --basedir)
-      basedir=$2
-      if test -z "$basedir"; then
-        echo "$0: Missing argument to --basedir." 1>&2
-        exit 1
+      if test $# -lt 2; then
+        usage_error "option '--basedir' requires an argument"
+      else
+        basedir=$2
       fi
       shift
       ;;
     --destdir)
-      destdir=$2
-      if test -z "$destdir"; then
-        echo "$0: Missing argument to --destdir." 1>&2
-        exit 1
+      if test $# -lt 2; then
+        usage_error "option '--destdir' requires an argument"
+      else
+        destdir=$2
       fi
       shift
       ;;
-    -h|--h*)
+    -h|--help)
       cat <<\EOF
 Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
 
@@ -69,20 +76,27 @@ Report bugs to <bug-automake at gnu.org>.
 EOF
       exit $?
       ;;
-    -v|--v*)
-      echo "py-compile $scriptversion"
+    -v|--version)
+      echo "$me $scriptversion"
       exit $?
       ;;
+    --)
+      shift
+      break
+      ;;
+    -*)
+      usage_error "unrecognized option '$1'"
+      ;;
     *)
-      files="$files $1"
+      break
       ;;
   esac
   shift
 done
 
+files=$*
 if test -z "$files"; then
-    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
-    exit 1
+    usage_error "no files given"
 fi
 
 # if basedir was given, then it should be prepended to filenames before
diff --git a/src/Makefile.am b/src/Makefile.am
index 56763e3..d936a6a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1 +1 @@
-SUBDIRS = saga_core modules modules_contrib modules_geostatistics modules_images modules_io modules_projection modules_recreations modules_simulation modules_terrain_analysis modules_lectures
+SUBDIRS = saga_core modules
diff --git a/src/Makefile.in b/src/Makefile.in
index 6fd9221..c4f42dd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -236,7 +260,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = saga_core modules modules_contrib modules_geostatistics modules_images modules_io modules_projection modules_recreations modules_simulation modules_terrain_analysis modules_lectures
+SUBDIRS = saga_core modules
 all: all-recursive
 
 .SUFFIXES:
@@ -278,11 +302,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -346,6 +370,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -409,6 +437,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -444,13 +486,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -485,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -566,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am
index 01a6bf1..5ec3178 100644
--- a/src/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -1 +1 @@
-SUBDIRS = tin table shapes pointcloud grid climate
+SUBDIRS = climate contrib db docs garden grid imagery io pointcloud projection shapes simulation statistics table terrain_analysis tin
diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in
index 2dd09b4..8706e6a 100644
--- a/src/modules/Makefile.in
+++ b/src/modules/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -236,7 +260,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = tin table shapes pointcloud grid climate
+SUBDIRS = climate contrib db docs garden grid imagery io pointcloud projection shapes simulation statistics table terrain_analysis tin
 all: all-recursive
 
 .SUFFIXES:
@@ -278,11 +302,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -346,6 +370,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -409,6 +437,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -444,13 +486,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -485,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -566,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/climate/Makefile.in b/src/modules/climate/Makefile.in
index 18f5608..b5dbf91 100644
--- a/src/modules/climate/Makefile.in
+++ b/src/modules/climate/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -278,11 +302,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -346,6 +370,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -409,6 +437,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -444,13 +486,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -485,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -566,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/climate/climate_tools/Makefile.in b/src/modules/climate/climate_tools/Makefile.in
index 1545f13..7fdf7e9 100644
--- a/src/modules/climate/climate_tools/Makefile.in
+++ b/src/modules/climate/climate_tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/climate/climate_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libclimate_tools_la_DEPENDENCIES =  \
@@ -103,6 +126,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libclimate_tools_la_SOURCES)
 DIST_SOURCES = $(libclimate_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -128,6 +156,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -155,6 +184,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -167,6 +197,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -196,6 +227,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -229,7 +261,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -307,7 +338,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -315,6 +345,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -330,13 +362,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libclimate_tools.la: $(libclimate_tools_la_OBJECTS) $(libclimate_tools_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libclimate_tools.la: $(libclimate_tools_la_OBJECTS) $(libclimate_tools_la_DEPENDENCIES) $(EXTRA_libclimate_tools_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libclimate_tools_la_OBJECTS) $(libclimate_tools_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -426,6 +460,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -476,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -565,18 +618,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/contrib/Makefile.am b/src/modules/contrib/Makefile.am
new file mode 100644
index 0000000..390732e
--- /dev/null
+++ b/src/modules/contrib/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = contrib_peregro
diff --git a/src/modules/contrib/Makefile.in b/src/modules/contrib/Makefile.in
new file mode 100644
index 0000000..4831354
--- /dev/null
+++ b/src/modules/contrib/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/contrib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = contrib_peregro
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/contrib/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/contrib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.cpp b/src/modules/contrib/contrib_peregro/A1WiTh.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.cpp
rename to src/modules/contrib/contrib_peregro/A1WiTh.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.h b/src/modules/contrib/contrib_peregro/A1WiTh.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.h
rename to src/modules/contrib/contrib_peregro/A1WiTh.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.cpp b/src/modules/contrib/contrib_peregro/A2WiTh.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.cpp
rename to src/modules/contrib/contrib_peregro/A2WiTh.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.h b/src/modules/contrib/contrib_peregro/A2WiTh.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.h
rename to src/modules/contrib/contrib_peregro/A2WiTh.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.cpp b/src/modules/contrib/contrib_peregro/A3WiTh.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.cpp
rename to src/modules/contrib/contrib_peregro/A3WiTh.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.h b/src/modules/contrib/contrib_peregro/A3WiTh.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.h
rename to src/modules/contrib/contrib_peregro/A3WiTh.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.cpp b/src/modules/contrib/contrib_peregro/AvWiMa1.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.cpp
rename to src/modules/contrib/contrib_peregro/AvWiMa1.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.h b/src/modules/contrib/contrib_peregro/AvWiMa1.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.h
rename to src/modules/contrib/contrib_peregro/AvWiMa1.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.cpp b/src/modules/contrib/contrib_peregro/AvWiMa2.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.cpp
rename to src/modules/contrib/contrib_peregro/AvWiMa2.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.h b/src/modules/contrib/contrib_peregro/AvWiMa2.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.h
rename to src/modules/contrib/contrib_peregro/AvWiMa2.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.cpp b/src/modules/contrib/contrib_peregro/MLB_Interface.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.cpp
rename to src/modules/contrib/contrib_peregro/MLB_Interface.cpp
diff --git a/src/modules/contrib/contrib_peregro/MLB_Interface.h b/src/modules/contrib/contrib_peregro/MLB_Interface.h
new file mode 100644
index 0000000..da0ec99
--- /dev/null
+++ b/src/modules/contrib/contrib_peregro/MLB_Interface.h
@@ -0,0 +1,26 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__contrib_a_perego_H
+#define HEADER_INCLUDED__contrib_a_perego_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__contrib_a_perego_H
diff --git a/src/modules/contrib/contrib_peregro/Makefile.am b/src/modules/contrib/contrib_peregro/Makefile.am
new file mode 100644
index 0000000..c44f9c2
--- /dev/null
+++ b/src/modules/contrib/contrib_peregro/Makefile.am
@@ -0,0 +1,36 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libcontrib_perego.la
+libcontrib_perego_la_SOURCES =\
+A1WiTh.cpp\
+A2WiTh.cpp\
+A3WiTh.cpp\
+AvWiMa1.cpp\
+AvWiMa2.cpp\
+destriping1.cpp\
+destriping2.cpp\
+directional1.cpp\
+MLB_Interface.cpp\
+A1WiTh.h\
+A2WiTh.h\
+A3WiTh.h\
+AvWiMa1.h\
+AvWiMa2.h\
+destriping1.h\
+destriping2.h\
+directional1.h\
+MLB_Interface.h
+
+libcontrib_perego_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/contrib/contrib_peregro/Makefile.in b/src/modules/contrib/contrib_peregro/Makefile.in
new file mode 100644
index 0000000..ebcac9c
--- /dev/null
+++ b/src/modules/contrib/contrib_peregro/Makefile.in
@@ -0,0 +1,654 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/contrib/contrib_peregro
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libcontrib_perego_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libcontrib_perego_la_OBJECTS = A1WiTh.lo A2WiTh.lo A3WiTh.lo \
+	AvWiMa1.lo AvWiMa2.lo destriping1.lo destriping2.lo \
+	directional1.lo MLB_Interface.lo
+libcontrib_perego_la_OBJECTS = $(am_libcontrib_perego_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libcontrib_perego_la_SOURCES)
+DIST_SOURCES = $(libcontrib_perego_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libcontrib_perego.la
+libcontrib_perego_la_SOURCES = \
+A1WiTh.cpp\
+A2WiTh.cpp\
+A3WiTh.cpp\
+AvWiMa1.cpp\
+AvWiMa2.cpp\
+destriping1.cpp\
+destriping2.cpp\
+directional1.cpp\
+MLB_Interface.cpp\
+A1WiTh.h\
+A2WiTh.h\
+A3WiTh.h\
+AvWiMa1.h\
+AvWiMa2.h\
+destriping1.h\
+destriping2.h\
+directional1.h\
+MLB_Interface.h
+
+libcontrib_perego_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/contrib/contrib_peregro/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/contrib/contrib_peregro/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libcontrib_perego.la: $(libcontrib_perego_la_OBJECTS) $(libcontrib_perego_la_DEPENDENCIES) $(EXTRA_libcontrib_perego_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libcontrib_perego_la_OBJECTS) $(libcontrib_perego_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/A1WiTh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/A2WiTh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/A3WiTh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/AvWiMa1.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/AvWiMa2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/destriping1.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/destriping2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/directional1.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.cpp b/src/modules/contrib/contrib_peregro/destriping1.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.cpp
rename to src/modules/contrib/contrib_peregro/destriping1.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.h b/src/modules/contrib/contrib_peregro/destriping1.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.h
rename to src/modules/contrib/contrib_peregro/destriping1.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.cpp b/src/modules/contrib/contrib_peregro/destriping2.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.cpp
rename to src/modules/contrib/contrib_peregro/destriping2.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.h b/src/modules/contrib/contrib_peregro/destriping2.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.h
rename to src/modules/contrib/contrib_peregro/destriping2.h
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.cpp b/src/modules/contrib/contrib_peregro/directional1.cpp
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.cpp
rename to src/modules/contrib/contrib_peregro/directional1.cpp
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.h b/src/modules/contrib/contrib_peregro/directional1.h
similarity index 100%
rename from src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.h
rename to src/modules/contrib/contrib_peregro/directional1.h
diff --git a/src/modules/db/Makefile.am b/src/modules/db/Makefile.am
new file mode 100644
index 0000000..e35a6c4
--- /dev/null
+++ b/src/modules/db/Makefile.am
@@ -0,0 +1,13 @@
+if HAVE_POSTGRESQL
+if WITH_ODBC
+SUBDIRS = db_odbc db_pgsql
+else
+SUBDIRS = db_pgsql
+endif
+else
+if WITH_ODBC
+SUBDIRS = db_odbc
+else
+SUBDIRS =
+endif
+endif
diff --git a/src/modules/db/Makefile.in b/src/modules/db/Makefile.in
new file mode 100644
index 0000000..595934a
--- /dev/null
+++ b/src/modules/db/Makefile.in
@@ -0,0 +1,637 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/db
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = db_odbc db_pgsql
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at HAVE_POSTGRESQL_FALSE@@WITH_ODBC_FALSE at SUBDIRS = 
+ at HAVE_POSTGRESQL_FALSE@@WITH_ODBC_TRUE at SUBDIRS = db_odbc
+ at HAVE_POSTGRESQL_TRUE@@WITH_ODBC_FALSE at SUBDIRS = db_pgsql
+ at HAVE_POSTGRESQL_TRUE@@WITH_ODBC_TRUE at SUBDIRS = db_odbc db_pgsql
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/db/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/db/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/db/db_odbc/MLB_Interface.cpp b/src/modules/db/db_odbc/MLB_Interface.cpp
new file mode 100644
index 0000000..31b1d25
--- /dev/null
+++ b/src/modules/db/db_odbc/MLB_Interface.cpp
@@ -0,0 +1,155 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2004 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 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("Import/Export - ODBC/OTL") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O.Conrad (c) 2010") );
+
+	case MLB_INFO_Description:
+		return( _TW(
+			"Database access via Open Data Base Connection (ODBC) interface. "
+			"Based on the OTL (Oracle, Odbc and DB2-CLI Template Library), Version 4.0: "
+			"<a target=\"_blank\" href=\"http://otl.sourceforge.net/\">http://otl.sourceforge.net/</a>"
+		));
+
+	case MLB_INFO_Version:
+		return( _TL("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Database|ODBC") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "get_connection.h"
+#include "table.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  9:	return( new CGet_Servers );
+	case  0:	return( new CGet_Connection );
+	case  1:	return( new CDel_Connection );
+	case 11:	return( new CDel_Connections );
+	case  2:	return( new CTransaction );
+	case  3:	return( new CExecute_SQL );
+
+	case 10:	return( new CTable_List );
+	case  4:	return( new CTable_Info );
+	case  5:	return( new CTable_Load );
+	case  6:	return( new CTable_Save );
+	case  7:	return( new CTable_Drop );
+	case  8:	return( new CTable_Query );
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+extern "C" _SAGA_DLL_EXPORT bool MLB_Finalize	(void)
+{
+	return( SG_ODBC_Get_Connection_Manager().Destroy() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE_CORE MLB_INTERFACE_INITIALIZE
+
+//}}AFX_SAGA
diff --git a/src/modules/db/db_odbc/MLB_Interface.h b/src/modules/db/db_odbc/MLB_Interface.h
new file mode 100644
index 0000000..cfb5c92
--- /dev/null
+++ b/src/modules/db/db_odbc/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2004 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__db_odbc_H
+#define HEADER_INCLUDED__db_odbc_H
+
+//---------------------------------------------------------
+#include "odbc.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__db_odbc_H
diff --git a/src/modules/db/db_odbc/Makefile.am b/src/modules/db/db_odbc/Makefile.am
new file mode 100644
index 0000000..e562d1c
--- /dev/null
+++ b/src/modules/db/db_odbc/Makefile.am
@@ -0,0 +1,26 @@
+#
+# $Id: Makefile.am 1828 2013-09-05 21:36:10Z manfred-e $
+#
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_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        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = $(DEP_LFLG) $(DEP_LIBS) -shared -lodbc -avoid-version
+pkglib_LTLIBRARIES = libdb_odbc.la
+libdb_odbc_la_SOURCES =\
+get_connection.cpp\
+MLB_Interface.cpp\
+odbc.cpp\
+table.cpp\
+get_connection.h\
+MLB_Interface.h\
+odbc.h\
+otlv4.h\
+table.h
+
+libdb_odbc_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules/db/db_odbc/Makefile.in b/src/modules/db/db_odbc/Makefile.in
new file mode 100644
index 0000000..a59ce70
--- /dev/null
+++ b/src/modules/db/db_odbc/Makefile.in
@@ -0,0 +1,639 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/db/db_odbc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libdb_odbc_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libdb_odbc_la_OBJECTS = get_connection.lo MLB_Interface.lo odbc.lo \
+	table.lo
+libdb_odbc_la_OBJECTS = $(am_libdb_odbc_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libdb_odbc_la_SOURCES)
+DIST_SOURCES = $(libdb_odbc_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1828 2013-09-05 21:36:10Z manfred-e $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@DEP_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 = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = $(DEP_LFLG) $(DEP_LIBS) -shared -lodbc -avoid-version
+pkglib_LTLIBRARIES = libdb_odbc.la
+libdb_odbc_la_SOURCES = \
+get_connection.cpp\
+MLB_Interface.cpp\
+odbc.cpp\
+table.cpp\
+get_connection.h\
+MLB_Interface.h\
+odbc.h\
+otlv4.h\
+table.h
+
+libdb_odbc_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/db/db_odbc/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/db/db_odbc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libdb_odbc.la: $(libdb_odbc_la_OBJECTS) $(libdb_odbc_la_DEPENDENCIES) $(EXTRA_libdb_odbc_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libdb_odbc_la_OBJECTS) $(libdb_odbc_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_connection.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/odbc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/db/db_odbc/get_connection.cpp b/src/modules/db/db_odbc/get_connection.cpp
new file mode 100644
index 0000000..f73a1f8
--- /dev/null
+++ b/src/modules/db/db_odbc/get_connection.cpp
@@ -0,0 +1,523 @@
+/**********************************************************
+ * Version $Id: get_connection.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Get_Connection.cpp                  //
+//                                                       //
+//                 Copyright (C) 2008 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "get_connection.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGet_Servers::CGet_Servers(void)
+{
+	Set_Name		(_TL("List ODBC Servers"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Lists all ODBC sources."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "SERVERS"		, _TL("Server"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CONNECTED"	, _TL("Only List Connected Servers"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+//---------------------------------------------------------
+bool CGet_Servers::On_Execute(void)
+{
+	bool		bConnected	= Parameters("CONNECTED")->asBool();
+	CSG_Table	*pServers	= Parameters("SERVERS"  )->asTable();
+
+	pServers->Destroy();
+	pServers->Set_Name(_TL("ODBC Servers"));
+
+	pServers->Add_Field(_TL("Server")   , SG_DATATYPE_String);
+	pServers->Add_Field(_TL("Connected"), SG_DATATYPE_Int);
+
+	CSG_Strings	Servers;
+
+	if( SG_ODBC_Get_Connection_Manager().Get_Servers(Servers) > 0 )
+	{
+		for(int i=0; i<Servers.Get_Count(); i++)
+		{
+			if( !bConnected || SG_ODBC_Get_Connection_Manager().Get_Connection(Servers[i]) )
+			{
+				CSG_Table_Record	*pServer	= pServers->Add_Record();
+
+				pServer->Set_Value(0, Servers[i]);
+				pServer->Set_Value(1, SG_ODBC_Get_Connection_Manager().Get_Connection(Servers[i]) ? 1 : 0);
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGet_Connection::CGet_Connection(void)
+{
+	Set_Name		(_TL("Connect to ODBC Source"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Connects to an ODBC source."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "SERVER"		, _TL("Server"),
+		_TL(""),
+		_TL("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "USERNAME"	, _TL("User"),
+		_TL(""),
+		_TL("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "PASSWORD"	, _TL("Password"),
+		_TL(""),
+		SG_T(""), false, true
+	);
+}
+
+//---------------------------------------------------------
+bool CGet_Connection::On_Before_Execution(void)
+{
+	CSG_String	Servers;
+
+	if( SG_ODBC_Get_Connection_Manager().Get_Servers(Servers) > 0 )
+	{
+		Parameters("SERVER")->asChoice()->Set_Items(Servers);
+
+		return( true );
+	}
+
+	Message_Dlg(
+		_TW("No ODBC server available!\n"
+			"Set up an ODBC server first."),
+		_TL("ODBC Database Connection Error")
+	);
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CGet_Connection::On_Execute(void)
+{
+	CSG_String	Server, User, Password;
+
+	Server		= Parameters("SERVER"  )->asString();
+	User		= Parameters("USERNAME")->asString();
+	Password	= Parameters("PASSWORD")->asString();
+
+	if( SG_ODBC_Get_Connection_Manager().Add_Connection(Server, User, Password) )
+	{
+		Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("ODBC source connected")));
+
+		SG_UI_ODBC_Update(Server);
+
+		return( true );
+	}
+
+	Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not connect ODBC source")));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CDel_Connection::CDel_Connection(void)
+{
+	Set_Name		(_TL("Disconnect from ODBC Source"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Disconnects an ODBC source connection."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TRANSACT"	, _TL("Transactions"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("rollback"),
+			_TL("commit")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+bool CDel_Connection::On_Execute(void)
+{
+	CSG_String	Server	= Get_Connection()->Get_Server();
+
+	if( SG_ODBC_Get_Connection_Manager().Del_Connection(Get_Connection(), Parameters("TRANSACT")->asInt() == 1) )
+	{
+		Message_Add(Server + ": " + _TL("ODBC source disconnected"));
+
+		SG_UI_ODBC_Update(Server);
+
+		return( true );
+	}
+
+	Message_Add(Server + ": " + _TL("could not disconnect ODBC source"));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CDel_Connections::CDel_Connections(void)
+{
+	Set_Name		(_TL("Disconnect All"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Disconnects all connected ODBC sources."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TRANSACT"	, _TL("Transactions"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("rollback"),
+			_TL("commit")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+bool CDel_Connections::On_Before_Execution(void)
+{
+	CSG_String	Servers;
+
+	if( SG_ODBC_Get_Connection_Manager().Get_Connections(Servers) > 0 )
+	{
+		return( true );
+	}
+
+	Message_Dlg(
+		_TL("No ODBC connection available!"),
+		_TL("ODBC Database Connection Error")
+	);
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CDel_Connections::On_Execute(void)
+{
+	bool	bCommit	= Parameters("TRANSACT")->asInt() == 1;
+
+	CSG_ODBC_Connections	&Manager	= SG_ODBC_Get_Connection_Manager();
+
+	for(int i=Manager.Get_Count()-1; i>=0; i--)
+	{
+		Manager.Del_Connection(i, bCommit);
+	}
+
+	return( Manager.Get_Count() == 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTransaction::CTransaction(void)
+{
+	Set_Name		(_TL("Commit/Rollback Transaction"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Execute a commit or rollback on open transactions with ODBC source."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "SERVERS"		, _TL("Server"),
+		_TL(""),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TRANSACT"	, _TL("Transactions"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("rollback"),
+			_TL("commit")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+bool CTransaction::On_Before_Execution(void)
+{
+	CSG_String	Servers;
+
+	if( SG_ODBC_Get_Connection_Manager().Get_Connections(Servers) > 0 )
+	{
+		Parameters("SERVERS")->asChoice()->Set_Items(Servers);
+
+		return( true );
+	}
+
+	Message_Dlg(
+		_TL("No ODBC connection available!"),
+		_TL("ODBC Database Connection Error")
+	);
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CTransaction::On_Execute(void)
+{
+	CSG_String	Server;
+
+	Server	= Parameters("SERVERS") ->asString();
+
+	CSG_ODBC_Connection	*pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(Server);
+
+	if( !pConnection )
+	{
+		return( false );
+	}
+
+	if( Parameters("TRANSACT")->asInt() == 1 )
+	{
+		if( pConnection->Commit() )
+		{
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("open transactions committed")));
+
+			SG_UI_ODBC_Update(Server);
+
+			return( true );
+		}
+	}
+	else
+	{
+		if( pConnection->Rollback() )
+		{
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("open transactions rollbacked")));
+
+			SG_UI_ODBC_Update(Server);
+
+			return( true );
+		}
+	}
+
+	Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not commit/rollback transactions.")));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CExecute_SQL::CExecute_SQL(void)
+{
+	Set_Name		(_TL("Execute SQL"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Execute SQL commands on a connected ODBC source. "
+		"Separate different commands with a semicolon (\';\'). "
+	));
+
+	Parameters.Add_String(
+		NULL	, "SQL"			, _TL("SQL Statment"),
+		_TL(""),
+		SG_T("CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);\n")
+		SG_T("INSERT INTO myTable1 (Col1, Col2) VALUES(\'First Value\', 1);\n")
+		SG_T("DROP TABLE myTable1;\n"),
+		true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "COMMIT"		, _TL("Commit"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "STOP"		, _TL("Stop on Error"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+//---------------------------------------------------------
+bool CExecute_SQL::On_Execute(void)
+{
+	if( !Get_Connection() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	bool		bCommit	= Parameters("COMMIT")	->asBool  ();
+	bool		bStop	= Parameters("STOP")	->asBool  ();
+	CSG_String	SQL		= Parameters("SQL")		->asString();
+
+	//-----------------------------------------------------
+	if( SQL.Find(SG_T(';')) < 0 )
+	{
+		return( Get_Connection()->Execute(SQL, bCommit) );
+	}
+
+	//-----------------------------------------------------
+	int		nSuccess = 0, nErrors = 0;
+
+	SQL	+= SG_T(';');
+
+	do
+	{
+		CSG_String	s	= SQL.BeforeFirst(SG_T(';'));
+
+		s.Trim();
+
+		if( s.Length() > 0 )
+		{
+			Message_Add(s);
+
+			if( Get_Connection()->Execute(s, bCommit) )
+			{
+				nSuccess++;
+
+				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("okay")), false);
+			}
+			else
+			{
+				nErrors++;
+
+				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("failed")));
+
+				if( bStop )
+				{
+					return( false );
+				}
+			}
+		}
+
+		SQL	= SQL.AfterFirst(SG_T(';'));
+	}
+	while( SQL.Length() > 0 );
+
+	return( nErrors == 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_odbc/get_connection.h b/src/modules/db/db_odbc/get_connection.h
new file mode 100644
index 0000000..9df63b2
--- /dev/null
+++ b/src/modules/db/db_odbc/get_connection.h
@@ -0,0 +1,209 @@
+/**********************************************************
+ * Version $Id: get_connection.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Get_Connection.h                    //
+//                                                       //
+//                 Copyright (C) 2008 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Get_Connection_H
+#define HEADER_INCLUDED__Get_Connection_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGet_Servers : public CSG_Module
+{
+public:
+	CGet_Servers(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGet_Connection : public CSG_Module
+{
+public:
+	CGet_Connection(void);
+
+
+protected:
+
+	virtual bool				On_Before_Execution		(void);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CDel_Connection : public CSG_ODBC_Module
+{
+public:
+	CDel_Connection(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CDel_Connections : public CSG_Module
+{
+public:
+	CDel_Connections(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Before_Execution		(void);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTransaction : public CSG_ODBC_Module
+{
+public:
+	CTransaction(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Before_Execution		(void);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CExecute_SQL : public CSG_ODBC_Module
+{
+public:
+	CExecute_SQL(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Get_Connection_H
diff --git a/src/modules/db/db_odbc/odbc.cpp b/src/modules/db/db_odbc/odbc.cpp
new file mode 100644
index 0000000..f2f66d2
--- /dev/null
+++ b/src/modules/db/db_odbc/odbc.cpp
@@ -0,0 +1,1654 @@
+/**********************************************************
+ * Version $Id: saga_odbc.cpp 1513 2012-11-06 08:33:32Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       odbc.cpp                        //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "odbc.h"
+
+#include <stdio.h>
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+//---------------------------------------------------------
+#define OTL_ODBC_MULTI_MODE
+
+#if defined(_SAGA_LINUX)
+	#define OTL_ODBC_UNIX
+#endif
+
+#if !defined(_SAGA_LINUX) && !defined(_SAGA_MSW)
+	#define OTL_ODBC_ALTERNATE_RPC
+	#define OTL_UNICODE
+
+	#if defined(__GNUC__)
+		namespace std
+		{
+			typedef unsigned short unicode_char;
+			typedef basic_string<unicode_char> unicode_string;
+		}
+
+		#define OTL_UNICODE_CHAR_TYPE	unicode_char
+		#define OTL_UNICODE_STRING_TYPE	unicode_string
+	#else
+		#define OTL_UNICODE_CHAR_TYPE	wchar_t
+		#define OTL_UNICODE_STRING_TYPE	wstring
+	#endif
+
+	#define std_string	std::wstring
+#else
+	#if defined(_UNICODE) || defined(UNICODE)
+		#undef _UNICODE
+		#undef UNICODE
+	#endif
+
+	#define OTL_ANSI_CPP			// Turn on ANSI C++ typecasts
+	#define OTL_STL					// Turn on STL features
+	#define std_string	std::string
+#endif
+
+#if defined(UNICODE)
+	#define SG_ODBC_CHAR	wchar_t
+#else
+	#define SG_ODBC_CHAR	char
+#endif
+
+#include "otlv4.h"				// include the OTL 4 header file
+
+//---------------------------------------------------------
+#include <sql.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_ODBC_Connections	g_Connections;
+
+//---------------------------------------------------------
+CSG_ODBC_Connections &	SG_ODBC_Get_Connection_Manager(void)
+{
+	return( g_Connections );
+}
+
+//---------------------------------------------------------
+bool SG_ODBC_is_Supported(void)
+{
+	return( true );
+}
+
+//---------------------------------------------------------
+void _Error_Message(const CSG_String &Message, const CSG_String &Additional = SG_T(""))
+{
+	SG_UI_Msg_Add_Execution(Message, true, SG_UI_MSG_STYLE_FAILURE);
+
+	CSG_String	s(Message);
+
+	s	+= SG_T(":\n");
+
+	if( Additional.Length() > 0 )
+	{
+		s	+= Additional;
+		s	+= SG_T("\n");
+	}
+
+	SG_UI_Msg_Add_Error(s);
+}
+
+void _Error_Message(otl_exception &e)
+{
+	CSG_String	s;
+
+	if( e.stm_text && *e.stm_text != '\0' )
+	{
+		s	= (const char *)e.stm_text;
+
+		if( e.var_info && *e.var_info != '\0' )
+		{
+			s	+= SG_T(" [");
+			s	+= (const char *)e.var_info;
+			s	+= SG_T("]");
+		}
+	}
+
+	_Error_Message((const char *)e.msg, s);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define m_Connection	(*((otl_connect *)m_pConnection))
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_ODBC_Connection::CSG_ODBC_Connection(const CSG_String &Server, const CSG_String &User, const CSG_String &Password, bool bAutoCommit)
+{
+	CSG_String	s;
+
+	m_DBMS			= SG_ODBC_DBMS_Unknown;
+	m_Size_Buffer	= 1;
+	m_bAutoCommit	= bAutoCommit;
+
+	if( User.Length() > 0 )
+	{
+		s	+= SG_T("UID=") + User     + SG_T(";");
+		s	+= SG_T("PWD=") + Password + SG_T(";");
+	}
+
+	s	+= SG_T("DSN=") + Server   + SG_T(";");
+
+	m_pConnection	= new otl_connect();
+
+	try
+	{
+		m_Connection.rlogon(s, m_bAutoCommit ? 1 : 0);
+	}
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+	}
+
+	//-----------------------------------------------------
+	if( !m_Connection.connected )
+	{
+		delete(((otl_connect *)m_pConnection));
+
+		m_pConnection	= NULL;
+	}
+	else
+	{
+		m_DSN	= Server;
+
+		//-------------------------------------------------
+		s		= Get_DBMS_Name();
+
+		if(      !s.CmpNoCase(SG_T("PostgreSQL")) )
+		{
+			m_DBMS	= SG_ODBC_DBMS_PostgreSQL;
+		}
+		else if( !s.CmpNoCase(SG_T("MySQL")) )
+		{
+			m_DBMS	= SG_ODBC_DBMS_MySQL;
+		}
+		else if( !s.CmpNoCase(SG_T("Oracle")) )
+		{
+			m_DBMS	= SG_ODBC_DBMS_Oracle;
+		}
+		else if( !s.CmpNoCase(SG_T("MSQL")) )
+		{
+			m_DBMS	= SG_ODBC_DBMS_MSSQLServer;
+		}
+		else if( !s.CmpNoCase(SG_T("ACCESS")) )
+		{
+			m_DBMS	= SG_ODBC_DBMS_Access;
+		}
+
+		//-------------------------------------------------
+		Set_Size_Buffer(is_Access() ? 1 : 50);
+
+		Set_Size_LOB_Max(4 * 32767);
+	}
+}
+
+//---------------------------------------------------------
+CSG_ODBC_Connection::~CSG_ODBC_Connection(void)
+{
+	if( is_Connected() )
+	{
+		delete(((otl_connect *)m_pConnection));
+
+		m_pConnection	= NULL;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Set_Size_Buffer(int Size)
+{
+	if( Size > 0 )
+	{
+		m_Size_Buffer	= Size;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+int CSG_ODBC_Connection::Get_Size_LOB_Max(void)	const
+{
+	return( is_Connected() ? m_Connection.get_max_long_size() : 0 );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Set_Size_LOB_Max(int Size)
+{
+	if( is_Connected() && Size > 0 )
+	{
+		m_Connection.set_max_long_size(Size);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_ODBC_Connection::_Get_DBMS_Info(int What) const
+{
+	CSG_String	Result;
+
+	if( is_Connected() )
+	{
+		SQLSMALLINT	nBuffer;
+		SQLTCHAR	Buffer[256];
+
+		SQLGetInfo(m_Connection.get_connect_struct().get_hdbc(), What, (SQLPOINTER)Buffer, 255, &nBuffer);
+
+		Result	= (const SG_ODBC_CHAR *)Buffer;
+	}
+
+	return( Result );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_ODBC_Connection::Get_DBMS_Name(void) const
+{
+	return( _Get_DBMS_Info(SQL_DBMS_NAME) );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_ODBC_Connection::Get_DBMS_Version(void) const
+{
+	return( _Get_DBMS_Info(SQL_DBMS_VER) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_ODBC_Connection::Get_Tables(CSG_Strings &Tables) const
+{
+	Tables.Clear();
+
+	if( is_Connected() )
+	{
+		try
+		{
+			otl_stream	Stream(m_Size_Buffer, "$SQLTables", m_Connection);	// get a list of all tables in the current database.
+
+			while( !Stream.eof() )
+			{
+				std_string	Catalog, Schema, Table, Type, Remarks;
+
+				Stream >> Catalog >> Schema >> Table >> Type >> Remarks;
+
+				Tables	+= Table.c_str();
+			}
+		}
+		catch( otl_exception &e )
+		{
+			_Error_Message(e);
+		}
+	}
+
+	return( Tables.Get_Count() );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_ODBC_Connection::Get_Tables(void) const
+{
+	CSG_String	Tables;
+
+	if( is_Connected() )
+	{
+		try
+		{
+			otl_stream	Stream(m_Size_Buffer, "$SQLTables", m_Connection);	// get a list of all tables in the current database.
+
+			while( !Stream.eof() )
+			{
+				std_string	Catalog, Schema, Table, Type, Remarks;
+
+				Stream >> Catalog >> Schema >> Table >> Type >> Remarks;
+
+				Tables	+= Table.c_str();
+				Tables	+= SG_T("|");
+			}
+		}
+		catch( otl_exception &e )
+		{
+			_Error_Message(e);
+		}
+	}
+
+	return( Tables );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Exists(const CSG_String &Table_Name) const
+{
+	if( is_Connected() )
+	{
+		try
+		{
+			otl_stream	Stream(m_Size_Buffer, "$SQLTables", m_Connection);	// get a list of all tables in the current database.
+
+			while( !Stream.eof() )
+			{
+				std_string	Catalog, Schema, Table, Type, Remarks;
+
+				Stream >> Catalog >> Schema >> Table >> Type >> Remarks;
+
+				if( !Table_Name.Cmp(CSG_String(Table.c_str())) )
+				{
+					return( true );
+				}
+			}
+		}
+		catch( otl_exception &e )
+		{
+			_Error_Message(e);
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+CSG_Table CSG_ODBC_Connection::Get_Field_Desc(const CSG_String &Table_Name) const
+{
+	CSG_Table	Fields;
+
+	Fields.Set_Name(CSG_String::Format(SG_T("%s [%s]"), Table_Name.c_str(), _TL("Field Description")));
+
+	if( is_Connected() )
+	{
+		try
+		{
+			int				i, n;
+			std_string		s;
+			otl_column_desc	*desc;
+			otl_stream		Stream;
+
+			Stream.set_all_column_types(otl_all_num2str|otl_all_date2str);
+
+			Stream.open(m_Size_Buffer, CSG_String::Format(SG_T("$SQLColumns $3:'%s'"), Table_Name.c_str()), m_Connection);	// get a list of all columns.
+
+			desc	= Stream.describe_select(n);
+
+			for(i=0; i<n; i++)
+			{
+				Fields.Add_Field(CSG_String(desc[i].name), SG_DATATYPE_String);
+			}
+
+			while( !Stream.eof() )
+			{
+				CSG_Table_Record	*pField	= Fields.Add_Record();
+
+				for(i=0; i<n; i++)
+				{
+					Stream >> s;
+
+					pField->Set_Value(i, CSG_String(s.c_str()));
+				}
+			}
+		}
+		catch( otl_exception &e )
+		{
+			_Error_Message(e);
+		}
+	}
+
+	return( Fields );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_ODBC_Connection::Get_Field_Names(const CSG_String &Table_Name) const
+{
+	CSG_Table	Fields	= Get_Field_Desc(Table_Name);
+
+	CSG_String	Names;
+
+	for(int i=0; i<Fields.Get_Count(); i++)
+	{
+		Names	+= Fields[i].asString(3);
+		Names	+= SG_T("|");
+	}
+
+	return( Names );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_ODBC_Connection::_Get_Type_To_SQL(TSG_Data_Type Type)
+{
+	switch( Type )
+	{
+	case SG_DATATYPE_String:	return( otl_var_char   );		// strings
+
+	case SG_DATATYPE_Color:
+	case SG_DATATYPE_Char:
+	case SG_DATATYPE_Short:
+	case SG_DATATYPE_Int:
+	case SG_DATATYPE_Long:		return( otl_var_int    );		// non-floating point numbers
+
+	case SG_DATATYPE_Float:		return( otl_var_float  );		// 32-bit floating point numbers
+	case SG_DATATYPE_Double:	return( otl_var_double );		// 64-bit floating point numbers
+
+	case SG_DATATYPE_Date:		return( otl_var_char );			// dates
+
+	case SG_DATATYPE_Binary:	return( otl_var_varchar_long );	// binary
+	}
+
+	return( -1 );
+}
+
+//---------------------------------------------------------
+TSG_Data_Type CSG_ODBC_Connection::_Get_Type_From_SQL(int Type)
+{
+	switch( Type )
+	{
+	case otl_var_char:			return( SG_DATATYPE_String );	//  1 | null terminated string
+	case otl_var_short:			return( SG_DATATYPE_Short  );	//  6 | signed 16-bit integer
+	case otl_var_int:			return( SG_DATATYPE_Int    );	//  4 | signed 32-bit integer
+	case otl_var_unsigned_int:	return( SG_DATATYPE_DWord  );	//  5 | unsigned 32-bit integer
+	case otl_var_long_int:		return( SG_DATATYPE_Long   );	//  7 | signed 32-bit integer (for 32-bit, and LLP64 C++ compilers), signed 64-bit integer (for LP-64 C++ compilers)
+	case otl_var_bigint:		return( SG_DATATYPE_Long   );	// 20 | MS SQL Server, DB2, MySQL, PostgreSQL, etc. BIGINT (signed 64-bit integer) type
+	case otl_var_float:			return( SG_DATATYPE_Float  );	//  3 | 4-byte floating point number
+	case otl_var_double:		return( SG_DATATYPE_Double );	//  2 | 8-byte floating point number
+
+	case otl_var_db2date:		return( SG_DATATYPE_String );	// 17 | DB2 DATE data type
+	case otl_var_db2time:		return( SG_DATATYPE_String );	// 16 | DB2 TIME data type
+	case otl_var_ltz_timestamp:	return( SG_DATATYPE_String );	// 19 | Oracle 9i/10g/11g TIMESTAMP WITH LOCAL TIME ZONE type
+	case otl_var_timestamp:		return( SG_DATATYPE_String );	//  8 | data type that is mapped into Oracle date/timestamp, DB2 timestamp, MS SQL datetime/datetime2/time/date, Sybase timestamp, etc.
+	case otl_var_tz_timestamp:	return( SG_DATATYPE_String );	// 18 | Oracle timestamp with timezone type
+
+	case otl_var_varchar_long:	return( SG_DATATYPE_String );	//  9 | data type that is mapped into LONG in Oracle 7/8/9/10/11, TEXT in MS SQL Server and Sybase, CLOB in DB2
+	case otl_var_raw:			return( SG_DATATYPE_Binary );	// 23 | RAW, BINARY, VARBINARY, BYTEA, VARCHAR BYTE, CHAR BYTE, etc.
+	case otl_var_raw_long:		return( SG_DATATYPE_Binary );	// 10 | data type that is mapped into LONG RAW in Oracle, IMAGE in MS SQL Server and Sybase, BLOB in DB2
+	case otl_var_clob:			return( SG_DATATYPE_Binary );	// 11 | data type that is mapped into CLOB in Oracle 8/9/10/11
+	case otl_var_blob:			return( SG_DATATYPE_Binary );	// 12 | data type that is mapped into BLOB in Oracle 8/9/10/11
+	}
+
+	return( SG_DATATYPE_Undefined );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Execute(const CSG_String &SQL, bool bCommit)
+{
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	try
+	{
+		m_Connection.direct_exec(SQL);
+
+		return( bCommit ? Commit() : true );
+
+	//	if( m_Connection.direct_exec(SQL) >= 0 )
+	//	{
+	//		return( bCommit ? Commit() : true );
+	//	}
+
+	//	_Error_Message(_TL("sql excution error"), SQL);
+	}
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+void CSG_ODBC_Connection::Set_Auto_Commit(bool bOn)
+{
+	if( is_Connected() && m_bAutoCommit != bOn )
+	{
+		m_bAutoCommit	= bOn;
+
+		if( bOn )
+		{
+			m_Connection.auto_commit_on();
+		}
+		else
+		{
+			m_Connection.auto_commit_off();
+		}
+	}
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Commit(void)
+{
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	try
+	{
+		m_Connection.commit();
+
+		return( true );
+	}
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Rollback(void)
+{
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	try
+	{
+		m_Connection.rollback();
+
+		return( true );
+	}
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
+{
+	if( Table.Get_Field_Count() <= 0 )
+	{
+		_Error_Message(_TL("no attributes in table"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			iField;
+	CSG_String	SQL;
+
+	SQL.Printf(SG_T("CREATE TABLE \"%s\"("), Table_Name.c_str());
+
+	for(iField=0; iField<Table.Get_Field_Count(); iField++)
+	{
+		CSG_String	s;
+
+		switch( Table.Get_Field_Type(iField) )
+		{
+		default:
+		case SG_DATATYPE_String:
+			s	= CSG_String::Format(SG_T("VARCHAR(%d)"), Table.Get_Field_Length(iField));
+			break;
+
+		case SG_DATATYPE_Char:
+			s	= SG_T("SMALLINT");
+			break;
+
+		case SG_DATATYPE_Short:
+			s	= SG_T("SMALLINT");
+			break;
+
+		case SG_DATATYPE_Int:
+			s	= SG_T("INT");
+			break;
+
+		case SG_DATATYPE_Color:
+			s	= SG_T("INT");
+			break;
+
+		case SG_DATATYPE_Long:
+			s	= SG_T("INT");
+			break;
+
+		case SG_DATATYPE_Float:
+			s	= SG_T("FLOAT");
+			break;
+
+		case SG_DATATYPE_Double:
+			s	= is_PostgreSQL()	? SG_T("DOUBLE PRECISION")
+				: SG_T("DOUBLE");
+			break;
+
+		case SG_DATATYPE_Binary:
+			s	= is_PostgreSQL()	? SG_T("BYTEA")
+				: is_Access()		? SG_T("IMAGE")
+				: SG_T("VARBINARY");
+			break;
+		}
+
+		//-------------------------------------------------
+		char	Flag	= (int)Flags.Get_Size() == Table.Get_Field_Count() ? Flags[iField] : 0;
+
+		if( (Flag & SG_ODBC_PRIMARY_KEY) == 0 )
+		{
+			if( (Flag & SG_ODBC_UNIQUE) != 0 )
+			{
+				s	+= SG_T(" UNIQUE");
+			}
+
+			if( (Flag & SG_ODBC_NOT_NULL) != 0 )
+			{
+				s	+= SG_T(" NOT NULL");
+			}
+		}
+
+		//-------------------------------------------------
+		if( iField > 0 )
+		{
+			SQL	+= SG_T(", ");
+		}
+
+		SQL	+= CSG_String::Format(SG_T("%s %s"), Table.Get_Field_Name(iField), s.c_str());
+	}
+
+	//-----------------------------------------------------
+	if( (int)Flags.Get_Size() == Table.Get_Field_Count() )
+	{
+		CSG_String	s;
+
+		for(iField=0; iField<Table.Get_Field_Count(); iField++)
+		{
+			if( (Flags[iField] & SG_ODBC_PRIMARY_KEY) != 0 )
+			{
+				s	+= s.Length() == 0 ? SG_T(", PRIMARY KEY(") : SG_T(", ");
+				s	+= Table.Get_Field_Name(iField);
+			}
+		}
+
+		if( s.Length() > 0 )
+		{
+			SQL	+= s + SG_T(")");
+		}
+	}
+
+	//-----------------------------------------------------
+	SQL	+= SG_T(")");
+
+	//-----------------------------------------------------
+	return( Execute(SQL, bCommit) );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Drop(const CSG_String &Table_Name, bool bCommit)
+{
+	if( !Table_Exists(Table_Name) )
+	{
+		_Error_Message(_TL("database table does not exist"));
+
+		return( false );
+	}
+
+	return( Execute(CSG_String::Format(SG_T("DROP TABLE \"%s\""), Table_Name.c_str()), bCommit) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Table &Table, bool bCommit)
+{
+	//-----------------------------------------------------
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	if( !Table_Exists(Table_Name) )
+	{
+		return( false );
+	}
+
+	CSG_Table	Fields	= Get_Field_Desc(Table_Name);
+
+	if( Fields.Get_Count() != Table.Get_Field_Count() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	try
+	{
+		bool	bLOB	= false;
+
+		int				iField, iRecord;
+		CSG_String		Insert;
+		otl_stream		Stream;
+
+		//-------------------------------------------------
+		Insert.Printf(SG_T("INSERT INTO %s VALUES("), Table_Name.c_str());
+
+		for(iField=0; iField<Table.Get_Field_Count(); iField++)
+		{
+			if( iField > 0 )
+			{
+				Insert	+= SG_T(",");
+			}
+
+			Insert	+= CSG_String::Format(SG_T(":f%d"), 1 + iField);
+
+			switch( Table.Get_Field_Type(iField) )
+			{
+			default:
+			case SG_DATATYPE_String:	Insert	+= SG_T("<varchar>");	break;
+			case SG_DATATYPE_Date:		Insert	+= SG_T("<char[12]>");	break;
+			case SG_DATATYPE_Char:		Insert	+= SG_T("<char>");		break;
+			case SG_DATATYPE_Short:		Insert	+= SG_T("<short>");		break;
+			case SG_DATATYPE_Int:		Insert	+= SG_T("<int>");		break;
+			case SG_DATATYPE_Color:		Insert	+= SG_T("<long>");		break;
+			case SG_DATATYPE_Long:		Insert	+= SG_T("<long>");		break;
+			case SG_DATATYPE_Float:		Insert	+= SG_T("<float>");		break;
+			case SG_DATATYPE_Double:	Insert	+= SG_T("<double>");	break;
+			}
+		}
+
+		Insert	+= SG_T(")");
+
+		Stream.set_all_column_types(otl_all_date2str);
+		Stream.set_lob_stream_mode(bLOB);
+		Stream.open(bLOB ? 1 : m_Size_Buffer, Insert, m_Connection);
+
+		std_string	valString;
+
+		//-------------------------------------------------
+		for(iRecord=0; iRecord<Table.Get_Count() && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
+		{
+			CSG_Table_Record	*pRecord	= Table.Get_Record(iRecord);
+
+			for(iField=0; iField<Table.Get_Field_Count(); iField++)
+			{
+				if( pRecord->is_NoData(iField) )
+				{
+					Stream << otl_null();
+				}
+				else switch( Table.Get_Field_Type(iField) )
+				{
+				default:
+				case SG_DATATYPE_String:
+				case SG_DATATYPE_Date:
+					valString	= CSG_String(pRecord->asString(iField));
+					Stream << valString;
+					break;
+
+				case SG_DATATYPE_Char:		Stream << (char)pRecord->asChar  (iField);	break;
+				case SG_DATATYPE_Short:		Stream <<       pRecord->asShort (iField);	break;
+				case SG_DATATYPE_Int:		Stream <<       pRecord->asInt   (iField);	break;
+				case SG_DATATYPE_Color:
+				case SG_DATATYPE_Long:		Stream << (long)pRecord->asInt   (iField);	break;
+				case SG_DATATYPE_Float:		Stream <<       pRecord->asFloat (iField);	break;
+				case SG_DATATYPE_Double:	Stream <<       pRecord->asDouble(iField);	break;
+				}
+			}
+		}
+	}
+	//-----------------------------------------------------
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+
+		return( false );
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Save(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
+{
+	//-----------------------------------------------------
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	if( Table_Exists(Table_Name) && !Table_Drop(Table_Name, bCommit) )
+	{
+		return( false );
+	}
+
+	if( !Table_Create(Table_Name, Table, Flags, bCommit) )
+	{
+		return( false );
+	}
+
+	if( !Table_Insert(Table_Name, Table, bCommit) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::_Table_Load(CSG_Table &Table, const CSG_String &Select, const CSG_String &Name, bool bLOB)
+{
+	//-----------------------------------------------------
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	try
+	{
+		int				valInt, iField, nFields;
+		long			valLong;
+		float			valFloat;
+		double			valDouble;
+		std_string		valString;
+		otl_long_string	valRaw(m_Connection.get_max_long_size());
+		otl_column_desc	*Fields;
+		otl_stream		Stream;
+		CSG_Bytes		BLOB;
+
+		Stream.set_all_column_types	(otl_all_date2str);
+		Stream.set_lob_stream_mode	(bLOB);
+		Stream.open					(bLOB ? 1 : m_Size_Buffer, Select, m_Connection);
+
+		Fields	= Stream.describe_select(nFields);
+
+		if( Fields == NULL || nFields <= 0 )
+		{
+			_Error_Message(_TL("no fields in selection"));
+
+			return( false );
+		}
+
+		//-------------------------------------------------
+		Table.Destroy();
+		Table.Set_Name(Name);
+
+		for(iField=0; iField<nFields; iField++)
+		{
+			if( _Get_Type_From_SQL(Fields[iField].otl_var_dbtype) == SG_DATATYPE_Undefined )
+			{
+				return( false );
+			}
+
+			Table.Add_Field(Fields[iField].name, _Get_Type_From_SQL(Fields[iField].otl_var_dbtype));
+		}
+
+		//-------------------------------------------------
+		while( !Stream.eof() && SG_UI_Process_Get_Okay() )	// while not end-of-data
+		{
+			CSG_Table_Record	*pRecord	= Table.Add_Record();
+
+			for(iField=0; iField<nFields; iField++)
+			{
+				switch( Table.Get_Field_Type(iField) )
+				{
+				case SG_DATATYPE_String:	Stream >> valString; if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, CSG_String(valString.c_str()));	break;
+				case SG_DATATYPE_Short:			
+				case SG_DATATYPE_Int:		Stream >> valInt;    if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valInt);		break;
+				case SG_DATATYPE_DWord:
+				case SG_DATATYPE_Long:		Stream >> valLong;   if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valLong);		break;
+				case SG_DATATYPE_Float:		Stream >> valFloat;  if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valFloat);		break;
+				case SG_DATATYPE_Double:	Stream >> valDouble; if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valDouble);	break;
+				case SG_DATATYPE_Binary:	Stream >> valRaw;    if( Stream.is_null() ) pRecord->Set_NoData(iField); else
+					{
+						BLOB.Clear();
+
+						for(int i=0; i<valRaw.len(); i++)
+						{
+							BLOB.Add((BYTE)valRaw[i]);
+						}
+
+						pRecord->Set_Value(iField, BLOB);
+					}
+					break;
+				}
+			}
+		}
+	}
+	//-----------------------------------------------------
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+
+		return( false );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Load(CSG_Table &Table, const CSG_String &Table_Name, bool bLOB)
+{
+	return( _Table_Load(Table, CSG_String::Format(SG_T("SELECT * FROM \"%s\""), Table_Name.c_str()), Table_Name, bLOB) );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Load(CSG_Table &Table, const CSG_String &Tables, const CSG_String &Fields, const CSG_String &Where, const CSG_String &Group, const CSG_String &Having, const CSG_String &Order, bool bDistinct, bool bLOB)
+{
+	CSG_String	Select;
+
+	Select.Printf(SG_T("SELECT %s %s FROM %s"), bDistinct ? SG_T("DISTINCT") : SG_T("ALL"), Fields.c_str(), Tables.c_str());
+
+	if( Where.Length() )
+	{
+		Select	+= SG_T(" WHERE ") + Where;
+	}
+
+	if( Group.Length() )
+	{
+		Select	+= SG_T(" GROUP BY ") + Group;
+
+		if( Having.Length() )
+		{
+			Select	+= SG_T(" HAVING ") + Having;
+		}
+	}
+
+	if( Order.Length() )
+	{
+		Select	+= SG_T(" ORDER BY ") + Order;
+	}
+
+	return( _Table_Load(Table, Select, Table.Get_Name(), bLOB) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connection::Table_Load_BLOBs(CSG_Bytes_Array &BLOBs, const CSG_String &Table_Name, const CSG_String &Field, const CSG_String &Where, const CSG_String &Order)
+{
+	//-----------------------------------------------------
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	try
+	{
+		bool			bLOB	= true;
+		int				nFields;
+		otl_column_desc	*Fields;
+		otl_long_string	valRaw(m_Connection.get_max_long_size());
+		otl_stream		Stream;
+		CSG_String		Select;
+
+		//-------------------------------------------------
+		Select.Printf(SG_T("SELECT %s FROM %s"), Field.c_str(), Table_Name.c_str());
+
+		if( Where.Length() )
+		{
+			Select	+= SG_T(" WHERE ") + Where;
+		}
+
+		if( Order.Length() )
+		{
+			Select	+= SG_T(" ORDER BY ") + Order;
+		}
+
+		//-------------------------------------------------
+		Stream.set_lob_stream_mode	(bLOB);
+		Stream.open					(bLOB ? 1 : m_Size_Buffer, Select, m_Connection);
+
+		Fields	= Stream.describe_select(nFields);
+
+		if( Fields == NULL || nFields <= 0 )
+		{
+			_Error_Message(_TL("no fields in selection"));
+
+			return( false );
+		}
+
+		if( nFields != 1 )
+		{
+			_Error_Message(_TL("more than one field in selection"));
+
+			return( false );
+		}
+
+		if( _Get_Type_From_SQL(Fields[0].otl_var_dbtype) != SG_DATATYPE_Binary )//|| _Get_Type_From_SQL(Fields[0].otl_var_dbtype) != SG_DATATYPE_String )
+		{
+			_Error_Message(_TL("field cannot be mapped to binary object"));
+
+			return( false );
+		}
+
+		//-------------------------------------------------
+		BLOBs.Destroy();
+
+		while( !Stream.eof() && SG_UI_Process_Get_Okay() )	// while not end-of-data
+		{
+			CSG_Bytes	*pBLOB	= BLOBs.Add();
+
+			Stream >> valRaw;
+
+			if( !Stream.is_null() )
+			{
+				for(int i=0; i<valRaw.len(); i++)
+				{
+					pBLOB->Add((BYTE)valRaw[i]);
+				}
+			}
+		}
+	}
+	//-----------------------------------------------------
+	catch( otl_exception &e )
+	{
+		_Error_Message(e);
+
+		return( false );
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_ODBC_Connections::CSG_ODBC_Connections(void)
+{
+	otl_connect::otl_initialize(); // initialize ODBC environment
+
+	m_hEnv			= SQL_NULL_HENV;
+	m_nConnections	= 0;
+	m_pConnections	= NULL;
+
+	Create();
+}
+
+//---------------------------------------------------------
+CSG_ODBC_Connections::~CSG_ODBC_Connections(void)
+{
+	Destroy();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connections::Create(void)
+{
+	Destroy();
+
+#if ODBCVER >= 0x0300
+	SQLRETURN	r	= SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_hEnv);
+#else
+	SQLRETURN	r	= SQLAllocEnv(&henv_);
+#endif
+
+	if( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO )
+	{
+		SG_UI_Msg_Add_Error(SG_T("Failed to allocate environment handle"));
+
+		return( false );
+	}
+
+#if ODBCVER >= 0x0300
+	// this should immediately follow an AllocEnv per ODBC3
+	SQLSetEnvAttr(m_hEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_UINTEGER);
+#endif
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connections::Destroy(void)
+{
+	if( m_pConnections )
+	{
+		for(int i=0; i<m_nConnections; i++)
+		{
+			delete(m_pConnections[i]);
+		}
+
+		SG_Free(m_pConnections);
+
+		m_nConnections	= 0;
+		m_pConnections	= NULL;
+	}
+
+	if( m_hEnv != SQL_NULL_HENV )
+	{
+#if ODBCVER >= 0x0300
+		SQLRETURN	r	= SQLFreeHandle(SQL_HANDLE_ENV, m_hEnv);
+#else
+		SQLRETURN	r	= SQLFreeEnv(m_hEnv);
+#endif
+
+		if( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO )
+		{
+			SG_UI_Msg_Add_Error(SG_T("Failed to close ODBC connection."));
+		}
+
+		m_hEnv	= SQL_NULL_HENV;
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_ODBC_Connection * CSG_ODBC_Connections::Add_Connection(const CSG_String &Server, const CSG_String &User, const CSG_String &Password)
+{
+	CSG_ODBC_Connection	*pConnection	= new CSG_ODBC_Connection(Server, User, Password);
+
+	if( pConnection )
+	{
+		if( pConnection->is_Connected() )
+		{
+			m_pConnections	= (CSG_ODBC_Connection **)SG_Realloc(m_pConnections, (m_nConnections + 1) * sizeof(CSG_ODBC_Connection *));
+
+			m_pConnections[m_nConnections++]	= pConnection;
+		}
+		else
+		{
+			delete(pConnection);
+
+			pConnection	= NULL;
+		}
+	}
+
+	return( pConnection );
+}
+
+//---------------------------------------------------------
+CSG_ODBC_Connection *  CSG_ODBC_Connections::Get_Connection(const CSG_String &Server)
+{
+	for(int i=0; i<m_nConnections; i++)
+	{
+		if( m_pConnections[i]->Get_Server().Cmp(Server) == 0 )
+		{
+			return( m_pConnections[i] );
+		}
+	}
+
+	return( NULL );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Connections::Del_Connection(int Index, bool bCommit)
+{
+	if( Index >= 0 && Index < m_nConnections )
+	{
+		if( bCommit )
+		{
+			m_pConnections[Index]->Commit();
+		}
+		else
+		{
+			m_pConnections[Index]->Rollback();
+		}
+
+		delete(m_pConnections[Index]);
+
+		for(m_nConnections--; Index<m_nConnections; Index++)
+		{
+			m_pConnections[Index]	= m_pConnections[Index + 1];
+		}
+
+		m_pConnections	= (CSG_ODBC_Connection **)SG_Realloc(m_pConnections, m_nConnections * sizeof(CSG_ODBC_Connection *));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+bool CSG_ODBC_Connections::Del_Connection(const CSG_String &Server, bool bCommit)
+{
+	for(int i=0; i<m_nConnections; i++)
+	{
+		if( m_pConnections[i]->Get_Server().Cmp(Server) == 0 )
+		{
+			return( Del_Connection(i, bCommit) );
+		}
+	}
+
+	return( false );
+}
+
+bool CSG_ODBC_Connections::Del_Connection(CSG_ODBC_Connection *pConnection, bool bCommit)
+{
+	return( !pConnection ? false : Del_Connection(pConnection->Get_Server(), bCommit) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Strings CSG_ODBC_Connections::Get_Servers(void)
+{
+	CSG_Strings	Servers;
+
+	SQLRETURN	r;
+	SQLSMALLINT	dsnlen, dsclen;
+	SQLTCHAR	dsn[SQL_MAX_DSN_LENGTH + 1], dsc[256];
+
+	r	= SQLDataSources(m_hEnv, SQL_FETCH_FIRST,
+			(SQLTCHAR *)dsn, SQL_MAX_DSN_LENGTH + 1, &dsnlen,
+			(SQLTCHAR *)dsc, 256,                    &dsclen
+		);
+
+	if( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO )
+	{
+		SG_UI_Msg_Add_Error(SG_T("Unable to retrieve data source names!"));
+	}
+	else
+	{
+		do
+		{
+			Servers	+= CSG_String((const SG_ODBC_CHAR *)dsn);
+
+			r	= SQLDataSources(m_hEnv, SQL_FETCH_NEXT,
+					(SQLTCHAR *)dsn, SQL_MAX_DSN_LENGTH + 1, &dsnlen,
+					(SQLTCHAR *)dsc, 256,                    &dsclen
+				);
+		}
+		while( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO );
+	}
+
+	return( Servers );
+}
+
+//---------------------------------------------------------
+int CSG_ODBC_Connections::Get_Servers(CSG_Strings &Servers)
+{
+	Servers	= Get_Servers();
+
+	return( Servers.Get_Count() );
+}
+
+//---------------------------------------------------------
+int CSG_ODBC_Connections::Get_Servers(CSG_String &Servers)
+{
+	CSG_Strings		s	= Get_Servers();
+
+	for(int i=0; i<s.Get_Count(); i++)
+	{
+		Servers	+= s[i] + SG_T("|");
+	}
+
+	return( s.Get_Count() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Strings CSG_ODBC_Connections::Get_Connections(void)
+{
+	CSG_Strings		Connections;
+
+	for(int i=0; i<m_nConnections; i++)
+	{
+		Connections.Add(m_pConnections[i]->Get_Server());
+	}
+
+	return( Connections );
+}
+
+//---------------------------------------------------------
+int CSG_ODBC_Connections::Get_Connections(CSG_String &Connections)
+{
+	CSG_Strings		s	= Get_Connections();
+
+	Connections.Clear();
+
+	for(int i=0; i<s.Get_Count(); i++)
+	{
+		Connections	+= CSG_String::Format(SG_T("%s|"), s[i].c_str());
+	}
+
+	return( s.Get_Count() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_ODBC_Module::CSG_ODBC_Module(void)
+{
+	if( !SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_String(
+			NULL	, "ODBC_DSN"	, _TL("DSN"),
+			_TL("Data Source Name"),
+			SG_T("")
+		);
+
+		Parameters.Add_String(
+			NULL	, "ODBC_USR"	, _TL("User"),
+			_TL("User Name"),
+			SG_T("")
+		);
+
+		Parameters.Add_String(
+			NULL	, "ODBC_PWD"	, _TL("Password"),
+			_TL("Password"),
+			SG_T("")
+		);
+	}
+	else
+	{
+		Parameters.Add_Choice(
+			NULL	, "CONNECTION"	, _TL("Server Connection"),
+			_TL(""),
+			""
+		);
+	}
+
+	m_pConnection	= NULL;
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Module::On_Before_Execution(void)
+{
+	m_pConnection	= NULL;
+
+	if( !SG_UI_Get_Window_Main() )
+	{
+		m_pConnection	= SG_ODBC_Get_Connection_Manager().Add_Connection(
+			Parameters("ODBC_DSN")->asString(),
+			Parameters("ODBC_USR")->asString(),
+			Parameters("ODBC_PWD")->asString()
+		);
+
+		if( m_pConnection == NULL )
+		{
+			Message_Dlg(
+				_TL("No ODBC connection available!"),
+				_TL("ODBC Database Connection Error")
+			);
+
+			return( false );
+		}
+	}
+	else
+	{
+		CSG_String	Connections;
+
+		int	nConnections	= SG_ODBC_Get_Connection_Manager().Get_Connections(Connections);
+
+		if( nConnections <= 0 )
+		{
+			Message_Dlg(
+				_TL("No ODBC connection available!"),
+				_TL("ODBC Database Connection Error")
+			);
+
+			return( false );
+		}
+
+		if( nConnections == 1 )
+		{
+			m_pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(0);
+		}
+
+		Parameters("CONNECTION")->asChoice()->Set_Items(Connections);
+		Parameters("CONNECTION")->Set_Enabled(nConnections > 1);
+
+		if( !(m_pConnection = SG_ODBC_Get_Connection_Manager().Get_Connection(Parameters("CONNECTION")->asString())) )
+		{
+			m_pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(0);
+		}
+
+		On_Parameter_Changed(&Parameters, Parameters("CONNECTION"));
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_ODBC_Module::On_After_Execution(void)
+{
+	if( !SG_UI_Get_Window_Main() )
+	{
+		SG_ODBC_Get_Connection_Manager().Del_Connection(m_pConnection, true);
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int CSG_ODBC_Module::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( SG_UI_Get_Window_Main() && !SG_STR_CMP(pParameter->Get_Identifier(), "CONNECTION") )
+	{
+		m_pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(pParameter->asString());
+
+		if( m_pConnection )
+		{
+			On_Connection_Changed(pParameters);
+		}
+	}
+
+	return( -1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_ODBC_Module::Set_Constraints(CSG_Parameters *pParameters, CSG_Table *pTable)
+{
+	if( !pParameters || !pTable )
+	{
+		return( false );
+	}
+
+	pParameters->Del_Parameters();
+
+	if( pTable )
+	{
+		CSG_Parameter	*pP	= pParameters->Add_Node(NULL, "P", _TL("Primary key)")	, _TL(""));
+		CSG_Parameter	*pN	= pParameters->Add_Node(NULL, "N", _TL("Not Null")		, _TL(""));
+		CSG_Parameter	*pU	= pParameters->Add_Node(NULL, "U", _TL("Unique")		, _TL(""));
+
+		for(int i=0; i<pTable->Get_Field_Count(); i++)
+		{
+			pParameters->Add_Value(pP, CSG_String::Format(SG_T("P%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
+			pParameters->Add_Value(pN, CSG_String::Format(SG_T("N%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
+			pParameters->Add_Value(pU, CSG_String::Format(SG_T("U%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+CSG_Buffer CSG_ODBC_Module::Get_Constraints(CSG_Parameters *pParameters, CSG_Table *pTable)
+{
+	CSG_Buffer	Flags;
+
+	if( pParameters )
+	{
+		int		nFields	= pTable ? pTable->Get_Field_Count() : (pParameters->Get_Count() - 3) / 3;
+
+		if( nFields * 3 + 3 == pParameters->Get_Count() )
+		{
+			for(int i=0; i<nFields; i++)
+			{
+				char	Flag	= 0;
+
+				if( pParameters->Get_Parameter(CSG_String::Format(SG_T("P%d"), i))->asBool() )
+				{
+					Flag	|= SG_ODBC_PRIMARY_KEY;
+				}
+
+				if( pParameters->Get_Parameter(CSG_String::Format(SG_T("N%d"), i))->asBool() )
+				{
+					Flag	|= SG_ODBC_NOT_NULL;
+				}
+
+				if( pParameters->Get_Parameter(CSG_String::Format(SG_T("U%d"), i))->asBool() )
+				{
+					Flag	|= SG_ODBC_UNIQUE;
+				}
+
+				Flags	+= Flag;
+			}
+		}
+	}
+
+	return( Flags );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_odbc/odbc.h b/src/modules/db/db_odbc/odbc.h
new file mode 100644
index 0000000..b80dfdd
--- /dev/null
+++ b/src/modules/db/db_odbc/odbc.h
@@ -0,0 +1,291 @@
+/**********************************************************
+ * Version $Id: saga_odbc.h 1507 2012-10-31 18:49:02Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      saga_odbc.h                      //
+//                                                       //
+//                 Copyright (C) 2010 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__saga_odbc_H
+#define HEADER_INCLUDED__saga_odbc_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+#ifdef db_odbc_EXPORTS
+	#define	db_odbc_EXPORT	_SAGA_DLL_EXPORT
+#else
+	#define	db_odbc_EXPORT	_SAGA_DLL_IMPORT
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SG_ODBC_PRIMARY_KEY		0x01
+#define SG_ODBC_NOT_NULL		0x02
+#define SG_ODBC_UNIQUE			0x04
+
+//---------------------------------------------------------
+typedef enum ESG_ODBC_DBMS
+{
+	SG_ODBC_DBMS_PostgreSQL,
+	SG_ODBC_DBMS_MySQL,
+	SG_ODBC_DBMS_Oracle,
+	SG_ODBC_DBMS_MSSQLServer,
+	SG_ODBC_DBMS_Access,
+	SG_ODBC_DBMS_Unknown
+}
+TSG_ODBC_DBMS;
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class db_odbc_EXPORT CSG_ODBC_Connection
+{
+	friend class CSG_ODBC_Connections;
+
+public:
+
+	bool						is_Connected			(void)	const	{	return( m_pConnection != NULL );	}
+
+	void						Set_Auto_Commit			(bool bOn);
+	bool						Get_Auto_Commit			(void)	const	{	return( m_bAutoCommit );	}
+
+	int							Get_Size_Buffer			(void)	const	{	return( m_Size_Buffer );	}
+	bool						Set_Size_Buffer			(int Size);
+
+	int							Get_Size_LOB_Max		(void)	const;
+	bool						Set_Size_LOB_Max		(int Size);
+
+	CSG_String					Get_DBMS_Name			(void)	const;
+	CSG_String					Get_DBMS_Version		(void)	const;
+	TSG_ODBC_DBMS				Get_DBMS				(void)	const	{	return( m_DBMS );	}
+
+	bool						is_PostgreSQL			(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_PostgreSQL  );	}
+	bool						is_MySQL				(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_MySQL       );	}
+	bool						is_Oracle				(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_Oracle      );	}
+	bool						is_MSSQLServer			(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_MSSQLServer );	}
+	bool						is_Access				(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_Access      );	}
+
+	CSG_String					Get_Server				(void)	const	{	return( m_DSN );	}
+
+	int							Get_Tables				(CSG_Strings &Tables)			const;
+	CSG_String					Get_Tables				(void)							const;
+	CSG_String					Get_Field_Names			(const CSG_String &Table_Name)	const;
+	CSG_Table					Get_Field_Desc			(const CSG_String &Table_Name)	const;
+
+	bool						Execute					(const CSG_String &SQL, bool bCommit = false);
+	bool						Commit					(void);
+	bool						Rollback				(void);
+
+	bool						Table_Exists			(const CSG_String &Table_Name)	const;
+
+	bool						Table_Create			(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
+	bool						Table_Drop				(const CSG_String &Table_Name                                                     , bool bCommit = true);
+	bool						Table_Insert			(const CSG_String &Table_Name, const CSG_Table &Table                             , bool bCommit = true);
+	bool						Table_Save				(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
+
+	bool						Table_Load				(CSG_Table &Table      , const CSG_String &Table_Name , bool bLOB = false);
+	bool						Table_Load				(CSG_Table &Table      , const CSG_String &Table_Names, const CSG_String &Fields, const CSG_String &Where = SG_T(""), const CSG_String &Group = SG_T(""), const CSG_String &Having = SG_T(""), const CSG_String &Order = SG_T(""), bool bDistinct = false, bool bLOB = false);
+	bool						Table_Load_BLOBs		(CSG_Bytes_Array &BLOBs, const CSG_String &Table_Name , const CSG_String &Field , const CSG_String &Where = SG_T(""), const CSG_String &Order = SG_T(""));
+
+
+
+private:
+
+	CSG_ODBC_Connection(const CSG_String &Server, const CSG_String &User, const CSG_String &Password, bool bAutoCommit = false);
+	virtual ~CSG_ODBC_Connection(void);
+
+
+	TSG_ODBC_DBMS				m_DBMS;
+
+	bool						m_bAutoCommit;
+
+	int							m_Size_Buffer;
+
+	void						*m_pConnection;
+
+	CSG_String					m_DSN;
+
+
+	CSG_String					_Get_DBMS_Info			(int What)	const;
+
+	int							_Get_Type_To_SQL		(TSG_Data_Type Type);
+	TSG_Data_Type				_Get_Type_From_SQL		(int Type);
+
+	bool						_Table_Load				(CSG_Table &Table, const CSG_String &Select, const CSG_String &Name, bool bLOB);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class db_odbc_EXPORT CSG_ODBC_Connections
+{
+public:
+	CSG_ODBC_Connections(void);
+	virtual ~CSG_ODBC_Connections(void);
+
+	bool						Create					(void);
+	bool						Destroy					(void);
+
+	int							Get_Servers				(CSG_String  &Servers);
+	int							Get_Servers				(CSG_Strings &Servers);
+	CSG_Strings					Get_Servers				(void);
+
+	int							Get_Connections			(CSG_String &Connections);
+	CSG_Strings					Get_Connections			(void);
+
+	int							Get_Count				(void)		{	return( m_nConnections );	}
+	CSG_ODBC_Connection *		Get_Connection			(int Index)	{	return( Index >= 0 && Index < m_nConnections ? m_pConnections[Index] : NULL );	}
+	CSG_ODBC_Connection *		Get_Connection			(const CSG_String &Server);
+	CSG_ODBC_Connection *		Add_Connection			(const CSG_String &Server, const CSG_String &User, const CSG_String &Password);
+	bool						Del_Connection			(int Index                       , bool bCommit);
+	bool						Del_Connection			(const CSG_String &Server        , bool bCommit);
+	bool						Del_Connection			(CSG_ODBC_Connection *pConnection, bool bCommit);
+
+
+private:
+
+	void						*m_hEnv;
+
+	int							m_nConnections;
+
+	CSG_ODBC_Connection			**m_pConnections;
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class db_odbc_EXPORT CSG_ODBC_Module : public CSG_Module
+{
+public:
+	CSG_ODBC_Module(void);
+
+
+protected:
+
+	virtual bool				On_Before_Execution		(void);
+	virtual bool				On_After_Execution		(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters)	{}
+
+	CSG_ODBC_Connection *		Get_Connection			(void)	{	return( m_pConnection );	}
+
+	static bool					Set_Constraints			(CSG_Parameters *pParameters, CSG_Table *pTable);
+	static CSG_Buffer			Get_Constraints			(CSG_Parameters *pParameters, CSG_Table *pTable);
+
+
+private:
+
+	CSG_ODBC_Connection			*m_pConnection;
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+db_odbc_EXPORT CSG_ODBC_Connections &	SG_ODBC_Get_Connection_Manager	(void);
+
+//---------------------------------------------------------
+db_odbc_EXPORT bool						SG_ODBC_is_Supported			(void);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__saga_odbc_H
diff --git a/src/modules_io/db/io_odbc/otlv4.h b/src/modules/db/db_odbc/otlv4.h
similarity index 100%
rename from src/modules_io/db/io_odbc/otlv4.h
rename to src/modules/db/db_odbc/otlv4.h
diff --git a/src/modules/db/db_odbc/table.cpp b/src/modules/db/db_odbc/table.cpp
new file mode 100644
index 0000000..c22d171
--- /dev/null
+++ b/src/modules/db/db_odbc/table.cpp
@@ -0,0 +1,476 @@
+/**********************************************************
+ * Version $Id: table.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       Table.cpp                       //
+//                                                       //
+//                 Copyright (C) 2008 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "get_connection.h"
+
+#include "table.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_List::CTable_List(void)
+{
+	Set_Name		(_TL("List Tables"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Lists all tables of an ODBC data source."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+//---------------------------------------------------------
+bool CTable_List::On_Execute(void)
+{
+	CSG_Table	*pTables	= Parameters("TABLES")->asTable();
+
+	pTables->Destroy();
+	pTables->Set_Name(_TL("Tables"));
+
+	pTables->Add_Field(_TL("Table"), SG_DATATYPE_String);
+
+	if( Get_Connection() )
+	{
+		CSG_Strings	Tables;
+
+		Get_Connection()->Get_Tables(Tables);
+
+		for(int i=0; i<Tables.Get_Count(); i++)
+		{
+			CSG_Table_Record	*pTable	= pTables->Add_Record();
+
+			pTable->Set_Value(0, Tables[i]);
+		}
+
+		pTables->Set_Name(Get_Connection()->Get_Server() + " [" + _TL("Tables") + "]");
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Info::CTable_Info(void)
+{
+	Set_Name		(_TL("List Table Fields"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Loads table information from ODBC data source."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Field Description"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CTable_Info::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
+
+	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
+	pParameter->Set_Value(pParameter->asString());
+}
+
+//---------------------------------------------------------
+bool CTable_Info::On_Execute(void)
+{
+	CSG_String	Table	= Parameters("TABLES")->asString();
+	CSG_Table	*pTable	= Parameters("TABLE" )->asTable();
+
+	CSG_Table tab = Get_Connection()->Get_Field_Desc(Table);
+	pTable->Assign(&tab);
+	pTable->Set_Name(Table + " [" + _TL("Field Description") + "]");
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Load::CTable_Load(void)
+{
+	Set_Name		(_TL("Import Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Imports a table from a database via ODBC."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Table"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CTable_Load::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
+
+	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
+	pParameter->Set_Value(pParameter->asString());
+}
+
+//---------------------------------------------------------
+bool CTable_Load::On_Execute(void)
+{
+	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
+
+	return( Get_Connection()->Table_Load(*pTable, Parameters("TABLES")->asString()) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Save::CTable_Save(void)
+{
+	Set_Name		(_TL("Export Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Exports a table to a database via ODBC."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Table"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_String(
+		NULL	, "NAME"		, _TL("Table Name"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_Parameters(
+		NULL	, "FLAGS"		, _TL("Constraints"),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "EXISTS"		, _TL("If table exists..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("abort export"),
+			_TL("replace existing table"),
+			_TL("append records, if table structure allows")
+		), 0
+	);
+}
+
+//---------------------------------------------------------
+int CTable_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) )
+	{
+		pParameters->Get_Parameter("NAME")->Set_Value(pParameter->asTable() ? pParameter->asTable()->Get_Name() : SG_T(""));
+
+		Set_Constraints(pParameters->Get_Parameter("FLAGS")->asParameters(), pParameter->asTable());
+	}
+
+	return( CSG_ODBC_Module::On_Parameter_Changed(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+bool CTable_Save::On_Execute(void)
+{
+	bool		bResult	= false;
+	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
+	CSG_String	Name	= Parameters("NAME" )->asString();	if( Name.Length() == 0 )	Name	= pTable->Get_Name();
+
+	//-----------------------------------------------------
+	if( Get_Connection()->Table_Exists(Name) )
+	{
+		Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Name.c_str()));
+
+		switch( Parameters("EXISTS")->asInt() )
+		{
+		case 0:	// abort export
+			break;
+
+		case 1:	// replace existing table
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("dropping table"), Name.c_str()));
+
+			if( !Get_Connection()->Table_Drop(Name, false) )
+			{
+				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
+			}
+			else
+			{
+				bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(Parameters("FLAGS")->asParameters(), pTable));
+			}
+			break;
+
+		case 2:	// append records, if table structure allows
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("appending to existing table"), Name.c_str()));
+
+			if( !(bResult = Get_Connection()->Table_Insert(Name, *pTable)) )
+			{
+				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
+			}
+			break;
+		}
+	}
+	else
+	{
+		bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(Parameters("FLAGS")->asParameters(), pTable));
+	}
+
+	//-----------------------------------------------------
+	if( bResult )
+	{
+		SG_UI_ODBC_Update(Get_Connection()->Get_Server());
+	}
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Drop::CTable_Drop(void)
+{
+	Set_Name		(_TL("Drop Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Deletes a table from a database via ODBC."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CTable_Drop::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
+
+	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
+	pParameter->Set_Value(pParameter->asString());
+}
+
+//---------------------------------------------------------
+bool CTable_Drop::On_Execute(void)
+{
+	if( Get_Connection()->Table_Drop(Parameters("TABLES")->asChoice()->asString()) )
+	{
+		SG_UI_ODBC_Update(Get_Connection()->Get_Server());
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Query::CTable_Query(void)
+{
+	CSG_Parameter	*pNode;
+
+	Set_Name		(_TL("Import Table from SQL Query"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Import a SQL table from a database via ODBC."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Table from SQL Query"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_String(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "FIELDS"		, _TL("Fields"),
+		_TL(""),
+		SG_T("*")
+	);
+
+	Parameters.Add_String(
+		NULL	, "WHERE"		, _TL("Where"),
+		_TL(""),
+		SG_T("")
+	);
+
+	pNode	= Parameters.Add_String(
+		NULL	, "GROUP"		, _TL("Group by"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_String(
+		pNode	, "HAVING"		, _TL("Having"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "ORDER"		, _TL("Order by"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTINCT"	, _TL("Distinct"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+//---------------------------------------------------------
+bool CTable_Query::On_Execute(void)
+{
+	CSG_Table	*pTable		= Parameters("TABLE"   )->asTable ();
+	CSG_String	Tables		= Parameters("TABLES"  )->asString();
+	CSG_String	Fields		= Parameters("FIELDS"  )->asString();
+	CSG_String	Where		= Parameters("WHERE"   )->asString();
+	CSG_String	Group		= Parameters("GROUP"   )->asString();
+	CSG_String	Having		= Parameters("HAVING"  )->asString();
+	CSG_String	Order		= Parameters("ORDER"   )->asString();
+	bool		bDistinct	= Parameters("DISTINCT")->asBool  ();
+
+	return( Get_Connection()->Table_Load(*pTable, Tables, Fields, Where, Group, Having, Order, bDistinct) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_odbc/table.h b/src/modules/db/db_odbc/table.h
new file mode 100644
index 0000000..83b7034
--- /dev/null
+++ b/src/modules/db/db_odbc/table.h
@@ -0,0 +1,215 @@
+/**********************************************************
+ * Version $Id: table.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        db_odbc                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       Table.h                         //
+//                                                       //
+//                 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:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Table_H
+#define HEADER_INCLUDED__Table_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_List : public CSG_ODBC_Module
+{
+public:
+	CTable_List(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Info : public CSG_ODBC_Module
+{
+public:
+	CTable_Info(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Load : public CSG_ODBC_Module
+{
+public:
+	CTable_Load(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Save : public CSG_ODBC_Module
+{
+public:
+	CTable_Save(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Drop : public CSG_ODBC_Module
+{
+public:
+	CTable_Drop(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Query : public CSG_ODBC_Module
+{
+public:
+	CTable_Query(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Table_H
diff --git a/src/modules/db/db_pgsql/MLB_Interface.cpp b/src/modules/db/db_pgsql/MLB_Interface.cpp
new file mode 100644
index 0000000..0cfc3f3
--- /dev/null
+++ b/src/modules/db/db_pgsql/MLB_Interface.cpp
@@ -0,0 +1,148 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 911 2011-11-11 11:11:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2013 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                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("Import/Export - PostgreSQL") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O. Conrad (c) 2013") );
+
+	case MLB_INFO_Description:
+		return( _TL("Accessing PostgreSQL databases.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Database|PostgreSQL") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "get_connection.h"
+#include "table.h"
+#include "pgis_shapes.h"
+#include "pgis_raster.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CGet_Connections );
+	case  1:	return( new CGet_Connection );
+	case  2:	return( new CDel_Connection );
+	case  3:	return( new CDel_Connections );
+	case  4:	return( new CTransaction_Start );
+	case  5:	return( new CTransaction_Stop );
+	case  6:	return( new CExecute_SQL );
+
+	case 10:	return( new CTable_List );
+	case 11:	return( new CTable_Info );
+	case 12:	return( new CTable_Load );
+	case 13:	return( new CTable_Save );
+	case 14:	return( new CTable_Drop );
+	case 15:	return( new CTable_Query );
+
+	case 20:	return( new CShapes_Load );
+	case 21:	return( new CShapes_Save );
+	case 22:	return( new CShapes_SRID_Update );
+
+	case 30:	return( new CRaster_Load );
+	case 31:	return( new CRaster_Save );
+	case 32:	return( new CRaster_SRID_Update );
+
+	case 40:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/db/db_pgsql/MLB_Interface.h b/src/modules/db/db_pgsql/MLB_Interface.h
new file mode 100644
index 0000000..0047c59
--- /dev/null
+++ b/src/modules/db/db_pgsql/MLB_Interface.h
@@ -0,0 +1,86 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 911 2011-11-11 11:11:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2013 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__db_pgsql_MLB_Interface_H
+#define HEADER_INCLUDED__db_pgsql_MLB_Interface_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+#ifdef db_pgsql_EXPORTS
+	#define	db_pgsql_EXPORT	_SAGA_DLL_EXPORT
+#else
+	#define	db_pgsql_EXPORT	_SAGA_DLL_IMPORT
+#endif
+
+//---------------------------------------------------------
+#include "db_pgsql.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__db_pgsql_MLB_Interface_H
diff --git a/src/modules/db/db_pgsql/Makefile.am b/src/modules/db/db_pgsql/Makefile.am
new file mode 100644
index 0000000..1ce8020
--- /dev/null
+++ b/src/modules/db/db_pgsql/Makefile.am
@@ -0,0 +1,29 @@
+#
+# $Id: Makefile.am 1790 2013-08-20 09:23:17Z reklov_w $
+#
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_DEFS = -D_SAGA_UNICODE
+endif
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core $(POSTGRESQL_CFLAGS)
+AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = $(DEP_LFLG) $(POSTGRESQL_LDFLAGS) $(DEP_LIBS) -shared -lpq -avoid-version
+pkglib_LTLIBRARIES = libdb_pgsql.la
+libdb_pgsql_la_SOURCES =\
+get_connection.cpp\
+MLB_Interface.cpp\
+db_pgsql.cpp\
+pgis_raster.cpp\
+pgis_shapes.cpp\
+table.cpp\
+get_connection.h\
+MLB_Interface.h\
+db_pgsql.h\
+pgis_raster.h\
+pgis_shapes.h\
+table.h
+
+libdb_pgsql_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules/db/db_pgsql/Makefile.in b/src/modules/db/db_pgsql/Makefile.in
new file mode 100644
index 0000000..e739a87
--- /dev/null
+++ b/src/modules/db/db_pgsql/Makefile.in
@@ -0,0 +1,644 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/db/db_pgsql
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libdb_pgsql_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libdb_pgsql_la_OBJECTS = get_connection.lo MLB_Interface.lo \
+	db_pgsql.lo pgis_raster.lo pgis_shapes.lo table.lo
+libdb_pgsql_la_OBJECTS = $(am_libdb_pgsql_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libdb_pgsql_la_SOURCES)
+DIST_SOURCES = $(libdb_pgsql_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1790 2013-08-20 09:23:17Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@DEP_DEFS = -D_SAGA_UNICODE
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core $(POSTGRESQL_CFLAGS)
+AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = $(DEP_LFLG) $(POSTGRESQL_LDFLAGS) $(DEP_LIBS) -shared -lpq -avoid-version
+pkglib_LTLIBRARIES = libdb_pgsql.la
+libdb_pgsql_la_SOURCES = \
+get_connection.cpp\
+MLB_Interface.cpp\
+db_pgsql.cpp\
+pgis_raster.cpp\
+pgis_shapes.cpp\
+table.cpp\
+get_connection.h\
+MLB_Interface.h\
+db_pgsql.h\
+pgis_raster.h\
+pgis_shapes.h\
+table.h
+
+libdb_pgsql_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/db/db_pgsql/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/db/db_pgsql/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libdb_pgsql.la: $(libdb_pgsql_la_OBJECTS) $(libdb_pgsql_la_DEPENDENCIES) $(EXTRA_libdb_pgsql_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libdb_pgsql_la_OBJECTS) $(libdb_pgsql_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/db_pgsql.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_connection.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pgis_raster.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pgis_shapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/db/db_pgsql/db_pgsql.cpp b/src/modules/db/db_pgsql/db_pgsql.cpp
new file mode 100644
index 0000000..7c4fe77
--- /dev/null
+++ b/src/modules/db/db_pgsql/db_pgsql.cpp
@@ -0,0 +1,1858 @@
+/**********************************************************
+ * Version $Id: db_pgsql.cpp 911 2011-11-11 11:11:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     db_pgsql.cpp                      //
+//                                                       //
+//                 Copyright (C) 2013 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "db_pgsql.h"
+
+#include <libpq-fe.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_PG_Connections	g_Connections;
+
+//---------------------------------------------------------
+CSG_PG_Connections &	SG_PG_Get_Connection_Manager(void)
+{
+	return( g_Connections );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void _Error_Message(const CSG_String &Message, const CSG_String &Additional = SG_T(""))
+{
+	SG_UI_Msg_Add_Execution(Message, true, SG_UI_MSG_STYLE_FAILURE);
+
+	CSG_String	s(Message);
+
+	if( Additional.Length() > 0 )
+	{
+		s	+= SG_T(":\n");
+		s	+= Additional;
+		s	+= SG_T("\n");
+	}
+
+	SG_UI_Msg_Add_Error(s);
+}
+
+//---------------------------------------------------------
+void _Error_Message(const CSG_String &Message, PGconn *pConnection)
+{
+	CSG_String	Error	= PQerrorMessage(pConnection);
+
+	_Error_Message(Message, Error);
+}
+
+//---------------------------------------------------------
+void _Error_Message(PGconn *pConnection)
+{
+	CSG_String	Error	= PQerrorMessage(pConnection);
+
+	_Error_Message(Error);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define m_pgConnection	((PGconn   *)m_pConnection)
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_PG_Connection::CSG_PG_Connection(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit)
+{
+	Create(Host, Port, Name, User, Password, bAutoCommit);
+}
+
+bool CSG_PG_Connection::Create(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit)
+{
+	m_bTransaction	= false;
+
+	m_pConnection	= PQsetdbLogin(Host, CSG_String::Format(SG_T("%d"), Port), NULL, NULL, Name, User, Password);
+
+	if( PQstatus(m_pgConnection) != CONNECTION_OK )
+	{
+		_Error_Message((_TL("Connection to database failed"), m_pgConnection));
+
+		Destroy();
+
+		return( false );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+CSG_PG_Connection::~CSG_PG_Connection(void)
+{
+	Destroy();
+}
+
+bool CSG_PG_Connection::Destroy(void)
+{
+	if( !is_Connected() )	{	return( false );	}
+
+	PQfinish(m_pgConnection);
+
+	m_pConnection	= NULL;
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SG_PG_BOOL		16
+#define	SG_PG_BYTEA		17
+#define	SG_PG_CHAR		18
+#define	SG_PG_NAME		19
+#define	SG_PG_INT8		20
+#define	SG_PG_INT2		21
+#define	SG_PG_INT4		23
+#define	SG_PG_TEXT		25
+#define	SG_PG_OID		26
+#define	SG_PG_FLOAT4	700
+#define	SG_PG_FLOAT8	701
+#define SG_PG_VARCHAR	1043
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Type_To_SQL(TSG_Data_Type Type, int Size)
+{
+	switch( Type )
+	{
+	case SG_DATATYPE_String:	return( CSG_String::Format(SG_T("varchar(%d)"), Size > 0 ? Size : 1) );
+	case SG_DATATYPE_Date:		return( "varchar(16)"      );
+	case SG_DATATYPE_Char:		return( "char(1)"          );
+	case SG_DATATYPE_Byte:		return( "smallint"         );
+	case SG_DATATYPE_Short:		return( "smallint"         );
+	case SG_DATATYPE_Int:		return( "integer"          );
+	case SG_DATATYPE_Long:		return( "bigint"           );
+	case SG_DATATYPE_Color:		return( "integer"          );
+	case SG_DATATYPE_Float:		return( "real"             );
+	case SG_DATATYPE_Double:	return( "double precision" );
+	case SG_DATATYPE_Binary:	return( "bytea"            );
+
+	default:	return( "text" );
+	}
+}
+
+//---------------------------------------------------------
+TSG_Data_Type CSG_PG_Connection::Get_Type_From_SQL(int Type)
+{
+	switch( Type )
+	{
+	case SG_PG_VARCHAR:	return( SG_DATATYPE_String );
+	case SG_PG_NAME:	return( SG_DATATYPE_String );
+	case SG_PG_TEXT:	return( SG_DATATYPE_String );
+
+	case SG_PG_INT2:	return( SG_DATATYPE_Short  );	// 2 bytes integer
+	case SG_PG_INT4:	return( SG_DATATYPE_Int    );	// 4 bytes integer
+	case SG_PG_INT8:	return( SG_DATATYPE_Long   );	// 8 bytes integer
+	case SG_PG_FLOAT4:	return( SG_DATATYPE_Float  );	// 4 bytes floating point, inexact
+	case SG_PG_FLOAT8:	return( SG_DATATYPE_Double );	// 8 bytes floating point, inexact
+
+	case SG_PG_BYTEA:	return( SG_DATATYPE_Binary );
+	}
+
+	return( SG_DATATYPE_String );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Raster_Type_To_SQL(TSG_Data_Type Type)
+{
+	switch( Type )
+	{
+	case SG_DATATYPE_Bit:		return( "1BB"   );
+	case SG_DATATYPE_Char:		return( "8BSI"  );
+	case SG_DATATYPE_Byte:		return( "8BUI"  );
+	case SG_DATATYPE_Short:		return( "16BSI" );
+	case SG_DATATYPE_Word:		return( "16BUI" );
+	case SG_DATATYPE_Int:		return( "32BSI" );
+	case SG_DATATYPE_DWord:		return( "32BUI" );
+	case SG_DATATYPE_Long:		return( "32BSI" );
+	case SG_DATATYPE_Float:		return( "32BF"  );
+	case SG_DATATYPE_Double:	return( "64BF"  );
+	}
+
+	return( "64BF" );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_PG_Connection::GUI_Update(void) const
+{
+	SG_UI_ODBC_Update(Get_Connection());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Connection(void) const
+{
+	return( Get_DBName() + " [" + Get_Host() + ":" + Get_Port() + "]" );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Host(void) const
+{
+	return( PQhost(m_pgConnection) );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Port(void) const
+{
+	return( PQport(m_pgConnection) );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_User(void) const
+{
+	return( PQuser(m_pgConnection) );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_DBName(void) const
+{
+	return( PQdb  (m_pgConnection) );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Version(void) const
+{
+	int	Version	= PQserverVersion(m_pgConnection);
+
+	return( CSG_String::Format(SG_T("%d.%d.%d"),
+		(Version / 100) / 100,
+		(Version / 100) % 100,
+		(Version % 100)
+	));
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::has_Version(int Major, int Minor, int Revision) const
+{
+	int	Version	= PQserverVersion(m_pgConnection);
+
+	return( Version >= (Major * 10000 + Minor * 100 + Revision) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_PostGIS(void) const
+{
+	CSG_Table	t;
+
+	if( _Table_Load(t, "SELECT PostGIS_Lib_Version()", "") && t.Get_Count() == 1 && t.Get_Field_Count() == 1 )
+	{
+		return( t[0][0].asString() );
+	}
+
+	return( "" );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::has_PostGIS(double minVersion)
+{
+	CSG_Table	t;
+
+	return( _Table_Load(t, "SELECT PostGIS_Lib_Version()", "") && t.Get_Count() == 1 && t.Get_Field_Count() == 1
+		&& 0.0001 * t[0][0].asDouble() >= minVersion
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_PG_Connection::Get_Tables(CSG_Strings &Tables) const
+{
+	Tables.Clear();
+
+	if( is_Connected() )
+	{
+		PGresult	*pResult	= PQexec(m_pgConnection,
+			"SELECT table_name FROM information_schema.tables WHERE table_schema='public' ORDER BY table_name"
+		);
+
+		if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
+		{
+			_Error_Message(_TL("listing of database tables failed"), m_pgConnection);
+		}
+		else
+		{
+			for(int iRecord=0; iRecord<PQntuples(pResult); iRecord++)
+			{
+				Tables	+= PQgetvalue(pResult, iRecord, 0);
+			}
+		}
+
+		PQclear(pResult);
+	}
+
+	return( Tables.Get_Count() );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Tables(void) const
+{
+	CSG_String	List;
+	CSG_Strings	Tables;
+
+	if( Get_Tables(Tables) )
+	{
+		for(int i=0; i<Tables.Get_Count(); i++)
+		{
+			List	+= Tables[i] + '|';
+		}
+	}
+
+	return( List );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Exists(const CSG_String &Table_Name) const
+{
+	CSG_Strings	Tables;
+
+	if( Get_Tables(Tables) )
+	{
+		for(int i=0; i<Tables.Get_Count(); i++)
+		{
+			if( Table_Name.Cmp(Tables[i]) == 0 )
+			{
+				return( true );
+			}
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+CSG_Table CSG_PG_Connection::Get_Field_Desc(const CSG_String &Table_Name) const
+{
+	CSG_Table	Fields;
+
+	Fields.Set_Name(CSG_String::Format(SG_T("%s [%s]"), Table_Name.c_str(), _TL("Field Description")));
+
+	Fields.Add_Field(_TL("NAME"     ), SG_DATATYPE_String);
+	Fields.Add_Field(_TL("TYPE"     ), SG_DATATYPE_String);
+	Fields.Add_Field(_TL("SIZE"     ), SG_DATATYPE_Int);
+	Fields.Add_Field(_TL("PRECISION"), SG_DATATYPE_Int);
+
+	if( is_Connected() )
+	{
+		CSG_String	s;
+
+		s	+= "SELECT column_name, udt_name, character_maximum_length, numeric_precision ";
+		s	+= "FROM information_schema.columns WHERE table_schema='public' AND table_name='";
+		s	+= Table_Name;
+		s	+= "' ORDER BY ordinal_position";
+
+		PGresult	*pResult	= PQexec(m_pgConnection, s);
+
+		if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
+		{
+			_Error_Message(_TL("listing of table columns failed"), m_pgConnection);
+		}
+		else
+		{
+			for(int iRecord=0; iRecord<PQntuples(pResult); iRecord++)
+			{
+				CSG_Table_Record	*pRecord	= Fields.Add_Record();
+
+				for(int iField=0; iField<Fields.Get_Field_Count(); iField++)
+				{
+					pRecord->Set_Value(iField, PQgetvalue(pResult, iRecord, iField));
+				}
+			}
+		}
+
+		PQclear(pResult);
+	}
+
+	return( Fields );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_PG_Connection::Get_Field_Names(const CSG_String &Table_Name) const
+{
+	CSG_Table	Fields	= Get_Field_Desc(Table_Name);
+
+	CSG_String	Names;
+
+	for(int i=0; i<Fields.Get_Count(); i++)
+	{
+		Names	+= Fields[i].asString(3);
+		Names	+= SG_T("|");
+	}
+
+	return( Names );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Execute(const CSG_String &SQL, CSG_Table *pTable)
+{
+	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
+
+	PGresult	*pResult	= PQexec(m_pgConnection, SQL);
+
+	bool	bResult;
+
+	switch( PQresultStatus(pResult) )
+	{
+	default:
+		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
+
+		bResult	= false;
+		break;
+
+	case PGRES_COMMAND_OK:
+		bResult	= true;
+		break;
+
+	case PGRES_TUPLES_OK:
+		if( pTable )
+		{
+			_Table_Load(*pTable, pResult);
+
+			pTable->Set_Name(_TL("Query Result"));
+		}
+
+		bResult	= true;
+		break;
+	}
+
+	PQclear(pResult);
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Begin(const CSG_String &SavePoint)
+{
+	CSG_String	Command;
+
+	if( SavePoint.is_Empty() )
+	{
+		if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
+		if( is_Transaction() )	{	_Error_Message(_TL("already in transaction"));	return( false );	}
+
+		Command	= "BEGIN";
+	}
+	else
+	{
+		if( !is_Transaction() )	{	_Error_Message(_TL("not in transaction"));	return( false );	}
+
+		Command	= "SAVEPOINT " + SavePoint;
+	}
+
+	PGresult	*pResult	= PQexec(m_pgConnection, Command);
+	bool		 bResult	= PQresultStatus(pResult) == PGRES_COMMAND_OK;
+
+	if( bResult )
+	{
+		m_bTransaction	= true;
+	}
+	else if( SavePoint.is_Empty() )
+	{
+		_Error_Message(_TL("begin transaction command failed"), m_pgConnection);
+	}
+	else
+	{
+		_Error_Message(_TL("could not add save point"), m_pgConnection);
+	}
+
+	PQclear(pResult);
+
+	return( bResult );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Rollback(const CSG_String &SavePoint)
+{
+	if( !is_Transaction() )	{	_Error_Message(_TL("not in transaction"));	return( false );	}
+
+	CSG_String	Command	= "ROLLBACK";
+
+	if( !SavePoint.is_Empty() )
+	{
+		Command	+= " TO SAVEPOINT " + SavePoint;
+	}
+
+	PGresult	*pResult	= PQexec(m_pgConnection, Command);
+
+	if( PQresultStatus(pResult) != PGRES_COMMAND_OK )
+	{
+		_Error_Message(_TL("rollback transaction command failed"), m_pgConnection);
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	if( SavePoint.is_Empty() )
+	{
+		m_bTransaction	= false;
+	}
+
+	PQclear(pResult);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Commit(const CSG_String &SavePoint)
+{
+	if( !is_Transaction() )	{	_Error_Message(_TL("not in transaction"));	return( false );	}
+
+	CSG_String	Command;
+
+	if( SavePoint.is_Empty() )
+	{
+		Command	= "COMMIT";
+	}
+	else
+	{
+		Command	= "RELEASE SAVEPOINT " + SavePoint;
+	}
+
+	PGresult	*pResult	= PQexec(m_pgConnection, Command);
+
+	if( PQresultStatus(pResult) != PGRES_COMMAND_OK )
+	{
+		_Error_Message(_TL("commit transaction command failed"), m_pgConnection);
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	m_bTransaction	= false;
+
+	PQclear(pResult);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
+{
+	if( Table.Get_Field_Count() <= 0 )
+	{
+		_Error_Message(_TL("no attributes in table"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			iField;
+	CSG_String	SQL;
+
+	SQL.Printf(SG_T("CREATE TABLE \"%s\"("), Table_Name.c_str());
+
+	//-----------------------------------------------------
+	for(iField=0; iField<Table.Get_Field_Count(); iField++)
+	{
+		CSG_String	s	= Get_Type_To_SQL(Table.Get_Field_Type(iField), Table.Get_Field_Length(iField));
+
+		char	Flag	= (int)Flags.Get_Size() == Table.Get_Field_Count() ? Flags[iField] : 0;
+
+		if( (Flag & SG_PG_PRIMARY_KEY) == 0 )
+		{
+			if( (Flag & SG_PG_UNIQUE) != 0 )
+			{
+				s	+= SG_T(" UNIQUE");
+			}
+
+			if( (Flag & SG_PG_NOT_NULL) != 0 )
+			{
+				s	+= SG_T(" NOT NULL");
+			}
+		}
+
+		if( iField > 0 )
+		{
+			SQL	+= SG_T(", ");
+		}
+
+		SQL	+= CSG_String::Format(SG_T("%s %s"), Table.Get_Field_Name(iField), s.c_str());
+	}
+
+	//-----------------------------------------------------
+	if( (int)Flags.Get_Size() == Table.Get_Field_Count() )
+	{
+		CSG_String	s;
+
+		for(iField=0; iField<Table.Get_Field_Count(); iField++)
+		{
+			if( (Flags[iField] & SG_PG_PRIMARY_KEY) != 0 )
+			{
+				s	+= s.Length() == 0 ? SG_T(", PRIMARY KEY(") : SG_T(", ");
+				s	+= Table.Get_Field_Name(iField);
+			}
+		}
+
+		if( s.Length() > 0 )
+		{
+			SQL	+= s + SG_T(")");
+		}
+	}
+
+	//-----------------------------------------------------
+	SQL	+= SG_T(")");
+
+	return( Execute(SQL) );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Drop(const CSG_String &Table_Name, bool bCommit)
+{
+	if( !Table_Exists(Table_Name) )
+	{
+		_Error_Message(_TL("database table does not exist"));
+
+		return( false );
+	}
+
+	return( Execute(CSG_String::Format(SG_T("DROP TABLE \"%s\""), Table_Name.c_str())) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Table &Table, bool bCommit)
+{
+	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
+
+	//-----------------------------------------------------
+	if( !Table_Exists(Table_Name) )
+	{
+		return( false );
+	}
+
+	if( Table.Get_Field_Count() <= 0 || Table.Get_Field_Count() != Get_Field_Desc(Table_Name).Get_Count() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int		iField, nFields	= Table.Get_Field_Count();
+
+	char	**Values		= (char **)SG_Malloc(nFields * sizeof(char *));
+	char	**paramValues	= (char **)SG_Malloc(nFields * sizeof(char *));
+	int		 *paramLengths	= (int   *)SG_Malloc(nFields * sizeof(int   ));
+	int		 *paramFormats	= (int   *)SG_Malloc(nFields * sizeof(int   ));
+//	Oid		 *paramTypes	= (Oid   *)SG_Malloc(nFields * sizeof(Oid   ));
+
+	CSG_String	Insert("INSERT INTO " + Table_Name + " VALUES(");
+
+	for(iField=0; iField<nFields; iField++)
+	{
+		Insert	+= CSG_String::Format(SG_T("$%d%c"), 1 + iField, iField < nFields - 1 ? SG_T(',') : SG_T(')'));
+
+		paramFormats[iField]	= Table.Get_Field_Type(iField) == SG_DATATYPE_Binary ? 1 : 0;
+
+		switch( Table.Get_Field_Type(iField) )
+		{
+		default:
+		case SG_DATATYPE_Date:
+		case SG_DATATYPE_String:
+			Values [iField]	= (char *)SG_Malloc((1 + Table.Get_Field_Length(iField)) * sizeof(char));
+			break;
+
+		case SG_DATATYPE_Short:
+		case SG_DATATYPE_Int:
+		case SG_DATATYPE_Color:
+		case SG_DATATYPE_Long:
+		case SG_DATATYPE_Float:
+		case SG_DATATYPE_Double:
+			Values [iField]	= (char *)SG_Malloc(256);
+			break;
+
+		case SG_DATATYPE_Binary:
+			break;
+		}
+	}
+
+	//-----------------------------------------------------
+	for(int iRecord=0; iRecord<Table.Get_Count() && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
+	{
+		CSG_Table_Record	*pRecord	= Table.Get_Record(iRecord);
+
+		for(iField=0; iField<Table.Get_Field_Count(); iField++)
+		{
+			if( pRecord->is_NoData(iField) )
+			{
+				paramValues [iField]	= NULL;
+			}
+			else if( Table.Get_Field_Type(iField) == SG_DATATYPE_Binary )
+			{
+				paramValues [iField]	= (char *)pRecord->Get_Value(iField)->asBinary().Get_Bytes();
+				paramLengths[iField]	=         pRecord->Get_Value(iField)->asBinary().Get_Count();
+			}
+			else
+			{
+				sprintf(Values[iField], "%s", CSG_String(pRecord->asString(iField)).b_str());
+
+				paramValues [iField]	= Values[iField];
+			}
+		}
+
+		PQexecParams(m_pgConnection, Insert, nFields, NULL, paramValues, paramLengths, paramFormats, 0);
+	}
+
+	//-----------------------------------------------------
+	for(iField=0; iField<nFields; iField++)
+	{
+		if( Table.Get_Field_Type(iField) != SG_DATATYPE_Binary )
+		{
+			SG_Free(Values[iField]);
+		}
+	}
+
+	SG_Free(Values);
+	SG_Free(paramValues);
+	SG_Free(paramLengths);
+	SG_Free(paramFormats);
+//	SG_Free(paramTypes);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Save(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
+{
+	//-----------------------------------------------------
+	if( !is_Connected() )
+	{
+		_Error_Message(_TL("no database connection"));
+
+		return( false );
+	}
+
+	if( Table_Exists(Table_Name) && !Table_Drop(Table_Name, bCommit) )
+	{
+		return( false );
+	}
+
+	if( !Table_Create(Table_Name, Table, Flags, bCommit) )
+	{
+		return( false );
+	}
+
+	if( !Table_Insert(Table_Name, Table, bCommit) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, const CSG_String &Select, const CSG_String &Name) const
+{
+	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
+
+	//-----------------------------------------------------
+	PGresult	*pResult	= PQexec(m_pgConnection, Select);
+
+	bool	bResult	= _Table_Load(Table, pResult);
+
+	Table.Set_Name(Name);
+
+	PQclear(pResult);
+
+	return( bResult );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, void *_pResult) const
+{
+	//-----------------------------------------------------
+	PGresult	*pResult	= (PGresult *)_pResult;
+
+	if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
+	{
+		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int		iField, nFields	= PQnfields(pResult);
+
+	if( nFields <= 0 )
+	{
+		_Error_Message(_TL("no fields in selection"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Table.Destroy();
+
+	for(iField=0; iField<nFields; iField++)
+	{
+		Table.Add_Field(PQfname(pResult, iField), Get_Type_From_SQL(PQftype(pResult, iField)));
+	}
+
+	//-----------------------------------------------------
+	int		iRecord, nRecords	= PQntuples(pResult);
+
+	for(iRecord=0; iRecord<nRecords && SG_UI_Process_Set_Progress(iRecord, nRecords); iRecord++)
+	{
+		CSG_Table_Record	*pRecord	= Table.Add_Record();
+
+		for(iField=0; pRecord && iField<nFields; iField++)
+		{
+			if( PQgetisnull(pResult, iRecord, iField) )
+			{
+				pRecord->Set_NoData(iField);
+			}
+			else switch( Table.Get_Field_Type(iField) )
+			{
+			default:
+				pRecord->Set_Value(iField, PQgetvalue(pResult, iRecord, iField));
+				break;
+
+			case SG_DATATYPE_Binary:
+				{
+					CSG_Bytes	Binary;
+					
+					Binary.fromHexString(PQgetvalue(pResult, iRecord, iField) + 2);
+
+					pRecord->Set_Value(iField, Binary);
+				}
+				break;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Load(CSG_Table &Table, const CSG_String &Table_Name)
+{
+	return( _Table_Load(Table, CSG_String::Format(SG_T("SELECT * FROM \"%s\""), Table_Name.c_str()), Table_Name) );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Table_Load(CSG_Table &Table, const CSG_String &Tables, const CSG_String &Fields, const CSG_String &Where, const CSG_String &Group, const CSG_String &Having, const CSG_String &Order, bool bDistinct)
+{
+	CSG_String	Select;
+
+	Select.Printf(SG_T("SELECT %s %s FROM %s"), bDistinct ? SG_T("DISTINCT") : SG_T("ALL"), Fields.c_str(), Tables.c_str());
+
+	if( Where.Length() )
+	{
+		Select	+= SG_T(" WHERE ") + Where;
+	}
+
+	if( Group.Length() )
+	{
+		Select	+= SG_T(" GROUP BY ") + Group;
+
+		if( Having.Length() )
+		{
+			Select	+= SG_T(" HAVING ") + Having;
+		}
+	}
+
+	if( Order.Length() )
+	{
+		Select	+= SG_T(" ORDER BY ") + Order;
+	}
+
+	return( _Table_Load(Table, Select, Table.Get_Name()) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Shapes_Load(CSG_Shapes *pShapes, const CSG_String &Name)
+{
+	CSG_Table	Info;
+
+	if( !Table_Load(Info, "geometry_columns", "*", "f_table_name='" + Name + "'") || Info.Get_Count() != 1 )
+	{
+		_Error_Message(_TL("table has no geometry field"));
+
+		return( false );
+	}
+
+	int	SRID	= Info[0].asInt("srid");
+
+	CSG_String	Fields, Geometry	= Info[0].asString("f_geometry_column");
+
+	Info	= Get_Field_Desc(Name);
+
+	if( Info.Get_Count() == 0 )
+	{
+		return( false );
+	}
+
+	for(int i=0; i<Info.Get_Count(); i++)
+	{
+		if( Geometry.Cmp(Info[i].asString(0)) )
+		{
+			Fields	+= CSG_String::Format(SG_T("\"%s\","), Info[i].asString(0));
+		}
+	}
+
+	bool	bBinary	= has_Version(9);	// previous versions did not support hex strings
+
+	Fields	+= (bBinary ? "ST_AsBinary(" : "ST_AsText(") + Geometry + ") AS __geometry__";
+
+	return( Shapes_Load(pShapes, Name, "SELECT " + Fields + " FROM \"" + Name + "\"", "__geometry__", bBinary, SRID) );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Shapes_Load(CSG_Shapes *pShapes, const CSG_String &Name, const CSG_String &Select, const CSG_String &Geometry_Field, bool bBinary, int SRID)
+{
+	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
+	if( !has_PostGIS () )	{	_Error_Message(_TL("not a PostGIS database"));	return( false );	}
+
+	//-----------------------------------------------------
+	PGresult	*pResult	= PQexec(m_pgConnection, Select);
+
+	if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
+	{
+		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int		iField, jField, gField, nFields, iRecord, nRecords;
+
+	if( (nFields = PQnfields(pResult)) <= 0 )
+	{
+		_Error_Message(_TL("no fields in selection"));
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	if( (nRecords = PQntuples(pResult)) <= 0 )
+	{
+		_Error_Message(_TL("no records in selection"));
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(iField=0, gField=-1; gField<0 && iField<nFields; iField++)
+	{
+		if( !Geometry_Field.CmpNoCase(PQfname(pResult, iField)) )
+		{
+			gField	= iField;
+		}
+	}
+
+	if( gField < 0 )
+	{
+		_Error_Message(_TL("no geometry in selection"));
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	TSG_Shape_Type	Type;
+	CSG_Bytes		Binary;
+
+	if( bBinary )
+	{
+		Binary.fromHexString(PQgetvalue(pResult, 0, gField) + 2);
+
+		Type	= CSG_Shapes_OGIS_Converter::to_ShapeType(Binary.asDWord(1, false));
+	}
+	else
+	{
+		Type	= CSG_Shapes_OGIS_Converter::to_ShapeType(CSG_String(PQgetvalue(pResult, 0, gField)).BeforeFirst('('));
+	}
+
+	if( Type == SHAPE_TYPE_Undefined )
+	{
+		_Error_Message(_TL("unsupported vector type"));
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pShapes->Create(Type, Name);
+
+	pShapes->Get_Projection().Create(SRID);
+
+	for(iField=0; iField<nFields; iField++)
+	{
+		if( iField != gField )
+		{
+			pShapes->Add_Field(PQfname(pResult, iField), Get_Type_From_SQL(PQftype(pResult, iField)));
+		}
+	}
+
+	//-----------------------------------------------------
+	for(iRecord=0; iRecord<nRecords && SG_UI_Process_Set_Progress(iRecord, nRecords); iRecord++)
+	{
+		CSG_Shape	*pRecord	= pShapes->Add_Shape();
+
+		if( bBinary )
+		{
+			Binary.fromHexString(PQgetvalue(pResult, iRecord, gField) + 2);
+
+			CSG_Shapes_OGIS_Converter::from_WKBinary(Binary, pRecord);
+		}
+		else
+		{
+			CSG_Shapes_OGIS_Converter::from_WKText(PQgetvalue(pResult, iRecord, gField), pRecord);
+		}
+
+		for(iField=0, jField=0; iField<nFields; iField++)
+		{
+			if( iField != gField )
+			{
+				if( PQgetisnull(pResult, iRecord, iField) )
+				{
+					pRecord->Set_NoData(jField++);
+				}
+				else switch( pShapes->Get_Field_Type(jField) )
+				{
+				default:
+					pRecord->Set_Value(jField++, PQgetvalue(pResult, iRecord, iField));
+					break;
+
+				case SG_DATATYPE_Binary:
+					Binary.fromHexString(PQgetvalue(pResult, iRecord, iField) + 2);
+
+					pRecord->Set_Value(jField++, Binary);
+					break;
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	PQclear(pResult);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Raster_Load(const CSG_String &Table, const CSG_String &Where, const CSG_String &Order, const CSG_String &Names, CSG_Parameter_Grid_List *pList)
+{
+	CSG_Table	Info;
+
+	if( !Table_Load(Info, "raster_columns", "*", CSG_String("r_table_name = '") + Table + "'") || Info.Get_Count() != 1 )
+	{
+		return( false );
+	}
+
+	CSG_String	Geometry	= Info[0].asString("r_raster_column");
+
+	//-----------------------------------------------------
+	if( Names.is_Empty() || !Table_Load(Info, Table, Names, Where, "", "", Order) )
+	{
+		Info.Destroy();
+	}
+
+	//-----------------------------------------------------
+	bool	bBinary	= true;
+
+	CSG_String	Select	= "COPY (SELECT ST_AsBinary(\"" + Geometry + "\") AS rastbin FROM \"" + Table + "\"";
+
+	if( Where.Length() )	Select	+= SG_T(" WHERE ")    + Where;
+	if( Order.Length() )	Select	+= SG_T(" ORDER BY ") + Order;
+
+	Select	+= ") TO STDOUT";	if( bBinary )	Select	+= " WITH (FORMAT 'binary')";
+
+	//-----------------------------------------------------
+	PGresult	*pResult	= PQexec(m_pgConnection, Select);
+
+	if( PQresultStatus(pResult) != PGRES_COPY_OUT )
+	{
+		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	char	*Bytes;
+	int		nBytes, nOkay, iBand;
+
+	for(iBand=0, nOkay=0; SG_UI_Process_Get_Okay() && (nBytes = PQgetCopyData(m_pgConnection, &Bytes, 0)) > 0; iBand++)
+	{
+		CSG_Bytes	Band;
+
+		if( bBinary )
+		{
+			int		Offset	= iBand == 0 ? 25 : 6;
+
+			if( *((short *)Bytes) > 0 && nBytes > Offset )
+			{
+				Band.Create((BYTE *)(Bytes + Offset), nBytes - Offset);
+			}
+		}
+		else if( nBytes > 3 )
+		{
+			Band.fromHexString(Bytes + 3);
+		}
+
+		PQfreemem(Bytes);
+
+		//-------------------------------------------------
+		CSG_Grid	*pGrid	= SG_Create_Grid();
+
+		if( Band.Get_Count() > 0 && CSG_Grid_OGIS_Converter::from_WKBinary(Band, pGrid) )
+		{
+			if( iBand < Info.Get_Count() )
+			{
+				pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"  ), Table.c_str(), Info[iBand].asString(0)));
+			}
+			else
+			{
+				pGrid->Set_Name(CSG_String::Format(SG_T("%s [%02d]"), Table.c_str(), iBand + 1));
+			}
+
+			SG_Get_Data_Manager().Add(pGrid);
+
+			if( pList )
+			{
+				pList->Add_Item(pGrid);
+			}
+
+			nOkay++;
+		}
+		else
+		{
+			delete(pGrid);
+		}
+	}
+
+	//-----------------------------------------------------
+	PQclear(pResult);
+
+	return( nOkay > 0 );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connection::Raster_Save(CSG_Grid *pGrid, int SRID, const CSG_String &Table, const CSG_String &Field)
+{
+	CSG_Table	Info;
+
+	if( !Table_Load(Info, "raster_columns", "*", CSG_String("r_table_name = '") + Table + "'") || Info.Get_Count() != 1 )
+	{
+		return( false );
+	}
+
+	CSG_String	Geometry	= Info[0].asString("r_raster_column");
+
+	//-----------------------------------------------------
+	bool	bBinary	= false;	// binary raster import not (yet??!!) supported
+
+	CSG_String	Select	= "COPY \"" + Table + "\" (\"" + Geometry + "\") FROM STDIN";	if( bBinary )	Select	+= " WITH (FORMAT 'binary')";
+
+	//-----------------------------------------------------
+	PGresult	*pResult	= PQexec(m_pgConnection, Select);
+
+	if( PQresultStatus(pResult) != PGRES_COPY_IN )
+	{
+		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
+
+		PQclear(pResult);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Bytes	Band;
+
+	if( CSG_Grid_OGIS_Converter::to_WKBinary(Band, pGrid, SRID) )
+	{
+		if( bBinary )
+		{
+			PQputCopyData(m_pgConnection, (const char *)Band.Get_Bytes(), Band.Get_Count());
+		}
+		else
+		{
+			CSG_String	hex(Band.toHexString());
+
+			PQputCopyData(m_pgConnection, hex, hex.Length());
+		}
+
+		PQputCopyEnd (m_pgConnection, NULL);
+	}
+
+	//-----------------------------------------------------
+	PQclear(pResult);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_PG_Connections::CSG_PG_Connections(void)
+{
+	m_nConnections	= 0;
+	m_pConnections	= NULL;
+
+	Create();
+}
+
+//---------------------------------------------------------
+CSG_PG_Connections::~CSG_PG_Connections(void)
+{
+	Destroy();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Connections::Create(void)
+{
+	Destroy();
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connections::Destroy(void)
+{
+	if( m_pConnections )
+	{
+		for(int i=0; i<m_nConnections; i++)
+		{
+			delete(m_pConnections[i]);
+		}
+
+		SG_Free(m_pConnections);
+
+		m_nConnections	= 0;
+		m_pConnections	= NULL;
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_PG_Connection * CSG_PG_Connections::Add_Connection(const CSG_String &Name, const CSG_String &User, const CSG_String &Password, const CSG_String &Host, int Port)
+{
+	CSG_PG_Connection	*pConnection	= new CSG_PG_Connection(Host, Port, Name, User, Password);
+
+	if( pConnection )
+	{
+		if( pConnection->is_Connected() )
+		{
+			m_pConnections	= (CSG_PG_Connection **)SG_Realloc(m_pConnections, (m_nConnections + 1) * sizeof(CSG_PG_Connection *));
+
+			m_pConnections[m_nConnections++]	= pConnection;
+		}
+		else
+		{
+			delete(pConnection);
+
+			pConnection	= NULL;
+		}
+	}
+
+	return( pConnection );
+}
+
+//---------------------------------------------------------
+CSG_PG_Connection *  CSG_PG_Connections::Get_Connection(const CSG_String &Name)
+{
+	for(int i=0; i<m_nConnections; i++)
+	{
+		if( Name.Cmp(m_pConnections[i]->Get_Connection()) == 0 )
+		{
+			return( m_pConnections[i] );
+		}
+	}
+
+	return( NULL );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Connections::Del_Connection(int Index, bool bCommit)
+{
+	if( Index >= 0 && Index < m_nConnections )
+	{
+		if( m_pConnections[Index]->is_Transaction() )
+		{
+			if( bCommit )
+			{
+				m_pConnections[Index]->Commit();
+			}
+			else
+			{
+				m_pConnections[Index]->Rollback();
+			}
+		}
+
+		delete(m_pConnections[Index]);
+
+		for(m_nConnections--; Index<m_nConnections; Index++)
+		{
+			m_pConnections[Index]	= m_pConnections[Index + 1];
+		}
+
+		m_pConnections	= (CSG_PG_Connection **)SG_Realloc(m_pConnections, m_nConnections * sizeof(CSG_PG_Connection *));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+bool CSG_PG_Connections::Del_Connection(const CSG_String &Name, bool bCommit)
+{
+	for(int i=0; i<m_nConnections; i++)
+	{
+		if( Name.Cmp(m_pConnections[i]->Get_Connection()) == 0 )
+		{
+			return( Del_Connection(i, bCommit) );
+		}
+	}
+
+	return( false );
+}
+
+bool CSG_PG_Connections::Del_Connection(CSG_PG_Connection *pConnection, bool bCommit)
+{
+	return( !pConnection ? false : Del_Connection(pConnection->Get_Connection(), bCommit) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Strings CSG_PG_Connections::Get_Servers(void)
+{
+	CSG_Strings	Servers;
+
+	return( Servers );
+}
+
+//---------------------------------------------------------
+int CSG_PG_Connections::Get_Servers(CSG_Strings &Servers)
+{
+	Servers	= Get_Servers();
+
+	return( Servers.Get_Count() );
+}
+
+//---------------------------------------------------------
+int CSG_PG_Connections::Get_Servers(CSG_String &Servers)
+{
+	CSG_Strings		s	= Get_Servers();
+
+	for(int i=0; i<s.Get_Count(); i++)
+	{
+		Servers	+= s[i] + SG_T("|");
+	}
+
+	return( s.Get_Count() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Strings CSG_PG_Connections::Get_Connections(void)
+{
+	CSG_Strings		Connections;
+
+	for(int i=0; i<m_nConnections; i++)
+	{
+		Connections.Add(m_pConnections[i]->Get_Connection());
+	}
+
+	return( Connections );
+}
+
+//---------------------------------------------------------
+int CSG_PG_Connections::Get_Connections(CSG_String &Connections)
+{
+	Connections.Clear();
+
+	for(int i=0; i<m_nConnections; i++)
+	{
+		Connections	+= m_pConnections[i]->Get_Connection() + "|";
+	}
+
+	return( m_nConnections );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_PG_Module::CSG_PG_Module(void)
+{
+	if( !SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_String(
+			NULL	, "PG_HOST"		, _TL("Host"),
+			_TL("Password"),
+			SG_T("")
+		);
+
+		Parameters.Add_Value(
+			NULL	, "PG_PORT"		, _TL("Port"),
+			_TL(""),
+			PARAMETER_TYPE_Int, 5432, 0, true
+		);
+
+		Parameters.Add_String(
+			NULL	, "PG_NAME"		, _TL("Database"),
+			_TL("Database Name"),
+			SG_T("")
+		);
+
+		Parameters.Add_String(
+			NULL	, "PG_USER"		, _TL("User"),
+			_TL("User Name"),
+			SG_T("")
+		);
+
+		Parameters.Add_String(
+			NULL	, "PG_PWD"		, _TL("Password"),
+			_TL("Password"),
+			SG_T("")
+		);
+	}
+	else
+	{
+		Parameters.Add_Choice(
+			NULL	, "CONNECTION", _TL("Available Connections"),
+			_TL(""),
+			""
+		);
+	}
+
+	m_pConnection	= NULL;
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Module::On_Before_Execution(void)
+{
+	m_pConnection	= NULL;
+
+	if( !SG_UI_Get_Window_Main() )
+	{
+		m_pConnection	= SG_PG_Get_Connection_Manager().Add_Connection(
+			Parameters("PG_NAME")->asString(),
+			Parameters("PG_USER")->asString(),
+			Parameters("PG_PWD" )->asString(),
+			Parameters("PG_HOST")->asString(),
+			Parameters("PG_PORT")->asInt()
+		);
+	}
+	else
+	{
+		CSG_String	Connections;
+
+		int	nConnections	= SG_PG_Get_Connection_Manager().Get_Connections(Connections);
+
+		if( nConnections <= 0 )
+		{
+			Message_Dlg(
+				_TL("No PostgreSQL connection available!"),
+				_TL("PostgreSQL Database Connection Error")
+			);
+
+			return( false );
+		}
+
+		if( nConnections == 1 || !(m_pConnection = SG_PG_Get_Connection_Manager().Get_Connection(Parameters("CONNECTION")->asString())) )
+		{
+			m_pConnection	= SG_PG_Get_Connection_Manager().Get_Connection(0);
+		}
+
+		Parameters("CONNECTION")->asChoice()->Set_Items(Connections);
+		Parameters("CONNECTION")->Set_Enabled(nConnections > 1);
+		Parameters("CONNECTION")->Set_Value(m_pConnection->Get_Connection());
+
+		On_Parameter_Changed(&Parameters, Parameters("CONNECTION"));
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Module::On_After_Execution(void)
+{
+	if( !SG_UI_Get_Window_Main() )
+	{
+		SG_PG_Get_Connection_Manager().Del_Connection(m_pConnection, true);
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int CSG_PG_Module::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( SG_UI_Get_Window_Main() )
+	{
+		//-------------------------------------------------
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG_GEOGCS")
+		||	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG_PROJCS") )
+		{
+			int		EPSG;
+
+			if( pParameter->asChoice()->Get_Data(EPSG) )
+			{
+				pParameters->Get_Parameter("CRS_EPSG")->Set_Value(EPSG);
+			}
+		}
+
+		//-------------------------------------------------
+		if( !SG_STR_CMP(pParameter->Get_Identifier(), "CONNECTION") )
+		{
+			m_pConnection	= SG_PG_Get_Connection_Manager().Get_Connection(pParameter->asString());
+
+			if( m_pConnection )
+			{
+				On_Connection_Changed(pParameters);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Module::Add_SRID_Picker(CSG_Parameters *pParameters)
+{
+	if( !pParameters )
+	{
+		pParameters	= &Parameters;
+	}
+
+	if( pParameters->Get_Parameter("CRS_EPSG") )
+	{
+		return( false );	// don't add twice ...
+	}
+
+	CSG_Parameter	*pNode	= pParameters->Add_Value(
+		NULL	, "CRS_EPSG"	, _TL("EPSG Code"),
+		_TL(""),
+		PARAMETER_TYPE_Int, -1, -1, true
+	);
+
+	if( SG_UI_Get_Window_Main() )
+	{
+		pParameters->Add_Choice(
+			pNode	, "CRS_EPSG_GEOGCS"	, _TL("Geographic Coordinate Systems"),
+			_TL(""),
+			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Geographic)
+		);
+
+		pParameters->Add_Choice(
+			pNode	, "CRS_EPSG_PROJCS"	, _TL("Projected Coordinate Systems"),
+			_TL(""),
+			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Projected)
+		);
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Module::Set_SRID_Picker_Enabled(CSG_Parameters *pParameters, bool bEnable)
+{
+	CSG_Parameter	*pParameter	= pParameters ? pParameters->Get_Parameter("CRS_EPSG") : NULL;
+
+	if( pParameter )
+	{
+		pParameter->Set_Enabled(bEnable);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_PG_Module::Set_SRID(CSG_Parameters *pParameters, int SRID)
+{
+	CSG_Parameter	*pParameter	= pParameters ? pParameters->Get_Parameter("CRS_EPSG") : NULL;
+
+	CSG_Projection	Projection;
+
+	if( pParameter && SG_Get_Projections().Get_Projection(Projection, SRID) )
+	{
+		pParameter->Set_Value(SRID);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+int CSG_PG_Module::Get_SRID(CSG_Parameters *pParameters)
+{
+	if( !pParameters )
+	{
+		pParameters	= &Parameters;
+	}
+
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("CRS_EPSG");
+
+	return( pParameter ? pParameter->asInt() : -1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_PG_Module::Set_Constraints(CSG_Parameters *pParameters, const CSG_String &Identifier)
+{
+	CSG_Parameter	*pParent	= pParameters ? pParameters->Get_Parameter(Identifier) : NULL;
+
+	if( !pParent || (pParent->Get_Type() != PARAMETER_TYPE_Table && pParent->Get_Type() != PARAMETER_TYPE_Shapes) )
+	{
+		return( false );
+	}
+
+	pParameters->Add_Table_Fields(pParent, Identifier + "_PK", _TL("Primary Key"), _TL(""));
+	pParameters->Add_Table_Fields(pParent, Identifier + "_NN", _TL("Not Null"   ), _TL(""));
+	pParameters->Add_Table_Fields(pParent, Identifier + "_UQ", _TL("Unique"     ), _TL(""));
+
+	return( true );
+}
+
+//---------------------------------------------------------
+CSG_Buffer CSG_PG_Module::Get_Constraints(CSG_Parameters *pParameters, const CSG_String &Identifier)
+{
+	CSG_Buffer		Flags;
+
+	CSG_Parameter	*pParent	= pParameters ? pParameters->Get_Parameter(Identifier) : NULL;
+
+	if( !pParent || (pParent->Get_Type() != PARAMETER_TYPE_Table && pParent->Get_Type() != PARAMETER_TYPE_Shapes) )
+	{
+		return( Flags );
+	}
+
+	CSG_Parameter	*pFields;
+
+	Flags.Set_Size(((CSG_Table *)pParent->asDataObject())->Get_Field_Count());
+
+	memset(Flags.Get_Data(), 0, Flags.Get_Size());
+
+	if( (pFields = pParameters->Get_Parameter(Identifier + "_PK")) != NULL && pFields->Get_Type() == PARAMETER_TYPE_Table_Fields )
+	{
+		for(int i=0, Index; i<pFields->asTableFields()->Get_Count(); i++)
+		{
+			if( (Index = pFields->asTableFields()->Get_Index(i)) >= 0 && Index < (int)Flags.Get_Size() )
+			{
+				Flags.Get_Data()[Index]	|= SG_PG_PRIMARY_KEY;
+			}
+		}
+	}
+
+	if( (pFields = pParameters->Get_Parameter(Identifier + "_NN")) != NULL && pFields->Get_Type() == PARAMETER_TYPE_Table_Fields )
+	{
+		for(int i=0, Index; i<pFields->asTableFields()->Get_Count(); i++)
+		{
+			if( (Index = pFields->asTableFields()->Get_Index(i)) >= 0 && Index < (int)Flags.Get_Size() )
+			{
+				Flags.Get_Data()[Index]	|= SG_PG_NOT_NULL;
+			}
+		}
+	}
+
+	if( (pFields = pParameters->Get_Parameter(Identifier + "_UQ")) != NULL && pFields->Get_Type() == PARAMETER_TYPE_Table_Fields )
+	{
+		for(int i=0, Index; i<pFields->asTableFields()->Get_Count(); i++)
+		{
+			if( (Index = pFields->asTableFields()->Get_Index(i)) >= 0 && Index < (int)Flags.Get_Size() )
+			{
+				Flags.Get_Data()[Index]	|= SG_PG_UNIQUE;
+			}
+		}
+	}
+
+	return( Flags );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_pgsql/db_pgsql.h b/src/modules/db/db_pgsql/db_pgsql.h
new file mode 100644
index 0000000..1f2c90f
--- /dev/null
+++ b/src/modules/db/db_pgsql/db_pgsql.h
@@ -0,0 +1,268 @@
+/**********************************************************
+ * Version $Id: db_pgsql.cpp 911 2011-11-11 11:11:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      db_pgsql.h                       //
+//                                                       //
+//                 Copyright (C) 2013 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__db_pgsql_H
+#define HEADER_INCLUDED__db_pgsql_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SG_PG_PRIMARY_KEY	0x01
+#define SG_PG_NOT_NULL		0x02
+#define SG_PG_UNIQUE		0x04
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class db_pgsql_EXPORT CSG_PG_Connection
+{
+	friend class CSG_PG_Connections;
+
+public:
+
+	static CSG_String			Get_Type_To_SQL			(TSG_Data_Type Type, int Size = 0);
+	static TSG_Data_Type		Get_Type_From_SQL		(int Type);
+	static CSG_String			Get_Raster_Type_To_SQL	(TSG_Data_Type Type);
+
+	void						GUI_Update				(void)	const;
+
+	bool						is_Connected			(void)	const	{	return( m_pConnection != NULL );	}
+
+	CSG_String					Get_Connection			(void)	const;
+
+	CSG_String					Get_Host				(void)	const;
+	CSG_String					Get_Port				(void)	const;
+	CSG_String					Get_User				(void)	const;
+	CSG_String					Get_DBName				(void)	const;
+	CSG_String					Get_Version				(void)	const;
+	bool						has_Version				(int Major, int Minor = 0, int Revision = 0) const;
+
+	CSG_String					Get_PostGIS				(void)	const;
+	bool						has_PostGIS				(double minVersion = 0.0);
+
+	int							Get_Tables				(CSG_Strings &Tables)			const;
+	CSG_String					Get_Tables				(void)							const;
+	CSG_String					Get_Field_Names			(const CSG_String &Table_Name)	const;
+	CSG_Table					Get_Field_Desc			(const CSG_String &Table_Name)	const;
+
+	bool						Execute					(const CSG_String &SQL, CSG_Table *pTable = NULL);
+
+	bool						Begin					(const CSG_String &SavePoint = "");
+	bool						Rollback				(const CSG_String &SavePoint = "");
+	bool						Commit					(const CSG_String &SavePoint = "");
+	bool						is_Transaction			(void)	const	{	return( is_Connected() && m_bTransaction );	}
+
+	bool						Table_Exists			(const CSG_String &Table_Name)	const;
+
+	bool						Table_Create			(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
+	bool						Table_Drop				(const CSG_String &Table_Name                                                     , bool bCommit = true);
+	bool						Table_Insert			(const CSG_String &Table_Name, const CSG_Table &Table                             , bool bCommit = true);
+	bool						Table_Save				(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
+
+	bool						Table_Load				(CSG_Table &Data, const CSG_String &Table );
+	bool						Table_Load				(CSG_Table &Data, const CSG_String &Tables, const CSG_String &Fields, const CSG_String &Where = "", const CSG_String &Group = "", const CSG_String &Having = "", const CSG_String &Order = "", bool bDistinct = false);
+
+	bool						Shapes_Load				(CSG_Shapes *pShapes, const CSG_String &Table);
+	bool						Shapes_Load				(CSG_Shapes *pShapes, const CSG_String &Name, const CSG_String &Select, const CSG_String &Geometry_Field, bool bBinary, int SRID = -1);
+
+	bool						Raster_Load				(const CSG_String &Table, const CSG_String &Where = "", const CSG_String &Order = "", const CSG_String &Names = "", CSG_Parameter_Grid_List *pList = NULL);
+	bool						Raster_Save				(CSG_Grid *pGrid, int SRID, const CSG_String &Table, const CSG_String &Field);
+	
+
+private:
+
+								CSG_PG_Connection		(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit = false);
+	bool						Create					(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit = false);
+
+	virtual ~CSG_PG_Connection(void);
+
+	bool						Destroy					(void);
+
+
+private:
+
+	void						*m_pConnection;
+
+	bool						m_bTransaction;
+
+
+	bool						_Table_Load				(CSG_Table &Data, const CSG_String &Select, const CSG_String &Name = "")	const;
+	bool						_Table_Load				(CSG_Table &Data, void *pResult)	const;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class db_pgsql_EXPORT CSG_PG_Connections
+{
+public:
+	CSG_PG_Connections(void);
+	virtual ~CSG_PG_Connections(void);
+
+	bool						Create					(void);
+	bool						Destroy					(void);
+
+	int							Get_Servers				(CSG_String  &Servers);
+	int							Get_Servers				(CSG_Strings &Servers);
+	CSG_Strings					Get_Servers				(void);
+
+	int							Get_Connections			(CSG_String &Connections);
+	CSG_Strings					Get_Connections			(void);
+
+	int							Get_Count				(void)		{	return( m_nConnections );	}
+	CSG_PG_Connection *			Get_Connection			(int Index)	{	return( Index >= 0 && Index < m_nConnections ? m_pConnections[Index] : NULL );	}
+	CSG_PG_Connection *			Get_Connection			(const CSG_String &Name);
+	CSG_PG_Connection *			Add_Connection			(const CSG_String &Name, const CSG_String &User, const CSG_String &Password, const CSG_String &Host = "localhost", int Port = 5432);
+	bool						Del_Connection			(int Index                     , bool bCommit);
+	bool						Del_Connection			(const CSG_String &Name        , bool bCommit);
+	bool						Del_Connection			(CSG_PG_Connection *pConnection, bool bCommit);
+
+
+private:
+
+	int							m_nConnections;
+
+	CSG_PG_Connection			**m_pConnections;
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class db_pgsql_EXPORT CSG_PG_Module : public CSG_Module
+{
+public:
+	CSG_PG_Module(void);
+
+
+protected:
+
+	virtual bool				On_Before_Execution		(void);
+	virtual bool				On_After_Execution		(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters)	{}
+
+	CSG_PG_Connection *			Get_Connection			(void)	{	return( m_pConnection );	}
+
+	bool						Add_SRID_Picker			(CSG_Parameters *pParameters = NULL);
+	bool						Set_SRID_Picker_Enabled	(CSG_Parameters *pParameters, bool bEnable = true);
+	bool						Set_SRID				(CSG_Parameters *pParameters, int SRID);
+	int							Get_SRID				(CSG_Parameters *pParameters = NULL);
+
+	static bool					Set_Constraints			(CSG_Parameters *pParameters, const CSG_String &Identifier);
+	static CSG_Buffer			Get_Constraints			(CSG_Parameters *pParameters, const CSG_String &Identifier);
+
+
+private:
+
+	CSG_PG_Connection			*m_pConnection;
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+db_pgsql_EXPORT CSG_PG_Connections &	SG_PG_Get_Connection_Manager	(void);
+
+//---------------------------------------------------------
+db_pgsql_EXPORT bool					SG_PG_is_Supported				(void);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__db_pgsql_H
diff --git a/src/modules/db/db_pgsql/get_connection.cpp b/src/modules/db/db_pgsql/get_connection.cpp
new file mode 100644
index 0000000..ebca6dc
--- /dev/null
+++ b/src/modules/db/db_pgsql/get_connection.cpp
@@ -0,0 +1,583 @@
+/**********************************************************
+ * Version $Id: get_connection.cpp 1509 2012-11-01 16:39:43Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Get_Connection.cpp                  //
+//                                                       //
+//                 Copyright (C) 2013 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 "get_connection.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGet_Connections::CGet_Connections(void)
+{
+	Set_Name		(_TL("List PostgreSQL Connections"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Lists all PostgreSQL sources."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "CONNECTIONS"		, _TL("Connections"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+//---------------------------------------------------------
+bool CGet_Connections::On_Execute(void)
+{
+	CSG_Table	*pConnections	= Parameters("CONNECTIONS")->asTable();
+
+	pConnections->Destroy();
+	pConnections->Set_Name(_TL("PostgreSQL Connections"));
+
+	pConnections->Add_Field(_TL("Name"    ), SG_DATATYPE_String);
+	pConnections->Add_Field(_TL("Host"    ), SG_DATATYPE_String);
+	pConnections->Add_Field(_TL("Port"    ), SG_DATATYPE_Int);
+	pConnections->Add_Field(_TL("Database"), SG_DATATYPE_String);
+	pConnections->Add_Field(_TL("Version" ), SG_DATATYPE_String);
+	pConnections->Add_Field(_TL("PostGIS" ), SG_DATATYPE_String);
+
+	for(int i=0; i<SG_PG_Get_Connection_Manager().Get_Count(); i++)
+	{
+		CSG_PG_Connection	*pConnection = SG_PG_Get_Connection_Manager().Get_Connection(i);
+		CSG_Table_Record	*pRecord     = pConnections->Add_Record();
+
+		pRecord->Set_Value(0, pConnection->Get_Connection());
+		pRecord->Set_Value(1, pConnection->Get_Host());
+		pRecord->Set_Value(2, pConnection->Get_Port());
+		pRecord->Set_Value(3, pConnection->Get_DBName());
+		pRecord->Set_Value(4, pConnection->Get_Version());
+		pRecord->Set_Value(5, pConnection->Get_PostGIS());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGet_Connection::CGet_Connection(void)
+{
+	Set_Name		(_TL("Connect to PostgreSQL"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Connect to PostgreSQL data source."
+	));
+
+	Parameters.Add_String(
+		NULL	, "PG_HOST"		, _TL("Host"),
+		_TL("Password"),
+		"localhost"
+	);
+
+	Parameters.Add_Value(
+		NULL	, "PG_PORT"		, _TL("Port"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 5432, 0, true
+	);
+
+	Parameters.Add_String(
+		NULL	, "PG_NAME"		, _TL("Database"),
+		_TL("Database Name"),
+		"geo_test"
+	);
+
+	Parameters.Add_String(
+		NULL	, "PG_USER"		, _TL("User"),
+		_TL("User Name"),
+		"postgres"
+	);
+
+	Parameters.Add_String(
+		NULL	, "PG_PWD"		, _TL("Password"),
+		_TL("Password"),
+		"postgres", false, true
+	);
+}
+
+//---------------------------------------------------------
+bool CGet_Connection::On_Execute(void)
+{
+	CSG_String	Connection	= CSG_String::Format(SG_T("%s [%s:%d]"),
+		Parameters("PG_NAME")->asString(),
+		Parameters("PG_HOST")->asString(),
+		Parameters("PG_PORT")->asInt()
+	);
+
+	if( SG_PG_Get_Connection_Manager().Get_Connection(Connection) )
+	{
+		Message_Add(Connection + ": " + _TL("PostgreSQL source is already connected"));
+
+		return( false );
+	}
+
+	CSG_PG_Connection	*pConnection	= SG_PG_Get_Connection_Manager().Add_Connection(
+		Parameters("PG_NAME")->asString(),
+		Parameters("PG_USER")->asString(),
+		Parameters("PG_PWD" )->asString(),
+		Parameters("PG_HOST")->asString(),
+		Parameters("PG_PORT")->asInt()
+	);
+
+	if( pConnection )
+	{
+		Message_Add(Connection + ": " + _TL("PostgreSQL source connected"));
+
+		pConnection->GUI_Update();
+
+		return( true );
+	}
+
+	Message_Add(Connection + ": " + _TL("could not connect to PostgreSQL source"));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CDel_Connection::CDel_Connection(void)
+{
+	Set_Name		(_TL("Disconnect from PostgreSQL"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Disconnect PostgreSQL data source."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TRANSACT"	, _TL("Transactions"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("rollback"),
+			_TL("commit")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+bool CDel_Connection::On_Execute(void)
+{
+	CSG_String	Connection	= Get_Connection()->Get_Connection();
+
+	if( SG_PG_Get_Connection_Manager().Del_Connection(Get_Connection(), Parameters("TRANSACT")->asInt() == 1) )
+	{
+		Message_Add(Connection + ": " + _TL("PostgreSQL source disconnected"));
+
+		SG_UI_ODBC_Update(Connection);
+
+		return( true );
+	}
+
+	Message_Add(Connection + ": " + _TL("could not disconnect PostgreSQL source"));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CDel_Connections::CDel_Connections(void)
+{
+	Set_Name		(_TL("Disconnect All"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Disconnects all PostgreSQL connections."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TRANSACT"	, _TL("Transactions"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("rollback"),
+			_TL("commit")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+bool CDel_Connections::On_Before_Execution(void)
+{
+	if( SG_PG_Get_Connection_Manager().Get_Count() > 0 )
+	{
+		return( true );
+	}
+
+	Message_Dlg(
+		_TL("No PostgreSQL connection available!"),
+		_TL("PostgreSQL Database Connection Error")
+	);
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CDel_Connections::On_Execute(void)
+{
+	bool	bCommit	= Parameters("TRANSACT")->asInt() == 1;
+
+	CSG_PG_Connections	&Manager	= SG_PG_Get_Connection_Manager();
+
+	for(int i=Manager.Get_Count()-1; i>=0; i--)
+	{
+		Manager.Del_Connection(i, bCommit);
+	}
+
+	SG_UI_ODBC_Update("");
+
+	return( Manager.Get_Count() == 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTransaction_Start::CTransaction_Start(void)
+{
+	Set_Name		(_TL("Begin Transaction"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Begins a transaction, which will be finished later with a commit or rollback. "
+		"Tries to add a save point, if already in transaction mode. "
+	));
+
+	Parameters.Add_String(
+		NULL	, "SAVEPOINT"	, _TL("Save Point"),
+		_TL(""),
+		"SAVEPOINT_01"
+	);
+}
+
+//---------------------------------------------------------
+void CTransaction_Start::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	pParameters->Get_Parameter("SAVEPOINT")->Set_Enabled(Get_Connection()->is_Transaction());
+}
+
+//---------------------------------------------------------
+bool CTransaction_Start::On_Execute(void)
+{
+	if( !Get_Connection()->is_Transaction() )
+	{
+		if( Get_Connection()->Begin() )
+		{
+			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("transaction started"));
+
+			return( true );
+		}
+
+		Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("could not start transaction"));
+	}
+	else
+	{
+		if( Get_Connection()->Begin(Parameters("SAVEPOINT")->asString()) )
+		{
+			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("save point added"));
+
+			return( true );
+		}
+
+		Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("could not add save point"));
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTransaction_Stop::CTransaction_Stop(void)
+{
+	Set_Name		(_TL("Commit/Rollback Transaction"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Execute a commit or rollback on open transactions with PostgreSQL source."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TRANSACT"	, _TL("Transactions"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("rollback"),
+			_TL("commit")
+		), 1
+	);
+
+	Parameters.Add_String(
+		NULL	, "SAVEPOINT"	, _TL("Save Point"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+bool CTransaction_Stop::On_Execute(void)
+{
+	if( !Get_Connection()->is_Transaction() )
+	{
+		Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("not in transaction"));
+
+		return( false );
+	}
+
+	if( Parameters("TRANSACT")->asInt() == 1 )
+	{
+		if( Get_Connection()->Commit(Parameters("SAVEPOINT")->asString()) )
+		{
+			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("open transactions committed"));
+
+			SG_UI_ODBC_Update(Get_Connection()->Get_Connection());
+
+			return( true );
+		}
+	}
+	else
+	{
+		if( Get_Connection()->Rollback(Parameters("SAVEPOINT")->asString()) )
+		{
+			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("open transactions rolled back"));
+
+			SG_UI_ODBC_Update(Get_Connection()->Get_Connection());
+
+			return( true );
+		}
+	}
+
+	Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("could not commit/rollback transactions."));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CExecute_SQL::CExecute_SQL(void)
+{
+	Set_Name		(_TL("Execute SQL"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Execute SQL commands on a connected PostgreSQL source. "
+		"Separate different commands with a semicolon (\';\'). "
+	));
+
+	Parameters.Add_String(
+		NULL	, "SQL"			, _TL("SQL Statment"),
+		_TL(""),
+		SG_T("CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);\n")
+		SG_T("INSERT INTO myTable1 (Col1, Col2) VALUES(\'First Value\', 1);\n")
+		SG_T("DROP TABLE myTable1;\n"),
+		true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "OUTPUT"		, _TL("Show Results"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "STOP"		, _TL("Stop on Error"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+//---------------------------------------------------------
+bool CExecute_SQL::On_Execute(void)
+{
+	//-----------------------------------------------------
+	bool		bOutput	= Parameters("OUTPUT")->asBool  ();
+	bool		bStop	= Parameters("STOP"  )->asBool  ();
+	CSG_String	SQL		= Parameters("SQL"   )->asString();
+
+	//-----------------------------------------------------
+	if( SQL.Find(SG_T(';')) < 0 )
+	{
+		return( Get_Connection()->Execute(SQL) );
+	}
+
+	//-----------------------------------------------------
+	int		nSuccess = 0, nErrors = 0;
+
+	SQL	+= SG_T(';');
+
+	do
+	{
+		CSG_String	s	= SQL.BeforeFirst(SG_T(';'));
+
+		s.Trim();
+
+		if( s.Length() > 0 )
+		{
+			CSG_Table	Table, *pTable;	pTable	= bOutput ? &Table : NULL;
+
+			Message_Add(s);
+
+			if( Get_Connection()->Execute(s, pTable) )
+			{
+				nSuccess++;
+
+				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("okay")), false);
+
+				if( pTable && pTable->Get_Count() )
+				{
+					int		iField, iRecord;
+
+					s	= "\n";
+
+					for(iField=0; iField<pTable->Get_Field_Count(); iField++)
+					{
+						s	+= iField > 0 ? "\t" : "\n";
+						s	+= pTable->Get_Field_Name(iField);
+					}
+
+					s	= "\n___";
+
+					for(iRecord=0; iRecord<pTable->Get_Count(); iRecord++)
+					{
+						CSG_Table_Record	*pRecord	= pTable->Get_Record(iRecord);
+
+						for(iField=0; iField<pTable->Get_Field_Count(); iField++)
+						{
+							s	+= iField > 0 ? "\t" : "\n";
+							s	+= pRecord->asString(iField);
+						}
+
+						Message_Add(s, false);	s.Clear();
+					}
+
+					Message_Add("\n", false);
+				}
+			}
+			else
+			{
+				nErrors++;
+
+				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("failed")));
+
+				if( bStop )
+				{
+					return( false );
+				}
+			}
+		}
+
+		SQL	= SQL.AfterFirst(SG_T(';'));
+	}
+	while( SQL.Length() > 0 );
+
+	return( nErrors == 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_pgsql/get_connection.h b/src/modules/db/db_pgsql/get_connection.h
new file mode 100644
index 0000000..1d38953
--- /dev/null
+++ b/src/modules/db/db_pgsql/get_connection.h
@@ -0,0 +1,225 @@
+/**********************************************************
+ * Version $Id: get_connection.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Get_Connection.h                    //
+//                                                       //
+//                 Copyright (C) 2013 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__Get_Connection_H
+#define HEADER_INCLUDED__Get_Connection_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGet_Connections : public CSG_Module
+{
+public:
+	CGet_Connections(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGet_Connection : public CSG_Module
+{
+public:
+	CGet_Connection(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CDel_Connection : public CSG_PG_Module
+{
+public:
+	CDel_Connection(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CDel_Connections : public CSG_Module
+{
+public:
+	CDel_Connections(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Before_Execution		(void);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTransaction_Start : public CSG_PG_Module
+{
+public:
+	CTransaction_Start(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTransaction_Stop : public CSG_PG_Module
+{
+public:
+	CTransaction_Stop(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CExecute_SQL : public CSG_PG_Module
+{
+public:
+	CExecute_SQL(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Get_Connection_H
diff --git a/src/modules/db/db_pgsql/pgis_raster.cpp b/src/modules/db/db_pgsql/pgis_raster.cpp
new file mode 100644
index 0000000..972de58
--- /dev/null
+++ b/src/modules/db/db_pgsql/pgis_raster.cpp
@@ -0,0 +1,337 @@
+/**********************************************************
+ * Version $Id: pgis_raster.cpp 1646 2013-04-10 16:29:00Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    pgis_raster.cpp                    //
+//                                                       //
+//                 Copyright (C) 2013 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 "pgis_raster.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CRaster_Load::CRaster_Load(void)
+{
+	Set_Name		(_TL("Import Raster from PostGIS"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Imports grids from a PostGIS database."
+	));
+
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CRaster_Load::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_String	s;
+	CSG_Table	t;
+
+	if( Get_Connection()->Table_Load(t, SG_T("raster_columns")) )
+	{
+		for(int i=0; i<t.Get_Count(); i++)
+		{
+			s	+= t[i].asString(SG_T("r_table_name")) + CSG_String("|");
+		}
+	}
+
+	pParameters->Get_Parameter("TABLES")->asChoice()->Set_Items(s);
+}
+
+//---------------------------------------------------------
+bool CRaster_Load::On_Execute(void)
+{
+	CSG_String	Table	= Parameters("TABLES")->asString();
+
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
+
+	pGrids->Del_Items();
+
+	if( !Get_Connection()->Raster_Load(Table, "", "", "", pGrids) )//, "rid=4") )
+	{
+		return( false );
+	}
+
+	return( pGrids->Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CRaster_Save::CRaster_Save(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Export Raster to PostGIS"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Exports grids to a PostGIS database."
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "GRID_SYSTEM"	, _TL("Grid System"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_List(
+		pNode	, "GRIDS"		, _TL("Bands"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_String(
+		NULL	, "NAME"		, _TL("Table Name"),
+		_TL(""),
+		""
+	);
+
+	Parameters.Add_Value(
+		NULL	, "GRID_NAME"	, _TL("Add Grid Name Field"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Add_SRID_Picker();
+}
+
+//---------------------------------------------------------
+bool CRaster_Save::On_Execute(void)
+{
+	if( !Get_Connection()->Table_Exists(SG_T("spatial_ref_sys")) || !Get_Connection()->Table_Exists(SG_T("geometry_columns")) )
+	{
+		SG_UI_Dlg_Message(_TL("Not a valid PostGIS database!"), _TL("Database Connection Error"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
+
+	CSG_String	SavePoint, Name	= Parameters("NAME")->asString();
+
+	if( Name.Length() == 0 )
+		return( false );
+
+	bool	bGridName	= Parameters("GRID_NAME")->asBool();
+
+	//-----------------------------------------------------
+	Get_Connection()->Begin(SavePoint = Get_Connection()->is_Transaction() ? "RASTER_SAVE" : "");
+
+	//-----------------------------------------------------
+	if( !Get_Connection()->Table_Exists(Name) )
+	{
+		CSG_String	SQL	= "CREATE TABLE \"" + Name + "\" (\"rid\" serial PRIMARY KEY, \"raster\" raster"
+			+ (bGridName ? ", \"name\" varchar(64))" : ")");
+		
+		if( !Get_Connection()->Execute(SQL) )
+		{
+			Get_Connection()->Rollback(SavePoint);
+
+			return( false );
+		}
+	}
+
+	//-----------------------------------------------------
+	for(int i=0; i<pGrids->Get_Count(); i++)
+	{
+		CSG_Bytes	WKB;
+
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %s [%d/%d]"), _TL("export grid"), pGrids->asGrid(i)->Get_Name(), i + 1, pGrids->Get_Count()));
+
+		if( !bGridName )
+		{
+			if( !Get_Connection()->Raster_Save(pGrids->asGrid(i), Get_SRID(), Name, "") )
+			{
+				Get_Connection()->Rollback(SavePoint);
+
+				return( false );
+			}
+		}
+		else if( CSG_Grid_OGIS_Converter::to_WKBinary(WKB, pGrids->asGrid(i), Get_SRID()) )
+		{
+			CSG_String	SQL	= "INSERT INTO \"" + Name + "\" (\"raster\", \"name\") VALUES("
+				+ "ST_AddBand('" + WKB.toHexString() + "'::raster, '"
+				+ CSG_PG_Connection::Get_Raster_Type_To_SQL(pGrids->asGrid(i)->Get_Type()) + "'::text, 0, NULL), '"
+				+ pGrids->asGrid(i)->Get_Name() + "')";
+
+			if( !Get_Connection()->Execute(SQL) )
+			{
+				Get_Connection()->Rollback(SavePoint);
+
+				return( false );
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Get_Connection()->Commit(SavePoint);
+
+	Get_Connection()->GUI_Update();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CRaster_SRID_Update::CRaster_SRID_Update(void)
+{
+	Set_Name		(_TL("Update Raster SRID"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		" Change the SRID of all rasters in the user-specified column and table."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+
+	Add_SRID_Picker();
+}
+
+//---------------------------------------------------------
+void CRaster_SRID_Update::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_String	s;
+	CSG_Table	t;
+
+	if( Get_Connection()->Table_Load(t, SG_T("raster_columns")) )
+	{
+		for(int i=0; i<t.Get_Count(); i++)
+		{
+			s	+= t[i].asString(SG_T("r_table_name")) + CSG_String("|");
+		}
+	}
+
+	pParameters->Get_Parameter("TABLES")->asChoice()->Set_Items(s);
+}
+
+//---------------------------------------------------------
+bool CRaster_SRID_Update::On_Execute(void)
+{
+	if( !Get_Connection()->has_PostGIS(2.1) )	{	Error_Set(_TL("not supported by PostGIS versions less than 2.1"));	return( false );	}
+
+	//-----------------------------------------------------
+	CSG_String	Select;
+	CSG_Table	Table;
+
+	Select.Printf(SG_T("r_table_name='%s'"), Parameters("TABLES")->asString());
+
+	if( !Get_Connection()->Table_Load(Table, "raster_columns", "*", Select) || Table.Get_Count() != 1 )
+	{
+		return( false );
+	}
+
+	Select.Printf(SG_T("SELECT UpdateRasterSRID('%s', '%s', %d)"),
+		Parameters("TABLES")->asString(),
+		Table[0].asString("r_raster_column"),
+		Get_SRID()
+	);
+
+	//-----------------------------------------------------
+	if( !Get_Connection()->Execute(Select) )
+	{
+		return( false );
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+	
\ No newline at end of file
diff --git a/src/modules/db/db_pgsql/pgis_raster.h b/src/modules/db/db_pgsql/pgis_raster.h
new file mode 100644
index 0000000..49c444a
--- /dev/null
+++ b/src/modules/db/db_pgsql/pgis_raster.h
@@ -0,0 +1,149 @@
+/**********************************************************
+ * Version $Id: pgis_raster.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     pgis_raster.h                     //
+//                                                       //
+//                 Copyright (C) 2013 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__pgis_raster_H
+#define HEADER_INCLUDED__pgis_raster_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CRaster_Load : public CSG_PG_Module
+{
+public:
+	CRaster_Load(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Raster") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CRaster_Save : public CSG_PG_Module
+{
+public:
+	CRaster_Save(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Raster") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CRaster_SRID_Update : public CSG_PG_Module
+{
+public:
+	CRaster_SRID_Update(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Raster") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__pgis_raster_H
diff --git a/src/modules/db/db_pgsql/pgis_shapes.cpp b/src/modules/db/db_pgsql/pgis_shapes.cpp
new file mode 100644
index 0000000..decadad
--- /dev/null
+++ b/src/modules/db/db_pgsql/pgis_shapes.cpp
@@ -0,0 +1,445 @@
+/**********************************************************
+ * Version $Id: pgis_shapes.cpp 1646 2013-04-10 16:29:00Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   PGIS_Shapes.cpp                     //
+//                                                       //
+//                 Copyright (C) 2013 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 "pgis_shapes.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CShapes_Load::CShapes_Load(void)
+{
+	Set_Name		(_TL("Import Shapes from PostGIS"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Imports shapes from a PostGIS database."
+	));
+
+	Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CShapes_Load::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_String	s;
+	CSG_Table	t;
+
+	if( Get_Connection()->Table_Load(t, SG_T("geometry_columns")) )
+	{
+		for(int i=0; i<t.Get_Count(); i++)
+		{
+			s	+= t[i].asString(SG_T("f_table_name")) + CSG_String("|");
+		}
+	}
+
+	Parameters("TABLES")->asChoice()->Set_Items(s);
+}
+
+//---------------------------------------------------------
+bool CShapes_Load::On_Execute(void)
+{
+	CSG_Shapes	*pShapes	= Parameters("SHAPES")->asShapes();
+	CSG_String	Name		= Parameters("TABLES")->asString();
+
+	if( !Get_Connection()->Shapes_Load(pShapes, Name) )
+	{
+		Error_Set(_TL("unable to load vector data from PostGIS database") + CSG_String(":\n") + Name);
+
+		return( false );
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CShapes_Save::CShapes_Save(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Export Shapes to PostGIS"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Exports shapes to a PostGIS database."
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Set_Constraints(&Parameters, "SHAPES");
+
+	Parameters.Add_String(
+		NULL	, "NAME"		, _TL("Table Name"),
+		_TL("if empty shapes layers's name is used as table name"),
+		SG_T("")
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "EXISTS"		, _TL("If table exists..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("abort export"),
+			_TL("replace existing table"),
+			_TL("append records, if table structure allows")
+		), 0
+	);
+
+	Add_SRID_Picker();
+}
+
+//---------------------------------------------------------
+int CShapes_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHAPES") )
+	{
+		CSG_Shapes	*pShapes	= pParameter->asShapes() ? pParameter->asShapes() : NULL;
+
+		pParameters->Get_Parameter("NAME")->Set_Value(pShapes ? pShapes->Get_Name() : SG_T(""));
+
+		Set_SRID(pParameters, pShapes ? pShapes->Get_Projection().Get_EPSG() : -1);
+	}
+
+	return( CSG_PG_Module::On_Parameter_Changed(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+bool CShapes_Save::On_Execute(void)
+{
+	if( !Get_Connection()->has_PostGIS() )
+	{
+		Error_Set(_TL("not a valid PostGIS database!"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pShapes;
+	CSG_String	SQL, Name, Type, Field, SavePoint;
+
+	pShapes		= Parameters("SHAPES")->asShapes();
+	Name		= Parameters("NAME"  )->asString();	if( Name.Length() == 0 )	Name	= pShapes->Get_Name();
+
+	Field		= "geometry";
+
+	int	SRID	= Get_SRID();
+
+	//-----------------------------------------------------
+	if( !CSG_Shapes_OGIS_Converter::from_ShapeType(Type, pShapes->Get_Type(), pShapes->Get_Vertex_Type()) )
+	{
+		Error_Set(_TL("invalid or unsupported shape or vertex type"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Get_Connection()->Begin(SavePoint = Get_Connection()->is_Transaction() ? "SHAPES_SAVE" : "");
+
+	//-----------------------------------------------------
+	if( Get_Connection()->Table_Exists(Name) )
+	{
+		Message_Add(_TL("table already exists") + CSG_String(": ") + Name);
+
+		switch( Parameters("EXISTS")->asInt() )
+		{
+		case 0:	// abort export
+			return( false );
+
+		case 1:	// replace existing table
+			Message_Add(_TL("trying to drop table") + CSG_String(": ") + Name);
+
+			if( !Get_Connection()->Table_Drop(Name, false) )
+			{
+				Message_Add(CSG_String(" ...") + _TL("failed") + "!");
+
+				return( false );
+			}
+
+			break;
+
+		case 2:	// append records, if table structure allows
+			break;
+		}
+	}
+
+	//-----------------------------------------------------
+	if( !Get_Connection()->Table_Exists(Name) )
+	{
+		if( !Get_Connection()->Table_Create(Name, *pShapes, Get_Constraints(&Parameters, "SHAPES"), false) )
+		{
+			Error_Set(_TL("could not create table"));
+
+			Get_Connection()->Rollback(SavePoint);
+
+			return( false );
+		}
+
+		//-------------------------------------------------
+		// SELECT AddGeometryColumn(<table_name>, <column_name>, <srid>, <type>, <dimension>)
+
+		SQL.Printf(SG_T("SELECT AddGeometryColumn('%s', '%s', %d, '%s', %d)"),
+			Name.c_str(), Field.c_str(), SRID, Type.c_str(),
+			pShapes->Get_Vertex_Type() == SG_VERTEX_TYPE_XY  ? 2 :
+			pShapes->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZ ? 3 : 4
+		);
+
+		if( !Get_Connection()->Execute(SQL) )
+		{
+			Error_Set(_TL("could not create geometry field"));
+
+			Get_Connection()->Rollback(SavePoint);
+
+			return( false );
+		}
+	}
+
+	//-----------------------------------------------------
+	bool	bBinary	= Get_Connection()->has_Version(9);
+
+	int		iShape, iField, nAdded;
+
+	CSG_String	Insert	= "INSERT INTO \"" + Name + "\" (" + Field;
+
+	for(iField=0; iField<pShapes->Get_Field_Count(); iField++)
+	{
+		Insert	+= CSG_String(", ") + pShapes->Get_Field_Name(iField);
+	}
+
+	Insert	+= ") VALUES (";
+
+	//-----------------------------------------------------
+	for(iShape=0, nAdded=0; iShape==nAdded && iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+
+		if( pShape->is_Valid() )
+		{
+			SQL	= Insert;
+
+			if( bBinary )
+			{
+				CSG_Bytes	WKB;
+
+				CSG_Shapes_OGIS_Converter::to_WKBinary(pShape, WKB);
+
+				SQL	+= "ST_GeomFromWKB(E'\\\\x" + WKB.toHexString() + CSG_String::Format(SG_T("', %d)"), SRID);
+			}
+			else
+			{
+				CSG_String	WKT;
+
+				CSG_Shapes_OGIS_Converter::to_WKText(pShape, WKT);
+
+				SQL	+= "ST_GeomFromText('" + WKT + CSG_String::Format(SG_T("', %d)"), SRID);
+			}
+
+			for(iField=0; iField<pShapes->Get_Field_Count(); iField++)
+			{
+				CSG_String	s = pShape->asString(iField);
+
+				if( pShapes->Get_Field_Type(iField) == SG_DATATYPE_String )
+				{
+					s.Replace(SG_T("'"), SG_T("\""));
+					s	= SG_T("'") + s + SG_T("'");
+				}
+
+				SQL	+= SG_T(", ")  + s;
+			}
+
+			SQL	+= SG_T(")");
+
+			if( Get_Connection()->Execute(SQL) )
+			{
+				nAdded++;
+			}
+			else
+			{
+				Message_Add(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("could not save shape"), 1 + iShape, pShapes->Get_Count()));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( nAdded < pShapes->Get_Count() )
+	{
+		Message_Add(SQL);
+
+		Get_Connection()->Rollback(SavePoint);
+
+		return( false );
+	}
+
+	Get_Connection()->Commit(SavePoint);
+
+	Get_Connection()->GUI_Update();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CShapes_SRID_Update::CShapes_SRID_Update(void)
+{
+	Set_Name		(_TL("Update Shapes SRID"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		" Change the SRID of all geometries in the user-specified column and table."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+
+	Add_SRID_Picker();
+}
+
+//---------------------------------------------------------
+void CShapes_SRID_Update::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_String	s;
+	CSG_Table	t;
+
+	if( Get_Connection()->Table_Load(t, SG_T("geometry_columns")) )
+	{
+		for(int i=0; i<t.Get_Count(); i++)
+		{
+			s	+= t[i].asString(SG_T("f_table_name")) + CSG_String("|");
+		}
+	}
+
+	pParameters->Get_Parameter("TABLES")->asChoice()->Set_Items(s);
+}
+
+//---------------------------------------------------------
+bool CShapes_SRID_Update::On_Execute(void)
+{
+	if( !Get_Connection()->has_PostGIS() )	{	Error_Set(_TL("no PostGIS layer"));	return( false );	}
+
+	//-----------------------------------------------------
+	CSG_String	Select;
+	CSG_Table	Table;
+
+	Select.Printf(SG_T("f_table_name='%s'"), Parameters("TABLES")->asString());
+
+	if( !Get_Connection()->Table_Load(Table, "geometry_columns", "*", Select) || Table.Get_Count() != 1 )
+	{
+		return( false );
+	}
+
+	Select.Printf(SG_T("SELECT UpdateGeometrySRID('%s', '%s', %d)"),
+		Parameters("TABLES")->asString(),
+		Table[0].asString("f_geometry_column"),
+		Get_SRID()
+	);
+
+	//-----------------------------------------------------
+	if( !Get_Connection()->Execute(Select) )
+	{
+		return( false );
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_pgsql/pgis_shapes.h b/src/modules/db/db_pgsql/pgis_shapes.h
new file mode 100644
index 0000000..cafe375
--- /dev/null
+++ b/src/modules/db/db_pgsql/pgis_shapes.h
@@ -0,0 +1,151 @@
+/**********************************************************
+ * Version $Id: pgis_shapes.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     PGIS_Shapes.h                     //
+//                                                       //
+//                 Copyright (C) 2013 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__PGIS_Shapes_H
+#define HEADER_INCLUDED__PGIS_Shapes_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CShapes_Load : public CSG_PG_Module
+{
+public:
+	CShapes_Load(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Shapes") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CShapes_Save : public CSG_PG_Module
+{
+public:
+	CShapes_Save(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Shapes") );	}
+
+
+protected:
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CShapes_SRID_Update : public CSG_PG_Module
+{
+public:
+	CShapes_SRID_Update(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Shapes") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__PGIS_Shapes_H
diff --git a/src/modules/db/db_pgsql/table.cpp b/src/modules/db/db_pgsql/table.cpp
new file mode 100644
index 0000000..e39adee
--- /dev/null
+++ b/src/modules/db/db_pgsql/table.cpp
@@ -0,0 +1,489 @@
+/**********************************************************
+ * Version $Id: table.cpp 1508 2012-11-01 16:13:43Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       Table.cpp                       //
+//                                                       //
+//                 Copyright (C) 2013 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 "get_connection.h"
+
+#include "table.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_List::CTable_List(void)
+{
+	Set_Name		(_TL("List Tables"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Lists all tables of an PostgreSQL data source."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+//---------------------------------------------------------
+bool CTable_List::On_Execute(void)
+{
+	CSG_Strings	Tables;
+	CSG_Table	*pTables	= Parameters("TABLES")->asTable();
+
+	pTables->Destroy();
+	pTables->Set_Name(Get_Connection()->Get_Connection() + " [" + _TL("Tables") + "]");
+
+	pTables->Add_Field(_TL("Table"), SG_DATATYPE_String);
+	pTables->Add_Field(_TL("Type" ), SG_DATATYPE_String);
+
+	if( Get_Connection()->Get_Tables(Tables) )
+	{
+		CSG_Table	t;
+
+		for(int i=0; i<Tables.Get_Count(); i++)
+		{
+			CSG_Table_Record	*pTable	= pTables->Add_Record();
+
+			pTable->Set_Value(0, Tables[i]);
+
+			if( Get_Connection()->Table_Load(t, "geometry_columns", "type", CSG_String::Format(SG_T("f_table_name='%s'"), Tables[i].c_str())) && t.Get_Count() == 1 )
+			{
+				pTable->Set_Value(1, t[0][0].asString());
+			}
+			else if( Get_Connection()->Table_Load(t, "raster_columns", "*", CSG_String::Format(SG_T("r_table_name='%s'"), Tables[i].c_str())) && t.Get_Count() == 1 )
+			{
+				pTable->Set_Value(1, "RASTER");
+			}
+			else
+			{
+				pTable->Set_Value(1, "TABLE");
+			}
+		}
+	}
+
+	return( pTables->Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Info::CTable_Info(void)
+{
+	Set_Name		(_TL("List Table Fields"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Loads table information from PostgreSQL data source."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Field Description"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CTable_Info::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
+
+	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
+	pParameter->Set_Value(pParameter->asString());
+}
+
+//---------------------------------------------------------
+bool CTable_Info::On_Execute(void)
+{
+	CSG_String	Table	= Parameters("TABLES")->asString();
+	CSG_Table	*pTable	= Parameters("TABLE" )->asTable();
+
+	CSG_Table tab = Get_Connection()->Get_Field_Desc(Table);
+	pTable->Assign(&tab);
+	pTable->Set_Name(Table + " [" + _TL("Field Description") + "]");
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Load::CTable_Load(void)
+{
+	Set_Name		(_TL("Import Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Imports a table from a PostgreSQL database."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Table"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CTable_Load::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
+
+	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
+	pParameter->Set_Value(pParameter->asString());
+}
+
+//---------------------------------------------------------
+bool CTable_Load::On_Execute(void)
+{
+	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
+
+	return( Get_Connection()->Table_Load(*pTable, Parameters("TABLES")->asString()) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Save::CTable_Save(void)
+{
+	Set_Name		(_TL("Export Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Exports a table to a PostgreSQL database."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Table"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Set_Constraints(&Parameters, "TABLE");
+
+	Parameters.Add_String(
+		NULL	, "NAME"		, _TL("Table Name"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "EXISTS"		, _TL("If table exists..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("abort export"),
+			_TL("replace existing table"),
+			_TL("append records, if table structure allows")
+		), 0
+	);
+}
+
+//---------------------------------------------------------
+int CTable_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) )
+	{
+		pParameters->Get_Parameter("NAME")->Set_Value(pParameter->asTable() ? pParameter->asTable()->Get_Name() : SG_T(""));
+	}
+
+	return( CSG_PG_Module::On_Parameter_Changed(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+bool CTable_Save::On_Execute(void)
+{
+	bool		bResult	= false;
+	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
+	CSG_String	Name	= Parameters("NAME" )->asString();	if( Name.Length() == 0 )	Name	= pTable->Get_Name();
+
+	//-----------------------------------------------------
+	CSG_String	SavePoint;
+
+	Get_Connection()->Begin(SavePoint = Get_Connection()->is_Transaction() ? "SHAPES_SAVE" : "");
+
+	//-----------------------------------------------------
+	if( Get_Connection()->Table_Exists(Name) )
+	{
+		Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Name.c_str()));
+
+		switch( Parameters("EXISTS")->asInt() )
+		{
+		case 0:	// abort export
+			break;
+
+		case 1:	// replace existing table
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("dropping table"), Name.c_str()));
+
+			if( !Get_Connection()->Table_Drop(Name, false) )
+			{
+				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
+			}
+			else
+			{
+				bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(&Parameters, "TABLE"));
+			}
+			break;
+
+		case 2:	// append records, if table structure allows
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("appending to existing table"), Name.c_str()));
+
+			if( !(bResult = Get_Connection()->Table_Insert(Name, *pTable)) )
+			{
+				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
+			}
+			break;
+		}
+	}
+	else
+	{
+		bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(&Parameters, "TABLE"));
+	}
+
+	//-----------------------------------------------------
+	if( !bResult )
+	{
+		Get_Connection()->Rollback(SavePoint);
+	}
+	else
+	{
+		Get_Connection()->Commit(SavePoint);
+
+		Get_Connection()->GUI_Update();
+	}
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Drop::CTable_Drop(void)
+{
+	Set_Name		(_TL("Drop Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Deletes a table from a PostgreSQL database."
+	));
+
+	Parameters.Add_Choice(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		""
+	);
+}
+
+//---------------------------------------------------------
+void CTable_Drop::On_Connection_Changed(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
+
+	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
+	pParameter->Set_Value(pParameter->asString());
+}
+
+//---------------------------------------------------------
+bool CTable_Drop::On_Execute(void)
+{
+	if( Get_Connection()->Table_Drop(Parameters("TABLES")->asChoice()->asString()) )
+	{
+		Get_Connection()->GUI_Update();
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Query::CTable_Query(void)
+{
+	CSG_Parameter	*pNode;
+
+	Set_Name		(_TL("Import Table from SQL Query"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Import a SQL table from a PostgreSQL database."
+	));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Table from SQL Query"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_String(
+		NULL	, "TABLES"		, _TL("Tables"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "FIELDS"		, _TL("Fields"),
+		_TL(""),
+		SG_T("*")
+	);
+
+	Parameters.Add_String(
+		NULL	, "WHERE"		, _TL("Where"),
+		_TL(""),
+		SG_T("")
+	);
+
+	pNode	= Parameters.Add_String(
+		NULL	, "GROUP"		, _TL("Group by"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_String(
+		pNode	, "HAVING"		, _TL("Having"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "ORDER"		, _TL("Order by"),
+		_TL(""),
+		SG_T("")
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTINCT"	, _TL("Distinct"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+//---------------------------------------------------------
+bool CTable_Query::On_Execute(void)
+{
+	CSG_Table	*pTable		= Parameters("TABLE"   )->asTable ();
+	CSG_String	Tables		= Parameters("TABLES"  )->asString();
+	CSG_String	Fields		= Parameters("FIELDS"  )->asString();
+	CSG_String	Where		= Parameters("WHERE"   )->asString();
+	CSG_String	Group		= Parameters("GROUP"   )->asString();
+	CSG_String	Having		= Parameters("HAVING"  )->asString();
+	CSG_String	Order		= Parameters("ORDER"   )->asString();
+	bool		bDistinct	= Parameters("DISTINCT")->asBool  ();
+
+	return( Get_Connection()->Table_Load(*pTable, Tables, Fields, Where, Group, Having, Order, bDistinct) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/db/db_pgsql/table.h b/src/modules/db/db_pgsql/table.h
new file mode 100644
index 0000000..357ee01
--- /dev/null
+++ b/src/modules/db/db_pgsql/table.h
@@ -0,0 +1,213 @@
+/**********************************************************
+ * Version $Id: table.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       db_pgsql                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       Table.h                         //
+//                                                       //
+//                 Copyright (C) 2013 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__Table_H
+#define HEADER_INCLUDED__Table_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_List : public CSG_PG_Module
+{
+public:
+	CTable_List(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Info : public CSG_PG_Module
+{
+public:
+	CTable_Info(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Load : public CSG_PG_Module
+{
+public:
+	CTable_Load(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Save : public CSG_PG_Module
+{
+public:
+	CTable_Save(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Drop : public CSG_PG_Module
+{
+public:
+	CTable_Drop(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Query : public CSG_PG_Module
+{
+public:
+	CTable_Query(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Table_H
diff --git a/src/modules_io/docs/Makefile.am b/src/modules/docs/Makefile.am
similarity index 100%
rename from src/modules_io/docs/Makefile.am
rename to src/modules/docs/Makefile.am
diff --git a/src/modules/docs/Makefile.in b/src/modules/docs/Makefile.in
new file mode 100644
index 0000000..c7983a8
--- /dev/null
+++ b/src/modules/docs/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/docs
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = docs_html docs_pdf
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/docs/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/docs/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/docs/docs_html/CreateWebContent.cpp b/src/modules/docs/docs_html/CreateWebContent.cpp
new file mode 100644
index 0000000..61a738c
--- /dev/null
+++ b/src/modules/docs/docs_html/CreateWebContent.cpp
@@ -0,0 +1,181 @@
+/**********************************************************
+ * Version $Id: CreateWebContent.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    PhotoLinks.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+#include "CreateWebContent.h"
+
+CCreateWebContent::CCreateWebContent(void)
+{
+	CSG_Parameter *pNode;
+	
+	//-----------------------------------------------------
+	Parameters.Set_Name(_TL("Create Web Content"));
+
+	Parameters.Set_Description(_TL(""));
+
+	pNode = Parameters.Add_Shapes(NULL, 
+						"SHAPES", 
+						_TL("Shapes"),
+						_TL(""),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Table_Field(pNode,
+								"NAME",
+								_TL("Name Field"),
+								_TL(""));
+	
+	Parameters.Add_FilePath(NULL,
+							"OUTPUTPATH",
+							_TL("Path for HTML Files"),
+							_TL(""),
+							_TL(""),
+							_TL(""),
+							true,
+							true);
+
+}
+
+CCreateWebContent::~CCreateWebContent(void)
+{}
+
+bool CCreateWebContent::On_Execute(void)
+{
+	m_bDown	= false;
+	m_pShapes = Parameters("SHAPES")->asShapes();
+
+	m_iNameField = Parameters("NAME")->asInt();
+	m_sOutputPath = Parameters("OUTPUTPATH")->asString();
+
+	m_pShapes->Add_Field("HTML", SG_DATATYPE_String);
+	m_iField = m_pShapes->Get_Field_Count() - 1;
+	
+	m_Pictures = new std::vector<CSG_String> [m_pShapes->Get_Count()];
+	m_Links = new std::vector<CSG_String> [m_pShapes->Get_Count()];
+	m_LinksDescription = new std::vector<CSG_String> [m_pShapes->Get_Count()];
+
+	return true ;
+}
+
+bool CCreateWebContent::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
+{
+	int i;
+	int iIndex, iShape;
+	CSG_Rect r;
+
+	switch( Mode ){
+	case MODULE_INTERACTIVE_LDOWN:
+		
+		if( m_bDown == false ){
+			m_bDown	= true;
+			m_ptDown = ptWorld;
+		}//if
+		
+		return true ;
+
+	case MODULE_INTERACTIVE_LUP:
+		if( m_bDown == true ){
+			m_bDown	= false;
+
+			r.Assign(m_ptDown.Get_X(), m_ptDown.Get_Y(), ptWorld.Get_X(), ptWorld.Get_Y());
+
+			if( r.Get_XRange() == 0.0 && r.Get_YRange() == 0.0 ){
+				m_pShapes->Select(m_pShapes->Get_Shape(m_ptDown), is_Shift());
+			}//if
+			else{
+				m_pShapes->Select(r, is_Shift());
+			}//else
+
+			DataObject_Update(m_pShapes, true);
+			
+		}//if
+		
+		return true;
+
+	case MODULE_INTERACTIVE_RDOWN:
+
+		CSG_String	sFileName;
+		CSG_Strings	files;
+		CSG_Parameters	dlg_files;
+		dlg_files.Add_FilePath(NULL, "FILES", _TL("Files"), _TL(""), _TL("Images|*.bmp;*.jpg;*.png;*.tif|HTML Files|*.htm|All Files|*.*"), NULL, false, false, true);
+
+		if( Dlg_Parameters(&dlg_files, _TL("Add Link to Files")) && dlg_files("FILES")->asFilePath()->Get_FilePaths(files) )
+		{
+			for (iShape = 0; iShape < m_pShapes->Get_Selection_Count(); iShape++){
+				iIndex = m_pShapes->Get_Selection(iShape)->Get_Index();
+				for (i = 0; i < files.Get_Count(); i++)
+				{
+					sFileName = "file://";
+					sFileName.Append((CSG_String)files[i]);
+					if (SG_File_Cmp_Extension (files[i],SG_T("htm"))){						
+						m_LinksDescription[iIndex].push_back(SG_File_Get_Name(files[i], true));
+						m_Links[iIndex].push_back(sFileName);
+					}//if
+					else if (  SG_File_Cmp_Extension (files[i],SG_T("bmp")) 
+							|| SG_File_Cmp_Extension (files[i],SG_T("jpg")) 
+							|| SG_File_Cmp_Extension (files[i],SG_T("png")) 				
+							|| SG_File_Cmp_Extension (files[i],SG_T("tif"))){
+						m_Pictures[iIndex].push_back(sFileName);
+					}//else
+				}				
+				sFileName = SG_File_Make_Path(m_sOutputPath.c_str(), m_pShapes->Get_Shape(iIndex)->asString(m_iNameField), SG_T("htm"));
+				m_pShapes->Get_Shape(iIndex)->Set_Value(m_iField, sFileName);
+			}
+		}
+		break;
+
+	}//switch
+
+	return false ;
+
+}//method
+
+bool CCreateWebContent::On_Execute_Finish(void){
+
+	int i,j;
+	CSG_String sFileName;
+	CSG_Doc_HTML HTMLDoc;
+
+	for (i = 0; i < m_pShapes->Get_Count(); i++){
+		Set_Progress(i, m_pShapes->Get_Count());
+		const SG_Char **Pictures;
+
+		if (m_Pictures[i].size() || m_Links[i].size()){
+			HTMLDoc.Open(m_pShapes->Get_Shape(i)->asString(m_iNameField));
+			Pictures = new const SG_Char *[m_Pictures[i].size()];
+			for (j = 0; j < m_Pictures[i].size(); j++){
+				Pictures[j] = m_Pictures[i].at(j).c_str();
+			}//for*/
+		
+			HTMLDoc.AddThumbnails(Pictures, m_Pictures[i].size(), 4);
+			HTMLDoc.AddLineBreak();
+			for (j = 0; j < m_Links[i].size(); j++){
+				HTMLDoc.AddHyperlink(m_LinksDescription[i].at(j).c_str(), m_Links[i].at(j).c_str());
+				HTMLDoc.AddLineBreak();
+			}//for
+
+			sFileName = SG_File_Make_Path(m_sOutputPath.c_str(), m_pShapes->Get_Shape(i)->asString(m_iNameField), SG_T("htm"));
+			HTMLDoc.Save(sFileName);
+		}//if
+
+	}//for
+
+	return true;
+
+}//method
diff --git a/src/modules/docs/docs_html/CreateWebContent.h b/src/modules/docs/docs_html/CreateWebContent.h
new file mode 100644
index 0000000..8a8b48f
--- /dev/null
+++ b/src/modules/docs/docs_html/CreateWebContent.h
@@ -0,0 +1,56 @@
+/**********************************************************
+ * Version $Id: CreateWebContent.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Photolinks.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#ifndef HEADER_INCLUDED__CreateWebContent_H
+#define HEADER_INCLUDED__CreateWebContent_H
+
+#include "doc_html.h"
+#include <vector>
+
+class CCreateWebContent : public CSG_Module_Interactive
+{
+public:
+
+	CCreateWebContent(void);
+	virtual ~CCreateWebContent(void);
+
+protected:
+
+	virtual bool				On_Execute(void);
+	virtual bool				On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+	virtual bool				On_Execute_Finish(void);
+
+private:
+
+	bool						m_bDown;
+	CSG_Point					m_ptDown;
+	CSG_Shapes						*m_pShapes;
+	int							m_iField, m_iNameField;
+	CSG_String					m_sOutputPath;
+
+	std::vector<CSG_String>	*m_Pictures;
+	std::vector<CSG_String>	*m_Links;
+	std::vector<CSG_String>	*m_LinksDescription;
+
+};
+
+#endif // #ifndef HEADER_INCLUDED__CreateWebContent_H
diff --git a/src/modules_io/docs/docs_html/MLB_Interface.cpp b/src/modules/docs/docs_html/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/docs/docs_html/MLB_Interface.cpp
rename to src/modules/docs/docs_html/MLB_Interface.cpp
diff --git a/src/modules_io/docs/docs_html/MLB_Interface.h b/src/modules/docs/docs_html/MLB_Interface.h
similarity index 100%
rename from src/modules_io/docs/docs_html/MLB_Interface.h
rename to src/modules/docs/docs_html/MLB_Interface.h
diff --git a/src/modules_io/docs/docs_html/Makefile.am b/src/modules/docs/docs_html/Makefile.am
similarity index 100%
rename from src/modules_io/docs/docs_html/Makefile.am
rename to src/modules/docs/docs_html/Makefile.am
diff --git a/src/modules/docs/docs_html/Makefile.in b/src/modules/docs/docs_html/Makefile.in
new file mode 100644
index 0000000..5832604
--- /dev/null
+++ b/src/modules/docs/docs_html/Makefile.in
@@ -0,0 +1,641 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/docs/docs_html
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libdocs_html_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libdocs_html_la_OBJECTS = CreateWebContent.lo doc_html.lo \
+	doc_svg.lo MLB_Interface.lo svg_interactive_map.lo
+libdocs_html_la_OBJECTS = $(am_libdocs_html_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libdocs_html_la_SOURCES)
+DIST_SOURCES = $(libdocs_html_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libdocs_html.la
+libdocs_html_la_SOURCES = \
+CreateWebContent.cpp\
+doc_html.cpp\
+doc_svg.cpp\
+MLB_Interface.cpp\
+svg_interactive_map.cpp\
+CreateWebContent.h\
+doc_html.h\
+doc_svg.h\
+MLB_Interface.h\
+svg_interactive_map.h
+
+libdocs_html_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/docs/docs_html/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/docs/docs_html/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libdocs_html.la: $(libdocs_html_la_OBJECTS) $(libdocs_html_la_DEPENDENCIES) $(EXTRA_libdocs_html_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libdocs_html_la_OBJECTS) $(libdocs_html_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/CreateWebContent.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/doc_html.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/doc_svg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svg_interactive_map.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/docs/docs_html/doc_html.cpp b/src/modules/docs/docs_html/doc_html.cpp
similarity index 100%
rename from src/modules_io/docs/docs_html/doc_html.cpp
rename to src/modules/docs/docs_html/doc_html.cpp
diff --git a/src/modules_io/docs/docs_html/doc_html.h b/src/modules/docs/docs_html/doc_html.h
similarity index 100%
rename from src/modules_io/docs/docs_html/doc_html.h
rename to src/modules/docs/docs_html/doc_html.h
diff --git a/src/modules_io/docs/docs_html/doc_svg.cpp b/src/modules/docs/docs_html/doc_svg.cpp
similarity index 100%
rename from src/modules_io/docs/docs_html/doc_svg.cpp
rename to src/modules/docs/docs_html/doc_svg.cpp
diff --git a/src/modules_io/docs/docs_html/doc_svg.h b/src/modules/docs/docs_html/doc_svg.h
similarity index 100%
rename from src/modules_io/docs/docs_html/doc_svg.h
rename to src/modules/docs/docs_html/doc_svg.h
diff --git a/src/modules/docs/docs_html/svg_interactive_map.cpp b/src/modules/docs/docs_html/svg_interactive_map.cpp
new file mode 100644
index 0000000..74bf1f4
--- /dev/null
+++ b/src/modules/docs/docs_html/svg_interactive_map.cpp
@@ -0,0 +1,2897 @@
+/**********************************************************
+ * Version $Id: svg_interactive_map.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       docs_html                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              SVG_Interactive_map.cpp                  //
+//                                                       //
+//          Copyright (C) 2005 by Victor Olaya           //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "svg_interactive_map.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define MAP_WINDOW_WIDTH	550.
+#define MAP_WINDOW_HEIGHT	700.
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSVG_Interactive_Map::CSVG_Interactive_Map(void)
+{
+	Set_Name		(_TL("SVG Interactive Map"));
+
+	Set_Author		(SG_T("V.Olaya"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	Parameters.Add_FilePath(
+		NULL	, "FILENAME"	, _TL("[FLD] SVG File"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|*.svg|%s|*.*"),
+			_TL("SVG - Scalable Vector Graphics Files (*.svg)"),
+			_TL("All Files")
+		), NULL, true, false
+	);
+
+	Parameters.Add_Shapes_List(
+		NULL	, "LIST"		, _TL("Shapes Layers"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("[FLD] Index Layer"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+}
+
+//---------------------------------------------------------
+CSVG_Interactive_Map::~CSVG_Interactive_Map(void)
+{}
+
+//---------------------------------------------------------
+bool CSVG_Interactive_Map::On_Execute(void)
+{
+	CSG_String				FileName;
+	CSG_Shapes				*pIndexLayer;
+	CSVG_Interactive_Map	SVG;
+
+	Process_Set_Text(CSG_String::Format(SG_T("%s..."), _TL("[MSG] Save as Interactive SVG")));
+
+	pIndexLayer		= Parameters("SHAPES")		->asShapes();
+	FileName		= Parameters("FILENAME")	->asString();
+
+	return( SVG.Create_From_Map(Parameters("LIST")->asShapesList(), pIndexLayer, FileName) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSVG_Interactive_Map::Create_From_Map(CSG_Parameter_Shapes_List *pList, CSG_Shapes *pIndexLayer, const SG_Char *Filename)
+{
+	int		i;
+
+	if( pList->Get_Count() <= 0 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_Directory	= SG_File_Get_Path(Filename);
+
+	CSG_Rect	r(pList->asShapes(0)->Get_Extent());
+
+	for(i=1; i<pList->Get_Count(); i++)
+	{
+		r.Union(pList->asShapes(i)->Get_Extent());
+	}
+
+	_Add_Opening(r);
+
+	//-----------------------------------------------------
+	m_sSVGCode.Append(SG_T("<g id=\"mainMapGroup\" transform=\"translate(0,0)\">\n"));
+
+	for(i=pList->Get_Count()-1; i>=0; i--)
+	{
+		_Add_Shapes	(pList->asShapes(i));
+	}
+
+	m_sSVGCode.Append(SG_T("</g>\n</svg>\n"));
+
+	//-----------------------------------------------------
+	_Add_CheckBoxes(pList);
+
+	_Add_ReferenceMap(pIndexLayer, r);
+
+	m_sSVGCode.Append(_Get_Code_Closing_1());
+
+	if( !Save(Filename) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("checkbox")			, SG_T("js")), _Get_Code_CheckBox());
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("mapApp")			, SG_T("js")), _Get_Code_MapApp	());
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("timer")			, SG_T("js")), _Get_Code_Timer	());
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("slider")			, SG_T("js")), _Get_Code_Slider	());
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("helper_functions")	, SG_T("js")), _Get_Code_Helper	());
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("button")			, SG_T("js")), _Get_Code_Buttons	());
+	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("navigation")		, SG_T("js")), CSG_String::Format(SG_T("%s%s"), _Get_Code_Navigation_1(), _Get_Code_Navigation_2()));
+
+	return( true );
+}
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Write_Code(const CSG_String &FileName, const CSG_String &Code)
+{
+	CSG_File	Stream;
+
+	if( Stream.Open(FileName, SG_FILE_W, false) )
+	{
+		Stream.Write(Code);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Add_Opening(CSG_Rect r)
+{
+	CSG_String sViewBox;
+	double Width, Height;
+	double OffsetX, OffsetY;
+
+	m_sSVGCode.Append(_Get_Opening_Code_1());
+	m_sSVGCode.Append(SG_Get_String(r.Get_XRange(),2));
+	m_sSVGCode.Append(SG_T("),"));
+	m_sSVGCode.Append(SG_Get_String(r.Get_XRange() / 400.,2));
+	m_sSVGCode.Append(_Get_Opening_Code_2());
+
+	if (r.Get_XRange() / r.Get_YRange()  > MAP_WINDOW_WIDTH / MAP_WINDOW_HEIGHT)
+	{
+		Width = r.Get_XRange();
+		Height =  r.Get_XRange() * MAP_WINDOW_HEIGHT / MAP_WINDOW_WIDTH;
+	}
+	else
+	{
+		Height = r.Get_YRange();
+		Width = r.Get_YRange() / MAP_WINDOW_HEIGHT * MAP_WINDOW_WIDTH;
+	}
+
+	OffsetX = (Width - r.Get_XRange()) / 2.;
+	OffsetY = (Height - r.Get_YRange()) / 2.;
+
+	sViewBox.Append(SG_Get_String(r.Get_XMin() - OffsetX,2));
+	sViewBox.Append(SG_T(" "));
+	sViewBox.Append(SG_Get_String(-r.Get_YMax() - OffsetY,2));
+	sViewBox.Append(SG_T(" "));
+	sViewBox.Append(SG_Get_String(Width,2));
+	sViewBox.Append(SG_T(" "));
+	sViewBox.Append(SG_Get_String(Height,2));
+
+	_AddAttribute(SG_T("viewBox"), sViewBox);	
+	m_sSVGCode.Append(SG_T(">\n"));
+
+	m_dWidth = Width;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Add_ReferenceMap(CSG_Shapes *pIndexLayer, CSG_Rect r)
+{
+	int i;
+	CSG_String sViewBox;
+	double Line_Width, Point_Width;
+	double Width, Height;
+	double OffsetX, OffsetY;
+	CSG_Shape *pShape;
+
+	if (r.Get_XRange() / r.Get_YRange()  > MAP_WINDOW_WIDTH / MAP_WINDOW_HEIGHT)
+	{
+		Width = r.Get_XRange();
+		Height =  r.Get_XRange() * MAP_WINDOW_HEIGHT / MAP_WINDOW_WIDTH;
+	}
+	else
+	{
+		Height = r.Get_YRange();
+		Width = r.Get_YRange() / MAP_WINDOW_HEIGHT * MAP_WINDOW_WIDTH;
+	}
+
+	OffsetX = (Width - r.Get_XRange()) / 2.;
+	OffsetY = (Height - r.Get_YRange()) / 2.;
+
+	sViewBox.Append(SG_Get_String(r.Get_XMin() - OffsetX,2));
+	sViewBox.Append(SG_T(" "));
+	sViewBox.Append(SG_Get_String(- r.Get_YMax() - OffsetY,2));
+	sViewBox.Append(SG_T(" "));
+	sViewBox.Append(SG_Get_String(Width,2));
+	sViewBox.Append(SG_T(" "));
+	sViewBox.Append(SG_Get_String(Height,2));
+
+	_AddAttribute(SG_T("viewBox"), sViewBox);	
+
+	m_sSVGCode.Append(_Get_Code_3());
+	
+	if (pIndexLayer)
+	{
+		m_sSVGCode.Append(SG_T("<g id=\"index\">\n"));
+		for (i = 0; i < pIndexLayer->Get_Count(); i++)
+		{
+			pShape = pIndexLayer->Get_Shape(i);
+			Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH;
+			Point_Width *= 5;
+			_Add_Shape(pShape, 0, 0, Line_Width, Point_Width);
+		}
+		m_sSVGCode.Append(SG_T("</g>\n"));
+	}
+
+	m_sSVGCode.Append(_Get_Code_4());
+		
+	_AddAttribute(SG_T("x"), r.Get_XMin() - OffsetX);
+	_AddAttribute(SG_T("y"), - r.Get_YMax() - OffsetY);
+	_AddAttribute(SG_T("width"), Width);
+	_AddAttribute(SG_T("height"), Height);
+
+	m_sSVGCode.Append(_Get_Code_5());
+
+}
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Add_Grid(CSG_Grid *pLayer)
+{
+/*	CSG_String Filename;
+	wxBitmap BMP;
+	
+	if( pLayer->Get_Image_Grid(BMP) )
+	{
+		Filename	= SG_File_Make_Path(m_Directory.c_str(), pLayer->Get_Name(), SG_T("jpg"));
+		BMP.SaveFile(Filename, wxBITMAP_TYPE_JPEG);
+
+		m_sSVGCode.Append(SG_T("<image "));
+
+		_AddAttribute(SG_T("id")			, pLayer->Get_Name());
+		_AddAttribute(SG_T("x")			, ((CSG_Grid *)pLayer->Get_Object())->Get_XMin());
+		_AddAttribute(SG_T("y")			,-((CSG_Grid *)pLayer->Get_Object())->Get_YMax());
+		_AddAttribute(SG_T("width")		, ((CSG_Grid *)pLayer->Get_Object())->Get_XRange());
+		_AddAttribute(SG_T("height")		, ((CSG_Grid *)pLayer->Get_Object())->Get_YRange());
+		_AddAttribute(SG_T("xlink:href")	, SG_File_Get_Name(Filename, true));
+
+		m_sSVGCode.Append(SG_T("/>"));
+	}
+/**/
+}
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Add_Shapes(CSG_Shapes *pLayer)
+{
+	int i;
+	int Line_Color, Fill_Color; 
+	double Line_Width, Point_Width;
+	CSG_Shape *pShape;
+	CSG_String sLabel;
+
+	m_sSVGCode.Append(SG_T("<g id=\""));
+	m_sSVGCode.Append(pLayer->Get_Name());		
+	m_sSVGCode.Append(SG_T("\" >\n"));
+	
+//	int	iColorField = pLayer->Get_Color_Field();
+
+	m_sSVGCode.Append(SG_T("<g transform=\"scale(1,-1)\">\n"));
+
+	for (i = 0; i < pLayer->Get_Count(); i++)
+	{
+		pShape = pLayer->Get_Shape(i);
+//		Line_Color = Fill_Color = pLayer->Get_Classifier()->Get_Class_Color_byValue(pShape->asDouble(iColorField));
+		Line_Color = SG_COLOR_BLACK;
+		Fill_Color = SG_COLOR_GREEN;
+		Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH;
+		Point_Width *= 5;
+		_Add_Shape(pShape, Fill_Color, Line_Color, Line_Width, Point_Width);
+	}
+	
+//	if (pLayer->Get_Label_Field() >= 0)
+	{
+/*		m_sSVGCode.Append(SG_T("<g transform=\"scale(0.01,-0.01)\"\n>"));
+		for (i = 0; i < pLayer->Get_Count(); i++)
+		{
+			double	dSize;
+
+			pShape = pLayer->Get_Shape(i);
+			Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH;
+			sLabel = pShape->asString(pLayer->Get_Label_Field());
+			switch( pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_SIZE_TYPE"))->asInt() )
+			{
+				case 0:	default:
+					dSize = Line_Width * pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_FONT"))->asFont()->GetPointSize();
+					_Add_Label(sLabel, pShape, dSize, SG_T("%"));
+					break;
+				case 1:
+					dSize =  pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_SIZE"))->asDouble();
+					_Add_Label(sLabel, pShape, dSize, SG_T(""));
+					break;
+			}
+		}
+
+		m_sSVGCode.Append(SG_T("</g>\n"));
+/**/
+	}
+
+	m_sSVGCode.Append(SG_T("</g>\n</g>\n"));
+}
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Add_Label(const SG_Char* Label, CSG_Shape *pShape, double dSize, const SG_Char* Unit)
+{
+
+	int iPoint, iPart;
+	TSG_Point Point;
+
+	switch( pShape->Get_Type() )
+	{
+	case SHAPE_TYPE_Point:
+	case SHAPE_TYPE_Points:
+		for(iPoint=0; iPoint < pShape->Get_Point_Count(0); iPoint++)
+		{
+			Point = pShape->Get_Point(iPoint);
+			Draw_Text(100 * Point.x, -100 * Point.y, Label, 0, SG_T("Verdana"), 100 * dSize);
+		}
+		break;
+
+	case SHAPE_TYPE_Line:
+		///************///
+		break;
+
+	case SHAPE_TYPE_Polygon:
+		
+		for (iPart = 0; iPart < pShape->Get_Part_Count(); iPart++)
+		{
+			if(! ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) )
+			{
+				Point = ((CSG_Shape_Polygon *)pShape)->Get_Centroid(iPart);
+				Draw_Text(100 * Point.x, -100 * Point.y, Label, 0, SG_T("Verdana"), 100 * dSize);
+			}
+		}
+		break;
+	}
+
+}
+
+//---------------------------------------------------------
+bool CSVG_Interactive_Map::_Add_Shape(CSG_Shape *pShape, int Fill_Color, int Line_Color, double Line_Width, double Point_Width)
+{
+	if( pShape && pShape->is_Valid() )
+	{
+		int				iPart, iPoint;
+		TSG_Point		Point;
+		CSG_Points	Points;
+
+		for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+		{
+			Points.Clear();
+
+			for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			{
+				Point = pShape->Get_Point(iPoint, iPart);
+				Points.Add(Point.x, Point.y);
+			}
+
+			switch( pShape->Get_Type() )
+			{
+			case SHAPE_TYPE_Point:
+			case SHAPE_TYPE_Points:
+				for(iPoint=0; iPoint<Points.Get_Count(); iPoint++)
+				{
+					Draw_Circle(Points[iPoint].x, Points[iPoint].y, Point_Width, Fill_Color, 0, Line_Width);
+				}
+				break;
+
+			case SHAPE_TYPE_Line:
+				Draw_Line(Points, Line_Width, Line_Color);
+				break;
+
+			case SHAPE_TYPE_Polygon:
+				if( ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) )
+				{
+					Draw_Polygon(Points, -1, 0, 0.01);
+				}
+				else
+				{
+					Draw_Polygon(Points, Fill_Color, 0, 0.01);
+				}
+				break;
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+void CSVG_Interactive_Map::_Add_CheckBoxes(CSG_Parameter_Shapes_List *pList)
+{
+
+	int i;
+	CSG_String s;
+	int x,y;
+	int iRow = 1;
+	
+	m_sSVGCode.Append(_Get_Code_1());	// 2* <g> open
+	m_sSVGCode.Append(_TL("Layers"));
+	m_sSVGCode.Append(SG_T("</text>\n"));
+
+	for (i = 0; i < pList->Get_Count(); i++)
+	{
+		y = iRow * 30;
+
+		if (i % 2)
+		{
+			x = 200;		
+			iRow++;
+		}
+		else
+		{
+			x = 0;
+		}
+	
+		m_sSVGCode.Append(SG_T("<g "));
+		s = SG_T("translate(");
+		s.Append(SG_Get_String(x,0));
+		s.Append(SG_T(" "));
+		s.Append(SG_Get_String(y,0));
+		s.Append(SG_T("))"));
+		_AddAttribute(SG_T("transform"), s);
+		m_sSVGCode.Append(SG_T(">\n"));
+
+		m_sSVGCode.Append(SG_T("<use "));
+		s = SG_T("checkBox");
+		s.Append(pList->asShapes(i)->Get_Name());
+		_AddAttribute(SG_T("id"), s);
+		_AddAttribute(SG_T("xlink:href"), SG_T("#checkBoxRect"));
+		s = SG_T("checkBoxScript(evt,'");
+		s.Append(pList->asShapes(i)->Get_Name());
+		s.Append(SG_T("');"));
+		_AddAttribute(SG_T("onclick"), s);
+		m_sSVGCode.Append(SG_T("/>\n"));
+
+		m_sSVGCode.Append(SG_T("<use "));
+		s = SG_T("checkCross");
+		s.Append(pList->asShapes(i)->Get_Name());
+		_AddAttribute(SG_T("id"), s);
+		_AddAttribute(SG_T("xlink:href"), SG_T("#checkBoxCross"));		
+		_AddAttribute(SG_T("visibility"), SG_T("visible"));
+		m_sSVGCode.Append(SG_T("/>\n"));
+
+		m_sSVGCode.Append(SG_T("</g>\n"));
+	}
+
+	m_sSVGCode.Append(SG_T("<g font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" pointer-events=\"none\">\n"));
+	
+	iRow = 1;
+		
+	for (i = 0; i < pList->Get_Count(); i++)
+	{
+		y = iRow * 30 + 6;
+
+		if (i % 2)
+		{
+			x = 212;
+			iRow++;
+		}
+		else
+		{
+			x = 12;
+		}
+
+		m_sSVGCode.Append(SG_T("<text "));	
+		_AddAttribute(SG_T("x"), x);
+		_AddAttribute(SG_T("y"), y);
+		m_sSVGCode.Append(SG_T(">"));
+		m_sSVGCode.Append(pList->asShapes(i)->Get_Name());
+		m_sSVGCode.Append(SG_T("</text>\n"));	
+
+	}
+
+	m_sSVGCode.Append(SG_T("</g>\n"));
+
+	m_sSVGCode.Append(_Get_Code_2());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Opening_Code_1(void)
+{
+	return(
+		"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
+		"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" [\n"
+		"<!ATTLIST svg\n"
+		"	xmlns:attrib CDATA #IMPLIED\n"
+		"	xmlns:batik CDATA #IMPLIED\n"
+		">\n"
+		"<!ATTLIST g\n"
+		"	batik:static CDATA #IMPLIED\n"
+		">\n"
+		"<!ATTLIST image\n"
+		"	batik:static CDATA #IMPLIED\n"
+		">\n"
+		"<!ATTLIST path\n"
+		"	batik:static CDATA #IMPLIED\n"
+		">\n"
+		"]>\n"
+		"<?AdobeSVGViewer save=\"snapshot\"?>\n"
+		"<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 1024 768\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:attrib=\"http://www.carto.net/attrib\" xmlns:batik=\"http://xml.apache.org/batik/ext\" onload=\"init(evt);\" zoomAndPan=\"disable\">\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"helper_functions.js\"/>\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"mapApp.js\"/>\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"timer.js\"/>\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"slider.js\"/>\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"button.js\"/>\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"checkbox.js\"/>\n"
+		"	<script type=\"text/ecmascript\" xlink:href=\"navigation.js\"/>\n"
+		"	<script type=\"text/ecmascript\"><![CDATA[\n"
+		"		//global variables for mapApp and map object\n"
+		"		var myMapApp = new mapApp();\n"
+		"		var myMainMap;\n"
+		"		function init(evt) {\n"
+		"			//dynamic layer array that allow loading from database\n"
+		"			var dynamicLayers = new Array();\n"
+		"			//initialize digiLayers (layers that allow digitizing)\n"
+		"			var digiLayers = new Array();\n"
+		"			//initialize myMainMap object\n"
+		"			myMainMap = new map(\"mainMap\"),"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Opening_Code_2(void)
+{
+	return(
+		"),0.6,0,0,\"\"),1,true,\"coordX\"),\"coordY\"),dynamicLayers,digiLayers,\"\"));\n"
+		"			//initialize refMapDragger object\n"
+		"			myMapApp.refMapDragger = new dragObj(\"dragRectForRefMap\"),\"referenceMap\"),\"myDragCross\"),0.1,true,\"coordX\"),\"coordY\"),myMainMap);\n"
+		"			//create zoom slider	\n"
+		"			myMapApp.zoomSlider = new slider(715,75,myMainMap.minWidth,715,165,myMainMap.maxWidth,myMainMap.maxWidth,\"mapZoomSlider\"),\"dimgray\"),2,10,\"sliderSymbol\"),myMapApp.refMapDragger,true);\n"
+		"			//now initialize buttons\n"
+		"			myMapApp.buttons = new Array();\n"
+		"			//groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset\n"
+		"			myMapApp.buttons[\"zoomIn\"] = new button(\"zoomIn\"),zoomImageButtons,\"rect\"),undefined,\"magnifyerZoomIn\"),705,47,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"zoomOut\"] = new button(\"zoomOut\"),zoomImageButtons,\"rect\"),undefined,\"magnifyerZoomOut\"),705,173,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"infoButton\"] = new switchbutton(\"infoButton\"),zoomImageSwitchButtons,\"rect\"),undefined,\"infoBut\"),746,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n"
+		"			statusChange(\"Mode: Infomode\"));\n"
+		"			myMapApp.buttons[\"zoomFull\"] = new button(\"zoomFull\"),zoomImageButtons,\"rect\"),undefined,\"magnifyerFull\"),771,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"zoomManual\"] = new switchbutton(\"zoomManual\"),zoomImageSwitchButtons,\"rect\"),undefined,\"magnifyerManual\"),796,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"panManual\"] = new switchbutton(\"panManual\"),zoomImageSwitchButtons,\"rect\"),undefined,\"symbPan\"),821,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"recenterMap\"] = new switchbutton(\"recenterMap\"),zoomImageSwitchButtons,\"rect\"),undefined,\"symbRecenter\"),846,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"backwardExtent\"] = new button(\"backwardExtent\"),zoomImageButtons,\"rect\"),undefined,\"symbArrowLeft\"),871,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			myMapApp.buttons[\"forwardExtent\"] = new button(\"forwardExtent\"),zoomImageButtons,\"rect\"),undefined,\"symbArrowRight\"),896,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
+		"			//see if we need to disable buttons\n"
+		"			myMainMap.checkButtons();\n"
+		"			//load function specific to the current map project\n"
+		"			loadProjectSpecific();\n"
+		"		}\n"
+		"		function loadProjectSpecific() {\n"
+		"			//adopt width and height of map extent\n"
+		"			document.getElementById(\"myScaleTextW\")).firstChild.nodeValue = formatNumberString(myMainMap.curWidth.toFixed(myMainMap.nrDecimals)) + myMainMap.units;\n"
+		"			document.getElementById(\"myScaleTextH\")).firstChild.nodeValue = formatNumberString(myMainMap.curHeight.toFixed(myMainMap.nrDecimals)) + myMainMap.units;\n"
+		"		}\n"
+		"]]></script>\n"
+		"	<defs>\n"
+		"		<!-- Symbols for checkboxes -->\n"
+		"		<symbol id=\"checkBoxRect\" overflow=\"visible\">\n"
+		"			<rect x=\"-6\" y=\"-6\" width=\"12\" height=\"12\" fill=\"white\" stroke=\"dimgray\" stroke-width=\"1.5\"/>\n"
+		"		</symbol>\n"
+		"		<symbol id=\"checkBoxCross\" overflow=\"visible\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"1\" pointer-events=\"none\">\n"
+		"			<line x1=\"-5\" y1=\"-5\" x2=\"5\" y2=\"5\"/>\n"
+		"			<line x1=\"-5\" y1=\"5\" x2=\"5\" y2=\"-5\"/>\n"
+		"		</symbol>\n"
+		"		<!-- Symbols for Zoom Magnifyer glasses -->\n"
+		"		<symbol id=\"magnifyerFull\" overflow=\"visible\">\n"
+		"			<text y=\"7.5\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"18px\" font-weight=\"bold\" text-anchor=\"middle\" pointer-events=\"none\">F</text>\n"
+		"		</symbol>\n"
+		"		<symbol id=\"infoBut\" overflow=\"visible\">\n"
+		"			<circle fill=\"none\" stroke=\"dimgray\" stroke-width=\"1.5\" r=\"7.5\" />\n"
+		"			<text y=\"5\" font-family=\"sans-serif\" font-size=\"13px\" font-weight=\"bold\" fill=\"dimgray\" text-anchor=\"middle\" pointer-events=\"none\">i</text>\n"
+		"		</symbol>\n"
+		"		<symbol id=\"magnifyerManual\" overflow=\"visible\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"1.5\">\n"
+		"			<rect x=\"-6\" y=\"-6\" width=\"12\" height=\"12\" stroke-dasharray=\"1.5,1.5\"/>\n"
+		"			<line x1=\"-3\" y1=\"0\" x2=\"3\" y2=\"0\" />\n"
+		"			<line x1=\"0\" y1=\"-3\" x2=\"0\" y2=\"3\" />\n"
+		"		</symbol>\n"
+		"		<symbol id=\"magnifyerZoomIn\" overflow=\"visible\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"2\">\n"
+		"			<line x1=\"-4\" y1=\"0\" x2=\"4\" y2=\"0\"/>\n"
+		"			<line x1=\"0\" y1=\"-4\" x2=\"0\" y2=\"4\"/>\n"
+		"		</symbol>\n"
+		"		<symbol id=\"magnifyerZoomOut\" overflow=\"visible\">\n"
+		"			<line x1=\"-4\" y1=\"0\" x2=\"4\" y2=\"0\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"2\" />\n"
+		"		</symbol>\n"
+		"		<!-- hand symbol for panning -->\n"
+		"		<symbol id=\"symbPan\" overflow=\"visible\">\n"
+		"			<path transform=\"scale(1.2)\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"1\" d=\"M-2 6 C -2.2 2.5 -8.0 -0 -5.7 -1.9 C -4.3 -2.5 -3.3 -0.5 -2.5 0.7 C -3.2 -2.1 -5.5 -5.2 -3.6 -5.8 C -2.1 -6.3 -1.6 -3.6 -1.1 -1.9 C -0.9 -4.2 -1.6 -6.4 -0.2 -6.6 C 1.4 -6.8 0.9 -3 1.1 -1.9 C 1.5 -3.5 1.2 -6.1 2.5 -6.1 C 3.9 -6.1 3.5 -3.2 3.6 -1.6 C 4 -2.9 4.1 -4.3 5.3 -4.4 C 7.3 -3.5 4 2.2 3 6z\"/>\n"
+		"		</symbol>\n"
+		"		<!-- Symbol for Arrows -->\n"
+		"		<symbol id=\"symbArrow\" overflow=\"visible\">\n"
+		"			<polyline fill=\"none\" stroke=\"dimgray\" stroke-width=\"1\" points=\"-3,-6 3,-6 3,1 5,1 0,7 -5,1 -3,1 -3,-5\"/>\n"
+		"		</symbol>\n"
+		"		<symbol id=\"symbArrowLeft\" overflow=\"visible\">\n"
+		"			<use xlink:href=\"#symbArrow\" transform=\"rotate(90)\" />\n"
+		"		</symbol>\n"
+		"		<symbol id=\"symbArrowRight\" overflow=\"visible\">\n"
+		"			<use xlink:href=\"#symbArrow\" transform=\"rotate(-90)\" />\n"
+		"		</symbol>\n"
+		"		<!-- Symbol for Recentering Map -->\n"
+		"		<symbol id=\"symbRecenter\" overflow=\"visible\">\n"
+		"			<circle fill=\"dimgray\" cx=\"0\" cy=\"0\" r=\"1\" pointer-events=\"none\"/>\n"
+		"			<g fill=\"none\" stroke=\"dimgray\" stroke-width=\"1.5\" pointer-events=\"none\">\n"
+		"				<line x1=\"-7\" y1=\"-7\" x2=\"-3\" y2=\"-3\"/>\n"
+		"				<line x1=\"7\" y1=\"7\" x2=\"3\" y2=\"3\"/>\n"
+		"				<line x1=\"-7\" y1=\"7\" x2=\"-3\" y2=\"3\"/>\n"
+		"				<line x1=\"7\" y1=\"-7\" x2=\"3\" y2=\"-3\"/>\n"
+		"			</g>\n"
+		"		</symbol>\n"
+		"		<!-- Symbol for Slider -->\n"
+		"		<symbol id=\"sliderSymbol\" overflow=\"visible\" pointer-events=\"none\">\n"
+		"			<line x1=\"0\" y1=\"-5\" x2=\"0\" y2=\"5\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"5\"/>\n"
+		"		</symbol>\n"
+		"		<!-- Symbol for Dragging if zoomed in far -->\n"
+		"		<symbol id=\"myDragCrossSymbol\" overflow=\"visible\" stroke-width=\"2000\" fill=\"none\" stroke=\"darkblue\" pointer-events=\"none\">\n"
+		"			<line x1=\"-7000\" y1=\"0\" x2=\"-2500\" y2=\"0\"/>\n"
+		"			<line x1=\"7000\" y1=\"0\" x2=\"2500\" y2=\"0\"/>\n"
+		"			<line x1=\"0\" y1=\"-3300\" x2=\"0\" y2=\"-7800\"/>\n"
+		"			<line x1=\"0\" y1=\"3300\" x2=\"0\" y2=\"7800\"/>\n"
+		"		</symbol>\n"
+		"		<!-- Marker for Extent-Arrows -->\n"
+		"		<marker id=\"myStartArrow\" overflow=\"visible\" orient=\"auto\">\n"
+		"			<polyline fill=\"dimgray\" points=\"-0.5,0 8,-2 8,2\"/>\n"
+		"		</marker>\n"
+		"		<marker id=\"myEndArrow\" overflow=\"visible\" orient=\"auto\">\n"
+		"			<polyline fill=\"dimgray\" points=\"0.5,0 -8,-2 -8,2\"/>\n"
+		"		</marker>\n"
+		"	</defs>\n"
+		"	<rect x=\"-500\" y=\"-500\" width=\"3000\" height=\"3000\" stroke=\"none\" fill=\"aliceblue\" />\n"
+		"	<!-- Main Map Frame -->\n"
+		"	<svg id=\"mainMap\" x=\"0\" y=\"15\" width=\"550\" height=\"700\"	cursor=\"crosshair\" "
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_1(void)
+{
+	return(
+		"<g>\n"
+		"		<g font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" pointer-events=\"none\">"
+		"			<text id=\"coordX\" x=\"745\" y=\"145\">X:</text>\n"
+		"			<text id=\"coordY\" x=\"845\" y=\"145\">Y:</text>\n"
+		"		</g>\n"
+		"		<g>"
+		"			<!-- vertical line, displays current height of map extent -->\n"
+		"			<line stroke=\"dimgray\" stroke-width=\"1.5\" marker-start=\"url(#myStartArrow)\" marker-end=\"url(#myEndArrow)\" x1=\"561\" y1=\"15\" x2=\"561\" y2=\"715\"/>\n"
+		"			<rect fill=\"aliceblue\" x=\"555\" y=\"330\" width=\"12\" height=\"70\"/>\n"
+		"			<text id=\"myScaleTextH\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" text-anchor=\"middle\" transform=\"translate(556,365),rotate(90)\" pointer-events=\"none\">-</text>\n"
+		"			<!-- horizontal line, displays current width of map extent -->\n"
+		"			<line stroke=\"dimgray\" stroke-width=\"1.5\" marker-start=\"url(#myStartArrow)\" marker-end=\"url(#myEndArrow)\" x1=\"0\" y1=\"723\" x2=\"553.1\" y2=\"723\"/>\n"
+		"			<rect fill=\"aliceblue\" x=\"242\" y=\"717\" width=\"70\" height=\"12\"/>\n"
+		"			<text id=\"myScaleTextW\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" text-anchor=\"middle\" transform=\"translate(277,728)\" pointer-events=\"none\">-</text>\n"
+		"			<!-- small rectangle in lower right corner, onclick displays current map extent in real world coordinates -->\n"
+		"			<rect fill=\"dimgray\" x=\"558.5\" y=\"720.5\" width=\"5\" height=\"5\" onclick=\"showExtent()\" />\n"
+		"		</g>\n"
+		"		<g transform=\"translate(590 225)\">\n"
+		"			<text font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"18px\" font-weight=\"bold\" x=\"-10\" y=\"0\" pointer-events=\"none\">"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_2(void)
+{
+	return(
+		"</g>\n"
+		"   <g text-rendering=\"optimizeLegibility\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"12px\">\n"
+		"		<!-- text with this id is required to show help texts -->\n"
+		"		<text id=\"statusText\" x=\"745\" y=\"125\">Statusbar: Your Status Text</text>\n"
+		"   </g>\n"
+		"</g>\n"
+		"<svg id=\"referenceMap\" x=\"580\" y=\"45\" "
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_3(void)
+{
+	return(
+		"width=\"118.52\" height=\"150\" onmousedown=\"myMapApp.refMapDragger.handleEvent(evt)\" onmousemove=\"myMapApp.refMapDragger.handleEvent(evt)\" onmouseup=\"myMapApp.refMapDragger.handleEvent(evt)\" onmouseout=\"myMapApp.refMapDragger.handleEvent(evt)\" cursor=\"crosshair\">\n"
+		"		<g transform=\"scale(1,-1)\"\n>"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_4(void)
+{
+	return(
+		"		</g>\n"
+		"		<rect id=\"dragRectForRefMap\" fill=\"lightskyblue\" fill-opacity=\"0.4\" "
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_5(void)
+{
+	return(
+		" pointer-events=\"none\" />\n	"
+		"		<use id=\"myDragCross\" x=\"0\" y=\"0\" xlink:href=\"#myDragCrossSymbol\" visibility=\"hidden\" />\n"
+		"	</svg>\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Closing_1(void)
+{
+	return(
+		"	<g>\n"
+		"		<!-- empty group where zoomSlider is later appended -->\n"
+		"		<g id=\"mapZoomSlider\"/>\n"
+		"		<!-- button for zoom-in, above slider -->\n"
+		"		<g id=\"zoomIn\" cursor=\"pointer\" />\n"
+		"		<!-- button for zoom-out, below slider -->\n"
+		"		<g id=\"zoomOut\" cursor=\"pointer\" />\n"
+		"		<!-- info button -->\n"
+		"		<g id=\"infoButton\" cursor=\"pointer\" />\n"
+		"		<!-- button for full view (f) -->\n"
+		"		<g id=\"zoomFull\" cursor=\"pointer\" />\n"
+		"		<!-- button for manual zoom (rectangle) -->\n"
+		"		<g id=\"zoomManual\" cursor=\"pointer\" />\n"
+		"		<!-- button for manual pan -->\n"
+		"		<g id=\"panManual\" cursor=\"pointer\" />\n"
+		"		<!-- button for redefining map center -->\n"
+		"		<g id=\"recenterMap\" cursor=\"pointer\" />\n"
+		"		<!-- button for backwarding map extent (extent history) -->\n"
+		"		<g id=\"backwardExtent\" cursor=\"pointer\" />\n"
+		"		<!-- button for forwarding map extent (extent history) -->\n"
+		"		<g id=\"forwardExtent\" cursor=\"pointer\" />\n"
+		"	</g>\n"
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														//
+//														//
+//														//
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_CheckBox(void)
+{
+	return(
+		"function checkBoxScript(evt,myLayer) { //checkBox for toggling layers an contextMenue\n"
+		"	var myLayerObj = document.getElementById(myLayer);\n"
+		"	var myCheckCrossObj = document.getElementById(\"checkCross\"+myLayer);\n"
+		"	var myCheckCrossVisibility = myCheckCrossObj.getAttributeNS(null,\"visibility\"));\n"
+		"	if (evt.type == \"click\" && evt.detail == 1) {\n"
+		"	if (myCheckCrossVisibility == \"visible\")) {\n"
+		"		myLayerObj.setAttributeNS(null,\"visibility\"),\"hidden\"));\n"
+		"		myCheckCrossObj.setAttributeNS(null,\"visibility\"),\"hidden\"));\n"
+		"		//you can do if/else or switch statements to set different actions on activating a checkbox here\n"
+		"		//myLayer holds the currentLayer name\n"
+		"	}\n"
+		"	else {\n"
+		"		myLayerObj.setAttributeNS(null,\"visibility\"),\"visible\"));\n"
+		"		myCheckCrossObj.setAttributeNS(null,\"visibility\"),\"visible\"));\n"
+		"	}\n"
+		"	}\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_MapApp(void)
+{
+	return(
+		"//holds data on window size\n"
+		"function mapApp() {\n"
+		"	if (!document.documentElement.getScreenCTM) {\n"
+		"	this.resetFactors();\n"
+		"	//add resize event to document element\n"
+		"	document.documentElement.addEventListener(\"SVGResize\"),this,false);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"mapApp.prototype.handleEvent = function(evt) {\n"
+		"	if (evt.type == \"SVGResize\")) {\n"
+		"	this.resetFactors();\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"mapApp.prototype.resetFactors = function() {\n"
+		"	if (!document.documentElement.getScreenCTM) {\n"
+		"	//case for viewers that don't support .getScreenCTM, such as ASV3\n"
+		"	//calculate ratio and offset values of app window\n"
+		"	var viewBoxArray = document.documentElement.getAttributeNS(null,\"viewBox\")).split(\" \"));\n"
+		"	var myRatio = viewBoxArray[2]/viewBoxArray[3];\n"
+		"	if ((window.innerWidth/window.innerHeight) > myRatio) { //case window is more wide than myRatio\n"
+		"		this.scaleFactor = viewBoxArray[3] / window.innerHeight;\n"
+		"	}\n"
+		"	else { //case window is more tall than myRatio\n"
+		"		this.scaleFactor = viewBoxArray[2] / window.innerWidth;\n"
+		"	}\n"
+		"	this.offsetX = (window.innerWidth - viewBoxArray[2] * 1 / this.scaleFactor) / 2;\n"
+		"	this.offsetY = (window.innerHeight - viewBoxArray[3] * 1 / this.scaleFactor) / 2;\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"mapApp.prototype.calcCoord = function(evt,ctmNode) {\n"
+		"	var svgPoint = document.documentElement.createSVGPoint();\n"
+		"	svgPoint.x = evt.clientX;\n"
+		"	svgPoint.y = evt.clientY;\n"
+		"	if (!document.documentElement.getScreenCTM) {\n"
+		"	//case ASV3 a. Corel\n"
+		"	svgPoint.x = (svgPoint.x	- this.offsetX) * this.scaleFactor;\n"
+		"	svgPoint.y = (svgPoint.y - this.offsetY) * this.scaleFactor;\n"
+		"	//undo the effect of transformations\n"
+		"	if (ctmNode) {\n"
+		"		var ctm = getTransformToRootElement(ctmNode).inverse();\n"
+		"	}\n"
+		"	else {\n"
+		"		var ctm = getTransformToRootElement(evt.target).inverse();\n"
+		"	}\n"
+		"	svgPoint = svgPoint.matrixTransform(ctm);\n"
+		"\n"
+		"	}\n"
+		"	else {\n"
+		"	if (ctmNode) {\n"
+		"		var matrix = ctmNode.getScreenCTM();\n"
+		"	}\n"
+		"	else {\n"
+		"		var matrix = evt.target.getScreenCTM();\n"
+		"	}\n"
+		"	svgPoint = svgPoint.matrixTransform(matrix.inverse());\n"
+		"	}\n"
+		"	return svgPoint;\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Timer(void)
+{
+	return(
+		"// source/credits: \"Algorithm\": http://www.codingforums.com/showthread.php?s=&threadid=10531\n"
+		"// The constructor should be called with\n"
+		"// the parent object (optional, defaults to window).\n"
+		"\n"
+		"function Timer(){\n"
+		"	this.obj = (arguments.length)?arguments[0]:window;\n"
+		"	return this;\n"
+		"}\n"
+		"\n"
+		"// The set functions should be called with:\n"
+		"// - The name of the object method (as a string) (required)\n"
+		"// - The millisecond delay (required)\n"
+		"// - Any number of extra arguments, which will all be\n"
+		"//	passed to the method when it is evaluated.\n"
+		"\n"
+		"Timer.prototype.setInterval = function(func, msec){\n"
+		"	var i = Timer.getNew();\n"
+		"	var t = Timer.buildCall(this.obj, i, arguments);\n"
+		"	Timer.set[i].timer = window.setInterval(t,msec);\n"
+		"	return i;\n"
+		"}\n"
+		"Timer.prototype.setTimeout = function(func, msec){\n"
+		"	var i = Timer.getNew();\n"
+		"	Timer.buildCall(this.obj, i, arguments);\n"
+		"	Timer.set[i].timer = window.setTimeout(\"Timer.callOnce(\"+i+\"));\"),msec);\n"
+		"	return i;\n"
+		"}\n"
+		"\n"
+		"// The clear functions should be called with\n"
+		"// the return value from the equivalent set function.\n"
+		"\n"
+		"Timer.prototype.clearInterval = function(i){\n"
+		"	if(!Timer.set[i]) return;\n"
+		"	window.clearInterval(Timer.set[i].timer);\n"
+		"	Timer.set[i] = null;\n"
+		"}\n"
+		"Timer.prototype.clearTimeout = function(i){\n"
+		"	if(!Timer.set[i]) return;\n"
+		"	window.clearTimeout(Timer.set[i].timer);\n"
+		"	Timer.set[i] = null;\n"
+		"}\n"
+		"\n"
+		"// Private data\n"
+		"\n"
+		"Timer.set = new Array();\n"
+		"Timer.buildCall = function(obj, i, args){\n"
+		"	var t = \"\");\n"
+		"	Timer.set[i] = new Array();\n"
+		"	if(obj != window){\n"
+		"	Timer.set[i].obj = obj;\n"
+		"	t = \"Timer.set[\"+i+\"].obj.\");\n"
+		"	}\n"
+		"	t += args[0]+\"(\");\n"
+		"	if(args.length > 2){\n"
+		"	Timer.set[i][0] = args[2];\n"
+		"	t += \"Timer.set[\"+i+\"][0]\");\n"
+		"	for(var j=1; (j+2)<args.length; j++){\n"
+		"		Timer.set[i][j] = args[j+2];\n"
+		"		t += \"), Timer.set[\"+i+\"][\"+j+\"]\");\n"
+		"	}}\n"
+		"	t += \"));\");\n"
+		"	Timer.set[i].call = t;\n"
+		"	return t;\n"
+		"}\n"
+		"Timer.callOnce = function(i){\n"
+		"	if(!Timer.set[i]) return;\n"
+		"	eval(Timer.set[i].call);\n"
+		"	Timer.set[i] = null;\n"
+		"}\n"
+		"Timer.getNew = function(){\n"
+		"	var i = 0;\n"
+		"	while(Timer.set[i]) i++;\n"
+		"	return i;\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Slider(void)
+{
+	return(
+		"//slider properties\n"
+		"function slider(x1,y1,value1,x2,y2,value2,startVal,sliderGroupId,sliderColor,visSliderWidth,invisSliderWidth,sliderSymb,functionToCall,mouseMoveBool) {\n"
+		"	this.x1 = x1;\n"
+		"	this.y1 = y1;\n"
+		"	this.value1 = value1;\n"
+		"	this.x2 = x2;\n"
+		"	this.y2 = y2;\n"
+		"	this.value2 = value2;\n"
+		"	this.startVal = startVal;\n"
+		"	this.value = startVal;\n"
+		"	this.sliderGroupId = sliderGroupId;\n"
+		"	this.sliderGroup = document.getElementById(this.sliderGroupId);\n"
+		"	this.sliderColor = sliderColor;\n"
+		"	this.visSliderWidth = visSliderWidth;\n"
+		"	this.invisSliderWidth = invisSliderWidth;\n"
+		"	this.sliderSymb = sliderSymb;\n"
+		"	this.functionToCall = functionToCall;\n"
+		"	this.mouseMoveBool = mouseMoveBool;\n"
+		"	this.length = toPolarDist((this.x2 - this.x1),(this.y2 - this.y1));\n"
+		"	this.direction = toPolarDir((this.x2 - this.x1),(this.y2 - this.y1));\n"
+		"	this.sliderLine = null;\n"
+		"	this.createSlider();\n"
+		"	this.slideStatus = 0;\n"
+		"}\n"
+		"\n"
+		"//create slider\n"
+		"slider.prototype.createSlider = function() {\n"
+		"	this.sliderLine = document.createElementNS(svgNS,\"line\"));\n"
+		"	this.sliderLine.setAttributeNS(null,\"x1\"),this.x1);\n"
+		"	this.sliderLine.setAttributeNS(null,\"y1\"),this.y1);\n"
+		"	this.sliderLine.setAttributeNS(null,\"x2\"),this.x2);\n"
+		"	this.sliderLine.setAttributeNS(null,\"y2\"),this.y2);\n"
+		"	this.sliderLine.setAttributeNS(null,\"stroke\"),this.sliderColor);\n"
+		"	this.sliderLine.setAttributeNS(null,\"stroke-width\"),this.invisSliderWidth);\n"
+		"	this.sliderLine.setAttributeNS(null,\"opacity\"),\"0\"));\n"
+		"	this.sliderLine.setAttributeNS(null,\"stroke-linecap\"),\"square\"));\n"
+		"	this.sliderLine.setAttributeNS(null,\"id\"),this.sliderGroupId+\"_invisibleSliderLine\"));\n"
+		"	this.sliderLine.addEventListener(\"mousedown\"),this,false);\n"
+		"	this.sliderGroup.appendChild(this.sliderLine);\n"
+		"	var mySliderLine = document.createElementNS(svgNS,\"line\"));\n"
+		"	mySliderLine.setAttributeNS(null,\"x1\"),this.x1);\n"
+		"	mySliderLine.setAttributeNS(null,\"y1\"),this.y1);\n"
+		"	mySliderLine.setAttributeNS(null,\"x2\"),this.x2);\n"
+		"	mySliderLine.setAttributeNS(null,\"y2\"),this.y2);\n"
+		"	mySliderLine.setAttributeNS(null,\"stroke\"),this.sliderColor);\n"
+		"	mySliderLine.setAttributeNS(null,\"stroke-width\"),this.visSliderWidth);\n"
+		"	mySliderLine.setAttributeNS(null,\"id\"),this.sliderGroupId+\"_visibleSliderLine\"));\n"
+		"	mySliderLine.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
+		"	this.sliderGroup.appendChild(mySliderLine);\n"
+		"	mySliderSymb = document.createElementNS(svgNS,\"use\"));\n"
+		"	mySliderSymb.setAttributeNS(xlinkNS,\"xlink:href\"),\"#\"+this.sliderSymb);\n"
+		"	var myStartDistance = this.length - ((this.value2 - this.startVal) / (this.value2 - this.value1)) * this.length;\n"
+		"	var myPosX = this.x1 + toRectX(this.direction,myStartDistance);\n"
+		"	var myPosY = this.y1 + toRectY(this.direction,myStartDistance);\n"
+		"	var myTransformString = \"translate(\"+myPosX+\"),\"+myPosY+\")) rotate(\" + Math.round(this.direction / Math.PI * 180) + \"))\");\n"
+		"	mySliderSymb.setAttributeNS(null,\"transform\"),myTransformString);\n"
+		"	mySliderSymb.setAttributeNS(null,\"id\"),this.sliderGroupId+\"_sliderSymbol\"));\n"
+		"	this.sliderGroup.appendChild(mySliderSymb);\n"
+		"}\n"
+		"\n"
+		"//remove all slider elements\n"
+		"slider.prototype.removeSlider = function() {\n"
+		"	var mySliderSymb = document.getElementById(this.sliderGroup+\"_sliderSymbol\"));\n"
+		"	this.sliderGroup.removeChild(mySliderSymb);\n"
+		"	var mySliderLine = document.getElementById(this.sliderGroup+\"_visibleSliderLine\"));\n"
+		"	this.sliderGroup.removeChild(mySliderLine);\n"
+		"	var mySliderLine = document.getElementById(this.sliderGroup+\"_invisibleSliderLine\"));\n"
+		"	this.sliderGroup.removeChild(mySliderLine);\n"
+		"}\n"
+		"\n"
+		"//handle events\n"
+		"slider.prototype.handleEvent = function(evt) {\n"
+		"	this.drag(evt);\n"
+		"}\n"
+		"\n"
+		"//drag slider\n"
+		"slider.prototype.drag = function(evt) {\n"
+		"	if (evt.type == \"mousedown\" || (evt.type == \"mousemove\" && this.slideStatus == 1)) {\n"
+		"	//get coordinate in slider coordinate system\n"
+		"	var coordPoint = myMapApp.calcCoord(evt,this.sliderLine);\n"
+		"	//draw normal line for first vertex\n"
+		"	var ax = this.x2 - this.x1;\n"
+		"	var ay = this.y2 - this.y1;\n"
+		"	//normal vector 1\n"
+		"	var px1 = parseFloat(this.x1) + ay * -1;\n"
+		"	var py1 = parseFloat(this.y1) + ax;\n"
+		"	//normal vector 2\n"
+		"	var px2 = parseFloat(this.x2) + ay * -1;\n"
+		"	var py2 = parseFloat(this.y2) + ax;\n"
+		"		\n"
+		"	if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 0 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 1) {\n"
+		"		if (evt.type == \"mousedown\" && evt.detail == 1) {\n"
+		"		this.slideStatus = 1;\n"
+		"		document.documentElement.addEventListener(\"mousemove\"),this,false);\n"
+		"		document.documentElement.addEventListener(\"mouseup\"),this,false);\n"
+		"		}\n"
+		"		myNewPos = intersect2lines(this.x1,this.y1,this.x2,this.y2,coordPoint.x,coordPoint.y,coordPoint.x + ay * -1,coordPoint.y + ax);\n"
+		"		var myPercentage = toPolarDist(myNewPos['x'] - this.x1,myNewPos['y'] - this.y1) / this.length;\n"
+		"		this.value = this.value1 + myPercentage * (this.value2 - this.value1);\n"
+		"	}\n"
+		"	else {\n"
+		"		var myNewPos = new Array();\n"
+		"		if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 0 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 0) {\n"
+		"		//more than max\n"
+		"		this.value = this.value2;\n"
+		"		myNewPos['x'] = this.x2;\n"
+		"		myNewPos['y'] = this.y2;\n"
+		"		}\n"
+		"		if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 1 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 1) {\n"
+		"		//less than min\n"
+		"		this.value = this.value1;\n"
+		"		myNewPos['x'] = this.x1;\n"
+		"		myNewPos['y'] = this.y1;\n"
+		"		}\n"
+		"	}\n"
+		"	var myTransformString = \"translate(\"+myNewPos['x']+\"),\"+myNewPos['y']+\")) rotate(\" + Math.round(this.direction / Math.PI * 180) + \"))\");\n"
+		"	document.getElementById(this.sliderGroupId+\"_sliderSymbol\")).setAttributeNS(null,\"transform\"),myTransformString);\n"
+		"	this.getValue();\n"
+		"	}\n"
+		"	if (evt.type == \"mouseup\" && evt.detail == 1) {\n"
+		"	if (this.slideStatus == 1) {\n"
+		"		this.slideStatus = 2;\n"
+		"		document.documentElement.removeEventListener(\"mousemove\"),this,false);\n"
+		"		document.documentElement.removeEventListener(\"mouseup\"),this,false);\n"
+		"		this.getValue();\n"
+		"	}\n"
+		"	this.slideStatus = 0;\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//this code is executed, after the slider is released\n"
+		"//you can use switch/if to detect which slider was used (use this.sliderGroup) for that\n"
+		"slider.prototype.getValue = function() {\n"
+		"	if (this.slideStatus == 1 && this.mouseMoveBool == true) {\n"
+		"	if (typeof(this.functionToCall) == \"function\")) {\n"
+		"		this.functionToCall(\"change\"),this.sliderGroupId,this.value);\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == \"object\")) {\n"
+		"		this.functionToCall.getSliderVal(\"change\"),this.sliderGroupId,this.value);\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == \"string\")) {\n"
+		"		eval(this.functionToCall+\"('change','\"+this.sliderGroupId+\"',\"+this.value+\"))\"));\n"
+		"	}\n"
+		"	}\n"
+		"	if (this.slideStatus == 2) {\n"
+		"	if (typeof(this.functionToCall) == \"function\")) {\n"
+		"		this.functionToCall(\"release\"),this.sliderGroupId,this.value);\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == \"object\")) {\n"
+		"		this.functionToCall.getSliderVal(\"release\"),this.sliderGroupId,this.value);\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == \"string\")) {\n"
+		"		eval(this.functionToCall+\"('release','\"+this.sliderGroupId+\"',\"+this.value+\"))\"));\n"
+		"	}\n"
+		"	}\n"
+		"}	\n"
+		"\n"
+		"//this is to set the value from other scripts\n"
+		"slider.prototype.setValue = function(value) {\n"
+		"	var myPercAlLine = (value - this.value1) / (this.value2 - this.value1);\n"
+		"	this.value = myPercAlLine;\n"
+		"	var myPosX = this.x1 + toRectX(this.direction,this.length * myPercAlLine);\n"
+		"	var myPosY = this.y1 + toRectY(this.direction,this.length * myPercAlLine);\n"
+		"	var myTransformString = \"translate(\"+myPosX+\"),\"+myPosY+\")) rotate(\" + Math.round(this.direction / Math.PI * 180) + \"))\");\n"
+		"	document.getElementById(this.sliderGroupId+\"_sliderSymbol\")).setAttributeNS(null,\"transform\"),myTransformString);\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Helper(void)
+{
+	return(
+		"/*\n"
+		"ECMAScript helper functions\n"
+		"Copyright (C) <2004>	<Andreas Neumann>\n"
+		"Version 1.1, 2004-11-18\n"
+		"neumann at karto.baug.ethz.ch\n"
+		"http://www.carto.net/\n"
+		"http://www.carto.net/neumann/\n"
+		"\n"
+		"Credits: numerous people on svgdevelopers at yahoogroups.com\n"
+		"\n"
+		"This ECMA script library is free software; you can redistribute it and/or\n"
+		"modify it under the terms of the GNU Lesser General Public\n"
+		"License as published by the Free Software Foundation; either\n"
+		"version 2.1 of the License, or (at your option) any later version.\n"
+		"\n"
+		"This library is distributed in the hope that it will be useful,\n"
+		"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNU\n"
+		"Lesser General Public License for more details.\n"
+		"\n"
+		"You should have received a copy of the GNU Lesser General Public\n"
+		"License along with this library (http://www.carto.net/papers/svg/resources/lesser_gpl.txt); if not, write to the Free Software\n"
+		"Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA\n"
+		"\n"
+		"----\n"
+		"\n"
+		"original document site: http://www.carto.net/papers/svg/resources/helper_functions.js\n"
+		"Please contact the author in case you want to use code or ideas commercially.\n"
+		"If you use this code, please include this copyright header, the included full\n"
+		"LGPL 2.1 text and read the terms provided in the LGPL 2.1 license\n"
+		"(http://www.gnu.org/copyleft/lesser.txt)\n"
+		"\n"
+		"-------------------------------\n"
+		"\n"
+		"Please report bugs and send improvements to neumann at karto.baug.ethz.ch\n"
+		"If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)\n"
+		"somewhere in the source-code-comment or the \"about\" of your project and give credits, thanks!\n"
+		"\n"
+		"*/\n"
+		"\n"
+		"//global variables necessary to create elements in these namespaces, do not delete them!!!!\n"
+		"var svgNS = \"http://www.w3.org/2000/svg\");\n"
+		"var xlinkNS = \"http://www.w3.org/1999/xlink\");\n"
+		"var cartoNS = \"http://www.carto.net/attrib\");\n"
+		"var attribNS = \"http://www.carto.net/attrib\");\n"
+		"var batikNS = \"http://xml.apache.org/batik/ext\");\n"
+		"\n"
+		"/* ----------------------- helper functions to calculate stuff ---------------- */\n"
+		"/* ---------------------------------------------------------------------------- */\n"
+		"function toPolarDir(xdiff,ydiff) { // Subroutine for calculating polar Coordinates\n"
+		"	direction = (Math.atan2(ydiff,xdiff));\n"
+		"	//result is angle in radian\n"
+		"	return(direction);\n"
+		"}\n"
+		"\n"
+		"function toPolarDist(xdiff,ydiff) { // Subroutine for calculating polar Coordinates\n"
+		"	distance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n"
+		"	return(distance);\n"
+		"}\n"
+		"\n"
+		"function toRectX(direction,distance) { // Subroutine for calculating cartesic coordinates\n"
+		"	x = distance * Math.cos(direction);\n"
+		"	y = distance * Math.sin(direction);\n"
+		"	return(x);\n"
+		"}\n"
+		"\n"
+		"function toRectY(direction,distance) { // Subroutine for calculating cartesic coordinates\n"
+		"	x = distance * Math.cos(direction);\n"
+		"	y = distance * Math.sin(direction);\n"
+		"	return(y);\n"
+		"}\n"
+		"\n"
+		"//Converts degrees to radians.\n"
+		"function DegToRad(deg) {\n"
+		"	return (deg / 180.0 * Math.PI);\n"
+		"}\n"
+		"\n"
+		"//Converts radians to degrees.\n"
+		"function RadToDeg(rad) {\n"
+		"	return (rad / Math.PI * 180.0);\n"
+		"}\n"
+		"\n"
+		"//converts decimal degrees to degree/minutes/seconds\n"
+		"function dd2dms(dd) {\n"
+		"	var minutes = (dd - Math.floor(dd)) * 60;\n"
+		"	var seconds = (minutes - Math.floor(minutes)) * 60;\n"
+		"	var minutes = Math.floor(minutes);\n"
+		"	var degrees = Math.floor(dd);\n"
+		"	return {deg:degrees,min:minutes,sec:seconds};\n"
+		"}\n"
+		"\n"
+		"//converts degree/minutes/seconds to decimal degrees\n"
+		"function dms2dd(deg,min,sec) {\n"
+		"	return deg + (min / 60) + (sec / 3600);\n"
+		"}\n"
+		"\n"
+		"//log functions that do not exist in Math object\n"
+		"function log(x,b) {\n"
+		"	if(b==null) b=Math.E;\n"
+		"	return Math.log(x)/Math.log(b);\n"
+		"}\n"
+		"\n"
+		"//gets 4 z-values (4 corners), a position, delta x and delty and a cellsize as input and returns interpolated z-value\n"
+		"function intBilinear(za,zb,zc,zd,xpos,ypos,ax,ay,cellsize) { //bilinear interpolation function\n"
+		"	e = (xpos - ax) / cellsize;\n"
+		"	f = (ypos - ay) / cellsize;\n"
+		"\n"
+		"	//calculation of weights\n"
+		"	wa = (1 - e) * (1 - f);\n"
+		"	wb = e * (1 - f);\n"
+		"	wc = e * f;\n"
+		"	wd = f * (1 - e);\n"
+		"\n"
+		"	height_interpol = wa * zc + wb * zd + wc * za + wd * zb;\n"
+		"\n"
+		"	return (height_interpol);	\n"
+		"}\n"
+		"\n"
+		"//test if point is left of or right of, result is 1 (leftof) or 0 (rightof)\n"
+		"function leftOfTest(pointx,pointy,linex1,liney1,linex2,liney2) {\n"
+		"	result = (liney1 - pointy) * (linex2 - linex1) - (linex1 - pointx) * (liney2 - liney1);\n"
+		"	if (result < 0) {\n"
+		"	leftof = 1; //case left of\n"
+		"	}\n"
+		"	else {\n"
+		"	leftof = 0; //case left of	\n"
+		"	}\n"
+		"	return(leftof);\n"
+		"}\n"
+		"\n"
+		"//input is point coordinate, and 2 line coordinates\n"
+		"function distFromLine(xpoint,ypoint,linex1,liney1,linex2,liney2) {\n"
+		"	dx = linex2 - linex1;\n"
+		"	dy = liney2 - liney1;\n"
+		"	distance = (dy * (xpoint - linex1) - dx * (ypoint - liney1)) / Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2));\n"
+		"	return(distance);\n"
+		"}\n"
+		"\n"
+		"//converts radian value to degrees\n"
+		"function radian2deg(radian) {\n"
+		"	deg = radian / Math.PI * 180;\n"
+		"	return(deg);\n"
+		"}\n"
+		"\n"
+		"//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian\n"
+		"//Formula: Acos from	Scalaproduct of the two vectors divided by ( norm (deutsch Betrag) vector 1 by norm vector 2\n"
+		"//see http://www.mathe-online.at/mathint/vect2/i.html#Winkel\n"
+		"function angleBetwTwoLines(a1,a2,b1,b2) {\n"
+		"	angle = Math.acos((a1 * b1 + a2 * b2) / (Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2)) * Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2))));\n"
+		"	return(angle);\n"
+		"}\n"
+		"\n"
+		"//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is new vector c2 returned as array\n"
+		"//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)\n"
+		"//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale\n"
+		"function calcBisectorVector(a1,a2,b1,b2) {\n"
+		"	betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));\n"
+		"	betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));\n"
+		"	c = new Array();\n"
+		"	c[0] = a1 / betraga + b1 / betragb;\n"
+		"	c[1] = a2 / betraga + b2 / betragb;\n"
+		"	return(c);\n"
+		"}\n"
+		"\n"
+		"//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian\n"
+		"//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)\n"
+		"//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale\n"
+		"function calcBisectorAngle(a1,a2,b1,b2) {\n"
+		"	betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));\n"
+		"	betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));\n"
+		"	c1 = a1 / betraga + b1 / betragb;\n"
+		"	c2 = a2 / betraga + b2 / betragb;\n"
+		"	angle = toPolarDir(c1,c2);\n"
+		"	return(angle);\n"
+		"}\n"
+		"\n"
+		"function intersect2lines(line1x1,line1y1,line1x2,line1y2,line2x1,line2y1,line2x2,line2y2) {\n"
+		"	//formula see http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/\n"
+		"	var result = new Array();\n"
+		"	var denominator = (line2y2 - line2y1)*(line1x2 - line1x1) - (line2x2 - line2x1)*(line1y2 - line1y1);\n"
+		"	if (denominator == 0) {\n"
+		"	alert(\"lines are parallel\"));\n"
+		"	}\n"
+		"	else {\n"
+		"	ua = ((line2x2 - line2x1)*(line1y1 - line2y1) - (line2y2 - line2y1)*(line1x1 - line2x1)) / denominator;\n"
+		"	ub = ((line1x2 - line1x1)*(line1y1 - line2y1) - (line1y2 - line1y1)*(line1x1 - line2x1)) / denominator;\n"
+		"	}\n"
+		"	result[\"x\"] = line1x1 + ua * (line1x2 - line1x1);\n"
+		"	result[\"y\"] = line1y1 + ua * (line1y2 - line1y1);\n"
+		"	return(result);\n"
+		"}\n"
+		"\n"
+		"/* ----------------------- helper function to sort arrays ---------------- */\n"
+		"/* ----------------------------------------------------------------------- */\n"
+		"//my own sort function, uses only first part of string (population value)\n"
+		"function mySort(a,b) {\n"
+		"	var myResulta = a.split(\"+\"));\n"
+		"	var myResultb = b.split(\"+\"));\n"
+		"	if (parseFloat(myResulta[0]) < parseFloat(myResultb[0])) {\n"
+		"	return 1;\n"
+		"	}\n"
+		"	else {\n"
+		"	return -1;\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"/* ----------------------- helper function format number strings -------------- */\n"
+		"/* ---------------------------------------------------------------------------- */\n"
+		"//formatting number strings\n"
+		"//this function add's \"'\" to a number every third digit\n"
+		"function formatNumberString(myString) {\n"
+		"	//check if of type string, if number, convert it to string\n"
+		"	if (typeof(myString) == \"number\")) {\n"
+		"	myTempString = myString.toString();\n"
+		"	}\n"
+		"	else {\n"
+		"	myTempString = myString;\n"
+		"	}\n"
+		"	var myNewString=\"\");\n"
+		"	//if it contains a comma, it will be split\n"
+		"	var splitResults = myTempString.split(\".\"));\n"
+		"	var myCounter= splitResults[0].length;\n"
+		"	if (myCounter > 3) {\n"
+		"	while(myCounter > 0) {\n"
+		"		if (myCounter > 3) {\n"
+		"		myNewString = \"),\" + splitResults[0].substr(myCounter - 3,3) + myNewString;\n"
+		"		}\n"
+		"		else {\n"
+		"		myNewString = splitResults[0].substr(0,myCounter) + myNewString;\n"
+		"		}\n"
+		"		myCounter -= 3;\n"
+		"	}\n"
+		"	}\n"
+		"	else {\n"
+		"	myNewString = splitResults[0];\n"
+		"	}\n"
+		"	//concatenate if it contains a comma\n"
+		"	if (splitResults[1]) {\n"
+		"	myNewString = myNewString + \".\" + splitResults[1];\n"
+		"	}\n"
+		"	return myNewString;\n"
+		"}\n"
+		"\n"
+		"//function for status Bar\n"
+		"function statusChange(statusText) {\n"
+		"	document.getElementById(\"statusText\")).firstChild.nodeValue = \"Statusbar: \" + statusText;\n"
+		"}\n"
+		"\n"
+		"//scale an object\n"
+		"function scaleObject(evt,factor) {\n"
+		"//reference to the currently selected object\n"
+		"	var element = evt.currentTarget;\n"
+		"	var myX = element.getAttributeNS(null,\"x\"));\n"
+		"	var myY = element.getAttributeNS(null,\"y\"));\n"
+		"	var newtransform = \"scale(\" + factor + \")) translate(\" + (myX * 1 / factor - myX) + \" \" + (myY * 1 / factor - myY) +\"))\");\n"
+		"	element.setAttributeNS(null,'transform', newtransform);\n"
+		"}\n"
+		"\n"
+		"//this code is copied from Kevin Lindsey\n"
+		"//http://www.kevlindev.com/tutorials/basics/transformations/toUserSpace/index.htm\n"
+		"function getTransformToRootElement(node) {\n"
+		"	try {\n"
+		"	//this part is for fully conformant players\n"
+		"	var CTM = node.getTransformToElement(document.documentElement);\n"
+		"	}\n"
+		"	catch (ex) {\n"
+		"	//this part is for ASV3 or other non-conformant players\n"
+		"	// Initialize our CTM the node's Current Transformation Matrix\n"
+		"	var CTM = node.getCTM();\n"
+		"	// Work our way through the ancestor nodes stopping at the SVG Document\n"
+		"	while ( ( node = node.parentNode ) != document ) {\n"
+		"		// Multiply the new CTM to the one with what we have accumulated so far\n"
+		"		CTM = node.getCTM().multiply(CTM);\n"
+		"	}\n"
+		"	}\n"
+		"	return CTM;\n"
+		"}\n"
+		"\n"
+		"//calculate HSV 2 RGB: HSV (h 0 to 360, sat and val are between 0 and 1), RGB between 0 and 255\n"
+		"function hsv2rgb(hue,sat,val) {\n"
+		"	//alert(\"Hue:\"+hue);\n"
+		"	var rgbArr = new Array();\n"
+		"	if ( sat == 0) {\n"
+		"	rgbArr[\"red\"] = Math.round(val * 255);\n"
+		"	rgbArr[\"green\"] = Math.round(val * 255);\n"
+		"	rgbArr[\"blue\"] = Math.round(val * 255);\n"
+		"	}\n"
+		"	else {\n"
+		"	var h = hue / 60;\n"
+		"	var i = Math.floor(h);\n"
+		"	var f = h - i;\n"
+		"	if (i % 2 == 0) {\n"
+		"		f = 1 - f;\n"
+		"	}\n"
+		"	var m = val * (1 - sat); \n"
+		"	var n = val * (1 - sat * f);\n"
+		"	switch(i) {\n"
+		"		case 0:\n"
+		"		rgbArr[\"red\"] = val;\n"
+		"		rgbArr[\"green\"] = n;\n"
+		"		rgbArr[\"blue\"] = m;\n"
+		"		break;\n"
+		"		case 1:\n"
+		"		rgbArr[\"red\"] = n;\n"
+		"		rgbArr[\"green\"] = val;\n"
+		"		rgbArr[\"blue\"] = m;\n"
+		"		break;\n"
+		"		case 2:\n"
+		"		rgbArr[\"red\"] = m;\n"
+		"		rgbArr[\"green\"] = val;\n"
+		"		rgbArr[\"blue\"] = n;\n"
+		"		break;\n"
+		"		case 3:\n"
+		"		rgbArr[\"red\"] = m;\n"
+		"		rgbArr[\"green\"] = n;\n"
+		"		rgbArr[\"blue\"] = val;\n"
+		"		break;\n"
+		"		case 4:\n"
+		"		rgbArr[\"red\"] = n;\n"
+		"		rgbArr[\"green\"] = m;\n"
+		"		rgbArr[\"blue\"] = val;\n"
+		"		break;\n"
+		"		case 5:\n"
+		"		rgbArr[\"red\"] = val;\n"
+		"		rgbArr[\"green\"] = m;\n"
+		"		rgbArr[\"blue\"] = n;\n"
+		"		break;\n"
+		"		case 6:\n"
+		"		rgbArr[\"red\"] = val;\n"
+		"		rgbArr[\"green\"] = n;\n"
+		"		rgbArr[\"blue\"] = m;\n"
+		"		break;\n"
+		"	}\n"
+		"	rgbArr[\"red\"] = Math.round(rgbArr[\"red\"] * 255);\n"
+		"	rgbArr[\"green\"] = Math.round(rgbArr[\"green\"] * 255);\n"
+		"	rgbArr[\"blue\"] = Math.round(rgbArr[\"blue\"] * 255);\n"
+		"	}\n"
+		"	return rgbArr;\n"
+		"}\n"
+		"\n"
+		"//calculate rgb to hsv values\n"
+		"function rgb2hsv (red,green,blue) {\n"
+		"	//input between 0 and 255 --> normalize to 0 to 1\n"
+		"	//result = \n"
+		"	var hsvArr = new Array();\n"
+		"	red = red / 255;\n"
+		"	green = green / 255;\n"
+		"	blue = blue / 255;\n"
+		"	myMax = Math.max(red, Math.max(green,blue));\n"
+		"	myMin = Math.min(red, Math.min(green,blue));\n"
+		"	v = myMax;\n"
+		"	if (myMax > 0) {\n"
+		"	s = (myMax - myMin) / myMax;\n"
+		"	}\n"
+		"	else {\n"
+		"	s = 0;\n"
+		"	}\n"
+		"	if (s > 0) {\n"
+		"	myDiff = myMax - myMin;\n"
+		"	rc = (myMax - red) / myDiff;\n"
+		"	gc = (myMax - green) / myDiff;\n"
+		"	bc = (myMax - blue) / myDiff;\n"
+		"	if (red == myMax) {\n"
+		"		h = (bc - gc) / 6;\n"
+		"	}\n"
+		"	if (green == myMax) {\n"
+		"		h = (2 + rc - bc) / 6;\n"
+		"	}\n"
+		"	if (blue == myMax) {\n"
+		"		h = (4 + gc - rc) / 6;\n"
+		"	}\n"
+		"	}\n"
+		"	else {\n"
+		"	h = 0;\n"
+		"	}\n"
+		"	if (h < 0) {\n"
+		"	h += 1;\n"
+		"	}\n"
+		"	hsvArr[\"hue\"] = Math.round(h * 360);\n"
+		"	hsvArr[\"sat\"] = s;\n"
+		"	hsvArr[\"val\"] = v;\n"
+		"	return hsvArr;\n"
+		"}\n"
+		"\n"
+		"//populate an array that can be addressed by both a key or an index nr\n"
+		"function assArrayPopulate(arrayKeys,arrayValues) {\n"
+		"	var returnArray = new Array();\n"
+		"	if (arrayKeys.length != arrayValues.length) {\n"
+		"	alert(\"error: arrays do not have same length!\"));\n"
+		"	}\n"
+		"	else {\n"
+		"	for (i=0;i<arrayKeys.length;i++) {\n"
+		"		returnArray[arrayKeys[i]] = arrayValues[i];\n"
+		"	}\n"
+		"	}\n"
+		"	return returnArray;\n"
+		"}\n"
+		"\n"
+		"//replace special (non-ASCII) characters with their charCode\n"
+		"function replaceSpecialChars(myString) {\n"
+		"	for (i=161;i<256;i++) {\n"
+		"		re = new RegExp(\"&#\"+i+\");\"),\"g\"));\n"
+		"		myString = myString.replace(re,String.fromCharCode(i));\n"
+		"	}\n"
+		"	return myString;\n"
+		"}\n"
+		"\n"
+		"/* ----------------------- getXMLData object ----------------------------- */\n"
+		"/* ----------------------------------------------------------------------- */\n"
+		"//this object allows to make network requests using getURL or XMLHttpRequest\n"
+		"//you may specify a url and a callBackFunction\n"
+		"//the callBackFunction receives a XML node representing the rootElement of the fragment received\n"
+		"function getXMLData(url,callBackFunction) {\n"
+		"	this.url = url;\n"
+		"	this.callBackFunction = callBackFunction;\n"
+		"	this.xmlRequest = null;\n"
+		"} \n"
+		"\n"
+		"getXMLData.prototype.getData = function() {\n"
+		"	//call getURL() if available\n"
+		"	if (window.getURL) {\n"
+		"	getURL(this.url,this);\n"
+		"	}\n"
+		"	//or call XMLHttpRequest() if available\n"
+		"	else if (window.XMLHttpRequest) {\n"
+		"	this.xmlRequest = new XMLHttpRequest();\n"
+		"	this.xmlRequest.overrideMimeType(\"text/xml\"));\n"
+		"	this.xmlRequest.open(\"GET\"),this.url,true);\n"
+		"	this.xmlRequest.onreadystatechange = this;\n"
+		"	this.xmlRequest.send(null);\n"
+		"	}\n"
+		"	//write an error message if neither method is available\n"
+		"	else {\n"
+		"	alert(\"your browser/svg viewer neither supports window.getURL nor window.XMLHttpRequest!\"));\n"
+		"	}	\n"
+		"}\n"
+		"\n"
+		"//this is the callback method for the getURL function\n"
+		"getXMLData.prototype.operationComplete = function(data) {\n"
+		"	//check if data has a success property\n"
+		"	if (data.success) {\n"
+		"	//parse content of the XML format to the variable \"node\"\n"
+		"	var node = parseXML(data.content,document);\n"
+		"	this.callBackFunction(node.firstChild);\n"
+		"	}\n"
+		"	else {\n"
+		"	alert(\"something went wrong with dynamic loading of geometry!\"));\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//this method receives data from XMLHttpRequest\n"
+		"getXMLData.prototype.handleEvent = function() {\n"
+		"	if (this.xmlRequest.readyState == 4) {\n"
+		"	this.callBackFunction(this.xmlRequest.responseXML.documentElement);\n"
+		"	}	\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Buttons(void)
+{
+	return(
+		"function button(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
+		"	if (arguments.length > 0) {\n"
+		"	this.init(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"button.prototype.init = function(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
+		"	this.groupId = groupId; //the group id where all new content is appended to\n"
+		"	this.functionToCall = functionToCall; //function to be called if button was pressed\n"
+		"	this.buttonType = buttonType; //button type: currently either \"rect\" or \"ellipse\"\n"
+		"	this.buttonText = buttonText; //default value to be filled in when textbox is created\n"
+		"	this.buttonSymbolId = buttonSymbolId; //id to a symbol to be used as a button graphics\n"
+		"	this.x = x; //left of button rectangle\n"
+		"	this.y = y; //top of button rectangle\n"
+		"	this.width = width; //button rectangle width\n"
+		"	this.height = height; //button rectangle height\n"
+		"	this.fontSize = fontSize; //font size in user units/pixels\n"
+		"	this.fontFamily = fontFamily; //font family for text element, can be an empty string for image buttons\n"
+		"	this.textFill = textFill; //the fill color of the text for text buttons, can be an empty string for image buttons\n"
+		"	this.buttonFill = buttonFill; //the fill color of the button rectangle or ellipse\n"
+		"	this.shadeLightFill = shadeLightFill; //light fill color simulating 3d effect\n"
+		"	this.shadeDarkFill = shadeDarkFill; //dark fill color simulating 3d effect\n"
+		"	this.shadowOffset = shadowOffset; //shadow offset in viewBox units\n"
+		"	this.buttonGroup = document.getElementById(this.groupId); //reference to the button group node\n"
+		"	this.upperLeftLine = null; //later a reference to the upper left line simulating 3d effect\n"
+		"	this.buttonRect = null; //later a reference to the button area (rect)\n"
+		"	this.buttonTextElement = null; //later a reference to the button text\n"
+		"	this.buttonSymbolInstance = null; //later a reference to the button symbol\n"
+		"	this.deActivateRect = null; //later a reference to a rectangle that can be used to deactivate the button\n"
+		"	this.activated = true; //a property indicating if button is activated or not\n"
+		"	this.lowerRightLine = null; //later a reference to the lower right line simulating 3d effect\n"
+		"	this.createButton(); //method to initialize button\n"
+		"	this.timer = new Timer(this); //a Timer instance for calling the functionToCall\n"
+		"	this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms\n"
+		"}\n"
+		"\n"
+		"//create button\n"
+		"button.prototype.createButton = function() {\n"
+		"	//create upper left button line or ellipse\n"
+		"	if (this.buttonType == \"rect\")) {\n"
+		"	this.upperLeftShadow = document.createElementNS(svgNS,\"rect\"));\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"x\"),this.x - this.shadowOffset);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"y\"),this.y - this.shadowOffset);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"width\"),this.width);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"height\"),this.height);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"points\"),this.x+\"),\"+(this.y+this.height)+\" \"+this.x+\"),\"+this.y+\" \"+(this.x+this.width)+\"),\"+this.y);\n"
+		"	}\n"
+		"	else if (this.buttonType == \"ellipse\")) {\n"
+		"	this.upperLeftShadow = document.createElementNS(svgNS,\"ellipse\"));\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5 - this.shadowOffset);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5 - this.shadowOffset);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"rx\"),this.width * 0.5);\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"ry\"),this.height * 0.5);\n"
+		"	}\n"
+		"	else {\n"
+		"	alert(\"buttonType '\"+this.buttonType+\"' not supported. You need to specify 'rect' or 'ellipse'\"));\n"
+		"	}\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);\n"
+		"	this.buttonGroup.appendChild(this.upperLeftShadow);\n"
+		"\n"
+		"	//create lower right button line or ellipse\n"
+		"	if (this.buttonType == \"rect\")) {\n"
+		"	this.lowerRightShadow = document.createElementNS(svgNS,\"rect\"));\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"x\"),this.x + this.shadowOffset);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"y\"),this.y + this.shadowOffset);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"width\"),this.width);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"height\"),this.height);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"points\"),this.x+\"),\"+(this.y+this.height)+\" \"+this.x+\"),\"+this.y+\" \"+(this.x+this.width)+\"),\"+this.y);\n"
+		"	}\n"
+		"	else if (this.buttonType == \"ellipse\")) {\n"
+		"	this.lowerRightShadow = document.createElementNS(svgNS,\"ellipse\"));\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5 + this.shadowOffset);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5 + this.shadowOffset);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"rx\"),this.width * 0.5);\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"ry\"),this.height * 0.5);\n"
+		"	}\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);\n"
+		"	this.buttonGroup.appendChild(this.lowerRightShadow);\n"
+		"\n"
+		"	//create buttonRect\n"
+		"	if (this.buttonType == \"rect\")) {\n"
+		"	this.buttonRect = document.createElementNS(svgNS,\"rect\"));\n"
+		"	this.buttonRect.setAttributeNS(null,\"x\"),this.x);\n"
+		"	this.buttonRect.setAttributeNS(null,\"y\"),this.y);\n"
+		"	this.buttonRect.setAttributeNS(null,\"width\"),this.width);\n"
+		"	this.buttonRect.setAttributeNS(null,\"height\"),this.height);\n"
+		"	}\n"
+		"	else if (this.buttonType == \"ellipse\")) {\n"
+		"	this.buttonRect = document.createElementNS(svgNS,\"ellipse\"));\n"
+		"	this.buttonRect.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5);\n"
+		"	this.buttonRect.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5);\n"
+		"	this.buttonRect.setAttributeNS(null,\"rx\"),this.width * 0.5);\n"
+		"	this.buttonRect.setAttributeNS(null,\"ry\"),this.height * 0.5);\n"
+		"	}\n"
+		"	this.buttonRect.setAttributeNS(null,\"fill\"),this.buttonFill);\n"
+		"	this.buttonRect.setAttributeNS(null,\"cursor\"),\"pointer\"));\n"
+		"	this.buttonRect.addEventListener(\"mousedown\"),this,false);\n"
+		"	this.buttonRect.addEventListener(\"mouseup\"),this,false);\n"
+		"	this.buttonRect.addEventListener(\"click\"),this,false);\n"
+		"	this.buttonGroup.appendChild(this.buttonRect);\n"
+		"	\n"
+		"	if (this.buttonText != undefined) {\n"
+		"	//create text element and add clipping path attribute\n"
+		"	this.buttonTextElement = document.createElementNS(svgNS,\"text\"));\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"x\"),(this.x + this.width / 2));\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"y\"),(this.y + this.height - ((this.height - this.fontSize) / 1.75)));\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"fill\"),this.textFill);\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"font-family\"),this.fontFamily);\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"font-size\"),this.fontSize+\"px\"));\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
+		"	this.buttonTextElement.setAttributeNS(null,\"text-anchor\"),\"middle\"));\n"
+		"	this.buttonTextElement.setAttributeNS(\"http://www.w3.org/XML/1998/namespace\"),\"space\"),\"preserve\"));\n"
+		"	var textboxTextContent = document.createTextNode(this.buttonText);\n"
+		"	this.buttonTextElement.appendChild(textboxTextContent);\n"
+		"	this.buttonGroup.appendChild(this.buttonTextElement);\n"
+		"	}\n"
+		"	\n"
+		"	if (this.buttonSymbolId != undefined) {\n"
+		"	this.buttonSymbolInstance = document.createElementNS(svgNS,\"use\"));\n"
+		"	this.buttonSymbolInstance.setAttributeNS(null,\"x\"),(this.x + this.width / 2));\n"
+		"	this.buttonSymbolInstance.setAttributeNS(null,\"y\"),(this.y + this.height / 2));\n"
+		"	this.buttonSymbolInstance.setAttributeNS(xlinkNS,\"href\"),\"#\"+this.buttonSymbolId);\n"
+		"	this.buttonSymbolInstance.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
+		"	this.buttonGroup.appendChild(this.buttonSymbolInstance);\n"
+		"	}\n"
+		"	\n"
+		"	//create rectangle to deactivate the button\n"
+		"	if (this.buttonType == \"rect\")) {\n"
+		"	this.deActivateRect = document.createElementNS(svgNS,\"rect\"));\n"
+		"	this.deActivateRect.setAttributeNS(null,\"x\"),this.x - this.shadowOffset);\n"
+		"	this.deActivateRect.setAttributeNS(null,\"y\"),this.y - this.shadowOffset);\n"
+		"	this.deActivateRect.setAttributeNS(null,\"width\"),this.width + this.shadowOffset * 2);\n"
+		"	this.deActivateRect.setAttributeNS(null,\"height\"),this.height + this.shadowOffset * 2);\n"
+		"	}\n"
+		"	else if (this.buttonType == \"ellipse\")) {\n"
+		"	this.deActivateRect = document.createElementNS(svgNS,\"ellipse\"));\n"
+		"	this.deActivateRect.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5);\n"
+		"	this.deActivateRect.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5);\n"
+		"	this.deActivateRect.setAttributeNS(null,\"rx\"),this.width * 0.5 + this.shadowOffset);\n"
+		"	this.deActivateRect.setAttributeNS(null,\"ry\"),this.height * 0.5 + this.shadowOffset);\n"
+		"	}\n"
+		"	\n"
+		"	this.deActivateRect.setAttributeNS(null,\"fill\"),\"white\"));\n"
+		"	this.deActivateRect.setAttributeNS(null,\"fill-opacity\"),\"0.5\"));\n"
+		"	this.deActivateRect.setAttributeNS(null,\"stroke\"),\"none\"));\n"
+		"	this.deActivateRect.setAttributeNS(null,\"display\"),\"none\"));\n"
+		"	this.deActivateRect.setAttributeNS(null,\"cursor\"),\"default\"));\n"
+		"	this.buttonGroup.appendChild(this.deActivateRect);\n"
+		"}\n"
+		"\n"
+		"//remove all textbox elements\n"
+		"button.prototype.removeButton = function() {\n"
+		"	this.buttonGroup.removeChild(this.upperLeftShadow);\n"
+		"	this.buttonGroup.removeChild(this.lowerRightShadow);\n"
+		"	this.buttonGroup.removeChild(this.buttonRect);\n"
+		"	if (this.buttonTextElement) {\n"
+		"	this.buttonGroup.removeChild(this.buttonTextElement);	\n"
+		"	}\n"
+		"	if (this.buttonSymbolInstance) {\n"
+		"	this.buttonGroup.removeChild(this.buttonSymbolInstance);	\n"
+		"	}\n"
+		"	this.buttonGroup.removeChild(this.deActivateRect);\n"
+		"}\n"
+		"\n"
+		"//click on and write in textbox\n"
+		"button.prototype.handleEvent = function(evt) {\n"
+		"	if (evt.type == \"mousedown\")) {\n"
+		"	this.togglePressed(\"pressed\"));\n"
+		"	document.documentElement.addEventListener(\"mouseup\"),this,false);	\n"
+		"	}\n"
+		"	if (evt.type == \"mouseup\")) {\n"
+		"	this.togglePressed(\"released\"));\n"
+		"	document.documentElement.removeEventListener(\"mouseup\"),this,false);	\n"
+		"	}\n"
+		"	if (evt.type == \"click\")) {\n"
+		"	//for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround\n"
+		"	//attention: only some of the evt properties are forwarded here, you can add more, if you need them\n"
+		"	var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}\n"
+		"	this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt)\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"button.prototype.togglePressed = function(type) {\n"
+		"	if (type == \"pressed\")) {\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);	\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);\n"
+		"	}\n"
+		"	if (type == \"released\")) {\n"
+		"	this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);	\n"
+		"	this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);	\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"button.prototype.fireFunction = function(evt) {\n"
+		"	if (typeof(this.functionToCall) == \"function\")) {\n"
+		"	if (this.buttonTextElement) {\n"
+		"		this.functionToCall(this.groupId,evt,this.buttonText);\n"
+		"	}\n"
+		"	if (this.buttonSymbolInstance) {\n"
+		"		this.functionToCall(this.groupId,evt);\n"
+		"	}\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == \"object\")) {\n"
+		"	if (this.buttonTextElement) {\n"
+		"		this.functionToCall.buttonPressed(this.groupId,evt,this.buttonText);\n"
+		"	}\n"
+		"	if (this.buttonSymbolInstance) {\n"
+		"		this.functionToCall.buttonPressed(this.groupId,evt);\n"
+		"	}\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == undefined) {\n"
+		"	return;	\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"button.prototype.getTextValue = function() {\n"
+		"	return this.buttonText;\n"
+		"}	\n"
+		"\n"
+		"button.prototype.setTextValue = function(value) {\n"
+		"	this.buttonText = value;\n"
+		"	this.buttonTextElement.firstChild.nodeValue=this.buttonText;\n"
+		"}\n"
+		"\n"
+		"button.prototype.activate = function(value) {\n"
+		"	this.deActivateRect.setAttributeNS(null,\"display\"),\"none\"));\n"
+		"	this.activated = true;\n"
+		"}\n"
+		"\n"
+		"button.prototype.deactivate = function(value) {\n"
+		"	this.deActivateRect.setAttributeNS(null,\"display\"),\"inherit\"));\n"
+		"	this.activated = false;\n"
+		"}\n"
+		"\n"
+		"//switchbutton\n"
+		"//initialize inheritance\n"
+		"switchbutton.prototype = new button();\n"
+		"switchbutton.prototype.constructor = switchbutton;\n"
+		"switchbutton.superclass = button.prototype;\n"
+		"\n"
+		"function switchbutton(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
+		"	if (arguments.length > 0) {\n"
+		"	this.init(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"switchbutton.prototype.init = function(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
+		"	switchbutton.superclass.init.call(this,groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n"
+		"	this.on = false;\n"
+		"}\n"
+		"\n"
+		"//overwriting handleEventcode\n"
+		"switchbutton.prototype.handleEvent = function(evt) {\n"
+		"	//for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround\n"
+		"	//attention: only some of the evt properties are forwarded here, you can add more, if you need them\n"
+		"	var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}\n"
+		"	if (evt.type == \"click\")) {\n"
+		"	if (this.on) {\n"
+		"		this.on = false;\n"
+		"		this.togglePressed(\"released\"));\n"
+		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n"
+		"	}\n"
+		"	else {\n"
+		"		this.on = true;\n"
+		"		this.togglePressed(\"pressed\"));		\n"
+		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n"
+		"	}\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"switchbutton.prototype.getSwitchValue = function() {\n"
+		"	return this.on;\n"
+		"}\n"
+		"\n"
+		"switchbutton.prototype.setSwitchValue = function(onOrOff,firefunction) {\n"
+		"	this.on = onOrOff;\n"
+		"	//artificial timer event - don't use the values!\n"
+		"	var timerEvt = {x:0,y:0,type:\"click\"),detail:1,timeStamp:0}\n"
+		"	if (this.on) {\n"
+		"	this.togglePressed(\"pressed\"));\n"
+		"	if (firefunction) {\n"
+		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n"
+		"	}\n"
+		"	}\n"
+		"	else {\n"
+		"	this.togglePressed(\"released\"));		\n"
+		"	if (firefunction) {\n"
+		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt)\n"
+		"	}\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//overwriting fireFunction code\n"
+		"switchbutton.prototype.fireFunction = function(evt) {\n"
+		"	if (typeof(this.functionToCall) == \"function\")) {\n"
+		"	if (this.buttonTextElement) {\n"
+		"		this.functionToCall(this.groupId,evt,this.on,this.buttonText);\n"
+		"	}\n"
+		"	if (this.buttonSymbolInstance) {\n"
+		"		this.functionToCall(this.groupId,evt,this.on);\n"
+		"	}\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == \"object\")) {\n"
+		"	if (this.buttonTextElement) {\n"
+		"		this.functionToCall.buttonPressed(this.groupId,evt,this.on,this.buttonText);\n"
+		"	}\n"
+		"	if (this.buttonSymbolInstance) {\n"
+		"		this.functionToCall.buttonPressed(this.groupId,evt,this.on);\n"
+		"	}\n"
+		"	}\n"
+		"	if (typeof(this.functionToCall) == undefined) {\n"
+		"	return;	\n"
+		"	}\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Navigation_1(void)
+{
+	return(
+		"/*\n"
+		"Scripts for SVG only webmapping application navigation tools\n"
+		"Copyright (C) <2005>  <Andreas Neumann>\n"
+		"Version 1.1, 2005-10-05\n"
+		"neumann at karto.baug.ethz.ch\n"
+		"http://www.carto.net/\n"
+		"http://www.carto.net/neumann/\n"
+		"\n"
+		"Credits: numerous people on svgdevelopers at yahoogroups.com\n"
+		"\n"
+		"This ECMA script library is free software; you can redistribute it and/or\n"
+		"modify it under the terms of the GNU Lesser General Public\n"
+		"License as published by the Free Software Foundation; either\n"
+		"version 2.1 of the License, or (at your option) any later version.\n"
+		"\n"
+		"This library is distributed in the hope that it will be useful,\n"
+		"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
+		"Lesser General Public License for more details.\n"
+		"\n"
+		"You should have received a copy of the GNU Lesser General Public\n"
+		"License along with this library (http://www.carto.net/papers/svg/navigationTools/lesser_gpl.txt); if not, write to the Free Software\n"
+		"Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA\n"
+		"\n"
+		"----\n"
+		"\n"
+		"current version: 1.1\n"
+		"\n"
+		"version history:\n"
+		"1.0 initial version\n"
+		"1.01 (2005-02-15) added cleanUp() method to map and dragObj objects, some fixes in the documentation\n"
+		"1.02 (2005-02-20) fixed problems with double clicks, the second click of a double click is now ignored, using the evt.detail property\n"
+		"1.03 (2005-02-22) introduced timestamp and nrLayerToLoad array for dynamic loading (getUrl)\n"
+		"1.04 (2005-09-15) introduced a few changes with coordinate calculation to support MozillaSVG, introduced epsg and unitsFactor property based on a suggestion by Bruce Rindahl\n"
+		"1.1 (2005-10-05) introduced button object (see button.js file), introduced zoom and pan \"modes\" for repeated actions in the same mode, introduced history of map extents with the ability to go back and forth in the list of previous map extents, some internal changes in the code (e.g. less global variables), added experimental support for the batik SVG 1.2 \"static\" attribute to improve performance while panning the map, added cursors to give better status feedback\n"
+		"\n"
+		"original document site: http://www.carto.net/papers/svg/navigationTools/\n"
+		"Please contact the author in case you want to use code or ideas commercially.\n"
+		"If you use this code, please include this copyright header, the included full\n"
+		"LGPL 2.1 text and read the terms provided in the LGPL 2.1 license\n"
+		"(http://www.gnu.org/copyleft/lesser.txt)\n"
+		"\n"
+		"-------------------------------\n"
+		"\n"
+		"Please report bugs and send improvements to neumann at karto.baug.ethz.ch\n"
+		"If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)\n"
+		"somewhere in the source-code-comment or the \"about\" of your project and give credits, thanks!\n"
+		"\n"
+		"*/\n"
+		"\n"
+		"//constructor: holds data on map and initializes various references\n"
+		"function map(mapName,maxWidth,minWidth,zoomFact,nrDecimals,epsg,units,unitsFactor,showCoords,coordXId,coordYId,dynamicLayers,digiLayers,activeDigiLayer) {\n"
+		"	this.mapName = mapName; //id of svg element containing the map geometry\n"
+		"	this.mapSVG = document.getElementById(this.mapName); //reference to nested SVG element holding the map-graphics\n"
+		"	this.mainMapGroup = document.getElementById(this.mapName+\"Group\")); //group within mainmap - to be transformed when panning manually\n"
+		"	this.dynamicLayers = dynamicLayers; //an associative array holding ids of values that are loaded from the web server dynamically (.getUrl())\n"
+		"	this.nrLayerToLoad = 0; //statusVariable to indicate how many layers are still to load\n"
+		"	this.maxWidth = maxWidth; //max map width\n"
+		"	this.minWidth = minWidth; //min map width, after zooming in\n"
+		"	this.zoomFact = zoomFact; //ratio to zoom in or out in relation to previous viewBox\n"
+		"	this.digiLayers = digiLayers; //references to digiLayers (for digitizing tools)\n"
+		"	this.activeDigiLayer = activeDigiLayer; //active Digi Layer, key is final group id where geometry should be copied to after digitizing\n"
+		"	this.pixXOffset = parseFloat(this.mapSVG.getAttributeNS(null,\"x\"))); //offset from left margin of outer viewBox\n"
+		"	this.pixYOffset = parseFloat(this.mapSVG.getAttributeNS(null,\"y\"))); //offset from top margin of outer viewBox\n"
+		"	var viewBoxArray = this.mapSVG.getAttributeNS(null,\"viewBox\")).split(\" \"));\n"
+		"	this.curxOrig = parseFloat(viewBoxArray[0]); //holds the current xOrig\n"
+		"	this.curyOrig = parseFloat(viewBoxArray[1]); //holds the current yOrig\n"
+		"	this.curWidth = parseFloat(viewBoxArray[2]); //holds the current map width\n"
+		"	this.curHeight = parseFloat(viewBoxArray[3]); //holds the current map height\n"
+		"	this.pixWidth = parseFloat(this.mapSVG.getAttributeNS(null,\"width\"))); //holds width of the map in pixel coordinates\n"
+		"	this.pixHeight = parseFloat(this.mapSVG.getAttributeNS(null,\"height\"))); //holds height of the map in pixel coordinates\n"
+		"	this.pixSize = this.curWidth / this.pixWidth; //size of a screen pixel in map units\n"
+		"	this.zoomVal = this.maxWidth / this.curWidth * 100; //zoomVal in relation to initial zoom\n"
+		"	this.nrDecimals = nrDecimals; //nr of decimal places to be displayed for show coordinates or accuracy when working with digitizing\n"
+		"	this.epsg = epsg; //epsg projection code - can be used for building URL strings for loading data from a WMS or spatial database, if you don't need it just input any number\n"
+		"	this.navStatus = \"info\"); //to indicate status in navigation, default is \"info\"), no navigation mode active\n"
+		"	this.units = units; //holds a string with map units, e.g. \"m\"), alternatively String.fromCharCode(176) for degrees\n"
+		"	this.unitsFactor = unitsFactor; //a factor for unit conversion. Can be used f.e. to output feet coordinates when data is meter, If you don't need a conversion, just use a factor of 1\n"
+		"	this.showCoords = showCoords;\n"
+		"	//initialize array of timestamp/layertoLoad values\n"
+		"	this.nrLayerToLoad = new Array();\n"
+		"	this.timestamp = null; //holds the timestamp after a zoom or pan occured\n"
+		"	//initialize coordinate display if showCoords == true\n"
+		"	if (this.showCoords == true) {\n"
+		"		//add event listener for coordinate display\n"
+		"		this.mapSVG.addEventListener(\"mousemove\"),this,false);\n"
+		"		if (typeof(coordXId) == \"string\")) {\n"
+		"			this.coordXText = document.getElementById(coordXId).firstChild;\n"
+		"		}\n"
+		"		else {\n"
+		"			alert(\"Error: coordXId needs to be an id of type string\"));\n"
+		"		}\n"
+		"		if (typeof(coordYId) == \"string\")) {\n"
+		"			this.coordYText = document.getElementById(coordYId).firstChild;\n"
+		"		}\n"
+		"		else {\n"
+		"			alert(\"Error: coordYId needs to be an id of type string\"));\n"
+		"		}\n"
+		"	}\n"
+		"	//a new array containing map extents\n"
+		"	this.mapExtents = new Array();\n"
+		"	this.mapExtents.push({xmin:this.curxOrig,ymin:((this.curyOrig + this.curHeight) * -1),xmax:(this.curxOrig + this.curWidth),ymax:(this.curyOrig * -1)});\n"
+		"	this.curMapExtentIndex = 0;\n"
+		"	//create background-element to receive events for showing coordinates\n"
+		"	//this rect is also used for manual zooming and panning\n"
+		"	this.backgroundRect = document.createElementNS(svgNS,\"rect\"));\n"
+		"	this.backgroundRect.setAttributeNS(null,\"x\"),this.curxOrig);\n"
+		"	this.backgroundRect.setAttributeNS(null,\"y\"),this.curyOrig);\n"
+		"	this.backgroundRect.setAttributeNS(null,\"width\"),this.curWidth);\n"
+		"	this.backgroundRect.setAttributeNS(null,\"height\"),this.curHeight);\n"
+		"	this.backgroundRect.setAttributeNS(null,\"fill\"),\"none\"));\n"
+		"	this.backgroundRect.setAttributeNS(null,\"stroke\"),\"none\"));\n"
+		"	this.backgroundRect.setAttributeNS(null,\"pointer-events\"),\"fill\"));\n"
+		"	this.backgroundRect.setAttributeNS(null,\"id\"),\"mapBackgroundRect\"));\n"
+		"	this.backgroundRect.addEventListener(\"mousedown\"),this,false);\n"
+		"	this.backgroundRect.addEventListener(\"mousemove\"),this,false);\n"
+		"	this.backgroundRect.addEventListener(\"mouseup\"),this,false);\n"
+		"	this.backgroundRect.addEventListener(\"mouseout\"),this,false);\n"
+		"	this.backgroundRect.addEventListener(\"click\"),this,false);\n"
+		"	this.mainMapGroup.insertBefore(this.backgroundRect,this.mainMapGroup.firstChild);\n"
+		"	//determine if viewer is capable of getScreenCTM\n"
+		"	if (document.documentElement.getScreenCTM) {\n"
+		"		this.getScreenCTM = true;\n"
+		"	}\n"
+		"	else {\n"
+		"		this.getScreenCTM = false;		\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//resets viewBox of main map after zooming and panning\n"
+		"map.prototype.newViewBox = function(refRectId,history) {\n"
+		"	var myRefRect = document.getElementById(refRectId);\n"
+		"	this.curxOrig = parseFloat(myRefRect.getAttributeNS(null,\"x\")));\n"
+		"	this.curyOrig = parseFloat(myRefRect.getAttributeNS(null,\"y\")));\n"
+		"	this.curWidth = parseFloat(myRefRect.getAttributeNS(null,\"width\")));\n"
+		"	this.curHeight = parseFloat(myRefRect.getAttributeNS(null,\"height\")));\n"
+		"	var myViewBoxString = this.curxOrig + \" \" + this.curyOrig + \" \" + this.curWidth + \" \" + this.curHeight;\n"
+		"	this.pixSize = this.curWidth / this.pixWidth;\n"
+		"	this.zoomVal = this.maxWidth / this.curWidth * 100;\n"
+		"	this.mapSVG.setAttributeNS(null,\"viewBox\"),myViewBoxString);\n"
+		"	myMapApp.zoomSlider.setValue(this.curWidth);\n"
+		"	loadProjectSpecific();\n"
+		"	if (history) {\n"
+		"	    this.mapExtents.push({xmin:this.curxOrig,ymin:((this.curyOrig + this.curHeight) * -1),xmax:(this.curxOrig + this.curWidth),ymax:(this.curyOrig * -1)});\n"
+		"               this.curMapExtentIndex = (this.mapExtents.length - 1);\n"
+		"	}\n"
+		"	this.checkButtons();\n"
+		"}\n"
+		"\n"
+		"map.prototype.backwardExtent = function() {\n"
+		"    if (this.curMapExtentIndex != 0) {\n"
+		"        this.curMapExtentIndex--;\n"
+		"        this.setNewViewBox(this.mapExtents[this.curMapExtentIndex].xmin,this.mapExtents[this.curMapExtentIndex].ymin,this.mapExtents[this.curMapExtentIndex].xmax,this.mapExtents[this.curMapExtentIndex].ymax,false);\n"
+		"    }\n"
+		"}\n"
+		"\n"
+		"map.prototype.forwardExtent = function() {\n"
+		"    if (this.mapExtents.length != (this.curMapExtentIndex + 1)) {\n"
+		"        this.curMapExtentIndex++;\n"
+		"        this.setNewViewBox(this.mapExtents[this.curMapExtentIndex].xmin,this.mapExtents[this.curMapExtentIndex].ymin,this.mapExtents[this.curMapExtentIndex].xmax,this.mapExtents[this.curMapExtentIndex].ymax,false);\n"
+		"    }\n"
+		"}\n"
+		"\n"
+		"map.prototype.checkButtons = function() {\n"
+		"           //check extent history\n"
+		"           if (this.curMapExtentIndex == 0) {\n"
+		"                if (myMapApp.buttons[\"backwardExtent\"].activated) {\n"
+		"                  myMapApp.buttons[\"backwardExtent\"].deactivate();\n"
+		"                }\n"
+		"           }\n"
+		"           else {\n"
+		"                if (!myMapApp.buttons[\"backwardExtent\"].activated) {\n"
+		"                  myMapApp.buttons[\"backwardExtent\"].activate();\n"
+		"                }           \n"
+		"           }\n"
+		"           if (this.mapExtents.length == (this.curMapExtentIndex + 1)) {\n"
+		"                if (myMapApp.buttons[\"forwardExtent\"].activated) {\n"
+		"                   myMapApp.buttons[\"forwardExtent\"].deactivate();\n"
+		"                }\n"
+		"           }\n"
+		"           else {\n"
+		"                if (!myMapApp.buttons[\"forwardExtent\"].activated) {\n"
+		"                  myMapApp.buttons[\"forwardExtent\"].activate();\n"
+		"                }           \n"
+		"           }\n"
+		" \n"
+		"           //maximum map width reached, cannot zoom out further\n"
+		"           if (this.curWidth >= this.maxWidth) {\n"
+		"               if (myMapApp.buttons[\"zoomOut\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomOut\"].deactivate();\n"
+		"               }\n"
+		"               if (myMapApp.buttons[\"zoomFull\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomFull\"].deactivate();\n"
+		"               }\n"
+		"               if (myMapApp.buttons[\"panManual\"].activated) {\n"
+		"                   myMapApp.buttons[\"panManual\"].deactivate();\n"
+		"               }\n"
+		"               if (myMapApp.buttons[\"recenterMap\"].activated) {\n"
+		"                   myMapApp.buttons[\"recenterMap\"].deactivate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomIn\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomIn\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomManual\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomManual\"].activate();\n"
+		"               }\n"
+		"           }\n"
+		"           //minimum map width reached, cannot zoom in further\n"
+		"           else if (this.curWidth <= this.minWidth) {\n"
+		"               if (myMapApp.buttons[\"zoomIn\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomIn\"].deactivate();\n"
+		"               }\n"
+		"               if (myMapApp.buttons[\"zoomManual\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomManual\"].deactivate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomOut\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomOut\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomFull\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomFull\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"panManual\"].activated) {\n"
+		"                   myMapApp.buttons[\"panManual\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"recenterMap\"].activated) {\n"
+		"                   myMapApp.buttons[\"recenterMap\"].activate();\n"
+		"               }           \n"
+		"           }\n"
+		"           //in between\n"
+		"           else {\n"
+		"               if (!myMapApp.buttons[\"zoomIn\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomIn\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomManual\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomManual\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomOut\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomOut\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"zoomFull\"].activated) {\n"
+		"                   myMapApp.buttons[\"zoomFull\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"panManual\"].activated) {\n"
+		"                   myMapApp.buttons[\"panManual\"].activate();\n"
+		"               }\n"
+		"               if (!myMapApp.buttons[\"recenterMap\"].activated) {\n"
+		"                   myMapApp.buttons[\"recenterMap\"].activate();\n"
+		"               }           \n"
+		"           }           \n"
+		"}\n"
+		"\n"
+		"map.prototype.setNewViewBox = function(xmin,ymin,xmax,ymax,history) {\n"
+		"	//check if within constraints\n"
+		"	if (xmin < myMapApp.refMapDragger.constrXmin) {\n"
+		"		xmin = myMapApp.refMapDragger.constrXmin;\n"
+		"	}\n"
+		"	if (xmax > myMapApp.refMapDragger.constrXmax) {\n"
+		"		xmax = myMapApp.refMapDragger.constrXmin;\n"
+		"	}\n"
+		"	if (ymin < (myMapApp.refMapDragger.constrYmax * -1)) {\n"
+		"		ymin = myMapApp.refMapDragger.constrYmax * -1;\n"
+		"	}\n"
+		"	if (ymax > (myMapApp.refMapDragger.constrYmin * -1)) {\n"
+		"		ymax = myMapApp.refMapDragger.constrYmin * -1;\n"
+		"	}\n"
+		"	\n"
+		"	var origWidth = xmax - xmin;\n"
+		"	var origHeight = ymax - ymin;\n"
+		"	var myRatio = this.curWidth/this.curHeight;\n"
+		"	\n"
+		"	if (origWidth / origHeight > myRatio) { //case rect is more wide than ratio\n"
+		"		var newWidth = origWidth;\n"
+		"		var newHeight = origWidth * 1 / myRatio;\n"
+		"		ymin = (ymax + (newHeight - origHeight) / 2) * -1;\n"
+		"	}\n"
+		"	else {\n"
+		"		var newHeight = origHeight;\n"
+		"		var newWidth = newHeight * myRatio;\n"
+		"		xmin = xmin - (newWidth - origWidth) / 2;\n"
+		"		ymin = ymax * -1;\n"
+		"	}\n"
+		"	//check if within constraints\n"
+		"	if (xmin < myMapApp.refMapDragger.constrXmin) {\n"
+		"		xmin = myMapApp.refMapDragger.constrXmin;\n"
+		"	}\n"
+		"	if (ymin < myMapApp.refMapDragger.constrYmin) {\n"
+		"		ymin = myMapApp.refMapDragger.constrYmin;\n"
+		"	}\n"
+		"	if ((xmin + newWidth) > myMapApp.refMapDragger.constrXmax) {\n"
+		"		xmin = myMapApp.refMapDragger.constrXmax - newWidth;\n"
+		"	}\n"
+		"	if ((ymin + newHeight) > myMapApp.refMapDragger.constrYmax) {\n"
+		"		ymin = myMapApp.refMapDragger.constrYmax - newHeight;\n"
+		"	}		\n"
+		"	myMapApp.refMapDragger.newView(xmin,ymin,newWidth,newHeight);\n"
+		"	this.newViewBox(myMapApp.refMapDragger.dragId,history);\n"
+		"}\n"
+		"\n"
+		"//handles events associated with navigation\n"
+		"map.prototype.handleEvent = function(evt) {\n"
+		"	var callerId = evt.currentTarget.getAttributeNS(null,\"id\"));\n"
+		"	if (callerId.match(/\\bzoomBgRectManual/)) {\n"
+		"		this.zoomManDragRect(evt);\n"
+		"	}\n"
+		"	if (callerId.match(/\\bzoomBgRectRecenter/)) {\n"
+		"		this.recenterFinally(evt);\n"
+		"	}\n"
+		"	if (callerId.match(/\\bbgPanManual/)) {\n"
+		"		this.panManualFinally(evt);\n"
+		"	}\n"
+		"	if (callerId == \"mainMap\" && evt.type == \"mousemove\")) {\n"
+		"		if (this.navStatus != \"panmanualActive\")) {\n"
+		"		    this.showCoordinates(evt);\n"
+		"		}\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//calcs coordinates; relies on myMapApp to handle different window sizes and resizing of windows\n"
+		"map.prototype.calcCoord = function(evt) {\n"
+		"	//with getScreenCTM the values are already in the inner coordinate system\n"
+		"	if (!this.getScreenCTM) {\n"
+		"		var coords = myMapApp.calcCoord(evt,this.mapSVG);\n"
+		"		coords.x = this.curxOrig + (coords.x - this.pixXOffset) * this.pixSize;\n"
+		"		coords.y = (this.curyOrig + (coords.y - this.pixYOffset) * this.pixSize);\n"
+		"	}\n"
+		"	else {	\n"
+		"		var coords = myMapApp.calcCoord(evt,this.mainMapGroup);\n"
+		"	}\n"
+		"	return coords;\n"
+		"}\n"
+		"\n"
+		"//displays x and y coordinates in two separate text elements\n"
+		"map.prototype.showCoordinates = function(evt) {\n"
+		"	var mapCoords = this.calcCoord(evt);\n"
+		"	this.coordXText.nodeValue = \"X: \" + formatNumberString((mapCoords.x * this.unitsFactor).toFixed(this.nrDecimals)) + this.units;\n"
+		"	this.coordYText.nodeValue = \"Y: \" + formatNumberString((mapCoords.y * this.unitsFactor * -1).toFixed(this.nrDecimals)) + this.units;\n"
+		"}\n"
+		"\n"
+		"//checks for and removes temporary rectangle objects\n"
+		"map.prototype.stopNavModes = function() {\n"
+		"	if (this.navStatus != \"info\")) {\n"
+		"                    	if (this.navStatus == \"zoomManual\")) {\n"
+		"                    	    myMapApp.buttons[\"zoomManual\"].setSwitchValue(false,false);\n"
+		"                    	}\n"
+		"                     	if (this.navStatus == \"panmanual\" || this.navStatus == \"panmanualActive\")) {\n"
+		"                    	    myMapApp.buttons[\"panManual\"].setSwitchValue(false,false);\n"
+		"                    	}\n"
+		"                    	if (this.navStatus == \"recenter\")) {\n"
+		"                    	    myMapApp.buttons[\"recenterMap\"].setSwitchValue(false,false);\n"
+		"                    	}\n"
+		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"mapBackgroundRect\"));\n"
+		"		myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n"
+		"		this.navStatus = \"info\");\n"
+		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"crosshair\"));\n"
+		"		statusChange(\"Mode: Infomode\"));\n"
+		"	               this.mainMapGroup.insertBefore(this.backgroundRect,this.mainMapGroup.firstChild);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//starts manual zooming mode\n"
+		"map.prototype.zoomManual = function(evt) {\n"
+		"	if (Math.round(myMainMap.curWidth) > myMainMap.minWidth && evt.detail == 1) {\n"
+		"		this.navStatus = \"zoomManual\");\n"
+		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"zoomBgRectManual\"));	\n"
+		"	               this.mainMapGroup.appendChild(this.backgroundRect);\n"
+		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"se-resize\"));\n"
+		"		statusChange(\"Click and drag rectangle for new map extent.\"));\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//manages manual zooming by drawing a rectangle\n"
+		"map.prototype.zoomManDragRect = function(evt) {\n"
+		"	var mapCoords = this.calcCoord(evt);\n"
+		"	var myX = mapCoords.x;\n"
+		"	var myY = mapCoords.y;\n"
+		"	var myYXFact = this.curHeight / this.curWidth;\n"
+		"	if (evt.type == \"mousedown\")) {\n"
+		"		this.manZoomActive = 1;\n"
+		"		this.zoomRect = document.createElementNS(svgNS,\"rect\"));\n"
+		"		var myLineWidth = this.curWidth * 0.003;\n"
+		"		this.zoomRect.setAttributeNS(null,\"id\"),\"zoomRect\"));\n"
+		"		this.zoomRect.setAttributeNS(null,\"fill\"),\"white\"));\n"
+		"		this.zoomRect.setAttributeNS(null,\"fill-opacity\"),\"0.5\"));\n"
+		"		this.zoomRect.setAttributeNS(null,\"stroke\"),\"dimgray\"));\n"
+		"		this.zoomRect.setAttributeNS(null,\"stroke-width\"),myLineWidth);\n"
+		"		this.zoomRect.setAttributeNS(null,\"stroke-dasharray\"),(myLineWidth*3)+\"),\"+myLineWidth);\n"
+		"		this.zoomRect.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
+		"		this.zoomRect.setAttributeNS(null,\"x\"),myX);\n"
+		"		this.zoomRect.setAttributeNS(null,\"y\"),myY);\n"
+		"		this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n"
+		"		this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);\n"
+		"		this.mainMapGroup.appendChild(this.zoomRect);\n"
+		"		this.zoomRectOrigX = myX;\n"
+		"		this.zoomRectOrigY = myY;\n"
+		"	}\n"
+		"	if (evt.type == \"mousemove\" && this.manZoomActive == 1) {\n"
+		"		var myZoomWidth = myX - this.zoomRectOrigX;\n"
+		"		if (myZoomWidth < 0) {\n"
+		"			if (Math.abs(myZoomWidth) < this.minWidth) {\n"
+		"				this.zoomRect.setAttributeNS(null,\"x\"),this.zoomRectOrigX - this.minWidth);\n"
+		"				this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY - this.minWidth * myYXFact);\n"
+		"				this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n"
+		"				this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);\n"
+		"			}\n"
+		"			else {\n"
+		"				this.zoomRect.setAttributeNS(null,\"x\"),myX);\n"
+		"				this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY - Math.abs(myZoomWidth) * myYXFact);\n"
+		"				this.zoomRect.setAttributeNS(null,\"width\"),Math.abs(myZoomWidth));\n"
+		"				this.zoomRect.setAttributeNS(null,\"height\"),Math.abs(myZoomWidth) * myYXFact);			\n"
+		"			}\n"
+		"		}\n"
+		"		else {\n"
+		"			this.zoomRect.setAttributeNS(null,\"x\"),this.zoomRectOrigX);\n"
+		"			this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY);\n"
+		"			if (myZoomWidth < this.minWidth) {\n"
+		"				this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n"
+		"				this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);		\n"
+		"			}\n"
+		"			else {\n"
+		"				this.zoomRect.setAttributeNS(null,\"width\"),myZoomWidth);\n"
+		"				this.zoomRect.setAttributeNS(null,\"height\"),myZoomWidth * myYXFact);\n"
+		"			}\n"
+		"		}\n"
+		"	}\n"
+		"	if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.manZoomActive == 1) {\n"
+		"		this.manZoomActive = 0;\n"
+		"		if (parseFloat(this.zoomRect.getAttributeNS(null,\"width\"))) > this.curWidth * 0.02) {\n"
+		"			myMapApp.refMapDragger.newView(parseFloat(this.zoomRect.getAttributeNS(null,\"x\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"y\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"width\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"height\"))));\n"
+		"			this.newViewBox(myMapApp.refMapDragger.dragId,true);\n"
+		"		}\n"
+		"		this.mainMapGroup.removeChild(this.zoomRect);\n"
+		"		statusChange(\"Mode: Manual Zooming\"));\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//initializes recentering mode\n"
+		"map.prototype.recenter = function(evt) {\n"
+		"	if (evt.detail == 1) {\n"
+		"		this.navStatus = \"recenter\");\n"
+		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"zoomBgRectRecenter\"));	\n"
+		"	               this.mainMapGroup.appendChild(this.backgroundRect);\n"
+		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"pointer\"));\n"
+		"		statusChange(\"Click in map to define new map center.\"));\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//finishes recentering after mouse-click\n"
+		"map.prototype.recenterFinally = function(evt) {\n"
+		"	if (evt.type == \"click\")) {\n"
+		"		var mapCoords = this.calcCoord(evt);\n"
+		"		var myX = mapCoords.x;\n"
+		"		var myY = mapCoords.y;\n"
+		"		var myNewX = myX - this.curWidth / 2;\n"
+		"		var myNewY = myY - this.curHeight / 2;\n"
+		"		\n"
+		"		//check if within constraints\n"
+		"		if (myNewX < myMapApp.refMapDragger.constrXmin) {\n"
+		"			myNewX = myMapApp.refMapDragger.constrXmin;\n"
+		"		}\n"
+		"		if (myNewY < myMapApp.refMapDragger.constrYmin) {\n"
+		"			myNewY = myMapApp.refMapDragger.constrYmin;\n"
+		"		}\n"
+		"		if ((myNewX + this.curWidth) > myMapApp.refMapDragger.constrXmax) {\n"
+		"			myNewX = myMapApp.refMapDragger.constrXmax - this.curWidth;\n"
+		"		}\n"
+		"		if ((myNewY + this.curHeight) > myMapApp.refMapDragger.constrYmax) {\n"
+		"			myNewY = myMapApp.refMapDragger.constrYmax - this.curHeight;\n"
+		"		}\n"
+		"		myMapApp.refMapDragger.newView(myNewX,myNewY,this.curWidth,this.curHeight);\n"
+		"		this.newViewBox(myMapApp.refMapDragger.dragId,true);\n"
+		"		statusChange(\"Mode: Recentering Map\"));\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//initializes manual panning\n"
+		"map.prototype.panManual = function(evt) {\n"
+		"	if (evt.detail == 1) {\n"
+		"		this.navStatus = \"panmanual\");\n"
+		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"bgPanManual\"));	\n"
+		"	               this.mainMapGroup.appendChild(this.backgroundRect);\n"
+		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"move\"));\n"
+		"		statusChange(\"Mouse down and move to pan the map\"));\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//manages and finishes manual panning\n"
+		"map.prototype.panManualFinally = function(evt) {\n"
+		"	if (evt.type == \"mousedown\")) {\n"
+		"		this.navStatus = \"panmanualActive\");\n"
+		"		this.panCoords = this.calcCoord(evt);\n"
+		"		this.panCoorX = this.panCoords.x;\n"
+		"		this.panCoorY = this.panCoords.y;\n"
+		"		this.diffX = 0;\n"
+		"		this.diffY = 0;\n"
+		"		this.mainMapGroup.setAttributeNS(batikNS,\"static\"),\"true\"));\n"
+		"	}\n"
+		"	if (evt.type == \"mousemove\" && this.navStatus == \"panmanualActive\")) {\n"
+		"		var mapCoords = this.calcCoord(evt);\n"
+		"		if (this.getScreenCTM) {\n"
+		"			this.diffX = this.panCoorX - mapCoords.x + this.diffX;\n"
+		"			this.diffY = this.panCoorY - mapCoords.y + this.diffY;\n"
+		"		}\n"
+		"		else {\n"
+		"			this.diffX = this.panCoorX - mapCoords.x;\n"
+		"			this.diffY = this.panCoorY - mapCoords.y;		\n"
+		"		}\n"
+		"		var myNewX = this.curxOrig + this.diffX;\n"
+		"		var myNewY = this.curyOrig + this.diffY;\n"
+		"		//check if within constraints\n"
+		"		if (myNewX < myMapApp.refMapDragger.constrXmin) {\n"
+		"			var myNewXTemp = myMapApp.refMapDragger.constrXmin;\n"
+		"			this.diffX = this.diffX + (myNewXTemp - myNewX);\n"
+		"			myNewX = myNewXTemp;\n"
+		"		}\n"
+		"		if (myNewY < myMapApp.refMapDragger.constrYmin) {\n"
+		"			var myNewYTemp = myMapApp.refMapDragger.constrYmin;\n"
+		"			this.diffY = this.diffY + (myNewYTemp - myNewY);\n"
+		"			myNewY = myNewYTemp;\n"
+		"		}\n"
+		"		if ((myNewX + this.curWidth) > myMapApp.refMapDragger.constrXmax) {\n"
+		"			var myNewXTemp = myMapApp.refMapDragger.constrXmax - this.curWidth;\n"
+		"			this.diffX = this.diffX + (myNewXTemp - myNewX);\n"
+		"			myNewX = myNewXTemp;\n"
+		"		}\n"
+		"		if ((myNewY + this.curHeight) > myMapApp.refMapDragger.constrYmax) {\n"
+		"			var myNewYTemp = myMapApp.refMapDragger.constrYmax - this.curHeight;\n"
+		"			this.diffY = this.diffY + (myNewYTemp - myNewY);\n"
+		"			myNewY = myNewYTemp;\n"
+		"		}	\n"
+		"		var transformString = \"translate(\"+(this.diffX * -1) +\"),\"+(this.diffY * -1)+\"))\");\n"
+		"		this.mainMapGroup.setAttributeNS(null,\"transform\"),transformString);\n"
+		"		myMapApp.refMapDragger.newView(myNewX,myNewY,this.curWidth,this.curHeight);\n"
+		"	}\n"
+		"	if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.navStatus == \"panmanualActive\")) {\n"
+		"		this.navStatus = \"panmanual\");\n"
+		"		this.mainMapGroup.setAttributeNS(batikNS,\"static\"),\"false\"));\n"
+		"		this.mainMapGroup.setAttributeNS(null,\"transform\"),\"translate(0,0)\"));\n"
+		"		this.newViewBox(myMapApp.refMapDragger.dragId,true);			\n"
+		"		statusChange(\"Mode: Manual Panning\"));	\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//remove all temporarily added elements and event listeners\n"
+		"map.prototype.cleanUp = function() {\n"
+		"			//remove background rect\n"
+		"			this.backgroundRect.parentNode.removeChild(this.backgroundRect);\n"
+		"			//remove eventlisteners\n"
+		"			if (this.showCoords == true) {\n"
+		"				//add event listener for coordinate display\n"
+		"				this.mapSVG.removeEventListener(\"mousemove\"),this,false);\n"
+		"			}\n"
+		"\n"
+		"}\n"
+		"\n"
+		"//make an element (rectangle) draggable within constraints\n"
+		"function dragObj(dragId,referenceMap,myDragSymbol,dragSymbThreshold,showCoords,coordXId,coordYId,mainMapObj) {\n"
+		"	this.dragId = dragId;\n"
+		"	this.myDragger = document.getElementById(this.dragId);\n"
+		"	this.myRefMap = document.getElementById(referenceMap);\n"
+		"	this.myDragSymbol = document.getElementById(myDragSymbol);	\n"
+		"	this.dragSymbThreshold = dragSymbThreshold;\n"
+		"	var viewBox = this.myRefMap.getAttributeNS(null,\"viewBox\")).split(\" \"));\n"
+		"	this.constrXmin = parseFloat(viewBox[0]);\n"
+		"	this.constrYmin = parseFloat(viewBox[1]);\n"
+		"	this.constrXmax = this.constrXmin + parseFloat(viewBox[2]);\n"
+		"	this.constrYmax = this.constrYmin + parseFloat(viewBox[3]);\n"
+		"	this.refMapX = parseFloat(this.myRefMap.getAttributeNS(null,\"x\")));\n"
+		"	this.refMapY = parseFloat(this.myRefMap.getAttributeNS(null,\"y\")));\n"
+		"	this.refMapWidth = parseFloat(this.myRefMap.getAttributeNS(null,\"width\")));\n"
+		"	this.pixSize = (this.constrXmax - this.constrXmin) / this.refMapWidth;\n"
+		"	this.mainMapObj = mainMapObj;\n"
+		"	//initialize coordinate display if showCoords == true\n"
+		"	this.showCoords = showCoords;\n"
+		"	if (this.showCoords == true) {\n"
+		"		if (typeof(coordXId) == \"string\")) {\n"
+		"			this.coordXText = document.getElementById(coordXId).firstChild;\n"
+		"		}\n"
+		"		else {\n"
+		"			alert(\"Error: coordXId needs to be an id of type string\"));\n"
+		"		}\n"
+		"		if (typeof(coordYId) == \"string\")) {\n"
+		"			this.coordYText = document.getElementById(coordYId).firstChild;\n"
+		"		}\n"
+		"		else {\n"
+		"			alert(\"Error: coordYId needs to be an id of type string\"));\n"
+		"		}\n"
+		"	}\n"
+		"	//determine if viewer is capable of getScreenCTM\n"
+		"	if (document.documentElement.getScreenCTM) {\n"
+		"		this.getScreenCTM = true;\n"
+		"	}\n"
+		"	else {\n"
+		"		this.getScreenCTM = false;		\n"
+		"	}\n"
+		"	this.status = false;\n"
+		"}\n"
+		"\n"
+		"dragObj.prototype.calcCoord = function(evt) {\n"
+		"	//with getScreenCTM the values are already in the inner coordinate system but without using the outer offset\n"
+		"	var coordPoint = myMapApp.calcCoord(evt,this.myRefMap);\n"
+		"	if (!this.getScreenCTM) {\n"
+		"		coordPoint.x = this.constrXmin + (coordPoint.x - this.refMapX) * this.pixSize;\n"
+		"		coordPoint.y = this.constrYmin + (coordPoint.y - this.refMapY) * this.pixSize;\n"
+		"	}\n"
+		"	return coordPoint;\n"
+		"}\n"
+		"\n"
+		"dragObj.prototype.handleEvent = function(evt) {\n"
+		"	if (evt.type == \"mousemove\")) {\n"
+		"		var mapCoords = this.calcCoord(evt);\n"
+		"		this.coordXText.nodeValue = \"X: \" + formatNumberString(mapCoords.x.toFixed(this.mainMapObj.nrDecimals)) + this.mainMapObj.units;\n"
+		"		this.coordYText.nodeValue = \"Y: \" + formatNumberString((mapCoords.y * -1).toFixed(this.mainMapObj.nrDecimals)) + this.mainMapObj.units;\n"
+		"	}\n"
+		"	this.drag(evt);\n"
+		"}\n"
+		"\n"
+		"dragObj.prototype.newView = function(x,y,width,height) {\n"
+		"	this.myDragger.setAttributeNS(null,\"x\"),x);\n"
+		"	this.myDragger.setAttributeNS(null,\"y\"),y);\n"
+		"	this.myDragger.setAttributeNS(null,\"width\"),width);\n"
+		"	this.myDragger.setAttributeNS(null,\"height\"),height);\n"
+		"	this.myDragSymbol.setAttributeNS(null,\"x\"),(x + width/2));\n"
+		"	this.myDragSymbol.setAttributeNS(null,\"y\"),(y + height/2));\n"
+		"	if (width < this.dragSymbThreshold) {\n"
+		"		this.myDragSymbol.setAttributeNS(null,\"visibility\"),\"visible\"));\n"
+		"	}\n"
+		"	else {\n"
+		"		this.myDragSymbol.setAttributeNS(null,\"visibility\"),\"hidden\"));	\n"
+		"	}\n"
+		"}\n"
+		"\n"
+	);
+}
+
+//---------------------------------------------------------
+const char * CSVG_Interactive_Map::_Get_Code_Navigation_2(void)
+{
+	return(
+		"//this method was previously called \"resizeDragger\" - now renamed to .getSliderVal\n"
+		"//this method receives values from the zoom slider\n"
+		"dragObj.prototype.getSliderVal = function(status,sliderGroupName,width) {\n"
+		"	var myX = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n"
+		"	var myY = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n"
+		"	var myWidth = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n"
+		"	var myHeight = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n"
+		"	var myCenterX = myX + myWidth / 2;\n"
+		"	var myCenterY = myY + myHeight / 2;\n"
+		"	var myRatio = myHeight / myWidth;\n"
+		"	var toMoveX = myCenterX - width / 2;\n"
+		"	var toMoveY = myCenterY - width * myRatio / 2;\n"
+		"	if (toMoveX < this.constrXmin) {\n"
+		"		toMoveX = this.constrXmin;\n"
+		"	}\n"
+		"	if ((toMoveX + width) > this.constrXmax) {\n"
+		"		toMoveX = this.constrXmax - width;\n"
+		"	}\n"
+		"	if (toMoveY < this.constrYmin) {\n"
+		"		toMoveY = this.constrYmin;\n"
+		"	}\n"
+		"	if ((toMoveY + width * myRatio) > this.constrYmax) {\n"
+		"		toMoveY = this.constrYmax - width * myRatio;\n"
+		"	}\n"
+		"	this.newView(toMoveX,toMoveY,width,width * myRatio);\n"
+		"	if (status == \"release\")) {\n"
+		"	           myMainMap.stopNavModes();\n"
+		"		this.mainMapObj.newViewBox(this.dragId,true);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"dragObj.prototype.drag = function(evt) {\n"
+		"	if (evt.type == \"mousedown\")) {\n"
+		"		this.myRefMap.setAttributeNS(null,\"cursor\"),\"move\"));\n"
+		"		this.status = true;\n"
+		"	}\n"
+		"	if ((evt.type == \"mousemove\" || evt.type == \"mousedown\")) && this.status == true) {\n"
+		"		var coords = this.calcCoord(evt);\n"
+		"		var newEvtX = coords.x;\n"
+		"		var newEvtY = coords.y;\n"
+		"		var myX = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n"
+		"		var myY = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n"
+		"		var myWidth = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n"
+		"		var myHeight = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n"
+		"		var toMoveX = newEvtX - myWidth / 2;\n"
+		"		var toMoveY = newEvtY - myHeight / 2;\n"
+		"		if (toMoveX < this.constrXmin) {\n"
+		"			toMoveX = this.constrXmin;\n"
+		"		}\n"
+		"		if ((toMoveX + myWidth) > this.constrXmax) {\n"
+		"			toMoveX = this.constrXmax - myWidth;\n"
+		"		}\n"
+		"		if (toMoveY < this.constrYmin) {\n"
+		"			toMoveY = this.constrYmin;\n"
+		"		}\n"
+		"		if ((toMoveY + myHeight) > this.constrYmax) {\n"
+		"			toMoveY = this.constrYmax - myHeight;\n"
+		"		}\n"
+		"		this.newView(toMoveX,toMoveY,myWidth,myHeight);\n"
+		"	}\n"
+		"	if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.status == true) {\n"
+		"		this.status = false;\n"
+		"		if (evt.detail == 1) { //second click is ignored\n"
+		"		               this.myRefMap.setAttributeNS(null,\"cursor\"),\"crosshair\"));\n"
+		"			this.mainMapObj.newViewBox('dragRectForRefMap',true);\n"
+		"		}\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"dragObj.prototype.zoom = function(inOrOut) {\n"
+		"	var myOldX = this.myDragger.getAttributeNS(null,\"x\"));\n"
+		"	var myOldY = this.myDragger.getAttributeNS(null,\"y\"));\n"
+		"	var myOldWidth = this.myDragger.getAttributeNS(null,\"width\"));\n"
+		"	var myOldHeight = this.myDragger.getAttributeNS(null,\"height\"));\n"
+		"	switch (inOrOut) {\n"
+		"		case \"in\":\n"
+		"			var myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myOldWidth * this.mainMapObj.zoomFact * 0.5);\n"
+		"			var myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myOldHeight * this.mainMapObj.zoomFact * 0.5);\n"
+		"			var myNewWidth = myOldWidth * this.mainMapObj.zoomFact;\n"
+		"			var myNewHeight = myOldHeight * this.mainMapObj.zoomFact;\n"
+		"			if (myNewWidth < this.mainMapObj.minWidth) {\n"
+		"				var myYXFact = this.mainMapObj.curHeight / this.mainMapObj.curWidth;\n"
+		"				myNewWidth = this.mainMapObj.minWidth;\n"
+		"				myNewHeight = myNewWidth * myYXFact;\n"
+		"				myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myNewWidth * 0.5);\n"
+		"				myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myNewHeight * 0.5);\n"
+		"			}\n"
+		"			break;\n"
+		"		case \"out\":\n"
+		"			var myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myOldWidth * (1 + this.mainMapObj.zoomFact) * 0.5);\n"
+		"			var myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myOldHeight * (1 + this.mainMapObj.zoomFact) * 0.5);\n"
+		"			var myNewWidth = myOldWidth * (1 + this.mainMapObj.zoomFact);\n"
+		"			var myNewHeight = myOldHeight * (1 + this.mainMapObj.zoomFact);\n"
+		"			break;\n"
+		"		default:\n"
+		"			var myNewX = this.constrXmin;\n"
+		"			var myNewY = this.constrYmin;\n"
+		"			var myNewWidth = this.constrXmax - this.constrXmin;\n"
+		"			var myNewHeight = this.constrYmax - this.constrYmin;\n"
+		"			break;\n"
+		"	}	\n"
+		"	//check if within constraints\n"
+		"	if (myNewWidth > (this.constrXmax - this.constrXmin)) {\n"
+		"		myNewWidth = this.constrXmax - this.constrXmin;\n"
+		"	}\n"
+		"	if (myNewHeight > (this.constrYmax - this.constrYmin)) {\n"
+		"		myNewHeight = this.constrYmax - this.constrYmin;\n"
+		"	}\n"
+		"	if (myNewX < this.constrXmin) {\n"
+		"		myNewX = this.constrXmin;\n"
+		"	}\n"
+		"	if (myNewY < this.constrYmin) {\n"
+		"		myNewY = this.constrYmin;\n"
+		"	}\n"
+		"	if ((myNewX + myNewWidth) > this.constrXmax) {\n"
+		"		myNewX = this.constrXmax - myNewWidth;\n"
+		"	}\n"
+		"	if ((myNewY + myNewHeight) > this.constrYmax) {\n"
+		"		myNewY = this.constrYmax - myNewHeight;\n"
+		"	}\n"
+		"	this.newView(myNewX,myNewY,myNewWidth,myNewHeight);\n"
+		"	this.mainMapObj.newViewBox(this.dragId,true);\n"
+		"}\n"
+		"\n"
+		"dragObj.prototype.pan = function (myX,myY,howmuch) {\n"
+		"	//get values from draggable rectangle\n"
+		"	var xulcorner = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n"
+		"	var yulcorner = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n"
+		"	var width = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n"
+		"	var height = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n"
+		"\n"
+		"	//set values of draggable rectangle\n"
+		"	var rectXulcorner = xulcorner + howmuch * width * myX;\n"
+		"	var rectYulcorner = yulcorner + howmuch * height * myY;\n"
+		"	//check if within constraints\n"
+		"	if (rectXulcorner < this.constrXmin) {\n"
+		"		rectXulcorner = this.constrXmin;\n"
+		"	}\n"
+		"	if (rectYulcorner < this.constrYmin) {\n"
+		"		rectYulcorner = this.constrYmin;\n"
+		"	}\n"
+		"	if ((rectXulcorner + width) > this.constrXmax) {\n"
+		"		rectXulcorner = this.constrXmax - width;\n"
+		"	}\n"
+		"	if ((rectYulcorner + height) > this.constrYmax) {\n"
+		"		rectYulcorner = this.constrYmax - height;\n"
+		"	}\n"
+		"	this.newView(rectXulcorner,rectYulcorner,width,height);\n"
+		"\n"
+		"	//set viewport of main map\n"
+		"	if ((xulcorner != rectXulcorner) || (yulcorner != rectYulcorner)) {\n"
+		"		this.mainMapObj.newViewBox(this.dragId,true);\n"
+		"	}\n"
+		"\n"
+		"	statusChange(\"map ready ...\"));\n"
+		"}\n"
+		"\n"
+		"//remove all temporarily used elements and event listeners\n"
+		"dragObj.prototype.cleanUp = function() {\n"
+		"	//remove eventlisteners\n"
+		"	if (this.showCoords == true) {\n"
+		"		//add event listener for coordinate display\n"
+		"		this.myRefMap.removeEventListener(\"mousemove\"),this,false);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"function zoomIt(evt,inOrOut) {\n"
+		"	if (evt.detail == 1) { //only react on first click, double click: second click is ignored\n"
+		"		if (inOrOut == \"in\")) {\n"
+		"			if (Math.round(myMainMap.curWidth) > myMainMap.minWidth) {\n"
+		"				myMapApp.refMapDragger.zoom(\"in\"));\n"
+		"			}\n"
+		"			else {\n"
+		"				statusChange(\"Maximum zoom factor reached. Cannot zoom in any more.\"));\n"
+		"			}\n"
+		"		}\n"
+		"		if (inOrOut == \"out\")) {\n"
+		"			if (Math.round(myMainMap.curWidth) < myMainMap.maxWidth) {\n"
+		"				myMapApp.refMapDragger.zoom(\"out\"));\n"
+		"			}\n"
+		"			else {\n"
+		"				statusChange(\"Minimum zoom factor reached. Cannot zoom out any more.\"));\n"
+		"			}\n"
+		"		}\n"
+		"		if (inOrOut == \"full\")) {\n"
+		"			if (Math.round(myMainMap.curWidth) < myMainMap.maxWidth) {\n"
+		"				myMapApp.refMapDragger.zoom(\"full\"));\n"
+		"			}\n"
+		"			else {\n"
+		"				statusChange(\"Full view already reached.\"));\n"
+		"			}\n"
+		"		}\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//this function starts various zoom actions or map extent history functions\n"
+		"function zoomImageButtons(id,evt) {\n"
+		"	myMainMap.stopNavModes();\n"
+		"	if (id == \"zoomIn\")) {\n"
+		"		zoomIt(evt,'in');\n"
+		"	}\n"
+		"	if (id == \"zoomOut\")) {\n"
+		"		zoomIt(evt,'out');\n"
+		"	}\n"
+		"	if (id == \"zoomFull\")) {\n"
+		"		zoomIt(evt,'full');\n"
+		"	}\n"
+		"	if (id == \"backwardExtent\")) {\n"
+		"		myMainMap.backwardExtent();\n"
+		"	}\n"
+		"	if (id == \"forwardExtent\")) {\n"
+		"		myMainMap.forwardExtent();\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//this function starts various interactive zoom or pan modes\n"
+		"function zoomImageSwitchButtons(id,evt,onOrOff) {\n"
+		"	myMainMap.stopNavModes();\n"
+		"	if (onOrOff) {\n"
+		"                      if (id == \"infoButton\")) {\n"
+		"                      \n"
+		"                      }\n"
+		"                      else {\n"
+		"		    if (id == \"zoomManual\")) {\n"
+		"			    myMainMap.zoomManual(evt);\n"
+		"		    }\n"
+		"		    if (id == \"panManual\")) {\n"
+		"			    myMainMap.panManual(evt);\n"
+		"		    }\n"
+		"		    if (id == \"recenterMap\")) {\n"
+		"			    myMainMap.recenter(evt);\n"
+		"		    }\n"
+		"		    if (myMapApp.buttons[\"infoButton\"].getSwitchValue()) {\n"
+		"		        myMapApp.buttons[\"infoButton\"].setSwitchValue(false,false);\n"
+		"		    }\n"
+		"		}\n"
+		"	}\n"
+		"	else {\n"
+		"	    if (id == \"infoButton\")) {\n"
+		"	        myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n"
+		"	    }\n"
+		"	}\n"
+		"}\n"
+		"\n"
+		"//alert map extent\n"
+		"function showExtent() {\n"
+		"	with(myMainMap) {\n"
+		"		alert(\n"
+		"         \"Xmin=\"+curxOrig.toFixed(nrDecimals)+units+\n"
+		"         \"); Xmax=\"+(curxOrig + curWidth).toFixed(nrDecimals)+units+\n"
+		"         \"\\nYmin=\"+((curyOrig + curHeight) * -1).toFixed(nrDecimals) +units+\n"
+		"         \"); Ymax=\"+(curyOrig*-1).toFixed(nrDecimals)+units+\n"
+		"         \"\\nWidth=\"+curWidth.toFixed(nrDecimals)+units+\n"
+		"         \"); Height=\"+curHeight.toFixed(nrDecimals)+units);\n"
+		"	}\n"
+		"}\n"
+		"\n"
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_html/svg_interactive_map.h b/src/modules/docs/docs_html/svg_interactive_map.h
similarity index 100%
rename from src/modules_io/docs/docs_html/svg_interactive_map.h
rename to src/modules/docs/docs_html/svg_interactive_map.h
diff --git a/src/modules_io/docs/docs_pdf/MLB_Interface.cpp b/src/modules/docs/docs_pdf/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/docs/docs_pdf/MLB_Interface.cpp
rename to src/modules/docs/docs_pdf/MLB_Interface.cpp
diff --git a/src/modules_io/docs/docs_pdf/MLB_Interface.h b/src/modules/docs/docs_pdf/MLB_Interface.h
similarity index 100%
rename from src/modules_io/docs/docs_pdf/MLB_Interface.h
rename to src/modules/docs/docs_pdf/MLB_Interface.h
diff --git a/src/modules_io/docs/docs_pdf/Makefile.am b/src/modules/docs/docs_pdf/Makefile.am
similarity index 100%
rename from src/modules_io/docs/docs_pdf/Makefile.am
rename to src/modules/docs/docs_pdf/Makefile.am
diff --git a/src/modules/docs/docs_pdf/Makefile.in b/src/modules/docs/docs_pdf/Makefile.in
new file mode 100644
index 0000000..3108022
--- /dev/null
+++ b/src/modules/docs/docs_pdf/Makefile.in
@@ -0,0 +1,646 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/docs/docs_pdf
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+ at HAVE_HARU_TRUE@libdocs_pdf_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am__libdocs_pdf_la_SOURCES_DIST = doc_pdf.cpp MLB_Interface.cpp \
+	Profile_Cross_Sections.cpp Shapes_Report.cpp \
+	Shapes_Summary.cpp doc_pdf.h MLB_Interface.h \
+	Profile_Cross_Sections.h Shapes_Report.h Shapes_Summary.h
+ at HAVE_HARU_TRUE@am_libdocs_pdf_la_OBJECTS = doc_pdf.lo \
+ at HAVE_HARU_TRUE@	MLB_Interface.lo Profile_Cross_Sections.lo \
+ at HAVE_HARU_TRUE@	Shapes_Report.lo Shapes_Summary.lo
+libdocs_pdf_la_OBJECTS = $(am_libdocs_pdf_la_OBJECTS)
+ at HAVE_HARU_TRUE@am_libdocs_pdf_la_rpath = -rpath $(pkglibdir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libdocs_pdf_la_SOURCES)
+DIST_SOURCES = $(am__libdocs_pdf_la_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
+ at HAVE_HARU_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+ at HAVE_HARU_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core
+ at HAVE_HARU_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(DISABLELIBHARU) $(GOMPFLAGS)
+ at HAVE_HARU_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version $(HARU_LIB)
+ at HAVE_HARU_TRUE@pkglib_LTLIBRARIES = libdocs_pdf.la
+ at HAVE_HARU_TRUE@libdocs_pdf_la_SOURCES = \
+ at HAVE_HARU_TRUE@doc_pdf.cpp\
+ at HAVE_HARU_TRUE@MLB_Interface.cpp\
+ at HAVE_HARU_TRUE@Profile_Cross_Sections.cpp\
+ at HAVE_HARU_TRUE@Shapes_Report.cpp\
+ at HAVE_HARU_TRUE@Shapes_Summary.cpp\
+ at HAVE_HARU_TRUE@doc_pdf.h\
+ at HAVE_HARU_TRUE@MLB_Interface.h\
+ at HAVE_HARU_TRUE@Profile_Cross_Sections.h\
+ at HAVE_HARU_TRUE@Shapes_Report.h\
+ at HAVE_HARU_TRUE@Shapes_Summary.h
+
+ at HAVE_HARU_TRUE@libdocs_pdf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/docs/docs_pdf/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/docs/docs_pdf/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libdocs_pdf.la: $(libdocs_pdf_la_OBJECTS) $(libdocs_pdf_la_DEPENDENCIES) $(EXTRA_libdocs_pdf_la_DEPENDENCIES) 
+	$(CXXLINK) $(am_libdocs_pdf_la_rpath) $(libdocs_pdf_la_OBJECTS) $(libdocs_pdf_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Profile_Cross_Sections.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Shapes_Report.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Shapes_Summary.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/doc_pdf.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/docs/docs_pdf/Profile_Cross_Sections.cpp b/src/modules/docs/docs_pdf/Profile_Cross_Sections.cpp
new file mode 100644
index 0000000..28c7275
--- /dev/null
+++ b/src/modules/docs/docs_pdf/Profile_Cross_Sections.cpp
@@ -0,0 +1,1459 @@
+/**********************************************************
+ * Version $Id: Profile_Cross_Sections.cpp 1230 2011-11-22 11:12:10Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    CrossSections.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Profile_Cross_Sections.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define OFFSET_X 100
+#define OFFSET_Y 50
+#define TABLE_WIDTH 450
+#define TABLE_LANDSCAPE_WIDTH 680
+#define TABLE_OFFSET_X 70
+#define TABLE_CELLPAD 10
+#define SECTIONS_PER_PAGE 3
+#define CROSS_SECTION_HEIGHT 200
+#define CROSS_SECTION_WIDTH 400
+#define PROFILE_HEIGHT 320
+#define PROFILE_WIDTH 1000
+#define GUITAR_LEYEND_WIDTH 50
+#define GUITAR_LEYEND_HEIGHT 230
+#define GUITAR_WIDTH PROFILE_WIDTH
+#define GUITAR_HEIGHT GUITAR_LEYEND_HEIGHT
+#define SEPARATION 35
+#define VOLUMES_TABLE_COLUMNS 7
+#define VOLUMES_TABLE_COLUMN_WIDTH ((596 - 2 * OFFSET_X) / VOLUMES_TABLE_COLUMNS)
+#define VOLUMES_TABLE_ROW_HEIGHT 20
+#define VOLUMES_TABLE_HEADER_SEPARATION 35
+#define VOLUMES_TABLE_MAX_ROWS 30
+#define SLOPE_RATIO (1. / 3.)
+#define LONG_SEGMENT 5000.
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//Compute the dot product AB ? BC
+double dot(double *A, double *B, double *C){
+    
+    double AB[2],BC[2];
+    AB[0] = B[0]-A[0];
+    AB[1] = B[1]-A[1];
+    BC[0] = C[0]-B[0];
+    BC[1] = C[1]-B[1];
+    double dot = AB[0] * BC[0] + AB[1] * BC[1];
+    
+	return dot;
+}
+
+//---------------------------------------------------------
+//Compute the cross product AB x AC
+double cross(double *A, double *B, double *C){
+    
+    double AB[2],AC[2];
+    AB[0] = B[0]-A[0];
+    AB[1] = B[1]-A[1];
+    AC[0] = C[0]-A[0];
+    AC[1] = C[1]-A[1];
+    double cross = AB[0] * AC[1] - AB[1] * AC[0];
+    
+	return cross;
+}
+
+//---------------------------------------------------------
+//Compute the distance from A to B
+double distance(double *A, double *B){
+    double d1 = A[0] - B[0];
+    double d2 = A[1] - B[1];
+    return sqrt(d1*d1+d2*d2);
+}
+
+//---------------------------------------------------------
+//Compute the distance from AB to C
+double linePointDist(double *A, double *B, double *C){
+    double dist = cross(A,B,C) / distance(A,B);
+
+    return fabs(dist);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SLOPE_TRANSITION 1
+#define DITCH_WIDTH 1
+
+CProfile_Cross_Sections_PDF::CProfile_Cross_Sections_PDF(){}
+
+CProfile_Cross_Sections_PDF::~CProfile_Cross_Sections_PDF(){}
+
+void CProfile_Cross_Sections_PDF::AddCrossSections(TSG_Point ** pCrossSections, 
+									 double *pHeight,
+									 TSG_Point * pRoadSection,
+									 int iSections,
+									 int iCrossSectionPoints,
+									 int iRoadPoints){
+	
+	int i,j;
+	std::vector<TSG_Point> ModifiedRoadSection;
+	std::vector<TSG_Point> ModifiedCrossSection;
+	TSG_Point  *pModifiedRoadSection;
+	TSG_Point  *pModifiedCrossSection;
+	int iCrossSectionPointsB;
+	int iRoadPointsB;
+	
+	Add_Page_Title (_TL("Cross Sections"), PDF_TITLE_01, PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT);
+
+	for (i = 0; i < iSections; i++){
+		m_iOffsetY = OFFSET_Y + (int)(CROSS_SECTION_HEIGHT * 1.1 * (i % SECTIONS_PER_PAGE));
+		if (m_iOffsetY == OFFSET_Y){
+			Add_Page();
+		}//if
+		
+		iCrossSectionPointsB = iCrossSectionPoints;
+		iRoadPointsB = iRoadPoints;
+		AdjustSections(pCrossSections[i], pRoadSection, ModifiedCrossSection, ModifiedRoadSection,
+						pHeight[i], iCrossSectionPointsB, iRoadPointsB);
+
+		pModifiedCrossSection = new TSG_Point [iCrossSectionPointsB];
+		pModifiedRoadSection = new TSG_Point [iRoadPointsB];
+		for (j = 0; j < iCrossSectionPointsB; j++){
+			pModifiedCrossSection[j] = ModifiedCrossSection[j];
+		}//for
+		for (j = 0; j < iRoadPointsB; j++){
+			pModifiedRoadSection[j] = ModifiedRoadSection[j];
+		}//for
+		
+		AddCrossSection(pModifiedCrossSection, pModifiedRoadSection,
+						 iCrossSectionPointsB, iRoadPointsB);
+
+		delete [] pModifiedRoadSection;
+		delete [] pModifiedCrossSection;
+	}//for
+	
+}//method
+
+void CProfile_Cross_Sections_PDF::AddCrossSection(TSG_Point * pCrossSection,
+									 TSG_Point * pRoadSection,
+									 int iCrossSectionPoints,
+									 int iRoadPoints){
+
+	int i;	
+    int iMag;
+	int iNumLines;
+	int iFirstPoint, iLastPoint;
+    double fMinLine = 0;
+	double fMaxY, fMinY;
+	double fMaxX, fMinX;
+	double fStep;
+    double fX, fY;
+	double fOffsetX;
+	double fDifX, fDifY;
+	double fRatio;
+	double fHeight;
+	CSG_String sValue;
+	CSG_Points Points;
+
+	iFirstPoint = 0;
+	iLastPoint = iCrossSectionPoints - 1;
+
+	for (i = 1; i < iCrossSectionPoints; i++) {
+		if (pCrossSection[i].x > pRoadSection[0].x){
+			iFirstPoint = i - 1;
+			break;
+		}//if
+	}//for
+	for (i = 1; i < iCrossSectionPoints; i++) {
+		if (pCrossSection[i].x > pRoadSection[iRoadPoints - 1].x){
+			iLastPoint = i;
+			break;
+		}//if
+	}//for
+    
+	fMinX = pCrossSection[iFirstPoint].x;
+	fMaxX = pCrossSection[iLastPoint].x;
+
+	fDifX = fMaxX - fMinX;
+
+	fMaxY  = pCrossSection[0].y;
+	fMinY  = pCrossSection[0].y;
+		    		    
+	for (i = iFirstPoint ; i < iLastPoint + 1; i++) {
+	    if (pCrossSection[i].y > fMaxY) {
+	        fMaxY = pCrossSection[i].y;
+	    }// if
+	    if (pCrossSection[i].y < fMinY) {
+	        fMinY = pCrossSection[i].y;
+	    }// if
+    }//for    
+	
+	for (i = 0; i < iRoadPoints; i++) {
+	    if (pRoadSection[i].y > fMaxY) {
+	        fMaxY = pRoadSection[i].y;
+	    }// if
+	    if (pRoadSection[i].y < fMinY) {
+	        fMinY = pRoadSection[i].y;
+	    }// if
+    }//for 
+
+	fDifY = fMaxY - fMinY;
+
+	fRatio = (fDifX / fDifY) / (CROSS_SECTION_WIDTH / CROSS_SECTION_HEIGHT);
+	if (fRatio > 1){
+		fMaxY = fMaxY + fDifY / 2. * (fRatio - 1.);
+		fMinY = fMinY - fDifY / 2. * (fRatio - 1.);
+
+	}//if
+	else{
+		fMaxX = fMaxX + fDifX / 2. * (1. / fRatio - 1.);
+		fMinX = fMinX - fDifX / 2. * (1. / fRatio - 1.);
+	}//else
+
+	fMaxX = fMaxX + fDifX * .05;
+	fMinX = fMinX - fDifX * .05;
+	fMaxY = fMaxY + fDifY * .05;
+	fMinY = fMinY - fDifY * .05;
+
+	iMag = (int) (log(fMaxY - fMinY) / log(10.0));
+	fStep = (double) ((int) pow(10.0, (double) iMag));                
+	if (fStep == 0){
+		fStep = 1.;
+	}//if
+	if (fMinY < 0) {        	
+		iMag = (int) (log(fabs(fMinY)) / log(10.0));
+		fMinLine = -(int) pow(10.0, (double) iMag);
+	}// if
+	else {
+		fMinLine=(int)(((int)(fMinY/fStep)) *fStep);
+	}//else
+
+	iNumLines = (int) ((fMaxY - fMinY) / fStep);
+
+	while (iNumLines < 8) {
+		fStep = fStep / 2.0;
+		iNumLines = (int) ((fMaxY - fMinY) / fStep);
+	}// while
+	iNumLines = (int) ((fMaxY - fMinLine) / fStep);
+
+	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
+
+	//horizontal lines
+
+	for (i = 0; i < iNumLines; i++) {
+        fY = m_iOffsetY + CROSS_SECTION_HEIGHT
+                - ((fMinLine + fStep * i - fMinY) / (fMaxY - fMinY)) * CROSS_SECTION_HEIGHT;		
+        if (fY <= m_iOffsetY + CROSS_SECTION_HEIGHT && fY >= m_iOffsetY) {
+			fY = fHeight - fY;
+			sValue = SG_Get_String(fMinLine + fStep * (double) i);			
+			Draw_Text(OFFSET_X - 10, fY, SG_Get_String(fMinLine + fStep * (double) i).c_str(),
+					9, PDF_STYLE_TEXT_ALIGN_H_RIGHT);
+			Draw_Line(OFFSET_X, fY, OFFSET_X - 5, fY, 0);
+        }// if
+    }// for	
+
+	iMag = (int) (log(fMaxX - fMinX) / log(10.0));
+	fStep = (double) pow(10.0, (double) iMag);                
+
+	iNumLines = (int) ((fMaxX-fMinX) / fStep);
+	
+	while (iNumLines < 3) {
+		fStep = fStep / 2.0;
+		iNumLines = (int) ((fMaxX-fMinX) / fStep);
+	}// while    
+	fMinLine = (int)(((int)(fMinX/fStep)) * fStep);          
+	while (fMinLine<fMinX){
+		fMinLine+=fStep;
+	}//while
+	fOffsetX = fMinX-fMinLine;
+
+	//vertical lines
+
+	for (i = 0; i < iNumLines; i++) {
+		fX = OFFSET_X + ((fStep * (double) i-fOffsetX) / (fMaxX-fMinX)) * CROSS_SECTION_WIDTH;
+		if (fX >= OFFSET_X && fX < OFFSET_X + CROSS_SECTION_WIDTH){
+			if (fabs(fStep * (double)i+fMinLine) > 100000) {
+				sValue = SG_Get_String(fStep * (double)i+fMinLine);
+			}// if 
+			else {
+				sValue = SG_Get_String(fStep * (double)i+fMinLine, 2, true);
+			}// else
+			Draw_Line (fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT,
+						fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT - 10);
+			Draw_Text(fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT - 15, 
+					SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9, 
+					PDF_STYLE_TEXT_ALIGN_H_CENTER | PDF_STYLE_TEXT_ALIGN_V_TOP );
+		}//if
+	}// for
+	
+	//axis
+	
+	Draw_Line (OFFSET_X, fHeight - m_iOffsetY, 
+				OFFSET_X, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 2);
+	Draw_Line (OFFSET_X, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 
+				OFFSET_X + CROSS_SECTION_WIDTH, 
+				fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 2);
+
+	//cross sections
+	
+	fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
+			- CROSS_SECTION_HEIGHT * ((pCrossSection[iFirstPoint].y - fMinY) / (fMaxY - fMinY));
+	fY = fHeight - fY;
+	fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pCrossSection[iFirstPoint].x - fMinX) / (fMaxX - fMinX));
+
+	Points.Add(fX,fY);
+	
+	for (i = iFirstPoint + 1; i < iLastPoint + 1; i++) {
+		fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
+			- CROSS_SECTION_HEIGHT * ((pCrossSection[i].y - fMinY) / (fMaxY - fMinY));
+		fY = fHeight - fY;
+		fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pCrossSection[i].x - fMinX) / (fMaxX - fMinX));
+		Points.Add(fX,fY);
+		if (pCrossSection[i].x > fMaxX){
+			break;
+		}//if
+	}// for
+	Draw_Line(Points, 2, 0x00bb00);
+
+	fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
+			- CROSS_SECTION_HEIGHT * ((pRoadSection[0].y - fMinY) / (fMaxY - fMinY));
+	fY = fHeight - fY;
+	fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pRoadSection[0].x - fMinX) / (fMaxX - fMinX));
+
+	Points.Clear();
+	Points.Add(fX,fY);	        
+	
+	for (i = 1; i < iRoadPoints; i++) {
+		fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
+			- CROSS_SECTION_HEIGHT * ((pRoadSection[i].y - fMinY) / (fMaxY - fMinY));
+		fY = fHeight - fY;
+		fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pRoadSection[i].x - fMinX) / (fMaxX - fMinX));
+		Points.Add(fX,fY);	
+	}// for
+	Draw_Line(Points, 0, 0x0000bb);
+
+
+}//method
+
+void CProfile_Cross_Sections_PDF::AddVolumesTable(TSG_Point * pProfile,
+									TSG_Point ** pCrossSections, 
+									 double *pHeight,
+									 TSG_Point * pRoadSection,
+									 int iSections,
+									 int iCrossSectionPoints,
+									 int iRoadPoints){
+
+
+	int i,j;
+	int iRow;
+	int iRowsWritten = 0;
+	double fDist;
+	double fX,fY;
+	double fXBox, fYBox;
+	double fIn, fOut;
+	double fInPrev, fOutPrev;
+	double fVolume;
+	double fHeight;
+	CSG_String sHeader[] = {_TL("Section"),_TL("Dist."),_TL("Area +"),_TL("Area -"),_TL("Partial D."),_TL("Vol. +"), _TL("Vol. -")};
+			
+	Add_Page_Title(_TL("Volumes"), PDF_TITLE_01);
+
+	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
+	
+	for (i = 0; i < iSections; i++){
+		iRow = iRowsWritten % VOLUMES_TABLE_MAX_ROWS;
+		if (iRow == 0){
+			Add_Page();
+			Draw_Rectangle(OFFSET_X, fHeight - OFFSET_Y,
+							OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * VOLUMES_TABLE_COLUMNS,
+							fHeight - OFFSET_Y - VOLUMES_TABLE_ROW_HEIGHT);			
+			fY = OFFSET_Y + VOLUMES_TABLE_ROW_HEIGHT * .6;
+			fY = fHeight - fY;
+			for (j = 0; j < VOLUMES_TABLE_COLUMNS; j++){
+				fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j + VOLUMES_TABLE_COLUMN_WIDTH / 2.;				
+				Draw_Text(fX, fY, sHeader[j].c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+
+				fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * (j + 1);
+				Draw_Line(fX, fHeight - OFFSET_Y, 
+							fX, fHeight - (OFFSET_Y + VOLUMES_TABLE_ROW_HEIGHT),
+							0);
+			}//for
+			if (i){
+				i--;
+			}//if
+		}//if
+		for (j = 0; j < 4; j++){
+			fYBox = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * iRow;
+			fYBox = fHeight - fYBox;
+			fXBox = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j;			
+			Draw_Rectangle(fXBox, fYBox, fXBox + VOLUMES_TABLE_COLUMN_WIDTH, 
+							fYBox - VOLUMES_TABLE_ROW_HEIGHT);			
+		}//for
+		fDist = pProfile[i].x;		
+		fY = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow + .6);
+		fY = fHeight - fY;
+		fX = OFFSET_X + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+		Draw_Text(fX, fY, SG_Get_String(i,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+
+		fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+		Draw_Text(fX, fY, SG_Get_String(fDist,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+
+		CalculateAreas(pCrossSections[i], pRoadSection, pHeight[i], iCrossSectionPoints, 
+						iRoadPoints,fIn, fOut);
+
+		fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 2 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+		Draw_Text(fX, fY, SG_Get_String(fIn,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+
+		fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 3 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+		Draw_Text(fX, fY, SG_Get_String(fOut,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+
+		if (iRow > 0){
+			for (j = 4; j < 7; j++){
+				fYBox = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow - .5);
+				fYBox = fHeight - fYBox;
+				fXBox = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j;			
+				Draw_Rectangle(fXBox, fYBox, fXBox + VOLUMES_TABLE_COLUMN_WIDTH, 
+								fYBox - VOLUMES_TABLE_ROW_HEIGHT);				
+			}//for
+			fY = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow + .1) ;
+			fY = fHeight - fY;
+
+			fDist = (pProfile[i].x - pProfile[i-1].x);
+			fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 4 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+			Draw_Text(fX, fY, SG_Get_String(fDist,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+
+			fVolume = (pProfile[i].x - pProfile[i-1].x) * (fIn + fInPrev) / 2.;
+			fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 5 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+			Draw_Text(fX, fY, SG_Get_String(fVolume,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+			
+			fVolume = (pProfile[i].x - pProfile[i-1].x) * (fOut + fOutPrev) / 2.;
+			fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 6 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
+			Draw_Text(fX, fY, SG_Get_String(fVolume,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
+		}//if
+
+		fInPrev = fIn;
+		fOutPrev = fOut;
+		iRowsWritten++;
+
+	}//for
+
+}//Method
+
+void CProfile_Cross_Sections_PDF::AdjustSections(TSG_Point * pCrossSection,
+									TSG_Point * pRoadSection,
+									std::vector<TSG_Point > &ModifiedCrossSection,
+									std::vector<TSG_Point > &ModifiedRoadSection,
+									double fHeight,
+									int &iCrossSectionPoints, 
+									int &iRoadPoints){
+
+	bool bDitchAdded;
+	int i,j;
+	int iSgn;
+	int iRoadPointsToAdd = 0;
+	int iCrossSectionPointsToAdd = 0;
+	double fX, fY;
+	TSG_Point  P;
+
+	ModifiedCrossSection.clear();
+	ModifiedRoadSection.clear();
+
+	//left half
+
+	for (i = 0 ; i < iCrossSectionPoints - 1; i++){
+		if (pCrossSection[i].x < pRoadSection[0].x && 
+				pCrossSection[i+1].x >= pRoadSection[0].x){
+			break;
+		}//if
+	}//for
+
+	if (i == iCrossSectionPoints - 1){
+		if (pRoadSection[0].y  + fHeight < pCrossSection[0].y){
+			P.x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH 
+				- fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO;
+			P.y = pCrossSection[0].y - fHeight;
+			ModifiedRoadSection.push_back(P);
+			P.y = pCrossSection[0].y;
+			ModifiedCrossSection.push_back(P);
+			iCrossSectionPointsToAdd++;
+			iRoadPointsToAdd++;			
+			
+			P.x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;
+			P.y = pRoadSection[0].y;
+			ModifiedRoadSection.push_back(P);
+			iRoadPointsToAdd++;
+
+			P.x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;	
+			P.y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION;
+			ModifiedRoadSection.push_back(P);
+			iRoadPointsToAdd++;
+
+			P.x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION;
+			ModifiedRoadSection.push_back(P);
+			iRoadPointsToAdd++;
+		}//if		
+		P.x = pRoadSection[0].x - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO;
+		P.y = pCrossSection[0].y - fHeight;
+		ModifiedRoadSection.push_back(P);
+		P.y = pCrossSection[0].y;
+		ModifiedCrossSection.push_back(P);
+		iCrossSectionPointsToAdd++;
+		iRoadPointsToAdd++;
+	}//if
+	else{
+		bDitchAdded = false;
+		for (j = 0; j < 4; j++){ //4 dummy points
+			ModifiedRoadSection.push_back(pRoadSection[0]);
+		}//for	
+		for (j = i ; j >= 0; j--){
+			if (ModifiedRoadSection[1].y  + fHeight > pCrossSection[j+1].y){
+				iSgn = -1;
+			}//if
+			else{
+				iSgn = 1;
+			}//else
+			Intersect_Lines(ModifiedRoadSection[1].x, ModifiedRoadSection[1].y + fHeight, 
+							ModifiedRoadSection[1].x - LONG_SEGMENT / SLOPE_RATIO,
+							ModifiedRoadSection[1].y + LONG_SEGMENT * iSgn + fHeight,
+							pCrossSection[j].x, pCrossSection[j].y,
+							pCrossSection[j+1].x, pCrossSection[j+1].y,
+							fX,fY);
+			if (pCrossSection[j].x < fX && pCrossSection[j+1].x >= fX){
+				if (iSgn == 1){
+					if(!bDitchAdded){
+						ModifiedRoadSection[1].x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;
+						ModifiedRoadSection[1].y = pRoadSection[0].y;						
+						iRoadPointsToAdd++;
+
+						ModifiedRoadSection[2].x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;	
+						ModifiedRoadSection[2].y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION;						
+						iRoadPointsToAdd++;
+
+						ModifiedRoadSection[3].x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION;
+						ModifiedRoadSection[3].y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION;						
+						iRoadPointsToAdd++;
+						
+						j = i + 1;
+						bDitchAdded = true;
+					}//if
+					else{
+						ModifiedRoadSection[0].x = fX;
+						ModifiedRoadSection[0].y = fY - fHeight;
+						iRoadPointsToAdd++;
+						break;
+					}//else
+				}//if
+				else{
+					ModifiedRoadSection[0].x = fX;
+					ModifiedRoadSection[0].y = fY - fHeight;
+					iRoadPointsToAdd++;
+					break;
+				}//else
+			}//if
+		}//for
+		if (j < 0){
+			ModifiedRoadSection[0].x = pRoadSection[0].x - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO;
+			ModifiedRoadSection[0].y = pCrossSection[0].y - fHeight;
+			P.x = ModifiedRoadSection[0].x;
+			P.y = pCrossSection[0].y;
+			ModifiedCrossSection.push_back(P);
+			iCrossSectionPointsToAdd++;
+			iRoadPointsToAdd++;
+		}//if*/
+	}//else
+
+	//add the central points
+
+	for (i = 0; i < iCrossSectionPoints; i++){
+		ModifiedCrossSection.push_back(pCrossSection[i]);
+	}//for
+	
+	ModifiedRoadSection.resize(iRoadPoints + iRoadPointsToAdd);
+	for (i = 0; i < iRoadPoints; i++){
+		ModifiedRoadSection[i + iRoadPointsToAdd].x = pRoadSection[i].x;
+		ModifiedRoadSection[i + iRoadPointsToAdd].y = pRoadSection[i].y;
+	}//for	
+	for (i = 0; i < iRoadPoints + iRoadPointsToAdd; i++){
+		ModifiedRoadSection[i].x = ModifiedRoadSection[i].x;
+		ModifiedRoadSection[i].y = ModifiedRoadSection[i].y + fHeight;
+	}//for
+
+	iRoadPoints += iRoadPointsToAdd;
+	iCrossSectionPoints += iCrossSectionPointsToAdd;
+
+	// right half
+
+	for (i = 0 ; i < iCrossSectionPoints - 1; i++){
+		if (ModifiedCrossSection[i].x < ModifiedRoadSection[iRoadPoints-1].x && 
+				ModifiedCrossSection[i+1].x >= ModifiedRoadSection[iRoadPoints-1].x){
+			break;
+		}//if
+	}//for
+	if (i == iCrossSectionPoints - 1){
+		if (ModifiedRoadSection[iRoadPoints-1].y  + fHeight < ModifiedCrossSection[iCrossSectionPoints-1].y){
+			P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION;
+			P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION;
+			ModifiedRoadSection.push_back(P);
+			iRoadPoints++;
+
+			P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;	
+			ModifiedRoadSection.push_back(P);
+			iRoadPoints++;
+
+			P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;
+			P.y = ModifiedRoadSection[iRoadPoints-3].y;
+			ModifiedRoadSection.push_back(P);
+			iRoadPoints++;
+		}//if		
+		P.x = ModifiedRoadSection[iRoadPoints-1].x 
+				+ fabs(ModifiedCrossSection[iCrossSectionPoints-1].y 
+				- ModifiedRoadSection[iRoadPoints-1].y) / SLOPE_RATIO;
+		P.y = ModifiedCrossSection[iCrossSectionPoints-1].y ;
+		ModifiedRoadSection.push_back(P);
+		ModifiedCrossSection.push_back(P);
+		iCrossSectionPoints++;
+		iRoadPoints++;
+	}//if
+	else{
+		bDitchAdded = false;
+		for (j = i ; j < iCrossSectionPoints - 1; j++){
+			if (ModifiedRoadSection[iRoadPoints-1].y > ModifiedCrossSection[j].y){
+				iSgn = -1;
+			}//if
+			else{
+				iSgn = 1;
+			}//else
+			if (iSgn == 1 && !bDitchAdded){
+				P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION;
+				P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION;
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+
+				P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;	
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+
+				P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;
+				P.y = ModifiedRoadSection[iRoadPoints-3].y;
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+				
+				if (ModifiedRoadSection[iRoadPoints-1].y > ModifiedCrossSection[j].y){
+					iSgn = -1;
+				}//if
+				else{
+					iSgn = 1;
+				}//else
+
+				bDitchAdded = true;
+
+			}//if
+
+			Intersect_Lines(ModifiedRoadSection[iRoadPoints-1].x, ModifiedRoadSection[iRoadPoints-1].y, 
+							ModifiedRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
+							ModifiedRoadSection[iRoadPoints-1].y + LONG_SEGMENT * iSgn,
+							ModifiedCrossSection[j].x, ModifiedCrossSection[j].y,
+							ModifiedCrossSection[j+1].x, ModifiedCrossSection[j+1].y,
+							fX,fY);
+
+			if (ModifiedCrossSection[j].x < fX && ModifiedCrossSection[j+1].x >= fX){
+				P.x = fX;
+				P.y = fY;
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+				break;
+			}//if
+		}//for
+		if (j == iCrossSectionPoints - 1){
+			if (ModifiedRoadSection[iRoadPoints-1].y  + fHeight < ModifiedCrossSection[iCrossSectionPoints-1].y
+					&& !bDitchAdded){
+				
+				P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION;
+				P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION;
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+
+				P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;	
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+
+				P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;
+				P.y = ModifiedRoadSection[iRoadPoints-3].y;
+				ModifiedRoadSection.push_back(P);
+				iRoadPoints++;
+
+			}//if		
+			P.x = ModifiedRoadSection[iRoadPoints-1].x 
+					+ fabs(ModifiedCrossSection[iCrossSectionPoints-1].y 
+					- ModifiedRoadSection[iRoadPoints-1].y) / SLOPE_RATIO;
+			P.y = ModifiedCrossSection[iCrossSectionPoints-1].y ;
+			ModifiedRoadSection.push_back(P);
+			ModifiedCrossSection.push_back(P);
+			iCrossSectionPoints++;
+			iRoadPoints++;
+
+		}//if*/
+	}//else
+
+}//method
+
+void CProfile_Cross_Sections_PDF::Intersect_Lines(double x0,double y0,double x1,double y1,
+									double x2,double y2,double x3,double y3,
+									double &xi,double &yi){
+
+	double a1,b1,c1, 
+		  a2,b2,c2,
+		  det_inv,  
+		  m1,m2;    
+
+	if ((x1-x0)!=0)
+	   m1 = (y1-y0)/(x1-x0);
+	else
+	   m1 = (double)1e+10;   
+
+	if ((x3-x2)!=0)
+	   m2 = (y3-y2)/(x3-x2);
+	else
+	   m2 = (double)1e+10;   
+
+	a1 = m1;
+	a2 = m2;
+
+	b1 = -1;
+	b2 = -1;
+
+	c1 = (y0-m1*x0);
+	c2 = (y2-m2*x2);
+
+	det_inv = 1/(a1*b2 - a2*b1);
+
+	xi=((b1*c2 - b2*c1)*det_inv);
+	yi=((a2*c1 - a1*c2)*det_inv);
+
+} //method
+
+void CProfile_Cross_Sections_PDF::CalculateAreas(TSG_Point * pCrossSection,
+									TSG_Point * pRoadSection,
+									double fHeight,
+									int iCrossSectionPoints, 
+									int iRoadPoints,
+									double &fPositiveArea,
+									double &fNegativeArea){
+
+	int i;
+	CSG_Shapes *pRoadShapes, *pCrossSectionShapes, *pResultShapes;
+	CSG_Shape *pRoadShape, *pCrossSectionShape, *pResultShape;
+
+	pResultShapes = new CSG_Shapes;
+	pResultShapes->Create(SHAPE_TYPE_Polygon);
+	pResultShape = pResultShapes->Add_Shape();
+	pRoadShapes = new CSG_Shapes;
+	pRoadShapes->Create(SHAPE_TYPE_Polygon);
+	pRoadShape = pRoadShapes->Add_Shape();
+	pCrossSectionShapes = new CSG_Shapes;
+	pCrossSectionShapes->Create(SHAPE_TYPE_Polygon);
+	pCrossSectionShape = pCrossSectionShapes->Add_Shape();
+	
+	for (i = 0; i < iRoadPoints; i++){
+		pRoadShape->Add_Point(pRoadSection[i].x, pRoadSection[i].y + fHeight);
+	}//for
+	pRoadShape->Add_Point(pRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
+						pRoadSection[iRoadPoints-1].y + fHeight + LONG_SEGMENT);
+	
+	pRoadShape->Add_Point(pRoadSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
+						pRoadSection[0].y + fHeight + LONG_SEGMENT);
+						
+	for (i = 0; i < iCrossSectionPoints; i++){
+		pCrossSectionShape->Add_Point(pCrossSection[i].x, pCrossSection[i].y);
+	}//for
+	pCrossSectionShape->Add_Point(pCrossSection[iCrossSectionPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
+						pCrossSection[iCrossSectionPoints-1].y - LONG_SEGMENT);
+	
+	pCrossSectionShape->Add_Point(pCrossSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
+						pCrossSection[0].y - LONG_SEGMENT);		
+
+	if (SG_Polygon_Intersection(pCrossSectionShape, pRoadShape, pResultShape)){
+		fNegativeArea = ((CSG_Shape_Polygon*)pResultShape)->Get_Area();
+	}//if
+	else{
+		fNegativeArea = 0;
+	}//else
+
+	pCrossSectionShape->Del_Parts();
+	pRoadShape->Del_Parts();
+	pResultShape->Del_Parts();
+	
+	for (i = 0; i < iRoadPoints; i++){
+		pRoadShape->Add_Point(pRoadSection[i].x, pRoadSection[i].y + fHeight);
+	}//for
+	pRoadShape->Add_Point(pRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
+						pRoadSection[iRoadPoints-1].y + fHeight - LONG_SEGMENT);
+	
+	pRoadShape->Add_Point(pRoadSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
+						pRoadSection[0].y + fHeight - LONG_SEGMENT);
+						
+	for (i = 0; i < iCrossSectionPoints; i++){
+		pCrossSectionShape->Add_Point(pCrossSection[i].x, pCrossSection[i].y);
+	}//for
+	pCrossSectionShape->Add_Point(pCrossSection[iCrossSectionPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
+						pCrossSection[iCrossSectionPoints-1].y + LONG_SEGMENT);
+	
+	pCrossSectionShape->Add_Point(pCrossSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
+						pCrossSection[0].y + LONG_SEGMENT);		
+	
+	if (SG_Polygon_Intersection(pCrossSectionShape, pRoadShape, pResultShape)){
+		fPositiveArea = ((CSG_Shape_Polygon*)pResultShape)->Get_Area();
+	}//if
+	else{
+		fPositiveArea = 0;
+	}//else
+
+	delete pRoadShapes;
+	delete pCrossSectionShapes;
+	delete pResultShapes;
+				
+}//method
+
+void CProfile_Cross_Sections_PDF::AddLongitudinalProfile(TSG_Point * pProfile,
+											double *pHeight,
+											int iNumPoints){
+
+	int i;	
+    int iMag;
+	int iNumLines;
+    double fMinLine = 0;
+	double fMaxY, fMinY;
+	double fMaxX, fMinX;
+	double fStep;
+    double fX, fY;
+	double fOffsetX;
+	CSG_String sValue;
+	CSG_Points Points;
+	double fHeight;
+	
+	Add_Page_Title(_TL("Longitudinal Profile"), PDF_TITLE_01);
+	
+	Add_Page(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE);
+
+	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
+
+	m_iOffsetY = 50;
+
+	fMaxY  = pProfile[0].y;
+	fMinY  = pProfile[0].y;
+		    		    
+	for (i = 0; i < iNumPoints; i++) {
+	    if (pProfile[i].y > fMaxY) {
+	        fMaxY = pProfile[i].y;
+	    }// if
+	    if (pProfile[i].y < fMinY) {
+	        fMinY = pProfile[i].y;
+	    }// if
+		if (pHeight[i] > fMaxY) {
+	        fMaxY = pHeight[i];
+	    }// if
+	    if (pHeight[i] < fMinY) {
+	        fMinY = pHeight[i];
+	    }// if
+    }//for    
+	
+	iMag = (int) (log(fMaxY - fMinY) / log(10.0));
+	fStep = (double) ((int) pow(10.0, (double) iMag));                
+	if (fStep == 0){
+		fStep = 1.;
+	}//if
+	if (fMinY < 0) {        	
+		iMag = (int) (log(fabs(fMinY)) / log(10.0));
+		fMinLine = -(int) pow(10.0, (double) iMag);
+	}// if
+	else {
+		fMinLine=(int)(((int)(fMinY/fStep)) *fStep);
+	}//else
+
+	iNumLines = (int) ((fMaxY - fMinY) / fStep);
+
+	while (iNumLines < 8) {
+		fStep = fStep / 2.0;
+		iNumLines = (int) ((fMaxY - fMinY) / fStep);
+	}// while
+	iNumLines = (int) ((fMaxY - fMinLine) / fStep);
+
+	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
+
+	for (i = 0; i < iNumLines; i++) {
+        fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION;
+		fY = m_iOffsetY + PROFILE_HEIGHT
+                - ((fMinLine + fStep * i - fMinY) / (fMaxY - fMinY)) * PROFILE_HEIGHT;		
+        if (fY <= m_iOffsetY + PROFILE_HEIGHT && fY >= m_iOffsetY) {
+			fY = fHeight - fY;
+			sValue = SG_Get_String(fMinLine + fStep * (double) i);
+			Draw_Text(fX - 10, fY, SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9,
+				PDF_STYLE_TEXT_ALIGN_H_RIGHT);
+			Draw_Line(fX, fY, fX - 5, fY, 0);
+        }// if
+    }// for	
+
+	fMinX = pProfile[0].x;
+	fMaxX = pProfile[iNumPoints - 1].x;
+
+	iMag = (int) (log(fMaxX - fMinX) / log(10.0));
+	fStep = (double) pow(10.0, (double) iMag);                
+
+	iNumLines = (int) ((fMaxX-fMinX) / fStep);
+	
+	while (iNumLines < 3) {
+		fStep = fStep / 2.0;
+		iNumLines = (int) ((fMaxX-fMinX) / fStep);
+	}// while    
+	fMinLine = (int)(((int)(fMinX/fStep)) * fStep);          
+	while (fMinLine<fMinX){
+		fMinLine+=fStep;
+	}//while
+	fOffsetX = fMinX-fMinLine;
+
+	for (i = 0; i < iNumLines; i++) {
+		fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+				+ ((fStep * (double) i-fOffsetX) / (fMaxX-fMinX)) * PROFILE_WIDTH;
+		if (fX>=OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+				&& fX < OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH){
+			if (fabs(fStep * (double)i+fMinLine) > 100000) {
+				sValue = SG_Get_String(fStep * (double)i+fMinLine);
+			}// if 
+			else {
+				sValue = SG_Get_String(fStep * (double)i+fMinLine, 2, true);
+			}// else
+			Draw_Text(fX, fHeight - m_iOffsetY - PROFILE_HEIGHT - 15,
+				SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9,
+				PDF_STYLE_TEXT_ALIGN_H_CENTER | PDF_STYLE_TEXT_ALIGN_V_TOP);
+			Draw_Line(fX, fHeight - m_iOffsetY - PROFILE_HEIGHT,
+					fX, fHeight - m_iOffsetY - PROFILE_HEIGHT - 10, 0);
+		}//if
+	}// for
+	
+	Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, 	fHeight - m_iOffsetY,
+			OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, 
+			fHeight - m_iOffsetY - PROFILE_HEIGHT, 2);
+	Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, 
+				fHeight - m_iOffsetY - PROFILE_HEIGHT,
+				OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH, 
+				fHeight - m_iOffsetY - PROFILE_HEIGHT, 2);
+		
+	fY = m_iOffsetY + PROFILE_HEIGHT 
+			- PROFILE_HEIGHT * ((pProfile[0].y - fMinY) / (fMaxY - fMinY));
+	fY = fHeight - fY;
+	fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+		+ PROFILE_WIDTH * ((pProfile[0].x - fMinX) / (fMaxX - fMinX));
+	Points.Add(fX, fY);	        
+	for (i = 1; i < iNumPoints; i++) {
+		fY = m_iOffsetY + PROFILE_HEIGHT 
+			- PROFILE_HEIGHT * ((pProfile[i].y - fMinY) / (fMaxY - fMinY));
+		fY = fHeight - fY;
+		fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+			+ PROFILE_WIDTH * ((pProfile[i].x - fMinX) / (fMaxX - fMinX));
+		Points.Add(fX, fY);
+	}// for
+	Draw_Line(Points, 2, 0x00bb00);
+
+	Points.Clear();
+	
+	fY = m_iOffsetY + PROFILE_HEIGHT 
+			- PROFILE_HEIGHT * ((pHeight[0] - fMinY) / (fMaxY - fMinY));
+	fY = fHeight - fY;
+	fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+		+ PROFILE_WIDTH * ((pProfile[0].x - fMinX) / (fMaxX - fMinX));
+	Points.Add(fX,fY);
+	for (i = 1; i < iNumPoints; i++) {
+		fY = m_iOffsetY + PROFILE_HEIGHT 
+			- PROFILE_HEIGHT * ((pHeight[i] - fMinY) / (fMaxY - fMinY));
+		fY = fHeight - fY;
+		fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+			+ PROFILE_WIDTH * ((pProfile[i].x - fMinX) / (fMaxX - fMinX));
+		Points.Add(fX, fY);
+	}// for
+	Draw_Line(Points, 2, 0x0000bb);
+
+	DrawGuitar(pProfile, pHeight, iNumPoints);
+
+}//method
+
+void CProfile_Cross_Sections_PDF::DrawGuitar(TSG_Point *pProfile, 
+							   double *pHeight, 
+							   int iNumPoints){
+
+	int i;
+	double fY;
+	double fMinX, fMaxX;
+	double fDif;
+	CSG_String sValue;
+	CSG_String sField [] = {"Distancia","Dist. Parcial.", "Elevacion del terreno", "Elevaci�n de la calzada", " ", " "};
+	double fHeight;
+
+	fMinX = pProfile[0].x;
+	fMaxX = pProfile[iNumPoints - 1].x;
+
+	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
+	
+	for (i = 0; i < 7; i++){
+		fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * i;
+		fY = fHeight - fY;
+		Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, fY,
+				OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + GUITAR_WIDTH, fY, 0, 0x880000);
+		if (i){
+			Draw_Text(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION - 10, 
+						fY + GUITAR_LEYEND_HEIGHT / 13, 
+						sField[i-1].c_str(),
+						9,
+						PDF_STYLE_TEXT_ALIGN_V_CENTER | PDF_STYLE_TEXT_ALIGN_H_RIGHT);
+		
+		}//if
+	}//for
+	
+	AddGuitarValue(0, 0, fMinX, fMaxX, 1);
+	for (i = 0; i < iNumPoints; i++) {
+		AddGuitarValue(pProfile[i].x, pProfile[i].x / 1000, fMinX, fMaxX, 0);
+		if (i){
+			AddGuitarValue(pProfile[i].x, pProfile[i].x / 1000 - pProfile[i-1].x / 1000, 
+							fMinX, fMaxX, 1);
+		}//if
+		fDif = pProfile[i].y - pHeight[i];
+		AddGuitarValue(pProfile[i].x, pProfile[i].y, fMinX, fMaxX, 2);
+		AddGuitarValue(pProfile[i].x, pHeight[i], fMinX, fMaxX, 3);
+		if (fDif > 0){
+			AddGuitarValue(pProfile[i].x, fDif, fMinX, fMaxX, 4);
+		}//if
+		else{
+			AddGuitarValue(pProfile[i].x, fDif, fMinX, fMaxX, 5);
+		}//else
+
+
+	}// for
+
+}//method
+
+void CProfile_Cross_Sections_PDF::AddGuitarValue(double fXValue,
+								   double fValue,
+								   double fMinX,
+								   double fMaxX,								   
+								   int iLine){
+
+	double fX,fY;
+	double fHeight;
+	
+	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
+	
+	fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
+		+ PROFILE_WIDTH * ((fXValue - fMinX) / (fMaxX - fMinX));
+	fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * (iLine + 1);
+	fY = fHeight - fY;
+
+	Draw_Line(fX, fY, fX, fY + 3, 0, 0x880000);
+
+	fY += 3;
+	fX += 3;
+	
+	Draw_Text(fX, fY, SG_Get_String(fValue, 2).c_str(), 8, 
+			0, 
+			3.14159/2.);
+		
+	fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * iLine;
+	fY = fHeight - fY;
+	fX -= 3;
+
+	Draw_Line(fX, fY, fX, fY - 3, 0, 0x880000);
+
+}//method
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CProfile_Cross_Sections::CProfile_Cross_Sections(void){
+
+	CSG_Parameter *pNode;
+
+	Parameters.Set_Name(_TL("Terrain Path Cross Sections"));
+	Parameters.Set_Description(_TW("(c) 2004 Victor Olaya. Cross Sections"));
+
+	Parameters.Add_Grid(NULL,
+						"DEM",
+						_TL("DEM"),
+						_TL("Digital Terrain Model"),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Shapes(NULL,
+						"LINES",
+						_TL("Path"),
+						_TL(""),
+						PARAMETER_INPUT, 
+						SHAPE_TYPE_Line);
+
+	Parameters.Add_Shapes(NULL,
+						"SECTIONS",
+						_TL("Cross Sections"),
+						_TL(""),
+						PARAMETER_OUTPUT);
+
+	Parameters.Add_Value(NULL,
+						"NUMPOINTS",
+						_TL("Number of points"),
+						_TL("Number of points on each side of the section"),
+						PARAMETER_TYPE_Int,
+						10,
+						1,
+						true);
+
+	Parameters.Add_Value(NULL,
+						"INTERVAL",
+						_TL("Interval"),
+						_TL("Interval between points (in grid units)."),
+						PARAMETER_TYPE_Double,
+						10);
+
+	Parameters.Add_Value(NULL,
+						"STEP",
+						_TL("n"),
+						_TL("Draw a section each n points"),
+						PARAMETER_TYPE_Int,
+						2);
+
+	pNode = Parameters.Add_Node(NULL,
+						"PDFNODE",
+						_TL("PDF Documents"),
+						_TL(""));
+
+	Parameters.Add_Value(pNode,
+						"PDF",
+						_TL("Create PDF Documents"),
+						_TL(""),
+						PARAMETER_TYPE_Bool,
+						true);	
+
+	Parameters.Add_FilePath(pNode,
+							"OUTPUTPATH",
+							_TL("Folder for PDF Files"),
+							_TL(""),
+							_TL(""),
+							_TL(""),
+							true,
+							true);
+
+	Parameters.Add_Value(pNode,
+						"WIDTH",
+						_TL("Road Width"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						5.);
+
+	Parameters.Add_Value(pNode,
+						"SLOPE",
+						_TL("Side Slope"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						.5);
+
+	Parameters.Add_Value(pNode,
+						"THRESHOLD",
+						_TL("Height Threshold"),
+						_TL("Height threshold for optimal profile calculation"),
+						PARAMETER_TYPE_Double,
+						.5);
+}//constructor
+
+
+CProfile_Cross_Sections::~CProfile_Cross_Sections(void){}
+
+bool CProfile_Cross_Sections::On_Execute(void){
+
+	CSG_Shapes *pLines;
+	CSG_Shape *pShape, *pSection;
+	CSG_Grid *pDEM;
+	TSG_Point	Point, Point2;
+	double fInterval;
+	double fStepX, fStepY;
+	int iNumPoints;
+	int i,j,k;
+	int iPoint;
+	int iField = 0;
+	int iStep;
+	double dX, dY;
+	double dX2, dY2;
+	double dDistance;
+	double dHeight;
+	bool bCopy;
+
+	m_pSections = Parameters("SECTIONS")->asShapes();
+	pLines = Parameters("LINES")->asShapes();
+	pDEM = Parameters("DEM")->asGrid();
+	fInterval = (double) Parameters("INTERVAL")->asDouble();
+	iNumPoints = Parameters("NUMPOINTS")->asInt();
+	iStep = Parameters("STEP")->asInt();
+
+	if(pLines == m_pSections){
+		bCopy = true;
+		m_pSections	= SG_Create_Shapes();
+	}//if
+	else{
+		bCopy = false;
+	}//else
+
+	m_pSections->Create(SHAPE_TYPE_Line, _TL("Cross Sections"));
+	for (i = iNumPoints; i > 0; i--){
+		m_pSections->Add_Field(CSG_String::Format(SG_T("-%s"), SG_Get_String(fInterval * i, 2).c_str()),
+										SG_DATATYPE_Double);
+	}//for
+	m_pSections->Add_Field("0", SG_DATATYPE_Double);
+	for (i = 1; i < iNumPoints +1; i++){
+		m_pSections->Add_Field(SG_Get_String(fInterval * i).c_str(), SG_DATATYPE_Double);
+	}//for
+	for(i=0; i<pLines->Get_Count() && Set_Progress(i, pLines->Get_Count()); i++){
+		pShape = pLines->Get_Shape(i);
+		for(j=0; j<pShape->Get_Part_Count(); j++){
+			for(k=0; k<pShape->Get_Point_Count(j)-1; k+=iStep){
+				Point = pShape->Get_Point(k,j);
+				Point2 = pShape->Get_Point(k+1,j);
+				dDistance = sqrt(pow(Point2.x - Point.x,2) + pow(Point2.y - Point.y,2));
+				dX = (Point.x + Point2.x) / 2.;
+				dY = (Point.y + Point2.y) / 2.;
+				fStepX = (Point2.y - Point.y) / dDistance * fInterval;
+				fStepY = -(Point2.x - Point.x) / dDistance * fInterval;
+				pSection = m_pSections->Add_Shape();
+				pSection->Add_Point(dX + iNumPoints * fStepX,
+								dY + iNumPoints * fStepY);
+				pSection->Add_Point(dX - iNumPoints * fStepX,
+								dY - iNumPoints * fStepY);
+				iField = 0;
+				for (iPoint = iNumPoints; iPoint > 0; iPoint--){
+					dX2 = dX - iPoint * fStepX;
+					dY2 = dY - iPoint * fStepY;
+					dHeight = pDEM->Get_Value(dX2, dY2);
+					pSection->Set_Value(iField, dHeight);
+					iField++;
+				}//for
+				dHeight = pDEM->Get_Value(dX, dY);
+				pSection->Set_Value(iField, dHeight);
+				iField++;
+				for (iPoint = 1; iPoint < iNumPoints +1; iPoint++){
+					dX2 = dX + iPoint * fStepX;
+					dY2 = dY + iPoint * fStepY;
+					dHeight = pDEM->Get_Value(dX2, dY2);
+					pSection->Set_Value(iField, dHeight);
+					iField++;
+				}//for*/
+			}//for
+		}//for
+	}//for
+
+	if (Parameters("PDF")->asBool()){
+		CreatePDFDocs();
+	}//if
+
+	if(bCopy){
+		pLines->Assign(m_pSections);
+		delete(m_pSections);
+	}//if
+
+	return true;
+
+}// method
+
+void CProfile_Cross_Sections::CreatePDFDocs(){
+
+	CSG_String sFilePath;
+			
+	if (Parameters("OUTPUTPATH")->asString()){
+		m_DocEngine.Open(_TL("SECTIONS"));
+		sFilePath = SG_File_Make_Path(Parameters("OUTPUTPATH")->asString(), _TL("Sections"), _TL("pdf"));
+	}//if
+	else{
+		Message_Add(_TL("\n** Error : Invalid parameters **\n"));
+		return;
+	}//else
+
+	AddLongitudinalProfiles();
+	AddCrossSections();
+
+	if (m_DocEngine.Save(sFilePath)){
+		if (!m_DocEngine.Close()){
+			Message_Add(_TL("\n\n ** Error : Could not close PDF engine ** \n\n"));
+		}
+	}//if
+	else{
+		Message_Add(_TL("\n\n ** Error : Could not save PDF file ** \n\n"));
+	}//else
+
+
+}//method
+
+
+void CProfile_Cross_Sections::AddLongitudinalProfiles(){
+
+	int i,j,k;
+	int iIndex = 0;	
+	int iNumPoints = Parameters("NUMPOINTS")->asInt();
+	int iStep = Parameters("STEP")->asInt();
+	int iFirstPoint = 0;
+	int iLastPoint;
+	int iSections;
+	double fX1, fY1, fX2, fY2;
+	double fDistance, fDistanceSum = 0;
+	double fDist;
+	double fThreshold = (double)Parameters("THRESHOLD")->asDouble();
+	bool bValid;
+	CSG_Shape *pShape;
+	CSG_Table *pTable;
+	TSG_Point	Point, Point2;
+	CSG_Shapes* pLines = Parameters("LINES")->asShapes();
+
+	pTable = m_pSections;
+	iSections = pTable->Get_Record_Count();
+
+	m_pProfile = new TSG_Point[iSections];
+
+	for(i=0; i<pLines->Get_Count() && Set_Progress(i, pLines->Get_Count()); i++){
+		pShape = pLines->Get_Shape(i);
+		for(j=0; j<pShape->Get_Part_Count(); j++){
+			Point = pShape->Get_Point(0,j);
+			for(k=0; k<pShape->Get_Point_Count(j)-1; k+=iStep){
+				Point2 = pShape->Get_Point(k,j);
+				fDistance = sqrt(pow(Point2.x - Point.x,2) + pow(Point2.y - Point.y,2));
+				m_pProfile[iIndex].x = fDistanceSum + fDistance / 2.;
+				m_pProfile[iIndex].y = pTable->Get_Record(iIndex)->asFloat(iNumPoints);
+				fDistanceSum += fDistance;
+				iIndex++;
+				Point.x = Point2.x;
+				Point.y = Point2.y;
+			}//for
+		}//for
+	}//for*/
+
+	m_pHeight = new double[iSections];
+
+	for (i = 0; i < iSections; i++){
+		m_pHeight[i] = 1500;
+	}
+	
+	iLastPoint = iSections - 1;
+	while(iFirstPoint != iSections - 1){
+		fX1 = m_pProfile[iFirstPoint].x;
+		fY1 = m_pProfile[iFirstPoint].y;
+		fX2 = m_pProfile[iLastPoint].x;
+		fY2 = m_pProfile[iLastPoint].y;
+		bValid = true;
+		for (i = iFirstPoint; i < iLastPoint; i++){			
+			fDist = CalculatePointLineDist(fX1,fY1,fX2,fY2, m_pProfile[i].x, m_pProfile[i].y);
+			if (fDist > fThreshold){
+				iLastPoint--;
+				bValid = false;
+				break;
+			}//if
+		}//for
+		if (bValid){
+			for (j = iFirstPoint; j < iLastPoint + 1; j++){
+				m_pHeight[j] = m_pProfile[iFirstPoint].y + 
+					(m_pProfile[j].x - m_pProfile[iFirstPoint].x) 
+					/ (m_pProfile[iLastPoint].x - m_pProfile[iFirstPoint].x)
+					* (m_pProfile[iLastPoint].y - m_pProfile[iFirstPoint].y);
+			}//for			
+			iFirstPoint = iLastPoint;
+			iLastPoint = iSections - 1;			
+		}//if
+	}//while
+	
+	
+	m_DocEngine.AddLongitudinalProfile(m_pProfile, m_pHeight, iSections);
+
+}//method
+
+double CProfile_Cross_Sections::CalculatePointLineDist(double fX1, double fY1, double fX2, double fY2, double fPX, double fPY){
+
+	double *pA, *pB, *pC;
+
+	pA = new double[2];
+	pA[0] = fX1;
+	pA[1] = fY1;
+	pB = new double[2];
+	pB[0] = fX2;
+	pB[1] = fY2;
+	pC = new double[2];
+	pC[0] = fPX;
+	pC[1] = fPY;
+	
+	return linePointDist(pA, pB, pC);
+
+}//method
+
+void CProfile_Cross_Sections::AddCrossSections(){
+
+	int i,j;
+	int iRoadPoints;
+	int iNumPoints = Parameters("NUMPOINTS")->asInt();
+	double fInterval = (double) Parameters("INTERVAL")->asDouble();
+	CSG_Table *pTable;
+	TSG_Point *pRoadSection;
+	TSG_Point **pCrossSections;
+	double dWidth = Parameters("WIDTH")->asDouble();
+
+	pRoadSection = new TSG_Point [2];
+	pRoadSection[0].x = -dWidth / 2.;
+	pRoadSection[0].y = 0;
+	pRoadSection[1].x = dWidth / 2.;
+	pRoadSection[1].y = 0;
+
+	pTable = m_pSections;
+	pCrossSections = new TSG_Point *[pTable->Get_Record_Count()];
+
+	for (i = 0; i < pTable->Get_Record_Count(); i++){
+		pCrossSections[i] = new TSG_Point [pTable->Get_Field_Count()];
+		for (j = 0; j < pTable->Get_Field_Count(); j++){
+			pCrossSections[i][j].x = -fInterval * iNumPoints + fInterval * j;
+			pCrossSections[i][j].y = pTable->Get_Record(i)->asFloat(j);
+		}//for
+	}//for
+
+	iRoadPoints = 2;
+
+	m_DocEngine.AddCrossSections(pCrossSections, m_pHeight, pRoadSection, pTable->Get_Record_Count(),
+								pTable->Get_Field_Count(), iRoadPoints);
+	m_DocEngine.AddVolumesTable(m_pProfile, pCrossSections, m_pHeight, pRoadSection,
+								pTable->Get_Record_Count(),	pTable->Get_Field_Count(), iRoadPoints);
+
+}//method
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/docs/docs_pdf/Profile_Cross_Sections.h b/src/modules/docs/docs_pdf/Profile_Cross_Sections.h
new file mode 100644
index 0000000..0ae3cff
--- /dev/null
+++ b/src/modules/docs/docs_pdf/Profile_Cross_Sections.h
@@ -0,0 +1,92 @@
+/**********************************************************
+ * Version $Id: Profile_Cross_Sections.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    CrossSections.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+//---------------------------------------------------------
+#include "doc_pdf.h"
+
+#include <vector>
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CProfile_Cross_Sections_PDF : public CSG_Doc_PDF   
+{
+public:
+	CProfile_Cross_Sections_PDF();
+	~CProfile_Cross_Sections_PDF();
+	void AddCrossSections(TSG_Point **,double*,TSG_Point *,int,int,int);	
+	void AddLongitudinalProfile(TSG_Point *, double*, int);
+	void AddVolumesTable(TSG_Point *,TSG_Point **,double*,TSG_Point *,int,int,int);	
+
+private:
+	char *m_pPath;
+	int m_iCanvasHeight;
+	int m_iTableWidth;
+	int m_iOffsetY;
+	CSG_String m_sName;
+
+	void AddCrossSection(TSG_Point *,TSG_Point *,int,int);
+	void DrawGuitar(TSG_Point *,double*, int);
+	void AddGuitarValue(double,double,double,double,int);
+	void AdjustSections(TSG_Point *,TSG_Point *,std::vector<TSG_Point >&,std::vector<TSG_Point >&,double,int&,int&);
+	void Intersect_Lines(double,double,double,double,double,double,double,double,double&,double&);
+	void CalculateAreas(TSG_Point*,TSG_Point*,double,int,int,double&,double&);
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CProfile_Cross_Sections : public CSG_Module_Grid
+{
+public:
+	CProfile_Cross_Sections(void);
+	virtual ~CProfile_Cross_Sections(void);
+
+protected:
+
+	bool On_Execute(void);
+
+private:
+
+	CProfile_Cross_Sections_PDF m_DocEngine;
+	CSG_Shapes *m_pSections;
+	double *m_pHeight;
+	TSG_Point *m_pProfile;
+
+	void CreatePDFDocs();
+	void AddLongitudinalProfiles();
+	void AddCrossSections();
+	double CalculatePointLineDist(double,double,double,double,double,double);
+
+};
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_pdf/Shapes_Report.cpp b/src/modules/docs/docs_pdf/Shapes_Report.cpp
similarity index 100%
rename from src/modules_io/docs/docs_pdf/Shapes_Report.cpp
rename to src/modules/docs/docs_pdf/Shapes_Report.cpp
diff --git a/src/modules_io/docs/docs_pdf/Shapes_Report.h b/src/modules/docs/docs_pdf/Shapes_Report.h
similarity index 100%
rename from src/modules_io/docs/docs_pdf/Shapes_Report.h
rename to src/modules/docs/docs_pdf/Shapes_Report.h
diff --git a/src/modules/docs/docs_pdf/Shapes_Summary.cpp b/src/modules/docs/docs_pdf/Shapes_Summary.cpp
new file mode 100644
index 0000000..7b22b55
--- /dev/null
+++ b/src/modules/docs/docs_pdf/Shapes_Summary.cpp
@@ -0,0 +1,575 @@
+/**********************************************************
+ * Version $Id: Shapes_Summary.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Summarize.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Shapes_Summary.h"
+
+#define VERY_LARGE_NUMBER 9999999999.
+
+CSG_String sParam[] = {"[Sum]", "[Mean]", "[Variance]", "[Minimum]", "[Maximum]"};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define PDF_PAGE_WIDTH_A4       596
+#define PDF_PAGE_HEIGHT_A4      842
+#define PDF_PAGE_WIDTH_A3 PDF_PAGE_HEIGHT_A4
+#define PDF_PAGE_HEIGHT_A3 (sqrt(2.) * PDF_PAGE_HEIGHT_A4)
+#define OFFSET_X 50
+#define OFFSET_Y 50
+#define LINE_SPACEMENT 12
+#define SUMMARY_LAYOUT_HEADER 50
+#define MAX_SUMMARY_LAYOUT_HEIGHT (PDF_PAGE_WIDTH_A3 - 2 * OFFSET_Y - LINE_SPACEMENT)
+#define MAX_SUMMARY_LAYOUT_WIDTH MAX_SUMMARY_LAYOUT_HEIGHT
+#define SUMMARY_LAYOUT_SEPARATION 30
+#define MAX_SUMMARY_TABLE_WIDTH (PDF_PAGE_HEIGHT_A3 - 2 * OFFSET_X - MAX_SUMMARY_LAYOUT_WIDTH - SUMMARY_LAYOUT_SEPARATION)
+#define MAX_ROWS_IN_SUMMARY_LAYOUT (MAX_SUMMARY_LAYOUT_HEIGHT / TABLE_CELL_HEIGHT)
+#define SUMMARY_STATISTICS_GRAPH_HEIGHT 120
+#define SUMMARY_STATISTICS_GRAPH_WIDTH (PDF_PAGE_WIDTH_A4 - 2 * OFFSET_X)
+#define SUMMARY_STATISTICS_GRAPH_SEPARATION 120
+#define GRATICULE_SEPARATION 20
+#define SUMMARY_TABLE_CELL_HEIGHT 13.0
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+CShapes_Summary_PDF::CShapes_Summary_PDF(){
+
+}//constructor
+
+CShapes_Summary_PDF::~CShapes_Summary_PDF(){}
+
+void CShapes_Summary_PDF::AddClassSummaryPage(CSG_Shapes *pShapes, 
+											   CSG_Table *pTable,
+											   int iClass,
+											   CSG_String sTitle){
+
+	int i;
+	double fPaperHeight;
+	double fRealWidth, fRealHeight;
+	double fX, fY;
+	CSG_Table *pClassTable;
+	CSG_Table_Record *pRecord;
+	CSG_Rect CanvasExtent, TableExtent;
+	TSG_Rect Extent;
+	
+
+	Add_Page(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE);
+	Add_Outline_Item(sTitle.c_str());
+
+	fPaperHeight = Get_Size_Page().Get_YRange();
+
+	Draw_Text(PDF_PAGE_HEIGHT_A3 - OFFSET_X, fPaperHeight - OFFSET_Y, sTitle, 
+				25, PDF_STYLE_TEXT_ALIGN_H_RIGHT, 0.0, SG_GET_RGB(0, 0, 0));
+
+	Draw_Line(OFFSET_X, fPaperHeight - OFFSET_Y - 5, 
+				PDF_PAGE_HEIGHT_A3 - OFFSET_X, fPaperHeight - OFFSET_Y - 5, 4 );
+
+	Extent = pShapes->Get_Extent();
+	fRealWidth = Extent.xMax - Extent.xMin;
+	fRealHeight = Extent.yMax - Extent.yMin;
+
+	CanvasExtent.Assign(OFFSET_X,
+						OFFSET_Y,
+						OFFSET_X + MAX_SUMMARY_LAYOUT_WIDTH,
+						OFFSET_Y + MAX_SUMMARY_LAYOUT_HEIGHT);
+
+	_Fit_Rectangle(CanvasExtent, fRealWidth / fRealHeight, true);
+
+	CanvasExtent.Deflate(GRATICULE_SEPARATION, false);
+
+	Draw_Shapes(CanvasExtent, pShapes);
+
+	CanvasExtent.Inflate(GRATICULE_SEPARATION, false);
+
+	/*CanvasExtent.xMin = OFFSET_X + (MAX_SUMMARY_LAYOUT_WIDTH - fWidth) / 2. - GRATICULE_SEPARATION;
+	CanvasExtent.xMax = CanvasExtent.xMin + fWidth + 2 * GRATICULE_SEPARATION;
+	CanvasExtent.yMin = OFFSET_Y + (MAX_SUMMARY_LAYOUT_HEIGHT - fHeight) / 2. - GRATICULE_SEPARATION;
+	CanvasExtent.yMax = CanvasExtent.yMin + fHeight + 2* GRATICULE_SEPARATION;*/
+
+	Draw_Graticule(CanvasExtent, Extent);
+
+	pClassTable = SG_Create_Table();
+	pClassTable->Add_Field(_TL("Field"), SG_DATATYPE_String );
+	pClassTable->Add_Field(_TL("Value"), SG_DATATYPE_Double);
+
+	for (i = 0; i < pTable->Get_Field_Count(); i++){
+		pRecord = pClassTable->Add_Record();
+		pRecord->Set_Value(0, pTable->Get_Field_Name(i));
+		pRecord->Set_Value(1, pTable->Get_Record(iClass)->asDouble(i));
+	}
+	fY = fPaperHeight - OFFSET_Y - SUMMARY_LAYOUT_HEADER;
+	fX = PDF_PAGE_HEIGHT_A3 - OFFSET_X - MAX_SUMMARY_TABLE_WIDTH;
+	TableExtent.Assign(fX, fY, fX + MAX_SUMMARY_TABLE_WIDTH, OFFSET_Y);
+
+	Draw_Table(TableExtent, pClassTable, SUMMARY_TABLE_CELL_HEIGHT, 0.0);
+	
+}//method
+
+void CShapes_Summary_PDF::AddSummaryStatisticsPage(CSG_Table* pTable){
+
+	int i,j;
+	double fX, fY;
+	double fPaperHeight;
+	CSG_Points Data;
+	CSG_String *pNames;
+	CSG_Rect r;
+
+	fPaperHeight = Get_Size_Page().Get_YRange();
+
+	pNames = new CSG_String [pTable->Get_Record_Count()];
+	for (i = 0; i < pTable->Get_Record_Count(); i++){
+		pNames[i] = pTable->Get_Record(i)->asString(0);
+	}//for
+
+	for (i = 1; i < pTable->Get_Field_Count(); i++){
+		if ((i-1)%3 == 0){
+			Add_Page();
+		}//if
+		Data.Clear();
+		for (j = 0; j < pTable->Get_Record_Count(); j++){
+			Data.Add(0.0, pTable->Get_Record(j)->asDouble(i)); 
+		}//for		
+		fY = OFFSET_Y + ((i-1)%3) * (SUMMARY_STATISTICS_GRAPH_HEIGHT + SUMMARY_STATISTICS_GRAPH_SEPARATION);
+		fY = fPaperHeight - fY;
+		fX = OFFSET_X;		
+		Draw_Text(fX, fY + 10, pTable->Get_Field_Name(i), 14);
+		r.Assign(fX, fY - 25 - SUMMARY_STATISTICS_GRAPH_HEIGHT, fX + SUMMARY_STATISTICS_GRAPH_WIDTH, fY - 25 );
+		AddBarGraphStatistics(Data, pNames, r);
+	}//for*/
+
+
+}//method
+
+void CShapes_Summary_PDF::AddBarGraphStatistics(CSG_Points &Data,
+										CSG_String *pNames,
+										const CSG_Rect &r){
+
+	int i;
+    int iMag;
+	int iNumLines;
+    double fMinLine = 0;
+	double fWidth;
+	double fMax, fMin;
+	double fStep;
+    double fX, fY;
+	double fPaperHeight;
+	double fAngle;
+	CSG_String sValue;
+	CSG_Points Points;
+
+	fPaperHeight = Get_Size_Page().Get_YRange();
+
+	fMin = fMax = Data[0].y;	
+
+	for (i = 0; i < Data.Get_Count(); i++){
+		if (Data[i].y > fMax){
+			fMax = Data[i].y;
+		}
+		if (Data[i].y < fMin){
+			fMin = Data[i].y;
+		}		
+		fMin = M_GET_MIN(0, fMin);		
+    }
+
+	if (fMin != fMax){
+		iMag = (int) (log(fMax - fMin) / log(10.0));
+		fStep =  (pow(10.0, (double) iMag));
+		if (fStep == 0){
+			fStep = 1.;
+		}
+		fMinLine= (long)(((long)(fMin/fStep)) *fStep);
+
+		iNumLines = (int) ((fMax - fMin) / fStep);
+
+		while (iNumLines < 8){
+			fStep = fStep / 2.0;
+			iNumLines = (int) ((fMax - fMin) / fStep);
+		}
+		iNumLines = (int) ((fMax - fMinLine) / fStep);
+	}
+	else{
+		fStep = fMin = 0;
+		iNumLines = 1;
+		fMinLine = fMax;
+	}
+
+
+	for (i = 0; i < iNumLines; i++) {
+        fY = r.Get_YMin() + ((fMinLine + fStep * i - fMin) / (fMax - fMin)) * r.Get_YRange();
+        if (fY <= r.Get_YMax() && fY >= r.Get_YMin()) {
+			Draw_Line(r.Get_XMin(), fY, r.Get_XMax(), fY);
+        }
+    }
+
+	fWidth = (double) r.Get_XRange() / (double) (Data.Get_Count());
+	for (i = 0; i < Data.Get_Count(); i++)
+	{
+	    fX = r.Get_XMin() + i * fWidth;
+		fY = r.Get_YMin();
+		//fY = fPaperHeight - fY;
+		Draw_Rectangle(fX, fY, fX + fWidth,
+				fY + r.Get_YRange() * ((Data[i].y - fMin) / (fMax - fMin)),
+				PDF_STYLE_POLYGON_FILLSTROKE, 0xaa0000);
+	}
+
+	fAngle = 3.14159/ 180 * 60;
+
+	for (i = 0; i < Data.Get_Count(); i++)
+	{
+	    fX = r.Get_XMin() + i * fWidth + fWidth / 2.;
+		Draw_Text(fX - 5, fY - 5, pNames[i], 9, PDF_STYLE_TEXT_ALIGN_V_TOP|PDF_STYLE_TEXT_ALIGN_H_RIGHT, fAngle);
+		Draw_Line(fX, fY, fX, fY - 5, 1);
+    }
+
+	Draw_Line(r.Get_XMin(), r.Get_YMin(), r.Get_XMin(), r.Get_YMax(), 4);
+	Draw_Line(r.Get_XMin(), r.Get_YMin(), r.Get_XMax(), r.Get_YMin(), 4);
+
+										
+}//method
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CShapes_Summary::CShapes_Summary(void){
+
+	CSG_Parameter *pNode;
+	CSG_String sName;
+
+	Parameters.Set_Name(_TL("Shapes Summary Report"));
+	Parameters.Set_Description(_TW("(c) 2004 by Victor Olaya. summary."));
+
+	pNode = Parameters.Add_Shapes(NULL,
+								"SHAPES",
+								_TL("Shapes"),
+								_TL(""),
+								PARAMETER_INPUT);
+
+	Parameters.Add_Table_Field(pNode,
+								"FIELD",
+								_TL("Field"),
+								_TL(""));
+
+	Parameters.Add_Table(NULL,
+						"TABLE",
+						_TL("Summary Table"),
+						_TL(""),
+						PARAMETER_OUTPUT);
+
+	pNode = Parameters.Add_Node(NULL,
+						"PDFNODE",
+						_TL("PDF Docs"),
+						_TL(""));
+
+	Parameters.Add_Value(pNode,
+						"PDF",
+						_TL("Create PDF Docs"),
+						_TL("Create PDF Docs"),
+						PARAMETER_TYPE_Bool,
+						true);
+
+	Parameters.Add_FilePath(pNode,
+							"OUTPUTPATH",
+							_TL("Folder"),
+							_TL("Folder"),
+							_TL(""),
+							_TL(""),
+							true,
+							true);
+
+	m_pExtraParameters	= Add_Parameters("EXTRA",
+										_TL("Field for Summary"),
+										_TL(""));
+
+}//constructor
+
+
+CShapes_Summary::~CShapes_Summary(void)
+{}
+
+bool CShapes_Summary::On_Execute(void){
+
+	int i,j;
+	CSG_Table *pShapesTable;
+	CSG_Parameter **pExtraParameter;
+	CSG_String sName, sFilePath;
+
+	m_iField = Parameters("FIELD")->asInt();
+	m_pShapes = Parameters("SHAPES")->asShapes();
+	m_pTable = Parameters("TABLE")->asTable();
+
+	pShapesTable = m_pShapes;
+	m_bIncludeParam = new bool [pShapesTable->Get_Field_Count() * 5];
+	pExtraParameter = new CSG_Parameter* [pShapesTable->Get_Field_Count() * 5];
+
+	for (i = 0; i < pShapesTable->Get_Field_Count(); i++){
+		for (j = 0; j < 5; j++){
+			if( SG_Data_Type_is_Numeric(pShapesTable->Get_Field_Type(i)) )
+			{ //is numeric field
+				sName = pShapesTable->Get_Field_Name(i);
+				sName.Append(sParam[j]);
+				pExtraParameter[i * 5 + j] = m_pExtraParameters->Add_Value(NULL,
+																			SG_Get_String(i * 5 + j,0).c_str(),
+																			sName.c_str(),
+																			_TL(""),
+																			PARAMETER_TYPE_Bool,
+																			false);
+				m_bIncludeParam[i * 5 + j] = true;
+			}//if
+			else{
+				m_bIncludeParam[i * 5 + j] = false;
+			}//else
+		}//for
+	}//for
+
+	if(Dlg_Parameters("EXTRA")){
+		for (i = 0; i < pShapesTable->Get_Field_Count() * 5; i++){
+			sName = SG_Get_String(i,0);
+			if (m_bIncludeParam[i]){
+				m_bIncludeParam[i] = Get_Parameters("EXTRA")->Get_Parameter(sName.c_str())->asBool();
+			}//if			
+		}//for
+
+		Summarize();
+
+		if (Parameters("PDF")->asBool()){
+			if (Parameters("OUTPUTPATH")->asString()){
+				sName = _TL("Summary_");
+				sName.Append(m_pShapes->Get_Name());
+				m_DocEngine.Open(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE, sName);
+				CreatePDFDocs();
+				sFilePath = SG_File_Make_Path(Parameters("OUTPUTPATH")->asString(), sName, SG_T("pdf"));
+				if (m_DocEngine.Save(sFilePath)){
+					if (!m_DocEngine.Close()){
+						Message_Add(_TL("\n\n ** Error : Could not close PDF engine ** \n\n"));
+					}
+				}//if
+				else{
+					Message_Add(_TL("\n\n ** Error : Could not save PDF file ** \n\n"));
+				}//else
+			}//if
+		}//if
+
+		m_pExtraParameters->Destroy();
+
+		delete [] m_bIncludeParam;
+
+		return true;
+
+	}//if
+
+	m_pExtraParameters->Destroy();
+
+	delete [] m_bIncludeParam;
+
+	return false;
+
+}//method
+
+void CShapes_Summary::CreatePDFDocs(){
+
+	CSG_Shapes *pShapes;
+	CSG_Shape *pShape;
+	CSG_Table *pShapesTable;
+	int i,j;
+	
+	m_DocEngine.Add_Page_Title (_TL("Summary"), PDF_TITLE_01, PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE);
+
+	pShapesTable = m_pShapes;
+	pShapes = new CSG_Shapes();
+	for (i = 0; i < (int)m_ClassesID.size(); i++){
+		Set_Progress(i,m_ClassesID.size());
+		pShapes->Create(m_pShapes->Get_Type());
+		for (j = 0; j < m_pShapes->Get_Count(); j++){
+			if (m_pClasses[j] == i){
+				pShape = pShapes->Add_Shape();
+				pShape->Assign(m_pShapes->Get_Shape(j));
+			}//if
+		}//for
+		m_DocEngine.AddClassSummaryPage(pShapes, m_pTable, i, m_ClassesID[i]);
+	}//for
+	
+	if (m_pTable->Get_Record_Count() > 1){
+		m_DocEngine.Add_Page_Title (_TL("Statistics"), PDF_TITLE_01, PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT);
+		m_DocEngine.AddSummaryStatisticsPage(m_pTable);
+	}//if
+
+	delete pShapes;
+
+}//method
+
+
+void CShapes_Summary::Summarize(){
+
+	int i,j;
+
+	CSG_Table *pShapesTable;
+	CSG_Table_Record *pRecord;
+	CSG_String sName;
+	float *pSum;
+	float *pMin;
+	float *pMax;
+	float *pVar;
+	float fValue;
+	float fMean;
+	int iLastField = -1;
+	int iField;
+	int iParam;
+
+	m_ClassesID.clear();
+
+	pShapesTable = m_pShapes;
+	m_pClasses = new int[pShapesTable->Get_Record_Count()];
+
+	for (i = 0; i < pShapesTable->Get_Record_Count(); i++){
+		pRecord = pShapesTable->Get_Record(i);
+		sName = pRecord->asString(m_iField);
+		for (j = 0; j < (int)m_ClassesID.size(); j++){
+			if (!m_ClassesID[j].CmpNoCase(sName)){
+				m_pClasses[i] = j;
+				break;
+			}//if
+		}//for
+		if (j == m_ClassesID.size()){
+			m_pClasses[i] = j;
+			m_ClassesID.push_back(sName);
+		}//if
+	}//for
+
+	m_pTable->Create((CSG_Table*)NULL);
+	m_pTable->Set_Name(_TL("Summary Table"));
+	m_pTable->Add_Field(_TL("Class"), SG_DATATYPE_String);
+	m_pTable->Add_Field(_TL("Count"), SG_DATATYPE_Int);
+
+	m_pCount = new int[m_ClassesID.size()];
+	pSum = new float[m_ClassesID.size()];
+	pMax = new float[m_ClassesID.size()];
+	pMin = new float[m_ClassesID.size()];
+	pVar = new float[m_ClassesID.size()];
+
+	for (i = 0; i < (int)m_ClassesID.size(); i++){
+		m_pCount[i] = 0;
+	}//for
+
+	for (i = 0; i < pShapesTable->Get_Record_Count(); i++){
+		m_pCount[m_pClasses[i]]++;
+	}//for
+
+	for (i = 0; i < (int)m_ClassesID.size(); i++){
+		pRecord = m_pTable->Add_Record();
+		sName = m_ClassesID[i];
+		pRecord->Set_Value(0,sName.c_str());
+		pRecord->Set_Value(1,m_pCount[i]);
+	}//for
+
+	for (i = 0; i < pShapesTable->Get_Field_Count() * 5; i++){
+		if (m_bIncludeParam[i]){
+			iField = (int) (i / 5);
+			iParam = i % 5;
+			sName = pShapesTable->Get_Field_Name(iField);
+			sName.Append(sParam[iParam]);
+			m_pTable->Add_Field(sName.c_str(), SG_DATATYPE_Double);
+			if (iField != iLastField){
+				for (j = 0; j < (int)m_ClassesID.size(); j++){
+					pSum[j] = 0;
+					pMax[j] = -(float)VERY_LARGE_NUMBER;
+					pMin[j] =  (float)VERY_LARGE_NUMBER;
+					pVar[j] = 0;
+				}//for
+				for (j = 0; j < pShapesTable->Get_Record_Count(); j++){
+					pRecord = pShapesTable->Get_Record(j);
+					fValue = pRecord->asFloat(iField);
+					pSum[m_pClasses[j]] += fValue;
+					pVar[m_pClasses[j]] += (fValue * fValue);
+					if (fValue > pMax[m_pClasses[j]]){
+						 pMax[m_pClasses[j]] = fValue;
+					}//if
+					if (fValue < pMin[m_pClasses[j]]){
+						 pMin[m_pClasses[j]] = fValue;
+					}//if
+				}//for
+			}//if
+			iField = m_pTable->Get_Field_Count() - 1;
+			for (j = 0; j < (int)m_ClassesID.size(); j++){
+				pRecord = m_pTable->Get_Record(j);
+				switch (iParam){
+				case 0: //sum
+					pRecord->Set_Value(iField, pSum[j]);
+					break;
+				case 1: //average
+					pRecord->Set_Value(iField, pSum[j] / (float) m_pCount[j]);
+					break;
+				case 2: //variance
+					fMean = pSum[j] / (float) m_pCount[j];
+					pRecord->Set_Value(iField, pVar[j] / (float) m_pCount[j] - fMean * fMean);
+					break;
+				case 3: //min
+					pRecord->Set_Value(iField, pMin[j]);
+					break;
+				case 4: //max
+					pRecord->Set_Value(iField, pMax[j]);
+					break;
+				default:
+					break;
+				}//switch
+			}//for
+
+		}//if
+
+	}//for
+
+
+}//method
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/docs/docs_pdf/Shapes_Summary.h b/src/modules/docs/docs_pdf/Shapes_Summary.h
new file mode 100644
index 0000000..35a752c
--- /dev/null
+++ b/src/modules/docs/docs_pdf/Shapes_Summary.h
@@ -0,0 +1,98 @@
+/**********************************************************
+ * Version $Id: Shapes_Summary.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Summarize.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "doc_pdf.h"
+
+#include <vector>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CShapes_Summary_PDF : public CSG_Doc_PDF 
+{
+public:
+
+	CShapes_Summary_PDF();
+	virtual ~CShapes_Summary_PDF();
+	void AddClassSummaryPage(CSG_Shapes*, CSG_Table*, int, CSG_String);
+	void AddSummaryStatisticsPage(CSG_Table* pTable);
+
+private:
+
+	void AddBarGraphStatistics(CSG_Points &, CSG_String*,	const CSG_Rect &);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CShapes_Summary : public CSG_Module  
+{
+public:
+	CShapes_Summary(void);
+	virtual ~CShapes_Summary(void);
+
+protected:
+
+	virtual bool			On_Execute(void);
+
+private:
+
+	int m_iField;
+	CSG_Shapes *m_pShapes;
+	CSG_Table *m_pTable;
+	bool *m_bIncludeParam;
+	std::vector<CSG_String> m_ClassesID;
+	int *m_pClasses;
+	int *m_pCount;
+	CSG_Parameters *m_pExtraParameters;
+	CShapes_Summary_PDF m_DocEngine;
+
+	void Summarize();
+	void CreatePDFDocs();
+
+};
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_pdf/doc_pdf.cpp b/src/modules/docs/docs_pdf/doc_pdf.cpp
similarity index 100%
rename from src/modules_io/docs/docs_pdf/doc_pdf.cpp
rename to src/modules/docs/docs_pdf/doc_pdf.cpp
diff --git a/src/modules_io/docs/docs_pdf/doc_pdf.h b/src/modules/docs/docs_pdf/doc_pdf.h
similarity index 100%
rename from src/modules_io/docs/docs_pdf/doc_pdf.h
rename to src/modules/docs/docs_pdf/doc_pdf.h
diff --git a/src/modules/garden/Makefile.am b/src/modules/garden/Makefile.am
new file mode 100644
index 0000000..8c3e1cb
--- /dev/null
+++ b/src/modules/garden/Makefile.am
@@ -0,0 +1,5 @@
+if WITH_GUI
+SUBDIRS = garden_3d_viewer garden_fractals garden_games garden_learn_to_program garden_webservices
+else
+SUBDIRS = garden_fractals garden_games garden_learn_to_program
+endif
diff --git a/src/modules/garden/Makefile.in b/src/modules/garden/Makefile.in
new file mode 100644
index 0000000..26303ba
--- /dev/null
+++ b/src/modules/garden/Makefile.in
@@ -0,0 +1,636 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/garden
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = garden_fractals garden_games garden_learn_to_program \
+	garden_3d_viewer garden_webservices
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at WITH_GUI_FALSE@SUBDIRS = garden_fractals garden_games garden_learn_to_program
+ at WITH_GUI_TRUE@SUBDIRS = garden_3d_viewer garden_fractals garden_games garden_learn_to_program garden_webservices
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/garden/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_globe_grid.cpp b/src/modules/garden/garden_3d_viewer/3d_viewer_globe_grid.cpp
new file mode 100644
index 0000000..116a92a
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_globe_grid.cpp
@@ -0,0 +1,634 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_globe_grid.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       3d_viewer                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                3d_viewer_globe_grid.cpp               //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "3d_viewer_globe_grid.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Globe_Grid_Panel : public CSG_3DView_Panel
+{
+public:
+	C3D_Viewer_Globe_Grid_Panel(wxWindow *pParent, CSG_Grid *pGrid, CSG_Grid *pZ);
+	virtual ~C3D_Viewer_Globe_Grid_Panel(void);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual void				Update_Statistics		(void);
+	virtual void				Update_Parent			(void);
+
+	virtual void				On_Key_Down				(wxKeyEvent   &event);
+
+	virtual bool				On_Draw					(void);
+
+	virtual int					Get_Color				(double Value);
+
+
+private:
+
+	bool						m_Color_bGrad;
+
+	double						m_Color_Min, m_Color_Scale, m_Radius;
+
+	CSG_Colors					m_Colors;
+
+	CSG_Grid					*m_pGrid, *m_pZ;
+
+	TSG_Point_Z					**m_pNodes;
+
+
+	bool						Create_Nodes			(void);
+
+	bool						Get_Node				(int x, int y, TSG_Triangle_Node &Node);
+
+
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_Globe_Grid_Panel, CSG_3DView_Panel)
+	EVT_KEY_DOWN	(C3D_Viewer_Globe_Grid_Panel::On_Key_Down)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_Globe_Grid_Panel::C3D_Viewer_Globe_Grid_Panel(wxWindow *pParent, CSG_Grid *pGrid, CSG_Grid *pZ)
+	: CSG_3DView_Panel(pParent)
+{
+	m_pGrid		= pGrid;
+	m_pZ		= pZ;
+	m_pNodes	= NULL;
+
+	Create_Nodes();
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode, *pNode_1, *pNode_2;
+
+	m_Parameters("BGCOLOR" )->Set_Value((int)SG_COLOR_BLACK);
+	m_Parameters("DRAW_BOX")->Set_Value(false);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters("NODE_GENERAL");
+
+	m_Parameters.Add_Value(
+		pNode	, "RADIUS"			, _TL("Radius"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 6371.0, 0.0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "Z_SCALE"			, _TL("Exaggeration"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_VIEW"		, _TL("Grid View Settings"),
+		_TL("")
+	);
+
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "DRAW_FACES"		, _TL("Draw Faces"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	pNode_2	= m_Parameters.Add_Value(
+		pNode_1	, "COLOR_ASRGB"		, _TL("RGB Values"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Colors(
+		pNode_2	, "COLORS"			, _TL("Colours"),
+		_TL("")
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "COLORS_GRAD"		, _TL("Graduated"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Range(
+		pNode_2	, "COLORS_RANGE"	, _TL("Value Range"),
+		_TL("")
+	);
+
+	pNode_2	= m_Parameters.Add_Choice(
+		pNode_1	, "SHADING"			, _TL("Shading"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("none"),
+			_TL("shading")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "SHADE_DEC"		, _TL("Light Source Height"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, -90.0, true, 90.0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "SHADE_AZI"		, _TL("Light Source Direction"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 315.0, 0.0, true, 360.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "DRAW_EDGES"		, _TL("Draw Wire"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "EDGE_COLOR"		, _TL("Colour"),
+		_TL(""),
+		PARAMETER_TYPE_Color, SG_GET_RGB(150, 150, 150)
+	);
+
+	//-----------------------------------------------------
+	Update_Statistics();
+}
+
+//---------------------------------------------------------
+C3D_Viewer_Globe_Grid_Panel::~C3D_Viewer_Globe_Grid_Panel(void)
+{
+	if( m_pNodes )
+	{
+		SG_Free(m_pNodes[0]);
+		SG_Free(m_pNodes);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_Globe_Grid_Panel::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "COLOR_ASRGB") )
+	{
+		pParameters->Get_Parameter("COLORS"      )->Set_Enabled(pParameter->asBool() == false);
+		pParameters->Get_Parameter("COLORS_RANGE")->Set_Enabled(pParameter->asBool() == false);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHADING") )
+	{
+		pParameters->Get_Parameter("SHADE_DEC")->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("SHADE_AZI")->Set_Enabled(pParameter->asBool());
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DRAW_EDGES") )
+	{
+		pParameters->Get_Parameter("EDGE_COLOR")->Set_Enabled(pParameter->asBool());
+	}
+
+	return( CSG_3DView_Panel::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Globe_Grid_Panel::Create_Nodes(void)
+{
+	m_pNodes	= (TSG_Point_Z **)SG_Malloc(m_pGrid->Get_NY    () * sizeof(TSG_Point_Z *));
+	m_pNodes[0]	= (TSG_Point_Z  *)SG_Malloc(m_pGrid->Get_NCells() * sizeof(TSG_Point_Z  ));
+
+	for(int y=0; y<m_pGrid->Get_NY(); y++)
+	{
+		m_pNodes[y]	= m_pNodes[0] + y * m_pGrid->Get_NX();
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Globe_Grid_Panel::Update_Statistics(void)
+{
+	double	Radius	= m_Parameters("RADIUS")->asDouble();
+	double	zScale	= m_pZ ? m_Parameters("Z_SCALE")->asDouble() : 0.0;
+
+	m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+		m_pGrid->Get_ArithMean() - 1.5 * m_pGrid->Get_StdDev(),
+		m_pGrid->Get_ArithMean() + 1.5 * m_pGrid->Get_StdDev()
+	);
+
+	m_Data_Min.x = m_Data_Max.x = 0.0;
+	m_Data_Min.y = m_Data_Max.y = 0.0;
+	m_Data_Min.z = m_Data_Max.z = 0.0;
+
+	for(int y=0; y<m_pGrid->Get_NY(); y++)
+	{
+		TSG_Point_Z	*pNode	= m_pNodes[y];
+
+		double	wy	= M_DEG_TO_RAD * (m_pGrid->Get_YMin() + y * m_pGrid->Get_Cellsize());
+		double	wx	= M_DEG_TO_RAD * (m_pGrid->Get_XMin());
+
+		for(int x=0; x<m_pGrid->Get_NX(); x++, pNode++, wx+=M_DEG_TO_RAD*m_pGrid->Get_Cellsize())
+		{
+			double r	= zScale ? Radius + zScale * m_pZ->asDouble(x, y) : Radius;
+			pNode->z	= r * sin(wy);
+			double s	= r * cos(wy);
+			pNode->x	= s * cos(wx);
+			pNode->y	= s * sin(wx);
+
+			if( m_Data_Min.x > pNode->x ) m_Data_Min.x = pNode->x; else if( m_Data_Max.x < pNode->x ) m_Data_Max.x = pNode->x;
+			if( m_Data_Min.y > pNode->y ) m_Data_Min.y = pNode->y; else if( m_Data_Max.y < pNode->y ) m_Data_Max.y = pNode->y;
+			if( m_Data_Min.z > pNode->z ) m_Data_Min.z = pNode->z; else if( m_Data_Max.z < pNode->z ) m_Data_Max.z = pNode->z;
+		}
+	}
+
+	//-----------------------------------------------------
+	Update_View();
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Globe_Grid_Panel::Update_Parent(void)
+{
+	((CSG_3DView_Dialog *)GetParent())->Update_Controls();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Globe_Grid_Panel::On_Key_Down(wxKeyEvent &event)
+{
+	switch( event.GetKeyCode() )
+	{
+	default:	CSG_3DView_Panel::On_Key_Down(event);	return;
+
+	case WXK_F1:	m_Parameters("Z_SCALE")->Set_Value(m_Parameters("Z_SCALE")->asDouble() -  0.5);	break;
+	case WXK_F2:	m_Parameters("Z_SCALE")->Set_Value(m_Parameters("Z_SCALE")->asDouble() +  0.5);	break;
+	}
+
+	//-----------------------------------------------------
+	Update_View(true);
+	Update_Parent();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_Globe_Grid_Panel::Get_Color(double Value)
+{
+	if( m_Color_Scale <= 0.0 )
+	{
+		return( (int)Value );
+	}
+
+	double	c	= m_Color_Scale * (Value - m_Color_Min);
+
+	return( m_Color_bGrad ? m_Colors.Get_Interpolated(c) : m_Colors[(int)c] );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline bool C3D_Viewer_Globe_Grid_Panel::Get_Node(int x, int y, TSG_Triangle_Node &Node)
+{
+	if( m_pGrid->is_InGrid(x, y) )
+	{
+		TSG_Point_Z	p	= m_pNodes[y][x];
+
+		m_Projector.Get_Projection(p);
+
+		Node.x	= p.x;
+		Node.y	= p.y;
+		Node.z	= p.z;
+		Node.c	= m_pGrid->asDouble(x, y);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool C3D_Viewer_Globe_Grid_Panel::On_Draw(void)
+{
+	//-----------------------------------------------------
+	if( m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal()
+	>=  m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() )
+	{
+		m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+			m_pGrid->Get_ArithMean() - 1.5 * m_pGrid->Get_StdDev(),
+			m_pGrid->Get_ArithMean() + 1.5 * m_pGrid->Get_StdDev()
+		);
+	}
+
+	m_Colors		= *m_Parameters("COLORS")->asColors();
+	m_Color_bGrad	= m_Parameters("COLORS_GRAD")->asBool();
+	m_Color_Min		= m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal();
+	m_Color_Scale	= m_Parameters("COLOR_ASRGB")->asBool() ? 0.0
+					: m_Colors.Get_Count() / (m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() - m_Color_Min);
+
+	//-----------------------------------------------------
+	if( m_Parameters("DRAW_FACES")->asBool() )	// Faces
+	{
+		int		Shading		= m_Parameters("SHADING"  )->asInt   ();
+		double	Shade_Dec	= m_Parameters("SHADE_DEC")->asDouble() * -M_DEG_TO_RAD;
+		double	Shade_Azi	= m_Parameters("SHADE_AZI")->asDouble() *  M_DEG_TO_RAD;
+
+		#pragma omp parallel for
+		for(int y=1; y<m_pGrid->Get_NY(); y++)
+		{
+			for(int x=1; x<m_pGrid->Get_NX(); x++)
+			{
+				TSG_Triangle_Node	a, b, p[3];
+
+				if( Get_Node(x - 1, y - 1, a)
+				&&  Get_Node(x    , y    , b) )
+				{
+					if( Get_Node(x    , y - 1, p[2]) )
+					{
+						p[0]	= a;
+						p[1]	= b;
+
+						if( Shading ) Draw_Triangle(p, Shade_Dec, Shade_Azi); else Draw_Triangle(p);
+					}
+
+					if( Get_Node(x - 1, y    , p[2]) )
+					{
+						p[0]	= a;
+						p[1]	= b;
+
+						if( Shading ) Draw_Triangle(p, Shade_Dec, Shade_Azi); else Draw_Triangle(p);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( m_Parameters("DRAW_EDGES")->asBool() )	// Edges
+	{
+		int	Color	= m_Parameters("EDGE_COLOR")->asColor();
+
+		for(int y0=0, y1=1; y1<m_pGrid->Get_NY(); y0++, y1++)
+		{
+			for(int x0=0, x1=1; x1<m_pGrid->Get_NX(); x0++, x1++)
+			{
+				TSG_Triangle_Node	p[3];
+
+				Get_Node(x0, y0, p[0]); p[0].c	= Get_Color(p[0].c);
+				Get_Node(x1, y1, p[1]); p[1].c	= Get_Color(p[1].c);
+				Draw_Line(p[0].x, p[0].y, p[0].z, p[1].x, p[1].y, p[1].z, p[0].c, p[1].c);
+
+				//-----------------------------------------
+				Get_Node(x1, y0, p[2]); p[2].c	= Get_Color(p[2].c);
+				Draw_Line(p[0].x, p[0].y, p[0].z, p[2].x, p[2].y, p[2].z, p[0].c, p[2].c);
+				Draw_Line(p[1].x, p[1].y, p[1].z, p[2].x, p[2].y, p[2].z, p[1].c, p[2].c);
+
+				//-----------------------------------------
+				Get_Node(x0, y1, p[2]); p[2].c	= Get_Color(p[2].c);
+				Draw_Line(p[0].x, p[0].y, p[0].z, p[2].x, p[2].y, p[2].z, p[0].c, p[2].c);
+				Draw_Line(p[1].x, p[1].y, p[1].z, p[2].x, p[2].y, p[2].z, p[1].c, p[2].c);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( !m_Parameters("DRAW_FACES")->asBool() && !m_Parameters("DRAW_EDGES")->asBool() )	// Nodes
+	{
+		int	Color	= m_Parameters("EDGE_COLOR")->asColor();
+
+		for(int y=0; y<m_pGrid->Get_NY(); y++)
+		{
+			for(int x=0; x<m_pGrid->Get_NX(); x++)
+			{
+				TSG_Triangle_Node	p;
+
+				Get_Node(x, y, p);
+
+				Draw_Point(p.x, p.y, p.z, Get_Color(p.c), 2);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Globe_Grid_Dialog : public CSG_3DView_Dialog
+{
+public:
+	C3D_Viewer_Globe_Grid_Dialog(CSG_Grid *pGrid, CSG_Grid *pZ);
+
+	virtual void				Update_Controls			(void);
+
+
+protected:
+
+	wxCheckBox					*m_pFaces, *m_pEdges;
+
+
+	virtual void				On_Update_Control		(wxCommandEvent &event);
+
+
+private:
+
+	DECLARE_EVENT_TABLE()
+
+};
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_Globe_Grid_Dialog, CSG_3DView_Dialog)
+	EVT_CHECKBOX	(wxID_ANY	, C3D_Viewer_Globe_Grid_Dialog::On_Update_Control)
+END_EVENT_TABLE()
+
+//---------------------------------------------------------
+C3D_Viewer_Globe_Grid_Dialog::C3D_Viewer_Globe_Grid_Dialog(CSG_Grid *pGrid, CSG_Grid *pZ)
+	: CSG_3DView_Dialog(_TL("Globe Viewer for Grids"))
+{
+	Create(new C3D_Viewer_Globe_Grid_Panel(this, pGrid, pZ));
+
+	Add_Spacer();
+	m_pFaces		= Add_CheckBox(_TL("Faces"), m_pPanel->m_Parameters("DRAW_FACES")->asBool());
+	m_pEdges		= Add_CheckBox(_TL("Edges"), m_pPanel->m_Parameters("DRAW_EDGES")->asBool());
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Globe_Grid_Dialog::On_Update_Control(wxCommandEvent &event)
+{
+	CHECKBOX_UPDATE(m_pFaces, "DRAW_FACES");
+	CHECKBOX_UPDATE(m_pEdges, "DRAW_EDGES");
+
+	CSG_3DView_Dialog::On_Update_Control(event);
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Globe_Grid_Dialog::Update_Controls(void)
+{
+	m_pFaces->SetValue(m_pPanel->m_Parameters("DRAW_FACES")->asBool());
+	m_pEdges->SetValue(m_pPanel->m_Parameters("DRAW_EDGES")->asBool());
+
+	CSG_3DView_Dialog::Update_Controls();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_Globe_Grid::C3D_Viewer_Globe_Grid(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Globe Viewer for Grids"));
+
+	Set_Author		("O. Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		""
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRID"	, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "Z"		, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Globe_Grid::On_Execute(void)
+{
+	C3D_Viewer_Globe_Grid_Dialog	dlg(
+		Parameters("GRID")->asGrid(),
+		Parameters("Z"   )->asGrid()
+	);
+
+	dlg.ShowModal();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_globe_grid.h b/src/modules/garden/garden_3d_viewer/3d_viewer_globe_grid.h
new file mode 100644
index 0000000..b5f85e2
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_globe_grid.h
@@ -0,0 +1,106 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_globe_grid.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 3d_viewer_globe_grid.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__3d_viewer_globe_grid_H
+#define HEADER_INCLUDED__3d_viewer_globe_grid_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Globe_Grid : public CSG_Module_Grid
+{
+public:
+	C3D_Viewer_Globe_Grid(void);
+
+	virtual bool			needs_GUI			(void)	{	return( true );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_viewer_globe_grid_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_multiple_grids.cpp b/src/modules/garden/garden_3d_viewer/3d_viewer_multiple_grids.cpp
new file mode 100644
index 0000000..64c0750
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_multiple_grids.cpp
@@ -0,0 +1,511 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_multiple_grids.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       3d_viewer                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              3d_viewer_multiple_grids.cpp             //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "3d_viewer_multiple_grids.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Multiple_Grids_Panel : public CSG_3DView_Panel
+{
+public:
+	C3D_Viewer_Multiple_Grids_Panel(wxWindow *pParent, CSG_Parameter_Grid_List *pGrids);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual void				Update_Statistics		(void);
+	virtual void				Update_Parent			(void);
+
+	virtual void				On_Key_Down				(wxKeyEvent   &event);
+
+	virtual bool				On_Before_Draw			(void);
+	virtual bool				On_Draw					(void);
+
+	virtual int					Get_Color				(double Value);
+
+
+private:
+
+	bool						m_Color_bGrad;
+
+	double						m_Color_Min, m_Color_Scale;
+
+	CSG_Colors					m_Colors;
+
+	CSG_Parameter_Grid_List		*m_pGrids;
+
+
+	bool						Get_Node				(CSG_Grid *pGrid, int x, int y, TSG_Triangle_Node &Node);
+
+	void						Draw_Grid				(CSG_Grid *pGrid);
+
+
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_Multiple_Grids_Panel, CSG_3DView_Panel)
+	EVT_KEY_DOWN	(C3D_Viewer_Multiple_Grids_Panel::On_Key_Down)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_Multiple_Grids_Panel::C3D_Viewer_Multiple_Grids_Panel(wxWindow *pParent, CSG_Parameter_Grid_List *pGrids)
+	: CSG_3DView_Panel(pParent)
+{
+	m_pGrids	= pGrids;
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode, *pNode_1;
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters("NODE_GENERAL");
+
+	m_Parameters.Add_Value(
+		pNode	, "Z_SCALE"			, _TL("Exaggeration"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_VIEW"		, _TL("Grid View Settings"),
+		_TL("")
+	);
+
+	pNode_1	= m_Parameters.Add_Colors(
+		pNode	, "COLORS"			, _TL("Colours"),
+		_TL("")
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "COLORS_GRAD"		, _TL("Graduated"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	pNode_1	= m_Parameters.Add_Choice(
+		pNode	, "SHADING"			, _TL("Shading"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("none"),
+			_TL("shading")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SHADE_DEC"		, _TL("Light Source Height"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, -90.0, true, 90.0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SHADE_AZI"		, _TL("Light Source Direction"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 315.0, 0.0, true, 360.0, true
+	);
+
+	//-----------------------------------------------------
+	Update_Statistics();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_Multiple_Grids_Panel::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHADING") )
+	{
+		pParameters->Get_Parameter("SHADE_DEC")->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("SHADE_AZI")->Set_Enabled(pParameter->asBool());
+	}
+
+	return( CSG_3DView_Panel::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Multiple_Grids_Panel::Update_Statistics(void)
+{
+	m_Data_Min.x	= m_pGrids->asGrid(0)->Get_Extent().Get_XMin();
+	m_Data_Max.x	= m_pGrids->asGrid(0)->Get_Extent().Get_XMax();
+
+	m_Data_Min.y	= m_pGrids->asGrid(0)->Get_Extent().Get_YMin();
+	m_Data_Max.y	= m_pGrids->asGrid(0)->Get_Extent().Get_YMax();
+
+	m_Data_Min.z	= m_pGrids->asGrid(0)->Get_ZMin();
+	m_Data_Max.z	= m_pGrids->asGrid(0)->Get_ZMax();
+
+	for(int i=1; i<m_pGrids->Get_Count(); i++)
+	{
+		CSG_Grid	*pGrid	= m_pGrids->asGrid(i);
+
+		if( m_Data_Min.x > pGrid->Get_Extent().Get_XMin() )
+			m_Data_Min.x = pGrid->Get_Extent().Get_XMin();	else
+		if( m_Data_Max.x < pGrid->Get_Extent().Get_XMax() )
+			m_Data_Max.x = pGrid->Get_Extent().Get_XMax();
+
+		if( m_Data_Min.y > pGrid->Get_Extent().Get_YMin() )
+			m_Data_Min.y = pGrid->Get_Extent().Get_YMin();	else
+		if( m_Data_Max.y < pGrid->Get_Extent().Get_YMax() )
+			m_Data_Max.y = pGrid->Get_Extent().Get_YMax();
+
+		if( m_Data_Min.z > pGrid->Get_ZMin() )
+			m_Data_Min.z = pGrid->Get_ZMin();	else
+		if( m_Data_Max.z < pGrid->Get_ZMax() )
+			m_Data_Max.z = pGrid->Get_ZMax();
+	}
+
+	//-----------------------------------------------------
+	Update_View();
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Multiple_Grids_Panel::Update_Parent(void)
+{
+	((CSG_3DView_Dialog *)GetParent())->Update_Controls();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Multiple_Grids_Panel::On_Key_Down(wxKeyEvent &event)
+{
+	switch( event.GetKeyCode() )
+	{
+	default:	CSG_3DView_Panel::On_Key_Down(event);	return;
+
+	case WXK_F1:	m_Parameters("Z_SCALE")->Set_Value(m_Parameters("Z_SCALE")->asDouble() -  0.5);	break;
+	case WXK_F2:	m_Parameters("Z_SCALE")->Set_Value(m_Parameters("Z_SCALE")->asDouble() +  0.5);	break;
+	}
+
+	//-----------------------------------------------------
+	Update_View();
+	Update_Parent();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Multiple_Grids_Panel::On_Before_Draw(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Projector.Set_zScaling(m_Projector.Get_xScaling() * m_Parameters("Z_SCALE")->asDouble());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_Multiple_Grids_Panel::Get_Color(double Value)
+{
+	if( m_Color_Scale <= 0.0 )
+	{
+		return( (int)Value );
+	}
+
+	double	c	= m_Color_Scale * (Value - m_Color_Min);
+
+	return( m_Color_bGrad ? m_Colors.Get_Interpolated(c) : m_Colors[(int)c] );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Multiple_Grids_Panel::On_Draw(void)
+{
+	//-------------------------------------------------
+	for(int i=0; i<m_pGrids->Get_Count(); i++)
+	{
+		Draw_Grid(m_pGrids->asGrid(i));
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline bool C3D_Viewer_Multiple_Grids_Panel::Get_Node(CSG_Grid *pGrid, int x, int y, TSG_Triangle_Node &Node)
+{
+	if( pGrid->is_InGrid(x, y) )
+	{
+		TSG_Point_Z	p;
+
+		p.x	= pGrid->Get_System().Get_xGrid_to_World(x);
+		p.y	= pGrid->Get_System().Get_yGrid_to_World(y);
+		p.z	= Node.c = pGrid->asDouble(x, y);
+
+		m_Projector.Get_Projection(p);
+
+		Node.x	= p.x;
+		Node.y	= p.y;
+		Node.z	= p.z;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Multiple_Grids_Panel::Draw_Grid(CSG_Grid *pGrid)
+{
+	//-----------------------------------------------------
+	if( !SG_UI_DataObject_Colors_Get(pGrid, &m_Colors) )
+	{
+		m_Colors	= *m_Parameters("COLORS")->asColors();
+	}
+
+	m_Color_bGrad	= m_Parameters("COLORS_GRAD")->asBool();
+
+	m_Color_Min		= pGrid->Get_ZMin();
+	m_Color_Scale	= pGrid->Get_ZRange() > 0.0 ? m_Colors.Get_Count() / pGrid->Get_ZRange() : 0.0;
+
+	//-----------------------------------------------------
+	int		Shading		= m_Parameters("SHADING"  )->asInt   ();
+	double	Shade_Dec	= m_Parameters("SHADE_DEC")->asDouble() * -M_DEG_TO_RAD;
+	double	Shade_Azi	= m_Parameters("SHADE_AZI")->asDouble() *  M_DEG_TO_RAD;
+
+	//-----------------------------------------------------
+	#pragma omp parallel for
+	for(int y=1; y<pGrid->Get_NY(); y++)
+	{
+		for(int x=1; x<pGrid->Get_NX(); x++)
+		{
+			TSG_Triangle_Node	a, b, p[3];
+
+			if( Get_Node(pGrid, x - 1, y - 1, a)
+			&&  Get_Node(pGrid, x    , y    , b) )
+			{
+				if( Get_Node(pGrid, x    , y - 1, p[2]) )
+				{
+					p[0]	= a;
+					p[1]	= b;
+
+					if( Shading ) Draw_Triangle(p, Shade_Dec, Shade_Azi); else Draw_Triangle(p);
+				}
+
+				if( Get_Node(pGrid, x - 1, y    , p[2]) )
+				{
+					p[0]	= a;
+					p[1]	= b;
+
+					if( Shading ) Draw_Triangle(p, Shade_Dec, Shade_Azi); else Draw_Triangle(p);
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Multiple_Grids_Dialog : public CSG_3DView_Dialog
+{
+public:
+	C3D_Viewer_Multiple_Grids_Dialog(CSG_Parameter_Grid_List *pGrids)
+		: CSG_3DView_Dialog(_TL("Multiple Grids Viewer"))
+	{
+		Create(new C3D_Viewer_Multiple_Grids_Panel(this, pGrids));
+	}
+
+
+protected:
+
+	virtual void				Set_Menu				(wxMenu &Menu);
+	virtual void				On_Menu					(wxCommandEvent &event);
+
+};
+
+//---------------------------------------------------------
+enum
+{
+	MENU_SCALE_Z_DEC	= MENU_USER_FIRST,
+	MENU_SCALE_Z_INC
+};
+
+//---------------------------------------------------------
+void C3D_Viewer_Multiple_Grids_Dialog::Set_Menu(wxMenu &Menu)
+{
+	wxMenu	*pMenu	= Menu.FindChildItem(Menu.FindItem(_TL("Display")))->GetSubMenu();
+
+	pMenu->AppendSeparator();
+	pMenu->Append(MENU_SCALE_Z_DEC, _TL("Decrease Exaggeration [F1]"));
+	pMenu->Append(MENU_SCALE_Z_INC, _TL("Increase Exaggeration [F2]"));
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Multiple_Grids_Dialog::On_Menu(wxCommandEvent &event)
+{
+	switch( event.GetId() )
+	{
+	case MENU_SCALE_Z_DEC:	m_pPanel->m_Parameters("Z_SCALE")->Set_Value(m_pPanel->m_Parameters("Z_SCALE")->asDouble() - 0.5); m_pPanel->Update_View();	return;
+	case MENU_SCALE_Z_INC:	m_pPanel->m_Parameters("Z_SCALE")->Set_Value(m_pPanel->m_Parameters("Z_SCALE")->asDouble() + 0.5); m_pPanel->Update_View();	return;
+	}
+
+	CSG_3DView_Dialog::On_Menu(event);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_Multiple_Grids::C3D_Viewer_Multiple_Grids(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Multiple Grids Viewer"));
+
+	Set_Author		("O. Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		""
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"	, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+}
+
+//---------------------------------------------------------
+bool C3D_Viewer_Multiple_Grids::On_Execute(void)
+{
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
+
+	if( pGrids->Get_Count() <= 0 )
+	{
+		Message_Add(_TL("invalid input"));
+
+		return( false );
+	}
+
+	C3D_Viewer_Multiple_Grids_Dialog	dlg(pGrids);
+
+	dlg.ShowModal();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_multiple_grids.h b/src/modules/garden/garden_3d_viewer/3d_viewer_multiple_grids.h
new file mode 100644
index 0000000..6cf8f5c
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_multiple_grids.h
@@ -0,0 +1,106 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_multiple_grids.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              3d_viewer_multiple_grids.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__3d_viewer_multiple_grids_H
+#define HEADER_INCLUDED__3d_viewer_multiple_grids_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Multiple_Grids : public CSG_Module  
+{
+public:
+	C3D_Viewer_Multiple_Grids(void);
+
+	virtual bool			needs_GUI			(void)	{	return( true );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_viewer_multiple_grids_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_pointcloud.cpp b/src/modules/garden/garden_3d_viewer/3d_viewer_pointcloud.cpp
new file mode 100644
index 0000000..37ba705
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_pointcloud.cpp
@@ -0,0 +1,956 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_pointcloud.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       3d_viewer                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                3d_viewer_pointcloud.cpp               //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/dcclient.h>
+
+#include "3d_viewer_pointcloud.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_PointCloud_Panel : public CSG_3DView_Panel
+{
+public:
+	C3D_Viewer_PointCloud_Panel(wxWindow *pParent, CSG_PointCloud *pPoints, int Field_Color);
+
+	void						Set_Extent				(CSG_Rect Extent);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual void				Update_Statistics		(void);
+	virtual void				Update_Parent			(void);
+
+	virtual void				On_Key_Down				(wxKeyEvent   &event);
+
+	virtual bool				On_Before_Draw			(void);
+	virtual bool				On_Draw					(void);
+
+	virtual int					Get_Color				(double Value, double z);
+
+
+private:
+
+	bool						m_Color_bGrad;
+
+	double						m_Color_Min, m_Color_Scale, m_Color_Dim_Min, m_Color_Dim_Max;
+
+	CSG_Array					m_Selection;
+
+	CSG_Colors					m_Colors;
+
+	CSG_Rect					m_Extent;
+
+	CSG_PointCloud				*m_pPoints;
+
+
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_PointCloud_Panel, CSG_3DView_Panel)
+	EVT_KEY_DOWN	(C3D_Viewer_PointCloud_Panel::On_Key_Down)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_PointCloud_Panel::C3D_Viewer_PointCloud_Panel(wxWindow *pParent, CSG_PointCloud *pPoints, int cField)
+	: CSG_3DView_Panel(pParent)
+{
+	m_pPoints	= pPoints;
+
+	//-----------------------------------------------------
+	CSG_String	Attributes;
+
+	for(int i=0; i<m_pPoints->Get_Field_Count(); i++)
+	{
+		Attributes	+= m_pPoints->Get_Field_Name(i);
+		Attributes	+= "|";
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode, *pNode_1;
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters("NODE_GENERAL");
+
+	m_Parameters.Add_Value(
+		pNode	, "Z_SCALE"			, _TL("Exaggeration"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_VIEW"		, _TL("Point View Settings"),
+		_TL("")
+	);
+
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "DETAIL"			, _TL("Level of Detail"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 100.0, 0.0, true, 100.0, true
+	);
+
+	pNode_1	= m_Parameters.Add_Choice(
+		pNode	, "COLORS_ATTR"		, _TL("Colour Attribute"),
+		_TL(""),
+		Attributes, cField
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "VAL_AS_RGB"		, _TL("RGB Values"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Colors(
+		pNode_1	, "COLORS"			, _TL("Colours"),
+		_TL("")
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "COLORS_GRAD"		, _TL("Graduated"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Range(
+		pNode_1	, "COLORS_RANGE"	, _TL("Value Range"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "DIM"				, _TL("Dim"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Range(
+		pNode_1	, "DIM_RANGE"		, _TL("Distance Range"),
+		_TL(""),
+		0.0, 1.0, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	m_Parameters.Add_Value(
+		pNode	, "SIZE"			, _TL("Size"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 2, 1, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "SIZE_SCALE"		, _TL("Size Scaling"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 250.0, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	m_Extent	= pPoints->Get_Extent();
+
+	m_Selection.Create(sizeof(int), 0, SG_ARRAY_GROWTH_2);
+
+	Update_Statistics();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_PointCloud_Panel::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "VAL_AS_RGB") )
+	{
+		pParameters->Get_Parameter("COLORS"      )->Set_Enabled(pParameter->asBool() == false);
+		pParameters->Get_Parameter("COLORS_RANGE")->Set_Enabled(pParameter->asBool() == false);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DIM") )
+	{
+		pParameters->Get_Parameter("DIM_RANGE")->Set_Enabled(pParameter->asBool());
+	}
+
+	return( CSG_3DView_Panel::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Panel::Set_Extent(CSG_Rect Extent)
+{
+	if( Extent.Get_XRange() == 0.0 || Extent.Get_YRange() == 0.0 )
+	{
+		Extent	= m_pPoints->Get_Extent();
+	}
+
+	if( Extent.is_Equal(m_Extent) == false )
+	{
+		m_Extent	= Extent;
+			
+		Update_View(true);
+	}
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Panel::Update_Statistics(void)
+{
+	m_Data_Min.x	= m_Extent.Get_XMin();
+	m_Data_Max.x	= m_Extent.Get_XMax();
+
+	m_Data_Min.y	= m_Extent.Get_YMin();
+	m_Data_Max.y	= m_Extent.Get_YMax();
+
+	m_Selection.Set_Array(0);
+
+	if( m_Extent.is_Equal(m_pPoints->Get_Extent()) )
+	{
+		int	cField	= m_Parameters("COLORS_ATTR")->asInt();
+
+		m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+			m_pPoints->Get_Mean(cField) - 1.5 * m_pPoints->Get_StdDev(cField),
+			m_pPoints->Get_Mean(cField) + 1.5 * m_pPoints->Get_StdDev(cField)
+		);
+
+		m_Data_Min.z	= m_pPoints->Get_Minimum(2);	// Get_ZMin();	ToDo in CSG_PointCloud class!!!
+		m_Data_Max.z	= m_pPoints->Get_Maximum(2);	// Get_ZMax();	ToDo in CSG_PointCloud class!!!
+	}
+	else
+	{
+		CSG_Simple_Statistics	cStats, zStats;
+
+		int	cField	= m_Parameters("COLORS_ATTR")->asInt();
+
+		for(int i=0; i<m_pPoints->Get_Count(); i++)
+		{
+			m_pPoints->Set_Cursor(i);
+
+			if( m_Extent.Contains(m_pPoints->Get_X(), m_pPoints->Get_Y()) && m_Selection.Inc_Array() )
+			{
+				*((int *)m_Selection.Get_Entry(m_Selection.Get_Size() - 1))	= i;
+
+				cStats	+= m_pPoints->Get_Value(cField);
+				zStats	+= m_pPoints->Get_Z();
+			}
+		}
+
+		m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+			cStats.Get_Mean() - 1.5 * cStats.Get_StdDev(),
+			cStats.Get_Mean() + 1.5 * cStats.Get_StdDev()
+		);
+
+		m_Data_Min.z	= zStats.Get_Minimum();
+		m_Data_Max.z	= zStats.Get_Maximum();
+	}
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Panel::Update_Parent(void)
+{
+	((CSG_3DView_Dialog *)GetParent())->Update_Controls();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Panel::On_Key_Down(wxKeyEvent &event)
+{
+	switch( event.GetKeyCode() )
+	{
+	default:	CSG_3DView_Panel::On_Key_Down(event);	return;
+
+	case WXK_F1:	m_Parameters("Z_SCALE"   )->Set_Value(m_Parameters("Z_SCALE"   )->asDouble() -  0.5);	break;
+	case WXK_F2:	m_Parameters("Z_SCALE"   )->Set_Value(m_Parameters("Z_SCALE"   )->asDouble() +  0.5);	break;
+
+	case WXK_F5:	m_Parameters("SIZE"      )->Set_Value(m_Parameters("SIZE"      )->asDouble() -  1.0);	break;
+	case WXK_F6:	m_Parameters("SIZE"      )->Set_Value(m_Parameters("SIZE"      )->asDouble() +  1.0);	break;
+
+	case WXK_F7:	m_Parameters("SIZE_SCALE")->Set_Value(m_Parameters("SIZE_SCALE")->asDouble() - 10.0);	break;
+	case WXK_F8:	m_Parameters("SIZE_SCALE")->Set_Value(m_Parameters("SIZE_SCALE")->asDouble() + 10.0);	break;
+	}
+
+	//-----------------------------------------------------
+	Update_View();
+	Update_Parent();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_PointCloud_Panel::On_Before_Draw(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Projector.Set_zScaling(m_Projector.Get_xScaling() * m_Parameters("Z_SCALE")->asDouble());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_PointCloud_Panel::Get_Color(double Value, double z)
+{
+	int	Color;
+
+	if( m_Color_Scale <= 0.0 )
+	{
+		Color	= (int)Value;
+	}
+	else
+	{
+		double	c	= m_Color_Scale * (Value - m_Color_Min);
+
+		Color	= m_Color_bGrad ? m_Colors.Get_Interpolated(c) : m_Colors[(int)c];
+	}
+
+	//-----------------------------------------------------
+	if( m_Color_Dim_Min < m_Color_Dim_Max )
+	{
+		double	dim	= 1.0 - (z - m_Color_Dim_Min) / (m_Color_Dim_Max - m_Color_Dim_Min);
+
+		if( dim < 1.0 )
+		{
+			Color	= Dim_Color(Color, dim < 0.1 ? 0.1 : dim);
+		}
+	}
+
+	return( Color );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_PointCloud_Panel::On_Draw(void)
+{
+	//-----------------------------------------------------
+	int		cField	= m_Parameters("COLORS_ATTR")->asInt();
+
+	if( m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal()
+	>=  m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() )
+	{
+		m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+			m_pPoints->Get_Mean(cField) - 1.5 * m_pPoints->Get_StdDev(cField),
+			m_pPoints->Get_Mean(cField) + 1.5 * m_pPoints->Get_StdDev(cField)
+		);
+	}
+
+	m_Colors		= *m_Parameters("COLORS")->asColors();
+	m_Color_bGrad	= m_Parameters("COLORS_GRAD")->asBool();
+	m_Color_Min		= m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal();
+	m_Color_Scale	= m_Parameters("VAL_AS_RGB")->asBool() ? 0.0 :
+		m_Colors.Get_Count() / (m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() - m_Color_Min);
+
+	if( m_Parameters("DIM")->asBool() )
+	{
+		m_Color_Dim_Min	= m_Parameters("DIM_RANGE")->asRange()->Get_LoVal() * (m_Data_Max.z - m_Data_Min.z);
+		m_Color_Dim_Max	= m_Parameters("DIM_RANGE")->asRange()->Get_HiVal() * (m_Data_Max.z - m_Data_Min.z);
+	}
+	else
+	{
+		m_Color_Dim_Min	= m_Color_Dim_Max	= 0.0;
+	}
+
+	//-----------------------------------------------------
+	int		Size	= m_Parameters("SIZE"      )->asInt   ();
+	double	dSize	= m_Parameters("SIZE_SCALE")->asDouble();
+	
+	if( dSize > 0.0 )	dSize = 1.0 / dSize; else dSize = 0.0;
+
+	//-----------------------------------------------------
+	int		nSkip	= 1 + (int)(0.001 * m_pPoints->Get_Count() * SG_Get_Square(1.0 - 0.01 * m_Parameters("DETAIL")->asDouble()));
+
+	//-----------------------------------------------------
+	int	nPoints	= m_Selection.Get_Size() > 0 ? (int)m_Selection.Get_Size() : m_pPoints->Get_Count();
+
+	#pragma omp parallel for
+	for(int iPoint=0; iPoint<nPoints; iPoint+=nSkip)
+	{
+		int	jPoint	= m_Selection.Get_Size() > 0 ? *((int *)m_Selection.Get_Entry(iPoint)) : iPoint;
+
+		TSG_Point_Z	p	= m_pPoints->Get_Point(jPoint);
+
+		m_Projector.Get_Projection(p);
+
+		Draw_Point(p.x, p.y, p.z,
+			Get_Color(m_pPoints->Get_Value(jPoint, cField), p.z),
+			Size + (dSize <= 0.0 ? 0 : (int)(20.0 * exp(-dSize * p.z)))
+		);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPointCloud_Overview : public wxDialog
+{
+public:
+	CPointCloud_Overview(void)	{}
+
+	void						Create			(wxWindow *pParent, CSG_PointCloud *pPoints, C3D_Viewer_PointCloud_Panel *pPanel)
+	{
+		m_pPanel	= pPanel;
+
+		wxDialog::Create(pParent, wxID_ANY, _TL("Overview"), wxDefaultPosition, wxDefaultSize,
+			wxCAPTION|wxCLOSE_BOX|wxSTAY_ON_TOP
+		);
+
+		//-------------------------------------------------
+		m_Ratio	= pPoints->Get_Extent().Get_XRange() / pPoints->Get_Extent().Get_YRange();
+
+		m_Count.Create(CSG_Grid_System(m_Ratio > 1.0
+			? pPoints->Get_Extent().Get_XRange() / 100.0
+			: pPoints->Get_Extent().Get_YRange() / 100.0,
+			pPoints->Get_Extent()), SG_DATATYPE_Int
+		);
+
+		for(int i=0, x, y; i<pPoints->Get_Count(); i++)
+		{
+			if( m_Count.Get_System().Get_World_to_Grid(x, y, pPoints->Get_X(i), pPoints->Get_Y(i)) ) // && m_Count.is_InGrid(x, y, false) )
+			{
+				m_Count.Add_Value(x, y, 1);
+			}
+		}
+
+		int	Size	= GetClientSize().GetWidth();
+
+		if( m_Ratio > 1.0 )
+			Set_Size(Size, (int)(Size / m_Ratio), false);
+		else
+			Set_Size((int)(Size * m_Ratio), Size, false);
+	}
+
+
+private:
+
+	double						m_Ratio;
+
+	wxPoint						m_Mouse_Down, m_Mouse_Move;
+
+	CSG_Rect					m_Selection;
+
+	wxImage						m_Image;
+
+	CSG_Grid					m_Count;
+
+	C3D_Viewer_PointCloud_Panel	*m_pPanel;
+
+
+	//---------------------------------------------------------
+	void						On_Mouse_LDown	(wxMouseEvent &event)
+	{
+		m_Mouse_Down	= m_Mouse_Move	= event.GetPosition();
+
+		Draw_Inverse(m_Mouse_Down, m_Mouse_Move);
+
+		CaptureMouse();
+	}
+
+	//---------------------------------------------------------
+	void						On_Mouse_Motion	(wxMouseEvent &event)
+	{
+		if( HasCapture() && event.Dragging() && event.LeftIsDown() )
+		{
+			Draw_Inverse(m_Mouse_Down, m_Mouse_Move);
+			Draw_Inverse(m_Mouse_Down, event.GetPosition());
+		}
+
+		m_Mouse_Move	= event.GetPosition();
+	}
+
+	//---------------------------------------------------------
+	void						On_Mouse_LUp	(wxMouseEvent &event)
+	{
+		if( HasCapture() )
+		{
+			ReleaseMouse();
+		}
+
+		if( m_Mouse_Down.x != event.GetX() && m_Mouse_Down.y != event.GetY() )
+		{
+			double	dx	=  m_Count.Get_XRange() / GetClientSize().GetWidth ();
+			double	dy	= -m_Count.Get_YRange() / GetClientSize().GetHeight();
+
+			m_Selection.Assign(
+				m_Count.Get_XMin() + dx * m_Mouse_Down.x,
+				m_Count.Get_YMax() + dy * m_Mouse_Down.y,
+				m_Count.Get_XMin() + dx * event.GetX(),
+				m_Count.Get_YMax() + dy * event.GetY()
+			);
+
+			m_pPanel->Set_Extent(m_Selection);
+		}
+
+		Refresh(false);
+	}
+
+	//---------------------------------------------------------
+	void						On_Mouse_RDown	(wxMouseEvent &event)
+	{
+		m_Selection.Assign(0.0, 0.0, 0.0, 0.0);
+
+		m_pPanel->Set_Extent(m_Selection);
+
+		Refresh(false);
+	}
+
+	//---------------------------------------------------------
+	void						On_Key_Down		(wxKeyEvent   &event)
+	{
+		switch( event.GetKeyCode() )
+		{
+		case WXK_PAGEUP:
+			Set_Size(GetClientSize().GetWidth() * 1.25, GetClientSize().GetHeight() * 1.25, true);
+			break;
+
+		case WXK_PAGEDOWN:
+			Set_Size(GetClientSize().GetWidth() / 1.25, GetClientSize().GetHeight() / 1.25, true);
+			break;
+		}
+	}
+
+	//---------------------------------------------------------
+	void						On_Close		(wxCloseEvent &event)
+	{
+		Hide();	((CSG_3DView_Dialog *)GetParent())->Update_Controls();
+	}
+
+	//---------------------------------------------------------
+	void						On_Paint		(wxPaintEvent &WXUNUSED(event))
+	{
+		wxPaintDC	dc(this);
+
+		if( m_Image.IsOk() )
+		{
+			dc.DrawBitmap(wxBitmap(m_Image), GetClientRect().GetTopLeft());
+		}
+
+		if( m_Selection.Get_XRange() > 0.0 && m_Selection.Get_YRange() > 0.0 )
+		{
+			dc.SetPen(wxPen(*wxRED));
+
+			double	dx	=  GetClientSize().GetWidth () / m_Count.Get_XRange();
+			double	dy	= -GetClientSize().GetHeight() / m_Count.Get_YRange();
+
+			int	ax	= dx * (m_Selection.Get_XMin() - m_Count.Get_XMin());
+			int	ay	= dy * (m_Selection.Get_YMin() - m_Count.Get_YMin()) + GetClientSize().GetHeight();
+			int	bx	= dx * (m_Selection.Get_XMax() - m_Count.Get_XMin());
+			int	by	= dy * (m_Selection.Get_YMax() - m_Count.Get_YMin()) + GetClientSize().GetHeight();
+
+			Draw_Inverse(wxPoint(ax, ay), wxPoint(bx, by));
+
+			dc.DrawLine(ax, ay, ax, by);
+			dc.DrawLine(ax, by, bx, by);
+			dc.DrawLine(bx, by, bx, ay);
+			dc.DrawLine(bx, ay, ax, ay);
+		}
+	}
+
+	//---------------------------------------------------------
+	void						Draw_Inverse	(wxPoint A, wxPoint B)
+	{
+		wxClientDC	dc(this);
+		dc.SetLogicalFunction(wxINVERT);
+		dc.DrawRectangle(A.x, A.y, B.x - A.x, B.y - A.y);
+	}
+
+	//---------------------------------------------------------
+	void						Set_Size		(int Width, int Height, bool bRefresh)
+	{
+		if( Width < 100 || Height < 100 || Width > 1000 || Height > 1000 )
+		{
+			return;
+		}
+
+		SetClientSize(Width, Height);
+
+		if( !m_Image.IsOk() || m_Image.GetWidth() != Width )
+		{
+			CSG_Colors	Colors(7, SG_COLORS_RAINBOW);
+			Colors.Set_Color(0, m_pPanel->m_Parameters("BGCOLOR")->asColor());
+			Colors.Set_Count(100);
+
+			double	dCount	= (Colors.Get_Count() - 2.0) / log(1.0 + m_Count.Get_ZMax());
+			double	dx		= m_Count.Get_XRange() / (double)Width ;
+			double	dy		= m_Count.Get_YRange() / (double)Height;
+
+			m_Image.Create(Width, Height, false);
+
+			#pragma omp parallel for
+			for(int y=0; y<m_Image.GetHeight(); y++)
+			{
+				double	Count, ix = m_Count.Get_XMin(), iy = m_Count.Get_YMax() - y * dy;
+
+				for(int x=0; x<m_Image.GetWidth(); x++, ix+=dx)
+				{
+					int	i	= m_Count.Get_Value(ix, iy, Count) && Count > 0.0 ? (int)(log(1.0 + Count) * dCount) : 0;
+
+					m_Image.SetRGB(x, y, Colors.Get_Red(i), Colors.Get_Green(i), Colors.Get_Blue(i));
+				}
+			}
+		}
+
+		if( bRefresh )
+		{
+			Refresh(false);
+		}
+	}
+
+
+	DECLARE_EVENT_TABLE()
+
+};
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(CPointCloud_Overview, wxDialog)
+	EVT_LEFT_DOWN	(CPointCloud_Overview::On_Mouse_LDown)
+	EVT_LEFT_UP		(CPointCloud_Overview::On_Mouse_LUp)
+	EVT_RIGHT_DOWN	(CPointCloud_Overview::On_Mouse_RDown)
+	EVT_MOTION		(CPointCloud_Overview::On_Mouse_Motion)
+	EVT_KEY_DOWN	(CPointCloud_Overview::On_Key_Down)
+	EVT_CLOSE		(CPointCloud_Overview::On_Close)
+	EVT_PAINT		(CPointCloud_Overview::On_Paint)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_PointCloud_Dialog : public CSG_3DView_Dialog
+{
+public:
+	C3D_Viewer_PointCloud_Dialog(CSG_PointCloud *pPoints, int Field_Color)
+		: CSG_3DView_Dialog(_TL("Point Cloud Viewer"))
+	{
+		Create(new C3D_Viewer_PointCloud_Panel(this, pPoints, Field_Color));
+
+		wxArrayString	Attributes;
+
+		for(int i=0; i<pPoints->Get_Field_Count(); i++)
+		{
+			Attributes.Add(pPoints->Get_Field_Name(i));
+		}
+
+		Add_Spacer();
+		m_pField_C	= Add_Choice  (_TL("Colour"  ), Attributes, Field_Color);
+
+		Add_Spacer();
+		m_pOverview	= Add_CheckBox(_TL("Overview"), false);
+
+		m_Overview.Create(this, pPoints, (C3D_Viewer_PointCloud_Panel *)m_pPanel);
+	}
+
+	virtual void				Update_Controls			(void);
+
+
+protected:
+
+	wxChoice					*m_pField_C;
+
+	wxCheckBox					*m_pOverview;
+
+	CPointCloud_Overview		m_Overview;
+
+
+	virtual void				On_Update_Choices		(wxCommandEvent &event);
+	virtual void				On_Update_Control		(wxCommandEvent &event);
+
+	virtual void				Set_Menu				(wxMenu &Menu);
+	virtual void				On_Menu					(wxCommandEvent &event);
+	virtual void				On_Menu_UI				(wxUpdateUIEvent &event);
+
+
+private:
+
+	DECLARE_EVENT_TABLE()
+
+};
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_PointCloud_Dialog, CSG_3DView_Dialog)
+	EVT_CHECKBOX	(wxID_ANY, C3D_Viewer_PointCloud_Dialog::On_Update_Control)
+	EVT_CHOICE		(wxID_ANY, C3D_Viewer_PointCloud_Dialog::On_Update_Choices)
+END_EVENT_TABLE()
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Dialog::On_Update_Choices(wxCommandEvent &event)
+{
+	if( event.GetEventObject() == m_pField_C )
+	{
+		m_pPanel->m_Parameters("COLORS_ATTR")->Set_Value(m_pField_C->GetSelection());
+		m_pPanel->Update_View(true);
+		return;
+	}
+
+	CSG_3DView_Dialog::On_Update_Choices(event);
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Dialog::On_Update_Control(wxCommandEvent &event)
+{
+	if( event.GetEventObject() == m_pOverview )
+	{
+#ifdef _SAGA_MSW
+		m_Overview.Show(m_pOverview->GetValue() == 1 ? true : false);	// unluckily this does not work with linux (broken event handler chain, non-modal dialog as subprocess of a modal one!!)
+#else
+		m_Overview.ShowModal();
+#endif
+	}
+
+	CSG_3DView_Dialog::On_Update_Control(event);
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Dialog::Update_Controls(void)
+{
+	m_pField_C->SetSelection(m_pPanel->m_Parameters("COLORS_ATTR")->asInt());
+
+	m_pOverview->SetValue(m_Overview.IsShown());
+
+	CSG_3DView_Dialog::Update_Controls();
+}
+
+//---------------------------------------------------------
+enum
+{
+	MENU_SCALE_Z_DEC	= MENU_USER_FIRST,
+	MENU_SCALE_Z_INC,
+	MENU_VAL_AS_RGB,
+	MENU_COLORS_GRAD,
+	MENU_SIZE_DEC,
+	MENU_SIZE_INC,
+	MENU_SIZE_SCALE_DEC,
+	MENU_SIZE_SCALE_INC
+};
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Dialog::Set_Menu(wxMenu &Menu)
+{
+	wxMenu	*pMenu	= Menu.FindChildItem(Menu.FindItem(_TL("Display")))->GetSubMenu();
+
+	pMenu->AppendSeparator();
+	pMenu->Append         (MENU_SCALE_Z_DEC   , _TL("Decrease Exaggeration [F1]"));
+	pMenu->Append         (MENU_SCALE_Z_INC   , _TL("Increase Exaggeration [F2]"));
+
+	pMenu->AppendSeparator();
+	pMenu->Append         (MENU_SIZE_DEC      , _TL("Decrease Size [F5]"));
+	pMenu->Append         (MENU_SIZE_INC      , _TL("Increase Size [F6]"));
+
+	pMenu->AppendSeparator();
+	pMenu->Append         (MENU_SIZE_SCALE_DEC, _TL("Decrease Size Scaling Factor [F7]"));
+	pMenu->Append         (MENU_SIZE_SCALE_INC, _TL("Increase Size Scaling Factor [F8]"));
+
+	pMenu->AppendSeparator();
+	pMenu->AppendCheckItem(MENU_VAL_AS_RGB    , _TL("Value as RGB"));
+	pMenu->AppendCheckItem(MENU_COLORS_GRAD   , _TL("Graduated Colours"));
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Dialog::On_Menu(wxCommandEvent &event)
+{
+	switch( event.GetId() )
+	{
+	default:	CSG_3DView_Dialog::On_Menu(event);	return;
+
+	case MENU_SCALE_Z_DEC   :	MENU_VALUE_ADD("Z_SCALE"   ,  -0.5);	return;
+	case MENU_SCALE_Z_INC   :	MENU_VALUE_ADD("Z_SCALE"   ,   0.5);	return;
+
+	case MENU_SIZE_DEC      :	MENU_VALUE_ADD("SIZE"      ,  -1.0);	return;
+	case MENU_SIZE_INC      :	MENU_VALUE_ADD("SIZE"      ,   1.0);	return;
+
+	case MENU_SIZE_SCALE_DEC:	MENU_VALUE_ADD("SIZE_SCALE", -10.0);	return;
+	case MENU_SIZE_SCALE_INC:	MENU_VALUE_ADD("SIZE_SCALE",  10.0);	return;
+
+	case MENU_VAL_AS_RGB    :	MENU_TOGGLE("VAL_AS_RGB" );	return;
+	case MENU_COLORS_GRAD   :	MENU_TOGGLE("COLORS_GRAD");	return;
+	}
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_PointCloud_Dialog::On_Menu_UI(wxUpdateUIEvent &event)
+{
+	switch( event.GetId() )
+	{
+	default:	CSG_3DView_Dialog::On_Menu_UI(event);	break;
+
+	case MENU_VAL_AS_RGB :	event.Check(m_pPanel->m_Parameters("VAL_AS_RGB" )->asBool());	break;
+	case MENU_COLORS_GRAD:	event.Check(m_pPanel->m_Parameters("COLORS_GRAD")->asBool());	break;
+	}
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_PointCloud::C3D_Viewer_PointCloud(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Point Cloud Viewer"));
+
+	Set_Author		("O. Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"3D viewer for point clouds."
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode	= Parameters.Add_PointCloud(
+		NULL	, "POINTS"	, _TL("Point Cloud"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "COLOR"	, _TL("Color"),
+		_TL("")
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_PointCloud::On_Execute(void)
+{
+	if( !SG_UI_Get_Window_Main() )
+	{
+		Message_Add(_TL("point cloud viewer can only be run from graphical user interface"));
+
+		return( false );
+	}
+
+	CSG_PointCloud	*pPoints	= Parameters("POINTS")->asPointCloud();
+
+	if( pPoints->Get_Count() <= 0 )
+	{
+		Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points"));
+
+		return( false );
+	}
+
+	C3D_Viewer_PointCloud_Dialog	dlg(pPoints, Parameters("COLOR")->asInt());
+
+	dlg.ShowModal();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_pointcloud.h b/src/modules/garden/garden_3d_viewer/3d_viewer_pointcloud.h
new file mode 100644
index 0000000..8351679
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_pointcloud.h
@@ -0,0 +1,106 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_pointcloud.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 3d_viewer_pointcloud.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__3d_viewer_pointcloud_H
+#define HEADER_INCLUDED__3d_viewer_pointcloud_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_PointCloud : public CSG_Module  
+{
+public:
+	C3D_Viewer_PointCloud(void);
+
+	virtual bool			needs_GUI			(void)	{	return( true );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_viewer_pointcloud_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_shapes.cpp b/src/modules/garden/garden_3d_viewer/3d_viewer_shapes.cpp
new file mode 100644
index 0000000..596c14d
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_shapes.cpp
@@ -0,0 +1,494 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_shapes.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       3d_viewer                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 3d_viewer_shapes.cpp                  //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "3d_viewer_shapes.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Shapes_Panel : public CSG_3DView_Panel
+{
+public:
+	C3D_Viewer_Shapes_Panel(wxWindow *pParent, CSG_Shapes *pShapes, int Field_Color);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual void				Update_Statistics		(void);
+	virtual void				Update_Parent			(void);
+
+	virtual void				On_Key_Down				(wxKeyEvent   &event);
+
+	virtual bool				On_Before_Draw			(void);
+	virtual bool				On_Draw					(void);
+
+	virtual int					Get_Color				(double Value);
+
+
+private:
+
+	bool						m_Color_bGrad;
+
+	double						m_Color_Min, m_Color_Scale;
+
+	CSG_Colors					m_Colors;
+
+	CSG_Shapes					*m_pShapes;
+
+
+	void						Draw_Shape				(CSG_Shape *pShape, int Field_Color);
+
+
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_Shapes_Panel, CSG_3DView_Panel)
+	EVT_KEY_DOWN	(C3D_Viewer_Shapes_Panel::On_Key_Down)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_Shapes_Panel::C3D_Viewer_Shapes_Panel(wxWindow *pParent, CSG_Shapes *pShapes, int cField)
+	: CSG_3DView_Panel(pParent)
+{
+	m_pShapes	= pShapes;
+
+	//-----------------------------------------------------
+	CSG_String	Attributes;
+
+	for(int i=0; i<m_pShapes->Get_Field_Count(); i++)
+	{
+		Attributes	+= m_pShapes->Get_Field_Name(i);
+		Attributes	+= "|";
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode, *pNode_1;
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters("NODE_GENERAL");
+
+	m_Parameters.Add_Value(
+		pNode	, "Z_SCALE"			, _TL("Exaggeration"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_VIEW"		, _TL("Shapes View Settings"),
+		_TL("")
+	);
+
+	pNode_1	= m_Parameters.Add_Choice(
+		pNode	, "COLORS_ATTR"		, _TL("Colour Attribute"),
+		_TL(""),
+		Attributes, cField
+	);
+
+	m_Parameters.Add_Colors(
+		pNode_1	, "COLORS"			, _TL("Colours"),
+		_TL("")
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "COLORS_GRAD"		, _TL("Graduated"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Range(
+		pNode_1	, "COLORS_RANGE"	, _TL("Value Range"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Update_Statistics();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_Shapes_Panel::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( CSG_3DView_Panel::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Shapes_Panel::Update_Statistics(void)
+{
+	int	Field	= m_Parameters("COLORS_ATTR")->asInt();
+
+	m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+		m_pShapes->Get_Mean(Field) - 1.5 * m_pShapes->Get_StdDev(Field),
+		m_pShapes->Get_Mean(Field) + 1.5 * m_pShapes->Get_StdDev(Field)
+	);
+
+	m_Data_Min.x	= m_pShapes->Get_Extent().Get_XMin();
+	m_Data_Max.x	= m_pShapes->Get_Extent().Get_XMax();
+
+	m_Data_Min.y	= m_pShapes->Get_Extent().Get_YMin();
+	m_Data_Max.y	= m_pShapes->Get_Extent().Get_YMax();
+
+	m_Data_Min.z	= m_pShapes->Get_ZMin();
+	m_Data_Max.z	= m_pShapes->Get_ZMax();
+
+	//-----------------------------------------------------
+	Update_View();
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_Shapes_Panel::Update_Parent(void)
+{
+	((CSG_3DView_Dialog *)GetParent())->Update_Controls();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Shapes_Panel::On_Key_Down(wxKeyEvent &event)
+{
+	switch( event.GetKeyCode() )
+	{
+	default:	CSG_3DView_Panel::On_Key_Down(event);	return;
+
+	case WXK_F1:	m_Parameters("Z_SCALE")->Set_Value(m_Parameters("Z_SCALE")->asDouble() -  0.5);	break;
+	case WXK_F2:	m_Parameters("Z_SCALE")->Set_Value(m_Parameters("Z_SCALE")->asDouble() +  0.5);	break;
+	}
+
+	//-----------------------------------------------------
+	Update_View();
+	Update_Parent();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Shapes_Panel::On_Before_Draw(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Projector.Set_zScaling(m_Projector.Get_xScaling() * m_Parameters("Z_SCALE")->asDouble());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_Shapes_Panel::Get_Color(double Value)
+{
+	if( m_Color_Scale <= 0.0 )
+	{
+		return( (int)Value );
+	}
+
+	double	c	= m_Color_Scale * (Value - m_Color_Min);
+
+	return( m_Color_bGrad ? m_Colors.Get_Interpolated(c) : m_Colors[(int)c] );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Shapes_Panel::On_Draw(void)
+{
+	//-----------------------------------------------------
+	int		cField	= m_Parameters("COLORS_ATTR")->asInt();
+
+	if( m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal()
+	>=  m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() )
+	{
+		m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+			m_pShapes->Get_Mean(cField) - 1.5 * m_pShapes->Get_StdDev(cField),
+			m_pShapes->Get_Mean(cField) + 1.5 * m_pShapes->Get_StdDev(cField)
+		);
+	}
+
+	m_Colors		= *m_Parameters("COLORS")->asColors();
+	m_Color_bGrad	= m_Parameters("COLORS_GRAD")->asBool();
+	m_Color_Min		= m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal();
+	m_Color_Scale	= m_Colors.Get_Count() / (m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() - m_Color_Min);
+
+	//-------------------------------------------------
+	for(int iShape=0; iShape<m_pShapes->Get_Count(); iShape++)
+	{
+		Draw_Shape(m_pShapes->Get_Shape(iShape), cField);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_Shapes_Panel::Draw_Shape(CSG_Shape *pShape, int Field_Color)
+{
+	int	Color	= Get_Color(pShape->asDouble(Field_Color));
+
+	for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+	{
+		switch( pShape->Get_Type() )
+		{
+		//-------------------------------------------------
+		case SHAPE_TYPE_Point:
+		case SHAPE_TYPE_Points:
+			{
+				for(int iPoint=1; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					TSG_Point_Z	a;
+					TSG_Point	p	= pShape->Get_Point(0, iPart);
+
+					a.x	= p.x;
+					a.y	= p.y;
+					a.z	= pShape->Get_Z(iPoint, iPart);
+
+					m_Projector.Get_Projection(a);
+
+					Draw_Point(a.x, a.y, a.z, Color, 2);
+				}
+			}
+			break;
+
+		//-------------------------------------------------
+		case SHAPE_TYPE_Line:
+			{
+				TSG_Point_Z	a, b;
+				TSG_Point	p	= pShape->Get_Point(0, iPart);
+
+				a.x	= p.x;
+				a.y	= p.y;
+				a.z	= pShape->Get_Z(0, iPart);
+
+				m_Projector.Get_Projection(a);
+
+				for(int iPoint=1; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					b	= a;
+					p	= pShape->Get_Point(iPoint, iPart);
+					a.x	= p.x;
+					a.y	= p.y;
+					a.z	= pShape->Get_Z(iPoint, iPart);
+
+					m_Projector.Get_Projection(a);
+
+					Draw_Line(a, b, Color);
+				}
+			}
+			break;
+
+		//-------------------------------------------------
+		case SHAPE_TYPE_Polygon:
+			{
+				TSG_Point_Z	a, b;
+				TSG_Point	p	= pShape->Get_Point(0, iPart, false);
+
+				a.x	= p.x;
+				a.y	= p.y;
+				a.z	= pShape->Get_Z(0, iPart, false);
+
+				m_Projector.Get_Projection(a);
+
+				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					b	= a;	p	= pShape->Get_Point(iPoint, iPart);
+
+					a.x	= p.x;
+					a.y	= p.y;
+					a.z	= pShape->Get_Z(iPoint, iPart);
+
+					m_Projector.Get_Projection(a);
+
+					Draw_Line(a, b, Color);
+				}
+			}
+			break;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Shapes_Dialog : public CSG_3DView_Dialog
+{
+public:
+	C3D_Viewer_Shapes_Dialog(CSG_Shapes *pShapes, int Field_Color)
+		: CSG_3DView_Dialog(_TL("3D Shapes Viewer"))
+	{
+		Create(new C3D_Viewer_Shapes_Panel(this, pShapes, Field_Color));
+	}
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_Shapes::C3D_Viewer_Shapes(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("3D Shapes Viewer"));
+
+	Set_Author		("O. Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"3D viewer for 3D Shapes."
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode	= Parameters.Add_Shapes(
+		NULL	, "SHAPES"	, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "COLOR"	, _TL("Colour"),
+		_TL("")
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_Shapes::On_Execute(void)
+{
+	CSG_Shapes	*pShapes	= Parameters("SHAPES")->asShapes();
+
+	if( !pShapes->is_Valid() )
+	{
+		Error_Set(_TL("invalid input"));
+
+		return( false );
+	}
+
+	C3D_Viewer_Shapes_Dialog	dlg(pShapes, Parameters("COLOR")->asInt());
+
+	dlg.ShowModal();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_shapes.h b/src/modules/garden/garden_3d_viewer/3d_viewer_shapes.h
new file mode 100644
index 0000000..e437d6b
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_shapes.h
@@ -0,0 +1,106 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_shapes.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  3d_viewer_shapes.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__3d_viewer_shapes_H
+#define HEADER_INCLUDED__3d_viewer_shapes_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_Shapes : public CSG_Module  
+{
+public:
+	C3D_Viewer_Shapes(void);
+
+	virtual bool			needs_GUI			(void)	{	return( true );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_viewer_shapes_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_tin.cpp b/src/modules/garden/garden_3d_viewer/3d_viewer_tin.cpp
new file mode 100644
index 0000000..3313da8
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_tin.cpp
@@ -0,0 +1,809 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_tin.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       3d_viewer                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   3d_viewer_tin.cpp                   //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/menu.h>
+
+#include "3d_viewer_tin.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_TIN_Panel : public CSG_3DView_Panel
+{
+public:
+	C3D_Viewer_TIN_Panel(wxWindow *pParent, CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Grid *pDrape);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual void				Update_Statistics		(void);
+	virtual void				Update_Parent			(void);
+
+	virtual void				On_Key_Down				(wxKeyEvent   &event);
+
+	virtual bool				On_Before_Draw			(void);
+	virtual bool				On_Draw					(void);
+
+	virtual int					Get_Color				(double Value);
+
+
+private:
+
+	bool						m_Color_bGrad;
+
+	double						m_Color_Min, m_Color_Scale;
+
+	CSG_Colors					m_Colors;
+
+	CSG_TIN						*m_pTIN;
+
+
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_TIN_Panel, CSG_3DView_Panel)
+	EVT_KEY_DOWN	(C3D_Viewer_TIN_Panel::On_Key_Down)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_TIN_Panel::C3D_Viewer_TIN_Panel(wxWindow *pParent, CSG_TIN *pTIN, int zField, int cField, CSG_Grid *pDrape)
+	: CSG_3DView_Panel(pParent, pDrape)
+{
+	m_pTIN		= pTIN;
+
+	//-----------------------------------------------------
+	CSG_String	Attributes;
+
+	for(int i=0; i<pTIN->Get_Field_Count(); i++)
+	{
+		Attributes	+= pTIN->Get_Field_Name(i);
+		Attributes	+= "|";
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode, *pNode_1, *pNode_2;
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters("NODE_GENERAL");
+
+	pNode_1	= m_Parameters.Add_Choice(
+		pNode	, "Z_ATTR"			, _TL("Z Attribute"),
+		_TL(""),
+		Attributes, zField
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "Z_SCALE"			, _TL("Exaggeration"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_VIEW"		, _TL("TIN View Settings"),
+		_TL("")
+	);
+
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "DRAW_FACES"		, _TL("Draw Faces"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	pNode_2	= m_Parameters.Add_Choice(
+		pNode_1	, "COLORS_ATTR"		, _TL("Colour Attribute"),
+		_TL(""),
+		Attributes, cField
+	);
+
+	m_Parameters.Add_Colors(
+		pNode_2	, "COLORS"			, _TL("Colours"),
+		_TL("")
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "COLORS_GRAD"		, _TL("Graduated"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Range(
+		pNode_2	, "COLORS_RANGE"	, _TL("Value Range"),
+		_TL("")
+	);
+
+	pNode_2	= m_Parameters.Add_Choice(
+		pNode_1	, "SHADING"			, _TL("Shading"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("none"),
+			_TL("shading"),
+			_TL("shading (fixed light source)")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "SHADE_DEC"		, _TL("Light Source Height"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 45.0, -90.0, true, 90.0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "SHADE_AZI"		, _TL("Light Source Direction"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 90.0, 0.0, true, 360.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "DRAW_EDGES"		, _TL("Draw Wire"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	pNode_2	= m_Parameters.Add_Value(
+		pNode_1	, "EDGE_COLOR_UNI"	, _TL("Single Colour"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Value(
+		pNode_2	, "EDGE_COLOR"		, _TL("Colour"),
+		_TL(""),
+		PARAMETER_TYPE_Color, SG_GET_RGB(150, 150, 150)
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Value(
+		NULL	, "DRAW_NODES"		, _TL("Draw Nodes"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "NODE_COLOR"		, _TL("Colour"),
+		_TL(""),
+		PARAMETER_TYPE_Color, SG_COLOR_BLACK
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "NODE_SIZE"		, _TL("Size"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 2, 1, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "NODE_SCALE"		, _TL("Size Scaling"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 250.0, 1.0, true
+	);
+
+	//-----------------------------------------------------
+	Update_Statistics();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_TIN_Panel::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DRAW_FACES") )
+	{
+		CSG_Parameter	*pDrape	= pParameters->Get_Parameter("DO_DRAPE");
+
+		pParameters->Get_Parameter("COLORS_ATTR")->Set_Enabled(pParameter->asBool() && (!pDrape || !pDrape->asBool()));
+		pParameters->Get_Parameter("SHADING"    )->Set_Enabled(pParameter->asBool());
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DO_DRAPE") )
+	{
+		CSG_Parameter	*pFaces	= pParameters->Get_Parameter("DRAW_FACES");
+
+		pParameters->Get_Parameter("COLORS_ATTR")->Set_Enabled(pParameter->asBool() == false && pFaces->asBool() == true);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHADING") )
+	{
+		pParameters->Get_Parameter("SHADE_DEC"  )->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("SHADE_AZI"  )->Set_Enabled(pParameter->asBool());
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DRAW_EDGES") )
+	{
+		pParameters->Get_Parameter("EDGE_COLOR_UNI" )->Set_Enabled(pParameter->asBool());
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "EDGE_COLOR_UNI") )
+	{
+		pParameters->Get_Parameter("EDGE_COLOR" )->Set_Enabled(pParameter->asBool());
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DRAW_NODES") )
+	{
+		pParameters->Get_Parameter("NODE_COLOR" )->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("NODE_SIZE"  )->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("NODE_SCALE" )->Set_Enabled(pParameter->asBool());
+	}
+
+	return( CSG_3DView_Panel::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Panel::Update_Statistics(void)
+{
+	int	Field	= m_Parameters("COLORS_ATTR")->asInt();
+
+	m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+		m_pTIN->Get_Mean(Field) - 1.5 * m_pTIN->Get_StdDev(Field),
+		m_pTIN->Get_Mean(Field) + 1.5 * m_pTIN->Get_StdDev(Field)
+	);
+
+	m_Data_Min.x	= m_pTIN->Get_Extent().Get_XMin();
+	m_Data_Max.x	= m_pTIN->Get_Extent().Get_XMax();
+
+	m_Data_Min.y	= m_pTIN->Get_Extent().Get_YMin();
+	m_Data_Max.y	= m_pTIN->Get_Extent().Get_YMax();
+
+	m_Data_Min.z	= m_pTIN->Get_Minimum(m_Parameters("Z_ATTR")->asInt());
+	m_Data_Max.z	= m_pTIN->Get_Maximum(m_Parameters("Z_ATTR")->asInt());
+
+	//-----------------------------------------------------
+	Update_View();
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Panel::Update_Parent(void)
+{
+	((CSG_3DView_Dialog *)GetParent())->Update_Controls();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Panel::On_Key_Down(wxKeyEvent &event)
+{
+	switch( event.GetKeyCode() )
+	{
+	default:	CSG_3DView_Panel::On_Key_Down(event);	return;
+
+	case WXK_F1:	m_Parameters("Z_SCALE"   )->Set_Value(m_Parameters("Z_SCALE"   )->asDouble() -  0.5);	break;
+	case WXK_F2:	m_Parameters("Z_SCALE"   )->Set_Value(m_Parameters("Z_SCALE"   )->asDouble() +  0.5);	break;
+
+	case WXK_F5:	m_Parameters("SIZE"      )->Set_Value(m_Parameters("SIZE"      )->asDouble() -  1.0);	break;
+	case WXK_F6:	m_Parameters("SIZE"      )->Set_Value(m_Parameters("SIZE"      )->asDouble() +  1.0);	break;
+
+	case WXK_F7:	m_Parameters("SIZE_SCALE")->Set_Value(m_Parameters("SIZE_SCALE")->asDouble() - 10.0);	break;
+	case WXK_F8:	m_Parameters("SIZE_SCALE")->Set_Value(m_Parameters("SIZE_SCALE")->asDouble() + 10.0);	break;
+	}
+
+	//-----------------------------------------------------
+	Update_View();
+	Update_Parent();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_TIN_Panel::On_Before_Draw(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Projector.Set_zScaling(m_Projector.Get_xScaling() * m_Parameters("Z_SCALE")->asDouble());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int C3D_Viewer_TIN_Panel::Get_Color(double Value)
+{
+	if( m_Color_Scale <= 0.0 )
+	{
+		return( (int)Value );
+	}
+
+	double	c	= m_Color_Scale * (Value - m_Color_Min);
+
+	return( m_Color_bGrad ? m_Colors.Get_Interpolated(c) : m_Colors[(int)c] );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_TIN_Panel::On_Draw(void)
+{
+	int		zField	= m_Parameters("Z_ATTR"     )->asInt();
+
+	//-----------------------------------------------------
+	int		cField	= m_Parameters("COLORS_ATTR")->asInt();
+
+	if( m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal()
+	>=  m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() )
+	{
+		m_Parameters("COLORS_RANGE")->asRange()->Set_Range(
+			m_pTIN->Get_Mean(cField) - 1.5 * m_pTIN->Get_StdDev(cField),
+			m_pTIN->Get_Mean(cField) + 1.5 * m_pTIN->Get_StdDev(cField)
+		);
+	}
+
+	m_Colors		= *m_Parameters("COLORS")->asColors();
+	m_Color_bGrad	= m_Parameters("COLORS_GRAD")->asBool();
+	m_Color_Min		= m_Parameters("COLORS_RANGE")->asRange()->Get_LoVal();
+	m_Color_Scale	= m_Colors.Get_Count() / (m_Parameters("COLORS_RANGE")->asRange()->Get_HiVal() - m_Color_Min);
+
+	//-----------------------------------------------------
+	if( m_Parameters("DRAW_FACES")->asBool() )	// Face
+	{
+		bool	bDrape		= m_Parameters("DO_DRAPE") && m_Parameters("DO_DRAPE")->asBool();
+		int		Shading		= m_Parameters("SHADING")->asInt();
+		double	Shade_Dec	= m_Parameters("SHADE_DEC")->asDouble() * -M_DEG_TO_RAD;
+		double	Shade_Azi	= m_Parameters("SHADE_AZI")->asDouble() *  M_DEG_TO_RAD;
+
+		#pragma omp parallel for
+		for(int iTriangle=0; iTriangle<m_pTIN->Get_Triangle_Count(); iTriangle++)
+		{
+			CSG_TIN_Triangle	*pTriangle	= m_pTIN->Get_Triangle(iTriangle);
+			TSG_Triangle_Node	p[3];
+
+			for(int i=0; i<3; i++)
+			{
+				CSG_TIN_Node	*pNode	= pTriangle->Get_Node(i);
+
+				p[i].x	= pNode->Get_Point().x;
+				p[i].y	= pNode->Get_Point().y;
+				p[i].z	= pNode->asDouble(zField);
+
+				if( bDrape )
+				{
+					p[i].c	= pNode->Get_Point().x;
+					p[i].d	= pNode->Get_Point().y;
+				}
+				else
+				{
+					p[i].c	= pNode->asDouble(cField);
+				}
+
+				m_Projector.Get_Projection(p[i].x, p[i].y, p[i].z);
+			}
+
+			//---------------------------------------------
+			switch( Shading )
+			{
+			default:
+			case 0:	Draw_Triangle(p);						break;
+			case 1:	Draw_Triangle(p, Shade_Dec, Shade_Azi);	break;
+			case 2:
+				{
+					double	s, a;
+
+					pTriangle->Get_Gradient(zField, s, a);
+
+					Draw_Triangle(p, acos(sin(M_PI_090 - s) * sin(Shade_Dec) + cos(M_PI_090 - s) * cos(Shade_Dec) * cos(a - Shade_Azi)) / M_PI_090);
+				}
+				break;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( m_Parameters("DRAW_EDGES")->asBool() )	// Edges
+	{
+		bool	bColor	= m_Parameters("EDGE_COLOR_UNI")->asBool();
+		int		Color	= m_Parameters("EDGE_COLOR"    )->asColor();
+
+		#pragma omp parallel for
+		for(int iEdge=0; iEdge<m_pTIN->Get_Edge_Count(); iEdge++)
+		{
+			CSG_TIN_Edge		*pEdge	= m_pTIN->Get_Edge(iEdge);
+			TSG_Triangle_Node	p[2];
+
+			for(int i=0; i<2; i++)
+			{
+				CSG_TIN_Node	*pNode	= pEdge->Get_Node(i);
+
+				p[i].x	= pNode->Get_Point().x;
+				p[i].y	= pNode->Get_Point().y;
+				p[i].z	= pNode->asDouble(zField);
+				p[i].c	= Get_Color(pNode->asDouble(cField));
+
+				m_Projector.Get_Projection(p[i].x, p[i].y, p[i].z);
+			}
+
+			//---------------------------------------------
+			if( bColor )
+			{
+				Draw_Line(p[0].x, p[0].y, p[0].z, p[1].x, p[1].y, p[1].z, Color);
+			}
+			else
+			{
+				Draw_Line(p[0].x, p[0].y, p[0].z, p[1].x, p[1].y, p[1].z, p[0].c, p[1].c);
+			}
+		}
+	}
+
+	//-------------------------------------------------
+	if( m_Parameters("DRAW_NODES")->asBool() )	// Nodes
+	{
+		int		Color	= m_Parameters("NODE_COLOR")->asColor ();
+		int		Size	= m_Parameters("NODE_SIZE" )->asInt   ();
+	//	double	dSize	= m_Parameters("NODE_SCALE")->asDouble();
+
+	//	if( dSize > 1.0 )
+	//	{
+	//		size	= (int)(20.0 * exp(-dSize * z));
+	//	}
+
+		#pragma omp parallel for
+		for(int iNode=0; iNode<m_pTIN->Get_Node_Count(); iNode++)
+		{
+			CSG_TIN_Node	*pNode	= m_pTIN->Get_Node(iNode);
+			TSG_Point_Z		p;
+
+			p.x	= pNode->Get_Point().x;
+			p.y	= pNode->Get_Point().y;
+			p.z	= pNode->asDouble(zField);
+
+			m_Projector.Get_Projection(p.x, p.y, p.z);
+
+			Draw_Point(p.x, p.y, p.z, Color, Size);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_TIN_Dialog : public CSG_3DView_Dialog
+{
+public:
+	C3D_Viewer_TIN_Dialog(CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Grid *pDrape);
+
+	virtual void				Update_Controls			(void);
+
+
+protected:
+
+	wxChoice					*m_pField_Z, *m_pField_C;
+
+//	wxCheckBox					*m_pFaces, *m_pEdges, *m_pNodes;
+
+
+	virtual void				On_Update_Choices		(wxCommandEvent &event);
+//	virtual void				On_Update_Control		(wxCommandEvent &event);
+
+	virtual void				Set_Menu				(wxMenu &Menu);
+	virtual void				On_Menu					(wxCommandEvent &event);
+	virtual void				On_Menu_UI				(wxUpdateUIEvent &event);
+
+
+private:
+
+	DECLARE_EVENT_TABLE()
+
+};
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(C3D_Viewer_TIN_Dialog, CSG_3DView_Dialog)
+	EVT_CHOICE		(wxID_ANY, C3D_Viewer_TIN_Dialog::On_Update_Choices)
+//	EVT_CHECKBOX	(wxID_ANY, C3D_Viewer_TIN_Dialog::On_Update_Control)
+END_EVENT_TABLE()
+
+//---------------------------------------------------------
+C3D_Viewer_TIN_Dialog::C3D_Viewer_TIN_Dialog(CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Grid *pDrape)
+	: CSG_3DView_Dialog(_TL("TIN Viewer"))
+{
+	Create(new C3D_Viewer_TIN_Panel(this, pTIN, Field_Z, Field_Color, pDrape));
+
+	wxArrayString	Attributes;
+
+	for(int i=0; i<pTIN->Get_Field_Count(); i++)
+	{
+		Attributes.Add(pTIN->Get_Field_Name(i));
+	}
+
+	Add_Spacer();
+	m_pField_Z	= Add_Choice  (_TL("Elevation"), Attributes, Field_Z);
+	m_pField_C	= Add_Choice  (_TL("Colour"   ), Attributes, Field_Color);
+
+//	Add_Spacer();
+//	m_pFaces	= Add_CheckBox(_TL("Faces"), m_pPanel->m_Parameters("DRAW_FACES")->asBool());
+//	m_pEdges	= Add_CheckBox(_TL("Edges"), m_pPanel->m_Parameters("DRAW_EDGES")->asBool());
+//	m_pNodes	= Add_CheckBox(_TL("Nodes"), m_pPanel->m_Parameters("DRAW_NODES")->asBool());
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Dialog::On_Update_Choices(wxCommandEvent &event)
+{
+	if( event.GetEventObject() == m_pField_Z )
+	{
+		m_pPanel->m_Parameters("Z_ATTR")->Set_Value(m_pField_Z->GetSelection());
+		m_pPanel->Update_View(true);
+		return;
+	}
+
+	if( event.GetEventObject() == m_pField_C )
+	{
+		m_pPanel->m_Parameters("COLORS_ATTR")->Set_Value(m_pField_C->GetSelection());
+		m_pPanel->Update_View(true);
+		return;
+	}
+
+	CSG_3DView_Dialog::On_Update_Choices(event);
+}
+
+//---------------------------------------------------------
+//void C3D_Viewer_TIN_Dialog::On_Update_Control(wxCommandEvent &event)
+//{
+//	CHECKBOX_UPDATE(m_pFaces, "DRAW_FACES");
+//	CHECKBOX_UPDATE(m_pEdges, "DRAW_EDGES");
+//	CHECKBOX_UPDATE(m_pNodes, "DRAW_NODES");
+
+//	CSG_3DView_Dialog::On_Update_Control(event);
+//}
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Dialog::Update_Controls(void)
+{
+	m_pField_Z->SetSelection(m_pPanel->m_Parameters("Z_ATTR"     )->asInt());
+	m_pField_C->SetSelection(m_pPanel->m_Parameters("COLORS_ATTR")->asInt());
+
+//	m_pFaces->SetValue(m_pPanel->m_Parameters("DRAW_FACES")->asBool());
+//	m_pEdges->SetValue(m_pPanel->m_Parameters("DRAW_EDGES")->asBool());
+//	m_pNodes->SetValue(m_pPanel->m_Parameters("DRAW_NODES")->asBool());
+
+	CSG_3DView_Dialog::Update_Controls();
+}
+
+//---------------------------------------------------------
+enum
+{
+	MENU_SCALE_Z_DEC	= MENU_USER_FIRST,
+	MENU_SCALE_Z_INC,
+	MENU_COLORS_GRAD,
+	MENU_SHADING,
+	MENU_FACES,
+	MENU_EDGES,
+	MENU_NODES
+};
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Dialog::Set_Menu(wxMenu &Menu)
+{
+	wxMenu	*pMenu	= Menu.FindChildItem(Menu.FindItem(_TL("Display")))->GetSubMenu();
+
+	pMenu->AppendSeparator();
+	pMenu->Append(MENU_SCALE_Z_DEC, _TL("Decrease Exaggeration [F1]"));
+	pMenu->Append(MENU_SCALE_Z_INC, _TL("Increase Exaggeration [F2]"));
+
+	pMenu->AppendSeparator();
+	pMenu->AppendCheckItem(MENU_COLORS_GRAD, _TL("Graduated Colours"));
+
+	Menu.AppendSeparator();
+	Menu.AppendCheckItem(MENU_SHADING, _TL("Shading"));
+
+	Menu.AppendSeparator();
+	Menu.AppendCheckItem(MENU_FACES, _TL("Faces"));
+	Menu.AppendCheckItem(MENU_EDGES, _TL("Edges"));
+	Menu.AppendCheckItem(MENU_NODES, _TL("Nodes"));
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Dialog::On_Menu(wxCommandEvent &event)
+{
+	switch( event.GetId() )
+	{
+	case MENU_SCALE_Z_DEC:	m_pPanel->m_Parameters("Z_SCALE")->Set_Value(m_pPanel->m_Parameters("Z_SCALE")->asDouble() - 0.5); m_pPanel->Update_View();	return;
+	case MENU_SCALE_Z_INC:	m_pPanel->m_Parameters("Z_SCALE")->Set_Value(m_pPanel->m_Parameters("Z_SCALE")->asDouble() + 0.5); m_pPanel->Update_View();	return;
+
+	case MENU_COLORS_GRAD:	MENU_TOGGLE("COLORS_GRAD");	return;
+
+	case MENU_SHADING    :	MENU_TOGGLE("SHADING"    );	return;
+
+	case MENU_FACES      :	MENU_TOGGLE("DRAW_FACES" );	return;
+	case MENU_EDGES      :	MENU_TOGGLE("DRAW_EDGES" );	return;
+	case MENU_NODES      :	MENU_TOGGLE("DRAW_NODES" );	return;
+	}
+
+	CSG_3DView_Dialog::On_Menu(event);
+}
+
+//---------------------------------------------------------
+void C3D_Viewer_TIN_Dialog::On_Menu_UI(wxUpdateUIEvent &event)
+{
+	switch( event.GetId() )
+	{
+	case MENU_COLORS_GRAD:	event.Check(m_pPanel->m_Parameters("COLORS_GRAD")->asBool());	return;
+
+	case MENU_SHADING    :	event.Check(m_pPanel->m_Parameters("SHADING"    )->asBool());	return;
+
+	case MENU_FACES      :	event.Check(m_pPanel->m_Parameters("DRAW_FACES" )->asBool());	return;
+	case MENU_EDGES      :	event.Check(m_pPanel->m_Parameters("DRAW_EDGES" )->asBool());	return;
+	case MENU_NODES      :	event.Check(m_pPanel->m_Parameters("DRAW_NODES" )->asBool());	return;
+	}
+
+	CSG_3DView_Dialog::On_Menu_UI(event);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+C3D_Viewer_TIN::C3D_Viewer_TIN(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("TIN Viewer"));
+
+	Set_Author		("O. Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"3D viewer for TIN."
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode	= Parameters.Add_TIN(
+		NULL	, "TIN"		, _TL("TIN"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "HEIGHT"	, _TL("Elevation"),
+		_TL("")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "COLOR"	, _TL("Color"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DRAPE"	, _TL("Map"),
+		_TL("rgb coded raster map to be draped"),
+		PARAMETER_INPUT_OPTIONAL
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool C3D_Viewer_TIN::On_Execute(void)
+{
+	CSG_TIN	*pTIN	= Parameters("TIN")->asTIN();
+
+	if( !pTIN->is_Valid() )
+	{
+		Error_Set(_TL("invalid input data"));
+
+		return( false );
+	}
+
+	C3D_Viewer_TIN_Dialog	dlg(pTIN, Parameters("HEIGHT")->asInt(), Parameters("COLOR")->asInt(), Parameters("DRAPE")->asGrid());
+
+	dlg.ShowModal();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/3d_viewer_tin.h b/src/modules/garden/garden_3d_viewer/3d_viewer_tin.h
new file mode 100644
index 0000000..033b816
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/3d_viewer_tin.h
@@ -0,0 +1,106 @@
+/**********************************************************
+ * Version $Id: 3d_viewer_tin.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    3d_viewer_tin.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__3d_viewer_tin_H
+#define HEADER_INCLUDED__3d_viewer_tin_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C3D_Viewer_TIN : public CSG_Module
+{
+public:
+	C3D_Viewer_TIN(void);
+
+	virtual bool			needs_GUI			(void)	{	return( true );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_viewer_tin_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/garden/garden_3d_viewer/MLB_Interface.cpp b/src/modules/garden/garden_3d_viewer/MLB_Interface.cpp
new file mode 100644
index 0000000..fff7405
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/MLB_Interface.cpp
@@ -0,0 +1,132 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2011 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 for Geography                //
+//                University of Hamburg                  //
+//                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("Garden - 3D Viewer") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O.Conrad (c) 2014") );
+
+	case MLB_INFO_Description:
+		return( _TL("3D Viewer." ));
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Garden|3D Viewer" ));
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "3d_viewer_tin.h"
+#include "3d_viewer_pointcloud.h"
+#include "3d_viewer_shapes.h"
+#include "3d_viewer_globe_grid.h"
+#include "3d_viewer_multiple_grids.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case 0:		return( new C3D_Viewer_TIN );
+	case 1:		return( new C3D_Viewer_PointCloud );
+	case 2:		return( new C3D_Viewer_Shapes );
+	case 3:		return( new C3D_Viewer_Globe_Grid );
+	case 4:		return( new C3D_Viewer_Multiple_Grids );
+
+	default:	return( NULL );
+//	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/garden/garden_3d_viewer/MLB_Interface.h b/src/modules/garden/garden_3d_viewer/MLB_Interface.h
new file mode 100644
index 0000000..9474e22
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/MLB_Interface.h
@@ -0,0 +1,83 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      3d_viewer                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.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 for Geography                //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H
+#define HEADER_INCLUDED__pointcloud_viewer_mlb_H
+
+//---------------------------------------------------------
+#include <saga_gdi/3d_view.h>
+
+//---------------------------------------------------------
+#ifdef pointcloud_viewer_EXPORTS
+	#define	pointcloud_viewer_EXPORT	_SAGA_DLL_EXPORT
+#else
+	#define	pointcloud_viewer_EXPORT	_SAGA_DLL_IMPORT
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H
diff --git a/src/modules/garden/garden_3d_viewer/Makefile.am b/src/modules/garden/garden_3d_viewer/Makefile.am
new file mode 100644
index 0000000..53fa646
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/Makefile.am
@@ -0,0 +1,30 @@
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
+else
+DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
+endif
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libgarden_3d_viewer.la
+libgarden_3d_viewer_la_SOURCES =\
+MLB_Interface.cpp\
+3d_viewer_globe_grid.cpp\
+3d_viewer_multiple_grids.cpp\
+3d_viewer_pointcloud.cpp\
+3d_viewer_shapes.cpp\
+3d_viewer_tin.cpp\
+MLB_Interface.h\
+3d_viewer_globe_grid.h\
+3d_viewer_multiple_grids.h\
+3d_viewer_pointcloud.h\
+3d_viewer_shapes.h\
+3d_viewer_tin.h
+
+libgarden_3d_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
diff --git a/src/modules/garden/garden_3d_viewer/Makefile.in b/src/modules/garden/garden_3d_viewer/Makefile.in
new file mode 100644
index 0000000..1b0390e
--- /dev/null
+++ b/src/modules/garden/garden_3d_viewer/Makefile.in
@@ -0,0 +1,645 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/garden/garden_3d_viewer
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libgarden_3d_viewer_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \
+	$(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la
+am_libgarden_3d_viewer_la_OBJECTS = MLB_Interface.lo \
+	3d_viewer_globe_grid.lo 3d_viewer_multiple_grids.lo \
+	3d_viewer_pointcloud.lo 3d_viewer_shapes.lo 3d_viewer_tin.lo
+libgarden_3d_viewer_la_OBJECTS = $(am_libgarden_3d_viewer_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libgarden_3d_viewer_la_SOURCES)
+DIST_SOURCES = $(libgarden_3d_viewer_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@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`
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libgarden_3d_viewer.la
+libgarden_3d_viewer_la_SOURCES = \
+MLB_Interface.cpp\
+3d_viewer_globe_grid.cpp\
+3d_viewer_multiple_grids.cpp\
+3d_viewer_pointcloud.cpp\
+3d_viewer_shapes.cpp\
+3d_viewer_tin.cpp\
+MLB_Interface.h\
+3d_viewer_globe_grid.h\
+3d_viewer_multiple_grids.h\
+3d_viewer_pointcloud.h\
+3d_viewer_shapes.h\
+3d_viewer_tin.h
+
+libgarden_3d_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_3d_viewer/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/garden/garden_3d_viewer/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgarden_3d_viewer.la: $(libgarden_3d_viewer_la_OBJECTS) $(libgarden_3d_viewer_la_DEPENDENCIES) $(EXTRA_libgarden_3d_viewer_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_3d_viewer_la_OBJECTS) $(libgarden_3d_viewer_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_viewer_globe_grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_viewer_multiple_grids.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_viewer_pointcloud.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_viewer_shapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_viewer_tin.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_recreations/recreations/recreations_fractals/Bifurcation.cpp b/src/modules/garden/garden_fractals/Bifurcation.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Bifurcation.cpp
rename to src/modules/garden/garden_fractals/Bifurcation.cpp
diff --git a/src/modules_recreations/recreations/recreations_fractals/Bifurcation.h b/src/modules/garden/garden_fractals/Bifurcation.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Bifurcation.h
rename to src/modules/garden/garden_fractals/Bifurcation.h
diff --git a/src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.cpp b/src/modules/garden/garden_fractals/Gaussian_Landscapes.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.cpp
rename to src/modules/garden/garden_fractals/Gaussian_Landscapes.cpp
diff --git a/src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.h b/src/modules/garden/garden_fractals/Gaussian_Landscapes.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.h
rename to src/modules/garden/garden_fractals/Gaussian_Landscapes.h
diff --git a/src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.cpp b/src/modules/garden/garden_fractals/Grid_FractalDimension.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.cpp
rename to src/modules/garden/garden_fractals/Grid_FractalDimension.cpp
diff --git a/src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.h b/src/modules/garden/garden_fractals/Grid_FractalDimension.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.h
rename to src/modules/garden/garden_fractals/Grid_FractalDimension.h
diff --git a/src/modules_recreations/recreations/recreations_fractals/MLB_Interface.cpp b/src/modules/garden/garden_fractals/MLB_Interface.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/MLB_Interface.cpp
rename to src/modules/garden/garden_fractals/MLB_Interface.cpp
diff --git a/src/modules/garden/garden_fractals/MLB_Interface.h b/src/modules/garden/garden_fractals/MLB_Interface.h
new file mode 100644
index 0000000..35a4eae
--- /dev/null
+++ b/src/modules/garden/garden_fractals/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    garden_fractals                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__garden_fractals_H
+#define HEADER_INCLUDED__garden_fractals_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__garden_fractals_H
diff --git a/src/modules/garden/garden_fractals/Makefile.am b/src/modules/garden/garden_fractals/Makefile.am
new file mode 100644
index 0000000..e06b9c3
--- /dev/null
+++ b/src/modules/garden/garden_fractals/Makefile.am
@@ -0,0 +1,32 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libgarden_fractals.la
+libgarden_fractals_la_SOURCES =\
+Bifurcation.cpp\
+Gaussian_Landscapes.cpp\
+Grid_FractalDimension.cpp\
+Mandelbrot.cpp\
+MLB_Interface.cpp\
+Newton.cpp\
+Pythagoras_Tree.cpp\
+Bifurcation.h\
+Gaussian_Landscapes.h\
+Grid_FractalDimension.h\
+Mandelbrot.h\
+MLB_Interface.h\
+Newton.h\
+Pythagoras_Tree.h
+
+libgarden_fractals_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/garden/garden_fractals/Makefile.in b/src/modules/garden/garden_fractals/Makefile.in
new file mode 100644
index 0000000..71ea925
--- /dev/null
+++ b/src/modules/garden/garden_fractals/Makefile.in
@@ -0,0 +1,648 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/garden/garden_fractals
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libgarden_fractals_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libgarden_fractals_la_OBJECTS = Bifurcation.lo \
+	Gaussian_Landscapes.lo Grid_FractalDimension.lo Mandelbrot.lo \
+	MLB_Interface.lo Newton.lo Pythagoras_Tree.lo
+libgarden_fractals_la_OBJECTS = $(am_libgarden_fractals_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libgarden_fractals_la_SOURCES)
+DIST_SOURCES = $(libgarden_fractals_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libgarden_fractals.la
+libgarden_fractals_la_SOURCES = \
+Bifurcation.cpp\
+Gaussian_Landscapes.cpp\
+Grid_FractalDimension.cpp\
+Mandelbrot.cpp\
+MLB_Interface.cpp\
+Newton.cpp\
+Pythagoras_Tree.cpp\
+Bifurcation.h\
+Gaussian_Landscapes.h\
+Grid_FractalDimension.h\
+Mandelbrot.h\
+MLB_Interface.h\
+Newton.h\
+Pythagoras_Tree.h
+
+libgarden_fractals_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_fractals/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/garden/garden_fractals/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgarden_fractals.la: $(libgarden_fractals_la_OBJECTS) $(libgarden_fractals_la_DEPENDENCIES) $(EXTRA_libgarden_fractals_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_fractals_la_OBJECTS) $(libgarden_fractals_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Bifurcation.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Gaussian_Landscapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_FractalDimension.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Mandelbrot.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Newton.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pythagoras_Tree.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_recreations/recreations/recreations_fractals/Mandelbrot.cpp b/src/modules/garden/garden_fractals/Mandelbrot.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Mandelbrot.cpp
rename to src/modules/garden/garden_fractals/Mandelbrot.cpp
diff --git a/src/modules_recreations/recreations/recreations_fractals/Mandelbrot.h b/src/modules/garden/garden_fractals/Mandelbrot.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Mandelbrot.h
rename to src/modules/garden/garden_fractals/Mandelbrot.h
diff --git a/src/modules_recreations/recreations/recreations_fractals/Newton.cpp b/src/modules/garden/garden_fractals/Newton.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Newton.cpp
rename to src/modules/garden/garden_fractals/Newton.cpp
diff --git a/src/modules_recreations/recreations/recreations_fractals/Newton.h b/src/modules/garden/garden_fractals/Newton.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Newton.h
rename to src/modules/garden/garden_fractals/Newton.h
diff --git a/src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.cpp b/src/modules/garden/garden_fractals/Pythagoras_Tree.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.cpp
rename to src/modules/garden/garden_fractals/Pythagoras_Tree.cpp
diff --git a/src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.h b/src/modules/garden/garden_fractals/Pythagoras_Tree.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.h
rename to src/modules/garden/garden_fractals/Pythagoras_Tree.h
diff --git a/src/modules_recreations/recreations/recreations_games/MLB_Interface.cpp b/src/modules/garden/garden_games/MLB_Interface.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_games/MLB_Interface.cpp
rename to src/modules/garden/garden_games/MLB_Interface.cpp
diff --git a/src/modules/garden/garden_games/MLB_Interface.h b/src/modules/garden/garden_games/MLB_Interface.h
new file mode 100644
index 0000000..15b8c09
--- /dev/null
+++ b/src/modules/garden/garden_games/MLB_Interface.h
@@ -0,0 +1,74 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Library Template                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 by                 //
+//                        Author                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     author at email.de                        //
+//                                                       //
+//    contact:    Author                                 //
+//                Sesame Street. 7                       //
+//                12345 Metropolis                       //
+//                Nirwana                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__garden_games_H
+#define HEADER_INCLUDED__garden_games_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__garden_games_H
diff --git a/src/modules/garden/garden_games/Makefile.am b/src/modules/garden/garden_games/Makefile.am
new file mode 100644
index 0000000..7683aef
--- /dev/null
+++ b/src/modules/garden/garden_games/Makefile.am
@@ -0,0 +1,25 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libgarden_games.la
+libgarden_games_la_SOURCES =\
+Mine_Sweeper.cpp\
+Mine_Sweeper_Res.cpp\
+MLB_Interface.cpp\
+Sudoku.cpp\
+Mine_Sweeper.h\
+MLB_Interface.h\
+Sudoku.h
+
+libgarden_games_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/garden/garden_games/Makefile.in b/src/modules/garden/garden_games/Makefile.in
new file mode 100644
index 0000000..82a4471
--- /dev/null
+++ b/src/modules/garden/garden_games/Makefile.in
@@ -0,0 +1,637 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/garden/garden_games
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libgarden_games_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libgarden_games_la_OBJECTS = Mine_Sweeper.lo Mine_Sweeper_Res.lo \
+	MLB_Interface.lo Sudoku.lo
+libgarden_games_la_OBJECTS = $(am_libgarden_games_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libgarden_games_la_SOURCES)
+DIST_SOURCES = $(libgarden_games_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libgarden_games.la
+libgarden_games_la_SOURCES = \
+Mine_Sweeper.cpp\
+Mine_Sweeper_Res.cpp\
+MLB_Interface.cpp\
+Sudoku.cpp\
+Mine_Sweeper.h\
+MLB_Interface.h\
+Sudoku.h
+
+libgarden_games_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_games/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/garden/garden_games/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgarden_games.la: $(libgarden_games_la_OBJECTS) $(libgarden_games_la_DEPENDENCIES) $(EXTRA_libgarden_games_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_games_la_OBJECTS) $(libgarden_games_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Mine_Sweeper.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Mine_Sweeper_Res.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Sudoku.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_recreations/recreations/recreations_games/Mine_Sweeper.cpp b/src/modules/garden/garden_games/Mine_Sweeper.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_games/Mine_Sweeper.cpp
rename to src/modules/garden/garden_games/Mine_Sweeper.cpp
diff --git a/src/modules_recreations/recreations/recreations_games/Mine_Sweeper.h b/src/modules/garden/garden_games/Mine_Sweeper.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_games/Mine_Sweeper.h
rename to src/modules/garden/garden_games/Mine_Sweeper.h
diff --git a/src/modules_recreations/recreations/recreations_games/Mine_Sweeper_Res.cpp b/src/modules/garden/garden_games/Mine_Sweeper_Res.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_games/Mine_Sweeper_Res.cpp
rename to src/modules/garden/garden_games/Mine_Sweeper_Res.cpp
diff --git a/src/modules_recreations/recreations/recreations_games/Sudoku.cpp b/src/modules/garden/garden_games/Sudoku.cpp
similarity index 100%
rename from src/modules_recreations/recreations/recreations_games/Sudoku.cpp
rename to src/modules/garden/garden_games/Sudoku.cpp
diff --git a/src/modules_recreations/recreations/recreations_games/Sudoku.h b/src/modules/garden/garden_games/Sudoku.h
similarity index 100%
rename from src/modules_recreations/recreations/recreations_games/Sudoku.h
rename to src/modules/garden/garden_games/Sudoku.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_01.cpp b/src/modules/garden/garden_learn_to_program/Exercise_01.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_01.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_01.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_01.h b/src/modules/garden/garden_learn_to_program/Exercise_01.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_01.h
rename to src/modules/garden/garden_learn_to_program/Exercise_01.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_02.cpp b/src/modules/garden/garden_learn_to_program/Exercise_02.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_02.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_02.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_02.h b/src/modules/garden/garden_learn_to_program/Exercise_02.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_02.h
rename to src/modules/garden/garden_learn_to_program/Exercise_02.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_03.cpp b/src/modules/garden/garden_learn_to_program/Exercise_03.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_03.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_03.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_03.h b/src/modules/garden/garden_learn_to_program/Exercise_03.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_03.h
rename to src/modules/garden/garden_learn_to_program/Exercise_03.h
diff --git a/src/modules/garden/garden_learn_to_program/Exercise_04.cpp b/src/modules/garden/garden_learn_to_program/Exercise_04.cpp
new file mode 100644
index 0000000..ec4c8b2
--- /dev/null
+++ b/src/modules/garden/garden_learn_to_program/Exercise_04.cpp
@@ -0,0 +1,446 @@
+/**********************************************************
+ * Version $Id: Exercise_04.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       Lectures                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Exercise_04.cpp                     //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Exercise_04.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CExercise_04::CExercise_04(void)
+{
+	//-----------------------------------------------------
+	// Give some information about your module...
+
+	Set_Name	(_TL("04: Direct neighbours - more..."));
+
+	Set_Author	(_TL("Copyrights (c) 2003 by Olaf Conrad"));
+
+	Set_Description	(_TW(
+		"Simple neighbourhood analysis for grid cells.\n"
+		"(c) 2003 by Olaf Conrad, Goettingen\n"
+		"email: oconrad at gwdg.de")
+	);
+
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL, "INPUT"	, _TL("Input grid"),
+		_TL("This must be your input data of type grid."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT"	, _TL("Output"),
+		_TL("This will contain your output data of type grid."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL, "METHOD"	, _TL("Method"),
+		_TL("Choose a method"),
+
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+			_TL("Arithmetic mean (version 1)"),
+			_TL("Arithmetic mean (version 2)"),
+			_TL("Difference from all neighbour's mean"),
+			_TL("Variance (version 1)"),
+			_TL("Variance (version 2)"),
+			_TL("Standard deviation")
+		)
+	);
+}
+
+//---------------------------------------------------------
+CExercise_04::~CExercise_04(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CExercise_04::On_Execute(void)
+{
+	bool	bResult;
+	int		Method;
+
+	//-----------------------------------------------------
+	// Get parameter settings...
+
+	m_pInput	= Parameters("INPUT" )->asGrid();
+	m_pOutput	= Parameters("OUTPUT")->asGrid();
+
+	Method		= Parameters("METHOD")->asInt();
+
+
+	//-----------------------------------------------------
+	// Execute calculation...
+
+	switch( Method )
+	{
+	case 0:
+		bResult	= Method_01();
+		break;
+
+	case 1:
+		bResult	= Method_02();
+		break;
+
+	case 2:
+		bResult	= Method_03();
+		break;
+
+	case 3:
+		bResult	= Method_04();
+		break;
+
+	case 4:
+		bResult	= Method_05();
+		break;
+
+	case 5:
+		bResult	= Method_06();
+		break;
+
+	default:
+		bResult	= false;
+	}
+
+
+	//-----------------------------------------------------
+	// Return 'true' if everything went okay...
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CExercise_04::Method_01(void)
+{
+	int		x, y, ix, iy, n;
+	double	s;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			s	= 0.0;
+			n	= 0;
+
+			for(iy=y-1; iy<=y+1; iy++)
+			{
+				for(ix=x-1; ix<=x+1; ix++)
+				{
+					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
+					{
+						s	+= m_pInput->asDouble(ix, iy);
+						n++;
+					}
+				}
+			}
+
+			if( n > 0 )
+			{
+				m_pOutput->Set_Value(x, y, s / n);
+			}
+			else
+			{
+				m_pOutput->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CExercise_04::Method_02(void)
+{
+	int		x, y, i, ix, iy, n;
+	double	s;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pInput->is_NoData(x, y) )
+			{
+				m_pOutput->Set_NoData(x, y);
+			}
+			else
+			{
+				s	= m_pInput->asDouble(x, y);
+				n	= 1;
+
+				for(i=0; i<8; i++)
+				{
+					ix	= Get_xTo(i, x);
+					iy	= Get_yTo(i, y);
+
+					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
+					{
+						s	+= m_pInput->asDouble(ix, iy);
+						n++;
+					}
+				}
+
+				m_pOutput->Set_Value(x, y, s / n);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CExercise_04::Method_03(void)
+{
+	int		x, y, i, ix, iy, n;
+	double	s;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pInput->is_NoData(x, y) )
+			{
+				m_pOutput->Set_NoData(x, y);
+			}
+			else
+			{
+				s	= 0.0;
+				n	= 0;
+
+				for(i=0; i<8; i++)
+				{
+					ix	= Get_xTo(i, x);
+					iy	= Get_yTo(i, y);
+
+					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
+					{
+						s	+= m_pInput->asDouble(ix, iy);
+						n++;
+					}
+				}
+
+				if( n > 0 )
+				{
+					m_pOutput->Set_Value(x, y, m_pInput->asDouble(x, y) - s / n);
+				}
+				else
+				{
+					m_pOutput->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CExercise_04::Method_04(void)
+{
+	int		x, y, i, ix, iy, n;
+	double	m, v, z[9], dz;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0, ix=1; x<Get_NX(); x++, ix++)
+		{
+			for(n=0, iy=y-1; iy<=y+1; iy++)
+			{
+				for(ix=x-1; ix<=x+1; ix++)
+				{
+					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
+					{
+						z[n++]	= m_pInput->asDouble(ix, iy);
+					}
+				}
+			}
+
+			if( n > 0 )
+			{
+				for(m=0.0, i=0; i<n; i++)
+				{
+					m	+= z[i];
+				}
+
+				m	/= n;
+
+				for(v=0.0, i=0; i<n; i++)
+				{
+					dz	 = m - z[i];
+					v	+= dz * dz;
+				}
+
+				v	/= n;
+
+				m_pOutput->Set_Value(x, y, v);
+			}
+			else
+			{
+				m_pOutput->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CExercise_04::Method_05(void)
+{
+	int		x, y, ix, iy, n;
+	double	m, v, z;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			n	= 0;
+			m	= 0.0;
+			v	= 0.0;
+
+			for(iy=y-1; iy<=y+1; iy++)
+			{
+				for(ix=x-1; ix<=x+1; ix++)
+				{
+					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
+					{
+						n++;
+
+						z	 = m_pInput->asDouble(ix, iy);
+
+						m	+= z;
+						v	+= z * z;
+					}
+				}
+			}
+
+			if( n > 0 )
+			{
+				m	= m / n;
+				v	= v / n - m * m;
+
+				m_pOutput->Set_Value(x, y, v);
+			}
+			else
+			{
+				m_pOutput->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CExercise_04::Method_06(void)
+{
+	//-----------------------------------------------------
+	if( Method_05() == false )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( m_pOutput->is_NoData(n) == false )
+		{
+			double	v	= m_pOutput->asDouble(n);
+
+			m_pOutput->Set_Value(n, sqrt(v));
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_04.h b/src/modules/garden/garden_learn_to_program/Exercise_04.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_04.h
rename to src/modules/garden/garden_learn_to_program/Exercise_04.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_05.cpp b/src/modules/garden/garden_learn_to_program/Exercise_05.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_05.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_05.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_05.h b/src/modules/garden/garden_learn_to_program/Exercise_05.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_05.h
rename to src/modules/garden/garden_learn_to_program/Exercise_05.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_06.cpp b/src/modules/garden/garden_learn_to_program/Exercise_06.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_06.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_06.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_06.h b/src/modules/garden/garden_learn_to_program/Exercise_06.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_06.h
rename to src/modules/garden/garden_learn_to_program/Exercise_06.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_07.cpp b/src/modules/garden/garden_learn_to_program/Exercise_07.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_07.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_07.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_07.h b/src/modules/garden/garden_learn_to_program/Exercise_07.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_07.h
rename to src/modules/garden/garden_learn_to_program/Exercise_07.h
diff --git a/src/modules/garden/garden_learn_to_program/Exercise_08.cpp b/src/modules/garden/garden_learn_to_program/Exercise_08.cpp
new file mode 100644
index 0000000..23acd4d
--- /dev/null
+++ b/src/modules/garden/garden_learn_to_program/Exercise_08.cpp
@@ -0,0 +1,293 @@
+/**********************************************************
+ * Version $Id: Exercise_08.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       Lectures                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Exercise_08.cpp                     //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Exercise_08.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CExercise_08::CExercise_08(void)
+{
+	//-----------------------------------------------------
+	// Give some information about your module...
+
+	Set_Name	(_TL("08: Extended neighbourhoods - catchment areas (parallel)"));
+
+	Set_Author	(_TL("Copyrights (c) 2003 by Olaf Conrad"));
+
+	Set_Description	(_TW(
+		"Extended Neighbourhoods - Catchment areas.\n"
+		"(c) 2003 by Olaf Conrad, Goettingen\n"
+		"email: oconrad at gwdg.de")
+	);
+
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL, "ELEVATION"	, _TL("Elevation grid"),
+		_TL("This must be your input data of type grid."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "AREA"		, _TL("Catchment area"),
+		_TL("This will contain your output data of type grid."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL, "METHOD"		, _TL("Method"),
+		_TL("Choose a method"),
+
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("D8"),
+			_TL("MFD")
+		)
+	);
+}
+
+//---------------------------------------------------------
+CExercise_08::~CExercise_08(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CExercise_08::On_Execute(void)
+{
+	bool	bResult;
+	int		Method;
+
+	//-----------------------------------------------------
+	// Get parameter settings...
+
+	m_pDTM		= Parameters("ELEVATION")->asGrid();
+
+	m_pArea		= Parameters("AREA"     )->asGrid();
+
+	Method		= Parameters("METHOD")->asInt();
+
+
+	m_pArea		->Assign(0.0);
+	m_pArea		->Set_Unit(SG_T("m\xc2\xb2"));
+	DataObject_Set_Colors(m_pArea, 100, SG_COLORS_WHITE_BLUE);
+
+
+	//-----------------------------------------------------
+	// Execute calculation...
+
+	switch( Method )
+	{
+	case 0:
+		bResult	= Method_01();
+		break;
+
+	case 1:
+		bResult	= Method_02();
+		break;
+
+	default:
+		bResult	= false;
+	}
+
+
+	//-----------------------------------------------------
+	// Return 'true' if everything went okay...
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CExercise_08::Method_01(void)
+{
+	int		x, y, i, ix, iy, iMax;
+	double	z, dz, dzMax,
+			Area_of_Cell	= Get_Cellsize() * Get_Cellsize();
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		m_pDTM->Get_Sorted(n, x, y, true, false);
+
+		if( m_pDTM->is_NoData(x, y) )
+		{
+			m_pArea->Set_NoData(x, y);
+		}
+		else
+		{
+			m_pArea->Add_Value(x, y, Area_of_Cell);
+
+			z		= m_pDTM->asDouble(x, y);
+			iMax	= -1;
+
+			for(i=0; i<8; i++)
+			{
+				ix		= Get_xTo(i, x);
+				iy		= Get_yTo(i, y);
+
+				if( is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) )
+				{
+					dz	= (z - m_pDTM->asDouble(ix, iy)) / Get_Length(i);
+
+					if( dz > 0.0 && (iMax < 0 || (iMax >= 0 && dzMax < dz)) )
+					{
+						iMax	= i;
+						dzMax	= dz;
+					}
+				}
+			}
+
+			if( iMax >= 0 )
+			{
+				ix		= Get_xTo(iMax, x);
+				iy		= Get_yTo(iMax, y);
+
+				m_pArea->Add_Value(ix, iy, m_pArea->asDouble(x, y));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CExercise_08::Method_02(void)
+{
+	int		x, y, i, ix, iy;
+	double	z, d, dz[8], dzSum,
+			Area_of_Cell	= Get_Cellsize() * Get_Cellsize(),
+			MFD_Converge	= 1.1;
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		m_pDTM->Get_Sorted(n, x, y, true, false);
+
+		if( m_pDTM->is_NoData(x, y) )
+		{
+			m_pArea->Set_NoData(x, y);
+		}
+		else
+		{
+			m_pArea->Add_Value(x, y, Area_of_Cell);
+
+			z		= m_pDTM->asDouble(x, y);
+			dzSum	= 0.0;
+
+			for(i=0; i<8; i++)
+			{
+				ix		= Get_xTo(i, x);
+				iy		= Get_yTo(i, y);
+
+				if( is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) && (d = z - m_pDTM->asDouble(ix, iy)) > 0.0 )
+				{
+					dz[i]	= pow(d / Get_Length(i), MFD_Converge);
+					dzSum	+= dz[i];
+				}
+				else
+				{
+					dz[i]	= 0.0;
+				}
+			}
+
+			if( dzSum > 0.0 )
+			{
+				d		= m_pArea->asDouble(x, y) / dzSum;
+
+				for(i=0; i<8; i++)
+				{
+					if( dz[i] > 0.0 )
+					{
+						ix		= Get_xTo(i, x);
+						iy		= Get_yTo(i, y);
+
+						m_pArea->Add_Value(ix, iy, dz[i] * d);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_08.h b/src/modules/garden/garden_learn_to_program/Exercise_08.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_08.h
rename to src/modules/garden/garden_learn_to_program/Exercise_08.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_09.cpp b/src/modules/garden/garden_learn_to_program/Exercise_09.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_09.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_09.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_09.h b/src/modules/garden/garden_learn_to_program/Exercise_09.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_09.h
rename to src/modules/garden/garden_learn_to_program/Exercise_09.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_10.cpp b/src/modules/garden/garden_learn_to_program/Exercise_10.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_10.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_10.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_10.h b/src/modules/garden/garden_learn_to_program/Exercise_10.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_10.h
rename to src/modules/garden/garden_learn_to_program/Exercise_10.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_11.cpp b/src/modules/garden/garden_learn_to_program/Exercise_11.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_11.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_11.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_11.h b/src/modules/garden/garden_learn_to_program/Exercise_11.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_11.h
rename to src/modules/garden/garden_learn_to_program/Exercise_11.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_12.cpp b/src/modules/garden/garden_learn_to_program/Exercise_12.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_12.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_12.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_12.h b/src/modules/garden/garden_learn_to_program/Exercise_12.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_12.h
rename to src/modules/garden/garden_learn_to_program/Exercise_12.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_13.cpp b/src/modules/garden/garden_learn_to_program/Exercise_13.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_13.cpp
rename to src/modules/garden/garden_learn_to_program/Exercise_13.cpp
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_13.h b/src/modules/garden/garden_learn_to_program/Exercise_13.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_13.h
rename to src/modules/garden/garden_learn_to_program/Exercise_13.h
diff --git a/src/modules/garden/garden_learn_to_program/Exercise_14.cpp b/src/modules/garden/garden_learn_to_program/Exercise_14.cpp
new file mode 100644
index 0000000..83071ab
--- /dev/null
+++ b/src/modules/garden/garden_learn_to_program/Exercise_14.cpp
@@ -0,0 +1,376 @@
+/**********************************************************
+ * Version $Id: Exercise_14.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    Lectures_Shapes                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Exercise_14.cpp                     //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Exercise_14.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//						Defines							 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define NOCHANNEL	0
+#define SPRING		1
+#define CHANNEL		2
+#define MOUTH		3
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CExercise_14::CExercise_14(void)
+{
+	//-----------------------------------------------------
+	// Give some information about your module...
+
+	Set_Name	(_TL("14: Vectorising channel lines"));
+
+	Set_Author	(_TL("Copyrights (c) 2003 by Olaf Conrad"));
+
+	Set_Description	(_TW(
+		"Vectorising channel lines.\n"
+		"(c) 2003 by Olaf Conrad, Goettingen\n"
+		"email: oconrad at gwdg.de")
+	);
+
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHANNELS"	, _TL("Channels (Raster)"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("Channels (Vector)"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD"	, _TL("Threshold"),
+		_TL(""),
+		PARAMETER_TYPE_Int	, 4, 0, true, 8, true
+	);
+}
+
+//---------------------------------------------------------
+CExercise_14::~CExercise_14(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CExercise_14::On_Execute(void)
+{
+	int		Threshold;
+
+	//-----------------------------------------------------
+	m_pDTM		= Parameters("ELEVATION")	->asGrid();
+	m_pChnl		= Parameters("CHANNELS")	->asGrid();
+	m_pShapes	= Parameters("SHAPES")		->asShapes();
+
+	Threshold	= Parameters("THRESHOLD")	->asInt();
+
+	//-----------------------------------------------------
+	m_pDir		= NULL;
+
+	if( Initialise(Threshold) )
+	{
+		Find_Channels();
+
+		Vectorise();
+	}
+
+	//-----------------------------------------------------
+	if( m_pDir )
+	{
+		delete(m_pDir);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CExercise_14::Initialise(int Threshold)
+{
+	int		x, y, i, ix, iy, Dir;
+	double	z, dz, dzMax;
+	CSG_Colors	Colors;
+
+	//-----------------------------------------------------
+	m_pDir	= new CSG_Grid(m_pDTM, SG_DATATYPE_Char);
+
+	m_pChnl->Assign();
+
+	Colors.Set_Count(4);
+	Colors.Set_Color(0, 192, 192, 192);	// NOCHANNEL
+	Colors.Set_Color(1,   0, 255,   0);	// SPRING
+	Colors.Set_Color(2,   0,   0, 255);	// CHANNEL
+	Colors.Set_Color(3, 255,   0,   0);	// MOUTH
+	DataObject_Set_Colors(m_pChnl, Colors);
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			Dir		= -1;
+
+			if( is_InGrid(x, y) && !m_pDTM->is_NoData(x, y) )
+			{
+				z		= m_pDTM->asDouble(x, y);
+				dzMax	= 0.0;
+
+				for(i=0; i<8; i++)
+				{
+					ix		= Get_xTo(i, x);
+					iy		= Get_yTo(i, y);
+
+					if( is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) )
+					{
+						dz		= (z - m_pDTM->asDouble(ix, iy)) / Get_Length(i);
+
+						if( dz > dzMax )
+						{
+							dzMax	= dz;
+							Dir		= i;
+						}
+					}
+				}
+			}
+
+			//---------------------------------------------
+			m_pDir->Set_Value(x, y, Dir);
+
+			if( Dir >= 0 )
+			{
+				m_pChnl->Add_Value(Get_xTo(Dir, x), Get_yTo(Dir, y), 1);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			m_pChnl->Set_Value(x, y, m_pChnl->asInt(x, y) >= Threshold ? SPRING : NOCHANNEL);
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CExercise_14::Find_Channels(void)
+{
+	int		x, y;
+
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( m_pDTM->Get_Sorted(n, x, y, true) && m_pChnl->asInt(x, y) == SPRING )
+		{
+			m_pChnl	->Set_Value(x, y, SPRING);
+
+			Find_Channels(x, y);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CExercise_14::Find_Channels(int x, int y)
+{
+	int		Dir, ix, iy;
+
+	if( (Dir = m_pDir->asInt(x, y)) >= 0 )
+	{
+		ix	= Get_xTo(Dir, x);
+		iy	= Get_yTo(Dir, y);
+
+		switch( m_pChnl->asInt(ix, iy) )
+		{
+		case NOCHANNEL: case SPRING:
+			m_pChnl	->Set_Value(ix, iy, CHANNEL);
+			Find_Channels(ix, iy);	// recursive function call...
+			break;
+
+		case CHANNEL:
+			m_pChnl	->Set_Value(ix, iy, MOUTH);
+			break;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CExercise_14::Vectorise(void)
+{
+	int			x, y, Segment_ID;
+	double		Length;
+	CSG_Shape	*pSegment;
+
+	m_pShapes->Create(SHAPE_TYPE_Line, _TL("Channels"));
+
+	m_pShapes->Add_Field("SEGMENT_ID"	, SG_DATATYPE_Int);
+	m_pShapes->Add_Field("LENGTH"		, SG_DATATYPE_Double);
+
+	//-----------------------------------------------------
+	for(y=0, Segment_ID=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			switch( m_pChnl->asInt(x, y) )
+			{
+			case SPRING: case MOUTH:
+				pSegment	= m_pShapes->Add_Shape();
+
+				Length		= Vectorise(x, y, pSegment);
+
+				if( Length > 0.0 )
+				{
+					pSegment->Set_Value(0, ++Segment_ID);
+					pSegment->Set_Value(1, Length);
+				}
+				else
+				{
+					m_pShapes->Del_Shape(pSegment);
+				}
+
+				break;
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+double CExercise_14::Vectorise(int x, int y, CSG_Shape *pSegment)
+{
+	int		Dir, ix, iy;
+	double	Length;
+
+	Length	= 0.0;
+
+	pSegment->Add_Point(Get_XMin() + x * Get_Cellsize(), Get_YMin() + y * Get_Cellsize());
+
+	if( (Dir = m_pDir->asInt(x, y)) >= 0 )
+	{
+		Length	= Get_Length(Dir);
+
+		ix		= Get_xTo(Dir, x);
+		iy		= Get_yTo(Dir, y);
+
+		switch( m_pChnl->asInt(ix, iy) )
+		{
+		case CHANNEL:
+			Length	+= Vectorise(ix, iy, pSegment);	// recursive function call...
+			break;
+
+		case MOUTH:
+			Length	+= Get_Length(Dir);
+			pSegment->Add_Point(Get_XMin() + ix * Get_Cellsize(), Get_YMin() + iy * Get_Cellsize());
+			break;
+		}
+	}
+
+	return( Length );
+}
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_14.h b/src/modules/garden/garden_learn_to_program/Exercise_14.h
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/Exercise_14.h
rename to src/modules/garden/garden_learn_to_program/Exercise_14.h
diff --git a/src/modules_lectures/lectures/lectures_introduction/MLB_Interface.cpp b/src/modules/garden/garden_learn_to_program/MLB_Interface.cpp
similarity index 100%
rename from src/modules_lectures/lectures/lectures_introduction/MLB_Interface.cpp
rename to src/modules/garden/garden_learn_to_program/MLB_Interface.cpp
diff --git a/src/modules/garden/garden_learn_to_program/MLB_Interface.h b/src/modules/garden/garden_learn_to_program/MLB_Interface.h
new file mode 100644
index 0000000..99b04a3
--- /dev/null
+++ b/src/modules/garden/garden_learn_to_program/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       Lectures                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__lectures_H
+#define HEADER_INCLUDED__lectures_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__lectures_H
diff --git a/src/modules/garden/garden_learn_to_program/Makefile.am b/src/modules/garden/garden_learn_to_program/Makefile.am
new file mode 100644
index 0000000..1b32546
--- /dev/null
+++ b/src/modules/garden/garden_learn_to_program/Makefile.am
@@ -0,0 +1,48 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libgarden_learn_to_program.la
+libgarden_learn_to_program_la_SOURCES =\
+Exercise_01.cpp\
+Exercise_02.cpp\
+Exercise_03.cpp\
+Exercise_04.cpp\
+Exercise_05.cpp\
+Exercise_06.cpp\
+Exercise_07.cpp\
+Exercise_08.cpp\
+Exercise_09.cpp\
+Exercise_10.cpp\
+Exercise_11.cpp\
+Exercise_12.cpp\
+Exercise_13.cpp\
+Exercise_14.cpp\
+MLB_Interface.cpp\
+Exercise_01.h\
+Exercise_02.h\
+Exercise_03.h\
+Exercise_04.h\
+Exercise_05.h\
+Exercise_06.h\
+Exercise_07.h\
+Exercise_08.h\
+Exercise_09.h\
+Exercise_10.h\
+Exercise_11.h\
+Exercise_12.h\
+Exercise_13.h\
+Exercise_14.h\
+MLB_Interface.h
+
+libgarden_learn_to_program_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/garden/garden_learn_to_program/Makefile.in b/src/modules/garden/garden_learn_to_program/Makefile.in
new file mode 100644
index 0000000..c5c6932
--- /dev/null
+++ b/src/modules/garden/garden_learn_to_program/Makefile.in
@@ -0,0 +1,675 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/garden/garden_learn_to_program
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libgarden_learn_to_program_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libgarden_learn_to_program_la_OBJECTS = Exercise_01.lo \
+	Exercise_02.lo Exercise_03.lo Exercise_04.lo Exercise_05.lo \
+	Exercise_06.lo Exercise_07.lo Exercise_08.lo Exercise_09.lo \
+	Exercise_10.lo Exercise_11.lo Exercise_12.lo Exercise_13.lo \
+	Exercise_14.lo MLB_Interface.lo
+libgarden_learn_to_program_la_OBJECTS =  \
+	$(am_libgarden_learn_to_program_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libgarden_learn_to_program_la_SOURCES)
+DIST_SOURCES = $(libgarden_learn_to_program_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libgarden_learn_to_program.la
+libgarden_learn_to_program_la_SOURCES = \
+Exercise_01.cpp\
+Exercise_02.cpp\
+Exercise_03.cpp\
+Exercise_04.cpp\
+Exercise_05.cpp\
+Exercise_06.cpp\
+Exercise_07.cpp\
+Exercise_08.cpp\
+Exercise_09.cpp\
+Exercise_10.cpp\
+Exercise_11.cpp\
+Exercise_12.cpp\
+Exercise_13.cpp\
+Exercise_14.cpp\
+MLB_Interface.cpp\
+Exercise_01.h\
+Exercise_02.h\
+Exercise_03.h\
+Exercise_04.h\
+Exercise_05.h\
+Exercise_06.h\
+Exercise_07.h\
+Exercise_08.h\
+Exercise_09.h\
+Exercise_10.h\
+Exercise_11.h\
+Exercise_12.h\
+Exercise_13.h\
+Exercise_14.h\
+MLB_Interface.h
+
+libgarden_learn_to_program_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_learn_to_program/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/garden/garden_learn_to_program/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgarden_learn_to_program.la: $(libgarden_learn_to_program_la_OBJECTS) $(libgarden_learn_to_program_la_DEPENDENCIES) $(EXTRA_libgarden_learn_to_program_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_learn_to_program_la_OBJECTS) $(libgarden_learn_to_program_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_02.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_03.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_04.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_05.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_06.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_07.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_08.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_09.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_10.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_11.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_12.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_13.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_14.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp b/src/modules/garden/garden_webservices/MLB_Interface.cpp
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp
rename to src/modules/garden/garden_webservices/MLB_Interface.cpp
diff --git a/src/modules_contrib/garden/garden_webservices/MLB_Interface.h b/src/modules/garden/garden_webservices/MLB_Interface.h
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/MLB_Interface.h
rename to src/modules/garden/garden_webservices/MLB_Interface.h
diff --git a/src/modules_contrib/garden/garden_webservices/Makefile.am b/src/modules/garden/garden_webservices/Makefile.am
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/Makefile.am
rename to src/modules/garden/garden_webservices/Makefile.am
diff --git a/src/modules/garden/garden_webservices/Makefile.in b/src/modules/garden/garden_webservices/Makefile.in
new file mode 100644
index 0000000..479aecd
--- /dev/null
+++ b/src/modules/garden/garden_webservices/Makefile.in
@@ -0,0 +1,635 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/garden/garden_webservices
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libgarden_webservices_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libgarden_webservices_la_OBJECTS = MLB_Interface.lo osm_import.lo \
+	wms_import.lo
+libgarden_webservices_la_OBJECTS =  \
+	$(am_libgarden_webservices_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libgarden_webservices_la_SOURCES)
+DIST_SOURCES = $(libgarden_webservices_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@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`
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libgarden_webservices.la
+libgarden_webservices_la_SOURCES = \
+MLB_Interface.cpp\
+osm_import.cpp\
+wms_import.cpp\
+MLB_Interface.h\
+osm_import.h\
+wms_import.h
+
+libgarden_webservices_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_webservices/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/garden/garden_webservices/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgarden_webservices.la: $(libgarden_webservices_la_OBJECTS) $(libgarden_webservices_la_DEPENDENCIES) $(EXTRA_libgarden_webservices_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_webservices_la_OBJECTS) $(libgarden_webservices_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/osm_import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wms_import.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_contrib/garden/garden_webservices/osm_import.cpp b/src/modules/garden/garden_webservices/osm_import.cpp
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/osm_import.cpp
rename to src/modules/garden/garden_webservices/osm_import.cpp
diff --git a/src/modules_contrib/garden/garden_webservices/osm_import.h b/src/modules/garden/garden_webservices/osm_import.h
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/osm_import.h
rename to src/modules/garden/garden_webservices/osm_import.h
diff --git a/src/modules_contrib/garden/garden_webservices/wms_import.cpp b/src/modules/garden/garden_webservices/wms_import.cpp
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/wms_import.cpp
rename to src/modules/garden/garden_webservices/wms_import.cpp
diff --git a/src/modules_contrib/garden/garden_webservices/wms_import.h b/src/modules/garden/garden_webservices/wms_import.h
similarity index 100%
rename from src/modules_contrib/garden/garden_webservices/wms_import.h
rename to src/modules/garden/garden_webservices/wms_import.h
diff --git a/src/modules/grid/Makefile.in b/src/modules/grid/Makefile.in
index 15c943c..d0db4f2 100644
--- a/src/modules/grid/Makefile.in
+++ b/src/modules/grid/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -278,11 +302,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -346,6 +370,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -409,6 +437,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -444,13 +486,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -485,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -566,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_analysis/Cost_Anisotropic.cpp b/src/modules/grid/grid_analysis/Cost_Anisotropic.cpp
index 17f57c4..333bcb8 100644
--- a/src/modules/grid/grid_analysis/Cost_Anisotropic.cpp
+++ b/src/modules/grid/grid_analysis/Cost_Anisotropic.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Cost_Anisotropic.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Cost_Anisotropic.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Cost_Anisotropic.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Cost_Anisotropic.h"
diff --git a/src/modules/grid/grid_analysis/Cost_Anisotropic.h b/src/modules/grid/grid_analysis/Cost_Anisotropic.h
index 31c8256..5d90703 100644
--- a/src/modules/grid/grid_analysis/Cost_Anisotropic.h
+++ b/src/modules/grid/grid_analysis/Cost_Anisotropic.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Cost_Anisotropic.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Cost_Anisotropic.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Cost_Anisotropic.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #ifndef HEADER_INCLUDED__Cost_Anisotropic_H
 #define HEADER_INCLUDED__Cost_Anisotropic_H
diff --git a/src/modules/grid/grid_analysis/Cost_Isotropic.cpp b/src/modules/grid/grid_analysis/Cost_Isotropic.cpp
index 598dbd8..04ada00 100644
--- a/src/modules/grid/grid_analysis/Cost_Isotropic.cpp
+++ b/src/modules/grid/grid_analysis/Cost_Isotropic.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Cost_Isotropic.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Cost_Isotropic.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Cost_Isotropic.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Cost_Isotropic.h"
diff --git a/src/modules/grid/grid_analysis/Cost_Isotropic.h b/src/modules/grid/grid_analysis/Cost_Isotropic.h
index 7ed631f..47ccdab 100644
--- a/src/modules/grid/grid_analysis/Cost_Isotropic.h
+++ b/src/modules/grid/grid_analysis/Cost_Isotropic.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Cost_Isotropic.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Cost_Isotropic.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Cost_Isotropic.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #ifndef HEADER_INCLUDED__Cost_Isotropic_H
 #define HEADER_INCLUDED__Cost_Isotropic_H
diff --git a/src/modules/grid/grid_analysis/CoveredDistance.cpp b/src/modules/grid/grid_analysis/CoveredDistance.cpp
index 24584e7..c055e13 100644
--- a/src/modules/grid/grid_analysis/CoveredDistance.cpp
+++ b/src/modules/grid/grid_analysis/CoveredDistance.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CoveredDistance.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CoveredDistance.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CoveredDistance.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 #include "CoveredDistance.h"
 
diff --git a/src/modules/grid/grid_analysis/CoveredDistance.h b/src/modules/grid/grid_analysis/CoveredDistance.h
index afc7f49..2f7a865 100644
--- a/src/modules/grid/grid_analysis/CoveredDistance.h
+++ b/src/modules/grid/grid_analysis/CoveredDistance.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CoveredDistance.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CoveredDistance.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CoveredDistance.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #if _MSC_VER > 1000
 #pragma once
diff --git a/src/modules/grid/grid_analysis/CrossClassification.cpp b/src/modules/grid/grid_analysis/CrossClassification.cpp
index 13a006b..890b4d2 100644
--- a/src/modules/grid/grid_analysis/CrossClassification.cpp
+++ b/src/modules/grid/grid_analysis/CrossClassification.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CrossClassification.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CrossClassification.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CrossClassification.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 #include "CrossClassification.h"
 
diff --git a/src/modules/grid/grid_analysis/CrossClassification.h b/src/modules/grid/grid_analysis/CrossClassification.h
index a119ebb..0ef2e23 100644
--- a/src/modules/grid/grid_analysis/CrossClassification.h
+++ b/src/modules/grid/grid_analysis/CrossClassification.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CrossClassification.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CrossClassification.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CrossClassification.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_analysis/Grid_AHP.cpp b/src/modules/grid/grid_analysis/Grid_AHP.cpp
index 31531bb..70ba1f8 100644
--- a/src/modules/grid/grid_analysis/Grid_AHP.cpp
+++ b/src/modules/grid/grid_analysis/Grid_AHP.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AHP.cpp 1407 2012-05-24 06:55:09Z manfred-e $
+ * Version $Id: Grid_AHP.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     AHP.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 #include "Grid_AHP.h"
diff --git a/src/modules/grid/grid_analysis/Grid_AHP.h b/src/modules/grid/grid_analysis/Grid_AHP.h
index b4d9796..c31cd61 100644
--- a/src/modules/grid/grid_analysis/Grid_AHP.h
+++ b/src/modules/grid/grid_analysis/Grid_AHP.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AHP.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_AHP.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     AHP.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp b/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp
index 4a929c0..9d6b452 100644
--- a/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp
+++ b/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Accumulation_Functions.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Accumulation_Functions.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -235,7 +235,7 @@ bool CGrid_Accumulation_Functions::On_Execute(void)
 	}
 
 
-	for(long n=0; n<Get_NCells() && Set_Progress(n); n++)
+	for(sLong n=0; n<Get_NCells() && Set_Progress(n); n++)
 	{
 		pSurface->Get_Sorted(n, x, y, true);
 
diff --git a/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp b/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp
index c047d40..b85c8b3 100644
--- a/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp
+++ b/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AggregationIndex.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_AggregationIndex.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     AggregationIndex.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 #include "Grid_AggregationIndex.h"
diff --git a/src/modules/grid/grid_analysis/Grid_AggregationIndex.h b/src/modules/grid/grid_analysis/Grid_AggregationIndex.h
index 64fc485..f2a44ec 100644
--- a/src/modules/grid/grid_analysis/Grid_AggregationIndex.h
+++ b/src/modules/grid/grid_analysis/Grid_AggregationIndex.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AggregationIndex.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_AggregationIndex.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     AggregationIndex.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_analysis/Grid_CVA.cpp b/src/modules/grid/grid_analysis/Grid_CVA.cpp
index 233691e..cad5bf3 100644
--- a/src/modules/grid/grid_analysis/Grid_CVA.cpp
+++ b/src/modules/grid/grid_analysis/Grid_CVA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CVA.cpp 1594 2013-01-25 14:15:15Z oconrad $
+ * Version $Id: Grid_CVA.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_CVA.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Grid_CVA.h b/src/modules/grid/grid_analysis/Grid_CVA.h
index 54ed717..70ba8b0 100644
--- a/src/modules/grid/grid_analysis/Grid_CVA.h
+++ b/src/modules/grid/grid_analysis/Grid_CVA.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CVA.h 1346 2012-03-08 17:08:55Z oconrad $
+ * Version $Id: Grid_CVA.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_CVA.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp
index 241ff8b..35560ca 100644
--- a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp
+++ b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_LayerOfMaximumValue.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_LayerOfMaximumValue.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CLayerOfMaximumValue.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #define MAXIMUM 0
diff --git a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h
index 2688a65..508aa82 100644
--- a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h
+++ b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_LayerOfMaximumValue.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_LayerOfMaximumValue.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     LayerOfMaximumValue.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_analysis/Grid_Pattern.cpp b/src/modules/grid/grid_analysis/Grid_Pattern.cpp
index bb4a6ac..b683751 100644
--- a/src/modules/grid/grid_analysis/Grid_Pattern.cpp
+++ b/src/modules/grid/grid_analysis/Grid_Pattern.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Pattern.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_Pattern.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Pattern.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Grid_Pattern.h"
diff --git a/src/modules/grid/grid_analysis/Grid_Pattern.h b/src/modules/grid/grid_analysis/Grid_Pattern.h
index 24574c3..d3b5af0 100644
--- a/src/modules/grid/grid_analysis/Grid_Pattern.h
+++ b/src/modules/grid/grid_analysis/Grid_Pattern.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Pattern.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_Pattern.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Pattern.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 //---------------------------------------------------------
diff --git a/src/modules/grid/grid_analysis/Makefile.in b/src/modules/grid/grid_analysis/Makefile.in
index 86cf09a..27038ce 100644
--- a/src/modules/grid/grid_analysis/Makefile.in
+++ b/src/modules/grid/grid_analysis/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_analysis
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_analysis_la_DEPENDENCIES =  \
@@ -110,6 +133,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_analysis_la_SOURCES)
 DIST_SOURCES = $(libgrid_analysis_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -135,6 +163,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -162,6 +191,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -174,6 +204,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -203,6 +234,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -236,7 +268,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -348,7 +379,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -356,6 +386,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -371,13 +403,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_analysis.la: $(libgrid_analysis_la_OBJECTS) $(libgrid_analysis_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_analysis.la: $(libgrid_analysis_la_OBJECTS) $(libgrid_analysis_la_DEPENDENCIES) $(EXTRA_libgrid_analysis_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_analysis_la_OBJECTS) $(libgrid_analysis_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -484,6 +518,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -534,10 +582,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -623,18 +676,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_analysis/owa.cpp b/src/modules/grid/grid_analysis/owa.cpp
index a4224d3..d1b14b8 100644
--- a/src/modules/grid/grid_analysis/owa.cpp
+++ b/src/modules/grid/grid_analysis/owa.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: owa.cpp 1394 2012-05-07 14:23:12Z manfred-e $
+ * Version $Id: owa.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     OWA.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 #include "owa.h"
diff --git a/src/modules/grid/grid_analysis/owa.h b/src/modules/grid/grid_analysis/owa.h
index 61a1a04..8224c38 100644
--- a/src/modules/grid/grid_analysis/owa.h
+++ b/src/modules/grid/grid_analysis/owa.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: owa.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: owa.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     owa.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_calculus/Fuzzify.cpp b/src/modules/grid/grid_calculus/Fuzzify.cpp
index c1daf0f..fb8c37b 100644
--- a/src/modules/grid/grid_calculus/Fuzzify.cpp
+++ b/src/modules/grid/grid_calculus/Fuzzify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Fuzzify.cpp 1318 2012-01-26 13:44:28Z oconrad $
+ * Version $Id: Fuzzify.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Fuzzify.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Fuzzify.h b/src/modules/grid/grid_calculus/Fuzzify.h
index 68cc411..6eba1e1 100644
--- a/src/modules/grid/grid_calculus/Fuzzify.h
+++ b/src/modules/grid/grid_calculus/Fuzzify.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Fuzzify.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Fuzzify.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Fuzzify.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp b/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
index e9e7e45..1e66424 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 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_Random_Terrain.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Random_Terrain.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Grid_Random_Terrain.h"
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Terrain.h b/src/modules/grid/grid_calculus/Grid_Random_Terrain.h
index 2d176b8..6cec079 100644
--- a/src/modules/grid/grid_calculus/Grid_Random_Terrain.h
+++ b/src/modules/grid/grid_calculus/Grid_Random_Terrain.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Random_Terrain.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Grid_Random_Terrain.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Random_Terrain.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 //---------------------------------------------------------
 #ifndef HEADER_INCLUDED__Grid_Random_Terrain_H
diff --git a/src/modules/grid/grid_calculus/MLB_Interface.cpp b/src/modules/grid/grid_calculus/MLB_Interface.cpp
index ab55087..52c6b9c 100644
--- a/src/modules/grid/grid_calculus/MLB_Interface.cpp
+++ b/src/modules/grid/grid_calculus/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: MLB_Interface.cpp 1937 2014-01-11 18:22:42Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -77,7 +77,7 @@ CSG_String Get_Info(int i)
 		return( _TL("Grid - Calculus") );
 
 	case MLB_INFO_Author:
-		return( SG_T("O. Conrad, A. Ringeler, V. Olaya (c) 2001-4") );
+		return( SG_T("O. Conrad, A. Ringeler, V. Olaya, J. Engels (c) 2001-2014") );
 
 	case MLB_INFO_Description:
 		return( _TL("Grid based or related calculations.") );
@@ -110,6 +110,7 @@ CSG_String Get_Info(int i)
 #include "grid_metric_conversion.h"
 #include "gradient_cartes_polar.h"
 
+#include "kff_synth.h"
 
 //---------------------------------------------------------
 // 4. Allow your modules to be created here...
@@ -143,8 +144,10 @@ CSG_Module *		Create_Module(int i)
 	case 15:		return( new CGradient_Cartes_To_Polar );
 	case 16:		return( new CGradient_Polar_To_Cartes );
 
+	case 19:		return( new Ckff_synthesis );
+
 	//-----------------------------------------------------
-	case 19:		return( NULL );
+	case 20:		return( NULL );
 	default:		return( MLB_INTERFACE_SKIP_MODULE );
 	}
 }
diff --git a/src/modules/grid/grid_calculus/Makefile.am b/src/modules/grid/grid_calculus/Makefile.am
index 7daea29..5a4e9e2 100644
--- a/src/modules/grid/grid_calculus/Makefile.am
+++ b/src/modules/grid/grid_calculus/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1549 2012-11-29 16:38:50Z oconrad $
+# $Id: Makefile.am 1937 2014-01-11 18:22:42Z reklov_w $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -16,6 +16,9 @@ libgrid_calculus_la_SOURCES =\
 Fuzzify.cpp\
 FuzzyAND.cpp\
 FuzzyOR.cpp\
+./../grid_filter/geodesic_morph_rec/errfunc.c\
+./../grid_filter/geodesic_morph_rec/spezfunc.c\
+./../grid_filter/geodesic_morph_rec/storeorg.c\
 gradient_cartes_polar.cpp\
 grid_metric_conversion.cpp\
 Grid_Calculator.cpp\
@@ -26,10 +29,15 @@ Grid_Plotter.cpp\
 Grid_Random_Field.cpp\
 Grid_Random_Terrain.cpp\
 Grid_Volume.cpp\
+kff_synth.cpp\
 MLB_Interface.cpp\
 Fuzzify.h\
 FuzzyAND.h\
 FuzzyOR.h\
+./../grid_filter/geodesic_morph_rec/errfunc.h\
+./../grid_filter/geodesic_morph_rec/rho.h\
+./../grid_filter/geodesic_morph_rec/spezfunc.h\
+./../grid_filter/geodesic_morph_rec/storeorg.h\
 gradient_cartes_polar.h\
 grid_metric_conversion.h\
 Grid_Calculator.h\
@@ -40,6 +48,7 @@ Grid_Plotter.h\
 Grid_Random_Field.h\
 Grid_Random_Terrain.h\
 Grid_Volume.h\
+kff_synth.h\
 MLB_Interface.h
 
 libgrid_calculus_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules/grid/grid_calculus/Makefile.in b/src/modules/grid/grid_calculus/Makefile.in
index ae74d28..c6afd9e 100644
--- a/src/modules/grid/grid_calculus/Makefile.in
+++ b/src/modules/grid/grid_calculus/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_calculus
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,30 +89,27 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_calculus_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 am_libgrid_calculus_la_OBJECTS = Fuzzify.lo FuzzyAND.lo FuzzyOR.lo \
-	gradient_cartes_polar.lo grid_metric_conversion.lo \
-	Grid_Calculator.lo grid_difference.lo \
-	Grid_Geometric_Figures.lo Grid_Normalise.lo Grid_Plotter.lo \
-	Grid_Random_Field.lo Grid_Random_Terrain.lo Grid_Volume.lo \
-	MLB_Interface.lo
+	errfunc.lo spezfunc.lo storeorg.lo gradient_cartes_polar.lo \
+	grid_metric_conversion.lo Grid_Calculator.lo \
+	grid_difference.lo Grid_Geometric_Figures.lo Grid_Normalise.lo \
+	Grid_Plotter.lo Grid_Random_Field.lo Grid_Random_Terrain.lo \
+	Grid_Volume.lo kff_synth.lo MLB_Interface.lo
 libgrid_calculus_la_OBJECTS = $(am_libgrid_calculus_la_OBJECTS)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -105,8 +119,22 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_calculus_la_SOURCES)
 DIST_SOURCES = $(libgrid_calculus_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -132,6 +160,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -159,6 +188,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -171,6 +201,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -200,6 +231,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -233,7 +265,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -255,7 +286,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1549 2012-11-29 16:38:50Z oconrad $
+# $Id: Makefile.am 1937 2014-01-11 18:22:42Z reklov_w $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_UNICODE_TRUE at UC_DEFS = -D_SAGA_UNICODE
@@ -268,6 +299,9 @@ libgrid_calculus_la_SOURCES = \
 Fuzzify.cpp\
 FuzzyAND.cpp\
 FuzzyOR.cpp\
+./../grid_filter/geodesic_morph_rec/errfunc.c\
+./../grid_filter/geodesic_morph_rec/spezfunc.c\
+./../grid_filter/geodesic_morph_rec/storeorg.c\
 gradient_cartes_polar.cpp\
 grid_metric_conversion.cpp\
 Grid_Calculator.cpp\
@@ -278,10 +312,15 @@ Grid_Plotter.cpp\
 Grid_Random_Field.cpp\
 Grid_Random_Terrain.cpp\
 Grid_Volume.cpp\
+kff_synth.cpp\
 MLB_Interface.cpp\
 Fuzzify.h\
 FuzzyAND.h\
 FuzzyOR.h\
+./../grid_filter/geodesic_morph_rec/errfunc.h\
+./../grid_filter/geodesic_morph_rec/rho.h\
+./../grid_filter/geodesic_morph_rec/spezfunc.h\
+./../grid_filter/geodesic_morph_rec/storeorg.h\
 gradient_cartes_polar.h\
 grid_metric_conversion.h\
 Grid_Calculator.h\
@@ -292,13 +331,14 @@ Grid_Plotter.h\
 Grid_Random_Field.h\
 Grid_Random_Terrain.h\
 Grid_Volume.h\
+kff_synth.h\
 MLB_Interface.h
 
 libgrid_calculus_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
+.SUFFIXES: .c .cpp .lo .o .obj
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -331,7 +371,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -339,6 +378,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -354,13 +395,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_calculus.la: $(libgrid_calculus_la_OBJECTS) $(libgrid_calculus_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_calculus.la: $(libgrid_calculus_la_OBJECTS) $(libgrid_calculus_la_DEPENDENCIES) $(EXTRA_libgrid_calculus_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_calculus_la_OBJECTS) $(libgrid_calculus_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -380,9 +423,55 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Random_Terrain.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Volume.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)/errfunc.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gradient_cartes_polar.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_difference.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_metric_conversion.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kff_synth.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spezfunc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/storeorg.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+errfunc.lo: ./../grid_filter/geodesic_morph_rec/errfunc.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errfunc.lo -MD -MP -MF $(DEPDIR)/errfunc.Tpo -c -o errfunc.lo `test -f './../grid_filter/geodesic_morph_rec/errfunc.c' || echo '$(srcdir)/'`./../grid_filter/geodesic_morph_rec/errfunc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/errfunc.Tpo $(DEPDIR)/errfunc.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./../grid_filter/geodesic_morph_rec/errfunc.c' object='errfunc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errfunc.lo `test -f './../grid_filter/geodesic_morph_rec/errfunc.c' || echo '$(srcdir)/'`./../grid_filter/geodesic_morph_rec/errfunc.c
+
+spezfunc.lo: ./../grid_filter/geodesic_morph_rec/spezfunc.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spezfunc.lo -MD -MP -MF $(DEPDIR)/spezfunc.Tpo -c -o spezfunc.lo `test -f './../grid_filter/geodesic_morph_rec/spezfunc.c' || echo '$(srcdir)/'`./../grid_filter/geodesic_morph_rec/spezfunc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spezfunc.Tpo $(DEPDIR)/spezfunc.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./../grid_filter/geodesic_morph_rec/spezfunc.c' object='spezfunc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spezfunc.lo `test -f './../grid_filter/geodesic_morph_rec/spezfunc.c' || echo '$(srcdir)/'`./../grid_filter/geodesic_morph_rec/spezfunc.c
+
+storeorg.lo: ./../grid_filter/geodesic_morph_rec/storeorg.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT storeorg.lo -MD -MP -MF $(DEPDIR)/storeorg.Tpo -c -o storeorg.lo `test -f './../grid_filter/geodesic_morph_rec/storeorg.c' || echo '$(srcdir)/'`./../grid_filter/geodesic_morph_rec/storeorg.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/storeorg.Tpo $(DEPDIR)/storeorg.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./../grid_filter/geodesic_morph_rec/storeorg.c' object='storeorg.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o storeorg.lo `test -f './../grid_filter/geodesic_morph_rec/storeorg.c' || echo '$(srcdir)/'`./../grid_filter/geodesic_morph_rec/storeorg.c
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -460,6 +549,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -510,10 +613,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -599,18 +707,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_calculus/gradient_cartes_polar.cpp b/src/modules/grid/grid_calculus/gradient_cartes_polar.cpp
index 86ebde3..f1779ae 100644
--- a/src/modules/grid/grid_calculus/gradient_cartes_polar.cpp
+++ b/src/modules/grid/grid_calculus/gradient_cartes_polar.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/gradient_cartes_polar.h b/src/modules/grid/grid_calculus/gradient_cartes_polar.h
index 50cbb43..922ff76 100644
--- a/src/modules/grid/grid_calculus/gradient_cartes_polar.h
+++ b/src/modules/grid/grid_calculus/gradient_cartes_polar.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/kff_synth.cpp b/src/modules/grid/grid_calculus/kff_synth.cpp
new file mode 100644
index 0000000..780a6d2
--- /dev/null
+++ b/src/modules/grid/grid_calculus/kff_synth.cpp
@@ -0,0 +1,232 @@
+/**********************************************************
+ * Version $Id: kff_synth.cpp 1963 2014-02-04 14:53:37Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     Grid_Calculus                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     kff_synth.cpp                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "kff_synth.h"
+
+extern "C" {
+	#include "./../grid_filter/geodesic_morph_rec/storeorg.h"
+	#include "./../grid_filter/geodesic_morph_rec/spezfunc.h"
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+Ckff_synthesis::Ckff_synthesis(void)
+{
+	Set_Name		(_TL("Spherical Harmonic Synthesis"));
+
+	Set_Author		(SG_T("HfT Stuttgart (c) 2013"));
+
+	Set_Description	(_TW(
+		"Synthesis of a completely normalized spherical harmonic expansion. The coefficients are "
+		"read from the input file (ASCII file, columns separated by space).\n\n"
+	));
+
+	Parameters.Add_Grid_Output (NULL,
+		                 "OUTPUT_GRID",
+						 _TL("Synthesized Grid"),
+						 _TL("Synthesized Grid"));
+
+	Parameters.Add_FilePath (NULL,
+		                     "FILE",
+							 _TL("File with Coefficients"),
+		                     _TL("ASCII file with columns degree, order, c_lm, s_lm (separated by space)"));
+
+	Parameters.Add_Value (NULL, "MINDEGREE",
+						  _TL ("Start Degree"),
+						  _TL ("Start Degree"),
+						  PARAMETER_TYPE_Int,
+						  0);
+
+	Parameters.Add_Value (NULL, "MAXDEGREE",
+						  _TL ("Expansion Degree"),
+						  _TL ("Expansion Degree"),
+						  PARAMETER_TYPE_Int,
+						  180);
+
+	Parameters.Add_Value (NULL, "LAT_START",
+						  _TL ("Start Latitude"),
+						  _TL ("Start Latitude"),
+						  PARAMETER_TYPE_Double,
+						  -90.0);
+
+	Parameters.Add_Value (NULL, "END_LAT",
+						  _TL ("End Latitude"),
+						  _TL ("End Latitude"),
+						  PARAMETER_TYPE_Double,
+						  90.0);
+
+	Parameters.Add_Value (NULL, "LONG_START",
+						  _TL ("Start Longitude"),
+						  _TL ("Start Longitude"),
+						  PARAMETER_TYPE_Double,
+						  -180.0);
+
+	Parameters.Add_Value (NULL, "END_LONG",
+						  _TL ("End Longitude"),
+						  _TL ("End Longitude"),
+						  PARAMETER_TYPE_Double,
+						  180.0);
+
+	Parameters.Add_Value (NULL, "INC",
+						  _TL ("Latitude / Longitude Increment"),
+						  _TL ("Latitude / Longitude Increment"),
+						  PARAMETER_TYPE_Double,
+						  1.0);
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+bool Ckff_synthesis::On_Execute(void)
+{
+	CSG_Grid *poutgrid;
+
+	int numlat = 0;
+	int numlong = 0;
+	int maxdegree = 0;
+	int mindegree = 0;
+	int rc = 0;
+	double inc = 0.0;
+	double lat_start = 0.0;
+	double end_lat = 0.0;
+	double long_start = 0.0;
+	double end_long = 0.0;
+	CSG_String fileName;
+    double **c_lm;
+	double **s_lm;
+	double **gitter;
+	char *error_liste = "nix";
+
+	//poutgrid = Parameters ("OUTPUT GRID")->asGrid ();
+
+	fileName	= Parameters("FILE")->asString();
+	inc = Parameters ("INC")->asDouble ();
+	mindegree = Parameters ("MINDEGREE")->asInt ();
+	maxdegree = Parameters ("MAXDEGREE")->asInt ();
+	lat_start = Parameters ("LAT_START")->asDouble ();
+	end_lat = Parameters ("END_LAT")->asDouble ();
+	long_start = Parameters ("LONG_START")->asDouble ();
+	end_long = Parameters ("END_LONG")->asDouble ();
+
+	numlat = static_cast <int> (floor ((end_lat - lat_start) / inc) + 1);
+	numlong = static_cast <int> (floor ((end_long - long_start) / inc) + 1);
+	gitter = (double **) matrix_all_alloc (numlat, numlong, 'D', 0);
+
+	read_coefficients (fileName.b_str(),
+		               mindegree,
+                       maxdegree,
+                       &c_lm,
+                       &s_lm);
+
+
+	rc = kff_synthese_regel_gitter_m (inc,
+                                    lat_start,
+                                    end_lat,
+                                    long_start,
+									end_long,
+									numlat,
+									numlong,
+                                    'A',
+                                    mindegree,
+                                    maxdegree,
+                                    c_lm,
+                                    s_lm,
+                                    gitter,
+                                    &error_liste);
+
+	poutgrid	= SG_Create_Grid(SG_DATATYPE_Double, numlong, numlat, inc, long_start, lat_start);
+	poutgrid	->Set_Name(_TL("Synthesized Grid"));
+
+	for (int y = 0; y < numlat; y++)
+	{
+		#pragma omp parallel for
+       for (int x = 0; x < numlong; x++)
+       {
+		    poutgrid->Set_Value(x,y, gitter[y][x]);
+	   }
+   }
+
+   Parameters("OUTPUT GRID")->Set_Value(poutgrid);
+
+   matrix_all_free ((void **) gitter);
+   matrix_all_free ((void **) c_lm);
+   matrix_all_free ((void **) s_lm);
+
+   return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_calculus/kff_synth.h b/src/modules/grid/grid_calculus/kff_synth.h
new file mode 100644
index 0000000..69598a6
--- /dev/null
+++ b/src/modules/grid/grid_calculus/kff_synth.h
@@ -0,0 +1,102 @@
+/**********************************************************
+ * Version $Id: kff_synth.h 1937 2014-01-11 18:22:42Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     Grid_Calculus                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      kff_synth.h                      //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__kff_synth_H
+#define HEADER_INCLUDED__kff_synth_H
+
+//---------------------------------------------------------
+
+
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class Ckff_synthesis : public CSG_Module
+{
+public:
+	Ckff_synthesis (void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Grid Generation") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__kff_synth_H
diff --git a/src/modules/grid/grid_calculus_bsl/Makefile.in b/src/modules/grid/grid_calculus_bsl/Makefile.in
index 5f2bce3..b409fc8 100644
--- a/src/modules/grid/grid_calculus_bsl/Makefile.in
+++ b/src/modules/grid/grid_calculus_bsl/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_calculus_bsl
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_calculus_bsl_la_DEPENDENCIES =  \
@@ -107,6 +130,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_calculus_bsl_la_SOURCES)
 DIST_SOURCES = $(libgrid_calculus_bsl_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -132,6 +160,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -159,6 +188,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -171,6 +201,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -200,6 +231,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -233,7 +265,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -341,7 +372,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -349,6 +379,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -364,13 +396,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_calculus_bsl.la: $(libgrid_calculus_bsl_la_OBJECTS) $(libgrid_calculus_bsl_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_calculus_bsl.la: $(libgrid_calculus_bsl_la_OBJECTS) $(libgrid_calculus_bsl_la_DEPENDENCIES) $(EXTRA_libgrid_calculus_bsl_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_calculus_bsl_la_OBJECTS) $(libgrid_calculus_bsl_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -473,6 +507,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -523,10 +571,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -612,18 +665,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_filter/FilterClumps.cpp b/src/modules/grid/grid_filter/FilterClumps.cpp
index 271435a..a8ad4bd 100644
--- a/src/modules/grid/grid_filter/FilterClumps.cpp
+++ b/src/modules/grid/grid_filter/FilterClumps.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FilterClumps.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: FilterClumps.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     FilterClumps.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "FilterClumps.h"
diff --git a/src/modules/grid/grid_filter/FilterClumps.h b/src/modules/grid/grid_filter/FilterClumps.h
index bb605d0..8851f5d 100644
--- a/src/modules/grid/grid_filter/FilterClumps.h
+++ b/src/modules/grid/grid_filter/FilterClumps.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FilterClumps.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: FilterClumps.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     FilterClumps.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #include "MLB_Interface.h"
 
diff --git a/src/modules/grid/grid_filter/Filter_Gauss.cpp b/src/modules/grid/grid_filter/Filter_Gauss.cpp
index 6578b4d..8fc5a8f 100644
--- a/src/modules/grid/grid_filter/Filter_Gauss.cpp
+++ b/src/modules/grid/grid_filter/Filter_Gauss.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Gauss.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Filter_Gauss.cpp 1960 2014-02-03 12:43:13Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -167,6 +167,7 @@ bool CFilter_Gauss::On_Execute(void)
 		//-------------------------------------------------
 		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_pInput->is_InGrid(x, y) )
diff --git a/src/modules/grid/grid_filter/Filter_Rank.cpp b/src/modules/grid/grid_filter/Filter_Rank.cpp
index 90f9999..b701119 100644
--- a/src/modules/grid/grid_filter/Filter_Rank.cpp
+++ b/src/modules/grid/grid_filter/Filter_Rank.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Rank.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Filter_Rank.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -130,7 +130,7 @@ CFilter_Rank::CFilter_Rank(void)
 //---------------------------------------------------------
 bool CFilter_Rank::On_Execute(void)
 {
-	int			x, y, ix, iy;
+	int			x, y;
 	double		Rank;
 	CSG_Grid	*pResult;
 
diff --git a/src/modules/grid/grid_filter/Filter_Sieve.cpp b/src/modules/grid/grid_filter/Filter_Sieve.cpp
new file mode 100644
index 0000000..658dfaf
--- /dev/null
+++ b/src/modules/grid/grid_filter/Filter_Sieve.cpp
@@ -0,0 +1,278 @@
+/**********************************************************
+ * Version $Id: Filter_Sieve.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Filter_Sieve.cpp                    //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Filter_Sieve.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFilter_Sieve::CFilter_Sieve(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Sieving Classes"));
+
+	Set_Author		("O.Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Majority filter for grids."
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "INPUT"		, _TL("Classes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "OUTPUT"		, _TL("Sieved Classes"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "MODE"		, _TL("Neighbourhood"),
+		_TL("Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Neumann"),
+			_TL("Moore")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD"	, _TL("Minimum Threshold"),
+		_TL("Minimum number of cells in a group of adjacent cells."),
+		PARAMETER_TYPE_Int, 4, 2, true
+	);
+
+	CSG_Parameter	*pNode	= Parameters.Add_Choice(
+		NULL	, "ALL"			, _TL("Class Selection"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("single class"),
+			_TL("all classes")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		pNode	, "CLASS"		, _TL("Class Identifier"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CFilter_Sieve::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "ALL") )
+	{
+		pParameters->Get_Parameter("CLASS")->Set_Enabled(pParameter->asInt() == 0);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFilter_Sieve::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pGrid		= Parameters("OUTPUT")->asGrid();
+
+	if( m_pGrid && m_pGrid != Parameters("INPUT")->asGrid() )
+	{
+		m_pGrid->Create(*Parameters("INPUT")->asGrid());
+	}
+	else
+	{
+		m_pGrid	= Parameters("INPUT")->asGrid();
+	}
+
+	//-----------------------------------------------------
+	m_Mode		= Parameters("MODE"     )->asInt() == 0 ? 2 : 1;
+	m_Threshold	= Parameters("THRESHOLD")->asInt();
+
+	bool	bAll	= Parameters("ALL"  )->asInt() == 1;
+	double	Class	= Parameters("CLASS")->asDouble();
+
+	//-----------------------------------------------------
+	Lock_Create();
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !Lock_Get(x, y) && !m_pGrid->is_NoData(x, y) && (bAll || Class == m_pGrid->asDouble(x, y)) )
+			{
+				m_Class	= m_pGrid->asDouble(x, y);
+
+				if( Get_Size(x, y) < m_Threshold )
+				{
+					Do_Sieve(x, y);
+				}
+				else
+				{
+					Do_Keep (x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Lock_Destroy();
+
+	if( m_pGrid == Parameters("INPUT")->asGrid() )
+	{
+		DataObject_Update(m_pGrid);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CFilter_Sieve::Get_Size(int x, int y, int n)
+{
+	if( m_pGrid->is_InGrid(x, y) && m_Class == m_pGrid->asDouble(x, y) )
+	{
+		switch( Lock_Get(x, y) )
+		{
+		case 0:	// not yet processed at all
+			{
+				Lock_Set(x, y, 1);
+
+				n++;
+
+				for(int i=0; i<8 && n<m_Threshold; i+=m_Mode)
+				{
+					n	= Get_Size(Get_xTo(i, x), Get_yTo(i, y), n);
+				}
+
+				return( n );
+			}
+
+		case 2:	// marked as not to be sieved, so don't sieve any adjacent cell either
+			{
+				return( m_Threshold );
+			}
+		}
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+void CFilter_Sieve::Do_Keep(int x, int y)
+{
+	if( m_pGrid->is_InGrid(x, y) && Lock_Get(x, y) == 1 )
+	{
+		Lock_Set(x, y, 2);
+
+		for(int i=0; i<8; i+=m_Mode)
+		{
+			Do_Keep(Get_xTo(i, x), Get_yTo(i, y));
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFilter_Sieve::Do_Sieve(int x, int y)
+{
+	if( m_pGrid->is_InGrid(x, y) && Lock_Get(x, y) == 1 )
+	{
+		Lock_Set(x, y, 3);
+
+		m_pGrid->Set_NoData(x, y);
+
+		for(int i=0; i<8; i+=m_Mode)
+		{
+			Do_Sieve(Get_xTo(i, x), Get_yTo(i, y));
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_filter/Filter_Sieve.h b/src/modules/grid/grid_filter/Filter_Sieve.h
new file mode 100644
index 0000000..9525c78
--- /dev/null
+++ b/src/modules/grid/grid_filter/Filter_Sieve.h
@@ -0,0 +1,120 @@
+/**********************************************************
+ * Version $Id: Filter_Sieve.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Filter_Sieve.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__Filter_Sieve_H
+#define HEADER_INCLUDED__Filter_Sieve_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CFilter_Sieve : public CSG_Module_Grid
+{
+public:
+	CFilter_Sieve(void);
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+	int						m_Mode, m_Threshold;
+
+	double					m_Class;
+
+	CSG_Grid				*m_pGrid;
+
+
+	int						Get_Size				(int x, int y, int n = 0);
+
+	void					Do_Keep					(int x, int y);
+	void					Do_Sieve				(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Filter_Sieve_H
diff --git a/src/modules/grid/grid_filter/MLB_Interface.cpp b/src/modules/grid/grid_filter/MLB_Interface.cpp
index b428fd8..5283f40 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: MLB_Interface.cpp 1991 2014-02-13 12:29:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -77,7 +77,7 @@ CSG_String Get_Info(int i)
 		return( _TL("Grid - Filter") );
 
 	case MLB_INFO_Author:
-		return( SG_T("SAGA User Group Associaton (c) 2002-10") );
+		return( SG_T("SAGA User Group Associaton, HfT Stuttgart (c) 2002-14") );
 
 	case MLB_INFO_Description:
 		return( _TL("Tools for the manipulation of gridded data.") );
@@ -106,6 +106,10 @@ CSG_String Get_Info(int i)
 #include "Filter_Rank.h"
 #include "mesh_denoise.h"
 #include "Filter_Resample.h"
+#include "geomrec.h"
+#include "bin_erosion_reconst.h"
+#include "connect_analysis.h"
+#include "Filter_Sieve.h"
 
 
 //---------------------------------------------------------
@@ -127,9 +131,14 @@ CSG_Module *		Create_Module(int i)
 	case  9:	return( new CFilter_Rank );
 	case 10:	return( new CMesh_Denoise_Grid );
 	case 11:	return( new CFilter_Resample );
-	}
+	case 12:	return( new CGeomrec );
+	case 13:	return( new Cbin_erosion_reconst );
+	case 14:	return( new Cconnectivity_analysis );
+	case 15:	return( new CFilter_Sieve );
 
-	return( NULL );
+	case 16:	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 40e3439..0257b1f 100644
--- a/src/modules/grid/grid_filter/Makefile.am
+++ b/src/modules/grid/grid_filter/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1535 2012-11-15 12:18:45Z oconrad $
+# $Id: Makefile.am 1991 2014-02-13 12:29:09Z oconrad $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -13,6 +13,8 @@ AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMP
 AM_LDFLAGS         = -fPIC -shared -avoid-version
 pkglib_LTLIBRARIES = libgrid_filter.la
 libgrid_filter_la_SOURCES =\
+bin_erosion_reconst.cpp\
+connect_analysis.cpp\
 Filter.cpp\
 Filter_3x3.cpp\
 Filter_Gauss.cpp\
@@ -22,10 +24,18 @@ Filter_Morphology.cpp\
 Filter_Multi_Dir_Lee.cpp\
 Filter_Rank.cpp\
 Filter_Resample.cpp\
+Filter_Sieve.cpp\
 Filter_Terrain_SlopeBased.cpp\
 FilterClumps.cpp\
+geomrec.cpp\
+./geodesic_morph_rec/bin_geovinc.c\
+./geodesic_morph_rec/combcontour.c\
+./geodesic_morph_rec/geovinc.c\
+./geodesic_morph_rec/storeorg.c\
 mesh_denoise.cpp\
 MLB_Interface.cpp\
+bin_erosion_reconst.h\
+connect_analysis.h\
 Filter.h\
 Filter_3x3.h\
 Filter_Gauss.h\
@@ -35,8 +45,15 @@ Filter_Morphology.h\
 Filter_Multi_Dir_Lee.h\
 Filter_Rank.h\
 Filter_Resample.h\
+Filter_Sieve.h\
 Filter_Terrain_SlopeBased.h\
 FilterClumps.h\
+geomrec.h\
+./geodesic_morph_rec/bin_geovinc.h\
+./geodesic_morph_rec/combcontour.h\
+./geodesic_morph_rec/geovinc.h\
+./geodesic_morph_rec/listfuncs.inc\
+./geodesic_morph_rec/storeorg.h\
 mesh_denoise.h\
 MLB_Interface.h
 
diff --git a/src/modules/grid/grid_filter/Makefile.in b/src/modules/grid/grid_filter/Makefile.in
index 5cf6ab2..d826fa5 100644
--- a/src/modules/grid/grid_filter/Makefile.in
+++ b/src/modules/grid/grid_filter/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_filter
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,29 +89,28 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_filter_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libgrid_filter_la_OBJECTS = Filter.lo Filter_3x3.lo Filter_Gauss.lo \
+am_libgrid_filter_la_OBJECTS = bin_erosion_reconst.lo \
+	connect_analysis.lo Filter.lo Filter_3x3.lo Filter_Gauss.lo \
 	Filter_LoG.lo Filter_Majority.lo Filter_Morphology.lo \
 	Filter_Multi_Dir_Lee.lo Filter_Rank.lo Filter_Resample.lo \
-	Filter_Terrain_SlopeBased.lo FilterClumps.lo mesh_denoise.lo \
-	MLB_Interface.lo
+	Filter_Sieve.lo Filter_Terrain_SlopeBased.lo FilterClumps.lo \
+	geomrec.lo bin_geovinc.lo combcontour.lo geovinc.lo \
+	storeorg.lo mesh_denoise.lo MLB_Interface.lo
 libgrid_filter_la_OBJECTS = $(am_libgrid_filter_la_OBJECTS)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -104,8 +120,22 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_filter_la_SOURCES)
 DIST_SOURCES = $(libgrid_filter_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -131,6 +161,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -158,6 +189,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -170,6 +202,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -199,6 +232,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -232,7 +266,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -254,7 +287,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1535 2012-11-15 12:18:45Z oconrad $
+# $Id: Makefile.am 1991 2014-02-13 12:29:09Z oconrad $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_UNICODE_TRUE at UC_DEFS = -D_SAGA_UNICODE
@@ -264,6 +297,8 @@ AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS = -fPIC -shared -avoid-version
 pkglib_LTLIBRARIES = libgrid_filter.la
 libgrid_filter_la_SOURCES = \
+bin_erosion_reconst.cpp\
+connect_analysis.cpp\
 Filter.cpp\
 Filter_3x3.cpp\
 Filter_Gauss.cpp\
@@ -273,10 +308,18 @@ Filter_Morphology.cpp\
 Filter_Multi_Dir_Lee.cpp\
 Filter_Rank.cpp\
 Filter_Resample.cpp\
+Filter_Sieve.cpp\
 Filter_Terrain_SlopeBased.cpp\
 FilterClumps.cpp\
+geomrec.cpp\
+./geodesic_morph_rec/bin_geovinc.c\
+./geodesic_morph_rec/combcontour.c\
+./geodesic_morph_rec/geovinc.c\
+./geodesic_morph_rec/storeorg.c\
 mesh_denoise.cpp\
 MLB_Interface.cpp\
+bin_erosion_reconst.h\
+connect_analysis.h\
 Filter.h\
 Filter_3x3.h\
 Filter_Gauss.h\
@@ -286,8 +329,15 @@ Filter_Morphology.h\
 Filter_Multi_Dir_Lee.h\
 Filter_Rank.h\
 Filter_Resample.h\
+Filter_Sieve.h\
 Filter_Terrain_SlopeBased.h\
 FilterClumps.h\
+geomrec.h\
+./geodesic_morph_rec/bin_geovinc.h\
+./geodesic_morph_rec/combcontour.h\
+./geodesic_morph_rec/geovinc.h\
+./geodesic_morph_rec/listfuncs.inc\
+./geodesic_morph_rec/storeorg.h\
 mesh_denoise.h\
 MLB_Interface.h
 
@@ -295,7 +345,7 @@ libgrid_filter_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
+.SUFFIXES: .c .cpp .lo .o .obj
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -328,7 +378,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -336,6 +385,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -351,13 +402,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_filter.la: $(libgrid_filter_la_OBJECTS) $(libgrid_filter_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_filter.la: $(libgrid_filter_la_OBJECTS) $(libgrid_filter_la_DEPENDENCIES) $(EXTRA_libgrid_filter_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_filter_la_OBJECTS) $(libgrid_filter_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -376,9 +429,66 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter_Multi_Dir_Lee.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter_Rank.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter_Resample.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter_Sieve.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter_Terrain_SlopeBased.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)/bin_erosion_reconst.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bin_geovinc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/combcontour.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/connect_analysis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geomrec.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geovinc.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)/storeorg.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+bin_geovinc.lo: ./geodesic_morph_rec/bin_geovinc.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bin_geovinc.lo -MD -MP -MF $(DEPDIR)/bin_geovinc.Tpo -c -o bin_geovinc.lo `test -f './geodesic_morph_rec/bin_geovinc.c' || echo '$(srcdir)/'`./geodesic_morph_rec/bin_geovinc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/bin_geovinc.Tpo $(DEPDIR)/bin_geovinc.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./geodesic_morph_rec/bin_geovinc.c' object='bin_geovinc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bin_geovinc.lo `test -f './geodesic_morph_rec/bin_geovinc.c' || echo '$(srcdir)/'`./geodesic_morph_rec/bin_geovinc.c
+
+combcontour.lo: ./geodesic_morph_rec/combcontour.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT combcontour.lo -MD -MP -MF $(DEPDIR)/combcontour.Tpo -c -o combcontour.lo `test -f './geodesic_morph_rec/combcontour.c' || echo '$(srcdir)/'`./geodesic_morph_rec/combcontour.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/combcontour.Tpo $(DEPDIR)/combcontour.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./geodesic_morph_rec/combcontour.c' object='combcontour.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o combcontour.lo `test -f './geodesic_morph_rec/combcontour.c' || echo '$(srcdir)/'`./geodesic_morph_rec/combcontour.c
+
+geovinc.lo: ./geodesic_morph_rec/geovinc.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT geovinc.lo -MD -MP -MF $(DEPDIR)/geovinc.Tpo -c -o geovinc.lo `test -f './geodesic_morph_rec/geovinc.c' || echo '$(srcdir)/'`./geodesic_morph_rec/geovinc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/geovinc.Tpo $(DEPDIR)/geovinc.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./geodesic_morph_rec/geovinc.c' object='geovinc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o geovinc.lo `test -f './geodesic_morph_rec/geovinc.c' || echo '$(srcdir)/'`./geodesic_morph_rec/geovinc.c
+
+storeorg.lo: ./geodesic_morph_rec/storeorg.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT storeorg.lo -MD -MP -MF $(DEPDIR)/storeorg.Tpo -c -o storeorg.lo `test -f './geodesic_morph_rec/storeorg.c' || echo '$(srcdir)/'`./geodesic_morph_rec/storeorg.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/storeorg.Tpo $(DEPDIR)/storeorg.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./geodesic_morph_rec/storeorg.c' object='storeorg.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o storeorg.lo `test -f './geodesic_morph_rec/storeorg.c' || echo '$(srcdir)/'`./geodesic_morph_rec/storeorg.c
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -456,6 +566,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -506,10 +630,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -595,18 +724,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_filter/bin_erosion_reconst.cpp b/src/modules/grid/grid_filter/bin_erosion_reconst.cpp
new file mode 100644
index 0000000..ccac801
--- /dev/null
+++ b/src/modules/grid/grid_filter/bin_erosion_reconst.cpp
@@ -0,0 +1,232 @@
+/**********************************************************
+ * Version $Id: bin_erosion_reconst.cpp 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 bin_erosion_reconst.c                 //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "bin_erosion_reconst.h"
+
+extern "C" {
+	#include "geodesic_morph_rec/storeorg.h"
+	#include "geodesic_morph_rec/bin_geovinc.h"
+}
+
+#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
+	bool	bResult;\
+	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
+	if( !bResult ) return( false );\
+}
+
+#define SET_PARAMETER(IDENTIFIER, VALUE) \
+	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
+
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+Cbin_erosion_reconst::Cbin_erosion_reconst(void)
+{
+	Set_Name		(_TL("Binary Erosion-Reconstruction"));
+
+	Set_Author		(SG_T("HfT Stuttgart (c) 2013"));
+
+	Set_Description	(_TW(
+		"Common binary Opening does not guarantee, that foreground regions which "
+		"outlast the erosion step are reconstructed to their original shape in the "
+		"dilation step. Depending on the application, that might be considered as a "
+		"deficiency. Therefore this module provides a combination of erosion with "
+		"the binary Geodesic Morphological Reconstruction, see \n"
+		"L. Vincent (1993): Morphological Grayscale Reconstruction in Image Analysis: "
+		"Applications and Efficient Algorithms. "
+		"IEEE Transactions on Image Processing, Vol. 2, No 2\n"
+		"Here we use the algorithm on p. 194: Breadth-first Scanning.\n\n"
+		"The marker is defined as the eroded INPUT_GRID, whereas the mask is just "
+		"the INPUT_GRID itself. OUTPUT_GRID is the reconstruction of the marker under "
+		"the mask.\n"
+	));
+
+	Parameters.Add_Grid (NULL, 
+		                 "INPUT_GRID", 
+						 _TL ("Input Grid"), 
+						 _TL ("Grid to be filtered"), 
+						 PARAMETER_INPUT);
+
+    // Data type of the output values is signed Byte. We wish to retain NoData values 
+	// unaltered. With the types Bit or unsigned Byte, however, we are not able 
+	// to distinguish 0 from NoData.
+
+	Parameters.Add_Grid (NULL, 
+		                 "OUTPUT_GRID", 
+						 _TL("Output Grid"), 
+						 _TL("Reconstruction result"), 
+						 PARAMETER_OUTPUT, 
+						 true, 
+						 SG_DATATYPE_Char);
+
+	Parameters.Add_Value (NULL,
+		                  "RADIUS",
+						  _TL ("Filter Size (Radius)"),
+						  _TL ("Filter size (radius in grid cells)"),
+						  PARAMETER_TYPE_Int,
+						  3);
+
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+bool Cbin_erosion_reconst::On_Execute(void)
+{
+	CSG_Grid *pinpgrid, *bingrid, *poutgrid;
+
+	unsigned short numrows;
+	unsigned short numcols;
+	char **mask;
+	char **marker;
+
+	pinpgrid = Parameters ("INPUT_GRID")->asGrid ();
+	poutgrid = Parameters ("OUTPUT_GRID")->asGrid ();
+
+	numrows=pinpgrid->Get_NY();
+	numcols=pinpgrid->Get_NX();
+
+	// bingrid is not an output grid here, so it must be created ad hoc
+
+	bingrid = SG_Create_Grid(SG_DATATYPE_Char,
+	                         pinpgrid->Get_NX(),
+							 pinpgrid->Get_NY(),
+							 pinpgrid->Get_Cellsize(),
+							 pinpgrid->Get_XMin(),
+							 pinpgrid->Get_YMin());
+
+	if (bingrid == NULL)
+	{
+	    SG_UI_Msg_Add_Error(_TL("Unable to create grid for the eroded image!"));
+
+		return (false);
+	}
+
+	RUN_MODULE("grid_filter"			, 8,
+	       SET_PARAMETER("INPUT"		, pinpgrid)
+	    && SET_PARAMETER("RESULT"		, bingrid)
+	    && SET_PARAMETER("MODE"		, 1)
+		&& SET_PARAMETER("RADIUS"		, Parameters ("RADIUS")->asInt())
+		&& SET_PARAMETER("METHOD"		, 1)
+    )
+
+	mask = (char **) matrix_all_alloc (numrows, numcols, 'C', 0);
+	marker = (char **) matrix_all_alloc (numrows, numcols, 'C', 0);
+
+	for (int y = 0; y < numrows; y++)
+	{
+       #pragma omp parallel for
+       for (int x = 0; x < numcols; x++)
+       {
+		  if (pinpgrid->is_NoData(x,y)) // check if there are no_data in input datasets
+		  {
+		 	 mask [y][x] = 0;
+		 	 marker [y][x] = 0;
+		  }
+		  else
+		  {
+			 mask [y][x] = pinpgrid->asChar(x,y);
+			 marker [y][x] = bingrid->asChar(x,y);
+		  }
+       }
+	}
+
+	bingrid->Destroy();
+
+    binary_geodesic_morphological_reconstruction (numrows, numcols, mask, marker);
+
+    for (int y = 0; y < Get_NY () && Set_Progress(y, Get_NY()); y++)
+    {
+	    #pragma omp parallel for
+	    for (int x = 0; x < Get_NX (); x++)
+	    {
+		    if (pinpgrid->is_NoData(x,y))
+		        poutgrid->Set_NoData(x,y);
+		    else
+		        poutgrid->Set_Value(x,y, marker[y][x]);
+	    }
+    }
+
+
+	matrix_all_free ((void **) mask);
+    matrix_all_free ((void **) marker);
+
+    return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_filter/bin_erosion_reconst.h b/src/modules/grid/grid_filter/bin_erosion_reconst.h
new file mode 100644
index 0000000..53dc592
--- /dev/null
+++ b/src/modules/grid/grid_filter/bin_erosion_reconst.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * Version $Id: bin_erosion_reconst.h 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 bin_erosion_reconst.h                 //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__bin_erosion_reconst_H
+#define HEADER_INCLUDED__bin erosion_reconst_H
+
+//---------------------------------------------------------
+
+
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class Cbin_erosion_reconst : public CSG_Module_Grid
+{
+public:
+	Cbin_erosion_reconst (void);
+
+
+protected:
+
+	virtual bool On_Execute (void);
+
+
+private:
+	int						m_Radius, m_Threshold;
+
+	CSG_Grid				m_Kernel, *m_pInput;
+
+
+	bool					Get_Range		(int x, int y, double &Minimum, double &Maximum);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__bin_erosion_reconst_H
diff --git a/src/modules/grid/grid_filter/connect_analysis.cpp b/src/modules/grid/grid_filter/connect_analysis.cpp
new file mode 100644
index 0000000..33308f2
--- /dev/null
+++ b/src/modules/grid/grid_filter/connect_analysis.cpp
@@ -0,0 +1,413 @@
+/**********************************************************
+ * Version $Id: connect_analysis.cpp 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  connect_analysis.c                   //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "connect_analysis.h"
+
+extern "C" {
+	#include "geodesic_morph_rec/storeorg.h"
+	#include "geodesic_morph_rec/combcontour.h"
+}
+
+//---------------------------------------------------------
+#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
+	bool	bResult;\
+	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
+	if( !bResult ) return( false );\
+}
+
+#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+Cconnectivity_analysis::Cconnectivity_analysis(void)
+{
+	Set_Name		(_TL("Connectivity Analysis"));
+
+	Set_Author		(SG_T("HfT Stuttgart (c) 2013"));
+
+	Set_Description	(_TW(
+		"Connectivity analysis of a binary input image according to \n"
+		"Burger, W., Burge, M.: Digitale Bildverarbeitung. "
+		"Springer Verlag 2006, p.208.\n"
+		"Output consists in a symbolic image of the connected foreground regions "
+		"and a shape of the borders of the foreground regions (outer and inner "
+		"borders). The shape may contain alternatively the centers or the corners "
+		"of the border pixels. Optionally, the regions which have contact with "
+		"the image borders can be removed together with their border shapes. \n"
+		"In addition, an optional morphological filter (erosion-binary reconstruction) "
+		"can be applied to the input image first. \n\n"
+	));
+
+	Parameters.Add_Grid (NULL,
+		                 "INPUT_GRID",
+						 _TL ("Input Binary Grid"),
+						 _TL ("Binary input image for the connectivity analysis"),
+						 PARAMETER_INPUT);
+
+	Parameters.Add_Grid (NULL,
+		                 "FILTERED_MASK",
+						 _TL("Filtered Image"),
+						 _TL("Morphologically filtered binary mask"),
+						 PARAMETER_OUTPUT_OPTIONAL,
+						 true,
+						 SG_DATATYPE_Char);
+
+	Parameters.Add_Value (NULL,
+		                  "FILTER",
+						  _TL ("Apply Filter?"),
+						  _TL ("Apply a filter (erosion - binary reconstruction) to the input image "),
+						  PARAMETER_TYPE_Bool,
+						  true);
+
+	Parameters.Add_Value (Parameters("FILTER"),
+		                  "SIZE",
+						  _TL ("Filter Size (Radius)"),
+						  _TL ("Filter size (radius in grid cells)"),
+						  PARAMETER_TYPE_Int,
+						  3);
+
+//	Parameters.Add_Grid_Output(NULL, "SYMBOLIC_IMAGE", _TL("Symbolic Image"), _TL("The final symbolic image"));
+
+	Parameters.Add_Grid (NULL,
+		                 "SYMBOLIC_IMAGE",
+						 _TL("Symbolic Image"),
+						 _TL("The final symbolic image"),
+						 PARAMETER_OUTPUT);
+
+	Parameters.Add_Shapes (NULL,
+		                   "OUTLINES",
+						   _TL("Outlines"),
+						   _TL("Polygon outlines of object regions"),
+						   PARAMETER_OUTPUT,
+						   SHAPE_TYPE_Polygon);
+
+	Parameters.Add_Value (NULL,
+		                  "BORDER_PIXEL_CENTERS",
+						  _TL ("Pixel Centers?"),
+						  _TL ("Should the output shapes contain the centers of the border pixels instead of the corners?"),
+						  PARAMETER_TYPE_Bool,
+						  false);
+
+    Parameters.Add_Value (NULL,
+		                  "REMOVE_MARGINAL_REGIONS",
+						  _TL ("Remove Border Regions?"),
+						  _TL ("Remove regions which have contact with (are adjacent to) the image borders?"),
+						  PARAMETER_TYPE_Bool,
+						  false);
+
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+bool Cconnectivity_analysis::On_Execute(void)
+{
+	CSG_Grid *pinpgrid, *bingrid, *symb_grid, *hgrid;
+	CSG_Shapes *pOutlines;
+
+	bool filter, corners_centers, remove_marginal_regions;
+	unsigned short numrows;
+	unsigned short numcols;
+	unsigned char center;
+	double xmin;
+	double ymin;
+	short interm_grid_created;
+    simple_REGIONC_list *reg_first;
+    simple_REGIONC_list *reg_last;
+	simple_REGIONC_list *reg_curr;
+
+	pinpgrid = Parameters ("INPUT_GRID")->asGrid();
+	bingrid = Parameters ("FILTERED_MASK")->asGrid();
+	filter = Parameters ("FILTER")->asBool();
+	corners_centers = Parameters ("BORDER_PIXEL_CENTERS")->asBool();
+	remove_marginal_regions = Parameters ("REMOVE_MARGINAL_REGIONS")->asBool();
+	pOutlines = Parameters("OUTLINES")->asShapes();
+	symb_grid = Parameters ("SYMBOLIC_IMAGE")->asGrid();
+	CSG_String	sName = pOutlines->Get_Name();
+	pOutlines->Destroy();
+	pOutlines->Set_Name(sName);
+	pOutlines->Add_Field(SG_T("ID"), SG_DATATYPE_Int);
+
+	numrows=pinpgrid->Get_NY()+2;
+	numcols=pinpgrid->Get_NX()+2;
+//	xmin=pinpgrid->Get_XMin()-2*pinpgrid->Get_Cellsize();
+//	ymin=pinpgrid->Get_YMin()-2*pinpgrid->Get_Cellsize();
+
+	xmin=pinpgrid->Get_XMin();
+	ymin=pinpgrid->Get_YMin();
+
+	unsigned char **bin_image;
+	long **symb_image;
+
+	if (corners_centers)
+		center = 1;
+	else
+		center = 0;
+
+	bin_image = (unsigned char **) matrix_all_alloc (numrows, numcols, 'U', 0);
+	symb_image = (long **) matrix_all_alloc (numrows, numcols, 'L', 0);
+
+	interm_grid_created = 0;
+
+	//SG_Free(bin_image);
+	//CSG_Grid *pTmp = new CSG_Grid();
+	//delete pTmp;
+
+	if (filter)
+	{
+		if (bingrid == NULL)
+		{
+			SG_UI_Msg_Add(_TL("Filtered mask will be created automatically ..."), true);
+
+			bingrid = SG_Create_Grid(SG_DATATYPE_Char,
+				                     pinpgrid->Get_NX(),
+									 pinpgrid->Get_NY(),
+									 pinpgrid->Get_Cellsize(),
+									 pinpgrid->Get_XMin(),
+									 pinpgrid->Get_YMin());
+
+			if (bingrid == NULL)
+			{
+				SG_UI_Msg_Add_Error(_TL("Unable to create filtered mask grid!"));
+	            matrix_all_free ((void **) bin_image);
+	            matrix_all_free ((void **) symb_image);
+
+				return (false);
+			}
+
+			Parameters("FILTERED_MASK")->Set_Value(bingrid);
+			interm_grid_created = 1;
+		}
+
+
+		//-----------------------------------------------------
+		RUN_MODULE("grid_filter"			, 13,
+				SET_PARAMETER("INPUT_GRID"  , pinpgrid)
+			&&	SET_PARAMETER("OUTPUT_GRID"	, bingrid)
+			&&	SET_PARAMETER("RADIUS"		, Parameters ("SIZE")->asInt())
+		)
+
+		hgrid = bingrid;
+	}
+	else
+	{
+	    hgrid = pinpgrid;
+	}
+
+    for (int y = 0; y < hgrid->Get_NY () && Set_Progress(y, hgrid->Get_NY()); y++)
+	{
+	    for (int x = 0; x < hgrid->Get_NX(); x++)
+		{
+            if (hgrid->is_NoData(x,y))
+		        bin_image[y+1][x+1] = 0;
+			else
+		        bin_image[y+1][x+1] = hgrid->asChar(x,y);
+		}
+	}
+
+
+	// Here the regions are removed which have contact with the image margins;
+	// this is achieved by a region growing
+
+	if (remove_marginal_regions)
+	{
+		for (int y = 1; y < numrows - 1; y++)
+		{
+			if (bin_image [y][1] != 0)
+				background_region_growing (bin_image, numrows, numcols, y, 1);
+
+			if (bin_image [y][numcols - 2] != 0)
+				background_region_growing (bin_image, numrows, numcols, y, numcols-2);
+		}
+
+		for (int x = 1; x < numcols - 1; x++)
+		{
+			if (bin_image [1][x] != 0)
+				background_region_growing (bin_image, numrows, numcols, 1, x);
+
+			if (bin_image [numrows-2][x] != 0)
+				background_region_growing (bin_image, numrows, numcols, numrows-2, x);
+		}
+
+		if (filter)
+		{
+		    for (int y = 0; y < bingrid->Get_NY (); y++)
+ 	        {
+     		    #pragma omp parallel for
+		        for (int x = 0; x < bingrid->Get_NX(); x++)
+		        {
+			        bingrid->Set_Value(x, y, bin_image[y+1][x+1]);
+		        }
+	        }
+		}
+	}
+
+	if (interm_grid_created)
+		bingrid->Destroy();
+
+
+	// The function which does the proper work: 
+	// computation of the symbolic image, construction of the border chains (shapes)
+	
+	comb_contour_region_marking (numrows,
+                                 numcols,
+                                 bin_image,
+                                 symb_image,
+                                 &reg_first,
+                                 &reg_last,
+                                 center);
+
+
+	for (int y = 0; y < symb_grid->Get_NY () && Set_Progress(y, symb_grid->Get_NY()); y++)
+ 	{
+		#pragma omp parallel for
+		for (int x = 0; x < symb_grid->Get_NX(); x++)
+		{
+			symb_grid->Set_Value(x, y, symb_image[y+1][x+1]);
+		}
+	}
+
+
+	// Here the shapes are generated
+
+	int iPolygon;
+
+	for (iPolygon = 0, reg_curr = reg_first; reg_curr != NULL; reg_curr = reg_curr -> next, iPolygon++)
+	{
+		CSG_Shape	*pShape = pOutlines->Add_Shape();
+
+		pShape->Set_Value(0, iPolygon);		// set ID field (= first field in table) to polygon ID
+
+		for (simple_PIXELC_list *pix_curr = reg_curr->first_pix; pix_curr != NULL; pix_curr = pix_curr->next)
+		{
+			TSG_Point point = symb_grid->Get_System().Get_Grid_to_World(pix_curr->col - 1, pix_curr->row - 1);
+			pShape->Add_Point(point, 0);
+		}
+
+		int iHoles;
+		simple_INNER_REGION_list *inner_curr;
+
+		for (iHoles=0, inner_curr = reg_curr->inner_first;
+			 iHoles < reg_curr->num_holes;
+			 iHoles++, inner_curr = inner_curr->next)
+		{
+			for (simple_PIXELC_list *pix_curr = inner_curr->first_pix; pix_curr != NULL; pix_curr = pix_curr->next)
+			{
+				TSG_Point point = symb_grid->Get_System().Get_Grid_to_World(pix_curr->col - 1, pix_curr->row - 1);
+				pShape->Add_Point(point, iHoles+1);
+			}
+		}
+
+        if (!corners_centers)
+            shift_shape (pShape, -Get_Cellsize()/2.0, -Get_Cellsize()/2.0);
+	}
+
+	matrix_all_free ((void **) bin_image);
+	matrix_all_free ((void **) symb_image);
+	free_regions (&reg_first, &reg_last);
+
+	return( true );
+}
+
+
+int Cconnectivity_analysis::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if ( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FILTER")) )
+	{
+		pParameters->Get_Parameter("SIZE")->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("FILTERED_MASK")->Set_Enabled(pParameter->asBool());
+	}
+
+	return (1);
+}
+
+
+void Cconnectivity_analysis::shift_shape (CSG_Shape *pShape, double dx, double dy)
+{
+	for (int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+	{
+		for (int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+		{
+			TSG_Point	point = pShape->Get_Point(iPoint, iPart);
+			point.x		= point.x + dx;
+			point.y		= point.y + dy;
+			pShape->Set_Point(point, iPoint, iPart);
+		} // iPoint
+	} // iPart
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_filter/connect_analysis.h b/src/modules/grid/grid_filter/connect_analysis.h
new file mode 100644
index 0000000..43c771e
--- /dev/null
+++ b/src/modules/grid/grid_filter/connect_analysis.h
@@ -0,0 +1,102 @@
+/**********************************************************
+ * Version $Id: connect_analysis.h 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  connect_analysis.h                   //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__connectivity_analysis_H
+#define HEADER_INCLUDED__connectivity_analysis_H
+
+//---------------------------------------------------------
+
+
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class Cconnectivity_analysis : public CSG_Module_Grid
+{
+public:
+	Cconnectivity_analysis (void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+	virtual int					On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+private:
+	void						shift_shape (CSG_Shape *pShape, double dx, double dy);
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__connectivity_analysis_H
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c
new file mode 100644
index 0000000..f60ad83
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c
@@ -0,0 +1,234 @@
+/**********************************************************
+ * Version $Id: bin_geovinc.c 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     bin_geovinc.c                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+#include "storeorg.h"
+#include "bin_geovinc.h"
+
+
+/************************************************************************/
+/* Funktioniert mit listfuncs.in2                                       */
+/************************************************************************/
+
+#define LISTELEMENT CHAR_PIXEL
+#include "listfuncs.inc"
+#undef LISTELEMENT
+
+
+
+
+static int find_border_pixels (unsigned short numrows, 
+                               unsigned short numcols,
+                               simple_CHAR_PIXEL_list **first_pix,
+                               simple_CHAR_PIXEL_list **last_pix,
+                               char **mask,
+							   char **marker)
+{
+   /*******************************************************************/
+   /* Es wird eine Liste von Vordergrund-Pixeln (die selbst den Wert  */
+   /* 1 haben) erzeugt, die mindestens ein Hintergrund-Pixel als      */
+   /* Nachbarn aufweisen.                                             */
+   /*******************************************************************/
+   
+   unsigned short row;
+   unsigned short col;
+   unsigned short nrow;
+   unsigned short ncol;
+
+   unsigned short rowmin;
+   unsigned short colmin;
+   unsigned short rowmax;
+   unsigned short colmax;
+
+   short fflag;
+
+
+   for (row = 0; row < numrows; row ++)
+   {
+      for (col = 0; col < numcols; col ++)
+      {
+         if (marker [row][col] != 1)
+            continue;
+
+         rowmin = (row == 0) ? 0 : row - 1;
+         colmin = (col == 0) ? 0 : col - 1;
+         rowmax = (row == numrows - 1) ? row : row + 1;
+         colmax = (col == numcols - 1) ? col : col + 1;
+		 fflag = 0;
+
+         for (nrow = rowmin; nrow <= rowmax; nrow ++)
+         {
+	        for (ncol = colmin; ncol <= colmax; ncol ++)
+            {
+               /*************************************************************/
+               /* Im ersten Fall liegen das aktuelle und das Nachbar-Pixel  */
+               /* diagonal (8-Nachbarschaft), im zweiten sind sie identisch */
+               /*************************************************************/
+ 
+               if ((ncol != col && nrow != row) || (ncol == col && nrow == row))
+                  continue;
+            
+            
+               if (marker [nrow][ncol] == 0 && mask [nrow][ncol] == 1)
+			   {
+				  /* Hier kann man propagieren */
+
+                  fflag = 1;
+				  break;
+			   }
+			}
+
+			if (fflag == 1)
+			   break;
+		 }
+
+
+         if (fflag == 0)
+            continue;
+
+         append_new_simple_CHAR_PIXEL_list (first_pix, last_pix);
+		 (*last_pix) -> row = row;
+		 (*last_pix) -> col = ncol;
+	  }
+   }
+
+   return 0;
+}
+
+
+
+
+int binary_geodesic_morphological_reconstruction (
+                unsigned short numrows,
+                unsigned short numcols,
+                char **mask,
+                char **marker)
+{
+   simple_CHAR_PIXEL_list *first_pix = NULL;
+   simple_CHAR_PIXEL_list *last_pix = NULL;
+   simple_CHAR_PIXEL_list *curr_pix;
+
+   unsigned short rowmin;
+   unsigned short colmin;
+   unsigned short rowmax;
+   unsigned short colmax;
+   unsigned short row;
+   unsigned short col;
+   unsigned short nrow;
+   unsigned short ncol;
+
+
+   find_border_pixels (numrows, numcols, &first_pix, &last_pix, mask, marker);
+   
+
+   /*********************************************************************/
+   /* Hier kommt jetzt die alles entscheidende Schleife, in der die     */
+   /* Dilatation vorgenommen wird. Das vorderste Element der Pixelliste */
+   /* wird herausgenommen; seine Nachbarn werden in die Pixelliste      */
+   /* einsortiert, falls ihr Wert geaendert werden kann.                */
+   /*********************************************************************/
+
+   for (curr_pix = first_pix; curr_pix != NULL;  curr_pix = first_pix)
+   {
+      row = curr_pix -> row;
+      col = curr_pix -> col;
+	  delete_first_simple_CHAR_PIXEL (&first_pix, &last_pix);
+	  
+      /****************************************************************/
+      /* Hier wird vorerst nur die 4-er Nachbarschaft betrachtet.     */
+      /****************************************************************/
+
+      rowmin = (row == 0) ? 0 : row - 1;
+      colmin = (col == 0) ? 0 : col - 1;
+      rowmax = (row == numrows - 1) ? row : row + 1;
+      colmax = (col == numcols - 1) ? col : col + 1;
+
+      for (nrow = rowmin; nrow <= rowmax; nrow ++)
+      {
+         for (ncol = colmin; ncol <= colmax; ncol ++)
+		 {
+            /*************************************************************/
+            /* Im ersten Fall liegen das aktuelle und das Nachbar-Pixel  */
+            /* diagonal (8-Nachbarschaft), im zweiten sind sie identisch */
+            /*************************************************************/	
+
+    	    if ((ncol != col && nrow != row) || (ncol == col && nrow == row))
+				continue;
+
+	 	    if (marker [nrow][ncol] == 1 || mask [nrow][ncol] != 1)
+				continue;
+
+            marker [nrow][ncol] = 1;
+            append_new_simple_CHAR_PIXEL_list (&first_pix, &last_pix);
+		    last_pix -> row = nrow;
+		    last_pix -> col = ncol;
+         }
+      }
+   }
+
+   return 0;
+}
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h
new file mode 100644
index 0000000..1a14747
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h
@@ -0,0 +1,90 @@
+/**********************************************************
+ * Version $Id: bin_geovinc.h 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     bin_geovinc.H                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef struct simple_CHAR_PIXEL_list
+{
+   unsigned short row;
+   unsigned short col;
+   
+   struct simple_CHAR_PIXEL_list *next;
+}
+simple_CHAR_PIXEL_list;
+
+
+typedef struct double_CHAR_PIXEL_list
+{
+   unsigned short row;
+   unsigned short col;
+   
+   struct double_CHAR_PIXEL_list *prev;
+   struct double_CHAR_PIXEL_list *next;
+}
+double_CHAR_PIXEL_list;
+
+
+
+int binary_geodesic_morphological_reconstruction (
+                unsigned short numrows,
+                unsigned short numcols,
+                char **mask,
+                char **marker);
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c
new file mode 100644
index 0000000..b888663
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c
@@ -0,0 +1,866 @@
+/**********************************************************
+ * Version $Id: combcontour.c 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     combcontour.c                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <math.h>
+
+#include "storeorg.h"
+#include "combcontour.h"
+
+
+#ifdef MATLAB
+#include "mex.h"
+#endif
+
+
+#define LISTELEMENT PIXELC
+#include "listfuncs.inc"
+#undef LISTELEMENT
+
+#define LISTELEMENT REGIONC
+#include "listfuncs.inc"
+#undef LISTELEMENT
+
+#define LISTELEMENT INNER_REGION
+#include "listfuncs.inc"
+#undef LISTELEMENT
+
+/*
+static int append_new_simple_PIXELC_to_list (simple_PIXELC_list **first_pix,
+									         simple_PIXELC_list **last_pix)
+{
+   simple_PIXELC_list *new_pix;
+
+   new_pix = (simple_PIXELC_list *) malloc (sizeof (simple_PIXELC_list));
+   memset (new_pix, 0x00, sizeof(simple_PIXELC_list));
+   append_simple_PIXELC_list (first_pix, last_pix, new_pix);
+
+   return 0;
+}
+*/
+
+
+
+int background_region_growing (unsigned char **bin_image, 
+	                           unsigned short numrows, 
+							   unsigned short numcols, 
+							   unsigned short row, 
+							   unsigned short col)
+{
+   /*****************************************************************/
+   /* Starting with the seed point (row, col), the function updates */
+   /* the pixels of the corresponding connected region of a binary  */
+   /* image by means of a region growing to zero.				    */
+   /* The region growing is based on a 4-neighbourhood.             */
+   /*****************************************************************/
+
+   unsigned short rowmin; 
+   unsigned short rowmax;
+   unsigned short colmin;
+   unsigned short colmax;
+   unsigned short nrow; 
+   unsigned short ncol;
+
+   simple_PIXELC_list *curr_pix;
+   simple_PIXELC_list *first_pix = NULL;
+   simple_PIXELC_list *last_pix = NULL;
+
+
+   append_new_simple_PIXELC_list (&first_pix, &last_pix);
+   last_pix -> row = row;
+   last_pix -> col = col;
+   
+   for (curr_pix = first_pix; curr_pix != NULL;  curr_pix = first_pix)
+   {
+      row = curr_pix -> row;
+      col = curr_pix -> col;
+	  delete_first_simple_PIXELC (&first_pix, &last_pix);
+	  bin_image [row][col] = 0;
+
+      rowmin = (row == 0) ? 0 : row - 1;
+      colmin = (col == 0) ? 0 : col - 1;
+      rowmax = (row == numrows - 1) ? row : row + 1;
+      colmax = (col == numcols - 1) ? col : col + 1;
+
+      for (nrow = rowmin; nrow <= rowmax; nrow ++)
+      {
+		 for (ncol = colmin; ncol <= colmax; ncol ++)
+		 {
+   		    /*************************************************************/
+		    /* In the first case the current pixel and the neighbouring  */
+		    /* pixel are diagonal adjacents, in the second case they are */
+		    /* identical, in the third case the neighbouring pixel is    */
+		    /* a background pixel, in the fourth case it is a foreground */
+		    /* pixel, but already in the list.                           */
+		    /*************************************************************/	
+
+    	    if ((ncol != col && nrow != row) || (ncol == col && nrow == row) ||
+			    bin_image [nrow][ncol] == 0 || bin_image [nrow][ncol] == 99)
+			   continue;
+
+            append_new_simple_PIXELC_list (&first_pix, &last_pix);
+			last_pix -> row = nrow;
+			last_pix -> col = ncol;
+			bin_image [nrow][ncol] = 99;
+         }
+      }
+   }
+
+   return 0;
+}
+
+
+
+
+
+int free_regions (simple_REGIONC_list **first_region, simple_REGIONC_list **last_region)
+{
+   simple_REGIONC_list *reg_curr;
+   simple_REGIONC_list *reg_next;
+   simple_INNER_REGION_list *inner_next;
+   simple_INNER_REGION_list *inner_curr;
+
+   for (reg_curr = *first_region; reg_curr != NULL; reg_curr = reg_next)
+   {
+      reg_next = reg_curr -> next;
+
+      free_simple_PIXELC_list (&(reg_curr -> first_pix), &(reg_curr -> last_pix)); 
+
+	  for (inner_curr = reg_curr -> inner_first; inner_curr != NULL; inner_curr = inner_next)
+	  {
+         inner_next = inner_curr -> next;
+         free_simple_PIXELC_list (&(inner_curr -> first_pix), &(inner_curr -> last_pix));
+		 free (inner_curr);
+	  }
+
+	  free (reg_curr);
+   }
+
+   return 0;
+}   
+
+
+
+
+/***********************************************************************/
+/* Konventionen für Koordinatensystem und Richtungen:                  */
+/*                                                                     */ 
+/*                                     direction                       */ 
+/* (row, col) --> (row, col + 1)          1                            */ 
+/* (row, col) --> (row + 1, col)          2                            */ 
+/* (row, col) --> (row, col - 1)          3                            */ 
+/* (row, col) --> (row - 1, col)          4                            */ 
+/***********************************************************************/
+
+static int neighbour (unsigned short row,
+                      unsigned short col,
+                      unsigned char curr_dir,
+                      unsigned short *nb_row,
+                      unsigned short *nb_col)
+{
+   switch (curr_dir)
+   {
+      case 1:
+         *nb_row = row;
+         *nb_col = col + 1;
+         break;
+
+      case 2:
+         *nb_row = row + 1;
+         *nb_col = col;
+         break;
+
+      case 3:
+         *nb_row = row;
+         *nb_col = col - 1;
+         break;
+
+      case 4:
+         *nb_row = row - 1;
+         *nb_col = col;
+         break;
+
+      default:
+         break;
+   }
+
+
+   return 0;
+}
+
+
+
+
+#define DIRECTION_RIGHT(x) (((x)==1)?4:(x)-1)
+#define DIRECTION_LEFT(x) (((x)==4)?1:(x)+1)
+
+#if 0
+static int neighbour_right (unsigned short row,
+                            unsigned short col,
+                            unsigned char curr_dir,
+                            unsigned short *nb_row,
+                            unsigned short *nb_col)
+{
+   neighbour (row, col, (DIRECTION_RIGHT(curr_dir)), nb_row, nb_col);
+   return 0;
+}
+#endif
+
+
+
+static void set_contour_point (simple_PIXELC_list *currpix, 
+	                            unsigned char direction, 
+							    unsigned short row, 
+							    unsigned short col)
+{
+   /***********************************************************************/
+   /* "direction" indicates the direction of the edge between foreground  */
+   /* and background as well as its location. The function sets the       */
+   /* starting point within the pixel structure. If the coordinate of the */
+   /* lower left corner of the pixel are (col, row), the start and end    */
+   /* points of the edges are, in particular                              */
+   /*                                                                     */
+   /* direction   start point       end point                             */
+   /*     1       (col, row)        (col+1, row)                          */
+   /*     2       (col+1, row)      (col+1, row+1)                        */
+   /*     3       (col+1, row+1)    (col, row+1)                          */
+   /*     4       (col, row+1)      (col, row) ,                          */
+   /*                                                                     */
+   /* therefore:                                                          */
+   /***********************************************************************/
+
+   switch (direction)
+   {
+      case 1:
+         currpix -> row = row;
+         currpix -> col = col;
+		 break;
+
+	  case 2:
+         currpix -> row = row;
+         currpix -> col = col + 1;
+		 break;
+
+	  case 3:
+         currpix -> row = row + 1;
+         currpix -> col = col + 1;
+		 break;
+
+	  case 4:
+         currpix -> row = row + 1;
+         currpix -> col = col;
+		 break;
+
+	  default:
+		  break;
+   }
+
+   return;
+}
+
+
+
+
+static int next_border_pixel_0 (unsigned short row,
+                                unsigned short col,
+                                unsigned char *curr_dir,
+                                unsigned char **bin_image,
+                                long **symb_image,
+                                long inout,
+                                long label,
+                                simple_PIXELC_list **first,
+                                simple_PIXELC_list **last,
+                                unsigned short *next_row,
+                                unsigned short *next_col)
+{
+   unsigned short nb_row;
+   unsigned short nb_col;
+   unsigned short im_row;
+   unsigned short im_col;
+   unsigned char zw_dir;
+   short k;
+
+
+   for (k = 0; k < 3; k ++)
+   {
+      neighbour (row, col, *curr_dir, &nb_row, &nb_col);
+
+      if (bin_image [nb_row][nb_col] == 0)
+      {
+         /**************************************************************/
+         /* Wir drehen so lange gegen den Uhrzeigersinn weiter, bis    */
+         /* das Nachbarpixel auch zum Vordergrund gehört.              */
+         /**************************************************************/
+
+         symb_image [nb_row][nb_col] = inout;
+         (*curr_dir) = DIRECTION_LEFT(*curr_dir);
+
+         append_new_simple_PIXELC_list (first, last);
+		 set_contour_point (*last, *curr_dir, row, col);
+      }
+      else
+         break;
+   }
+
+   /*********************************************************************/
+   /* Es muss geprüft werden, ob das rechte Nachbarpixel des neuen      */
+   /* Pixels auch zum Hintergrund gehört. Wenn nicht gehen wir gleich   */
+   /* noch eins weiter "rechts um die Ecke".                            */
+   /*********************************************************************/
+
+   zw_dir = DIRECTION_RIGHT(*curr_dir);
+   neighbour (nb_row, nb_col, zw_dir, &im_row, &im_col);
+
+   if (bin_image [im_row][im_col] != 0)
+   {
+      symb_image [nb_row][nb_col] = label;
+
+      nb_row = im_row;
+      nb_col = im_col;
+      *curr_dir = zw_dir;
+   }
+   else
+      symb_image [im_row][im_col] = inout;
+
+   *next_row = nb_row;
+   *next_col = nb_col;
+   symb_image [nb_row][nb_col] = label;
+
+   append_new_simple_PIXELC_list (first, last);
+   set_contour_point (*last, *curr_dir, nb_row, nb_col);
+
+   return 0;
+}
+
+
+
+
+
+static int next_border_pixel_1 (unsigned short row,
+                                unsigned short col,
+                                unsigned char *curr_dir,
+                                unsigned char **bin_image,
+                                long **symb_image,
+                                long inout,
+                                long label,
+                                simple_PIXELC_list **first,
+                                simple_PIXELC_list **last,
+                                unsigned short *next_row,
+                                unsigned short *next_col)
+{
+   unsigned short nb_row;
+   unsigned short nb_col;
+   unsigned short im_row;
+   unsigned short im_col;
+   unsigned char zw_dir;
+   short k;
+
+
+   for (k = 0; k < 3; k ++)
+   {
+      neighbour (row, col, *curr_dir, &nb_row, &nb_col);
+
+      if (bin_image [nb_row][nb_col] == 0)
+      {
+         /**************************************************************/
+         /* Wir drehen so lange gegen den Uhrzeigersinn weiter, bis    */
+         /* das Nachbarpixel auch zum Vordergrund gehört.              */
+         /**************************************************************/
+         
+         symb_image [nb_row][nb_col] = inout;
+         (*curr_dir) = DIRECTION_LEFT(*curr_dir);
+      }
+      else
+         break;
+   }
+
+   /*********************************************************************/
+   /* Es muss geprüft werden, ob das rechte Nachbarpixel des neuen      */
+   /* Pixels auch zum Hintergrund gehört. Wenn nicht gehen wir gleich   */
+   /* noch eins weiter "rechts um die Ecke".                            */
+   /*********************************************************************/
+
+   zw_dir = DIRECTION_RIGHT(*curr_dir);
+   neighbour (nb_row, nb_col, zw_dir, &im_row, &im_col);
+
+   if (bin_image [im_row][im_col] != 0)
+   {
+      symb_image [nb_row][nb_col] = label;
+      append_new_simple_PIXELC_list (first, last);
+      (*last) -> row = nb_row;
+	  (*last) -> col = nb_col;
+
+      nb_row = im_row;
+      nb_col = im_col;
+      *curr_dir = zw_dir;
+   }
+   else
+      symb_image [im_row][im_col] = inout;
+
+   *next_row = nb_row;
+   *next_col = nb_col;
+   symb_image [nb_row][nb_col] = label;
+
+   append_new_simple_PIXELC_list (first, last);
+   (*last) -> row = nb_row;
+   (*last) -> col = nb_col;
+
+   return 0;
+}
+
+
+
+
+
+
+
+
+static int trace_contour_4 (
+                unsigned short start_row,
+                unsigned short start_col,
+                unsigned char **bin_image,
+                long **symb_image,
+                long curr_reg_nr,
+                simple_REGIONC_list *reg_curr,
+                char contour_orientation,
+				char center)
+{
+   /********************************************************************/
+   /* Um die Subregion herumlaufen und die Randpunkte abspeichern.     */
+   /* contour_orientation = 1 bedeutet, gegen den Uhrzeigersinn um die */ 
+   /* Vordergrundregion herumlaufen, d.h. der Hintergrund liegt        */ 
+   /* rechts; es muss sich um eine äußere Randkette handeln.           */
+   /* contour_orientation = -1 bedeutet, mit dem Uhrzeigersinn um die  */ 
+   /* Hintergrundregion herumlaufen, d.h. der Hintergrund liegt        */
+   /* rechts; es muss sich um eine innere Randkette handeln.           */
+   /********************************************************************/
+
+
+   /********************************************************************/
+   /* "direction" bedeutet die Richtung entlang der Randkette, so dass */
+   /* der Hintergrund jeweils rechts liegt. Die Richtung nach außen    */ 
+   /* ist also:                                                        */ 
+   /*    outward_direction = direction - 1                             */
+   /* (start_row, start_col) bezieht sich jeweils auf das Pixel das    */
+   /* schon / noch zum Vordergrund gehört! Vorsicht beim Aufruf!       */ 
+   /********************************************************************/
+
+   unsigned short row;
+   unsigned short col;
+   unsigned short nb_row;
+   unsigned short nb_col;
+   unsigned short next_row;
+   unsigned short next_col;
+   long label;
+   long inout;
+   unsigned char curr_dir;
+   unsigned char dir_try;
+   unsigned char dir_right;
+   unsigned char direction_start;
+   char k;
+   simple_PIXELC_list *first;
+   simple_PIXELC_list *last;
+
+
+   inout = 2 - contour_orientation; /* nur für die Markierung des Randes im symbolischen Bild  */
+   row = start_row;
+   col = start_col;
+
+   last = (simple_PIXELC_list *) malloc (sizeof(simple_PIXELC_list));
+   memset (last, 0x00, sizeof(simple_PIXELC_list));
+   first = last;
+
+   if (contour_orientation == 1)
+   {
+      direction_start = 4;
+      label = curr_reg_nr * 10 + 8;
+      reg_curr -> first_pix = last;
+      reg_curr -> last_pix = last;
+      symb_image [row][col-1] = inout;
+   }
+   else 
+   {
+      direction_start = 2;
+      label = curr_reg_nr * 10 + 5;
+      reg_curr -> inner_last -> first_pix = last;
+      reg_curr -> inner_last -> last_pix = last;
+      symb_image [row][col+1] = inout;
+   }
+
+   symb_image [row][col] = label;
+
+   /********************************************************************/
+   /* Wir drehen hier so lange zurück (im Uhrzeigersinn), bis das      */
+   /* Nachbarpixel in Gegenrichtung von direction_start ein            */
+   /* Vordergrundpixel ist. direction_start ist damit die Richtung,    */
+   /* bei der wir am Ende wieder herauskommen müssen.                  */
+   /********************************************************************/
+
+   for (k = 0; k < 3; k ++)
+   {
+      dir_try = DIRECTION_RIGHT(direction_start);  
+      dir_right = DIRECTION_RIGHT(dir_try);  
+
+      neighbour (row, col, dir_right, &nb_row, &nb_col);
+      
+      if (bin_image [nb_row][nb_col] == 0)
+      {
+         symb_image [nb_row][nb_col] = inout;
+         direction_start = dir_try;
+      }
+      else
+         break;
+   }
+
+   last -> row = row;
+   last -> col = col;
+   
+   if (k == 3)
+   {
+      /*****************************************************************/
+      /* Es handelt sich um ein einzelnes Vordergrundpixel             */
+      /*****************************************************************/
+      
+      if (center == 0)
+	  {
+         set_contour_point (last, 1, row, col);
+
+         for (curr_dir = 2; curr_dir < 5; curr_dir ++)
+	     {
+            append_new_simple_PIXELC_list (&first, &last);
+		    set_contour_point (last, curr_dir, row, col);
+	     }
+	  }
+
+      return 0;
+   }
+
+   curr_dir = direction_start;
+
+   if (center == 0)
+   {
+      set_contour_point (last, direction_start, row, col);
+   }
+   else
+   {
+      last -> row = row;
+      last -> col = col;
+   }
+
+   do
+   {
+      if (center == 0)
+	  {
+         next_border_pixel_0 (row, 
+                              col, 
+                              &curr_dir, 
+                              bin_image,
+                              symb_image,
+                              inout,
+                              label,
+							  &first,
+                              &last,
+                              &next_row,
+                              &next_col);
+	  }
+	  else
+	  {
+         next_border_pixel_1 (row, 
+                              col, 
+                              &curr_dir, 
+                              bin_image,
+                              symb_image,
+                              inout,
+                              label,
+							  &first,
+                              &last,
+                              &next_row,
+                              &next_col);
+	  }
+
+      row = next_row;
+      col = next_col;
+   }
+   while (row != start_row || col != start_col || 
+          curr_dir != direction_start);
+
+   if (contour_orientation == 1)
+      reg_curr -> last_pix = last;
+   else 
+      reg_curr -> inner_last -> last_pix = last;
+
+   return 0;
+}
+
+
+
+
+/************************************************************************/
+/* Die folgende Funktion setzt Regionen-Labels für ein Binärbild und    */
+/* extrahiert die zugehörigen Randketten. Siehe Burger, Burge (2006):   */
+/* Digitale Bildverarbeitung. 2. Auflage Springer Verlag S.208.         */
+/*                                                                      */
+/* Voraussetzung ist, dass die Randzeilen und Randspalten des Bildes    */
+/* alle aus Hintergrundpixeln bestehen!                                 */
+/************************************************************************/
+
+#define ALLOC_INC  1000
+
+int comb_contour_region_marking (
+                unsigned short numrows,
+                unsigned short numcols,
+                unsigned char **bin_image,
+                long **symb_image,
+				simple_REGIONC_list **reg_first,
+				simple_REGIONC_list **reg_last,
+				char center)
+{
+   unsigned short row;
+   unsigned short col;
+   unsigned short row_prev;
+   unsigned short col_prev;
+   int last_reg_nr;
+   int curr_reg_nr;
+   long anz_alloc;
+   long label;
+   char status;
+   char status_alt;
+  
+   simple_REGIONC_list *reg_new;
+   simple_REGIONC_list **reg_vec;
+   simple_REGIONC_list *reg_curr;
+   simple_INNER_REGION_list *new_inner_reg;
+
+   last_reg_nr = 0;
+   *reg_first = NULL;
+   *reg_last = NULL;
+
+   /*********************************************************************/
+   /* Wir benutzen folgende Labels im symbolischen Bild:                */
+   /*   0 - Hintergrund                                                 */
+   /*  x2 - inneres Pixel einer Region                                  */
+   /*  x8 - äußeres Randpixel einer Region                              */
+   /*  x5 - Randpixel eines inneren Randes einer Region                 */
+   /*                                                                   */
+   /* Diese Labels dienen nur der Visualisierung. Manche Pixel können   */
+   /* Randpixel sowohl eines inneren Randes als auch des äußeren Randes */
+   /* sein                                                              */
+   /*********************************************************************/
+
+   anz_alloc = ALLOC_INC;
+
+   /*********************************************************************/
+   /*  Der Vektor reg_vec dient dazu, eine Region als Element der       */
+   /*  verketteten Liste simple_REGIONC_list aus der curr_reg_nr         */
+   /*  aufzufinden.                                                     */
+   /*********************************************************************/
+
+   reg_vec = (simple_REGIONC_list **) malloc (anz_alloc *
+                           sizeof (simple_REGIONC_list *));
+   memset (reg_vec, 0x00, anz_alloc * sizeof (simple_REGIONC_list *));
+
+   for (row = 1; row < numrows - 1; row ++)
+   {
+      status = 0;
+      status_alt = 0;
+      curr_reg_nr = 0;
+
+      for (col = 1; col < numcols - 1; col ++)
+      {
+         status = bin_image [row][col];
+
+         if (status_alt != status)
+         {
+            if (status_alt == 0 && symb_image [row][col] == 0)
+            {
+               /*********************************************************/
+               /* Fall A: Übergang von einem Hintergrundpixel auf ein   */
+               /* bisher nicht markiertes Vordergrundpixel              */
+               /* Das muss ein äußerer Rand sein                        */
+               /*********************************************************/
+
+               last_reg_nr ++;
+               curr_reg_nr = last_reg_nr;
+
+               reg_new = (simple_REGIONC_list *)
+                                     malloc (sizeof(simple_REGIONC_list));
+               memset (reg_new, 0x00, sizeof(simple_REGIONC_list));
+               reg_new -> region_nr = last_reg_nr;
+               reg_curr = reg_new;
+
+               append_simple_REGIONC_list (reg_first, reg_last, reg_new);
+
+               if (last_reg_nr >= anz_alloc)
+               {
+                  reg_vec = (simple_REGIONC_list **) realloc (
+                        reg_vec,
+                        (anz_alloc + ALLOC_INC) *
+                        sizeof (simple_REGIONC_list *));
+                  memset (((char *) reg_vec) + 
+                                anz_alloc * sizeof (simple_REGIONC_list *), 
+                          0x00, 
+                          ALLOC_INC);
+                  anz_alloc += ALLOC_INC;
+               }
+
+               reg_vec [last_reg_nr] = reg_new;
+
+               trace_contour_4 (row,
+                                col, 
+                                bin_image, 
+                                symb_image, 
+                                curr_reg_nr, 
+                                reg_curr,
+                                1,
+								center);
+            }
+            else if (status_alt == 0 && symb_image [row][col] != 0)
+            {
+               /*********************************************************/
+               /* Ein Randpixel, das früher mal erzeugt wurde. Das      */
+               /* könnte ein äußerer oder auch ein innerer Rand sein.   */
+               /*********************************************************/
+
+               label = symb_image [row][col];
+
+               if (label % 10 == 8)        /* äußerer Rand    */
+                  curr_reg_nr = (label - 8) / 10;
+               else if (label % 10 == 5)   /* innerer Rand    */
+                  curr_reg_nr = (label - 5) / 10;
+
+               reg_curr = reg_vec [curr_reg_nr];
+            }
+            else if (status_alt != 0 && status == 0)
+            {
+               row_prev = row;
+               col_prev = col - 1;
+               label = symb_image [row_prev][col_prev];
+
+               if (symb_image [row][col] == 0)
+               {
+                  /******************************************************/
+                  /* Es ist ein Randpixel (wegen status = 0), wurde     */
+                  /* aber bisher nicht als solches erkannt.             */
+                  /* Das muss ein Randpixel eines inneren Randes sein,  */
+                  /* andernfalls wäre es früher schon erfasst worden    */
+                  /* bzw. das Hintergrundpixel wäre schon markiert.     */
+                  /******************************************************/
+                 
+                  curr_reg_nr = (label - 2) / 10;
+                  reg_curr = reg_vec [curr_reg_nr];
+
+                  new_inner_reg = (simple_INNER_REGION_list *)
+                            malloc (sizeof (simple_INNER_REGION_list));
+                  memset (new_inner_reg, 
+                          0x00, 
+                          sizeof (simple_INNER_REGION_list));
+
+                  (reg_curr -> num_holes) ++;
+                  append_simple_INNER_REGION_list (
+                             &(reg_curr -> inner_first), 
+                             &(reg_curr -> inner_last),
+                             new_inner_reg);
+                   
+                  trace_contour_4 (row_prev,
+                                   col_prev, 
+                                   bin_image, 
+                                   symb_image, 
+                                   curr_reg_nr, 
+                                   reg_curr,
+                                   -1,
+								   center);
+               }
+               else
+               {
+                  /******************************************************/
+                  /* Ein Randpixel, das wir früher schon mal als        */
+                  /* solches erfasst hatten. Da müssen wir nichts tun.  */
+                  /******************************************************/
+
+                  ;
+               }
+            }
+
+            status_alt = status;
+         } /* Der status hatte sich geändert    */
+         else if (status_alt == 0)
+            continue;
+         else if (symb_image [row][col] != 0)
+            continue;
+         else
+            symb_image [row][col] = curr_reg_nr * 10 + 2; 
+      }
+   }
+   
+   free (reg_vec);
+
+   return 0;
+}
+
+
+
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h
new file mode 100644
index 0000000..fb5e138
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h
@@ -0,0 +1,155 @@
+/**********************************************************
+ * Version $Id: combcontour.h 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     combcontour.h                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef struct simple_PIXELC_list
+{
+   unsigned short row;
+   unsigned short col;
+   
+   struct simple_PIXELC_list *next;
+}
+simple_PIXELC_list;
+
+
+typedef struct double_PIXELC_list
+{
+   unsigned short row;
+   unsigned short col;
+   
+   struct double_PIXELC_list *prev;
+   struct double_PIXELC_list *next;
+}
+double_PIXELC_list;
+
+
+
+
+typedef struct simple_REGIONC_list
+{
+   struct simple_REGIONC_list *next;
+   long region_nr;
+
+   struct simple_PIXELC_list *first_pix;
+   struct simple_PIXELC_list *last_pix;
+   short num_holes;
+   struct simple_INNER_REGION_list *inner_first;
+   struct simple_INNER_REGION_list *inner_last;
+}
+simple_REGIONC_list;
+
+
+
+typedef struct double_REGIONC_list
+{
+   struct double_REGIONC_list *prev;
+   struct double_REGIONC_list *next;
+   long region_nr;
+
+   struct double_PIXELC_list *first_pix;
+   struct double_PIXELC_list *last_pix;
+   short num_holes;
+   struct double_INNER_REGION_list *inner_first;
+   struct double_INNER_REGION_list *inner_last;
+}
+double_REGIONC_list;
+
+
+typedef struct simple_INNER_REGION_list
+{
+   struct simple_INNER_REGION_list *next;
+
+   struct simple_PIXELC_list *first_pix;
+   struct simple_PIXELC_list *last_pix;
+}
+simple_INNER_REGION_list;
+
+
+
+typedef struct double_INNER_REGION_list
+{
+   struct double_INNER_REGION_list *prev;
+   struct double_INNER_REGION_list *next;
+
+   struct double_PIXELC_list *first_pix;
+   struct double_PIXELC_list *last_pix;
+}
+double_INNER_REGION_list;
+
+
+int background_region_growing (unsigned char **bin_image, 
+	                           unsigned short numrows, 
+							   unsigned short numcols, 
+							   unsigned short row, 
+							   unsigned short col);
+
+int free_regions (simple_REGIONC_list **first_region, simple_REGIONC_list **last_region);
+
+int comb_contour_region_marking (
+                unsigned short numrows,
+                unsigned short numcols,
+                unsigned char **bin_image,
+                long **symb_image,
+                simple_REGIONC_list **reg_first,
+				simple_REGIONC_list **reg_last,
+				char center);
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c
new file mode 100644
index 0000000..959b37f
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c
@@ -0,0 +1,773 @@
+/**********************************************************
+ * Version $Id: errfunc.c 1937 2014-01-11 18:22:42Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//              Grid_Filter / Grid_Calculus              //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       errfunc.c                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <ctype.h>
+
+#include "errfunc.h"
+
+
+
+
+
+
+void fehler (int zeile,
+             int fnr,
+             char *filename,
+             char *funk_name,
+             FILE *protfile,
+             fehlerinfo *finf,
+             void *info1,
+             void *info2,
+             void *info3,
+             void *info4,
+             void *info5,
+             void *info6,
+             void *info7)
+
+/************************************************/
+/*   Ausgabe von Laufzeitfehlern,               */
+/*   ggf. Programmabbruch                       */
+/************************************************/
+
+{
+   int j;
+   int gefunden;
+   int sl;
+
+   char fmessage [255];
+   char *cp1;
+   char *cp2;
+   char *cp3;
+   char *cp4;
+   fehlerinfo *fil;
+
+   void *info [8];
+
+
+   info [1] = info1;
+   info [2] = info2;
+   info [3] = info3;
+   info [4] = info4;
+   info [5] = info5;
+   info [6] = info6;
+   info [7] = info7;
+
+   fprintf (protfile, "\n\n");
+
+   gefunden = 0;
+
+   for (fil = finf; fil != NULL && fil -> fnr != 0; fil ++)
+   {
+      if (fnr == fil -> fnr)
+      {
+         gefunden = 1;
+         break;
+      }
+   }
+
+   if (gefunden == 0)
+   {
+      fprintf (protfile, "+++ Unbekannter Fehler\n");
+      fflush (protfile);
+      fprintf (protfile, "    Abbruch des Programms.\n\n");
+      exit (20);
+   }
+
+   if (fil -> art == 'W')
+      fprintf (protfile, 
+               "+++ Warnung in Funktion %s,\n"
+               "               Datei    %s,\n"
+               "               Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+   else if (fil -> art == 'F' || fil -> art == 'E')
+      fprintf (protfile, 
+               "+++ Fehler in Funktion %s,\n"
+               "              Datei    %s,\n"
+               "              Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+
+   for (cp1 = fil -> message, j = 1, cp4 = cp1;
+        j <= 7 && info [j] != NULL; j ++)
+   {
+      cp2 = strchr (cp4, '%');
+   
+      if (cp2 == NULL)
+         break;
+
+      if (*(cp2 + 1) == '%')
+      {
+         cp4 = cp2 + 2;
+         j --;
+         continue;
+      }
+
+
+      gefunden = 0;
+
+      cp3 = strpbrk (cp2 + 1, "csdlhfe");
+
+      if (cp3 == NULL)
+      {
+         fprintf (protfile, "    Fehler in errfunc.c: ");
+         fprintf (protfile, "unzulaessige Formatangabe\n");
+         break;
+      }
+
+      if (*(cp3 + 1) != 0x00 && *(cp3 + 1) != '%')
+         cp2 = cp3 + 2;
+      else
+         cp2 = cp3 + 1;
+
+      sl = cp2 - cp1;
+
+      memcpy (fmessage, cp1, sl);
+      fmessage [sl] = 0x00;
+
+      switch (*cp3)
+      {
+         case 'd':
+            fprintf (protfile, fmessage, *((int *)(info [j])));
+            break;
+                
+         case 'l':
+            fprintf (protfile, fmessage, *((long *)(info [j])));
+            break;
+
+         case 'h':
+            fprintf (protfile, fmessage, *((short *)(info [j])));
+            break;
+
+         case 'e':
+         case 'f':
+            fprintf (protfile, fmessage, *((double *)(info [j])));
+            break;
+
+         case 'c':
+            fprintf (protfile, fmessage, *((char *)(info [j])));
+            break;
+
+         case 's':
+            fprintf (protfile, fmessage, (char *)(info [j]));
+            break;
+
+         default:
+            break;
+      }
+
+      cp1 = cp2;
+      cp4 = cp2;
+   }
+
+   fprintf (protfile, cp1);
+
+   if (fil -> art == 'E')
+   {
+      fprintf (protfile, "    Abbruch des Programms.\n\n");
+      exit (20);
+   }
+
+   fflush (protfile);
+
+   return;
+}
+
+
+
+
+
+
+void error_message (int zeile,
+                    int fnr,
+                    char *filename,
+                    char *funk_name,
+                    char **error_list,
+                    fehlerinfo *finf,
+                    void *info1,
+                    void *info2,
+                    void *info3,
+                    void *info4,
+                    void *info5,
+                    void *info6,
+                    void *info7)
+
+/************************************************/
+/*   Ausgabe von Laufzeitfehlern,               */
+/*   ggf. Programmabbruch                       */
+/************************************************/
+
+{
+   int j;
+   int gefunden;
+   int sl;
+   int sl_head;
+   int sl_all;
+   int sl_alt;
+   fehlerinfo *fil;
+
+   char fmessage [512];
+   char zw [255];
+   char *cp1;
+   char *cp2;
+   char *cp3;
+   char *cp4;
+
+   void *info [8];
+
+
+   info [1] = info1;
+   info [2] = info2;
+   info [3] = info3;
+   info [4] = info4;
+   info [5] = info5;
+   info [6] = info6;
+   info [7] = info7;
+
+   gefunden = 0;
+
+   for (fil = finf; fil != NULL && fil -> fnr != 0; fil ++)
+   {
+      if (fnr == fil -> fnr)
+      {
+         gefunden = 1;
+         break;
+      }
+   }
+
+   if (gefunden == 0)
+   {
+      sprintf (fmessage, "\n"
+                         "+++ Unbekannter Fehler\n"
+                         "    Abbruch des Programms.\n\n");
+      sl_all = strlen (fmessage);
+      
+      sl_alt = strlen (*error_list);
+      *error_list = realloc (*error_list, 
+                             (sl_alt + sl_all + 1) * sizeof (char));
+      memcpy (*error_list + sl_alt, fmessage, sl_all);
+      *(*error_list + sl_alt + sl_all) = 0x00;
+   
+      return;
+   }
+
+
+   if (fil -> art == 'W')
+      sprintf (fmessage, "\n"
+               "+++ Warnung in Funktion %s,\n"
+               "               Datei    %s,\n"
+               "               Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+   else if (fil -> art == 'F' || fil -> art == 'E')
+      sprintf (fmessage, "\n"
+               "+++ Fehler in Funktion %s,\n"
+               "              Datei    %s,\n"
+               "              Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+
+
+   sl_head = strlen (fmessage);
+   memset (fmessage + sl_head, ' ', 4);
+   sl_head += 4;
+   sl_all = sl_head;
+
+   for (cp1 = fil -> message, j = 1, cp4 = cp1;
+        j <= 7 && info [j] != NULL; 
+        j ++)
+   {
+      cp2 = strchr (cp4, '%');
+   
+      if (cp2 == NULL)
+         break;
+
+      if (*(cp2 + 1) == '%')
+      {
+         cp4 = cp2 + 2;
+         j --;
+         continue;
+      }
+
+
+      gefunden = 0;
+
+      cp3 = strpbrk (cp2 + 1, "csdlhfe");
+
+      if (cp3 == NULL)
+      {
+         sprintf (fmessage + sl_all, "    Fehler in errfunc.c: "
+                                     "unzulaessige Formatangabe\n");
+         break;
+      }
+
+      if (*(cp3 + 1) != 0x00 && *(cp3 + 1) != '%')
+         cp2 = cp3 + 2;
+      else
+         cp2 = cp3 + 1;
+
+      sl = cp2 - cp1;
+
+      memcpy (zw, cp1, sl);
+      zw [sl] = 0x00;
+
+      switch (*cp3)
+      {
+         case 'd':
+            sprintf (fmessage + sl_all, zw, *((int *)(info [j])));
+            break;
+                
+         case 'l':
+            sprintf (fmessage + sl_all, zw, *((long *)(info [j])));
+            break;
+
+         case 'h':
+            sprintf (fmessage + sl_all, zw, *((short *)(info [j])));
+            break;
+
+         case 'e':
+         case 'f':
+            sprintf (fmessage + sl_all, zw, *((double *)(info [j])));
+            break;
+
+         case 'c':
+            sprintf (fmessage + sl_all, zw, *((char *)(info [j])));
+            break;
+
+         case 's':
+            sprintf (fmessage + sl_all, zw, (char *)(info [j]));
+            break;
+
+         default:
+            break;
+      }
+      
+      sl_all = strlen (fmessage);
+
+      cp1 = cp2;
+      cp4 = cp2;
+   }
+
+   sprintf (fmessage + sl_all, cp1);
+   sl_all = strlen (fmessage);
+   
+   sl_alt = strlen (*error_list);
+   *error_list = realloc (*error_list, 
+                          (sl_alt + sl_all + 1) * sizeof (char));
+   memcpy (*error_list + sl_alt, fmessage, sl_all);
+   *(*error_list + sl_alt + sl_all) = 0x00;
+
+   return;
+}
+
+
+
+
+
+void fehler2 (int zeile,
+              int fnr,
+              char *filename,
+              char *funk_name,
+              FILE *protfile,
+              fehlerinfo *finf,
+              ...)
+
+/************************************************/
+/*   Ausgabe von Laufzeitfehlern,               */
+/*   ggf. Programmabbruch                       */
+/************************************************/
+
+{
+   int j;
+   int gefunden;
+   int sl;
+
+   char fmessage [255];
+   char *cp1;
+   char *cp2;
+   char *cp3;
+   char *cp4;
+   fehlerinfo *fil;
+   va_list ap;
+
+   int vint;
+   double vdouble;
+   long vlong;
+   char *pchar;
+
+   fprintf (protfile, "\n\n");
+
+   gefunden = 0;
+
+   for (fil = finf; fil != NULL && fil -> fnr != 0; fil ++)
+   {
+      if (fnr == fil -> fnr)
+      {
+         gefunden = 1;
+         break;
+      }
+   }
+
+   if (gefunden == 0)
+   {
+      fprintf (protfile, "+++ Unbekannter Fehler\n");
+      fprintf (protfile, "    Abbruch des Programms.\n\n");
+      exit (20);
+   }
+
+   if (fil -> art == 'W')
+      fprintf (protfile, 
+               "+++ Warnung in Funktion %s,\n"
+               "               Datei    %s,\n"
+               "               Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+   else if (fil -> art == 'F' || fil -> art == 'E')
+      fprintf (protfile, 
+               "+++ Fehler in Funktion %s,\n"
+               "              Datei    %s,\n"
+               "              Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+
+
+   va_start(ap,finf);
+
+   for (cp1 = fil -> message, j = 1, cp4 = cp1;
+        j <= 7; j ++)
+   {
+      cp2 = strchr (cp4, '%');
+   
+      if (cp2 == NULL)
+         break;
+
+      if (*(cp2 + 1) == '%')
+      {
+         cp4 = cp2 + 2;
+         j --;
+         continue;
+      }
+
+
+      gefunden = 0;
+
+      cp3 = strpbrk (cp2 + 1, "sdlfe");
+
+      if (cp3 == NULL)
+      {
+         fprintf (protfile, "    Fehler in errfunc.c: ");
+         fprintf (protfile, "unzulaessige Formatangabe\n");
+         break;
+      }
+
+      if (*(cp3 + 1) != 0x00 && *(cp3 + 1) != '%')
+         cp2 = cp3 + 2;
+      else
+         cp2 = cp3 + 1;
+
+      sl = cp2 - cp1;
+
+      memcpy (fmessage, cp1, sl);
+      fmessage [sl] = 0x00;
+
+      switch (*cp3)
+      {
+         /*****************************************************/
+         /* shorts und chars darf es hier aus Syntaxgr�nden   */
+         /* nicht geben (!?!)                                 */
+         /*****************************************************/
+
+         case 'd':
+            vint = va_arg(ap,int);
+            fprintf (protfile, fmessage, vint);
+            break;
+                
+         case 'l':
+            vlong = va_arg(ap,long);
+            fprintf (protfile, fmessage, vlong);
+            break;
+
+         case 'e':
+         case 'f':
+            vdouble = va_arg(ap,double);
+            fprintf (protfile, fmessage, vdouble);
+            break;
+
+         case 's':
+            pchar = va_arg(ap,char *);
+            fprintf (protfile, fmessage, pchar);
+            break;
+
+         default:
+            break;
+      }
+
+      cp1 = cp2;
+      cp4 = cp2;
+   }
+
+   va_end (ap);
+
+   fprintf (protfile, cp1);
+
+   if (fil -> art == 'E')
+   {
+      fprintf (protfile, "    Abbruch des Programms.\n\n");
+      exit (20);
+   }
+
+   return;
+}
+
+
+
+
+void fehler3 (int zeile,
+              int fnr,
+              char *filename,
+              char *funk_name,
+              char **error_list,
+              fehlerinfo *finf,
+              ...)
+
+/************************************************/
+/*   Ausgabe von Laufzeitfehlern,               */
+/*   ggf. Programmabbruch                       */
+/************************************************/
+
+{
+   int j;
+   int gefunden;
+   int sl;
+   int sl_all;
+   int sl_alt;
+   int sl_head;
+
+   char fmessage [512];
+   char zw [255];
+   char *cp1;
+   char *cp2;
+   char *cp3;
+   char *cp4;
+   fehlerinfo *fil;
+   va_list ap;
+
+   int vint;
+   double vdouble;
+   long vlong;
+   char *pchar;
+
+   gefunden = 0;
+
+   for (fil = finf; fil != NULL && fil -> fnr != 0; fil ++)
+   {
+      if (fnr == fil -> fnr)
+      {
+         gefunden = 1;
+         break;
+      }
+   }
+
+
+   if (gefunden == 0)
+   {
+      sprintf (fmessage, "\n+++ Unbekannter Fehler\n"
+                           "    Abbruch des Programms.\n\n");
+      sl_all = strlen (fmessage);
+      
+      sl_alt = strlen (*error_list);
+      *error_list = realloc (*error_list, 
+                             (sl_alt + sl_all + 1) * sizeof (char));
+      memcpy (*error_list + sl_alt, fmessage, sl_all);
+      *(*error_list + sl_alt + sl_all) = 0x00;
+   
+      return;
+   }
+
+
+   if (fil -> art == 'W')
+      sprintf (fmessage, "\n"
+               "+++ Warnung in Funktion %s,\n"
+               "               Datei    %s,\n"
+               "               Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+   else if (fil -> art == 'F' || fil -> art == 'E')
+      sprintf (fmessage, "\n"
+               "+++ Fehler in Funktion %s,\n"
+               "              Datei    %s,\n"
+               "              Zeile    %d:\n",
+               funk_name,
+               filename, 
+               zeile);
+
+
+   sl_head = strlen (fmessage);
+   memset (fmessage + sl_head, ' ', 4);
+   sl_head += 4;
+   sl_all = sl_head;
+
+   va_start (ap, finf);
+
+   for (cp1 = fil -> message, j = 1, cp4 = cp1;
+        j <= 7; j ++)
+   {
+      cp2 = strchr (cp4, '%');
+   
+      if (cp2 == NULL)
+         break;
+
+      if (*(cp2 + 1) == '%')
+      {
+         cp4 = cp2 + 2;
+         j --;
+         continue;
+      }
+
+
+      gefunden = 0;
+
+      cp3 = strpbrk (cp2 + 1, "sdlfe");
+
+      if (cp3 == NULL)
+      {
+         sprintf (fmessage + sl_all, "    Fehler in errfunc.c: "
+                                     "unzulaessige Formatangabe\n");
+         break;
+      }
+
+      if (*(cp3 + 1) != 0x00 && *(cp3 + 1) != '%')
+         cp2 = cp3 + 2;
+      else
+         cp2 = cp3 + 1;
+
+      sl = cp2 - cp1;
+
+      memcpy (zw, cp1, sl);
+      zw [sl] = 0x00;
+
+      switch (*cp3)
+      {
+         /*****************************************************/
+         /* shorts und chars darf es hier aus Syntaxgruenden  */
+         /* nicht geben (!?!)                                 */
+         /*****************************************************/
+
+         case 'd':
+            vint = va_arg (ap, int);
+            sprintf (fmessage + sl_all, zw, vint);
+            break;
+                
+         case 'l':
+            vlong = va_arg (ap, long);
+            sprintf (fmessage + sl_all, zw, vlong);
+            break;
+
+         case 'e':
+         case 'f':
+            vdouble = va_arg (ap, double);
+            sprintf (fmessage + sl_all, zw, vdouble);
+            break;
+
+         case 's':
+            pchar = va_arg (ap, char *);
+            sprintf (fmessage + sl_all, zw, pchar);
+            break;
+
+         default:
+            break;
+      }
+
+      sl_all = strlen (fmessage);
+
+      cp1 = cp2;
+      cp4 = cp2;
+   }
+
+   va_end (ap);
+
+   sprintf (fmessage + sl_all, cp1);
+   sl_all = strlen (fmessage);
+   
+   sl_alt = strlen (*error_list);
+   *error_list = realloc (*error_list, 
+                          (sl_alt + sl_all + 1) * sizeof (char));
+   memcpy (*error_list + sl_alt, fmessage, sl_all);
+   *(*error_list + sl_alt + sl_all) = 0x00;
+
+   return;
+}
+
+
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h
new file mode 100644
index 0000000..63a2f9d
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h
@@ -0,0 +1,211 @@
+/**********************************************************
+ * Version $Id: errfunc.h 1937 2014-01-11 18:22:42Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//              Grid_Filter / Grid_Calculus              //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       errfunc.h                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef struct fehlerinfo
+{
+   int fnr;
+   char art;
+   char *message;
+}
+fehlerinfo;
+
+void fehler (int zeile,
+             int fnr,
+             char *filename,
+             char *funk_name,
+             FILE *protfile,
+             fehlerinfo *finf,
+             void *info1,
+             void *info2,
+             void *info3,
+             void *info4,
+             void *info5,
+             void *info6,
+             void *info7);
+
+
+void error_message (int zeile,
+                    int fnr,
+                    char *filename,
+                    char *funk_name,
+                    char **error_list,
+                    fehlerinfo *finf,
+                    void *info1,
+                    void *info2,
+                    void *info3,
+                    void *info4,
+                    void *info5,
+                    void *info6,
+                    void *info7);
+       
+void fehler2 (int zeile,
+              int fnr,
+              char *filename,
+              char *funk_name,
+              FILE *protfile,
+              fehlerinfo *finf,
+              ...);
+
+void fehler3 (int zeile,
+              int fnr,
+              char *filename,
+              char *funk_name,
+              char **error_list,
+              fehlerinfo *finf,
+              ...);
+
+
+#define ERR_MESS_0(fnr)   error_message (__LINE__, (fnr), __FILE__, \
+                                         funk_name, &error_liste,   \
+                                         finfo, NULL, NULL, NULL,   \
+                                         NULL, NULL, NULL,          \
+                                         NULL)
+
+#define ERR_MESS_1(fnr,y)   error_message (__LINE__, (fnr), __FILE__, \
+                                           funk_name, &error_liste,   \
+                                           finfo, (y), NULL, NULL,    \
+                                           NULL, NULL, NULL,          \
+                                           NULL)
+
+
+#define ERRCHECK2_RC(fnr,finfo,x1,x2)                            \
+                                                                 \
+if (rc != 0)                                                     \
+{                                                                \
+   error_message (__LINE__,(fnr),__FILE__,funk_name,error_liste, \
+                  finfo,x1,x2,NULL,NULL,NULL,NULL,NULL);         \
+   return 8;                                                     \
+}
+
+#define ERRCHECK2_NULL(y,fnr,finfo,x1,x2)                        \
+                                                                 \
+if (y == NULL)                                                   \
+{                                                                \
+   error_message (__LINE__,(fnr),__FILE__,funk_name,error_liste, \
+                  finfo,x1,x2,NULL,NULL,NULL,NULL,NULL);         \
+}
+
+#define ERRCHECK2_RC_R(fnr,finfo,x1,x2)                          \
+                                                                 \
+if (rc != 0)                                                     \
+{                                                                \
+   error_message (__LINE__,(fnr),__FILE__,funk_name,error_liste, \
+                  finfo,x1,x2,NULL,NULL,NULL,NULL,NULL);         \
+   return rc;                                                    \
+}
+
+
+#define ERRCHECK2_NULL_R(y,fnr,finfo,x1,x2)                      \
+                                                                 \
+if (y == NULL)                                                   \
+{                                                                \
+   error_message (__LINE__,(fnr),__FILE__,funk_name,error_liste, \
+                  finfo,x1,x2,NULL,NULL,NULL,NULL,NULL);         \
+   return;                                                       \
+}
+
+
+#if 0
+
+#define ERRCHECK7_RC(fnr,finfo,x1,x2,x3,x4,x5,x6,x7)             \
+                                                                 \
+if (rc != 0)                                                     \
+{                                                                \
+   fehler2 (__LINE__,(fnr),__FILE__,funk_name,stdout,finfo,      \
+            x1,x2,x3,x4,x5,x6,x7);                               \
+}
+
+
+
+#define ERRCHECK7_NULL(y,fnr,finfo,x1,x2,x3,x4,x5,x6,x7)         \
+                                                                 \
+if (y == NULL)                                                   \
+{                                                                \
+   fehler2 (__LINE__,(fnr),__FILE__,funk_name,stdout,finfo,      \
+            x1,x2,x3,x4,x5,x6,x7);                               \
+}
+
+
+#define ERRCHECK7_RC_R(fnr,finfo,x1,x2,x3,x4,x5,x6,x7)           \
+                                                                 \
+if (rc != 0)                                                     \
+{                                                                \
+   fehler2 (__LINE__,(fnr),__FILE__,funk_name,stdout,finfo,      \
+            x1,x2,x3,x4,x5,x6,x7);                               \
+   return rc;                                                    \
+}
+
+
+#define ERRCHECK7_NULL_R(y,fnr,finfo,x1,x2,x3,x4,x5,x6,x7)       \
+                                                                 \
+if (y == NULL)                                                   \
+{                                                                \
+   fehler2 (__LINE__,(fnr),__FILE__,funk_name,stdout,finfo,      \
+            x1,x2,x3,x4,x5,x6,x7);                               \
+   return;                                                       \
+}
+
+
+#endif
+
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c
new file mode 100644
index 0000000..ef76b3f
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c
@@ -0,0 +1,609 @@
+/**********************************************************
+ * Version $Id: geovinc.c 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       geovinc.c                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <math.h>
+#include "storeorg.h"
+#include "geovinc.h"
+
+
+/************************************************************************/
+/* Funktioniert mit listfuncs.in2                                       */
+/************************************************************************/
+
+#define LISTELEMENT PIXEL
+#include "listfuncs.inc"
+#undef LISTELEMENT
+
+#define LISTELEMENT REGION
+#include "listfuncs.inc"
+#undef LISTELEMENT
+
+
+static int comp_PIXEL (simple_PIXEL_list *curr,
+                       simple_PIXEL_list *_new,
+                       void *add1,
+                       void *dummy)
+{
+   /*********************************************************************/
+   /*  1 -- der Grauwert von curr ist groesser                          */
+   /*  0 -- beide Grauwerte sind gleich gross                           */
+   /* -1 -- der Grauwert von new ist groesser                           */
+   /*********************************************************************/
+
+   unsigned short row;   
+   unsigned short col;   
+   unsigned short nrow;   
+   unsigned short ncol;  
+   double **greyvalues;
+
+   greyvalues = (double **) add1;
+
+   row = curr -> row;
+   col = curr -> col;
+
+   nrow = _new -> row;
+   ncol = _new -> col;
+
+   if (greyvalues [row][col] > greyvalues [nrow][ncol])
+      return 1;
+   else if (greyvalues [row][col] == greyvalues [nrow][ncol])
+      return 0;
+   else
+      return -1;
+}
+                       
+
+
+
+static int new_pixel_in_region (simple_REGION_list *maxreg, 
+                                unsigned short row, 
+                                unsigned short col)
+{
+   simple_PIXEL_list *_new;
+
+   _new = (simple_PIXEL_list *) malloc (sizeof (simple_PIXEL_list));
+   memset (_new, 0x00, sizeof (simple_PIXEL_list));
+   
+   _new -> row = row;
+   _new -> col = col;
+
+   append_simple_PIXEL_list (&(maxreg -> first),
+                             &(maxreg -> last),
+                             _new);
+   return 0;   
+}                                     
+
+
+
+static int new_region_in_region_list (simple_REGION_list **first,
+                                      simple_REGION_list **last)
+{
+   simple_REGION_list *_new;
+   
+   _new = (simple_REGION_list *) malloc (sizeof (simple_REGION_list));
+   memset (_new, 0x00, sizeof (simple_REGION_list));
+  
+   append_simple_REGION_list (first, last, _new);
+   
+   return 0;   
+}                                     
+
+
+static int free_pixlist_of_region (simple_REGION_list *mr)
+{
+   free_simple_PIXEL_list (&(mr -> first), &(mr -> last));  
+ 
+   return 0;
+}   
+
+
+
+static int free_last_region (simple_REGION_list **mr_first,
+                             simple_REGION_list **mr_last,
+                             simple_REGION_list *last_but_one)
+{
+   /*******************************************************************/
+   /* Hier wird vorausgesetzt, dass die Liste mindestens zwei         */
+   /* Regionen beinhaltet                                             */
+   /*******************************************************************/
+
+   free_pixlist_of_region (*mr_last);
+   return delete_last_simple_REGION (mr_first, mr_last, last_but_one);
+}
+
+
+static int flat_region_list (simple_REGION_list **mr_first,
+                             simple_REGION_list **mr_last,
+                             simple_PIXEL_list **flat_pixels_first,
+                             simple_PIXEL_list **flat_pixels_last,
+                             double **marker)
+{
+   simple_REGION_list *curr_reg;
+   simple_PIXEL_list *_new;
+
+   unsigned short row;
+   unsigned short col;
+
+   /*********************************************************************/
+   /* Hier wird vorausgesetzt, dass es mindestens eine Region gibt      */
+   /* Wir nehmen von jeder Maximalregion nur ein Pixel.                 */
+   /*********************************************************************/
+
+   for (curr_reg = *mr_first; curr_reg != NULL; curr_reg = curr_reg -> next)
+   {
+      row = curr_reg -> first -> row; 
+      col = curr_reg -> first -> col; 
+
+      _new = (simple_PIXEL_list *) malloc (sizeof (simple_PIXEL_list));
+      memset (_new, 0x00, sizeof (simple_PIXEL_list));
+   
+      _new -> row = row;
+      _new -> col = col;
+      _new -> greyvalue = marker [row][col];
+
+      append_simple_PIXEL_list (flat_pixels_first, flat_pixels_last, _new);
+
+      free_pixlist_of_region (curr_reg);
+   }
+
+   free_simple_REGION_list (mr_first, mr_last);
+
+   return 0;
+}
+
+
+static int single_check_neighbours (unsigned short numrows,
+                                    unsigned short numcols,
+                                    unsigned short row,
+                                    unsigned short col,
+                                    double **greyvalues,
+                                    short *maxflag,
+                                    short *ind_plateau)
+{
+   /*******************************************************************/
+   /* Hier wird geprueft, ob Pixel (row, col) zu einem regionalen     */
+   /* Maximum gehoeren koennte.                                       */
+   /* maxflag =  1: Grauwert im Pixel groesser oder gleich wie die    */
+   /*               Grauwerte aller Nachbarn                          */
+   /* maxflag = -1: Grauwert im Pixel kleiner als in mindestens einem */
+   /*                                                       Nachbarn  */
+   /*                                                                 */
+   /* maxflag sollte von der aufrufenden Funktion mit 1 initialisiert */
+   /* sein!                                                           */
+   /*                                                                 */
+   /* ind_plateau = 1: Es existiert mindestens ein Nachbar mit        */
+   /*                  demselben Grauwert                             */
+   /*                                                                 */
+   /* ind_plateau muss von der aufrufenden Funktion mit 0             */
+   /* initialisiert sein!                                             */
+   /*******************************************************************/
+   
+   unsigned short nrow;
+   unsigned short ncol;
+   unsigned short rowmin;
+   unsigned short colmin;
+   unsigned short rowmax;
+   unsigned short colmax;
+   
+
+   /*******************************************************************/
+   /* Hier wird vorerst nur die 4-er Nachbarschaft betrachtet.        */
+   /*******************************************************************/
+
+   rowmin = (row == 0) ? 0 : row - 1;
+   colmin = (col == 0) ? 0 : col - 1;
+   rowmax = (row == numrows - 1) ? row : row + 1;
+   colmax = (col == numcols - 1) ? col : col + 1;
+   
+   /*******************************************************************/
+   /* Hier wird nur geprueft, es wird keine Liste der Pixel des       */
+   /* eventuellen Maximums angelegt.                                  */
+   /*******************************************************************/
+
+   for (nrow = rowmin; nrow <= rowmax; nrow ++)
+   {
+	  //#pragma omp parallel for
+      for (ncol = colmin; ncol <= colmax; ncol ++)
+      {
+         /*************************************************************/
+         /* Im ersten Fall liegen das aktuelle und das Nachbar-Pixel  */
+         /* diagonal (8-Nachbarschaft), im zweiten sind sie identisch */
+         /*************************************************************/
+
+         if ((ncol != col && nrow != row) || (ncol == col && nrow == row))
+            continue;
+            
+         if (greyvalues [row][col] < greyvalues [nrow][ncol])
+            *maxflag = -1;
+         else if (greyvalues [nrow][ncol] == greyvalues [row][col])
+            *ind_plateau = 1;
+      }
+   }
+   
+   return 0;
+}
+
+
+static int check_plateau (unsigned short numrows,                   
+                          unsigned short numcols,                   
+                          double **greyvalues,
+                          unsigned char **vis,
+                          simple_REGION_list *mr,  
+                          simple_PIXEL_list *currpix,
+                          short *maxflag)
+{
+   /*******************************************************************/
+   /* Hier wird eine Pixelliste eines Plateaus angelegt, also einer   */
+   /* zusammenhaengenden Region von Pixeln, die alle denselben        */
+   /* Grauwert besitzen. Gleichzeitig wird festgestellt ob es sich    */
+   /* bei dieser Region um ein regionales Maximum handelt.            */
+   /* Sobald ein Nachbarpixel des Plateaus angetroffen wird, dessen   */
+   /* Grauwert den des Plateaus uebertrifft, ist klar, dass es sich   */
+   /* bei dem Plateau nicht um ein regionales Maximum handeln kann.   */
+   /* Das Plateau wird trotzdem weiter abgearbeitet, damit alle Pixel */
+   /* des Plateaus als besucht gekennzeichnet werden koennen. Erst    */
+   /* danach wird die Liste bzw. Region wieder aufgeloest.            */
+   /*******************************************************************/
+   
+   unsigned short row;
+   unsigned short col;
+   unsigned short nrow;
+   unsigned short ncol;
+   unsigned short rowmin;
+   unsigned short colmin;
+   unsigned short rowmax;
+   unsigned short colmax;
+
+
+   row = currpix -> row;
+   col = currpix -> col;
+
+   /*******************************************************************/
+   /* Hier wird vorerst nur die 4-er Nachbarschaft betrachtet.        */
+   /*******************************************************************/
+
+   rowmin = (row == 0) ? 0 : row - 1;
+   colmin = (col == 0) ? 0 : col - 1;
+   rowmax = (row == numrows - 1) ? row : row + 1;
+   colmax = (col == numcols - 1) ? col : col + 1;
+   
+   
+   for (nrow = rowmin; nrow <= rowmax; nrow ++)
+   {
+	  //#pragma omp parallel for
+      for (ncol = colmin; ncol <= colmax; ncol ++)
+      {
+         /*************************************************************/
+         /* Im ersten Fall liegen das aktuelle und das Nachbar-Pixel  */
+         /* diagonal (8-Nachbarschaft), im zweiten sind sie identisch */
+         /*************************************************************/
+ 
+        if ((ncol != col && nrow != row) || (ncol == col && nrow == row))
+            continue;
+            
+         /*************************************************************/
+         /* Wir machen hier weiter, auch wenn das Nachbarpixel schon  */
+         /* mal besucht wurde, da sonst eventuell maxflag nicht       */
+         /* richtig gesetzt wird.                                     */
+         /*************************************************************/
+            
+         if (greyvalues [nrow][ncol] == greyvalues [row][col])
+         {
+            if (vis [nrow][ncol] == 0)
+            {
+               new_pixel_in_region (mr, nrow, ncol);
+               
+
+               /*******************************************************/
+               /* In die Liste gestellt ist hier so gut wie schon     */
+               /* besucht. Das Pixel wird markiert, damit es nicht    */
+               /* nochmal in die Liste reinkommt                      */
+               /*******************************************************/
+               
+               vis [nrow][ncol] = 1;
+            }   
+         }   
+         else if (greyvalues [nrow][ncol] > greyvalues [row][col])
+         {
+            /**********************************************************/
+            /* Dieser Nachbarpunkt gehoert nicht zum Plateau, wird    */
+            /* also nicht an die Liste angehaengt. Dennoch gibt es    */
+            /* hier kein break. Falls ein Plateau gefunden wurde,     */
+            /* wird es immer als Ganzes bearbeitet, auch wenn schon   */
+            /* klar ist, dass es sich nicht um ein Maximum handelt!   */
+            /**********************************************************/
+
+            *maxflag = -1;
+         }
+         else
+         {
+            ;         
+
+            /**********************************************************/
+            /* Da passiert gar nichts.                                */
+            /**********************************************************/
+         }
+      }
+   }
+   
+   return 0;
+}
+
+
+static int find_regional_maxima (unsigned short numrows, 
+                                 unsigned short numcols,
+                                 simple_REGION_list **mr_first,
+                                 simple_REGION_list **mr_last,
+                                 short *num_regions,
+                                 double **greyvalues)
+{
+   /*******************************************************************/
+   /* Es werden Listen von regionalen Maxima erzeugt                  */
+   /*******************************************************************/
+   
+   unsigned short row;
+   unsigned short col;
+   short maxflag;
+   short ind_plateau;
+   simple_PIXEL_list *currpix;
+   simple_REGION_list *last_but_one = NULL;
+  
+   unsigned char **vis;
+
+
+   vis = (unsigned char **) matrix_all_alloc (numrows, numcols, 'U', 0);
+
+   new_region_in_region_list (mr_first, mr_last);
+
+   *num_regions = 0;
+  
+
+   for (row = 0; row < numrows; row ++)
+   {
+	  //#pragma omp parallel for
+      for (col = 0; col < numcols; col ++)
+      {
+         if (vis [row][col] != 0)
+            continue;
+            
+         maxflag = 1;
+         ind_plateau = 0;
+   
+         single_check_neighbours (numrows, numcols, row, col, greyvalues, &maxflag, &ind_plateau);
+
+         /*************************************************************/
+         /* Das aktuelle Pixel der Schleife wird hier als besucht     */
+         /* markiert, auch wenn es das erste Pixel eines Plateaus     */
+         /* ist (die uebrigen Pixel des Plateaus werden dann in       */
+         /* check_plateau_us markiert).                               */
+         /*************************************************************/
+
+         vis [row][col] = 1;
+                                     
+         if (ind_plateau == 0)
+         {
+            /**********************************************************/
+            /* Kein Nachbarpixel hat denselben Grauwert wie das       */
+            /* aktuelle Pixel                                         */
+            /**********************************************************/
+            
+            if (maxflag == 1)
+            {
+               /*******************************************************/
+               /* Ein Maximum, bestehend aus einem einzigen Pixel     */
+               /*******************************************************/
+               
+               last_but_one = *mr_last;    
+               new_pixel_in_region (*mr_last, row, col);
+               (*num_regions) ++;
+               new_region_in_region_list (mr_first, mr_last);
+            }
+            else
+            {
+               ;
+               
+               /*******************************************************/
+               /* Kein Maximum, da tun wir gar nichts                 */
+               /*******************************************************/
+            }
+            
+            continue;  
+         }
+         
+
+         /*************************************************************/
+         /* Es ist ein Plateau                                        */
+         /*************************************************************/
+         
+         new_pixel_in_region (*mr_last, row, col);
+         //#pragma omp parallel for
+         for (currpix = (*mr_last) -> first; currpix != NULL; currpix = currpix -> next)
+         {
+            check_plateau (numrows, numcols, greyvalues, vis, *mr_last, currpix, &maxflag);
+         }
+		 
+         if (maxflag == -1)
+            free_pixlist_of_region (*mr_last);
+         else
+         {
+            /**********************************************************/
+            /* Ein neues Maximum-Plateau                              */
+            /**********************************************************/
+            last_but_one = *mr_last;    
+            new_region_in_region_list (mr_first, mr_last);
+
+            (*num_regions) ++;
+         }
+      }
+   }
+
+   free_last_region (mr_first, mr_last, last_but_one);
+   matrix_all_free ((void **) vis);
+   
+   return 0;
+}
+
+
+
+
+#define MINIMUM(a,b) ((a)<(b))?a:b
+
+
+int geodesic_morphological_reconstruction (
+                unsigned short numrows,
+                unsigned short numcols,
+                double **mask,
+                double **marker)
+{
+   int k;
+
+   simple_REGION_list *mr_first = NULL;
+   simple_REGION_list *mr_last = NULL;
+
+   simple_PIXEL_list *first_pix = NULL;
+   simple_PIXEL_list *last_pix = NULL;
+   simple_PIXEL_list *curr_pix;
+   simple_PIXEL_list *_new;
+
+   short num_regions;
+
+   unsigned short rowmin;
+   unsigned short colmin;
+   unsigned short rowmax;
+   unsigned short colmax;
+   unsigned short row;
+   unsigned short col;
+   unsigned short nrow;
+   unsigned short ncol;
+
+   find_regional_maxima (numrows, numcols, &mr_first, &mr_last, &num_regions, marker);
+   
+   /*********************************************************************/
+   /* Hier wird jetzt die Regionen-Liste geplaettet, d.h. in eine Liste */
+   /* von Pixeln ueberfuehrt. Diese Liste wird schon nach Grauwerten    */
+   /* sortiert.                                                         */
+   /*********************************************************************/
+
+   flat_region_list (&mr_first, &mr_last, &first_pix, &last_pix, marker);
+  
+   memset (*marker, 0x00, numrows * numcols * sizeof (double));
+
+   for (curr_pix = first_pix; curr_pix != NULL; curr_pix = curr_pix -> next)
+   {
+      row = curr_pix -> row;
+      col = curr_pix -> col;
+	  marker [row][col] = curr_pix -> greyvalue;
+   }
+
+   /*********************************************************************/
+   /* Hier kommt jetzt die alles entscheidende Schleife, in der die     */
+   /* Dilatation vorgenommen wird. Das vorderste Element der Pixelliste */
+   /* wird herausgenommen; seine Nachbarn werden in die Pixelliste      */
+   /* einsortiert, falls ihr Grauwert geaendert werden kann.            */
+   /*********************************************************************/
+
+   for (curr_pix = first_pix, k = 1; curr_pix != NULL;  curr_pix = first_pix, k ++)
+   {
+      row = curr_pix -> row;
+      col = curr_pix -> col;
+	  delete_first_simple_PIXEL (&first_pix, &last_pix);
+
+      /****************************************************************/
+      /* Hier wird vorerst nur die 4-er Nachbarschaft betrachtet.     */
+      /****************************************************************/
+
+      rowmin = (row == 0) ? 0 : row - 1;
+      colmin = (col == 0) ? 0 : col - 1;
+      rowmax = (row == numrows - 1) ? row : row + 1;
+      colmax = (col == numcols - 1) ? col : col + 1;
+      for (nrow = rowmin; nrow <= rowmax; nrow ++)
+      {
+		for (ncol = colmin; ncol <= colmax; ncol ++)
+		{
+		/*************************************************************/
+		/* Im ersten Fall liegen das aktuelle und das Nachbar-Pixel  */
+		/* diagonal (8-Nachbarschaft), im zweiten sind sie identisch */
+		/*************************************************************/	
+    	   if ((ncol != col && nrow != row) || (ncol == col && nrow == row))
+				continue;
+	 	   if (marker [nrow][ncol] >= marker [row][col] || marker [nrow][ncol] == mask [nrow][ncol])
+				continue;
+
+			marker [nrow][ncol] = MINIMUM((marker[row][col]),(mask[nrow][ncol]));
+			_new = (simple_PIXEL_list *) malloc (sizeof(simple_PIXEL_list));
+            memset (_new, 0x00, sizeof(simple_PIXEL_list));
+			_new -> row = nrow;
+			_new -> col = ncol;
+            append_simple_PIXEL_list (&first_pix, &last_pix, _new);
+         }
+      }
+   }
+
+   return 0;
+}
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.h
new file mode 100644
index 0000000..2d86380
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.h
@@ -0,0 +1,54 @@
+
+typedef struct simple_PIXEL_list
+{
+   unsigned short row;
+   unsigned short col;
+   double greyvalue;
+   
+   struct simple_PIXEL_list *next;
+}
+simple_PIXEL_list;
+
+
+typedef struct double_PIXEL_list
+{
+   unsigned short row;
+   unsigned short col;
+   double greyvalue;
+   
+   struct double_PIXEL_list *prev;
+   struct double_PIXEL_list *next;
+}
+double_PIXEL_list;
+
+
+
+
+typedef struct simple_REGION_list
+{
+   struct simple_REGION_list *next;
+
+   struct simple_PIXEL_list *first;
+   struct simple_PIXEL_list *last;
+}
+simple_REGION_list;
+
+
+typedef struct double_REGION_list
+{
+   struct double_REGION_list *prev;
+   struct double_REGION_list *next;
+
+   struct double_PIXEL_list *first;
+   struct double_PIXEL_list *last;
+}
+double_REGION_list;
+
+
+
+int geodesic_morphological_reconstruction (
+                unsigned short numrows,
+                unsigned short numcols,
+                double **mask,
+                double **marker);
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc b/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc
new file mode 100644
index 0000000..cfe787e
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc
@@ -0,0 +1,920 @@
+/**********************************************************
+ * Version $Id: listfuncs.inc 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     listfuncs.inc                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+/************************************************************************/
+/* Vor diese Datei irgendwo includiert wird, muessen                    */
+/*    LISTELEMENT             (z.B. #define LISTELEMENT REGION)         */
+/* durch ein #define,                                                   */
+/*    simple_LISTELEMENT_list (z.B. typedef struct simple_REGION_list)  */
+/*    double_LISTELEMENT_list (z.B. typedef struct double_REGION_list)  */
+/* durch ein typedef definiert sein!                                    */
+/* Diese Strukturen muessen ein Feld simple_LISTELEMENT_list *next      */
+/* bzw. zwei Felder simple_LISTELEMENT_list *next, *prev enthalten.     */
+/* Funktioniert z.B. mit georec.c                                       */
+/************************************************************************/
+
+/* zu tun: Funktionen INSSORTSLIST2, INSSORTDLIST2 in denen der         */ 
+/* Vergleich direkt vorgenommen wird:                                   */
+/* if (curr -> content.sortkey >= new -> content.sortkey)      etc.     */
+
+
+#if 0
+#ifndef __LISTFUNCS_INC__
+
+#define __LISTFUNCS_INC__
+
+#endif
+#endif
+
+
+#define CONCAT(x,y)    x ## y
+#define LCONCAT(x,y)  CONCAT(x,y)
+
+#define SLIST          LCONCAT(LCONCAT(simple_,LISTELEMENT),_list)
+#define DLIST          LCONCAT(LCONCAT(double_,LISTELEMENT),_list)
+#define APPSLIST       LCONCAT(LCONCAT(append_simple_,LISTELEMENT),_list) 
+#define APPDLIST       LCONCAT(LCONCAT(append_double_,LISTELEMENT),_list)
+#define APPNEWSLIST    LCONCAT(LCONCAT(append_new_simple_,LISTELEMENT),_list) 
+#define APPNEWDLIST    LCONCAT(LCONCAT(append_new_double_,LISTELEMENT),_list) 
+#define PRESLIST       LCONCAT(LCONCAT(prepend_simple_,LISTELEMENT),_list) 
+#define PREDLIST       LCONCAT(LCONCAT(prepend_double_,LISTELEMENT),_list) 
+#define PRENEWSLIST    LCONCAT(LCONCAT(prepend_new_simple_,LISTELEMENT),_list) 
+#define PRENEWDLIST    LCONCAT(LCONCAT(prepend_new_double_,LISTELEMENT),_list) 
+#define CONCATSLIST    LCONCAT(LCONCAT(concat_simple_,LISTELEMENT),_list)
+#define CONCATDLIST    LCONCAT(LCONCAT(concat_double_,LISTELEMENT),_list)
+#define APPAFTERSLIST  LCONCAT(LCONCAT(app_after_simple_,LISTELEMENT),_list) 
+#define APPAFTERDLIST  LCONCAT(LCONCAT(app_after_double_,LISTELEMENT),_list) 
+#define APPBEFOREDLIST LCONCAT(LCONCAT(app_before_double_,LISTELEMENT),_list) 
+#define APPBEFORESLIST LCONCAT(LCONCAT(app_before_simple_,LISTELEMENT),_list) 
+#define DELETESFIRST   LCONCAT(delete_first_simple_,LISTELEMENT)
+#define DELETEDFIRST   LCONCAT(delete_first_double_,LISTELEMENT)
+#define DELETESLAST    LCONCAT(delete_last_simple_,LISTELEMENT)
+#define DELETEDLAST    LCONCAT(delete_last_double_,LISTELEMENT)
+#define REMOVESFIRST   LCONCAT(remove_first_simple_,LISTELEMENT) 
+#define REMOVEDFIRST   LCONCAT(remove_first_double_,LISTELEMENT) 
+#define REMOVESELEMENT LCONCAT(LCONCAT(remove_simple_,LISTELEMENT),_list) 
+#define REMOVEDELEMENT LCONCAT(LCONCAT(remove_double_,LISTELEMENT),_list) 
+#define FREESLIST      LCONCAT(LCONCAT(free_simple_,LISTELEMENT),_list)
+#define FREEDLIST      LCONCAT(LCONCAT(free_double_,LISTELEMENT),_list)
+#define INSSORTSLIST   LCONCAT(LCONCAT(inssort_simple_,LISTELEMENT),_list) 
+#define INSSORTDLIST   LCONCAT(LCONCAT(inssort_double_,LISTELEMENT),_list) 
+#define COMPELEMENT    LCONCAT(comp_,LISTELEMENT)
+
+
+int APPSLIST (SLIST **first, SLIST **last, SLIST *new);
+
+int APPDLIST (DLIST **first, DLIST **last, DLIST *new);
+
+int APPNEWSLIST (SLIST **first, SLIST **last);
+
+int APPNEWDLIST (DLIST **first, DLIST **last);
+
+int PRESLIST (SLIST **first, SLIST **last, SLIST *new);
+
+int PREDLIST (DLIST **first, DLIST **last, DLIST *new);
+
+int PRENEWSLIST (SLIST **first, SLIST **last);
+
+int PRENEWDLIST (DLIST **first, DLIST **last);
+
+int CONCATSLIST (SLIST **first, SLIST **last, SLIST *fapp, SLIST *lapp);
+
+int CONCATDLIST (DLIST **first, DLIST **last, DLIST *fapp, DLIST *lapp);
+
+int APPAFTERSLIST (SLIST **first, SLIST **last, SLIST *old, SLIST *new);
+
+int APPAFTERDLIST (DLIST **first, DLIST **last, DLIST *old, DLIST *new);
+
+int APPBEFORESLIST (SLIST **first,
+                    SLIST **last,
+                    SLIST *old,
+                    SLIST *oldprev,
+                    SLIST *new);
+
+int APPBEFOREDLIST (DLIST **first, DLIST **last, DLIST *old, DLIST *new);
+
+int DELETESFIRST (SLIST **first, SLIST **last);
+
+int DELETEDFIRST (DLIST **first, DLIST **last);
+
+int DELETESLAST (SLIST **first, SLIST **last, SLIST *last_but_one);
+
+int DELETEDLAST (DLIST **first, DLIST **last);
+
+int REMOVESFIRST (SLIST **first, SLIST **last);
+
+int REMOVEDFIRST (DLIST **first, DLIST **last);
+
+int REMOVESELEMENT (SLIST **first, SLIST **last, SLIST *prev, SLIST *el);
+
+int REMOVEDELEMENT (DLIST **first, DLIST **last, DLIST *el);
+
+int FREESLIST (SLIST **first, SLIST **last);
+
+int FREEDLIST (DLIST **first, DLIST **last);
+
+int INSSORTSLIST (SLIST **first, 
+                  SLIST **last, 
+                  short ascdesc, 
+                  SLIST *new,
+                  void *add1,
+                  void *add2,
+                  int (*comp)(SLIST *, SLIST *, void *, void *));
+
+int INSSORTDLIST (DLIST **first, 
+                  DLIST **last, 
+                  short ascdesc, 
+                  DLIST *new,
+                  void *add1,
+                  void *add2,
+                  int (*comp) (DLIST *, DLIST *, void *, void *));
+
+
+/************************************************************************/
+/* Neues Element an eine Liste hinten dranhaengen                       */
+/************************************************************************/
+
+int APPSLIST (SLIST **first,
+              SLIST **last,
+              SLIST *new)
+{
+   if (*first == NULL)
+   {
+      *first = new;
+      *last  = new;
+   }
+   else
+   {
+      (*last) -> next = new;
+   }
+   
+   *last = new;
+   new -> next = NULL;
+   
+   return 0;
+}
+
+
+
+
+int APPDLIST (DLIST **first,
+              DLIST **last,
+              DLIST *new)
+{
+   if (*first == NULL)
+   {
+      *first = new;
+      *last  = new;
+      new -> prev = NULL;
+   }
+   else
+   {
+      (*last) -> next = new;
+      new -> prev = *last;
+   }
+   
+   *last = new;
+   new -> next = NULL;
+   
+   return 0;
+}
+
+
+
+int APPNEWSLIST (SLIST **first,
+                 SLIST **last)
+{
+   SLIST *new_el;
+
+   new_el = (SLIST *) malloc (sizeof (SLIST));
+   memset (new_el, 0x00, sizeof(SLIST));
+
+   if (*first == NULL)
+   {
+      *first = new_el;
+      *last  = new_el;
+   }
+   else
+   {
+      (*last) -> next = new_el;
+   }
+   
+   *last = new_el;
+   
+   return 0;
+}
+
+
+
+
+int APPNEWDLIST (DLIST **first,
+                 DLIST **last)
+{
+   DLIST *new_el;
+
+   new_el = (DLIST *) malloc (sizeof (DLIST));
+   memset (new_el, 0x00, sizeof(DLIST));
+
+   if (*first == NULL)
+   {
+      *first = new_el;
+      *last  = new_el;
+   }
+   else
+   {
+      (*last) -> next = new_el;
+	  new_el -> prev = *last;
+   }
+   
+   *last = new_el;
+   
+   return 0;
+}
+
+
+
+
+
+
+
+/************************************************************************/
+/* Neues Element einer Liste voranstellen                               */
+/************************************************************************/
+
+int PRESLIST (SLIST **first,
+              SLIST **last,
+              SLIST *new)
+{
+   if (*first == NULL)
+   {
+      *first = new;
+      *last  = new;
+      new -> next = NULL;
+   }
+   else
+   {
+      new -> next = *first;
+   }
+   
+   *first = new;
+   
+   return 0;
+}
+
+
+
+
+int PRENEWSLIST (SLIST **first,
+                 SLIST **last)
+{
+   SLIST *new_el;
+
+   new_el = (SLIST *) malloc (sizeof (SLIST));
+   memset (new_el, 0x00, sizeof(SLIST));
+
+
+   if (*first == NULL)
+   {
+      *first = new_el;
+      *last  = new_el;
+   }
+   else
+   {
+      new_el -> next = *first;
+   }
+   
+   *first = new_el;
+   
+   return 0;
+}
+
+
+
+
+
+
+int PREDLIST (DLIST **first,
+              DLIST **last,
+              DLIST *new)
+{
+   if (*first == NULL)
+   {
+      *first = new;
+      *last  = new;
+      new -> next = NULL;
+   }
+   else
+   {
+      new -> next = *first;
+      (*first) -> prev = new;
+   }
+   
+   *first = new;
+   new -> prev = NULL;
+   
+   return 0;
+}
+
+
+
+int PRENEWDLIST (DLIST **first,
+                 DLIST **last)
+{
+   DLIST *new_el;
+
+   new_el = (DLIST *) malloc (sizeof (DLIST));
+   memset (new_el, 0x00, sizeof(DLIST));
+
+   if (*first == NULL)
+   {
+      *first = new_el;
+      *last  = new_el;
+   }
+   else
+   {
+      new_el -> next = *first;
+      (*first) -> prev = new_el;
+   }
+   
+   *first = new_el;
+   
+   return 0;
+}
+
+
+
+
+
+int CONCATSLIST (SLIST **first, SLIST **last, SLIST *fapp, SLIST *lapp)
+{
+   /*********************************************************************/
+   /* Hier wird die zweite Liste an die erste drangehaengt.             */
+   /*********************************************************************/
+   
+   if (fapp == NULL)
+      return 8;
+   else if (*first == NULL)
+   {
+      *first = fapp;
+      *last = lapp;
+      return 4;
+   }
+   else
+   {
+      (*last) -> next = fapp;
+      *last = lapp;
+      return 0;
+   }
+
+   return 0;
+}
+
+
+
+
+
+int CONCATDLIST (DLIST **first, DLIST **last, DLIST *fapp, DLIST *lapp)
+{
+   /*********************************************************************/
+   /* Hier wird die zweite Liste an die erste drangehaengt.             */
+   /*********************************************************************/
+   
+   if (fapp == NULL)
+      return 8;
+   else if (*first == NULL)
+   {
+      *first = fapp;
+      *last = lapp;
+      return 4;
+   }
+   else
+   {
+      (*last) -> next = fapp;
+      fapp -> prev = *last;
+      *last = lapp;
+      return 0;
+   }
+
+   return 0;
+}
+
+
+
+
+
+/************************************************************************/
+/* Neues Element in eine Liste hinter einem bestimmten Element          */
+/* einfuegen                                                            */
+/************************************************************************/
+
+int APPAFTERSLIST (SLIST **first,
+                   SLIST **last,
+                   SLIST *old,
+                   SLIST *new)
+{
+   if (old == NULL)
+      return 8;
+
+   new -> next = old -> next;
+   old -> next = new;
+ 
+   if (old == *last)
+      *last = new;
+   
+   return 0;
+}
+
+
+
+
+int APPAFTERDLIST (DLIST **first,
+                   DLIST **last,
+                   DLIST *old,
+                   DLIST *new)
+{
+   if (old == NULL)
+      return 8;
+
+   new -> next = old -> next;
+   new -> prev = old;
+
+   if (old == *last)
+      *last = new;
+   else
+      old -> next -> prev = new;
+   
+   old -> next = new;
+
+   return 0;
+}
+
+
+/************************************************************************/
+/* Neues Element in eine Liste vor einem bestimmten Element einfuegen   */
+/************************************************************************/
+
+int APPBEFORESLIST (SLIST **first,
+                    SLIST **last,
+                    SLIST *old,
+                    SLIST *oldprev,
+                    SLIST *new)
+{
+   if (old == NULL)
+      return 8;
+
+   new -> next = old;
+
+   if (old == *first)
+      *first = new;
+   else
+      oldprev -> next = new;
+   
+   return 0;
+}
+
+
+
+
+int APPBEFOREDLIST (DLIST **first,
+                    DLIST **last,
+                    DLIST *old,
+                    DLIST *new)
+{
+   if (old == NULL)
+      return 8;
+
+   new -> next = old;
+   new -> prev = old -> prev;
+
+   if (old == *first)
+      *first = new;
+   else
+      old -> prev -> next = new;
+
+   old -> prev = new;
+   
+   return 0;
+}
+
+
+
+
+
+int DELETESFIRST (SLIST **first, SLIST **last)
+{
+   SLIST *zw;
+
+   if (*first == NULL)
+      return 8;
+
+   if (*first == *last)
+   {
+      free (*first);
+      *first = NULL;
+      *last  = NULL;
+      return 0;
+   }
+
+   zw = *first;
+   *first = zw -> next;
+   free (zw);
+
+   return 0;
+}
+
+
+   
+
+int DELETEDFIRST (DLIST **first, DLIST **last)
+{
+   DLIST *zw;
+
+   if (*first == NULL)
+      return 8;
+
+   if (*first == *last)
+   {
+      free (*first);
+      *first = NULL;
+      *last  = NULL;
+      return 0;
+   }
+
+   zw = *first;
+   *first = zw -> next;
+   free (zw);
+   (*first) -> prev = NULL;
+
+   return 0;
+}
+
+
+   
+
+
+int DELETESLAST (SLIST **first, SLIST **last, SLIST *last_but_one)
+{
+   if (*first == NULL)
+      return 8;
+
+   if (*first == *last)
+   {
+      free (*first);
+      *first = NULL;
+      *last  = NULL;
+      return 0;
+   }
+
+   free (*last);
+   last_but_one -> next = NULL;
+   *last = last_but_one;
+
+   return 0;
+}
+
+
+   
+
+
+
+int DELETEDLAST (DLIST **first, DLIST **last)
+{
+   DLIST *zw;
+
+   if (*first == NULL)
+      return 8;
+
+   if (*first == *last)
+   {
+      free (*first);
+      *first = NULL;
+      *last  = NULL;
+      return 0;
+   }
+
+   zw = (*last) -> prev;
+   free (*last);
+   zw -> next = NULL;
+   *last = zw;
+
+   return 0;
+}
+
+
+   
+
+int REMOVESFIRST (SLIST **first, SLIST **last)
+{
+   SLIST *zw;
+
+   if (*first == NULL)
+      return 8;
+
+   if (*first == *last)
+   {
+      *first = NULL;
+      *last  = NULL;
+   }
+   else
+   {
+      zw = *first;
+      *first = zw -> next;
+      zw -> next = NULL;
+   }
+
+   return 0;
+}
+
+
+   
+
+
+int REMOVEDFIRST (DLIST **first, DLIST **last)
+{
+   DLIST *zw;
+
+   if (*first == NULL)
+      return 8;
+
+   if (*first == *last)
+   {
+      *first = NULL;
+      *last  = NULL;
+   }
+   else
+   {
+      zw = *first;
+      *first = zw -> next;
+      zw -> next = NULL;
+   }
+
+   return 0;
+}
+
+
+   
+
+
+
+
+
+
+/************************************************************************/
+/* Element aus der Liste entfernen                                      */
+/************************************************************************/
+
+int REMOVESELEMENT (SLIST **first,
+                    SLIST **last,
+                    SLIST *prev,
+                    SLIST *el)
+{
+   if (el == NULL)
+      return 8;
+
+   if (el == *first)
+      *first = el -> next; 
+   else
+      prev -> next = el -> next;
+
+   if (el == *last)
+      *last = prev;
+
+   el -> next = NULL;
+
+   return 0;
+}
+
+
+
+
+int REMOVEDELEMENT (DLIST **first,
+                    DLIST **last,
+                    DLIST *el)
+{   
+   if (el == NULL)
+      return 8;
+
+   if (el == *first)
+      *first = el -> next; 
+   else
+      el -> prev -> next = el -> next;
+
+   if (el == *last)
+      *last = el -> prev;
+   else
+      el -> next -> prev = el -> prev;
+
+   el -> next = NULL;
+   el -> prev = NULL;
+
+   return 0;
+}
+
+
+
+
+
+/************************************************************************/
+/* Liste freigeben                                                      */
+/************************************************************************/
+
+int FREESLIST (SLIST **first, SLIST **last)
+{
+   SLIST *currpix;
+   SLIST *nextpix;
+
+   for (currpix = *first; currpix != NULL; currpix = nextpix)
+   {
+      nextpix = currpix -> next;
+      free (currpix);
+   }  
+
+   *first = NULL;
+   *last  = NULL;
+
+   return 0;
+}
+
+
+
+
+int FREEDLIST (DLIST **first, DLIST **last)
+{
+   DLIST *currpix;
+   DLIST *nextpix;
+
+   for (currpix = *first; currpix != NULL; currpix = nextpix)
+   {
+      nextpix = currpix -> next;
+      free (currpix);
+   }  
+
+   *first = NULL;
+   *last  = NULL;
+
+   return 0;
+}
+
+
+
+
+int INSSORTSLIST (SLIST **first,
+                  SLIST **last,
+                  short ascdesc,
+                  SLIST *new,
+                  void *add1,
+                  void *add2,
+                  int (*comp) (SLIST *, SLIST *, void *, void *))
+{
+   SLIST *curr;
+   SLIST *currprev;
+
+   if (*first == NULL)
+   {
+      *first = new;
+      *last  = new;
+
+      return 0;
+   }
+   
+   currprev = NULL; 
+
+   if (ascdesc > 1)    /* die Liste soll aufsteigend sortiert werden */
+   {
+      for (curr = *first; curr != NULL; curr = curr -> next)
+      {
+         if ((*comp) (curr, new, add1, add2) >= 0)  /* curr >= new */
+         {
+             APPBEFORESLIST (first, last, curr, currprev, new);
+             return 0;
+         }
+
+         currprev = curr;
+     }
+   }
+   else                /* die Liste soll absteigend sortiert werden  */
+   {  
+      for (curr = *first; curr != NULL; curr = curr -> next)
+      {
+         if ((*comp) (curr, new, add1, add2) <= 0)  /* curr <= new */
+         {
+             APPBEFORESLIST (first, last, curr, currprev, new); 
+
+             return 0;
+         }
+
+         currprev = curr;
+      }
+   }
+
+   return (APPSLIST (first, last, new));
+}
+
+
+
+
+int INSSORTDLIST (DLIST **first,
+                  DLIST **last,
+                  short ascdesc,
+                  DLIST *new,
+                  void *add1,
+                  void *add2,
+                  int (*comp) (DLIST *, DLIST *, void *, void *))
+{
+   DLIST *curr;
+
+   if (*first == NULL)
+   {
+      *first = new;
+      *last  = new;
+
+      return 0;
+   }
+   
+   if (ascdesc > 1)    /* die Liste soll aufsteigend sortiert werden */
+   {
+      for (curr = *first; curr != NULL; curr = curr -> next)
+      {
+         if ((*comp) (curr, new, add1, add2) >= 0)  /* curr >= new */
+         {
+             APPBEFOREDLIST (first, last, curr, new);
+             return 0;
+         }
+     }
+   }
+   else                /* die Liste soll absteigend sortiert werden  */
+   {  
+      for (curr = *first; curr != NULL; curr = curr -> next)
+      {
+         if ((*comp) (curr, new, add1, add2) <= 0)  /* curr <= new */
+         {
+             APPBEFOREDLIST (first, last, curr, new);
+             return 0;
+         }
+      }
+   }
+
+   return (APPDLIST (first, last, new));
+}
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h b/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h
new file mode 100644
index 0000000..697c136
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h
@@ -0,0 +1,72 @@
+/**********************************************************
+ * Version $Id: rho.h 1937 2014-01-11 18:22:42Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//              Grid_Filter / Grid_Calculus              //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                         rho.h                         //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+/*******************************/
+/* globale Variable            */
+/*******************************/
+
+#define RHO_GRAD   (M_1_PI*180.0)    /* M_1_PI  - Reziprokwert von pi */
+#define RHO_ARCSEC (M_1_PI*648000.0) /* def. in /usr/include/math.h   */
+#define RHO_STUND  (M_1_PI*12.0)
+#define RHO_TSEC   (M_1_PI*43200.0)
+#define RHO_REZ    (M_PI/180.0)
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c
new file mode 100644
index 0000000..29b8916
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c
@@ -0,0 +1,1228 @@
+/**********************************************************
+ * Version $Id: spezfunc.c 1937 2014-01-11 18:22:42Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//              Grid_Filter / Grid_Calculus              //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      spezfunc.c                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define M_PI 3.141592653589793
+
+#include "storeorg.h"
+#include "spezfunc.h"
+#include "rho.h"
+#include "errfunc.h"
+
+
+static fehlerinfo finfo [] =
+        { { 1001, 'E', "    Fehler in legendre_dreieck_alloc, "
+                       "lmax = %d\n"                           },
+          { 1002, 'E', "    Fehler beim Einlesen der "
+                       "Nullstellen, Zeile %d \n" },
+          { 1003, 'E', "    Fehlerhafte Indizierung im Nullstellenfile,"
+                       " Grad (ist)  = %d,\n"
+                       "                                               "
+                       " Grad (soll) = %d,\n" },
+          { 1004, 'F', "    Fehler in der Funktion zur "
+                       "Berechnung der Gitterwerte \n" },
+          { 1005, 'E', "    Testausgabe: "
+                       "lmax = %d, name = %s \n"  },
+          {    0, 'F', ""  } };
+
+
+
+int read_coefficients (const char *filename,
+	                   int mindegree,
+                       int maxdegree,
+                       double ***c_lm,
+                       double ***s_lm)
+{
+	FILE *fh;
+    int l;
+    int m;
+    int degree;
+    int order;
+    double c;
+    double s;
+
+
+	fh = fopen (filename, "r");
+
+    legendre_dreieck_alloc (maxdegree, c_lm);
+	legendre_dreieck_alloc (maxdegree, s_lm);
+
+	for (l = mindegree; l <= maxdegree; l ++)
+	{
+	    fscanf (fh, "%d %d %lf %lf", &degree, &order, &c, &s);
+
+        if (degree != l || order != 0)
+           printf ("Error: Wrong order of coefficients in input file\n");
+
+	    (*c_lm) [l][0] = c;
+
+		for (m = 1; m <= l; m ++)
+		{
+	        fscanf (fh, "%d %d %lf %lf", &degree, &order, &c, &s);
+
+	        if (degree != l || order != m)
+               printf ("Error: Wrong order of coefficients in input file\n");
+
+       	    (*c_lm) [l][m] = c;
+	        (*s_lm) [l][m] = s;
+	    }
+    }
+
+	fclose (fh);
+
+	return 0;
+}
+
+
+
+
+int leg_pol_berechnen (double t,
+                       int maxdeg,
+                       double *lp)
+{
+   /*******************************************************************/
+   /* Nicht normierte Legendre-Polynome bis zum angegebenen           */
+   /* Entwicklungsgrad maxdeg rechnen                                 */
+   /* t = sin (phi) muss mitgegeben werden                            */
+   /* Der Vektor lp muss im aufrufenden Programm gen�gend gro�        */
+   /* allokiert sein (z.B. durch Funktion dvector_alloc in speiorg.c) */
+   /*******************************************************************/
+
+   short n;
+
+
+   lp [0] = 1.0;
+   lp [1] = t;
+
+   for (n = 2; n <= maxdeg; n ++)
+   {
+      lp [n] = (-lp [n - 2] * (n - 1) +
+                 t * lp [n - 1] * (2 * n - 1)) / n;
+   }
+
+   return 0;
+}
+
+
+
+
+int leg_func_berechnen (double t,
+                        int maxdeg,
+                        double **lf)
+{
+   /*******************************************************************/
+   /* Vollst�ndig normierte Legendre-Funktionen bis zum angegebenen   */
+   /* Entwicklungsgrad maxdeg rechnen                                 */
+   /* t = sin (phi) muss mitgegeben werden                            */
+   /* Die Matrix lf muss im aufrufenden Programm gen�gend gro�        */
+   /* allokiert sein (z.B. durch Funktion legendre_dreieck_alloc      */
+   /* in speiorg.c)                                                   */
+   /*******************************************************************/
+
+   short grad;
+   short ord;
+   double cf;
+   double *wurz;
+   short i;
+   short ip;
+   short im;
+
+   wurz = (double *) malloc ((2 * maxdeg + 4) * sizeof (double));
+
+   for (i = 0; i < 2 * maxdeg + 4; i ++)
+      wurz [i] = sqrt ((double ) (i));
+
+
+   cf = sqrt (1.0 - t * t);
+
+   lf [0][0] = 1.0;
+   lf [1][1] = wurz [3] * cf;
+
+   for (grad = 1; grad < maxdeg; grad ++)
+   {
+      /*****************************************/
+      /* Hauptdiagonalelemente berechnen       */
+      /*****************************************/
+
+      lf [grad + 1][grad + 1] =
+              wurz [2 * grad + 3] / wurz [2 * grad + 2] *
+              cf * lf [grad][grad];
+   }
+
+   for (ord = 0; ord < maxdeg; ord ++)
+   {
+      lf [ord + 1][ord] = wurz [2 * ord + 3] * t * lf [ord][ord];
+
+      for (grad = ord + 1; grad < maxdeg; grad ++)
+      {
+         i = 2 * grad;
+         ip = grad + ord;
+         im = grad - ord;
+
+         lf [grad + 1][ord] =
+               wurz [i + 3] / wurz [ip + 1] / wurz [im + 1] *
+               (wurz [i + 1] * t * lf [grad][ord] -
+                wurz [ip] * wurz [im] / wurz [i - 1] *
+                                                 lf [grad - 1][ord]);
+      }
+   }
+
+   free (wurz);
+
+   return 0;
+}
+
+
+
+
+int leg_func_deriv (double t,
+                    int maxdeg,
+                    double **lf,
+                    double **lf_der)
+{
+   /*******************************************************************/
+   /* Ableitungen der vollst�ndig normierten Legendre-Funktionen nach */
+   /* dem Argument t = sin (phi) bis zum angegebenen Entwicklungsgrad */
+   /* maxdeg rechnen                                                  */
+   /* t = sin (phi) sowie die Matrix lf der Legendre-Funktionen       */
+   /* selbst m�ssen mitgegeben werden                                 */
+   /* Die Matrix lf_der muss im aufrufenden Programm gen�gend gro�    */
+   /* allokiert sein (z.B. durch Funktion legendre_dreieck_alloc      */
+   /* in speiorg.c)                                                   */
+   /*******************************************************************/
+
+   short grad;
+   short ord;
+   double cf;
+   double *wurz;
+   short i;
+   short ip;
+   short im;
+
+   wurz = (double *) malloc ((2 * maxdeg + 4) * sizeof (double));
+
+   for (i = 0; i < 2 * maxdeg + 4; i ++)
+      wurz [i] = sqrt ((double ) (i));
+
+
+   cf = sqrt (1.0 - t * t);
+
+   lf_der [0][0] = 0.0;
+   lf_der [1][1] = -wurz [3] * t;
+
+   for (grad = 1; grad < maxdeg; grad ++)
+   {
+      /*****************************************/
+      /* Hauptdiagonalelemente berechnen       */
+      /*****************************************/
+
+      lf_der [grad + 1][grad + 1] =
+              wurz [2 * grad + 3] / wurz [2 * grad + 2] *
+              (cf * lf_der [grad][grad] - t * lf [grad][grad]);
+   }
+
+   for (ord = 0; ord < maxdeg; ord ++)
+   {
+      lf_der [ord + 1][ord] =
+                       wurz [2 * ord + 3] * (t * lf_der [ord][ord] +
+                                             cf * lf [ord][ord]);
+
+      for (grad = ord + 1; grad < maxdeg; grad ++)
+      {
+         i = 2 * grad;
+         ip = grad + ord;
+         im = grad - ord;
+
+         lf_der [grad + 1][ord] =
+               wurz [i + 3] / wurz [ip + 1] / wurz [im + 1] *
+               (wurz [i + 1] * (t * lf_der [grad][ord] +
+                                cf * lf [grad][ord]) -
+                wurz [ip] * wurz [im] / wurz [i - 1] *
+                                              lf_der [grad - 1][ord]);
+      }
+   }
+
+   free (wurz);
+
+   return 0;
+}
+
+
+
+int kff_synthese_einzelpunkt (double lambda,
+                              char winkelmass,
+                              double **leg_func,
+                              int mindeg,
+                              int maxdeg,
+                              double **c_lm,
+                              double **s_lm,
+                              double *f)
+{
+   /*******************************************************************/
+   /* Harmonische Synthese in einem Einzelpunkt rechnen               */
+   /*                                                                 */
+   /* f = sum_{l=mindeg}^maxdeg  *                                    */
+   /*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+   /*                                       s_lm * sin (m*lambdar))   */
+   /*                                                                 */
+   /*                                                                 */
+   /* Winkelmass = 'A': lambda muss in Altgrad eingegeben werden      */
+   /* Winkelmass = 'R': lambda muss im Bogenma� eingegeben werden     */
+   /*                                                                 */
+   /* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+   /* gesetzt                                                         */
+   /*******************************************************************/
+
+   double fzw;
+   int l;
+   int m;
+
+   *f = 0.;
+
+   mindeg = (mindeg < 0) ? 0 : mindeg;
+
+   if (winkelmass == 'A')
+      lambda *= RHO_REZ;
+
+   for (l = mindeg; l <= maxdeg; l ++)
+   {
+      fzw = leg_func [l][0] * c_lm [l][0];
+
+      for (m = 1; m <= l; m ++)
+      {
+         fzw += (leg_func [l][m] *
+                 (c_lm [l][m] * cos (m * lambda) +
+                  s_lm [l][m] * sin (m * lambda)));
+      }
+
+      *f += fzw;
+   }
+
+   return 0;
+}
+
+
+
+
+
+int kff_synthese_einzelpunkt_s (double lambda,
+                                char winkelmass,
+                                double **leg_func,
+                                int mindeg,
+                                int maxdeg,
+                                double **c_lm,
+                                double **s_lm,
+                                double *f)
+{
+   /*******************************************************************/
+   /* Harmonische Synthese in einem Einzelpunkt rechnen               */
+   /*                                                                 */
+   /* wie kff_synthese_einzelpunkt_S, aber es wird das Ergebnis nicht */
+   /* f�r die Breite phi gew�nscht, mit der die Legendre-Funktionen   */
+   /* berechnet wurden, sondern f�r die Breite -phi                   */
+   /* ("Wert im symmetrisch zur �quatorebene liegenden Punkt")        */
+   /*                                                                 */
+   /* Winkelmass = 'A': lambda muss in Altgrad eingegeben werden      */
+   /* Winkelmass = 'R': lambda muss im Bogenma� eingegeben werden     */
+   /*                                                                 */
+   /* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+   /* gesetzt                                                         */
+   /*******************************************************************/
+
+   double fzw;
+   int l;
+   int m;
+   int sig_alt;
+   int sig_alt_st;
+
+   *f = 0.;
+
+   mindeg = (mindeg < 0) ? 0 : mindeg;
+
+   if (winkelmass == 'A')
+      lambda *= RHO_REZ;
+
+   if (mindeg % 2 == 0)
+      sig_alt_st = -1;
+   else
+      sig_alt_st = 1;
+
+   for (l = mindeg; l <= maxdeg; l ++)
+   {
+      sig_alt_st = -sig_alt_st;
+      sig_alt = sig_alt_st;
+
+      if (sig_alt == -1)
+      {
+         fzw = -leg_func [l][0] * c_lm [l][0];
+      }
+      else
+      {
+         fzw = leg_func [l][0] * c_lm [l][0];
+      }
+
+      for (m = 1; m <= l; m ++)
+      {
+         sig_alt = -sig_alt;
+
+         if (sig_alt == -1)
+         {
+            fzw -= (leg_func [l][m] *
+                    (c_lm [l][m] * cos (m * lambda) +
+                     s_lm [l][m] * sin (m * lambda)));
+         }
+         else
+         {
+            fzw += (leg_func [l][m] *
+                    (c_lm [l][m] * cos (m * lambda) +
+                     s_lm [l][m] * sin (m * lambda)));
+         }
+      }
+
+      *f += fzw;
+   }
+
+   return 0;
+}
+
+
+
+
+
+int kff_synthese_breitenkreis (double lambda_inc,
+                               double lambda_anf,
+                               double lambda_end,
+                               char winkelmass,
+                               double **leg_func,
+                               int mindeg,
+                               int maxdeg,
+                               double **c_lm,
+                               double **s_lm,
+                               double *f)
+{
+   /*******************************************************************/
+   /* Harmonische Synthese auf einem Breitenkreis rechnen             */
+   /*                                                                 */
+   /* f = sum_{l=mindeg}^maxdeg  *                                    */
+   /*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+   /*                                       s_lm * sin (m*lambdar))   */
+   /*                                                                 */
+   /* Winkelmass = 'A': lambda_inc, lambda_anf und lambda_end m�ssen  */
+   /*                   in Altgrad eingegeben werden                  */
+   /* Winkelmass = 'R': lambda_inc, lambda_anf und lambda_end m�ssen  */
+   /*                   im Bogenma� eingegeben werden                 */
+   /*                                                                 */
+   /* Es wird ab lambda_anf bis lambda_end mit lambda_inc als         */
+   /* Inkrement gerechnet.                                            */
+   /* Der Vektor f muss im aufrufenden Modul gen�gend gro� allokiert  */
+   /* sein: Mindestgr��e ist                                          */
+   /*        (lambda_end - lambda_anf) / lambda_inc + 1               */
+   /*                                                                 */
+   /* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+   /* gesetzt                                                         */
+   /*******************************************************************/
+
+   double fzw;
+   double lambda;
+   int l;
+   int m;
+   int i;
+
+
+   mindeg = (mindeg < 0) ? 0 : mindeg;
+
+   if (winkelmass == 'A')
+   {
+      lambda_inc *= RHO_REZ;
+      lambda_anf *= RHO_REZ;
+      lambda_end *= RHO_REZ;
+   }
+
+
+   for (i = 0, lambda = lambda_anf;
+        lambda <= lambda_end;
+        i ++ ,lambda += lambda_inc)
+   {
+      f [i] = 0.;
+
+      for (l = mindeg; l <= maxdeg; l ++)
+      {
+         fzw = leg_func [l][0] * c_lm [l][0];
+
+         for (m = 1; m <= l; m ++)
+         {
+            fzw += (leg_func [l][m] *
+                    (c_lm [l][m] * cos (m * lambda) +
+                     s_lm [l][m] * sin (m * lambda)));
+         }
+
+         f [i] += fzw;
+      }
+   }
+
+   return 0;
+}
+
+
+
+
+
+int kff_synthese_regel_gitter (double winkel_inc,
+                               double phi_anf,
+                               double phi_end,
+                               double lambda_anf,
+                               double lambda_end,
+                               char winkelmass,
+                               int mindeg,
+                               int maxdeg,
+                               double **c_lm,
+                               double **s_lm,
+                               double **f,
+                               char **error_liste)
+{
+   /*******************************************************************/
+   /* Harmonische Synthese auf einem regelm��igen Gitter rechnen      */
+   /*                                                                 */
+   /* f = sum_{l=mindeg}^maxdeg  *                                    */
+   /*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+   /*                                       s_lm * sin (m*lambdar))   */
+   /*                                                                 */
+   /* Winkelmass = 'A':                                               */
+   /* winkel_inc, lambda_anf, lambda_end, phi_anf und phi_end m�ssen  */
+   /* in Altgrad mitgegeben werden                                    */
+   /*                                                                 */
+   /* Winkelmass = 'R':                                               */
+   /* winkel_inc, lambda_anf, lambda_end, phi_anf und phi_end m�ssen  */
+   /* im Bogenma� mitgegeben werden                                   */
+   /*                                                                 */
+   /* Die Matrix f muss im aufrufenden Modul gen�gend gro� allokiert  */
+   /* sein: Mindestgr��e ist                                          */
+   /*       [(phi_end - phi_anf) / winkel_inc + 1] *                  */
+   /*       [(lambda_end - lambda_anf) / winkel_inc + 1]              */
+   /*                                                                 */
+   /* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+   /* gesetzt                                                         */
+   /*******************************************************************/
+
+   double fzw;
+   double lambda;
+   double phi;
+   double sphi;
+   double **lf;
+   int l;
+   int m;
+   int i;
+   int j;
+   int rc;
+   char *funk_name = "kff_synthese_regel_gitter";
+
+
+   mindeg = (mindeg < 0) ? 0 : mindeg;
+
+   if (winkelmass == 'A')
+   {
+      winkel_inc *= RHO_REZ;
+      lambda_anf *= RHO_REZ;
+      lambda_end *= RHO_REZ;
+      phi_anf *= RHO_REZ;
+      phi_end *= RHO_REZ;
+   }
+
+   rc = legendre_dreieck_alloc (maxdeg, &lf);
+   ERRCHECK2_RC(1001,finfo,&maxdeg,NULL)
+
+   for (i = 0, phi = phi_anf;
+        phi <= phi_end;
+        i ++, phi += winkel_inc)
+   {
+      sphi = sin (phi);
+
+      leg_func_berechnen (sphi, maxdeg, lf);
+
+
+      for (j = 0, lambda = lambda_anf;
+           lambda <= lambda_end;
+           j ++, lambda += winkel_inc)
+      {
+         f [i][j] = 0.;
+
+         for (l = mindeg; l <= maxdeg; l ++)
+         {
+            fzw = lf [l][0] * c_lm [l][0];
+
+            for (m = 1; m <= l; m ++)
+            {
+               fzw += (lf [l][m] *
+                       (c_lm [l][m] * cos (m * lambda) +
+                        s_lm [l][m] * sin (m * lambda)));
+            }
+
+            f [i][j] += fzw;
+         }
+      }
+   }
+
+   legendre_dreieck_free (&lf);
+
+   return 0;
+}
+
+
+
+
+
+static int trigfuncs_gitter (double winkel_inc,
+                             double lambda_anf,
+                             double lambda_end,
+	        			     int maxdeg,
+                             double **cosmla,
+                             double **sinmla)
+{
+   /*******************************************************************/
+   /* Trigonometrische Funktionen cos (m lambda), sin (m lambda)      */
+   /* mit Additionstheoremen berechnen                                */
+   /*******************************************************************/
+
+   double lambda;
+   int m;
+   int j;
+   double cosl1;
+   double sinl1;
+
+   char *funk_name = "trigfuncs_gitter";
+
+   for (j = 0, lambda = lambda_anf;
+        lambda <= lambda_end;
+        j ++, lambda += winkel_inc)
+   {
+	   cosmla [j][0] = 1.0;
+	   sinmla [j][0] = 0.0;
+	   cosmla [j][1] = cos (lambda);
+	   sinmla [j][1] = sin (lambda);
+	   cosl1 = cosmla [j][1];
+	   sinl1 = sinmla [j][1];
+
+	   for (m = 2; m <= maxdeg; m ++)
+	   {
+		   cosmla [j][m] = cosmla [j][m-1] * cosl1 - sinmla [j][m-1] * sinl1;
+  		   sinmla [j][m] = sinmla [j][m-1] * cosl1 + cosmla [j][m-1] * sinl1;
+	   }
+   }
+
+   return 0;
+}
+
+
+
+
+
+int kff_synthese_regel_gitter_m (double winkel_inc,
+                                 double phi_anf,
+                                 double phi_end,
+                                 double lambda_anf,
+                                 double lambda_end,
+								 int numlat,
+								 int numlong,
+                                 char winkelmass,
+                                 int mindeg,
+                                 int maxdeg,
+                                 double **c_lm,
+                                 double **s_lm,
+                                 double **f,
+                                 char **error_liste)
+{
+   /**************************************************************************/
+   /* Wie kff_synthese_regel_gitter, aber die cos (m lambda), sin (m lambda) */
+   /* werden vorab gerechnet und gespeichert. Geht schneller und braucht     */
+   /* mehr Speicherplatz.                                                    */
+   /**************************************************************************/
+
+   double fzw;
+   double lambda;
+   double phi;
+   double sphi;
+   double **lf;
+   double **cosmla;
+   double **sinmla;
+   int l;
+   int m;
+   int i;
+   int j;
+   int rc;
+   char *funk_name = "kff_synthese_regel_gitter_m";
+
+
+   mindeg = (mindeg < 0) ? 0 : mindeg;
+
+   if (winkelmass == 'A')
+   {
+      winkel_inc *= RHO_REZ;
+      lambda_anf *= RHO_REZ;
+      lambda_end *= RHO_REZ;
+      phi_anf *= RHO_REZ;
+      phi_end *= RHO_REZ;
+   }
+
+   rc = legendre_dreieck_alloc (maxdeg, &lf);
+   ERRCHECK2_RC(1001,finfo,&maxdeg,NULL)
+
+   cosmla = (double **) matrix_all_alloc (numlong, maxdeg + 1, 'D', 0);
+   sinmla = (double **) matrix_all_alloc (numlong, maxdeg + 1, 'D', 0);
+
+   trigfuncs_gitter (winkel_inc,
+                     lambda_anf,
+                     lambda_end,
+	        		 maxdeg,
+                     cosmla,
+                     sinmla);
+
+
+   for (i = 0, phi = phi_anf;
+        phi <= phi_end;
+        i ++, phi += winkel_inc)
+   {
+      sphi = sin (phi);
+
+      leg_func_berechnen (sphi, maxdeg, lf);
+
+
+      for (j = 0, lambda = lambda_anf;
+           lambda <= lambda_end;
+           j ++, lambda += winkel_inc)
+      {
+         f [i][j] = 0.;
+
+         for (l = mindeg; l <= maxdeg; l ++)
+         {
+            fzw = lf [l][0] * c_lm [l][0];
+
+            for (m = 1; m <= l; m ++)
+            {
+               fzw += (lf [l][m] *
+                       (c_lm [l][m] * cosmla [j][m] +
+                        s_lm [l][m] * sinmla [j][m]));
+            }
+
+            f [i][j] += fzw;
+         }
+      }
+   }
+
+   legendre_dreieck_free (&lf);
+   matrix_all_free ((void **) cosmla);
+   matrix_all_free ((void **) sinmla);
+
+   return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+int kff_synthese_bk_ng (int anz_mer,
+                        double **leg_func,
+                        double *cos_la,
+                        double *sin_la,
+                        int mindeg,
+                        int maxdeg,
+                        char spiegel,
+                        double **c_lm,
+                        double **s_lm,
+                        double *f)
+{
+   /*******************************************************************/
+   /* Harmonische Synthese auf einem Breitenkreis rechnen             */
+   /*                                                                 */
+   /* Im Gegensatz zu kff_synthese_breitenkreis wird hier voraus-     */
+   /* gesetzt, dass die L�nge lambda aller Gitterpunkte jeweils ein   */
+   /* ganzzahliges Vielfaches des Inkrementes lambda_inc              */
+   /* 2 * pi / anz_mer und dass lambda = 360 Grad ein ganzzahliges    */
+   /* Vielfaches von lambda_inc ist.                                  */
+   /* Damit vereinfacht sich die Berechnung.                          */
+   /*                                                                 */
+   /* f = sum_{l=mindeg}^maxdeg  *                                    */
+   /*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+   /*                                       s_lm * sin (m*lambdar))   */
+   /*                                                                 */
+   /* Es wird von 0 <= lambda < 360 Grad gerechnet                    */
+   /* Der Vektor f muss im aufrufenden Modul gen�gend gro� allokiert  */
+   /* sein: Mindestgr��e ist anz_mer                                  */
+   /*                                                                 */
+   /* Die Vektoren cos_la und sin_la m�ssen bereits die               */
+   /* Werte                                                           */
+   /*          cos_la [k] = cos (k * lambda_inc)                      */
+   /*          sin_la [k] = sin (k * lambda_inc)                      */
+   /*                                                                 */
+   /* f�r 0 <= k < anz_mer enthalten.                                 */
+   /*                                                                 */
+   /* mindeg muss >= 0 sein.                                          */
+   /*                                                                 */
+   /* Ist spiegel = 'S', so wird das Ergebnis nicht f�r die Breite    */
+   /* phi berechnet, mit der die Legendre-Funktionen                  */
+   /* berechnet wurden, sondern f�r die Breite -phi                   */
+   /* ("Wert im symmetrisch zur �quatorebene liegenden Punkt")        */
+   /*                                                                 */
+   /*******************************************************************/
+
+   int l;
+   int m;
+   int k;
+   int tri_ind;
+   int sig_alt;
+   int sig_alt_st;
+
+   double cfac;
+   double sfac;
+
+
+   for (k = 0; k < anz_mer; k ++)
+      f [k] = 0.0;
+
+
+   if (spiegel == 'S')
+   {
+      if (mindeg % 2 == 0)
+         sig_alt_st = -1;
+      else
+         sig_alt_st = 1;
+
+
+      for (l = mindeg; l <= maxdeg; l ++)
+      {
+         sig_alt_st = -sig_alt_st;
+         sig_alt = sig_alt_st;
+
+         for (m = 0; m <= l; m ++)
+         {
+            if (sig_alt > 0)
+            {
+               cfac = leg_func [l][m] * c_lm [l][m];
+               sfac = leg_func [l][m] * s_lm [l][m];
+            }
+            else
+            {
+               cfac = -leg_func [l][m] * c_lm [l][m];
+               sfac = -leg_func [l][m] * s_lm [l][m];
+            }
+
+            for (k = 0, tri_ind = 0; k < anz_mer; k ++)
+            {
+               f [k] += (cfac * cos_la [tri_ind] +
+                         sfac * sin_la [tri_ind]);
+
+               tri_ind += m;
+               tri_ind %= anz_mer;
+            }
+
+            sig_alt = -sig_alt;
+         }
+      }
+   }
+   else
+   {
+      for (l = mindeg; l <= maxdeg; l ++)
+      {
+         for (m = 0; m <= l; m ++)
+         {
+            cfac = leg_func [l][m] * c_lm [l][m];
+            sfac = leg_func [l][m] * s_lm [l][m];
+
+            for (k = 0, tri_ind = 0; k < anz_mer; k ++)
+            {
+               f [k] += (cfac * cos_la [tri_ind] +
+                         sfac * sin_la [tri_ind]);
+
+               tri_ind += m;
+               tri_ind %= anz_mer;
+            }
+         }
+      }
+   }
+
+   return 0;
+}
+
+
+
+
+
+int harm_ana_gauss (FILE *inpfile,
+                    FILE *outfile,
+                    int lmax,
+                    daten_funktion dat_funk,
+                    void *arg1,
+                    void *arg2,
+                    void *arg3,
+                    void *arg4,
+                    void *arg5,
+                    void *arg6,
+                    char **error_liste)
+{
+   /**************************************************************/
+   /* Programm zur harmonischen Analyse mit Hilfe einer          */
+   /* Gauss-Quadratur. Die Nullstellen des Legendre-Polynoms     */
+   /* vom Grad lmax (Entwicklungsgrad) sowie die Gewichte werden */
+   /* vom Eingabefile inpfile gelesen. lmax muss gerade sein!!   */
+   /**************************************************************/
+
+   int rc;
+   int l;
+   int m;
+   int j;
+   int k;
+   int dummy;
+   int anz_m;
+   int tri_ind;
+   int sig_alt;
+   int sig_alt_st;
+
+   double **lf;
+   double **clm;
+   double **slm;
+   double alpha;
+   double t_nullst;
+   double lambda;
+   double la_inc;
+   double *f_nord;
+   double *f_sued;
+   double *cos_la;
+   double *sin_la;
+   double *c_sum_nord;
+   double *s_sum_nord;
+   double *c_sum_sued;
+   double *s_sum_sued;
+
+   char zeile [82];
+   char *cp;
+   char *cp5;
+   char *funk_name = "harm_ana_gauss";
+
+
+   cp5 = funk_name;
+
+   anz_m = 2 * lmax;
+   la_inc = M_PI / lmax;
+
+
+   /***************************/
+   /* Speicher allokieren     */
+   /***************************/
+
+   cos_la = (double *) malloc ((size_t) (anz_m) * sizeof (double));
+   sin_la = (double *) malloc ((size_t) (anz_m) * sizeof (double));
+
+   f_nord = (double *) malloc ((size_t) (anz_m) * sizeof (double));
+   f_sued = (double *) malloc ((size_t) (anz_m) * sizeof (double));
+
+   c_sum_nord = (double *) malloc ((size_t) (lmax + 1) *
+                                            sizeof (double));
+   s_sum_nord = (double *) malloc ((size_t) (lmax + 1) *
+                                            sizeof (double));
+   c_sum_sued = (double *) malloc ((size_t) (lmax + 1) *
+                                            sizeof (double));
+   s_sum_sued = (double *) malloc ((size_t) (lmax + 1) *
+                                            sizeof (double));
+
+   rc = legendre_dreieck_alloc (lmax, &lf);
+   ERRCHECK2_RC(1001,finfo,&lmax,NULL)
+
+   rc = legendre_dreieck_alloc (lmax, &clm);
+   ERRCHECK2_RC(1001,finfo,&lmax,NULL)
+
+   rc = legendre_dreieck_alloc (lmax, &slm);
+   ERRCHECK2_RC(1001,finfo,&lmax,NULL)
+
+
+   /******************************************************/
+   /* Berechnung von cos lambda, sin lambda auf den      */
+   /* Gittermeridianen                                   */
+   /******************************************************/
+
+   for (k = 0, lambda = 0.0; k < anz_m; k ++, lambda += la_inc)
+   {
+      cos_la [k] = cos (lambda);
+      sin_la [k] = sin (lambda);
+   }
+
+
+   /******************************************************/
+   /* Schleife �ber die Breitenkreise                    */
+   /******************************************************/
+
+
+   for (j = 1; j <= lmax / 2; j ++)
+   {
+      /****************************************/
+      /* Nullstelle und Gewicht einlesen      */
+      /****************************************/
+
+      cp = fgets (zeile, 80, inpfile);
+      ERRCHECK2_NULL(cp,1002,finfo,&j,NULL)
+
+#if 0
+      if (j == 2)
+      {
+         rc = 5;
+         ERRCHECK2_RC_R(1005,finfo,&lmax,cp5)
+      }
+
+
+      if ((cp = fgets (zeile, 80, inpfile)) == NULL)
+      {
+         printf ("Fehler beim Einlesen der Nullstellen\n");
+         exit (20);
+      }
+#endif
+
+      sscanf (zeile, "%d %lf %lf", &dummy, &t_nullst, &alpha);
+
+#if 0
+      dummy = 7;
+
+      printf ("Achtung, j = %d", j);
+#endif
+
+      if (dummy != j)
+      {
+#if 0
+         fehler2 (__LINE__,1003,__FILE__,funk_name,stdout,finfo,
+                  dummy, j, NULL, NULL, NULL, NULL, NULL);
+#endif
+         error_message (__LINE__,1003,__FILE__,funk_name,error_liste,
+                        finfo, &dummy, &j, NULL, NULL, NULL, NULL, NULL);
+      }
+
+
+      /****************************************/
+      /* Legendre-Funktionen berechnen        */
+      /****************************************/
+
+      rc =  leg_func_berechnen (t_nullst, lmax, lf);
+
+
+      for (m = 0; m <= lmax; m ++)
+      {
+         c_sum_nord [m] = 0.0;
+         s_sum_nord [m] = 0.0;
+         c_sum_sued [m] = 0.0;
+         s_sum_sued [m] = 0.0;
+      }
+
+
+      /****************************************/
+      /* Funktionswerte berechnen (auf Nord-  */
+      /* und S�dhalbkugel)                    */
+      /****************************************/
+
+      rc = (*dat_funk) (anz_m,
+                        t_nullst,
+                        lf,
+                        'N',
+                        f_nord,
+                        arg1,
+                        arg2,
+                        arg3,
+                        arg4,
+                        arg5,
+                        arg6);
+
+      ERRCHECK2_RC_R(1004,finfo,NULL,NULL)
+
+      rc = (*dat_funk) (anz_m,
+                        -t_nullst,
+                        lf,
+                        'S',
+                        f_sued,
+                        arg1,
+                        arg2,
+                        arg3,
+                        arg4,
+                        arg5,
+                        arg6);
+
+      ERRCHECK2_RC_R(1004,finfo,NULL,NULL)
+
+      /***************************************************/
+      /* Schleife �ber die Meridiane                     */
+      /***************************************************/
+
+      for (k = 0; k < anz_m; k ++)
+      {
+         /****************************************/
+         /* Schleife �ber die Ordnung der        */
+         /* Kff-Koeffiezienten                   */
+         /****************************************/
+
+         c_sum_nord [0] += f_nord [k];
+         c_sum_sued [0] += f_sued [k];
+
+
+         for (m = 1, tri_ind = 0; m <= lmax; m ++)
+         {
+            /***************************************************/
+            /* Aufsummieren:                                   */
+            /*                                                 */
+            /*     anz_m - 1                     cos m*lambda  */
+            /* Summe          f (lambda, phi) *                */
+            /*     k=0                           sin m*lambda  */
+            /*                                                 */
+            /***************************************************/
+
+            tri_ind += k;
+            tri_ind %= anz_m;
+
+            c_sum_nord [m] += (cos_la [tri_ind] * f_nord [k]);
+            s_sum_nord [m] += (sin_la [tri_ind] * f_nord [k]);
+            c_sum_sued [m] += (cos_la [tri_ind] * f_sued [k]);
+            s_sum_sued [m] += (sin_la [tri_ind] * f_sued [k]);
+         }
+      }
+
+
+      /*****************************************/
+      /* Schleife �ber den Grad der            */
+      /* Kff-Koeffiezienten                    */
+      /*****************************************/
+
+      sig_alt_st = -1;
+
+      for (l = 0; l <= lmax; l ++)
+      {
+         sig_alt_st = -sig_alt_st;
+         sig_alt = sig_alt_st;
+
+         clm [l][0] += (lf [l][0] * alpha *
+                          (c_sum_nord [0] + sig_alt * c_sum_sued [0]));
+
+
+         for (m = 1; m <= l; m ++)
+         {
+            /***********************************/
+            /* Gewicht auf Legendre-Funktionen */
+            /* draufmultiplizieren             */
+            /***********************************/
+
+            sig_alt = -sig_alt;
+
+            clm [l][m] += (lf [l][m] * alpha *
+                           (c_sum_nord [m] + sig_alt * c_sum_sued [m]));
+            slm [l][m] += (lf [l][m] * alpha *
+                           (s_sum_nord [m] + sig_alt * s_sum_sued [m]));
+         }
+      }
+   }
+
+
+   for (l = 0; l <= lmax; l ++)
+   {
+      clm [l][0] /= (2. * (double) (anz_m));
+
+      for (m = 1; m <= l; m ++)
+      {
+         clm [l][m] /= (2. * (double) (anz_m));
+         slm [l][m] /= (2. * (double) (anz_m));
+      }
+   }
+
+
+   /*************************************************/
+   /* Berechnete KFF-Koeffizienten ausgeben         */
+   /*************************************************/
+
+   for (l = 0; l <= lmax; l ++)
+   {
+      for (m = 0; m <= l; m ++)
+      {
+         fprintf (outfile, "%3d%3d%19.12e%19.12e\n",
+                           l, m, clm [l][m], slm [l][m]);
+      }
+   }
+
+
+   free (c_sum_nord);
+   free (s_sum_nord);
+   free (c_sum_sued);
+   free (s_sum_sued);
+
+   free (cos_la);
+   free (sin_la);
+
+   legendre_dreieck_free (&clm);
+   legendre_dreieck_free (&slm);
+   legendre_dreieck_free (&lf);
+
+   return 0;
+}
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h
new file mode 100644
index 0000000..8d8a91f
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h
@@ -0,0 +1,355 @@
+/**********************************************************
+ * Version $Id: spezfunc.h 1937 2014-01-11 18:22:42Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//              Grid_Filter / Grid_Calculus              //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      spezfunc.h                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef SPEZ
+#define SPEZ
+
+
+
+typedef int (* daten_funktion) (int anz_mer,
+                                double t_sin_phi,
+                                double **lf,
+                                char spiegel,
+                                double *ergebnis,
+                                void *arg1,
+                                void *arg2,
+                                void *arg3,
+                                void *arg4,
+                                void *arg5,
+                                void *arg6);
+
+
+
+
+/**********************************************************/
+/* Prototypen der externen Funktionen in spezfunc.c       */
+/**********************************************************/
+
+int read_coefficients (const char *filename,
+	                   int mindegree,
+                       int maxdegree,
+                       double ***c_lm,
+                       double ***s_lm);
+
+
+
+/*******************************************************************/
+/* Nicht normierte Legendre-Polynome bis zum angegebenen           */
+/* Entwicklungsgrad maxdeg rechnen                                 */
+/* t = sin (phi) muss mitgegeben werden                            */
+/* Der Vektor lp muss im aufrufenden Programm gen�gend gro�        */
+/* allokiert sein (z.B. durch Funktion dvector_alloc in speiorg.c) */
+/*******************************************************************/
+
+int leg_pol_berechnen (double t,
+                       int maxdeg,
+                       double *lp);
+
+
+/*******************************************************************/
+/* Vollst�ndig normierte Legendre-Funktionen bis zum angegebenen   */
+/* Entwicklungsgrad maxdeg rechnen                                 */
+/* t = sin (phi) muss mitgegeben werden                            */
+/* Die Matrix lf muss im aufrufenden Programm gen�gend gro�        */
+/* allokiert sein (z.B. durch Funktion legendre_dreieck_alloc      */
+/* in speiorg.c)                                                   */
+/*******************************************************************/
+
+int leg_func_berechnen (double t,
+                        int maxdeg,
+                        double **lf);
+
+
+/*******************************************************************/
+/* Ableitungen der vollst�ndig normierten Legendre-Funktionen nach */
+/* dem Argument t = sin (phi) bis zum angegebenen Entwicklungsgrad */
+/* maxdeg rechnen                                                  */
+/* t = sin (phi) sowie die Matrix lf der Legendre-Funktionen       */
+/* selbst m�ssen mitgegeben werden                                 */
+/* Die Matrix lf_der muss im aufrufenden Programm gen�gend gro�    */
+/* allokiert sein (z.B. durch Funktion legendre_dreieck_alloc      */
+/* in speiorg.c)                                                   */
+/*******************************************************************/
+
+int leg_func_deriv (double t,
+                    int maxdeg,
+                    double **lf,
+                    double **lf_der);
+
+
+
+
+/*******************************************************************/
+/* Harmonische Synthese in einem Einzelpunkt rechnen               */
+/*                                                                 */
+/* f = sum_{l=mindeg}^maxdeg  *                                    */
+/*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+/*                                       s_lm * sin (m*lambdar))   */
+/*                                                                 */
+/*                                                                 */
+/* Winkelmass = 'A': lambda muss in Altgrad eingegeben werden      */
+/* Winkelmass = 'R': lambda muss im Bogenma� eingegeben werden     */
+/*                                                                 */
+/* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+/* gesetzt                                                         */
+/*******************************************************************/
+
+int kff_synthese_einzelpunkt (double lambda,
+                              char winkelmass,
+                              double **leg_func,
+                              int mindeg,
+                              int maxdeg,
+                              double **c_lm,
+                              double **s_lm,
+                              double *f);
+
+
+
+
+/*******************************************************************/
+/* Harmonische Synthese in einem Einzelpunkt rechnen               */
+/*                                                                 */
+/* wie kff_synthese_einzelpunkt_S, aber es wird das Ergebnis nicht */
+/* f�r die Breite phi gew�nscht, mit der die Legendre-Funktionen   */
+/* berechnet wurden, sondern f�r die Breite -phi                   */
+/* ("Wert im symmetrisch zur �quatorebene liegenden Punkt")        */
+/*                                                                 */
+/* Winkelmass = 'A': lambda muss in Altgrad eingegeben werden      */
+/* Winkelmass = 'R': lambda muss im Bogenma� eingegeben werden     */
+/*                                                                 */
+/* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+/* gesetzt                                                         */
+/*******************************************************************/
+
+int kff_synthese_einzelpunkt_s (double lambda,
+                                char winkelmass,
+                                double **leg_func,
+                                int mindeg,
+                                int maxdeg,
+                                double **c_lm,
+                                double **s_lm,
+                                double *f);
+
+
+
+
+
+
+
+/*******************************************************************/
+/* Harmonische Synthese auf einem Breitenkreis rechnen             */
+/*                                                                 */
+/* f = sum_{l=mindeg}^maxdeg  *                                    */
+/*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+/*                                       s_lm * sin (m*lambdar))   */
+/*                                                                 */
+/* Winkelmass = 'A': lambda_inc, lambda_anf und lambda_end m�ssen  */
+/*                   in Altgrad eingegeben werden                  */
+/* Winkelmass = 'R': lambda_inc, lambda_anf und lambda_end m�ssen  */
+/*                   im Bogenma� eingegeben werden                 */
+/*                                                                 */
+/* Es wird ab lambda_anf bis lambda_end mit lambda_inc als         */
+/* Inkrement gerechnet.                                            */
+/* Der Vektor f muss im aufrufenden Modul gen�gend gro� allokiert  */
+/* sein: Mindestgr��e ist                                          */
+/*        (lambda_end - lambda_anf) / lambda_inc + 1               */
+/*                                                                 */
+/* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+/* gesetzt                                                         */
+/*******************************************************************/
+
+int kff_synthese_breitenkreis (double lambda_inc,
+                               double lambda_anf,
+                               double lambda_end,
+                               char winkelmass,
+                               double **leg_func,
+                               int mindeg,
+                               int maxdeg,
+                               double **c_lm,
+                               double **s_lm,
+                               double *f);
+
+
+
+
+/*******************************************************************/
+/* Harmonische Synthese auf einem Breitenkreis rechnen             */
+/*                                                                 */
+/* Im Gegensatz zu kff_synthese_breitenkreis wird hier voraus-     */
+/* gesetzt, dass die L�nge lambda aller Gitterpunkte jeweils ein   */
+/* ganzzahliges Vielfaches des Inkrementes lambda_inc              */
+/* 2 * pi / anz_mer und dass lambda = 360 Grad ein ganzzahliges    */
+/* Vielfaches von lambda_inc ist.                                  */
+/* Damit vereinfacht sich die Berechnung.                          */
+/*                                                                 */
+/* f = sum_{l=mindeg}^maxdeg  *                                    */
+/*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+/*                                       s_lm * sin (m*lambdar))   */
+/*                                                                 */
+/* Es wird von 0 <= lambda < 360 Grad gerechnet                    */
+/* Der Vektor f muss im aufrufenden Modul gen�gend gro� allokiert  */
+/* sein: Mindestgr��e ist anz_mer                                  */
+/*                                                                 */
+/* Die Vektoren cos_la und sin_la m�ssen bereits die               */
+/* Werte                                                           */
+/*          cos_la [k] = cos (k * lambda_inc)                      */
+/*          sin_la [k] = sin (k * lambda_inc)                      */
+/*                                                                 */
+/* f�r 0 <= k < anz_mer enthalten.                                 */
+/*                                                                 */
+/* mindeg muss >= 0 sein.                                          */
+/*                                                                 */
+/* Ist spiegel = 'S', so wird das Ergebnis nicht f�r die Breite    */
+/* phi berechnet, mit der die Legendre-Funktionen                  */
+/* berechnet wurden, sondern f�r die Breite -phi                   */
+/* ("Wert im symmetrisch zur �quatorebene liegenden Punkt")        */
+/*                                                                 */
+/*******************************************************************/
+
+int kff_synthese_bk_ng (int anz_mer,
+                        double **leg_func,
+                        double *cos_la,
+                        double *sin_la,
+                        int mindeg,
+                        int maxdeg,
+                        char spiegel,
+                        double **c_lm,
+                        double **s_lm,
+                        double *f);
+
+
+
+
+/*******************************************************************/
+/* Harmonische Synthese auf einem regelm��igen Gitter rechnen      */
+/*                                                                 */
+/* f = sum_{l=mindeg}^maxdeg  *                                    */
+/*           sum_{m=0}^l leg_func_{l,m} (c_lm * cos (m*lambdar) +  */
+/*                                       s_lm * sin (m*lambdar))   */
+/*                                                                 */
+/* Winkelmass = 'A':                                               */
+/* winkel_inc, lambda_anf, lambda_end, phi_anf und phi_end m�ssen  */
+/* in Altgrad mitgegeben werden                                    */
+/*                                                                 */
+/* Winkelmass = 'R':                                               */
+/* winkel_inc, lambda_anf, lambda_end, phi_anf und phi_end m�ssen  */
+/* im Bogenma� mitgegeben werden                                   */
+/*                                                                 */
+/* Die Matrix f muss im aufrufenden Modul gen�gend gro� allokiert  */
+/* sein: Mindestgr��e ist                                          */
+/*       [(phi_end - phi_anf) / winkel_inc + 1] *                  */
+/*       [(lambda_end - lambda_anf) / winkel_inc + 1]              */
+/*                                                                 */
+/* mindeg muss >= 0 sein, andernfalls wird es gewaltsam auf 0      */
+/* gesetzt                                                         */
+/*******************************************************************/
+
+int kff_synthese_regel_gitter (double winkel_inc,
+                               double phi_anf,
+                               double phi_end,
+                               double lambda_anf,
+                               double lambda_end,
+                               char winkelmass,
+                               int mindeg,
+                               int maxdeg,
+                               double **c_lm,
+                               double **s_lm,
+                               double **f,
+                               char **error_liste);
+
+int kff_synthese_regel_gitter_m (double winkel_inc,
+                                 double phi_anf,
+                                 double phi_end,
+                                 double lambda_anf,
+                                 double lambda_end,
+								 int numlat,
+								 int numlong,
+                                 char winkelmass,
+                                 int mindeg,
+                                 int maxdeg,
+                                 double **c_lm,
+                                 double **s_lm,
+                                 double **f,
+                                 char **error_liste);
+
+
+/**************************************************************/
+/* Programm zur harmonischen Analyse mit Hilfe einer          */
+/* Gauss-Quadratur. Die Nullstellen des Legendre-Polynoms     */
+/* vom Grad lmax (Entwicklungsgrad) sowie die Gewichte werden */
+/* vom Eingabefile inpfile gelesen. lmax muss gerade sein !!  */
+/**************************************************************/
+
+int harm_ana_gauss (FILE *inpfile,
+                    FILE *outfile,
+                    int lmax,
+                    daten_funktion dat_funk,
+                    void *arg1,
+                    void *arg2,
+                    void *arg3,
+                    void *arg4,
+                    void *arg5,
+                    void *arg6,
+                    char **error_liste);
+
+#endif
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c
new file mode 100644
index 0000000..3f1cd2c
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c
@@ -0,0 +1,2135 @@
+/**********************************************************
+ * Version $Id: storeorg.c 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      storeorg.c                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "storeorg.h"
+
+
+#define SPMESSAGE  nixtrace
+
+static int nixtrace (char *cp, ...)
+{
+   return 0;
+}
+
+
+
+static void *mem_anker [ANZ_MEMPOOL] = { NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL,
+                                         NULL };
+
+
+/*********************************************************************/
+/* Die folgenden beiden defines muessen immer aufeinander abgestimmt */
+/* werden !                                                          */
+/*********************************************************************/
+
+#define CAPS_MALLOC  check_malloc
+#define CAPS_FREE    check_free
+
+
+
+
+
+static void *check_malloc (long ext_size)
+{
+   /******************************************************************/
+   /* Diese Funktion ist nur fuer Aufrufe innerhalb von chain_malloc */
+   /* oder chain_realloc gedacht.                                    */
+   /*                                                                */
+   /* Belegung:                                                      */
+   /*                                                                */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*       4 Byte voriger Speicherbereich           |               */
+   /*       4 Byte naechster Speicherbereich         |  ext_size =   */
+   /*       4 Byte Groesse                           |  size + 12    */
+   /*    size Byte Datenblock                        |               */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*  -----------------------------------------------------         */
+   /* size+36 Byte insgesamt                                         */
+   /******************************************************************/
+
+   char *p;
+
+
+   SPMESSAGE ("Start check_malloc\n");
+   SPMESSAGE ("size %ld\n", ext_size);
+
+   p = malloc (ext_size + 24);
+
+   if (p == NULL)
+   {
+      printf ("schrecklicher Fehler bei check_malloc:\n");
+      printf ("Allokation gescheitert:\n");
+      return NULL;
+   }
+
+   memset (p, 0x00, ext_size + 24);
+
+   memcpy (p, "<0123456789>", 12);
+   memcpy (p + 12 + ext_size, "<0123456789>", 12);
+   p += 12;
+
+   SPMESSAGE ("p  %p\n", p);
+   SPMESSAGE ("Ende check_malloc\n");
+
+   return p;
+}
+
+
+
+
+
+static void check_free (void *palt)
+
+{
+   char *p;
+   long size_lfd;
+
+   SPMESSAGE ("Start check_free\n");
+   SPMESSAGE ("palt   %p \n", palt);
+
+   if (palt == NULL)
+   {
+      printf ("schrecklicher Fehler in check_free\n");
+      printf ("NULL-pointer erhalten\n");
+      return;
+   }
+
+   p = palt;
+   p -= 12;
+
+
+   SPMESSAGE ("Pruefung der Integritaet\n");
+
+   if (memcmp (p, "<0123456789>", 12) != 0)
+   {
+      printf ("check_free - schrecklicher Speicherfehler\n");
+      printf ("Bereich vor Datenblock zerstoert\n");
+      exit (20);
+   }
+
+   size_lfd = *((long *)(p + 20));
+
+   if (memcmp (p + 24 + size_lfd, "<0123456789>", 12) != 0)
+   {
+      printf ("check_free - schrecklicher Speicherfehler\n");
+      printf ("Bereich nach Datenblock zerstoert\n");
+      exit (20);
+   }
+
+   free ((void *) p);
+
+   SPMESSAGE ("Ende check_free\n");
+
+   return;
+}
+
+
+
+
+
+
+void *chain_malloc (long size, short mempool)
+{
+   /*******************************************************************/
+   /* Belegung:                                                       */
+   /*                                                                 */
+   /*       4 Byte voriger Speicherbereich                            */
+   /*       4 Byte naechster Speicherbereich                          */
+   /*       4 Byte Groesse                                            */
+   /*    size Byte Datenblock                                         */
+   /*  -----------------------------------------------------          */
+   /* size+12 Byte insgesamt                                          */
+   /*                                                                 */
+   /* Der mem_anker ist jeweils das NEUESTE Element!                  */
+   /*                                                                 */
+   /* Ist allerdings CAPS_MALLOC als check_malloc definiert, also     */
+   /* #define CAPS_MALLOC  check_malloc  ,                            */
+   /* so wird zusaetzlich ein Prueffeld (Magic) vorne und hinten      */
+   /* angehaengt, es gilt dann folgende Konvention fuer die Belegung  */
+   /* des allokierten Arrays:                                         */
+   /*                                                                 */
+   /* [<0123456789> | prev | next | size |   DATEN    | <0123456789>] */
+   /* [  12 Bytes   | 4 B  | 4 B  | 4 B  |  size      |   12 Bytes  ] */
+   /*                ^                    ^                           */
+   /*                |                    |                           */
+   /*                |                    |                           */
+   /* (hierher zeigt der Zeiger, den      |                           */
+   /*  man von CAPS_MALLOC zurueck-       |                           */
+   /*  bekommt, und DIESE Adresse         |                           */
+   /*  steht in mem_anker, falls der      |                           */
+   /*  Speicherbereich das neueste        |                           */
+   /*  Element ist)                       |                           */
+   /*                                     |                           */
+   /*                             (hierher zeigt der Zeiger, den      */
+   /*                              chain_malloc zurueckgibt)          */
+   /*                                                                 */
+   /*******************************************************************/
+
+   char *p;
+   char *ph;
+
+   SPMESSAGE ("Start chain_malloc\n");
+   SPMESSAGE ("size %ld\n", size);
+
+   if (mempool < 0 || mempool >= ANZ_MEMPOOL)
+      return NULL;
+
+   p = CAPS_MALLOC (size + 12);
+
+   if (p == NULL)
+   {
+      printf ("schrecklicher Fehler bei CAPS_MALLOC:\n");
+      printf ("Allokation gescheitert:\n");
+      return NULL;
+   }
+
+   memset (p, 0x00, size + 12);
+
+   /*******************************************************************/
+   /* In die ersten vier Bytes von p kommt die Speicheradresse des    */
+   /* derzeitigen mem_ankers rein. Danach kommt umgekehrt in die      */
+   /* Bytes 5 - 8 des mem_ankers, falls ungleich NULL, die Adresse    */
+   /* von p rein.                                                     */
+   /*******************************************************************/
+
+   * ((void **) p) = mem_anker [mempool];
+
+   if (mem_anker [mempool] != NULL)
+   {
+      ph = mem_anker [mempool];
+      ph += 4;
+      *((void **) ph) = p;
+   }
+
+   mem_anker [mempool] = p;
+
+   *((long *)(p + 8)) = size;
+   p += 12;
+
+
+   SPMESSAGE ("p  %p\n", p);
+   SPMESSAGE ("Ende chain_malloc\n");
+
+   return p;
+}
+
+
+
+
+
+void chain_free (void *palt)
+
+{
+   char *p;
+   char *p_prev;
+   char *p_next;
+   short i;
+   short gefunden;
+
+   SPMESSAGE ("Start chain_free\n");
+   SPMESSAGE ("palt   %p \n", palt);
+
+   if (palt == NULL)
+   {
+      printf ("schrecklicher Fehler in chain_free\n");
+      printf ("NULL-pointer erhalten\n");
+      return;
+   }
+
+
+   p = palt;
+   p -= 12;
+
+   /*******************************/
+   /* Bereiche neu verpointern    */
+   /*******************************/
+
+   p_prev = *((void **) p);
+   p_next = *((void **) (p + 4));
+
+   if (p_prev != NULL)
+      *((void **) (p_prev + 4)) = p_next;
+
+   if (p_next != NULL)
+      *((void **) (p_next)) = p_prev;
+   else
+   {
+      gefunden = 0;
+	  //#pragma omp parallel for
+      for (i = 0; i < ANZ_MEMPOOL; i ++)
+      {
+         if ((void *) p == mem_anker [i])
+         {
+            gefunden = 1;
+            break;
+         }
+      }
+
+      if (gefunden > 0)
+         mem_anker [i] = p_prev;
+      else
+      {
+         printf ("schrecklicher Fehler: chain-Element ohne Anker\n");
+         return;
+      }
+   }
+
+   CAPS_FREE ((void *) p);
+
+   SPMESSAGE ("Ende chain_free\n");
+
+   return;
+}
+
+
+
+
+
+void *chain_realloc (void *palt,
+                     long newsize,
+                     short mempool)
+
+{
+   /*******************************************************************/
+   /* Hier koennte man das Element auch unter der Hand in einen       */
+   /* anderen mempool verschieben.                                    */
+   /*******************************************************************/#
+
+   void *p;
+   long oldsize;
+   char *ph;
+
+   SPMESSAGE ("Start chain_realloc");
+
+   p = chain_malloc (newsize, mempool);
+
+   if (p != NULL)
+   {
+      if (palt != NULL)
+      {
+         ph = palt;
+         oldsize = *((long *)(ph - 4));
+
+         if (oldsize != 0)
+            memcpy (p, palt, oldsize);
+
+         chain_free (palt);
+      }
+   }
+   else
+      printf ("schrecklicher Fehler: chain_realloc gescheitert!\n");
+
+   SPMESSAGE ("Ende chain_realloc");
+
+   return p;
+}
+
+
+
+
+
+void chain_integrity (short mempool)
+{
+   /******************************************************************/
+   /* Belegung:                                                      */
+   /*                                                                */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*       4 Byte voriger Speicherbereich                           */
+   /*       4 Byte naechster Speicherbereich                         */
+   /*       4 Byte Groesse                                           */
+   /*    size Byte Datenblock                                        */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*  -----------------------------------------------------         */
+   /* size+36 Byte insgesamt                                         */
+   /******************************************************************/
+
+   char *p2;
+   long size_lfd;
+
+   SPMESSAGE ("Pruefung der Integritaet, mempool %hd\n", mempool);
+   //#pragma omp parallel for
+   for (p2 = mem_anker [mempool]; p2 != NULL; p2 = * ((void **) p2))
+   {
+      if (memcmp (p2 - 12, "<0123456789>", 12) != 0)
+      {
+         printf ("chain_integrity - "
+                 "schrecklicher Speicherfehler\n");
+         printf ("Bereich vor Datenblock zerstoert\n");
+         exit (20);
+      }
+
+      size_lfd = *((long *)(p2 + 8));
+
+      if (memcmp (p2 + 12 + size_lfd, "<0123456789>", 12) != 0)
+      {
+         printf ("chain_integrity - "
+                 "schrecklicher Speicherfehler\n");
+         printf ("Bereich nach Datenblock zerstoert\n");
+         exit (20);
+      }
+   }
+
+   printf ("Integritaet mempool %hd ok\n", mempool);
+
+   return;
+}
+
+
+
+
+
+void chain_all_free (short mempool)
+
+{
+   void *cp;
+   void *cp_prev;
+   //#pragma omp parallel for
+   for (cp = mem_anker [mempool]; cp != NULL; cp = cp_prev)
+   {
+      cp_prev = * ((void **) cp);
+      CAPS_FREE (cp);
+   }
+
+   mem_anker [mempool] = NULL;
+
+   return;
+}
+
+
+/*********************************************************************/
+/*   eigenes (modifiziertes) basis_malloc usw.                       */
+/*   realloc selbst, malloc und free durch                           */
+/*   Standard-Speicherverwaltung realisiert;                         */
+/*   Bereiche verpointern und jedesmal die Integritaet der           */
+/*   Kette checken                                                   */
+/*********************************************************************/
+
+static void *stor_kette = NULL;
+
+
+void *basis_malloc (long size)
+{
+   /******************************************************************/
+   /* Belegung:                                                      */
+   /*                                                                */
+   /*       4 Byte voriger Speicherbereich                           */
+   /*       4 Byte naechster Speicherbereich                         */
+   /*       4 Byte Groesse                                           */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*    size Byte Datenblock                                        */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*  -----------------------------------------------------         */
+   /* size+36 Byte insgesamt                                         */
+   /******************************************************************/
+
+
+   char *p;
+   char *ph;
+
+#if 0
+   char *p2;
+   long size_lfd;
+#endif
+
+   SPMESSAGE ("Start basis_malloc\n");
+   SPMESSAGE ("size %ld\n", size);
+
+   p = malloc (size + 36);
+
+   if (p == NULL)
+   {
+      printf ("schrecklicher Fehler bei basis_malloc:\n");
+      printf ("Allokation gescheitert:\n");
+      return NULL;
+   }
+
+   memset (p, 0x00, size + 36);
+
+   /*******************************************************************/
+   /* In die ersten vier Bytes von p kommt die Speicheradresse von    */
+   /* stor_kette rein. Danach kommt umgekehrt in die Bytes 5 - 8      */
+   /* von stor_kette, falls ungleich NULL, die Adresse von p rein.    */
+   /* (Ist das noetig, die Liste doppelt zu verketten?)               */
+   /*******************************************************************/
+
+   * ((void **) p) = stor_kette;
+
+   if (stor_kette != NULL)
+   {
+      ph = stor_kette;
+      ph += 4;
+      *((void **) ph) = p;
+   }
+
+   stor_kette = p;
+
+   *((long *)(p + 8)) = size;
+   memcpy (p + 12, "<0123456789>", 12);
+   memcpy (p + 24 + size, "<0123456789>", 12);
+   p += 24;
+
+#if 0
+   SPMESSAGE ("Pruefung der Integritaet\n");
+
+   for (p2 = stor_kette; p2 != NULL;  p2 = * ((void **) p2))
+   {
+      if (memcmp (p2 + 12, "<0123456789>", 12) != 0)
+      {
+         printf ("basis_malloc - schrecklicher Speicherfehler\n");
+         printf ("Bereich vor Datenblock zerstoert\n");
+         exit (20);
+      }
+
+      size_lfd = *((long *)(p2 + 8));
+
+      if (memcmp (p2 + 24 + size_lfd, "<0123456789>", 12) != 0)
+      {
+         printf ("basis_malloc - schrecklicher Speicherfehler\n");
+         printf ("Bereich nach Datenblock zerstoert\n");
+         exit (20);
+      }
+   }
+#endif
+
+   SPMESSAGE ("p  %p\n", p);
+   SPMESSAGE ("Ende basis_malloc\n");
+
+   return p;
+}
+
+
+
+
+void basis_free (void *palt)
+
+{
+   char *p;
+   char *p_prev;
+   char *p_next;
+   long size_lfd;
+
+   SPMESSAGE ("Start basis_free\n");
+   SPMESSAGE ("palt   %p \n", palt);
+
+   if (palt == NULL)
+   {
+      printf ("schrecklicher Fehler in basis_free\n");
+      printf ("NULL-pointer erhalten\n");
+      return;
+   }
+
+
+   p = palt;
+   p -= 24;
+
+
+   SPMESSAGE ("Pruefung der Integritaet\n");
+
+   if (memcmp (p + 12, "<0123456789>", 12) != 0)
+   {
+      printf ("basis_free - schrecklicher Speicherfehler\n");
+      printf ("Bereich vor Datenblock zerstoert\n");
+      exit (20);
+   }
+
+   size_lfd = *((long *)(p + 8));
+
+   if (memcmp (p + 24 + size_lfd, "<0123456789>", 12) != 0)
+   {
+      printf ("basis_free - schrecklicher Speicherfehler\n");
+      printf ("Bereich nach Datenblock zerstoert\n");
+      exit (20);
+   }
+
+   /*******************************/
+   /* Bereiche neu verpointern    */
+   /*******************************/
+
+   p_prev = *((void **) p);
+   p_next = *((void **) (p + 4));
+
+   if (p_prev != NULL)
+      *((void **) (p_prev + 4)) = p_next;
+
+   if (p_next != NULL)
+      *((void **) (p_next)) = p_prev;
+   else
+      stor_kette = p_prev;
+
+   free ((void *) p);
+
+   SPMESSAGE ("Ende basis_free\n");
+
+   return;
+}
+
+
+
+
+
+void integritaet_pruefen (void)
+{
+   /******************************************************************/
+   /* Belegung:                                                      */
+   /*                                                                */
+   /*       4 Byte voriger Speicherbereich                           */
+   /*       4 Byte naechster Speicherbereich                         */
+   /*       4 Byte Groesse                                           */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*    size Byte Datenblock                                        */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*  -----------------------------------------------------         */
+   /* size+36 Byte insgesamt                                         */
+   /******************************************************************/
+
+   char *p2;
+   long size_lfd;
+
+   SPMESSAGE ("Pruefung der Integritaet\n");
+
+	//#pragma omp parallel for
+   for (p2 = stor_kette; p2 != NULL; p2 = * ((void **) p2))
+   {
+      if (memcmp (p2 + 12, "<0123456789>", 12) != 0)
+      {
+         printf ("integritaet_pruefen - "
+                 "schrecklicher Speicherfehler\n");
+         printf ("Bereich vor Datenblock zerstoert\n");
+         exit (20);
+      }
+
+      size_lfd = *((long *)(p2 + 8));
+
+      if (memcmp (p2 + 24 + size_lfd, "<0123456789>", 12) != 0)
+      {
+         printf ("integritaet_pruefen - "
+                 "schrecklicher Speicherfehler\n");
+         printf ("Bereich nach Datenblock zerstoert\n");
+         exit (20);
+      }
+   }
+
+   printf ("Integritaet ok\n");
+
+   return;
+}
+
+
+
+
+int adr_in_kette_finden (void *adr)
+{
+   /******************************************************************/
+   /* Belegung:                                                      */
+   /*                                                                */
+   /*       4 Byte voriger Speicherbereich                           */
+   /*       4 Byte naechster Speicherbereich                         */
+   /*       4 Byte Groesse                                           */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*    size Byte Datenblock                                        */
+   /*      12 Byte Bereich zum Testen der Integritaet                */
+   /*  -----------------------------------------------------         */
+   /* size+36 Byte insgesamt                                         */
+   /******************************************************************/
+
+   char *p2;
+   long size_lfd;
+   int rc;
+
+   SPMESSAGE ("Pruefung der Integritaet\n");
+
+   rc = 0;
+   //#pragma omp parallel for
+   for (p2 = stor_kette; p2 != NULL; p2 = * ((void **) p2))
+   {
+      if (memcmp (p2 + 12, "<0123456789>", 12) != 0)
+      {
+         printf ("integritaet_pruefen - "
+                 "schrecklicher Speicherfehler\n");
+         printf ("Bereich vor Datenblock zerstoert\n");
+         exit (20);
+      }
+
+      if (p2 + 24 == ((char *) adr))
+         rc = 1;
+
+      size_lfd = *((long *)(p2 + 8));
+
+      if (memcmp (p2 + 24 + size_lfd, "<0123456789>", 12) != 0)
+      {
+         printf ("integritaet_pruefen - "
+                 "schrecklicher Speicherfehler\n");
+         printf ("Bereich nach Datenblock zerstoert\n");
+         exit (20);
+      }
+   }
+
+   return rc;
+}
+
+
+
+
+void *basis_calloc (long length, int obj_size)
+{
+   void *p;
+
+   p = basis_malloc (length * obj_size);
+
+   return p;
+}
+
+
+
+
+void integritaet_speziell (void *palt)
+
+{
+   char *p;
+   long size_lfd;
+
+   p = palt;
+   p -= 24;
+
+
+   SPMESSAGE ("Pruefung der Integritaet\n");
+
+   if (memcmp (p + 12, "<0123456789>", 12) != 0)
+   {
+      printf ("integritaet_speziell - schrecklicher Speicherfehler\n");
+      printf ("Bereich vor Datenblock zerstoert\n");
+      exit (20);
+   }
+
+   size_lfd = *((long *)(p + 8));
+
+   if (memcmp (p + 24 + size_lfd, "<0123456789>", 12) != 0)
+   {
+      printf ("integritaet_speziell - schrecklicher Speicherfehler\n");
+      printf ("Bereich nach Datenblock zerstoert\n");
+      exit (20);
+   }
+
+   return;
+}
+
+
+
+
+
+
+void *basis_realloc (void *palt,
+                     long newsize)
+
+{
+   void *p;
+   long oldsize;
+   char *ph;
+
+   SPMESSAGE ("Start basis_realloc");
+
+   p = basis_malloc (newsize);
+
+   if (p != NULL)
+   {
+      if (palt != NULL)
+      {
+         ph = palt;
+         oldsize = *((long *)(ph - 16));
+
+         if (oldsize != 0)
+            memcpy (p, palt, oldsize);
+
+         basis_free (palt);
+      }
+   }
+   else
+      printf ("schrecklicher Fehler: realloc gescheitert!\n");
+
+   SPMESSAGE ("Ende basis_realloc");
+
+   return p;
+}
+
+
+
+
+/**********************************************************************/
+/* einen double-Vektor mit Indexbereich   0 ... n   allokieren und    */
+/* initialisieren. Es wird also immer ein Element mehr allokiert als  */
+/* im Prinzip noetig waere.                                           */
+/**********************************************************************/
+
+double *dvector_alloc (long n)
+{
+   double *v;
+
+   v = (double *) BASIS_CALLOC ((size_t) (n + 1), sizeof (double));
+
+   return v;
+}
+
+
+
+
+
+size_t element_length (char type)
+{
+   switch (type)
+   {
+      case 'C':
+         return (sizeof (char));
+
+      case 'U':
+         return (sizeof (unsigned char));
+
+      case 'H':
+         return (sizeof (unsigned short));
+
+      case 'S':
+         return (sizeof (short));
+
+      case 'I':
+         return (sizeof (int));
+
+      case 'L':
+         return (sizeof (long));
+
+      case 'F':
+         return (sizeof (float));
+
+      case 'D':
+         return (sizeof (double));
+
+      default:
+         return 0;
+   }
+}
+
+
+
+/**********************************************************************/
+/* einen Vektor mit Indexbereich   0 ... n   allokieren und           */
+/* initialisieren. Es wird also immer ein Element mehr allokiert als  */
+/* im Prinzip noetig waere.                                           */
+/**********************************************************************/
+
+void *vector_alloc (long n, char type)
+{
+   size_t el;
+
+   el = element_length (type);
+   return BASIS_CALLOC ((size_t) (n + 1), el);
+}
+
+
+
+
+double *basis_dvector_alloc (long n)
+{
+   /***********************************************************/
+   /* einen Vektor mit Indexbereich 1 ... n allokieren        */
+   /* und initialisieren                                      */
+   /***********************************************************/
+
+   double *v;
+
+   v = (double *) basis_calloc ((size_t) (n + 1), sizeof (double));
+
+   return v;
+}
+
+
+
+#if 0
+float *fvector_alloc (long n)
+{
+   /***********************************************************/
+   /* einen Vektor mit Indexbereich 1 ... n allokieren        */
+   /* und initialisieren                                      */
+   /***********************************************************/
+
+   float *v;
+
+   v = (float *) calloc ((size_t) (n + 1), sizeof (float));
+
+   return v;
+}
+
+
+
+
+float *fvector_alloc_1 (long n)
+{
+   /***********************************************************/
+   /* einen Vektor mit Indexbereich 1 ... n allokieren        */
+   /* und initialisieren                                      */
+   /***********************************************************/
+
+   float *v;
+
+   v = (float *) calloc ((size_t) (n + 1), sizeof (float));
+
+   return v;
+}
+
+
+
+
+int *ivector_alloc_1 (long n)
+{
+   /***********************************************************/
+   /* einen Int-Vektor mit Indexbereich 1 ... n allokieren    */
+   /* und initialisieren                                      */
+   /***********************************************************/
+
+   int *v;
+
+   v = (int *) calloc ((size_t) (n + 1), sizeof (int));
+
+   return v;
+}
+#endif
+
+
+void *vector_realloc (void *v, long n_alt, long n_neu, char type)
+{
+   /*******************************************************************/
+   /* einen Vektor reallokieren und den neuen Bereich initialisieren  */
+   /*******************************************************************/
+
+   void *u;
+   size_t el;
+
+   el = element_length (type);
+
+   u = BASIS_REALLOC (v, (size_t) ((n_neu + 1) * el));
+
+   if (n_neu > n_alt)
+      memset (((char *) u) + (n_alt + 1) * el,
+              0x00,
+              (n_neu - n_alt) * el);
+
+   return u;
+}
+
+
+
+
+double *dvector_realloc (double *v, long n_alt, long n_neu)
+{
+   /***********************************************************/
+   /* einen double-Vektor auf den Indexbereich 1 ... n_neu    */
+   /* reallokieren und den neuen Bereich initialisieren       */
+   /***********************************************************/
+
+   double *u;
+
+   u = (double *) BASIS_REALLOC (v, ((size_t) (n_neu + 1)) *
+                                                       sizeof (double));
+
+   if (n_neu > n_alt)
+      memset (u + n_alt + 1, 0x00, (n_neu - n_alt) * sizeof (double));
+
+   return u;
+}
+
+
+
+
+double *dvector_realloc_1 (double *v, long n_alt, long n_neu)
+{
+   /***********************************************************/
+   /* einen double-Vektor auf den Indexbereich 1 ... n_neu    */
+   /* reallokieren und den neuen Bereich initialisieren       */
+   /***********************************************************/
+
+   double *u;
+
+   u = (double *) realloc (v, ((size_t) (n_neu + 1)) * sizeof (double));
+
+   if (n_neu > n_alt)
+      memset (u + n_alt + 1, 0x00, (n_neu - n_alt) * sizeof (double));
+
+   return u;
+}
+
+
+
+
+void ivector_free (int *v)
+
+{
+   /***************************************************************/
+   /* einen int-Vektor freigeben                                  */
+   /***************************************************************/
+
+   BASIS_FREE (v);
+   return;
+}
+
+
+
+
+void vector_free (void *v)
+
+{
+   /***************************************************************/
+   /* einen Vektor freigeben                                      */
+   /***************************************************************/
+
+   BASIS_FREE (v);
+   return;
+}
+
+
+
+
+void dvector_free (double *v)
+
+{
+   /***************************************************************/
+   /* einen double-Vektor freigeben                               */
+   /***************************************************************/
+
+   BASIS_FREE (v);
+   return;
+}
+
+
+
+
+void fvector_free (float *v)
+
+{
+   /***************************************************************/
+   /* einen double-Vektor freigeben                               */
+   /***************************************************************/
+
+   BASIS_FREE (v);
+   return;
+}
+
+
+
+
+/**********************************************************************/
+/* Double-Matrix mit Indexbereich                                     */
+/*                   indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*                   indexing, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier wird nur der Vektor von Zeigern auf die Zeilen allokiert und  */
+/* gesetzt. indexing kann 0 oder 1 sein.                              */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/**********************************************************************/
+
+double **dmatrix_pointer_alloc (double *a,
+                                long num_rows,
+                                long num_cols,
+                                short indexing)
+{
+   double **m;
+   long row_start;
+   long end_row;
+   long j;
+
+
+   if (indexing < 0 || indexing > 1)
+      return NULL;
+
+   m = (double **) BASIS_MALLOC ((size_t) (num_rows + indexing) *
+                                                    sizeof (double *));
+   if (m == NULL)
+      return NULL;
+
+   m [0] = a;
+
+   row_start = (1 - indexing) * num_cols;
+   end_row = num_rows + indexing;
+   //#pragma omp parallel for
+   for (j = 1; j < end_row; j ++, row_start += num_cols)
+      m [j] = a + row_start;
+
+   return m;
+}
+
+
+
+
+
+/**********************************************************************/
+/* Matrix mit Indexbereich                                            */
+/*                   indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*                   indexing, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier wird nur der Vektor von Zeigern auf die Zeilen der Matrix     */
+/* allokiert und auf die entsprechenden Elemente des mitgegebenen     */
+/* Datenvektors a gesetzt. indexing kann 0 oder 1 sein.               */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/* Unabhaengig von indexing ist m [0] = a.                            */
+/*                                                                    */
+/* Folgende Typen sind moeglich:  D  -- double                        */
+/*                                F  -- float                         */
+/*                                I  -- int                           */
+/*                                S  -- short                         */
+/*                                L  -- long                          */
+/*                                C  -- char                          */
+/*                                U  -- unsigned char                 */
+/*                                                                    */
+/* Diese Funktion ist noch nicht genuegend getestet. Falls sie nicht  */
+/* richtig funktioniert, kann man auf die kommentierte Variante       */
+/* in speiorg.c zurueckgreifen !!!!                                   */
+/**********************************************************************/
+
+void **matrix_pointer_alloc (void *a,
+                             long num_rows,
+                             long num_cols,
+                             char type,
+                             short indexing)
+{
+   size_t el;
+   long end_row;
+   void **m;
+   char *acurr;
+   long j;
+
+   el = element_length (type);
+
+   if (indexing < 0 || indexing > 1)
+      return NULL;
+
+   end_row = num_rows + indexing;
+
+   m = (void **) BASIS_MALLOC ((size_t) (num_rows + indexing) *
+                                              sizeof (void *));
+   if (m == NULL)
+      return NULL;
+
+   if (indexing == 1)
+      m [0] = a;
+
+   acurr = (char *) a;
+   //#pragma omp parallel for
+   for (j = indexing; j < end_row; j ++, acurr += (num_cols * el))
+      m [j] = (void *) acurr;
+
+   return m;
+}
+
+
+
+
+void ***array_3_pointer_alloc (void *a,
+                               long num_rows,
+                               long num_cols,
+                               long num_levs,
+                               char type,
+                               short indexing)
+{
+   size_t el;
+   long end_row;
+   long num_last_dims;
+   void ***p;
+   char *acurr;
+   long j;
+
+   el = element_length (type);
+
+   if (indexing < 0 || indexing > 1)
+      return NULL;
+
+   end_row = num_rows + indexing;
+   num_last_dims = num_cols * num_levs;
+
+
+   p = (void ***) BASIS_MALLOC ((size_t) end_row * sizeof (void **));
+
+   if (p == NULL)
+      return NULL;
+
+   if (indexing == 1)
+      p [0] = &a;
+
+   acurr = (char *) a;
+
+   for (j = indexing; j < end_row; j ++, acurr += (num_last_dims * el))
+   {
+      p [j] = matrix_pointer_alloc (acurr,
+                                    num_cols,
+                                    num_levs,
+                                    type,
+                                    indexing);
+      if (p [j] == NULL)
+         return NULL;
+   }
+
+   return p;
+}
+
+
+
+
+void ****array_4_pointer_alloc (void *a,
+                                long num_rows,
+                                long num_cols,
+                                long num_levs,
+                                long num_elems,
+                                char type,
+                                short indexing)
+{
+   size_t el;
+   long end_row;
+   long num_last_dims;
+   void ****p;
+   char *acurr;
+   long j;
+
+   el = element_length (type);
+
+   if (indexing < 0 || indexing > 1)
+      return NULL;
+
+   end_row = num_rows + indexing;
+   num_last_dims = num_cols * num_levs * num_elems;
+
+
+   p = (void ****) BASIS_MALLOC ((size_t) end_row * sizeof (void ***));
+
+   if (p == NULL)
+      return NULL;
+
+   if (indexing == 1)
+      p [0][0] = &a;
+
+   acurr = (char *) a;
+   //#pragma omp parallel for
+   for (j = indexing; j < end_row; j ++, acurr += (num_last_dims * el))
+   {
+      p [j] = array_3_pointer_alloc (acurr,
+                                     num_cols,
+                                     num_levs,
+                                     num_elems,
+                                     type,
+                                     indexing);
+      if (p [j] == NULL)
+         return NULL;
+   }
+
+   return p;
+}
+
+
+
+
+void **matrix_all_alloc (long zn, long sn, char type, short indexing)
+{
+   void *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = vector_alloc (ges_laenge, type);
+
+   if (a == NULL)
+      return NULL;
+
+   return matrix_pointer_alloc (a, zn, sn, type, indexing);
+}
+
+
+
+
+
+
+void ***array_3_all_alloc (long zn,
+                           long sn,
+                           long hn,
+                           char type,
+                           short indexing)
+{
+   void *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn * hn;
+
+   a = vector_alloc (ges_laenge, type);
+
+   if (a == NULL)
+      return NULL;
+
+   return array_3_pointer_alloc (a, zn, sn, hn, type, indexing);
+}
+
+
+
+
+
+
+void **matrix_realloc_zeilen (void **m,
+                              long zn_alt,
+                              long zn_neu,
+                              long sn,
+                              char type,
+                              short indexing)
+{
+   /***********************************************************/
+   /* eine Matrix reallokieren.                               */
+   /* Nur die Anzahl der Zeilen darf sich aendern!            */
+   /***********************************************************/
+
+   void **m_neu;
+   void *a;
+   long ges_laenge_alt;
+   long ges_laenge_neu;
+
+
+   a = m [0];
+
+   ges_laenge_alt = zn_alt * sn;
+   ges_laenge_neu = zn_neu * sn;
+
+   a = vector_realloc (a, ges_laenge_alt, ges_laenge_neu, type);
+
+   if (a == NULL)
+      return NULL;
+
+   BASIS_FREE (m);
+   m_neu = matrix_pointer_alloc (a, zn_neu, sn, type, indexing);
+
+   return m_neu;
+}
+
+
+
+
+double **dmatrix_zeiger_alloc_1 (double *a, long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+   /*                              1, ... sn (Spalten)        */
+   /* allokieren                                              */
+   /* Hier wird nur der Vektor von Zeigern allokiert und      */
+   /* gesetzt. Der erste Zeiger m [1] zeigt auf den           */
+   /* mitgegebenen Vektor a, so dass m [1][1] = a [1].        */
+   /***********************************************************/
+
+   double **m;
+   long i;
+
+   m = (double **) malloc ((size_t) (zn + 1) * sizeof (double *));
+
+   if (m == NULL)
+      return NULL;
+
+   m [0] = a;
+   #pragma omp parallel for
+   for (i = 0; i < zn; i ++)
+      m [i + 1] = a + i * sn;
+
+   return m;
+}
+
+
+
+
+
+
+
+
+double **basis_dmatrix_zeiger_alloc (double *a, long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+   /*                              1, ... sn (Spalten)        */
+   /* allokieren                                              */
+   /* Hier wird nur der Vektor von Zeigern allokiert und      */
+   /* gesetzt. Der erste Zeiger m [1] zeigt auf den           */
+   /* mitgegebenen Vektor a, so dass m [1][1] = a [1].        */
+   /***********************************************************/
+
+   double **m;
+   long i;
+
+   m = (double **) basis_malloc ((size_t) (zn + 1) *
+                                              sizeof (double *));
+
+   if (m == NULL)
+      return NULL;
+
+   m [0] = a;
+   #pragma omp parallel for
+   for (i = 0; i < zn; i ++)
+      m [i + 1] = a + i * sn;
+
+   return m;
+}
+
+
+
+
+double **basis_dmatrix_zeiger_alloc_1 (double *a, long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+   /*                              1, ... sn (Spalten)        */
+   /* allokieren                                              */
+   /* Hier wird nur der Vektor von Zeigern allokiert und      */
+   /* gesetzt. Der erste Zeiger m [1] zeigt auf den           */
+   /* mitgegebenen Vektor a, so dass m [1][1] = a [1].        */
+   /***********************************************************/
+
+   double **m;
+   long i;
+
+   m = (double **) basis_malloc ((size_t) (zn + 1) *
+                                              sizeof (double *));
+
+   if (m == NULL)
+      return NULL;
+
+   m [0] = a;
+   #pragma omp parallel for
+   for (i = 0; i < zn; i ++)
+      m [i + 1] = a + i * sn;
+
+   return m;
+}
+
+
+
+
+double **basis_dmatrix_zeiger_alloc_0 (double *a, long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 0, ... zn - 1 (Zeilen)     */
+   /*                              0, ... sn - 1 (Spalten)    */
+   /* allokieren                                              */
+   /* Hier wird nur der Vektor von Zeigern allokiert und      */
+   /* gesetzt. Der erste Zeiger m [0] zeigt auf den           */
+   /* mitgegebenen Vektor a, so dass m [0][0] = a [0].        */
+   /***********************************************************/
+
+   double **m;
+   long i;
+
+   m = (double **) basis_malloc ((size_t) zn * sizeof (double *));
+
+   if (m == NULL)
+      return NULL;
+   #pragma omp parallel for
+   for (i = 0; i < zn; i ++)
+      m [i] = a + i * sn;
+
+   return m;
+}
+
+
+
+
+
+
+
+double **doberes_dreieck_zeiger_alloc (double *a, long n)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich i = 1, ....... n (Zeilen)  */
+   /*                              j =     i, ... n (Spalten) */
+   /* allokieren                                              */
+   /* Hier wird nur der Vektor von Zeigern allokiert und      */
+   /* gesetzt. Der erste Zeiger m [1] zeigt auf den           */
+   /* mitgegebenen Vektor a, so dass m [1][1] = a [1].        */
+   /***********************************************************/
+
+   double **m;
+   long i;
+   double *b;
+
+   m = (double **) BASIS_MALLOC ((size_t) (n + 1) * sizeof (double *));
+
+   if (m == NULL)
+      return NULL;
+
+   b = a;
+   m [0] = a;
+
+   #pragma omp parallel for
+   for (i = 0; i < n; i ++)
+   {
+      m [i + 1] = b;
+      b += (n - i - 1);
+   }
+
+   return m;
+}
+
+
+
+/**********************************************************************/
+/* Matrix mit Indexbereich                                            */
+/*               i = indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*               j =        i, ... num_rows + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier wird nur der Vektor von Zeigern auf die Zeilen allokiert und  */
+/* gesetzt. indexing kann 0 oder 1 sein.                              */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/*                                                                    */
+/* Folgende Typen sind moeglich:  D  -- double                        */
+/*                                F  -- float                         */
+/*                                I  -- int                           */
+/*                                S  -- short                         */
+/*                                L  -- long                          */
+/*                                C  -- char                          */
+/*                                U  -- unsigned char                 */
+/*                                                                    */
+/* Diese Version ist experimentell und noch nicht genuegend           */
+/* getestet. Falls sie nicht gut funktioniert, kann man auf die       */
+/* kommentierte Version in speiorg.c zurueckgreifen.                  */
+/**********************************************************************/
+
+void **upper_triangle_pointer_alloc (void *a,
+                                     long num_rows,
+                                     char type,
+                                     short indexing)
+{
+   size_t el;
+   long j;
+   long end_row;
+   long inc_start;
+   char *acurr;
+   void **m;
+
+
+   el = element_length (type);
+
+   if (indexing < 0 || indexing > 1)
+      return NULL;
+
+   end_row = num_rows + indexing;
+
+
+   /*******************************************************************/
+   /* Das Inkrement von einem Zeiger auf eine Zeile zur naechsten ist */
+   /* schon am Anfang eins kleiner als die Anzahl der Zeilen: Die     */
+   /* Die erste Zeile hat num_rows Elemente, dann kommt aber im Falle */
+   /* indexing = 1 schon m [2][2], es muss also m [2][0] dasselbe     */
+   /* Element sein wie m [1][num_rows - 1].                           */
+   /*******************************************************************/
+
+   inc_start = (num_rows - 1) * (long)el;
+
+   acurr = (char *) a;
+
+   m = BASIS_MALLOC ((size_t) (num_rows + indexing) * sizeof (void *));
+
+   if (m == NULL)
+      return NULL;
+
+   if (indexing == 1)
+      m [0] = a;
+   //#pragma omp parallel for
+   for (j = indexing; j < end_row; j ++, inc_start -= (long)el)
+   {
+      m [j] = (void *) acurr;
+      acurr += inc_start;
+   }
+
+   return m;
+}
+
+
+
+
+void **upper_triangle_all_alloc (long num_rows,
+                                 char type,
+                                 short indexing)
+{
+
+   void *a;
+   long ges_laenge;
+
+   ges_laenge = (num_rows + 1) * num_rows;
+   ges_laenge = ges_laenge / 2 + indexing;
+
+   a = vector_alloc (ges_laenge, type);
+
+   if (a == NULL)
+      return NULL;
+
+   return upper_triangle_pointer_alloc (a, num_rows, type, indexing);
+}
+
+
+
+
+void dmatrix_zeiger_free (double **m)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+   /* freigeben (Gegenstueck zu dmatrix_zeiger_alloc und zu   */
+   /* dmatrix_zeiger_alloc_0)                                 */
+   /***********************************************************/
+
+   BASIS_FREE (m);
+   return;
+}
+
+
+
+
+void matrix_pointer_free (void **m)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+   /* freigeben (Gegenstueck zu matrix_pointer_alloc)         */
+   /***********************************************************/
+
+   free (m);
+   return;
+}
+
+
+
+
+#if 0
+float **fmatrix_all_alloc (long zn, long sn)
+{
+   /**************************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)            */
+   /*                              1, ... sn (Spalten)           */
+   /* allokieren                                                 */
+   /* Hier werden der float-Vektor a fuer die Matrixelemente     */
+   /* (gesamte Groesse der Matrix) und ein Vektor m von Zeigern  */
+   /* allokiert. Der float Vektor a wird initialisiert, die      */
+   /* Elemente des Zeiger-Vektors m werden auf die "Zeilen-      */
+   /* anfaenge" (entsprechende Elemente von a) gesetzt, so dass  */
+   /* m [1][1] = a [1].                                          */
+   /**************************************************************/
+
+   float **m;
+   float *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = fvector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = fmatrix_zeiger_alloc (a, zn, sn);
+
+   return m;
+}
+
+
+
+
+float **fmatrix_all_alloc_1 (long zn, long sn)
+{
+   /**************************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)            */
+   /*                              1, ... sn (Spalten)           */
+   /* allokieren                                                 */
+   /* Hier werden der float-Vektor a fuer die Matrixelemente     */
+   /* (gesamte Groesse der Matrix) und ein Vektor m von Zeigern  */
+   /* allokiert. Der float Vektor a wird initialisiert, die      */
+   /* Elemente des Zeiger-Vektors m werden auf die "Zeilen-      */
+   /* anfaenge" (entsprechende Elemente von a) gesetzt, so dass  */
+   /* m [1][1] = a [1].                                          */
+   /**************************************************************/
+
+   float **m;
+   float *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = fvector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = fmatrix_zeiger_alloc (a, zn, sn);
+
+   return m;
+}
+#endif
+
+
+
+/**********************************************************************/
+/* Double-Matrix mit Indexbereich                                     */
+/*                   indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*                   indexing, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier werden der double-Vektor a fuer die Matrixelemente (gesamte   */
+/* Groesse der Matrix) und ein Vektor m von Zeigern auf die Zeilen    */
+/* der Matrix allokiert. Der double-Vektor a wird initialisiert, die  */
+/* Elemente des Zeiger-Vektors m werden auf die "Zeilenanfaenge"      */
+/* (also die entsprechenden Elemente von a) gesetzt. indexing gibt    */
+/* an, ob die Indizierung der Matrix bei 0 oder bei 1 beginnen soll.  */
+/* indexing kann 0 oder 1 sein.                                       */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/**********************************************************************/
+
+double **dmatrix_all_alloc (long zn, long sn, short indexing)
+{
+   double **m;
+   double *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = dvector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = dmatrix_pointer_alloc (a, zn, sn, indexing);
+
+   return m;
+}
+
+
+
+
+double **basis_dmatrix_all_alloc (long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+   /*                              1, ... sn (Spalten)        */
+   /* allokieren                                              */
+   /* Hier werden der double-Vektor a fuer die Matrixelemente */
+   /* (gesamte Groesse der Matrix) und ein Vektor m von       */
+   /* Zeigern allokiert. Der double Vektor a wird             */
+   /* initialisiert, die Elemente des zeiger-Vektors m werden */
+   /* auf die "Zeilenanfaenge" (entsprechende Elemente von a) */
+   /* gesetzt, so dass m [1][1] = a [1].                      */
+   /***********************************************************/
+
+   double **m;
+   double *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = basis_dvector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = basis_dmatrix_zeiger_alloc (a, zn, sn);
+
+   return m;
+}
+
+
+
+
+double **doberes_dreieck_all_alloc (long n)
+{
+   /******************************************************************/
+   /* obere Dreiecks Matrix mit Indexbereich i = 1, ... n (Zeilen)   */
+   /*                                        j = i, ... n (Spalten)  */
+   /* allokieren                                                     */
+   /* Eine eigene Funktion zum Freigeben braucht es nicht, man kann  */
+   /* die Funktion dmatrix_all_free benutzen                         */
+   /******************************************************************/
+
+   double **m;
+   double *a;
+   long ges_laenge;
+
+   ges_laenge = n * (n + 1) / 2;
+
+   a = dvector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = doberes_dreieck_zeiger_alloc (a, n);
+
+   return m;
+}
+
+
+
+
+double **doberes_dreieck_all_alloc_1 (long n)
+{
+   /******************************************************************/
+   /* obere Dreiecks Matrix mit Indexbereich i = 1, ... n (Zeilen)   */
+   /*                                        j = i, ... n (Spalten)  */
+   /* allokieren                                                     */
+   /* Eine eigene Funktion zum Freigeben braucht es nicht, man kann  */
+   /* die Funktion dmatrix_all_free benutzen                         */
+   /******************************************************************/
+
+   double **m;
+   double *a;
+   long ges_laenge;
+
+   ges_laenge = n * (n + 1) / 2;
+
+   a = dvector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = doberes_dreieck_zeiger_alloc (a, n);
+
+   return m;
+}
+
+
+
+#if 0
+int **imatrix_all_alloc (long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+   /*                              1, ... sn (Spalten)        */
+   /* allokieren                                              */
+   /* Hier werden der Int-Vektor a fuer die Matrixelemente    */
+   /* (gesamte Groesse der Matrix) und ein Vektor m von       */
+   /* Zeigern allokiert. Der Int-Vektor a wird initialisiert, */
+   /* die Elemente des Zeiger-Vektors m werden auf die        */
+   /* "Zeilenanfaenge" (entsprechende Elemente von a)         */
+   /* gesetzt, so dass m [1][1] = a [1].                      */
+   /***********************************************************/
+
+   int **m;
+   int *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = ivector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = imatrix_zeiger_alloc (a, zn, sn);
+
+   return m;
+}
+
+
+
+
+int **imatrix_all_alloc_1 (long zn, long sn)
+{
+   /***********************************************************/
+   /* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+   /*                              1, ... sn (Spalten)        */
+   /* allokieren                                              */
+   /* Hier werden der Int-Vektor a fuer die Matrixelemente    */
+   /* (gesamte Groesse der Matrix) und ein Vektor m von       */
+   /* Zeigern allokiert. Der Int-Vektor a wird initialisiert, */
+   /* die Elemente des Zeiger-Vektors m werden auf die        */
+   /* "Zeilenanfaenge" (entsprechende Elemente von a)         */
+   /* gesetzt, so dass m [1][1] = a [1].                      */
+   /***********************************************************/
+
+   int **m;
+   int *a;
+   long ges_laenge;
+
+   ges_laenge = zn * sn;
+
+   a = ivector_alloc (ges_laenge);
+
+   if (a == NULL)
+      return NULL;
+
+   m = imatrix_zeiger_alloc (a, zn, sn);
+
+   return m;
+}
+#endif
+
+
+
+void dmatrix_all_free (double **m)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+   /* sowie den Vektor der Matrixelemente freigeben           */
+   /* (Gegenstueck zu dmatrix_all_alloc)                      */
+   /***********************************************************/
+
+   double *a;
+
+   a = m [0];
+
+   BASIS_FREE (m);
+   BASIS_FREE (a);
+
+   return;
+}
+
+
+
+
+void fmatrix_all_free (float **m)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+   /* sowie den Vektor der Matrixelemente freigeben           */
+   /* (Gegenst�ck zufdmatrix_all_allc))                       */
+   /***********************************************************/
+
+   float *a;
+
+   a = m [0];
+
+   BASIS_FREE (m);
+   BASIS_FREE (a);
+
+   return;
+}
+
+
+
+
+void smatrix_all_free (short **m)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+   /* sowie den Vektor der Matrixelemente freigeben           */
+   /* (Gegenst�ck zufdmatrix_all_allc))                       */
+   /***********************************************************/
+
+   short *a;
+
+   a = m [0];
+
+   BASIS_FREE (m);
+   BASIS_FREE (a);
+
+   return;
+}
+
+
+
+
+void matrix_all_free (void **m)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+   /* sowie den Vektor der Matrixelemente freigeben           */
+   /* (Gegenstueck zu matrix_all_alloc)                       */
+   /***********************************************************/
+
+   void *a;
+
+   a = m [0];
+
+   BASIS_FREE (m);
+   BASIS_FREE (a);
+
+   return;
+}
+
+
+
+
+int legendre_dreieck_alloc (int maxdeg, double ***lf_anker)
+{
+   /**********************************************************/
+   /* Speicherplatz fuer Legendre-Funktionen bis zum         */
+   /* Entwicklungsgrad maxdeg allokieren und initialisieren  */
+   /* Es wird sowohl der double-Vektor der Elemente          */
+   /* allokiert und mit Nullen vorbesetzt als auch der       */
+   /* Zeigervektor (Zeiger auf die Zeilen der Legendre-      */
+   /* Matrix (Grade)) allokiert und gesetzt.                 */
+   /**********************************************************/
+
+
+   double *lf_kette;
+   double *pd;
+   double **lf_matrix;
+   int grad;
+   long anz_func;
+
+
+   lf_kette = NULL;
+   lf_matrix = NULL;
+
+   anz_func = (maxdeg + 1) * (maxdeg + 2) / 2;
+
+   lf_kette = (double *) calloc (anz_func, sizeof (double));
+
+   if (lf_kette == NULL)
+      return 8;
+
+   lf_matrix = (double **) malloc (
+                                  (maxdeg + 1) * sizeof (double *));
+
+   if (lf_matrix == NULL)
+   {
+      free (lf_kette);
+      return 12;
+   }
+   //#pragma omp parallel for
+   for (grad = 0, pd = lf_kette; grad <= maxdeg;  grad ++, pd += grad)
+   {
+      lf_matrix [grad] = pd;
+   }
+
+   *lf_anker = lf_matrix;
+
+   return 0;
+}
+
+
+
+
+double **legendre_dreieck_alloc_neu (int maxdeg)
+{
+   /**********************************************************/
+   /* Speicherplatz fuer Legendre-Funktionen bis zum         */
+   /* Entwicklungsgrad maxdeg allokieren und initialisieren  */
+   /* Es wird sowohl der double-Vektor der Elemente          */
+   /* allokiert und mit Nullen vorbesetzt als auch der       */
+   /* Zeigervektor (Zeiger auf die Zeilen der Legendre-      */
+   /* Matrix (Grade)) allokiert und gesetzt.                 */
+   /**********************************************************/
+
+
+   double *lf_kette;
+   double *pd;
+   double **lf_matrix;
+   int grad;
+   long anz_func;
+
+
+   lf_kette = NULL;
+   lf_matrix = NULL;
+
+   anz_func = (maxdeg + 1) * (maxdeg + 2) / 2;
+
+   lf_kette = (double *) calloc (anz_func, sizeof (double));
+
+   if (lf_kette == NULL)
+      return NULL;
+
+   lf_matrix = (double **) malloc (
+                               (maxdeg + 1) * sizeof (double *));
+
+   if (lf_matrix == NULL)
+   {
+      free (lf_kette);
+      return NULL;
+   }
+   //#pragma omp parallel for
+   for (grad = 0, pd = lf_kette; grad <= maxdeg; grad ++, pd += grad)
+   {
+      lf_matrix [grad] = pd;
+   }
+
+   return lf_matrix;
+}
+
+
+
+
+int legendre_dreieck_free (double ***lf_anker)
+{
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Legendre-     */
+   /* Matrix sowie den Vektor der Matrixelemente freigeben    */
+   /* (Gegenst�ck zu legendre_dreieck_alloc)                  */
+   /***********************************************************/
+
+
+   double *pd;
+   double **lf_matrix;
+
+
+   lf_matrix = *lf_anker;
+   pd = *lf_matrix;
+
+   free (lf_matrix);
+   free (pd);
+
+   return 0;
+}
+
+
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h
new file mode 100644
index 0000000..64501ac
--- /dev/null
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h
@@ -0,0 +1,470 @@
+/**********************************************************
+ * Version $Id: storeorg.h 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      storeorg.h                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//#ifdef _cplusplus
+//extern "C" {
+//#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#define NR_END 1
+
+#define BASIS_MALLOC  malloc
+#define BASIS_CALLOC  calloc
+#define BASIS_FREE    free
+#define BASIS_REALLOC realloc
+
+#if 0
+#define BASIS_MALLOC  basis_malloc
+#define BASIS_CALLOC  basis_calloc
+#define BASIS_FREE    basis_free
+#define BASIS_REALLOC basis_realloc
+#endif
+
+#define ANZ_MEMPOOL   10
+
+void *chain_malloc (long size, short mempool);
+
+void chain_free (void *palt);
+
+void *chain_realloc (void *palt, long newsize, short mempool);
+
+void chain_integrity (short mempool);
+
+void chain_all_free (short mempool);
+
+
+size_t element_length (char type);
+
+void *vector_alloc (long n, char type);
+
+
+/**********************************************************************/
+/* einen double-Vektor mit Indexbereich   0 ... n   allokieren und    */
+/* initialisieren. Es wird also immer ein Element mehr allokiert als  */
+/* im Prinzip noetig waere.                                           */
+/**********************************************************************/
+
+double *dvector_alloc (long n);
+
+
+
+
+
+/**********************************************************************/
+/* Double-Matrix mit Indexbereich                                     */
+/*                   indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*                   indexing, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier wird nur der Vektor von Zeigern auf die Zeilen allokiert und  */
+/* gesetzt. indexing kann 0 oder 1 sein.                              */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/**********************************************************************/
+
+double **dmatrix_pointer_alloc (double *a,
+                                long num_rows,
+                                long num_cols,
+                                short indexing);
+
+
+
+
+/**********************************************************************/
+/* Double-Matrix mit Indexbereich                                     */
+/*                   indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*                   indexing, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier werden der double-Vektor a fuer die Matrixelemente (gesamte   */
+/* Groesse der Matrix) und ein Vektor m von Zeigern auf die Zeilen    */
+/* der Matrix allokiert. Der double-Vektor a wird initialisiert, die  */
+/* Elemente des Zeiger-Vektors m werden auf die "Zeilenanfaenge"      */
+/* (also die entsprechenden Elemente von a) gesetzt. indexing gibt    */
+/* an, ob die Indizierung der Matrix bei 0 oder bei 1 beginnen soll.  */
+/* indexing kann 0 oder 1 sein.                                       */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/**********************************************************************/
+
+double **dmatrix_all_alloc (long zn, long sn, short indexing);
+
+/**********************************************************************/
+/* Matrix mit Indexbereich                                            */
+/*                   indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*                   indexing, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier wird nur der Vektor von Zeigern auf die Zeilen allokiert und  */
+/* gesetzt. indexing kann 0 oder 1 sein.                              */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/*                                                                    */
+/* Folgende Typen sind moeglich:  D  -- double                        */
+/*                                F  -- float                         */
+/*                                I  -- int                           */
+/*                                S  -- short                         */
+/*                                L  -- long                          */
+/*                                C  -- char                          */
+/*                                U  -- unsigned char                 */
+/**********************************************************************/
+
+void **matrix_pointer_alloc (void *a,
+                             long num_rows,
+                             long num_cols,
+                             char type,
+                             short indexing);
+
+void ***array_3_pointer_alloc (void *a,
+                               long num_rows,
+                               long num_cols,
+                               long num_piles,
+                               char type,
+                               short indexing);
+
+void **matrix_all_alloc (long zn, long sn, char type, short indexing);
+
+void ***array_3_all_alloc (long zn,
+                           long sn,
+                           long hn,
+                           char type,
+                           short indexing);
+
+void ****array_4_pointer_alloc (void *a,
+                                long num_rows,
+                                long num_cols,
+                                long num_levs,
+                                long num_elems,
+                                char type,
+                                short indexing);
+
+void *basis_malloc (long size);
+
+void integritaet_pruefen (void);
+
+int adr_in_kette_finden (void *adr);
+
+void *basis_calloc (long length, int obj_size);
+
+void basis_free (void *palt);
+
+void integritaet_speziell (void *palt);
+
+void *basis_realloc (void *palt, long newsize);
+
+
+
+
+/***********************************************************/
+/* einen Vektor mit Indexbereich 1 ... n allokieren        */
+/* und initialisieren                                      */
+/***********************************************************/
+
+double *basis_dvector_alloc (long n);
+
+
+#if 0
+float *fvector_alloc (long n);
+
+float *fvector_alloc_1 (long n);
+
+/***********************************************************/
+/* einen Vektor mit Indexbereich 0 ... n - 1 allokieren    */
+/* und initialisieren                                      */
+/***********************************************************/
+
+
+/***********************************************************/
+/* einen Vektor mit Indexbereich 1 ... n allokieren        */
+/* und initialisieren                                      */
+/***********************************************************/
+
+int *ivector_alloc (long n);
+
+int *ivector_alloc_1 (long n);
+#endif
+
+
+/***********************************************************/
+/* einen Short-Vektor mit Indexbereich 1 ... n allokieren   */
+/* und initialisieren                                      */
+/***********************************************************/
+
+
+void *vector_realloc (void *v, long n_alt, long n_neu, char type);
+
+double *dvector_realloc (double *v, long n_alt, long n_neu);
+
+double *dvector_realloc_1 (double *v, long n_alt, long n_neu);
+
+
+/************************************/
+/* einen int-Vektor freigeben       */
+/************************************/
+
+void ivector_free (int *v);
+
+
+
+/************************************/
+/* einen double-Vektor freigeben    */
+/************************************/
+
+void dvector_free (double *v);
+
+void fvector_free (float *v);
+
+
+/***************************************************************/
+/* einen Vektor freigeben                                      */
+/***************************************************************/
+
+void vector_free (void *v);
+
+
+/***********************************************************/
+/* eine Matrix mit Indexbereich 1, ... zn (Zeilen)         */
+/*                              1, ... sn (Spalten)        */
+/* allokieren                                              */
+/* Hier wird nur der Vektor von Zeigern allokiert und      */
+/* gesetzt. Der erste Zeiger m [1] zeigt auf den           */
+/* mitgegebenen Vektor a, so dass m [1][1] = a [1].        */
+/***********************************************************/
+
+double **dmatrix_zeiger_alloc (double *a, long zn, long sn);
+
+double **dmatrix_zeiger_alloc_1 (double *a, long zn, long sn);
+
+#if 0
+int **imatrix_zeiger_alloc (int *a, long zn, long sn);
+
+int **imatrix_zeiger_alloc_1 (int *a, long zn, long sn);
+#endif
+
+
+double **basis_dmatrix_zeiger_alloc (double *a, long zn, long sn);
+
+double **basis_dmatrix_zeiger_alloc_1 (double *a, long zn, long sn);
+
+#if 0
+float **fmatrix_zeiger_alloc (float *a, long zn, long sn);
+
+
+/***********************************************************/
+/* eine Matrix mit Indexbereich i = 1, ... n (Zeilen)      */
+/*                              j = i, ... n (Spalten)     */
+/* allokieren                                              */
+/* Hier wird nur der Vektor von Zeigern allokiert und      */
+/* gesetzt. Der erste Zeiger m [1] zeigt auf den           */
+/* mitgegebenen Vektor a, so dass m [1][1] = a [1].        */
+/***********************************************************/
+
+float **fmatrix_zeiger_alloc_1 (float *a, long zn, long sn);
+#endif
+
+double **doberes_dreieck_zeiger_alloc (double *a, long n);
+
+
+
+/**********************************************************************/
+/* Matrix mit Indexbereich                                            */
+/*               i = indexing, ... num_rows + indexing - 1 (Zeilen),  */
+/*               j =        i, ... num_cols + indexing - 1 (Spalten)  */
+/* allokieren                                                         */
+/* Hier wird nur der Vektor von Zeigern auf die Zeilen allokiert und  */
+/* gesetzt. indexing kann 0 oder 1 sein.                              */
+/* Der erste Zeiger m [indexing] zeigt auf den mitgegebenen Vektor a, */
+/* so dass m [indexing][indexing] = a [indexing].                     */
+/*                                                                    */
+/* Folgende Typen sind moeglich:  D  -- double                        */
+/*                                F  -- float                         */
+/*                                I  -- int                           */
+/*                                S  -- short                         */
+/*                                L  -- long                          */
+/*                                C  -- char                          */
+/*                                U  -- unsigned char                 */
+/**********************************************************************/
+
+void **upper_triangle_pointer_alloc (void *a,
+                                     long num_rows,
+                                     char type,
+                                     short indexing);
+
+
+void **upper_triangle_all_alloc (long num_rows,
+                                 char type,
+                                 short indexing);
+
+
+
+
+/***********************************************************/
+/* eine Matrix mit Indexbereich 0, ... zn - 1 (Zeilen)     */
+/*                              0, ... sn - 1 (Spalten)    */
+/* allokieren                                              */
+/* Hier wird nur der Vektor von Zeigern allokiert und      */
+/* gesetzt. Der erste Zeiger m [0] zeigt auf den           */
+/* mitgegebenen Vektor a, so dass m [0][0] = a [0].        */
+/***********************************************************/
+
+double **basis_dmatrix_zeiger_alloc_0 (double *a, long zn, long sn);
+
+
+
+
+
+void dmatrix_zeiger_free (double **m);
+
+void matrix_pointer_free (void **m);
+
+#if 0
+float **fmatrix_all_alloc (long zn, long sn);
+
+float **fmatrix_all_alloc_1 (long zn, long sn);
+#endif
+
+double **basis_dmatrix_all_alloc (long zn, long sn);
+
+double **basis_dmatrix_all_alloc_1 (long zn, long sn);
+
+
+/******************************************************************/
+/* obere Dreiecks Matrix mit Indexbereich i = 1, ... n (Zeilen)   */
+/*                                        j = i, ... n (Spalten)  */
+/* allokieren                                                     */
+/******************************************************************/
+
+double **doberes_dreieck_all_alloc (long n);
+
+double **doberes_dreieck_all_alloc_1 (long n);
+
+/***********************************************************/
+/* eine Matrix mit Indexbereich 0, ... zn - 1 (Zeilen)     */
+/*                              0, ... sn - 1 (Spalten)    */
+/* allokieren                                              */
+/* Hier werden der double-Vektor a f�r die Matrixelemente  */
+/* (gesamte Gr��e der Matrix) und ein Vektor m von Zeigern */
+/* allokiert. Der double Vektor a wird initialisiert, die  */
+/* Elemente des Zeiger-vektors m werden auf die "Zeilen-   */
+/* anf�nge" (entsprechende Elemente von a) gesetzt,        */
+/* so dass m [0][0] = a [0].                               */
+/***********************************************************/
+
+double **dmatrix_all_alloc_0 (long zn, long sn);
+
+double **basis_dmatrix_all_alloc_0 (long zn, long sn);
+
+
+
+void **matrix_realloc_zeilen (void **m,
+                              long zn_alt,
+                              long zn_neu,
+                              long sn,
+                              char type,
+                              short indexing);
+#if 0
+int **imatrix_all_alloc (long zn, long sn);
+
+int **imatrix_all_alloc_1 (long zn, long sn);
+#endif
+
+/***********************************************************/
+/* den Vektor mit Zeigern auf die Zeilen der Matrix        */
+/* sowie den Vektor der Matrixelemente freigeben           */
+/* (Gegenstueck zu dmatrix_all_alloc)                      */
+/***********************************************************/
+
+void dmatrix_all_free (double **m);
+
+void fmatrix_all_free (float **m);
+
+void smatrix_all_free (short **m);
+
+
+void matrix_all_free (void **m);
+
+/**********************************************************/
+/* Speicherplatz fuer Legendre-Funktionen bis zum         */
+/* Entwicklungsgrad maxdeg allokieren und initialisieren  */
+/* Es wird sowohl der double-Vektor der Elemente          */
+/* allokiert und mit Nullen vorbesetzt als auch der       */
+/* Zeigervektor (Zeiger auf die Zeilen der Legendre-      */
+/* Matrix (Grade)) allokiert und gesetzt.                 */
+/**********************************************************/
+
+int legendre_dreieck_alloc (int maxdeg, double ***lf_anker);
+
+
+double **legendre_dreieck_alloc_neu (int maxdeg);
+
+
+   /***********************************************************/
+   /* den Vektor mit Zeigern auf die Zeilen der Legendre-     */
+   /* Matrix sowie den Vektor der Matrixelemente freigeben    */
+   /* (Gegenstueck zu legendre_dreieck_alloc)                 */
+   /***********************************************************/
+
+
+int legendre_dreieck_free (double ***lf_anker);
+
+
+
diff --git a/src/modules/grid/grid_filter/geomrec.cpp b/src/modules/grid/grid_filter/geomrec.cpp
new file mode 100644
index 0000000..c9788ec
--- /dev/null
+++ b/src/modules/grid/grid_filter/geomrec.cpp
@@ -0,0 +1,203 @@
+/**********************************************************
+ * Version $Id: geomrec.cpp 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     geomrec.cpp                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "geomrec.h"
+
+extern "C" {
+	#include "geodesic_morph_rec/storeorg.h"
+	#include "geodesic_morph_rec/geovinc.h"
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGeomrec::CGeomrec(void)
+{
+	Set_Name		(_TL("Geodesic Morphological Reconstruction"));
+
+	Set_Author		(SG_T("HfT Stuttgart (c) 2013"));
+
+	Set_Description	(_TW(
+		"Geodesic morphological reconstruction according to \n"
+		"L. Vincent (1993): Morphological Grayscale Reconstruction in Image Analysis: "
+		"Applications and Efficient Algorithms. "
+		"IEEE Transactions on Image Processing, Vol. 2, No 2\n"
+		"Here we use the algorithm on p. 194: Computing of Regional Maxima and Breadth-first Scanning.\n\n"
+		"A marker is derived from the input image INPUT_GRID by subtracting a constant SHIFT_VALUE. Optionally "
+		"the SHIFT_VALUE can be set to zero at the border of the grid (\"Preserve 1px border Yes/No\"). "
+		"OUTPUT_GRID is the difference between the input image and the morphological reconstruction of "
+		"the marker under the input image as mask. If the Option \"Create a binary mask\" is selected, "
+		"the OUTPUT_GRID is thresholded with THRESHOLD, creating a binary image of maxima regions.\n"
+	));
+
+	CSG_Parameter	*pNode;
+
+	Parameters.Add_Grid (NULL, "INPUT_GRID", _TL ("Input Grid"), _TL ("Input for the morphological reconstruction"), PARAMETER_INPUT);
+	Parameters.Add_Grid (NULL, "OBJECT_GRID", _TL("Object Grid"), _TL("Binary object mask"), PARAMETER_OUTPUT, true, SG_DATATYPE_Bit);
+	Parameters.Add_Grid (NULL, "DIFFERENCE_GRID", _TL ("Difference Input - Reconstruction"), _TL ("Difference Input - Reconstruction"), PARAMETER_OUTPUT);
+	Parameters.Add_Value (Parameters ("SHIFT"), "SHIFT_VALUE", _TL ("Shift value"), _TL ("Shift value"), PARAMETER_TYPE_Double, 5);
+	Parameters.Add_Value (NULL, "BORDER_YES_NO", _TL ("Preserve 1px border Yes/No"), _TL ("Preserve 1px border Yes/No"), PARAMETER_TYPE_Bool, true);
+	pNode = Parameters.Add_Value (NULL, "BIN_YES_NO", _TL ("Create a binary mask Yes/No"), _TL ("Create a binary mask Yes/No"), PARAMETER_TYPE_Bool, true);
+	Parameters.Add_Value (pNode, "THRESHOLD", _TL ("Threshold"), _TL ("Threshold"), PARAMETER_TYPE_Double, 1);
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+bool CGeomrec::On_Execute(void)
+{
+	CSG_Grid *pinpgrid, *bingrid, *poutgrid;
+
+
+	unsigned short numrows;
+	unsigned short numcols;
+	double **mask;
+	double **marker;
+
+
+	double h, t;
+	bool pborder, bin;
+
+	pinpgrid = Parameters ("INPUT_GRID")->asGrid ();
+	bingrid = Parameters ("OBJECT_GRID")->asGrid();
+	poutgrid = Parameters ("DIFFERENCE_GRID")->asGrid ();
+
+	h = Parameters ("SHIFT_VALUE")->asDouble ();
+	t = Parameters ("THRESHOLD")->asDouble ();
+	pborder = Parameters ("BORDER_YES_NO")->asBool ();
+	bin = Parameters ("BIN_YES_NO")->asBool ();
+
+	numcols = Get_NY();
+	numrows = Get_NX();
+
+	mask = (double **) matrix_all_alloc (numrows, numcols, 'D', 0);
+	marker = (double **) matrix_all_alloc (numrows, numcols, 'D', 0);
+
+	for (int y = 0; y < Get_NY () && Set_Progress(y, Get_NY()); y++)
+	{
+		#pragma omp parallel for
+       for (int x = 0; x < Get_NX (); x++)
+       {
+		  if (pinpgrid->is_NoData(x,y)) // check if there are no_data in input datasets
+		  {
+		 	 mask [x][y] = 0;
+		 	 marker [x][y] = 0;
+		  }
+		  else if ((pborder) && ((x==0)||(y==0)||(x==Get_NX()-1)||(y==Get_NY()-1)))
+   		  {
+			 mask [x][y] = pinpgrid->asDouble(x,y);
+			 marker [x][y] = pinpgrid->asDouble(x,y);
+		  }
+		  else
+		  {
+			 mask [x][y] = pinpgrid->asDouble(x,y);
+			 marker [x][y] = pinpgrid->asDouble(x,y) - h;
+		  }
+       }
+	}
+
+   geodesic_morphological_reconstruction (numrows, numcols, mask, marker);
+
+   for (int y = 0; y < Get_NY () && Set_Progress(y, Get_NY()); y++)
+   {
+	  #pragma omp parallel for
+	  for (int x = 0; x < Get_NX (); x++)
+	  {
+		 if (pinpgrid->is_NoData(x,y))
+		    poutgrid->Set_NoData(x,y);
+		 else
+		    poutgrid->Set_Value(x,y, mask[x][y]-marker[x][y]);
+	  }
+   }
+
+   if (bin)
+   {
+	   for (int y = 0; y < Get_NY () && Set_Progress(y, Get_NY()); y++)
+			#pragma omp parallel for
+			for (int x = 0; x < Get_NX (); x++)
+				if ((mask[x][y]-marker[x][y])>t)
+						bingrid->Set_Value(x, y, 1);
+					else
+						bingrid->Set_Value(x, y, 0);
+   }
+
+   matrix_all_free ((void **) mask);
+   matrix_all_free ((void **) marker);
+
+   return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_filter/geomrec.h b/src/modules/grid/grid_filter/geomrec.h
new file mode 100644
index 0000000..bcc664a
--- /dev/null
+++ b/src/modules/grid/grid_filter/geomrec.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * Version $Id: geomrec.h 1936 2014-01-11 14:07:20Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       geomrec.h                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     johannes.engels at hft-stuttgart.de       //
+//                                                       //
+//    contact:    Johannes Engels                        //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                70174 Stuttgart                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Geomrec_H
+#define HEADER_INCLUDED__Geomrec_H
+
+//---------------------------------------------------------
+
+
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGeomrec : public CSG_Module_Grid
+{
+public:
+	CGeomrec (void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+	int						m_Radius, m_Threshold;
+
+	CSG_Grid				m_Kernel, *m_pInput;
+
+
+	bool					Get_Range		(int x, int y, double &Minimum, double &Maximum);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__LDi_H
diff --git a/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp b/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp
index 1e9c700..25b8268 100644
--- a/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_NaturalNeighbour.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Interpolation_NaturalNeighbour.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -135,9 +135,9 @@ bool CInterpolation_NaturalNeighbour::Interpolate(void)
 	delaunay	*pTIN	= delaunay_build(n, pSrc, 0, NULL, 0, NULL);
 
 	//-----------------------------------------------------
-	double	*xDst	= (double *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(double));
-	double	*yDst	= (double *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(double));
-	double	*zDst	= (double *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(double));
+	double	*xDst	= (double *)SG_Malloc(m_pGrid->Get_NCells() * sizeof(double));
+	double	*yDst	= (double *)SG_Malloc(m_pGrid->Get_NCells() * sizeof(double));
+	double	*zDst	= (double *)SG_Malloc(m_pGrid->Get_NCells() * sizeof(double));
 
 	for(y=0, i=0, p.y=m_pGrid->Get_YMin(); y<m_pGrid->Get_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++, p.y+=m_pGrid->Get_Cellsize())
 	{
diff --git a/src/modules/grid/grid_gridding/Makefile.in b/src/modules/grid/grid_gridding/Makefile.in
index 8a9cd21..61d5e0a 100644
--- a/src/modules/grid/grid_gridding/Makefile.in
+++ b/src/modules/grid/grid_gridding/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_gridding
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_gridding_la_DEPENDENCIES =  \
@@ -109,6 +132,11 @@ CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_gridding_la_SOURCES)
 DIST_SOURCES = $(libgrid_gridding_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -134,6 +162,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -161,6 +190,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -173,6 +203,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -202,6 +233,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -235,7 +267,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -343,7 +374,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -351,6 +381,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -366,13 +398,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_gridding.la: $(libgrid_gridding_la_OBJECTS) $(libgrid_gridding_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_gridding.la: $(libgrid_gridding_la_OBJECTS) $(libgrid_gridding_la_DEPENDENCIES) $(EXTRA_libgrid_gridding_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_gridding_la_OBJECTS) $(libgrid_gridding_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -554,6 +588,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -604,10 +652,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -693,18 +746,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp b/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp
index b2ea8d5..b04d87d 100644
--- a/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_CSA.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Gridding_Spline_CSA.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -217,7 +217,7 @@ bool CGridding_Spline_CSA::On_Execute(void)
 	m_Points.Clear();
 
 	//-----------------------------------------------------
-	point	*pDst	= (point *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(point));
+	point	*pDst	= (point *)SG_Malloc(m_pGrid->Get_NCells() * sizeof(point));
 
 	for(y=0, i=0, p.y=m_pGrid->Get_YMin(); y<m_pGrid->Get_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++, p.y+=m_pGrid->Get_Cellsize())
 	{
diff --git a/src/modules/grid/grid_spline/Makefile.in b/src/modules/grid/grid_spline/Makefile.in
index a26fab7..cced877 100644
--- a/src/modules/grid/grid_spline/Makefile.in
+++ b/src/modules/grid/grid_spline/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_spline
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_spline_la_DEPENDENCIES =  \
@@ -106,6 +129,11 @@ CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_spline_la_SOURCES)
 DIST_SOURCES = $(libgrid_spline_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -131,6 +159,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -158,6 +187,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -170,6 +200,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -199,6 +230,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -232,7 +264,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -322,7 +353,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -330,6 +360,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -345,13 +377,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_spline.la: $(libgrid_spline_la_OBJECTS) $(libgrid_spline_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_spline.la: $(libgrid_spline_la_OBJECTS) $(libgrid_spline_la_DEPENDENCIES) $(EXTRA_libgrid_spline_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_spline_la_OBJECTS) $(libgrid_spline_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -468,6 +502,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -518,10 +566,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -607,18 +660,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_tools/Grid_Buffer.cpp b/src/modules/grid/grid_tools/Grid_Buffer.cpp
index 8a3bc54..4b72b31 100644
--- a/src/modules/grid/grid_tools/Grid_Buffer.cpp
+++ b/src/modules/grid/grid_tools/Grid_Buffer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Buffer.cpp 1586 2013-01-16 09:28:07Z reklov_w $
+ * Version $Id: Grid_Buffer.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Buffer.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 #include "Grid_Buffer.h"
diff --git a/src/modules/grid/grid_tools/Grid_Buffer.h b/src/modules/grid/grid_tools/Grid_Buffer.h
index 2a21ec7..0246d8f 100644
--- a/src/modules/grid/grid_tools/Grid_Buffer.h
+++ b/src/modules/grid/grid_tools/Grid_Buffer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Buffer.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_Buffer.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Buffer.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 //---------------------------------------------------------
 #ifndef HEADER_INCLUDED__Grid_Buffer_H
diff --git a/src/modules/grid/grid_tools/Grid_CombineGrids.cpp b/src/modules/grid/grid_tools/Grid_CombineGrids.cpp
index 4a9e2b6..c6f8b9d 100644
--- a/src/modules/grid/grid_tools/Grid_CombineGrids.cpp
+++ b/src/modules/grid/grid_tools/Grid_CombineGrids.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CombineGrids.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_CombineGrids.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CombineGrids.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Grid_CombineGrids.h"
diff --git a/src/modules/grid/grid_tools/Grid_CombineGrids.h b/src/modules/grid/grid_tools/Grid_CombineGrids.h
index 68f7350..24c5c01 100644
--- a/src/modules/grid/grid_tools/Grid_CombineGrids.h
+++ b/src/modules/grid/grid_tools/Grid_CombineGrids.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CombineGrids.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_CombineGrids.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CombineGrids.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp b/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp
index e084d78..79c8d2f 100644
--- a/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp
+++ b/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ConstantGrid.cpp 1688 2013-05-14 11:40:29Z oconrad $
+ * Version $Id: Grid_ConstantGrid.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     ConstantGrid.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_ConstantGrid.h b/src/modules/grid/grid_tools/Grid_ConstantGrid.h
index e894ad6..3eeb219 100644
--- a/src/modules/grid/grid_tools/Grid_ConstantGrid.h
+++ b/src/modules/grid/grid_tools/Grid_ConstantGrid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ConstantGrid.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_ConstantGrid.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_ConstantGrid.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 
diff --git a/src/modules/grid/grid_tools/Grid_CropToData.cpp b/src/modules/grid/grid_tools/Grid_CropToData.cpp
index dee2238..c9ddac6 100644
--- a/src/modules/grid/grid_tools/Grid_CropToData.cpp
+++ b/src/modules/grid/grid_tools/Grid_CropToData.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CropToData.cpp 1149 2011-08-29 12:26:13Z oconrad $
+ * Version $Id: Grid_CropToData.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CropToData.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 
diff --git a/src/modules/grid/grid_tools/Grid_CropToData.h b/src/modules/grid/grid_tools/Grid_CropToData.h
index 1c3bb77..b2d2a9c 100644
--- a/src/modules/grid/grid_tools/Grid_CropToData.h
+++ b/src/modules/grid/grid_tools/Grid_CropToData.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CropToData.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_CropToData.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CropToData.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Cut.cpp b/src/modules/grid/grid_tools/Grid_Cut.cpp
index dca65f2..2b01da9 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Cut.cpp 2097 2014-04-11 12:50:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -316,10 +316,11 @@ CGrid_Clip::CGrid_Clip(void)
 	pNode	= Parameters.Add_Choice(
 		NULL	, "EXTENT"		, _TL("Extent"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
 			_TL("user defined"),
 			_TL("grid system"),
-			_TL("shapes extent")
+			_TL("shapes extent"),
+			_TL("polygon")
 		), 0
 	);
 
@@ -334,12 +335,24 @@ CGrid_Clip::CGrid_Clip(void)
 		PARAMETER_INPUT
 	);
 
+	Parameters.Add_Shapes(
+		pNode	, "POLYGONS"	, _TL("Polygon"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	);
+
 	Parameters.Add_Value(pNode, "XMIN", _TL("Left"   ), _TL(""), PARAMETER_TYPE_Double);
 	Parameters.Add_Value(pNode, "XMAX", _TL("Right"  ), _TL(""), PARAMETER_TYPE_Double);
 	Parameters.Add_Value(pNode, "YMIN", _TL("Bottom" ), _TL(""), PARAMETER_TYPE_Double);
 	Parameters.Add_Value(pNode, "YMAX", _TL("Top"    ), _TL(""), PARAMETER_TYPE_Double);
 	Parameters.Add_Value(pNode, "NX"  , _TL("Columns"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true);
 	Parameters.Add_Value(pNode, "NY"  , _TL("Rows"   ), _TL(""), PARAMETER_TYPE_Int, 1, 1, true);
+
+	Parameters.Add_Value(
+		NULL	, "BUFFER"		, _TL("Buffer"),
+		_TL("add buffer (map units) to extent"),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
 }
 
 
@@ -378,6 +391,8 @@ int CGrid_Clip::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter
 		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
 	}
 
 	return( 1 );
@@ -391,28 +406,39 @@ int CGrid_Clip::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter
 //---------------------------------------------------------
 bool CGrid_Clip::On_Execute(void)
 {
-	CSG_Grid_System	System;
-	
+	//--------------------------------------------------------
+	CSG_Rect	Extent;
+
 	switch( Parameters("EXTENT")->asInt() )
 	{
 	case 0:	// user defined
-		System	= Fit_Extent(*Get_System(), CSG_Rect(
-			Parameters("XMIN")->asDouble(),
-			Parameters("YMIN")->asDouble(),
-			Parameters("XMAX")->asDouble(),
-			Parameters("YMAX")->asDouble()
-		));
+		Extent.Assign(
+			Parameters("XMIN")->asDouble(), Parameters("YMIN")->asDouble(),
+			Parameters("XMAX")->asDouble(), Parameters("YMAX")->asDouble()
+		);
 		break;
 
 	case 1: // grid system
-		System	= Fit_Extent(*Get_System(), Parameters("GRIDSYSTEM")->asGrid_System()->Get_Extent());
+		Extent.Assign(Parameters("GRIDSYSTEM")->asGrid_System()->Get_Extent());
 		break;
 
 	case 2:	// shapes extent
-		System	= Fit_Extent(*Get_System(), Parameters("SHAPES")->asShapes()->Get_Extent());
+		Extent.Assign(Parameters("SHAPES"  )->asShapes()->Get_Extent());
+		break;
+
+	case 3:	// polygon
+		Extent.Assign(Parameters("POLYGONS")->asShapes()->Get_Extent());
 		break;
 	}
 
+	if( Parameters("BUFFER")->asDouble() > 0.0 && Parameters("EXTENT")->asInt() != 3 )	// no buffering for polygon clip
+	{
+		Extent.Inflate(Parameters("BUFFER")->asDouble(), false);
+	}
+
+	//--------------------------------------------------------
+	CSG_Grid_System	System	= Fit_Extent(*Get_System(), Extent);
+
 	if( !System.is_Valid() )
 	{
 		Error_Set(_TL("clip extent does not match grid's extent"));
@@ -421,6 +447,16 @@ bool CGrid_Clip::On_Execute(void)
 	}
 
 	//--------------------------------------------------------
+	CSG_Grid	Mask;
+	
+	if( Parameters("EXTENT")->asInt() == 3 && !Get_Mask(Mask, System, Parameters("POLYGONS")->asShapes()) )
+	{
+		Error_Set(_TL("failed to create polygon clipping mask"));
+
+		return( false );
+	}
+
+	//--------------------------------------------------------
 	CSG_Parameter_Grid_List	*pInput		= Parameters("GRIDS"  )->asGridList();
 	CSG_Parameter_Grid_List	*pOutput	= Parameters("CLIPPED")->asGridList();
 
@@ -431,10 +467,118 @@ bool CGrid_Clip::On_Execute(void)
 		pClip->Assign  (pInput->asGrid(i), GRID_INTERPOLATION_NearestNeighbour);
 		pClip->Set_Name(pInput->asGrid(i)->Get_Name());
 
+		if( Mask.is_Valid() ) // && Parameters("EXTENT")->asInt() == 3 )	// polygon clip
+		{
+			for(int y=0; y<System.Get_NY() && Set_Progress(y, System.Get_NY()); y++)
+			{
+				#pragma omp parallel for
+				for(int x=0; x<System.Get_NX(); x++)
+				{
+					if( Mask.is_NoData(x, y) )
+					{
+						pClip->Set_NoData(x, y);
+					}
+				}
+			}
+		}
+
 		pOutput->Add_Item(pClip);
-		DataObject_Add   (pClip);
 	}
 
+	//--------------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Clip::Get_Mask(CSG_Grid &Mask, CSG_Grid_System &System, CSG_Shapes *pPolygons)
+{
+	//-----------------------------------------------------
+	if( !Mask.Create(System, SG_DATATYPE_Char) )
+	{
+		return( false );
+	}
+
+	Mask.Set_NoData_Value(0);
+
+	//-----------------------------------------------------
+	for(int i=0; i<pPolygons->Get_Count() && Set_Progress(i, pPolygons->Get_Count()); i++)
+	{
+		CSG_Shape	*pPolygon	= pPolygons->Get_Shape(i);
+
+        if( pPolygons->Get_Selection_Count() > 0 && !pPolygon->is_Selected() )
+		{
+			continue;
+		}
+
+		int	xA	= System.Get_xWorld_to_Grid(pPolygon->Get_Extent().Get_XMin()) - 1; if( xA <  0               ) xA = 0;
+		int	xB	= System.Get_xWorld_to_Grid(pPolygon->Get_Extent().Get_XMax()) + 1; if( xB >= System.Get_NX() ) xB = System.Get_NX() - 1;
+
+		//-------------------------------------------------
+		#pragma omp parallel for
+		for(int y=0; y<System.Get_NY(); y++)
+		{
+			double	yRow	= System.Get_yGrid_to_World(y);
+
+			if( yRow >= pPolygon->Get_Extent().Get_YMin()
+			&&  yRow <= pPolygon->Get_Extent().Get_YMax() )
+			{
+				TSG_Point	Row[2];
+
+				Row[0].x	= System.Get_XMin(true) - 1.0;
+				Row[1].x	= System.Get_XMax(true) + 1.0;
+				Row[0].y	= Row[1].y	= yRow;
+
+				//-----------------------------------------
+				int	*nCrossings	= (int *)SG_Calloc(System.Get_NX(), sizeof(int));
+
+				for(int iPart=0; iPart<pPolygon->Get_Part_Count(); iPart++)
+				{
+					TSG_Point	C, A, B	= pPolygon->Get_Point(0, iPart, false);	// last point
+
+					for(int iPoint=0; iPoint<pPolygon->Get_Point_Count(iPart); iPoint++)
+					{
+						A	= B;	B	= pPolygon->Get_Point(iPoint, iPart, true);
+
+						if( (A.y <= yRow && yRow <  B.y)
+						||  (A.y >  yRow && yRow >= B.y) )
+						{
+							SG_Get_Crossing(C, A, B, Row[0], Row[1], false);
+
+							int x	= System.Get_xWorld_to_Grid(C.x);	if( x < 0 )	x	= 0;
+
+							if( x >= 0 && x < System.Get_NX() )
+							{
+								nCrossings[x]	= nCrossings[x] ? 0 : 1;
+							}
+						}
+					}
+				}
+
+				//-----------------------------------------
+				for(int x=xA, Fill=0; x<=xB; x++)
+				{
+					if( nCrossings[x] )
+					{
+						Fill	= Fill ? 0 : 1;
+					}
+
+					if( Fill )
+					{
+						Mask.Set_Value(x, y, 1);
+					}
+				}
+
+				SG_Free(nCrossings);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
 	return( true );
 }
 
diff --git a/src/modules/grid/grid_tools/Grid_Cut.h b/src/modules/grid/grid_tools/Grid_Cut.h
index 0ba9f30..33265c8 100644
--- a/src/modules/grid/grid_tools/Grid_Cut.h
+++ b/src/modules/grid/grid_tools/Grid_Cut.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Cut.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Cut.h 2097 2014-04-11 12:50:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -133,6 +133,8 @@ protected:
 
 private:
 
+	bool						Get_Mask				(CSG_Grid &Mask, CSG_Grid_System &System, CSG_Shapes *pPolygons);
+
 };
 
 
diff --git a/src/modules/grid/grid_tools/Grid_InvertNoData.cpp b/src/modules/grid/grid_tools/Grid_InvertNoData.cpp
index f035d1c..1c3554f 100644
--- a/src/modules/grid/grid_tools/Grid_InvertNoData.cpp
+++ b/src/modules/grid/grid_tools/Grid_InvertNoData.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_InvertNoData.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_InvertNoData.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     InvertNoData.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Grid_InvertNoData.h"
diff --git a/src/modules/grid/grid_tools/Grid_InvertNoData.h b/src/modules/grid/grid_tools/Grid_InvertNoData.h
index 4230b89..3ecde70 100644
--- a/src/modules/grid/grid_tools/Grid_InvertNoData.h
+++ b/src/modules/grid/grid_tools/Grid_InvertNoData.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_InvertNoData.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_InvertNoData.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     InvertNoData.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #include "MLB_Interface.h"
 
diff --git a/src/modules/grid/grid_tools/Grid_Merge.cpp b/src/modules/grid/grid_tools/Grid_Merge.cpp
index 658b0e7..c0689c6 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Merge.cpp 1954 2014-01-22 14:20:41Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -137,6 +137,16 @@ CGrid_Merge::CGrid_Merge(void)
 		PARAMETER_TYPE_Double, 10.0, 0.0, true
 	);
 
+	Parameters.Add_Choice(
+		NULL	, "MATCH"		, _TL("Match"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("none"),
+			_TL("regression"),
+			_TL("histogram match")
+		), 0
+	);
+
 	//-----------------------------------------------------
 	Parameters.Add_Choice(
 		NULL	, "TARGET"		, _TL("Target Grid"),
@@ -202,6 +212,8 @@ bool CGrid_Merge::On_Execute(void)
 		{
 		}
 
+		Get_Match(i > 0 ? pGrid : NULL);
+
 		int	ax	= (int)((pGrid->Get_XMin() - m_pMosaic->Get_XMin()) / m_pMosaic->Get_Cellsize());
 		int	ay	= (int)((pGrid->Get_YMin() - m_pMosaic->Get_YMin()) / m_pMosaic->Get_Cellsize());
 
@@ -416,6 +428,11 @@ bool CGrid_Merge::is_Aligned(CSG_Grid *pGrid)
 //---------------------------------------------------------
 inline void CGrid_Merge::Set_Value(int x, int y, double Value, double Weight)
 {
+	if( m_Match.Get_N() == 2 )
+	{
+		Value	= m_Match[0] + m_Match[1] * Value;
+	}
+
 	switch( m_Overlap )
 	{
 	case 0:	// first
@@ -652,3 +669,63 @@ bool CGrid_Merge::Set_Weight(CSG_Grid *pGrid)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CGrid_Merge::Get_Match(CSG_Grid *pGrid)
+{
+	if( pGrid && Parameters("MATCH")->asInt() )
+	{
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %s"), _TL("matching histogram"), pGrid->Get_Name()));
+
+		int	ax	= (int)((pGrid->Get_XMin() - m_pMosaic->Get_XMin()) / m_pMosaic->Get_Cellsize());	if( ax < 0 )	ax	= 0;
+		int	ay	= (int)((pGrid->Get_YMin() - m_pMosaic->Get_YMin()) / m_pMosaic->Get_Cellsize());	if( ay < 0 )	ay	= 0;
+
+		int	nx	= 1 + m_pMosaic->Get_System().Get_xWorld_to_Grid(pGrid->Get_XMax()); if( nx > m_pMosaic->Get_NX() )	nx	= m_pMosaic->Get_NX();
+		int	ny	= 1 + m_pMosaic->Get_System().Get_yWorld_to_Grid(pGrid->Get_YMax()); if( ny > m_pMosaic->Get_NY() )	ny	= m_pMosaic->Get_NY();
+
+		CSG_Vector	Z[2];
+
+		for(int y=ay; y<ny && Set_Progress(y-ay, ny-ay); y++)
+		{
+			double	py	= m_pMosaic->Get_YMin() + y * m_pMosaic->Get_Cellsize();
+
+			for(int x=ax; x<nx; x++)
+			{
+				if( !m_pMosaic->is_NoData(x, y) )
+				{
+					double	z, px	= m_pMosaic->Get_XMin() + x * m_pMosaic->Get_Cellsize();
+
+					if( pGrid->Get_Value(px, py, z, GRID_INTERPOLATION_NearestNeighbour) )
+					{
+						Z[0].Add_Row(z);
+						Z[1].Add_Row(m_pMosaic->asDouble(x, y));
+					}
+				}
+			}
+		}
+
+		CSG_Regression	r;
+
+		if( r.Calculate(Z[0].Get_Size(), Z[0].Get_Data(), Z[1].Get_Data()) )
+		{
+			m_Match.Create(2);
+
+			m_Match[0]	= r.Get_Constant();
+			m_Match[1]	= r.Get_Coefficient();
+
+			Message_Add("histogram stretch:\n", false);
+			Message_Add(r.asString(), false);
+
+			return;
+		}
+	}
+
+	m_Match.Destroy();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_tools/Grid_Merge.h b/src/modules/grid/grid_tools/Grid_Merge.h
index 3787855..49e7169 100644
--- a/src/modules/grid/grid_tools/Grid_Merge.h
+++ b/src/modules/grid/grid_tools/Grid_Merge.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Merge.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Merge.h 1954 2014-01-22 14:20:41Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -97,6 +97,8 @@ private:
 
 	double						m_dBlend;
 
+	CSG_Vector					m_Match;
+
 	CSG_Grid					*m_pMosaic, m_Weights, m_Weight;
 
 	CSG_Parameter_Grid_List		*m_pGrids;
@@ -114,6 +116,8 @@ private:
 	bool						Set_Weight				(CSG_Grid *pGrid);
 	double						Get_Weight				(int x, int y);
 
+	void						Get_Match				(CSG_Grid *pGrid);
+
 };
 
 
diff --git a/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp b/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp
index eadb24f..5999e1f 100644
--- a/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp
+++ b/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Shrink_Expand.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Shrink_Expand.cpp 1992 2014-02-13 12:30:26Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -70,14 +70,28 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+enum
+{
+	EXPAND_MIN		= 0,
+	EXPAND_MAX,
+	EXPAND_MEAN,
+	EXPAND_MAJORITY
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 CGrid_Shrink_Expand::CGrid_Shrink_Expand(void)
 {
 	//-----------------------------------------------------
-	// 1. Info...
-
 	Set_Name		(_TL("Shrink and Expand"));
 
-	Set_Author		(SG_T("V.Wichmann & O.Conrad (c) 2011"));
+	Set_Author		("V.Wichmann & O.Conrad (c) 2011");
 
 	Set_Description	(_TW(
 		"Regions with valid data in the input grid can be shrinked or expanded by a certain amount (radius). "
@@ -86,10 +100,7 @@ CGrid_Shrink_Expand::CGrid_Shrink_Expand(void)
 		"selected (min, max, mean, majority).\n\n"
 	));
 
-
 	//-----------------------------------------------------
-	// 2. Parameters...
-
 	Parameters.Add_Grid(
 		NULL, "INPUT"		, _TL("Grid"),
 		_TL(""),
@@ -105,14 +116,16 @@ CGrid_Shrink_Expand::CGrid_Shrink_Expand(void)
 	Parameters.Add_Choice(
 		NULL, "OPERATION"		, _TL("Operation"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Shrink"),
-			_TL("Expand")
-		), 1
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("shrink"),
+			_TL("expand"),
+			_TL("shrink and expand"),
+			_TL("expand and shrink")
+		), 3
 	);
 
 	Parameters.Add_Choice(
-		NULL, "MODE"		, _TL("Search Mode"),
+		NULL, "CIRCLE"		, _TL("Search Mode"),
 		_TL(""),
 		CSG_String::Format(SG_T("%s|%s|"),
 			_TL("Square"),
@@ -126,188 +139,119 @@ CGrid_Shrink_Expand::CGrid_Shrink_Expand(void)
 		PARAMETER_TYPE_Int, 1, 1, true
 	);
 
-	CSG_String	choices;
-		
-	for (int i=0; i<METHOD_KEY_Count; i++)
-		choices += CSG_String::Format(SG_T("%s|"), gSG_Method_Key_Names[i]);
-
 	Parameters.Add_Choice(
-		NULL, "METHOD_EXPAND"	, _TL("Method"),
+		NULL, "EXPAND"		, _TL("Method"),
 		_TL(""),
-		choices
-		, 0
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("minimum"),
+			_TL("maximum"),
+			_TL("mean"),
+			_TL("majority")
+		), 3
 	);
-
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CGrid_Shrink_Expand::On_Execute(void)
+int CGrid_Shrink_Expand::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	int						x, y, ix, iy;
-	int						operation, methodExpand;
-	CSG_Grid				*pResult;
-	CSG_Simple_Statistics	Statistics;
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OPERATION")) )
+	{
+		pParameters->Get_Parameter("EXPAND")->Set_Enabled(pParameter->asInt() > 0);
+	}
 
-	//-----------------------------------------------------
-	m_pInput		= Parameters("INPUT")		->asGrid();
-	pResult			= Parameters("RESULT")		->asGrid();
-	m_Radius		= Parameters("RADIUS")		->asInt();
-	operation		= Parameters("OPERATION")	->asInt();
-	methodExpand	= Parameters("METHOD_EXPAND")->asInt();
+	return (1);
+}
 
-	//-----------------------------------------------------
-	m_Kernel.Create(SG_DATATYPE_Byte, 1 + 2 * m_Radius, 1 + 2 * m_Radius);
-	m_Kernel.Set_NoData_Value(0.0);
-	m_Kernel.Assign(1.0);
-	m_Kernel.Set_Value(m_Radius, m_Radius, 0.0);
 
-	if( Parameters("MODE")->asInt() == 1 )
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Shrink_Expand::On_Execute(void)
+{
+	//-----------------------------------------------------
+	if( !m_Kernel.Set_Radius(Parameters("RADIUS")->asInt(), Parameters("CIRCLE")->asInt() == 0) )
 	{
-		for(y=-m_Radius, iy=0; y<=m_Radius; y++, iy++)
-		{
-			for(x=-m_Radius, ix=0; x<=m_Radius; x++, ix++)
-			{
-				if( x*x + y*y > m_Radius*m_Radius )
-				{
-					m_Kernel.Set_Value(ix, iy, 0.0);
-				}
-			}
-		}
+		Error_Set(_TL("could not initialize search kernel"));
+
+		return( false );
 	}
 
 	//-----------------------------------------------------
+	CSG_Grid	*pResult, Result;
+
+	m_pInput	= Parameters("INPUT" )->asGrid();
+	pResult		= Parameters("RESULT")->asGrid();
+
 	if( !pResult || pResult == m_pInput )
 	{
-		pResult	= SG_Create_Grid(m_pInput);
-	}
-	else
-	{
-		if( operation == 0 )
-			pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Shrink")));
-		else
-			pResult->Set_Name(CSG_String::Format(SG_T("%s [%s %s]"), m_pInput->Get_Name(), _TL("Expand"), gSG_Method_Key_Names[Parameters("METHOD_EXPAND")->asInt()]));
+		Result.Create(m_pInput);
 
-		pResult->Set_NoData_Value(m_pInput->Get_NoData_Value());
+		pResult	= &Result;
 	}
 
-	pResult->Assign_NoData();
-
 	//-----------------------------------------------------
-	if( operation == 0 )	// shrink
+	CSG_String	Name(m_pInput->Get_Name());
+
+	switch( Parameters("OPERATION")->asInt() )
 	{
-		for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	case 0:	// shrink
 		{
-			for(x=0; x<Get_NX(); x++)
-			{
-				if( m_pInput->is_NoData(x, y) )
-					continue;
-				else
-				{
-					bool	bShrink = false;
-
-					for(int iy=0, jy=y-m_Radius; iy<m_Kernel.Get_NY(); iy++, jy++)
-					{
-						for(int ix=0, jx=x-m_Radius; ix<m_Kernel.Get_NX(); ix++, jx++)
-						{
-							if( m_Kernel.asByte(ix, iy) && m_pInput->is_InGrid(jx, jy, false) )
-							{
-								if( m_pInput->is_NoData(jx, jy) )
-								{
-									bShrink = true;
-									break;
-								}
-							}
-						}
-
-						if( bShrink )
-							break;
-					}
-
-					if( bShrink )
-						pResult->Set_NoData(x, y);
-					else
-						pResult->Set_Value(x, y, m_pInput->asDouble(x, y));
-				}
-			}
+			Do_Shrink(pResult);
+
+			pResult->Set_Name(Name + " [" + _TL("Shrink") + "]");
 		}
-	}
-	else	// expand
-	{
-		for(y=0; y<Get_NY() && Set_Progress(y); y++)
+		break;
+
+	case 1:	// expand
 		{
-			for(x=0; x<Get_NX(); x++)
-			{
-				if( !m_pInput->is_NoData(x, y) )
-				{
-					pResult->Set_Value(x, y, m_pInput->asDouble(x, y));
-					continue;
-				}
-				else
-				{
-					if(	methodExpand == METHOD_KEY_MIN || methodExpand == METHOD_KEY_MAX || methodExpand == METHOD_KEY_MEAN )
-					{
-						Statistics.Invalidate();
-
-						for(int iy=0, jy=y-m_Radius; iy<m_Kernel.Get_NY(); iy++, jy++)
-						{
-							for(int ix=0, jx=x-m_Radius; ix<m_Kernel.Get_NX(); ix++, jx++)
-							{
-								if( m_Kernel.asByte(ix, iy) && m_pInput->is_InGrid(jx, jy, false) )
-								{
-									if( !m_pInput->is_NoData(jx, jy) )
-										Statistics.Add_Value(m_pInput->asDouble(jx, jy));
-								}
-							}
-						}
-
-						if( Statistics.Get_Count() == 0 )
-						{
-							pResult->Set_NoData(x, y);
-							continue;
-						}
-					}
-
-			
-					switch( methodExpand )
-					{
-					default:
-						return( false );
-					case METHOD_KEY_MIN:
-						pResult->Set_Value(x, y, Statistics.Get_Minimum());
-						break;
-					case METHOD_KEY_MAX:
-						pResult->Set_Value(x, y, Statistics.Get_Maximum());
-						break;
-					case METHOD_KEY_MEAN:
-						pResult->Set_Value(x, y, Statistics.Get_Mean());
-						break;
-					case METHOD_KEY_MAJORITY:
-						m_Majority.Create();
-						pResult->Set_Value(x, y, Get_Majority(x, y));
-						m_Majority.Destroy();
-						break;
-					}
-				} // noData
-			} // for x
-		} // for y
-	} // method expand
+			Do_Expand(pResult);
+
+			pResult->Set_Name(Name + " [" + _TL("Expand") + "]");
+		}
+		break;
+
+	case 2:	// shrink and expand
+		{
+			CSG_Grid	TMP(pResult);
+
+			Do_Shrink(&TMP);
+
+			m_pInput	= &TMP;
+
+			Do_Expand(pResult);
+
+			pResult->Set_Name(Name + " [" + _TL("Shrink and Expand") + "]");
+		}
+		break;
+
+	case 3:	// expand and shrink
+		{
+			CSG_Grid	TMP(pResult);
+
+			Do_Expand(&TMP);
 
+			m_pInput	= &TMP;
+
+			Do_Shrink(pResult);
+
+			pResult->Set_Name(Name + " [" + _TL("Expand and Shrink") + "]");
+		}
+		break;
+	}
 
 	//-----------------------------------------------------
-	if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput )
+	if( pResult	== &Result )
 	{
-		m_pInput->Assign(pResult);
-
-		delete(pResult);
+		Parameters("INPUT")->asGrid()->Assign(pResult);
 
-		DataObject_Update(m_pInput);
+		DataObject_Update(Parameters("INPUT")->asGrid());
 	}
 
 	m_Kernel.Destroy();
@@ -316,49 +260,145 @@ bool CGrid_Shrink_Expand::On_Execute(void)
 }
 
 
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-int CGrid_Shrink_Expand::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+bool CGrid_Shrink_Expand::Do_Shrink(CSG_Grid *pResult)
 {
+	Process_Set_Text(CSG_String::Format(SG_T("%s..."), _TL("Shrink")));
 
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OPERATION")) )
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 	{
-		pParameters->Get_Parameter("METHOD_EXPAND")->Set_Enabled(pParameter->asInt() > 0);
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			bool	bShrink = m_pInput->is_NoData(x, y);
+
+			for(int i=0; !bShrink && i<m_Kernel.Get_Count(); i++)
+			{
+				int	ix	= m_Kernel.Get_X(i, x);
+				int	iy	= m_Kernel.Get_Y(i, y);
+
+				if( is_InGrid(ix, iy) && m_pInput->is_NoData(ix, iy) )
+				{
+					bShrink	= true;
+				}
+			}
+
+			if( bShrink )
+			{
+				pResult->Set_NoData(x, y);
+			}
+			else
+			{
+				pResult->Set_Value(x, y, m_pInput->asDouble(x, y));
+			}
+		}
 	}
 
-	//-----------------------------------------------------
-	return (1);
+	return( true );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Shrink_Expand::Do_Expand(CSG_Grid *pResult)
+{
+	Process_Set_Text(CSG_String::Format(SG_T("%s..."), _TL("Expand")));
+
+	int		Method	= Parameters("EXPAND")->asInt();
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	Value;
+
+			if( Get_Expand_Value(x, y, Method, Value) )
+			{
+				pResult->Set_Value(x, y, Value);
+			}
+			else
+			{
+				pResult->Set_NoData(x, y);
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-double CGrid_Shrink_Expand::Get_Majority(int x, int y)
+bool CGrid_Shrink_Expand::Get_Expand_Value(int x, int y, int Method, double &Value)
 {
-	m_Majority.Reset();
+	//-----------------------------------------------------
+	if( !m_pInput->is_NoData(x, y) )
+	{
+		Value	= m_pInput->asDouble(x, y);
+
+		return( true );
+	}
 
-	for(int iy=0, jy=y-m_Radius; iy<m_Kernel.Get_NY(); iy++, jy++)
+	//-----------------------------------------------------
+	if( Method == EXPAND_MAJORITY )
 	{
-		for(int ix=0, jx=x-m_Radius; ix<m_Kernel.Get_NX(); ix++, jx++)
+		CSG_Class_Statistics	Majority;
+
+		for(int i=0; i<m_Kernel.Get_Count(); i++)
 		{
-			if( m_Kernel.asByte(ix, iy) && m_pInput->is_InGrid(jx, jy) )
+			int	ix	= m_Kernel.Get_X(i, x);
+			int	iy	= m_Kernel.Get_Y(i, y);
+
+			if( m_pInput->is_InGrid(ix, iy) )
 			{
-				m_Majority.Add_Value(m_pInput->asDouble(jx, jy));
+				Majority.Add_Value(m_pInput->asDouble(ix, iy));
 			}
 		}
+
+		return( Majority.Get_Majority(Value) );
 	}
 
-	int		Count;
-	double	Value;
+	//-----------------------------------------------------
+	{
+		CSG_Simple_Statistics	Statistics;
+
+		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);
+
+			if( m_pInput->is_InGrid(ix, iy) )
+			{
+				Statistics.Add_Value(m_pInput->asDouble(ix, iy));
+			}
+		}
+
+		if( Statistics.Get_Count() > 0 )
+		{
+			switch( Method )
+			{
+			default:
+			case EXPAND_MEAN:	Value	= Statistics.Get_Mean   ();	break;
+			case EXPAND_MIN :	Value	= Statistics.Get_Minimum();	break;
+			case EXPAND_MAX :	Value	= Statistics.Get_Maximum();	break;
+			}
+
+			return( true );
+		}
+	}
 
-	if( m_Majority.Get_Majority(Value, Count) && Count > 0 )
-		return( Value );
-	else
-		return( m_pInput->Get_NoData_Value() );
+	return( false );
 }
 
 
diff --git a/src/modules/grid/grid_tools/Grid_Shrink_Expand.h b/src/modules/grid/grid_tools/Grid_Shrink_Expand.h
index 80d8076..25c147c 100644
--- a/src/modules/grid/grid_tools/Grid_Shrink_Expand.h
+++ b/src/modules/grid/grid_tools/Grid_Shrink_Expand.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Shrink_Expand.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Shrink_Expand.h 1992 2014-02-13 12:30:26Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -81,52 +81,34 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-typedef enum ESG_Method_Key
-{
-	METHOD_KEY_MIN		= 0,
-	METHOD_KEY_MAX,
-	METHOD_KEY_MEAN,
-	METHOD_KEY_MAJORITY,
-	METHOD_KEY_Count
-}
-TSG_Method_Key;
-
-//---------------------------------------------------------
-const SG_Char	gSG_Method_Key_Names[METHOD_KEY_Count][32]	=
-{
-	SG_T("min"),
-	SG_T("max"),
-	SG_T("mean"),
-	SG_T("majority")
-};
-
-
-//---------------------------------------------------------
 class CGrid_Shrink_Expand : public CSG_Module_Grid
 {
 public:
 	CGrid_Shrink_Expand(void);
 
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("A:Grid|Gaps") );	}
+	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("A:Grid|Gaps") );	}
 
 
 protected:
 
-	virtual bool			On_Execute		(void);
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
-	virtual int				On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual bool			On_Execute				(void);
 
 
 private:
 
-	int						m_Radius, m_Threshold;
+	int						m_Threshold;
+
+	CSG_Grid_Cell_Addressor	m_Kernel;
 
-	CSG_Grid				m_Kernel, *m_pInput;
+	CSG_Grid				*m_pInput;
 
-	CSG_Class_Statistics	m_Majority;
 
+	bool					Do_Shrink				(CSG_Grid *pResult);
+	bool					Do_Expand				(CSG_Grid *pResult);
 
-	double					Get_Majority	(int x, int y);
+	bool					Get_Expand_Value		(int x, int y, int Method, double &Value);
 
 };
 
diff --git a/src/modules/grid/grid_tools/Grid_SortRaster.cpp b/src/modules/grid/grid_tools/Grid_SortRaster.cpp
index 07b30f6..19cc3c5 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 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_SortRaster.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SortRaster.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Grid_SortRaster.h"
@@ -68,8 +68,10 @@ bool CSortRaster::On_Execute(void)
 
 	pIndex->Set_NoData_Value(0.0);
 
-	for(int i=0, Index=0, ix, iy; i<Get_NCells() && Set_Progress(i, Get_NCells()); i++)
+	for(sLong i=0, Index=0; i<Get_NCells() && Set_Progress(i, Get_NCells()); i++)
 	{
+		int	ix, iy;
+
 		pGrid->Get_Sorted(i, ix, iy, bDown, false);
 
 		if( pGrid->is_NoData(ix, iy) )
diff --git a/src/modules/grid/grid_tools/Grid_SortRaster.h b/src/modules/grid/grid_tools/Grid_SortRaster.h
index c58a311..921fd69 100644
--- a/src/modules/grid/grid_tools/Grid_SortRaster.h
+++ b/src/modules/grid/grid_tools/Grid_SortRaster.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_SortRaster.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_SortRaster.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SortRaster.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #include "MLB_Interface.h"
 
diff --git a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp
index 08387ce..261f414 100644
--- a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp
+++ b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ThresholdBuffer.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Grid_ThresholdBuffer.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     ThresholdBuffer.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 #include "Grid_ThresholdBuffer.h"
diff --git a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h
index 4ae9341..951ade0 100644
--- a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h
+++ b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ThresholdBuffer.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_ThresholdBuffer.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     ThresholdBuffer.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp b/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp
index dffa9df..4f91501 100644
--- a/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Reclassify.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Value_Reclassify.cpp 1984 2014-02-11 16:45:09Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -80,14 +80,20 @@ CGrid_Value_Reclassify::CGrid_Value_Reclassify(void)
 	Set_Author(_TL("Copyrights (c) 2005 by Volker Wichmann"));
 
 	Set_Description	(_TW(
-		"The module can be used to reclassify the values of a grid. It provides three different options: (a) "
-		"reclassification of single values, (b) reclassification of a range of values and (c) reclassification "
-		"of value ranges specified in a lookup table. In addition to theses methods, two special cases "
-		"(No-Data values and values not included in the reclassification setup) are supported. In mode (a) "
-		"and (b) the 'No-Data option' is evaluated before the method settings, in mode (c) the option is "
-		"evaluated only if the No-Data value ins't included in the lookup table. The 'other values' option "
-		"is always evaluated after checking the method settings. ")
-	);
+		"The module can be used to reclassify the values of a grid. It provides three different options:\n"
+		"(a) reclassification of single values\n"
+		"(b) reclassification of a range of values\n"
+		"(c) reclassification of value ranges specified in a lookup table\n\n"
+		"In addition to theses methods, two special cases (NoData values and values not included in the "
+		"reclassification setup) are supported.\n"
+		"With reclassification mode (a) and (b), the 'NoData option' is evaluated before the 'Method' "
+		"settings. In reclassification mode (c) the option is evaluated only if the NoData value is not "
+		"included in the lookup table.\n"
+		"The 'other values' option is always evaluated after checking the 'Method' settings.\n\n"
+		"The module allows to define the NoData value of the output grid (header): by default, the "
+		"output grid gets assigned the NoData value of the input grid. But it is also possible to "
+		"assign a user defined NoData value.\n\n"
+	));
 
 
 	//-----------------------------------------------------
@@ -236,6 +242,27 @@ CGrid_Value_Reclassify::CGrid_Value_Reclassify(void)
 	);
 
 	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL, "OPT_RESULT"			, _TL("NoData Output Grid"),
+		_TL("Parameter settings for the NoData value of the output grid (header).")
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "RESULT_NODATA_CHOICE"	, _TL("Assign ..."),
+		_TL("Choose how to handle the NoData value of the output grid."),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("NoData value of input grid"),
+			_TL("user defined NoData value")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		Parameters("RESULT_NODATA_CHOICE")	, "RESULT_NODATA_VALUE"		, _TL("NoData Value"),
+		_TL("User defined NoData value for output grid."),
+		PARAMETER_TYPE_Double, -99999
+	);
+
+	//-----------------------------------------------------
 	CSG_Table			*pLookup;
 	CSG_Table_Record	*pRecord;
 
@@ -283,8 +310,17 @@ bool CGrid_Value_Reclassify::On_Execute(void)
 	//-----------------------------------------------------
 	if( bSuccess )
 	{
-	    pResult->Set_NoData_Value(pInput->Get_NoData_Value());
+		if( Parameters("RESULT_NODATA_CHOICE") == 0 )
+		{
+			pResult->Set_NoData_Value(pInput->Get_NoData_Value());
+		}
+		else
+		{
+			pResult->Set_NoData_Value(Parameters("RESULT_NODATA_VALUE")->asDouble());
+		}
+
 	    pResult->Set_Name(CSG_String::Format(SG_T("%s_reclassified"), pInput->Get_Name()));
+
 	    return( true );
 	}
 	else
@@ -615,6 +651,11 @@ int CGrid_Value_Reclassify::On_Parameters_Enable(CSG_Parameters *pParameters, CS
 		pParameters->Get_Parameter("OTHERS"		)->Set_Enabled(pParameter->asInt() > 0);
 	}
 
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("RESULT_NODATA_CHOICE")) )
+	{
+		pParameters->Get_Parameter("RESULT_NODATA_VALUE")->Set_Enabled(pParameter->asInt() > 0);
+	}
+	
 	//-----------------------------------------------------
 	return (1);
 }
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 ecee68a..1ad2287 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 1850 2013-09-30 09:11:04Z reklov_w $
+ * Version $Id: Grid_Value_Replace_Interactive.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Value_Replace_Interactive.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "Grid_Value_Replace_Interactive.h"
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 c33c2b2..5b1ee54 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 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: Grid_Value_Replace_Interactive.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Grid_Value_Replace_Interactive.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 //---------------------------------------------------------
diff --git a/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp b/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp
index 67f4052..825d496 100644
--- a/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp
+++ b/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GridsFromTableAndGrid.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: GridsFromTableAndGrid.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     GridsFromTableAndGrid.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
@@ -82,7 +82,7 @@ CGridsFromTableAndGrid::CGridsFromTableAndGrid(void)
 bool CGridsFromTableAndGrid::On_Execute(void)
 {
 	int						iField, iRecord, iAttribute, nAttributes, *Attribute;
-	long					iCell, jCell;
+	sLong					iCell, jCell;
 	CSG_Parameter_Grid_List	*pGrids;
 	CSG_Grid				*pClasses;
 	CSG_Table				*pTable;
diff --git a/src/modules/grid/grid_tools/GridsFromTableAndGrid.h b/src/modules/grid/grid_tools/GridsFromTableAndGrid.h
index 7ec14c6..bdfbcd1 100644
--- a/src/modules/grid/grid_tools/GridsFromTableAndGrid.h
+++ b/src/modules/grid/grid_tools/GridsFromTableAndGrid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GridsFromTableAndGrid.h 1891 2013-12-04 17:50:43Z oconrad $
+ * Version $Id: GridsFromTableAndGrid.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     GridsFromTableAndGrid.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 
diff --git a/src/modules/grid/grid_tools/Makefile.in b/src/modules/grid/grid_tools/Makefile.in
index b1740e1..1df5ff3 100644
--- a/src/modules/grid/grid_tools/Makefile.in
+++ b/src/modules/grid/grid_tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_tools_la_DEPENDENCIES =  \
@@ -113,6 +136,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_tools_la_SOURCES)
 DIST_SOURCES = $(libgrid_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -138,6 +166,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -165,6 +194,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -177,6 +207,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -206,6 +237,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -239,7 +271,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -373,7 +404,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -381,6 +411,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -396,13 +428,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_tools.la: $(libgrid_tools_la_OBJECTS) $(libgrid_tools_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_tools.la: $(libgrid_tools_la_OBJECTS) $(libgrid_tools_la_DEPENDENCIES) $(EXTRA_libgrid_tools_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_tools_la_OBJECTS) $(libgrid_tools_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -520,6 +554,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -570,10 +618,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -659,18 +712,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp b/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp
index 4bb0be5..56b4f6e 100644
--- a/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Aspect_Slope_Map.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Aspect_Slope_Map.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -247,7 +247,7 @@ bool CGrid_Aspect_Slope_Map::On_Execute(void)
 
 	//-----------------------------------------------------
 	#pragma omp parallel for
-	for(long n=0; n<Get_NCells(); n++)
+	for(sLong n=0; n<Get_NCells(); n++)
 	{
 		int		iAspectClass, iSlopeClass;
 
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp b/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp
index 15d4804..dbdeb0f 100644
--- a/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Blend.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Color_Blend.cpp 1949 2014-01-17 15:09:44Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -96,24 +96,49 @@ CGrid_Color_Blend::CGrid_Color_Blend(void)
 	Parameters.Add_Value(
 		NULL	, "NSTEPS"	, _TL("Interpolation Steps"),
 		_TL(""),
-		PARAMETER_TYPE_Int	, 0.0, 0.0, true
+		PARAMETER_TYPE_Int	, 0, 0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "LOOP"	, _TL("Loop"),
+		_TL(""),
+		PARAMETER_TYPE_Bool	, true
 	);
 
 	Parameters.Add_Choice(
 		NULL	, "RANGE"	, _TL("Color Stretch"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
 			_TL("fit to each grid"),
 			_TL("fit to overall range"),
-			_TL("fit to overall 1.5 standard deviation"),
-			_TL("fit to overall 2.0 standard deviation")
+			_TL("fit to overall standard deviation")
 		), 3
 	);
+
+	Parameters.Add_Value(
+		NULL	, "STDDEV"	, _TL("Standard Deviation"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 2.0, 0.0, true
+	);
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-CGrid_Color_Blend::~CGrid_Color_Blend(void)
-{}
+int CGrid_Color_Blend::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "RANGE") )
+	{
+		pParameters->Get_Parameter("STDDEV")->Set_Enabled(pParameter->asInt() == 2);
+	}
+
+	return( 1 );
+}
 
 
 ///////////////////////////////////////////////////////////
@@ -125,117 +150,132 @@ CGrid_Color_Blend::~CGrid_Color_Blend(void)
 //---------------------------------------------------------
 bool CGrid_Color_Blend::On_Execute(void)
 {
-	int						iGrid, x, y, iStep, nSteps, Range;
-	double					d, dStep, Value_A, Value_B, Range_Min, Range_Max;
-	CSG_Grid				*pGrid, *pGrid_A, *pGrid_B;
-	CSG_Parameter_Grid_List	*pGrids;
-
-	pGrid	= Parameters("GRID")	->asGrid();
-	pGrids	= Parameters("GRIDS")	->asGridList();
-	Range	= Parameters("RANGE")	->asInt();
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
 
-	if( pGrids->Get_Count() > 1 )
+	if( pGrids->Get_Count() < 2 )
 	{
-		nSteps	= Parameters("NSTEPS")->asInt();
-		dStep	= 1.0 / (1.0 + nSteps);
-		nSteps	= (1 + nSteps) * (pGrids->Get_Count() - 1);
-
-		pGrid_B	= pGrids->asGrid(0);
-		pGrid->Assign(pGrid_B);
+		return( false );
+	}
 
-		switch( Range )
+	//-----------------------------------------------------
+	switch( Parameters("RANGE")->asInt() )
+	{
+	case 0:	// fit to each grid
 		{
-		case 0:
-			Range_Min	= pGrid->Get_ZMin();
-			Range_Max	= pGrid->Get_ZMax();
-			break;
+			m_Range_Min	= 0.0;
+			m_Range_Max	= 0.0;
+		}
+		break;
 
-		case 1:
-			Range_Min	= pGrid->Get_ZMin();
-			Range_Max	= pGrid->Get_ZMax();
+	case 1:	// fit to overall range
+		{
+			m_Range_Min	= pGrids->asGrid(0)->Get_ZMin();
+			m_Range_Max	= pGrids->asGrid(0)->Get_ZMax();
 
-			for(iGrid=1; iGrid<pGrids->Get_Count(); iGrid++)
+			for(int i=1; i<pGrids->Get_Count(); i++)
 			{
-				if( Range_Min > pGrids->asGrid(iGrid)->Get_ZMin() )	Range_Min	= pGrids->asGrid(iGrid)->Get_ZMin();
-				if( Range_Max < pGrids->asGrid(iGrid)->Get_ZMax() )	Range_Max	= pGrids->asGrid(iGrid)->Get_ZMax();
+				if( m_Range_Min > pGrids->asGrid(i)->Get_ZMin() )	m_Range_Min	= pGrids->asGrid(i)->Get_ZMin();
+				if( m_Range_Max < pGrids->asGrid(i)->Get_ZMax() )	m_Range_Max	= pGrids->asGrid(i)->Get_ZMax();
 			}
-			break;
+		}
+		break;
+
+	case 2:	// fit to overall standard deviation
+		{
+			double	StdDev	= Parameters("STDDEV")->asDouble();
 
-		case 2:
-			Range_Min	= pGrid->Get_ArithMean() - 1.5 * pGrid->Get_StdDev();
-			Range_Max	= pGrid->Get_ArithMean() + 1.5 * pGrid->Get_StdDev();
+			m_Range_Min	= pGrids->asGrid(0)->Get_ArithMean() - StdDev * pGrids->asGrid(0)->Get_StdDev();
+			m_Range_Max	= pGrids->asGrid(0)->Get_ArithMean() + StdDev * pGrids->asGrid(0)->Get_StdDev();
 
-			for(iGrid=1; iGrid<pGrids->Get_Count(); iGrid++)
+			for(int i=1; i<pGrids->Get_Count(); i++)
 			{
-				double	Min	= pGrids->asGrid(iGrid)->Get_ArithMean() - 1.5 * pGrids->asGrid(iGrid)->Get_StdDev();
-				double	Max	= pGrids->asGrid(iGrid)->Get_ArithMean() + 1.5 * pGrids->asGrid(iGrid)->Get_StdDev();
+				double	Min	= pGrids->asGrid(i)->Get_ArithMean() - StdDev * pGrids->asGrid(i)->Get_StdDev();
+				double	Max	= pGrids->asGrid(i)->Get_ArithMean() + StdDev * pGrids->asGrid(i)->Get_StdDev();
 
-				if( Range_Min > Min )	Range_Min	= Min;
-				if( Range_Max < Max )	Range_Max	= Max;
+				if( m_Range_Min > Min )	m_Range_Min	= Min;
+				if( m_Range_Max < Max )	m_Range_Max	= Max;
 			}
-			break;
+		}
+		break;
+	}
 
-		case 3:
-			Range_Min	= pGrid->Get_ArithMean() - 2.0 * pGrid->Get_StdDev();
-			Range_Max	= pGrid->Get_ArithMean() + 2.0 * pGrid->Get_StdDev();
+	//-----------------------------------------------------
+	m_pGrid	= Parameters("GRID")->asGrid();
+	m_pGrid	->Set_Name(_TL("Color Blending"));
+	m_pGrid	->Assign(pGrids->asGrid(0));
 
-			for(iGrid=1; iGrid<pGrids->Get_Count(); iGrid++)
-			{
-				double	Min	= pGrids->asGrid(iGrid)->Get_ArithMean() - 2.0 * pGrids->asGrid(iGrid)->Get_StdDev();
-				double	Max	= pGrids->asGrid(iGrid)->Get_ArithMean() + 2.0 * pGrids->asGrid(iGrid)->Get_StdDev();
+	DataObject_Update(m_pGrid, SG_UI_DATAOBJECT_SHOW);
 
-				if( Range_Min > Min )	Range_Min	= Min;
-				if( Range_Max < Max )	Range_Max	= Max;
-			}
-			break;
+	do
+	{
+		for(int i=1; i<pGrids->Get_Count() && Set_Progress(i, pGrids->Get_Count() - 1); i++)
+		{
+			Blend(pGrids->asGrid(i - 1), pGrids->asGrid(i));
 		}
 
-		DataObject_Update(pGrid, Range_Min, Range_Max, SG_UI_DATAOBJECT_SHOW);
-
-		for(iGrid=1, iStep=1; iGrid<pGrids->Get_Count() && Set_Progress(iStep, nSteps); iGrid++, iStep++)
+		if( Parameters("LOOP")->asBool() && Process_Get_Okay() )
 		{
-			pGrid_A	= pGrid_B;
-			pGrid_B	= pGrids->asGrid(iGrid);
+			Blend(pGrids->asGrid(pGrids->Get_Count() - 1), pGrids->asGrid(0));
+		}
+	}
+	while( Parameters("LOOP")->asBool() && Process_Get_Okay() );
 
-			for(d=dStep; d<1.0 && Set_Progress(iStep, nSteps); d+=dStep, iStep++)
-			{
-				for(y=0; y<Get_NY(); y++)
-				{
-					for(x=0; x<Get_NX(); x++)
-					{
-						Value_A	= pGrid_A->asDouble(x, y);
-						Value_B	= pGrid_B->asDouble(x, y);
-
-						pGrid->Set_Value(x, y, Value_A + d * (Value_B - Value_A) );
-					}
-				}
-
-				if( Range == 0 )
-				{
-					DataObject_Update(pGrid);
-				}
-				else
-				{
-					DataObject_Update(pGrid, Range_Min, Range_Max);
-				}
-			}
+	//-----------------------------------------------------
+	return( true );
+}
 
-			pGrid->Assign(pGrid_B);
 
-			if( Range == 0 )
-			{
-				DataObject_Update(pGrid);
-			}
-			else
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CGrid_Color_Blend::Blend(CSG_Grid *pA, CSG_Grid *pB)
+{
+	int	nSteps	= 1 + Parameters("NSTEPS")->asInt();
+
+	for(int i=1; i<nSteps && Process_Get_Okay(); i++)
+	{
+		double	d	= i / (double)nSteps;
+
+		#pragma omp parallel for
+		for(int y=0; y<Get_NY(); y++)
+		{
+			for(int x=0; x<Get_NX(); x++)
 			{
-				DataObject_Update(pGrid, Range_Min, Range_Max);
+				double	a	= pA->asDouble(x, y);
+				double	b	= pB->asDouble(x, y);
+
+				m_pGrid->Set_Value(x, y, a + d * (b - a));
 			}
 		}
 
-		return( true );
+		if( m_Range_Min < m_Range_Max )
+		{
+			DataObject_Update(m_pGrid, m_Range_Min, m_Range_Max);
+		}
+		else
+		{
+			DataObject_Update(m_pGrid);
+		}
 	}
 
-	return( false );
+	//-----------------------------------------------------
+	SG_UI_Progress_Lock(true);
+	m_pGrid->Assign(pB);
+	SG_UI_Progress_Lock(false);
+
+	if( m_Range_Min < m_Range_Max )
+	{
+		DataObject_Update(m_pGrid, m_Range_Min, m_Range_Max);
+	}
+	else
+	{
+		DataObject_Update(m_pGrid);
+	}
 }
 
 
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Blend.h b/src/modules/grid/grid_visualisation/Grid_Color_Blend.h
index 5a2f11a..dbdcb45 100644
--- a/src/modules/grid/grid_visualisation/Grid_Color_Blend.h
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Blend.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Blend.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Color_Blend.h 1949 2014-01-17 15:09:44Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -65,21 +65,53 @@
 #define HEADER_INCLUDED__Grid_Color_Blend_H
 
 
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #include "MLB_Interface.h"
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 class CGrid_Color_Blend : public CSG_Module_Grid
 {
 public:
 	CGrid_Color_Blend(void);
-	virtual ~CGrid_Color_Blend(void);
 
 
 protected:
 
-	virtual bool			On_Execute(void);
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+	double					m_Range_Min, m_Range_Max;
+
+	CSG_Grid				*m_pGrid;
+
+
+	void					Blend					(CSG_Grid *pA, CSG_Grid *pB);
 
 };
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #endif // #ifndef HEADER_INCLUDED__Grid_Color_Blend_H
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp b/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp
index b5c4bd3..8d28a85 100644
--- a/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Triangle.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Color_Triangle.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -324,7 +324,7 @@ CSG_Grid * CGrid_Color_Triangle::_Get_Grid(CSG_Grid *pGrid, int Method, CSG_Para
 	if( pGrid )
 	{
 		int		x, y;
-		long	n;
+		sLong	n;
 
 		switch( Method )
 		{
@@ -347,10 +347,10 @@ CSG_Grid * CGrid_Color_Triangle::_Get_Grid(CSG_Grid *pGrid, int Method, CSG_Para
 			break;
 
 		case 3:	// Normalise
-			n		= (long)(pGrid->Get_NCells() * pPerctl->Get_LoVal() / 100.0);
+			n		= (sLong)(pGrid->Get_NCells() * pPerctl->Get_LoVal() / 100.0);
 			pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false);
 			Min		= pGrid->asDouble(x, y);
-			n		= (long)(pGrid->Get_NCells() * pPerctl->Get_HiVal() / 100.0);
+			n		= (sLong)(pGrid->Get_NCells() * pPerctl->Get_HiVal() / 100.0);
 			pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false);
 			Range	= pGrid->asDouble(x, y) - Min;
 			Range	= Range > 0.0 ? 1.0 / Range : 0.0;
diff --git a/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp b/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp
index 0653544..6639f4d 100644
--- a/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_RGB_Composite.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_RGB_Composite.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -342,7 +342,7 @@ CSG_Grid * CGrid_RGB_Composite::_Get_Grid(CSG_Grid *pGrid, int Method, CSG_Param
 	if( pGrid )
 	{
 		int		x, y;
-		long	n;
+		sLong	n;
 
 		switch( Method )
 		{
@@ -365,10 +365,10 @@ CSG_Grid * CGrid_RGB_Composite::_Get_Grid(CSG_Grid *pGrid, int Method, CSG_Param
 			break;
 
 		case 3:	// Normalise
-			n		= (long)(pGrid->Get_NCells() * pPerctl->Get_LoVal() / 100.0);
+			n		= (sLong)(pGrid->Get_NCells() * pPerctl->Get_LoVal() / 100.0);
 			pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false);
 			Min		= pGrid->asDouble(x, y);
-			n		= (long)(pGrid->Get_NCells() * pPerctl->Get_HiVal() / 100.0);
+			n		= (sLong)(pGrid->Get_NCells() * pPerctl->Get_HiVal() / 100.0);
 			pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false);
 			Range	= pGrid->asDouble(x, y) - Min;
 			Range	= Range > 0.0 ? 255.0 / Range : 0.0;
diff --git a/src/modules/grid/grid_visualisation/Makefile.in b/src/modules/grid/grid_visualisation/Makefile.in
index a588b57..346e3b0 100644
--- a/src/modules/grid/grid_visualisation/Makefile.in
+++ b/src/modules/grid/grid_visualisation/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_visualisation
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libgrid_visualisation_la_DEPENDENCIES =  \
@@ -107,6 +130,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libgrid_visualisation_la_SOURCES)
 DIST_SOURCES = $(libgrid_visualisation_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -132,6 +160,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -159,6 +188,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -171,6 +201,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -200,6 +231,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -233,7 +265,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -321,7 +352,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -329,6 +359,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -344,13 +376,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgrid_visualisation.la: $(libgrid_visualisation_la_OBJECTS) $(libgrid_visualisation_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libgrid_visualisation.la: $(libgrid_visualisation_la_OBJECTS) $(libgrid_visualisation_la_DEPENDENCIES) $(EXTRA_libgrid_visualisation_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libgrid_visualisation_la_OBJECTS) $(libgrid_visualisation_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -445,6 +479,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -495,10 +543,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -584,18 +637,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/imagery/Makefile.am b/src/modules/imagery/Makefile.am
new file mode 100644
index 0000000..8d88b1c
--- /dev/null
+++ b/src/modules/imagery/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = imagery_classification imagery_opencv imagery_rga imagery_segmentation imagery_svm imagery_tools imagery_vigra
diff --git a/src/modules/imagery/Makefile.in b/src/modules/imagery/Makefile.in
new file mode 100644
index 0000000..17b5197
--- /dev/null
+++ b/src/modules/imagery/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = imagery_classification imagery_opencv imagery_rga imagery_segmentation imagery_svm imagery_tools imagery_vigra
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp b/src/modules/imagery/imagery_classification/MLB_Interface.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp
rename to src/modules/imagery/imagery_classification/MLB_Interface.cpp
diff --git a/src/modules_images/modules_imagery/imagery_classification/MLB_Interface.h b/src/modules/imagery/imagery_classification/MLB_Interface.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/MLB_Interface.h
rename to src/modules/imagery/imagery_classification/MLB_Interface.h
diff --git a/src/modules_images/modules_imagery/imagery_classification/Makefile.am b/src/modules/imagery/imagery_classification/Makefile.am
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/Makefile.am
rename to src/modules/imagery/imagery_classification/Makefile.am
diff --git a/src/modules/imagery/imagery_classification/Makefile.in b/src/modules/imagery/imagery_classification/Makefile.in
new file mode 100644
index 0000000..93bb130
--- /dev/null
+++ b/src/modules/imagery/imagery_classification/Makefile.in
@@ -0,0 +1,643 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_classification
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libimagery_classification_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libimagery_classification_la_OBJECTS = change_detection.lo \
+	classify_cluster_analysis.lo classify_supervised.lo \
+	classify_supervised_polygons.lo decision_tree.lo \
+	MLB_Interface.lo
+libimagery_classification_la_OBJECTS =  \
+	$(am_libimagery_classification_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_classification_la_SOURCES)
+DIST_SOURCES = $(libimagery_classification_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libimagery_classification.la
+libimagery_classification_la_SOURCES = \
+change_detection.cpp\
+classify_cluster_analysis.cpp\
+classify_supervised.cpp\
+classify_supervised_polygons.cpp\
+decision_tree.cpp\
+MLB_Interface.cpp\
+change_detection.h\
+classify_cluster_analysis.h\
+classify_supervised.h\
+classify_supervised_polygons.h\
+decision_tree.h\
+MLB_Interface.h
+
+libimagery_classification_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_classification/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_classification/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_classification.la: $(libimagery_classification_la_OBJECTS) $(libimagery_classification_la_DEPENDENCIES) $(EXTRA_libimagery_classification_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_classification_la_OBJECTS) $(libimagery_classification_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/change_detection.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classify_cluster_analysis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classify_supervised.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classify_supervised_polygons.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/decision_tree.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/imagery/imagery_classification/change_detection.cpp b/src/modules/imagery/imagery_classification/change_detection.cpp
new file mode 100644
index 0000000..f1339e2
--- /dev/null
+++ b/src/modules/imagery/imagery_classification/change_detection.cpp
@@ -0,0 +1,500 @@
+/**********************************************************
+ * Version $Id: change_detection.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_classification                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  change_detection.cpp                 //
+//                                                       //
+//                 Copyright (C) 2010 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 "change_detection.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CChange_Detection::CChange_Detection(void)
+{
+	CSG_Parameter	*pNode, *pTable;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Change Detection"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Change detection for classified grids."
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid(
+		NULL	, "INITIAL"		, _TL("Initial State"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	pTable	= Parameters.Add_Table(pNode, "INI_LUT" , _TL("Look-up Table")	, _TL(""), PARAMETER_INPUT_OPTIONAL);
+	Parameters.Add_Table_Field(pTable, "INI_LUT_MIN", _TL("Value")			, _TL(""), false);
+	Parameters.Add_Table_Field(pTable, "INI_LUT_MAX", _TL("Value (Maximum)"), _TL(""), true	);
+	Parameters.Add_Table_Field(pTable, "INI_LUT_NAM", _TL("Name")			, _TL(""), true);
+
+	pNode	= Parameters.Add_Grid(
+		NULL	, "FINAL"		, _TL("Final State"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	pTable	= Parameters.Add_Table(pNode, "FIN_LUT" , _TL("Look-up Table")	, _TL(""), PARAMETER_INPUT_OPTIONAL);
+	Parameters.Add_Table_Field(pTable, "FIN_LUT_MIN", _TL("Value")			, _TL(""), false);
+	Parameters.Add_Table_Field(pTable, "FIN_LUT_MAX", _TL("Value (Maximum)"), _TL(""), true	);
+	Parameters.Add_Table_Field(pTable, "FIN_LUT_NAM", _TL("Name")			, _TL(""), true);
+
+	Parameters.Add_Grid(
+		NULL	, "CHANGE"		, _TL("Changes"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NOCHANGE"	, _TL("Report Unchanged Classes"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	pNode	= Parameters.Add_Table(
+		NULL	, "CHANGES"		, _TL("Changes"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "OUTPUT"		, _TL("Output as..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("cells"),
+			_TL("percent"),
+			_TL("area")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CChange_Detection::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INI_LUT")) )
+	{
+		pParameters->Get_Parameter("INI_LUT_MIN")->Set_Enabled(pParameter->asTable() != NULL);
+		pParameters->Get_Parameter("INI_LUT_MAX")->Set_Enabled(pParameter->asTable() != NULL);
+		pParameters->Get_Parameter("INI_LUT_NAM")->Set_Enabled(pParameter->asTable() != NULL);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIN_LUT")) )
+	{
+		pParameters->Get_Parameter("FIN_LUT_MIN")->Set_Enabled(pParameter->asTable() != NULL);
+		pParameters->Get_Parameter("FIN_LUT_MAX")->Set_Enabled(pParameter->asTable() != NULL);
+		pParameters->Get_Parameter("FIN_LUT_NAM")->Set_Enabled(pParameter->asTable() != NULL);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CChange_Detection::On_Execute(void)
+{
+	bool		bNoChange;
+	int			iInitial, iFinal;
+	CSG_Matrix	Identity;
+	CSG_Table	Initial, Final, *pChanges;
+	CSG_Grid	*pInitial, *pFinal, *pChange;
+
+	//-----------------------------------------------------
+	pInitial	= Parameters("INITIAL")	->asGrid();
+	pFinal		= Parameters("FINAL")	->asGrid();
+	pChange		= Parameters("CHANGE")	->asGrid();
+	pChanges	= Parameters("CHANGES")	->asTable();
+	bNoChange	= Parameters("NOCHANGE")->asBool();
+
+	if( !Get_Classes(Initial, pInitial, true) )
+	{
+		Error_Set(_TL("no class definitions for initial state"));
+
+		return( false );
+	}
+
+	if( !Get_Classes(Final, pFinal, false) )
+	{
+		Error_Set(_TL("no class definitions for final state"));
+
+		return( false );
+	}
+
+	if( !Get_Changes(Initial, Final, pChanges, Identity) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			iInitial	= Get_Class(Initial, pInitial->asDouble(x, y));
+			iFinal		= Get_Class(Final  , pFinal  ->asDouble(x, y));
+
+			if( bNoChange || !Identity[iInitial][iFinal] )
+			{
+				pChanges->Get_Record(iInitial)->Add_Value(1 + iFinal, 1);
+
+				pChange->Set_Value(x, y, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal);
+			}
+			else
+			{
+				pChange->Set_Value(x, y, -1);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pChange, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		CSG_Table	*pLUT	= P("LUT")->asTable();
+
+		CSG_Colors	cRandom(pChanges->Get_Count());
+
+		cRandom.Random();
+
+		pLUT->Del_Records();
+
+		for(iInitial=0; iInitial<pChanges->Get_Count(); iInitial++)
+		{
+			CSG_Colors	cRamp(pChanges->Get_Field_Count() - 1);
+
+			cRamp.Set_Ramp(cRandom[iInitial], cRandom[iInitial]);
+			cRamp.Set_Ramp_Brighness(225, 50);
+
+			for(iFinal=0; iFinal<pChanges->Get_Field_Count()-1; iFinal++)
+			{
+				if( pChanges->Get_Record(iInitial)->asInt(1 + iFinal) > 0 )
+				{
+					CSG_Table_Record	*pClass	= pLUT->Add_Record();
+
+					pClass->Set_Value(0, cRamp.Get_Color(iFinal));
+					pClass->Set_Value(1, CSG_String::Format(SG_T("%s >> %s"), pChanges->Get_Record(iInitial)->asString(0), pChanges->Get_Field_Name(1 + iFinal)));
+					pClass->Set_Value(3, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal);
+					pClass->Set_Value(4, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal);
+				}
+			}
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pChange, P);
+	}
+
+	//-----------------------------------------------------
+	double	Factor;
+
+	switch( Parameters("OUTPUT")->asInt() )
+	{
+	default:	Factor	= 1.0;						break;	// cells
+	case 1:		Factor	= 100.0 / Get_NCells();		break;	// percent
+	case 2:		Factor	= M_SQR(Get_Cellsize());	break;	// area
+	}
+
+	if( Factor != 1.0 )
+	{
+		for(iInitial=0; iInitial<pChanges->Get_Count(); iInitial++)
+		{
+			for(iFinal=0; iFinal<pChanges->Get_Field_Count()-1; iFinal++)
+			{
+				pChanges->Get_Record(iInitial)->Mul_Value(1 + iFinal, Factor);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	pChanges	->Set_Name(CSG_String::Format(SG_T("%s [%s >> %s]"), _TL("Changes"), pInitial->Get_Name(), pFinal->Get_Name()));
+
+	pChange		->Set_Name(CSG_String::Format(SG_T("%s [%s >> %s]"), _TL("Changes"), pInitial->Get_Name(), pFinal->Get_Name()));
+	pChange		->Set_NoData_Value(-1);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	CLASS_NAM	= 0,
+	CLASS_MIN,
+	CLASS_MAX
+};
+
+//---------------------------------------------------------
+bool CChange_Detection::Get_Classes(CSG_Table &Classes, CSG_Grid *pGrid, bool bInitial)
+{
+	CSG_Table	*pClasses;
+
+	Classes.Destroy();
+
+	Classes.Add_Field(_TL("NAME")	, SG_DATATYPE_String);
+	Classes.Add_Field(_TL("MIN")	, SG_DATATYPE_Double);
+	Classes.Add_Field(_TL("MAX")	, SG_DATATYPE_Double);
+
+	//-----------------------------------------------------
+	if( (pClasses = Parameters(bInitial ? "INI_LUT" : "FIN_LUT")->asTable()) != NULL )
+	{
+		int	fNam	= Parameters(bInitial ? "INI_LUT_NAM" : "FIN_LUT_NAM")->asInt();
+		int	fMin	= Parameters(bInitial ? "INI_LUT_MIN" : "FIN_LUT_MIN")->asInt();
+		int	fMax	= Parameters(bInitial ? "INI_LUT_MAX" : "FIN_LUT_MAX")->asInt();
+
+		if( fNam < 0 || fNam >= pClasses->Get_Field_Count() )	{	fNam	= fMin;	}
+		if( fMax < 0 || fMax >= pClasses->Get_Field_Count() )	{	fMax	= fMin;	}
+
+		for(int iClass=0; iClass<pClasses->Get_Count(); iClass++)
+		{
+			CSG_Table_Record	*pClass	= Classes.Add_Record();
+
+			pClass->Set_Value(CLASS_NAM, pClasses->Get_Record(iClass)->asString(fNam));
+			pClass->Set_Value(CLASS_MIN, pClasses->Get_Record(iClass)->asDouble(fMin));
+			pClass->Set_Value(CLASS_MAX, pClasses->Get_Record(iClass)->asDouble(fMax));
+		}
+	}
+
+	//-----------------------------------------------------
+	else if( DataObject_Get_Parameter(pGrid, "LUT") )
+	{
+		pClasses	= DataObject_Get_Parameter(pGrid, "LUT")->asTable();
+
+		for(int iClass=0; iClass<pClasses->Get_Count(); iClass++)
+		{
+			CSG_Table_Record	*pClass	= Classes.Add_Record();
+
+			pClass->Set_Value(CLASS_NAM, pClasses->Get_Record(iClass)->asString(1));
+			pClass->Set_Value(CLASS_MIN, pClasses->Get_Record(iClass)->asDouble(3));
+			pClass->Set_Value(CLASS_MAX, pClasses->Get_Record(iClass)->asDouble(4));
+		}
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		double	z;
+
+		for(sLong i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
+		{
+			double iz	= pGrid->asDouble(pGrid->Get_Sorted(i, false, false));
+
+			if( i == 0 || iz != z )
+			{
+				CSG_Table_Record	*pClass	= Classes.Add_Record();
+
+				pClass->Set_Value(CLASS_NAM, z = iz);
+				pClass->Set_Value(CLASS_MIN, z);
+				pClass->Set_Value(CLASS_MAX, z);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( Classes.Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CChange_Detection::Get_Changes(CSG_Table &Initial, CSG_Table &Final, CSG_Table *pChanges, CSG_Matrix &Identity)
+{
+	int		iInitial, iFinal;
+
+	//-----------------------------------------------------
+	Identity.Create(Final.Get_Count() + 1, Initial.Get_Count() + 1);
+
+	for(iInitial=0; iInitial<Initial.Get_Count(); iInitial++)
+	{
+		CSG_String	s	= Initial[iInitial].asString(CLASS_NAM);
+
+		for(iFinal=0; iFinal<Final.Get_Count(); iFinal++)
+		{
+			Identity[iInitial][iFinal]	= s.Cmp(Final[iFinal].asString(CLASS_NAM)) ? 0 : 1;
+		}
+	}
+
+	Identity[Initial.Get_Count()][Final.Get_Count()]	= 1;	// unclassified
+
+	//-----------------------------------------------------
+	pChanges->Destroy();
+
+	pChanges->Add_Field(_TL("Name"), SG_DATATYPE_String);
+
+	for(iFinal=0; iFinal<Final.Get_Count(); iFinal++)
+	{
+		pChanges->Add_Field(Final[iFinal].asString(CLASS_NAM), SG_DATATYPE_Double);
+	}
+
+	pChanges->Add_Field(_TL("Unclassified"), SG_DATATYPE_Double);
+
+	//-----------------------------------------------------
+	for(iInitial=0; iInitial<Initial.Get_Count(); iInitial++)
+	{
+		pChanges->Add_Record()->Set_Value(0, Initial[iInitial].asString(CLASS_NAM));
+	}
+
+	pChanges->Add_Record()->Set_Value(0, _TL("Unclassified"));
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline int CChange_Detection::Cmp_Class(CSG_Table &Classes, double Value, int iClass)
+{
+	CSG_Table_Record	*pClass	= Classes.Get_Record_byIndex(iClass);
+
+	double	min	= pClass->asDouble(CLASS_MIN);
+
+	if( Value < min )
+	{
+		return( 1 );
+	}
+
+	double	max	= pClass->asDouble(CLASS_MAX);
+
+	return( min < max
+		?	(Value < max ?  0 : -1)
+		:	(Value > min ? -1 :  0)
+	);
+}
+
+//---------------------------------------------------------
+int CChange_Detection::Get_Class(CSG_Table &Classes, double Value)
+{
+	int		a, b, i, c;
+
+	if( Classes.Get_Count() > 0 )
+	{
+		if( Classes.Get_Index_Field(0) != CLASS_MIN || Classes.Get_Index_Order(0) != TABLE_INDEX_Ascending )
+		{
+			Classes.Set_Index(CLASS_MIN, TABLE_INDEX_Ascending);
+		}
+
+		for(a=0, b=Classes.Get_Record_Count()-1; a < b; )
+		{
+			i	= a + (b - a) / 2;
+			c	= Cmp_Class(Classes, Value, i);
+
+			if( c > 0 )
+			{
+				b	= b > i ? i : b - 1;
+			}
+			else if( c < 0 )
+			{
+				a	= a < i ? i : a + 1;
+			}
+			else
+			{
+				return( Classes.Get_Record_byIndex(i)->Get_Index() );
+			}
+		}
+
+		if( Cmp_Class(Classes, Value, a) == 0 )
+		{
+			return( Classes.Get_Record_byIndex(a)->Get_Index() );
+		}
+
+		if( a != b && Cmp_Class(Classes, Value, b) == 0 )
+		{
+			return( Classes.Get_Record_byIndex(b)->Get_Index() );
+		}
+	}
+
+	return( Classes.Get_Count() );	// := unclassified
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_classification/change_detection.h b/src/modules/imagery/imagery_classification/change_detection.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/change_detection.h
rename to src/modules/imagery/imagery_classification/change_detection.h
diff --git a/src/modules/imagery/imagery_classification/classify_cluster_analysis.cpp b/src/modules/imagery/imagery_classification/classify_cluster_analysis.cpp
new file mode 100644
index 0000000..7bdd6a2
--- /dev/null
+++ b/src/modules/imagery/imagery_classification/classify_cluster_analysis.cpp
@@ -0,0 +1,847 @@
+/**********************************************************
+ * Version $Id: classify_cluster_analysis.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_classification                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               Grid_Cluster_Analysis.cpp               //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "classify_cluster_analysis.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Cluster_Analysis::CGrid_Cluster_Analysis(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Cluster Analysis for Grids"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2001"));
+
+	Set_Description	(_TW(		
+		"Cluster Analysis for grids.\n\nReferences:\n\n"
+		                                                                                                                                                                                                                  
+		"Iterative Minimum Distance:\n"
+		"- Forgy, E. (1965):\n"
+		"  'Cluster Analysis of multivariate data: efficiency vs. interpretability of classifications',\n"
+		"  Biometrics 21:768\n\n"
+
+		"Hill-Climbing:"
+		"- Rubin, J. (1967):\n"
+		"  'Optimal Classification into Groups: An Approach for Solving the Taxonomy Problem',\n"
+		"  J. Theoretical Biology, 15:103-144\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CLUSTER"		, _TL("Clusters"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Int
+	);
+
+	Parameters.Add_Table(
+		NULL	, "STATISTICS"	, _TL("Statistics"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Iterative Minimum Distance (Forgy 1965)"),
+			_TL("Hill-Climbing (Rubin 1967)"),
+			_TL("Combined Minimum Distance / Hillclimbing") 
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NCLUSTER"	, _TL("Clusters"),
+		_TL("Number of clusters"),
+		PARAMETER_TYPE_Int, 10, 2, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NORMALISE"	, _TL("Normalise"),
+		_TL("Automatically normalise grids by standard deviation before clustering."),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode	=
+	Parameters.Add_Value(NULL	, "OLDVERSION", _TL("Old Version"), _TL("slower but memory saving"), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(pNode	, "UPDATEVIEW", _TL("Update View"), _TL(""), PARAMETER_TYPE_Bool, true);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Cluster_Analysis::On_Execute(void)
+{
+	if( Parameters("OLDVERSION")->asBool() )	{	return( _On_Execute() );	}
+
+	//-----------------------------------------------------
+	bool					bNormalize;
+	sLong					iFeature, iElement, nElements;
+	CSG_Cluster_Analysis	Analysis;
+	CSG_Grid				*pCluster;
+	CSG_Parameter_Grid_List	*pGrids;
+
+	//-----------------------------------------------------
+	pGrids		= Parameters("GRIDS")		->asGridList();
+	pCluster	= Parameters("CLUSTER")		->asGrid();
+	bNormalize	= Parameters("NORMALISE")	->asBool();
+
+	if( !Analysis.Create(pGrids->Get_Count()) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pCluster->Set_NoData_Value(-1.0);
+
+	for(iElement=0, nElements=0; iElement<Get_NCells() && Set_Progress_NCells(iElement); iElement++)
+	{
+		bool	bNoData		= false;
+
+		for(iFeature=0; iFeature<pGrids->Get_Count() && !bNoData; iFeature++)
+		{
+			if( pGrids->asGrid(iFeature)->is_NoData(iElement) )
+			{
+				bNoData	= true;
+			}
+		}
+
+		if( bNoData || !Analysis.Add_Element() )
+		{
+			pCluster->Set_Value(iElement, -1);
+		}
+		else
+		{
+			pCluster->Set_Value(iElement, 0);
+
+			for(iFeature=0; iFeature<pGrids->Get_Count(); iFeature++)
+			{
+				double	d	= pGrids->asGrid(iFeature)->asDouble(iElement);
+
+				if( bNormalize )
+				{
+					d	= (d - pGrids->asGrid(iFeature)->Get_ArithMean()) / pGrids->asGrid(iFeature)->Get_StdDev();
+				}
+
+				Analysis.Set_Feature(nElements, iFeature, d);
+			}
+
+			nElements++;
+		}
+	}
+
+	if( nElements <= 1 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	bool	bResult	= Analysis.Execute(Parameters("METHOD")->asInt(), Parameters("NCLUSTER")->asInt());
+
+	for(iElement=0, nElements=0; iElement<Get_NCells(); iElement++)
+	{
+		Set_Progress_NCells(iElement);
+
+		if( !pCluster->is_NoData(iElement) )
+		{
+			pCluster->Set_Value(iElement, Analysis.Get_Cluster(nElements++));
+		}
+	}
+
+	Save_Statistics(pGrids, bNormalize, Analysis);
+
+	Save_LUT(pCluster, Analysis.Get_nClusters());
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CGrid_Cluster_Analysis::Save_Statistics(CSG_Parameter_Grid_List *pGrids, bool bNormalize, const CSG_Cluster_Analysis &Analysis)
+{
+	int					iCluster, iFeature;
+	CSG_String			s;
+	CSG_Table_Record	*pRecord;
+	CSG_Table			*pTable;
+
+	pTable	= Parameters("STATISTICS")->asTable();
+
+	pTable->Destroy();
+	pTable->Set_Name(_TL("Cluster Analysis"));
+
+	pTable->Add_Field(_TL("ClusterID")	, SG_DATATYPE_Int);
+	pTable->Add_Field(_TL("Elements")	, SG_DATATYPE_Int);
+	pTable->Add_Field(_TL("Std.Dev.")	, SG_DATATYPE_Double);
+
+	s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"),
+		_TL("Number of Elements")	, Analysis.Get_nElements(),
+		_TL("Number of Variables")	, Analysis.Get_nFeatures(),
+		_TL("Number of Clusters")	, Analysis.Get_nClusters(),
+		_TL("Standard Deviation")	, sqrt(Analysis.Get_SP()),
+		_TL("Cluster"), _TL("Elements"), _TL("Std.Dev.")
+	);
+
+	for(iFeature=0; iFeature<Analysis.Get_nFeatures(); iFeature++)
+	{
+		s	+= CSG_String::Format(SG_T("\t%s"), pGrids->asGrid(iFeature)->Get_Name());
+
+		pTable->Add_Field(pGrids->asGrid(iFeature)->Get_Name(), SG_DATATYPE_Double);
+	}
+
+	Message_Add(s);
+
+	for(iCluster=0; iCluster<Analysis.Get_nClusters(); iCluster++)
+	{
+		s.Printf(SG_T("\n%d\t%d\t%f"), iCluster, Analysis.Get_nMembers(iCluster), sqrt(Analysis.Get_Variance(iCluster)));
+
+		pRecord	= pTable->Add_Record();
+		pRecord->Set_Value(0, iCluster);
+		pRecord->Set_Value(1, Analysis.Get_nMembers(iCluster));
+		pRecord->Set_Value(2, sqrt(Analysis.Get_Variance(iCluster)));
+
+		for(iFeature=0; iFeature<Analysis.Get_nFeatures(); iFeature++)
+		{
+			double	Centroid	= Analysis.Get_Centroid(iCluster, iFeature);
+
+			if( bNormalize )
+			{
+				Centroid	= pGrids->asGrid(iFeature)->Get_ArithMean() + Centroid * pGrids->asGrid(iFeature)->Get_StdDev();
+			}
+
+			s	+= CSG_String::Format(SG_T("\t%f"), Centroid);
+
+			pRecord->Set_Value(iFeature + 3, Centroid);
+		}
+
+		Message_Add(s, false);
+	}
+}
+
+//---------------------------------------------------------
+void CGrid_Cluster_Analysis::Save_LUT(CSG_Grid *pCluster, int nClusters)
+{
+	CSG_Parameters	Parms;
+
+	if( DataObject_Get_Parameters(pCluster, Parms) && Parms("COLORS_TYPE") && Parms("LUT") )
+	{
+		CSG_Table_Record	*pClass;
+		CSG_Table			*pLUT	= Parms("LUT")->asTable();
+
+		for(int iCluster=0; iCluster<nClusters; iCluster++)
+		{
+			if( (pClass = pLUT->Get_Record(iCluster)) == NULL )
+			{
+				pClass	= pLUT->Add_Record();
+				pClass->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX));
+			}
+
+			pClass->Set_Value(1, CSG_String::Format(SG_T("%s %d"), _TL("Class"), iCluster + 1));
+			pClass->Set_Value(2, CSG_String::Format(SG_T("%s %d"), _TL("Class"), iCluster + 1));
+			pClass->Set_Value(3, iCluster);
+			pClass->Set_Value(4, iCluster);
+		}
+
+		while( pLUT->Get_Record_Count() > nClusters )
+		{
+			pLUT->Del_Record(pLUT->Get_Record_Count() - 1);
+		}
+
+		Parms("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pCluster, Parms);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+//														 //
+//				Deprecated Old Version					 //
+//														 //
+///////////////////////////////////////////////////////////
+//														 //
+//				slow, but safes memory !				 //
+//														 //
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Cluster_Analysis::_On_Execute(void)
+{
+	int						i, j, *nMembers, nCluster, nElements;
+	double					*Variances, **Centroids, SP;
+	CSG_Grid				**Grids, *pCluster;
+	CSG_Parameter_Grid_List	*pGrids;
+
+	//-----------------------------------------------------
+	pGrids		= Parameters("GRIDS")	->asGridList();
+	pCluster	= Parameters("CLUSTER")	->asGrid();
+	nCluster	= Parameters("NCLUSTER")->asInt();
+
+	if( pGrids->Get_Count() < 1 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Grids		= (CSG_Grid **)SG_Malloc(pGrids->Get_Count() * sizeof(CSG_Grid *));
+
+	if( Parameters("NORMALISE")->asBool() )
+	{
+		for(i=0; i<pGrids->Get_Count(); i++)
+		{
+			Grids[i]	= SG_Create_Grid(pGrids->asGrid(i), SG_DATATYPE_Float);
+			Grids[i]	->Assign(pGrids->asGrid(i));
+			Grids[i]	->Standardise();
+		}
+	}
+	else
+	{
+		for(i=0; i<pGrids->Get_Count(); i++)
+		{
+			Grids[i]	= pGrids->asGrid(i);
+		}
+	}
+
+	pCluster->Set_NoData_Value(-1.0);
+	pCluster->Assign_NoData();
+
+	nMembers	= (int     *)SG_Malloc(nCluster * sizeof(int));
+	Variances	= (double  *)SG_Malloc(nCluster * sizeof(double));
+	Centroids	= (double **)SG_Malloc(nCluster * sizeof(double *));
+
+	for(i=0; i<nCluster; i++)
+	{
+		Centroids[i]	= (double  *)SG_Malloc(pGrids->Get_Count() * sizeof(double));
+	}
+
+	//-------------------------------------------------
+	switch( Parameters("METHOD")->asInt() )
+	{
+	case 0:		SP	= _MinimumDistance	(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());	break;
+	case 1:		SP	= _HillClimbing		(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());	break;
+	case 2:		SP	= _MinimumDistance	(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());
+				SP	= _HillClimbing		(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());	break;
+	}
+
+	//-------------------------------------------------
+	if( Parameters("NORMALISE")->asBool() )
+	{
+		for(i=0; i<pGrids->Get_Count(); i++)
+		{
+			delete(Grids[i]);
+
+			for(j=0; j<nCluster; j++)
+			{
+				Centroids[j][i]	= pGrids->asGrid(i)->Get_StdDev() * Centroids[j][i] + pGrids->asGrid(i)->Get_ArithMean();
+			}
+		}
+	}
+
+	//-------------------------------------------------
+	Save_LUT(pCluster, nCluster);
+
+	//-------------------------------------------------
+	int					iCluster, iFeature;
+	CSG_String			s;
+	CSG_Table_Record	*pRecord;
+	CSG_Table			*pTable;
+
+	pTable	= Parameters("STATISTICS")->asTable();
+
+	pTable->Destroy();
+	pTable->Set_Name(_TL("Cluster Analysis"));
+
+	pTable->Add_Field(_TL("ClusterID")	, SG_DATATYPE_Int);
+	pTable->Add_Field(_TL("Elements")	, SG_DATATYPE_Int);
+	pTable->Add_Field(_TL("Std.Dev.")	, SG_DATATYPE_Double);
+
+	s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"),
+		_TL("Number of Elements")	, nElements,
+		_TL("Number of Variables")	, pGrids->Get_Count(),
+		_TL("Number of Clusters")	, nCluster,
+		_TL("Standard Deviation")	, sqrt(SP),
+		_TL("Cluster"), _TL("Elements"), _TL("Std.Dev.")
+	);
+
+	for(iFeature=0; iFeature<pGrids->Get_Count(); iFeature++)
+	{
+		s	+= CSG_String::Format(SG_T("\t%s"), pGrids->asGrid(iFeature)->Get_Name());
+
+		pTable->Add_Field(pGrids->asGrid(iFeature)->Get_Name(), SG_DATATYPE_Double);
+	}
+
+	Message_Add(s);
+
+	for(iCluster=0; iCluster<nCluster; iCluster++)
+	{
+		Variances[iCluster]	= nMembers[iCluster] ? Variances[iCluster] / nMembers[iCluster] : 0.0;
+
+		s.Printf(SG_T("\n%d\t%d\t%f"), iCluster, nMembers[iCluster], sqrt(Variances[iCluster]));
+
+		pRecord	= pTable->Add_Record();
+		pRecord->Set_Value(0, iCluster);
+		pRecord->Set_Value(1, nMembers[iCluster]);
+		pRecord->Set_Value(2, sqrt(Variances[iCluster]));
+
+		for(iFeature=0; iFeature<pGrids->Get_Count(); iFeature++)
+		{
+			double	Centroid	= Centroids[iCluster][iFeature];
+
+			if( Parameters("NORMALISE")->asBool() )
+			{
+				Centroid	= pGrids->asGrid(iFeature)->Get_ArithMean() + Centroid * pGrids->asGrid(iFeature)->Get_StdDev();
+			}
+
+			s	+= CSG_String::Format(SG_T("\t%f"), Centroid);
+
+			pRecord->Set_Value(iFeature + 3, Centroid);
+		}
+
+		Message_Add(s, false);
+	}
+
+	//-------------------------------------------------
+	for(i=0; i<nCluster; i++)
+	{
+		SG_Free(Centroids[i]);
+	}
+
+	SG_Free(Centroids);
+	SG_Free(Variances);
+	SG_Free(nMembers);
+	SG_Free(Grids);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+double CGrid_Cluster_Analysis::_MinimumDistance(CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements)
+{
+	bool	bContinue;
+	int		iElement, iGrid, iCluster, nClusterElements, nShifts, minCluster, nPasses;
+	double	d, Variance, minVariance, SP, SP_Last	= -1;
+
+	//-----------------------------------------------------
+	for(iElement=0, nClusterElements=0; iElement<nElements; iElement++)
+	{
+		for(iGrid=0, bContinue=true; iGrid<nGrids && bContinue; iGrid++)
+		{
+			if( Grids[iGrid]->is_NoData(iElement) )
+			{
+				bContinue	= false;
+			}
+		}
+
+		if( bContinue )
+		{
+			if( pCluster->asInt(iElement) < 0 || pCluster->asInt(iElement) >= nCluster )
+			{
+				pCluster->Set_Value(iElement, iElement % nCluster);
+			}
+
+			nClusterElements++;
+		}
+		else
+		{
+			pCluster->Set_Value(iElement, -1);
+		}
+	}
+
+	if( Parameters("UPDATEVIEW")->asBool() )
+	{
+		DataObject_Update(pCluster, 0, nCluster, true);
+	}
+
+	//-----------------------------------------------------
+	for(nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++)
+	{
+		for(iCluster=0; iCluster<nCluster; iCluster++)
+		{
+			Variances[iCluster]	= 0;
+			nMembers [iCluster]	= 0;
+
+			for(iGrid=0; iGrid<nGrids; iGrid++)
+			{
+				Centroids[iCluster][iGrid]	= 0;
+			}
+		}
+
+		//-------------------------------------------------
+		for(iElement=0; iElement<nElements; iElement++)
+		{
+			if( pCluster->asInt(iElement) >= 0 )
+			{
+				iCluster	= pCluster->asInt(iElement);
+				nMembers[iCluster]++;
+
+				for(iGrid=0; iGrid<nGrids; iGrid++)
+				{
+					Centroids[iCluster][iGrid]	+= Grids[iGrid]->asDouble(iElement);
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		for(iCluster=0; iCluster<nCluster; iCluster++)
+		{
+			d		= nMembers[iCluster] > 0 ? 1.0 / (double)nMembers[iCluster] : 0;
+
+			for(iGrid=0; iGrid<nGrids; iGrid++)
+			{
+				Centroids[iCluster][iGrid]	*= d;
+			}
+		}
+
+		//-------------------------------------------------
+		SP		= 0;
+		nShifts	= 0;
+
+		for(iElement=0; iElement<nElements && bContinue; iElement++)
+		{
+			if( pCluster->asInt(iElement) >= 0 )
+			{
+				minVariance	= -1;
+
+				for(iCluster=0; iCluster<nCluster; iCluster++)
+				{
+					Variance	= 0;
+
+					for(iGrid=0; iGrid<nGrids; iGrid++)
+					{
+						d			= Centroids[iCluster][iGrid] - Grids[iGrid]->asDouble(iElement);
+						Variance	+= d * d;
+					}
+
+					if( minVariance<0 || Variance<minVariance )
+					{
+						minVariance	= Variance;
+						minCluster	= iCluster;
+					}
+				}
+
+				if( pCluster->asInt(iElement) != minCluster )
+				{
+					pCluster->Set_Value(iElement, minCluster);
+					nShifts++;
+				}
+
+				SP						+= minVariance;
+				Variances[minCluster]	+= minVariance;
+			}
+		}
+
+		//-------------------------------------------------
+		if( nShifts == 0 )//|| (SP_Last >= 0 && SP >= SP_Last) )
+		{
+			bContinue	= false;
+		}
+
+		SP	/= nElements;
+
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"),
+			_TL("pass")		, nPasses,
+			_TL("change")	, SP_Last < 0.0 ? SP : SP_Last - SP
+		));
+
+		SP_Last		= SP;
+
+		if( Parameters("UPDATEVIEW")->asBool() )
+		{
+			DataObject_Update(pCluster, 0, nCluster);	// Update_Output();
+		}
+	}
+
+	nElements	= nClusterElements;
+
+	return( SP );
+}
+
+//---------------------------------------------------------
+double CGrid_Cluster_Analysis::_HillClimbing(CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements)
+{
+	bool	bContinue;
+	int		iElement, iGrid, iCluster, jCluster, kCluster, nClusterElements, noShift, nPasses;
+	double	d, e, n_iK, n_jK, V, VMin, V1, V2, SP, SP_Last	= -1;
+
+	//-----------------------------------------------------
+	for(iCluster=0; iCluster<nCluster; iCluster++)
+	{
+		Variances[iCluster]	= 0;
+		nMembers [iCluster]	= 0;
+
+		for(iGrid=0; iGrid<nGrids; iGrid++)
+		{
+			Centroids[iCluster][iGrid]	= 0;
+		}
+	}
+
+	//-----------------------------------------------------
+	for(iElement=0, nClusterElements=0; iElement<nElements; iElement++)
+	{
+		for(iGrid=0, bContinue=true; iGrid<nGrids && bContinue; iGrid++)
+		{
+			if( Grids[iGrid]->is_NoData(iElement) )
+			{
+				bContinue	= false;
+			}
+		}
+
+		if( bContinue )
+		{
+			if( pCluster->asInt(iElement) < 0 || pCluster->asInt(iElement) >= nCluster )
+			{
+				pCluster->Set_Value(iElement, iElement % nCluster);
+			}
+
+			nClusterElements++;
+
+			iCluster	= pCluster->asInt(iElement);
+
+			nMembers[iCluster]++;
+
+			V			= 0.0;
+
+			for(iGrid=0; iGrid<nGrids; iGrid++)
+			{
+				d							 = Grids[iGrid]->asDouble(iElement);
+				Centroids[iCluster][iGrid]	+= d;
+				V							+= d * d;
+			}
+
+			Variances[iCluster]	+= V;
+		}
+		else
+		{
+			pCluster->Set_Value(iElement, -1);
+		}
+	}
+
+	//-----------------------------------------------------
+	for(iCluster=0; iCluster<nCluster; iCluster++)
+	{
+		d	= nMembers[iCluster] != 0 ? 1.0 / (double)nMembers[iCluster] : 0;
+		V	= 0.0;
+
+		for(iGrid=0; iGrid<nGrids; iGrid++)
+		{
+			Centroids[iCluster][iGrid]	*= d;
+			e							 = Centroids[iCluster][iGrid];
+			V							+= e * e;
+		}
+
+		Variances[iCluster]	-= nMembers [iCluster] * V;
+	}
+
+	if( Parameters("UPDATEVIEW")->asBool() )
+	{
+		DataObject_Update(pCluster, 0, nCluster, true);
+	}
+
+	//-----------------------------------------------------
+	noShift		= 0;
+
+	for(nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++)
+	{
+		for(iElement=0; iElement<nElements && bContinue; iElement++)
+		{
+			if( pCluster->asInt(iElement) >= 0 )
+			{
+				if( noShift++ >= nElements )
+				{
+					bContinue	= false;
+				}
+				else
+				{
+
+					//-------------------------------------
+					iCluster	= pCluster->asInt(iElement);
+
+					if( nMembers[iCluster] > 1 )
+					{
+						V	= 0.0;
+
+						for(iGrid=0; iGrid<nGrids; iGrid++)
+						{
+							d	= Centroids[iCluster][iGrid] - Grids[iGrid]->asDouble(iElement);
+							V	+= d * d;
+						}
+
+						n_iK	= nMembers[iCluster];
+						V1		= V * n_iK / (n_iK - 1.0);
+						VMin	= -1.0;
+
+						//---------------------------------
+						for(jCluster=0; jCluster<nCluster; jCluster++)
+						{
+							if( jCluster != iCluster )
+							{
+								V	= 0.0;
+
+								for(iGrid=0; iGrid<nGrids; iGrid++)
+								{
+									d	= Centroids[jCluster][iGrid] - Grids[iGrid]->asDouble(iElement);
+									V	+= d * d;
+								}
+
+								n_jK	= nMembers[jCluster];
+								V2		= V * n_jK / (n_jK + 1.0);
+
+								if( VMin < 0 || V2 < VMin )
+								{
+									VMin		= V2;
+									kCluster	= jCluster;
+								}
+							}
+						}
+
+						//---------------------------------
+						if( VMin >= 0 && VMin < V1 )
+						{
+							noShift				= 0;
+							Variances[iCluster]	-= V1;
+							Variances[kCluster]	+= VMin;
+							V1					= 1.0 / (n_iK - 1.0);
+							n_jK				= nMembers[kCluster];
+							V2					= 1.0 / (n_jK + 1.0);
+
+							for(iGrid=0; iGrid<nGrids; iGrid++)
+							{
+								d							= Grids[iGrid]->asDouble(iElement);
+								Centroids[iCluster][iGrid]	= (n_iK * Centroids[iCluster][iGrid] - d) * V1;
+								Centroids[kCluster][iGrid]	= (n_jK * Centroids[kCluster][iGrid] + d) * V2;
+							}
+
+							pCluster->Set_Value(iElement, kCluster);
+
+							nMembers[iCluster]--;
+							nMembers[kCluster]++;
+						}
+					}
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		for(iCluster=0, SP=0.0; iCluster<nCluster; iCluster++)
+		{
+			SP	+= Variances[iCluster];
+		}
+
+		SP	/= nElements;
+
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"),
+			_TL("pass")		, nPasses,
+			_TL("change")	, SP_Last < 0.0 ? SP : SP_Last - SP
+		));
+
+		SP_Last		= SP;
+
+		if( Parameters("UPDATEVIEW")->asBool() )
+		{
+			DataObject_Update(pCluster, 0, nCluster);	// Update_Output();
+		}
+	}
+
+	nElements	= nClusterElements;
+
+	return( SP );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.h b/src/modules/imagery/imagery_classification/classify_cluster_analysis.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.h
rename to src/modules/imagery/imagery_classification/classify_cluster_analysis.h
diff --git a/src/modules_images/modules_imagery/imagery_classification/classify_supervised.cpp b/src/modules/imagery/imagery_classification/classify_supervised.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/classify_supervised.cpp
rename to src/modules/imagery/imagery_classification/classify_supervised.cpp
diff --git a/src/modules_images/modules_imagery/imagery_classification/classify_supervised.h b/src/modules/imagery/imagery_classification/classify_supervised.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/classify_supervised.h
rename to src/modules/imagery/imagery_classification/classify_supervised.h
diff --git a/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp b/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp
new file mode 100644
index 0000000..fd6bfa7
--- /dev/null
+++ b/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp
@@ -0,0 +1,431 @@
+/**********************************************************
+ * Version $Id: classify_supervised_polygons.cpp 2104 2014-04-21 15:24:01Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_classification                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              classify_supervised_polygons.cpp         //
+//                                                       //
+//                 Copyright (C) 2012 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 "classify_supervised_polygons.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	CLASS_ID	= 0,
+	CLASS_ROI_M,
+	CLASS_ROI_S,
+	CLASS_TOT_N,
+	CLASS_ROI_N
+};
+
+//---------------------------------------------------------
+#define CLASS_NPARMS	(CLASS_ROI_S - CLASS_ROI_M + 1)
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPolygon_Classify_Supervised::CPolygon_Classify_Supervised(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Supervised Classification for Polygons"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2012"));
+
+	Set_Description	(_TW(
+		"Supervised Classification"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POLYGONS"		, _TL("Polygons"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "CLASS_ID"		, _TL("Class Identifier"),
+		_TL("")
+	);
+
+	Parameters.Add_Table_Fields(
+		pNode	, "FIELDS"		, _TL("Attributes"),
+		_TL("")
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "CLASSES"			, _TL("Classification"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Table(
+		NULL	, "CLASS_INFO"		, _TL("Summary"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"			, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			CSG_Classifier_Supervised::Get_Name_of_Method(SG_CLASSIFY_SUPERVISED_MinimumDistance).c_str(),
+			CSG_Classifier_Supervised::Get_Name_of_Method(SG_CLASSIFY_SUPERVISED_SAM).c_str()
+		), 0
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NORMALISE"		, _TL("Normalise"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD_DIST"	, _TL("Distance Threshold"),
+		_TL("Let pixel stay unclassified, if minimum or mahalanobis distance is greater than threshold."),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD_ANGLE"	, _TL("Spectral Angle Threshold (Degree)"),
+		_TL("Let pixel stay unclassified, if spectral angle distance is greater than threshold."),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 90.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CPolygon_Classify_Supervised::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
+	{
+		int	Value	= pParameter->asInt();
+
+		pParameters->Get_Parameter("THRESHOLD_DIST" )->Set_Enabled(Value == 0);
+		pParameters->Get_Parameter("THRESHOLD_ANGLE")->Set_Enabled(Value == 1);
+	}
+
+	//-----------------------------------------------------
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPolygon_Classify_Supervised::On_Execute(void)
+{
+	bool		bNoData;
+	int			Method, Class, i, iPolygon;
+	double		Quality;
+
+	//-------------------------------------------------
+	m_pPolygons		= Parameters("POLYGONS" )->asShapes();
+	m_Class_ID		= Parameters("CLASS_ID" )->asInt();
+ 	m_pClasses		= Parameters("CLASSES"  )->asShapes();
+	m_bNormalise	= Parameters("NORMALISE")->asBool();
+	Method			= Parameters("METHOD"   )->asInt();
+
+	m_Classifier.Set_Distance_Threshold   (Parameters("THRESHOLD_DIST" )->asDouble());
+	m_Classifier.Set_Angle_Threshold      (Parameters("THRESHOLD_ANGLE")->asDouble() * M_DEG_TO_RAD);
+
+	switch( Method )
+	{
+	default:
+	case  0:	Method	= SG_CLASSIFY_SUPERVISED_MinimumDistance;	break;
+	case  1:	Method	= SG_CLASSIFY_SUPERVISED_SAM;				break;
+	}
+
+	//-------------------------------------------------
+	m_Features	= (int *)Parameters("FIELDS")->asPointer();
+	m_nFeatures	=        Parameters("FIELDS")->asInt    ();
+
+	if( !m_Features || m_nFeatures <= 0 )
+	{
+		Error_Set(_TL("no features in selection"));
+
+		return( false );
+	}
+
+	//-------------------------------------------------
+	m_pClasses->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), m_pPolygons->Get_Name(), _TL("Classified")), NULL, m_pPolygons->Get_Vertex_Type());
+	m_pClasses->Add_Field(_TL("CLASS_NR"), SG_DATATYPE_Int);
+	m_pClasses->Add_Field(_TL("CLASS_ID"), SG_DATATYPE_String);
+	m_pClasses->Add_Field(_TL("QUALITY" ), SG_DATATYPE_Double);
+
+	CSG_Vector	Features(m_nFeatures);
+
+	m_Classifier.Create (m_nFeatures);
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("analyzing known classes"));
+
+	for(iPolygon=0; iPolygon<m_pPolygons->Get_Count() && Set_Progress(iPolygon, m_pPolygons->Get_Count()); iPolygon++)
+	{
+		CSG_Shape	*pPolygon	= m_pPolygons->Get_Shape(iPolygon);
+
+		if( SG_STR_LEN(pPolygon->asString(m_Class_ID)) > 0 )
+		{
+			for(i=0, bNoData=false; i<m_nFeatures && !bNoData; i++)
+			{
+				if( pPolygon->is_NoData(m_Features[i]) )
+				{
+					bNoData	= true;
+				}
+				else
+				{
+					Features[i]	= pPolygon->asDouble(m_Features[i]);
+
+					if( m_bNormalise )
+					{
+						Features[i]	= (Features[i] - m_pPolygons->Get_Mean(m_Features[i])) / m_pPolygons->Get_StdDev(m_Features[i]);
+					}
+				}
+			}
+
+			if( !bNoData )
+			{
+				CSG_Simple_Statistics	*pClass	= m_Classifier.Get_Statistics(pPolygon->asString(m_Class_ID));
+
+				for(i=0; i<m_nFeatures; i++)
+				{
+					pClass[i].Add_Value(Features[i]);
+				}
+			}
+		}
+	}
+
+	if( m_Classifier.Get_Class_Count() <= 0 )
+	{
+		Error_Set(_TL("no training areas could be analysed."));
+
+		return( false );
+	}
+
+	//-------------------------------------------------
+	Process_Set_Text(_TL("running classification"));
+
+	for(iPolygon=0; iPolygon<m_pPolygons->Get_Count() && Set_Progress(iPolygon, m_pPolygons->Get_Count()); iPolygon++)
+	{
+		CSG_Shape	*pPolygon	= m_pPolygons->Get_Shape(iPolygon);
+
+		for(i=0, bNoData=false; i<m_nFeatures && !bNoData; i++)
+		{
+			if( pPolygon->is_NoData(m_Features[i]) )
+			{
+				bNoData	= true;
+			}
+			else
+			{
+				Features[i]	= pPolygon->asDouble(m_Features[i]);
+
+				if( m_bNormalise )
+				{
+					Features[i]	= (Features[i] - m_pPolygons->Get_Mean(m_Features[i])) / m_pPolygons->Get_StdDev(m_Features[i]);
+				}
+			}
+		}
+
+		if( !bNoData )
+		{
+			if( m_Classifier.Get_Class(Features, Class, Quality, Method) )
+			{
+				CSG_Shape	*pClass	= m_pClasses->Add_Shape(pPolygon);
+
+				pClass->Set_Value(0, 1 + Class);
+				pClass->Set_Value(1, m_Classifier.Get_Class_ID(Class));
+				pClass->Set_Value(2, Quality);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Finalize();
+
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPolygon_Classify_Supervised::Finalize(void)
+{
+	int			iClass, iFeature, iOffset, nClasses;
+	CSG_String	Name_Method, Name_Quality;
+	CSG_Table	*pTable;
+
+	//-----------------------------------------------------
+	Name_Method		= CSG_Classifier_Supervised::Get_Name_of_Method (Parameters("METHOD")->asInt());
+	Name_Quality	= CSG_Classifier_Supervised::Get_Name_of_Quality(Parameters("METHOD")->asInt());
+
+	//-----------------------------------------------------
+	pTable	= Parameters("CLASS_INFO")->asTable();
+
+	pTable->Destroy();
+	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Class Information"), Name_Method.c_str()));
+
+	pTable->Add_Field(_TL("ID")   , SG_DATATYPE_String);	// CLASS_ID
+
+	for(iFeature=0; iFeature<m_Classifier.Get_Feature_Count(); iFeature++)
+	{
+		pTable->Add_Field(CSG_String::Format(SG_T("B%02d_MEAN")  , iFeature + 1), SG_DATATYPE_Double);	// CLASS_ROI_M
+		pTable->Add_Field(CSG_String::Format(SG_T("B%02d_STDDEV"), iFeature + 1), SG_DATATYPE_Double);	// CLASS_ROI_S
+	}
+
+	pTable->Add_Field(_TL("TOT_N"), SG_DATATYPE_Int);		// CLASS_TOT_N
+	pTable->Add_Field(_TL("ROI_N"), SG_DATATYPE_Int);		// CLASS_ROI_N
+
+	for(iClass=0; iClass<m_Classifier.Get_Class_Count(); iClass++)
+	{
+		CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+		pRecord->Set_Value(CLASS_ID   , m_Classifier.Get_Class_ID(iClass).c_str());
+
+		for(iFeature=0, iOffset=0; iFeature<m_Classifier.Get_Feature_Count(); iFeature++, iOffset+=CLASS_NPARMS)
+		{
+			CSG_Simple_Statistics	*pStatistics	= m_Classifier.Get_Statistics(iClass) + iFeature;
+
+			double	m	= m_bNormalise ? m_pPolygons->Get_Mean  (m_Features[iFeature]) : 0.0;
+			double	s	= m_bNormalise ? m_pPolygons->Get_StdDev(m_Features[iFeature]) : 1.0;
+
+			pRecord->Set_Value(iOffset + CLASS_ROI_M  , pStatistics->Get_Mean   () * s + m);
+			pRecord->Set_Value(iOffset + CLASS_ROI_S  , pStatistics->Get_StdDev () * s);
+		//	pRecord->Set_Value(iOffset + CLASS_ROI_MIN, pStatistics->Get_Minimum() * s + m);
+		//	pRecord->Set_Value(iOffset + CLASS_ROI_MAX, pStatistics->Get_Maximum() * s + m);
+		}
+
+		pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 1, m_Classifier.Get_Statistics(iClass)->Get_Count());
+		pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 2, m_Classifier.Get_Element_Count(iClass));
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(m_pClasses, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		pTable	= P("LUT")->asTable();
+
+		for(iClass=0, nClasses=0; iClass<m_Classifier.Get_Class_Count(); iClass++)
+		{
+			if( m_Classifier.Get_Element_Count(iClass) > 0 )
+			{
+				CSG_Table_Record	*pRecord	= pTable->Get_Record(nClasses++);
+
+				if( pRecord == NULL )
+				{
+					pRecord	= pTable->Add_Record();
+					pRecord->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX));
+				}
+
+				pRecord->Set_Value(1, m_Classifier.Get_Class_ID(iClass).c_str());
+				pRecord->Set_Value(2, m_Classifier.Get_Class_ID(iClass).c_str());
+				pRecord->Set_Value(3, iClass + 1);
+				pRecord->Set_Value(4, iClass + 1);
+			}
+		}
+
+		while( pTable->Get_Record_Count() > m_Classifier.Get_Class_Count() )
+		{
+			pTable->Del_Record(pTable->Get_Record_Count() - 1);
+		}
+
+		P.Set_Parameter("COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
+		P.Set_Parameter("LUT_ATTRIB" , 0);	// Lookup Table Attribute
+
+		DataObject_Set_Parameters(m_pClasses, P);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_classification/classify_supervised_polygons.h b/src/modules/imagery/imagery_classification/classify_supervised_polygons.h
new file mode 100644
index 0000000..5ada73b
--- /dev/null
+++ b/src/modules/imagery/imagery_classification/classify_supervised_polygons.h
@@ -0,0 +1,117 @@
+/**********************************************************
+ * Version $Id: classify_supervised_polygons.h 2104 2014-04-21 15:24:01Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_classification                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             classify_supervised_polygons.h            //
+//                                                       //
+//                 Copyright (C) 2012 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__classify_supervised_polygons_H
+#define HEADER_INCLUDED__classify_supervised_polygons_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPolygon_Classify_Supervised : public CSG_Module
+{
+public:
+	CPolygon_Classify_Supervised(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	bool						m_bNormalise;
+
+	int							m_Class_ID, *m_Features, m_nFeatures;
+
+	CSG_Classifier_Supervised	m_Classifier;
+
+	CSG_Shapes					*m_pPolygons, *m_pClasses;
+
+
+	bool						Finalize				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__classify_supervised_polygons_H
diff --git a/src/modules_images/modules_imagery/imagery_classification/decision_tree.cpp b/src/modules/imagery/imagery_classification/decision_tree.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/decision_tree.cpp
rename to src/modules/imagery/imagery_classification/decision_tree.cpp
diff --git a/src/modules_images/modules_imagery/imagery_classification/decision_tree.h b/src/modules/imagery/imagery_classification/decision_tree.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_classification/decision_tree.h
rename to src/modules/imagery/imagery_classification/decision_tree.h
diff --git a/src/modules_images/modules_opencv/opencv/MLB_Interface.cpp b/src/modules/imagery/imagery_opencv/MLB_Interface.cpp
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/MLB_Interface.cpp
rename to src/modules/imagery/imagery_opencv/MLB_Interface.cpp
diff --git a/src/modules_images/modules_opencv/opencv/MLB_Interface.h b/src/modules/imagery/imagery_opencv/MLB_Interface.h
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/MLB_Interface.h
rename to src/modules/imagery/imagery_opencv/MLB_Interface.h
diff --git a/src/modules/imagery/imagery_opencv/Makefile.am b/src/modules/imagery/imagery_opencv/Makefile.am
new file mode 100644
index 0000000..a360801
--- /dev/null
+++ b/src/modules/imagery/imagery_opencv/Makefile.am
@@ -0,0 +1,31 @@
+#
+# $Id: Makefile.am 1856 2013-10-17 09:46:51Z oconrad $
+#
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+UC_DEFS = -D_SAGA_UNICODE
+endif
+if HAVE_CV
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
+AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = -fPIC -shared -avoid-version -lcv
+pkglib_LTLIBRARIES = libimagery_opencv.la
+libimagery_opencv_la_SOURCES =\
+MLB_Interface.cpp\
+opencv.cpp\
+opencv_fourier.cpp\
+opencv_morphology.cpp\
+opencv_nnet.cpp\
+opencv_svd.cpp\
+MLB_Interface.h\
+opencv.h\
+opencv_fourier.h\
+opencv_morphology.h\
+opencv_nnet.h\
+opencv_svd.h
+
+libimagery_opencv_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+endif
diff --git a/src/modules/imagery/imagery_opencv/Makefile.in b/src/modules/imagery/imagery_opencv/Makefile.in
new file mode 100644
index 0000000..38f16c6
--- /dev/null
+++ b/src/modules/imagery/imagery_opencv/Makefile.in
@@ -0,0 +1,649 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_opencv
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+ at HAVE_CV_TRUE@libimagery_opencv_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am__libimagery_opencv_la_SOURCES_DIST = MLB_Interface.cpp opencv.cpp \
+	opencv_fourier.cpp opencv_morphology.cpp opencv_nnet.cpp \
+	opencv_svd.cpp MLB_Interface.h opencv.h opencv_fourier.h \
+	opencv_morphology.h opencv_nnet.h opencv_svd.h
+ at HAVE_CV_TRUE@am_libimagery_opencv_la_OBJECTS = MLB_Interface.lo \
+ at HAVE_CV_TRUE@	opencv.lo opencv_fourier.lo opencv_morphology.lo \
+ at HAVE_CV_TRUE@	opencv_nnet.lo opencv_svd.lo
+libimagery_opencv_la_OBJECTS = $(am_libimagery_opencv_la_OBJECTS)
+ at HAVE_CV_TRUE@am_libimagery_opencv_la_rpath = -rpath $(pkglibdir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_opencv_la_SOURCES)
+DIST_SOURCES = $(am__libimagery_opencv_la_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1856 2013-10-17 09:46:51Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
+ at HAVE_CV_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+ at HAVE_CV_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
+ at HAVE_CV_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+ at HAVE_CV_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version -lcv
+ at HAVE_CV_TRUE@pkglib_LTLIBRARIES = libimagery_opencv.la
+ at HAVE_CV_TRUE@libimagery_opencv_la_SOURCES = \
+ at HAVE_CV_TRUE@MLB_Interface.cpp\
+ at HAVE_CV_TRUE@opencv.cpp\
+ at HAVE_CV_TRUE@opencv_fourier.cpp\
+ at HAVE_CV_TRUE@opencv_morphology.cpp\
+ at HAVE_CV_TRUE@opencv_nnet.cpp\
+ at HAVE_CV_TRUE@opencv_svd.cpp\
+ at HAVE_CV_TRUE@MLB_Interface.h\
+ at HAVE_CV_TRUE@opencv.h\
+ at HAVE_CV_TRUE@opencv_fourier.h\
+ at HAVE_CV_TRUE@opencv_morphology.h\
+ at HAVE_CV_TRUE@opencv_nnet.h\
+ at HAVE_CV_TRUE@opencv_svd.h
+
+ at HAVE_CV_TRUE@libimagery_opencv_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_opencv/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_opencv/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_opencv.la: $(libimagery_opencv_la_OBJECTS) $(libimagery_opencv_la_DEPENDENCIES) $(EXTRA_libimagery_opencv_la_DEPENDENCIES) 
+	$(CXXLINK) $(am_libimagery_opencv_la_rpath) $(libimagery_opencv_la_OBJECTS) $(libimagery_opencv_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_fourier.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_morphology.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_nnet.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_svd.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_images/modules_opencv/opencv/opencv.cpp b/src/modules/imagery/imagery_opencv/opencv.cpp
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv.cpp
rename to src/modules/imagery/imagery_opencv/opencv.cpp
diff --git a/src/modules_images/modules_opencv/opencv/opencv.h b/src/modules/imagery/imagery_opencv/opencv.h
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv.h
rename to src/modules/imagery/imagery_opencv/opencv.h
diff --git a/src/modules_images/modules_opencv/opencv/opencv_fourier.cpp b/src/modules/imagery/imagery_opencv/opencv_fourier.cpp
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_fourier.cpp
rename to src/modules/imagery/imagery_opencv/opencv_fourier.cpp
diff --git a/src/modules_images/modules_opencv/opencv/opencv_fourier.h b/src/modules/imagery/imagery_opencv/opencv_fourier.h
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_fourier.h
rename to src/modules/imagery/imagery_opencv/opencv_fourier.h
diff --git a/src/modules_images/modules_opencv/opencv/opencv_morphology.cpp b/src/modules/imagery/imagery_opencv/opencv_morphology.cpp
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_morphology.cpp
rename to src/modules/imagery/imagery_opencv/opencv_morphology.cpp
diff --git a/src/modules_images/modules_opencv/opencv/opencv_morphology.h b/src/modules/imagery/imagery_opencv/opencv_morphology.h
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_morphology.h
rename to src/modules/imagery/imagery_opencv/opencv_morphology.h
diff --git a/src/modules_images/modules_opencv/opencv/opencv_nnet.cpp b/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_nnet.cpp
rename to src/modules/imagery/imagery_opencv/opencv_nnet.cpp
diff --git a/src/modules_images/modules_opencv/opencv/opencv_nnet.h b/src/modules/imagery/imagery_opencv/opencv_nnet.h
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_nnet.h
rename to src/modules/imagery/imagery_opencv/opencv_nnet.h
diff --git a/src/modules_images/modules_opencv/opencv/opencv_svd.cpp b/src/modules/imagery/imagery_opencv/opencv_svd.cpp
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_svd.cpp
rename to src/modules/imagery/imagery_opencv/opencv_svd.cpp
diff --git a/src/modules_images/modules_opencv/opencv/opencv_svd.h b/src/modules/imagery/imagery_opencv/opencv_svd.h
similarity index 100%
rename from src/modules_images/modules_opencv/opencv/opencv_svd.h
rename to src/modules/imagery/imagery_opencv/opencv_svd.h
diff --git a/src/modules/imagery/imagery_photogrammetry/.deps/Colorisation.Plo b/src/modules/imagery/imagery_photogrammetry/.deps/Colorisation.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/.deps/Colorisation.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/src/modules/imagery/imagery_photogrammetry/.deps/MLB_Interface.Plo b/src/modules/imagery/imagery_photogrammetry/.deps/MLB_Interface.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/.deps/MLB_Interface.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/src/modules/imagery/imagery_photogrammetry/.deps/Resection.Plo b/src/modules/imagery/imagery_photogrammetry/.deps/Resection.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/.deps/Resection.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/src/modules/imagery/imagery_photogrammetry/.deps/methods.Plo b/src/modules/imagery/imagery_photogrammetry/.deps/methods.Plo
new file mode 100644
index 0000000..9ce06a8
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/.deps/methods.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp b/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp
new file mode 100644
index 0000000..97c7c72
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp
@@ -0,0 +1,322 @@
+/**********************************************************
+ * Version $Id: Colorisation.cpp 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Colorisation.cpp                    //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     avishek.dutta at hft-stuttgart.de         //
+//                                                       //
+//    contact:    Avishek Dutta                          //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                D-70174 Stuttgart                      //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Colorisation.h"
+#include "methods.h"
+#include <saga_api/api_core.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CColorisation::CColorisation(void)
+{
+	Set_Name		(_TL("Colorisation (PC)"));
+
+	Set_Author		(SG_T("HfT Stuttgart (c) 2013"));
+
+	Set_Description	(_TW(
+					"This module attaches the color information from a RGB image to Laser Points."
+					"\n The RGB Image and the Point Cloud to be colorised are the inputs along "
+					"with the interior and exterior orientation parameters of the camera. The "
+					"necessary interior orientation parameters are Focal Length (mm), Pixel "
+					"Size (um), Principal Point Offsets (pixels) and optionally the Radial "
+					"Distortion Parameters. The distortion model being used is as follows: "
+					"\n	 x_d = x_u (1 - dR)"
+					"\n	 y_d = y_u (1 - dR) "
+					"\n where, dR = K1 * r_u ^ 2 + K2 * r_u ^ 4 + K3 * r_u ^ 6,"
+					"\n r_u ^ 2  = x_u ^ 2 + y_u ^ 2,"
+					"\n x_u, y_u are the undistorted (corrected) image coordinates in mm,"
+					"\n x_d, y_d are the distorted (observed) image coordinates in mm,"
+					"\n K1 is in [mm ^ -2], K2 is in [mm ^ -4],  K3 is in [mm ^ -6]."
+					"\nThe necessary exterior orientation parameters are the coordinates of the "
+					"Projection Center and the Cardan angles Omega, Kappa and Alpha. The Cardan "
+					"angles refer to the following transformation between image coordinates "
+					"(x_image) and global coordinates (X_Global): "
+					"\n x_image = R_1(omega) * R_2(kappa) * R_3(alpha) * X_Global "
+					"\n\n [Optional] If the Time Stamp of the RGB Image is given, an acceptable time difference"
+					" between the points and the image must provided in order to colorise only those points falling"
+					" that range. If no time is given all points are colorised."
+					"\n The result is a colorised point cloud."
+					"\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(NULL, "rgbImage", _TL("RGB Image"), _TL("RGB Image"), PARAMETER_INPUT);
+
+	Parameters.Add_PointCloud(
+		NULL	, "PC_IN"		, _TL("Points to be Colorised"),
+		_TL("Points to be Colorised"),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Value (NULL, "GIVE_TIME", _TL ("Provide Time stamp of Image?"), _TL ("Do you wish to provide the time stamp of Image?"), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value (NULL, "IMG_TIME", _TL ("Time stamp of Image"), _TL ("Time stamp of Image"), PARAMETER_TYPE_Double);
+	Parameters.Add_Value (NULL, "TIME_DIFF", _TL ("Time Difference between Image & Points"), _TL ("Acceptable Time Difference between Image and Laser Points"), PARAMETER_TYPE_Double);
+	
+	Parameters.Add_Node(NULL, "INT ORI", _TL("Interior Orientation Parameters"), _TL("Internal Orientation Parameters"));
+		Parameters.Add_Value (Parameters("INT ORI"), "F", _TL ("Focal Length (mm)"), _TL ("Focal Length in mm"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "W", _TL ("Pixel Width (um)"), _TL ("Pixel Width in micro meters"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "ppX", _TL ("Principal Point Offset in X (pixles)"), _TL ("Principal Point Offset in X"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "ppY", _TL ("Principal Point Offset in Y (pixels)"), _TL ("Principal Point Offset in Y"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "GIVE_DISTORTIONS", _TL ("Provide Radial Distortion Parameters?"), _TL ("Do you wish to provide the Radial Distortion Parameters?"), PARAMETER_TYPE_Bool, false);
+		Parameters.Add_Value (Parameters("INT ORI"), "K1", _TL ("K1"), _TL ("K1"), PARAMETER_TYPE_Double, 0.0);
+		Parameters.Add_Value (Parameters("INT ORI"), "K2", _TL ("K2"), _TL ("K2"), PARAMETER_TYPE_Double, 0.0);
+		Parameters.Add_Value (Parameters("INT ORI"), "K3", _TL ("K3"), _TL ("K3"), PARAMETER_TYPE_Double, 0.0);
+
+	Parameters.Add_Node(NULL, "EXT ORI", _TL("Exterior Orientation Parameters"), _TL("Exterior Orientation Parameters"));
+		Parameters.Add_Value (Parameters("EXT ORI"), "Xc", _TL ("Projection Centre - X"), _TL ("Projection Centre"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("EXT ORI"), "Yc", _TL ("Projection Centre - Y"), _TL ("Projection Centre"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("EXT ORI"), "Zc", _TL ("Projection Centre - Z"), _TL ("Projection Centre"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("EXT ORI"), "omega", _TL ("Omega"), _TL ("Rotation Angle"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("EXT ORI"), "kappa", _TL ("Kappa"), _TL ("Rotation Angle"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("EXT ORI"), "alpha", _TL ("Alpha"), _TL ("Rotation Angle"), PARAMETER_TYPE_Double);
+
+	
+	Parameters.Add_PointCloud(
+		NULL	, "PC_OUT"		, _TL("Colorised Point Cloud"),
+		_TL("Colorised Point Cloud"),
+		PARAMETER_OUTPUT
+	);
+	
+}
+
+//---------------------------------------------------------
+bool CColorisation::On_Execute(void)
+{
+	
+	CSG_Vector center(3), angles(3);
+
+	CSG_Grid *rgbImage		= Parameters("rgbImage")	->asGrid();
+	CSG_PointCloud *pPoints	= Parameters("PC_IN")		->asPointCloud();
+	CSG_PointCloud *pResult	= Parameters("PC_OUT")		->asPointCloud();
+	double c				= Parameters("F")			->asDouble();		// Focal Length (mm)
+	double pixWmm			= Parameters("W")			->asDouble() / 1000;// Pixel Width (mm)
+	double ppOffsetX		= Parameters("ppX")			->asDouble();		// Principal Point Offset X (pixels)
+	double ppOffsetY		= Parameters("ppY")			->asDouble();		// Principal Point Offset Y (pixels)
+	center[0]				= Parameters("Xc")			->asDouble();
+	center[1]				= Parameters("Yc")			->asDouble();
+	center[2]				= Parameters("Zc")			->asDouble();
+	angles[0]				= Parameters("omega")		->asDouble();
+	angles[1]				= Parameters("kappa")		->asDouble();
+	angles[2]				= Parameters("alpha")		->asDouble();
+
+	int pointCount = pPoints->Get_Point_Count();
+	int attrCount = pPoints->Get_Attribute_Count();
+	
+	bool applyDistortions = false;
+	CSG_Vector K(3);
+	if ( Parameters("GIVE_DISTORTIONS")->asBool() ) {
+
+		applyDistortions = true;
+		K[0]			= Parameters("K1")			->asDouble();
+		K[1]			= Parameters("K2")			->asDouble();
+		K[2]			= Parameters("K3")			->asDouble();
+
+	}
+
+	double imgTimeStamp = 0;
+	double timeThresh = 0;
+	bool applyTimeStamp		= Parameters("GIVE_TIME")	->asBool();
+	if (applyTimeStamp) {
+
+		imgTimeStamp = Parameters("IMG_TIME")	->asDouble();
+		timeThresh	= Parameters("TIME_DIFF")	->asDouble();
+	}
+
+	pResult->Create(pPoints);
+	pResult->Set_Name(CSG_String::Format(_TL("%s_colorised"), pPoints->Get_Name()));
+//	pResult->Add_Field(SG_T("Red"), SG_DATATYPE_Int);
+//	pResult->Add_Field(SG_T("Green"), SG_DATATYPE_Int);
+//	pResult->Add_Field(SG_T("Blue"), SG_DATATYPE_Int);
+	pResult->Add_Field(SG_T("RGB"), SG_DATATYPE_Int);
+	DataObject_Update(pResult);
+		
+	CSG_Matrix R = methods::calcRotnMatrix(angles);
+
+	double xmin = rgbImage->Get_XMin();
+	double xmax = rgbImage->Get_XMax();
+	double ymin = rgbImage->Get_YMin();
+	double ymax = rgbImage->Get_YMax();
+	
+	int iAccept = 0;
+	
+	for (int i = 0; i < pointCount && Set_Progress(i, pointCount); i++) {
+		
+		if ( applyTimeStamp && abs( imgTimeStamp - pPoints->Get_Attribute(i,0) ) >= timeThresh ) {
+			
+			continue;
+
+		}
+
+		CSG_Vector pqs(3);										// Approx. pi, qi, si
+		for (int j = 0; j < 3; j++) {
+			pqs[j] = R[j][0] * (pPoints->Get_X(i) - center[0]) 
+					+ R[j][1] * (pPoints->Get_Y(i) - center[1]) 
+					+ R[j][2] * (pPoints->Get_Z(i) - center[2]);
+		}
+
+		double p_i = pqs[0];
+		double q_i = pqs[1];
+		double s_i = pqs[2];
+
+		// Check for points behind image plane
+		if ( q_i < 0) {
+			continue;
+		}
+
+		// Image coordinates in mm
+		CSG_Vector pixelPos(2);
+		pixelPos[0] = c * p_i / q_i;
+		pixelPos[1] = c * s_i / q_i;
+			
+		if ( applyDistortions ) {
+
+			pixelPos = getDistortedPositions(pixelPos, K);
+
+		}
+
+		// Image coordinates in pixels
+		pixelPos[0] = ( pixelPos[0] / pixWmm ) + ppOffsetX;
+		pixelPos[1] = ( pixelPos[1] / pixWmm ) + ppOffsetY;
+
+		int row = (int)floor(pixelPos[1] + 0.5);
+		int col = (int)floor(pixelPos[0] + 0.5);
+
+		if ( col >= xmin && col <= xmax && row >= ymin && row <= ymax ) {
+
+			pResult->Add_Point(pPoints->Get_X(i), pPoints->Get_Y(i), pPoints->Get_Z(i));
+
+			int iField;
+
+			for(iField = 0; iField < attrCount; iField ++)
+			{
+				pResult->Set_Attribute(iAccept, iField, pPoints->Get_Attribute(i, iField));
+			}
+
+			pResult->Set_Attribute(iAccept, iField, rgbImage->asInt( col, row ));
+				
+			iAccept ++;
+
+		}
+
+		pqs.Destroy();
+		pixelPos.Destroy();
+
+	}
+
+	DataObject_Update(pResult);
+
+	R.Destroy();
+	K.Destroy();
+	center.Destroy();
+	angles.Destroy();
+	
+	return true;
+}
+
+//---------------------------------------------------------
+int CColorisation::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GIVE_DISTORTIONS")) )
+	{
+		pParameters->Get_Parameter("K1")->Set_Enabled( pParameter->asBool() );
+		pParameters->Get_Parameter("K2")->Set_Enabled( pParameter->asBool() );
+		pParameters->Get_Parameter("K3")->Set_Enabled( pParameter->asBool() );
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GIVE_TIME")) )
+	{
+		pParameters->Get_Parameter("IMG_TIME")->Set_Enabled( pParameter->asBool() );
+		pParameters->Get_Parameter("TIME_DIFF")->Set_Enabled( pParameter->asBool() );
+	}
+
+	return 1;
+}
+
+//---------------------------------------------------------
+CSG_Vector CColorisation::getDistortedPositions(CSG_Vector pixPos, CSG_Vector K)
+{
+
+	CSG_Vector XYd(2);
+
+	double r2 = pow(pixPos[0], 2.0) + pow(pixPos[1], 2.0);
+	double dR = K[0] * r2 + K[1] * pow(r2, 2) + K[2] * pow(r2, 3);
+	
+	XYd[0] = pixPos[0] * (1 - dR);
+	XYd[1] = pixPos[1] * (1 - dR);
+
+	return XYd;
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
\ No newline at end of file
diff --git a/src/modules/imagery/imagery_photogrammetry/Colorisation.h b/src/modules/imagery/imagery_photogrammetry/Colorisation.h
new file mode 100644
index 0000000..735a357
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/Colorisation.h
@@ -0,0 +1,92 @@
+/**********************************************************
+ * Version $Id: Colorisation.h 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Colorisation.h                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     avishek.dutta at hft-stuttgart.de         //
+//                                                       //
+//    contact:    Avishek Dutta                          //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                D-70174 Stuttgart                      //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Colorisation_H
+#define HEADER_INCLUDED__Colorisation_H
+
+//---------------------------------------------------------
+# include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CColorisation : public CSG_Module
+{
+public:
+	CColorisation									(void);
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+protected:
+
+	virtual bool			On_Execute				(void);
+
+private:
+	
+	CSG_Vector				getDistortedPositions	(CSG_Vector pixPos, CSG_Vector K);
+
+};
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Colorisation_H
\ No newline at end of file
diff --git a/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp
new file mode 100644
index 0000000..60579fb
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp
@@ -0,0 +1,124 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2009 by                 //
+//                 SAGA User Group Assoc.                //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     author at email.de                        //
+//                                                       //
+//    contact:    Author                                 //
+//                Sesame Street. 7                       //
+//                12345 Metropolis                       //
+//                Nirwana                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//			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("Imagery - Photogrammetry") );
+
+	case MLB_INFO_Author:
+		return( SG_T("HfT Stuttgart (c) 2013") );
+
+	case MLB_INFO_Description:
+		return( _TL("Photogrammetry tools.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Imagery|Photogrammetry") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "Resection.h"
+#include "Colorisation.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case 0:		return ( new CResection );
+		
+	case 1:		return ( new CColorisation );
+
+	default:	return ( NULL );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h
new file mode 100644
index 0000000..877bae2
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h
@@ -0,0 +1,68 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2009 by                 //
+//                 SAGA User Group Assoc.                //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     author at email.de                        //
+//                                                       //
+//    contact:    Author                                 //
+//                Sesame Street. 7                       //
+//                12345 Metropolis                       //
+//                Nirwana                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__imagery_photogrammetry_H
+#define HEADER_INCLUDED__imagery_photogrammetry_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__imagery_photogrammetry_H
diff --git a/src/modules/imagery/imagery_photogrammetry/Makefile.am b/src/modules/imagery/imagery_photogrammetry/Makefile.am
new file mode 100644
index 0000000..138d75a
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/Makefile.am
@@ -0,0 +1,23 @@
+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 = libimagery_photogrammetry.la
+libimagery_photogrammetry_la_SOURCES =\
+Colorisation.cpp\
+methods.cpp\
+MLB_Interface.cpp\
+Resection.cpp\
+Colorisation.h\
+methods.h\
+MLB_Interface.h\
+Resection.h
+
+libimagery_photogrammetry_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/imagery/imagery_photogrammetry/Makefile.in b/src/modules/imagery/imagery_photogrammetry/Makefile.in
new file mode 100644
index 0000000..76eb4dc
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/Makefile.in
@@ -0,0 +1,635 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_photogrammetry
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libimagery_photogrammetry_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libimagery_photogrammetry_la_OBJECTS = Colorisation.lo methods.lo \
+	MLB_Interface.lo Resection.lo
+libimagery_photogrammetry_la_OBJECTS =  \
+	$(am_libimagery_photogrammetry_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_photogrammetry_la_SOURCES)
+DIST_SOURCES = $(libimagery_photogrammetry_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libimagery_photogrammetry.la
+libimagery_photogrammetry_la_SOURCES = \
+Colorisation.cpp\
+methods.cpp\
+MLB_Interface.cpp\
+Resection.cpp\
+Colorisation.h\
+methods.h\
+MLB_Interface.h\
+Resection.h
+
+libimagery_photogrammetry_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_photogrammetry/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_photogrammetry/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_photogrammetry.la: $(libimagery_photogrammetry_la_OBJECTS) $(libimagery_photogrammetry_la_DEPENDENCIES) $(EXTRA_libimagery_photogrammetry_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_photogrammetry_la_OBJECTS) $(libimagery_photogrammetry_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Colorisation.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Resection.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/methods.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/imagery/imagery_photogrammetry/Resection.cpp b/src/modules/imagery/imagery_photogrammetry/Resection.cpp
new file mode 100644
index 0000000..06f90fa
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/Resection.cpp
@@ -0,0 +1,564 @@
+/**********************************************************
+ * Version $Id: Resection.cpp 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     Resection.cpp                     //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     avishek.dutta at hft-stuttgart.de         //
+//                                                       //
+//    contact:    Avishek Dutta                          //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                D-70174 Stuttgart                      //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Resection.h"
+#include "methods.h"
+#include <algorithm>
+
+// Convergence Criteria (mm)
+const double thresh = 1;
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CResection::CResection(void)
+{
+	Set_Name		(_TL("Resection (Terrestrial)"));
+
+	Set_Author		(SG_T("HfT Stuttgart (c) 2013"));
+
+	Set_Description	(_TW(
+		"Single Image Spatial Resection (Terrestrial): from at least 3 image points with known "
+		"coordinates, the Cardan angles of the image orientation and the coordinates of the "
+		"perspective center are calculated by a least-squares adjustment. The Cardan angles "
+		"refer to the following transformation between image coordinates (x_image) and global "
+		"coordinates (X_Global): \n\t x_image = R_1(omega) * R_2(kappa) * R_3(alpha) * X_Global "
+		"\n Here R_1, R_2, R_3 denote rotation matrices of a right-handed (passive) coordinate "
+		"transformation.\n\nThe inputs consist of a point cloud containing the identical points "
+		"with their pixel indices as additional attributes. The origin of pixels is in the lower "
+		"left corner of the image. The interior orientation parameters of the camera is to be "
+		"provided. These include Focal Length (mm), Pixel Size (um), Principal Point Offsets (pixels) "
+		"and optionally the Radial Distortion Parameters. The distortion model being used is as follows: "
+		"\n	 x_d = x_u (1 - dR)"
+		"\n	 y_d = y_u (1 - dR) "
+		"\n where, dR = K1 * r_u ^ 2 + K2 * r_u ^ 4 + K3 * r_u ^ 6,"
+		"\n r_u ^ 2  = x_u ^ 2 + y_u ^ 2,"
+		"\n x_u, y_u are the undistorted (corrected) image coordinates in mm,"
+		"\n x_d, y_d are the distorted (observed) image coordinates in mm,"
+		"\n K1 is in [mm ^ -2], K2 is in [mm ^ -4],  K3 is in [mm ^ -6]."
+		"\nApproximate coordinates in [m] for the Projection Center and the center of image are also "
+		"to be provided.\n\nFollowing the adjustment the results are written to a text file. The main "
+		"contents of the text file are: for each iteration the Sum of Squared Residuals, the A-Posteriori "
+		"Standard Deviation (Sigma Naught) and the Condition of Normal Matrix, and the final estimated "
+		"exterior orientation parameters (Xc, Yc, Zc, Omega, Kappa, Alpha).\n\n Optionally the Principal "
+		"Point Offsets can be estimated. This requires at least 4 image points as input."
+		"\n\n[Warning] The module is dedicated to the terrestrial case which means the viewing direction "
+		"must be sufficiently different from the vertical direction."
+		"\nThe estimation of Principal Point Offsets is not recommended if the condition of the Normal "
+		"Matrix is less than 10 ^ -7."
+		"\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_PointCloud(
+		NULL	, "POINTS"		, _TL("Measured Points (PC)"),
+		_TL("List of Measured Points as PC"),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Node(NULL, "INT ORI", _TL("Interior Orientation Parameters"), _TL("Internal Orientation Parameters"));
+		Parameters.Add_Value (Parameters("INT ORI"), "F", _TL ("Focal Length (mm)"), _TL ("Focal Length in mm"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "W", _TL ("Pixel Width (um)"), _TL ("Pixel Width in micro meters"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "EST_OFFSETS", _TL ("Estimate Principal Point Offsets?"), _TL ("Do you wish to estimate Principal Point Offsets?"), PARAMETER_TYPE_Bool, false);
+		Parameters.Add_Value (Parameters("INT ORI"), "ppX", _TL ("Principal Point Offset in X (pixels)"), _TL ("Principal Point Offset in X"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "ppY", _TL ("Principal Point Offset in Y (pixels)"), _TL ("Principal Point Offset in Y"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("INT ORI"), "GIVE_DISTORTIONS", _TL ("Provide Radial Distortion Parameters?"), _TL ("Do you wish to provide the Radial Distortion Parameters?"), PARAMETER_TYPE_Bool, false);
+		Parameters.Add_Value (Parameters("INT ORI"), "K1", _TL ("K1"), _TL ("K1"), PARAMETER_TYPE_Double, 0.0);
+		Parameters.Add_Value (Parameters("INT ORI"), "K2", _TL ("K2"), _TL ("K2"), PARAMETER_TYPE_Double, 0.0);
+		Parameters.Add_Value (Parameters("INT ORI"), "K3", _TL ("K3"), _TL ("K3"), PARAMETER_TYPE_Double, 0.0);
+
+	Parameters.Add_Node(NULL, "PROJ CENTER", _TL("Approximate Coordinates of Projection Center"), _TL("Approximate Coordinates of Projection Center"));
+		Parameters.Add_Value (Parameters("PROJ CENTER"), "Xc", _TL ("X"), _TL ("Approximate Coordinate"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("PROJ CENTER"), "Yc", _TL ("Y"), _TL ("Approximate Coordinate"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("PROJ CENTER"), "Zc", _TL ("Z"), _TL ("Approximate Coordinate"), PARAMETER_TYPE_Double);
+
+	Parameters.Add_Node(NULL, "TARGET", _TL("Approximate Coordinates of Target Point"), _TL("Approximate Coordinates of Target Point"));
+		Parameters.Add_Value (Parameters("TARGET"), "Xt", _TL ("X"), _TL ("Approximate Coordinate"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("TARGET"), "Yt", _TL ("Y"), _TL ("Approximate Coordinate"), PARAMETER_TYPE_Double);
+		Parameters.Add_Value (Parameters("TARGET"), "Zt", _TL ("Z"), _TL ("Approximate Coordinate"), PARAMETER_TYPE_Double);
+
+	Parameters.Add_FilePath(
+		NULL	, "OUTPUT FILE"	, _TL("Output Text File"),
+		_TL("The file to write the Calculation Results to."),
+		CSG_String::Format(SG_T("%s|%s"),
+			_TL("Text Files (*.txt)")	, SG_T("*.txt")
+		), NULL, true
+	);
+	
+}
+
+//---------------------------------------------------------
+bool CResection::On_Execute(void)
+{
+
+	CSG_PointCloud			*pPoints;									// Input Point Cloud
+	CSG_String				fileName;
+	CSG_File				*pTabStream = NULL;
+	int n					= 6;										// Number of unknowns
+	CSG_Vector center(3);
+	CSG_Vector target(3);
+
+	double c			= Parameters("F")			->asDouble();		// Focal Length (mm)
+	double pixWmm		= Parameters("W")			->asDouble() / 1000;// Pixel Width (mm)
+	double ppOffsetX	= Parameters("ppX")			->asDouble();		// Principal Point Offset X (pixels)
+	double ppOffsetY	= Parameters("ppY")			->asDouble();		// Principal Point Offset Y (pixels)
+	pPoints				= Parameters("POINTS")		->asPointCloud();
+	fileName			= Parameters("OUTPUT FILE")	->asString();
+	center[0]			= Parameters("Xc")			->asDouble();
+	center[1]			= Parameters("Yc")			->asDouble();
+	center[2]			= Parameters("Zc")			->asDouble();
+	target[0]			= Parameters("Xt")			->asDouble();
+	target[1]			= Parameters("Yt")			->asDouble();
+	target[2]			= Parameters("Zt")			->asDouble();
+
+	int pointCount = pPoints->Get_Point_Count();
+
+	bool estPPOffsets = false;
+
+	if ( Parameters("EST_OFFSETS")->asBool() ) {
+
+		estPPOffsets = true;
+		n = 8;															// Increase number of unknowns by 2
+	}
+
+	bool applyDistortions = false;
+	CSG_Vector K(3);
+
+	if ( Parameters("GIVE_DISTORTIONS")->asBool() ) {
+
+		applyDistortions = true;
+		K[0]			= Parameters("K1")			->asDouble();
+		K[1]			= Parameters("K2")			->asDouble();
+		K[2]			= Parameters("K3")			->asDouble();
+
+	}
+
+	double dxapp = center [0] - target [0];
+	double dyapp = center [1] - target [1];
+	double dzapp = center [2] - target [2];
+	double h_d	= sqrt (dxapp * dxapp + dyapp * dyapp + dzapp * dzapp);	// Distance between Proj. Center & Target (m)
+	double h_dmm = h_d * 1000;											// Convert to mm
+
+	if( fileName.Length() == 0 )
+	{
+		SG_UI_Msg_Add_Error(_TL("Please provide an output file name!"));
+		return( false );
+	}
+
+	pTabStream = new CSG_File();
+
+	if( !pTabStream->Open(fileName, SG_FILE_W, false) )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format(_TL("Unable to open output file %s!"), fileName.c_str()));
+		delete (pTabStream);
+		return (false);
+	}
+
+
+	CSG_Vector rotns = methods::calcRotations(center,target);			// Approx. rotations omega, kappa, alpha
+
+	CSG_String msg = "********* Initial Approximate Values *********";
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Rotation Angles:");
+	pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Omega:\t") + SG_Get_String(rotns[0],6,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Kappa:\t") + SG_Get_String(rotns[1],6,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Alpha:\t") + SG_Get_String(rotns[2],6,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Projection Center:");
+	pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Xc:\t") + SG_Get_String(center[0],4,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Yc:\t") + SG_Get_String(center[1],4,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Zc:\t") + SG_Get_String(center[2],4,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	
+	if (estPPOffsets) {
+
+		msg = SG_T("Principal Point Offsets:");
+		pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+
+		msg = SG_T("ppX:\t") + SG_Get_String(ppOffsetX,5,false);
+		pTabStream->Write(msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+		msg = SG_T("ppY:\t") + SG_Get_String(ppOffsetY,5,false);
+		pTabStream->Write(msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+
+	}
+
+	double itrNo = 0;
+	CSG_Matrix invN;
+	
+	while (true) {													// Begin Iterations
+
+		itrNo++;
+		
+		double omega = rotns[0];
+		double kappa = rotns[1];
+		double alpha = rotns[2];
+
+		CSG_Matrix R = methods::calcRotnMatrix(rotns);				// Rotation Matrix from approximate values
+		CSG_Matrix E(3,3);											// [w1;w2;w3] = E * [dw;dk;da]
+
+		E[0][0] = -1;
+		E[0][1] = E[1][0] = E[2][0] = 0;
+		E[0][2] = sin(kappa);
+		E[1][1] = -cos(omega);
+		E[1][2] = -sin(omega) * cos(kappa);
+		E[2][1] = sin(omega);
+		E[2][2] = -cos(omega) * cos(kappa);
+
+		CSG_Matrix N(n,n);											// Transpose(Design Matrix) * I * Design Matrix
+		CSG_Vector ATL(n);											// Transpose(Design Matrix) * I * Shortened obs. vector
+
+		double SS = 0;
+		double sigma_naught = 0;
+		
+		for (int i = 0; i < pointCount; i++) {
+			
+			CSG_Vector pqs(3);										// Approx. pi, qi, si
+
+			for (int j = 0; j < 3; j++) {
+				pqs[j] = R[j][0] * (pPoints->Get_X(i) - center[0]) +
+						 R[j][1] * (pPoints->Get_Y(i) - center[1]) +
+						 R[j][2] * (pPoints->Get_Z(i) - center[2]);
+			}
+
+			double p_i = pqs[0];
+			double q_i = pqs[1];
+			double s_i = pqs[2];
+
+			double dR =  0;
+			
+			// Undistorted
+			double x_u = c * p_i / q_i;
+			double y_u = c * s_i / q_i;
+			
+			double c_hat = c;
+			
+			if (applyDistortions) {
+				double r2 = x_u * x_u + y_u * y_u;
+				dR =  K[0] * r2 + K[1] * r2 * r2 + K[2] * r2 * r2 * r2;
+				c_hat = c * (1 - dR);
+			}
+
+			// Approx. image coordinates (with distortions)
+			double x_i = (1 - dR) * x_u + ppOffsetX * pixWmm;
+			double z_i = (1 - dR) * y_u + ppOffsetY * pixWmm;
+
+			// Shortened obervation vector: dxi & dzi
+			double dx_i = pPoints->Get_Attribute(i,0) * pixWmm - x_i;
+			double dz_i = pPoints->Get_Attribute(i,1) * pixWmm - z_i;
+			SS += pow(dx_i,2) + pow(dz_i,2);
+
+			/*
+				x_i, z_i in [mm]
+				p_i,q_i,s_i in [m]
+				h_d in [m]
+				c, c_hat in [mm]
+				h_dmm in [mm]
+			*/
+			CSG_Matrix L(3,2);										// CSG_Matrix takes columns first and rows second
+			CSG_Matrix V(3,3);
+			CSG_Matrix LR(3,2);
+			CSG_Matrix LVE(3,2);
+
+			L[0][0] = L[1][2] = c_hat / (1000 * q_i);
+			L[0][2] = L[1][0] = 0;
+			L[0][1] = -x_u * (1 - dR) / (1000 * q_i);
+			L[1][1] = -y_u * (1 - dR) / (1000 * q_i);
+
+			V[0][0] = V[1][1] = V[2][2] = 0;
+			V[0][1] =  s_i / h_d;
+			V[0][2] = -q_i / h_d;
+			V[1][0] = -s_i / h_d;
+			V[1][2] =  p_i / h_d;
+			V[2][0] =  q_i / h_d;
+			V[2][1] = -p_i / h_d;
+
+			LVE = ( L * V ) * E;
+			LR = L * R;
+
+			// Design Matrix (J)
+			CSG_Matrix design(n,2);
+
+			for(int j = 0; j < 2; j++) {
+				for(int k = 0; k < 3; k++) {
+					design[j][k] = LVE[j][k];
+					design[j][k+3] = -LR[j][k];
+				}
+			}
+
+			if ( estPPOffsets ) {
+				design[0][6] = design[1][7] = 1.0;
+			}
+
+			// Build Normal Matrix
+			for(int j = 0; j < n; j++) {
+				for(int k = 0; k < n; k++) {
+					N[j][k] += (design[0][j] * design[0][k] + design[1][j] * design[1][k]);
+				}
+			}
+
+			// Build Tranpose (J) * I * (Shortened obs. vector)
+			for (int m=0; m < n; m++) {
+				ATL[m] += design[0][m] * dx_i + design[1][m] * dz_i;
+			}
+
+			L.Destroy();
+			V.Destroy();
+			LR.Destroy();
+			LVE.Destroy();
+			pqs.Destroy();
+			design.Destroy();
+
+		} // end looping over observations
+
+		// Eigen values and Eigen Vectors
+		CSG_Vector eigenVals(n);
+		CSG_Matrix eigenVecs(n,n);
+		SG_Matrix_Eigen_Reduction(N, eigenVecs, eigenVals, true);
+
+		// One of the Eigen Values is 0
+		if (std::any_of(eigenVals.cbegin(),
+		                eigenVals.cend(),
+		                [] (double i) { return i == 0; })) {
+			msg = "The Normal Matrix has a rank defect. Please measure more points.";
+			pTabStream->Write(msg + SG_T("\n"));
+			SG_UI_Msg_Add(msg, true);
+			break;
+		}
+
+		double mx = *std::max_element(eigenVals.cbegin(), eigenVals.cend());
+		double mn = *std::min_element(eigenVals.cbegin(), eigenVals.cend());
+
+		// Ratio of Smallest to the Biggest Eigen value is too small
+		if ((mn / mx) < pow(10,-12.0)) {
+			msg = SG_T("Condition of the Matrix of Normal Equations:\t") + CSG_String::Format(SG_T("  %13.5e"), mn/mx);
+			pTabStream->Write(msg + SG_T("\n"));
+			SG_UI_Msg_Add(msg, true);
+			msg = "The Normal Matrix is weakly conditioned. Please measure more points.";
+			pTabStream->Write(msg + SG_T("\n"));
+			SG_UI_Msg_Add(msg, true);
+			break;
+		}
+
+		// Calculate the adjustments
+		double absMax = 0;
+		invN = N.Get_Inverse();
+		CSG_Vector est_param_incs = invN * ATL;
+
+		for (int i = 0; i < n; i++) {
+			if (abs(est_param_incs[i]) > absMax) {
+				absMax = abs(est_param_incs[i]);
+			}
+		}
+
+		if (absMax < thresh) {
+			msg = "Solution has converged.";
+			pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+			SG_UI_Msg_Add(msg, true);
+			break;
+		}
+
+		for (int a = 0; a < 3; a++) {
+			rotns[a] += est_param_incs[a] / h_dmm;								// New Approx. rotations omega, kappa, alpha
+			center[a] += est_param_incs[a+3] / 1000;							// New Approx. Projection Center
+		}
+
+		if ( estPPOffsets ) {
+			ppOffsetX += (est_param_incs[6] / pixWmm);							// New Approx. Principal Point
+			ppOffsetY += (est_param_incs[7] / pixWmm);
+		}
+
+		sigma_naught = sqrt(SS / (2 * pointCount - n));
+
+		// Writing To Output File & SAGA Console
+		msg = "********* Iteration: " + SG_Get_String(itrNo,0,false) + " *********";
+		pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+
+		msg = "Sum of Squared Residuals:\t" + SG_Get_String(SS,5,false);
+		pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+		
+		msg = "Sigma Naught:\t" + SG_Get_String(sigma_naught,5,false);
+		pTabStream->Write(msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+		
+		msg = SG_T("Condition of the Matrix of Normal Equations:\t") + CSG_String::Format(SG_T("  %13.5e"), mn/mx);
+		pTabStream->Write(msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+		
+		R.Destroy();
+		E.Destroy();
+		N.Destroy();
+		ATL.Destroy();
+		invN.Destroy();
+		eigenVals.Destroy();
+		eigenVecs.Destroy();
+		est_param_incs.Destroy();
+
+	} // end of iterations
+
+	msg = "********* Final Estimated Parameters *********";
+	pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Rotation Angles:");
+	pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Omega:\t") + SG_Get_String(rotns[0],6,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Kappa:\t") + SG_Get_String(rotns[1],6,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Alpha:\t") + SG_Get_String(rotns[2],6,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Projection Center:");
+	pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	msg = SG_T("Xc:\t") + SG_Get_String(center[0],4,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Yc:\t") + SG_Get_String(center[1],4,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+	msg = SG_T("Zc:\t") + SG_Get_String(center[2],4,false);
+	pTabStream->Write(msg + SG_T("\n"));
+	SG_UI_Msg_Add(msg, true);
+
+	if (estPPOffsets) {
+
+		msg = SG_T("Principal Point Offsets:");
+		pTabStream->Write(SG_T("\n") + msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+
+		msg = SG_T("ppX:\t") + SG_Get_String(ppOffsetX,5,false);
+		pTabStream->Write(msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+		msg = SG_T("ppY:\t") + SG_Get_String(ppOffsetY,5,false);
+		pTabStream->Write(msg + SG_T("\n"));
+		SG_UI_Msg_Add(msg, true);
+
+	}
+
+
+	K.Destroy();
+	rotns.Destroy();
+	center.Destroy();
+	target.Destroy();
+
+	pTabStream->Close();
+	
+	return true;
+}
+
+//---------------------------------------------------------
+int CResection::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GIVE_DISTORTIONS")) )
+	{
+		pParameters->Get_Parameter("K1")->Set_Enabled( pParameter->asBool() );
+		pParameters->Get_Parameter("K2")->Set_Enabled( pParameter->asBool() );
+		pParameters->Get_Parameter("K3")->Set_Enabled( pParameter->asBool() );
+	}
+
+	return( 1 );
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
\ No newline at end of file
diff --git a/src/modules/imagery/imagery_photogrammetry/Resection.h b/src/modules/imagery/imagery_photogrammetry/Resection.h
new file mode 100644
index 0000000..b60ca6f
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/Resection.h
@@ -0,0 +1,91 @@
+/**********************************************************
+ * Version $Id: Resection.h 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      Resection.h                      //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     avishek.dutta at hft-stuttgart.de         //
+//                                                       //
+//    contact:    Avishek Dutta                          //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                D-70174 Stuttgart                      //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Resection_H
+#define HEADER_INCLUDED__Resection_H
+
+//---------------------------------------------------------
+# include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CResection : public CSG_Module
+{
+public:
+	CResection										(void);
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+protected:
+
+	virtual bool			On_Execute				(void);
+
+private:
+	
+	
+};
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Resection_H
\ No newline at end of file
diff --git a/src/modules/imagery/imagery_photogrammetry/methods.cpp b/src/modules/imagery/imagery_photogrammetry/methods.cpp
new file mode 100644
index 0000000..72eccad
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/methods.cpp
@@ -0,0 +1,148 @@
+/**********************************************************
+ * Version $Id: methods.cpp 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      methods.cpp                      //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     avishek.dutta at hft-stuttgart.de         //
+//                                                       //
+//    contact:    Avishek Dutta                          //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                D-70174 Stuttgart                      //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "methods.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+namespace methods {
+
+//---------------------------------------------------------
+CSG_Vector calcRotations(CSG_Vector c, CSG_Vector t)
+{
+
+	CSG_Vector exOri(3);
+
+	exOri[0] = atan2((t[2]-c[2]) , (sqrt(pow((t[0]-c[0]),2.0) + pow((t[1]-c[1]),2))));
+	exOri[1] = 0;
+	exOri[2] = atan2((t[1]-c[1]) , (t[0]-c[0])) - M_PI * 0.5;
+	
+	return exOri;
+}
+
+//---------------------------------------------------------
+CSG_Matrix calcRotnMatrix(CSG_Vector params)
+{
+	CSG_Matrix rMat(3,3);
+	 /* 
+		omega = params[0];
+		kappa = params[1];
+		alpha = params[2];
+	*/
+	
+	double sw = sin(params[0]);
+	double sk = sin(params[1]);
+	double sa = sin(params[2]);
+
+	double cw = cos(params[0]);
+	double ck = cos(params[1]);
+	double ca = cos(params[2]);
+	
+	rMat[0][0] = ck * ca;
+	rMat[0][1] = ck * sa;
+	rMat[0][2] = -sk;
+
+	rMat[1][0] = sw * sk * ca - cw * sa;
+	rMat[1][1] = sw * sk * sa + cw * ca;
+	rMat[1][2] = sw * ck;
+
+	rMat[2][0] = cw * sk * ca + sw * sa;
+	rMat[2][1] = cw * sk * sa - sw * ca;
+	rMat[2][2] = cw * ck;
+
+	return rMat;
+
+}
+
+//---------------------------------------------------------
+std::pair<double,double> minmax(CSG_Vector v)
+{
+	double min = v[0];
+	double max = v[0];
+
+	for (int i = 0; i < v.Get_Length(); i++) {
+		if (v[i] > v[0]) {
+			max = v[i];
+		}
+		else if (v[i] < v[0]) {
+			min = v[i];
+		}
+	}
+
+	return std::make_pair(min, max);
+}
+
+} // namespace methods
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
\ No newline at end of file
diff --git a/src/modules/imagery/imagery_photogrammetry/methods.h b/src/modules/imagery/imagery_photogrammetry/methods.h
new file mode 100644
index 0000000..0dd6668
--- /dev/null
+++ b/src/modules/imagery/imagery_photogrammetry/methods.h
@@ -0,0 +1,93 @@
+/**********************************************************
+ * Version $Id: methods.h 1945 2014-01-16 10:00:22Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                imagery_photogrammetry                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       methods.h                       //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     HfT Stuttgart                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     avishek.dutta at hft-stuttgart.de         //
+//                                                       //
+//    contact:    Avishek Dutta                          //
+//                Hochschule fuer Technik Stuttgart      //
+//                Schellingstr. 24                       //
+//                D-70174 Stuttgart                      //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__methods_H
+#define HEADER_INCLUDED__methods_H
+
+//---------------------------------------------------------
+//#define _USE_MATH_DEFINES
+#include <utility>
+#include <saga_api/mat_tools.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+namespace methods {
+	
+	CSG_Vector calcRotations(CSG_Vector c , CSG_Vector t);
+	CSG_Matrix calcRotnMatrix(CSG_Vector params);
+	std::pair<double,double> minmax(CSG_Vector v);
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__methods_H
\ No newline at end of file
diff --git a/src/modules_images/modules_imagery/imagery_rga/MLB_Interface.cpp b/src/modules/imagery/imagery_rga/MLB_Interface.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_rga/MLB_Interface.cpp
rename to src/modules/imagery/imagery_rga/MLB_Interface.cpp
diff --git a/src/modules_images/modules_imagery/imagery_rga/MLB_Interface.h b/src/modules/imagery/imagery_rga/MLB_Interface.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_rga/MLB_Interface.h
rename to src/modules/imagery/imagery_rga/MLB_Interface.h
diff --git a/src/modules_images/modules_imagery/imagery_rga/Makefile.am b/src/modules/imagery/imagery_rga/Makefile.am
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_rga/Makefile.am
rename to src/modules/imagery/imagery_rga/Makefile.am
diff --git a/src/modules/imagery/imagery_rga/Makefile.in b/src/modules/imagery/imagery_rga/Makefile.in
new file mode 100644
index 0000000..88450bb
--- /dev/null
+++ b/src/modules/imagery/imagery_rga/Makefile.in
@@ -0,0 +1,631 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_rga
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libimagery_rga_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libimagery_rga_la_OBJECTS = fast_region_growing.lo MLB_Interface.lo
+libimagery_rga_la_OBJECTS = $(am_libimagery_rga_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_rga_la_SOURCES)
+DIST_SOURCES = $(libimagery_rga_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libimagery_rga.la
+libimagery_rga_la_SOURCES = \
+fast_region_growing.cpp\
+MLB_Interface.cpp\
+fast_region_growing.h\
+MLB_Interface.h
+
+libimagery_rga_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_rga/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_rga/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_rga.la: $(libimagery_rga_la_OBJECTS) $(libimagery_rga_la_DEPENDENCIES) $(EXTRA_libimagery_rga_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_rga_la_OBJECTS) $(libimagery_rga_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fast_region_growing.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_rga/fast_region_growing.cpp b/src/modules/imagery/imagery_rga/fast_region_growing.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_rga/fast_region_growing.cpp
rename to src/modules/imagery/imagery_rga/fast_region_growing.cpp
diff --git a/src/modules_images/modules_imagery/imagery_rga/fast_region_growing.h b/src/modules/imagery/imagery_rga/fast_region_growing.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_rga/fast_region_growing.h
rename to src/modules/imagery/imagery_rga/fast_region_growing.h
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.cpp b/src/modules/imagery/imagery_segmentation/MLB_Interface.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.cpp
rename to src/modules/imagery/imagery_segmentation/MLB_Interface.cpp
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.h b/src/modules/imagery/imagery_segmentation/MLB_Interface.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.h
rename to src/modules/imagery/imagery_segmentation/MLB_Interface.h
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/Makefile.am b/src/modules/imagery/imagery_segmentation/Makefile.am
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/Makefile.am
rename to src/modules/imagery/imagery_segmentation/Makefile.am
diff --git a/src/modules/imagery/imagery_segmentation/Makefile.in b/src/modules/imagery/imagery_segmentation/Makefile.in
new file mode 100644
index 0000000..c13eaf0
--- /dev/null
+++ b/src/modules/imagery/imagery_segmentation/Makefile.in
@@ -0,0 +1,642 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_segmentation
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libimagery_segmentation_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libimagery_segmentation_la_OBJECTS = grid_seeds.lo MLB_Interface.lo \
+	rga_basic.lo skeletonization.lo watershed_segmentation.lo
+libimagery_segmentation_la_OBJECTS =  \
+	$(am_libimagery_segmentation_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_segmentation_la_SOURCES)
+DIST_SOURCES = $(libimagery_segmentation_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libimagery_segmentation.la
+libimagery_segmentation_la_SOURCES = \
+grid_seeds.cpp\
+MLB_Interface.cpp\
+rga_basic.cpp\
+skeletonization.cpp\
+watershed_segmentation.cpp\
+grid_seeds.h\
+MLB_Interface.h\
+rga_basic.h\
+skeletonization.h\
+watershed_segmentation.h
+
+libimagery_segmentation_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_segmentation/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_segmentation/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_segmentation.la: $(libimagery_segmentation_la_OBJECTS) $(libimagery_segmentation_la_DEPENDENCIES) $(EXTRA_libimagery_segmentation_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_segmentation_la_OBJECTS) $(libimagery_segmentation_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_seeds.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rga_basic.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/skeletonization.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/watershed_segmentation.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.cpp b/src/modules/imagery/imagery_segmentation/grid_seeds.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.cpp
rename to src/modules/imagery/imagery_segmentation/grid_seeds.cpp
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.h b/src/modules/imagery/imagery_segmentation/grid_seeds.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.h
rename to src/modules/imagery/imagery_segmentation/grid_seeds.h
diff --git a/src/modules/imagery/imagery_segmentation/rga_basic.cpp b/src/modules/imagery/imagery_segmentation/rga_basic.cpp
new file mode 100644
index 0000000..930c2f1
--- /dev/null
+++ b/src/modules/imagery/imagery_segmentation/rga_basic.cpp
@@ -0,0 +1,665 @@
+/**********************************************************
+ * Version $Id: rga_basic.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 imagery_segmentation                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    rga_basic.cpp                      //
+//                                                       //
+//                 Copyright (C) 2008 by                 //
+//                     Benni Bechtel                     //
+//                      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 "rga_basic.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCandidates::CCandidates(void)
+{
+	m_Candidates	= NULL;
+	m_nCandidates	= 0;
+	m_pLow			= NULL;
+	m_pHigh			= NULL;
+	m_nMax			= 256;
+
+	Create(m_nMax);
+}
+
+//---------------------------------------------------------
+CCandidates::CCandidates(int nMax)
+{
+	m_Candidates	= NULL;
+	m_nCandidates	= 0;
+	m_pLow			= NULL;
+	m_pHigh			= NULL;
+	m_nMax			= nMax;
+
+	Create(m_nMax);
+}
+
+//---------------------------------------------------------
+CCandidates::~CCandidates(void)
+{
+	Destroy();
+}
+
+//---------------------------------------------------------
+void CCandidates::Create(void)
+{
+	Create(m_nMax);
+}
+
+//---------------------------------------------------------
+void CCandidates::Create(int nMax)
+{
+	if( nMax <= 1 )
+	{
+		Create();
+
+		return;
+	}
+
+	Destroy();
+
+	m_nMax			= nMax;
+
+	m_Candidates	= (TCandidate *)SG_Malloc(m_nMax * sizeof(TCandidate));
+}
+
+//---------------------------------------------------------
+void CCandidates::Destroy(void)
+{
+	m_nCandidates	= 0;
+
+	if( m_Candidates )
+	{
+		SG_Free(m_Candidates);
+
+		m_Candidates	= NULL;
+	}
+
+	if( m_pLow )
+	{
+		delete(m_pLow);
+
+		m_pLow		= NULL;
+	}
+
+	if( m_pHigh )
+	{
+		delete(m_pHigh);
+
+		m_pHigh		= NULL;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CCandidates::Add(int x, int y, int Segment, double Similarity)
+{
+	if( m_Candidates && m_nCandidates < m_nMax )
+	{
+		int	iInsert	= _Find(Similarity);
+
+		memmove(m_Candidates + iInsert + 1, m_Candidates + iInsert, sizeof(TCandidate) * (m_nCandidates - iInsert));
+
+		m_Candidates[iInsert].x				= x;
+		m_Candidates[iInsert].y				= y;
+		m_Candidates[iInsert].Segment		= Segment;
+		m_Candidates[iInsert].Similarity	= Similarity;
+	}
+	else
+	{
+		if( !m_pLow )
+		{
+			int	iDivide	= m_nMax / 2;
+
+			m_pLow	= new CCandidates(m_nMax);
+			m_pHigh	= new CCandidates(m_nMax);
+
+			m_pLow ->m_nCandidates	= iDivide;
+			m_pHigh->m_nCandidates	= m_nMax - iDivide;
+
+			memcpy(m_pLow ->m_Candidates, m_Candidates                        , m_pLow ->m_nCandidates * sizeof(TCandidate));
+			memcpy(m_pHigh->m_Candidates, m_Candidates + m_pLow->m_nCandidates, m_pHigh->m_nCandidates * sizeof(TCandidate));
+
+			SG_Free(m_Candidates);
+			m_Candidates	= NULL;
+		}
+
+		if( Similarity > m_pHigh->Get_Minimum() )
+		{
+			m_pHigh->Add(x, y, Segment, Similarity);
+		}
+		else
+		{
+			m_pLow ->Add(x, y, Segment, Similarity);
+		}
+	}
+
+	m_nCandidates++;
+}
+
+//---------------------------------------------------------
+double CCandidates::Get_Minimum(void)
+{
+	if( m_nCandidates > 0 )
+	{
+		if( m_pLow )
+		{
+			return( m_pLow->Get_Minimum() );
+		}
+
+		return( m_Candidates[0].Similarity );
+	}
+
+	return( 0.0 );
+}
+
+//---------------------------------------------------------
+double CCandidates::Get_Maximum(void)
+{
+	if( m_nCandidates > 0 )
+	{
+		if( m_pHigh )
+		{
+			return( m_pHigh->Get_Maximum() );
+		}
+
+		return( m_Candidates[m_nCandidates - 1].Similarity );
+	}
+
+	return( 0.0 );
+}
+
+//---------------------------------------------------------
+int CCandidates::_Find(double Similarity)
+{
+	if( m_nCandidates == 0 )
+	{
+		return( 0 );
+	}
+
+	int		a, b;
+
+	a	= 0;
+	b	= m_nCandidates - 1;
+
+	if( Similarity < m_Candidates[a].Similarity )
+	{
+		return( a );
+	}
+
+	if( Similarity > m_Candidates[b].Similarity )
+	{
+		return( b + 1 );
+	}
+
+	for(int d=(b-a)/2 ; d>0; d/=2)
+	{
+		int		i	= a + d;
+
+		if( Similarity > m_Candidates[i].Similarity )
+		{
+			a	= a < i ? i : a + 1;
+		}
+		else
+		{
+			b	= b > i ? i : b - 1;
+		}
+	}
+
+	for(int i=a; i<=b; i++)
+	{
+		if( Similarity < m_Candidates[i].Similarity )
+		{
+			return( i );
+		}
+	}
+
+	return( b );
+}
+
+//---------------------------------------------------------
+bool CCandidates::Get(int &x, int &y, int &Segment)
+{
+	if( m_nCandidates > 0 )
+	{
+		m_nCandidates--;
+
+		if( m_Candidates )
+		{
+			x		= m_Candidates[m_nCandidates].x;
+			y		= m_Candidates[m_nCandidates].y;
+			Segment	= m_Candidates[m_nCandidates].Segment;
+		}
+		else // if( m_pLow )
+		{
+			m_pHigh->Get(x, y, Segment);
+
+			if( m_pHigh->m_nCandidates == 0 )
+			{
+				delete(m_pHigh);
+
+				CCandidates	*pLow	= m_pLow;
+
+			//	m_nCandidates	= pLow->m_nCandidates;
+				m_Candidates	= pLow->m_Candidates;
+				m_pLow			= pLow->m_pLow;
+				m_pHigh			= pLow->m_pHigh;
+
+				pLow->m_Candidates	= NULL;
+				pLow->m_pLow		= NULL;
+				pLow->m_pHigh		= NULL;
+				delete(pLow);
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SEEDFIELD_X		2
+#define SEEDFIELD_Y		(SEEDFIELD_X + 1)
+#define SEEDFIELD_Z		(SEEDFIELD_X + 2)
+
+#define NO_SEGMENT			-1
+#define NO_SIMILARITY		-1.0
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CRGA_Basic::CRGA_Basic(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Simple Region Growing"));
+
+	Set_Author		(SG_T("B. Bechtel, O. Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"\n"
+		"References\n"
+		"Bechtel, B., Ringeler, A., Boehner, J. (2008): "
+		"Segmentation for Object Extraction of Trees using MATLAB and SAGA. "
+		"In: Boehner, J., Blaschke, T., Montanarella, L. [Eds.]: SAGA - Seconds Out. "
+		"Hamburger Beitraege zur Physischen Geographie und Landschaftsoekologie, 19:59-70. "
+		"<a href=\"http://downloads.sourceforge.net/saga-gis/hbpl19_01.pdf\">download</a>\n"
+		"\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "SEEDS"		, _TL("Seeds"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "FEATURES"	, _TL("Features"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SEGMENTS"	, _TL("Segments"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SIMILARITY"	, _TL("Similarity"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Seeds"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("feature space and position"),
+			_TL("feature space")
+		), 0
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "NEIGHBOUR"	, _TL("Neighbourhood"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("4 (von Neumann)"),
+			_TL("8 (Moore)")
+		), 0
+	);
+
+	pNode	= Parameters.Add_Node(
+		NULL	, "NODE_COLSPACE"	, _TL("Feature Space Options"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SIG_1"			, _TL("Variance in Feature Space"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 1.0, 0.0, true	// 0.36
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SIG_2"			, _TL("Variance in Position Space"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 1.0, 0.0, true	// 8.2141
+	);
+
+	Parameters.Add_Value(
+		pNode	, "THRESHOLD"		, _TL("Threshold - Similarity"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 0.0, 0.0, true	// 0.15
+	);
+
+	Parameters.Add_Value(
+		pNode	, "REFRESH"			, _TL("Refresh"),
+		_TL(""),
+		PARAMETER_TYPE_Bool			, false
+	);
+
+	Parameters.Add_Value(
+		pNode	, "LEAFSIZE"		, _TL("Leaf Size (for Speed Optimisation)"),
+		_TL(""),
+		PARAMETER_TYPE_Int			, 256, 2, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CRGA_Basic::On_Execute(void)
+{
+	bool		bRefresh;
+	sLong		n;
+	int			x, y, i, Segment;
+	CSG_Grid	*pSeeds;
+
+	//-----------------------------------------------------
+	m_pSegments		= Parameters("SEGMENTS")	->asGrid();
+	m_pFeatures		= Parameters("FEATURES")	->asGridList();
+	m_nFeatures		= m_pFeatures->Get_Count();
+
+	pSeeds			= Parameters("SEEDS")		->asGrid();
+	m_pSeeds		= Parameters("TABLE")		->asTable();
+
+	m_pSimilarity	= Parameters("SIMILARITY")	->asGrid();
+
+	m_dNeighbour	= Parameters("NEIGHBOUR")->asInt() == 0 ? 2 : 1;
+
+	m_Var_1			= SG_Get_Square(Parameters("SIG_1")->asDouble());
+	m_Var_2			= SG_Get_Square(Parameters("SIG_2")->asDouble());
+	m_Threshold		= Parameters("THRESHOLD")	->asDouble();
+
+	m_Method		= Parameters("METHOD")		->asInt();
+	bRefresh		= Parameters("REFRESH")		->asBool();
+
+	//-----------------------------------------------------
+	m_pSegments		->Assign(-1);
+	m_pSegments		->Set_NoData_Value(-1);
+
+	m_pSimilarity	->Assign(-1);
+	m_pSimilarity	->Set_NoData_Value(-1);
+
+	//-----------------------------------------------------
+	m_pSeeds->Destroy();
+
+	m_pSeeds->Add_Field(_TL("ID")	, SG_DATATYPE_Int);
+	m_pSeeds->Add_Field(_TL("AREA")	, SG_DATATYPE_Double);
+	m_pSeeds->Add_Field(_TL("X")	, SG_DATATYPE_Double);
+	m_pSeeds->Add_Field(_TL("Y")	, SG_DATATYPE_Double);
+
+	for(i=0; i<m_pFeatures->Get_Count(); i++)
+	{
+		m_pSeeds->Add_Field(m_pFeatures->asGrid(i)->Get_Name(), SG_DATATYPE_Double);
+	}
+
+	m_Candidates.Create(Parameters("LEAFSIZE")->asInt());
+
+	//-----------------------------------------------------
+	for(y=0, n=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( !pSeeds->is_NoData(x, y) )
+			{
+				CSG_Table_Record	*pRec	= m_pSeeds->Add_Record();
+
+				pRec->Set_Value(0, n);
+				pRec->Set_Value(SEEDFIELD_X, x);
+				pRec->Set_Value(SEEDFIELD_Y, y);
+
+				for(i=0; i<m_pFeatures->Get_Count(); i++)
+				{
+					pRec->Set_Value(SEEDFIELD_Z + i, m_pFeatures->asGrid(i)->asDouble(x, y));
+				}
+
+				m_pSimilarity->Set_Value(x, y, 1.0);
+
+				Add_To_Segment(x, y, n++);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( n > 0 )
+	{
+		n	= 0;
+
+		while( n++ < Get_NCells() && Set_Progress_NCells(n) && Get_Next_Candidate(x, y, Segment) )
+		{
+			Add_To_Segment(x, y, Segment);
+
+			if( bRefresh && (n % Get_NX()) == 0 )
+			{
+				DataObject_Update(m_pSegments, 0, m_pSeeds->Get_Record_Count());
+
+				Process_Set_Text(CSG_String::Format(SG_T("%.2f"), 100.0 * m_Candidates.Get_Count() / Get_NCells()));
+			}
+		}
+
+		m_Candidates.Destroy();
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	m_Candidates.Destroy();
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CRGA_Basic::Get_Next_Candidate(int &x, int &y, int &Segment)
+{
+	while( m_Candidates.Get(x, y, Segment) )
+	{
+		if( m_pSegments->is_NoData(x, y) )
+		{
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CRGA_Basic::Add_To_Segment(int x, int y, int Segment)
+{
+	if( is_InGrid(x, y) && m_pSegments->is_NoData(x, y) )			// if the pixel is not element of any segment...
+	{
+		int		i, ix, iy;
+
+		m_pSegments->Set_Value(x, y, Segment);						// the candidate is added to the correspondig region
+	
+		for(i=0; i<8; i+=m_dNeighbour)								// update of candidate-grid - all 8-Neigbours of the added pixel are checked
+		{
+			if( Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) && m_pSegments->is_NoData(ix, iy) )
+			{
+				double	Similarity	= Get_Similarity(ix, iy, Segment);
+
+				if(	Similarity >= m_Threshold						// a neigbour-pixel is only added as candidate if its similarity is higher than the preset threshold
+				&&	Similarity > m_pSimilarity->asDouble(ix, iy) )	// and it is not candidate for another region with a higher similarity-value yet
+				{
+					m_Candidates.Add(ix, iy, Segment, Similarity);
+
+					m_pSimilarity->Set_Value(ix, iy, Similarity);
+				}
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+double CRGA_Basic::Get_Similarity(int x, int y, int Segment)
+{
+	CSG_Table_Record	*pSeed;
+
+	if( is_InGrid(x, y) && (pSeed = m_pSeeds->Get_Record(Segment)) != NULL )
+	{
+		int		i;
+		double	a, b, Result;
+
+		switch( m_Method )
+		{
+		//-------------------------------------------------
+		case 0:	// feature space and position
+			for(i=0, a=0.0; i<m_nFeatures; i++)
+			{
+				a	+= SG_Get_Square(m_pFeatures->asGrid(i)->asDouble(x, y) - pSeed->asDouble(SEEDFIELD_Z + i));
+			}
+
+			b	= SG_Get_Square(x - pSeed->asDouble(SEEDFIELD_X))
+				+ SG_Get_Square(y - pSeed->asDouble(SEEDFIELD_Y));
+
+			Result	= a / m_Var_1 + b / m_Var_2;
+
+			break;
+
+		//-------------------------------------------------
+		case 1:	// feature space
+			for(i=0, a=0.0; i<m_nFeatures; i++)
+			{
+				a	+= SG_Get_Square(m_pFeatures->asGrid(i)->asDouble(x, y) - pSeed->asDouble(SEEDFIELD_Z + i));
+			}
+
+			Result	= a / m_Var_1;
+
+			break;
+		}
+
+		return( 1.0 / (1.0 + Result) );	// from 'distance' to 'similarity' !!!
+	//	return( exp(-0.5 * Result) );
+	}
+
+	return( -1.0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/rga_basic.h b/src/modules/imagery/imagery_segmentation/rga_basic.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/rga_basic.h
rename to src/modules/imagery/imagery_segmentation/rga_basic.h
diff --git a/src/modules/imagery/imagery_segmentation/skeletonization.cpp b/src/modules/imagery/imagery_segmentation/skeletonization.cpp
new file mode 100644
index 0000000..145d9eb
--- /dev/null
+++ b/src/modules/imagery/imagery_segmentation/skeletonization.cpp
@@ -0,0 +1,950 @@
+/**********************************************************
+ * Version $Id: skeletonization.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 imagery_segmentation                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 Grid_Skeletonize.cpp                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "skeletonization.h"
+
+//---------------------------------------------------------
+#define	skNE			1
+#define skJA			2
+
+#define SEGMENT_END		1
+#define SEGMENT_NODE	2
+#define SEGMENT_LOCKED	3
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSkeletonization::CSkeletonization(void)
+{
+	Set_Name		(_TL("Grid Skeletonization"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2002"));
+
+	Set_Description	(_TW(
+		"Simple skeletonisation methods for grids.\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL, "INPUT"			, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "RESULT"			, _TL("Skeleton"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
+	);
+
+	Parameters.Add_Shapes(
+		NULL, "VECTOR"			, _TL("Skeleton"),
+		_TL(""), PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Choice(
+		NULL, "METHOD"			, _TL("Method"),
+		_TL(""),
+
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Standard"),
+			_TL("Hilditch's Algorithm"),
+			_TL("Channel Skeleton")
+		), 0
+	);
+
+	Parameters.Add_Choice(
+		NULL, "INIT_METHOD"		, _TL("Initialisation"),
+		_TL(""),
+
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Less than"),
+			_TL("Greater than") 
+		),1
+	);
+
+	Parameters.Add_Value(
+		NULL, "INIT_THRESHOLD"	, _TL("Threshold (Init.)"),
+		_TL(""),
+		PARAMETER_TYPE_Double
+	);
+
+	Parameters.Add_Value(
+		NULL, "CONVERGENCE"		, _TL("Convergence"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 3
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSkeletonization::On_Execute(void)
+{
+	int			Initiation;
+	sLong		n;
+	double		Threshold;
+	CSG_Grid	*pInput;
+
+	//-----------------------------------------------------
+	pInput		= Parameters("INPUT")			->asGrid();
+	pResult		= Parameters("RESULT")			->asGrid();
+
+	Initiation	= Parameters("INIT_METHOD")		->asInt();
+	Threshold	= Parameters("INIT_THRESHOLD")	->asDouble();
+
+	DataObject_Set_Colors(pResult, 3, SG_COLORS_BLACK_WHITE, true);
+	pResult->Assign(0.0);
+
+	//-----------------------------------------------------
+	for(n=0; n<Get_NCells(); n++)
+	{
+		switch( Initiation )
+		{
+		case 0: default:
+			if( pInput->asDouble(n) < Threshold )
+			{
+				pResult->Set_Value(n, 1);
+			}
+			break;
+
+		case 1:
+			if( pInput->asDouble(n) > Threshold )
+			{
+				pResult->Set_Value(n, 1);
+			}
+			break;
+		}
+	}
+
+	//-----------------------------------------------------
+	switch( Parameters("METHOD")->asInt() )
+	{
+	case 0:	default:
+		Standard_Execute();
+		break;
+
+	case 1:
+		Hilditch_Execute();
+		break;
+
+	case 2:
+		SK_Execute();
+		break;
+	}
+
+	//-------------------------------------------------
+	if( Parameters("VECTOR")->asShapes() )
+	{
+		Vectorize(Parameters("VECTOR")->asShapes());
+	}
+
+	if( 1 )
+	{
+		for(n=0; n<Get_NCells(); n++)
+		{
+			switch( Initiation )
+			{
+			case 0: default:
+				if( pInput->asDouble(n) < Threshold )
+				{
+					pResult->Add_Value(n, 1);
+				}
+				break;
+
+			case 1:
+				if( pInput->asDouble(n) > Threshold )
+				{
+					pResult->Add_Value(n, 1);
+				}
+				break;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//						Helpers							 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSkeletonization::Get_Neighbours(int x, int y, CSG_Grid *pGrid, bool Neighbours[8])
+{
+	int		i, ix, iy, nNeighbours;
+
+	nNeighbours	= 0;
+
+	for(i=0; i<8; i++)
+	{
+		ix	= Get_System()->Get_xTo(i, x);
+		iy	= Get_System()->Get_yTo(i, y);
+
+		if( pGrid->is_InGrid(ix, iy) && pGrid->asByte(ix, iy) )
+		{
+			Neighbours[i]	= true;
+
+			nNeighbours++;
+		}
+		else
+		{
+			Neighbours[i]	= false;
+		}
+	}
+
+	return( nNeighbours );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//					Vectorization						 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSkeletonization::Vectorize(CSG_Shapes *pShapes)
+{
+	bool	z[8], bPrev;
+
+	int		x, y, i, ix, iy, n, nSegments;
+
+	double	xMin, yMin, dx, dy;
+
+	CSG_Shape	*pShape;
+
+	//-----------------------------------------------------
+	pShapes->Create(SHAPE_TYPE_Line, _TL("Skeleton"));
+	pShapes->Add_Field("ID", SG_DATATYPE_Int);
+
+	Lock_Create();
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( pResult->asByte(x, y) )
+			{
+				n	= Get_Neighbours(x, y, pResult, z);
+				
+				if( n == 1 )
+				{
+					Lock_Set(x, y, SEGMENT_END);
+				}
+				else if( n > 1 )
+				{
+					n	= 0;
+
+					for(i=0, bPrev=z[7]; i<8; i++)
+					{
+						if( bPrev == false && z[i] == true )
+						{
+							n++;
+						}
+
+						bPrev	= z[i];
+					}
+
+					if( n > 2 )
+					{
+						Lock_Set(x, y, SEGMENT_NODE);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	nSegments	= 0;
+
+	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
+	{
+		dx			= pResult->Get_Cellsize();
+		xMin		= pResult->Get_XMin();// + 0.5 * dx;
+		dy			= pResult->Get_Cellsize();
+		yMin		= pResult->Get_YMin();// + 0.5 * dy;
+
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( Lock_Get(x, y) == SEGMENT_NODE || Lock_Get(x, y) == SEGMENT_END )
+			{
+				Lock_Set(x, y, SEGMENT_LOCKED);
+
+				for(i=0; i<8; i++)
+				{
+					ix	= Get_System()->Get_xTo(i, x);
+					iy	= Get_System()->Get_yTo(i, y);
+
+					if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && !Lock_Get(ix, iy) )
+					{
+						pShape	= pShapes->Add_Shape();
+						pShape->Set_Value(0, ++nSegments);
+						pShape->Add_Point(xMin + dx * (double)x, yMin + dy * (double)y);
+
+						Vectorize_Trace(ix, iy, pShape);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Lock_Destroy();
+
+	Message_Dlg(CSG_String::Format(SG_T("%d %s\n"), nSegments, _TL("segments identified")), Get_Name());
+
+	return( nSegments );
+}
+
+//---------------------------------------------------------
+bool CSkeletonization::Vectorize_Trace(int x, int y, CSG_Shape *pShape)
+{
+	bool	bContinue;
+
+	int		i, ix, iy, iNext;
+
+	double	xMin, yMin, dx, dy;
+
+	//-----------------------------------------------------
+	dx			= pResult->Get_Cellsize();
+	xMin		= pResult->Get_XMin();// + 0.5 * dx;
+	dy			= pResult->Get_Cellsize();
+	yMin		= pResult->Get_YMin();// + 0.5 * dy;
+
+	bContinue	= true;
+
+	do
+	{
+		pShape->Add_Point(xMin + dx * (double)x, yMin + dy * (double)y);
+
+		if( Lock_Get(x, y) == SEGMENT_NODE || Lock_Get(x, y) == SEGMENT_END )
+		{
+			bContinue	= false;
+		}
+		else
+		{
+			Lock_Set(x, y, SEGMENT_LOCKED);
+
+			iNext	= -1;
+
+			for(i=0; i<8; i+=2)
+			{
+				ix	= Get_System()->Get_xTo(i, x);
+				iy	= Get_System()->Get_yTo(i, y);
+
+				if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && Lock_Get(ix, iy) != SEGMENT_LOCKED )
+				{
+					iNext	= i;
+
+					if( Lock_Get(ix, iy) == SEGMENT_NODE )
+					{
+						break;
+					}
+				}
+			}
+
+			if( iNext < 0 )
+			{
+				for(i=1; i<8; i+=2)
+				{
+					ix	= Get_System()->Get_xTo(i, x);
+					iy	= Get_System()->Get_yTo(i, y);
+
+					if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && Lock_Get(ix, iy) != SEGMENT_LOCKED )
+					{
+						iNext	= i;
+
+						if( Lock_Get(ix, iy) == SEGMENT_NODE )
+						{
+							break;
+						}
+					}
+				}
+			}
+
+			if( iNext < 0 )
+			{
+				bContinue	= false;
+			}
+			else
+			{
+				x	+= Get_System()->Get_xTo(iNext);
+				y	+= Get_System()->Get_yTo(iNext);
+			}
+		}
+	}
+	while( bContinue );
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//						Standard						 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSkeletonization::Standard_Execute(void)
+{
+	int		i, nChanges;
+
+	CSG_Grid	*pPrev, *pNext, *pTemp;
+
+	//-----------------------------------------------------
+	pPrev		= pResult;
+	pNext		= SG_Create_Grid(pPrev);
+
+	//-----------------------------------------------------
+	do
+	{
+		DataObject_Update(pResult, 0, 1, true);
+
+		nChanges	= 0;
+
+		for(i=0; i<8; i++)
+		{
+			nChanges	+= Standard_Step(i, pPrev, pNext);
+
+			pTemp		= pPrev;
+			pPrev		= pNext;
+			pNext		= pTemp;
+		}
+	}
+	while( nChanges > 0 && Process_Get_Okay(true) );
+
+	//-----------------------------------------------------
+	if( pNext == pResult )
+	{
+		delete(pPrev);
+	}
+	else
+	{
+		pResult->Assign(pNext);
+
+		delete(pNext);
+	}
+}
+
+//---------------------------------------------------------
+int CSkeletonization::Standard_Step(int iDir, CSG_Grid *pPrev, CSG_Grid *pNext)
+{
+	bool	z[8], bRemove;
+
+	int		x, y, nNeighbours, nChanges;
+
+	pNext->Assign();
+
+	nChanges	= 0;
+
+	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( pPrev->asByte(x, y) )
+			{
+				bRemove		= false;
+				nNeighbours	= Get_Neighbours(x, y, pPrev, z);
+
+				if( nNeighbours > 1 && nNeighbours < 6 )
+				{
+					bRemove	= Standard_Check(iDir, z);
+				}
+
+				if( bRemove )
+				{
+					nChanges++;
+				}
+				else
+				{
+					pNext->Set_Value(x, y, 1);
+				}
+			}
+		}
+	}
+
+	return( nChanges );
+}
+
+//---------------------------------------------------------
+inline bool CSkeletonization::Standard_Check(int iDir, bool z[8])
+{
+	bool	bRemove;
+
+	switch( iDir )
+	{
+	default:
+		bRemove	= false;
+		break;
+
+	case 0:
+		bRemove	=	!z[7] && !z[0] && !z[1]
+				&&	 z[3] &&  z[4] &&  z[5];
+		break;
+
+	case 1:
+		bRemove	=	!z[0] && !z[1] && !z[2]
+				&&	 z[4]      &&      z[6];
+		break;
+
+	case 2:
+		bRemove	=	!z[1] && !z[2] && !z[3]
+				&&	 z[5] &&  z[6] &&  z[7];
+		break;
+
+	case 3:
+		bRemove	=	!z[2] && !z[3] && !z[4]
+				&&	 z[6]      &&      z[0];
+		break;
+
+	case 4:
+		bRemove	=	!z[3] && !z[4] && !z[5]
+				&&	 z[7] &&  z[0] &&  z[1];
+		break;
+
+	case 5:
+		bRemove	=	!z[4] && !z[5] && !z[6]
+				&&	 z[0]      &&      z[2];
+		break;
+
+	case 6:
+		bRemove	=	!z[5] && !z[6] && !z[7]
+				&&	 z[1] &&  z[2] &&  z[3];
+		break;
+
+	case 7:
+		bRemove	=	!z[6] && !z[7] && !z[0]
+				&&	 z[2]      &&      z[4];
+		break;
+	}
+
+	return( bRemove );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//						Hilditch						 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSkeletonization::Hilditch_Execute(void)
+{
+	int		nChanges;
+
+	CSG_Grid	*pPrev, *pNext, *pTemp, *pNC_Gaps;
+
+	//-----------------------------------------------------
+	pPrev		= pResult;
+	pNext		= SG_Create_Grid(pPrev);
+	pNC_Gaps	= SG_Create_Grid(pPrev, SG_DATATYPE_Char);
+
+	//-----------------------------------------------------
+	do
+	{
+		DataObject_Update(pResult, 0, 1, true);
+
+		nChanges	= Hilditch_Step(pPrev, pNext, pNC_Gaps);
+
+		pTemp		= pPrev;
+		pPrev		= pNext;
+		pNext		= pTemp;
+	}
+	while( nChanges > 0 && Process_Get_Okay(true) );
+
+	//-----------------------------------------------------
+	delete(pNC_Gaps);
+
+	if( pNext == pResult )
+	{
+		delete(pPrev);
+	}
+	else
+	{
+		pResult->Assign(pNext);
+
+		delete(pNext);
+	}
+}
+
+//---------------------------------------------------------
+int CSkeletonization::Hilditch_Step(CSG_Grid *pPrev, CSG_Grid *pNext, CSG_Grid *pNC_Gaps)
+{
+	bool	z[8], bPrev, bRemove;
+
+	int		x, y, i, nChanges, nNeighbours;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			nChanges	= 0;
+
+			if( pPrev->asByte(x, y) && Get_Neighbours(x, y, pPrev, z) > 0 )
+			{
+				for(i=0, bPrev=z[7]; i<8; i++)
+				{
+					if( bPrev == false && z[i] == true )
+					{
+						nChanges++;
+					}
+
+					bPrev	= z[i];
+				}
+			}
+
+			pNC_Gaps->Set_Value(x, y, nChanges);
+		}
+	}
+
+	//-----------------------------------------------------
+	pNext->Assign();
+
+	nChanges	= 0;
+
+	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( pPrev->asByte(x, y) )
+			{
+				bRemove		= false;
+				nNeighbours	= Get_Neighbours(x, y, pPrev, z);
+
+				//-----------------------------------------
+				if( 2 <= nNeighbours && nNeighbours <= 6 && pNC_Gaps->asByte(x, y) == 1 )
+				{
+					bRemove	=	Hilditch_Check(pNC_Gaps, x, y, 0, z)
+							||	Hilditch_Check(pNC_Gaps, x, y, 2, z)
+							||	Hilditch_Check(pNC_Gaps, x, y, 4, z)
+							||	Hilditch_Check(pNC_Gaps, x, y, 6, z)
+							;
+				}
+
+				//-----------------------------------------
+				if( bRemove )
+				{
+					nChanges++;
+				}
+				else
+				{
+					pNext->Set_Value(x, y, true);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( nChanges );
+}
+
+//---------------------------------------------------------
+inline bool CSkeletonization::Hilditch_Check(CSG_Grid *pNC_Gaps, int x, int y, int i0, bool z[8])
+{
+	int		ix, iy, i2, i4, i6;
+
+	i2		= (i0 + 2) % 8;
+	i4		= (i0 + 4) % 8;
+	i6		= (i0 + 6) % 8;
+
+	if( z[i0] || z[i2] || z[i6] )
+	{
+		ix		= Get_System()->Get_xTo(i0, x);
+		iy		= Get_System()->Get_yTo(i0, y);
+
+		if( pNC_Gaps->is_InGrid(ix, iy) && pNC_Gaps->asByte(ix, iy) == 1 )
+		{
+			return( false );
+		}
+	}
+
+	if( z[i0] || z[i2] || z[i4] )
+	{
+		ix		= Get_System()->Get_xTo(i2, x);
+		iy		= Get_System()->Get_yTo(i2, y);
+
+		if( pNC_Gaps->is_InGrid(ix, iy) && pNC_Gaps->asByte(ix, iy) == 1 )
+		{
+			return( false );
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//					Channel Detection					 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSkeletonization::SK_Execute(void)
+{
+	int		x, y, i, ix, iy, n,
+			Convergence, NB[8];
+
+	double	z, iz;
+
+	CSG_Grid	*pInput;
+
+	//-----------------------------------------------------
+	Convergence	= Parameters("CONVERGENCE")->asInt();
+	pInput		= Parameters("INPUT")->asGrid();
+
+	pResult->Assign();
+
+
+	//-----------------------------------------------------
+	// 1.) Find definitive channel points...
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			z	= pInput->asDouble(x, y);
+			n	= 0;
+
+			for(i=0; i<8; i++)
+			{
+				ix	= Get_System()->Get_xTo(i, x);
+				iy	= Get_System()->Get_yTo(i, y);
+
+				if( pInput->is_InGrid(ix, iy) && z < pInput->asDouble(ix, iy) )
+				{
+					n++;
+				}
+			}
+
+			if( Convergence > n )
+			{
+				pResult->Set_Value(x, y, 2);
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+	// 2.) Find channels...
+
+	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{	
+		if( pInput->Get_Sorted(n, x, y) )	// Von oben nach unten...
+		{
+			z	= pInput->asDouble(x, y);
+
+			for(i=0; i<8; i++)
+			{
+				ix	= Get_System()->Get_xTo(i,x);
+				iy	= Get_System()->Get_yTo(i,y);
+
+				if( !pInput->is_InGrid(ix, iy) )
+				{
+					NB[i]	= skNE;
+				}
+				else
+				{
+					iz	= pInput->asDouble(ix, iy);
+
+					if( iz < z )
+					{
+						NB[i]	= skNE;
+					}
+					else if( iz > z && pResult->asByte(ix, iy) )
+					{
+						NB[i]	= skJA;
+					}
+					else
+					{
+						NB[i]	= 0;
+					}
+				}
+			}
+
+			if( SK_Connectivity(NB) )
+			{
+				pResult->Set_Value(x, y, 1);
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+	/*/ 3.) Filter...
+
+	Lock_Create();
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			SK_Filter(x, y);
+		}
+	}
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( Lock_Get(x, y) )
+			{
+				pResult->Set_Value(x, y, 0);
+			}
+		}
+	}
+
+	Lock_Destroy();/**/
+}
+
+//---------------------------------------------------------
+int CSkeletonization::SK_Connectivity(int NB[8])
+{
+	int		i;
+
+	for(i=0; i<8; i+=2)
+	{
+		if( !NB[i] )
+		{
+			if( !NB[(i+2)%8] )	// Diagonal Connection
+			{
+			/*
+				if( ( NB[(i+1)%8]	)
+				&&	( NB[(i+3)%8] || NB[(i+4)%8] || NB[(i+5)%8] || NB[(i+6)%8] || NB[(i+7)%8] ) )
+					return(1);
+				*/
+
+				///*
+				if( ( NB[(i+1)%8]==skNE	)
+				&&	( NB[(i+3)%8]==skJA || NB[(i+4)%8]==skJA || NB[(i+5)%8]==skJA || NB[(i+6)%8]==skJA || NB[(i+7)%8]==skJA ) )
+					return(1);
+
+				if( ( NB[(i+1)%8]==skJA	)
+				&&	( NB[(i+3)%8]==skNE || NB[(i+4)%8]==skNE || NB[(i+5)%8]==skNE || NB[(i+6)%8]==skNE || NB[(i+7)%8]==skNE ) )
+					return(1);
+				//*/
+			}
+
+			//---Orthogonal-Connection---------------------------------
+			if(!NB[(i+4)%8])
+			{	/*
+				if(	( NB[(i+1)%8] || NB[(i+2)%8] || NB[(i+3)%8] )
+				&&	( NB[(i+5)%8] || NB[(i+6)%8] || NB[(i+7)%8] ) )
+					return(1);
+				*/
+
+				///*
+				if(	( NB[(i+1)%8]==skJA || NB[(i+2)%8]==skJA || NB[(i+3)%8]==skJA )
+				&&	( NB[(i+5)%8]==skNE || NB[(i+6)%8]==skNE || NB[(i+7)%8]==skNE ) )
+					return(1);
+
+				if(	( NB[(i+1)%8]==skNE || NB[(i+2)%8]==skNE || NB[(i+3)%8]==skNE )
+				&&	( NB[(i+5)%8]==skJA || NB[(i+6)%8]==skJA || NB[(i+7)%8]==skJA ) )
+					return(1);
+				//*/
+			}
+		}
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+bool CSkeletonization::SK_Filter(int x, int y)
+{
+	bool	z[8];
+
+	if( !pResult->asByte(x, y) && Get_Neighbours(x, y, pResult, z) == 4 )
+	{
+		if( z[0] && z[2] && z[4] && z[6] )
+		{
+			Lock_Set(Get_System()->Get_xTo(0, x), Get_System()->Get_yTo(0, y));
+			Lock_Set(Get_System()->Get_xTo(2, x), Get_System()->Get_yTo(2, y));
+			Lock_Set(Get_System()->Get_xTo(4, x), Get_System()->Get_yTo(4, y));
+			Lock_Set(Get_System()->Get_xTo(6, x), Get_System()->Get_yTo(6, y));
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/skeletonization.h b/src/modules/imagery/imagery_segmentation/skeletonization.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/skeletonization.h
rename to src/modules/imagery/imagery_segmentation/skeletonization.h
diff --git a/src/modules/imagery/imagery_segmentation/watershed_segmentation.cpp b/src/modules/imagery/imagery_segmentation/watershed_segmentation.cpp
new file mode 100644
index 0000000..480797c
--- /dev/null
+++ b/src/modules/imagery/imagery_segmentation/watershed_segmentation.cpp
@@ -0,0 +1,515 @@
+/**********************************************************
+ * Version $Id: watershed_segmentation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 imagery_segmentation                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               watershed_segmentation.cpp              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "watershed_segmentation.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	SEED_X	= 0,
+	SEED_Y,
+	SEED_Z,
+	SEED_ID,
+	SEED_JOIN
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWatershed_Segmentation::CWatershed_Segmentation(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Watershed Segmentation"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2002"));
+
+	Set_Description	(_TW(
+		"Watershed segmentation."
+	));
+
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRID"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	pNode	= Parameters.Add_Grid(
+		NULL	, "SEGMENTS"	, _TL("Segments"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "SEEDS"		, _TL("Seed Points"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "BORDERS"		, _TL("Borders"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		pNode	, "OUTPUT"		, _TL("Output"),
+		_TL("The values of the resultant grid can be either the seed value (e.g. the local maximum) or the enumerated segment id."),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Seed Value"),
+			_TL("Segment ID")
+		), 1
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "DOWN"		, _TL("Method"),
+		_TL("Choose if you want to segmentate either on minima or on maxima."),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Minima"),
+			_TL("Maxima")
+		), 1
+	);
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "JOIN"		, _TL("Join Segments based on Threshold Value"),
+		_TL("Join segments based on threshold value."),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("do not join"),
+			_TL("seed to saddle difference"),
+			_TL("seeds difference")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "THRESHOLD"	, _TL("Threshold"),
+		_TL("Specify a threshold value as minimum difference between neighboured segments."),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "EDGE"		, _TL("Allow Edge Pixels to be Seeds"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "BBORDERS"	, _TL("Borders"),
+		_TL("Create borders between segments as new grid."),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatershed_Segmentation::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pGrid		= Parameters("GRID")		->asGrid();
+	m_pSeeds	= Parameters("SEEDS")		->asShapes();
+	m_pSegments	= Parameters("SEGMENTS")	->asGrid();
+	m_bDown		= Parameters("DOWN")		->asInt() == 1;
+
+	//-----------------------------------------------------
+	m_pSeeds->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pGrid->Get_Name(), _TL("Seeds")));
+
+	m_pSeeds->Add_Field(SG_T("XCELL")	, SG_DATATYPE_Int);		// SEED_X
+	m_pSeeds->Add_Field(SG_T("YCELL")	, SG_DATATYPE_Int);		// SEED_Y
+	m_pSeeds->Add_Field(SG_T("VALUE")	, SG_DATATYPE_Double);	// SEED_Z
+	m_pSeeds->Add_Field(SG_T("ID")		, SG_DATATYPE_Int);		// SEED_ID
+	m_pSeeds->Add_Field(SG_T("ID_JOIN")	, SG_DATATYPE_Int);		// SEED_JOIN
+
+	//-----------------------------------------------------
+	m_pSegments->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pGrid->Get_Name(), _TL("Segments")));
+	m_pSegments->Set_NoData_Value(-999999.0);
+
+	m_Dir.Create(*Get_System(), SG_DATATYPE_Char);
+
+	//-----------------------------------------------------
+	if( !Get_Seeds() )
+	{
+		Message_Add(_TL("no seed points identified"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Get_Segments();
+
+	//-----------------------------------------------------
+	if( Parameters("OUTPUT")->asInt() == 0 )
+	{
+		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			for(int x=0; x<Get_NX(); x++)
+			{
+				int	ID	= m_pSegments->asInt(x, y);
+
+				if( ID >= 0 )
+				{
+					m_pSegments->Set_Value(x, y, m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z));
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( Parameters("BBORDERS")->asBool() )
+	{
+		Get_Borders();
+	}
+
+	//-----------------------------------------------------
+	m_Dir.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatershed_Segmentation::Get_Seeds(void)
+{
+	Process_Set_Text(_TL("Seeds"));
+
+	bool	bEdge, bEdge_Seeds;
+	int		x, y, i, ix, iy, iMax;
+	double	z, dz, dzMax;
+
+	//-----------------------------------------------------
+	bEdge_Seeds	= Parameters("EDGE")	->asBool();
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( !m_pGrid->is_InGrid(x, y) )
+			{
+				m_Dir.Set_Value(x, y, -1);
+				m_pSegments->Set_NoData(x, y);
+			}
+			else
+			{
+				for(i=0, iMax=-1, dzMax=0.0, z=m_pGrid->asDouble(x, y), bEdge=false; i<8; i++)
+				{
+					if( !m_pGrid->is_InGrid(ix = Get_xTo(i, x), iy = Get_yTo(i, y)) )
+					{
+						bEdge	= true;
+					}
+					else if( dzMax < (dz = (m_bDown ? m_pGrid->asDouble(ix, iy) - z : z - m_pGrid->asDouble(ix, iy)) / Get_Length(i)) )
+					{
+						dzMax	= dz;
+						iMax	= i;
+					}
+				}
+
+				//---------------------------------------------
+				m_Dir.Set_Value(x, y, iMax);
+
+				if( iMax < 0 && (bEdge_Seeds || !bEdge) )
+				{
+					int			ID	= m_pSeeds->Get_Count();
+
+					CSG_Shape	*pSeed	= m_pSeeds->Add_Shape();
+
+					pSeed->Set_Point(Get_System()->Get_Grid_to_World(x, y), 0);
+
+					pSeed->Set_Value(SEED_X		, x);
+					pSeed->Set_Value(SEED_Y		, y);
+					pSeed->Set_Value(SEED_Z		, z);
+					pSeed->Set_Value(SEED_ID	, ID);
+					pSeed->Set_Value(SEED_JOIN	, -1);
+				
+					m_pSegments->Set_Value(x, y, ID);
+				}
+				else
+				{
+					m_pSegments->Set_Value(x, y, -1);
+				}
+			}
+		}
+	}
+
+	return( m_pSeeds->Get_Count() > 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatershed_Segmentation::Get_Segments(void)
+{
+	Process_Set_Text(_TL("Segments"));
+
+	double	Threshold	= Parameters("THRESHOLD")->asDouble();
+	int		Join		= Threshold > 0.0 ? Parameters("JOIN")->asInt() : 0;
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)	
+	{
+		int		x, y, i, ID, iID;
+
+		if( m_pGrid->Get_Sorted(n, x, y, m_bDown) && (i = m_Dir.asInt(x, y)) >= 0 )
+		{
+			m_pSegments->Set_Value(x, y, ID = m_pSegments->asInt(Get_xTo(i, x), Get_yTo(i, y)));
+
+			if( Join != 0 && ID >= 0 )
+			{
+				double	z	= m_pGrid->asDouble(x, y);
+
+				for(int i=0; i<8; i++)
+				{
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( m_pSegments->is_InGrid(ix, iy) && (iID = m_pSegments->asInt(ix, iy)) >= 0 )	// Border < 0, Segment >= 0
+					{
+						if( ID != iID )
+						{
+							bool	bJoin;
+
+							if( Join == 1 )
+							{
+								bJoin	=  (Threshold >= fabs(m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) - z))
+										|| (Threshold >= fabs(m_pSeeds->Get_Shape( ID)->asDouble(SEED_Z) - z));
+							}
+							else
+							{
+								bJoin	=  Threshold >= fabs(m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) - m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z));
+							}
+
+							if( bJoin )
+							{
+								if(	(m_bDown == true  && m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) < m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z))
+								||	(m_bDown == false && m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) > m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z)) )
+								{
+									Segment_Change(iID, ID);
+								}
+								else
+								{
+									Segment_Change(ID, iID);
+
+									ID	= iID;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatershed_Segmentation::Segment_Change(int ID, int new_ID)
+{
+	bool	bContinue;
+	int		ax, ay, bx, by;
+
+	//-----------------------------------------------------
+	CSG_Shape	*pSeed	= m_pSeeds->Get_Shape(ID);
+
+	pSeed->Set_Value(SEED_JOIN, new_ID);
+
+	ax	= bx	= pSeed->asInt(SEED_X);
+	ay	= by	= pSeed->asInt(SEED_Y);
+
+	do
+	{
+		bContinue	= false;
+
+		for(int x=ax; x<=bx; x++)
+		{
+			if( m_pSegments->asInt( x, ay) == ID )
+			{
+				m_pSegments->Set_Value( x, ay, new_ID);
+
+				bContinue	= true;
+			}
+
+			if( m_pSegments->asInt( x, by) == ID )
+			{
+				m_pSegments->Set_Value( x, by, new_ID);
+
+				bContinue	= true;
+			}
+		}
+
+		for(int y=ay; y<=by; y++)
+		{
+			if( m_pSegments->asInt(ax,  y) == ID )
+			{
+				m_pSegments->Set_Value(ax,  y, new_ID);
+
+				bContinue	= true;
+			}
+
+			if( m_pSegments->asInt(bx,  y) == ID )
+			{
+				m_pSegments->Set_Value(bx,  y, new_ID);
+
+				bContinue	= true;
+			}
+		}
+
+		if( ax > 0 )			ax--;
+		if( ay > 0 )			ay--;
+		if( bx < Get_NX() - 1 )	bx++;
+		if( by < Get_NY() - 1 )	by++;
+	}
+	while( bContinue );
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatershed_Segmentation::Get_Borders(void)
+{
+	Process_Set_Text(_TL("Borders"));
+
+	CSG_Grid	*pBorders	= SG_Create_Grid(SG_DATATYPE_Byte, Get_NX() + 2, Get_NY() + 2, Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize());
+
+	pBorders->Set_NoData_Value(0);
+
+	Parameters("BORDERS")->Set_Value(pBorders);
+
+	for(int y=0, yy=1; yy<Get_NY() && Set_Progress(yy); y++, yy++)
+	{
+		for(int x=0, xx=1; xx<Get_NX(); x++, xx++)
+		{
+			int		id	= m_pSegments->asInt(x, y);
+
+			if( id != m_pSegments->asInt(xx,  y) )
+			{
+				pBorders->Set_Value(xx,  y, 1);
+			}
+
+			if( id != m_pSegments->asInt( x, yy) )
+			{
+				pBorders->Set_Value( x, yy, 1);
+			}
+
+			if( id != m_pSegments->asInt(xx, yy) )
+			{
+				pBorders->Set_Value(xx, yy, 1);
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.h b/src/modules/imagery/imagery_segmentation/watershed_segmentation.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.h
rename to src/modules/imagery/imagery_segmentation/watershed_segmentation.h
diff --git a/src/modules_images/modules_imagery/imagery_svm/MLB_Interface.cpp b/src/modules/imagery/imagery_svm/MLB_Interface.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/MLB_Interface.cpp
rename to src/modules/imagery/imagery_svm/MLB_Interface.cpp
diff --git a/src/modules_images/modules_imagery/imagery_svm/MLB_Interface.h b/src/modules/imagery/imagery_svm/MLB_Interface.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/MLB_Interface.h
rename to src/modules/imagery/imagery_svm/MLB_Interface.h
diff --git a/src/modules_images/modules_imagery/imagery_svm/Makefile.am b/src/modules/imagery/imagery_svm/Makefile.am
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/Makefile.am
rename to src/modules/imagery/imagery_svm/Makefile.am
diff --git a/src/modules/imagery/imagery_svm/Makefile.in b/src/modules/imagery/imagery_svm/Makefile.in
new file mode 100644
index 0000000..ffbe962
--- /dev/null
+++ b/src/modules/imagery/imagery_svm/Makefile.in
@@ -0,0 +1,630 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_svm
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libimagery_svm_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libimagery_svm_la_OBJECTS = MLB_Interface.lo svm.lo svm_grids.lo
+libimagery_svm_la_OBJECTS = $(am_libimagery_svm_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_svm_la_SOURCES)
+DIST_SOURCES = $(libimagery_svm_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libimagery_svm.la
+libimagery_svm_la_SOURCES = \
+MLB_Interface.cpp\
+svm.cpp\
+svm_grids.cpp\
+MLB_Interface.h\
+svm.h\
+svm_grids.h
+
+libimagery_svm_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_svm/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_svm/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_svm.la: $(libimagery_svm_la_OBJECTS) $(libimagery_svm_la_DEPENDENCIES) $(EXTRA_libimagery_svm_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_svm_la_OBJECTS) $(libimagery_svm_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svm_grids.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_svm/svm.cpp b/src/modules/imagery/imagery_svm/svm.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/svm.cpp
rename to src/modules/imagery/imagery_svm/svm.cpp
diff --git a/src/modules_images/modules_imagery/imagery_svm/svm.h b/src/modules/imagery/imagery_svm/svm.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/svm.h
rename to src/modules/imagery/imagery_svm/svm.h
diff --git a/src/modules_images/modules_imagery/imagery_svm/svm_grids.cpp b/src/modules/imagery/imagery_svm/svm_grids.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/svm_grids.cpp
rename to src/modules/imagery/imagery_svm/svm_grids.cpp
diff --git a/src/modules_images/modules_imagery/imagery_svm/svm_grids.h b/src/modules/imagery/imagery_svm/svm_grids.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_svm/svm_grids.h
rename to src/modules/imagery/imagery_svm/svm_grids.h
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp b/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp
new file mode 100644
index 0000000..77a8b45
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp
@@ -0,0 +1,284 @@
+/**********************************************************
+ * Version $Id: Image_VI_Distance.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Image_VI_Distance.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Image_VI_Distance.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CImage_VI_Distance::CImage_VI_Distance(void)
+{
+	Set_Name		(_TL("Vegetation Index (Distance Based)"));
+
+	Set_Author		(SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Distance based vegetation indices.\n"
+	//	"\n<ul>"
+	//	"<li>Transformed Soil Adjusted Vegetation Index (s. McCloy, 2006)\n"
+	//	"    TSAVI = (NIR - Gain * R - Offset) * Gain / (Gain * NIR + R - Gain * Offset)</li>\n"
+	//	"<li>Transformed Soil Adjusted Vegetation Index (s. McCloy, 2006)\n"
+	//	"    ATSAVI = (NIR - Gain * R - Offset) / (Gain * NIR + R - gain * Offset + 0.8 * (1 + Gain^2))</li>\n"
+	//	"</ul>(NIR = near infrared, R = red, S = soil adjustment factor)\n"
+		"\n"
+		"References:\n"
+		"K.R. McCloy (2006): Resource Management Information Systems: Remote Sensing, GIS and Modelling. 2nd Edition, CRC Taylor & Francis, 575pp.\n"
+		"\n"
+		"N.G. Silleos, T.K. Alexandridis, I.Z. Gitas & K. Perakis (2006): "
+		"Vegetation Indices: Advances Made in Biomass Estimation and Vegetation Monitoring in the Last 30 Years, "
+		"Geocarto International, 21:4, 21-28, "
+		"<a target=\"_blank\" href=\"http://dx.doi.org/10.1080/10106040608542399\">online</a>.\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL, "RED"			, _TL("Red Reflectance"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "NIR"			, _TL("Near Infrared Reflectance"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "PVI0"		, _TL("Perpendicular Vegetation Index (Richardson and Wiegand, 1977)"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "PVI1"		, _TL("Perpendicular Vegetation Index (Perry and Lautenschlager, 1984)"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "PVI2"		, _TL("Perpendicular Vegetation Index (Walther and Shabaani)"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "PVI3"		, _TL("Perpendicular Vegetation Index (Qi, et al., 1994)"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "TSAVI"		, _TL("Transformed Soil Adjusted Vegetation Index (Baret et al. 1989)"), 
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "ATSAVI"		, _TL("Transformed Soil Adjusted Vegetation Index (Baret and Guyot, 1991)"), 
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL, "INTERCEPT"	, _TL("Intercept of Soil Line"), 
+		_TL(""), 
+		PARAMETER_TYPE_Double, 0
+	);
+
+	Parameters.Add_Value(
+		NULL, "SLOPE"		, _TL("Slope of Soil Line"), 
+		_TL(""), 
+		PARAMETER_TYPE_Double, 0.5
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CImage_VI_Distance::On_Execute(void)
+{	
+	CSG_Grid	*pRed		= Parameters("RED"   )->asGrid();
+	CSG_Grid	*pNIR		= Parameters("NIR"   )->asGrid();
+
+	CSG_Grid	*pPVI0		= Parameters("PVI0"  )->asGrid();
+	CSG_Grid	*pPVI1		= Parameters("PVI1"  )->asGrid();
+	CSG_Grid	*pPVI2		= Parameters("PVI2"  )->asGrid();
+	CSG_Grid	*pPVI3		= Parameters("PVI3"  )->asGrid();
+	CSG_Grid	*pTSAVI		= Parameters("TSAVI" )->asGrid();
+	CSG_Grid	*pATSAVI	= Parameters("ATSAVI")->asGrid();
+
+	DataObject_Set_Colors(pPVI0  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pPVI1  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pPVI2  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pPVI3  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pTSAVI , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pATSAVI, 100, SG_COLORS_WHITE_GREEN, false);
+
+	m_Slope		= Parameters("SLOPE"    )->asDouble();
+	m_Intercept	= Parameters("INTERCEPT")->asDouble();
+
+	if( m_Slope <= 0.0 )
+	{
+		Error_Set(_TL("slope value has to be greater than zero"));
+
+		return( false );
+	}
+		
+    for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) )
+			{
+				if( pPVI0   )	pPVI0  ->Set_NoData(x, y);
+				if( pPVI1   )	pPVI1  ->Set_NoData(x, y);
+				if( pPVI2   )	pPVI2  ->Set_NoData(x, y);
+				if( pPVI3   )	pPVI3  ->Set_NoData(x, y);
+				if( pTSAVI  )	pTSAVI ->Set_NoData(x, y);
+				if( pATSAVI )	pATSAVI->Set_NoData(x, y);
+			}
+			else
+			{
+				double	R, NIR, Value;
+
+				R	= pRed->asDouble(x, y);
+				NIR	= pNIR->asDouble(x, y);
+
+				if( pPVI0   ) { if( Get_PVI0  (R, NIR, Value) ) pPVI0  ->Set_Value(x, y, Value); else pPVI0  ->Set_NoData(x, y); }
+				if( pPVI1   ) { if( Get_PVI1  (R, NIR, Value) ) pPVI1  ->Set_Value(x, y, Value); else pPVI1  ->Set_NoData(x, y); }
+				if( pPVI2   ) { if( Get_PVI2  (R, NIR, Value) ) pPVI2  ->Set_Value(x, y, Value); else pPVI2  ->Set_NoData(x, y); }
+				if( pPVI3   ) { if( Get_PVI3  (R, NIR, Value) ) pPVI3  ->Set_Value(x, y, Value); else pPVI3  ->Set_NoData(x, y); }
+				if( pTSAVI  ) { if( Get_TSAVI (R, NIR, Value) ) pTSAVI ->Set_Value(x, y, Value); else pTSAVI ->Set_NoData(x, y); }
+				if( pATSAVI ) { if( Get_ATSAVI(R, NIR, Value) ) pATSAVI->Set_Value(x, y, Value); else pATSAVI->Set_NoData(x, y); }
+			}
+        }
+    }
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline bool CImage_VI_Distance::Get_PVI0(double R, double NIR, double &Value)	// Richardson & Wiegand, 1977
+{
+	double dB1	= 1.0 / m_Slope;
+	double dB0	= R - NIR / m_Slope;
+
+	double Rgg5	= (dB1 * m_Intercept - dB0 * m_Slope) / (dB1 - m_Slope);
+	double Rgg7	= (m_Intercept - dB0) / (dB1 - m_Slope);
+	
+	Value	= sqrt(pow(Rgg5 - R, 2.0) + pow(Rgg7 - NIR, 3.0));
+
+	return( true );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Distance::Get_PVI1(double R, double NIR, double &Value)	// Perry & Rautenschlager, 1984
+{
+	if( (Value = sqrt(1.0 + m_Slope * m_Slope)) != 0.0 )
+	{
+		Value	= ((m_Slope * NIR - R) + m_Intercept) / Value;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Distance::Get_PVI2(double R, double NIR, double &Value)
+{
+	if( (Value = sqrt(1.0 + m_Intercept)) != 0.0 )
+	{
+		Value	= (NIR - m_Intercept) * (R + m_Slope) / Value;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Distance::Get_PVI3(double R, double NIR, double &Value)	// Qi et al., 1994
+{
+	Value	= (NIR * m_Intercept) - (R * m_Slope);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Distance::Get_TSAVI(double R, double NIR, double &Value)	// Baret et al., 1989
+{
+	if( (Value = R + m_Slope * NIR - m_Slope * m_Intercept) != 0.0 )
+	{
+		Value	= m_Slope * (NIR - m_Slope) * (R - m_Intercept) / Value;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Distance::Get_ATSAVI(double R, double NIR, double &Value)	// Baret & Guyot, 1991
+{
+	if( (Value = R + m_Slope * NIR - m_Slope * m_Intercept + 0.08 * (1.0 + m_Slope*m_Slope)) != 0.0 )
+	{
+		Value	= m_Slope * (NIR - m_Slope * R - m_Intercept) / Value;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Distance.h b/src/modules/imagery/imagery_tools/Image_VI_Distance.h
new file mode 100644
index 0000000..54852d3
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/Image_VI_Distance.h
@@ -0,0 +1,87 @@
+/**********************************************************
+ * Version $Id: Image_VI_Distance.h 2072 2014-03-31 08:50:43Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Image_VI_Distance.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Image_VI_Distance_H
+#define HEADER_INCLUDED__Image_VI_Distance_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CImage_VI_Distance : public CSG_Module_Grid
+{
+public:
+	CImage_VI_Distance(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	double					m_Intercept, m_Slope;
+
+
+	bool					Get_PVI0		(double R, double NIR, double &Value);
+	bool					Get_PVI1		(double R, double NIR, double &Value);
+	bool					Get_PVI2		(double R, double NIR, double &Value);
+	bool					Get_PVI3		(double R, double NIR, double &Value);
+	bool					Get_TSAVI		(double R, double NIR, double &Value);
+	bool					Get_ATSAVI		(double R, double NIR, double &Value);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Image_VI_Distance_H
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp b/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp
new file mode 100644
index 0000000..56ccdcb
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp
@@ -0,0 +1,329 @@
+/**********************************************************
+ * Version $Id: Image_VI_Slope.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Image_VI_Slope.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Image_VI_Slope.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CImage_VI_Slope::CImage_VI_Slope(void)
+{
+	Set_Name		(_TL("Vegetation Index (Slope Based)"));
+
+	Set_Author		(SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Slope based vegetation indices.\n"
+		"\n<ul>"
+		"<li>Ratio Vegetation Index (Richardson and Wiegand, 1977)\n"
+		"    RVI = R / NIR</li>\n"
+		"<li>Normalized Ratio Vegetation Index (Baret and Guyot, 1991)\n"
+		"    NRVI = (RVI - 1) / (RVI + 1)</li>\n"
+		"<li>Normalized Difference Vegetation Index (Rouse et al. 1974)\n"
+		"    NDVI = (NIR - R) / (NIR + R)</li>\n"
+		"<li>Transformed Vegetation Index (Deering et al., 1975)\n"
+		"    TVI = [(NIR - R) / (NIR + R)]^0.5 + 0.5 </li>\n"
+		"<li>Corrected Transformed Ratio Vegetation Index (Perry and Lautenschlager, 1984)\n"
+		"    CTVI = [(NDVI + 0.5) / abs(NDVI + 0.5)] * [abs(NDVI + 0.5)]^0.5</li>\n"
+		"<li>Thiam's Transformed Vegetation Index (Thiam, 1997)\n"
+		"    RVI = [abs(NDVI) + 0.5]^0.5</li>\n"
+		"<li>Soil Adjusted Vegetation Index (Huete, 1988)\n"
+		"    SAVI = [(NIR - R) / (NIR + R)] * (1 + S)</li>\n"
+		"</ul>(NIR = near infrared, R = red, S = soil adjustment factor)\n"
+		"\n"
+		"References:\n"
+		"K.R. McCloy (2006): Resource Management Information Systems: Remote Sensing, GIS and Modelling. 2nd Edition, CRC Taylor & Francis, 575pp.\n"
+		"\n"
+		"N.G. Silleos, T.K. Alexandridis, I.Z. Gitas & K. Perakis (2006): "
+		"Vegetation Indices: Advances Made in Biomass Estimation and Vegetation Monitoring in the Last 30 Years, "
+		"Geocarto International, 21:4, 21-28, "
+		"<a target=\"_blank\" href=\"http://dx.doi.org/10.1080/10106040608542399\">online</a>.\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL, "RED"		, _TL("Red Reflectance"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "NIR"		, _TL("Near Infrared Reflectance"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "DVI"		, _TL("Difference Vegetation Index"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "NDVI"	, _TL("Normalized Difference Vegetation Index"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+	
+	Parameters.Add_Grid(
+		NULL, "RVI"		, _TL("Ratio Vegetation Index"), 
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "NRVI"	, _TL("Normalized Ratio Vegetation Index"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "TVI"		, _TL("Transformed Vegetation Index"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "CTVI"	, _TL("Corrected Transformed Vegetation Index"), 
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "TTVI"	, _TL("Thiam's Transformed Vegetation Index"), 
+		_TL(""), 
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "SAVI"		, _TL("Soil Adjusted Vegetation Index"), 
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL, "SOIL"	, _TL("Soil Adjustment Factor"), 
+		_TW("Soil adjustment factor for SAVI calculation. "
+			"Suggested values are 1.0 in case of very low vegetation, "
+			"0.5 for intermediate 0.5, and 0.25 for high densities (Silleos et al. 2006)."),
+		PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CImage_VI_Slope::On_Execute(void)
+{
+	CSG_Grid	*pRed		= Parameters("RED"  )->asGrid();
+	CSG_Grid	*pNIR		= Parameters("NIR"  )->asGrid();
+
+	CSG_Grid	*pDVI		= Parameters("DVI"  )->asGrid();
+	CSG_Grid	*pNDVI		= Parameters("NDVI" )->asGrid();
+	CSG_Grid	*pRVI		= Parameters("RVI"  )->asGrid();
+	CSG_Grid	*pNRVI		= Parameters("NRVI" )->asGrid();
+	CSG_Grid	*pTVI		= Parameters("TVI"  )->asGrid();
+	CSG_Grid	*pCTVI		= Parameters("CTVI" )->asGrid();
+	CSG_Grid	*pTTVI		= Parameters("TTVI" )->asGrid();
+	CSG_Grid	*pSAVI		= Parameters("SAVI" )->asGrid();
+
+	DataObject_Set_Colors(pDVI  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pNDVI , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pRVI  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pNRVI , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pTVI  , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pCTVI , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pTTVI , 100, SG_COLORS_WHITE_GREEN, false);
+	DataObject_Set_Colors(pSAVI , 100, SG_COLORS_WHITE_GREEN, false);
+
+	m_Soil	= Parameters("SOIL")->asDouble();
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) )
+			{
+				if( pDVI   )	pDVI	->Set_NoData(x, y);
+				if( pNDVI  )	pNDVI	->Set_NoData(x, y);
+				if( pRVI   )	pRVI	->Set_NoData(x, y);
+				if( pNRVI  )	pNRVI	->Set_NoData(x, y);
+				if( pTVI   )	pTVI	->Set_NoData(x, y);
+				if( pTTVI  )	pTTVI	->Set_NoData(x, y);
+				if( pCTVI  )	pCTVI	->Set_NoData(x, y);
+				if( pSAVI  )	pSAVI	->Set_NoData(x, y);
+			}
+			else
+			{
+				double	R, NIR, Value;
+
+				R	= pRed->asDouble(x, y);
+				NIR	= pNIR->asDouble(x, y);
+
+				if( pDVI   ) { if( Get_DVI  (R, NIR, Value) ) pDVI  ->Set_Value(x, y, Value); else pDVI  ->Set_NoData(x, y); }
+				if( pNDVI  ) { if( Get_NDVI (R, NIR, Value) ) pNDVI ->Set_Value(x, y, Value); else pNDVI ->Set_NoData(x, y); }
+				if( pRVI   ) { if( Get_RVI  (R, NIR, Value) ) pRVI  ->Set_Value(x, y, Value); else pRVI  ->Set_NoData(x, y); }
+				if( pNRVI  ) { if( Get_NRVI (R, NIR, Value) ) pNRVI ->Set_Value(x, y, Value); else pNRVI ->Set_NoData(x, y); }
+				if( pTVI   ) { if( Get_TVI  (R, NIR, Value) ) pTVI  ->Set_Value(x, y, Value); else pTVI  ->Set_NoData(x, y); }
+				if( pCTVI  ) { if( Get_CTVI (R, NIR, Value) ) pCTVI ->Set_Value(x, y, Value); else pCTVI ->Set_NoData(x, y); }
+				if( pTTVI  ) { if( Get_TTVI (R, NIR, Value) ) pTTVI ->Set_Value(x, y, Value); else pTTVI ->Set_NoData(x, y); }
+				if( pSAVI  ) { if( Get_SAVI (R, NIR, Value) ) pSAVI ->Set_Value(x, y, Value); else pSAVI ->Set_NoData(x, y); }
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_DVI(double R, double NIR, double &Value)
+{
+	Value	= NIR - R;
+
+	return( true );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_NDVI(double R, double NIR, double &Value)
+{
+	if( R + NIR != 0.0 )
+	{
+		Value	= (NIR - R) / (NIR + R);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_RVI(double R, double NIR, double &Value)
+{
+	if( R != 0.0 )
+	{
+		Value	= NIR / R;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_NRVI(double R, double NIR, double &Value)
+{
+	if( Get_RVI(R, NIR, Value) && Value + 1.0 != 0.0 )
+	{
+		Value	= (Value - 1.0) / (Value + 1.0);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_TVI(double R, double NIR, double &Value)
+{
+	if( Get_NDVI(R, NIR, Value) && Value > 0.0 )
+	{
+		Value	= sqrt(Value) + 0.5;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_CTVI(double R, double NIR, double &Value)
+{
+	if( Get_NDVI(R, NIR, Value) )
+	{
+		Value	+= 0.5;
+
+		Value	= Value > 0.0 ? sqrt(fabs(Value)) : -sqrt(fabs(Value));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_TTVI(double R, double NIR, double &Value)
+{
+	if( Get_NDVI(R, NIR, Value) )
+	{
+		Value	= sqrt(fabs(Value + 0.5));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CImage_VI_Slope::Get_SAVI(double R, double NIR, double &Value)
+{
+	if( Get_NDVI(R, NIR, Value) )
+	{
+		Value	= Value * (1.0 + m_Soil);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Slope.h b/src/modules/imagery/imagery_tools/Image_VI_Slope.h
new file mode 100644
index 0000000..ab4281a
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/Image_VI_Slope.h
@@ -0,0 +1,89 @@
+/**********************************************************
+ * Version $Id: Image_VI_Slope.h 2072 2014-03-31 08:50:43Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Image_VI_Slope.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Image_VI_Slope_H
+#define HEADER_INCLUDED__Image_VI_Slope_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CImage_VI_Slope : public CSG_Module_Grid
+{
+public:
+	CImage_VI_Slope(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	double					m_Soil, m_Offset, m_Gain;
+
+
+	bool					Get_DVI			(double R, double NIR, double &Value);
+	bool					Get_NDVI		(double R, double NIR, double &Value);
+	bool					Get_RVI			(double R, double NIR, double &Value);
+	bool					Get_NRVI		(double R, double NIR, double &Value);
+	bool					Get_TVI			(double R, double NIR, double &Value);
+	bool					Get_CTVI		(double R, double NIR, double &Value);
+	bool					Get_TTVI		(double R, double NIR, double &Value);
+	bool					Get_SAVI		(double R, double NIR, double &Value);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Image_VI_Slope_H
diff --git a/src/modules/imagery/imagery_tools/MLB_Interface.cpp b/src/modules/imagery/imagery_tools/MLB_Interface.cpp
new file mode 100644
index 0000000..33b5b3b
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/MLB_Interface.cpp
@@ -0,0 +1,142 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2009 by                 //
+//                 SAGA User Group Assoc.                //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     author at email.de                        //
+//                                                       //
+//    contact:    Author                                 //
+//                Sesame Street. 7                       //
+//                12345 Metropolis                       //
+//                Nirwana                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//			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("Imagery - Tools") );
+
+	case MLB_INFO_Author:
+		return( SG_T("SAGA User Group Assoc. (c) 2009") );
+
+	case MLB_INFO_Description:
+		return( _TL("Image processing tools.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Imagery|Tools") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "Image_VI_Distance.h"
+#include "Image_VI_Slope.h"
+#include "evi.h"
+#include "tasseled_cap.h"
+
+#include "pansharpening.h"
+
+#include "landsat_toar.h"
+#include "landsat_acca.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CImage_VI_Distance );
+	case  1:	return( new CImage_VI_Slope );
+	case  2:	return( new CEnhanced_VI );
+	case  3:	return( new CTasseled_Cap );
+
+	case  4:	return( new CPanSharp_IHS );
+	case  5:	return( new CPanSharp_Brovey );
+	case  6:	return( new CPanSharp_CN );
+	case  7:	return( new CPanSharp_PCA );
+
+	case  8:	return( new CLandsat_TOAR );
+	case  9:	return( new CLandsat_ACCA );
+
+	//-----------------------------------------------------
+	case 10:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/imagery/imagery_tools/MLB_Interface.h b/src/modules/imagery/imagery_tools/MLB_Interface.h
new file mode 100644
index 0000000..c706fbe
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/MLB_Interface.h
@@ -0,0 +1,68 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2009 by                 //
+//                 SAGA User Group Assoc.                //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     author at email.de                        //
+//                                                       //
+//    contact:    Author                                 //
+//                Sesame Street. 7                       //
+//                12345 Metropolis                       //
+//                Nirwana                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__imagery_tools_H
+#define HEADER_INCLUDED__imagery_tools_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__imagery_tools_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/Makefile.am b/src/modules/imagery/imagery_tools/Makefile.am
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_tools/Makefile.am
rename to src/modules/imagery/imagery_tools/Makefile.am
diff --git a/src/modules/imagery/imagery_tools/Makefile.in b/src/modules/imagery/imagery_tools/Makefile.in
new file mode 100644
index 0000000..b421428
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/Makefile.in
@@ -0,0 +1,651 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_tools
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libimagery_tools_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libimagery_tools_la_OBJECTS = evi.lo Image_VI_Distance.lo \
+	Image_VI_Slope.lo landsat_acca.lo landsat_toar.lo \
+	landsat_toar_core.lo MLB_Interface.lo pansharpening.lo \
+	tasseled_cap.lo
+libimagery_tools_la_OBJECTS = $(am_libimagery_tools_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_tools_la_SOURCES)
+DIST_SOURCES = $(libimagery_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libimagery_tools.la
+libimagery_tools_la_SOURCES = \
+evi.cpp\
+Image_VI_Distance.cpp\
+Image_VI_Slope.cpp\
+landsat_acca.cpp\
+landsat_toar.cpp\
+landsat_toar_core.cpp\
+MLB_Interface.cpp\
+pansharpening.cpp\
+tasseled_cap.cpp\
+evi.h\
+Image_VI_Distance.h\
+Image_VI_Slope.h\
+landsat_acca.h\
+landsat_toar.h\
+landsat_toar_core.h\
+MLB_Interface.h\
+pansharpening.h\
+tasseled_cap.h
+
+libimagery_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_tools/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_tools/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_tools.la: $(libimagery_tools_la_OBJECTS) $(libimagery_tools_la_DEPENDENCIES) $(EXTRA_libimagery_tools_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_tools_la_OBJECTS) $(libimagery_tools_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Image_VI_Distance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Image_VI_Slope.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/evi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/landsat_acca.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/landsat_toar.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/landsat_toar_core.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pansharpening.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tasseled_cap.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/imagery/imagery_tools/evi.cpp b/src/modules/imagery/imagery_tools/evi.cpp
new file mode 100644
index 0000000..ba03c3e
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/evi.cpp
@@ -0,0 +1,200 @@
+/**********************************************************
+ * Version $Id: evi.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                        evi.cpp                        //
+//                                                       //
+//                 Copyright (C) 2011 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 "evi.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CEnhanced_VI::CEnhanced_VI(void)
+{
+	Set_Name		(_TL("Enhanced Vegetation Index"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Enhanced Vegetation Index (EVI).\n"
+		"\n"
+		"References:\n"
+		"A Huete, K Didan, T Miura, E.P Rodriguez, X Gao, L.G Ferreira, "
+		"Overview of the radiometric and biophysical performance of the MODIS vegetation indices, "
+		"Remote Sensing of Environment, Volume 83, Issues 1-2, November 2002, Pages 195-213, ISSN 0034-4257, 10.1016/S0034-4257(02)00096-2. "
+		"<a target=\"_blank\" href=\"http://www.sciencedirect.com/science/article/pii/S0034425702000962\">online</a>\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL, "BLUE"	, _TL("Blue Reflectance"),
+		_TL(""), 
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "RED"		, _TL("Red Reflectance"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "NIR"		, _TL("Near Infrared Reflectance"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "EVI"		, _TL("Enhanced Vegetation Index"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "GAIN"	, _TL("Gain"), 
+		_TL(""),
+		PARAMETER_TYPE_Double, 2.5, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "L"		, _TL("Canopy Background Adjustment"), 
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "CBLUE"	, _TL("Aerosol Resistance Coefficient (Blue)"), 
+		_TL(""),
+		PARAMETER_TYPE_Double, 7.5, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "CRED"	, _TL("Aerosol Resistance Coefficient (Red)"), 
+		_TL(""),
+		PARAMETER_TYPE_Double, 6.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CEnhanced_VI::On_Execute(void)
+{
+	CSG_Grid	*pBlue	= Parameters("BLUE" )->asGrid();
+	CSG_Grid	*pRed	= Parameters("RED"  )->asGrid();
+	CSG_Grid	*pNIR	= Parameters("NIR"  )->asGrid();
+
+	CSG_Grid	*pEVI	= Parameters("EVI"  )->asGrid();
+
+	double		Gain	= Parameters("GAIN" )->asDouble();
+	double		L		= Parameters("L"    )->asDouble();
+	double		CBlue	= Parameters("CBLUE")->asDouble();
+	double		CRed	= Parameters("CRED" )->asDouble();
+
+	DataObject_Set_Colors(pEVI, 100, SG_COLORS_WHITE_GREEN, false);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	d;
+
+			if( (pBlue && pBlue->is_NoData(x, y)) || pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) )
+			{
+				d	= 0.0;
+			}
+			else if( pBlue )
+			{
+				d	= L + pNIR->asDouble(x, y) + CRed * pRed->asDouble(x, y) + CBlue * pBlue->asDouble(x, y);
+			}
+			else
+			{
+				d	= L + pNIR->asDouble(x, y) + CRed * pRed->asDouble(x, y);
+			}
+
+			if( d )
+			{
+				pEVI->Set_Value(x, y, Gain * (pNIR->asDouble(x, y) - pRed->asDouble(x, y)) / d);
+			}
+			else
+			{
+				pEVI->Set_NoData(x, y);
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/evi.h b/src/modules/imagery/imagery_tools/evi.h
new file mode 100644
index 0000000..766780b
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/evi.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * Version $Id: evi.h 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                         evi.h                         //
+//                                                       //
+//                 Copyright (C) 2011 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__evi_H
+#define HEADER_INCLUDED__evi_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CEnhanced_VI : public CSG_Module_Grid
+{
+public:
+	CEnhanced_VI(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__evi_H
diff --git a/src/modules/imagery/imagery_tools/landsat_acca.cpp b/src/modules/imagery/imagery_tools/landsat_acca.cpp
new file mode 100644
index 0000000..65886fa
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/landsat_acca.cpp
@@ -0,0 +1,889 @@
+/**********************************************************
+ * Version $Id: landsat_acca.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     imagery_tools                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   landsat_acca.cpp                    //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//            Benjamin Bechtel & 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 "landsat_acca.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define NO_DEFINED		1
+#define IS_SHADOW		2
+#define IS_COLD_CLOUD	6
+#define IS_WARM_CLOUD	9
+
+//---------------------------------------------------------
+#define LUT_SET_CLASS(id, name, color)	{ CSG_Table_Record *pR = pLUT->asTable()->Add_Record(); pR->Set_Value(0, color); pR->Set_Value(1, name); pR->Set_Value(3, id); pR->Set_Value(3, id); }
+
+//---------------------------------------------------------
+void	acca_algorithm	(CSG_Grid *pCloud, CSG_Grid *band[], int single_pass, int with_shadow, int cloud_signature);
+void	filter_holes	(CSG_Grid *pGrid);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CLandsat_ACCA::CLandsat_ACCA(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Automated Cloud Cover Assessment"));
+
+	Set_Author		(_TL("B.Bechtel, O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Automated Cloud-Cover Assessment (ACCA) for Landsat TM/ETM+ imagery as proposed by Irish (2000). "
+		"This module incorporates E.J. Tizado's GRASS GIS implementation (i.landsat.acca).\n"
+		"\n"
+		"References:\n"
+		"- Irish, R.R. (2000): Landsat 7 Automatic Cloud Cover Assessment."
+		" In Shen, S.S., Descour, M.R. (Eds.): Algorithms for Multispectral, Hyperspectral, and Ultraspectral Imagery VI. "
+		" Proceedings of SPIE, 4049: 348-355. "
+		"<a target=\"_blank\" href=\"http://landsathandbook.gsfc.nasa.gov/pdfs/ACCA_SPIE_paper.pdf\">online</a>.\n"
+		"- Irish, R.R., Barker J.L., Goward S.N., Arvidson T. (2006): "
+		" Characterization of the Landsat-7 ETM+ Automated Cloud-Cover Assessment (ACCA) Algorithm."
+		" Photogrammetric Engineering and Remote Sensing vol. 72(10): 1179-1188. "
+		"<a target=\"_blank\" href=\"http://landsathandbook.gsfc.nasa.gov/pdfs/ACCA_Special_Issue_Final.pdf\">online</a>.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(NULL, "BAND2", _TL("Landsat Band 2"), _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL, "BAND3", _TL("Landsat Band 3"), _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL, "BAND4", _TL("Landsat Band 4"), _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL, "BAND5", _TL("Landsat Band 5"), _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL, "BAND6", _TL("Landsat Band 6"), _TL(""), PARAMETER_INPUT, false);
+
+	Parameters.Add_Grid(
+		NULL	, "CLOUD"		, _TL("Cloud Cover"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
+	);
+
+	Parameters.Add_Value(
+		NULL	, "FILTER"		, _TL("Apply post-processing filter to remove small holes"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "NODE_THRS"	, _TL("Thresholds"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "B56C"		, _TL("B56 Composite (step 6)"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 225.0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "B45R"		, _TL("B45 Ratio: Desert detection (step 10)"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "NODE_CLOUD"	, _TL("Cloud Settings"),
+		_TL("")
+	);
+
+//	Parameters.Add_Value(
+//		pNode	, "HIST_N"		, _TL("Number of classes in the cloud temperature histogram"),
+//		_TL(""),
+//		PARAMETER_TYPE_Int, 100, 10, true
+//	);
+
+	Parameters.Add_Value(
+		pNode	, "CSIG"		, _TL("Always use cloud signature (step 14)"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "PASS2"		, _TL("Bypass second-pass processing, and merge warm (not ambiguous) and cold clouds"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SHADOW"		, _TL("Include a category for cloud shadows"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CLandsat_ACCA::On_Execute(void)
+{
+	CSG_Grid	*pCloud, *pBand[5];
+
+	//-----------------------------------------------------
+	// Get parameter settings...
+
+	pBand[0]	= Parameters("BAND2")->asGrid();
+	pBand[1]	= Parameters("BAND3")->asGrid();
+	pBand[2]	= Parameters("BAND4")->asGrid();
+	pBand[3]	= Parameters("BAND5")->asGrid();
+	pBand[4]	= Parameters("BAND6")->asGrid();
+
+	pCloud		= Parameters("CLOUD")->asGrid();
+	pCloud		->Set_NoData_Value(0);
+
+	//-----------------------------------------------------
+//	int	hist_n		= Parameters("HIST_N")->asInt();
+
+	//-----------------------------------------------------
+	acca_algorithm(pCloud, pBand,
+		Parameters("PASS2" )->asBool(),
+		Parameters("SHADOW")->asBool(),
+		Parameters("CSIG"  )->asBool()
+	);
+
+	if( Parameters("FILTER")->asBool() )
+	{
+		filter_holes(pCloud);
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pLUT	= DataObject_Get_Parameter(pCloud, "LUT");
+
+	if( pLUT && pLUT->asTable() )
+	{
+		pLUT->asTable()->Del_Records();
+
+		LUT_SET_CLASS(IS_SHADOW    , _TL("Shadow"    ), SG_COLOR_BLUE_DARK);
+		LUT_SET_CLASS(IS_COLD_CLOUD, _TL("Cold Cloud"), SG_COLOR_BLUE);
+		LUT_SET_CLASS(IS_WARM_CLOUD, _TL("Warm Cloud"), SG_COLOR_BLUE_LIGHT);
+
+		DataObject_Set_Parameter(pCloud, pLUT);
+
+		DataObject_Set_Parameter(pCloud, "COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//													   //
+//													   //
+//													   //
+///////////////////////////////////////////////////////////
+
+/****************************************************************************
+ *
+ * MODULE:	   i.landsat.acca
+ *
+ * AUTHOR(S):	E. Jorge Tizado - ej.tizado at unileon.es
+ *
+ * PURPOSE:	  Landsat TM/ETM+ Automatic Cloud Cover Assessment
+ *			   Adopted for GRASS 7 by Martin Landa <landa.martin gmail.com>
+ *
+ * COPYRIGHT:	(C) 2008, 2010 by the GRASS Development Team
+ *
+ *			   This program is free software under the GNU General Public
+ *   			 License (>=v2). Read the file COPYING that comes with GRASS
+ *   			 for details.
+ *
+ *****************************************************************************/
+
+#define SCALE		200.
+#define K_BASE		230.
+
+/* value and count */
+#define TOTAL		0
+#define WARM		1
+#define COLD		2
+#define SNOW		3
+#define SOIL		4
+
+/* signa */
+#define COVER		1
+#define SUM_COLD	0
+#define SUM_WARM	1
+#define KMEAN		2
+#define KMAX		3
+#define KMIN		4
+
+/* re-use value */
+#define KLOWER		0
+#define KUPPER		1
+#define MEAN		2
+#define SKEW		3
+#define DSTD		4
+
+
+/**********************************************************
+ *
+ * Automatic Cloud Cover Assessment (ACCA): Irish 2000
+ *
+ **********************************************************/
+
+/*--------------------------------------------------------
+  CONSTANTS
+  Usar esta forma para que via extern puedan modificarse
+  como opciones desde el programa main.
+ ---------------------------------------------------------*/
+
+double th_1		= 0.08;		/* Band 3 Brightness Threshold */
+double th_1_b	= 0.07;
+double th_2[2]	= { -0.25, 0.70 };	/* Normalized Snow Difference Index */
+double th_2_b	= 0.8;
+double th_3		= 300.;		/* Band 6 Temperature Threshold */
+double th_4		= 225.;		/* Band 5/6 Composite */
+double th_4_b	= 0.08;
+double th_5		= 2.35;		/* Band 4/3 Ratio */
+double th_6		= 2.16248;	/* Band 4/2 Ratio */
+double th_7		= 1.0;		/* Band 4/5 Ratio */ ;
+double th_8		= 210.;		/* Band 5/6 Composite */
+
+//---------------------------------------------------------
+const int hist_n = 100;		/* interval of real data 100/hist_n */
+
+//---------------------------------------------------------
+#define G_message(s)	SG_UI_Msg_Add(s, false)
+
+void acca_first(CSG_Grid *pCloud, CSG_Grid *band[], int with_shadow, int count[], int cold[], int warm[], double stats[]);
+void acca_second(CSG_Grid *pCloud, CSG_Grid *band, int review_warm, double upper, double lower);
+int shadow_algorithm(double pixel[]);
+
+void hist_put(double t, int hist[]);
+double quantile(double q, int hist[]);
+double moment(int n, int hist[], int k);
+
+
+#define BAND2			0
+#define BAND3			1
+#define BAND4			2
+#define BAND5			3
+#define BAND6			4
+
+#define NO_CLOUD		0
+#define IS_CLOUD		1
+#define COLD_CLOUD		30
+#define WARM_CLOUD		50
+
+//---------------------------------------------------------
+void acca_algorithm(CSG_Grid *pCloud, CSG_Grid *band[], int single_pass, int with_shadow, int cloud_signature)
+{
+	int		i, count[5], hist_cold[hist_n], hist_warm[hist_n], review_warm;
+	double	max, value[5], signa[5], idesert, shift;
+
+	/* Reset variables ... */
+	for (i = 0; i < 5; i++) {
+	count[i] = 0;
+	value[i] = 0.;
+	}
+
+	for (i = 0; i < hist_n; i++) {
+	hist_cold[i] = hist_warm[i] = 0;
+	}
+
+	/* FIRST FILTER ... */
+	acca_first(pCloud, band, with_shadow, count, hist_cold, hist_warm, signa);
+	/* CATEGORIES: NO_DEFINED, WARM_CLOUD, COLD_CLOUD, NULL (= NO_CLOUD) */
+
+	value[WARM] = (double)count[WARM] / (double)count[TOTAL];
+	value[COLD] = (double)count[COLD] / (double)count[TOTAL];
+	value[SNOW] = (double)count[SNOW] / (double)count[TOTAL];
+	value[SOIL] = (double)count[SOIL] / (double)count[TOTAL];
+
+	value[0] = (double)(count[WARM] + count[COLD]);
+	idesert = (value[0] == 0. ? 0. : value[0] / ((double)count[SOIL]));
+
+	//-----------------------------------------------------
+	// BAND-6 CLOUD SIGNATURE DEVELOPMENT
+	if( idesert <= .5 || value[SNOW] > 0.01 )
+	{	// Only the cold clouds are used if snow or desert soil is present
+		review_warm		= 1;
+	}
+	else
+	{	// The cold and warm clouds are combined and treated as a single population
+		review_warm		= 0;
+
+		count[COLD]		+= count[WARM];
+		value[COLD]		+= value[WARM];
+		signa[SUM_COLD]	+= signa[SUM_WARM];
+
+		for(i=0; i<hist_n; i++)
+			hist_cold[i]	+= hist_warm[i];
+	}
+
+	signa[KMEAN] = SCALE * signa[SUM_COLD] / ((double)count[COLD]);
+	signa[COVER] = ((double)count[COLD]) / ((double)count[TOTAL]);
+
+/*	G_message(_TL("Preliminary scene analysis:"));
+	G_message(_TL("* Desert index: %.2lf"), idesert);
+	G_message(_TL("* Snow cover: %.2lf %%"), 100. * value[SNOW]);
+	G_message(_TL("* Cloud cover: %.2lf %%"), 100. * signa[COVER]);
+	G_message(_TL("* Temperature of clouds:"));
+	G_message(_TL("** Maximum: %.2lf K"), signa[KMAX]);
+	G_message(_TL("** Mean (%s cloud): %.2lf K"),
+		(review_warm ? "cold" : "all"), signa[KMEAN]);
+	G_message(_TL("** Minimum: %.2lf K"), signa[KMIN]);
+/**/
+	/* WARNING: re-use of the variable 'value' with new meaning */
+
+	/* step 14 */
+
+	/* To correct Irish2006: idesert has to be bigger than 0.5 to start pass 2 processing (see Irish2000)
+	   because then we have no desert condition (thanks to Matthias Eder, Germany) */
+	if( cloud_signature || (idesert > .5 && signa[COVER] > 0.004 && signa[KMEAN] < 295.) )
+	{
+		G_message(_TL("Histogram cloud signature:"));
+
+		value[MEAN]	= quantile(0.5, hist_cold) + K_BASE;
+		value[DSTD]	= sqrt(moment(2, hist_cold, 1));
+		value[SKEW]	= moment(3, hist_cold, 3) / pow(value[DSTD], 3);
+
+	/*	G_message(_TL("* Mean temperature: %.2lf K"), value[MEAN]);
+		G_message(_TL("* Standard deviation: %.2lf"), value[DSTD]);
+		G_message(_TL("* Skewness: %.2lf"), value[SKEW]);
+		G_message(_TL("* Histogram classes: %d"), hist_n);
+	/**/
+		shift = value[SKEW];
+		if (shift > 1.)
+			shift = 1.;
+		else if (shift < 0.)
+			shift = 0.;
+
+		max = quantile(0.9875, hist_cold) + K_BASE;
+		value[KUPPER] = quantile(0.975, hist_cold) + K_BASE;
+		value[KLOWER] = quantile(0.835, hist_cold) + K_BASE;
+
+	/*	G_message(_TL("* 98.75 percentile: %.2lf K"), max);
+		G_message(_TL("* 97.50 percentile: %.2lf K"), value[KUPPER]);
+		G_message(_TL("* 83.50 percentile: %.2lf K"), value[KLOWER]);
+	/**/
+		/* step 17 & 18 */
+		if (shift > 0.)
+		{
+			shift *= value[DSTD];
+
+			if ((value[KUPPER] + shift) > max)
+			{
+				if ((value[KLOWER] + shift) > max)
+				{
+					value[KLOWER] += (max - value[KUPPER]);
+				}
+				else
+				{
+					value[KLOWER] += shift;
+				}
+
+				value[KUPPER] = max;
+			}
+			else
+			{
+				value[KLOWER] += shift;
+				value[KUPPER] += shift;
+			}
+		}
+
+	/*	G_message(_TL("Maximum temperature:"));
+		G_message(_TL("* Cold cloud: %.2lf K"), value[KUPPER]);
+		G_message(_TL("* Warm cloud: %.2lf K"), value[KLOWER]);
+	/**/
+	}
+	else if( signa[KMEAN] < 295. )
+	{	// Retained warm and cold clouds
+		G_message(_TL("Result: Scene with clouds"));
+		review_warm = 0;
+		value[KUPPER] = 0.;
+		value[KLOWER] = 0.;
+	}
+	else
+	{	// Retained cold clouds
+		G_message(_TL("Result: Scene cloud free"));
+		review_warm = 1;
+		value[KUPPER] = 0.;
+		value[KLOWER] = 0.;
+	}
+
+	//-----------------------------------------------------
+	// SECOND FILTER ...
+
+	// By-pass two processing but it retains warm and cold clouds
+	if( single_pass != 0 )
+	{
+		review_warm		= -1;
+		value[KUPPER]	= 0.;
+		value[KLOWER]	= 0.;
+	}
+
+	// CATEGORIES: IS_WARM_CLOUD, IS_COLD_CLOUD, IS_SHADOW, NULL (= NO_CLOUD)
+	acca_second(pCloud, band[BAND6], review_warm, value[KUPPER], value[KLOWER]);
+
+	//-----------------------------------------------------
+	return;
+}
+
+//---------------------------------------------------------
+void acca_first(CSG_Grid *pCloud, CSG_Grid *band[], int with_shadow, int count[], int cold[], int warm[], double stats[])
+{
+	double	nsdi, rat56;
+
+	/* Creation of output file */
+	/* ----- ----- */
+	SG_UI_Msg_Add_Execution(_TL("Processing first pass..."), true);
+
+	stats[SUM_COLD]	= 0.;
+	stats[SUM_WARM]	= 0.;
+	stats[KMAX]		= 0.;
+	stats[KMIN]		= 10000.;
+
+	for(int y=0; y<pCloud->Get_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++)
+	{
+		for(int x=0; x<pCloud->Get_NX(); x++)
+		{
+			char	code	= NO_DEFINED;
+			double	pixel[5];
+
+			for(int i=BAND2; i<=BAND6; i++)	// Null when null pixel in any band
+			{
+				if( pCloud->Get_System() == band[i]->Get_System() )
+				{
+					if( band[i]->is_NoData(x, y) )
+					{
+						code	= NO_CLOUD;
+						break;
+					}
+
+					pixel[i]	= band[i]->asDouble(x, y);
+				}
+				else if( !band[i]->Get_Value(pCloud->Get_System().Get_Grid_to_World(x, y), pixel[i]) )
+				{
+					code	= NO_CLOUD;
+					break;
+				}
+			}
+
+			/* Determina los pixeles de sombras */
+			if( code == NO_DEFINED && with_shadow )
+			{
+				code = shadow_algorithm(pixel);
+			}
+
+			/* Analiza el valor de los pixeles no definidos */
+			if (code == NO_DEFINED)
+			{
+				code	= NO_CLOUD;
+				count[TOTAL]++;
+				nsdi	= (pixel[BAND2] - pixel[BAND5]) / (pixel[BAND2] + pixel[BAND5]);
+
+				/* ----------------------------------------------------- */
+				/* step 1. Brightness Threshold: Eliminates dark images */
+				if (pixel[BAND3] > th_1)
+				{
+					/* step 3. Normalized Snow Difference Index: Eliminates many types of snow */
+					if (nsdi > th_2[0] && nsdi < th_2[1])
+					{
+						/* step 5. Temperature Threshold: Eliminates warm image features */
+						if (pixel[BAND6] < th_3)
+						{
+							rat56 = (1. - pixel[BAND5]) * pixel[BAND6];
+							/* step 6. Band 5/6 Composite: Eliminates numerous categories including ice */
+							if (rat56 < th_4)
+							{
+								/* step 8. Eliminates growing vegetation */
+								if ((pixel[BAND4] / pixel[BAND3]) < th_5)
+								{
+									/* step 9. Eliminates senescing vegetation */
+									if ((pixel[BAND4] / pixel[BAND2]) < th_6)
+									{
+										/* step 10. Eliminates rocks and desert */
+										count[SOIL]++;
+
+										if ((pixel[BAND4] / pixel[BAND5]) > th_7)
+										{
+											/* step 11. Distinguishes warm clouds from cold clouds */
+											if (rat56 < th_8)
+											{
+												code = COLD_CLOUD;
+												count[COLD]++;
+												/* for statistic */
+												stats[SUM_COLD] += (pixel[BAND6] / SCALE);
+												hist_put(pixel[BAND6] - K_BASE, cold);
+											}
+											else
+											{
+												code = WARM_CLOUD;
+												count[WARM]++;
+												/* for statistic */
+												stats[SUM_WARM] += (pixel[BAND6] / SCALE);
+												hist_put(pixel[BAND6] - K_BASE, warm);
+											}
+
+											if (pixel[BAND6] > stats[KMAX])	stats[KMAX] = pixel[BAND6];
+											if (pixel[BAND6] < stats[KMIN])	stats[KMIN] = pixel[BAND6];
+										}
+										else
+										{
+											code = NO_DEFINED;
+										}
+									}
+									else
+									{
+										code = NO_DEFINED;
+										count[SOIL]++;
+									}
+								}
+								else
+								{
+									code = NO_DEFINED;
+								}
+							}
+							else
+							{
+								/* step 7 */
+								code = (pixel[BAND5] < th_4_b) ? NO_CLOUD : NO_DEFINED;
+							}
+						}
+						else
+						{
+							code = NO_CLOUD;
+						}
+					}
+					else
+					{
+						/* step 3 */
+						code = NO_CLOUD;
+				
+						if (nsdi > th_2_b)
+							count[SNOW]++;
+					}
+				}
+				else
+				{
+					/* step 2 */
+					code = (pixel[BAND3] < th_1_b) ? NO_CLOUD : NO_DEFINED;
+				}
+			}
+
+			//---------------------------------------------
+			if (code == NO_CLOUD)
+			{
+				pCloud->Set_Value(x, y, 1);
+			}
+			else
+			{
+				pCloud->Set_Value(x, y, code);
+			}
+		}
+	}
+
+	return;
+}
+
+//---------------------------------------------------------
+void acca_second(CSG_Grid *pCloud, CSG_Grid *pThermal, int review_warm, double upper, double lower)
+{
+	SG_UI_Process_Set_Text(upper == 0.0
+		? _TL("Removing ambiguous pixels...")
+		: _TL("Pass two processing...")
+	);
+
+	//-----------------------------------------------------
+	for(int y=0; y<pCloud->Get_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++)
+	{
+		double	p_y	= pCloud->Get_YMin() + y * pCloud->Get_Cellsize();
+
+		#pragma omp parallel for
+		for(int x=0; x<pCloud->Get_NX(); x++)
+		{
+			if( !pCloud->is_NoData(x, y) )
+			{
+				int	code	= pCloud->asInt(x, y);
+
+				if( code == NO_DEFINED || (code == WARM_CLOUD && review_warm == 1) )	// Resolve ambiguous pixels
+				{
+					double	t, p_x	= pCloud->Get_XMin() + x * pCloud->Get_Cellsize();
+
+					if( !pThermal->Get_Value(p_x, p_y, t) || t > upper )
+					{
+						pCloud->Set_NoData(x, y);
+					}
+					else
+					{
+						pCloud->Set_Value(x, y, t < lower ? IS_WARM_CLOUD : IS_COLD_CLOUD);
+					}
+				}
+				else if( code == COLD_CLOUD || code == WARM_CLOUD )	// Join warm (not ambiguous) and cold clouds
+				{
+					pCloud->Set_Value(x, y, (code == WARM_CLOUD && review_warm == 0) ? IS_WARM_CLOUD : IS_COLD_CLOUD);
+				}
+				else
+				{
+					pCloud->Set_Value(x, y, IS_SHADOW);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//					Cloud shadows						 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int shadow_algorithm(double pixel[])
+{
+	// I think this filter is better but not in any paper
+	if( pixel[BAND3] < 0.07 && (1 - pixel[BAND4]) * pixel[BAND6] > 240. && pixel[BAND4] / pixel[BAND2] > 1.
+	&& (pixel[BAND3] - pixel[BAND5]) / (pixel[BAND3] + pixel[BAND5]) < 0.10 )
+//	if( pixel[BAND3] < 0.07 && (1 - pixel[BAND4]) * pixel[BAND6] > 240. && pixel[BAND4] / pixel[BAND2] > 1. )
+	{
+		return IS_SHADOW;
+	}
+
+	return NO_DEFINED;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				  HISTOGRAM ANALYSIS					 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Define un factor de escala = hist_n/100 con objeto
+// de dividir el entero 1 por 100/hist_n partes y
+// aumentar la precision.
+//
+// Afecta al almacenamiento en el histograma pero
+// modifica el calculo de quantiles y momentos.
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+void hist_put(double t, int hist[])
+{
+	int	i	= (int)(t * ((double)hist_n / 100.));	// scale factor
+
+	if( i < 1 )
+		i	= 1;
+	else if (i > hist_n)
+		i	= hist_n;
+
+	hist[i - 1]++;
+}
+
+//---------------------------------------------------------
+/* histogram moment */
+double moment(int n, int hist[], int k)
+{
+	int		i, total;
+	double	value, mean;
+
+	for(i=0, total=0, mean=0; i<hist_n; i++)
+	{
+		total	+= hist[i];
+		mean	+= (double)(i * hist[i]);
+	}
+
+	mean	/= ((double)total);	/* histogram mean */
+
+	for(i=0, value=0.; i<hist_n; i++)
+	{
+		value	+= (pow((i - mean), n) * ((double)hist[i]));
+	}
+
+	value	/= (double)(total);	// k	= 0;	// ???!!!
+//	value	/= (double)(total - k);
+
+	return( value / pow((double)hist_n / 100., n) );
+}
+
+//---------------------------------------------------------
+/* Real data quantile */
+double quantile(double q, int hist[])
+{
+	int		i, total;
+	double	value, qmax, qmin;
+
+	for(i=0, total=0; i<hist_n; i++)
+	{
+		total += hist[i];
+	}
+
+	for(i=hist_n-1, value=0, qmax=1.; i>=0; i--)
+	{
+		qmin	= qmax - (double)hist[i] / (double)total;
+
+		if( q >= qmin )
+		{
+			value = (q - qmin) / (qmax - qmin) + (i - 1);
+			break;
+		}
+
+		qmax	= qmin;
+	}
+
+	/* remove scale factor */
+	return (value / ((double)hist_n / 100.));
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				FILTER HOLES OF CLOUDS					 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// This a >=50% filter of 3x3
+// if >= 50% vecinos cloud then pixel set to cloud
+//---------------------------------------------------------
+void filter_holes(CSG_Grid *pCloud)
+{
+	if( pCloud->Get_NY() < 3 || pCloud->Get_NX() < 3 )
+		return;
+
+	SG_UI_Process_Set_Text(_TL("Filling small holes in clouds..."));
+
+	CSG_Grid Cloud(*pCloud);
+
+	//-----------------------------------------------------
+	for(int y=0; y<pCloud->Get_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<pCloud->Get_NX(); x++)
+		{
+			int	z	= Cloud.asInt(x, y);
+
+			if( z == 0 )
+			{
+				int	cold, warm, shadow, nulo;
+
+				cold = warm = shadow = nulo = 0;
+
+				for(int i=0; i<8; i++)
+				{
+					int	ix	= pCloud->Get_System().Get_xTo(i, x);
+					int	iy	= pCloud->Get_System().Get_yTo(i, y);
+
+					switch( Cloud.is_InGrid(ix, iy) ? Cloud.asInt(ix, iy) : -1 )
+					{
+					case IS_COLD_CLOUD:	cold  ++;	break;
+					case IS_WARM_CLOUD:	warm  ++;	break;
+					case IS_SHADOW:		shadow++;	break;
+					default:			nulo  ++;	break;
+					}
+				}
+
+				int	lim	= (cold + warm + shadow + nulo) / 2;
+
+				// Entra pixel[0] = 0
+				if( nulo < lim )
+				{
+					if( shadow >= (cold + warm) )
+						z = IS_SHADOW;
+					else
+						z = (warm > cold) ? IS_WARM_CLOUD : IS_COLD_CLOUD;
+				}
+			}
+
+			if( z != 0 )
+			{
+				pCloud->Set_Value(x, y, z);
+			}
+			else
+			{
+				pCloud->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return;
+}
+
+
+///////////////////////////////////////////////////////////
+//													   //
+//													   //
+//													   //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/landsat_acca.h b/src/modules/imagery/imagery_tools/landsat_acca.h
new file mode 100644
index 0000000..b7070ed
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/landsat_acca.h
@@ -0,0 +1,110 @@
+/**********************************************************
+ * Version $Id: landsat_acca.h 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     imagery_tools                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    landsat_acca.h                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//            Benjamin Bechtel & 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__landsat_acca_H
+#define HEADER_INCLUDED__landsat_acca_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CLandsat_ACCA : public CSG_Module_Grid
+{
+public:
+
+	CLandsat_ACCA(void);
+
+	virtual CSG_String	Get_MenuPath	(void)	{	return( _TL("R:Landsat") );	}
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+
+private:
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__landsat_acca_H
diff --git a/src/modules/imagery/imagery_tools/landsat_toar.cpp b/src/modules/imagery/imagery_tools/landsat_toar.cpp
new file mode 100644
index 0000000..f036f70
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/landsat_toar.cpp
@@ -0,0 +1,786 @@
+/**********************************************************
+ * Version $Id: landsat_toar.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     imagery_tools                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   landsat_toar.cpp                    //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//            Benjamin Bechtel & 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 "landsat_toar.h"
+
+//---------------------------------------------------------
+#include "landsat_toar_core.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	mss1 = 0,	// Landsat-1 MSS
+	mss2,		// Landsat-2 MSS
+	mss3,		// Landsat-3 MSS
+	mss4,		// Landsat-4 MSS
+	mss5,		// Landsat-5 MSS
+	tm4,		// Landsat-4 TM
+	tm5,		// Landsat-5 TM
+	tm7			// Landsat-7 ETM+
+};
+
+//---------------------------------------------------------
+#define PRM_IN(id)				(CSG_String("DN_") + id)
+#define PRM_OUT(id)				(CSG_String("RF_") + id)
+#define PRM_ADD_BAND__IN(id)	Parameters.Add_Grid(pNode, PRM_IN (id), CSG_String::Format(SG_T("%s %s"), _TL("DN"), _TL("Band")) + id, _TL(""), PARAMETER_INPUT_OPTIONAL);
+#define PRM_ADD_BAND_OUT(id)	Parameters.Add_Grid(pNode, PRM_OUT(id), CSG_String::Format(SG_T("%s %s"), _TL("Reflectance"), _TL("Band")) + id, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+#define PRM_ADD_BAND(id)		PRM_ADD_BAND_IN(id); PRM_ADD_BAND_OUT(id)
+#define PRM_ENABLE_OUTPUT(id)	pParameters->Get_Parameter(PRM_OUT(id))->Set_Enabled(pParameters->Get_Parameter(PRM_IN(id))->is_Enabled() && pParameters->Get_Parameter(PRM_IN(id))->asGrid())
+
+//---------------------------------------------------------
+#define GET_DESC_INT(name, value)		CSG_String::Format(SG_T("%s: %d\n"), name, value)
+#define GET_DESC_FLT(name, value)		CSG_String::Format(SG_T("%s: %f\n"), name, value)
+#define GET_DESC_RNG(name, min, max)	CSG_String::Format(SG_T("%s: %f / %f\n"), name, min, max)
+#define GET_DESC_STR(name, value)		CSG_String(name) + ": " + CSG_String(value) + "\n"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool	Set_Date_from_String	(char *date, const CSG_String s)
+{
+	// yyyy-mm-dd
+	// 0123456789
+
+	if( s.Length() == 10 )
+	{
+		strncpy(date, s.b_str(), 11);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool	Load_MetaFile	(const CSG_String &MetaFile, lsat_data &lsat)
+{
+	if( !SG_File_Exists(MetaFile) )	// Data from metadata file
+	{
+		return( false );
+	}
+
+	if( !lsat_newdata(MetaFile, &lsat)
+	&&  !lsat_mtldata(MetaFile, &lsat)
+	&&  !lsat_metdata(MetaFile, &lsat)	)
+	{
+		return( false );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int		Get_Sensor_Index	(int LSat_Number, const CSG_String &LSat_Sensor)
+{
+	if( !LSat_Sensor.CmpNoCase("MSS") )
+	{
+		switch( LSat_Number )
+		{
+		case 1:	return(0);	break;	// Landsat-1 MSS
+		case 2:	return(1);	break;	// Landsat-2 MSS
+		case 3:	return(2);	break;	// Landsat-3 MSS
+		case 4:	return(3);	break;	// Landsat-4 MSS
+		case 5:	return(4);	break;	// Landsat-5 MSS
+		}
+	}
+	else if( !CSG_String(LSat_Sensor).CmpNoCase("TM") )
+	{
+		switch( LSat_Number )
+		{
+		case 4:	return(5);	break;	// Landsat-1 MSS
+		case 5:	return(6);	break;	// Landsat-2 MSS
+		}
+	}
+	else if( !CSG_String(LSat_Sensor).Find("ETM") && LSat_Number == 7 )
+	{
+		return(7);	// Landsat-7 ETM+
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CLandsat_TOAR::CLandsat_TOAR(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Top of Atmosphere Reflectance"));
+
+	Set_Author		(_TL("B.Bechtel, O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Calculation of top-of-atmosphere radiance or reflectance and temperature (TOAR) for Landsat MSS/TM/ETM+. "
+		"This module incorporates E.J. Tizado's GRASS GIS implementation (i.landsat.toar).\n"
+		"\n"
+		"References:\n"
+		"<a target=\"_blank\" href=\"http://landsathandbook.gsfc.nasa.gov/\">Landsat 7 Science Data Users Handbook</a>"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid_System(NULL, "GS_SPECTRAL", _TL("Spectral"    ), _TL(""));
+	PRM_ADD_BAND__IN("10"); PRM_ADD_BAND__IN("20"); PRM_ADD_BAND__IN("30"); PRM_ADD_BAND__IN("40"); PRM_ADD_BAND__IN("50"); PRM_ADD_BAND__IN("70");
+	PRM_ADD_BAND_OUT("10"); PRM_ADD_BAND_OUT("20"); PRM_ADD_BAND_OUT("30"); PRM_ADD_BAND_OUT("40"); PRM_ADD_BAND_OUT("50"); PRM_ADD_BAND_OUT("70");
+
+	pNode	= Parameters.Add_Grid_System(NULL, "GS_THERMAL"	, _TL("Thermal"     ), _TL(""));
+	PRM_ADD_BAND__IN("60"); PRM_ADD_BAND__IN("61"); PRM_ADD_BAND__IN("62");
+	PRM_ADD_BAND_OUT("60"); PRM_ADD_BAND_OUT("61"); PRM_ADD_BAND_OUT("62");
+
+	pNode	= Parameters.Add_Grid_System(NULL, "GS_PAN"		, _TL("Panchromatic"), _TL(""));
+	PRM_ADD_BAND__IN("80");
+	PRM_ADD_BAND_OUT("80");
+
+	//-----------------------------------------------------
+	Parameters.Add_FilePath(
+		NULL	, "METAFILE"	, _TL("Metadata File"),
+		_TL("Name of Landsat metadata file (.met or MTL.txt)"),
+		CSG_String::Format(SG_T("%s|*.met;*.txt|%s|*.*"),
+			_TL("Metadata Files (*.met, *.txt)"),
+			_TL("All Files")
+		) 
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "SENSOR"		, _TL("Spacecraft Sensor"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("Landsat-1 MSS"),
+			_TL("Landsat-2 MSS"),
+			_TL("Landsat-3 MSS"),
+			_TL("Landsat-4 MSS"),
+			_TL("Landsat-5 MSS"),
+			_TL("Landsat-4 TM"),
+			_TL("Landsat-5 TM"),
+			_TL("Landsat-7 ETM+")
+		), 7
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_String(
+		NULL	, "DATE_ACQU"	, _TL("Image Acquisition Date"),
+		_TL("Image acquisition date (yyyy-mm-dd)"),
+		"2001-01-01"
+	);
+
+	Parameters.Add_String(
+		NULL	, "DATE_PROD"	, _TL("Image Creation Date"),
+		_TL("Image creation date (yyyy-mm-dd)"),
+		"2001-01-01"
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SUN_HGT"		, _TL("Suns's Height"),
+		_TL("Sun's height above horizon in degree"),
+		PARAMETER_TYPE_Double, 45.0, 0.0, true, 90.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "AS_RAD"		, _TL("At-Sensor Radiance"),
+		_TL("Output at-sensor radiance for all bands"),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Choice(
+		NULL	, "AC_METHOD"	, _TL("Atmospheric Correction"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("uncorrected"),
+			_TL("corrected"),
+			_TL("dos1"),
+			_TL("dos2"),
+			_TL("dos2b"),
+			_TL("dos3"),
+			_TL("dos4")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "AC_DO_CELLS"	, _TL("Minimum Number of Dark Object Cells"),
+		_TL("Minimum pixels to consider digital number as dark object"),
+		PARAMETER_TYPE_Int, 1000, 0, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "AC_RAYLEIGH"	, _TL("Rayleigh Scattering"),
+		_TL("Rayleigh atmosphere (diffuse sky irradiance)"),
+		PARAMETER_TYPE_Double, 0.0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "AC_SUN_RAD"	, _TL("Solar Radiance"),
+		_TL("Percent of solar radiance in path radiance"),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true, 100.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "ETM_GAIN"	, _TL("ETM+ Gain"),
+		_TL("Gain (H/L) of all Landsat ETM+ bands (1-5,61,62,7,8)")
+	);
+
+	Parameters.Add_Choice(pNode, "ETM_GAIN_10", _TL("Band 1" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_20", _TL("Band 2" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_30", _TL("Band 3" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_40", _TL("Band 4" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_50", _TL("Band 5" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_61", _TL("Band 61"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 0);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_62", _TL("Band 62"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_70", _TL("Band 7" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
+	Parameters.Add_Choice(pNode, "ETM_GAIN_80", _TL("Band 8" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 0);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CLandsat_TOAR::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METAFILE")) && *pParameter->asString() )
+	{
+		lsat_data	lsat;
+
+		if( !Load_MetaFile(pParameter->asString(), lsat) )
+		{
+			pParameter->Set_Value((const char *)"");
+
+			Error_Set(_TL("could not read metadata file"));
+		}
+		else
+		{
+			pParameters->Get_Parameter("SENSOR"   )->Set_Value(Get_Sensor_Index(lsat.number, lsat.sensor));
+			pParameters->Get_Parameter("DATE_ACQU")->Set_Value((const char *)lsat.date);
+			pParameters->Get_Parameter("DATE_PROD")->Set_Value((const char *)lsat.creation);
+			pParameters->Get_Parameter("SUN_HGT"  )->Set_Value(lsat.sun_elev);
+		}
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SENSOR")) )
+	{
+		pParameters->Get_Parameter("METAFILE")->Set_Value((const char *)"");
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+int CLandsat_TOAR::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AC_METHOD")) )
+	{
+		pParameters->Get_Parameter("AC_DO_CELLS")->Set_Enabled(pParameter->asInt() > 1);
+	}
+
+	if(	1 )
+	{
+		int	Sensor	= pParameters->Get_Parameter("SENSOR")->asInt();
+
+		pParameters->Get_Parameter("ETM_GAIN"  )->Set_Enabled(Sensor == tm7 && !(*pParameters->Get_Parameter("METAFILE")->asString()));
+
+		pParameters->Get_Parameter("GS_PAN"    )->Set_Enabled(Sensor == tm7);
+		pParameters->Get_Parameter("GS_THERMAL")->Set_Enabled(Sensor >= tm4);
+
+		pParameters->Get_Parameter(PRM_IN("50"))->Set_Enabled(Sensor >= tm4);
+		pParameters->Get_Parameter(PRM_IN("70"))->Set_Enabled(Sensor >= tm4);
+		pParameters->Get_Parameter(PRM_IN("60"))->Set_Enabled(Sensor == tm4 || Sensor == tm5);
+		pParameters->Get_Parameter(PRM_IN("61"))->Set_Enabled(Sensor == tm7);
+		pParameters->Get_Parameter(PRM_IN("62"))->Set_Enabled(Sensor == tm7);
+
+		PRM_ENABLE_OUTPUT("10");
+		PRM_ENABLE_OUTPUT("20");
+		PRM_ENABLE_OUTPUT("30");
+		PRM_ENABLE_OUTPUT("40");
+		PRM_ENABLE_OUTPUT("50");
+		PRM_ENABLE_OUTPUT("60");
+		PRM_ENABLE_OUTPUT("61");
+		PRM_ENABLE_OUTPUT("62");
+		PRM_ENABLE_OUTPUT("70");
+		PRM_ENABLE_OUTPUT("80");
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CLandsat_TOAR::On_Execute(void)
+{
+	//-----------------------------------------------------
+	int			Sensor, iBand, dn_dark[MAX_BANDS], dn_mode[MAX_BANDS], AC_Method, AC_nCells;
+	double		AC_Rayleigh, AC_SunRad;
+	CSG_Grid	*pInput, *pOutput;
+	lsat_data	lsat;
+
+	//-----------------------------------------------------
+	if( *Parameters("METAFILE")->asString()  )
+	{
+		if( !Load_MetaFile(Parameters("METAFILE")->asString(), lsat) )
+		{
+			Error_Set(_TL("could not read metadata file"));
+
+			return( false );
+		}
+
+		Sensor		= Get_Sensor_Index(lsat.number, lsat.sensor);
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		memset(&lsat, 0, sizeof(lsat));
+
+		if( !Set_Date_from_String(lsat.date    , Parameters("DATE_ACQU")->asString()) )
+		{
+			Error_Set(_TL("invalid acquisition date"));
+
+			return( false );
+		}
+
+		if( !Set_Date_from_String(lsat.creation, Parameters("DATE_PROD")->asString()) )
+		{
+			Error_Set(_TL("invalid production date"));
+
+			return( false );
+		}
+
+		lsat.sun_elev	= Parameters("SUN_HGT")->asDouble();
+
+		switch( Sensor = Parameters("SENSOR")->asInt() )
+		{
+		case mss1:	set_MSS1(&lsat);	break;
+		case mss2:	set_MSS2(&lsat);	break;
+		case mss3:	set_MSS3(&lsat);	break;
+		case mss4:	set_MSS4(&lsat);	break;
+		case mss5:	set_MSS5(&lsat);	break;
+		case tm4:	set_TM4 (&lsat);	break;
+		case tm5:	set_TM5 (&lsat);	break;
+		case tm7:
+			{
+				char	gain[9];
+
+				gain[0]	= Parameters("ETM_GAIN_10")->asInt() == 0 ? 'L' : 'H';
+				gain[1]	= Parameters("ETM_GAIN_20")->asInt() == 0 ? 'L' : 'H';
+				gain[2]	= Parameters("ETM_GAIN_30")->asInt() == 0 ? 'L' : 'H';
+				gain[3]	= Parameters("ETM_GAIN_40")->asInt() == 0 ? 'L' : 'H';
+				gain[4]	= Parameters("ETM_GAIN_50")->asInt() == 0 ? 'L' : 'H';
+				gain[5]	= Parameters("ETM_GAIN_61")->asInt() == 0 ? 'L' : 'H';
+				gain[6]	= Parameters("ETM_GAIN_62")->asInt() == 0 ? 'L' : 'H';
+				gain[7]	= Parameters("ETM_GAIN_70")->asInt() == 0 ? 'L' : 'H';
+				gain[8]	= Parameters("ETM_GAIN_80")->asInt() == 0 ? 'L' : 'H';
+
+				set_ETM (&lsat, gain);	// Landsat-7 requires band gain with 9 (H/L) data
+				break;
+			}
+		}
+    }
+
+
+	///////////////////////////////////////////////////////
+	//-----------------------------------------------------
+	// Atmospheric Correction
+
+	switch( Parameters("AC_METHOD")->asInt() )
+	{
+	default:	AC_Method	= UNCORRECTED;	break;
+	case 1:		AC_Method	= CORRECTED;	break;
+	case 2:		AC_Method	= DOS1;			break;
+	case 3:		AC_Method	= DOS2;			break;
+	case 4:		AC_Method	= DOS2b;		break;
+	case 5:		AC_Method	= DOS3;			break;
+	case 6:		AC_Method	= DOS4;			break;
+	}
+
+	AC_nCells	= Parameters("AC_DO_CELLS")->asInt();
+	AC_Rayleigh	= Parameters("AC_RAYLEIGH")->asDouble();
+	AC_SunRad	= Parameters("AC_SUN_RAD" )->asDouble() / 100.0;
+
+	//-----------------------------------------------------
+	for(iBand=0; iBand<lsat.bands && Process_Get_Okay(); iBand++)
+	{
+		dn_mode[iBand] = 0;
+		dn_dark[iBand] = (int)lsat.band[iBand].qcalmin;
+
+		if( !(pInput = Get_Band_Input(iBand, Sensor)) )
+		{
+			continue;
+		}
+
+		//-------------------------------------------------
+		if( AC_Method > DOS && !lsat.band[iBand].thermal )	// calculate dark pixel
+		{
+			Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("Dark Object Subtraction"), lsat.band[iBand].number, lsat.bands));
+
+			int				j;
+			unsigned long	hist[256], h_max;
+
+			memset(hist, 0, 256 * sizeof(unsigned long));
+
+			//---------------------------------------------
+			// histogram
+			for(int y=0; y<pInput->Get_NY() && Set_Progress(y, pInput->Get_NY()); y++)
+			{
+				for(int x=0, q; x<pInput->Get_NX(); x++)
+				{
+					if( !pInput->is_NoData(x, y) && (q = pInput->asInt(x, y)) != 0 && q >= lsat.band[iBand].qcalmin && q <= 255 )
+					{
+						hist[q]++;
+					}
+				}
+			}
+
+			//---------------------------------------------
+			// DN of dark object
+			for(j=(int)lsat.band[iBand].qcalmin; j<256; j++)
+			{
+				if( hist[j] >= (unsigned int)AC_nCells )
+				{
+					dn_dark[iBand] = j;
+			
+					break;
+				}
+			}
+
+			//---------------------------------------------
+			// Mode of DN
+			for(j=(int)lsat.band[iBand].qcalmin, h_max=0L; j<241; j++)
+			{
+				if( hist[j] > h_max )	// Exclude potentially saturated < 240
+				{
+					h_max = hist[j];
+					dn_mode[iBand] = j;
+				}
+			}
+
+			Message_Add(CSG_String::Format(SG_T("DN = %.2d [%lu] : mode %.2d [%lu] %s"),
+				dn_dark[iBand], hist[dn_dark[iBand]],
+				dn_mode[iBand], hist[dn_mode[iBand]],
+				hist[255] > hist[dn_mode[iBand]] ? ", excluding DN > 241" : ""
+			));
+		}
+
+		//-------------------------------------------------
+		lsat_bandctes(&lsat, iBand, AC_Method, AC_SunRad, dn_dark[iBand], AC_Rayleigh);	// calculate transformation constants
+	}
+
+
+	///////////////////////////////////////////////////////
+	//-----------------------------------------------------
+	bool	bRadiance	= Parameters("AS_RAD")->asBool();
+
+	CSG_String	sAll	= _TL("Top of Atmosphere Reflectance");	sAll	+= "\n";
+
+	sAll	+= GET_DESC_STR(_TL("Platform")              , CSG_String::Format(SG_T("Landsat-%d"), lsat.number));
+	sAll	+= GET_DESC_STR(_TL("Sensor")                , lsat.sensor);
+	sAll	+= GET_DESC_STR(_TL("Acquisition")           , lsat.date);
+	sAll	+= GET_DESC_STR(_TL("Production")            , lsat.creation);
+	sAll	+= GET_DESC_FLT(_TL("Earth-Sun Distance")    , lsat.dist_es);
+	sAll	+= GET_DESC_FLT(_TL("Solar Height")          , lsat.sun_elev);
+	sAll	+= GET_DESC_STR(_TL("Atmospheric Correction"), Parameters("AC_METHOD")->asString());
+
+	//-----------------------------------------------------
+	for(iBand=0; iBand<lsat.bands && Process_Get_Okay(); iBand++)
+	{
+		if( !(pInput  = Get_Band_Input (iBand, Sensor))
+		||  !(pOutput = Get_Band_Output(iBand, Sensor)) )
+		{
+			continue;
+		}
+
+		Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"),
+			bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance"),
+			lsat.band[iBand].number, lsat.bands
+		));
+
+		//-------------------------------------------------
+		for(int y=0; y<pInput->Get_NY() && Set_Progress(y, pInput->Get_NY()); y++)
+		{
+			#pragma omp parallel for
+			for(int x=0; x<pInput->Get_NX(); x++)
+			{
+				double	qcal;
+
+				if( pInput->is_NoData(x, y) || (qcal = pInput->asDouble(x, y)) == 0.0 || qcal < lsat.band[iBand].qcalmin )
+				{
+					pOutput->Set_NoData(x, y);
+				}
+				else
+				{
+					double	r	= lsat_qcal2rad(qcal, &lsat.band[iBand]);
+
+					if( bRadiance )
+					{
+						pOutput->Set_Value(x, y, r);
+					}
+					else if( lsat.band[iBand].thermal )
+					{
+						pOutput->Set_Value(x, y, lsat_rad2temp(r, &lsat.band[iBand]));
+					}
+					else
+					{
+						r	= lsat_rad2ref(r, &lsat.band[iBand]);
+
+						pOutput->Set_Value(x, y, r < 0.0 && AC_Method > DOS ? 0.0 : r);
+					}
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		CSG_String	sBand;
+
+		sBand	+= GET_DESC_INT(_TL("Band"                     ), lsat.band[iBand].number);
+		sBand	+= GET_DESC_STR(_TL("Type"                     ), bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance"));
+		sBand	+= GET_DESC_RNG(_TL("Calibrated Digital Number"), lsat.band[iBand].qcalmin, lsat.band[iBand].qcalmax);
+		sBand	+= GET_DESC_RNG(_TL("Calibration Constants"    ), lsat.band[iBand].lmin   , lsat.band[iBand].lmax);
+		sBand	+= GET_DESC_STR(AC_Method > DOS ? _TL("At-Surface Radiance") : _TL("At-Sensor Radiance"), CSG_String::Format(SG_T("%.5lf * DN + %.5lf"), lsat.band[iBand].gain, lsat.band[iBand].bias));
+
+		if( lsat.band[iBand].thermal )
+		{
+			sBand	+= GET_DESC_STR(_TL("At-Sensor Temperature"), CSG_String::Format(SG_T("%.3lf / ln[(%.3lf / %s) + 1.0]"), lsat.band[iBand].K2, lsat.band[iBand].K1, _TL("Radiance")));
+			sBand	+= GET_DESC_FLT(_TL("Temperature K1"       ), lsat.band[iBand].K1);
+			sBand	+= GET_DESC_FLT(_TL("Temperature K2"       ), lsat.band[iBand].K2);
+		}
+		else
+		{
+			sBand	+= GET_DESC_FLT(_TL("Mean Solar Irradiance"), lsat.band[iBand].esun);	// Mean Solar Exoatmospheric Irradiance
+			sBand	+= GET_DESC_STR(AC_Method > DOS ? _TL("At-Surface Reflectance") : _TL("At-Sensor Reflectance"), CSG_String::Format(SG_T("%s / %.5lf"), _TL("Radiance"), lsat.band[iBand].K2));
+
+			if( AC_Method > DOS )
+			{
+				double	ref_mode	= lsat_rad2ref(lsat_qcal2rad(dn_mode[iBand], &lsat.band[iBand]), &lsat.band[iBand]);
+
+				sBand	+= GET_DESC_INT(_TL("Minimum of Darkness DN Cells" ), AC_nCells);
+				sBand	+= GET_DESC_INT(_TL("Darkness Digital Number (DN)" ), dn_dark[iBand]);
+				sBand	+= GET_DESC_INT(_TL("Mode of DN"                   ), dn_mode[iBand]);
+				sBand	+= GET_DESC_FLT(_TL("Mode in Reflectance Histogram"), ref_mode);
+			}
+		}
+
+		Message_Add(sBand, true);
+
+		//-------------------------------------------------
+		pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(),
+			bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance")
+		));
+
+		if( lsat.band[iBand].thermal )
+		{
+			pOutput->Set_Unit(_TL("Kelvin"));
+		}
+
+		pOutput->Set_Description(sAll + sBand);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Grid * CLandsat_TOAR::Get_Band_Input(int iBand, int Sensor)
+{
+	switch( iBand )
+	{
+	case 0:	return( Parameters(PRM_IN("10"))->asGrid() );
+	case 1:	return( Parameters(PRM_IN("20"))->asGrid() );
+	case 2:	return( Parameters(PRM_IN("30"))->asGrid() );
+	case 3:	return( Parameters(PRM_IN("40"))->asGrid() );
+	}
+
+	switch( Sensor )
+	{
+	case tm4: case tm5:
+		switch( iBand )
+		{
+		case 4:	return( Parameters(PRM_IN("50"))->asGrid() );
+		case 5:	return( Parameters(PRM_IN("60"))->asGrid() );
+		case 6:	return( Parameters(PRM_IN("70"))->asGrid() );
+		}
+		break;
+
+	case tm7:
+		switch( iBand )
+		{
+		case 4:	return( Parameters(PRM_IN("50"))->asGrid() );
+		case 5:	return( Parameters(PRM_IN("61"))->asGrid() );
+		case 6:	return( Parameters(PRM_IN("62"))->asGrid() );
+		case 7:	return( Parameters(PRM_IN("80"))->asGrid() );
+		}
+		break;
+	}
+
+	return( NULL );
+}
+
+//---------------------------------------------------------
+CSG_Grid * CLandsat_TOAR::Get_Band_Output(int iBand, int Sensor)
+{
+	CSG_Grid	*pInput	= Get_Band_Input(iBand, Sensor);
+
+	if( pInput )
+	{
+		CSG_Parameter	*pOutput	= NULL;
+
+		switch( iBand )
+		{
+		case 0:	pOutput = Parameters(PRM_OUT("10"));	break;
+		case 1:	pOutput	= Parameters(PRM_OUT("20"));	break;
+		case 2:	pOutput	= Parameters(PRM_OUT("30"));	break;
+		case 3:	pOutput	= Parameters(PRM_OUT("40"));	break;
+		}
+
+		switch( Sensor )
+		{
+		case tm4: case tm5:
+			switch( iBand )
+			{
+			case 4:	pOutput	= Parameters(PRM_OUT("50"));	break;
+			case 5:	pOutput	= Parameters(PRM_OUT("60"));	break;
+			case 6:	pOutput	= Parameters(PRM_OUT("70"));	break;
+			}
+			break;
+
+		case tm7:
+			switch( iBand )
+			{
+			case 4:	pOutput	= Parameters(PRM_OUT("50"));	break;
+			case 5:	pOutput	= Parameters(PRM_OUT("61"));	break;
+			case 6:	pOutput	= Parameters(PRM_OUT("62"));	break;
+			case 7:	pOutput	= Parameters(PRM_OUT("80"));	break;
+			}
+			break;
+		}
+
+		if( pOutput )
+		{
+			if( !pOutput->asGrid() )
+			{
+				CSG_Grid	*pGrid	= SG_Create_Grid(pInput);
+
+				if( pGrid && pGrid->is_Valid() && pGrid->Get_System() == pInput->Get_System() )
+				{
+					pOutput->Set_Value(pGrid);
+				}
+				else
+				{
+					if( pGrid )
+					{
+						delete(pGrid);
+					}
+
+					return( NULL );
+				}
+			}
+
+			pOutput->asGrid()->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Reflectance")));
+
+			return( pOutput->asGrid() );
+		}
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/landsat_toar.h b/src/modules/imagery/imagery_tools/landsat_toar.h
new file mode 100644
index 0000000..fa428a3
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/landsat_toar.h
@@ -0,0 +1,114 @@
+/**********************************************************
+ * Version $Id: landsat_toar.h 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     imagery_tools                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    landsat_toar.h                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//            Benjamin Bechtel & 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__landsat_toar_H
+#define HEADER_INCLUDED__landsat_toar_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CLandsat_TOAR : public CSG_Module
+{
+public:
+	CLandsat_TOAR(void);
+
+	virtual CSG_String	Get_MenuPath			(void)	{	return( _TL("R:Landsat") );	}
+
+
+protected:
+
+	virtual int			On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int			On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool		On_Execute				(void);
+
+
+private:
+
+	CSG_Grid *			Get_Band_Input			(int iBand, int Sensor);
+	CSG_Grid *			Get_Band_Output			(int iBand, int Sensor);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__landsat_toar_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/landsat_toar_core.cpp b/src/modules/imagery/imagery_tools/landsat_toar_core.cpp
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_tools/landsat_toar_core.cpp
rename to src/modules/imagery/imagery_tools/landsat_toar_core.cpp
diff --git a/src/modules_images/modules_imagery/imagery_tools/landsat_toar_core.h b/src/modules/imagery/imagery_tools/landsat_toar_core.h
similarity index 100%
rename from src/modules_images/modules_imagery/imagery_tools/landsat_toar_core.h
rename to src/modules/imagery/imagery_tools/landsat_toar_core.h
diff --git a/src/modules/imagery/imagery_tools/pansharpening.cpp b/src/modules/imagery/imagery_tools/pansharpening.cpp
new file mode 100644
index 0000000..7c6e129
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/pansharpening.cpp
@@ -0,0 +1,811 @@
+/**********************************************************
+ * Version $Id: pansharpening.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   pansharpening.cpp                   //
+//                                                       //
+//                 Copyright (C) 2011 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 "pansharpening.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+TSG_Grid_Interpolation	Get_Interpolation(int Interpolation)
+{
+	switch( Interpolation )
+	{
+	case 0:				return( GRID_INTERPOLATION_NearestNeighbour );
+	case 1:				return( GRID_INTERPOLATION_Bilinear );
+	case 2: default:	return( GRID_INTERPOLATION_BSpline );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPanSharp_IHS::CPanSharp_IHS(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("IHS Sharpening"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Intensity, hue, saturation (IHS) sharpening.\n"
+		"\nReferences:\n"
+		"Haydn, R., Dalke, G. W., Henkel, J., Bare, J. E. (1982): "
+		"Application of the IHS color transform to the processing of multisensor data and image enhancement. "
+		"Proceedings of the International Symposium on Remote Sensing of Arid and Semi-Arid Lands, "
+		"Cairo, Egypt (Environmental Research Institute, Ann Arbor, Mich., 1982), pp. 599�616.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(NULL	, "R"		, _TL("Red")	, _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL	, "G"		, _TL("Green")	, _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL	, "B"		, _TL("Blue")	, _TL(""), PARAMETER_INPUT);
+
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "PAN_SYSTEM"	, _TL("High Resolution Grid System"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid(
+		pNode	, "PAN"			, _TL("Panchromatic Channel"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(pNode	, "R_SHARP"	, _TL("Red")	, _TL(""), PARAMETER_OUTPUT, false);
+	Parameters.Add_Grid(pNode	, "G_SHARP"	, _TL("Green")	, _TL(""), PARAMETER_OUTPUT, false);
+	Parameters.Add_Grid(pNode	, "B_SHARP"	, _TL("Blue")	, _TL(""), PARAMETER_OUTPUT, false);
+
+	Parameters.Add_Grid_List(
+		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "RESAMPLING"	, _TL("Resampling"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nearest neighbour"),
+			_TL("bilinear"),
+			_TL("cubic convolution")
+		), 2
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "PAN_MATCH"	, _TL("Panchromatic Channel Matching"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("normalized"),
+			_TL("standardized")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPanSharp_IHS::On_Execute(void)
+{
+	//-----------------------------------------------------
+	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
+
+	//-----------------------------------------------------
+	int			y;
+	double		r, g, b, i, h, s;
+	CSG_Grid	*pPan, *pR, *pG, *pB;
+
+	pPan	= Parameters("PAN")->asGrid();
+
+	//-----------------------------------------------------
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("R")->asGrid()->Get_Name()));
+	pR	= Parameters("R_SHARP")->asGrid();
+	pR	->Assign  (Parameters("R")->asGrid(), Interpolation);
+	pR	->Set_Name(Parameters("R")->asGrid()->Get_Name());
+
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("G")->asGrid()->Get_Name()));
+	pG	= Parameters("G_SHARP")->asGrid();
+	pG	->Assign  (Parameters("G")->asGrid(), Interpolation);
+	pG	->Set_Name(Parameters("G")->asGrid()->Get_Name());
+
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("B")->asGrid()->Get_Name()));
+	pB	= Parameters("B_SHARP")->asGrid();
+	pB	->Assign  (Parameters("B")->asGrid(), Interpolation);
+	pB	->Set_Name(Parameters("B")->asGrid()->Get_Name());
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("RGB to IHS"));
+
+	double	rMin	= pR->Get_ZMin(),	rRange	= pR->Get_ZRange();
+	double	gMin	= pG->Get_ZMin(),	gRange	= pG->Get_ZRange();
+	double	bMin	= pB->Get_ZMin(),	bRange	= pB->Get_ZRange();
+
+	for(y=0; y<pPan->Get_NY() && Set_Progress(y, pPan->Get_NY()); y++)
+	{
+		for(int x=0; x<pPan->Get_NX(); x++)
+		{
+			bool	bNoData	= true;
+
+			if( pPan->is_NoData(x, y) || pR->is_NoData(x, y) || pG->is_NoData(x, y) || pB->is_NoData(x, y) )
+			{
+				pR->Set_NoData(x, y);
+				pG->Set_NoData(x, y);
+				pB->Set_NoData(x, y);
+			}
+			else
+			{
+				r	= (pR->asDouble(x, y) - rMin) / rRange;	if( r < 0.0 ) r = 0.0; else if( r > 1.0 ) r = 1.0;
+				g	= (pG->asDouble(x, y) - gMin) / gRange;	if( g < 0.0 ) g = 0.0; else if( g > 1.0 ) g = 1.0;
+				b	= (pB->asDouble(x, y) - bMin) / bRange;	if( b < 0.0 ) b = 0.0; else if( b > 1.0 ) b = 1.0;
+
+				i	= r + g + b;
+				
+				if( i <= 0.0 )
+				{
+					h	= 0.0;
+					s	= 0.0;
+				}
+				else
+				{
+					if( r == g && g == b )			{	h	= 0.0;	}
+					else if( b < r && b < g )		{	h	= (g - b) / (i - 3 * b)    ;	}
+					else if( r < g && r < b )		{	h	= (b - r) / (i - 3 * r) + 1;	}
+					else							{	h	= (r - g) / (i - 3 * g) + 2;	}
+
+					if     ( 0.0 <= h && h < 1.0 )	{	s	= (i - 3 * b) / i;	}
+					else if( 1.0 <= h && h < 2.0 )	{	s	= (i - 3 * r) / i;	}
+					else							{	s	= (i - 3 * g) / i;	}
+				}
+
+				pR->Set_Value(x, y, i);
+				pG->Set_Value(x, y, s);
+				pB->Set_Value(x, y, h);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	double	Offset_Pan, Offset, Scale;
+
+	if( Parameters("PAN_MATCH")->asInt() == 0 )
+	{
+		Offset_Pan	= pPan->Get_ZMin();
+		Offset		= pR->Get_ZMin();
+		Scale		= pR->Get_ZRange() / pPan->Get_ZRange();
+	}
+	else
+	{
+		Offset_Pan	= pPan->Get_ArithMean();
+		Offset		= pR->Get_ArithMean();
+		Scale		= pR->Get_StdDev() / pPan->Get_StdDev();
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("IHS to RGB"));
+
+	for(y=0; y<pPan->Get_NY() && Set_Progress(y, pPan->Get_NY()); y++)
+	{
+		for(int x=0; x<pPan->Get_NX(); x++)
+		{
+			if( !pR->is_NoData(x, y) )
+			{
+				i	= Offset + Scale * (pPan->asDouble(x, y) - Offset_Pan);
+				s	= pG  ->asDouble(x, y);
+				h	= pB  ->asDouble(x, y);
+
+				if     ( 0.0 <= h && h < 1.0 )
+				{
+					r	= i * (1 + 2 * s - 3 * s * h) / 3;
+					g	= i * (1 -     s + 3 * s * h) / 3;
+					b	= i * (1 -     s            ) / 3;
+				}
+				else if( 1.0 <= h && h < 2.0 )
+				{
+					r	= i * (1 -     s                  ) / 3;
+					g	= i * (1 + 2 * s - 3 * s * (h - 1)) / 3;
+					b	= i * (1 -     s + 3 * s * (h - 1)) / 3;
+				}
+				else
+				{
+					r	= i * (1 -     s + 3 * s * (h - 2)) / 3;
+					g	= i * (1 -     s                  ) / 3;
+					b	= i * (1 + 2 * s - 3 * s * (h - 2)) / 3;
+				}
+
+				pR->Set_Value(x, y, rMin + r * rRange);
+				pG->Set_Value(x, y, gMin + g * gRange);
+				pB->Set_Value(x, y, bMin + b * bRange);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPanSharp_Brovey::CPanSharp_Brovey(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Colour Normalized Brovey Sharpening"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Colour normalized (Brovey) sharpening.\n"
+		"\n"
+		"References:\n"
+		"Vrabel, J. (1996): Multispectral Imagery Band Sharpening Study. "
+		"Photogrammetric Engineering & Remote Sensing, Vol. 62, No. 9, pp. 1075-1083.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(NULL	, "R"		, _TL("Red")	, _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL	, "G"		, _TL("Green")	, _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL	, "B"		, _TL("Blue")	, _TL(""), PARAMETER_INPUT);
+
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "PAN_SYSTEM"	, _TL("High Resolution Grid System"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid(
+		pNode	, "PAN"			, _TL("Panchromatic Channel"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(pNode	, "R_SHARP"	, _TL("Red")	, _TL(""), PARAMETER_OUTPUT, false);
+	Parameters.Add_Grid(pNode	, "G_SHARP"	, _TL("Green")	, _TL(""), PARAMETER_OUTPUT, false);
+	Parameters.Add_Grid(pNode	, "B_SHARP"	, _TL("Blue")	, _TL(""), PARAMETER_OUTPUT, false);
+
+	Parameters.Add_Grid_List(
+		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "RESAMPLING"	, _TL("Resampling"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nearest neighbour"),
+			_TL("bilinear"),
+			_TL("cubic convolution")
+		), 2
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPanSharp_Brovey::On_Execute(void)
+{
+	//-----------------------------------------------------
+	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
+
+	//-----------------------------------------------------
+	CSG_Grid	*pPan, *pR, *pG, *pB;
+
+	pPan	= Parameters("PAN")->asGrid();
+
+	//-----------------------------------------------------
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("R")->asGrid()->Get_Name()));
+	pR	= Parameters("R_SHARP")->asGrid();
+	pR	->Assign  (Parameters("R")->asGrid(), Interpolation);
+	pR	->Set_Name(Parameters("R")->asGrid()->Get_Name());
+
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("G")->asGrid()->Get_Name()));
+	pG	= Parameters("G_SHARP")->asGrid();
+	pG	->Assign  (Parameters("G")->asGrid(), Interpolation);
+	pG	->Set_Name(Parameters("G")->asGrid()->Get_Name());
+
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("B")->asGrid()->Get_Name()));
+	pB	= Parameters("B_SHARP")->asGrid();
+	pB	->Assign  (Parameters("B")->asGrid(), Interpolation);
+	pB	->Set_Name(Parameters("B")->asGrid()->Get_Name());
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Sharpening"));
+
+	for(int y=0; y<pPan->Get_NY() && Set_Progress(y, pPan->Get_NY()); y++)
+	{
+		for(int x=0; x<pPan->Get_NX(); x++)
+		{
+			if( !pPan->is_NoData(x, y) && !pR->is_NoData(x, y) && !pG->is_NoData(x, y) && !pB->is_NoData(x, y) )
+			{
+				double	k	= (pR->asDouble(x, y) + pG->asDouble(x, y) + pB->asDouble(x, y));
+
+				if( k != 0.0 )
+				{
+					k	= pPan->asDouble(x, y) / k;
+				}
+
+				pR->Mul_Value(x, y, k);
+				pG->Mul_Value(x, y, k);
+				pB->Mul_Value(x, y, k);
+			}
+			else
+			{
+				pR->Set_NoData(x, y);
+				pG->Set_NoData(x, y);
+				pB->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPanSharp_CN::CPanSharp_CN(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Colour Normalized Spectral Sharpening"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Colour normalized spectral sharpening.\n"
+		"\n"
+		"References:\n"
+		"Vrabel, J., Doraiswamy, P., McMurtrey, J., Stern, A. (2002): "
+		"Demonstration of the Accuracy of Improved Resolution Hyperspectral Imagery. "
+		"SPIE Symposium Proceedings.\n"
+		"\n"
+		"Vrabel, J., Doraiswamy, P., Stern, A. (2002): "
+		"Application of Hyperspectral Imagery Resolution Improvement for Site-Specific Farming. "
+		"ASPRS 2002 Conference Proceedings.\n"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "LO_RES"		, _TL("Low Resolution Grid System"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_List(
+		pNode	, "GRIDS"		, _TL("Original Channels"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "PAN"			, _TL("Panchromatic Channel"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "RESAMPLING"	, _TL("Resampling"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nearest neighbour"),
+			_TL("bilinear"),
+			_TL("cubic convolution")
+		), 2
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPanSharp_CN::On_Execute(void)
+{
+	//-----------------------------------------------------
+	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
+
+	//-----------------------------------------------------
+	int						i;
+	CSG_Grid				*pPan;
+	CSG_Parameter_Grid_List	*pGrids, *pSharp;
+	
+	pPan	= Parameters("PAN"    )->asGrid();
+	pGrids	= Parameters("GRIDS"  )->asGridList();
+	pSharp	= Parameters("SHARPEN")->asGridList();
+
+	//-----------------------------------------------------
+	pSharp->Del_Items();
+
+	for(i=0; i<pGrids->Get_Count(); i++)
+	{
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), pGrids->asGrid(i)->Get_Name()));
+
+		CSG_Grid	*pGrid	= SG_Create_Grid(*Get_System());
+
+		pGrid->Set_Name (pGrids->asGrid(i)->Get_Name());
+		pGrid->Assign   (pGrids->asGrid(i), Interpolation);
+
+		pSharp->Add_Item(pGrid);
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	Sum	= 0.0;
+
+			if( !pPan->is_NoData(x, y) )
+			{
+				for(i=0; i<pSharp->Get_Count(); i++)
+				{
+					if( !pSharp->asGrid(i)->is_NoData(x, y) )
+					{
+						Sum	+= pSharp->asGrid(i)->asDouble (x, y);
+					}
+					else
+					{
+						Sum	 = 0.0;
+
+						break;
+					}
+				}
+			}
+
+			if( Sum )
+			{
+				Sum	= pPan->asDouble(x, y) * pSharp->Get_Count() / (Sum + pSharp->Get_Count());
+
+				for(i=0; i<pSharp->Get_Count(); i++)
+				{
+					pSharp->asGrid(i)->Mul_Value(x, y, Sum);
+				}
+			}
+			else
+			{
+				for(i=0; i<pSharp->Get_Count(); i++)
+				{
+					pSharp->asGrid(i)->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPanSharp_PCA::CPanSharp_PCA(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Principle Components Based Image Sharpening"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Principle components based image sharpening."
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "LO_RES"		, _TL("Low Resolution Grid System"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_List(
+		pNode	, "GRIDS"		, _TL("Original Channels"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "PAN"			, _TL("Panchromatic Channel"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("correlation matrix"),
+			_TL("variance-covariance matrix"),
+			_TL("sums-of-squares-and-cross-products matrix")
+		), 1
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "RESAMPLING"	, _TL("Resampling"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nearest neighbour"),
+			_TL("bilinear"),
+			_TL("cubic convolution")
+		), 2
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "PAN_MATCH"	, _TL("Panchromatic Channel Matching"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("normalized"),
+			_TL("standardized")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define RUN_MODULE(BRETVAL, LIBRARY, MODULE, PARAMETERS, GRIDSYSTEM, CONDITION)	{\
+	\
+	BRETVAL	= false;\
+	\
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T(LIBRARY), MODULE);\
+	\
+	if(	pModule == NULL )\
+	{\
+		Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("could not find module"), SG_T(LIBRARY)));\
+	}\
+	else if( pModule->is_Grid() )\
+	{\
+		Process_Set_Text(pModule->Get_Name());\
+		\
+		CSG_Parameters	P_tmp; P_tmp.Assign(pModule->Get_Parameters());\
+		\
+		pModule->Set_Manager(NULL);\
+		\
+		((CSG_Module_Grid *)pModule)->Get_System()->Assign(GRIDSYSTEM);\
+		\
+		if( !(CONDITION) )\
+		{\
+			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not initialize module"), SG_T(LIBRARY), pModule->Get_Name().c_str()));\
+		}\
+		else if( !pModule->Execute() )\
+		{\
+			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not execute module")   , SG_T(LIBRARY), pModule->Get_Name().c_str()));\
+		}\
+		else\
+		{\
+			BRETVAL	= true;\
+		}\
+		\
+		PARAMETERS.Assign(pModule->Get_Parameters());\
+		\
+		pModule->Get_Parameters()->Assign_Values(&P_tmp);\
+	}\
+}
+
+//---------------------------------------------------------
+#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPanSharp_PCA::On_Execute(void)
+{
+	//-----------------------------------------------------
+	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
+
+	//-----------------------------------------------------
+	bool			bResult;
+	CSG_Parameters	P;
+	CSG_Table		Eigen;
+
+	//-----------------------------------------------------
+	RUN_MODULE(bResult, "statistics_grid", 8, P, Parameters("GRIDS")->asGridList()->asGrid(0)->Get_System(),
+			SET_PARAMETER("GRIDS"	, Parameters("GRIDS"))
+		&&	SET_PARAMETER("METHOD"	, Parameters("METHOD"))
+		&&	SET_PARAMETER("EIGEN"	, &Eigen)
+		&&	SET_PARAMETER("NFIRST"	, 0)
+	);
+
+	if( !bResult )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pPCA_0	= P.Get_Parameter("PCA")->asGridList();
+	CSG_Parameter_Grid_List	*pPCA_1	= P.Add_Grid_List(NULL, "PCA_1", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList();
+
+	CSG_Grid	*PCA	= new CSG_Grid[pPCA_0->Get_Count()];
+	CSG_Grid	*pPan	= Parameters("PAN")->asGrid();
+
+	double	Offset_Pan, Offset, Scale;
+
+	if( Parameters("PAN_MATCH")->asInt() == 0 )
+	{
+		Offset_Pan	= pPan->Get_ZMin();
+		Offset		= pPCA_0->asGrid(0)->Get_ZMin();
+		Scale		= pPCA_0->asGrid(0)->Get_ZRange() / pPan->Get_ZRange();
+	}
+	else
+	{
+		Offset_Pan	= pPan->Get_ArithMean();
+		Offset		= pPCA_0->asGrid(0)->Get_ArithMean();
+		Scale		= pPCA_0->asGrid(0)->Get_StdDev() / pPan->Get_StdDev();
+	}
+
+	PCA[0].Create(*Get_System());
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( pPan->is_NoData(x, y) )
+			{
+				PCA[0].Set_NoData(x, y);
+			}
+			else
+			{
+				PCA[0].Set_Value(x, y, Offset + Scale * (pPan->asDouble(x, y) - Offset_Pan));
+			}
+		}
+	}
+
+	pPCA_1->Add_Item(&PCA[0]);
+
+	delete(pPCA_0->asGrid(0));
+
+	for(int i=1; i<pPCA_0->Get_Count(); i++)
+	{
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), pPCA_0->asGrid(i)->Get_Name()));
+
+		PCA[i].Create(*Get_System());
+		PCA[i].Assign(pPCA_0->asGrid(i), Interpolation);
+		pPCA_1->Add_Item(&PCA[i]);
+		delete(pPCA_0->asGrid(i));
+	}
+
+	//-----------------------------------------------------
+	RUN_MODULE(bResult, "statistics_grid", 10, P, *Get_System(),
+			SET_PARAMETER("PCA"		, P("PCA_1"))
+		&&	SET_PARAMETER("GRIDS"	, Parameters("SHARPEN"))
+		&&	SET_PARAMETER("EIGEN"	, &Eigen)
+	);
+
+	delete[](PCA);
+
+	if( !bResult )
+	{
+		return( false );
+	}
+
+	Parameters.Set_Parameter("SHARPEN", P.Get_Parameter("GRIDS"));
+
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS"  )->asGridList();
+	CSG_Parameter_Grid_List	*pSharp	= Parameters("SHARPEN")->asGridList();
+
+	for(int j=0; j<pGrids->Get_Count() && j<pSharp->Get_Count(); j++)
+	{
+		pSharp->asGrid(j)->Set_Name(pGrids->asGrid(j)->Get_Name());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/pansharpening.h b/src/modules/imagery/imagery_tools/pansharpening.h
new file mode 100644
index 0000000..3df61f6
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/pansharpening.h
@@ -0,0 +1,155 @@
+/**********************************************************
+ * Version $Id: pansharpening.h 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    pansharpening.h                    //
+//                                                       //
+//                 Copyright (C) 2011 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__pansharpening_pca_H
+#define HEADER_INCLUDED__pansharpening_pca_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPanSharp_IHS : public CSG_Module_Grid
+{
+public:
+	CPanSharp_IHS(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPanSharp_Brovey : public CSG_Module_Grid
+{
+public:
+	CPanSharp_Brovey(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPanSharp_CN : public CSG_Module_Grid
+{
+public:
+	CPanSharp_CN(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPanSharp_PCA : public CSG_Module_Grid
+{
+public:
+	CPanSharp_PCA(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__pansharpening_pca_H
diff --git a/src/modules/imagery/imagery_tools/tasseled_cap.cpp b/src/modules/imagery/imagery_tools/tasseled_cap.cpp
new file mode 100644
index 0000000..ccb6a40
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/tasseled_cap.cpp
@@ -0,0 +1,227 @@
+/**********************************************************
+ * Version $Id: tasseled_cap.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   tasseled_cap.cpp                    //
+//                                                       //
+//                 Copyright (C) 2011 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 "tasseled_cap.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTasseled_Cap::CTasseled_Cap(void)
+{
+	Set_Name		(_TL("Tasseled Cap Transformation"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Tasseled Cap Transformation as proposed for Landsat Thematic Mapper.\n"
+		"\n"
+		"References:\n"
+		"Kauth R. J. und G. S. Thomas (1976): "
+		"The Tasseled Cap - A Graphic Description of the Spectral-Temporal Development of Agricultural Crops as Seen by LANDSAT. "
+		"Proceedings of the Symposium on Machine Processing of Remotely Sensed Data. "
+		"<a target=\"_blank\" href=\"http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1160&context=lars_symp&sei-redir=1&referer=http%3A%2F%2Fwww.google.de%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3Dthe%2520tasseled%2520cap%2520--%2520a%2520graphic%2520description%2520of%2520the%2520spectral-temporal%2520development%2520of%2520agricultural%2520crops%26source%3Dweb%26cd%3D1%26ved%3D0CCEQFjAA%26url%3Dhttp%253A%252F%252Fdocs.lib.purdue.edu%252Fcgi%252Fviewcontent.cgi%253Farticle%253D1160%2526context%25 [...]
+		"\n"
+		"Huang, C., B. Wylie, L. Yang, C. Homer, and G. Zylstra. "
+		"Derivation of a Tasseled Cap Transformation Based on Landsat 7 At-Satellite Reflectance. "
+		"USGS EROS Data Center White Paper. "
+		"<a target=\"_blank\" href=\"http://landcover.usgs.gov/pdf/tasseled.pdf\">online at USGS</a>\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL, "BLUE"		, _TL("Blue (TM 1)"),
+		_TL(""), 
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "RED"			, _TL("Red (TM 2)"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "GREEN"		, _TL("Green (TM 3)"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "NIR"			, _TL("Near Infrared (TM 4)"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "MIR1"		, _TL("Mid Infrared (TM 5)"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "MIR2"		, _TL("Mid Infrared (TM 7)"), 
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "BRIGHTNESS"	, _TL("Brightness"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "GREENNESS"	, _TL("Greenness"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "WETNESS"		, _TL("Wetness"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTasseled_Cap::On_Execute(void)
+{
+	CSG_Grid	*pBand[6], *pBright, *pGreen, *pWet;
+
+	pBand[0]	= Parameters("BLUE"      )->asGrid();
+	pBand[1]	= Parameters("GREEN"     )->asGrid();
+	pBand[2]	= Parameters("RED"       )->asGrid();
+	pBand[3]	= Parameters("NIR"       )->asGrid();
+	pBand[4]	= Parameters("MIR1"      )->asGrid();
+	pBand[5]	= Parameters("MIR2"      )->asGrid();
+
+	pBright		= Parameters("BRIGHTNESS")->asGrid();
+	pGreen		= Parameters("GREENNESS" )->asGrid();
+	pWet		= Parameters("WETNESS"   )->asGrid();
+
+	DataObject_Set_Colors(pBright, 100, SG_COLORS_BLACK_WHITE  , false);
+	DataObject_Set_Colors(pGreen , 100, SG_COLORS_WHITE_GREEN  , false);
+	DataObject_Set_Colors(pWet   , 100, SG_COLORS_RED_GREY_BLUE, false);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if(	pBand[0]->is_NoData(x, y)
+			||	pBand[1]->is_NoData(x, y)
+			||	pBand[2]->is_NoData(x, y)
+			||	pBand[3]->is_NoData(x, y)
+			||	pBand[4]->is_NoData(x, y)
+			||	pBand[5]->is_NoData(x, y)
+			)
+			{
+				pBright	->Set_NoData(x, y);
+				pGreen	->Set_NoData(x, y);
+				pWet	->Set_NoData(x, y);
+			}
+			else
+			{
+				double	b[6];
+
+				b[0]	= pBand[0]->asDouble(x, y);
+				b[1]	= pBand[1]->asDouble(x, y);
+				b[2]	= pBand[2]->asDouble(x, y);
+				b[3]	= pBand[3]->asDouble(x, y);
+				b[4]	= pBand[4]->asDouble(x, y);
+				b[5]	= pBand[5]->asDouble(x, y);
+
+			    pBright	->Set_Value(x, y,
+					 0.3037 * b[0] + 0.2793 * b[1] + 0.4743 * b[2] + 0.5585 * b[3] + 0.5082 * b[4] + 0.1863 * b[5]
+				);
+
+				pGreen	->Set_Value(x, y,
+					-0.2848 * b[0] - 0.2435 * b[1] - 0.5436 * b[2] + 0.7243 * b[3] + 0.0840 * b[4] - 0.1800 * b[5]
+				);
+
+				pWet	->Set_Value(x, y,
+					 0.1509 * b[0] + 0.1973 * b[1] + 0.3279 * b[2] + 0.3406 * b[3] - 0.7112 * b[4] - 0.4572 * b[5]
+				);
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/tasseled_cap.h b/src/modules/imagery/imagery_tools/tasseled_cap.h
new file mode 100644
index 0000000..714f490
--- /dev/null
+++ b/src/modules/imagery/imagery_tools/tasseled_cap.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * Version $Id: tasseled_cap.h 1938 2014-01-12 13:44:06Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    imagery_tools                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    tasseled_cap.h                     //
+//                                                       //
+//                 Copyright (C) 2011 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__tasseled_cap_H
+#define HEADER_INCLUDED__tasseled_cap_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTasseled_Cap : public CSG_Module_Grid
+{
+public:
+	CTasseled_Cap(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__tasseled_cap_H
diff --git a/src/modules_images/modules_vigra/vigra/MLB_Interface.cpp b/src/modules/imagery/imagery_vigra/MLB_Interface.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/MLB_Interface.cpp
rename to src/modules/imagery/imagery_vigra/MLB_Interface.cpp
diff --git a/src/modules_images/modules_vigra/vigra/MLB_Interface.h b/src/modules/imagery/imagery_vigra/MLB_Interface.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/MLB_Interface.h
rename to src/modules/imagery/imagery_vigra/MLB_Interface.h
diff --git a/src/modules/imagery/imagery_vigra/Makefile.am b/src/modules/imagery/imagery_vigra/Makefile.am
new file mode 100644
index 0000000..a568df3
--- /dev/null
+++ b/src/modules/imagery/imagery_vigra/Makefile.am
@@ -0,0 +1,37 @@
+#
+# $Id: Makefile.am 1896 2013-12-10 14:56:59Z oconrad $
+#
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+UC_DEFS = -D_SAGA_UNICODE
+endif
+if HAVE_VIGRA
+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 -lvigraimpex -lfftw3
+pkglib_LTLIBRARIES = libimagery_vigra.la
+libimagery_vigra_la_SOURCES =\
+vigra.h\
+vigra_edges.h\
+vigra_smoothing.h\
+vigra_distance.h\
+vigra_fft.h\
+vigra_morphology.h\
+vigra_random_forest.h\
+vigra_watershed.h\
+MLB_Interface.cpp\
+vigra.cpp\
+MLB_Interface.h\
+vigra_distance.cpp\
+vigra_fft.cpp\
+vigra_smoothing.cpp\
+vigra_edges.cpp\
+vigra_morphology.cpp\
+vigra_random_forest.cpp\
+vigra_watershed.cpp
+
+libimagery_vigra_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+endif
diff --git a/src/modules/imagery/imagery_vigra/Makefile.in b/src/modules/imagery/imagery_vigra/Makefile.in
new file mode 100644
index 0000000..3f0d9b1
--- /dev/null
+++ b/src/modules/imagery/imagery_vigra/Makefile.in
@@ -0,0 +1,663 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/imagery/imagery_vigra
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+ at HAVE_VIGRA_TRUE@libimagery_vigra_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am__libimagery_vigra_la_SOURCES_DIST = vigra.h vigra_edges.h \
+	vigra_smoothing.h vigra_distance.h vigra_fft.h \
+	vigra_morphology.h vigra_random_forest.h vigra_watershed.h \
+	MLB_Interface.cpp vigra.cpp MLB_Interface.h vigra_distance.cpp \
+	vigra_fft.cpp vigra_smoothing.cpp vigra_edges.cpp \
+	vigra_morphology.cpp vigra_random_forest.cpp \
+	vigra_watershed.cpp
+ at HAVE_VIGRA_TRUE@am_libimagery_vigra_la_OBJECTS = MLB_Interface.lo \
+ at HAVE_VIGRA_TRUE@	vigra.lo vigra_distance.lo vigra_fft.lo \
+ at HAVE_VIGRA_TRUE@	vigra_smoothing.lo vigra_edges.lo \
+ at HAVE_VIGRA_TRUE@	vigra_morphology.lo vigra_random_forest.lo \
+ at HAVE_VIGRA_TRUE@	vigra_watershed.lo
+libimagery_vigra_la_OBJECTS = $(am_libimagery_vigra_la_OBJECTS)
+ at HAVE_VIGRA_TRUE@am_libimagery_vigra_la_rpath = -rpath $(pkglibdir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libimagery_vigra_la_SOURCES)
+DIST_SOURCES = $(am__libimagery_vigra_la_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1896 2013-12-10 14:56:59Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
+ at HAVE_VIGRA_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+ at HAVE_VIGRA_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core
+ at HAVE_VIGRA_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+ at HAVE_VIGRA_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version -lvigraimpex -lfftw3
+ at HAVE_VIGRA_TRUE@pkglib_LTLIBRARIES = libimagery_vigra.la
+ at HAVE_VIGRA_TRUE@libimagery_vigra_la_SOURCES = \
+ at HAVE_VIGRA_TRUE@vigra.h\
+ at HAVE_VIGRA_TRUE@vigra_edges.h\
+ at HAVE_VIGRA_TRUE@vigra_smoothing.h\
+ at HAVE_VIGRA_TRUE@vigra_distance.h\
+ at HAVE_VIGRA_TRUE@vigra_fft.h\
+ at HAVE_VIGRA_TRUE@vigra_morphology.h\
+ at HAVE_VIGRA_TRUE@vigra_random_forest.h\
+ at HAVE_VIGRA_TRUE@vigra_watershed.h\
+ at HAVE_VIGRA_TRUE@MLB_Interface.cpp\
+ at HAVE_VIGRA_TRUE@vigra.cpp\
+ at HAVE_VIGRA_TRUE@MLB_Interface.h\
+ at HAVE_VIGRA_TRUE@vigra_distance.cpp\
+ at HAVE_VIGRA_TRUE@vigra_fft.cpp\
+ at HAVE_VIGRA_TRUE@vigra_smoothing.cpp\
+ at HAVE_VIGRA_TRUE@vigra_edges.cpp\
+ at HAVE_VIGRA_TRUE@vigra_morphology.cpp\
+ at HAVE_VIGRA_TRUE@vigra_random_forest.cpp\
+ at HAVE_VIGRA_TRUE@vigra_watershed.cpp
+
+ at HAVE_VIGRA_TRUE@libimagery_vigra_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_vigra/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_vigra/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libimagery_vigra.la: $(libimagery_vigra_la_OBJECTS) $(libimagery_vigra_la_DEPENDENCIES) $(EXTRA_libimagery_vigra_la_DEPENDENCIES) 
+	$(CXXLINK) $(am_libimagery_vigra_la_rpath) $(libimagery_vigra_la_OBJECTS) $(libimagery_vigra_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_distance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_edges.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_fft.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_morphology.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_random_forest.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_smoothing.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_watershed.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_images/modules_vigra/vigra/vigra.cpp b/src/modules/imagery/imagery_vigra/vigra.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra.cpp
rename to src/modules/imagery/imagery_vigra/vigra.cpp
diff --git a/src/modules_images/modules_vigra/vigra/vigra.h b/src/modules/imagery/imagery_vigra/vigra.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra.h
rename to src/modules/imagery/imagery_vigra/vigra.h
diff --git a/src/modules_images/modules_vigra/vigra/vigra_distance.cpp b/src/modules/imagery/imagery_vigra/vigra_distance.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_distance.cpp
rename to src/modules/imagery/imagery_vigra/vigra_distance.cpp
diff --git a/src/modules_images/modules_vigra/vigra/vigra_distance.h b/src/modules/imagery/imagery_vigra/vigra_distance.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_distance.h
rename to src/modules/imagery/imagery_vigra/vigra_distance.h
diff --git a/src/modules_images/modules_vigra/vigra/vigra_edges.cpp b/src/modules/imagery/imagery_vigra/vigra_edges.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_edges.cpp
rename to src/modules/imagery/imagery_vigra/vigra_edges.cpp
diff --git a/src/modules_images/modules_vigra/vigra/vigra_edges.h b/src/modules/imagery/imagery_vigra/vigra_edges.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_edges.h
rename to src/modules/imagery/imagery_vigra/vigra_edges.h
diff --git a/src/modules_images/modules_vigra/vigra/vigra_fft.cpp b/src/modules/imagery/imagery_vigra/vigra_fft.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_fft.cpp
rename to src/modules/imagery/imagery_vigra/vigra_fft.cpp
diff --git a/src/modules_images/modules_vigra/vigra/vigra_fft.h b/src/modules/imagery/imagery_vigra/vigra_fft.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_fft.h
rename to src/modules/imagery/imagery_vigra/vigra_fft.h
diff --git a/src/modules/imagery/imagery_vigra/vigra_morphology.cpp b/src/modules/imagery/imagery_vigra/vigra_morphology.cpp
new file mode 100644
index 0000000..93063f9
--- /dev/null
+++ b/src/modules/imagery/imagery_vigra/vigra_morphology.cpp
@@ -0,0 +1,203 @@
+/**********************************************************
+ * Version $Id: vigra_morphology.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        VIGRA                          //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  vigra_morphology.cpp                 //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "vigra_morphology.h"
+
+//---------------------------------------------------------
+#include <vigra/flatmorphology.hxx>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CViGrA_Morphology::CViGrA_Morphology(void)
+{
+	Set_Name		(_TL("Morphological Filter (ViGrA)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2009"));
+
+	Set_Description	(_TW(
+		"References:\n"
+		"ViGrA - Vision with Generic Algorithms\n"
+		"<a target=\"_blank\" href=\"http://hci.iwr.uni-heidelberg.de/vigra\">http://hci.iwr.uni-heidelberg.de</a>"
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "INPUT"		, _TL("Input"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "OUTPUT"		, _TL("Output"),
+		_TL(""),
+		PARAMETER_OUTPUT, SG_DATATYPE_Byte
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TYPE"		, _TL("Operation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("Dilation"),
+			_TL("Erosion"),
+			_TL("Median"),
+			_TL("User defined rank")
+		)
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RADIUS"		, _TL("Radius (cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RANK"		, _TL("User defined rank"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RESCALE"		, _TL("Rescale Values (0-255)"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CViGrA_Morphology::On_Execute(void)
+{
+	bool		bRescale;
+	int			Type, Radius;
+	double		Rank;
+	CSG_Grid	*pInput, *pOutput, Rescaled;
+
+	pInput		= Parameters("INPUT")	->asGrid();
+	pOutput		= Parameters("OUTPUT")	->asGrid();
+	Type		= Parameters("TYPE")	->asInt();
+	Radius		= Parameters("RADIUS")	->asInt();
+	Rank		= Parameters("RANK")	->asDouble();
+	bRescale	= Parameters("RESCALE")	->asBool();
+
+	//-----------------------------------------------------
+	if( bRescale )
+	{
+		Rescaled.Create(*Get_System(), SG_DATATYPE_Byte);
+
+		for(sLong i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
+		{
+			Rescaled.Set_Value(i, 0.5 + (pInput->asDouble(i) - pInput->Get_ZMin()) * 255.0 / pInput->Get_ZRange());
+		}
+
+		pInput	= &Rescaled;
+	}
+
+	//-----------------------------------------------------
+	vigra::BImage	Input, Output(Get_NX(), Get_NY());
+
+	Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true);
+
+	switch( Type )
+	{
+	case 0:	// Dilation
+		discDilation		(srcImageRange(Input), destImage(Output), Radius);
+		break;
+
+	case 1:	// Erosion
+		discErosion			(srcImageRange(Input), destImage(Output), Radius);
+		break;
+
+	case 2:	// Median
+		discMedian			(srcImageRange(Input), destImage(Output), Radius);
+		break;
+
+	case 3:	// User defined rank
+		discRankOrderFilter	(srcImageRange(Input), destImage(Output), Radius, Rank);
+		break;
+	}
+
+	//-----------------------------------------------------
+	Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false);
+
+	pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str()));
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_images/modules_vigra/vigra/vigra_morphology.h b/src/modules/imagery/imagery_vigra/vigra_morphology.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_morphology.h
rename to src/modules/imagery/imagery_vigra/vigra_morphology.h
diff --git a/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp b/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp
new file mode 100644
index 0000000..908672f
--- /dev/null
+++ b/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp
@@ -0,0 +1,683 @@
+/**********************************************************
+ * Version $Id: vigra_random_forest.cpp 1282 2011-12-29 17:13:26Z manfred-e $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        VIGRA                          //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                vigra_random_forest.cpp                //
+//                                                       //
+//                 Copyright (C) 2013 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 "vigra_random_forest.h"
+
+#if !defined(WITH_RANDOMFOREST)
+int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter)	{	return( 0 );	}
+
+bool				On_Execute				(void)	{	return( false );	}
+
+CSG_Grid *			Get_Class_Grid			(void)	{	return( NULL );	}
+void				Set_Classification		(CSG_Table &Classes)	{}
+
+CSG_Parameter_Grid_List *	Get_Propability_Grids	(CSG_Table &Classes)	{	return( NULL );	}
+
+bool				Get_Training			(CSG_Matrix &Data, CSG_Table &Classes)	{	return( false );	}
+int				Get_Training			(CSG_Matrix &Data, int ID, CSG_Shape_Polygon *pArea)	{	return( 0 );	}
+
+#else
+//---------------------------------------------------------
+#include <vigra/random_forest.hxx>
+
+#define WITH_HDF5
+
+#if defined(WITH_HDF5)
+#include <vigra/random_forest_hdf5_impex.hxx>
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	CLASS_ID	= 0,
+	CLASS_NAME,
+	CLASS_COUNT
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CViGrA_Random_Forest::CViGrA_Random_Forest(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Random Forest (ViGrA)"));
+
+	Set_Author		("O.Conrad (c) 2013");
+
+	Set_Description	(_TW(
+		"References:\n"
+		"ViGrA - Vision with Generic Algorithms\n"
+		"<a target=\"_blank\" href=\"http://hci.iwr.uni-heidelberg.de/vigra\">http://hci.iwr.uni-heidelberg.de</a>"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "FEATURES"			, _TL("Features"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CLASSES"				, _TL("Random Forest Classification"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "PROBABILITY"			, _TL("Prediction Probability"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL	, "BPROBABILITIES"		, _TL("Feature Probabilities"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "PROBABILITIES"		, _TL("Feature Probabilities"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	//-----------------------------------------------------
+#if defined(WITH_HDF5)
+	Parameters.Add_FilePath(
+		NULL	, "RF_IMPORT"			, _TL("Import from File"),
+		_TL(""),
+		NULL, NULL, false
+	);
+#endif
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "TRAINING"			, _TL("Training Areas"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD"				, _TL("Label Field"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "LABEL_AS_ID"			, _TL("Use Label as Identifier"),
+		_TL("Use training area labels as identifier in classification result, assumes all label values are integer numbers!"),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "RF_OPTIONS"			, _TL("Options"),
+		_TL("")
+	);
+
+#if defined(WITH_HDF5)
+	Parameters.Add_FilePath(
+		pNode	, "RF_EXPORT"			, _TL("Export to File"),
+		_TL(""),
+		NULL, NULL, true
+	);
+#endif
+
+	Parameters.Add_Value(
+		pNode	, "RF_TREE_COUNT"		, _TL("Tree Count"),
+		_TL("How many trees to create?"),
+		PARAMETER_TYPE_Int, 32, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "RF_TREE_SAMPLES"		, _TL("Samples per Tree"),
+		_TL("Specifies the fraction of the total number of samples used per tree for learning."),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "RF_REPLACE"			, _TL("Sample with Replacement"),
+		_TL("Sample from training population with or without replacement?"),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "RF_SPLIT_MIN_SIZE"	, _TL("Minimum Node Split Size"),
+		_TL("Number of examples required for a node to be split. Choose 1 for complete growing."),
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "RF_NODE_FEATURES"	, _TL("Features per Node"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("logarithmic"),
+			_TL("square root"),
+			_TL("all")
+		), 1
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "RF_STRATIFICATION"	, _TL("Stratification"),
+		_TL("Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("none"),
+			_TL("equal"),
+			_TL("proportional")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CViGrA_Random_Forest::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "RF_IMPORT") )
+	{
+		bool	bTraining	= !SG_File_Exists(pParameter->asString());
+
+		pParameters->Get_Parameter("RF_OPTIONS")->Set_Enabled(bTraining);
+		pParameters->Get_Parameter("TRAINING"  )->Set_Enabled(bTraining);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CViGrA_Random_Forest::On_Execute(void)
+{
+	//-----------------------------------------------------
+	// Feature Grids
+
+	m_pFeatures	= Parameters("FEATURES")->asGridList();
+
+	for(int i=m_pFeatures->Get_Count()-1; i>=0; i--)
+	{
+		if( m_pFeatures->asGrid(i)->Get_ZRange() <= 0.0 )
+		{
+			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("grid has been dropped"), m_pFeatures->asGrid(i)->Get_Name()));
+
+			m_pFeatures->Del_Item(i);
+		}
+	}
+
+	if( m_pFeatures->Get_Count() <= 0 )
+	{
+		Error_Set(_TL("no valid grid in features list."));
+
+		return( false );
+	}
+
+
+	//-----------------------------------------------------
+	CSG_Table	Classes;
+
+	vigra::RandomForestOptions	Options;
+	vigra::RandomForest<int>	Forest(Options);
+
+
+#if defined(WITH_HDF5)
+	if( SG_File_Exists(Parameters("RF_IMPORT")->asString()) )
+	{
+		if( !vigra::rf_import_HDF5(Forest, CSG_String(Parameters("RF_IMPORT")->asString()).b_str()) )
+		{
+			Error_Set(_TL("could not import random forest"));
+
+			return( false );
+		}
+
+		if( Forest.feature_count() != m_pFeatures->Get_Count() )
+		{
+			Error_Set(CSG_String::Format(SG_T("%s\n%s: %d"), _TL("invalid number of features"), _TL("expected"), Forest.feature_count()));
+
+			return( false );
+		}
+	}
+	else
+#endif
+	{
+		//-------------------------------------------------
+		// Training Data
+
+		CSG_Matrix	Data;
+
+		if( !Get_Training(Data, Classes) )
+		{
+			Error_Set(_TL("insufficient training samples"));
+
+			return( false );
+		}
+
+		vigra::Matrix<double>	train_features(Data.Get_NRows(), m_pFeatures->Get_Count());
+		vigra::Matrix<int>		train_response(Data.Get_NRows(), 1);
+
+		for(int iSample=0; iSample<Data.Get_NRows(); iSample++)
+		{
+			train_response(iSample, 0)	= (int)Data[iSample][m_pFeatures->Get_Count()];
+
+			for(int iFeature=0; iFeature<m_pFeatures->Get_Count(); iFeature++)
+			{
+				train_features(iSample, iFeature)	= Data[iSample][iFeature];
+			}
+		}
+
+		Data.Destroy();
+
+
+		//-------------------------------------------------
+		// Random Forest Options
+
+		Forest.set_options().tree_count             (Parameters("RF_TREE_COUNT"    )->asInt   ());
+		Forest.set_options().samples_per_tree       (Parameters("RF_TREE_SAMPLES"  )->asDouble());
+		Forest.set_options().sample_with_replacement(Parameters("RF_REPLACE"       )->asBool  ());
+		Forest.set_options().min_split_node_size    (Parameters("RF_SPLIT_MIN_SIZE")->asInt   ());
+
+		switch( Parameters("RF_NODE_FEATURES")->asInt() )
+		{
+		case  0:	Forest.set_options().features_per_node(vigra::RF_LOG );	break;
+		default:	Forest.set_options().features_per_node(vigra::RF_SQRT);	break;
+		case  1:	Forest.set_options().features_per_node(vigra::RF_ALL );	break;
+		}
+
+		switch( Parameters("RF_STRATIFICATION")->asInt() )
+		{
+		default:	Forest.set_options().use_stratification(vigra::RF_NONE        );	break;
+		case  1:	Forest.set_options().use_stratification(vigra::RF_EQUAL       );	break;
+		case  2:	Forest.set_options().use_stratification(vigra::RF_PROPORTIONAL);	break;
+		}
+
+
+		//-------------------------------------------------
+		// Learning
+
+		Process_Set_Text(_TL("learning"));
+
+		vigra::rf::visitors::OOB_Error	oob_v;	// construct visitor to calculate out-of-bag error
+
+		Forest.learn(train_features, train_response, vigra::rf::visitors::create_visitor(oob_v));
+
+		Message_Add(CSG_String::Format(SG_T("\n%s: %f"), _TL("out-of-bag error"), oob_v.oob_breiman), false);
+
+#if defined(WITH_HDF5)
+		if( Parameters("RF_EXPORT")->asString() && *Parameters("RF_EXPORT")->asString() )
+		{
+			vigra::rf_export_HDF5(Forest, CSG_String(Parameters("RF_EXPORT")->asString()).b_str());
+		}
+#endif
+	}
+
+	//-----------------------------------------------------
+	// Output Grids
+
+	CSG_Grid	*pClasses		= Get_Class_Grid();
+
+	CSG_Grid	*pProbability	= Parameters("PROBABILITY")->asGrid();
+
+	CSG_Parameter_Grid_List	*pProbabilities	= Get_Propability_Grids(Classes);
+
+	DataObject_Set_Colors(pProbability, 11, SG_COLORS_WHITE_GREEN);
+
+
+	//-----------------------------------------------------
+	// Prediction
+
+	Process_Set_Text(_TL("prediction"));
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !pClasses->is_NoData(x, y) )
+			{
+				vigra::Matrix<double>	features(1, m_pFeatures->Get_Count());
+
+				for(int iFeature=0; iFeature<m_pFeatures->Get_Count(); iFeature++)
+				{
+					features(0, iFeature)	= m_pFeatures->asGrid(iFeature)->asDouble(x, y);
+				}
+
+				int		id	= Forest.predictLabel(features);
+
+				pClasses->Set_Value(x, y, id);
+
+				if( pProbability || pProbabilities )
+				{
+					vigra::Matrix<double>	p(1, Forest.class_count());
+
+					Forest.predictProbabilities(features, p);
+
+					if( pProbability )
+					{
+						pProbability->Set_Value(x, y, p(0, id - 1));
+					}
+
+					for(int i=0; pProbabilities && i<pProbabilities->Get_Count(); i++)
+					{
+						pProbabilities->asGrid(i)->Set_Value(x, y, p(0, i));
+					}
+				}
+			}
+			else // if( pClasses->is_NoData(x, y) )
+			{
+				if( pProbability )
+				{
+					pProbability->Set_NoData(x, y);
+				}
+
+				for(int i=0; pProbabilities && i<pProbabilities->Get_Count(); i++)
+				{
+					pProbabilities->asGrid(i)->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+	// Postprocessing
+
+	Set_Classification(Classes);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CViGrA_Random_Forest::Get_Training(CSG_Matrix &Data, CSG_Table &Classes)
+{
+	CSG_Shapes	*pTraining	= Parameters("TRAINING")->asShapes();
+
+	bool	bLabelAsId	= Parameters("LABEL_AS_ID")->asBool();
+
+	int		Field	= Parameters("FIELD")->asInt();
+
+	Classes.Destroy();
+	Classes.Add_Field(SG_T("ID")   , SG_DATATYPE_Int);		// CLASS_ID
+	Classes.Add_Field(SG_T("NAME" ), SG_DATATYPE_String);	// CLASS_NAME
+	Classes.Add_Field(SG_T("COUNT"), SG_DATATYPE_Int);		// CLASS_COUNT
+
+	CSG_String	Label;
+
+	CSG_Table_Record	*pClass	= NULL;
+
+	pTraining->Set_Index(Field, TABLE_INDEX_Ascending);
+
+	for(int iTraining=0, ID=0; iTraining<pTraining->Get_Count(); iTraining++)
+	{
+		CSG_Shape	*pArea	= pTraining->Get_Shape(iTraining);
+
+		if( !pClass || (bLabelAsId && ID != pArea->asInt(Field)) || Label.Cmp(pArea->asString(Field)) )
+		{
+			Label	= pArea->asString(Field);
+
+			if( !pClass || pClass->asInt(CLASS_COUNT) > 0 )
+			{
+				pClass	= Classes.Add_Record();
+
+				ID	= bLabelAsId ? pArea->asInt(Field) : ID + 1;
+			}
+
+			pClass->Set_Value(CLASS_ID   , ID);
+			pClass->Set_Value(CLASS_NAME , Label);
+			pClass->Set_Value(CLASS_COUNT, 0);
+		}
+
+		pClass->Add_Value(CLASS_COUNT, Get_Training(Data, ID, (CSG_Shape_Polygon *)pArea));
+	}
+
+	return( Data.Get_NRows() > 1 );
+}
+
+//---------------------------------------------------------
+int CViGrA_Random_Forest::Get_Training(CSG_Matrix &Data, int ID, CSG_Shape_Polygon *pArea)
+{
+	int	Count	= 0;
+
+	int	xMin	= Get_System()->Get_xWorld_to_Grid(pArea->Get_Extent().Get_XMin());	if( xMin <  0        ) xMin = 0;
+	int	xMax	= Get_System()->Get_xWorld_to_Grid(pArea->Get_Extent().Get_XMax());	if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
+	int	yMin	= Get_System()->Get_yWorld_to_Grid(pArea->Get_Extent().Get_YMin());	if( yMin <  0        ) yMin = 0;
+	int	yMax	= Get_System()->Get_yWorld_to_Grid(pArea->Get_Extent().Get_YMax());	if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
+
+	for(int y=yMin; y<=yMax; y++)
+	{
+		for(int x=xMin; x<=xMax; x++)
+		{
+			if( pArea->Contains(Get_System()->Get_Grid_to_World(x, y)) )
+			{
+				int	iRow	= Data.Get_NRows();
+
+				if( iRow == 0 )
+				{
+					Data.Create(1 + m_pFeatures->Get_Count(), 1);
+				}
+				else
+				{
+					Data.Add_Row();
+				}
+
+				Data[iRow][m_pFeatures->Get_Count()]	= ID;
+
+				for(int i=0; i<m_pFeatures->Get_Count(); i++)
+				{
+					Data[iRow][i]	= m_pFeatures->asGrid(i)->asDouble(x, y);
+				}
+
+				Count++;
+			}
+		}
+	}
+
+	return( Count );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Grid * CViGrA_Random_Forest::Get_Class_Grid(void)
+{
+	CSG_Grid	*pClasses	= Parameters("CLASSES")->asGrid();
+
+	pClasses->Set_NoData_Value(-1.0);
+
+	#pragma omp parallel for
+	for(sLong i=0; i<Get_NCells(); i++)
+	{
+		bool	bOkay	= true;
+
+		for(int iFeature=0; bOkay && iFeature<m_pFeatures->Get_Count(); iFeature++)
+		{
+			bOkay	= !m_pFeatures->asGrid(iFeature)->is_NoData(i);
+		}
+
+		pClasses->Set_Value(i, bOkay ? 0.0 : -1.0);
+	}
+
+	return( pClasses );
+}
+
+//---------------------------------------------------------
+void CViGrA_Random_Forest::Set_Classification(CSG_Table &Classes)
+{
+	if( Classes.Get_Field_Count() == 3 && Classes.Get_Count() > 0 )
+	{
+		CSG_Grid	*pClasses	= Parameters("CLASSES")->asGrid();
+
+		CSG_Parameters	P;
+
+		if( DataObject_Get_Parameters(pClasses, P) && P("COLORS_TYPE") && P("LUT") )
+		{
+			CSG_Table	*pTable	= P("LUT")->asTable();
+
+			for(int i=0; i<Classes.Get_Count(); i++)
+			{
+				CSG_Table_Record	*pRecord	= pTable->Get_Record(i);
+
+				if( pRecord == NULL )
+				{
+					pRecord	= pTable->Add_Record();
+					pRecord->Set_Value(0, CSG_Random::Get_Uniform(0, 255*255*255));
+				}
+
+				pRecord->Set_Value(1, Classes[i].asString(1));
+				pRecord->Set_Value(2, Classes[i].asString(1));
+				pRecord->Set_Value(3, Classes[i].asInt(0));
+				pRecord->Set_Value(4, Classes[i].asInt(0));
+			}
+
+			while( pTable->Get_Record_Count() > Classes.Get_Count() )
+			{
+				pTable->Del_Record(pTable->Get_Record_Count() - 1);
+			}
+
+			P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+			DataObject_Set_Parameters(pClasses, P);
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Parameter_Grid_List * CViGrA_Random_Forest::Get_Propability_Grids(CSG_Table &Classes)
+{
+	if( Parameters("BPROBABILITIES")->asBool() && Classes.Get_Field_Count() == 3 && Classes.Get_Count() > 0 )
+	{
+		CSG_Parameter_Grid_List	*pGrids	= Parameters("PROBABILITIES")->asGridList();
+
+		for(int i=0; i<Classes.Get_Count(); i++)
+		{
+			CSG_Grid	*pGrid;
+			
+			if( i < pGrids->Get_Count() )
+			{
+				pGrid	= pGrids->asGrid(i);
+			}
+			else
+			{
+				pGrids->Add_Item(pGrid = SG_Get_Data_Manager().Add_Grid(*Get_System()));
+
+				DataObject_Set_Colors(pGrid, 11, SG_COLORS_WHITE_GREEN);
+			}
+
+			pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Classes[i].asString(CLASS_NAME), _TL("Probability")));
+		}
+
+		return( pGrids );
+	}
+
+	return( NULL );
+}
+
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_vigra/vigra_random_forest.h b/src/modules/imagery/imagery_vigra/vigra_random_forest.h
new file mode 100644
index 0000000..85daef9
--- /dev/null
+++ b/src/modules/imagery/imagery_vigra/vigra_random_forest.h
@@ -0,0 +1,121 @@
+/**********************************************************
+ * Version $Id: vigra_random_forest.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        VIGRA                          //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 vigra_random_forest.h                 //
+//                                                       //
+//                 Copyright (C) 2013 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__vigra_random_forest_H
+#define HEADER_INCLUDED__vigra_random_forest_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "vigra.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CViGrA_Random_Forest : public CSG_Module_Grid
+{
+public:
+	CViGrA_Random_Forest(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Imagery|Classification") );	}
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+
+private:
+
+	CSG_Parameter_Grid_List		*m_pFeatures;
+
+
+	CSG_Grid *					Get_Class_Grid			(void);
+	void						Set_Classification		(CSG_Table &Classes);
+
+	CSG_Parameter_Grid_List *	Get_Propability_Grids	(CSG_Table &Classes);
+
+	bool						Get_Training			(CSG_Matrix &Data, CSG_Table &Classes);
+	int							Get_Training			(CSG_Matrix &Data, int ID, CSG_Shape_Polygon *pArea);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__vigra_random_forest_H
diff --git a/src/modules_images/modules_vigra/vigra/vigra_smoothing.cpp b/src/modules/imagery/imagery_vigra/vigra_smoothing.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_smoothing.cpp
rename to src/modules/imagery/imagery_vigra/vigra_smoothing.cpp
diff --git a/src/modules_images/modules_vigra/vigra/vigra_smoothing.h b/src/modules/imagery/imagery_vigra/vigra_smoothing.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_smoothing.h
rename to src/modules/imagery/imagery_vigra/vigra_smoothing.h
diff --git a/src/modules_images/modules_vigra/vigra/vigra_watershed.cpp b/src/modules/imagery/imagery_vigra/vigra_watershed.cpp
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_watershed.cpp
rename to src/modules/imagery/imagery_vigra/vigra_watershed.cpp
diff --git a/src/modules_images/modules_vigra/vigra/vigra_watershed.h b/src/modules/imagery/imagery_vigra/vigra_watershed.h
similarity index 100%
rename from src/modules_images/modules_vigra/vigra/vigra_watershed.h
rename to src/modules/imagery/imagery_vigra/vigra_watershed.h
diff --git a/src/modules/io/Makefile.am b/src/modules/io/Makefile.am
new file mode 100644
index 0000000..f348fd5
--- /dev/null
+++ b/src/modules/io/Makefile.am
@@ -0,0 +1,5 @@
+if WITH_GUI
+SUBDIRS = io_esri_e00 io_gdal io_gps io_grid io_grid_grib2 io_grid_image io_shapes io_shapes_dxf io_shapes_las io_table io_virtual
+else
+SUBDIRS = io_esri_e00 io_gdal io_gps io_grid io_grid_grib2 io_shapes io_shapes_dxf io_shapes_las io_table io_virtual
+endif
diff --git a/src/modules/io/Makefile.in b/src/modules/io/Makefile.in
new file mode 100644
index 0000000..db94a37
--- /dev/null
+++ b/src/modules/io/Makefile.in
@@ -0,0 +1,637 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = io_esri_e00 io_gdal io_gps io_grid io_grid_grib2 \
+	io_shapes io_shapes_dxf io_shapes_las io_table io_virtual \
+	io_grid_image
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at WITH_GUI_FALSE@SUBDIRS = io_esri_e00 io_gdal io_gps io_grid io_grid_grib2 io_shapes io_shapes_dxf io_shapes_las io_table io_virtual
+ at WITH_GUI_TRUE@SUBDIRS = io_esri_e00 io_gdal io_gps io_grid io_grid_grib2 io_grid_image io_shapes io_shapes_dxf io_shapes_las io_table io_virtual
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp b/src/modules/io/io_esri_e00/ESRI_E00_Import.cpp
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp
rename to src/modules/io/io_esri_e00/ESRI_E00_Import.cpp
diff --git a/src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.h b/src/modules/io/io_esri_e00/ESRI_E00_Import.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.h
rename to src/modules/io/io_esri_e00/ESRI_E00_Import.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/MLB_Interface.cpp b/src/modules/io/io_esri_e00/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/MLB_Interface.cpp
rename to src/modules/io/io_esri_e00/MLB_Interface.cpp
diff --git a/src/modules_io/esri_e00/io_esri_e00/MLB_Interface.h b/src/modules/io/io_esri_e00/MLB_Interface.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/MLB_Interface.h
rename to src/modules/io/io_esri_e00/MLB_Interface.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/Makefile.am b/src/modules/io/io_esri_e00/Makefile.am
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/Makefile.am
rename to src/modules/io/io_esri_e00/Makefile.am
diff --git a/src/modules/io/io_esri_e00/Makefile.in b/src/modules/io/io_esri_e00/Makefile.in
new file mode 100644
index 0000000..36a2305
--- /dev/null
+++ b/src/modules/io/io_esri_e00/Makefile.in
@@ -0,0 +1,704 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_esri_e00
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_esri_e00_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_esri_e00_la_OBJECTS = ESRI_E00_Import.lo MLB_Interface.lo \
+	cpl_conv.lo cpl_error.lo cpl_vsisimple.lo e00read.lo \
+	e00write.lo
+libio_esri_e00_la_OBJECTS = $(am_libio_esri_e00_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_esri_e00_la_SOURCES)
+DIST_SOURCES = $(libio_esri_e00_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libio_esri_e00.la
+libio_esri_e00_la_SOURCES = \
+ESRI_E00_Import.cpp\
+MLB_Interface.cpp\
+e00compr/cpl_conv.c\
+e00compr/cpl_error.c\
+e00compr/cpl_vsisimple.c\
+e00compr/e00read.c\
+e00compr/e00write.c\
+ESRI_E00_Import.h\
+MLB_Interface.h\
+e00compr/cpl_conv.h\
+e00compr/cpl_error.h\
+e00compr/cpl_port.h\
+e00compr/cpl_vsi.h\
+e00compr/e00compr.h
+
+libio_esri_e00_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_esri_e00/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_esri_e00/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_esri_e00.la: $(libio_esri_e00_la_OBJECTS) $(libio_esri_e00_la_DEPENDENCIES) $(EXTRA_libio_esri_e00_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_esri_e00_la_OBJECTS) $(libio_esri_e00_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ESRI_E00_Import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cpl_conv.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cpl_error.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cpl_vsisimple.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/e00read.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/e00write.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+cpl_conv.lo: e00compr/cpl_conv.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_conv.lo -MD -MP -MF $(DEPDIR)/cpl_conv.Tpo -c -o cpl_conv.lo `test -f 'e00compr/cpl_conv.c' || echo '$(srcdir)/'`e00compr/cpl_conv.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cpl_conv.Tpo $(DEPDIR)/cpl_conv.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/cpl_conv.c' object='cpl_conv.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_conv.lo `test -f 'e00compr/cpl_conv.c' || echo '$(srcdir)/'`e00compr/cpl_conv.c
+
+cpl_error.lo: e00compr/cpl_error.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_error.lo -MD -MP -MF $(DEPDIR)/cpl_error.Tpo -c -o cpl_error.lo `test -f 'e00compr/cpl_error.c' || echo '$(srcdir)/'`e00compr/cpl_error.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cpl_error.Tpo $(DEPDIR)/cpl_error.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/cpl_error.c' object='cpl_error.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_error.lo `test -f 'e00compr/cpl_error.c' || echo '$(srcdir)/'`e00compr/cpl_error.c
+
+cpl_vsisimple.lo: e00compr/cpl_vsisimple.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_vsisimple.lo -MD -MP -MF $(DEPDIR)/cpl_vsisimple.Tpo -c -o cpl_vsisimple.lo `test -f 'e00compr/cpl_vsisimple.c' || echo '$(srcdir)/'`e00compr/cpl_vsisimple.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cpl_vsisimple.Tpo $(DEPDIR)/cpl_vsisimple.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/cpl_vsisimple.c' object='cpl_vsisimple.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_vsisimple.lo `test -f 'e00compr/cpl_vsisimple.c' || echo '$(srcdir)/'`e00compr/cpl_vsisimple.c
+
+e00read.lo: e00compr/e00read.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT e00read.lo -MD -MP -MF $(DEPDIR)/e00read.Tpo -c -o e00read.lo `test -f 'e00compr/e00read.c' || echo '$(srcdir)/'`e00compr/e00read.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/e00read.Tpo $(DEPDIR)/e00read.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/e00read.c' object='e00read.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o e00read.lo `test -f 'e00compr/e00read.c' || echo '$(srcdir)/'`e00compr/e00read.c
+
+e00write.lo: e00compr/e00write.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT e00write.lo -MD -MP -MF $(DEPDIR)/e00write.Tpo -c -o e00write.lo `test -f 'e00compr/e00write.c' || echo '$(srcdir)/'`e00compr/e00write.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/e00write.Tpo $(DEPDIR)/e00write.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/e00write.c' object='e00write.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o e00write.lo `test -f 'e00compr/e00write.c' || echo '$(srcdir)/'`e00compr/e00write.c
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.c b/src/modules/io/io_esri_e00/e00compr/cpl_conv.c
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.c
rename to src/modules/io/io_esri_e00/e00compr/cpl_conv.c
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.h b/src/modules/io/io_esri_e00/e00compr/cpl_conv.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.h
rename to src/modules/io/io_esri_e00/e00compr/cpl_conv.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.c b/src/modules/io/io_esri_e00/e00compr/cpl_error.c
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.c
rename to src/modules/io/io_esri_e00/e00compr/cpl_error.c
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.h b/src/modules/io/io_esri_e00/e00compr/cpl_error.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.h
rename to src/modules/io/io_esri_e00/e00compr/cpl_error.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_port.h b/src/modules/io/io_esri_e00/e00compr/cpl_port.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_port.h
rename to src/modules/io/io_esri_e00/e00compr/cpl_port.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsi.h b/src/modules/io/io_esri_e00/e00compr/cpl_vsi.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsi.h
rename to src/modules/io/io_esri_e00/e00compr/cpl_vsi.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsisimple.c b/src/modules/io/io_esri_e00/e00compr/cpl_vsisimple.c
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsisimple.c
rename to src/modules/io/io_esri_e00/e00compr/cpl_vsisimple.c
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/e00compr.h b/src/modules/io/io_esri_e00/e00compr/e00compr.h
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/e00compr.h
rename to src/modules/io/io_esri_e00/e00compr/e00compr.h
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/e00read.c b/src/modules/io/io_esri_e00/e00compr/e00read.c
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/e00read.c
rename to src/modules/io/io_esri_e00/e00compr/e00read.c
diff --git a/src/modules_io/esri_e00/io_esri_e00/e00compr/e00write.c b/src/modules/io/io_esri_e00/e00compr/e00write.c
similarity index 100%
rename from src/modules_io/esri_e00/io_esri_e00/e00compr/e00write.c
rename to src/modules/io/io_esri_e00/e00compr/e00write.c
diff --git a/src/modules_io/gdal/io_gdal/MLB_Interface.cpp b/src/modules/io/io_gdal/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/MLB_Interface.cpp
rename to src/modules/io/io_gdal/MLB_Interface.cpp
diff --git a/src/modules_io/gdal/io_gdal/MLB_Interface.h b/src/modules/io/io_gdal/MLB_Interface.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/MLB_Interface.h
rename to src/modules/io/io_gdal/MLB_Interface.h
diff --git a/src/modules_io/gdal/io_gdal/Makefile.am b/src/modules/io/io_gdal/Makefile.am
similarity index 100%
rename from src/modules_io/gdal/io_gdal/Makefile.am
rename to src/modules/io/io_gdal/Makefile.am
diff --git a/src/modules/io/io_gdal/Makefile.in b/src/modules/io/io_gdal/Makefile.in
new file mode 100644
index 0000000..6d03f9e
--- /dev/null
+++ b/src/modules/io/io_gdal/Makefile.in
@@ -0,0 +1,659 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_gdal
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_gdal_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_gdal_la_OBJECTS = gdal_driver.lo gdal_export.lo \
+	gdal_export_geotiff.lo gdal_import.lo gdal_import_netcdf.lo \
+	MLB_Interface.lo ogr_driver.lo ogr_export.lo ogr_export_kml.lo \
+	ogr_import.lo
+libio_gdal_la_OBJECTS = $(am_libio_gdal_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_gdal_la_SOURCES)
+DIST_SOURCES = $(libio_gdal_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1465 2012-08-23 09:20:00Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
+DEP_LIBS = `gdal-config --libs`
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core `gdal-config --cflags`
+AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS)
+pkglib_LTLIBRARIES = libio_gdal.la
+libio_gdal_la_SOURCES = \
+gdal_driver.cpp\
+gdal_export.cpp\
+gdal_export_geotiff.cpp\
+gdal_import.cpp\
+gdal_import_netcdf.cpp\
+MLB_Interface.cpp\
+ogr_driver.cpp\
+ogr_export.cpp\
+ogr_export_kml.cpp\
+ogr_import.cpp\
+gdal_driver.h\
+gdal_export.h\
+gdal_export_geotiff.h\
+gdal_import.h\
+gdal_import_netcdf.h\
+MLB_Interface.h\
+ogr_driver.h\
+ogr_export.h\
+ogr_export_kml.h\
+ogr_import.h
+
+libio_gdal_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_gdal/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_gdal/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_gdal.la: $(libio_gdal_la_OBJECTS) $(libio_gdal_la_DEPENDENCIES) $(EXTRA_libio_gdal_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_gdal_la_OBJECTS) $(libio_gdal_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_driver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_export.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_export_geotiff.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_import_netcdf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_driver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_export.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_export_kml.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_import.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/gdal/io_gdal/gdal_driver.cpp b/src/modules/io/io_gdal/gdal_driver.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_driver.cpp
rename to src/modules/io/io_gdal/gdal_driver.cpp
diff --git a/src/modules_io/gdal/io_gdal/gdal_driver.h b/src/modules/io/io_gdal/gdal_driver.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_driver.h
rename to src/modules/io/io_gdal/gdal_driver.h
diff --git a/src/modules_io/gdal/io_gdal/gdal_export.cpp b/src/modules/io/io_gdal/gdal_export.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_export.cpp
rename to src/modules/io/io_gdal/gdal_export.cpp
diff --git a/src/modules_io/gdal/io_gdal/gdal_export.h b/src/modules/io/io_gdal/gdal_export.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_export.h
rename to src/modules/io/io_gdal/gdal_export.h
diff --git a/src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp b/src/modules/io/io_gdal/gdal_export_geotiff.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp
rename to src/modules/io/io_gdal/gdal_export_geotiff.cpp
diff --git a/src/modules_io/gdal/io_gdal/gdal_export_geotiff.h b/src/modules/io/io_gdal/gdal_export_geotiff.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_export_geotiff.h
rename to src/modules/io/io_gdal/gdal_export_geotiff.h
diff --git a/src/modules_io/gdal/io_gdal/gdal_import.cpp b/src/modules/io/io_gdal/gdal_import.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_import.cpp
rename to src/modules/io/io_gdal/gdal_import.cpp
diff --git a/src/modules_io/gdal/io_gdal/gdal_import.h b/src/modules/io/io_gdal/gdal_import.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_import.h
rename to src/modules/io/io_gdal/gdal_import.h
diff --git a/src/modules_io/gdal/io_gdal/gdal_import_netcdf.cpp b/src/modules/io/io_gdal/gdal_import_netcdf.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_import_netcdf.cpp
rename to src/modules/io/io_gdal/gdal_import_netcdf.cpp
diff --git a/src/modules_io/gdal/io_gdal/gdal_import_netcdf.h b/src/modules/io/io_gdal/gdal_import_netcdf.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/gdal_import_netcdf.h
rename to src/modules/io/io_gdal/gdal_import_netcdf.h
diff --git a/src/modules/io/io_gdal/ogr_driver.cpp b/src/modules/io/io_gdal/ogr_driver.cpp
new file mode 100644
index 0000000..bd749d7
--- /dev/null
+++ b/src/modules/io/io_gdal/ogr_driver.cpp
@@ -0,0 +1,863 @@
+/**********************************************************
+ * Version $Id: ogr_driver.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library                     //
+//                                                       //
+//                       io_gdal                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    ogr_driver.cpp                     //
+//                                                       //
+//            Copyright (C) 2008 by O. 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Bundesstr. 55                          //
+//                D-20146 Hamburg                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "ogr_driver.h"
+
+#include <gdal_priv.h>
+#include <ogrsf_frmts.h>
+#include <ogr_core.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_OGR_Drivers		gSG_OGR_Drivers;
+
+const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void)
+{
+	return( gSG_OGR_Drivers );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_OGR_Drivers::CSG_OGR_Drivers(void)
+{
+	OGRRegisterAll();
+
+	m_pDrivers	= OGRSFDriverRegistrar::GetRegistrar();
+}
+
+//---------------------------------------------------------
+CSG_OGR_Drivers::~CSG_OGR_Drivers(void)
+{
+//	OGRCleanupAll();	
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_OGR_Drivers::Get_Count(void) const
+{
+	return( m_pDrivers->GetDriverCount() );
+}
+
+//---------------------------------------------------------
+OGRSFDriver * CSG_OGR_Drivers::Get_Driver(int Index) const
+{
+	return( m_pDrivers->GetDriver(Index) );
+}
+
+//---------------------------------------------------------
+OGRSFDriver * CSG_OGR_Drivers::Get_Driver(const CSG_String &Name) const
+{
+	return( m_pDrivers ? m_pDrivers->GetDriverByName(Name) : NULL );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_OGR_Drivers::Get_Name(int Index) const
+{
+	return( m_pDrivers->GetDriver(Index)->GetName() );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_OGR_Drivers::Get_Description(int Index) const
+{
+	OGRSFDriver	*pDriver	= m_pDrivers->GetDriver(Index);
+	CSG_String	s;
+
+	s	+= pDriver->TestCapability(ODrCCreateDataSource)	? SG_T("\n[x] ") : SG_T("\n[ ] ");
+	s	+= _TL("create data source");
+
+	s	+= pDriver->TestCapability(ODrCDeleteDataSource)	? SG_T("\n[x] ") : SG_T("\n[ ] ");
+	s	+= _TL("delete data source");
+
+/*	s	+= pDriver->TestCapability(ODsCCreateLayer)			? SG_T("\n[x]") : SG_T("\n[ ]");
+	s	+= _TL("create layer");
+
+	s	+= pDriver->TestCapability(ODsCDeleteLayer)			? SG_T("\n[x]") : SG_T("\n[ ]");
+	s	+= _TL("delete layer");
+
+	s	+= pDriver->TestCapability(OLCDeleteFeature)		? SG_T("\n[x]") : SG_T("\n[ ]");
+	s	+= _TL("delete feature");
+
+	s	+= pDriver->TestCapability(OLCRandomRead)			? SG_T("\n[x]") : SG_T("\n[ ]");
+	s	+= _TL("random read");
+
+	s	+= pDriver->TestCapability(OLCRandomWrite)			? SG_T("\n[x]") : SG_T("\n[ ]");
+	s	+= _TL("random write");
+
+	s	+= pDriver->TestCapability(OLCSequentialWrite)		? SG_T("\n[x]") : SG_T("\n[ ]");
+	s	+= _TL("sequential write");
+/**/
+
+	return( s );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_Drivers::Can_Read(int Index) const
+{
+	return( Get_Driver(Index) != NULL );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_Drivers::Can_Write(int Index) const
+{
+	return( Get_Driver(Index) != NULL );//&& Get_Driver(Index)->TestCapability(ODrCCreateDataSource) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+TSG_Vertex_Type CSG_OGR_Drivers::Get_Vertex_Type(int Type)
+{
+	switch( Type )
+	{
+	case wkbPoint25D:				// 2.5D extension as per 99-402
+	case wkbMultiPoint25D:			// 2.5D extension as per 99-402
+	case wkbLineString25D:			// 2.5D extension as per 99-402
+	case wkbMultiLineString25D:		// 2.5D extension as per 99-402
+	case wkbPolygon25D:				// 2.5D extension as per 99-402
+	case wkbMultiPolygon25D:		// 2.5D extension as per 99-402
+	case wkbGeometryCollection25D:	// 2.5D extension as per 99-402 
+		return( SG_VERTEX_TYPE_XYZ );
+
+	default:
+		return( SG_VERTEX_TYPE_XY );
+	}
+}
+
+//---------------------------------------------------------
+TSG_Shape_Type CSG_OGR_Drivers::Get_Shape_Type(int Type)
+{
+	switch( Type )
+	{
+	case wkbPoint:					// 0-dimensional geometric object, standard WKB
+	case wkbPoint25D:				// 2.5D extension as per 99-402
+		return( SHAPE_TYPE_Point );
+
+	case wkbMultiPoint:				// GeometryCollection of Points, standard WKB
+	case wkbMultiPoint25D:			// 2.5D extension as per 99-402
+		return( SHAPE_TYPE_Points );
+
+	case wkbLineString:				// 1-dimensional geometric object with linear interpolation between Points, standard WKB
+	case wkbMultiLineString:		// GeometryCollection of LineStrings, standard WKB
+	case wkbLineString25D:			// 2.5D extension as per 99-402
+	case wkbMultiLineString25D:		// 2.5D extension as per 99-402
+		return( SHAPE_TYPE_Line );
+
+	case wkbPolygon:				// planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB
+	case wkbMultiPolygon:			// GeometryCollection of Polygons, standard WKB
+	case wkbPolygon25D:				// 2.5D extension as per 99-402
+	case wkbMultiPolygon25D:		// 2.5D extension as per 99-402
+		return( SHAPE_TYPE_Polygon );
+
+	default:
+	case wkbUnknown:				// unknown type, non-standard
+	case wkbNone:					// non-standard, for pure attribute records
+	case wkbLinearRing:				// non-standard, just for createGeometry()
+	case wkbGeometryCollection:		// geometric object that is a collection of 1 or more geometric objects, standard WKB
+	case wkbGeometryCollection25D:	// 2.5D extension as per 99-402 
+		return( SHAPE_TYPE_Undefined );
+	}
+}
+
+//---------------------------------------------------------
+int CSG_OGR_Drivers::Get_Shape_Type(TSG_Shape_Type Type, bool bZ)
+{
+	switch( Type )
+	{
+	case SHAPE_TYPE_Point:	 	return( bZ ? wkbPoint25D           : wkbPoint           );	// point
+	case SHAPE_TYPE_Points: 	return( bZ ? wkbMultiPoint25D      : wkbMultiPoint      );	// points
+	case SHAPE_TYPE_Line: 		return( bZ ? wkbMultiLineString25D : wkbMultiLineString );	// line
+	case SHAPE_TYPE_Polygon:	return( bZ ? wkbMultiPolygon25D    : wkbMultiPolygon    );	// polygon
+
+	default:	return( wkbUnknown );
+	}
+}
+
+//---------------------------------------------------------
+TSG_Data_Type CSG_OGR_Drivers::Get_Data_Type(int Type)
+{
+	switch( Type )
+	{
+	case OFTInteger:		// Simple 32bit integer
+		return( SG_DATATYPE_Int );
+
+	case OFTReal:			// Double Precision floating point
+		return( SG_DATATYPE_Double );
+
+	case OFTString:			// String of ASCII chars
+		return( SG_DATATYPE_String );
+
+	case OFTDateTime:		// Date and Time 
+		return( SG_DATATYPE_Date );
+
+	default:
+	case OFTIntegerList:	// List of 32bit integers
+	case OFTRealList:		// List of doubles
+	case OFTStringList:		// Array of strings
+	case OFTWideString:		// deprecated
+	case OFTWideStringList:	// deprecated
+	case OFTBinary:			// Raw Binary data
+	case OFTDate:			// Date
+	case OFTTime:			// Time
+		return( SG_DATATYPE_Undefined );
+	}
+}
+
+//---------------------------------------------------------
+int CSG_OGR_Drivers::Get_Data_Type(TSG_Data_Type Type)
+{
+	switch( Type )
+	{
+	default:
+	case SG_DATATYPE_String:
+	case SG_DATATYPE_Date:
+		return( OFTString );
+
+	case SG_DATATYPE_Byte:
+	case SG_DATATYPE_Char:
+	case SG_DATATYPE_Word:
+	case SG_DATATYPE_Short:
+	case SG_DATATYPE_DWord:
+	case SG_DATATYPE_Int:
+	case SG_DATATYPE_ULong:
+	case SG_DATATYPE_Long:
+	case SG_DATATYPE_Color:
+		return( OFTInteger );
+
+	case SG_DATATYPE_Float:
+	case SG_DATATYPE_Double:
+		return( OFTReal );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_OGR_DataSource::CSG_OGR_DataSource(void)
+{
+	m_pDataSource	= NULL;
+}
+
+CSG_OGR_DataSource::CSG_OGR_DataSource(const CSG_String &File)
+{
+	m_pDataSource	= NULL;
+
+	Create(File);
+}
+
+//---------------------------------------------------------
+CSG_OGR_DataSource::~CSG_OGR_DataSource(void)
+{
+	Destroy();
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::Create(const CSG_String &File)
+{
+	Destroy();
+
+	m_pDataSource	= OGRSFDriverRegistrar::Open(File);
+
+	return( m_pDataSource != NULL );
+}
+
+bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &DriverName)
+{
+	OGRSFDriver	*pDriver;
+
+	Destroy();
+
+	if( (pDriver = gSG_OGR_Drivers.Get_Driver(DriverName)) != NULL )
+	{
+		m_pDataSource	= pDriver->CreateDataSource(File, NULL);
+	}
+
+	return( m_pDataSource != NULL );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::Destroy(void)
+{
+	if( m_pDataSource )
+	{
+		OGRDataSource::DestroyDataSource(m_pDataSource);
+
+		m_pDataSource	= NULL;
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_OGR_DataSource::Get_Count(void)
+{
+	if( m_pDataSource )
+	{
+		return( m_pDataSource->GetLayerCount() );
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+OGRLayer * CSG_OGR_DataSource::Get_Layer(int iLayer)
+{
+	if( m_pDataSource && iLayer >= 0 && iLayer < m_pDataSource->GetLayerCount() )
+	{
+		return( m_pDataSource->GetLayer(iLayer) );
+	}
+
+	return( NULL );
+}
+
+//---------------------------------------------------------
+TSG_Shape_Type CSG_OGR_DataSource::Get_Type(int iLayer)
+{
+	if( Get_Layer(iLayer) )
+	{
+		return( CSG_OGR_Drivers::Get_Shape_Type(Get_Layer(iLayer)->GetLayerDefn()->GetGeomType()) );
+	}
+
+	return( SHAPE_TYPE_Undefined );
+}
+
+//---------------------------------------------------------
+TSG_Vertex_Type CSG_OGR_DataSource::Get_Coordinate_Type(int iLayer)
+{
+	if( Get_Layer(iLayer) )
+	{
+		return( CSG_OGR_Drivers::Get_Vertex_Type(Get_Layer(iLayer)->GetLayerDefn()->GetGeomType()) );
+	}
+
+	return( SG_VERTEX_TYPE_XY );
+}
+
+//---------------------------------------------------------
+CSG_Projection CSG_OGR_DataSource::Get_Projection(int iLayer)
+{
+	CSG_Projection	Projection;
+
+	if( Get_Layer(iLayer) && Get_Layer(iLayer)->GetSpatialRef() )
+	{
+		char	*p	= NULL;
+
+		//-------------------------------------------------
+		if( !Projection.is_Okay() && Get_Layer(iLayer)->GetSpatialRef()->exportToWkt  (&p) == OGRERR_NONE && p && *p )
+		{
+			Projection.Create(p, SG_PROJ_FMT_WKT);
+		}
+
+		if( p )	{	OGRFree(p);	p	= NULL;	}
+
+		//-------------------------------------------------
+		if( !Projection.is_Okay() && Get_Layer(iLayer)->GetSpatialRef()->exportToProj4(&p) == OGRERR_NONE && p && *p )
+		{
+			Projection.Create(p, SG_PROJ_FMT_Proj4);
+		}
+
+		if( p )	{	OGRFree(p);	p	= NULL;	}
+	}
+
+	return( Projection );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Shapes * CSG_OGR_DataSource::Read(int iLayer, int iGeomTypeChoice)
+{
+	//-----------------------------------------------------
+	OGRLayer	*pLayer	= Get_Layer(iLayer);
+
+	if( !pLayer )
+	{
+		return( NULL );
+	}
+
+	if( iGeomTypeChoice != 0 )
+	{
+		pLayer->GetLayerDefn()->SetGeomType((OGRwkbGeometryType)_Get_GeomType_Choice(iGeomTypeChoice));
+	}
+
+	if( Get_Type(iLayer) == SHAPE_TYPE_Undefined )
+	{
+		return( NULL );
+	}
+
+	//-----------------------------------------------------
+	OGRFeatureDefn	*pDef		= pLayer->GetLayerDefn();
+	CSG_Shapes		*pShapes	= SG_Create_Shapes(Get_Type(iLayer), CSG_String(pDef->GetName()), NULL, Get_Coordinate_Type(iLayer));
+
+	pShapes->Get_Projection()	= Get_Projection(iLayer);
+
+	//-----------------------------------------------------
+	int		iField;
+
+	for(iField=0; iField<pDef->GetFieldCount(); iField++)
+	{
+		OGRFieldDefn	*pDefField	= pDef->GetFieldDefn(iField);
+
+		pShapes->Add_Field(pDefField->GetNameRef(), CSG_OGR_Drivers::Get_Data_Type(pDefField->GetType()));
+	}
+
+	//-----------------------------------------------------
+	OGRFeature	*pFeature;
+
+	pLayer->ResetReading();
+
+	while( (pFeature = pLayer->GetNextFeature()) != NULL && SG_UI_Process_Get_Okay(false) )
+	{
+		OGRGeometry	*pGeometry	= pFeature->GetGeometryRef();
+
+		if( pGeometry != NULL )
+		{
+			CSG_Shape	*pShape	= pShapes->Add_Shape();
+
+			for(iField=0; iField<pDef->GetFieldCount(); iField++)
+			{
+				OGRFieldDefn	*pDefField	= pDef->GetFieldDefn(iField);
+
+				switch( pDefField->GetType() )
+				{
+				default:			pShape->Set_Value(iField, pFeature->GetFieldAsString (iField));	break;
+				case OFTString:		pShape->Set_Value(iField, pFeature->GetFieldAsString (iField));	break;
+				case OFTInteger:	pShape->Set_Value(iField, pFeature->GetFieldAsInteger(iField));	break;
+				case OFTReal:		pShape->Set_Value(iField, pFeature->GetFieldAsDouble (iField));	break;
+				}
+			}
+
+			//---------------------------------------------
+			if( _Read_Geometry(pShape, pGeometry) == false )
+			{
+				pShapes->Del_Shape(pShape);
+			}
+		}
+
+		OGRFeature::DestroyFeature(pFeature);
+	}
+
+	return( pShapes );
+}
+
+//---------------------------------------------------------
+int CSG_OGR_DataSource::_Get_GeomType_Choice(int iGeomTypeChoice)
+{
+	switch( iGeomTypeChoice )
+	{
+	default:
+	case AUTOMATIC:					return( wkbUnknown );
+	case WKBPOINT:					return( wkbPoint );
+	case WKBPOINT25D:				return( wkbPoint25D );
+	case WKBMULTIPOINT:				return( wkbMultiPoint );
+	case WKBMULTIPOINT25D:			return( wkbMultiPoint25D );
+	case WKBLINESTRING:				return( wkbLineString );
+	case WKBLINESTRING25D:			return( wkbLineString25D );
+	case WKBMULTILINESTRING:		return( wkbMultiLineString );
+	case WKBMULTILINESTRING25D:		return( wkbMultiLineString25D );
+	case WKBPOLYGON:				return( wkbPolygon );
+	case WKBPOLYGON25D:				return( wkbPolygon25D );
+	case WKBMULTIPOLYGON:			return( wkbMultiPolygon );
+	case WKBMULTIPOLYGON25D:		return( wkbMultiPolygon25D );
+	case WKBGEOMETRYCOLLECTION:		return( wkbGeometryCollection );
+	case WKBGEOMETRYCOLLECTION25D:	return( wkbGeometryCollection25D );
+	}
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::_Read_Geometry(CSG_Shape *pShape, OGRGeometry *pGeometry)
+{
+	if( pShape && pGeometry )
+	{
+		switch( pGeometry->getGeometryType() )
+		{
+		//-------------------------------------------------
+		case wkbPoint:				// 0-dimensional geometric object, standard WKB
+		case wkbPoint25D:			// 2.5D extension as per 99-402
+			pShape->Add_Point(((OGRPoint *)pGeometry)->getX(), ((OGRPoint *)pGeometry)->getY());
+			pShape->Set_Z(((OGRPoint *)pGeometry)->getZ(), 0);
+			return( true );
+
+		//-------------------------------------------------
+		case wkbLineString:			// 1-dimensional geometric object with linear interpolation between Points, standard WKB
+		case wkbLineString25D:		// 2.5D extension as per 99-402
+			return( _Read_Line(pShape, (OGRLineString *)pGeometry) );
+
+		//-------------------------------------------------
+		case wkbPolygon:			// planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB
+		case wkbPolygon25D:			// 2.5D extension as per 99-402
+			return( _Read_Polygon(pShape, (OGRPolygon *)pGeometry) );
+
+		//-------------------------------------------------
+		case wkbMultiPoint:			// GeometryCollection of Points, standard WKB
+		case wkbMultiPoint25D:		// 2.5D extension as per 99-402
+		case wkbMultiLineString:	// GeometryCollection of LineStrings, standard WKB
+		case wkbMultiLineString25D:	// 2.5D extension as per 99-402
+		case wkbMultiPolygon:		// GeometryCollection of Polygons, standard WKB
+		case wkbMultiPolygon25D:	// 2.5D extension as per 99-402
+			{
+				for(int i=0; i<((OGRGeometryCollection *)pGeometry)->getNumGeometries(); i++)
+				{
+					if( _Read_Geometry(pShape, ((OGRGeometryCollection *)pGeometry)->getGeometryRef(i)) == false )
+					{
+						return( false );
+					}
+				}
+			}
+
+			return( true );
+
+		//-------------------------------------------------
+		default:
+			break;
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::_Read_Line(CSG_Shape *pShape, OGRLineString *pLine)
+{
+	if( pShape && pLine && pLine->getNumPoints() > 0 )
+	{
+		int		iPart	= pShape->Get_Part_Count();
+
+		for(int iPoint=0; iPoint<pLine->getNumPoints(); iPoint++)
+		{
+			pShape->Add_Point(pLine->getX(iPoint), pLine->getY(iPoint), iPart);
+
+			pShape->Set_Z(pLine->getZ(iPoint), iPoint, iPart);
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::_Read_Polygon(CSG_Shape *pShape, OGRPolygon *pPolygon)
+{
+	if( pShape && pPolygon )
+	{
+		_Read_Line(pShape, pPolygon->getExteriorRing());
+
+		for(int i=0; i<pPolygon->getNumInteriorRings(); i++)
+		{
+			pPolygon->getInteriorRing(i);
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName)
+{
+	if( !m_pDataSource || !pShapes || !pShapes->is_Valid() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	OGRSpatialReference	*pSRS	= NULL;
+
+	if( pShapes->Get_Projection().is_Okay() )
+	{
+		pSRS	= new OGRSpatialReference(pShapes->Get_Projection().Get_WKT());
+	//	pSRS	= new OGRSpatialReference();
+	//	pSRS	->importFromProj4(pShapes->Get_Projection().Get_Proj4());
+	}
+
+	OGRLayer	*pLayer	= m_pDataSource->CreateLayer(CSG_String(pShapes->Get_Name()), pSRS,
+		(OGRwkbGeometryType)gSG_OGR_Drivers.Get_Shape_Type(pShapes->Get_Type(), pShapes->Get_Vertex_Type() != SG_VERTEX_TYPE_XY)
+	);
+
+	if( !pLayer )
+	{
+		return( false );
+	}
+
+	//-------------------------------------------------
+	if( SG_STR_CMP(DriverName, "DXF") )
+	{
+		// the dxf driver does not support arbitrary field creation and returns OGRERR_FAILURE;
+		// it seems like there is no method in OGR to check whether a driver supports field creation or not;
+		// another issue with the dxf driver: 3D polygon data is not supported (would require e.g. "3DFACE"
+		// entity implementation in GDAL/OGR), so we would need to treat them as polylines (not implemented,
+		// currently it is necessary to convert to a line shapefile a priori)
+
+		for(int iField=0; iField<pShapes->Get_Field_Count(); iField++)
+		{
+			OGRFieldDefn	DefField(CSG_String(pShapes->Get_Field_Name(iField)), (OGRFieldType)gSG_OGR_Drivers.Get_Data_Type(pShapes->Get_Field_Type(iField)));
+
+			if( pLayer->CreateField(&DefField) != OGRERR_NONE )
+			{
+				return( false );
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(int iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape		= pShapes->Get_Shape(iShape);
+		OGRFeature	*pFeature	= OGRFeature::CreateFeature(pLayer->GetLayerDefn());
+
+		if( _Write_Geometry(pShape, pFeature, pShapes->Get_Vertex_Type() != SG_VERTEX_TYPE_XY) )
+		{
+			// no need for a special treatment of DXF here, as pFeature->SetField() just silently ignores iFields out of range
+			for(int iField=0; iField<pShapes->Get_Field_Count(); iField++)
+			{
+				switch( pShapes->Get_Field_Type(iField) )
+				{
+				default:
+				case SG_DATATYPE_Char:
+				case SG_DATATYPE_String:
+				case SG_DATATYPE_Date:
+					pFeature->SetField(iField, CSG_String(pShape->asString(iField)));
+					break;
+
+				case SG_DATATYPE_Short:
+				case SG_DATATYPE_Int:
+				case SG_DATATYPE_Long:
+				case SG_DATATYPE_Color:
+					pFeature->SetField(iField, pShape->asInt(iField));
+					break;
+
+				case SG_DATATYPE_Float:
+				case SG_DATATYPE_Double:
+					pFeature->SetField(iField, pShape->asDouble(iField));
+					break;
+				}
+			}
+
+			pLayer->CreateFeature(pFeature);
+		}
+
+		OGRFeature::DestroyFeature(pFeature);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::_Write_Geometry(CSG_Shape *pShape, OGRFeature *pFeature, bool bZ)
+{
+	if( !pShape || !pFeature )
+	{
+		return( false );
+	}
+
+	switch( pShape->Get_Type() )
+	{
+	//-----------------------------------------------------
+	case SHAPE_TYPE_Point:
+		{
+			TSG_Point	p	= pShape->Get_Point(0);
+
+			OGRPoint	Point(p.x, p.y, pShape->Get_Z(0));
+
+			return( pFeature->SetGeometry(&Point) == OGRERR_NONE );
+		}
+
+	//-----------------------------------------------------
+	case SHAPE_TYPE_Points:
+		{
+			OGRMultiPoint	Points;
+
+			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					TSG_Point	p	= pShape->Get_Point(iPoint, iPart);
+
+					OGRPoint	Point(p.x, p.y, pShape->Get_Z(0));
+
+					Points.addGeometry(&Point);
+				}
+			}
+
+			return( pFeature->SetGeometry(&Points) == OGRERR_NONE );
+		}
+
+	//-----------------------------------------------------
+	case SHAPE_TYPE_Line:
+		if( pShape->Get_Part_Count() == 1 )
+		{
+			OGRLineString	Line;
+
+			_Write_Line(pShape, &Line, 0, bZ);
+
+			return( pFeature->SetGeometry(&Line) == OGRERR_NONE );
+		}
+		else
+		{
+			OGRMultiLineString	Lines;
+
+			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				OGRLineString	Line;
+
+				if( _Write_Line(pShape, &Line, iPart, bZ) )
+				{
+					Lines.addGeometry(&Line);
+				}
+			}
+
+			return( pFeature->SetGeometry(&Lines) == OGRERR_NONE );
+		}
+
+	//-----------------------------------------------------
+	case SHAPE_TYPE_Polygon:
+		{
+			OGRPolygon	Polygon;
+
+			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				OGRLinearRing	Ring;
+
+				if( _Write_Line(pShape, &Ring, iPart, bZ) )
+				{
+					Polygon.addRing(&Ring);
+				}
+			}
+
+			return( pFeature->SetGeometry(&Polygon) == OGRERR_NONE );
+		}
+
+	//-------------------------------------------------
+	default:
+		return( false );
+	}
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_DataSource::_Write_Line(CSG_Shape *pShape, OGRLineString *pLine, int iPart, bool bZ)
+{
+	if( pLine && pShape && iPart >= 0 && iPart < pShape->Get_Part_Count() )
+	{
+		pLine->empty();
+
+		for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+		{
+			TSG_Point	p	= pShape->Get_Point(iPoint, iPart);
+
+			pLine->addPoint(p.x, p.y, pShape->Get_Z(iPoint, iPart));
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_gdal/ogr_driver.h b/src/modules/io/io_gdal/ogr_driver.h
new file mode 100644
index 0000000..ea6276a
--- /dev/null
+++ b/src/modules/io/io_gdal/ogr_driver.h
@@ -0,0 +1,203 @@
+/**********************************************************
+ * Version $Id: ogr_driver.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library                     //
+//                                                       //
+//                       io_gdal                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     ogr_driver.h                      //
+//                                                       //
+//            Copyright (C) 2008 O. 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Bundesstr. 55                          //
+//                D-20146 Hamburg                        //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__ogr_driver_H
+#define HEADER_INCLUDED__ogr_driver_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+//---------------------------------------------------------
+typedef enum ESG_Geom_Type_Choice_Key
+{
+	AUTOMATIC				= 0,
+	WKBPOINT,
+	WKBPOINT25D,
+	WKBMULTIPOINT,
+	WKBMULTIPOINT25D,
+	WKBLINESTRING,
+	WKBLINESTRING25D,
+	WKBMULTILINESTRING,
+	WKBMULTILINESTRING25D,
+	WKBPOLYGON,
+	WKBPOLYGON25D,
+	WKBMULTIPOLYGON,
+	WKBMULTIPOLYGON25D,
+	WKBGEOMETRYCOLLECTION,
+	WKBGEOMETRYCOLLECTION25D,
+	GEOM_TYPE_KEY_Count
+}
+TSG_Geom_Type_Choice_Key;
+
+
+//---------------------------------------------------------
+const SG_Char	gSG_Geom_Type_Choice_Key_Name[GEOM_TYPE_KEY_Count][32]	=
+{
+	SG_T("automatic"),
+	SG_T("wkbPoint"),
+	SG_T("wkbPoint25D"),
+	SG_T("wkbMultiPoint"),
+	SG_T("wkbMultiPoint25D"),
+	SG_T("wkbLineString"),
+	SG_T("wkbLineString25D"),
+	SG_T("wkbMultiLineString"),
+	SG_T("wkbMultiLineString25D"),
+	SG_T("wkbPolygon"),
+	SG_T("wkbPolygon25D"),
+	SG_T("wkbMultiPolygon"),
+	SG_T("wkbMultiPolygon25D"),
+	SG_T("wkbGeometryCollection"),
+	SG_T("wkbGeometryCollection25D")
+};
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class io_gdal_EXPORT CSG_OGR_Drivers
+{
+public:
+	CSG_OGR_Drivers(void);
+	virtual ~CSG_OGR_Drivers(void);
+
+	int							Get_Count			(void)						const;
+
+	class OGRSFDriver *			Get_Driver			(const CSG_String &Name)	const;
+	class OGRSFDriver *			Get_Driver			(int Index)					const;
+
+	CSG_String					Get_Name			(int Index)					const;
+	CSG_String					Get_Description		(int Index)					const;
+
+	bool						Can_Read			(int Index)					const;
+	bool						Can_Write			(int Index)					const;
+
+	static TSG_Vertex_Type		Get_Vertex_Type		(int Type);
+	static TSG_Shape_Type		Get_Shape_Type		(int Type);
+	static int					Get_Shape_Type		(TSG_Shape_Type Type, bool bZ);
+
+	static TSG_Data_Type		Get_Data_Type		(int            Type);
+	static int					Get_Data_Type		(TSG_Data_Type  Type);
+
+
+private:
+
+	class OGRSFDriverRegistrar	*m_pDrivers;
+
+};
+
+//---------------------------------------------------------
+io_gdal_EXPORT const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class io_gdal_EXPORT CSG_OGR_DataSource
+{
+public:
+	CSG_OGR_DataSource(void);
+	CSG_OGR_DataSource(const CSG_String &File);
+	CSG_OGR_DataSource(const CSG_String &File, const CSG_String &DriverName);
+	virtual ~CSG_OGR_DataSource(void);
+
+	bool						Create				(const CSG_String &File);
+	bool						Create				(const CSG_String &File, const CSG_String &DriverName);
+	bool						Destroy				(void);
+
+	int							Get_Count			(void);
+	class OGRLayer *			Get_Layer			(int iLayer);
+	TSG_Shape_Type				Get_Type			(int iLayer);
+	TSG_Vertex_Type				Get_Coordinate_Type	(int iLayer);
+	CSG_Projection				Get_Projection		(int iLayer);
+
+	CSG_Shapes *				Read				(int iLayer, int iGeomTypeChoice);
+	bool						Write				(CSG_Shapes *pShapes, const CSG_String &DriverName);
+
+
+private:
+
+	class OGRDataSource			*m_pDataSource;
+
+
+	int							_Get_GeomType_Choice(int iGeomTypeChoice);
+
+	bool						_Read_Geometry		(CSG_Shape *pShape, class OGRGeometry *pGeometry);
+	bool						_Read_Line			(CSG_Shape *pShape, class OGRLineString *pLine);
+	bool						_Read_Polygon		(CSG_Shape *pShape, class OGRPolygon *pPolygon);
+
+	bool						_Write_Geometry		(CSG_Shape *pShape, class OGRFeature *pFeature, bool bZ);
+	bool						_Write_Line			(CSG_Shape *pShape, class OGRLineString *pLine, int iPart, bool bZ);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__ogr_driver_H
diff --git a/src/modules_io/gdal/io_gdal/ogr_export.cpp b/src/modules/io/io_gdal/ogr_export.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/ogr_export.cpp
rename to src/modules/io/io_gdal/ogr_export.cpp
diff --git a/src/modules_io/gdal/io_gdal/ogr_export.h b/src/modules/io/io_gdal/ogr_export.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/ogr_export.h
rename to src/modules/io/io_gdal/ogr_export.h
diff --git a/src/modules_io/gdal/io_gdal/ogr_export_kml.cpp b/src/modules/io/io_gdal/ogr_export_kml.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/ogr_export_kml.cpp
rename to src/modules/io/io_gdal/ogr_export_kml.cpp
diff --git a/src/modules_io/gdal/io_gdal/ogr_export_kml.h b/src/modules/io/io_gdal/ogr_export_kml.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/ogr_export_kml.h
rename to src/modules/io/io_gdal/ogr_export_kml.h
diff --git a/src/modules_io/gdal/io_gdal/ogr_import.cpp b/src/modules/io/io_gdal/ogr_import.cpp
similarity index 100%
rename from src/modules_io/gdal/io_gdal/ogr_import.cpp
rename to src/modules/io/io_gdal/ogr_import.cpp
diff --git a/src/modules_io/gdal/io_gdal/ogr_import.h b/src/modules/io/io_gdal/ogr_import.h
similarity index 100%
rename from src/modules_io/gdal/io_gdal/ogr_import.h
rename to src/modules/io/io_gdal/ogr_import.h
diff --git a/src/modules/io/io_gps/GPSBabel.cpp b/src/modules/io/io_gps/GPSBabel.cpp
new file mode 100644
index 0000000..0d69e70
--- /dev/null
+++ b/src/modules/io/io_gps/GPSBabel.cpp
@@ -0,0 +1,163 @@
+/**********************************************************
+ * Version $Id: GPSBabel.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    GPSBabel.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+#include "GPSBabel.h"
+
+CSG_String	sGPSBabelID[]	=
+{
+	"geo",
+	"gpsman",
+	"gpx",
+	"magellan",
+	"mapsend",
+	"pcx",
+	"mapsource",
+	"gpsutil",
+	"tiger",
+	"csv",
+	"xmap",
+	"dna",
+	"psp",
+	"cetus",
+	"gpspilot",
+	"magnav",
+	"garmin",
+	"mxf",
+	"holux",
+	"ozi",
+	"tpg",
+	"tmpro"
+};
+
+CGPSBabel::CGPSBabel(){
+
+	Parameters.Set_Name(_TL("GPSBabel"));
+
+	Parameters.Set_Description(_TW(
+		"An interface to the GPSBabel software"
+		"(c) 2005 by Victor Olaya\r\nemail: volaya at ya.com"));
+
+	Parameters.Add_FilePath(NULL,
+							"BASEPATH",
+							_TL("GPSBabel path"),
+							_TL("GPSBabel path"),
+							_TL(""),
+							_TL(""),
+							false,
+							true);
+
+	Parameters.Add_FilePath(NULL, 
+							"INPUT", 
+							_TL("Input file"),
+							_TL(""),
+							_TL("All Files|*.*|"));
+
+	Parameters.Add_Choice(NULL, 
+						"FORMATIN", 
+						_TL("Input format"), 
+						_TL(""), 
+						_TW("Geocaching.com .loc|"
+							"GPSman|"
+							"GPX XML|"
+							"Magellan protocol|"
+							"Magellan Mapsend|"
+							"Garmin PCX5|"
+							"Garmin Mapsource|"
+							"gpsutil|"
+							"U.S. Census Bureau Tiger Mapping Service|"
+							"Comma separated values|"
+							"Delorme Topo USA4/XMap Conduit|"
+							"Navitrak DNA marker format|"
+							"MS PocketStreets 2002 Pushpin|"
+							"Cetus for Palm/OS|"
+							"GPSPilot Tracker for Palm/OS|"
+							"Magellan NAV Companion for PalmOS|"
+							"Garmin serial protocol|"
+							"MapTech Exchange Format|"
+							"Holux (gm-100) .wpo Format|"
+							"OziExplorer Waypoint|"
+							"National Geographic Topo .tpg|"
+							"TopoMapPro Places File|"
+						),	0);
+
+	Parameters.Add_FilePath(NULL, 
+							"OUTPUT", 
+							_TL("Output file"),
+							_TL(""),
+							_TL("All Files|*.*|"),
+							_TL(""),
+							true,
+							false);
+
+	Parameters.Add_Choice(NULL, 
+						"FORMATOUT", 
+						_TL("Output format"), 
+						_TL(""), 
+					_TW("Geocaching.com .loc|"
+						"GPSman|"
+						"GPX XML|"
+						"Magellan protocol|"
+						"Magellan Mapsend|"
+						"Garmin PCX5|"
+						"Garmin Mapsource|"
+						"gpsutil|"
+						"U.S. Census Bureau Tiger Mapping Service|"
+						"Comma separated values|"
+						"Delorme Topo USA4/XMap Conduit|"
+						"Navitrak DNA marker format|"
+						"MS PocketStreets 2002 Pushpin|"
+						"Cetus for Palm/OS|"
+						"GPSPilot Tracker for Palm/OS|"
+						"Magellan NAV Companion for PalmOS|"
+						"Garmin serial protocol|"
+						"MapTech Exchange Format|"
+						"Holux (gm-100) .wpo Format|"
+						"OziExplorer Waypoint|"
+						"National Geographic Topo .tpg|"
+						"TopoMapPro Places File|"),
+						0);
+
+}//constructor
+
+CGPSBabel::~CGPSBabel(){
+
+}//destructor
+
+bool CGPSBabel::On_Execute(void){
+
+	CSG_String sCmd;
+	CSG_String sInputFile = Parameters("INPUT")->asString();
+	CSG_String sOutputFile = Parameters("OUTPUT")->asString();
+	CSG_String sBasePath = Parameters("BASEPATH")->asString();
+	int iInputFormat = Parameters("FORMATIN")->asInt();
+	int iOutputFormat = Parameters("FORMATOUT")->asInt();
+
+	sCmd = sBasePath + SG_T("\\") + SG_T("gpsbabel.exe ") 
+			+ SG_T("-i ") + sGPSBabelID[iInputFormat]	+ SG_T(" ")
+			+ SG_T("-f ") + sInputFile					+ SG_T(" ")
+			+ SG_T("-o ") + sGPSBabelID[iOutputFormat]	+ SG_T(" ")
+			+ SG_T("-F ") + sOutputFile					+ SG_T(" ");
+
+	system(sCmd.b_str());
+
+	return true;
+
+}//method
\ No newline at end of file
diff --git a/src/modules/io/io_gps/GPSBabel.h b/src/modules/io/io_gps/GPSBabel.h
new file mode 100644
index 0000000..1c04e1f
--- /dev/null
+++ b/src/modules/io/io_gps/GPSBabel.h
@@ -0,0 +1,39 @@
+/**********************************************************
+ * Version $Id: GPSBabel.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    GPSBabel.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CGPSBabel : public CSG_Module {
+
+public:
+	CGPSBabel(void);
+	virtual ~CGPSBabel(void);
+
+protected:
+	virtual bool On_Execute(void);
+
+};
+
diff --git a/src/modules_io/gps/io_gps/MLB_Interface.cpp b/src/modules/io/io_gps/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/gps/io_gps/MLB_Interface.cpp
rename to src/modules/io/io_gps/MLB_Interface.cpp
diff --git a/src/modules_io/gps/io_gps/MLB_Interface.h b/src/modules/io/io_gps/MLB_Interface.h
similarity index 100%
rename from src/modules_io/gps/io_gps/MLB_Interface.h
rename to src/modules/io/io_gps/MLB_Interface.h
diff --git a/src/modules_io/gps/io_gps/Makefile.am b/src/modules/io/io_gps/Makefile.am
similarity index 100%
rename from src/modules_io/gps/io_gps/Makefile.am
rename to src/modules/io/io_gps/Makefile.am
diff --git a/src/modules/io/io_gps/Makefile.in b/src/modules/io/io_gps/Makefile.in
new file mode 100644
index 0000000..2931b80
--- /dev/null
+++ b/src/modules/io/io_gps/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_gps
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_gps_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_gps_la_OBJECTS = GPSBabel.lo gpx2shp.lo MLB_Interface.lo
+libio_gps_la_OBJECTS = $(am_libio_gps_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_gps_la_SOURCES)
+DIST_SOURCES = $(libio_gps_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libio_gps.la
+libio_gps_la_SOURCES = \
+GPSBabel.cpp\
+gpx2shp.cpp\
+MLB_Interface.cpp\
+GPSBabel.h\
+gpx2shp.h\
+MLB_Interface.h
+
+libio_gps_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_gps/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_gps/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_gps.la: $(libio_gps_la_OBJECTS) $(libio_gps_la_DEPENDENCIES) $(EXTRA_libio_gps_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_gps_la_OBJECTS) $(libio_gps_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GPSBabel.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gpx2shp.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/io/io_gps/gpx2shp.cpp b/src/modules/io/io_gps/gpx2shp.cpp
new file mode 100644
index 0000000..28e722d
--- /dev/null
+++ b/src/modules/io/io_gps/gpx2shp.cpp
@@ -0,0 +1,145 @@
+/**********************************************************
+ * Version $Id: gpx2shp.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    GPX2SHP.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+#include "gpx2shp.h"
+
+CGPX2SHP::CGPX2SHP(){
+				   
+	Parameters.Set_Name(_TL("GPX to shapefile"));
+
+	Parameters.Set_Description(_TW(
+		"Converts a GPX file into a Shapefile (.shp)"
+		"(c) 2005 by Victor Olaya\r\nemail: volaya at ya.com")
+	);
+
+	Parameters.Add_FilePath(NULL,
+							"BASEPATH",
+							_TL("Gpx2shp path"),
+							_TL("Gpx2shp path"),
+							_TL(""),
+							_TL(""),
+							false,
+							true);
+
+	Parameters.Add_FilePath(NULL, 
+							"FILE", 
+							_TL("GPX file"),
+							_TL(""),
+							_TL("GPX files (*.gpx)|*.gpx|All Files|*.*")
+	);
+	
+	Parameters.Add_Value(NULL,
+						"TRACKPOINTS", 
+						_TL("Convert track points"),
+						_TL("Convert track points"),
+						PARAMETER_TYPE_Bool,
+						true);
+	
+	Parameters.Add_Value(NULL,
+						"WAYPOINTS", 
+						_TL("Convert way points"),
+						_TL("Convert way points"),
+						PARAMETER_TYPE_Bool,
+						true);
+
+	Parameters.Add_Value(NULL,
+						"ROUTES", 
+						_TL("Convert routes"),
+						_TL("Convert routes"),
+						PARAMETER_TYPE_Bool,
+						true);
+	
+	Parameters.Add_Value(NULL,
+						"ADD", 
+						_TL("Load shapefile"),
+						_TL("Load shapefile after conversion"),
+						PARAMETER_TYPE_Bool,
+						true);
+
+}//constructor
+
+CGPX2SHP::~CGPX2SHP(){
+
+}//destructor
+
+bool CGPX2SHP::On_Execute(void){
+
+	CSG_String sCmd;
+	CSG_String sFile = Parameters("FILE")->asString();
+	CSG_String sBasePath = Parameters("BASEPATH")->asString();
+	CSG_String sShapefile;
+	bool bWaypoints = Parameters("WAYPOINTS")->asBool();
+	bool bTrackpoints = Parameters("TRACKPOINTS")->asBool();
+	bool bRoutes = Parameters("ROUTES")->asBool();
+	bool bAdd = Parameters("ADD")->asBool();
+	CSG_Shapes *pShapes;
+
+	sCmd = sBasePath + SG_T("\\gpx2shp ");
+
+	if (bWaypoints){
+		sCmd += SG_T("-w ");
+	}//if
+	if (bTrackpoints){
+		sCmd += SG_T("-t ");
+	}//if
+	if (bRoutes){
+		sCmd += SG_T("-r ");
+	}//if
+	
+	sCmd += sFile;
+
+	system(sCmd.b_str());
+
+	if( bAdd )
+	{
+		CSG_String	sDir(SG_File_Get_Path(sFile)), sName(SG_File_Get_Name(sFile, false));
+
+		//-------------------------------------------------
+		sFile	= SG_File_Make_Path(sDir, sName + SG_T("_wpt"), SG_T("shp"));
+		pShapes	= SG_Create_Shapes(sFile);
+
+		if( pShapes->is_Valid() )
+			DataObject_Add(pShapes, false);
+		else
+			delete(pShapes);
+
+		//-------------------------------------------------
+		sFile	= SG_File_Make_Path(sDir, sName + SG_T("_trk"), SG_T("shp"));
+		pShapes	= SG_Create_Shapes(sFile);
+
+		if( pShapes->is_Valid() )
+			DataObject_Add(pShapes, false);
+		else
+			delete(pShapes);
+
+		//-------------------------------------------------
+		sFile	= SG_File_Make_Path(sDir, sName + SG_T("_rte"), SG_T("shp"));
+		pShapes	= SG_Create_Shapes(sFile);
+
+		if( pShapes->is_Valid() )
+			DataObject_Add(pShapes, false);
+		else
+			delete(pShapes);
+	}//if
+	
+	return true;
+
+}//method
\ No newline at end of file
diff --git a/src/modules/io/io_gps/gpx2shp.h b/src/modules/io/io_gps/gpx2shp.h
new file mode 100644
index 0000000..c1d4225
--- /dev/null
+++ b/src/modules/io/io_gps/gpx2shp.h
@@ -0,0 +1,39 @@
+/**********************************************************
+ * Version $Id: gpx2shp.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    GPX2SHP.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CGPX2SHP : public CSG_Module {
+
+public:
+	CGPX2SHP(void);
+	virtual ~CGPX2SHP(void);
+
+protected:
+	virtual bool On_Execute(void);
+
+};
+
diff --git a/src/modules_io/grid/io_grid/MLB_Interface.cpp b/src/modules/io/io_grid/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/MLB_Interface.cpp
rename to src/modules/io/io_grid/MLB_Interface.cpp
diff --git a/src/modules_io/grid/io_grid/MLB_Interface.h b/src/modules/io/io_grid/MLB_Interface.h
similarity index 100%
rename from src/modules_io/grid/io_grid/MLB_Interface.h
rename to src/modules/io/io_grid/MLB_Interface.h
diff --git a/src/modules_io/grid/io_grid/Makefile.am b/src/modules/io/io_grid/Makefile.am
similarity index 100%
rename from src/modules_io/grid/io_grid/Makefile.am
rename to src/modules/io/io_grid/Makefile.am
diff --git a/src/modules/io/io_grid/Makefile.in b/src/modules/io/io_grid/Makefile.in
new file mode 100644
index 0000000..0323083
--- /dev/null
+++ b/src/modules/io/io_grid/Makefile.in
@@ -0,0 +1,663 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_grid
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_grid_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_grid_la_OBJECTS = bmp_export.lo erdas_lan.lo esri_arcinfo.lo \
+	grid_table.lo MLB_Interface.lo mola.lo raw.lo srtm30.lo \
+	surfer.lo usgs_srtm.lo wrf.lo xyz.lo
+libio_grid_la_OBJECTS = $(am_libio_grid_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_grid_la_SOURCES)
+DIST_SOURCES = $(libio_grid_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libio_grid.la
+libio_grid_la_SOURCES = \
+bmp_export.cpp\
+erdas_lan.cpp\
+esri_arcinfo.cpp\
+grid_table.cpp\
+MLB_Interface.cpp\
+mola.cpp\
+raw.cpp\
+srtm30.cpp\
+surfer.cpp\
+usgs_srtm.cpp\
+wrf.cpp\
+xyz.cpp\
+bmp_export.h\
+erdas_lan.h\
+esri_arcinfo.h\
+grid_table.h\
+MLB_Interface.h\
+mola.h\
+raw.h\
+srtm30.h\
+surfer.h\
+usgs_srtm.h\
+wrf.h\
+xyz.h
+
+libio_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_grid/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_grid/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_grid.la: $(libio_grid_la_OBJECTS) $(libio_grid_la_DEPENDENCIES) $(EXTRA_libio_grid_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_grid_la_OBJECTS) $(libio_grid_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bmp_export.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/erdas_lan.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/esri_arcinfo.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_table.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mola.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/raw.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/srtm30.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/surfer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/usgs_srtm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wrf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xyz.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/grid/io_grid/bmp_export.cpp b/src/modules/io/io_grid/bmp_export.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/bmp_export.cpp
rename to src/modules/io/io_grid/bmp_export.cpp
diff --git a/src/modules_io/grid/io_grid/bmp_export.h b/src/modules/io/io_grid/bmp_export.h
similarity index 100%
rename from src/modules_io/grid/io_grid/bmp_export.h
rename to src/modules/io/io_grid/bmp_export.h
diff --git a/src/modules_io/grid/io_grid/erdas_lan.cpp b/src/modules/io/io_grid/erdas_lan.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/erdas_lan.cpp
rename to src/modules/io/io_grid/erdas_lan.cpp
diff --git a/src/modules_io/grid/io_grid/erdas_lan.h b/src/modules/io/io_grid/erdas_lan.h
similarity index 100%
rename from src/modules_io/grid/io_grid/erdas_lan.h
rename to src/modules/io/io_grid/erdas_lan.h
diff --git a/src/modules_io/grid/io_grid/esri_arcinfo.cpp b/src/modules/io/io_grid/esri_arcinfo.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/esri_arcinfo.cpp
rename to src/modules/io/io_grid/esri_arcinfo.cpp
diff --git a/src/modules_io/grid/io_grid/esri_arcinfo.h b/src/modules/io/io_grid/esri_arcinfo.h
similarity index 100%
rename from src/modules_io/grid/io_grid/esri_arcinfo.h
rename to src/modules/io/io_grid/esri_arcinfo.h
diff --git a/src/modules_io/grid/io_grid/grid_table.cpp b/src/modules/io/io_grid/grid_table.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/grid_table.cpp
rename to src/modules/io/io_grid/grid_table.cpp
diff --git a/src/modules_io/grid/io_grid/grid_table.h b/src/modules/io/io_grid/grid_table.h
similarity index 100%
rename from src/modules_io/grid/io_grid/grid_table.h
rename to src/modules/io/io_grid/grid_table.h
diff --git a/src/modules_io/grid/io_grid/mola.cpp b/src/modules/io/io_grid/mola.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/mola.cpp
rename to src/modules/io/io_grid/mola.cpp
diff --git a/src/modules_io/grid/io_grid/mola.h b/src/modules/io/io_grid/mola.h
similarity index 100%
rename from src/modules_io/grid/io_grid/mola.h
rename to src/modules/io/io_grid/mola.h
diff --git a/src/modules_io/grid/io_grid/raw.cpp b/src/modules/io/io_grid/raw.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/raw.cpp
rename to src/modules/io/io_grid/raw.cpp
diff --git a/src/modules_io/grid/io_grid/raw.h b/src/modules/io/io_grid/raw.h
similarity index 100%
rename from src/modules_io/grid/io_grid/raw.h
rename to src/modules/io/io_grid/raw.h
diff --git a/src/modules_io/grid/io_grid/srtm30.cpp b/src/modules/io/io_grid/srtm30.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/srtm30.cpp
rename to src/modules/io/io_grid/srtm30.cpp
diff --git a/src/modules_io/grid/io_grid/srtm30.h b/src/modules/io/io_grid/srtm30.h
similarity index 100%
rename from src/modules_io/grid/io_grid/srtm30.h
rename to src/modules/io/io_grid/srtm30.h
diff --git a/src/modules_io/grid/io_grid/surfer.cpp b/src/modules/io/io_grid/surfer.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/surfer.cpp
rename to src/modules/io/io_grid/surfer.cpp
diff --git a/src/modules_io/grid/io_grid/surfer.h b/src/modules/io/io_grid/surfer.h
similarity index 100%
rename from src/modules_io/grid/io_grid/surfer.h
rename to src/modules/io/io_grid/surfer.h
diff --git a/src/modules_io/grid/io_grid/usgs_srtm.cpp b/src/modules/io/io_grid/usgs_srtm.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/usgs_srtm.cpp
rename to src/modules/io/io_grid/usgs_srtm.cpp
diff --git a/src/modules_io/grid/io_grid/usgs_srtm.h b/src/modules/io/io_grid/usgs_srtm.h
similarity index 100%
rename from src/modules_io/grid/io_grid/usgs_srtm.h
rename to src/modules/io/io_grid/usgs_srtm.h
diff --git a/src/modules_io/grid/io_grid/wrf.cpp b/src/modules/io/io_grid/wrf.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid/wrf.cpp
rename to src/modules/io/io_grid/wrf.cpp
diff --git a/src/modules_io/grid/io_grid/wrf.h b/src/modules/io/io_grid/wrf.h
similarity index 100%
rename from src/modules_io/grid/io_grid/wrf.h
rename to src/modules/io/io_grid/wrf.h
diff --git a/src/modules/io/io_grid/xyz.cpp b/src/modules/io/io_grid/xyz.cpp
new file mode 100644
index 0000000..7ea832d
--- /dev/null
+++ b/src/modules/io/io_grid/xyz.cpp
@@ -0,0 +1,391 @@
+/**********************************************************
+ * Version $Id: xyz.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        Grid_IO                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                        XYZ.cpp                        //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "xyz.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CXYZ_Export::CXYZ_Export(void)
+{
+	//-----------------------------------------------------
+	// 1. Info...
+
+	Set_Name		(_TL("Export Grid to XYZ"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2003"));
+
+	Set_Description	(_TW(
+		"Export grid to a table (text format), that contains for each grid cell "
+		"the x/y-coordinates and additionally data from selected grids.\n"
+		"Optionally, it is possible to skip NoData cells from the output. In this "
+		"case, the first input grid will perform like a mask.\n\n")
+	);
+
+
+	//-----------------------------------------------------
+	// 2. Parameters...
+
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_FilePath(
+		NULL	, "FILENAME"	, _TL("File Name"),
+		_TL(""),
+		CSG_String::Format(
+			SG_T("%s|*.xyz|%s|*.txt|%s|*.*"),
+			_TL("XYZ files (*.xyz)"),
+			_TL("Text files (*.txt)"),
+			_TL("All Files")
+		), NULL, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CAPTION"		, _TL("Write Field Names"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "EX_NODATA"	, _TL("Exclude NoData Cells"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+//---------------------------------------------------------
+CXYZ_Export::~CXYZ_Export(void)
+{}
+
+
+//---------------------------------------------------------
+bool CXYZ_Export::On_Execute(void)
+{
+	bool					bExNoData;
+	int						x, y, i;
+	TSG_Point				p;
+	CSG_File				Stream;
+	CSG_String				FileName;
+	CSG_Parameter_Grid_List	*pGrids;
+
+	pGrids		= Parameters("GRIDS")	->asGridList();
+	FileName	= Parameters("FILENAME")->asString();
+	bExNoData	= Parameters("EX_NODATA")->asBool();
+
+	if( pGrids->Get_Count() > 0 && Stream.Open(FileName, SG_FILE_W, false) )
+	{
+		if( Parameters("CAPTION")->asBool() )
+		{
+			Stream.Printf(SG_T("\"X\"\t\"Y\""));
+
+			for(i=0; i<pGrids->Get_Count(); i++)
+			{
+				Stream.Printf(SG_T("\t\"%s\""), pGrids->asGrid(i)->Get_Name());
+			}
+
+			Stream.Printf(SG_T("\n"));
+		}
+
+		for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
+		{
+			for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
+			{
+				if( !bExNoData || (bExNoData && !pGrids->asGrid(0)->is_NoData(x, y)) )
+				{
+					Stream.Printf(SG_T("%f\t%f"), p.x,  p.y);
+
+					for(i=0; i<pGrids->Get_Count(); i++)
+					{
+						Stream.Printf(SG_T("\t%f"), pGrids->asGrid(i)->asDouble(x, y));
+					}
+
+					Stream.Printf(SG_T("\n"));
+				}
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CXYZ_Import::CXYZ_Import(void)
+{
+	//-----------------------------------------------------
+	// 1. Info...
+
+	Set_Name		(_TL("Import Grid from XYZ"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2009"));
+
+	Set_Description	(_TW(
+		"Import grid from a table (text format), that contains for each grid cell "
+		"the x/y/z-coordinates and additional data from selected grids.\n"
+	));
+
+
+	//-----------------------------------------------------
+	// 2. Parameters...
+
+	Parameters.Add_Grid_Output(
+		NULL	, "GRID"		, _TL("Grid"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "COUNT"		, _TL("Count"),
+		_TL("")
+	);
+
+	Parameters.Add_FilePath(
+		NULL	, "FILENAME"	, _TL("File Name"),
+		_TL(""),
+		CSG_String::Format(
+			SG_T("%s|*.xyz|%s|*.txt|%s|*.*"),
+			_TL("XYZ files (*.xyz)"),
+			_TL("Text files (*.txt)"),
+			_TL("All Files")
+		), NULL, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CAPTION"		, _TL("Has Field Names"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CELLSIZE"	, _TL("Target Cellsize"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "SEPARATOR"	, _TL("Separator"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|,|;|"),
+			_TL("space"),
+			_TL("tabulator")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+bool CXYZ_Import::On_Execute(void)
+{
+	int			nx, ny, nValues, fLength;
+	double		x, y, z, xMin, yMin, xMax, yMax, Cellsize;
+	CSG_File	Stream;
+	CSG_String	FileName, sLine;
+	CSG_Grid	*pGrid, *pCount;
+
+	FileName	= Parameters("FILENAME")->asString();
+	Cellsize	= Parameters("CELLSIZE")->asDouble();
+
+	switch( Parameters("SEPARATOR")->asInt() )
+	{
+	case 0:	m_Separator	= SG_T(' ');	break;
+	case 1:	m_Separator	= SG_T('\t');	break;
+	case 2:	m_Separator	= SG_T(',');	break;
+	case 3:	m_Separator	= SG_T(';');	break;
+	}
+
+	if( Cellsize > 0.0 && Stream.Open(FileName, SG_FILE_R, false) )
+	{
+		if( Parameters("CAPTION")->asBool() )
+		{
+			Stream.Read_Line(sLine);
+		}
+
+		fLength	= Stream.Length();
+		nValues	= 0;
+		xMin	= xMax	= 0;
+		yMin	= yMax	= 0;
+
+		while( Read_Values(Stream, x, y, z) && Set_Progress(Stream.Tell(), fLength) )
+		{
+			if( nValues == 0 )
+			{
+				xMin	= xMax	= x;
+				yMin	= yMax	= y;
+			}
+			else
+			{
+				if( xMin > x )	xMin	= x;	else if( xMax < x )	xMax	= x;
+				if( yMin > y )	yMin	= y;	else if( yMax < y )	yMax	= y;
+			}
+
+			nValues++;
+		}
+
+		//-------------------------------------------------
+		if( Process_Get_Okay() && xMin < xMax && yMin < yMax )
+		{
+			nx		= 1 + (int)((xMax - xMin) / Cellsize);
+			ny		= 1 + (int)((yMax - yMin) / Cellsize);
+
+			Parameters("GRID" )->Set_Value(pGrid  = SG_Create_Grid(SG_DATATYPE_Float, nx, ny, Cellsize, xMin, yMin));
+			Parameters("COUNT")->Set_Value(pCount = SG_Create_Grid(SG_DATATYPE_Byte , nx, ny, Cellsize, xMin, yMin));
+
+			if( pGrid && pCount )
+			{
+				pGrid	->Set_Name(FileName = SG_File_Get_Name(FileName, false));
+				pCount	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), FileName.c_str(), _TL("Count")));
+
+				Stream.Seek_Start();
+
+				if( Parameters("CAPTION")->asBool() )
+				{
+					Stream.Read_Line(sLine);
+				}
+
+				while( Read_Values(Stream, x, y, z) && Set_Progress(Stream.Tell(), fLength) )
+				{
+					if( pGrid->Get_System().Get_World_to_Grid(nx, ny, x, y) )
+					{
+						pGrid ->Add_Value(nx, ny, z);
+						pCount->Add_Value(nx, ny, 1.0);
+					}
+				}
+
+				for(ny=0; ny<pGrid->Get_NY() && Set_Progress(ny, pGrid->Get_NY()); ny++)
+				{
+					for(nx=0; nx<pGrid->Get_NX(); nx++)
+					{
+						nValues	= pCount->asInt(nx, ny);
+
+						if( nValues == 0 )
+						{
+							pGrid->Set_NoData(nx, ny);
+						}
+						else if( nValues > 1 )
+						{
+							pGrid->Mul_Value(nx, ny, 1.0 / nValues);
+						}
+					}
+				}
+
+				return( true );
+			}
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline bool CXYZ_Import::Read_Values(CSG_File &Stream, double &x, double &y, double &z)
+{
+	CSG_String	sLine;
+
+	if( Stream.Read_Line(sLine) )
+	{
+		sLine.Trim();
+
+		if( sLine.asDouble(x) )
+		{
+			sLine	= sLine.AfterFirst(m_Separator);
+
+			sLine.Trim();
+
+			if( sLine.asDouble(y) )
+			{
+				sLine	= sLine.AfterFirst(m_Separator);
+
+				if( sLine.asDouble(z) )
+				{
+					return( true );
+				}
+			}
+		}
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid/xyz.h b/src/modules/io/io_grid/xyz.h
new file mode 100644
index 0000000..33b62fd
--- /dev/null
+++ b/src/modules/io/io_grid/xyz.h
@@ -0,0 +1,138 @@
+/**********************************************************
+ * Version $Id: xyz.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        Grid_IO                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                         XYZ.h                         //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__XYZ_H
+#define HEADER_INCLUDED__XYZ_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CXYZ_Export : public CSG_Module_Grid
+{
+public:
+	CXYZ_Export(void);
+	virtual ~CXYZ_Export(void);
+
+	virtual CSG_String		Get_MenuPath	(void)			{	return( _TL("R:Export") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CXYZ_Import : public CSG_Module
+{
+public:
+	CXYZ_Import(void);
+
+	virtual CSG_String		Get_MenuPath	(void)			{	return( _TL("R:Import") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	SG_Char					m_Separator;
+
+
+	bool					Read_Values		(CSG_File &Stream, double &x, double &y, double &z);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__XYZ_H
diff --git a/src/modules_io/grid/io_grid_grib2/MLB_Interface.cpp b/src/modules/io/io_grid_grib2/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid_grib2/MLB_Interface.cpp
rename to src/modules/io/io_grid_grib2/MLB_Interface.cpp
diff --git a/src/modules_io/grid/io_grid_grib2/MLB_Interface.h b/src/modules/io/io_grid_grib2/MLB_Interface.h
similarity index 100%
rename from src/modules_io/grid/io_grid_grib2/MLB_Interface.h
rename to src/modules/io/io_grid_grib2/MLB_Interface.h
diff --git a/src/modules_io/grid/io_grid_grib2/Makefile.am b/src/modules/io/io_grid_grib2/Makefile.am
similarity index 100%
rename from src/modules_io/grid/io_grid_grib2/Makefile.am
rename to src/modules/io/io_grid_grib2/Makefile.am
diff --git a/src/modules/io/io_grid_grib2/Makefile.in b/src/modules/io/io_grid_grib2/Makefile.in
new file mode 100644
index 0000000..1907831
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/Makefile.in
@@ -0,0 +1,1063 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_grid_grib2
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_grid_grib2_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_grid_grib2_la_OBJECTS = cmplxpack.lo compack.lo comunpack.lo \
+	dec_jpeg2000.lo dec_png.lo drstemplates.lo enc_jpeg2000.lo \
+	enc_png.lo g2_addfield.lo g2_addgrid.lo g2_addlocal.lo \
+	g2_create.lo g2_free.lo g2_getfld.lo g2_gribend.lo g2_info.lo \
+	g2_miss.lo g2_unpack1.lo g2_unpack2.lo g2_unpack3.lo \
+	g2_unpack4.lo g2_unpack5.lo g2_unpack6.lo g2_unpack7.lo \
+	gbits.lo getdim.lo getpoly.lo gridtemplates.lo int_power.lo \
+	jpcpack.lo jpcunpack.lo misspack.lo mkieee.lo pack_gp.lo \
+	pdstemplates.lo pngpack.lo pngunpack.lo rdieee.lo reduce.lo \
+	seekgb.lo simpack.lo simunpack.lo specpack.lo specunpack.lo \
+	grib2_import.lo MLB_Interface.lo
+libio_grid_grib2_la_OBJECTS = $(am_libio_grid_grib2_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_grid_grib2_la_SOURCES)
+DIST_SOURCES = $(libio_grid_grib2_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DUSE_JPEG2000 -DUSE_PNG
+CXX_INCS = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS)
+AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+#AM_LDFLAGS         = -fPIC -shared -avoid-version -lpq -ljasper
+AM_LDFLAGS = -fPIC -shared -avoid-version $(LOCAL_LIBS) -ljasper
+pkglib_LTLIBRARIES = libio_grid_grib2.la
+libio_grid_grib2_la_SOURCES = \
+./g2clib-1.0.4/cmplxpack.c\
+./g2clib-1.0.4/compack.c\
+./g2clib-1.0.4/comunpack.c\
+./g2clib-1.0.4/dec_jpeg2000.c\
+./g2clib-1.0.4/dec_png.c\
+./g2clib-1.0.4/drstemplates.c\
+./g2clib-1.0.4/enc_jpeg2000.c\
+./g2clib-1.0.4/enc_png.c\
+./g2clib-1.0.4/g2_addfield.c\
+./g2clib-1.0.4/g2_addgrid.c\
+./g2clib-1.0.4/g2_addlocal.c\
+./g2clib-1.0.4/g2_create.c\
+./g2clib-1.0.4/g2_free.c\
+./g2clib-1.0.4/g2_getfld.c\
+./g2clib-1.0.4/g2_gribend.c\
+./g2clib-1.0.4/g2_info.c\
+./g2clib-1.0.4/g2_miss.c\
+./g2clib-1.0.4/g2_unpack1.c\
+./g2clib-1.0.4/g2_unpack2.c\
+./g2clib-1.0.4/g2_unpack3.c\
+./g2clib-1.0.4/g2_unpack4.c\
+./g2clib-1.0.4/g2_unpack5.c\
+./g2clib-1.0.4/g2_unpack6.c\
+./g2clib-1.0.4/g2_unpack7.c\
+./g2clib-1.0.4/gbits.c\
+./g2clib-1.0.4/getdim.c\
+./g2clib-1.0.4/getpoly.c\
+./g2clib-1.0.4/gridtemplates.c\
+./g2clib-1.0.4/int_power.c\
+./g2clib-1.0.4/jpcpack.c\
+./g2clib-1.0.4/jpcunpack.c\
+./g2clib-1.0.4/misspack.c\
+./g2clib-1.0.4/mkieee.c\
+./g2clib-1.0.4/pack_gp.c\
+./g2clib-1.0.4/pdstemplates.c\
+./g2clib-1.0.4/pngpack.c\
+./g2clib-1.0.4/pngunpack.c\
+./g2clib-1.0.4/rdieee.c\
+./g2clib-1.0.4/reduce.c\
+./g2clib-1.0.4/seekgb.c\
+./g2clib-1.0.4/simpack.c\
+./g2clib-1.0.4/simunpack.c\
+./g2clib-1.0.4/specpack.c\
+./g2clib-1.0.4/specunpack.c\
+./g2clib-1.0.4/drstemplates.h\
+./g2clib-1.0.4/grib2.h\
+./g2clib-1.0.4/gridtemplates.h\
+./g2clib-1.0.4/pdstemplates.h\
+grib2_import.cpp\
+MLB_Interface.cpp\
+grib2_import.h\
+MLB_Interface.h
+
+libio_grid_grib2_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_grid_grib2/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_grid_grib2/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_grid_grib2.la: $(libio_grid_grib2_la_OBJECTS) $(libio_grid_grib2_la_DEPENDENCIES) $(EXTRA_libio_grid_grib2_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_grid_grib2_la_OBJECTS) $(libio_grid_grib2_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cmplxpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/compack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/comunpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dec_jpeg2000.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dec_png.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/drstemplates.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/enc_jpeg2000.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/enc_png.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_addfield.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_addgrid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_addlocal.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_create.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_free.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_getfld.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_gribend.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_info.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_miss.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack1.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack3.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack4.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack5.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack6.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack7.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gbits.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getdim.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getpoly.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grib2_import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gridtemplates.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/int_power.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jpcpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jpcunpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/misspack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mkieee.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pack_gp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pdstemplates.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pngpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pngunpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rdieee.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/reduce.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seekgb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/simpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/simunpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/specpack.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/specunpack.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+cmplxpack.lo: ./g2clib-1.0.4/cmplxpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmplxpack.lo -MD -MP -MF $(DEPDIR)/cmplxpack.Tpo -c -o cmplxpack.lo `test -f './g2clib-1.0.4/cmplxpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/cmplxpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cmplxpack.Tpo $(DEPDIR)/cmplxpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/cmplxpack.c' object='cmplxpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cmplxpack.lo `test -f './g2clib-1.0.4/cmplxpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/cmplxpack.c
+
+compack.lo: ./g2clib-1.0.4/compack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compack.lo -MD -MP -MF $(DEPDIR)/compack.Tpo -c -o compack.lo `test -f './g2clib-1.0.4/compack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/compack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/compack.Tpo $(DEPDIR)/compack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/compack.c' object='compack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compack.lo `test -f './g2clib-1.0.4/compack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/compack.c
+
+comunpack.lo: ./g2clib-1.0.4/comunpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT comunpack.lo -MD -MP -MF $(DEPDIR)/comunpack.Tpo -c -o comunpack.lo `test -f './g2clib-1.0.4/comunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/comunpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/comunpack.Tpo $(DEPDIR)/comunpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/comunpack.c' object='comunpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o comunpack.lo `test -f './g2clib-1.0.4/comunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/comunpack.c
+
+dec_jpeg2000.lo: ./g2clib-1.0.4/dec_jpeg2000.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_jpeg2000.lo -MD -MP -MF $(DEPDIR)/dec_jpeg2000.Tpo -c -o dec_jpeg2000.lo `test -f './g2clib-1.0.4/dec_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_jpeg2000.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dec_jpeg2000.Tpo $(DEPDIR)/dec_jpeg2000.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/dec_jpeg2000.c' object='dec_jpeg2000.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_jpeg2000.lo `test -f './g2clib-1.0.4/dec_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_jpeg2000.c
+
+dec_png.lo: ./g2clib-1.0.4/dec_png.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_png.lo -MD -MP -MF $(DEPDIR)/dec_png.Tpo -c -o dec_png.lo `test -f './g2clib-1.0.4/dec_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_png.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dec_png.Tpo $(DEPDIR)/dec_png.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/dec_png.c' object='dec_png.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_png.lo `test -f './g2clib-1.0.4/dec_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_png.c
+
+drstemplates.lo: ./g2clib-1.0.4/drstemplates.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT drstemplates.lo -MD -MP -MF $(DEPDIR)/drstemplates.Tpo -c -o drstemplates.lo `test -f './g2clib-1.0.4/drstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/drstemplates.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/drstemplates.Tpo $(DEPDIR)/drstemplates.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/drstemplates.c' object='drstemplates.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drstemplates.lo `test -f './g2clib-1.0.4/drstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/drstemplates.c
+
+enc_jpeg2000.lo: ./g2clib-1.0.4/enc_jpeg2000.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_jpeg2000.lo -MD -MP -MF $(DEPDIR)/enc_jpeg2000.Tpo -c -o enc_jpeg2000.lo `test -f './g2clib-1.0.4/enc_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_jpeg2000.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/enc_jpeg2000.Tpo $(DEPDIR)/enc_jpeg2000.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/enc_jpeg2000.c' object='enc_jpeg2000.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_jpeg2000.lo `test -f './g2clib-1.0.4/enc_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_jpeg2000.c
+
+enc_png.lo: ./g2clib-1.0.4/enc_png.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_png.lo -MD -MP -MF $(DEPDIR)/enc_png.Tpo -c -o enc_png.lo `test -f './g2clib-1.0.4/enc_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_png.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/enc_png.Tpo $(DEPDIR)/enc_png.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/enc_png.c' object='enc_png.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_png.lo `test -f './g2clib-1.0.4/enc_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_png.c
+
+g2_addfield.lo: ./g2clib-1.0.4/g2_addfield.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addfield.lo -MD -MP -MF $(DEPDIR)/g2_addfield.Tpo -c -o g2_addfield.lo `test -f './g2clib-1.0.4/g2_addfield.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addfield.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_addfield.Tpo $(DEPDIR)/g2_addfield.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_addfield.c' object='g2_addfield.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addfield.lo `test -f './g2clib-1.0.4/g2_addfield.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addfield.c
+
+g2_addgrid.lo: ./g2clib-1.0.4/g2_addgrid.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addgrid.lo -MD -MP -MF $(DEPDIR)/g2_addgrid.Tpo -c -o g2_addgrid.lo `test -f './g2clib-1.0.4/g2_addgrid.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addgrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_addgrid.Tpo $(DEPDIR)/g2_addgrid.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_addgrid.c' object='g2_addgrid.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addgrid.lo `test -f './g2clib-1.0.4/g2_addgrid.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addgrid.c
+
+g2_addlocal.lo: ./g2clib-1.0.4/g2_addlocal.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addlocal.lo -MD -MP -MF $(DEPDIR)/g2_addlocal.Tpo -c -o g2_addlocal.lo `test -f './g2clib-1.0.4/g2_addlocal.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addlocal.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_addlocal.Tpo $(DEPDIR)/g2_addlocal.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_addlocal.c' object='g2_addlocal.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addlocal.lo `test -f './g2clib-1.0.4/g2_addlocal.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addlocal.c
+
+g2_create.lo: ./g2clib-1.0.4/g2_create.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_create.lo -MD -MP -MF $(DEPDIR)/g2_create.Tpo -c -o g2_create.lo `test -f './g2clib-1.0.4/g2_create.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_create.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_create.Tpo $(DEPDIR)/g2_create.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_create.c' object='g2_create.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_create.lo `test -f './g2clib-1.0.4/g2_create.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_create.c
+
+g2_free.lo: ./g2clib-1.0.4/g2_free.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_free.lo -MD -MP -MF $(DEPDIR)/g2_free.Tpo -c -o g2_free.lo `test -f './g2clib-1.0.4/g2_free.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_free.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_free.Tpo $(DEPDIR)/g2_free.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_free.c' object='g2_free.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_free.lo `test -f './g2clib-1.0.4/g2_free.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_free.c
+
+g2_getfld.lo: ./g2clib-1.0.4/g2_getfld.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_getfld.lo -MD -MP -MF $(DEPDIR)/g2_getfld.Tpo -c -o g2_getfld.lo `test -f './g2clib-1.0.4/g2_getfld.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_getfld.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_getfld.Tpo $(DEPDIR)/g2_getfld.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_getfld.c' object='g2_getfld.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_getfld.lo `test -f './g2clib-1.0.4/g2_getfld.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_getfld.c
+
+g2_gribend.lo: ./g2clib-1.0.4/g2_gribend.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_gribend.lo -MD -MP -MF $(DEPDIR)/g2_gribend.Tpo -c -o g2_gribend.lo `test -f './g2clib-1.0.4/g2_gribend.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_gribend.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_gribend.Tpo $(DEPDIR)/g2_gribend.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_gribend.c' object='g2_gribend.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_gribend.lo `test -f './g2clib-1.0.4/g2_gribend.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_gribend.c
+
+g2_info.lo: ./g2clib-1.0.4/g2_info.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_info.lo -MD -MP -MF $(DEPDIR)/g2_info.Tpo -c -o g2_info.lo `test -f './g2clib-1.0.4/g2_info.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_info.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_info.Tpo $(DEPDIR)/g2_info.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_info.c' object='g2_info.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_info.lo `test -f './g2clib-1.0.4/g2_info.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_info.c
+
+g2_miss.lo: ./g2clib-1.0.4/g2_miss.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_miss.lo -MD -MP -MF $(DEPDIR)/g2_miss.Tpo -c -o g2_miss.lo `test -f './g2clib-1.0.4/g2_miss.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_miss.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_miss.Tpo $(DEPDIR)/g2_miss.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_miss.c' object='g2_miss.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_miss.lo `test -f './g2clib-1.0.4/g2_miss.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_miss.c
+
+g2_unpack1.lo: ./g2clib-1.0.4/g2_unpack1.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack1.lo -MD -MP -MF $(DEPDIR)/g2_unpack1.Tpo -c -o g2_unpack1.lo `test -f './g2clib-1.0.4/g2_unpack1.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack1.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack1.Tpo $(DEPDIR)/g2_unpack1.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack1.c' object='g2_unpack1.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack1.lo `test -f './g2clib-1.0.4/g2_unpack1.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack1.c
+
+g2_unpack2.lo: ./g2clib-1.0.4/g2_unpack2.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack2.lo -MD -MP -MF $(DEPDIR)/g2_unpack2.Tpo -c -o g2_unpack2.lo `test -f './g2clib-1.0.4/g2_unpack2.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack2.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack2.Tpo $(DEPDIR)/g2_unpack2.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack2.c' object='g2_unpack2.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack2.lo `test -f './g2clib-1.0.4/g2_unpack2.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack2.c
+
+g2_unpack3.lo: ./g2clib-1.0.4/g2_unpack3.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack3.lo -MD -MP -MF $(DEPDIR)/g2_unpack3.Tpo -c -o g2_unpack3.lo `test -f './g2clib-1.0.4/g2_unpack3.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack3.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack3.Tpo $(DEPDIR)/g2_unpack3.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack3.c' object='g2_unpack3.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack3.lo `test -f './g2clib-1.0.4/g2_unpack3.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack3.c
+
+g2_unpack4.lo: ./g2clib-1.0.4/g2_unpack4.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack4.lo -MD -MP -MF $(DEPDIR)/g2_unpack4.Tpo -c -o g2_unpack4.lo `test -f './g2clib-1.0.4/g2_unpack4.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack4.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack4.Tpo $(DEPDIR)/g2_unpack4.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack4.c' object='g2_unpack4.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack4.lo `test -f './g2clib-1.0.4/g2_unpack4.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack4.c
+
+g2_unpack5.lo: ./g2clib-1.0.4/g2_unpack5.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack5.lo -MD -MP -MF $(DEPDIR)/g2_unpack5.Tpo -c -o g2_unpack5.lo `test -f './g2clib-1.0.4/g2_unpack5.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack5.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack5.Tpo $(DEPDIR)/g2_unpack5.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack5.c' object='g2_unpack5.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack5.lo `test -f './g2clib-1.0.4/g2_unpack5.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack5.c
+
+g2_unpack6.lo: ./g2clib-1.0.4/g2_unpack6.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack6.lo -MD -MP -MF $(DEPDIR)/g2_unpack6.Tpo -c -o g2_unpack6.lo `test -f './g2clib-1.0.4/g2_unpack6.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack6.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack6.Tpo $(DEPDIR)/g2_unpack6.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack6.c' object='g2_unpack6.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack6.lo `test -f './g2clib-1.0.4/g2_unpack6.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack6.c
+
+g2_unpack7.lo: ./g2clib-1.0.4/g2_unpack7.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack7.lo -MD -MP -MF $(DEPDIR)/g2_unpack7.Tpo -c -o g2_unpack7.lo `test -f './g2clib-1.0.4/g2_unpack7.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack7.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack7.Tpo $(DEPDIR)/g2_unpack7.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack7.c' object='g2_unpack7.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack7.lo `test -f './g2clib-1.0.4/g2_unpack7.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack7.c
+
+gbits.lo: ./g2clib-1.0.4/gbits.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gbits.lo -MD -MP -MF $(DEPDIR)/gbits.Tpo -c -o gbits.lo `test -f './g2clib-1.0.4/gbits.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gbits.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/gbits.Tpo $(DEPDIR)/gbits.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/gbits.c' object='gbits.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gbits.lo `test -f './g2clib-1.0.4/gbits.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gbits.c
+
+getdim.lo: ./g2clib-1.0.4/getdim.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getdim.lo -MD -MP -MF $(DEPDIR)/getdim.Tpo -c -o getdim.lo `test -f './g2clib-1.0.4/getdim.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getdim.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/getdim.Tpo $(DEPDIR)/getdim.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/getdim.c' object='getdim.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getdim.lo `test -f './g2clib-1.0.4/getdim.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getdim.c
+
+getpoly.lo: ./g2clib-1.0.4/getpoly.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getpoly.lo -MD -MP -MF $(DEPDIR)/getpoly.Tpo -c -o getpoly.lo `test -f './g2clib-1.0.4/getpoly.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getpoly.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/getpoly.Tpo $(DEPDIR)/getpoly.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/getpoly.c' object='getpoly.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getpoly.lo `test -f './g2clib-1.0.4/getpoly.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getpoly.c
+
+gridtemplates.lo: ./g2clib-1.0.4/gridtemplates.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gridtemplates.lo -MD -MP -MF $(DEPDIR)/gridtemplates.Tpo -c -o gridtemplates.lo `test -f './g2clib-1.0.4/gridtemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gridtemplates.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/gridtemplates.Tpo $(DEPDIR)/gridtemplates.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/gridtemplates.c' object='gridtemplates.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gridtemplates.lo `test -f './g2clib-1.0.4/gridtemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gridtemplates.c
+
+int_power.lo: ./g2clib-1.0.4/int_power.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT int_power.lo -MD -MP -MF $(DEPDIR)/int_power.Tpo -c -o int_power.lo `test -f './g2clib-1.0.4/int_power.c' || echo '$(srcdir)/'`./g2clib-1.0.4/int_power.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/int_power.Tpo $(DEPDIR)/int_power.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/int_power.c' object='int_power.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o int_power.lo `test -f './g2clib-1.0.4/int_power.c' || echo '$(srcdir)/'`./g2clib-1.0.4/int_power.c
+
+jpcpack.lo: ./g2clib-1.0.4/jpcpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT jpcpack.lo -MD -MP -MF $(DEPDIR)/jpcpack.Tpo -c -o jpcpack.lo `test -f './g2clib-1.0.4/jpcpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/jpcpack.Tpo $(DEPDIR)/jpcpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/jpcpack.c' object='jpcpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o jpcpack.lo `test -f './g2clib-1.0.4/jpcpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcpack.c
+
+jpcunpack.lo: ./g2clib-1.0.4/jpcunpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT jpcunpack.lo -MD -MP -MF $(DEPDIR)/jpcunpack.Tpo -c -o jpcunpack.lo `test -f './g2clib-1.0.4/jpcunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcunpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/jpcunpack.Tpo $(DEPDIR)/jpcunpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/jpcunpack.c' object='jpcunpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o jpcunpack.lo `test -f './g2clib-1.0.4/jpcunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcunpack.c
+
+misspack.lo: ./g2clib-1.0.4/misspack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misspack.lo -MD -MP -MF $(DEPDIR)/misspack.Tpo -c -o misspack.lo `test -f './g2clib-1.0.4/misspack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/misspack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/misspack.Tpo $(DEPDIR)/misspack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/misspack.c' object='misspack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misspack.lo `test -f './g2clib-1.0.4/misspack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/misspack.c
+
+mkieee.lo: ./g2clib-1.0.4/mkieee.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mkieee.lo -MD -MP -MF $(DEPDIR)/mkieee.Tpo -c -o mkieee.lo `test -f './g2clib-1.0.4/mkieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/mkieee.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mkieee.Tpo $(DEPDIR)/mkieee.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/mkieee.c' object='mkieee.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mkieee.lo `test -f './g2clib-1.0.4/mkieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/mkieee.c
+
+pack_gp.lo: ./g2clib-1.0.4/pack_gp.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_gp.lo -MD -MP -MF $(DEPDIR)/pack_gp.Tpo -c -o pack_gp.lo `test -f './g2clib-1.0.4/pack_gp.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pack_gp.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pack_gp.Tpo $(DEPDIR)/pack_gp.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pack_gp.c' object='pack_gp.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_gp.lo `test -f './g2clib-1.0.4/pack_gp.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pack_gp.c
+
+pdstemplates.lo: ./g2clib-1.0.4/pdstemplates.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pdstemplates.lo -MD -MP -MF $(DEPDIR)/pdstemplates.Tpo -c -o pdstemplates.lo `test -f './g2clib-1.0.4/pdstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pdstemplates.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pdstemplates.Tpo $(DEPDIR)/pdstemplates.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pdstemplates.c' object='pdstemplates.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pdstemplates.lo `test -f './g2clib-1.0.4/pdstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pdstemplates.c
+
+pngpack.lo: ./g2clib-1.0.4/pngpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngpack.lo -MD -MP -MF $(DEPDIR)/pngpack.Tpo -c -o pngpack.lo `test -f './g2clib-1.0.4/pngpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pngpack.Tpo $(DEPDIR)/pngpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pngpack.c' object='pngpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngpack.lo `test -f './g2clib-1.0.4/pngpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngpack.c
+
+pngunpack.lo: ./g2clib-1.0.4/pngunpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngunpack.lo -MD -MP -MF $(DEPDIR)/pngunpack.Tpo -c -o pngunpack.lo `test -f './g2clib-1.0.4/pngunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngunpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pngunpack.Tpo $(DEPDIR)/pngunpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pngunpack.c' object='pngunpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngunpack.lo `test -f './g2clib-1.0.4/pngunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngunpack.c
+
+rdieee.lo: ./g2clib-1.0.4/rdieee.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdieee.lo -MD -MP -MF $(DEPDIR)/rdieee.Tpo -c -o rdieee.lo `test -f './g2clib-1.0.4/rdieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/rdieee.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rdieee.Tpo $(DEPDIR)/rdieee.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/rdieee.c' object='rdieee.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdieee.lo `test -f './g2clib-1.0.4/rdieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/rdieee.c
+
+reduce.lo: ./g2clib-1.0.4/reduce.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reduce.lo -MD -MP -MF $(DEPDIR)/reduce.Tpo -c -o reduce.lo `test -f './g2clib-1.0.4/reduce.c' || echo '$(srcdir)/'`./g2clib-1.0.4/reduce.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/reduce.Tpo $(DEPDIR)/reduce.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/reduce.c' object='reduce.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reduce.lo `test -f './g2clib-1.0.4/reduce.c' || echo '$(srcdir)/'`./g2clib-1.0.4/reduce.c
+
+seekgb.lo: ./g2clib-1.0.4/seekgb.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seekgb.lo -MD -MP -MF $(DEPDIR)/seekgb.Tpo -c -o seekgb.lo `test -f './g2clib-1.0.4/seekgb.c' || echo '$(srcdir)/'`./g2clib-1.0.4/seekgb.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/seekgb.Tpo $(DEPDIR)/seekgb.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/seekgb.c' object='seekgb.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seekgb.lo `test -f './g2clib-1.0.4/seekgb.c' || echo '$(srcdir)/'`./g2clib-1.0.4/seekgb.c
+
+simpack.lo: ./g2clib-1.0.4/simpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT simpack.lo -MD -MP -MF $(DEPDIR)/simpack.Tpo -c -o simpack.lo `test -f './g2clib-1.0.4/simpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/simpack.Tpo $(DEPDIR)/simpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/simpack.c' object='simpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o simpack.lo `test -f './g2clib-1.0.4/simpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simpack.c
+
+simunpack.lo: ./g2clib-1.0.4/simunpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT simunpack.lo -MD -MP -MF $(DEPDIR)/simunpack.Tpo -c -o simunpack.lo `test -f './g2clib-1.0.4/simunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simunpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/simunpack.Tpo $(DEPDIR)/simunpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/simunpack.c' object='simunpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o simunpack.lo `test -f './g2clib-1.0.4/simunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simunpack.c
+
+specpack.lo: ./g2clib-1.0.4/specpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT specpack.lo -MD -MP -MF $(DEPDIR)/specpack.Tpo -c -o specpack.lo `test -f './g2clib-1.0.4/specpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/specpack.Tpo $(DEPDIR)/specpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/specpack.c' object='specpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o specpack.lo `test -f './g2clib-1.0.4/specpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specpack.c
+
+specunpack.lo: ./g2clib-1.0.4/specunpack.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT specunpack.lo -MD -MP -MF $(DEPDIR)/specunpack.Tpo -c -o specunpack.lo `test -f './g2clib-1.0.4/specunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specunpack.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/specunpack.Tpo $(DEPDIR)/specunpack.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/specunpack.c' object='specunpack.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o specunpack.lo `test -f './g2clib-1.0.4/specunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specunpack.c
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/cmplxpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/cmplxpack.c
new file mode 100644
index 0000000..cea6e11
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/cmplxpack.c
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: cmplxpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include "grib2.h"
+
+void cmplxpack(g2float *fld,g2int ndpts, g2int idrsnum,g2int *idrstmpl,
+               unsigned char *cpack, g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    cmplxpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2004-08-27
+//
+// ABSTRACT: This subroutine packs up a data field using a complex
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//   It also fills in GRIB2 Data Representation Template 5.2 or 5.3 
+//   with the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2004-08-27  Gilbert
+//
+// USAGE:    cmplxpack(g2float *fld,g2int ndpts, g2int idrsnum,g2int *idrstmpl,
+//             unsigned char *cpack, g2int *lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.2 or 5.3
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                    .
+//                    .
+//                [6] = Missing value management
+//                [7] = Primary missing value
+//                [8] = Secondary missing value
+//                    .
+//                    .
+//               [16] = Order of Spatial Differencing  ( 1 or 2 )
+//                    .
+//                    .
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.3
+//                [0] = Reference value - set by compack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                    .
+//                    .
+//     cpack    - The packed data field (character*1 array)
+//     lcpack   - length of packed field cpack[].
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+      
+
+      if ( idrstmpl[6] == 0 ) {       // No internal missing values
+         compack(fld,ndpts,idrsnum,idrstmpl,cpack,lcpack);
+      }
+      else if ( idrstmpl[6] == 1  ||  idrstmpl[6] == 2) {
+         misspack(fld,ndpts,idrsnum,idrstmpl,cpack,lcpack);
+      }
+      else {
+         printf("cmplxpack: Don:t recognize Missing value option.");
+         *lcpack=-1;
+      }
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/compack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/compack.c
new file mode 100644
index 0000000..841323a
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/compack.c
@@ -0,0 +1,419 @@
+/**********************************************************
+ * Version $Id: compack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void compack(g2float *fld,g2int ndpts,g2int idrsnum,g2int *idrstmpl,
+             unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    compack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-11-07
+//
+// ABSTRACT: This subroutine packs up a data field using a complex
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//   It also fills in GRIB2 Data Representation Template 5.2 or 5.3 
+//   with the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-07  Gilbert
+//
+// USAGE:    void compack(g2float *fld,g2int ndpts,g2int idrsnum,
+//                g2int *idrstmpl,unsigned char *cpack,g2int *lcpack)
+//
+//   INPUT ARGUMENTS:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.2 or 5.3
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                    .
+//                    .
+//                [6] = Missing value management
+//                [7] = Primary missing value
+//                [8] = Secondary missing value
+//                    .
+//                    .
+//               [16] = Order of Spatial Differencing  ( 1 or 2 )
+//                    .
+//                    .
+//
+//   OUTPUT ARGUMENTS: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.3
+//                [0] = Reference value - set by compack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                    .
+//                    .
+//     cpack    - The packed data field
+//     lcpack   - length of packed field cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+{
+
+      static g2int zero=0;
+      g2int  *ifld,*gref,*glen,*gwidth;
+      g2int  *jmin, *jmax, *lbit;
+      g2int  i,j,n,nbits,imin,imax,left;
+      g2int  isd,itemp,ilmax,ngwidthref=0,nbitsgwidth=0;
+      g2int  nglenref=0,nglenlast=0,iofst,ival1,ival2;
+      g2int  minsd,nbitsd=0,maxorig,nbitorig,ngroups;
+      g2int  lg,ng,igmax,iwmax,nbitsgref;
+      g2int  glength,grpwidth,nbitsglen=0;
+      g2int  kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
+      g2int  missopt, miss1, miss2, ier;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      static g2int simple_alg = 0;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      static g2int one=1;
+
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if (rmin != rmax) {
+        iofst=0;
+        ifld=calloc(ndpts,sizeof(g2int));
+        gref=calloc(ndpts,sizeof(g2int));
+        gwidth=calloc(ndpts,sizeof(g2int));
+        glen=calloc(ndpts,sizeof(g2int));
+        //
+        //  Scale original data
+        //
+        if (idrstmpl[1] == 0) {        //  No binary scaling
+           imin=(g2int)rint(rmin*dscale);
+           //imax=(g2int)rint(rmax*dscale);
+           rmin=(g2float)imin;
+           for (j=0;j<ndpts;j++) 
+              ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else {                             //  Use binary scaling factor
+           rmin=rmin*dscale;
+           //rmax=rmax*dscale;
+           for (j=0;j<ndpts;j++) 
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Calculate Spatial differences, if using DRS Template 5.3
+        //
+        if (idrsnum == 3) {        // spatial differences
+           if (idrstmpl[16]!=1 && idrstmpl[16]!=2) idrstmpl[16]=1;
+           if (idrstmpl[16] == 1) {      // first order
+              ival1=ifld[0];
+              for (j=ndpts-1;j>0;j--) 
+                 ifld[j]=ifld[j]-ifld[j-1];
+              ifld[0]=0;
+           }
+           else if (idrstmpl[16] == 2) {      // second order
+              ival1=ifld[0];
+              ival2=ifld[1];
+              for (j=ndpts-1;j>1;j--) 
+                 ifld[j]=ifld[j]-(2*ifld[j-1])+ifld[j-2];
+              ifld[0]=0;
+              ifld[1]=0;
+           }
+           //
+           //  subtract min value from spatial diff field
+           //
+           isd=idrstmpl[16];
+           minsd=ifld[isd];
+           for (j=isd;j<ndpts;j++)  if ( ifld[j] < minsd ) minsd=ifld[j];
+           for (j=isd;j<ndpts;j++)  ifld[j]=ifld[j]-minsd;
+           //
+           //   find num of bits need to store minsd and add 1 extra bit
+           //   to indicate sign
+           //
+           temp=log((double)(abs(minsd)+1))/alog2;
+           nbitsd=(g2int)ceil(temp)+1;
+           //
+           //   find num of bits need to store ifld[0] ( and ifld[1]
+           //   if using 2nd order differencing )
+           //
+           maxorig=ival1;
+           if (idrstmpl[16]==2 && ival2>ival1) maxorig=ival2;
+           temp=log((double)(maxorig+1))/alog2;
+           nbitorig=(g2int)ceil(temp)+1;
+           if (nbitorig > nbitsd) nbitsd=nbitorig;
+           //   increase number of bits to even multiple of 8 ( octet )
+           if ( (nbitsd%8) != 0) nbitsd=nbitsd+(8-(nbitsd%8));
+           //
+           //  Store extra spatial differencing info into the packed
+           //  data section.
+           //
+           if (nbitsd != 0) {
+              //   pack first original value
+              if (ival1 >= 0) {
+                 sbit(cpack,&ival1,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(ival1);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+              if (idrstmpl[16] == 2) {
+               //  pack second original value
+                 if (ival2 >= 0) {
+                    sbit(cpack,&ival2,iofst,nbitsd);
+                    iofst=iofst+nbitsd;
+                 }
+                 else {
+                    sbit(cpack,&one,iofst,1);
+                    iofst=iofst+1;
+                    itemp=abs(ival2);
+                    sbit(cpack,&itemp,iofst,nbitsd-1);
+                    iofst=iofst+nbitsd-1;
+                 }
+              }
+              //  pack overall min of spatial differences
+              if (minsd >= 0) {
+                 sbit(cpack,&minsd,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(minsd);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+           }
+           //printf("SDp %ld %ld %ld %ld\n",ival1,ival2,minsd,nbitsd);
+        }     //  end of spatial diff section
+        //
+        //   Determine Groups to be used.
+        //
+        if ( simple_alg == 1 ) {
+           //  set group length to 10;  calculate number of groups
+           //  and length of last group
+           ngroups=ndpts/10;
+           for (j=0;j<ngroups;j++) glen[j]=10;
+           itemp=ndpts%10;
+           if (itemp != 0) {
+              ngroups=ngroups+1;
+              glen[ngroups-1]=itemp;
+           }
+        }
+        else {
+           // Use Dr. Glahn's algorithm for determining grouping.
+           //
+           kfildo=6;
+           minpk=10;
+           inc=1;
+           maxgrps=(ndpts/minpk)+1;
+           jmin = calloc(maxgrps,sizeof(g2int));
+           jmax = calloc(maxgrps,sizeof(g2int));
+           lbit = calloc(maxgrps,sizeof(g2int));
+           missopt=0;
+           pack_gp(&kfildo,ifld,&ndpts,&missopt,&minpk,&inc,&miss1,&miss2,
+                        jmin,jmax,lbit,glen,&maxgrps,&ngroups,&ibit,&jbit,
+                        &kbit,&novref,&lbitref,&ier);
+           //print *,'SAGier = ',ier,ibit,jbit,kbit,novref,lbitref
+           for ( ng=0; ng<ngroups; ng++) glen[ng]=glen[ng]+novref;
+           free(jmin);
+           free(jmax);
+           free(lbit);
+        }
+        //  
+        //  For each group, find the group's reference value
+        //  and the number of bits needed to hold the remaining values
+        //
+        n=0;
+        for (ng=0;ng<ngroups;ng++) {
+           //    find max and min values of group
+           gref[ng]=ifld[n];
+           imax=ifld[n];
+           j=n+1;
+           for (lg=1;lg<glen[ng];lg++) {
+              if (ifld[j] < gref[ng]) gref[ng]=ifld[j]; 
+              if (ifld[j] > imax) imax=ifld[j];
+              j++;
+           }
+           //   calc num of bits needed to hold data
+           if ( gref[ng] != imax ) {
+              temp=log((double)(imax-gref[ng]+1))/alog2;
+              gwidth[ng]=(g2int)ceil(temp);
+           }
+           else 
+              gwidth[ng]=0;
+           //   Subtract min from data
+           j=n;
+           for (lg=0;lg<glen[ng];lg++) {
+              ifld[j]=ifld[j]-gref[ng];
+              j++;
+           }
+           //   increment fld array counter
+           n=n+glen[ng];
+        }
+        //  
+        //  Find max of the group references and calc num of bits needed 
+        //  to pack each groups reference value, then
+        //  pack up group reference values
+        //
+        igmax=gref[0];
+        for (j=1;j<ngroups;j++) if (gref[j] > igmax) igmax=gref[j];
+        if (igmax != 0) {
+           temp=log((double)(igmax+1))/alog2;
+           nbitsgref=(g2int)ceil(temp);
+           sbits(cpack,gref,iofst,nbitsgref,0,ngroups);
+           itemp=nbitsgref*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else
+           nbitsgref=0;
+        //
+        //  Find max/min of the group widths and calc num of bits needed
+        //  to pack each groups width value, then
+        //  pack up group width values
+        //
+        iwmax=gwidth[0];
+        ngwidthref=gwidth[0];
+        for (j=1;j<ngroups;j++) {
+           if (gwidth[j] > iwmax) iwmax=gwidth[j];
+           if (gwidth[j] < ngwidthref) ngwidthref=gwidth[j];
+        }
+        if (iwmax != ngwidthref) {
+           temp=log((double)(iwmax-ngwidthref+1))/alog2;
+           nbitsgwidth=(g2int)ceil(temp);
+           for (i=0;i<ngroups;i++) 
+              gwidth[i]=gwidth[i]-ngwidthref;
+           sbits(cpack,gwidth,iofst,nbitsgwidth,0,ngroups);
+           itemp=nbitsgwidth*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsgwidth=0;
+           for (i=0;i<ngroups;i++) gwidth[i]=0;
+        }
+        //
+        //  Find max/min of the group lengths and calc num of bits needed
+        //  to pack each groups length value, then
+        //  pack up group length values
+        //
+        //write(77,*)'GLENS: ',(glen(j),j=1,ngroups)
+        ilmax=glen[0];
+        nglenref=glen[0];
+        for (j=1;j<ngroups-1;j++) {
+           if (glen[j] > ilmax) ilmax=glen[j];
+           if (glen[j] < nglenref) nglenref=glen[j];
+        }
+        nglenlast=glen[ngroups-1];
+        if (ilmax != nglenref) {
+           temp=log((double)(ilmax-nglenref+1))/alog2;
+           nbitsglen=(g2int)ceil(temp);
+           for (i=0;i<ngroups-1;i++)  glen[i]=glen[i]-nglenref;
+           sbits(cpack,glen,iofst,nbitsglen,0,ngroups);
+           itemp=nbitsglen*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsglen=0;
+           for (i=0;i<ngroups;i++) glen[i]=0;
+        }
+        //
+        //  For each group, pack data values
+        //
+        n=0;
+        for (ng=0;ng<ngroups;ng++) {
+           glength=glen[ng]+nglenref;
+           if (ng == (ngroups-1) ) glength=nglenlast;
+           grpwidth=gwidth[ng]+ngwidthref;
+           if ( grpwidth != 0 ) {
+              sbits(cpack,ifld+n,iofst,grpwidth,0,glength);
+              iofst=iofst+(grpwidth*glength);
+           }
+           n=n+glength;
+        }
+        //         Pad last octet with Zeros, if necessary,
+        if ( (iofst%8) != 0) {
+           left=8-(iofst%8);
+           sbit(cpack,&zero,iofst,left);
+           iofst=iofst+left;
+        }
+        *lcpack=iofst/8;
+        //
+        if ( ifld!=0 ) free(ifld);
+        if ( gref!=0 ) free(gref);
+        if ( gwidth!=0 ) free(gwidth);
+        if ( glen!=0 ) free(glen);
+      }
+      else {          //   Constant field ( max = min )
+        nbits=0;
+        *lcpack=0;
+        nbitsgref=0;
+        ngroups=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.2
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbitsgref;
+      idrstmpl[4]=0;         // original data were reals
+      idrstmpl[5]=1;         // general group splitting
+      idrstmpl[6]=0;         // No internal missing values
+      idrstmpl[7]=0;         // Primary missing value
+      idrstmpl[8]=0;         // secondary missing value
+      idrstmpl[9]=ngroups;          // Number of groups
+      idrstmpl[10]=ngwidthref;       // reference for group widths
+      idrstmpl[11]=nbitsgwidth;      // num bits used for group widths
+      idrstmpl[12]=nglenref;         // Reference for group lengths
+      idrstmpl[13]=1;                // length increment for group lengths
+      idrstmpl[14]=nglenlast;        // True length of last group
+      idrstmpl[15]=nbitsglen;        // num bits used for group lengths
+      if (idrsnum == 3) {
+         idrstmpl[17]=nbitsd/8;      // num bits used for extra spatial
+                                     // differencing values
+      }
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/comunpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/comunpack.c
new file mode 100644
index 0000000..27c76c6
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/comunpack.c
@@ -0,0 +1,333 @@
+/**********************************************************
+ * Version $Id: comunpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+int comunpack(unsigned char *cpack,g2int lensec,g2int idrsnum,g2int *idrstmpl,g2int ndpts,g2float *fld)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    comunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed using a
+//   complex packing algorithm as defined in the GRIB2 documention,
+//   using info from the GRIB2 Data Representation Template 5.2 or 5.3.
+//   Supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+// 2004-12-16  Gilbert  -  Added test ( provided by Arthur Taylor/MDL )
+//                         to verify that group widths and lengths are
+//                         consistent with section length.
+//
+// USAGE:    int comunpack(unsigned char *cpack,g2int lensec,g2int idrsnum,
+//                         g2int *idrstmpl, g2int ndpts,g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - pointer to the packed data field.
+//     lensec   - length of section 7 (used for error checking).
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - pointer to the array of values for Data Representation
+//                Template 5.2 or 5.3
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld      - Contains the unpacked data values.  fld must be allocated
+//                with at least ndpts*sizeof(g2float) bytes before
+//                calling this routine.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$//
+{
+
+      g2int   nbitsd=0,isign;
+      g2int  j,iofst,ival1,ival2,minsd,itemp,l,k,n,non=0;
+      g2int  *ifld,*ifldmiss=0;
+      g2int  *gref,*gwidth,*glen;
+      g2int  itype,ngroups,nbitsgref,nbitsgwidth,nbitsglen;
+      g2int  msng1,msng2;
+      g2float ref,bscale,dscale,rmiss1,rmiss2;
+      g2int totBit, totLen;
+
+      //printf('IDRSTMPL: ',(idrstmpl(j),j=1,16)
+      rdieee(idrstmpl+0,&ref,1);
+//      printf("SAGTref: %f\n",ref);
+      bscale = (g2float)int_power(2.0,idrstmpl[1]);
+      dscale = (g2float)int_power(10.0,-idrstmpl[2]);
+      nbitsgref = idrstmpl[3];
+      itype = idrstmpl[4];
+      ngroups = idrstmpl[9];
+      nbitsgwidth = idrstmpl[11];
+      nbitsglen = idrstmpl[15];
+      if (idrsnum == 3)
+         nbitsd=idrstmpl[17]*8;
+
+      //   Constant field
+
+      if (ngroups == 0) {
+         for (j=0;j<ndpts;j++) fld[j]=ref;
+         return(0);
+      }
+
+      iofst=0;
+      ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+      //printf("ALLOC ifld: %d %x\n",(int)ndpts,ifld);
+      gref=(g2int *)calloc(ngroups,sizeof(g2int));
+      //printf("ALLOC gref: %d %x\n",(int)ngroups,gref);
+      gwidth=(g2int *)calloc(ngroups,sizeof(g2int));
+      //printf("ALLOC gwidth: %d %x\n",(int)ngroups,gwidth);
+//
+//  Get missing values, if supplied
+//
+      if ( idrstmpl[6] == 1 ) {
+         if (itype == 0) 
+            rdieee(idrstmpl+7,&rmiss1,1);
+         else 
+            rmiss1=(g2float)idrstmpl[7];
+      }
+      if ( idrstmpl[6] == 2 ) {
+         if (itype == 0) {
+            rdieee(idrstmpl+7,&rmiss1,1);
+            rdieee(idrstmpl+8,&rmiss2,1);
+         }
+         else {
+            rmiss1=(g2float)idrstmpl[7];
+            rmiss2=(g2float)idrstmpl[8];
+         }
+      }
+      
+      //printf("RMISSs: %f %f %f \n",rmiss1,rmiss2,ref);
+// 
+//  Extract Spatial differencing values, if using DRS Template 5.3
+//
+      if (idrsnum == 3) {
+         if (nbitsd != 0) {
+              gbit(cpack,&isign,iofst,1);
+              iofst=iofst+1;
+              gbit(cpack,&ival1,iofst,nbitsd-1);
+              iofst=iofst+nbitsd-1;
+              if (isign == 1) ival1=-ival1;
+              if (idrstmpl[16] == 2) {
+                 gbit(cpack,&isign,iofst,1);
+                 iofst=iofst+1;
+                 gbit(cpack,&ival2,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+                 if (isign == 1) ival2=-ival2;
+              }
+              gbit(cpack,&isign,iofst,1);
+              iofst=iofst+1;
+              gbit(cpack,&minsd,iofst,nbitsd-1);
+              iofst=iofst+nbitsd-1;
+              if (isign == 1) minsd=-minsd;
+         }
+         else {
+              ival1=0;
+              ival2=0;
+              minsd=0;
+         }
+       //printf("SDu %ld %ld %ld %ld \n",ival1,ival2,minsd,nbitsd);
+      }
+//
+//  Extract Each Group's reference value
+//
+      //printf("SAG1: %ld %ld %ld \n",nbitsgref,ngroups,iofst);
+      if (nbitsgref != 0) {
+         gbits(cpack,gref+0,iofst,nbitsgref,0,ngroups);
+         itemp=nbitsgref*ngroups;
+         iofst=iofst+itemp;
+         if (itemp%8 != 0) iofst=iofst+(8-(itemp%8));
+      }
+      else {
+         for (j=0;j<ngroups;j++)
+              gref[j]=0;
+      }
+//
+//  Extract Each Group's bit width
+//
+      //printf("SAG2: %ld %ld %ld %ld \n",nbitsgwidth,ngroups,iofst,idrstmpl[10]);
+      if (nbitsgwidth != 0) {
+         gbits(cpack,gwidth+0,iofst,nbitsgwidth,0,ngroups);
+         itemp=nbitsgwidth*ngroups;
+         iofst=iofst+itemp;
+         if (itemp%8 != 0) iofst=iofst+(8-(itemp%8));
+      }
+      else {
+         for (j=0;j<ngroups;j++)
+                gwidth[j]=0;
+      }
+
+      for (j=0;j<ngroups;j++)
+          gwidth[j]=gwidth[j]+idrstmpl[10];
+      
+//
+//  Extract Each Group's length (number of values in each group)
+//
+      glen=(g2int *)calloc(ngroups,sizeof(g2int));
+      //printf("ALLOC glen: %d %x\n",(int)ngroups,glen);
+      //printf("SAG3: %ld %ld %ld %ld %ld \n",nbitsglen,ngroups,iofst,idrstmpl[13],idrstmpl[12]);
+      if (nbitsglen != 0) {
+         gbits(cpack,glen,iofst,nbitsglen,0,ngroups);
+         itemp=nbitsglen*ngroups;
+         iofst=iofst+itemp;
+         if (itemp%8 != 0) iofst=iofst+(8-(itemp%8));
+      }
+      else {
+         for (j=0;j<ngroups;j++)
+              glen[j]=0;
+      }
+      for (j=0;j<ngroups;j++) 
+           glen[j]=(glen[j]*idrstmpl[13])+idrstmpl[12];
+      glen[ngroups-1]=idrstmpl[14];
+//
+//  Test to see if the group widths and lengths are consistent with number of
+//  values, and length of section 7.
+//
+      totBit = 0;
+      totLen = 0;
+      for (j=0;j<ngroups;j++) {
+        totBit += (gwidth[j]*glen[j]);
+        totLen += glen[j];
+      }
+      if (totLen != ndpts) {
+        return 1;
+      }
+      if (totBit / 8. > lensec) {
+        return 1;
+      }
+//
+//  For each group, unpack data values
+//
+      if ( idrstmpl[6] == 0 ) {        // no missing values
+         n=0;
+         for (j=0;j<ngroups;j++) {
+           if (gwidth[j] != 0) {
+             gbits(cpack,ifld+n,iofst,gwidth[j],0,glen[j]);
+             for (k=0;k<glen[j];k++) {
+               ifld[n]=ifld[n]+gref[j];
+               n=n+1;
+             }
+           }
+           else {
+             for (l=n;l<n+glen[j];l++) ifld[l]=gref[j];
+             n=n+glen[j];
+           }
+           iofst=iofst+(gwidth[j]*glen[j]);
+         }
+      }
+      else if ( idrstmpl[6]==1 || idrstmpl[6]==2 ) {
+         // missing values included
+         ifldmiss=(g2int *)malloc(ndpts*sizeof(g2int));
+         //printf("ALLOC ifldmiss: %d %x\n",(int)ndpts,ifldmiss);
+         //for (j=0;j<ndpts;j++) ifldmiss[j]=0;
+         n=0;
+         non=0;
+         for (j=0;j<ngroups;j++) {
+           //printf(" SAGNGP %d %d %d %d\n",j,gwidth[j],glen[j],gref[j]);
+           if (gwidth[j] != 0) {
+             msng1=(g2int)int_power(2.0,gwidth[j])-1;
+             msng2=msng1-1;
+             gbits(cpack,ifld+n,iofst,gwidth[j],0,glen[j]);
+             iofst=iofst+(gwidth[j]*glen[j]);
+             for (k=0;k<glen[j];k++) {
+               if (ifld[n] == msng1) {
+                  ifldmiss[n]=1;
+                  //ifld[n]=0;
+               }
+               else if (idrstmpl[6]==2 && ifld[n]==msng2) {
+                  ifldmiss[n]=2;
+                  //ifld[n]=0;
+               }
+               else {
+                  ifldmiss[n]=0;
+                  ifld[non++]=ifld[n]+gref[j];
+               }
+               n++;
+             }
+           }
+           else {
+             msng1=(g2int)int_power(2.0,nbitsgref)-1;
+             msng2=msng1-1;
+             if (gref[j] == msng1) {
+                for (l=n;l<n+glen[j];l++) ifldmiss[l]=1;
+             }
+             else if (idrstmpl[6]==2 && gref[j]==msng2) {
+                for (l=n;l<n+glen[j];l++) ifldmiss[l]=2;
+             }
+             else {
+                for (l=n;l<n+glen[j];l++) ifldmiss[l]=0;
+                for (l=non;l<non+glen[j];l++) ifld[l]=gref[j];
+                non += glen[j];
+             }
+             n=n+glen[j];
+           }
+         }
+      }
+
+      if ( gref != 0 ) free(gref);
+      if ( gwidth != 0 ) free(gwidth);
+      if ( glen != 0 ) free(glen);
+//
+//  If using spatial differences, add overall min value, and
+//  sum up recursively
+//
+      //printf("SAGod: %ld %ld\n",idrsnum,idrstmpl[16]);
+      if (idrsnum == 3) {         // spatial differencing
+         if (idrstmpl[16] == 1) {      // first order
+            ifld[0]=ival1;
+            if ( idrstmpl[6] == 0 ) itemp=ndpts;        // no missing values
+            else  itemp=non;
+            for (n=1;n<itemp;n++) {
+               ifld[n]=ifld[n]+minsd;
+               ifld[n]=ifld[n]+ifld[n-1];
+            }
+         }
+         else if (idrstmpl[16] == 2) {    // second order
+            ifld[0]=ival1;
+            ifld[1]=ival2;
+            if ( idrstmpl[6] == 0 ) itemp=ndpts;        // no missing values
+            else  itemp=non;
+            for (n=2;n<itemp;n++) {
+               ifld[n]=ifld[n]+minsd;
+               ifld[n]=ifld[n]+(2*ifld[n-1])-ifld[n-2];
+            }
+         }
+      }
+//
+//  Scale data back to original form
+//
+      //printf("SAGT: %f %f %f\n",ref,bscale,dscale);
+      if ( idrstmpl[6] == 0 ) {        // no missing values
+         for (n=0;n<ndpts;n++) {
+            fld[n]=(((g2float)ifld[n]*bscale)+ref)*dscale;
+         }
+      }
+      else if ( idrstmpl[6]==1 || idrstmpl[6]==2 ) {
+         // missing values included
+         non=0;
+         for (n=0;n<ndpts;n++) {
+            if ( ifldmiss[n] == 0 ) {
+               fld[n]=(((g2float)ifld[non++]*bscale)+ref)*dscale;
+               //printf(" SAG %d %f %d %f %f %f\n",n,fld[n],ifld[non-1],bscale,ref,dscale);
+            }
+            else if ( ifldmiss[n] == 1 ) 
+               fld[n]=rmiss1;
+            else if ( ifldmiss[n] == 2 ) 
+               fld[n]=rmiss2;
+         }
+         if ( ifldmiss != 0 ) free(ifldmiss);
+      }
+
+      if ( ifld != 0 ) free(ifld);
+
+      return(0);
+      
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/dec_jpeg2000.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/dec_jpeg2000.c
new file mode 100644
index 0000000..9d76962
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/dec_jpeg2000.c
@@ -0,0 +1,147 @@
+/**********************************************************
+ * Version $Id: dec_jpeg2000.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef USE_JPEG2000
+#include "grib2.h"
+ int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
+ {	return( 0 );	}
+#else   /* USE_JPEG2000 */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "grib2.h"
+#include "jasper/jasper.h"
+#define JAS_1_700_2
+
+
+   int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
+/*$$$  SUBPROGRAM DOCUMENTATION BLOCK
+*                .      .    .                                       .
+* SUBPROGRAM:    dec_jpeg2000      Decodes JPEG2000 code stream
+*   PRGMMR: Gilbert          ORG: W/NP11     DATE: 2002-12-02
+*
+* ABSTRACT: This Function decodes a JPEG2000 code stream specified in the
+*   JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) using JasPer 
+*   Software version 1.500.4 (or 1.700.2) written by the University of British
+*   Columbia and Image Power Inc, and others.
+*   JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.
+*
+* PROGRAM HISTORY LOG:
+* 2002-12-02  Gilbert
+*
+* USAGE:     int dec_jpeg2000(char *injpc,g2int bufsize,g2int *outfld)
+*
+*   INPUT ARGUMENTS:
+*      injpc - Input JPEG2000 code stream.
+*    bufsize - Length (in bytes) of the input JPEG2000 code stream.
+*
+*   OUTPUT ARGUMENTS:
+*     outfld - Output matrix of grayscale image values.
+*
+*   RETURN VALUES :
+*          0 = Successful decode
+*         -3 = Error decode jpeg2000 code stream.
+*         -5 = decoded image had multiple color components.
+*              Only grayscale is expected.
+*
+* REMARKS:
+*
+*      Requires JasPer Software version 1.500.4 or 1.700.2
+*
+* ATTRIBUTES:
+*   LANGUAGE: C
+*   MACHINE:  IBM SP
+*
+*$$$*/
+
+{
+    int ier;
+    g2int i,j,k;
+    jas_image_t *image=0;
+    jas_stream_t *jpcstream;
+    jas_image_cmpt_t *pcmpt;
+    char *opts=0;
+    jas_matrix_t *data;
+
+//    jas_init();
+
+    ier=0;
+//   
+//     Create jas_stream_t containing input JPEG200 codestream in memory.
+//       
+
+    jpcstream=jas_stream_memopen(injpc,bufsize);
+
+//   
+//     Decode JPEG200 codestream into jas_image_t structure.
+//       
+    image=jpc_decode(jpcstream,opts);
+    if ( image == 0 ) {
+       printf(" jpc_decode return = %d \n",ier);
+       return -3;
+    }
+    
+    pcmpt=image->cmpts_[0];
+/*
+    printf(" SAGOUT DECODE:\n");
+    printf(" tlx %d \n",image->tlx_);
+    printf(" tly %d \n",image->tly_);
+    printf(" brx %d \n",image->brx_);
+    printf(" bry %d \n",image->bry_);
+    printf(" numcmpts %d \n",image->numcmpts_);
+    printf(" maxcmpts %d \n",image->maxcmpts_);
+#ifdef JAS_1_500_4
+    printf(" colormodel %d \n",image->colormodel_);
+#endif
+#ifdef JAS_1_700_2
+    printf(" colorspace %d \n",image->clrspc_);
+#endif
+    printf(" inmem %d \n",image->inmem_);
+    printf(" COMPONENT:\n");
+    printf(" tlx %d \n",pcmpt->tlx_);
+    printf(" tly %d \n",pcmpt->tly_);
+    printf(" hstep %d \n",pcmpt->hstep_);
+    printf(" vstep %d \n",pcmpt->vstep_);
+    printf(" width %d \n",pcmpt->width_);
+    printf(" height %d \n",pcmpt->height_);
+    printf(" prec %d \n",pcmpt->prec_);
+    printf(" sgnd %d \n",pcmpt->sgnd_);
+    printf(" cps %d \n",pcmpt->cps_);
+#ifdef JAS_1_700_2
+    printf(" type %d \n",pcmpt->type_);
+#endif
+*/
+
+//   Expecting jpeg2000 image to be grayscale only.
+//   No color components.
+//
+    if (image->numcmpts_ != 1 ) {
+       printf("dec_jpeg2000: Found color image.  Grayscale expected.\n");
+       return (-5);
+    }
+
+// 
+//    Create a data matrix of grayscale image values decoded from
+//    the jpeg2000 codestream.
+//
+    data=jas_matrix_create(jas_image_height(image), jas_image_width(image));
+    jas_image_readcmpt(image,0,0,0,jas_image_width(image),
+                       jas_image_height(image),data);
+//
+//    Copy data matrix to output integer array.
+//
+    k=0;
+    for (i=0;i<pcmpt->height_;i++) 
+      for (j=0;j<pcmpt->width_;j++) 
+        outfld[k++]=data->rows_[i][j];
+//
+//     Clean up JasPer work structures.
+//
+    jas_matrix_destroy(data);
+    ier=jas_stream_close(jpcstream);
+    jas_image_destroy(image);
+
+    return 0;
+
+}
+#endif   /* USE_JPEG2000 */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/dec_png.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/dec_png.c
new file mode 100644
index 0000000..28161af
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/dec_png.c
@@ -0,0 +1,144 @@
+/**********************************************************
+ * Version $Id: dec_png.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef USE_PNG
+#include "grib2.h"
+ int dec_png(unsigned char *pngbuf,g2int *width,g2int *height,char *cout)
+ {	return( 0 );	}
+#else   /* USE_PNG */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <png.h>
+#include "grib2.h"
+
+
+struct png_stream {
+   unsigned char *stream_ptr;     /*  location to write PNG stream  */
+   g2int stream_len;               /*  number of bytes written       */
+};
+typedef struct png_stream png_stream;
+
+void user_read_data(png_structp , png_bytep , png_uint_32 );
+
+void user_read_data(png_structp png_ptr,png_bytep data, png_uint_32 length)
+/*
+        Custom read function used so that libpng will read a PNG stream
+        from memory instead of a file on disk.
+*/
+{
+     char *ptr;
+     g2int offset;
+     png_stream *mem;
+
+     mem=(png_stream *)png_get_io_ptr(png_ptr);
+     ptr=(void *)mem->stream_ptr;
+     offset=mem->stream_len;
+/*     printf("SAGrd %ld %ld %x\n",offset,length,ptr);  */
+     memcpy(data,ptr+offset,length);
+     mem->stream_len += length;
+}
+
+
+
+int dec_png(unsigned char *pngbuf,g2int *width,g2int *height,char *cout)
+{
+    int interlace,color,compres,filter,bit_depth;
+    g2int j,k,n,bytes,clen;
+    png_structp png_ptr;
+    png_infop info_ptr,end_info;
+    png_bytepp row_pointers;
+    png_stream read_io_ptr;
+
+/*  check if stream is a valid PNG format   */
+
+    if ( png_sig_cmp(pngbuf,0,8) != 0) 
+       return (-3);
+
+/* create and initialize png_structs  */
+
+    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL, 
+                                      NULL, NULL);
+    if (!png_ptr)
+       return (-1);
+
+    info_ptr = png_create_info_struct(png_ptr);
+    if (!info_ptr)
+    {
+       png_destroy_read_struct(&png_ptr,(png_infopp)NULL,(png_infopp)NULL);
+       return (-2);
+    }
+
+    end_info = png_create_info_struct(png_ptr);
+    if (!end_info)
+    {
+       png_destroy_read_struct(&png_ptr,(png_infopp)info_ptr,(png_infopp)NULL);
+       return (-2);
+    }
+
+/*     Set Error callback   */
+
+    if (setjmp(png_jmpbuf(png_ptr)))
+    {
+       png_destroy_read_struct(&png_ptr, &info_ptr,&end_info);
+       return (-3);
+    }
+
+/*    Initialize info for reading PNG stream from memory   */
+
+    read_io_ptr.stream_ptr=(png_voidp)pngbuf;
+    read_io_ptr.stream_len=0;
+
+/*    Set new custom read function    */
+
+    png_set_read_fn(png_ptr,(voidp)&read_io_ptr,(png_rw_ptr)user_read_data);
+/*     png_init_io(png_ptr, fptr);   */
+
+/*     Read and decode PNG stream   */
+
+    png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
+/*     Get pointer to each row of image data   */
+
+    row_pointers = png_get_rows(png_ptr, info_ptr);
+
+/*     Get image info, such as size, depth, colortype, etc...   */
+
+    /*printf("SAGT:png %d %d %d\n",info_ptr->width,info_ptr->height,info_ptr->bit_depth);*/
+    (void)png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *)width, (png_uint_32 *)height,
+               &bit_depth, &color, &interlace, &compres, &filter);
+
+/*     Check if image was grayscale      */
+
+/*
+    if (color != PNG_COLOR_TYPE_GRAY ) {
+       fprintf(stderr,"dec_png: Grayscale image was expected. \n");
+    }
+*/
+    if ( color == PNG_COLOR_TYPE_RGB ) {
+       bit_depth=24;
+    }
+    else if ( color == PNG_COLOR_TYPE_RGB_ALPHA ) {
+       bit_depth=32;
+    }
+/*     Copy image data to output string   */
+
+    n=0;
+    bytes=bit_depth/8;
+    clen=(*width)*bytes;
+    for (j=0;j<*height;j++) {
+      for (k=0;k<clen;k++) {
+        cout[n]=*(row_pointers[j]+k);
+        n++;
+      }
+    }
+
+/*      Clean up   */
+
+    png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+    return 0;
+
+}
+
+#endif   /* USE_PNG */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/drstemplates.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/drstemplates.c
new file mode 100644
index 0000000..0797645
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/drstemplates.c
@@ -0,0 +1,157 @@
+/**********************************************************
+ * Version $Id: drstemplates.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include "grib2.h"
+#include "drstemplates.h"
+
+g2int getdrsindex(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getdrsindex 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-06-28
+!
+! ABSTRACT: This function returns the index of specified Data 
+!   Representation Template 5.NN (NN=number) in array templates.
+!
+! PROGRAM HISTORY LOG:
+! 2001-06-28  Gilbert
+!
+! USAGE:    index=getdrsindex(number)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Data Representation 
+!                Template 5.NN that is being requested.
+!
+! RETURNS:  Index of DRT 5.NN in array templates, if template exists.
+!           = -1, otherwise.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int j,getdrsindex=-1;
+
+           for (j=0;j<MAXDRSTEMP;j++) {
+              if (number == templatesdrs[j].template_num) {
+                 getdrsindex=j;
+                 return(getdrsindex);
+              }
+           }
+
+           return(getdrsindex);
+}
+
+
+template *getdrstemplate(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getdrstemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+!
+! ABSTRACT: This subroutine returns DRS template information for a 
+!   specified Data Representation Template 5.NN.
+!   The number of entries in the template is returned along with a map
+!   of the number of octets occupied by each entry.  Also, a flag is
+!   returned to indicate whether the template would need to be extended.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-11  Gilbert
+!
+! USAGE:    new=getdrstemplate(number);
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Data Representation 
+!                Template 5.NN that is being requested.
+!
+!   RETURN VALUE:      
+!        - Pointer to the returned template struct. 
+!          Returns NULL pointer, if template not found.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int index;
+           template *new;
+
+           index=getdrsindex(number);
+
+           if (index != -1) {
+              new=(template *)malloc(sizeof(template));
+              new->type=5;
+              new->num=templatesdrs[index].template_num;
+              new->maplen=templatesdrs[index].mapdrslen;
+              new->needext=templatesdrs[index].needext;
+              new->map=(g2int *)templatesdrs[index].mapdrs;
+              new->extlen=0;
+              new->ext=0;        //NULL
+              return(new);
+           }
+           else {
+             printf("getdrstemplate: DRS Template 5.%d not defined.\n",(int)number);
+             return(0);        //NULL
+           }
+
+         return(0);        //NULL
+}
+
+template *extdrstemplate(g2int number,g2int *list)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    extdrstemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+!
+! ABSTRACT: This subroutine generates the remaining octet map for a
+!   given Data Representation Template, if required.  Some Templates can
+!   vary depending on data values given in an earlier part of the 
+!   Template, and it is necessary to know some of the earlier entry
+!   values to generate the full octet map of the Template.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-11  Gilbert
+!
+! USAGE:    new=extdrstemplate(number,list);
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Data Representation 
+!                Template 5.NN that is being requested.
+!     list()   - The list of values for each entry in the 
+!                the Data Representation Template 5.NN.
+!
+!   RETURN VALUE:      
+!        - Pointer to the returned template struct. 
+!          Returns NULL pointer, if template not found.
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           template *new;
+           g2int index,i;
+
+           index=getdrsindex(number);
+           if (index == -1) return(0);
+
+           new=getdrstemplate(number);
+
+           if ( ! new->needext ) return(new);
+
+           if ( number == 1 ) {
+              new->extlen=list[10]+list[12];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                new->ext[i]=4;
+              }
+           }
+           return(new);
+
+}
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/drstemplates.h b/src/modules/io/io_grid_grib2/g2clib-1.0.4/drstemplates.h
new file mode 100644
index 0000000..759c52d
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/drstemplates.h
@@ -0,0 +1,72 @@
+/**********************************************************
+ * Version $Id: drstemplates.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef _drstemplates_H
+#define _drstemplates_H
+#include "grib2.h"
+
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-26
+//
+// ABSTRACT: This Fortran Module contains info on all the available 
+//   GRIB2 Data Representation Templates used in Section 5 (DRS).
+//   The information decribing each template is stored in the
+//   drstemplate structure defined below.
+//
+//   Each Template has three parts: The number of entries in the template
+//   (mapdrslen);  A map of the template (mapdrs), which contains the
+//   number of octets in which to pack each of the template values; and
+//   a logical value (needext) that indicates whether the Template needs 
+//   to be extended.  In some cases the number of entries in a template 
+//   can vary depending upon values specified in the "static" part of 
+//   the template.  ( See Template 5.1 as an example )
+//
+//   NOTE:  Array mapdrs contains the number of octets in which the 
+//   corresponding template values will be stored.  A negative value in
+//   mapdrs is used to indicate that the corresponding template entry can
+//   contain negative values.  This information is used later when packing
+//   (or unpacking) the template data values.  Negative data values in GRIB
+//   are stored with the left most bit set to one, and a negative number
+//   of octets value in mapdrs[] indicates that this possibility should
+//   be considered.  The number of octets used to store the data value
+//   in this case would be the absolute value of the negative value in 
+//   mapdrs[].
+//  
+//
+///////////////////////////////////////////////////////////////////////
+
+      #define MAXDRSTEMP 9              // maximum number of templates
+      #define MAXDRSMAPLEN 200          // maximum template map length
+
+      struct drstemplate
+      {
+          g2int template_num;
+          g2int mapdrslen;
+          g2int needext;
+          g2int mapdrs[MAXDRSMAPLEN];
+      };
+
+      const struct drstemplate templatesdrs[MAXDRSTEMP] = {
+             // 5.0: Grid point data - Simple Packing
+         { 0, 5, 0, {4,-2,-2,1,1} },
+             // 5.2: Grid point data - Complex Packing
+         { 2, 16, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1} },
+             // 5.3: Grid point data - Complex Packing and spatial differencing
+         { 3, 18, 0, {4,-2,-2,1,1,1,1,4,4,4,1,1,4,1,4,1,1,1} },
+             // 5.50: Spectral Data - Simple Packing
+         { 50, 5, 0, {4,-2,-2,1,4} },
+             // 5.51: Spherical Harmonics data - Complex packing 
+         { 51, 10, 0, {4,-2,-2,1,-4,2,2,2,4,1} },
+//           // 5.1: Matrix values at gridpoint - Simple packing
+//         { 1, 15, 1, {4,-2,-2,1,1,1,4,2,2,1,1,1,1,1,1} },
+             // 5.40: Grid point data - JPEG2000 encoding
+         { 40, 7, 0, {4,-2,-2,1,1,1,1} },
+             // 5.41: Grid point data - PNG encoding
+         { 41, 5, 0, {4,-2,-2,1,1} },
+             // 5.40000: Grid point data - JPEG2000 encoding
+         { 40000, 7, 0, {4,-2,-2,1,1,1,1} },
+             // 5.40010: Grid point data - PNG encoding
+         { 40010, 5, 0, {4,-2,-2,1,1} }
+      } ;
+
+
+#endif  /*  _drstemplates_H  */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/enc_jpeg2000.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/enc_jpeg2000.c
new file mode 100644
index 0000000..c56010a
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/enc_jpeg2000.c
@@ -0,0 +1,190 @@
+/**********************************************************
+ * Version $Id: enc_jpeg2000.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef USE_JPEG2000
+#include "grib2.h"
+ int enc_jpeg2000(unsigned char *cin,g2int width,g2int height,g2int nbits,
+                 g2int ltype, g2int ratio, g2int retry, char *outjpc, 
+                 g2int jpclen)
+ {	return( 0 );	}
+#else   /* USE_JPEG2000 */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+#include "jasper/jasper.h"
+#define JAS_1_700_2
+
+
+int enc_jpeg2000(unsigned char *cin,g2int width,g2int height,g2int nbits,
+                 g2int ltype, g2int ratio, g2int retry, char *outjpc, 
+                 g2int jpclen)
+/*$$$  SUBPROGRAM DOCUMENTATION BLOCK
+*                .      .    .                                       .
+* SUBPROGRAM:    enc_jpeg2000      Encodes JPEG2000 code stream
+*   PRGMMR: Gilbert          ORG: W/NP11     DATE: 2002-12-02
+*
+* ABSTRACT: This Function encodes a grayscale image into a JPEG2000 code stream
+*   specified in the JPEG2000 Part-1 standard (i.e., ISO/IEC 15444-1) 
+*   using JasPer Software version 1.500.4 (or 1.700.2 ) written by the 
+*   University of British Columbia, Image Power Inc, and others.
+*   JasPer is available at http://www.ece.uvic.ca/~mdadams/jasper/.
+*
+* PROGRAM HISTORY LOG:
+* 2002-12-02  Gilbert
+* 2004-12-16  Gilbert - Added retry argument/option to allow option of
+*                       increasing the maximum number of guard bits to the
+*                       JPEG2000 algorithm.
+*
+* USAGE:    int enc_jpeg2000(unsigned char *cin,g2int width,g2int height,
+*                            g2int nbits, g2int ltype, g2int ratio, 
+*                            g2int retry, char *outjpc, g2int jpclen)
+*
+*   INPUT ARGUMENTS:
+*      cin   - Packed matrix of Grayscale image values to encode.
+*     width  - width of image
+*     height - height of image
+*     nbits  - depth (in bits) of image.  i.e number of bits
+*              used to hold each data value
+*    ltype   - indicator of lossless or lossy compression
+*              = 1, for lossy compression
+*              != 1, for lossless compression
+*    ratio   - target compression ratio.  (ratio:1)
+*              Used only when ltype == 1.
+*    retry   - Pointer to option type.
+*              1 = try increasing number of guard bits
+*              otherwise, no additional options
+*    jpclen  - Number of bytes allocated for new JPEG2000 code stream in
+*              outjpc.
+*
+*   INPUT ARGUMENTS:
+*     outjpc - Output encoded JPEG2000 code stream
+*
+*   RETURN VALUES :
+*        > 0 = Length in bytes of encoded JPEG2000 code stream
+*         -3 = Error decode jpeg2000 code stream.
+*         -5 = decoded image had multiple color components.
+*              Only grayscale is expected.
+*
+* REMARKS:
+*
+*      Requires JasPer Software version 1.500.4 or 1.700.2
+*
+* ATTRIBUTES:
+*   LANGUAGE: C
+*   MACHINE:  IBM SP
+*
+*$$$*/
+{
+    int ier,rwcnt;
+    jas_image_t image;
+    jas_stream_t *jpcstream,*istream;
+    jas_image_cmpt_t cmpt,*pcmpt;
+#define MAXOPTSSIZE 1024
+    char opts[MAXOPTSSIZE];
+
+/*
+    printf(" enc_jpeg2000:width %ld\n",width);
+    printf(" enc_jpeg2000:height %ld\n",height);
+    printf(" enc_jpeg2000:nbits %ld\n",nbits);
+    printf(" enc_jpeg2000:jpclen %ld\n",jpclen);
+*/
+//    jas_init();
+
+//
+//    Set lossy compression options, if requested.
+//
+    if ( ltype != 1 ) {
+       opts[0]=(char)0;
+    }
+    else {
+#ifdef _SAGA_MSW
+       sprintf(opts,"mode=real\nrate=%f",1.0/(float)ratio);
+#else
+       snprintf(opts,MAXOPTSSIZE,"mode=real\nrate=%f",1.0/(float)ratio);
+#endif	// _SAGA_MSW
+    }
+    if ( retry == 1 ) {             // option to increase number of guard bits
+       strcat(opts,"\nnumgbits=4");
+    }
+    //printf("SAGopts: %s\n",opts);
+    
+//
+//     Initialize the JasPer image structure describing the grayscale
+//     image to encode into the JPEG2000 code stream.
+//
+    image.tlx_=0;
+    image.tly_=0;
+#ifdef JAS_1_500_4 
+    image.brx_=(uint_fast32_t)width;
+    image.bry_=(uint_fast32_t)height;
+#endif 
+#ifdef JAS_1_700_2
+    image.brx_=(jas_image_coord_t)width;
+    image.bry_=(jas_image_coord_t)height;
+#endif
+    image.numcmpts_=1;
+    image.maxcmpts_=1;
+#ifdef JAS_1_500_4
+    image.colormodel_=JAS_IMAGE_CM_GRAY;         /* grayscale Image */
+#endif
+#ifdef JAS_1_700_2
+    image.clrspc_=JAS_CLRSPC_SGRAY;         /* grayscale Image */
+    image.cmprof_=0; 
+#endif
+    image.inmem_=1;
+
+    cmpt.tlx_=0;
+    cmpt.tly_=0;
+    cmpt.hstep_=1;
+    cmpt.vstep_=1;
+#ifdef JAS_1_500_4
+    cmpt.width_=(uint_fast32_t)width;
+    cmpt.height_=(uint_fast32_t)height;
+#endif
+#ifdef JAS_1_700_2
+    cmpt.width_=(jas_image_coord_t)width;
+    cmpt.height_=(jas_image_coord_t)height;
+    cmpt.type_=JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y);
+#endif
+    cmpt.prec_=nbits;
+    cmpt.sgnd_=0;
+    cmpt.cps_=(nbits+7)/8;
+
+    pcmpt=&cmpt;
+    image.cmpts_=&pcmpt;
+
+//
+//    Open a JasPer stream containing the input grayscale values
+//
+    istream=jas_stream_memopen((char *)cin,height*width*cmpt.cps_);
+    cmpt.stream_=istream;
+
+//
+//    Open an output stream that will contain the encoded jpeg2000
+//    code stream.
+//
+    jpcstream=jas_stream_memopen(outjpc,(int)jpclen);
+
+//
+//     Encode image.
+//
+    ier=jpc_encode(&image,jpcstream,opts);
+    if ( ier != 0 ) {
+       printf(" jpc_encode return = %d \n",ier);
+       return -3;
+    }
+//
+//     Clean up JasPer work structures.
+//    
+    rwcnt=jpcstream->rwcnt_;
+    ier=jas_stream_close(istream);
+    ier=jas_stream_close(jpcstream);
+//
+//      Return size of jpeg2000 code stream
+//
+    return (rwcnt);
+
+}
+
+#endif   /* USE_JPEG2000 */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/enc_png.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/enc_png.c
new file mode 100644
index 0000000..8fd7fde
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/enc_png.c
@@ -0,0 +1,138 @@
+/**********************************************************
+ * Version $Id: enc_png.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef USE_PNG
+#include "grib2.h"
+ int enc_png(char *data,g2int width,g2int height,g2int nbits,char *pngbuf)	{	return( 0 );	}
+#else   /* USE_PNG */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <png.h>
+#include "grib2.h"
+
+
+struct png_stream {
+   unsigned char *stream_ptr;     /*  location to write PNG stream  */
+   g2int stream_len;               /*  number of bytes written       */
+};
+typedef struct png_stream png_stream;
+
+void user_write_data(png_structp ,png_bytep , png_uint_32 );
+void user_flush_data(png_structp );
+
+void user_write_data(png_structp png_ptr,png_bytep data, png_uint_32 length)
+/*
+        Custom write function used to that libpng will write
+        to memory location instead of a file on disk
+*/
+{
+     unsigned char *ptr;
+     g2int offset;
+     png_stream *mem;
+
+     mem=(png_stream *)png_get_io_ptr(png_ptr);
+     ptr=mem->stream_ptr;
+     offset=mem->stream_len;
+/*     printf("SAGwr %ld %ld %x\n",offset,length,ptr);    */
+     /*for (j=offset,k=0;k<length;j++,k++) ptr[j]=data[k];*/
+     memcpy(ptr+offset,data,length);
+     mem->stream_len += length;
+}
+
+
+void user_flush_data(png_structp png_ptr)
+/*
+        Dummy Custom flush function
+*/
+{
+   int *do_nothing;
+   do_nothing=NULL;
+}
+
+
+int enc_png(char *data,g2int width,g2int height,g2int nbits,char *pngbuf)
+{
+ 
+    int color_type;
+    g2int j,bytes,pnglen,bit_depth;
+    png_structp png_ptr;
+    png_infop info_ptr;
+//    png_bytep *row_pointers[height];
+    png_bytep **row_pointers;
+    png_stream write_io_ptr;
+
+/* create and initialize png_structs  */
+
+    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL, 
+                                      NULL, NULL);
+    if (!png_ptr)
+       return (-1);
+
+    info_ptr = png_create_info_struct(png_ptr);
+    if (!info_ptr)
+    {
+       png_destroy_write_struct(&png_ptr,(png_infopp)NULL);
+       return (-2);
+    }
+
+/*     Set Error callback   */
+
+    if (setjmp(png_jmpbuf(png_ptr)))
+    {
+       png_destroy_write_struct(&png_ptr, &info_ptr);
+       return (-3);
+    }
+
+/*    Initialize info for writing PNG stream to memory   */
+
+    write_io_ptr.stream_ptr=(png_voidp)pngbuf;
+    write_io_ptr.stream_len=0;
+
+/*    Set new custom write functions    */
+
+    png_set_write_fn(png_ptr,(voidp)&write_io_ptr,(png_rw_ptr)user_write_data,
+                    (png_flush_ptr)user_flush_data);
+/*    png_init_io(png_ptr, fptr);   */
+/*    png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);  */
+
+/*     Set the image size, colortype, filter type, etc...      */
+
+/*    printf("SAGTsettingIHDR %d %d %d\n",width,height,bit_depth); */
+    bit_depth=nbits;
+    color_type=PNG_COLOR_TYPE_GRAY;
+    if (nbits == 24 ) {
+        bit_depth=8;
+        color_type=PNG_COLOR_TYPE_RGB;
+    }
+    else if (nbits == 32 ) {
+        bit_depth=8;
+        color_type=PNG_COLOR_TYPE_RGB_ALPHA;
+    }
+    png_set_IHDR(png_ptr, info_ptr, width, height,
+       bit_depth, color_type, PNG_INTERLACE_NONE,
+       PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+
+/*     Put image data into the PNG info structure    */
+
+    /*bytes=bit_depth/8;*/
+    bytes=nbits/8;
+    row_pointers=malloc(height*sizeof(png_bytep));
+    for (j=0;j<height;j++) row_pointers[j]=(png_bytep *)(data+(j*width*bytes));
+    png_set_rows(png_ptr, info_ptr, (png_bytepp)row_pointers);
+
+/*     Do the PNG encoding, and write out PNG stream  */
+
+    png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
+
+/*     Clean up   */
+
+    png_destroy_write_struct(&png_ptr, &info_ptr);
+    free(row_pointers);
+    pnglen=write_io_ptr.stream_len;
+    return pnglen;
+
+}
+
+#endif   /* USE_PNG */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addfield.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addfield.c
new file mode 100644
index 0000000..2a3ea74
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addfield.c
@@ -0,0 +1,513 @@
+/**********************************************************
+ * Version $Id: g2_addfield.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int getdim(unsigned char *,g2int *,g2int *,g2int *);
+g2int getpoly(unsigned char *,g2int *,g2int *,g2int *);
+void simpack(g2float *, g2int, g2int *, unsigned char *, g2int *);
+void cmplxpack(g2float *, g2int, g2int, g2int *, unsigned char *, g2int *);
+void specpack(g2float *,g2int,g2int,g2int,g2int,g2int *,unsigned char *,
+              g2int *);
+#ifdef USE_PNG
+  void pngpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
+#endif  /* USE_PNG */
+#ifdef USE_JPEG2000
+  void jpcpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
+#endif  /* USE_JPEG2000 */
+
+
+g2int g2_addfield(unsigned char *cgrib,g2int ipdsnum,g2int *ipdstmpl,
+                g2float *coordlist,g2int numcoord,g2int idrsnum,g2int *idrstmpl,
+                g2float *fld,g2int ngrdpts,g2int ibmap,g2int *bmap)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addfield 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-05
+//
+// ABSTRACT: This routine packs up Sections 4 through 7 for a given field
+//   and adds them to a GRIB2 message.  They are Product Definition Section,
+//   Data Representation Section, Bit-Map Section and Data Section, 
+//   respectively.
+//   This routine is used with routines "g2_create", "g2_addlocal", 
+//   "g2_addgrid", and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//   Also, routine g2_addgrid must be called after g2_create and
+//   before this routine to add the appropriate grid description to
+//   the GRIB2 message.   Also, a call to g2_gribend is required to complete 
+//   GRIB2 message after all fields have been added.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-05  Gilbert
+// 2002-12-23  Gilbert  -  Added complex spherical harmonic packing
+// 2003-08-27  Gilbert  - Added support for new templates using
+//                        PNG and JPEG2000 algorithms/templates.
+// 2004-11-29  Gilbert  - JPEG2000 now allowed to use WMO Template no. 5.40
+//                        PNG now allowed to use WMO Template no. 5.41
+//                      - Added check to determine if packing algorithm failed.
+// 2005-05-10  Gilbert -  Imposed minimum size on cpack, used to hold encoded
+//                        bit string.
+//
+// USAGE:    int g2_addfield(unsigned char *cgrib,g2int ipdsnum,g2int *ipdstmpl,
+//              g2float *coordlist,g2int numcoord,g2int idrsnum,g2int *idrstmpl,
+//              g2float *fld,g2int ngrdpts,g2int ibmap,g2int *bmap)
+//   INPUT ARGUMENT LIST:
+//     cgrib    - Char array that contains the GRIB2 message to which sections
+//                4 through 7 should be added.
+//     ipdsnum  - Product Definition Template Number ( see Code Table 4.0)
+//     ipdstmpl - Contains the data values for the specified Product Definition
+//                Template ( N=ipdsnum ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Product
+//                Defintion Template 4.N
+//     coordlist- Array containg floating point values intended to document
+//                the vertical discretisation associated to model data
+//                on hybrid coordinate vertical levels.
+//     numcoord - number of values in array coordlist.
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0 )
+//     idrstmpl - Contains the data values for the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//                Note that some values in this template (eg. reference
+//                values, number of bits, etc...) may be changed by the
+//                data packing algorithms.
+//                Use this to specify scaling factors and order of
+//                spatial differencing, if desired.
+//     fld[]    - Array of data points to pack.
+//     ngrdpts  - Number of data points in grid.
+//                i.e.  size of fld and bmap.
+//     ibmap    - Bitmap indicator ( see Code Table 6.0 )
+//                0 = bitmap applies and is included in Section 6.
+//                1-253 = Predefined bitmap applies
+//                254 = Previously defined bitmap applies to this field
+//                255 = Bit map does not apply to this product.
+//     bmap[]   - Integer array containing bitmap to be added. ( if ibmap=0 )
+//
+//   OUTPUT ARGUMENT LIST:      
+//     cgrib    - Character array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine g2_create first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 3 or 7.
+//               -5 = Could not find requested Product Definition Template.
+//               -6 = Section 3 (GDS) not previously defined in message
+//               -7 = Tried to use unsupported Data Representationi Template
+//               -8 = Specified use of a previously defined bitmap, but one
+//                    does not exist in the GRIB message.
+//               -9 = GDT of one of 5.50 through 5.53 required to pack field
+//                    using DRT 5.51.
+//              -10 = Error packing data field.
+//
+// REMARKS: Note that the Sections 4 through 7 can only follow
+//          Section 3 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+      g2int ierr;
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char s7=0x37;   // '7'
+
+      unsigned char *cpack;
+      static g2int  zero=0,one=1,four=4,five=5,six=6,seven=7;
+      const g2int  minsize=50000;
+      g2int   iofst,ibeg,lencurr,len,nsize;
+      g2int   ilen,isecnum,i,nbits,temp,left;
+      g2int   ibmprev,j,lcpack,ioctet,newlen,ndpts;
+      g2int   lensec4,lensec5,lensec6,lensec7;
+      g2int   issec3,isprevbmap,lpos3=0,JJ,KK,MM;
+      g2int   *coordieee;
+      g2int   width,height,iscan,itemp;
+      g2float *pfld;
+      template  *mappds,*mapdrs;
+      unsigned int allones=4294967295u;
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_addfield: GRIB not found in given message.\n");
+        printf("g2_addfield: Call to routine g2_create required to initialize GRIB messge.\n");
+        ierr=-1;
+        return(ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Check to see if GRIB message is already complete
+//  
+      if ( cgrib[lencurr-4]==s7 && cgrib[lencurr-3]==s7 &&
+           cgrib[lencurr-2]==s7 && cgrib[lencurr-1]==s7 ) {
+        printf("g2_addfield: GRIB message already complete.  Cannot add new section.\n");
+        ierr=-2;
+        return(ierr);
+      }
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      issec3=0;
+      isprevbmap=0;
+      len=16;    // length of Section 0
+      for (;;) { 
+      //    Get number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        iofst=iofst+8;
+      //  Check if previous Section 3 exists
+        if (isecnum == 3) {
+            issec3=1;
+            lpos3=len;
+        }
+      //  Check if a previous defined bitmap exists
+        if (isecnum == 6) {
+          gbit(cgrib,&ibmprev,iofst,8);
+          iofst=iofst+8;
+          if ((ibmprev >= 0) && (ibmprev <= 253)) isprevbmap=1;
+        }
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_addfield: Section byte counts don''t add to total.\n");
+          printf("g2_addfield: Sum of section byte counts = %ld\n",len);
+          printf("g2_addfield: Total byte count in Section 0 = %ld\n",lencurr);
+          ierr=-3;
+          return(ierr);
+        }
+      }
+//
+//  Sections 4 through 7 can only be added after section 3 or 7.
+//
+      if ( (isecnum != 3) && (isecnum != 7) ) {
+        printf("g2_addfield: Sections 4-7 can only be added after Section 3 or 7.\n");
+        printf("g2_addfield: Section ',isecnum,' was the last found in given GRIB message.\n");
+        ierr=-4;
+        return(ierr);
+//
+//  Sections 4 through 7 can only be added if section 3 was previously defined.
+//
+      }
+      else if ( ! issec3) {
+        printf("g2_addfield: Sections 4-7 can only be added if Section 3 was previously included.\n");
+        printf("g2_addfield: Section 3 was not found in given GRIB message.\n");
+        printf("g2_addfield: Call to routine addgrid required to specify Grid definition.\n");
+        ierr=-6;
+        return(ierr);
+      }
+//
+//  Add Section 4  - Product Definition Section
+//
+      ibeg=lencurr*8;        //   Calculate offset for beginning of section 4
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&four,iofst,8);     // Store section number ( 4 )
+      iofst=iofst+8;
+      sbit(cgrib,&numcoord,iofst,16);   // Store num of coordinate values
+      iofst=iofst+16;
+      sbit(cgrib,&ipdsnum,iofst,16);    // Store Prod Def Template num.
+      iofst=iofst+16;
+      //
+      //   Get Product Definition Template
+      //
+      mappds=getpdstemplate(ipdsnum);
+      if (mappds == 0) {          // undefined template
+        ierr=-5;
+        return(ierr);
+      }
+      //
+      //   Extend the Product Definition Template, if necessary.
+      //   The number of values in a specific template may vary
+      //   depending on data specified in the "static" part of the
+      //   template.
+      //
+      if ( mappds->needext ) {
+        free(mappds);
+        mappds=extpdstemplate(ipdsnum,ipdstmpl);
+      }
+      //
+      //   Pack up each input value in array ipdstmpl into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mappds.
+      //
+      for (i=0;i<mappds->maplen;i++) {
+        nbits=abs(mappds->map[i])*8;
+        if ( (mappds->map[i] >= 0) || (ipdstmpl[i] >= 0) )
+          sbit(cgrib,ipdstmpl+i,iofst,nbits);
+        else {
+          sbit(cgrib,&one,iofst,1);
+          temp=abs(ipdstmpl[i]);
+          sbit(cgrib,&temp,iofst+1,nbits-1);
+        }
+        iofst=iofst+nbits;
+      }
+      //  Pack template extension, if appropriate
+      j=mappds->maplen;
+      if ( mappds->needext && (mappds->extlen > 0) ) {
+         for (i=0;i<mappds->extlen;i++) {
+           nbits=abs(mappds->ext[i])*8;
+           if ( (mappds->ext[i] >= 0) || (ipdstmpl[j] >= 0) )
+             sbit(cgrib,ipdstmpl+j,iofst,nbits);
+           else {
+             sbit(cgrib,&one,iofst,1);
+             temp=abs(ipdstmpl[j]);
+             sbit(cgrib,&temp,iofst+1,nbits-1);
+           }
+           iofst=iofst+nbits;
+           j++;
+         }
+      }
+      free(mappds);
+      //
+      //   Add Optional list of vertical coordinate values
+      //   after the Product Definition Template, if necessary.
+      //
+      if ( numcoord != 0 ) {
+        coordieee=(g2int *)calloc(numcoord,sizeof(g2int));
+        mkieee(coordlist,coordieee,numcoord);
+        sbits(cgrib,coordieee,iofst,32,0,numcoord);
+        iofst=iofst+(32*numcoord);
+        free(coordieee);
+      }
+      //
+      //   Calculate length of section 4 and store it in octets
+      //   1-4 of section 4.
+      //
+      lensec4=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec4,ibeg,32);
+//
+//  Pack Data using appropriate algorithm
+//
+      //
+      //   Get Data Representation Template
+      //
+      mapdrs=getdrstemplate(idrsnum);
+      if (mapdrs == 0) {
+        ierr=-5;
+        return(ierr);
+      }
+      //
+      //  contract data field, removing data at invalid grid points,
+      //  if bit-map is provided with field.
+      //
+      if ( ibmap == 0 || ibmap==254 ) {
+         pfld=(g2float *)malloc(ngrdpts*sizeof(g2float));
+         ndpts=0;
+         for (j=0;j<ngrdpts;j++) {
+             if ( bmap[j]==1 ) pfld[ndpts++]=fld[j];
+         }
+      }
+      else {
+         ndpts=ngrdpts;
+         pfld=fld;
+      }
+      nsize=ndpts*4;
+      if ( nsize < minsize ) nsize=minsize;
+      cpack=malloc(nsize);
+      if (idrsnum == 0)           //  Simple Packing
+        simpack(pfld,ndpts,idrstmpl,cpack,&lcpack);
+      else if (idrsnum==2 || idrsnum==3)           //  Complex Packing
+        cmplxpack(pfld,ndpts,idrsnum,idrstmpl,cpack,&lcpack);
+      else if (idrsnum == 50) {         //  Sperical Harmonic Simple Packing 
+        simpack(pfld+1,ndpts-1,idrstmpl,cpack,&lcpack);
+        mkieee(pfld+0,idrstmpl+4,1);  // ensure RE(0,0) value is IEEE format
+      }
+      else if (idrsnum == 51) {         //  Sperical Harmonic Complex Packing 
+        getpoly(cgrib+lpos3,&JJ,&KK,&MM);
+        if ( JJ!=0 && KK!=0 && MM!=0 )
+           specpack(pfld,ndpts,JJ,KK,MM,idrstmpl,cpack,&lcpack);
+        else {
+           printf("g2_addfield: Cannot pack DRT 5.51.\n");
+           return (-9);
+        }
+      }
+#ifdef USE_JPEG2000
+      else if (idrsnum == 40 || idrsnum == 40000) {    /*  JPEG2000 encoding  */
+        if (ibmap == 255) {
+           getdim(cgrib+lpos3,&width,&height,&iscan);
+           if ( width==0 || height==0 ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( width==allones || height==allones ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( (iscan&32) == 32) {   /* Scanning mode: bit 3  */
+              itemp=width;
+              width=height;
+              height=itemp;
+           }
+        }
+        else {
+           width=ndpts;
+           height=1;
+        }
+        lcpack=nsize;
+        jpcpack(pfld,width,height,idrstmpl,cpack,&lcpack);
+      }
+#endif  /* USE_JPEG2000 */
+#ifdef USE_PNG
+      else if (idrsnum == 41 || idrsnum == 40010) {      /*  PNG encoding   */
+        if (ibmap == 255) {
+           getdim(cgrib+lpos3,&width,&height,&iscan);
+           if ( width==0 || height==0 ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( width==allones || height==allones ) {
+              width=ndpts;
+              height=1;
+           }
+           else if ( (iscan&32) == 32) {   /* Scanning mode: bit 3  */
+              itemp=width;
+              width=height;
+              height=itemp;
+           }
+        }
+        else {
+           width=ndpts;
+           height=1;
+        }
+        pngpack(pfld,width,height,idrstmpl,cpack,&lcpack);
+      }
+#endif  /* USE_PNG */
+      else {
+        printf("g2_addfield: Data Representation Template 5.%ld not yet implemented.\n",idrsnum);
+        ierr=-7;
+        return(ierr);
+      }
+      if ( ibmap == 0 || ibmap==254 ) {      // free temp space
+         if (fld != pfld) free(pfld);
+      }
+      if ( lcpack < 0 ) {
+        if( cpack != 0 ) free(cpack);
+        ierr=-10;
+        return(ierr);
+      }
+
+//
+//  Add Section 5  - Data Representation Section
+//
+      ibeg=iofst;            //   Calculate offset for beginning of section 5
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&five,iofst,8);     // Store section number ( 5 )
+      iofst=iofst+8;
+      sbit(cgrib,&ndpts,iofst,32);    // Store num of actual data points
+      iofst=iofst+32;
+      sbit(cgrib,&idrsnum,iofst,16);    // Store Data Repr. Template num.
+      iofst=iofst+16;
+      //
+      //   Pack up each input value in array idrstmpl into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapdrs.
+      //
+      for (i=0;i<mapdrs->maplen;i++) {
+        nbits=abs(mapdrs->map[i])*8;
+        if ( (mapdrs->map[i] >= 0) || (idrstmpl[i] >= 0) )
+          sbit(cgrib,idrstmpl+i,iofst,nbits);
+        else {
+          sbit(cgrib,&one,iofst,1);
+          temp=abs(idrstmpl[i]);
+          sbit(cgrib,&temp,iofst+1,nbits-1);
+        }
+        iofst=iofst+nbits;
+      }
+      free(mapdrs);
+      //
+      //   Calculate length of section 5 and store it in octets
+      //   1-4 of section 5.
+      //
+      lensec5=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec5,ibeg,32);
+
+//
+//  Add Section 6  - Bit-Map Section
+//
+      ibeg=iofst;            //   Calculate offset for beginning of section 6
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&six,iofst,8);     // Store section number ( 6 )
+      iofst=iofst+8;
+      sbit(cgrib,&ibmap,iofst,8);    // Store Bit Map indicator
+      iofst=iofst+8;
+      //
+      //  Store bitmap, if supplied
+      //
+      if (ibmap == 0) {
+        sbits(cgrib,bmap,iofst,1,0,ngrdpts);    // Store BitMap
+        iofst=iofst+ngrdpts;
+      }
+      //
+      //  If specifying a previously defined bit-map, make sure
+      //  one already exists in the current GRIB message.
+      //
+      if ((ibmap==254) && ( ! isprevbmap)) {
+        printf("g2_addfield: Requested previously defined bitmap,");
+        printf(" but one does not exist in the current GRIB message.\n");
+        ierr=-8;
+        return(ierr);
+      }
+      //
+      //   Calculate length of section 6 and store it in octets
+      //   1-4 of section 6.  Pad to end of octect, if necessary.
+      //
+      left=8-(iofst%8);
+      if (left != 8) {
+        sbit(cgrib,&zero,iofst,left);     // Pad with zeros to fill Octet
+        iofst=iofst+left;
+      }
+      lensec6=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec6,ibeg,32);
+
+//
+//  Add Section 7  - Data Section
+//
+      ibeg=iofst;            //   Calculate offset for beginning of section 7
+      iofst=ibeg+32;        //   leave space for length of section
+      sbit(cgrib,&seven,iofst,8);    // Store section number ( 7 )
+      iofst=iofst+8;
+      //      Store Packed Binary Data values, if non-constant field
+      if (lcpack != 0) {
+        ioctet=iofst/8;
+        //cgrib(ioctet+1:ioctet+lcpack)=cpack(1:lcpack)
+        for (j=0;j<lcpack;j++) cgrib[ioctet+j]=cpack[j];
+        iofst=iofst+(8*lcpack);
+      }
+      //
+      //   Calculate length of section 7 and store it in octets
+      //   1-4 of section 7.  
+      //
+      lensec7=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec7,ibeg,32);
+
+      if( cpack != 0 ) free(cpack);
+//
+//  Update current byte total of message in Section 0
+//
+      newlen=lencurr+lensec4+lensec5+lensec6+lensec7;
+      sbit(cgrib,&newlen,96,32);
+
+      return(newlen);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addgrid.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addgrid.c
new file mode 100644
index 0000000..7c8a51f
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addgrid.c
@@ -0,0 +1,246 @@
+/**********************************************************
+ * Version $Id: g2_addgrid.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_addgrid(unsigned char *cgrib,g2int *igds,g2int *igdstmpl,g2int *ideflist,g2int idefnum)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addgrid 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-01
+//
+// ABSTRACT: This routine packs up a Grid Definition Section (Section 3) 
+//   and adds it to a GRIB2 message.  It is used with routines "g2_create",
+//   "g2_addlocal", "g2_addfield",
+//   and "g2_gribend" to create a complete GRIB2 message.
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-01  Gilbert
+//
+// USAGE:    int g2_addgrid(unsigned char *cgrib,g2int *igds,g2int *igdstmpl,
+//                          g2int *ideflist,g2int idefnum)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array that contains the GRIB2 message to which
+//                section should be added.
+//     igds     - Contains information needed for GRIB Grid Definition Section 3
+//                Must be dimensioned >= 5.
+//                igds[0]=Source of grid definition (see Code Table 3.0)
+//                igds[1]=Number of grid points in the defined grid.
+//                igds[2]=Number of octets needed for each 
+//                            additional grid points definition.  
+//                            Used to define number of
+//                            points in each row ( or column ) for
+//                            non-regular grids.  
+//                            = 0, if using regular grid.
+//                igds[3]=Interpretation of list for optional points 
+//                            definition.  (Code Table 3.11)
+//                igds[4]=Grid Definition Template Number (Code Table 3.1)
+//     igdstmpl - Contains the data values for the specified Grid Definition
+//                Template ( NN=igds[4] ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Grid
+//                Defintion Template 3.NN
+//     ideflist - (Used if igds[2] != 0)  This array contains the
+//                number of grid points contained in each row ( or column )
+//      idefnum - (Used if igds[2] != 0)  The number of entries
+//                in array ideflist.  i.e. number of rows ( or columns )
+//                for which optional grid points are defined.
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 1, 2 or 7.
+//               -5 = Could not find requested Grid Definition Template.
+//
+// REMARKS: Note that the Grid Def Section ( Section 3 ) can only follow
+//          Section 1, 2 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int ierr;
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char seven=0x37;   // '7'
+
+      static g2int one=1,three=3,miss=65535;
+      g2int   lensec3,iofst,ibeg,lencurr,len;
+      g2int   i,j,temp,ilen,isecnum,nbits;
+      template *mapgrid=0;
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_addgrid: GRIB not found in given message.\n");
+        printf("g2_addgrid: Call to routine gribcreate required to initialize GRIB messge.\n");
+        ierr=-1;
+        return(ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Check to see if GRIB message is already complete
+//  
+      if ( cgrib[lencurr-4]==seven && cgrib[lencurr-3]==seven &&
+           cgrib[lencurr-2]==seven && cgrib[lencurr-1]==seven ) {
+        printf("g2_addgrid: GRIB message already complete.  Cannot add new section.\n");
+        ierr=-2;
+        return(ierr);
+      }
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      len=16;    // length of Section 0
+      for (;;) { 
+      //    Get section number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_addgrid: Section byte counts don''t add to total.\n");
+          printf("g2_addgrid: Sum of section byte counts = %ld\n",len);
+          printf("g2_addgrid: Total byte count in Section 0 = %ld\n",lencurr);
+          ierr=-3;
+          return(ierr);
+        }
+      }
+//
+//  Section 3 can only be added after sections 1, 2 and 7.
+//
+      if ( (isecnum!=1) && (isecnum!=2) && (isecnum!=7) ) {
+        printf("g2_addgrid: Section 3 can only be added after Section 1, 2 or 7.\n");
+        printf("g2_addgrid: Section ',isecnum,' was the last found in given GRIB message.\n");
+        ierr=-4;
+        return(ierr);
+      }
+//
+//  Add Section 3  - Grid Definition Section
+//
+      ibeg=lencurr*8;        //   Calculate offset for beginning of section 3
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&three,iofst,8);     // Store section number ( 3 )
+      iofst=iofst+8;
+      sbit(cgrib,igds+0,iofst,8);     // Store source of Grid def.
+      iofst=iofst+8;
+      sbit(cgrib,igds+1,iofst,32);    // Store number of data pts.
+      iofst=iofst+32;
+      sbit(cgrib,igds+2,iofst,8);     // Store number of extra octets.
+      iofst=iofst+8;
+      sbit(cgrib,igds+3,iofst,8);     // Store interp. of extra octets.
+      iofst=iofst+8;
+      //   if Octet 6 is not equal to zero, Grid Definition Template may
+      //   not be supplied.
+      if ( igds[0] == 0 )
+        sbit(cgrib,igds+4,iofst,16);  // Store Grid Def Template num.
+      else
+        sbit(cgrib,&miss,iofst,16);   // Store missing value as Grid Def Template num.
+      iofst=iofst+16;
+      //
+      //   Get Grid Definition Template
+      //
+      if (igds[0] == 0) {
+        mapgrid=getgridtemplate(igds[4]);
+        if (mapgrid == 0) {       // undefined template
+          ierr=-5;
+          return(ierr);
+        }
+        //
+        //   Extend the Grid Definition Template, if necessary.
+        //   The number of values in a specific template may vary
+        //   depending on data specified in the "static" part of the
+        //   template.
+        //
+        if ( mapgrid->needext ) {
+          free(mapgrid);
+          mapgrid=extgridtemplate(igds[4],igdstmpl);
+        }
+      }
+      //
+      //   Pack up each input value in array igdstmpl into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapgrid.
+      //
+      for (i=0;i<mapgrid->maplen;i++) {
+        nbits=abs(mapgrid->map[i])*8;
+        if ( (mapgrid->map[i] >= 0) || (igdstmpl[i] >= 0) )
+          sbit(cgrib,igdstmpl+i,iofst,nbits);
+        else {
+          sbit(cgrib,&one,iofst,1);
+          temp=abs(igdstmpl[i]);
+          sbit(cgrib,&temp,iofst+1,nbits-1);
+        }
+        iofst=iofst+nbits;
+      }
+      //  Pack template extension, if appropriate
+      j=mapgrid->maplen;
+      if ( mapgrid->needext && (mapgrid->extlen > 0) ) {
+         for (i=0;i<mapgrid->extlen;i++) {
+           nbits=abs(mapgrid->ext[i])*8;
+           if ( (mapgrid->ext[i] >= 0) || (igdstmpl[j] >= 0) )
+             sbit(cgrib,igdstmpl+j,iofst,nbits);
+           else {
+             sbit(cgrib,&one,iofst,1);
+             temp=abs(igdstmpl[j]);
+             sbit(cgrib,&temp,iofst+1,nbits-1);
+           }
+           iofst=iofst+nbits;
+           j++;
+         }
+      }
+      free(mapgrid);
+      //
+      //   If requested,
+      //   Insert optional list of numbers defining number of points
+      //   in each row or column.  This is used for non regular
+      //   grids.
+      //
+      if ( igds[2] != 0 ) {
+         nbits=igds[2]*8;
+         sbits(cgrib,ideflist,iofst,nbits,0,idefnum);
+         iofst=iofst+(nbits*idefnum);
+      }
+      //
+      //   Calculate length of section 3 and store it in octets
+      //   1-4 of section 3.
+      //
+      lensec3=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec3,ibeg,32);
+
+//
+//  Update current byte total of message in Section 0
+//
+      lencurr+=lensec3;
+      sbit(cgrib,&lencurr,96,32);
+
+      return(lencurr);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addlocal.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addlocal.c
new file mode 100644
index 0000000..97b941a
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_addlocal.c
@@ -0,0 +1,150 @@
+/**********************************************************
+ * Version $Id: g2_addlocal.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include "grib2.h"
+
+g2int g2_addlocal(unsigned char *cgrib,unsigned char *csec2,g2int lcsec2)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_addlocal 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-11-01
+//
+// ABSTRACT: This routine adds a Local Use Section (Section 2) to 
+//   a GRIB2 message.  It is used with routines "g2_create", 
+//   "g2_addgrid", "g2_addfield",
+//   and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-01  Gilbert
+//
+// USAGE:    int g2_addlocal(unsigned char *cgrib,unsigned char *csec2,
+//                           g2int lcsec2)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array that contains the GRIB2 message to which section
+//                2 should be added.
+//     csec2    - Character array containing information to be added in
+//                Section 2.
+//     lcsec2   - Number of bytes of character array csec2 to be added to
+//                Section 2.
+//
+//   OUTPUT ARGUMENT:      
+//     cgrib    - Char array to contain the updated GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Current size of updated GRIB2 message
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine gribcreate first.
+//               -2 = GRIB message already complete.  Cannot add new section.
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 1 or 7.
+//
+// REMARKS: Note that the Local Use Section ( Section 2 ) can only follow
+//          Section 1 or Section 7 in a GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$
+{
+
+      g2int ierr; 
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char seven=0x37;   // '7'
+
+      static g2int two=2;
+      g2int   j,k,lensec2,iofst,ibeg,lencurr,ilen,len,istart;
+      g2int   isecnum;
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_addlocal: GRIB not found in given message.\n");
+        printf("g2_addlocal: Call to routine g2_create required to initialize GRIB messge.\n");
+        ierr=-1;
+        return(ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Check to see if GRIB message is already complete
+//  
+      if ( cgrib[lencurr-4]==seven && cgrib[lencurr-3]==seven && 
+           cgrib[lencurr-2]==seven && cgrib[lencurr-1]==seven ) {
+        printf("g2_addlocal: GRIB message already complete.  Cannot add new section.\n");
+        ierr=-2;
+        return(ierr);
+      }
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      len=16;    // length of Section 0
+      for (;;) { 
+      //    Get section number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_addlocal: Section byte counts don't add to total.\n");
+          printf("g2_addlocal: Sum of section byte counts = %ld\n",len);
+          printf("g2_addlocal: Total byte count in Section 0 = %ld\n",lencurr);
+          ierr=-3;
+          return(ierr);
+        }
+      }
+//
+//  Section 2 can only be added after sections 1 and 7.
+//
+      if ( (isecnum!=1) && (isecnum!=7) ) {
+        printf("g2_addlocal: Section 2 can only be added after Section 1 or Section 7.\n");
+        printf("g2_addlocal: Section %ld was the last found in given GRIB message.\n",isecnum);
+        ierr=-4;
+        return(ierr);
+      }
+//
+//  Add Section 2  - Local Use Section
+//
+      ibeg=lencurr*8;        //   Calculate offset for beginning of section 2
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&two,iofst,8);     // Store section number ( 2 )
+      istart=lencurr+5;
+      //cgrib(istart+1:istart+lcsec2)=csec2(1:lcsec2)
+      k=0;
+      for (j=istart;j<istart+lcsec2;j++) {
+         cgrib[j]=csec2[k++];
+      }
+      //
+      //   Calculate length of section 2 and store it in octets
+      //   1-4 of section 2.
+      //
+      lensec2=lcsec2+5;      // bytes
+      sbit(cgrib,&lensec2,ibeg,32);
+
+//
+//  Update current byte total of message in Section 0
+//
+      lencurr+=lensec2;
+      sbit(cgrib,&lencurr,96,32);
+
+      return(lencurr);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_create.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_create.c
new file mode 100644
index 0000000..6683650
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_create.c
@@ -0,0 +1,130 @@
+/**********************************************************
+ * Version $Id: g2_create.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include "grib2.h"
+
+#define MAPSEC1LEN 13
+
+g2int g2_create(unsigned char *cgrib,g2int *listsec0,g2int *listsec1)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_create 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine initializes a new GRIB2 message and packs
+//   GRIB2 sections 0 (Indicator Section) and 1 (Identification Section).
+//   This routine is used with routines "g2_addlocal", "g2_addgrid", 
+//   "g2_addfield", and "g2_gribend" to create a complete GRIB2 message.  
+//   g2_create must be called first to initialize a new GRIB2 message.
+//   Also, a call to g2_gribend is required to complete GRIB2 message
+//   after all fields have been added.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_create(unsigned char *cgrib,g2int *listsec0,g2int *listsec1)
+//   INPUT ARGUMENTS:
+//     cgrib    - Character array to contain the GRIB2 message
+//     listsec0 - Contains information needed for GRIB Indicator Section 0.
+//                Must be dimensioned >= 2.
+//                listsec0[0]=Discipline-GRIB Master Table Number
+//                            (see Code Table 0.0)
+//                listsec0[1]=GRIB Edition Number (currently 2)
+//     listsec1 - Contains information needed for GRIB Identification Section 1.
+//                Must be dimensioned >= 13.
+//                listsec1[0]=Id of orginating centre (Common Code Table C-1)
+//                listsec1[1]=Id of orginating sub-centre (local table)
+//                listsec1[2]=GRIB Master Tables Version Number (Code Table 1.0)
+//                listsec1[3]=GRIB Local Tables Version Number (Code Table 1.1)
+//                listsec1[4]=Significance of Reference Time (Code Table 1.2)
+//                listsec1[5]=Reference Time - Year (4 digits)
+//                listsec1[6]=Reference Time - Month
+//                listsec1[7]=Reference Time - Day
+//                listsec1[8]=Reference Time - Hour
+//                listsec1[9]=Reference Time - Minute
+//                listsec1[10]=Reference Time - Second
+//                listsec1[11]=Production status of data (Code Table 1.3)
+//                listsec1[12]=Type of processed data (Code Table 1.4)
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array to contain the new GRIB2 message.
+//                Must be allocated large enough to store the entire
+//                GRIB2 message.
+//
+//   RETURN VALUES:
+//     ierr     - return code.
+//              > 0 = Current size of new GRIB2 message
+//               -1 = Tried to use for version other than GRIB Edition 2
+//
+// REMARKS: This routine is intended for use with routines "g2_addlocal", 
+//          "g2_addgrid", "g2_addfield", and "g2_gribend" to create a complete 
+//          GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  ierr;
+      g2int   zero=0,one=1;
+      g2int   mapsec1len=MAPSEC1LEN;
+      g2int   mapsec1[MAPSEC1LEN]={ 2,2,1,1,1,2,1,1,1,1,1,1,1 };
+      g2int   i,lensec0,lensec1,iofst,ibeg,nbits,len;
+
+      ierr=0;
+//
+//  Currently handles only GRIB Edition 2.
+//  
+      if (listsec0[1] != 2) {
+        printf("g2_create: can only code GRIB edition 2.");
+        ierr=-1;
+        return (ierr);
+      }
+//
+//  Pack Section 0 - Indicator Section 
+//  ( except for total length of GRIB message )
+//
+      cgrib[0]=0x47;   // 'G'            // Beginning of GRIB message
+      cgrib[1]=0x52;   // 'R'
+      cgrib[2]=0x49;   // 'I'
+      cgrib[3]=0x42;   // 'B'
+      sbit(cgrib,&zero,32,16);           // reserved for future use
+      sbit(cgrib,listsec0+0,48,8);       // Discipline
+      sbit(cgrib,listsec0+1,56,8);       // GRIB edition number
+      lensec0=16;      // bytes (octets)
+//
+//  Pack Section 1 - Identification Section
+//
+      ibeg=lensec0*8;        //   Calculate offset for beginning of section 1
+      iofst=ibeg+32;         //   leave space for length of section
+      sbit(cgrib,&one,iofst,8);     // Store section number ( 1 )
+      iofst=iofst+8;
+      //
+      //   Pack up each input value in array listsec1 into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapsec1.
+      //
+      for (i=0;i<mapsec1len;i++) {
+        nbits=mapsec1[i]*8;
+        sbit(cgrib,listsec1+i,iofst,nbits);
+        iofst=iofst+nbits;
+      }
+      //
+      //   Calculate length of section 1 and store it in octets
+      //   1-4 of section 1.
+      //
+      lensec1=(iofst-ibeg)/8;
+      sbit(cgrib,&lensec1,ibeg,32);
+//
+//  Put current byte total of message into Section 0
+//
+      sbit(cgrib,&zero,64,32);
+      len=lensec0+lensec1;
+      sbit(cgrib,&len,96,32);
+
+      return (len);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_free.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_free.c
new file mode 100644
index 0000000..0a99e4c
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_free.c
@@ -0,0 +1,47 @@
+/**********************************************************
+ * Version $Id: g2_free.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include  "grib2.h"
+
+void g2_free(gribfield *gfld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_free 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This routine frees up memory that was allocated for
+//   struct gribfield.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:    g2_free(gribfield *gfld)
+//   ARGUMENT:
+//     gfld - pointer to gribfield structure (defined in include file grib2.h)
+//            returned from routine g2_getfld.
+//
+// REMARKS:  This routine must be called to free up memory used by
+//           the decode routine, g2_getfld, when user no longer needs to
+//           reference this data.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{ 
+
+      if (gfld->idsect != 0 ) free(gfld->idsect);
+      if (gfld->local != 0 ) free(gfld->local);
+      if (gfld->list_opt != 0 ) free(gfld->list_opt);
+      if (gfld->igdtmpl != 0 ) free(gfld->igdtmpl);
+      if (gfld->ipdtmpl != 0 ) free(gfld->ipdtmpl);
+      if (gfld->coord_list != 0 ) free(gfld->coord_list);
+      if (gfld->idrtmpl != 0 ) free(gfld->idrtmpl);
+      if (gfld->bmap != 0 ) free(gfld->bmap);
+      if (gfld->fld != 0 ) free(gfld->fld);
+      free(gfld);
+
+      return;
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_getfld.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_getfld.c
new file mode 100644
index 0000000..efc6897
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_getfld.c
@@ -0,0 +1,553 @@
+/**********************************************************
+ * Version $Id: g2_getfld.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack1(unsigned char *,g2int *,g2int **,g2int *);
+g2int g2_unpack2(unsigned char *,g2int *,g2int *,unsigned char **);
+g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
+                         g2int *,g2int **,g2int *);
+g2int g2_unpack4(unsigned char *,g2int *,g2int *,g2int **,
+                         g2int *,g2float **,g2int *);
+g2int g2_unpack5(unsigned char *,g2int *,g2int *,g2int *, g2int **,g2int *);
+g2int g2_unpack6(unsigned char *,g2int *,g2int ,g2int *, g2int **);
+g2int g2_unpack7(unsigned char *,g2int *,g2int ,g2int *,
+                         g2int ,g2int *,g2int ,g2float **);
+
+g2int g2_getfld(unsigned char *cgrib,g2int ifldnum,g2int unpack,g2int expand,
+                gribfield **gfld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_getfld 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This subroutine returns all the metadata, template values, 
+//   Bit-map ( if applicable ), and the unpacked data for a given data
+//   field.  All of the information returned is stored in a gribfield
+//   structure, which is defined in file grib2.h.
+//   Users of this routine will need to include "grib2.h" in their source
+//   code that calls this routine.  Each component of the gribfield
+//   struct is also described in the OUTPUT ARGUMENTS section below.
+//
+//   Since there can be multiple data fields packed into a GRIB2
+//   message, the calling routine indicates which field is being requested
+//   with the ifldnum argument.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:    #include "grib2.h"
+//           int g2_getfld(unsigned char *cgrib,g2int ifldnum,g2int unpack,
+//                         g2int expand,gribfield **gfld)
+//   INPUT ARGUMENTS:
+//     cgrib    - Character pointer to the GRIB2 message
+//     ifldnum  - Specifies which field in the GRIB2 message to return.
+//     unpack   - Boolean value indicating whether to unpack bitmap/data field
+//                1 = unpack bitmap (if present) and data values
+//                0 = do not unpack bitmap and data values
+//     expand   - Boolean value indicating whether the data points should be 
+//                expanded to the correspond grid, if a bit-map is present.
+//                1 = if possible, expand data field to grid, inserting zero 
+//                    values at gridpoints that are bitmapped out. 
+//                    (SEE REMARKS2)
+//                0 = do not expand data field, leaving it an array of
+//                    consecutive data points for each "1" in the bitmap.
+//                This argument is ignored if unpack == 0 OR if the
+//                returned field does not contain a bit-map.
+//
+//   OUTPUT ARGUMENT:      
+//     gribfield gfld; - pointer to structure gribfield containing
+//                       all decoded data for the data field.
+// 
+//        gfld->version = GRIB edition number ( currently 2 )
+//        gfld->discipline = Message Discipline ( see Code Table 0.0 )
+//        gfld->idsect = Contains the entries in the Identification
+//                        Section ( Section 1 )
+//                        This element is a pointer to an array
+//                        that holds the data.
+//            gfld->idsect[0]  = Identification of originating Centre
+//                                    ( see Common Code Table C-1 )
+//                             7 - US National Weather Service
+//            gfld->idsect[1]  = Identification of originating Sub-centre
+//            gfld->idsect[2]  = GRIB Master Tables Version Number
+//                                    ( see Code Table 1.0 )
+//                             0 - Experimental
+//                             1 - Initial operational version number
+//            gfld->idsect[3]  = GRIB Local Tables Version Number
+//                                    ( see Code Table 1.1 )
+//                             0     - Local tables not used
+//                             1-254 - Number of local tables version used
+//            gfld->idsect[4]  = Significance of Reference Time (Code Table 1.2)
+//                             0 - Analysis
+//                             1 - Start of forecast
+//                             2 - Verifying time of forecast
+//                             3 - Observation time
+//            gfld->idsect[5]  = Year ( 4 digits )
+//            gfld->idsect[6]  = Month
+//            gfld->idsect[7)  = Day
+//            gfld->idsect[8]  = Hour
+//            gfld->idsect[9]  = Minute
+//            gfld->idsect[10]  = Second
+//            gfld->idsect[11]  = Production status of processed data
+//                                    ( see Code Table 1.3 )
+//                              0 - Operational products
+//                              1 - Operational test products
+//                              2 - Research products
+//                              3 - Re-analysis products
+//            gfld->idsect[12]  = Type of processed data ( see Code Table 1.4 )
+//                              0  - Analysis products
+//                              1  - Forecast products
+//                              2  - Analysis and forecast products
+//                              3  - Control forecast products
+//                              4  - Perturbed forecast products
+//                              5  - Control and perturbed forecast products
+//                              6  - Processed satellite observations
+//                              7  - Processed radar observations
+//        gfld->idsectlen = Number of elements in gfld->idsect[].
+//        gfld->local   = Pointer to character array containing contents
+//                       of Local Section 2, if included
+//        gfld->locallen = length of array gfld->local[]
+//        gfld->ifldnum = field number within GRIB message
+//        gfld->griddef = Source of grid definition (see Code Table 3.0)
+//                      0 - Specified in Code table 3.1
+//                      1 - Predetermined grid Defined by originating centre
+//        gfld->ngrdpts = Number of grid points in the defined grid.
+//        gfld->numoct_opt = Number of octets needed for each
+//                          additional grid points definition.
+//                          Used to define number of
+//                          points in each row ( or column ) for
+//                          non-regular grids.
+//                          = 0, if using regular grid.
+//        gfld->interp_opt = Interpretation of list for optional points
+//                          definition.  (Code Table 3.11)
+//        gfld->igdtnum = Grid Definition Template Number (Code Table 3.1)
+//        gfld->igdtmpl  = Contains the data values for the specified Grid
+//                         Definition Template ( NN=gfld->igdtnum ).  Each
+//                         element of this integer array contains an entry (in
+//                         the order specified) of Grid Defintion Template 3.NN
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->igdtlen = Number of elements in gfld->igdtmpl[].  i.e. number of
+//                       entries in Grid Defintion Template 3.NN
+//                       ( NN=gfld->igdtnum ).
+//        gfld->list_opt  = (Used if gfld->numoct_opt .ne. 0)  This array
+//                          contains the number of grid points contained in
+//                          each row ( or column ).  (part of Section 3)
+//                          This element is a pointer to an array
+//                          that holds the data.  This pointer is nullified
+//                          if gfld->numoct_opt=0.
+//        gfld->num_opt = (Used if gfld->numoct_opt .ne. 0) 
+//                        The number of entries
+//                       in array ideflist.  i.e. number of rows ( or columns )
+//                       for which optional grid points are defined.  This value
+//                       is set to zero, if gfld->numoct_opt=0.
+//        gfdl->ipdtnum = Product Definition Template Number(see Code Table 4.0)
+//        gfld->ipdtmpl  = Contains the data values for the specified Product
+//                         Definition Template ( N=gfdl->ipdtnum ). Each element
+//                         of this integer array contains an entry (in the
+//                         order specified) of Product Defintion Template 4.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->ipdtlen = Number of elements in gfld->ipdtmpl[].  i.e. number of
+//                       entries in Product Defintion Template 4.N
+//                       ( N=gfdl->ipdtnum ).
+//        gfld->coord_list  = Real array containing floating point values
+//                            intended to document the vertical discretisation
+//                            associated to model data on hybrid coordinate
+//                            vertical levels.  (part of Section 4)
+//                            This element is a pointer to an array
+//                            that holds the data.
+//        gfld->num_coord = number of values in array gfld->coord_list[].
+//        gfld->ndpts = Number of data points unpacked and returned.
+//        gfld->idrtnum = Data Representation Template Number
+//                       ( see Code Table 5.0)
+//        gfld->idrtmpl  = Contains the data values for the specified Data
+//                         Representation Template ( N=gfld->idrtnum ).  Each
+//                         element of this integer array contains an entry
+//                         (in the order specified) of Product Defintion
+//                         Template 5.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->idrtlen = Number of elements in gfld->idrtmpl[].  i.e. number
+//                       of entries in Data Representation Template 5.N
+//                       ( N=gfld->idrtnum ).
+//        gfld->unpacked = logical value indicating whether the bitmap and
+//                        data values were unpacked.  If false,
+//                        gfld->bmap and gfld->fld pointers are nullified.
+//        gfld->expanded = Logical value indicating whether the data field 
+//                         was expanded to the grid in the case where a 
+//                         bit-map is present.  If true, the data points in
+//                         gfld->fld match the grid points and zeros were 
+//                         inserted at grid points where data was bit-mapped
+//                         out.  If false, the data values in gfld->fld were
+//                         not expanded to the grid and are just a consecutive
+//                         array of data points corresponding to each value of
+//                         "1" in gfld->bmap.
+//        gfld->ibmap = Bitmap indicator ( see Code Table 6.0 )
+//                     0 = bitmap applies and is included in Section 6.
+//                     1-253 = Predefined bitmap applies
+//                     254 = Previously defined bitmap applies to this field
+//                     255 = Bit map does not apply to this product.
+//        gfld->bmap  = integer array containing decoded bitmap,
+//                      if gfld->ibmap=0 or gfld->ibap=254.  Otherwise nullified
+//                      This element is a pointer to an array
+//                      that holds the data.
+//        gfld->fld  = Array of gfld->ndpts unpacked data points.
+//                     This element is a pointer to an array
+//                     that holds the data.
+//
+// 
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                1 = Beginning characters "GRIB" not found.
+//                2 = GRIB message is not Edition 2.
+//                3 = The data field request number was not positive.
+//                4 = End string "7777" found, but not where expected.
+//                6 = GRIB message did not contain the requested number of
+//                    data fields.
+//                7 = End string "7777" not found at end of message.
+//                8 = Unrecognized Section encountered.
+//                9 = Data Representation Template 5.NN not yet implemented.
+//               15 = Error unpacking Section 1.
+//               16 = Error unpacking Section 2.
+//               10 = Error unpacking Section 3.
+//               11 = Error unpacking Section 4.
+//               12 = Error unpacking Section 5.
+//               13 = Error unpacking Section 6.
+//               14 = Error unpacking Section 7.
+//               17 = Previous bitmap specified, yet none exists.
+//
+// REMARKS: Note that struct gribfield is allocated by this routine and it
+//          also contains pointers to many arrays of data that were allocated
+//          during decoding.  Users are encouraged to free up this memory, 
+//          when it is no longer needed, by an explicit call to routine g2_free.
+//          EXAMPLE:
+//              #include "grib2.h"
+//              gribfield *gfld;
+//              ret=g2_getfld(cgrib,1,1,1,&gfld);
+//                ...
+//              g2_free(gfld);
+//
+//          Routine g2_info can be used to first determine
+//          how many data fields exist in a given GRIB message.
+//
+// REMARKS2: It may not always be possible to expand a bit-mapped data field.
+//           If a pre-defined bit-map is used and not included in the GRIB2
+//           message itself, this routine would not have the necessary 
+//           information to expand the data.  In this case, gfld->expanded would
+//           would be set to 0 (false), regardless of the value of input 
+//           argument expand.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+    
+      g2int have3,have4,have5,have6,have7,ierr,jerr;
+      g2int numfld,j,n,istart,iofst,ipos;
+      g2int disc,ver,lensec0,lengrib,lensec,isecnum;
+      g2int  *igds;
+      g2int *bmpsave;
+      g2float *newfld;
+      gribfield  *lgfld;
+
+      have3=0;
+      have4=0;
+      have5=0;
+      have6=0;
+      have7=0;
+      ierr=0;
+      numfld=0;
+
+      lgfld=(gribfield *)malloc(sizeof(gribfield));
+      *gfld=lgfld;
+
+      lgfld->locallen=0;
+      lgfld->idsect=0;
+      lgfld->local=0;
+      lgfld->list_opt=0;
+      lgfld->igdtmpl=0;
+      lgfld->ipdtmpl=0;
+      lgfld->idrtmpl=0;
+      lgfld->coord_list=0;
+      lgfld->bmap=0;
+      lgfld->fld=0;
+//
+//  Check for valid request number
+//  
+      if (ifldnum <= 0) {
+        printf("g2_getfld: Request for field number must be positive.\n");
+        ierr=3;
+        return(ierr);
+      }
+//
+//  Check for beginning of GRIB message in the first 100 bytes
+//
+      istart=-1;
+      for (j=0;j<100;j++) {
+        if (cgrib[j]=='G' && cgrib[j+1]=='R' &&cgrib[j+2]=='I' && 
+            cgrib[j+3]=='B') {
+          istart=j;
+          break;
+        }
+      }
+      if (istart == -1) {
+        printf("g2_getfld:  Beginning characters GRIB not found.\n");
+        ierr=1;
+        return(ierr);
+      }
+//
+//  Unpack Section 0 - Indicator Section 
+//
+      iofst=8*(istart+6);
+      gbit(cgrib,&disc,iofst,8);     // Discipline
+      iofst=iofst+8;
+      gbit(cgrib,&ver,iofst,8);     // GRIB edition number
+      iofst=iofst+8;
+      iofst=iofst+32;
+      gbit(cgrib,&lengrib,iofst,32);        // Length of GRIB message
+      iofst=iofst+32;
+      lensec0=16;
+      ipos=istart+lensec0;
+//
+//  Currently handles only GRIB Edition 2.
+//  
+      if (ver != 2) {
+        printf("g2_getfld: can only decode GRIB edition 2.\n");
+        ierr=2;
+        return(ierr);
+      }
+//
+//  Loop through the remaining sections keeping track of the 
+//  length of each.  Also keep the latest Grid Definition Section info.
+//  Unpack the requested field number.
+//
+      for (;;) {
+        //    Check to see if we are at end of GRIB message
+        if (cgrib[ipos]=='7' && cgrib[ipos+1]=='7' && cgrib[ipos+2]=='7' && 
+            cgrib[ipos+3]=='7') {
+          ipos=ipos+4;
+          //    If end of GRIB message not where expected, issue error
+          if (ipos != (istart+lengrib)) {
+            printf("g2_getfld: '7777' found, but not where expected.\n");
+            ierr=4;
+            return(ierr);
+          }
+          break;
+        }
+        //     Get length of Section and Section number
+        iofst=(ipos-1)*8;
+        iofst=ipos*8;
+        gbit(cgrib,&lensec,iofst,32);        // Get Length of Section
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);         // Get Section number
+        iofst=iofst+8;
+        //printf(" lensec= %ld    secnum= %ld \n",lensec,isecnum);
+        //
+        //  Check to see if section number is valid
+        //
+        if ( isecnum<1 || isecnum>7 ) {
+          printf("g2_getfld: Unrecognized Section Encountered=%ld\n",isecnum);
+          ierr=8;
+          return(ierr);
+        }
+        //
+        //   If found Section 1, decode elements in Identification Section
+        //
+        if (isecnum == 1) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          jerr=g2_unpack1(cgrib,&iofst,&lgfld->idsect,&lgfld->idsectlen);
+          if (jerr !=0 ) {
+            ierr=15;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 2, Grab local section
+        //   Save in case this is the latest one before the requested field.
+        //
+        if (isecnum == 2) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          if (lgfld->local!=0) free(lgfld->local);
+          jerr=g2_unpack2(cgrib,&iofst,&lgfld->locallen,&lgfld->local);
+          if (jerr != 0) {
+            ierr=16;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 3, unpack the GDS info using the 
+        //   appropriate template.  Save in case this is the latest
+        //   grid before the requested field.
+        //
+        if (isecnum == 3) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          if (lgfld->igdtmpl!=0) free(lgfld->igdtmpl);
+          if (lgfld->list_opt!=0) free(lgfld->list_opt);
+          jerr=g2_unpack3(cgrib,&iofst,&igds,&lgfld->igdtmpl,
+                          &lgfld->igdtlen,&lgfld->list_opt,&lgfld->num_opt);
+          if (jerr == 0) {
+            have3=1;
+            lgfld->griddef=igds[0];
+            lgfld->ngrdpts=igds[1];
+            lgfld->numoct_opt=igds[2];
+            lgfld->interp_opt=igds[3];
+            lgfld->igdtnum=igds[4];
+          }
+          else {
+            ierr=10;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 4, check to see if this field is the
+        //   one requested.
+        //
+        if (isecnum == 4) {
+          numfld=numfld+1;
+          if (numfld == ifldnum) {
+            lgfld->discipline=disc;
+            lgfld->version=ver;
+            lgfld->ifldnum=ifldnum;
+            lgfld->unpacked=unpack;
+            lgfld->expanded=0;
+            iofst=iofst-40;       // reset offset to beginning of section
+            jerr=g2_unpack4(cgrib,&iofst,&lgfld->ipdtnum,
+                            &lgfld->ipdtmpl,&lgfld->ipdtlen,&lgfld->coord_list,
+                            &lgfld->num_coord);
+            if (jerr == 0)
+              have4=1;
+            else {
+              ierr=11;
+              return(ierr);
+            }
+          }
+        }
+        //
+        //   If found Section 5, check to see if this field is the
+        //   one requested.
+        //
+        if (isecnum == 5 && numfld == ifldnum) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          jerr=g2_unpack5(cgrib,&iofst,&lgfld->ndpts,&lgfld->idrtnum,
+                          &lgfld->idrtmpl,&lgfld->idrtlen);
+          if (jerr == 0)
+            have5=1;
+          else {
+            ierr=12;
+            return(ierr);
+          }
+        }
+        //
+        //   If found Section 6, Unpack bitmap.
+        //   Save in case this is the latest
+        //   bitmap before the requested field.
+        //
+        if (isecnum == 6) {
+          if (unpack) {   // unpack bitmap
+            iofst=iofst-40;           // reset offset to beginning of section
+            bmpsave=lgfld->bmap;      // save pointer to previous bitmap
+            jerr=g2_unpack6(cgrib,&iofst,lgfld->ngrdpts,&lgfld->ibmap,
+                         &lgfld->bmap);
+            if (jerr == 0) {
+              have6=1;
+              if (lgfld->ibmap == 254)     // use previously specified bitmap
+                 if( bmpsave!=0 ) 
+                    lgfld->bmap=bmpsave;
+                 else {
+                    printf("g2_getfld: Prev bit-map specified, but none exist.\n");
+                    ierr=17;
+                    return(ierr);
+                 }
+              else                         // get rid of it
+                 if( bmpsave!=0 ) free(bmpsave);
+            }
+            else {
+              ierr=13;
+              return(ierr);
+            }
+          }
+          else {    // do not unpack bitmap
+            gbit(cgrib,&lgfld->ibmap,iofst,8);      // Get BitMap Indicator
+            have6=1;
+          }
+        }
+        //
+        //   If found Section 7, check to see if this field is the
+        //   one requested.
+        //
+        if (isecnum==7 && numfld==ifldnum && unpack) {
+          iofst=iofst-40;       // reset offset to beginning of section
+          jerr=g2_unpack7(cgrib,&iofst,lgfld->igdtnum,lgfld->igdtmpl,
+                          lgfld->idrtnum,lgfld->idrtmpl,lgfld->ndpts,
+                          &lgfld->fld);
+          if (jerr == 0) {
+            have7=1;
+            //  If bitmap is used with this field, expand data field 
+            //  to grid, if possible.
+            if ( lgfld->ibmap != 255 && lgfld->bmap != 0 ) {
+               if ( expand == 1 ) {
+                  n=0;
+                  newfld=(g2float *)calloc(lgfld->ngrdpts,sizeof(g2float));
+                  for (j=0;j<lgfld->ngrdpts;j++) {
+                      if (lgfld->bmap[j]==1) newfld[j]=lgfld->fld[n++];
+                  }
+                  free(lgfld->fld);
+                  lgfld->fld=newfld;
+                  lgfld->expanded=1;
+               }
+               else {
+                  lgfld->expanded=0;
+               }
+            }
+            else {
+               lgfld->expanded=1;
+            }
+          }
+          else {
+            printf("g2_getfld: return from g2_unpack7 = %d \n",(int)jerr);
+            ierr=14;
+            return(ierr);
+          }
+        }
+        //
+        //   Check to see if we read pass the end of the GRIB
+        //   message and missed the terminator string '7777'.
+        //
+        ipos=ipos+lensec;                // Update beginning of section pointer
+        if (ipos > (istart+lengrib)) {
+          printf("g2_getfld: '7777'  not found at end of GRIB message.\n");
+          ierr=7;
+          return(ierr);
+        }
+        //
+        //  If unpacking requested, return when all sections have been
+        //  processed
+        //
+        if (unpack && have3 && have4 && have5 && have6 && have7)
+            return(ierr);
+        //
+        //  If unpacking is not requested, return when sections 
+        //  3 through 6 have been processed
+        //
+        if ((! unpack) && have3 && have4 && have5 && have6)
+            return(ierr);
+        
+      }
+
+//
+//  If exited from above loop, the end of the GRIB message was reached
+//  before the requested field was found.
+//
+      printf("g2_getfld: GRIB message contained %ld different fields.\n",numfld);
+      printf("g2_getfld: The request was for field %ld.\n",ifldnum);
+      ierr=6;
+
+      return(ierr);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_gribend.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_gribend.c
new file mode 100644
index 0000000..2d4c55f
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_gribend.c
@@ -0,0 +1,125 @@
+/**********************************************************
+ * Version $Id: g2_gribend.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include "grib2.h"
+
+g2int g2_gribend(unsigned char *cgrib)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_gribend 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine finalizes a GRIB2 message after all grids
+//   and fields have been added.  It adds the End Section ( "7777" )
+//   to the end of the GRIB message and calculates the length and stores
+//   it in the appropriate place in Section 0.
+//   This routine is used with routines "g2_create", "g2_addlocal", 
+//   "g2_addgrid", and "g2_addfield" to create a complete GRIB2 message.
+//   g2_create must be called first to initialize a new GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_gribend(unsigned char *cgrib)
+//   INPUT ARGUMENT:
+//     cgrib    - Char array containing all the data sections added
+//                be previous calls to g2_create, g2_addlocal, g2_addgrid,
+//                and g2_addfield.
+//
+//   OUTPUT ARGUMENTS:      
+//     cgrib    - Char array containing the finalized GRIB2 message
+//
+//   RETURN VALUES:
+//     ierr     - Return code.
+//              > 0 = Length of the final GRIB2 message in bytes.
+//               -1 = GRIB message was not initialized.  Need to call
+//                    routine g2_create first.
+//               -2 = GRIB message already complete.  
+//               -3 = Sum of Section byte counts doesn't add to total byte count
+//               -4 = Previous Section was not 7.
+//
+// REMARKS: This routine is intended for use with routines "g2_create", 
+//          "g2_addlocal", "g2_addgrid", and "g2_addfield" to create a complete 
+//          GRIB2 message.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+{
+
+      g2int iofst,lencurr,len,ilen,isecnum;
+      g2int   ierr,lengrib;
+      static unsigned char G=0x47;       // 'G'
+      static unsigned char R=0x52;       // 'R'
+      static unsigned char I=0x49;       // 'I'
+      static unsigned char B=0x42;       // 'B'
+      static unsigned char seven=0x37;   // '7'
+ 
+      ierr=0;
+//
+//  Check to see if beginning of GRIB message exists
+//
+      if ( cgrib[0]!=G || cgrib[1]!=R || cgrib[2]!=I || cgrib[3]!=B ) {
+        printf("g2_gribend: GRIB not found in given message.\n");
+        ierr=-1;
+        return (ierr);
+      }
+//
+//  Get current length of GRIB message
+//  
+      gbit(cgrib,&lencurr,96,32);
+//
+//  Loop through all current sections of the GRIB message to
+//  find the last section number.
+//
+      len=16;    // Length of Section 0
+      for (;;) { 
+      //    Get number and length of next section
+        iofst=len*8;
+        gbit(cgrib,&ilen,iofst,32);
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);
+        len=len+ilen;
+      //    Exit loop if last section reached
+        if ( len == lencurr ) break;
+      //    If byte count for each section doesn't match current
+      //    total length, then there is a problem.
+        if ( len > lencurr ) {
+          printf("g2_gribend: Section byte counts don''t add to total.\n");
+          printf("g2_gribend: Sum of section byte counts = %d\n",(int)len);
+          printf("g2_gribend: Total byte count in Section 0 = %d\n",(int)lencurr);
+          ierr=-3;
+          return (ierr);
+        }
+      }
+//
+//  Can only add End Section (Section 8) after Section 7.
+//
+      if ( isecnum != 7 ) {
+        printf("g2_gribend: Section 8 can only be added after Section 7.\n");
+        printf("g2_gribend: Section %ld was the last found in given GRIB message.\n",isecnum);
+        ierr=-4;
+        return (ierr);
+      }
+//
+//  Add Section 8  - End Section
+//
+      //cgrib(lencurr+1:lencurr+4)=c7777
+      cgrib[lencurr]=seven;
+      cgrib[lencurr+1]=seven;
+      cgrib[lencurr+2]=seven;
+      cgrib[lencurr+3]=seven;
+
+//
+//  Update current byte total of message in Section 0
+//
+      lengrib=lencurr+4;
+      sbit(cgrib,&lengrib,96,32);
+
+      return (lengrib);
+
+}
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_info.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_info.c
new file mode 100644
index 0000000..fcbc49c
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_info.c
@@ -0,0 +1,193 @@
+/**********************************************************
+ * Version $Id: g2_info.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_info(unsigned char *cgrib,g2int *listsec0,g2int *listsec1,
+            g2int *numfields,g2int *numlocal)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_info 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-28
+//
+// ABSTRACT: This subroutine searches through a GRIB2 message and
+//   returns the number of gridded fields found in the message and
+//   the number (and maximum size) of Local Use Sections.
+//   Also various checks  are performed
+//   to see if the message is a valid GRIB2 message.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  Gilbert
+//
+// USAGE:   int g2_info(unsigned char *cgrib,g2int *listsec0,g2int *listsec1,
+//            g2int *numfields,g2int *numlocal)
+//   INPUT ARGUMENT:
+//     cgrib    - Character pointer to the GRIB2 message
+//
+//   OUTPUT ARGUMENTS:      
+//     listsec0 - pointer to an array containing information decoded from 
+//                GRIB Indicator Section 0.
+//                Must be allocated with >= 3 elements.
+//                listsec0[0]=Discipline-GRIB Master Table Number
+//                            (see Code Table 0.0)
+//                listsec0[1]=GRIB Edition Number (currently 2)
+//                listsec0[2]=Length of GRIB message
+//     listsec1 - pointer to an array containing information read from GRIB 
+//                Identification Section 1.
+//                Must be allocated with >= 13 elements.
+//                listsec1[0]=Id of orginating centre (Common Code Table C-1)
+//                listsec1[1]=Id of orginating sub-centre (local table)
+//                listsec1[2]=GRIB Master Tables Version Number (Code Table 1.0)
+//                listsec1[3]=GRIB Local Tables Version Number 
+//                listsec1[4]=Significance of Reference Time (Code Table 1.1)
+//                listsec1[5]=Reference Time - Year (4 digits)
+//                listsec1[6]=Reference Time - Month
+//                listsec1[7]=Reference Time - Day
+//                listsec1[8]=Reference Time - Hour
+//                listsec1[9]=Reference Time - Minute
+//                listsec1[10]=Reference Time - Second
+//                listsec1[11]=Production status of data (Code Table 1.2)
+//                listsec1[12]=Type of processed data (Code Table 1.3)
+//     numfields- The number of gridded fields found in the GRIB message.
+//                That is, the number of occurences of Sections 4 - 7.
+//     numlocal - The number of Local Use Sections ( Section 2 ) found in 
+//                the GRIB message.
+//
+//     RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                1 = Beginning characters "GRIB" not found.
+//                2 = GRIB message is not Edition 2.
+//                3 = Could not find Section 1, where expected.
+//                4 = End string "7777" found, but not where expected.
+//                5 = End string "7777" not found at end of message.
+//                6 = Invalid section number found.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+ 
+      g2int ierr,mapsec1len=13;
+      g2int mapsec1[13]={2,2,1,1,1,2,1,1,1,1,1,1,1};
+      g2int  i,j,istart,iofst,lengrib,lensec0,lensec1;
+      g2int ipos,isecnum,nbits,lensec;
+
+      ierr=0;
+      *numlocal=0;
+      *numfields=0;
+//
+//  Check for beginning of GRIB message in the first 100 bytes
+//
+      istart=-1;
+      for (j=0;j<100;j++) {
+        if (cgrib[j]=='G' && cgrib[j+1]=='R' &&cgrib[j+2]=='I' &&
+            cgrib[j+3]=='B') {
+          istart=j;
+          break;
+        }
+      }
+      if (istart == -1) {
+        printf("g2_info:  Beginning characters GRIB not found.");
+        ierr=1;
+        return(ierr);
+      }
+//
+//  Unpack Section 0 - Indicator Section 
+//
+      iofst=8*(istart+6);
+      gbit(cgrib,listsec0+0,iofst,8);     // Discipline
+      iofst=iofst+8;
+      gbit(cgrib,listsec0+1,iofst,8);     // GRIB edition number
+      iofst=iofst+8;
+      iofst=iofst+32;
+      gbit(cgrib,&lengrib,iofst,32);        // Length of GRIB message
+      iofst=iofst+32;
+      listsec0[2]=lengrib;
+      lensec0=16;
+      ipos=istart+lensec0;
+//
+//  Currently handles only GRIB Edition 2.
+//  
+      if (listsec0[1] != 2) {
+        printf("g2_info: can only decode GRIB edition 2.");
+        ierr=2;
+        return(ierr);
+      }
+//
+//  Unpack Section 1 - Identification Section
+//
+      gbit(cgrib,&lensec1,iofst,32);        // Length of Section 1
+      iofst=iofst+32;
+      gbit(cgrib,&isecnum,iofst,8);         // Section number ( 1 )
+      iofst=iofst+8;
+      if (isecnum != 1) {
+        printf("g2_info: Could not find section 1.");
+        ierr=3;
+        return(ierr);
+      }
+      //
+      //   Unpack each input value in array listsec1 into the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapsec1.
+      //
+      for (i=0;i<mapsec1len;i++) {
+        nbits=mapsec1[i]*8;
+        gbit(cgrib,listsec1+i,iofst,nbits);
+        iofst=iofst+nbits;
+      }
+      ipos=ipos+lensec1;
+//
+//  Loop through the remaining sections to see if they are valid.
+//  Also count the number of times Section 2
+//  and Section 4 appear.
+//
+      for (;;) {
+        if (cgrib[ipos]=='7' && cgrib[ipos+1]=='7' && cgrib[ipos+2]=='7' &&
+            cgrib[ipos+3]=='7') {
+          ipos=ipos+4;
+          if (ipos != (istart+lengrib)) {
+            printf("g2_info: '7777' found, but not where expected.\n");
+            ierr=4;
+            return(ierr);
+          }
+          break;
+        }
+        
+        iofst=ipos*8;
+        gbit(cgrib,&lensec,iofst,32);        // Get Length of Section
+        iofst=iofst+32;
+        gbit(cgrib,&isecnum,iofst,8);         // Get Section number
+        iofst=iofst+8;
+        ipos=ipos+lensec;                 // Update beginning of section pointer
+        if (ipos > (istart+lengrib)) {
+          printf("g2_info: '7777'  not found at end of GRIB message.\n");
+          ierr=5;
+          return(ierr);
+        }
+        if ( isecnum>=2 && isecnum<=7 ) {
+           if (isecnum == 2)      // Local Section 2
+              //   increment counter for total number of local sections found
+              (*numlocal)++;
+            
+           else if (isecnum == 4)
+              //   increment counter for total number of fields found
+              (*numfields)++;
+        }
+        else {
+           printf("g2_info: Invalid section number found in GRIB message: %ld\n"                   ,isecnum);
+           ierr=6;
+           return(ierr);
+        }
+        
+      }
+
+      return(0);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_miss.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_miss.c
new file mode 100644
index 0000000..0bf5da3
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_miss.c
@@ -0,0 +1,72 @@
+/**********************************************************
+ * Version $Id: g2_miss.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include "grib2.h"
+
+void g2_miss( gribfield *gfld, float *rmiss, int *nmiss )
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_miss 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2004-12-16
+//
+// ABSTRACT: This routine checks the Data Representation Template to see if
+// missing value management is used, and returns the missing value(s) 
+// in the data field.
+//
+// PROGRAM HISTORY LOG:
+// 2004-12-16  Gilbert
+//
+// USAGE:    g2_miss( gribfield *gfld, float *rmiss, int *nmiss )
+//                   
+//   INPUT ARGUMENT LIST:
+//     *gfld    - pointer to gribfield structure (defined in include file 
+//                   grib2.h)
+//
+//   OUTPUT ARGUMENT LIST:      
+//     rmiss    - List of the missing values used
+//     nmiss    - NUmber of the missing values included in the field
+//
+// REMARKS:  rmiss must be allocated in the calling program with enough space 
+//           hold all the missing values.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+    g2int     itype;    
+
+    /*
+     *  Missing value management currnetly only used in
+     *  DRT's 5.2 and 5.3.
+     */
+    if ( gfld->idrtnum != 2  &&  gfld->idrtnum != 3 ) {
+       *nmiss=0;
+       return;
+    }
+                                                                                
+    itype = gfld->idrtmpl[4];
+    if ( gfld->idrtmpl[6] == 1 ) {
+         *nmiss=1;
+         if (itype == 0)
+            rdieee(gfld->idrtmpl+7,rmiss+0,1);
+         else
+            rmiss[0]=(float)gfld->idrtmpl[7];
+    }
+    else if ( gfld->idrtmpl[6] == 2 ) {
+         *nmiss=2;
+         if (itype == 0) {
+            rdieee(gfld->idrtmpl+7,rmiss+0,1);
+            rdieee(gfld->idrtmpl+8,rmiss+1,1);
+         }
+         else {
+            rmiss[0]=(float)gfld->idrtmpl[7];
+            rmiss[1]=(float)gfld->idrtmpl[8];
+         }
+    }
+    else {
+       *nmiss=0;
+    }
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack1.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack1.c
new file mode 100644
index 0000000..64332f8
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack1.c
@@ -0,0 +1,102 @@
+/**********************************************************
+ * Version $Id: g2_unpack1.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack1(unsigned char *cgrib,g2int *iofst,g2int **ids,g2int *idslen)
+/*//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack1 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine unpacks Section 1 (Identification Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+//
+// USAGE:    int g2_unpack1(unsigned char *cgrib,g2int *iofst,g2int **ids,
+//                          g2int *idslen)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 1 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 1 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 1, returned.
+//     ids      - address of pointer to integer array containing information 
+//                read from Section 1, the Identification section.
+//            ids[0]  = Identification of originating Centre
+//                                 ( see Common Code Table C-1 )
+//            ids[1]  = Identification of originating Sub-centre
+//            ids[2]  = GRIB Master Tables Version Number
+//                                 ( see Code Table 1.0 )
+//            ids[3]  = GRIB Local Tables Version Number
+//                                 ( see Code Table 1.1 )
+//            ids[4]  = Significance of Reference Time (Code Table 1.2)
+//            ids[5]  = Year ( 4 digits )
+//            ids[6]  = Month
+//            ids[7]  = Day
+//            ids[8]  = Hour
+//            ids[9]  = Minute
+//            ids[10]  = Second
+//            ids[11]  = Production status of processed data
+//                                 ( see Code Table 1.3 )
+//            ids[12]  = Type of processed data ( see Code Table 1.4 )
+//     idslen   - Number of elements in ids[].
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Array passed is not section 1
+//                6 = memory allocation error
+//
+// REMARKS: 
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+*/
+{
+
+      g2int i,lensec,nbits,ierr,isecnum;
+      g2int mapid[13]={2,2,1,1,1,2,1,1,1,1,1,1,1};
+
+      ierr=0;
+      *idslen=13;
+      *ids=0;
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 1 ) {
+         ierr=2;
+         *idslen=13;
+         fprintf(stderr,"g2_unpack1: Not Section 1 data.\n");
+         return(ierr);
+      }
+
+      //
+      //   Unpack each value into array ids from the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapid.
+      //
+      *ids=(g2int *)calloc(*idslen,sizeof(g2int));
+      if (*ids == 0) {
+         ierr=6;
+         return(ierr);
+      }
+      
+      for (i=0;i<*idslen;i++) {
+        nbits=mapid[i]*8;
+        gbit(cgrib,*ids+i,*iofst,nbits);
+        *iofst=*iofst+nbits;
+      }
+      
+      return(ierr);    // End of Section 1 processing
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack2.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack2.c
new file mode 100644
index 0000000..b05cd52
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack2.c
@@ -0,0 +1,82 @@
+/**********************************************************
+ * Version $Id: g2_unpack2.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack2(unsigned char *cgrib,g2int *iofst,g2int *lencsec2,unsigned char **csec2)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack2 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 2 (Local Use Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_unpack2(unsigned char *cgrib,g2int *iofst,g2int *lencsec2,
+//                          unsigned char **csec2)
+//   INPUT ARGUMENT LIST:
+//     cgrib    - char array containing Section 2 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 2 in cgrib.
+//
+//   OUTPUT ARGUMENT LIST:      
+//     iofst    - Bit offset at the end of Section 2, returned.
+//     lencsec2 - Length (in octets) of Local Use data
+//     csec2    - Pointer to a char array containing local use data
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Array passed is not section 2
+//                6 = memory allocation error
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE: 
+//
+//$$$//
+{
+
+      g2int ierr,isecnum;
+      g2int lensec,ipos,j;
+
+      ierr=0;
+      *lencsec2=0;
+      *csec2=0;    // NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      *lencsec2=lensec-5;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+      ipos=(*iofst/8);
+
+      if ( isecnum != 2 ) {
+         ierr=2;
+         *lencsec2=0;
+         fprintf(stderr,"g2_unpack2: Not Section 2 data.\n");
+         return(ierr);
+      }
+
+      *csec2=(unsigned char *)malloc(*lencsec2);
+      if (*csec2 == 0) {
+         ierr=6;
+         *lencsec2=0;
+         return(ierr);
+      }
+      
+      //printf(" SAGIPO %d \n",(int)ipos);
+      for (j=0;j<*lencsec2;j++) {
+         *(*csec2+j)=cgrib[ipos+j];
+      }
+      *iofst=*iofst+(*lencsec2*8);
+
+      return(ierr);    // End of Section 2 processing
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack3.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack3.c
new file mode 100644
index 0000000..aa10b92
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack3.c
@@ -0,0 +1,216 @@
+/**********************************************************
+ * Version $Id: g2_unpack3.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_unpack3(unsigned char *cgrib,g2int *iofst,g2int **igds,g2int **igdstmpl,
+                         g2int *mapgridlen,g2int **ideflist,g2int *idefnum)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack3 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This routine unpacks Section 3 (Grid Definition Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_unpack3(unsigned char *cgrib,g2int *iofst,g2int **igds,
+//                          g2int **igdstmpl,g2int *mapgridlen,
+//                          g2int **ideflist,g2int *idefnum)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array ontaining Section 3 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 3 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 3, returned.
+//     igds     - Contains information read from the appropriate GRIB Grid 
+//                Definition Section 3 for the field being returned.
+//                igds[0]=Source of grid definition (see Code Table 3.0)
+//                igds[1]=Number of grid points in the defined grid.
+//                igds[2]=Number of octets needed for each 
+//                            additional grid points definition.  
+//                            Used to define number of
+//                            points in each row ( or column ) for
+//                            non-regular grids.  
+//                            = 0, if using regular grid.
+//                igds[3]=Interpretation of list for optional points 
+//                            definition.  (Code Table 3.11)
+//                igds[4]=Grid Definition Template Number (Code Table 3.1)
+//     igdstmpl - Pointer to integer array containing the data values for 
+//                the specified Grid Definition
+//                Template ( NN=igds[4] ).  Each element of this integer 
+//                array contains an entry (in the order specified) of Grid
+//                Defintion Template 3.NN
+//     mapgridlen- Number of elements in igdstmpl[].  i.e. number of entries
+//                in Grid Defintion Template 3.NN  ( NN=igds[4] ).
+//     ideflist - (Used if igds[2] .ne. 0)  Pointer to integer array containing
+//                the number of grid points contained in each row ( or column ).
+//                (part of Section 3)
+//     idefnum  - (Used if igds[2] .ne. 0)  The number of entries
+//                in array ideflist.  i.e. number of rows ( or columns )
+//                for which optional grid points are defined.
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not Section 3
+//                5 = "GRIB" message contains an undefined Grid Definition
+//                    Template.
+//                6 = memory allocation error
+//
+// REMARKS: 
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$
+
+{
+      g2int ierr,i,j,nbits,isecnum;
+      g2int lensec,ibyttem=0,isign,newlen;
+      g2int *ligds,*ligdstmpl=0,*lideflist=0;
+      template *mapgrid;
+
+      ierr=0;
+      *igds=0;       // NULL
+      *igdstmpl=0;       // NULL
+      *ideflist=0;       // NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 3 ) {
+         ierr=2;
+         *idefnum=0;
+         *mapgridlen=0;
+        // fprintf(stderr,"g2_unpack3: Not Section 3 data.\n");
+         return(ierr);
+      }
+
+      ligds=(g2int *)calloc(5,sizeof(g2int));
+      *igds=ligds;
+
+      gbit(cgrib,ligds+0,*iofst,8);     // Get source of Grid def.
+      *iofst=*iofst+8;
+      gbit(cgrib,ligds+1,*iofst,32);    // Get number of grid pts.
+      *iofst=*iofst+32;
+      gbit(cgrib,ligds+2,*iofst,8);     // Get num octets for opt. list
+      *iofst=*iofst+8;
+      gbit(cgrib,ligds+3,*iofst,8);     // Get interpret. for opt. list
+      *iofst=*iofst+8;
+      gbit(cgrib,ligds+4,*iofst,16);    // Get Grid Def Template num.
+      *iofst=*iofst+16;
+
+      if (ligds[4] != 65535) {
+        //   Get Grid Definition Template
+        mapgrid=getgridtemplate(ligds[4]);
+        if (mapgrid == 0) {         // undefined template
+          ierr=5;
+          return(ierr);
+        }
+        *mapgridlen=mapgrid->maplen;
+        //
+        //   Unpack each value into array igdstmpl from the
+        //   the appropriate number of octets, which are specified in
+        //   corresponding entries in array mapgrid.
+        //
+        if (*mapgridlen > 0) {
+           ligdstmpl=0;
+           ligdstmpl=(g2int *)calloc(*mapgridlen,sizeof(g2int));
+           if (ligdstmpl == 0) {
+              ierr=6;
+              *mapgridlen=0;
+              *igdstmpl=0;    //NULL
+              if( mapgrid != 0 ) free(mapgrid);
+              return(ierr);
+           }
+           else {
+              *igdstmpl=ligdstmpl;
+           }
+        }
+        ibyttem=0;
+        for (i=0;i<*mapgridlen;i++) {
+          nbits=abs(mapgrid->map[i])*8;
+          if ( mapgrid->map[i] >= 0 ) {
+            gbit(cgrib,ligdstmpl+i,*iofst,nbits);
+          }
+          else {
+            gbit(cgrib,&isign,*iofst,1);
+            gbit(cgrib,ligdstmpl+i,*iofst+1,nbits-1);
+            if (isign == 1) ligdstmpl[i]=-1*ligdstmpl[i];
+          }
+          *iofst=*iofst+nbits;
+          ibyttem=ibyttem+abs(mapgrid->map[i]);
+        }
+        //
+        //   Check to see if the Grid Definition Template needs to be
+        //   extended.
+        //   The number of values in a specific template may vary
+        //   depending on data specified in the "static" part of the
+        //   template.
+        //
+        if ( mapgrid->needext == 1 ) {
+          free(mapgrid);
+          mapgrid=extgridtemplate(ligds[4],ligdstmpl);
+          //   Unpack the rest of the Grid Definition Template
+          newlen=mapgrid->maplen+mapgrid->extlen;
+          ligdstmpl=(g2int *)realloc(ligdstmpl,newlen*sizeof(g2int));
+          *igdstmpl=ligdstmpl;
+          j=0;
+          for (i=*mapgridlen;i<newlen;i++) {
+            nbits=abs(mapgrid->ext[j])*8;
+            if ( mapgrid->ext[j] >= 0 ) {
+              gbit(cgrib,ligdstmpl+i,*iofst,nbits);
+            }
+            else {
+              gbit(cgrib,&isign,*iofst,1);
+              gbit(cgrib,ligdstmpl+i,*iofst+1,nbits-1);
+              if (isign == 1) ligdstmpl[i]=-1*ligdstmpl[i];
+            }
+            *iofst=*iofst+nbits;
+            ibyttem=ibyttem+abs(mapgrid->ext[j]);
+            j++;
+          }
+          *mapgridlen=newlen;
+        }
+        if( mapgrid->ext != 0 ) free(mapgrid->ext);
+        if( mapgrid != 0 ) free(mapgrid);
+      }
+      else {              // No Grid Definition Template
+        *mapgridlen=0;
+        *igdstmpl=0;
+      }
+      //
+      //   Unpack optional list of numbers defining number of points
+      //   in each row or column, if included.  This is used for non regular
+      //   grids.
+      //
+      if ( ligds[2] != 0 ) {
+         nbits=ligds[2]*8;
+         *idefnum=(lensec-14-ibyttem)/ligds[2];
+         if (*idefnum > 0) lideflist=(g2int *)calloc(*idefnum,sizeof(g2int));
+         if (lideflist == 0) {
+            ierr=6;
+            *idefnum=0;
+            *ideflist=0;   //NULL
+            return(ierr);
+         }
+         else {
+            *ideflist=lideflist;
+         }
+         gbits(cgrib,lideflist,*iofst,nbits,0,*idefnum);
+         *iofst=*iofst+(nbits*(*idefnum));
+      }
+      else {
+         *idefnum=0;
+         *ideflist=0;    // NULL
+      }
+      
+      return(ierr);    // End of Section 3 processing
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack4.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack4.c
new file mode 100644
index 0000000..cc5cabf
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack4.c
@@ -0,0 +1,187 @@
+/**********************************************************
+ * Version $Id: g2_unpack4.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_unpack4(unsigned char *cgrib,g2int *iofst,g2int *ipdsnum,g2int **ipdstmpl,
+               g2int *mappdslen,g2float **coordlist,g2int *numcoord)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack4 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 4 (Product Definition Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_unpack4(unsigned char *cgrib,g2int *iofst,g2int *ipdsnum,
+//                          g2int **ipdstmpl,g2int *mappdslen,
+//                          g2float **coordlist,g2int *numcoord)
+//   INPUT ARGUMENTS:
+//     cgrib    - Char array containing Section 4 of the GRIB2 message
+//     iofst    - Bit offset of the beginning of Section 4 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset of the end of Section 4, returned.
+//     ipdsnum  - Product Definition Template Number ( see Code Table 4.0)
+//     ipdstmpl - Pointer to integer array containing the data values for 
+//                the specified Product Definition
+//                Template ( N=ipdsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Product
+//                Defintion Template 4.N
+//     mappdslen- Number of elements in ipdstmpl[].  i.e. number of entries
+//                in Product Defintion Template 4.N  ( N=ipdsnum ).
+//     coordlist- Pointer to real array containing floating point values 
+//                intended to document
+//                the vertical discretisation associated to model data
+//                on hybrid coordinate vertical levels.  (part of Section 4)
+//     numcoord - number of values in array coordlist.
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not section 4
+//                5 = "GRIB" message contains an undefined Product Definition
+//                    Template.
+//                6 = memory allocation error
+//
+// REMARKS: 
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$//
+{
+
+      g2int ierr,needext,i,j,nbits,isecnum;
+      g2int lensec,isign,newlen;
+      g2int *coordieee;
+      g2int *lipdstmpl=0;
+      g2float *lcoordlist;
+      template *mappds;
+
+      ierr=0;
+      *ipdstmpl=0;    // NULL
+      *coordlist=0;    // NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 4 ) {
+         ierr=2;
+         *numcoord=0;
+         *mappdslen=0;
+        // fprintf(stderr,"g2_unpack4: Not Section 4 data.\n");
+         return(ierr);
+      }
+
+      gbit(cgrib,numcoord,*iofst,16);    // Get num of coordinate values
+      *iofst=*iofst+16;
+      gbit(cgrib,ipdsnum,*iofst,16);    // Get Prod. Def Template num.
+      *iofst=*iofst+16;
+
+      //   Get Product Definition Template
+      mappds=getpdstemplate(*ipdsnum);
+      if (mappds == 0) {       // undefine template
+        ierr=5;
+        *mappdslen=0;
+        return(ierr);
+      }
+      *mappdslen=mappds->maplen;
+      needext=mappds->needext;
+      //
+      //   Unpack each value into array ipdstmpl from the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mappds.
+      //
+      if (*mappdslen > 0) lipdstmpl=(g2int *)calloc(*mappdslen,sizeof(g2int));
+      if (lipdstmpl == 0) {
+         ierr=6;
+         *mappdslen=0;
+         *ipdstmpl=0;     //NULL
+         if ( mappds != 0 ) free(mappds);
+         return(ierr);
+      }
+      else {
+         *ipdstmpl=lipdstmpl;
+      }
+      for (i=0;i<mappds->maplen;i++) {
+        nbits=abs(mappds->map[i])*8;
+        if ( mappds->map[i] >= 0 ) {
+          gbit(cgrib,lipdstmpl+i,*iofst,nbits);
+        }
+        else {
+          gbit(cgrib,&isign,*iofst,1);
+          gbit(cgrib,lipdstmpl+i,*iofst+1,nbits-1);
+          if (isign == 1) lipdstmpl[i]=-1*lipdstmpl[i];
+        }
+        *iofst=*iofst+nbits;
+      }
+      //
+      //   Check to see if the Product Definition Template needs to be
+      //   extended.
+      //   The number of values in a specific template may vary
+      //   depending on data specified in the "static" part of the
+      //   template.
+      //
+      if ( needext ==1 ) {
+        free(mappds);
+        mappds=extpdstemplate(*ipdsnum,lipdstmpl);
+        newlen=mappds->maplen+mappds->extlen;
+        lipdstmpl=(g2int *)realloc(lipdstmpl,newlen*sizeof(g2int));
+        *ipdstmpl=lipdstmpl;
+        //   Unpack the rest of the Product Definition Template
+        j=0;
+        for (i=*mappdslen;i<newlen;i++) {
+          nbits=abs(mappds->ext[j])*8;
+          if ( mappds->ext[j] >= 0 ) {
+            gbit(cgrib,lipdstmpl+i,*iofst,nbits);
+          }
+          else {
+            gbit(cgrib,&isign,*iofst,1);
+            gbit(cgrib,lipdstmpl+i,*iofst+1,nbits-1);
+            if (isign == 1) lipdstmpl[i]=-1*lipdstmpl[i];
+          }
+          *iofst=*iofst+nbits;
+          j++;
+        }
+        *mappdslen=newlen;
+      }
+      if( mappds->ext != 0 ) free(mappds->ext);
+      if( mappds != 0 ) free(mappds);
+      //
+      //   Get Optional list of vertical coordinate values
+      //   after the Product Definition Template, if necessary.
+      //
+      *coordlist=0;    // NULL
+      if ( *numcoord != 0 ) {
+         coordieee=(g2int *)calloc(*numcoord,sizeof(g2int));
+         lcoordlist=(g2float *)calloc(*numcoord,sizeof(g2float));
+         if (coordieee == 0 || lcoordlist == 0) {
+            ierr=6;
+            *numcoord=0;
+            *coordlist=0;    // NULL
+            if( coordieee != 0 ) free(coordieee);
+            if( lcoordlist != 0 ) free(lcoordlist);
+            return(ierr);
+         }
+         else {
+            *coordlist=lcoordlist;
+         }
+        gbits(cgrib,coordieee,*iofst,32,0,*numcoord);
+        rdieee(coordieee,*coordlist,*numcoord);
+        free(coordieee);
+        *iofst=*iofst+(32*(*numcoord));
+      }
+      
+      return(ierr);    // End of Section 4 processing
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack5.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack5.c
new file mode 100644
index 0000000..0f2f992
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack5.c
@@ -0,0 +1,154 @@
+/**********************************************************
+ * Version $Id: g2_unpack5.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int g2_unpack5(unsigned char *cgrib,g2int *iofst,g2int *ndpts,g2int *idrsnum,
+               g2int **idrstmpl,g2int *mapdrslen)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack5 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 5 (Data Representation Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_unpack5(unsigned char *cgrib,g2int *iofst,g2int *ndpts,
+//                          g2int *idrsnum,g2int **idrstmpl,g2int *mapdrslen)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 5 of the GRIB2 message
+//     iofst    - Bit offset for the beginning of Section 5 in cgrib.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 5, returned.
+//     ndpts    - Number of data points unpacked and returned.
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0)
+//     idrstmpl - Pointer to an integer array containing the data values for 
+//                the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//     mapdrslen- Number of elements in idrstmpl[].  i.e. number of entries
+//                in Data Representation Template 5.N  ( N=idrsnum ).
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not Section 5
+//                6 = memory allocation error
+//                7 = "GRIB" message contains an undefined Data
+//                    Representation Template.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$//
+{
+      g2int ierr,needext,i,j,nbits,isecnum;
+      g2int lensec,isign,newlen;
+      g2int *lidrstmpl=0;
+      template *mapdrs;
+
+      ierr=0;
+      *idrstmpl=0;       //NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 5 ) {
+         ierr=2;
+         *ndpts=0;
+         *mapdrslen=0;
+        // fprintf(stderr,"g2_unpack5: Not Section 5 data.\n");
+         return(ierr);
+      }
+
+      gbit(cgrib,ndpts,*iofst,32);    // Get num of data points
+      *iofst=*iofst+32;
+      gbit(cgrib,idrsnum,*iofst,16);     // Get Data Rep Template Num.
+      *iofst=*iofst+16;
+
+      //   Gen Data Representation Template
+      mapdrs=getdrstemplate(*idrsnum);
+      if (mapdrs == 0) {
+        ierr=7;
+        *mapdrslen=0;
+        return(ierr);
+      }
+      *mapdrslen=mapdrs->maplen;
+      needext=mapdrs->needext;
+      //
+      //   Unpack each value into array ipdstmpl from the
+      //   the appropriate number of octets, which are specified in
+      //   corresponding entries in array mapdrs.
+      //
+      if (*mapdrslen > 0) lidrstmpl=(g2int *)calloc(*mapdrslen,sizeof(g2int));
+      if (lidrstmpl == 0) {
+         ierr=6;
+         *mapdrslen=0;
+         *idrstmpl=0;     //NULL
+         if ( mapdrs != 0 ) free(mapdrs);
+         return(ierr);
+      }
+      else {
+         *idrstmpl=lidrstmpl;
+      }
+      for (i=0;i<mapdrs->maplen;i++) {
+        nbits=abs(mapdrs->map[i])*8;
+        if ( mapdrs->map[i] >= 0 ) {
+          gbit(cgrib,lidrstmpl+i,*iofst,nbits);
+        }
+        else {
+          gbit(cgrib,&isign,*iofst,1);
+          gbit(cgrib,lidrstmpl+i,*iofst+1,nbits-1);
+          if (isign == 1) lidrstmpl[i]=-1*lidrstmpl[i];
+        }
+        *iofst=*iofst+nbits;
+      }
+      //
+      //   Check to see if the Data Representation Template needs to be
+      //   extended.
+      //   The number of values in a specific template may vary
+      //   depending on data specified in the "static" part of the
+      //   template.
+      //
+      if ( needext == 1 ) {
+        free(mapdrs);
+        mapdrs=extdrstemplate(*idrsnum,lidrstmpl);
+        newlen=mapdrs->maplen+mapdrs->extlen;
+        lidrstmpl=(g2int *)realloc(lidrstmpl,newlen*sizeof(g2int));
+        *idrstmpl=lidrstmpl;
+        //   Unpack the rest of the Data Representation Template
+        j=0;
+        for (i=*mapdrslen;i<newlen;i++) {
+          nbits=abs(mapdrs->ext[j])*8;
+          if ( mapdrs->ext[j] >= 0 ) {
+            gbit(cgrib,lidrstmpl+i,*iofst,nbits);
+          }
+          else {
+            gbit(cgrib,&isign,*iofst,1);
+            gbit(cgrib,lidrstmpl+i,*iofst+1,nbits-1);
+            if (isign == 1) lidrstmpl[i]=-1*lidrstmpl[i];
+          }
+          *iofst=*iofst+nbits;
+          j++;
+        }
+        *mapdrslen=newlen;
+      }
+      if( mapdrs->ext != 0 ) free(mapdrs->ext);
+      if( mapdrs != 0 ) free(mapdrs);
+
+      return(ierr);    // End of Section 5 processing
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack6.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack6.c
new file mode 100644
index 0000000..d7686e0
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack6.c
@@ -0,0 +1,100 @@
+/**********************************************************
+ * Version $Id: g2_unpack6.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack6(unsigned char *cgrib,g2int *iofst,g2int ngpts,g2int *ibmap,
+               g2int **bmap)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack6 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 6 (Bit-Map Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+//
+// USAGE:    int g2_unpack6(unsigned char *cgrib,g2int *iofst,g2int ngpts,
+//                          g2int *ibmap,g2int **bmap)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 6 of the GRIB2 message
+//     iofst    - Bit offset of the beginning of Section 6 in cgrib.
+//     ngpts    - Number of grid points specified in the bit-map
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 6, returned.
+//     ibmap    - Bitmap indicator ( see Code Table 6.0 )
+//                0 = bitmap applies and is included in Section 6.
+//                1-253 = Predefined bitmap applies
+//                254 = Previously defined bitmap applies to this field
+//                255 = Bit map does not apply to this product.
+//     bmap     - Pointer to an integer array containing decoded bitmap. 
+//                ( if ibmap=0 )
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not Section 6
+//                4 = Unrecognized pre-defined bit-map.
+//                6 = memory allocation error
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$//
+{
+      g2int j,ierr,isecnum;
+      g2int *lbmap=0;
+      g2int *intbmap;
+
+      ierr=0;
+      *bmap=0;    //NULL
+
+      *iofst=*iofst+32;    // skip Length of Section
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8; 
+
+      if ( isecnum != 6 ) {
+         ierr=2;
+         fprintf(stderr,"g2_unpack6: Not Section 6 data.\n");
+         return(ierr);
+      }
+
+      gbit(cgrib,ibmap,*iofst,8);    // Get bit-map indicator
+      *iofst=*iofst+8;
+
+      if (*ibmap == 0) {               // Unpack bitmap
+         if (ngpts > 0) lbmap=(g2int *)calloc(ngpts,sizeof(g2int));
+         if (lbmap == 0) {
+            ierr=6;
+            return(ierr);
+         }
+         else {
+            *bmap=lbmap;
+         }
+         intbmap=(g2int *)calloc(ngpts,sizeof(g2int));  
+         gbits(cgrib,intbmap,*iofst,1,0,ngpts);
+         *iofst=*iofst+ngpts;
+         for (j=0;j<ngpts;j++) {
+           lbmap[j]=(g2int)intbmap[j];
+         }
+         free(intbmap);
+//      else if (*ibmap.eq.254)               ! Use previous bitmap
+//        return(ierr);
+//      else if (*ibmap.eq.255)               ! No bitmap in message
+//        bmap(1:ngpts)=.true.
+//      else {
+//        print *,'gf_unpack6: Predefined bitmap ',*ibmap,' not recognized.'
+//        ierr=4;
+      }
+      
+      return(ierr);    // End of Section 6 processing
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack7.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack7.c
new file mode 100644
index 0000000..a76ab99
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/g2_unpack7.c
@@ -0,0 +1,154 @@
+/**********************************************************
+ * Version $Id: g2_unpack7.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <string.h>
+#include "grib2.h"
+
+g2int simunpack(unsigned char *,g2int *, g2int,g2float *);
+int comunpack(unsigned char *,g2int,g2int,g2int *,g2int,g2float *);
+g2int specunpack(unsigned char *,g2int *,g2int,g2int,g2int, g2int, g2float *);
+#ifdef USE_PNG
+  g2int pngunpack(unsigned char *,g2int,g2int *,g2int, g2float *);
+#endif  /* USE_PNG */
+#ifdef USE_JPEG2000
+  g2int jpcunpack(unsigned char *,g2int,g2int *,g2int, g2float *);
+#endif  /* USE_JPEG2000 */
+
+g2int g2_unpack7(unsigned char *cgrib,g2int *iofst,g2int igdsnum,g2int *igdstmpl,
+               g2int idrsnum,g2int *idrstmpl,g2int ndpts,g2float **fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    g2_unpack7 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-31
+//
+// ABSTRACT: This subroutine unpacks Section 7 (Data Section)
+//           as defined in GRIB Edition 2.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-31  Gilbert
+// 2002-12-20  Gilbert - Added GDT info to arguments
+//                       and added 5.51 processing.
+// 2003-08-29  Gilbert  - Added support for new templates using
+//                        PNG and JPEG2000 algorithms/templates.
+// 2004-11-29  Gilbert  - JPEG2000 now allowed to use WMO Template no. 5.40
+//                        PNG now allowed to use WMO Template no. 5.41
+// 2004-12-16  Taylor   - Added check on comunpack return code.
+//
+// USAGE:    int g2_unpack7(unsigned char *cgrib,g2int *iofst,g2int igdsnum,
+//                          g2int *igdstmpl, g2int idrsnum,
+//                          g2int *idrstmpl, g2int ndpts,g2float **fld)
+//   INPUT ARGUMENTS:
+//     cgrib    - char array containing Section 7 of the GRIB2 message
+//     iofst    - Bit offset of the beginning of Section 7 in cgrib.
+//     igdsnum  - Grid Definition Template Number ( see Code Table 3.0)
+//                ( Only used for DRS Template 5.51 )
+//     igdstmpl - Pointer to an integer array containing the data values for
+//                the specified Grid Definition
+//                Template ( N=igdsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Grid
+//                Definition Template 3.N
+//                ( Only used for DRS Template 5.51 )
+//     idrsnum  - Data Representation Template Number ( see Code Table 5.0)
+//     idrstmpl - Pointer to an integer array containing the data values for
+//                the specified Data Representation
+//                Template ( N=idrsnum ).  Each element of this integer
+//                array contains an entry (in the order specified) of Data
+//                Representation Template 5.N
+//     ndpts    - Number of data points unpacked and returned.
+//
+//   OUTPUT ARGUMENTS:      
+//     iofst    - Bit offset at the end of Section 7, returned.
+//     fld      - Pointer to a float array containing the unpacked data field.
+//
+//   RETURN VALUES:
+//     ierr     - Error return code.
+//                0 = no error
+//                2 = Not section 7
+//                4 = Unrecognized Data Representation Template
+//                5 = need one of GDT 3.50 through 3.53 to decode DRT 5.51
+//                6 = memory allocation error
+//                7 = corrupt section 7.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:
+//
+//$$$//
+{
+      g2int ierr,isecnum;
+      g2int ipos,lensec;
+      g2float *lfld;
+
+      ierr=0;
+      *fld=0;     //NULL
+
+      gbit(cgrib,&lensec,*iofst,32);        // Get Length of Section
+      *iofst=*iofst+32;    
+      gbit(cgrib,&isecnum,*iofst,8);         // Get Section Number
+      *iofst=*iofst+8;
+
+      if ( isecnum != 7 ) {
+         ierr=2;
+         //fprintf(stderr,"g2_unpack7: Not Section 7 data.\n");
+         return(ierr);
+      }
+
+      ipos=(*iofst/8);
+      lfld=(g2float *)calloc(ndpts,sizeof(g2float));
+      if (lfld == 0) {
+         ierr=6;
+         return(ierr);
+      }
+      else {
+         *fld=lfld;
+      }
+
+      if (idrsnum == 0) 
+        simunpack(cgrib+ipos,idrstmpl,ndpts,lfld);
+      else if (idrsnum == 2 || idrsnum == 3) {
+        if (comunpack(cgrib+ipos,lensec,idrsnum,idrstmpl,ndpts,lfld) != 0) {
+          return 7;
+        }
+      }
+      else if (idrsnum == 50) {            // Spectral Simple
+        simunpack(cgrib+ipos,idrstmpl,ndpts-1,lfld+1);
+        rdieee(idrstmpl+4,lfld+0,1);
+      }
+      else if (idrsnum == 51)              //  Spectral complex
+        if ( igdsnum>=50 && igdsnum <=53 ) 
+          specunpack(cgrib+ipos,idrstmpl,ndpts,igdstmpl[0],igdstmpl[2],igdstmpl[2],lfld);
+        else {
+          fprintf(stderr,"g2_unpack7: Cannot use GDT 3.%d to unpack Data Section 5.51.\n",(int)igdsnum);
+          ierr=5;
+          if ( lfld != 0 ) free(lfld);
+          *fld=0;     //NULL
+          return(ierr);
+        }
+#ifdef USE_JPEG2000
+      else if (idrsnum == 40 || idrsnum == 40000) {
+        jpcunpack(cgrib+ipos,lensec-5,idrstmpl,ndpts,lfld);
+        }
+#endif  /* USE_JPEG2000 */
+#ifdef USE_PNG
+      else if (idrsnum == 41 || idrsnum == 40010) {
+        pngunpack(cgrib+ipos,lensec-5,idrstmpl,ndpts,lfld);
+        }
+#endif  /* USE_PNG */
+      else {
+        fprintf(stderr,"g2_unpack7: Data Representation Template 5.%d not yet implemented.\n",(int)idrsnum);
+        ierr=4;
+        if ( lfld != 0 ) free(lfld);
+        *fld=0;     //NULL
+        return(ierr);
+      }
+
+      *iofst=*iofst+(8*lensec);
+      
+      return(ierr);    // End of Section 7 processing
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/gbits.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/gbits.c
new file mode 100644
index 0000000..a85cace
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/gbits.c
@@ -0,0 +1,127 @@
+/**********************************************************
+ * Version $Id: gbits.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include "grib2.h"
+
+void gbit(unsigned char *in,g2int *iout,g2int iskip,g2int nbyte)
+{
+      gbits(in,iout,iskip,nbyte,(g2int)0,(g2int)1);
+}
+
+void sbit(unsigned char *out,g2int *in,g2int iskip,g2int nbyte)
+{
+      sbits(out,in,iskip,nbyte,(g2int)0,(g2int)1);
+}
+
+
+void gbits(unsigned char *in,g2int *iout,g2int iskip,g2int nbyte,g2int nskip,
+           g2int n)
+/*          Get bits - unpack bits:  Extract arbitrary size values from a
+/          packed bit string, right justifying each value in the unpacked
+/          iout array.
+/           *in    = pointer to character array input
+/           *iout  = pointer to unpacked array output
+/            iskip = initial number of bits to skip
+/            nbyte = number of bits to take
+/            nskip = additional number of bits to skip on each iteration
+/            n     = number of iterations
+/ v1.1
+*/
+{
+      g2int i,tbit,bitcnt,ibit,itmp;
+      g2int nbit,index;
+      static g2int ones[]={1,3,7,15,31,63,127,255};
+
+//     nbit is the start position of the field in bits
+      nbit = iskip;
+      for (i=0;i<n;i++) {
+         bitcnt = nbyte;
+         index=nbit/8;
+         ibit=nbit%8;
+         nbit = nbit + nbyte + nskip;
+
+//        first byte
+         tbit= ( bitcnt < (8-ibit) ) ? bitcnt : 8-ibit;  // find min
+         itmp = (int)*(in+index) & ones[7-ibit];
+         if (tbit != 8-ibit) itmp >>= (8-ibit-tbit);
+         index++;
+         bitcnt = bitcnt - tbit;
+
+//        now transfer whole bytes
+         while (bitcnt >= 8) {
+             itmp = itmp<<8 | (int)*(in+index);
+             bitcnt = bitcnt - 8;
+             index++;
+         }
+
+//        get data from last byte
+         if (bitcnt > 0) {
+             itmp = ( itmp << bitcnt ) | ( ((int)*(in+index) >> (8-bitcnt)) & ones[bitcnt-1] );
+         }
+
+         *(iout+i) = itmp;
+      }
+}
+
+
+void sbits(unsigned char *out,g2int *in,g2int iskip,g2int nbyte,g2int nskip,
+           g2int n)
+/*C          Store bits - pack bits:  Put arbitrary size values into a
+/          packed bit string, taking the low order bits from each value
+/          in the unpacked array.
+/           *iout  = pointer to packed array output
+/           *in    = pointer to unpacked array input
+/            iskip = initial number of bits to skip
+/            nbyte = number of bits to pack
+/            nskip = additional number of bits to skip on each iteration
+/            n     = number of iterations
+/ v1.1
+*/
+{
+      g2int i,bitcnt,tbit,ibit,itmp,imask,itmp2,itmp3;
+      g2int nbit,index;
+      static g2int ones[]={1,3,7,15,31,63,127,255};
+
+//     number bits from zero to ...
+//     nbit is the last bit of the field to be filled
+
+      nbit = iskip + nbyte - 1;
+      for (i=0;i<n;i++) {
+         itmp = *(in+i);
+         bitcnt = nbyte;
+         index=nbit/8;
+         ibit=nbit%8;
+         nbit = nbit + nbyte + nskip;
+
+//        make byte aligned 
+         if (ibit != 7) {
+             tbit= ( bitcnt < (ibit+1) ) ? bitcnt : ibit+1;  // find min
+             imask = ones[tbit-1] << (7-ibit);
+             itmp2 = (itmp << (7-ibit)) & imask;
+             itmp3 = (int)*(out+index) & (255-imask);
+             out[index] = (unsigned char)(itmp2 | itmp3);
+             bitcnt = bitcnt - tbit;
+             itmp = itmp >> tbit;
+             index--;
+         }
+
+//        now byte aligned
+
+//        do by bytes
+         while (bitcnt >= 8) {
+             out[index] = (unsigned char)(itmp & 255);
+             itmp = itmp >> 8;
+             bitcnt = bitcnt - 8;
+             index--;
+         }
+
+//        do last byte
+
+         if (bitcnt > 0) {
+             itmp2 = itmp & ones[bitcnt-1];
+             itmp3 = (int)*(out+index) & (255-ones[bitcnt-1]);
+             out[index] = (unsigned char)(itmp2 | itmp3);
+         }
+      }
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/getdim.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/getdim.c
new file mode 100644
index 0000000..7ea9246
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/getdim.c
@@ -0,0 +1,130 @@
+/**********************************************************
+ * Version $Id: getdim.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
+                         g2int *,g2int **,g2int *);
+
+g2int getdim(unsigned char *csec3,g2int *width,g2int *height,g2int *iscan)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getdim 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-12-11
+//
+// ABSTRACT: This subroutine returns the dimensions and scanning mode of 
+//   a grid definition packed in GRIB2 Grid Definition Section 3 format.
+//
+// PROGRAM HISTORY LOG:
+// 2002-12-11  Gilbert
+//
+// USAGE:    int getdim(unsigned char *csec3,g2int *width,
+//                      g2int *height, g2int *iscan)
+//   INPUT ARGUMENT LIST:
+//     csec3    - Character array that contains the packed GRIB2 GDS
+//
+//   OUTPUT ARGUMENT LIST:      
+//     width    - x (or i) dimension of the grid.
+//     height   - y (or j) dimension of the grid.
+//     iscan    - Scanning mode ( see Code Table 3.4 )
+//
+// REMARKS:  Returns width and height set to zero, if grid template
+//           not recognized.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+    
+      g2int  *igdstmpl,*list_opt;
+      g2int  *igds;
+      g2int  iofst,igdtlen,num_opt,jerr;
+
+      igdstmpl=0;
+      list_opt=0;
+      igds=0;
+      iofst=0;       // set offset to beginning of section
+      jerr= g2_unpack3(csec3,&iofst,&igds,&igdstmpl,
+                       &igdtlen,&list_opt,&num_opt);
+      if (jerr == 0) {
+         switch ( igds[4] )     //  Template number
+         {
+           case 0:    // Lat/Lon
+           case 1:
+           case 2:
+           case 3:
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[18];
+              break;
+           }
+           case 10:   // Mercator
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[15];
+              break;
+           }
+           case 20:   // Polar Stereographic
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[17];
+              break;
+           }
+           case 30:   // Lambert Conformal
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[17];
+              break;
+           }
+           case 40:   // Gaussian
+           case 41:
+           case 42:
+           case 43:
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[18];
+              break;
+           }
+           case 90:   // Space View/Orthographic
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[16];
+              break;
+           }
+           case 110:   // Equatorial Azimuthal
+           {
+              *width=igdstmpl[7];
+              *height=igdstmpl[8];
+              *iscan=igdstmpl[15];
+              break;
+           }
+           default:
+           {
+              *width=0;
+              *height=0;
+              *iscan=0;
+              break;
+           }
+         }  // end switch
+      }
+      else {
+         *width=0;
+         *height=0;
+      }
+
+      if (igds != 0) free(igds);
+      if (igdstmpl != 0) free(igdstmpl);
+      if (list_opt != 0) free(list_opt);
+
+      return 0;
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/getpoly.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/getpoly.c
new file mode 100644
index 0000000..53bca0c
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/getpoly.c
@@ -0,0 +1,83 @@
+/**********************************************************
+ * Version $Id: getpoly.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+g2int g2_unpack3(unsigned char *,g2int *,g2int **,g2int **,
+                         g2int *,g2int **,g2int *);
+
+g2int getpoly(unsigned char *csec3,g2int *jj,g2int *kk,g2int *mm)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getpoly 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-12-11
+//
+// ABSTRACT: This subroutine returns the J, K, and M pentagonal resolution
+//   parameters specified in a GRIB Grid Definition Section used
+//   spherical harmonic coefficients using GDT 5.50 through 5.53
+//
+// PROGRAM HISTORY LOG:
+// 2002-12-11  Gilbert
+//
+// USAGE:    int getpoly(unsigned char *csec3,g2int *jj,g2int *kk,g2int *mm)
+//   INPUT ARGUMENTS:
+//     csec3    - Character array that contains the packed GRIB2 GDS
+//
+//   OUTPUT ARGUMENTS:      
+//         JJ   = J - pentagonal resolution parameter
+//         KK   = K - pentagonal resolution parameter
+//         MM   = M - pentagonal resolution parameter
+//
+// REMARKS:  Returns JJ, KK, and MM set to zero, if grid template
+//           not recognized.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+    
+      g2int   *igdstmpl,*list_opt;
+      g2int   *igds;
+      g2int   iofst,igdtlen,num_opt,jerr;
+
+      iofst=0;       // set offset to beginning of section
+      jerr=g2_unpack3(csec3,&iofst,&igds,&igdstmpl,
+                      &igdtlen,&list_opt,&num_opt);
+      if (jerr == 0) {
+         switch ( igds[4] )     //  Template number
+         {
+           case 50:     // Spherical harmonic coefficients
+           case 51:
+           case 52:
+           case 53:
+           {
+              *jj=igdstmpl[0];
+              *kk=igdstmpl[1];
+              *mm=igdstmpl[2];
+              break;
+           }
+           default:
+           {
+              *jj=0;
+              *kk=0;
+              *mm=0;
+              break;
+           }
+         }     // end switch
+      }
+      else {
+         *jj=0;
+         *kk=0;
+         *mm=0;
+      }
+        
+      if (igds != 0) free(igds);
+      if (igdstmpl != 0) free(igdstmpl);
+      if (list_opt != 0) free(list_opt);
+
+      return 0;
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/grib2.h b/src/modules/io/io_grid_grib2/g2clib-1.0.4/grib2.h
new file mode 100644
index 0000000..592db4a
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/grib2.h
@@ -0,0 +1,254 @@
+/**********************************************************
+ * Version $Id: grib2.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef _grib2_H
+#define _grib2_H
+#include<stdio.h>
+
+#ifdef _SAGA_MSW
+extern double rint(double x);
+#endif
+
+#define G2_VERSION "g2clib-1.0.4"
+/*                .      .    .                                       .
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-25
+//
+//   Each element of structure gribfield is defined as:
+//   
+//   gribfield gfld;
+//
+//        gfld->version = GRIB edition number ( currently 2 )
+//        gfld->discipline = Message Discipline ( see Code Table 0.0 )
+//        gfld->idsect = Contains the entries in the Identification
+//                        Section ( Section 1 )
+//                        This element is a pointer to an array
+//                        that holds the data.
+//            gfld->idsect[0]  = Identification of originating Centre
+//                                    ( see Common Code Table C-1 )
+//                             7 - US National Weather Service
+//            gfld->idsect[1]  = Identification of originating Sub-centre
+//            gfld->idsect[2]  = GRIB Master Tables Version Number
+//                                    ( see Code Table 1.0 )
+//                             0 - Experimental
+//                             1 - Initial operational version number
+//            gfld->idsect[3]  = GRIB Local Tables Version Number
+//                                    ( see Code Table 1.1 )
+//                             0     - Local tables not used
+//                             1-254 - Number of local tables version used
+//            gfld->idsect[4]  = Significance of Reference Time (Code Table 1.2)
+//                             0 - Analysis
+//                             1 - Start of forecast
+//                             2 - Verifying time of forecast
+//                             3 - Observation time
+//            gfld->idsect[5]  = Year ( 4 digits )
+//            gfld->idsect[6]  = Month
+//            gfld->idsect[7)  = Day
+//            gfld->idsect[8]  = Hour
+//            gfld->idsect[9]  = Minute
+//            gfld->idsect[10]  = Second
+//            gfld->idsect[11]  = Production status of processed data
+//                                    ( see Code Table 1.3 )
+//                              0 - Operational products
+//                              1 - Operational test products
+//                              2 - Research products
+//                              3 - Re-analysis products
+//            gfld->idsect[12]  = Type of processed data ( see Code Table 1.4 )
+//                              0  - Analysis products
+//                              1  - Forecast products
+//                              2  - Analysis and forecast products
+//                              3  - Control forecast products
+//                              4  - Perturbed forecast products
+//                              5  - Control and perturbed forecast products
+//                              6  - Processed satellite observations
+//                              7  - Processed radar observations
+//        gfld->idsectlen = Number of elements in gfld->idsect[].
+//        gfld->local   = Pointer to character array containing contents
+//                       of Local Section 2, if included
+//        gfld->locallen = length of array gfld->local[]
+//        gfld->ifldnum = field number within GRIB message
+//        gfld->griddef = Source of grid definition (see Code Table 3.0)
+//                      0 - Specified in Code table 3.1
+//                      1 - Predetermined grid Defined by originating centre
+//        gfld->ngrdpts = Number of grid points in the defined grid.
+//        gfld->numoct_opt = Number of octets needed for each
+//                          additional grid points definition.
+//                          Used to define number of
+//                          points in each row ( or column ) for
+//                          non-regular grids.
+//                          = 0, if using regular grid.
+//        gfld->interp_opt = Interpretation of list for optional points
+//                          definition.  (Code Table 3.11)
+//        gfld->igdtnum = Grid Definition Template Number (Code Table 3.1)
+//        gfld->igdtmpl  = Contains the data values for the specified Grid
+//                         Definition Template ( NN=gfld->igdtnum ).  Each
+//                         element of this integer array contains an entry (in
+//                         the order specified) of Grid Defintion Template 3.NN
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->igdtlen = Number of elements in gfld->igdtmpl[].  i.e. number of
+//                       entries in Grid Defintion Template 3.NN
+//                       ( NN=gfld->igdtnum ).
+//        gfld->list_opt  = (Used if gfld->numoct_opt .ne. 0)  This array
+//                          contains the number of grid points contained in
+//                          each row ( or column ).  (part of Section 3)
+//                          This element is a pointer to an array
+//                          that holds the data.  This pointer is nullified
+//                          if gfld->numoct_opt=0.
+//        gfld->num_opt = (Used if gfld->numoct_opt .ne. 0)  The number of entries
+//                       in array ideflist.  i.e. number of rows ( or columns )
+//                       for which optional grid points are defined.  This value
+//                       is set to zero, if gfld->numoct_opt=0.
+//        gfdl->ipdtnum = Product Definition Template Number (see Code Table 4.0)
+//        gfld->ipdtmpl  = Contains the data values for the specified Product
+//                         Definition Template ( N=gfdl->ipdtnum ).  Each element
+//                         of this integer array contains an entry (in the
+//                         order specified) of Product Defintion Template 4.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->ipdtlen = Number of elements in gfld->ipdtmpl[].  i.e. number of
+//                       entries in Product Defintion Template 4.N
+//                       ( N=gfdl->ipdtnum ).
+//        gfld->coord_list  = Real array containing floating point values
+//                            intended to document the vertical discretisation
+//                            associated to model data on hybrid coordinate
+//                            vertical levels.  (part of Section 4)
+//                            This element is a pointer to an array
+//                            that holds the data.
+//        gfld->num_coord = number of values in array gfld->coord_list[].
+//        gfld->ndpts = Number of data points unpacked and returned.
+//        gfld->idrtnum = Data Representation Template Number
+//                       ( see Code Table 5.0)
+//        gfld->idrtmpl  = Contains the data values for the specified Data
+//                         Representation Template ( N=gfld->idrtnum ).  Each
+//                         element of this integer array contains an entry
+//                         (in the order specified) of Product Defintion
+//                         Template 5.N.
+//                         This element is a pointer to an array
+//                         that holds the data.
+//        gfld->idrtlen = Number of elements in gfld->idrtmpl[].  i.e. number
+//                       of entries in Data Representation Template 5.N
+//                       ( N=gfld->idrtnum ).
+//        gfld->unpacked = logical value indicating whether the bitmap and
+//                        data values were unpacked.  If false,
+//                        gfld->bmap and gfld->fld pointers are nullified.
+//        gfld->expanded = Logical value indicating whether the data field 
+//                         was expanded to the grid in the case where a 
+//                         bit-map is present.  If true, the data points in
+//                         gfld->fld match the grid points and zeros were 
+//                         inserted at grid points where data was bit-mapped
+//                         out.  If false, the data values in gfld->fld were
+//                         not expanded to the grid and are just a consecutive
+//                         array of data points corresponding to each value of
+//                         "1" in gfld->bmap.
+//        gfld->ibmap = Bitmap indicator ( see Code Table 6.0 )
+//                     0 = bitmap applies and is included in Section 6.
+//                     1-253 = Predefined bitmap applies
+//                     254 = Previously defined bitmap applies to this field
+//                     255 = Bit map does not apply to this product.
+//        gfld->bmap  = integer array containing decoded bitmap,
+//                      if gfld->ibmap=0 or gfld->ibap=254.  Otherwise nullified.
+//                      This element is a pointer to an array
+//                      that holds the data.
+//        gfld->fld  = Array of gfld->ndpts unpacked data points.
+//                     This element is a pointer to an array
+//                     that holds the data.
+*/
+
+#ifdef __64BIT__
+typedef int g2int;
+typedef unsigned int g2intu;
+#else
+typedef long g2int;
+typedef unsigned long g2intu;
+#endif
+typedef float g2float;
+
+struct _template {
+   g2int type;           /* 3=Grid Defintion Template.                       */
+                         /* 4=Product Defintion Template.                    */
+                         /* 5=Data Representation Template.                  */
+   g2int num;            /* template number.                                 */
+   g2int maplen;         /* number of entries in the static part             */
+                         /*                    of the template.              */
+   g2int *map;           /* num of octets of each entry in the               */
+                         /*         static part of the template.             */
+   g2int needext;        /* indicates whether or not the template needs      */
+                         /*     to be extended.                              */
+   g2int extlen;         /* number of entries in the template extension.     */
+   g2int *ext;           /* num of octets of each entry in the extension     */
+                         /*                      part of the template.       */
+};
+
+typedef struct _template _template;
+
+#define template _template
+
+struct gribfield {
+   g2int   version,discipline;
+   g2int   *idsect;
+   g2int   idsectlen;
+   unsigned char *local;
+   g2int   locallen;
+   g2int   ifldnum;
+   g2int   griddef,ngrdpts;
+   g2int   numoct_opt,interp_opt,num_opt;
+   g2int   *list_opt;
+   g2int   igdtnum,igdtlen;
+   g2int   *igdtmpl;
+   g2int   ipdtnum,ipdtlen;
+   g2int   *ipdtmpl;
+   g2int   num_coord;
+   g2float *coord_list;
+   g2int   ndpts,idrtnum,idrtlen;
+   g2int   *idrtmpl;
+   g2int   unpacked;
+   g2int   expanded;
+   g2int   ibmap;
+   g2int   *bmap;
+   g2float *fld;
+};
+
+typedef struct gribfield gribfield;
+
+
+/*  Prototypes for unpacking API  */
+void seekgb(FILE *,g2int ,g2int ,g2int *,g2int *);
+g2int g2_info(unsigned char *,g2int *,g2int *,g2int *,g2int *);
+g2int g2_getfld(unsigned char *,g2int ,g2int ,g2int ,gribfield **);
+void g2_free(gribfield *);
+
+/*  Prototypes for packing API  */
+g2int g2_create(unsigned char *,g2int *,g2int *);
+g2int g2_addlocal(unsigned char *,unsigned char *,g2int );
+g2int g2_addgrid(unsigned char *,g2int *,g2int *,g2int *,g2int ); 
+g2int g2_addfield(unsigned char *,g2int ,g2int *,
+                       g2float *,g2int ,g2int ,g2int *,
+                       g2float *,g2int ,g2int ,g2int *);
+g2int g2_gribend(unsigned char *);
+
+/*  Prototypes for supporting routines  */
+extern double int_power(double, g2int );
+extern void mkieee(g2float *,g2int *,g2int);
+void rdieee(g2int *,g2float *,g2int );
+extern _template *getpdstemplate(g2int);
+extern _template *extpdstemplate(g2int,g2int *);
+extern _template *getdrstemplate(g2int);
+extern _template *extdrstemplate(g2int,g2int *);
+extern _template *getgridtemplate(g2int);
+extern _template *extgridtemplate(g2int,g2int *);
+extern void simpack(g2float *,g2int,g2int *,unsigned char *,g2int *);
+extern void compack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *);
+void misspack(g2float *,g2int ,g2int ,g2int *, unsigned char *, g2int *);
+void gbit(unsigned char *,g2int *,g2int ,g2int );
+void sbit(unsigned char *,g2int *,g2int ,g2int );
+void gbits(unsigned char *,g2int *,g2int ,g2int ,g2int ,g2int );
+void sbits(unsigned char *,g2int *,g2int ,g2int ,g2int ,g2int );
+
+int pack_gp(g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *, g2int *, g2int *,
+            g2int *, g2int *, g2int *);
+
+#endif  /*  _grib2_H  */
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/gridtemplates.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/gridtemplates.c
new file mode 100644
index 0000000..bbec4ae
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/gridtemplates.c
@@ -0,0 +1,176 @@
+/**********************************************************
+ * Version $Id: gridtemplates.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include "grib2.h"
+#include "gridtemplates.h"
+
+g2int getgridindex(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getgridindex
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-06-28
+!
+! ABSTRACT: This function returns the index of specified Grid
+!   Definition Template 3.NN (NN=number) in array templates.
+!
+! PROGRAM HISTORY LOG:
+! 2001-06-28  Gilbert
+!
+! USAGE:    index=getgridindex(number)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Grid Definition
+!                Template 3.NN that is being requested.
+!
+! RETURNS:  Index of GDT 3.NN in array templates, if template exists.
+!           = -1, otherwise.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int j,getgridindex=-1;
+
+           for (j=0;j<MAXGRIDTEMP;j++) {
+              if (number == templatesgrid[j].template_num) {
+                 getgridindex=j;
+                 return(getgridindex);
+              }
+           }
+
+           return(getgridindex);
+}
+
+template *getgridtemplate(g2int number)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    getgridtemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-09
+!
+! ABSTRACT: This subroutine returns grid template information for a 
+!   specified Grid Definition Template 3.NN.
+!   The number of entries in the template is returned along with a map
+!   of the number of octets occupied by each entry.  Also, a flag is
+!   returned to indicate whether the template would need to be extended.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-09  Gilbert
+!
+! USAGE:    template *getgridtemplate(number)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Grid Definition 
+!                Template 3.NN that is being requested.
+!
+!   RETURN VALUE:
+!        - Pointer to the returned template struct.
+!          Returns NULL pointer, if template not found.
+!
+! REMARKS: None
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           g2int index;
+           template *new;
+
+           index=getgridindex(number);
+
+           if (index != -1) {
+              new=(template *)malloc(sizeof(template));
+              new->type=3;
+              new->num=templatesgrid[index].template_num;
+              new->maplen=templatesgrid[index].mapgridlen;
+              new->needext=templatesgrid[index].needext;
+              new->map=(g2int *)templatesgrid[index].mapgrid;
+              new->extlen=0;
+              new->ext=0;        //NULL
+              return(new);
+           }
+           else {
+             printf("getgridtemplate: GDT Template 3.%d not defined.\n",(int)number);
+             return(0);        //NULL
+           }
+
+         return(0);        //NULL
+}
+
+
+template *extgridtemplate(g2int number,g2int *list)
+/*!$$$  SUBPROGRAM DOCUMENTATION BLOCK
+!                .      .    .                                       .
+! SUBPROGRAM:    extgridtemplate 
+!   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-09
+!
+! ABSTRACT: This subroutine generates the remaining octet map for a 
+!   given Grid Definition Template, if required.  Some Templates can 
+!   vary depending on data values given in an earlier part of the 
+!   Template, and it is necessary to know some of the earlier entry
+!   values to generate the full octet map of the Template.
+!
+! PROGRAM HISTORY LOG:
+! 2000-05-09  Gilbert
+!
+! USAGE:    CALL extgridtemplate(number,list)
+!   INPUT ARGUMENT LIST:
+!     number   - NN, indicating the number of the Grid Definition 
+!                Template 3.NN that is being requested.
+!     list()   - The list of values for each entry in 
+!                the Grid Definition Template.
+!
+!   RETURN VALUE:
+!        - Pointer to the returned template struct.
+!          Returns NULL pointer, if template not found.
+!
+! ATTRIBUTES:
+!   LANGUAGE: C
+!   MACHINE:  IBM SP
+!
+!$$$*/
+{
+           template *new;
+           g2int index,i;
+
+           index=getgridindex(number);
+           if (index == -1) return(0);
+
+           new=getgridtemplate(number);
+
+           if ( ! new->needext ) return(new);
+
+           if ( number == 120 ) {
+              new->extlen=list[1]*2;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 if ( i%2 == 0 ) {
+                    new->ext[i]=2;
+                 }
+                 else {
+                    new->ext[i]=-2;
+                 }
+              }
+           }
+           else if ( number == 1000 ) {
+              new->extlen=list[19];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=4;
+              }
+           }
+           else if ( number == 1200 ) {
+              new->extlen=list[15];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=4;
+              }
+           }
+
+           return(new);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/gridtemplates.h b/src/modules/io/io_grid_grib2/g2clib-1.0.4/gridtemplates.h
new file mode 100644
index 0000000..7e79c1d
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/gridtemplates.h
@@ -0,0 +1,99 @@
+/**********************************************************
+ * Version $Id: gridtemplates.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef _gridtemplates_H
+#define _gridtemplates_H
+#include "grib2.h"
+
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-10-26
+//
+// ABSTRACT: This Fortran Module contains info on all the available 
+//   GRIB2 Grid Definition Templates used in Section 3 (GDS).
+//   The information decribing each template is stored in the
+//   gridtemplate structure defined below.
+//
+//   Each Template has three parts: The number of entries in the template
+//   (mapgridlen);  A map of the template (mapgrid), which contains the
+//   number of octets in which to pack each of the template values; and
+//   a logical value (needext) that indicates whether the Template needs 
+//   to be extended.  In some cases the number of entries in a template 
+//   can vary depending upon values specified in the "static" part of 
+//   the template.  ( See Template 3.120 as an example )
+//
+//   NOTE:  Array mapgrid contains the number of octets in which the 
+//   corresponding template values will be stored.  A negative value in
+//   mapgrid is used to indicate that the corresponding template entry can
+//   contain negative values.  This information is used later when packing
+//   (or unpacking) the template data values.  Negative data values in GRIB
+//   are stored with the left most bit set to one, and a negative number
+//   of octets value in mapgrid[] indicates that this possibility should
+//   be considered.  The number of octets used to store the data value
+//   in this case would be the absolute value of the negative value in 
+//   mapgrid[].
+//  
+//
+////////////////////////////////////////////////////////////////////
+
+      #define MAXGRIDTEMP 23              // maximum number of templates
+      #define MAXGRIDMAPLEN 200           // maximum template map length
+
+      struct gridtemplate
+      {
+          g2int template_num;
+          g2int mapgridlen;
+          g2int needext;
+          g2int mapgrid[MAXGRIDMAPLEN];
+      };
+
+      const struct gridtemplate templatesgrid[MAXGRIDTEMP] = {
+             // 3.0: Lat/Lon grid
+         { 0, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+             // 3.1: Rotated Lat/Lon grid
+         { 1, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+             // 3.2: Stretched Lat/Lon grid
+         { 2, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+             // 3.3: Stretched & Rotated Lat/Lon grid
+         { 3, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+             // 3.10: Mercator
+         {10, 19, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,-4,4,1,4,4,4} },
+             // 3.20: Polar Stereographic Projection
+         {20, 18, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1} },
+             // 3.30: Lambert Conformal
+         {30, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+             // 3.31: Albers equal area
+         {31, 22, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,-4,4,4,4,1,1,-4,-4,-4,4} },
+             // 3.40: Guassian Lat/Lon
+         {40, 19, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1} },
+             // 3.41: Rotated Gaussian Lat/Lon
+         {41, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4} },
+             // 3.42: Stretched Gaussian Lat/Lon
+         {42, 22, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,-4} },
+             // 3.43: Stretched and Rotated Gaussian Lat/Lon
+         {43, 25, 0, {1,1,4,1,4,1,4,4,4,4,4,-4,4,1,-4,4,4,4,1,-4,4,4,-4,4,-4} },
+             // 3.50: Spherical Harmonic Coefficients
+         {50, 5, 0, {4,4,4,1,1} },
+             // 3.51: Rotated Spherical Harmonic Coefficients
+         {51, 8, 0, {4,4,4,1,1,-4,4,4} },
+             // 3.52: Stretched Spherical Harmonic Coefficients
+         {52, 8, 0, {4,4,4,1,1,-4,4,-4} },
+             // 3.53: Stretched and Rotated Spherical Harmonic Coefficients
+         {53, 11, 0, {4,4,4,1,1,-4,4,4,-4,4,-4} },
+             // 3.90: Space View Perspective or orthographic
+         {90, 21, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,4,4,1,4,4,4,4} },
+             // 3.100: Triangular grid based on an icosahedron
+         {100, 11, 0, {1,1,2,1,-4,4,4,1,1,1,4} },
+             // 3.110: Equatorial Azimuthal equidistant
+         {110, 16, 0, {1,1,4,1,4,1,4,4,4,-4,4,1,4,4,1,1} },
+             // 3.120: Azimuth-range projection
+         {120, 7, 1, {4,4,-4,4,4,4,1} },
+             // 3.1000: Cross Section Grid
+         {1000, 20, 1, {1,1,4,1,4,1,4,4,4,4,-4,4,1,4,4,1,2,1,1,2} },
+             // 3.1100: Hovmoller Diagram Grid
+         {1100, 28, 0, {1,1,4,1,4,1,4,4,4,4,-4,4,1,-4,4,1,4,1,-4,1,1,-4,2,1,1,1,1,1} },
+             // 3.1200: Time Section Grid
+         {1200, 16, 1, {4,1,-4,1,1,-4,2,1,1,1,1,1,2,1,1,2} }
+
+      } ;
+
+
+#endif  /*  _gridtemplates_H  */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/int_power.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/int_power.c
new file mode 100644
index 0000000..b5fed32
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/int_power.c
@@ -0,0 +1,33 @@
+/**********************************************************
+ * Version $Id: int_power.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include "grib2.h"
+/*
+ * w. ebisuzaki
+ *
+ *  return x**y
+ *
+ *
+ *  input: double x
+ *         int y
+ */
+double int_power(double x, g2int y) {
+
+        double value;
+
+        if (y < 0) {
+                y = -y;
+                x = 1.0 / x;
+        }
+        value = 1.0;
+
+        while (y) {
+                if (y & 1) {
+                        value *= x;
+                }
+                x = x * x;
+                y >>= 1;
+        }
+        return value;
+}
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/jpcpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/jpcpack.c
new file mode 100644
index 0000000..2b42039
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/jpcpack.c
@@ -0,0 +1,178 @@
+/**********************************************************
+ * Version $Id: jpcpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+int enc_jpeg2000(unsigned char *,g2int ,g2int ,g2int ,
+                 g2int , g2int, g2int , char *, g2int );
+
+void jpcpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+             unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    jpcpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-17
+//
+// ABSTRACT: This subroutine packs up a data field into a JPEG2000 code stream.
+//   After the data field is scaled, and the reference value is subtracted out,
+//   it is treated as a grayscale image and passed to a JPEG2000 encoder.
+//   It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with 
+//   the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-17  Gilbert
+// 2004-11-92  Gilbert  - Fixed bug encountered when packing a near constant
+//                        field.
+// 2004-07-19  Gilbert - Added check on whether the jpeg2000 encoding was
+//                       successful.  If not, try again with different encoder
+//                       options.
+// 2005-05-10  Gilbert - Imposed minimum size on cpack, used to hold encoded
+//                       bit string.
+//
+// USAGE:    jpcpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+//                   unsigned char *cpack,g2int *lcpack);
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     width    - number of points in the x direction
+//     height   - number of points in the y direction
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.40 or 5.40000
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                [3] = number of bits for each data value - ignored on input
+//                [4] = Original field type - currently ignored on input
+//                      Data values assumed to be reals.
+//                [5] = 0 - use lossless compression
+//                    = 1 - use lossy compression
+//                [6] = Desired compression ratio, if idrstmpl[5]=1.
+//                      Set to 255, if idrstmpl[5]=0.
+//     lcpack   - size of array cpack[]
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.0
+//                [0] = Reference value - set by jpcpack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                [3] = Number of bits containing each grayscale pixel value
+//                [4] = Original field type - currently set = 0 on output.
+//                      Data values assumed to be reals.
+//                [5] = 0 - use lossless compression
+//                    = 1 - use lossy compression
+//                [6] = Desired compression ratio, if idrstmpl[5]=1
+//     cpack    - The packed data field 
+//     lcpack   - length of packed field in cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+      g2int  *ifld;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      g2int  j,nbits,imin,imax,maxdif;
+      g2int  ndpts,nbytes,nsize,retry;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      unsigned char *ctemp;
+      
+      ifld=0;
+      ndpts=width*height;
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+      if (idrstmpl[1] == 0) 
+         maxdif = (g2int) (rint(rmax*dscale) - rint(rmin*dscale));
+      else
+         maxdif = (g2int)rint( (rmax-rmin)*dscale*bscale );
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if ( rmin != rmax  &&  maxdif != 0 ) {
+        ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+        //
+        //  Determine which algorithm to use based on user-supplied 
+        //  binary scale factor and number of bits.
+        //
+        if (idrstmpl[1] == 0) {
+           //
+           //  No binary scaling and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           imin=(g2int)rint(rmin*dscale);
+           imax=(g2int)rint(rmax*dscale);
+           maxdif=imax-imin;
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           rmin=(g2float)imin;
+           //   scale data
+           for(j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else {
+           //
+           //  Use binary scaling factor and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxdif=(g2int)rint((rmax-rmin)*bscale);
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Pack data into full octets, then do JPEG 2000 encode.
+        //  and calculate the length of the packed data in bytes
+        //
+        retry=0;
+        nbytes=(nbits+7)/8;
+        nsize=*lcpack;          // needed for input to enc_jpeg2000
+        ctemp=calloc(ndpts,nbytes);
+        sbits(ctemp,ifld,0,nbytes*8,0,ndpts);
+        *lcpack=(g2int)enc_jpeg2000(ctemp,width,height,nbits,idrstmpl[5],idrstmpl[6],retry,(char *)cpack,nsize);
+        if (*lcpack <= 0) {
+           printf("jpcpack: ERROR Packing JPC = %d\n",(int)*lcpack);
+           if ( *lcpack == -3 ) {
+              retry=1;
+              *lcpack=(g2int)enc_jpeg2000(ctemp,width,height,nbits,idrstmpl[5],idrstmpl[6],retry,(char *)cpack,nsize);
+              if ( *lcpack <= 0 ) printf("jpcpack: Retry Failed.\n");
+              else printf("jpcpack: Retry Successful.\n");
+           }
+        }
+        free(ctemp);
+
+      }
+      else {
+        nbits=0;
+        *lcpack=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.0
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbits;
+      idrstmpl[4]=0;         // original data were reals
+      if (idrstmpl[5] == 0) idrstmpl[6]=255;       // lossy not used
+      if (ifld != 0) free(ifld);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/jpcunpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/jpcunpack.c
new file mode 100644
index 0000000..7640bda
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/jpcunpack.c
@@ -0,0 +1,75 @@
+/**********************************************************
+ * Version $Id: jpcunpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+   int dec_jpeg2000(char *,g2int ,g2int *);
+
+g2int jpcunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+                g2float *fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    jpcunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-27
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed into a 
+//   JPEG2000 code stream
+//   using info from the GRIB2 Data Representation Template 5.40 or 5.40000.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-27  Gilbert
+//
+// USAGE:    jpcunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+//                     g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - The packed data field (character*1 array)
+//     len      - length of packed field cpack().
+//     idrstmpl - Pointer to array of values for Data Representation
+//                Template 5.40 or 5.40000
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld[]    - Contains the unpacked data values
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int  *ifld;
+      g2int  j,nbits,iret;
+      g2float  ref,bscale,dscale;
+
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+//
+//  if nbits equals 0, we have a constant field where the reference value
+//  is the data value at each gridpoint
+//
+      if (nbits != 0) {
+
+         ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+         if ( ifld == 0 ) {
+            fprintf(stderr,"Could not allocate space in jpcunpack.\n  Data field NOT upacked.\n");
+            return(1);
+         }
+         iret=(g2int)dec_jpeg2000(cpack,len,ifld);
+         for (j=0;j<ndpts;j++) {
+           fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale;
+         }
+         free(ifld);
+      }
+      else {
+         for (j=0;j<ndpts;j++) fld[j]=ref;
+      }
+
+      return(0);
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/misspack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/misspack.c
new file mode 100644
index 0000000..ff69fac
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/misspack.c
@@ -0,0 +1,535 @@
+/**********************************************************
+ * Version $Id: misspack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+void misspack(g2float *fld,g2int ndpts,g2int idrsnum,g2int *idrstmpl,
+              unsigned char *cpack, g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    misspack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2000-06-21
+//
+// ABSTRACT: This subroutine packs up a data field using a complex
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   supports GRIB2 complex packing templates with or without
+//   spatial differences (i.e. DRTs 5.2 and 5.3).
+//   It also fills in GRIB2 Data Representation Template 5.2 or 5.3 
+//   with the appropriate values.
+//   This version assumes that Missing Value Management is being used and that
+//   1 or 2 missing values appear in the data.
+//
+// PROGRAM HISTORY LOG:
+// 2000-06-21  Gilbert
+//
+// USAGE:    misspack(g2float *fld,g2int ndpts,g2int idrsnum,g2int *idrstmpl,
+//                    unsigned char *cpack, g2int *lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrsnum  - Data Representation Template number 5.N
+//                Must equal 2 or 3.
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.2 or 5.3
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                    .
+//                    .
+//                [6] = Missing value management
+//                [7] = Primary missing value
+//                [8] = Secondary missing value
+//                    .
+//                    .
+//               [16] = Order of Spatial Differencing  ( 1 or 2 )
+//                    .
+//                    .
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.3
+//                [0] = Reference value - set by misspack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                    .
+//                    .
+//     cpack    - The packed data field (character*1 array)
+//     *lcpack   - length of packed field cpack().
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  *ifld, *ifldmiss, *jfld;
+      g2int  *jmin, *jmax, *lbit;
+      static g2int zero=0;
+      g2int  *gref, *gwidth, *glen;
+      g2int  glength, grpwidth;
+      g2int  i, n, iofst, imin, ival1, ival2, isd, minsd, nbitsd;
+      g2int  nbitsgref, left, iwmax, ngwidthref, nbitsgwidth, ilmax;
+      g2int  nglenref, nglenlast, nbitsglen, ij;
+      g2int  j, missopt, nonmiss, itemp, maxorig, nbitorig, miss1, miss2;
+      g2int  ngroups, ng, num0, num1, num2;
+      g2int  imax, lg, mtemp, ier, igmax;
+      g2int  kfildo, minpk, inc, maxgrps, ibit, jbit, kbit, novref, lbitref;
+      g2float  rmissp, rmisss, bscale, dscale, rmin, temp;
+      static g2int simple_alg = 0;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      static g2int one=1;
+      
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+      missopt=idrstmpl[6];
+      if ( missopt != 1 && missopt != 2 ) {
+         printf("misspack: Unrecognized option.\n");
+         *lcpack=-1;
+         return;
+      }
+      else {    //  Get missing values
+         rdieee(idrstmpl+7,&rmissp,1);
+         if (missopt == 2) rdieee(idrstmpl+8,&rmisss,1);
+      }
+//
+//  Find min value of non-missing values in the data,
+//  AND set up missing value mapping of the field.
+//
+      ifldmiss = calloc(ndpts,sizeof(g2int));
+      rmin=1E+37;
+      if ( missopt ==  1 ) {        // Primary missing value only
+         for ( j=0; j<ndpts; j++) {
+           if (fld[j] == rmissp) {
+              ifldmiss[j]=1;
+           }
+           else {
+              ifldmiss[j]=0;
+              if (fld[j] < rmin) rmin=fld[j];
+           }
+         }
+      }
+      if ( missopt ==  2 ) {        // Primary and secondary missing values
+         for ( j=0; j<ndpts; j++ ) {
+           if (fld[j] == rmissp) {
+              ifldmiss[j]=1;
+           }
+           else if (fld[j] == rmisss) {
+              ifldmiss[j]=2;
+           }
+           else {
+              ifldmiss[j]=0;
+              if (fld[j] < rmin) rmin=fld[j];
+           }
+         }
+      }
+//
+//  Allocate work arrays:
+//  Note: -ifldmiss[j],j=0,ndpts-1 is a map of original field indicating 
+//         which of the original data values
+//         are primary missing (1), sencondary missing (2) or non-missing (0).
+//        -jfld[j],j=0,nonmiss-1 is a subarray of just the non-missing values 
+//         from the original field.
+//
+      //if (rmin != rmax) {
+        iofst=0;
+        ifld = calloc(ndpts,sizeof(g2int));
+        jfld = calloc(ndpts,sizeof(g2int));
+        gref = calloc(ndpts,sizeof(g2int));
+        gwidth = calloc(ndpts,sizeof(g2int));
+        glen = calloc(ndpts,sizeof(g2int));
+        //
+        //  Scale original data
+        //
+        nonmiss=0;
+        if (idrstmpl[1] == 0) {        //  No binary scaling
+           imin=(g2int)rint(rmin*dscale);
+           //imax=(g2int)rint(rmax*dscale);
+           rmin=(g2float)imin;
+           for ( j=0; j<ndpts; j++) {
+              if (ifldmiss[j] == 0) {
+                jfld[nonmiss]=(g2int)rint(fld[j]*dscale)-imin;
+                nonmiss++;
+              }
+           }
+        }
+        else {                             //  Use binary scaling factor
+           rmin=rmin*dscale;
+           //rmax=rmax*dscale;
+           for ( j=0; j<ndpts; j++ ) {
+              if (ifldmiss[j] == 0) {
+                jfld[nonmiss]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+                nonmiss++;
+              }
+           }
+        }
+        //
+        //  Calculate Spatial differences, if using DRS Template 5.3
+        //
+        if (idrsnum == 3) {        // spatial differences
+           if (idrstmpl[16]!=1 && idrstmpl[16]!=2) idrstmpl[16]=2;
+           if (idrstmpl[16] == 1) {      // first order
+              ival1=jfld[0];
+              for ( j=nonmiss-1; j>0; j--)
+                 jfld[j]=jfld[j]-jfld[j-1];
+              jfld[0]=0;
+           }
+           else if (idrstmpl[16] == 2) {      // second order
+              ival1=jfld[0];
+              ival2=jfld[1];
+              for ( j=nonmiss-1; j>1; j--)
+                 jfld[j]=jfld[j]-(2*jfld[j-1])+jfld[j-2];
+              jfld[0]=0;
+              jfld[1]=0;
+           }
+           //
+           //  subtract min value from spatial diff field
+           //
+           isd=idrstmpl[16];
+           minsd=jfld[isd];
+           for ( j=isd; j<nonmiss; j++ ) if ( jfld[j] < minsd ) minsd=jfld[j];
+           for ( j=isd; j<nonmiss; j++ ) jfld[j]=jfld[j]-minsd;
+           //
+           //   find num of bits need to store minsd and add 1 extra bit
+           //   to indicate sign
+           //
+           temp=log((double)(abs(minsd)+1))/alog2;
+           nbitsd=(g2int)ceil(temp)+1;
+           //
+           //   find num of bits need to store ifld[0] ( and ifld[1]
+           //   if using 2nd order differencing )
+           //
+           maxorig=ival1;
+           if (idrstmpl[16]==2 && ival2>ival1) maxorig=ival2;
+           temp=log((double)(maxorig+1))/alog2;
+           nbitorig=(g2int)ceil(temp)+1;
+           if (nbitorig > nbitsd) nbitsd=nbitorig;
+           //   increase number of bits to even multiple of 8 ( octet )
+           if ( (nbitsd%8) != 0) nbitsd=nbitsd+(8-(nbitsd%8));
+           //
+           //  Store extra spatial differencing info into the packed
+           //  data section.
+           //
+           if (nbitsd != 0) {
+              //   pack first original value
+              if (ival1 >= 0) {
+                 sbit(cpack,&ival1,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(ival1);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+              if (idrstmpl[16] == 2) {
+               //  pack second original value
+                 if (ival2 >= 0) {
+                    sbit(cpack,&ival2,iofst,nbitsd);
+                    iofst=iofst+nbitsd;
+                 }
+                 else {
+                    sbit(cpack,&one,iofst,1);
+                    iofst=iofst+1;
+                    itemp=abs(ival2);
+                    sbit(cpack,&itemp,iofst,nbitsd-1);
+                    iofst=iofst+nbitsd-1;
+                 }
+              }
+              //  pack overall min of spatial differences
+              if (minsd >= 0) {
+                 sbit(cpack,&minsd,iofst,nbitsd);
+                 iofst=iofst+nbitsd;
+              }
+              else {
+                 sbit(cpack,&one,iofst,1);
+                 iofst=iofst+1;
+                 itemp=abs(minsd);
+                 sbit(cpack,&itemp,iofst,nbitsd-1);
+                 iofst=iofst+nbitsd-1;
+              }
+           }
+         //print *,'SDp ',ival1,ival2,minsd,nbitsd
+        }       //  end of spatial diff section
+        //
+        //  Expand non-missing data values to original grid.
+        //
+        miss1=jfld[0];
+        for ( j=0; j<nonmiss; j++) if (jfld[j] < miss1) miss1 = jfld[j];
+        miss1--;
+        miss2=miss1-1;
+        n=0;
+        for ( j=0; j<ndpts; j++) {
+           if ( ifldmiss[j] == 0 ) {
+              ifld[j]=jfld[n];
+              n++;
+           }
+           else if ( ifldmiss[j] == 1 ) {
+              ifld[j]=miss1;
+           }
+           else if ( ifldmiss[j] == 2 ) {
+              ifld[j]=miss2;
+           }
+        }
+        //
+        //   Determine Groups to be used.
+        //
+        if ( simple_alg == 1 ) {
+           //  set group length to 10 :  calculate number of groups
+           //  and length of last group
+           ngroups=ndpts/10;
+           for (j=0;j<ngroups;j++) glen[j]=10;
+           itemp=ndpts%10;
+           if (itemp != 0) {
+              ngroups++;
+              glen[ngroups-1]=itemp;
+           }
+        }
+        else {
+           // Use Dr. Glahn's algorithm for determining grouping.
+           //
+           kfildo=6;
+           minpk=10;
+           inc=1;
+           maxgrps=(ndpts/minpk)+1;
+           jmin = calloc(maxgrps,sizeof(g2int));
+           jmax = calloc(maxgrps,sizeof(g2int));
+           lbit = calloc(maxgrps,sizeof(g2int));
+           pack_gp(&kfildo,ifld,&ndpts,&missopt,&minpk,&inc,&miss1,&miss2,
+                        jmin,jmax,lbit,glen,&maxgrps,&ngroups,&ibit,&jbit,
+                        &kbit,&novref,&lbitref,&ier);
+           //printf("SAGier = %d %d %d %d %d %d\n",ier,ibit,jbit,kbit,novref,lbitref);
+           for ( ng=0; ng<ngroups; ng++) glen[ng]=glen[ng]+novref;
+           free(jmin);
+           free(jmax);
+           free(lbit);
+        }
+        //  
+        //  For each group, find the group's reference value (min)
+        //  and the number of bits needed to hold the remaining values
+        //
+        n=0;
+        for ( ng=0; ng<ngroups; ng++) {
+           //  how many of each type?
+           num0=num1=num2=0;
+           for (j=n; j<n+glen[ng]; j++) {
+               if (ifldmiss[j] == 0 ) num0++;
+               if (ifldmiss[j] == 1 ) num1++;
+               if (ifldmiss[j] == 2 ) num2++;
+           }
+           if ( num0 == 0 ) {      // all missing values
+              if ( num1 == 0 ) {       // all secondary missing
+                gref[ng]=-2;
+                gwidth[ng]=0;
+              }
+              else if ( num2 == 0 ) {       // all primary missing
+                gref[ng]=-1;
+                gwidth[ng]=0;
+              }
+              else {                          // both primary and secondary
+                gref[ng]=0;
+                gwidth[ng]=1;
+              }
+           }
+           else {                      // contains some non-missing data
+             //    find max and min values of group
+             gref[ng]=2147483647;
+             imax=-2147483647;
+             j=n;
+             for ( lg=0; lg<glen[ng]; lg++ ) {
+                if ( ifldmiss[j] == 0 ) {
+                  if (ifld[j] < gref[ng]) gref[ng]=ifld[j];
+                  if (ifld[j] > imax) imax=ifld[j]; 
+                }
+                j++;
+             }
+             if (missopt == 1) imax=imax+1;
+             if (missopt == 2) imax=imax+2;
+             //   calc num of bits needed to hold data
+             if ( gref[ng] != imax ) {
+                temp=log((double)(imax-gref[ng]+1))/alog2;
+                gwidth[ng]=(g2int)ceil(temp);
+             }
+             else {
+                gwidth[ng]=0;
+             }
+           }
+           //   Subtract min from data
+           j=n;
+           mtemp=(g2int)int_power(2.,gwidth[ng]);
+           for ( lg=0; lg<glen[ng]; lg++ ) {
+              if (ifldmiss[j] == 0)            // non-missing
+                 ifld[j]=ifld[j]-gref[ng];
+              else if (ifldmiss[j] == 1)         // primary missing
+                 ifld[j]=mtemp-1;
+              else if (ifldmiss[j] == 2)         // secondary missing
+                 ifld[j]=mtemp-2;
+              
+              j++;
+           }
+           //   increment fld array counter
+           n=n+glen[ng];
+        }
+        //  
+        //  Find max of the group references and calc num of bits needed 
+        //  to pack each groups reference value, then
+        //  pack up group reference values
+        //
+        //printf(" GREFS: ");
+        //for (j=0;j<ngroups;j++) printf(" %d",gref[j]); printf("\n");
+        igmax=gref[0];
+        for (j=1;j<ngroups;j++) if (gref[j] > igmax) igmax=gref[j];
+        if (missopt == 1) igmax=igmax+1;
+        if (missopt == 2) igmax=igmax+2;
+        if (igmax != 0) {
+           temp=log((double)(igmax+1))/alog2;
+           nbitsgref=(g2int)ceil(temp);
+           // reset the ref values of any "missing only" groups.
+           mtemp=(g2int)int_power(2.,nbitsgref);
+           for ( j=0; j<ngroups; j++ ) {
+               if (gref[j] == -1) gref[j]=mtemp-1;
+               if (gref[j] == -2) gref[j]=mtemp-2;
+           }
+           sbits(cpack,gref,iofst,nbitsgref,0,ngroups);
+           itemp=nbitsgref*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsgref=0;
+        }
+        //
+        //  Find max/min of the group widths and calc num of bits needed
+        //  to pack each groups width value, then
+        //  pack up group width values
+        //
+        //write(77,*)'GWIDTHS: ',(gwidth(j),j=1,ngroups)
+        iwmax=gwidth[0];
+        ngwidthref=gwidth[0];
+        for (j=1;j<ngroups;j++) {
+           if (gwidth[j] > iwmax) iwmax=gwidth[j];
+           if (gwidth[j] < ngwidthref) ngwidthref=gwidth[j];
+        }
+        if (iwmax != ngwidthref) {
+           temp=log((double)(iwmax-ngwidthref+1))/alog2;
+           nbitsgwidth=(g2int)ceil(temp);
+           for ( i=0; i<ngroups; i++) gwidth[i]=gwidth[i]-ngwidthref;
+           sbits(cpack,gwidth,iofst,nbitsgwidth,0,ngroups);
+           itemp=nbitsgwidth*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsgwidth=0;
+           for (i=0;i<ngroups;i++) gwidth[i]=0;
+        }
+        //
+        //  Find max/min of the group lengths and calc num of bits needed
+        //  to pack each groups length value, then
+        //  pack up group length values
+        //
+        //printf(" GLENS: ");
+        //for (j=0;j<ngroups;j++) printf(" %d",glen[j]); printf("\n");
+        ilmax=glen[0];
+        nglenref=glen[0];
+        for (j=1;j<ngroups-1;j++) {
+           if (glen[j] > ilmax) ilmax=glen[j];
+           if (glen[j] < nglenref) nglenref=glen[j];
+        }
+        nglenlast=glen[ngroups-1];
+        if (ilmax != nglenref) {
+           temp=log((double)(ilmax-nglenref+1))/alog2;
+           nbitsglen=(g2int)ceil(temp);
+           for ( i=0; i<ngroups-1; i++) glen[i]=glen[i]-nglenref;
+           sbits(cpack,glen,iofst,nbitsglen,0,ngroups);
+           itemp=nbitsglen*ngroups;
+           iofst=iofst+itemp;
+           //         Pad last octet with Zeros, if necessary,
+           if ( (itemp%8) != 0) {
+              left=8-(itemp%8);
+              sbit(cpack,&zero,iofst,left);
+              iofst=iofst+left;
+           }
+        }
+        else {
+           nbitsglen=0;
+           for (i=0;i<ngroups;i++) glen[i]=0;
+        }
+        //
+        //  For each group, pack data values
+        //
+        //write(77,*)'IFLDS: ',(ifld(j),j=1,ndpts)
+        n=0;
+        ij=0;
+        for ( ng=0; ng<ngroups; ng++) {
+           glength=glen[ng]+nglenref;
+           if (ng == (ngroups-1) ) glength=nglenlast;
+           grpwidth=gwidth[ng]+ngwidthref;
+       //write(77,*)'NGP ',ng,grpwidth,glength,gref(ng)
+           if ( grpwidth != 0 ) {
+              sbits(cpack,ifld+n,iofst,grpwidth,0,glength);
+              iofst=iofst+(grpwidth*glength);
+           }
+       //  do kk=1,glength
+       //     ij=ij+1
+       //write(77,*)'SAG ',ij,fld(ij),ifld(ij),gref(ng),bscale,rmin,dscale
+       //  enddo
+           n=n+glength;
+        }
+        //         Pad last octet with Zeros, if necessary,
+        if ( (iofst%8) != 0) {
+           left=8-(iofst%8);
+           sbit(cpack,&zero,iofst,left);
+           iofst=iofst+left;
+        }
+        *lcpack=iofst/8;
+        //
+        if ( ifld != 0 ) free(ifld);
+        if ( jfld != 0 ) free(jfld);
+        if ( ifldmiss != 0 ) free(ifldmiss);
+        if ( gref != 0 ) free(gref);
+        if ( gwidth != 0 ) free(gwidth);
+        if ( glen != 0 ) free(glen);
+      //}
+      //else {          //   Constant field ( max = min )
+      //  nbits=0;
+      //  *lcpack=0;
+      //  nbitsgref=0;
+      //  ngroups=0;
+      //}
+
+//
+//  Fill in ref value and number of bits in Template 5.2
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbitsgref;
+      idrstmpl[4]=0;         // original data were reals
+      idrstmpl[5]=1;         // general group splitting
+      idrstmpl[9]=ngroups;          // Number of groups
+      idrstmpl[10]=ngwidthref;       // reference for group widths
+      idrstmpl[11]=nbitsgwidth;      // num bits used for group widths
+      idrstmpl[12]=nglenref;         // Reference for group lengths
+      idrstmpl[13]=1;                // length increment for group lengths
+      idrstmpl[14]=nglenlast;        // True length of last group
+      idrstmpl[15]=nbitsglen;        // num bits used for group lengths
+      if (idrsnum == 3) {
+         idrstmpl[17]=nbitsd/8;      // num bits used for extra spatial
+                                     // differencing values
+      }
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/mkieee.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/mkieee.c
new file mode 100644
index 0000000..37fb87b
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/mkieee.c
@@ -0,0 +1,126 @@
+/**********************************************************
+ * Version $Id: mkieee.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void mkieee(g2float *a,g2int *rieee,g2int num)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    mkieee 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine stores a list of real values in 
+//   32-bit IEEE floating point format.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+//
+// USAGE:    mkieee(g2float *a,g2int *rieee,g2int num);
+//   INPUT ARGUMENT LIST:
+//     a        - Input array of floating point values.
+//     num      - Number of floating point values to convert.
+//
+//   OUTPUT ARGUMENT LIST:      
+//     rieee    - Output array of data values in 32-bit IEEE format
+//                stored in g2int integer array.  rieee must be allocated
+//                with at least 4*num bytes of memory before calling this
+//                function.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  j,n,ieee,iexp,imant;
+      double  alog2,atemp;
+
+      static double  two23,two126;
+      static g2int test=0;
+    //g2intu msk1=0x80000000;        // 10000000000000000000000000000000 binary
+    //g2int msk2=0x7F800000;         // 01111111100000000000000000000000 binary
+    //g2int msk3=0x007FFFFF;         // 00000000011111111111111111111111 binary
+
+      if ( test == 0 ) {
+         two23=(double)int_power(2.0,23);
+         two126=(double)int_power(2.0,126);
+         test=1;
+      }
+
+      alog2=0.69314718;       //  ln(2.0)
+
+      for (j=0;j<num;j++) {
+      
+        ieee=0;
+
+        if (a[j] == 0.0) {
+          rieee[j]=ieee;
+          continue;
+        }
+        
+//
+//  Set Sign bit (bit 31 - leftmost bit)
+//
+        if (a[j] < 0.0) {
+          ieee= 1 << 31;
+          atemp=-1.0*a[j];
+        }
+        else {
+          ieee= 0 << 31;
+          atemp=a[j];
+        }
+        //printf("sign %ld %x \n",ieee,ieee);
+//
+//  Determine exponent n with base 2
+//
+        if ( atemp >= 1.0 ) {
+           n = 0;
+           while ( int_power(2.0,n+1) <= atemp ) {
+              n++;
+           }
+        }
+        else {
+           n = -1;
+           while ( int_power(2.0,n) > atemp ) {
+              n--;
+           }
+        }
+        //n=(g2int)floor(log(atemp)/alog2);
+        iexp=n+127;
+        if (n >  127) iexp=255;     // overflow
+        if (n < -127) iexp=0;
+        //printf("exp %ld %ld \n",iexp,n);
+        //      set exponent bits ( bits 30-23 )
+        ieee = ieee | ( iexp << 23 );
+//
+//  Determine Mantissa
+// 
+        if (iexp != 255) {
+          if (iexp != 0) 
+            atemp=(atemp/int_power(2.0,n))-1.0;
+          else
+            atemp=atemp*two126;
+          imant=(g2int)rint(atemp*two23);
+        }
+        else {
+          imant=0;
+        }
+        //printf("mant %ld %x \n",imant,imant);
+        //      set mantissa bits ( bits 22-0 )
+        ieee = ieee | imant;
+//
+//  Transfer IEEE bit string to rieee array
+//
+        rieee[j]=ieee;
+
+      }
+
+      return;
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/pack_gp.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pack_gp.c
new file mode 100644
index 0000000..4cde3e2
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pack_gp.c
@@ -0,0 +1,1450 @@
+/**********************************************************
+ * Version $Id: pack_gp.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/* pack_gp.f -- translated by f2c (version 20031025).
+   You must link the resulting object file with libf2c:
+	on Microsoft Windows system, link with libf2c.lib;
+	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
+	or, if you install libf2c.a in a standard place, with -lf2c -lm
+	-- in that order, at the end of the command line, as in
+		cc *.o -lf2c -lm
+	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
+
+		http://www.netlib.org/f2c/libf2c.zip
+*/
+
+/*#include "f2c.h"*/
+#include <stdlib.h>
+#include "grib2.h"
+typedef g2int integer;
+typedef g2int logical;
+#define TRUE_ (1)
+#define FALSE_ (0)
+
+/* Subroutine */ int pack_gp(integer *kfildo, integer *ic, integer *nxy, 
+	integer *is523, integer *minpk, integer *inc, integer *missp, integer 
+	*misss, integer *jmin, integer *jmax, integer *lbit, integer *nov, 
+	integer *ndg, integer *lx, integer *ibit, integer *jbit, integer *
+	kbit, integer *novref, integer *lbitref, integer *ier)
+{
+    /* Initialized data */
+
+    const  integer mallow = 1073741825;   /*  MALLOW=2**30+1  */
+    static integer ifeed = 12;
+    static integer ifirst = 0;
+
+    /* System generated locals */
+    integer i__1, i__2, i__3;
+
+    /* Local variables */
+    static integer j, k, l;
+    static logical adda;
+    static integer ired, kinc, mina, maxa, minb, maxb, minc, maxc, ibxx2[31];
+    static char cfeed[1];
+    static integer nenda, nendb, ibita, ibitb, minak, minbk, maxak, maxbk, 
+	    minck, maxck, nouta, lmiss, itest, nount;
+    extern /* Subroutine */ int reduce(integer *, integer *, integer *, 
+	    integer *, integer *, integer *, integer *, integer *, integer *, 
+	    integer *, integer *, integer *, integer *);
+    static integer ibitbs, mislla, misllb, misllc, iersav, lminpk, ktotal, 
+	    kounta, kountb, kstart, mstart, mintst, maxtst, 
+	    kounts, mintstk, maxtstk;
+    integer *misslx;
+
+
+/*        FEBRUARY 1994   GLAHN   TDL   MOS-2000 */
+/*        JUNE     1995   GLAHN   MODIFIED FOR LMISS ERROR. */
+/*        JULY     1996   GLAHN   ADDED MISSS */
+/*        FEBRUARY 1997   GLAHN   REMOVED 4 REDUNDANT TESTS FOR */
+/*                                MISSP.EQ.0; INSERTED A TEST TO BETTER */
+/*                                HANDLE A STRING OF 9999'S */
+/*        FEBRUARY 1997   GLAHN   ADDED LOOPS TO ELIMINATE TEST FOR */
+/*                                MISSS WHEN MISSS = 0 */
+/*        MARCH    1997   GLAHN   CORRECTED FOR SECONDARY MISSING VALUE */
+/*        MARCH    1997   GLAHN   CORRECTED FOR USE OF LOCAL VALUE */
+/*                                OF MINPK */
+/*        MARCH    1997   GLAHN   CORRECTED FOR SECONDARY MISSING VALUE */
+/*        MARCH    1997   GLAHN   CHANGED CALCULATING NUMBER OF BITS */
+/*                                THROUGH EXPONENTS TO AN ARRAY (IMPROVED */
+/*                                OVERALL PACKING PERFORMANCE BY ABOUT */
+/*                                35 PERCENT!).  ALLOWED 0 BITS FOR */
+/*                                PACKING JMIN( ), LBIT( ), AND NOV( ). */
+/*        MAY      1997   GLAHN   A NUMBER OF CHANGES FOR EFFICIENCY. */
+/*                                MOD FUNCTIONS ELIMINATED AND ONE */
+/*                                IFTHEN ADDED.  JOUNT REMOVED. */
+/*                                RECOMPUTATION OF BITS NOT MADE UNLESS */
+/*                                NECESSARY AFTER MOVING POINTS FROM */
+/*                                ONE GROUP TO ANOTHER.  NENDB ADJUSTED */
+/*                                TO ELIMINATE POSSIBILITY OF VERY */
+/*                                SMALL GROUP AT THE END. */
+/*                                ABOUT 8 PERCENT IMPROVEMENT IN */
+/*                                OVERALL PACKING.  ISKIPA REMOVED; */
+/*                                THERE IS ALWAYS A GROUP B THAT CAN */
+/*                                BECOME GROUP A.  CONTROL ON SIZE */
+/*                                OF GROUP B (STATEMENT BELOW 150) */
+/*                                ADDED.  ADDED ADDA, AND USE */
+/*                                OF GE AND LE INSTEAD OF GT AND LT */
+/*                                IN LOOPS BETWEEN 150 AND 160. */
+/*                                IBITBS ADDED TO SHORTEN TRIPS */
+/*                                THROUGH LOOP. */
+/*        MARCH    2000   GLAHN   MODIFIED FOR GRIB2; CHANGED NAME FROM */
+/*                                PACKGP */
+/*        JANUARY  2001   GLAHN   COMMENTS; IER = 706 SUBSTITUTED FOR */
+/*                                STOPS; ADDED RETURN1; REMOVED STATEMENT */
+/*                                NUMBER 110; ADDED IER AND * RETURN */
+/*        NOVEMBER 2001   GLAHN   CHANGED SOME DIAGNOSTIC FORMATS TO */
+/*                                ALLOW PRINTING LARGER NUMBERS */
+/*        NOVEMBER 2001   GLAHN   ADDED MISSLX( ) TO PUT MAXIMUM VALUE */
+/*                                INTO JMIN( ) WHEN ALL VALUES MISSING */
+/*                                TO AGREE WITH GRIB STANDARD. */
+/*        NOVEMBER 2001   GLAHN   CHANGED TWO TESTS ON MISSP AND MISSS */
+/*                                EQ 0 TO TESTS ON IS523.  HOWEVER, */
+/*                                MISSP AND MISSS CANNOT IN GENERAL BE */
+/*                                = 0. */
+/*        NOVEMBER 2001   GLAHN   ADDED CALL TO REDUCE; DEFINED ITEST */
+/*                                BEFORE LOOPS TO REDUCE COMPUTATION; */
+/*                                STARTED LARGE GROUP WHEN ALL SAME */
+/*                                VALUE */
+/*        DECEMBER 2001   GLAHN   MODIFIED AND ADDED A FEW COMMENTS */
+/*        JANUARY  2002   GLAHN   REMOVED LOOP BEFORE 150 TO DETERMINE */
+/*                                A GROUP OF ALL SAME VALUE */
+/*        JANUARY  2002   GLAHN   CHANGED MALLOW FROM 9999999 TO 2**30+1, */
+/*                                AND MADE IT A PARAMETER */
+/*        MARCH    2002   GLAHN   ADDED NON FATAL IER = 716, 717; */
+/*                                REMOVED NENDB=NXY ABOVE 150; */
+/*                                ADDED IERSAV=0; COMMENTS */
+
+/*        PURPOSE */
+/*            DETERMINES GROUPS OF VARIABLE SIZE, BUT AT LEAST OF */
+/*            SIZE MINPK, THE ASSOCIATED MAX (JMAX( )) AND MIN (JMIN( )), */
+/*            THE NUMBER OF BITS NECESSARY TO HOLD THE VALUES IN EACH */
+/*            GROUP (LBIT( )), THE NUMBER OF VALUES IN EACH GROUP */
+/*            (NOV( )), THE NUMBER OF BITS NECESSARY TO PACK THE JMIN( ) */
+/*            VALUES (IBIT), THE NUMBER OF BITS NECESSARY TO PACK THE */
+/*            LBIT( ) VALUES (JBIT), AND THE NUMBER OF BITS NECESSARY */
+/*            TO PACK THE NOV( ) VALUES (KBIT).  THE ROUTINE IS DESIGNED */
+/*            TO DETERMINE THE GROUPS SUCH THAT A SMALL NUMBER OF BITS */
+/*            IS NECESSARY TO PACK THE DATA WITHOUT EXCESSIVE */
+/*            COMPUTATIONS.  IF ALL VALUES IN THE GROUP ARE ZERO, THE */
+/*            NUMBER OF BITS TO USE IN PACKING IS DEFINED AS ZERO WHEN */
+/*            THERE CAN BE NO MISSING VALUES; WHEN THERE CAN BE MISSING */
+/*            VALUES, THE NUMBER OF BITS MUST BE AT LEAST 1 TO HAVE */
+/*            THE CAPABILITY TO RECOGNIZE THE MISSING VALUE.  HOWEVER, */
+/*            IF ALL VALUES IN A GROUP ARE MISSING, THE NUMBER OF BITS */
+/*            NEEDED IS 0, AND THE UNPACKER RECOGNIZES THIS. */
+/*            ALL VARIABLES ARE INTEGER.  EVEN THOUGH THE GROUPS ARE */
+/*            INITIALLY OF SIZE MINPK OR LARGER, AN ADJUSTMENT BETWEEN */
+/*            TWO GROUPS (THE LOOKBACK PROCEDURE) MAY MAKE A GROUP */
+/*            SMALLER THAN MINPK.  THE CONTROL ON GROUP SIZE IS THAT */
+/*            THE SUM OF THE SIZES OF THE TWO CONSECUTIVE GROUPS, EACH OF */
+/*            SIZE MINPK OR LARGER, IS NOT DECREASED.  WHEN DETERMINING */
+/*            THE NUMBER OF BITS NECESSARY FOR PACKING, THE LARGEST */
+/*            VALUE THAT CAN BE ACCOMMODATED IN, SAY, MBITS, IS */
+/*            2**MBITS-1; THIS LARGEST VALUE (AND THE NEXT SMALLEST */
+/*            VALUE) IS RESERVED FOR THE MISSING VALUE INDICATOR (ONLY) */
+/*            WHEN IS523 NE 0.  IF THE DIMENSION NDG */
+/*            IS NOT LARGE ENOUGH TO HOLD ALL THE GROUPS, THE LOCAL VALUE */
+/*            OF MINPK IS INCREASED BY 50 PERCENT.  THIS IS REPEATED */
+/*            UNTIL NDG WILL SUFFICE.  A DIAGNOSTIC IS PRINTED WHENEVER */
+/*            THIS HAPPENS, WHICH SHOULD BE VERY RARELY.  IF IT HAPPENS */
+/*            OFTEN, NDG IN SUBROUTINE PACK SHOULD BE INCREASED AND */
+/*            A CORRESPONDING INCREASE IN SUBROUTINE UNPACK MADE. */
+/*            CONSIDERABLE CODE IS PROVIDED SO THAT NO MORE CHECKING */
+/*            FOR MISSING VALUES WITHIN LOOPS IS DONE THAN NECESSARY; */
+/*            THE ADDED EFFICIENCY OF THIS IS RELATIVELY MINOR, */
+/*            BUT DOES NO HARM.  FOR GRIB2, THE REFERENCE VALUE FOR */
+/*            THE LENGTH OF GROUPS IN NOV( ) AND FOR THE NUMBER OF */
+/*            BITS NECESSARY TO PACK GROUP VALUES ARE DETERMINED, */
+/*            AND SUBTRACTED BEFORE JBIT AND KBIT ARE DETERMINED. */
+
+/*            WHEN 1 OR MORE GROUPS ARE LARGE COMPARED TO THE OTHERS, */
+/*            THE WIDTH OF ALL GROUPS MUST BE AS LARGE AS THE LARGEST. */
+/*            A SUBROUTINE REDUCE BREAKS UP LARGE GROUPS INTO 2 OR */
+/*            MORE TO REDUCE TOTAL BITS REQUIRED.  IF REDUCE SHOULD */
+/*            ABORT, PACK_GP WILL BE EXECUTED AGAIN WITHOUT THE CALL */
+/*            TO REDUCE. */
+
+/*        DATA SET USE */
+/*           KFILDO - UNIT NUMBER FOR OUTPUT (PRINT) FILE. (OUTPUT) */
+
+/*        VARIABLES IN CALL SEQUENCE */
+/*              KFILDO = UNIT NUMBER FOR OUTPUT (PRINT) FILE.  (INPUT) */
+/*               IC( ) = ARRAY TO HOLD DATA FOR PACKING.  THE VALUES */
+/*                       DO NOT HAVE TO BE POSITIVE AT THIS POINT, BUT */
+/*                       MUST BE IN THE RANGE -2**30 TO +2**30 (THE */
+/*                       THE VALUE OF MALLOW).  THESE INTEGER VALUES */
+/*                       WILL BE RETAINED EXACTLY THROUGH PACKING AND */
+/*                       UNPACKING.  (INPUT) */
+/*                 NXY = NUMBER OF VALUES IN IC( ).  ALSO TREATED */
+/*                       AS ITS DIMENSION.  (INPUT) */
+/*              IS523  = missing value management */
+/*                       0=data contains no missing values */
+/*                       1=data contains Primary missing values */
+/*                       2=data contains Primary and secondary missing values */
+/*                       (INPUT) */
+/*               MINPK = THE MINIMUM SIZE OF EACH GROUP, EXCEPT POSSIBLY */
+/*                       THE LAST ONE.  (INPUT) */
+/*                 INC = THE NUMBER OF VALUES TO ADD TO AN ALREADY */
+/*                       EXISTING GROUP IN DETERMINING WHETHER OR NOT */
+/*                       TO START A NEW GROUP.  IDEALLY, THIS WOULD BE */
+/*                       1, BUT EACH TIME INC VALUES ARE ATTEMPTED, THE */
+/*                       MAX AND MIN OF THE NEXT MINPK VALUES MUST BE */
+/*                       FOUND.  THIS IS "A LOOP WITHIN A LOOP," AND */
+/*                       A SLIGHTLY LARGER VALUE MAY GIVE ABOUT AS GOOD */
+/*                       RESULTS WITH SLIGHTLY LESS COMPUTATIONAL TIME. */
+/*                       IF INC IS LE 0, 1 IS USED, AND A DIAGNOSTIC IS */
+/*                       OUTPUT.  NOTE:  IT IS EXPECTED THAT INC WILL */
+/*                       EQUAL 1.  THE CODE USES INC PRIMARILY IN THE */
+/*                       LOOPS STARTING AT STATEMENT 180.  IF INC */
+/*                       WERE 1, THERE WOULD NOT NEED TO BE LOOPS */
+/*                       AS SUCH.  HOWEVER, KINC (THE LOCAL VALUE OF */
+/*                       INC) IS SET GE 1 WHEN NEAR THE END OF THE DATA */
+/*                       TO FORESTALL A VERY SMALL GROUP AT THE END. */
+/*                       (INPUT) */
+/*               MISSP = WHEN MISSING POINTS CAN BE PRESENT IN THE DATA, */
+/*                       THEY WILL HAVE THE VALUE MISSP OR MISSS. */
+/*                       MISSP IS THE PRIMARY MISSING VALUE AND  MISSS */
+/*                       IS THE SECONDARY MISSING VALUE .  THESE MUST */
+/*                       NOT BE VALUES THAT WOULD OCCUR WITH SUBTRACTING */
+/*                       THE MINIMUM (REFERENCE) VALUE OR SCALING. */
+/*                       FOR EXAMPLE, MISSP = 0 WOULD NOT BE ADVISABLE. */
+/*                       (INPUT) */
+/*               MISSS = SECONDARY MISSING VALUE INDICATOR (SEE MISSP). */
+/*                       (INPUT) */
+/*             JMIN(J) = THE MINIMUM OF EACH GROUP (J=1,LX).  (OUTPUT) */
+/*             JMAX(J) = THE MAXIMUM OF EACH GROUP (J=1,LX).  THIS IS */
+/*                       NOT REALLY NEEDED, BUT SINCE THE MAX OF EACH */
+/*                       GROUP MUST BE FOUND, SAVING IT HERE IS CHEAP */
+/*                       IN CASE THE USER WANTS IT.  (OUTPUT) */
+/*             LBIT(J) = THE NUMBER OF BITS NECESSARY TO PACK EACH GROUP */
+/*                       (J=1,LX).  IT IS ASSUMED THE MINIMUM OF EACH */
+/*                       GROUP WILL BE REMOVED BEFORE PACKING, AND THE */
+/*                       VALUES TO PACK WILL, THEREFORE, ALL BE POSITIVE. */
+/*                       HOWEVER, IC( ) DOES NOT NECESSARILY CONTAIN */
+/*                       ALL POSITIVE VALUES.  IF THE OVERALL MINIMUM */
+/*                       HAS BEEN REMOVED (THE USUAL CASE), THEN IC( ) */
+/*                       WILL CONTAIN ONLY POSITIVE VALUES.  (OUTPUT) */
+/*              NOV(J) = THE NUMBER OF VALUES IN EACH GROUP (J=1,LX). */
+/*                       (OUTPUT) */
+/*                 NDG = THE DIMENSION OF JMIN( ), JMAX( ), LBIT( ), AND */
+/*                       NOV( ).  (INPUT) */
+/*                  LX = THE NUMBER OF GROUPS DETERMINED.  (OUTPUT) */
+/*                IBIT = THE NUMBER OF BITS NECESSARY TO PACK THE JMIN(J) */
+/*                       VALUES, J=1,LX.  (OUTPUT) */
+/*                JBIT = THE NUMBER OF BITS NECESSARY TO PACK THE LBIT(J) */
+/*                       VALUES, J=1,LX.  (OUTPUT) */
+/*                KBIT = THE NUMBER OF BITS NECESSARY TO PACK THE NOV(J) */
+/*                       VALUES, J=1,LX.  (OUTPUT) */
+/*              NOVREF = REFERENCE VALUE FOR NOV( ).  (OUTPUT) */
+/*             LBITREF = REFERENCE VALUE FOR LBIT( ).  (OUTPUT) */
+/*                 IER = ERROR RETURN. */
+/*                       706 = VALUE WILL NOT PACK IN 30 BITS--FATAL */
+/*                       714 = ERROR IN REDUCE--NON-FATAL */
+/*                       715 = NGP NOT LARGE ENOUGH IN REDUCE--NON-FATAL */
+/*                       716 = MINPK INCEASED--NON-FATAL */
+/*                       717 = INC SET = 1--NON-FATAL */
+/*                       (OUTPUT) */
+/*                   * = ALTERNATE RETURN WHEN IER NE 0 AND FATAL ERROR. */
+
+/*        INTERNAL VARIABLES */
+/*               CFEED = CONTAINS THE CHARACTER REPRESENTATION */
+/*                       OF A PRINTER FORM FEED. */
+/*               IFEED = CONTAINS THE INTEGER VALUE OF A PRINTER */
+/*                       FORM FEED. */
+/*                KINC = WORKING COPY OF INC.  MAY BE MODIFIED. */
+/*                MINA = MINIMUM VALUE IN GROUP A. */
+/*                MAXA = MAXIMUM VALUE IN GROUP A. */
+/*               NENDA = THE PLACE IN IC( ) WHERE GROUP A ENDS. */
+/*              KSTART = THE PLACE IN IC( ) WHERE GROUP A STARTS. */
+/*               IBITA = NUMBER OF BITS NEEDED TO HOLD VALUES IN GROUP A. */
+/*                MINB = MINIMUM VALUE IN GROUP B. */
+/*                MAXB = MAXIMUM VALUE IN GROUP B. */
+/*               NENDB = THE PLACE IN IC( ) WHERE GROUP B ENDS. */
+/*               IBITB = NUMBER OF BITS NEEDED TO HOLD VALUES IN GROUP B. */
+/*                MINC = MINIMUM VALUE IN GROUP C. */
+/*                MAXC = MAXIMUM VALUE IN GROUP C. */
+/*              KTOTAL = COUNT OF NUMBER OF VALUES IN IC( ) PROCESSED. */
+/*               NOUNT = NUMBER OF VALUES ADDED TO GROUP A. */
+/*               LMISS = 0 WHEN IS523 = 0.  WHEN PACKING INTO A */
+/*                       SPECIFIC NUMBER OF BITS, SAY MBITS, */
+/*                       THE MAXIMUM VALUE THAT CAN BE HANDLED IS */
+/*                       2**MBITS-1.  WHEN IS523 = 1, INDICATING */
+/*                       PRIMARY MISSING VALUES, THIS MAXIMUM VALUE */
+/*                       IS RESERVED TO HOLD THE PRIMARY MISSING VALUE */
+/*                       INDICATOR AND LMISS = 1.  WHEN IS523 = 2, */
+/*                       THE VALUE JUST BELOW THE MAXIMUM (I.E., */
+/*                       2**MBITS-2) IS RESERVED TO HOLD THE SECONDARY */
+/*                       MISSING VALUE INDICATOR AND LMISS = 2. */
+/*              LMINPK = LOCAL VALUE OF MINPK.  THIS WILL BE ADJUSTED */
+/*                       UPWARD WHENEVER NDG IS NOT LARGE ENOUGH TO HOLD */
+/*                       ALL THE GROUPS. */
+/*              MALLOW = THE LARGEST ALLOWABLE VALUE FOR PACKING. */
+/*              MISLLA = SET TO 1 WHEN ALL VALUES IN GROUP A ARE MISSING. */
+/*                       THIS IS USED TO DISTINGUISH BETWEEN A REAL */
+/*                       MINIMUM WHEN ALL VALUES ARE NOT MISSING */
+/*                       AND A MINIMUM THAT HAS BEEN SET TO ZERO WHEN */
+/*                       ALL VALUES ARE MISSING.  0 OTHERWISE. */
+/*                       NOTE THAT THIS DOES NOT DISTINGUISH BETWEEN */
+/*                       PRIMARY AND SECONDARY MISSINGS WHEN SECONDARY */
+/*                       MISSINGS ARE PRESENT.  THIS MEANS THAT */
+/*                       LBIT( ) WILL NOT BE ZERO WITH THE RESULTING */
+/*                       COMPRESSION EFFICIENCY WHEN SECONDARY MISSINGS */
+/*                       ARE PRESENT.  ALSO NOTE THAT A CHECK HAS BEEN */
+/*                       MADE EARLIER TO DETERMINE THAT SECONDARY */
+/*                       MISSINGS ARE REALLY THERE. */
+/*              MISLLB = SET TO 1 WHEN ALL VALUES IN GROUP B ARE MISSING. */
+/*                       THIS IS USED TO DISTINGUISH BETWEEN A REAL */
+/*                       MINIMUM WHEN ALL VALUES ARE NOT MISSING */
+/*                       AND A MINIMUM THAT HAS BEEN SET TO ZERO WHEN */
+/*                       ALL VALUES ARE MISSING.  0 OTHERWISE. */
+/*              MISLLC = PERFORMS THE SAME FUNCTION FOR GROUP C THAT */
+/*                       MISLLA AND MISLLB DO FOR GROUPS B AND C, */
+/*                       RESPECTIVELY. */
+/*            IBXX2(J) = AN ARRAY THAT WHEN THIS ROUTINE IS FIRST ENTERED */
+/*                       IS SET TO 2**J, J=0,30. IBXX2(30) = 2**30, WHICH */
+/*                       IS THE LARGEST VALUE PACKABLE, BECAUSE 2**31 */
+/*                       IS LARGER THAN THE INTEGER WORD SIZE. */
+/*              IFIRST = SET BY DATA STATEMENT TO 0.  CHANGED TO 1 ON */
+/*                       FIRST */
+/*                       ENTRY WHEN IBXX2( ) IS FILLED. */
+/*               MINAK = KEEPS TRACK OF THE LOCATION IN IC( ) WHERE THE */
+/*                       MINIMUM VALUE IN GROUP A IS LOCATED. */
+/*               MAXAK = DOES THE SAME AS MINAK, EXCEPT FOR THE MAXIMUM. */
+/*               MINBK = THE SAME AS MINAK FOR GROUP B. */
+/*               MAXBK = THE SAME AS MAXAK FOR GROUP B. */
+/*               MINCK = THE SAME AS MINAK FOR GROUP C. */
+/*               MAXCK = THE SAME AS MAXAK FOR GROUP C. */
+/*                ADDA = KEEPS TRACK WHETHER OR NOT AN ATTEMPT TO ADD */
+/*                       POINTS TO GROUP A WAS MADE.  IF SO, THEN ADDA */
+/*                       KEEPS FROM TRYING TO PUT ONE BACK INTO B. */
+/*                       (LOGICAL) */
+/*              IBITBS = KEEPS CURRENT VALUE IF IBITB SO THAT LOOP */
+/*                       ENDING AT 166 DOESN'T HAVE TO START AT */
+/*                       IBITB = 0 EVERY TIME. */
+/*           MISSLX(J) = MALLOW EXCEPT WHEN A GROUP IS ALL ONE VALUE (AND */
+/*                       LBIT(J) = 0) AND THAT VALUE IS MISSING.  IN */
+/*                       THAT CASE, MISSLX(J) IS MISSP OR MISSS.  THIS */
+/*                       GETS INSERTED INTO JMIN(J) LATER AS THE */
+/*                       MISSING INDICATOR; IT CAN'T BE PUT IN UNTIL */
+/*                       THE END, BECAUSE JMIN( ) IS USED TO CALCULATE */
+/*                       THE MAXIMUM NUMBER OF BITS (IBITS) NEEDED TO */
+/*                       PACK JMIN( ). */
+/*        1         2         3         4         5         6         7 X */
+
+/*        NON SYSTEM SUBROUTINES CALLED */
+/*           NONE */
+
+
+
+/*        MISSLX( ) was AN AUTOMATIC ARRAY. */
+    misslx = (integer *)calloc(*ndg,sizeof(integer));
+
+
+    /* Parameter adjustments */
+    --ic;
+    --nov;
+    --lbit;
+    --jmax;
+    --jmin;
+
+    /* Function Body */
+
+    *ier = 0;
+    iersav = 0;
+/*     CALL TIMPR(KFILDO,KFILDO,'START PACK_GP        ') */
+    *(unsigned char *)cfeed = (char) ifeed;
+
+    ired = 0;
+/*        IRED IS A FLAG.  WHEN ZERO, REDUCE WILL BE CALLED. */
+/*        IF REDUCE ABORTS, IRED = 1 AND IS NOT CALLED.  IN */
+/*        THIS CASE PACK_GP EXECUTES AGAIN EXCEPT FOR REDUCE. */
+
+    if (*inc <= 0) {
+	iersav = 717;
+/*        WRITE(KFILDO,101)INC */
+/* 101     FORMAT(/' ****INC ='I8,' NOT CORRECT IN PACK_GP.  1 IS USED.') */
+    }
+
+/*        THERE WILL BE A RESTART OF PACK_GP IF SUBROUTINE REDUCE */
+/*        ABORTS.  THIS SHOULD NOT HAPPEN, BUT IF IT DOES, PACK_GP */
+/*        WILL COMPLETE WITHOUT SUBROUTINE REDUCE.  A NON FATAL */
+/*        DIAGNOSTIC RETURN IS PROVIDED. */
+
+L102:
+    /*kinc = max(*inc,1);*/
+    kinc = (*inc > 1) ? *inc : 1;
+    lminpk = *minpk;
+
+/*         CALCULATE THE POWERS OF 2 THE FIRST TIME ENTERED. */
+
+    if (ifirst == 0) {
+	ifirst = 1;
+	ibxx2[0] = 1;
+
+	for (j = 1; j <= 30; ++j) {
+	    ibxx2[j] = ibxx2[j - 1] << 1;
+/* L104: */
+	}
+
+    }
+
+/*        THERE WILL BE A RESTART AT 105 IS NDG IS NOT LARGE ENOUGH. */
+/*        A NON FATAL DIAGNOSTIC RETURN IS PROVIDED. */
+
+L105:
+    kstart = 1;
+    ktotal = 0;
+    *lx = 0;
+    adda = FALSE_;
+    lmiss = 0;
+    if (*is523 == 1) {
+	lmiss = 1;
+    }
+    if (*is523 == 2) {
+	lmiss = 2;
+    }
+
+/*        ************************************* */
+
+/*        THIS SECTION COMPUTES STATISTICS FOR GROUP A.  GROUP A IS */
+/*        A GROUP OF SIZE LMINPK. */
+
+/*        ************************************* */
+
+    ibita = 0;
+    mina = mallow;
+    maxa = -mallow;
+    minak = mallow;
+    maxak = -mallow;
+
+/*        FIND THE MIN AND MAX OF GROUP A.  THIS WILL INITIALLY BE OF */
+/*        SIZE LMINPK (IF THERE ARE STILL LMINPK VALUES IN IC( )), BUT */
+/*        WILL INCREASE IN SIZE IN INCREMENTS OF INC UNTIL A NEW */
+/*        GROUP IS STARTED.  THE DEFINITION OF GROUP A IS DONE HERE */
+/*        ONLY ONCE (UPON INITIAL ENTRY), BECAUSE A GROUP B CAN ALWAYS */
+/*        BECOME A NEW GROUP A AFTER A IS PACKED, EXCEPT IF LMINPK */
+/*        HAS TO BE INCREASED BECAUSE NDG IS TOO SMALL.  THEREFORE, */
+/*        THE SEPARATE LOOPS FOR MISSING AND NON-MISSING HERE BUYS */
+/*        ALMOST NOTHING. */
+
+/* Computing MIN */
+    i__1 = kstart + lminpk - 1;
+    /*nenda = min(i__1,*nxy);*/
+    nenda = (i__1 < *nxy) ? i__1 : *nxy;
+    if (*nxy - nenda <= lminpk / 2) {
+	nenda = *nxy;
+    }
+/*        ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
+/*        MAKING THE ACTUAL GROUP LARGER.  IF A PROVISION LIKE THIS IS */
+/*        NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
+/*        AT THE END.  USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
+/*        VALUES FOR EFFICIENCY. */
+
+/*        DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE */
+/*        UNLESS NENDA = NXY.  THIS MAY ALLOW A LARGE GROUP A TO */
+/*        START WITH, AS WITH MISSING VALUES.   SEPARATE LOOPS FOR */
+/*        MISSING OPTIONS.  THIS SECTION IS ONLY EXECUTED ONCE, */
+/*        IN DETERMINING THE FIRST GROUP.  IT HELPS FOR AN ARRAY */
+/*        OF MOSTLY MISSING VALUES OR OF ONE VALUE, SUCH AS */
+/*        RADAR OR PRECIP DATA. */
+
+    if (nenda != *nxy && ic[kstart] == ic[kstart + 1]) {
+/*           NO NEED TO EXECUTE IF FIRST TWO VALUES ARE NOT EQUAL. */
+
+	if (*is523 == 0) {
+/*              THIS LOOP IS FOR NO MISSING VALUES. */
+
+	    i__1 = *nxy;
+	    for (k = kstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != ic[kstart]) {
+/* Computing MAX */
+		    i__2 = nenda, i__3 = k - 1;
+		    /*nenda = max(i__2,i__3);*/
+		    nenda = (i__2 > i__3) ? i__2 : i__3;
+		    goto L114;
+		}
+
+/* L111: */
+	    }
+
+	    nenda = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
+
+	} else if (*is523 == 1) {
+/*              THIS LOOP IS FOR PRIMARY MISSING VALUES ONLY. */
+
+	    i__1 = *nxy;
+	    for (k = kstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != *missp) {
+
+		    if (ic[k] != ic[kstart]) {
+/* Computing MAX */
+			i__2 = nenda, i__3 = k - 1;
+			/*nenda = max(i__2,i__3);*/
+			nenda = (i__2 > i__3) ? i__2 : i__3;
+			goto L114;
+		    }
+
+		}
+
+/* L112: */
+	    }
+
+	    nenda = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
+
+	} else {
+/*              THIS LOOP IS FOR PRIMARY AND SECONDARY MISSING VALUES. */
+
+	    i__1 = *nxy;
+	    for (k = kstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != *missp && ic[k] != *misss) {
+
+		    if (ic[k] != ic[kstart]) {
+/* Computing MAX */
+			i__2 = nenda, i__3 = k - 1;
+			/*nenda = max(i__2,i__3);*/
+			nenda = (i__2 > i__3) ? i__2 : i__3;
+			goto L114;
+		    }
+
+		}
+
+/* L113: */
+	    }
+
+	    nenda = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL VALUES ARE THE SAME. */
+	}
+
+    }
+
+L114:
+    if (*is523 == 0) {
+
+	i__1 = nenda;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] < mina) {
+		mina = ic[k];
+		minak = k;
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+		maxak = k;
+	    }
+/* L115: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = nenda;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L117;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+		minak = k;
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+		maxak = k;
+	    }
+L117:
+	    ;
+	}
+
+    } else {
+
+	i__1 = nenda;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L120;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+		minak = k;
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+		maxak = k;
+	    }
+L120:
+	    ;
+	}
+
+    }
+
+    kounta = nenda - kstart + 1;
+
+/*        INCREMENT KTOTAL AND FIND THE BITS NEEDED TO PACK THE A GROUP. */
+
+    ktotal += kounta;
+    mislla = 0;
+    if (mina != mallow) {
+	goto L125;
+    }
+/*        ALL MISSING VALUES MUST BE ACCOMMODATED. */
+    mina = 0;
+    maxa = 0;
+    mislla = 1;
+    ibitb = 0;
+    if (*is523 != 2) {
+	goto L130;
+    }
+/*        WHEN ALL VALUES ARE MISSING AND THERE ARE NO */
+/*        SECONDARY MISSING VALUES, IBITA = 0. */
+/*        OTHERWISE, IBITA MUST BE CALCULATED. */
+
+L125:
+    itest = maxa - mina + lmiss;
+
+    for (ibita = 0; ibita <= 30; ++ibita) {
+	if (itest < ibxx2[ibita]) {
+	    goto L130;
+	}
+/* ***        THIS TEST IS THE SAME AS: */
+/* ***     IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 130 */
+/* L126: */
+    }
+
+/*     WRITE(KFILDO,127)MAXA,MINA */
+/* 127  FORMAT(' ****ERROR IN PACK_GP.  VALUE WILL NOT PACK IN 30 BITS.', */
+/*    1       '  MAXA ='I13,'  MINA ='I13,'.  ERROR AT 127.') */
+    *ier = 706;
+    goto L900;
+
+L130:
+
+/* ***D     WRITE(KFILDO,131)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA */
+/* ***D131  FORMAT(' AT 130, KOUNTA ='I8,'  KTOTAL ='I8,'  MINA ='I8, */
+/* ***D    1       '  MAXA ='I8,'  IBITA ='I3,'  MISLLA ='I3) */
+
+L133:
+    if (ktotal >= *nxy) {
+	goto L200;
+    }
+
+/*        ************************************* */
+
+/*        THIS SECTION COMPUTES STATISTICS FOR GROUP B.  GROUP B IS A */
+/*        GROUP OF SIZE LMINPK IMMEDIATELY FOLLOWING GROUP A. */
+
+/*        ************************************* */
+
+L140:
+    minb = mallow;
+    maxb = -mallow;
+    minbk = mallow;
+    maxbk = -mallow;
+    ibitbs = 0;
+    mstart = ktotal + 1;
+
+/*        DETERMINE WHETHER THERE IS A LONG STRING OF THE SAME VALUE. */
+/*        THIS WORKS WHEN THERE ARE NO MISSING VALUES. */
+
+    nendb = 1;
+
+    if (mstart < *nxy) {
+
+	if (*is523 == 0) {
+/*              THIS LOOP IS FOR NO MISSING VALUES. */
+
+	    i__1 = *nxy;
+	    for (k = mstart + 1; k <= i__1; ++k) {
+
+		if (ic[k] != ic[mstart]) {
+		    nendb = k - 1;
+		    goto L150;
+		}
+
+/* L145: */
+	    }
+
+	    nendb = *nxy;
+/*              FALL THROUGH THE LOOP MEANS ALL REMAINING VALUES */
+/*              ARE THE SAME. */
+	}
+
+    }
+
+L150:
+/* Computing MAX */
+/* Computing MIN */
+    i__3 = ktotal + lminpk;
+    /*i__1 = nendb, i__2 = min(i__3,*nxy);*/
+    i__1 = nendb, i__2 = (i__3 < *nxy) ? i__3 : *nxy;
+    /*nendb = max(i__1,i__2);*/
+    nendb = (i__1 > i__2) ? i__1 : i__2;
+/* **** 150  NENDB=MIN(KTOTAL+LMINPK,NXY) */
+
+    if (*nxy - nendb <= lminpk / 2) {
+	nendb = *nxy;
+    }
+/*        ABOVE STATEMENT GUARANTEES THE LAST GROUP IS GT LMINPK/2 BY */
+/*        MAKING THE ACTUAL GROUP LARGER.  IF A PROVISION LIKE THIS IS */
+/*        NOT INCLUDED, THERE WILL MANY TIMES BE A VERY SMALL GROUP */
+/*        AT THE END.  USE SEPARATE LOOPS FOR MISSING AND NO MISSING */
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY. */
+
+    if (*is523 == 0) {
+
+	i__1 = nendb;
+	for (k = mstart; k <= i__1; ++k) {
+	    if (ic[k] <= minb) {
+		minb = ic[k];
+/*              NOTE LE, NOT LT.  LT COULD BE USED BUT THEN A */
+/*              RECOMPUTE OVER THE WHOLE GROUP WOULD BE NEEDED */
+/*              MORE OFTEN.  SAME REASONING FOR GE AND OTHER */
+/*              LOOPS BELOW. */
+		minbk = k;
+	    }
+	    if (ic[k] >= maxb) {
+		maxb = ic[k];
+		maxbk = k;
+	    }
+/* L155: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = nendb;
+	for (k = mstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L157;
+	    }
+	    if (ic[k] <= minb) {
+		minb = ic[k];
+		minbk = k;
+	    }
+	    if (ic[k] >= maxb) {
+		maxb = ic[k];
+		maxbk = k;
+	    }
+L157:
+	    ;
+	}
+
+    } else {
+
+	i__1 = nendb;
+	for (k = mstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L160;
+	    }
+	    if (ic[k] <= minb) {
+		minb = ic[k];
+		minbk = k;
+	    }
+	    if (ic[k] >= maxb) {
+		maxb = ic[k];
+		maxbk = k;
+	    }
+L160:
+	    ;
+	}
+
+    }
+
+    kountb = nendb - ktotal;
+    misllb = 0;
+    if (minb != mallow) {
+	goto L165;
+    }
+/*        ALL MISSING VALUES MUST BE ACCOMMODATED. */
+    minb = 0;
+    maxb = 0;
+    misllb = 1;
+    ibitb = 0;
+
+    if (*is523 != 2) {
+	goto L170;
+    }
+/*        WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
+/*        MISSING VALUES, IBITB = 0.  OTHERWISE, IBITB MUST BE */
+/*        CALCULATED. */
+
+L165:
+    for (ibitb = ibitbs; ibitb <= 30; ++ibitb) {
+	if (maxb - minb < ibxx2[ibitb] - lmiss) {
+	    goto L170;
+	}
+/* L166: */
+    }
+
+/*     WRITE(KFILDO,167)MAXB,MINB */
+/* 167  FORMAT(' ****ERROR IN PACK_GP.  VALUE WILL NOT PACK IN 30 BITS.', */
+/*    1       '  MAXB ='I13,'  MINB ='I13,'.  ERROR AT 167.') */
+    *ier = 706;
+    goto L900;
+
+/*        COMPARE THE BITS NEEDED TO PACK GROUP B WITH THOSE NEEDED */
+/*        TO PACK GROUP A.  IF IBITB GE IBITA, TRY TO ADD TO GROUP A. */
+/*        IF NOT, TRY TO ADD A'S POINTS TO B, UNLESS ADDITION TO A */
+/*        HAS BEEN DONE.  THIS LATTER IS CONTROLLED WITH ADDA. */
+
+L170:
+
+/* ***D     WRITE(KFILDO,171)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
+/* ***D    1                               MINB,MAXB,IBITB,MISLLB */
+/* ***D171  FORMAT(' AT 171, KOUNTA ='I8,'  KTOTAL ='I8,'  MINA ='I8, */
+/* ***D    1       '  MAXA ='I8,'  IBITA ='I3,'  MISLLA ='I3, */
+/* ***D    2       '  MINB ='I8,'  MAXB ='I8,'  IBITB ='I3,'  MISLLB ='I3) */
+
+    if (ibitb >= ibita) {
+	goto L180;
+    }
+    if (adda) {
+	goto L200;
+    }
+
+/*        ************************************* */
+
+/*        GROUP B REQUIRES LESS BITS THAN GROUP A.  PUT AS MANY OF A'S */
+/*        POINTS INTO B AS POSSIBLE WITHOUT EXCEEDING THE NUMBER OF */
+/*        BITS NECESSARY TO PACK GROUP B. */
+
+/*        ************************************* */
+
+    kounts = kounta;
+/*        KOUNTA REFERS TO THE PRESENT GROUP A. */
+    mintst = minb;
+    maxtst = maxb;
+    mintstk = minbk;
+    maxtstk = maxbk;
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY. */
+
+    if (*is523 == 0) {
+
+	i__1 = kstart;
+	for (k = ktotal; k >= i__1; --k) {
+/*           START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
+	    if (ic[k] < minb) {
+		mintst = ic[k];
+		mintstk = k;
+	    } else if (ic[k] > maxb) {
+		maxtst = ic[k];
+		maxtstk = k;
+	    }
+	    if (maxtst - mintst >= ibxx2[ibitb]) {
+		goto L174;
+	    }
+/*           NOTE THAT FOR THIS LOOP, LMISS = 0. */
+	    minb = mintst;
+	    maxb = maxtst;
+	    minbk = mintstk;
+	    maxbk = maxtstk;
+	    --kounta;
+/*           THERE IS ONE LESS POINT NOW IN A. */
+/* L1715: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = kstart;
+	for (k = ktotal; k >= i__1; --k) {
+/*           START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
+	    if (ic[k] == *missp) {
+		goto L1718;
+	    }
+	    if (ic[k] < minb) {
+		mintst = ic[k];
+		mintstk = k;
+	    } else if (ic[k] > maxb) {
+		maxtst = ic[k];
+		maxtstk = k;
+	    }
+	    if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
+		goto L174;
+	    }
+/*           FOR THIS LOOP, LMISS = 1. */
+	    minb = mintst;
+	    maxb = maxtst;
+	    minbk = mintstk;
+	    maxbk = maxtstk;
+	    misllb = 0;
+/*           WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
+L1718:
+	    --kounta;
+/*           THERE IS ONE LESS POINT NOW IN A. */
+/* L1719: */
+	}
+
+    } else {
+
+	i__1 = kstart;
+	for (k = ktotal; k >= i__1; --k) {
+/*           START WITH THE END OF THE GROUP AND WORK BACKWARDS. */
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L1729;
+	    }
+	    if (ic[k] < minb) {
+		mintst = ic[k];
+		mintstk = k;
+	    } else if (ic[k] > maxb) {
+		maxtst = ic[k];
+		maxtstk = k;
+	    }
+	    if (maxtst - mintst >= ibxx2[ibitb] - lmiss) {
+		goto L174;
+	    }
+/*           FOR THIS LOOP, LMISS = 2. */
+	    minb = mintst;
+	    maxb = maxtst;
+	    minbk = mintstk;
+	    maxbk = maxtstk;
+	    misllb = 0;
+/*           WHEN THE POINT IS NON MISSING, MISLLB SET = 0. */
+L1729:
+	    --kounta;
+/*           THERE IS ONE LESS POINT NOW IN A. */
+/* L173: */
+	}
+
+    }
+
+/*        AT THIS POINT, KOUNTA CONTAINS THE NUMBER OF POINTS TO CLOSE */
+/*        OUT GROUP A WITH.  GROUP B NOW STARTS WITH KSTART+KOUNTA AND */
+/*        ENDS WITH NENDB.  MINB AND MAXB HAVE BEEN ADJUSTED AS */
+/*        NECESSARY TO REFLECT GROUP B (EVEN THOUGH THE NUMBER OF BITS */
+/*        NEEDED TO PACK GROUP B HAVE NOT INCREASED, THE END POINTS */
+/*        OF THE RANGE MAY HAVE). */
+
+L174:
+    if (kounta == kounts) {
+	goto L200;
+    }
+/*        ON TRANSFER, GROUP A WAS NOT CHANGED.  CLOSE IT OUT. */
+
+/*        ONE OR MORE POINTS WERE TAKEN OUT OF A.  RANGE AND IBITA */
+/*        MAY HAVE TO BE RECOMPUTED; IBITA COULD BE LESS THAN */
+/*        ORIGINALLY COMPUTED.  IN FACT, GROUP A CAN NOW CONTAIN */
+/*        ONLY ONE POINT AND BE PACKED WITH ZERO BITS */
+/*        (UNLESS MISSS NE 0). */
+
+    nouta = kounts - kounta;
+    ktotal -= nouta;
+    kountb += nouta;
+    if (nenda - nouta > minak && nenda - nouta > maxak) {
+	goto L200;
+    }
+/*        WHEN THE ABOVE TEST IS MET, THE MIN AND MAX OF THE */
+/*        CURRENT GROUP A WERE WITHIN THE OLD GROUP A, SO THE */
+/*        RANGE AND IBITA DO NOT NEED TO BE RECOMPUTED. */
+/*        NOTE THAT MINAK AND MAXAK ARE NO LONGER NEEDED. */
+    ibita = 0;
+    mina = mallow;
+    maxa = -mallow;
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY. */
+
+    if (*is523 == 0) {
+
+	i__1 = nenda - nouta;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] < mina) {
+		mina = ic[k];
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+	    }
+/* L1742: */
+	}
+
+    } else if (*is523 == 1) {
+
+	i__1 = nenda - nouta;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L1744;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+	    }
+L1744:
+	    ;
+	}
+
+    } else {
+
+	i__1 = nenda - nouta;
+	for (k = kstart; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L175;
+	    }
+	    if (ic[k] < mina) {
+		mina = ic[k];
+	    }
+	    if (ic[k] > maxa) {
+		maxa = ic[k];
+	    }
+L175:
+	    ;
+	}
+
+    }
+
+    mislla = 0;
+    if (mina != mallow) {
+	goto L1750;
+    }
+/*        ALL MISSING VALUES MUST BE ACCOMMODATED. */
+    mina = 0;
+    maxa = 0;
+    mislla = 1;
+    if (*is523 != 2) {
+	goto L177;
+    }
+/*        WHEN ALL VALUES ARE MISSING AND THERE ARE NO SECONDARY */
+/*        MISSING VALUES IBITA = 0 AS ORIGINALLY SET.  OTHERWISE, */
+/*        IBITA MUST BE CALCULATED. */
+
+L1750:
+    itest = maxa - mina + lmiss;
+
+    for (ibita = 0; ibita <= 30; ++ibita) {
+	if (itest < ibxx2[ibita]) {
+	    goto L177;
+	}
+/* ***        THIS TEST IS THE SAME AS: */
+/* ***         IF(MAXA-MINA.LT.IBXX2(IBITA)-LMISS)GO TO 177 */
+/* L176: */
+    }
+
+/*     WRITE(KFILDO,1760)MAXA,MINA */
+/* 1760 FORMAT(' ****ERROR IN PACK_GP.  VALUE WILL NOT PACK IN 30 BITS.', */
+/*    1       '  MAXA ='I13,'  MINA ='I13,'.  ERROR AT 1760.') */
+    *ier = 706;
+    goto L900;
+
+L177:
+    goto L200;
+
+/*        ************************************* */
+
+/*        AT THIS POINT, GROUP B REQUIRES AS MANY BITS TO PACK AS GROUPA. */
+/*        THEREFORE, TRY TO ADD INC POINTS TO GROUP A WITHOUT INCREASING */
+/*        IBITA.  THIS AUGMENTED GROUP IS CALLED GROUP C. */
+
+/*        ************************************* */
+
+L180:
+    if (mislla == 1) {
+	minc = mallow;
+	minck = mallow;
+	maxc = -mallow;
+	maxck = -mallow;
+    } else {
+	minc = mina;
+	maxc = maxa;
+	minck = minak;
+	maxck = minak;
+    }
+
+    nount = 0;
+    if (*nxy - (ktotal + kinc) <= lminpk / 2) {
+	kinc = *nxy - ktotal;
+    }
+/*        ABOVE STATEMENT CONSTRAINS THE LAST GROUP TO BE NOT LESS THAN */
+/*        LMINPK/2 IN SIZE.  IF A PROVISION LIKE THIS IS NOT INCLUDED, */
+/*        THERE WILL MANY TIMES BE A VERY SMALL GROUP AT THE END. */
+
+/*        USE SEPARATE LOOPS FOR MISSING AND NO MISSING VALUES */
+/*        FOR EFFICIENCY.  SINCE KINC IS USUALLY 1, USING SEPARATE */
+/*        LOOPS HERE DOESN'T BUY MUCH.  A MISSING VALUE WILL ALWAYS */
+/*        TRANSFER BACK TO GROUP A. */
+
+    if (*is523 == 0) {
+
+/* Computing MIN */
+	i__2 = ktotal + kinc;
+	/*i__1 = min(i__2,*nxy);*/
+	i__1 = (i__2 < *nxy) ? i__2 : *nxy;
+	for (k = ktotal + 1; k <= i__1; ++k) {
+	    if (ic[k] < minc) {
+		minc = ic[k];
+		minck = k;
+	    }
+	    if (ic[k] > maxc) {
+		maxc = ic[k];
+		maxck = k;
+	    }
+	    ++nount;
+/* L185: */
+	}
+
+    } else if (*is523 == 1) {
+
+/* Computing MIN */
+	i__2 = ktotal + kinc;
+	/*i__1 = min(i__2,*nxy);*/
+	i__1 = (i__2 < *nxy) ? i__2 : *nxy;
+	for (k = ktotal + 1; k <= i__1; ++k) {
+	    if (ic[k] == *missp) {
+		goto L186;
+	    }
+	    if (ic[k] < minc) {
+		minc = ic[k];
+		minck = k;
+	    }
+	    if (ic[k] > maxc) {
+		maxc = ic[k];
+		maxck = k;
+	    }
+L186:
+	    ++nount;
+/* L187: */
+	}
+
+    } else {
+
+/* Computing MIN */
+	i__2 = ktotal + kinc;
+	/*i__1 = min(i__2,*nxy);*/
+	i__1 = (i__2 < *nxy) ? i__2 : *nxy;
+	for (k = ktotal + 1; k <= i__1; ++k) {
+	    if (ic[k] == *missp || ic[k] == *misss) {
+		goto L189;
+	    }
+	    if (ic[k] < minc) {
+		minc = ic[k];
+		minck = k;
+	    }
+	    if (ic[k] > maxc) {
+		maxc = ic[k];
+		maxck = k;
+	    }
+L189:
+	    ++nount;
+/* L190: */
+	}
+
+    }
+
+/* ***D     WRITE(KFILDO,191)KOUNTA,KTOTAL,MINA,MAXA,IBITA,MISLLA, */
+/* ***D    1   MINC,MAXC,NOUNT,IC(KTOTAL),IC(KTOTAL+1) */
+/* ***D191  FORMAT(' AT 191, KOUNTA ='I8,'  KTOTAL ='I8,'  MINA ='I8, */
+/* ***D    1       '  MAXA ='I8,'  IBITA ='I3,'  MISLLA ='I3, */
+/* ***D    2       '  MINC ='I8,'  MAXC ='I8, */
+/* ***D    3       '  NOUNT ='I5,'  IC(KTOTAL) ='I9,'  IC(KTOTAL+1) =',I9) */
+
+/*        IF THE NUMBER OF BITS NEEDED FOR GROUP C IS GT IBITA, */
+/*        THEN THIS GROUP A IS A GROUP TO PACK. */
+
+    if (minc == mallow) {
+	minc = mina;
+	maxc = maxa;
+	minck = minak;
+	maxck = maxak;
+	misllc = 1;
+	goto L195;
+/*           WHEN THE NEW VALUE(S) ARE MISSING, THEY CAN ALWAYS */
+/*           BE ADDED. */
+
+    } else {
+	misllc = 0;
+    }
+
+    if (maxc - minc >= ibxx2[ibita] - lmiss) {
+	goto L200;
+    }
+
+/*        THE BITS NECESSARY FOR GROUP C HAS NOT INCREASED FROM THE */
+/*        BITS NECESSARY FOR GROUP A.  ADD THIS POINT(S) TO GROUP A. */
+/*        COMPUTE THE NEXT GROUP B, ETC., UNLESS ALL POINTS HAVE BEEN */
+/*        USED. */
+
+L195:
+    ktotal += nount;
+    kounta += nount;
+    mina = minc;
+    maxa = maxc;
+    minak = minck;
+    maxak = maxck;
+    mislla = misllc;
+    adda = TRUE_;
+    if (ktotal >= *nxy) {
+	goto L200;
+    }
+
+    if (minbk > ktotal && maxbk > ktotal) {
+	mstart = nendb + 1;
+/*           THE MAX AND MIN OF GROUP B WERE NOT FROM THE POINTS */
+/*           REMOVED, SO THE WHOLE GROUP DOES NOT HAVE TO BE LOOKED */
+/*           AT TO DETERMINE THE NEW MAX AND MIN.  RATHER START */
+/*           JUST BEYOND THE OLD NENDB. */
+	ibitbs = ibitb;
+	nendb = 1;
+	goto L150;
+    } else {
+	goto L140;
+    }
+
+/*        ************************************* */
+
+/*        GROUP A IS TO BE PACKED.  STORE VALUES IN JMIN( ), JMAX( ), */
+/*        LBIT( ), AND NOV( ). */
+
+/*        ************************************* */
+
+L200:
+    ++(*lx);
+    if (*lx <= *ndg) {
+	goto L205;
+    }
+    lminpk += lminpk / 2;
+/*     WRITE(KFILDO,201)NDG,LMINPK,LX */
+/* 201  FORMAT(' ****NDG ='I5,' NOT LARGE ENOUGH.', */
+/*    1       '  LMINPK IS INCREASED TO 'I3,' FOR THIS FIELD.'/ */
+/*    2       '  LX = 'I10) */
+    iersav = 716;
+    goto L105;
+
+L205:
+    jmin[*lx] = mina;
+    jmax[*lx] = maxa;
+    lbit[*lx] = ibita;
+    nov[*lx] = kounta;
+    kstart = ktotal + 1;
+
+    if (mislla == 0) {
+	misslx[*lx - 1] = mallow;
+    } else {
+	misslx[*lx - 1] = ic[ktotal];
+/*           IC(KTOTAL) WAS THE LAST VALUE PROCESSED.  IF MISLLA NE 0, */
+/*           THIS MUST BE THE MISSING VALUE FOR THIS GROUP. */
+    }
+
+/* ***D     WRITE(KFILDO,206)MISLLA,IC(KTOTAL),KTOTAL,LX,JMIN(LX),JMAX(LX), */
+/* ***D    1                 LBIT(LX),NOV(LX),MISSLX(LX) */
+/* ***D206  FORMAT(' AT 206,  MISLLA ='I2,'  IC(KTOTAL) ='I5,'  KTOTAL ='I8, */
+/* ***D    1       '  LX ='I6,'  JMIN(LX) ='I8,'  JMAX(LX) ='I8, */
+/* ***D    2       '  LBIT(LX) ='I5,'  NOV(LX) ='I8,'  MISSLX(LX) =',I7) */
+
+    if (ktotal >= *nxy) {
+	goto L209;
+    }
+
+/*        THE NEW GROUP A WILL BE THE PREVIOUS GROUP B.  SET LIMITS, ETC. */
+
+    ibita = ibitb;
+    mina = minb;
+    maxa = maxb;
+    minak = minbk;
+    maxak = maxbk;
+    mislla = misllb;
+    nenda = nendb;
+    kounta = kountb;
+    ktotal += kounta;
+    adda = FALSE_;
+    goto L133;
+
+/*        ************************************* */
+
+/*        CALCULATE IBIT, THE NUMBER OF BITS NEEDED TO HOLD THE GROUP */
+/*        MINIMUM VALUES. */
+
+/*        ************************************* */
+
+L209:
+    *ibit = 0;
+
+    i__1 = *lx;
+    for (l = 1; l <= i__1; ++l) {
+L210:
+	if (jmin[l] < ibxx2[*ibit]) {
+	    goto L220;
+	}
+	++(*ibit);
+	goto L210;
+L220:
+	;
+    }
+
+/*        INSERT THE VALUE IN JMIN( ) TO BE USED FOR ALL MISSING */
+/*        VALUES WHEN LBIT( ) = 0.  WHEN SECONDARY MISSING */
+/*        VALUES CAN BE PRESENT, LBIT(L) WILL NOT = 0. */
+
+    if (*is523 == 1) {
+
+	i__1 = *lx;
+	for (l = 1; l <= i__1; ++l) {
+
+	    if (lbit[l] == 0) {
+
+		if (misslx[l - 1] == *missp) {
+		    jmin[l] = ibxx2[*ibit] - 1;
+		}
+
+	    }
+
+/* L226: */
+	}
+
+    }
+
+/*        ************************************* */
+
+/*        CALCULATE JBIT, THE NUMBER OF BITS NEEDED TO HOLD THE BITS */
+/*        NEEDED TO PACK THE VALUES IN THE GROUPS.  BUT FIND AND */
+/*        REMOVE THE REFERENCE VALUE FIRST. */
+
+/*        ************************************* */
+
+/*     WRITE(KFILDO,228)CFEED,LX */
+/* 228  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP WIDTHS LBIT( ) FOR ',I8,' GROUPS' */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,229) (LBIT(J),J=1,MIN(LX,100)) */
+/* 229  FORMAT(/' '20I6) */
+
+    *lbitref = lbit[1];
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+	if (lbit[k] < *lbitref) {
+	    *lbitref = lbit[k];
+	}
+/* L230: */
+    }
+
+    if (*lbitref != 0) {
+
+	i__1 = *lx;
+	for (k = 1; k <= i__1; ++k) {
+	    lbit[k] -= *lbitref;
+/* L240: */
+	}
+
+    }
+
+/*     WRITE(KFILDO,241)CFEED,LBITREF */
+/* 241  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP WIDTHS LBIT( ) AFTER REMOVING REFERENCE ', */
+/*    2             I8, */
+/*    3          /' *****************************************') */
+/*     WRITE(KFILDO,242) (LBIT(J),J=1,MIN(LX,100)) */
+/* 242  FORMAT(/' '20I6) */
+
+    *jbit = 0;
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+L310:
+	if (lbit[k] < ibxx2[*jbit]) {
+	    goto L320;
+	}
+	++(*jbit);
+	goto L310;
+L320:
+	;
+    }
+
+/*        ************************************* */
+
+/*        CALCULATE KBIT, THE NUMBER OF BITS NEEDED TO HOLD THE NUMBER */
+/*        OF VALUES IN THE GROUPS.  BUT FIND AND REMOVE THE */
+/*        REFERENCE FIRST. */
+
+/*        ************************************* */
+
+/*     WRITE(KFILDO,321)CFEED,LX */
+/* 321  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP SIZES NOV( ) FOR ',I8,' GROUPS' */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,322) (NOV(J),J=1,MIN(LX,100)) */
+/* 322  FORMAT(/' '20I6) */
+
+    *novref = nov[1];
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+	if (nov[k] < *novref) {
+	    *novref = nov[k];
+	}
+/* L400: */
+    }
+
+    if (*novref > 0) {
+
+	i__1 = *lx;
+	for (k = 1; k <= i__1; ++k) {
+	    nov[k] -= *novref;
+/* L405: */
+	}
+
+    }
+
+/*     WRITE(KFILDO,406)CFEED,NOVREF */
+/* 406  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP SIZES NOV( ) AFTER REMOVING REFERENCE ',I8, */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,407) (NOV(J),J=1,MIN(LX,100)) */
+/* 407  FORMAT(/' '20I6) */
+/*     WRITE(KFILDO,408)CFEED */
+/* 408  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP REFERENCES JMIN( )' */
+/*    2          /' *****************************************') */
+/*     WRITE(KFILDO,409) (JMIN(J),J=1,MIN(LX,100)) */
+/* 409  FORMAT(/' '20I6) */
+
+    *kbit = 0;
+
+    i__1 = *lx;
+    for (k = 1; k <= i__1; ++k) {
+L410:
+	if (nov[k] < ibxx2[*kbit]) {
+	    goto L420;
+	}
+	++(*kbit);
+	goto L410;
+L420:
+	;
+    }
+
+/*        DETERMINE WHETHER THE GROUP SIZES SHOULD BE REDUCED */
+/*        FOR SPACE EFFICIENCY. */
+
+    if (ired == 0) {
+	reduce(kfildo, &jmin[1], &jmax[1], &lbit[1], &nov[1], lx, ndg, ibit, 
+		jbit, kbit, novref, ibxx2, ier);
+
+	if (*ier == 714 || *ier == 715) {
+/*              REDUCE HAS ABORTED.  REEXECUTE PACK_GP WITHOUT REDUCE. */
+/*              PROVIDE FOR A NON FATAL RETURN FROM REDUCE. */
+	    iersav = *ier;
+	    ired = 1;
+	    *ier = 0;
+	    goto L102;
+	}
+
+    }
+
+    if ( misslx != 0 ) {
+         free(misslx);
+         misslx=0;
+    }
+/*     CALL TIMPR(KFILDO,KFILDO,'END   PACK_GP        ') */
+    if (iersav != 0) {
+	*ier = iersav;
+	return 0;
+    }
+
+/* 900  IF(IER.NE.0)RETURN1 */
+
+L900:
+    if ( misslx != 0 ) free(misslx);
+    return 0;
+} /* pack_gp__ */
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/pdstemplates.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pdstemplates.c
new file mode 100644
index 0000000..1994206
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pdstemplates.c
@@ -0,0 +1,271 @@
+/**********************************************************
+ * Version $Id: pdstemplates.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include "grib2.h"
+#include "pdstemplates.h"
+
+g2int getpdsindex(g2int number)
+///$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getpdsindex
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2001-06-28
+//
+// ABSTRACT: This function returns the index of specified Product
+//   Definition Template 4.NN (NN=number) in array templates.
+//
+// PROGRAM HISTORY LOG:
+// 2001-06-28  Gilbert
+//
+// USAGE:    index=getpdsindex(number)
+//   INPUT ARGUMENT LIST:
+//     number   - NN, indicating the number of the Product Definition
+//                Template 4.NN that is being requested.
+//
+// RETURNS:  Index of PDT 4.NN in array templates, if template exists.
+//           = -1, otherwise.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$/
+{
+           g2int j,getpdsindex=-1;
+
+           for (j=0;j<MAXPDSTEMP;j++) {
+              if (number == templatespds[j].template_num) {
+                 getpdsindex=j;
+                 return(getpdsindex);
+              }
+           }
+
+           return(getpdsindex);
+}
+
+
+template *getpdstemplate(g2int number)
+///$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    getpdstemplate 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+//
+// ABSTRACT: This subroutine returns PDS template information for a 
+//   specified Product Definition Template 4.NN.
+//   The number of entries in the template is returned along with a map
+//   of the number of octets occupied by each entry.  Also, a flag is
+//   returned to indicate whether the template would need to be extended.
+//
+// PROGRAM HISTORY LOG:
+// 2000-05-11  Gilbert
+//
+// USAGE:    CALL getpdstemplate(number)
+//   INPUT ARGUMENT LIST:
+//     number   - NN, indicating the number of the Product Definition 
+//                Template 4.NN that is being requested.
+//
+//   RETURN VALUE:
+//        - Pointer to the returned template struct.
+//          Returns NULL pointer, if template not found.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$/
+{
+           g2int index;
+           template *new;
+
+           index=getpdsindex(number);
+
+           if (index != -1) {
+              new=(template *)malloc(sizeof(template));
+              new->type=4;
+              new->num=templatespds[index].template_num;
+              new->maplen=templatespds[index].mappdslen;
+              new->needext=templatespds[index].needext;
+              new->map=(g2int *)templatespds[index].mappds;
+              new->extlen=0;
+              new->ext=0;        //NULL
+              return(new);
+           }
+           else {
+             printf("getpdstemplate: PDS Template 4.%d not defined.\n",(int)number);
+             return(0);        //NULL
+           }
+
+         return(0);        //NULL
+}
+         
+        
+template *extpdstemplate(g2int number,g2int *list)
+///$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    extpdstemplate 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2000-05-11
+//
+// ABSTRACT: This subroutine generates the remaining octet map for a
+//   given Product Definition Template, if required.  Some Templates can
+//   vary depending on data values given in an earlier part of the 
+//   Template, and it is necessary to know some of the earlier entry
+//   values to generate the full octet map of the Template.
+//
+// PROGRAM HISTORY LOG:
+// 2000-05-11  Gilbert
+//
+// USAGE:    CALL extpdstemplate(number,list)
+//   INPUT ARGUMENT LIST:
+//     number   - NN, indicating the number of the Product Definition 
+//                Template 4.NN that is being requested.
+//     list()   - The list of values for each entry in the 
+//                the Product Definition Template 4.NN.
+//
+//   RETURN VALUE:
+//        - Pointer to the returned template struct.
+//          Returns NULL pointer, if template not found.
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+           template *new;
+           g2int index,i,j,k,l;
+
+           index=getpdsindex(number);
+           if (index == -1) return(0);
+
+           new=getpdstemplate(number);
+
+           if ( ! new->needext ) return(new);
+
+           if ( number == 3 ) {
+              new->extlen=list[26];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 4 ) {
+              new->extlen=list[25];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<new->extlen;i++) {
+                 new->ext[i]=1;
+              }
+           }
+           else if ( number == 8 ) {
+              if ( list[21] > 1 ) {
+                 new->extlen=(list[21]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[21];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[23+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 9 ) {
+              if ( list[28] > 1 ) {
+                 new->extlen=(list[28]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[28];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[30+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 10 ) {
+              if ( list[22] > 1 ) {
+                 new->extlen=(list[22]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[22];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[24+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 11 ) {
+              if ( list[24] > 1 ) {
+                 new->extlen=(list[24]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[24];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[26+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 12 ) {
+              if ( list[23] > 1 ) {
+                 new->extlen=(list[23]-1)*6;
+                 new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+                 for (j=2;j<=list[23];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[25+k];
+                    }
+                 }
+              }
+           }
+           else if ( number == 13 ) {
+              new->extlen=((list[37]-1)*6)+list[26];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              if ( list[37] > 1 ) {
+                 for (j=2;j<=list[37];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[39+k];
+                    }
+                 }
+              }
+              l=(list[37]-1)*6;
+              if ( l<0 ) l=0;
+              for (i=0;i<list[26];i++) {
+                new->ext[l+i]=1;
+              }
+           }
+           else if ( number == 14 ) {
+              new->extlen=((list[36]-1)*6)+list[25];
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              if ( list[36] > 1 ) {
+                 for (j=2;j<=list[36];j++) {
+                    l=(j-2)*6;
+                    for (k=0;k<6;k++) {
+                       new->ext[l+k]=new->map[38+k];
+                    }
+                 }
+              }
+              l=(list[36]-1)*6;
+              if ( l<0 ) l=0;
+              for (i=0;i<list[25];i++) {
+                new->ext[l+i]=1;
+              }
+           }
+           else if ( number == 30 ) {
+              new->extlen=list[4]*5;
+              new->ext=(g2int *)malloc(sizeof(g2int)*new->extlen);
+              for (i=0;i<list[4];i++) {
+                 l=i*5;
+                 new->ext[l]=2;
+                 new->ext[l+1]=2;
+                 new->ext[l+2]=1;
+                 new->ext[l+3]=1;
+                 new->ext[l+4]=4;
+              }
+           }
+           return(new);
+
+}
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/pdstemplates.h b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pdstemplates.h
new file mode 100644
index 0000000..9c10c1e
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pdstemplates.h
@@ -0,0 +1,121 @@
+/**********************************************************
+ * Version $Id: pdstemplates.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#ifndef _pdstemplates_H
+#define _pdstemplates_H
+#include "grib2.h"
+
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-26
+//
+// ABSTRACT: This inculde file contains info on all the available 
+//   GRIB2 Product Definition Templates used in Section 4 (PDS).
+//   The information decribing each template is stored in the
+//   pdstemplate structure defined below.
+//
+//   Each Template has three parts: The number of entries in the template
+//   (mappdslen);  A map of the template (mappds), which contains the
+//   number of octets in which to pack each of the template values; and
+//   a logical value (needext) that indicates whether the Template needs 
+//   to be extended.  In some cases the number of entries in a template 
+//   can vary depending upon values specified in the "static" part of 
+//   the template.  ( See Template 4.3 as an example )
+//
+//   NOTE:  Array mappds contains the number of octets in which the 
+//   corresponding template values will be stored.  A negative value in
+//   mappds is used to indicate that the corresponding template entry can
+//   contain negative values.  This information is used later when packing
+//   (or unpacking) the template data values.  Negative data values in GRIB
+//   are stored with the left most bit set to one, and a negative number
+//   of octets value in mappds[] indicates that this possibility should
+//   be considered.  The number of octets used to store the data value
+//   in this case would be the absolute value of the negative value in 
+//   mappds[].
+//  
+// 2005-12-08  Gilbert  -  Allow negative scale factors and limits for
+//                         Templates 4.5 and 4.9
+//
+//$$$
+
+      #define MAXPDSTEMP 23           // maximum number of templates
+      #define MAXPDSMAPLEN 200        // maximum template map length
+
+      struct pdstemplate 
+      {
+          g2int template_num;
+          g2int mappdslen;
+          g2int needext;
+          g2int mappds[MAXPDSMAPLEN];
+      };
+
+      const struct pdstemplate templatespds[MAXPDSTEMP] = {
+             // 4.0: Analysis or Forecast at Horizontal Level/Layer
+             //      at a point in time
+         {0,15,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.1: Individual Ensemble Forecast at Horizontal Level/Layer
+             //      at a point in time
+         {1,18,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1} },
+             // 4.2: Derived Fcst based on whole Ensemble at Horiz Level/Layer
+             //      at a point in time
+         {2,17,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1} },
+             // 4.3: Derived Fcst based on Ensemble cluster over rectangular
+             //      area at Horiz Level/Layer at a point in time
+         {3,31,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4} },
+             // 4.4: Derived Fcst based on Ensemble cluster over circular
+             //      area at Horiz Level/Layer at a point in time
+         {4,30,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4} },
+             // 4.5: Probablility Forecast at Horiz Level/Layer
+             //      at a point in time
+         {5,22,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4} },
+             // 4.6: Percentile Forecast at Horiz Level/Layer
+             //      at a point in time
+         {6,16,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1} },
+             // 4.7: Analysis or Forecast Error at Horizontal Level/Layer
+             //      at a point in time
+         {7,15,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.8: Ave/Accum/etc... at Horiz Level/Layer
+             //      in a time interval
+         {8,29,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.9: Probablility Forecast at Horiz Level/Layer
+             //      in a time interval
+         {9,36,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,-1,-4,-1,-4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.10: Percentile Forecast at Horiz Level/Layer
+             //       in a time interval
+         {10,30,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.11: Individual Ensemble Forecast at Horizontal Level/Layer
+             //       in a time interval
+         {11,32,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.12: Derived Fcst based on whole Ensemble at Horiz Level/Layer
+             //       in a time interval
+         {12,31,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.13: Derived Fcst based on Ensemble cluster over rectangular
+             //       area at Horiz Level/Layer in a time interval
+         {13,45,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.14: Derived Fcst based on Ensemble cluster over circular
+             //       area at Horiz Level/Layer in a time interval
+         {14,44,1, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,1,1,1,1,1,1,1,-4,4,4,1,-1,4,-1,4,2,1,1,1,1,1,1,4,1,1,1,4,1,4} },
+             // 4.20: Radar Product
+         {20,19,0, {1,1,1,1,1,-4,4,2,4,2,1,1,1,1,1,2,1,3,2} },
+             // 4.30: Satellite Product
+         {30,5,1, {1,1,1,1,1} },
+             // 4.254: CCITT IA5 Character String
+         {254,3,0, {1,1,4} },
+             // 4.1000: Cross section of analysis or forecast
+             //         at a point in time
+         {1000,9,0, {1,1,1,1,1,2,1,1,4} },
+             // 4.1001: Cross section of Ave/Accum/etc... analysis or forecast
+             //         in a time interval
+         {1001,16,0, {1,1,1,1,1,2,1,1,4,4,1,1,1,4,1,4} },
+             // 4.1001: Cross section of Ave/Accum/etc... analysis or forecast
+             //         over latitude or longitude
+         {1002,15,0, {1,1,1,1,1,2,1,1,4,1,1,1,4,4,2} },
+             // 4.1100: Hovmoller-type grid w/ no averaging or other
+             //         statistical processing
+         {1100,15,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4} },
+             // 4.1100: Hovmoller-type grid with averaging or other
+             //         statistical processing
+         {1101,22,0, {1,1,1,1,1,2,1,1,4,1,-1,-4,1,-1,-4,4,1,1,1,4,1,4} }
+
+      } ;
+
+
+#endif  /*  _pdstemplates_H  */
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/pngpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pngpack.c
new file mode 100644
index 0000000..237847c
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pngpack.c
@@ -0,0 +1,165 @@
+/**********************************************************
+ * Version $Id: pngpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+int enc_png(char *,g2int ,g2int ,g2int ,char *);
+
+void pngpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+             unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    pngpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-27
+//
+// ABSTRACT: This subroutine packs up a data field into PNG image format.
+//   After the data field is scaled, and the reference value is subtracted out,
+//   it is treated as a grayscale image and passed to a PNG encoder.
+//   It also fills in GRIB2 Data Representation Template 5.41 or 5.40010 with 
+//   the appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-27  Gilbert
+//
+// USAGE:    pngpack(g2float *fld,g2int width,g2int height,g2int *idrstmpl,
+//                   unsigned char *cpack,g2int *lcpack);
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     width    - number of points in the x direction
+//     height   - number of points in the y direction
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.41 or 5.40010
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                [3] = number of bits for each data value - ignored on input
+//                [4] = Original field type - currently ignored on input
+//                      Data values assumed to be reals.
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.41 or 5.40010
+//                [0] = Reference value - set by pngpack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                [3] = Number of bits containing each grayscale pixel value
+//                [4] = Original field type - currently set = 0 on output.
+//                      Data values assumed to be reals.
+//     cpack    - The packed data field 
+//     lcpack   - length of packed field cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+      g2int  *ifld;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      g2int  j,nbits,imin,imax,maxdif;
+      g2int  ndpts,nbytes;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      unsigned char *ctemp;
+      
+      ifld=0;
+      ndpts=width*height;
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+      maxdif = (g2int)rint( (rmax-rmin)*dscale*bscale );
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if (rmin != rmax  &&  maxdif != 0 ) {
+        ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+        //
+        //  Determine which algorithm to use based on user-supplied 
+        //  binary scale factor and number of bits.
+        //
+        if (idrstmpl[1] == 0) {
+           //
+           //  No binary scaling and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           imin=(g2int)rint(rmin*dscale);
+           imax=(g2int)rint(rmax*dscale);
+           maxdif=imax-imin;
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           rmin=(g2float)imin;
+           //   scale data
+           for(j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else {
+           //
+           //  Use binary scaling factor and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxdif=(g2int)rint((rmax-rmin)*bscale);
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Pack data into full octets, then do PNG encode.
+        //  and calculate the length of the packed data in bytes
+        //
+        if (nbits <= 8) {
+            nbits=8;
+        }
+        else if (nbits <= 16) {
+            nbits=16;
+        }
+        else if (nbits <= 24) {
+            nbits=24;
+        }
+        else {
+            nbits=32;
+        }
+        nbytes=(nbits/8)*ndpts;
+        ctemp=calloc(nbytes,1);
+        sbits(ctemp,ifld,0,nbits,0,ndpts);
+        //
+        //  Encode data into PNG Format.
+        //
+        *lcpack=(g2int)enc_png((char *)ctemp,width,height,nbits,(char *)cpack);
+        if (*lcpack <= 0) {
+           printf("pngpack: ERROR Packing PNG = %d\n",(int)*lcpack);
+        }
+        free(ctemp);
+
+      }
+      else {
+        nbits=0;
+        *lcpack=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.0
+//
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      idrstmpl[3]=nbits;
+      idrstmpl[4]=0;         // original data were reals
+      if (ifld != 0) free(ifld);
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/pngunpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pngunpack.c
new file mode 100644
index 0000000..22a9ed3
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/pngunpack.c
@@ -0,0 +1,79 @@
+/**********************************************************
+ * Version $Id: pngunpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+int dec_png(unsigned char *,g2int *,g2int *,char *);
+
+g2int pngunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+                g2float *fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    pngunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2003-08-27
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed into a 
+//   PNG image format
+//   using info from the GRIB2 Data Representation Template 5.41 or 5.40010.
+//
+// PROGRAM HISTORY LOG:
+// 2003-08-27  Gilbert
+//
+// USAGE:    pngunpack(unsigned char *cpack,g2int len,g2int *idrstmpl,g2int ndpts,
+//                     g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - The packed data field (character*1 array)
+//     len      - length of packed field cpack().
+//     idrstmpl - Pointer to array of values for Data Representation
+//                Template 5.41 or 5.40010
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld[]    - Contains the unpacked data values
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int  *ifld;
+      g2int  j,nbits,iret,width,height;
+      g2float  ref,bscale,dscale;
+      unsigned char *ctemp;
+
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+//
+//  if nbits equals 0, we have a constant field where the reference value
+//  is the data value at each gridpoint
+//
+      if (nbits != 0) {
+
+         ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+         ctemp=(unsigned char *)calloc(ndpts*4,1);
+         if ( ifld == 0 || ctemp == 0) {
+            fprintf(stderr,"Could not allocate space in jpcunpack.\n  Data field NOT upacked.\n");
+            return(1);
+         }
+         iret=(g2int)dec_png(cpack,&width,&height,ctemp);
+         gbits(ctemp,ifld,0,nbits,0,ndpts);
+         for (j=0;j<ndpts;j++) {
+           fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale;
+         }
+         free(ctemp);
+         free(ifld);
+      }
+      else {
+         for (j=0;j<ndpts;j++) fld[j]=ref;
+      }
+
+      return(0);
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/rdieee.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/rdieee.c
new file mode 100644
index 0000000..03e3771
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/rdieee.c
@@ -0,0 +1,81 @@
+/**********************************************************
+ * Version $Id: rdieee.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include "grib2.h"
+
+void rdieee(g2int *rieee,g2float *a,g2int num)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    rdieee 
+//   PRGMMR: Gilbert         ORG: W/NP11    DATE: 2002-10-25
+//
+// ABSTRACT: This subroutine reads a list of real values in 
+//   32-bit IEEE floating point format.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-25  Gilbert
+//
+// USAGE:    void rdieee(g2int *rieee,g2float *a,g2int num)
+//   INPUT ARGUMENT LIST:
+//     rieee    - g2int array of floating point values in 32-bit IEEE format.
+//     num      - Number of floating point values to convert.
+//
+//   OUTPUT ARGUMENT LIST:      
+//     a        - float array of real values.  a must be allocated with at
+//                least 4*num bytes of memory before calling this function.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int  j;
+      g2int  isign,iexp,imant;
+
+      g2float  sign,temp;
+      static g2float  two23,two126;
+      static g2int test=0;
+      g2intu msk1=0x80000000;        // 10000000000000000000000000000000 binary
+      g2int msk2=0x7F800000;         // 01111111100000000000000000000000 binary
+      g2int msk3=0x007FFFFF;         // 00000000011111111111111111111111 binary
+
+      if ( test == 0 ) {
+         two23=(g2float)int_power(2.0,-23);
+         two126=(g2float)int_power(2.0,-126);
+         test=1;
+      }
+
+      for (j=0;j<num;j++) {
+//
+//  Extract sign bit, exponent, and mantissa
+//
+        isign=(rieee[j]&msk1)>>31;
+        iexp=(rieee[j]&msk2)>>23;
+        imant=(rieee[j]&msk3);
+        //printf("SAGieee= %ld %ld %ld\n",isign,iexp,imant);
+
+        sign=1.0;
+        if (isign == 1) sign=-1.0;
+        
+        if ( (iexp > 0) && (iexp < 255) ) {
+          temp=(g2float)int_power(2.0,(iexp-127));
+          a[j]=sign*temp*(1.0+(two23*(g2float)imant));
+        }
+        else if ( iexp == 0 ) {
+          if ( imant != 0 )
+            a[j]=sign*two126*two23*(g2float)imant;
+          else
+            a[j]=sign*0.0;
+          
+        }
+        else if ( iexp == 255 )
+           a[j]=sign*(1E+37);
+
+
+      }
+
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/reduce.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/reduce.c
new file mode 100644
index 0000000..aafd182
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/reduce.c
@@ -0,0 +1,413 @@
+/**********************************************************
+ * Version $Id: reduce.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/* reduce.f -- translated by f2c (version 20031025).
+   You must link the resulting object file with libf2c:
+	on Microsoft Windows system, link with libf2c.lib;
+	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
+	or, if you install libf2c.a in a standard place, with -lf2c -lm
+	-- in that order, at the end of the command line, as in
+		cc *.o -lf2c -lm
+	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
+
+		http://www.netlib.org/f2c/libf2c.zip
+*/
+
+/*#include "f2c.h"*/
+#include <stdlib.h>
+#include "grib2.h"
+typedef g2int integer;
+typedef g2float real;
+
+/* Subroutine */ int reduce(integer *kfildo, integer *jmin, integer *jmax, 
+	integer *lbit, integer *nov, integer *lx, integer *ndg, integer *ibit,
+	 integer *jbit, integer *kbit, integer *novref, integer *ibxx2, 
+	integer *ier)
+{
+    /* Initialized data */
+
+    static integer ifeed = 12;
+
+    /* System generated locals */
+    integer i__1, i__2;
+
+    /* Local variables */
+    static integer newboxtp, j, l, m, jj, lxn, left;
+    static real pimp;
+    static integer move, novl;
+    static char cfeed[1];
+    static integer nboxj[31], lxnkp, iorigb, ibxx2m1, movmin,
+	     ntotbt[31], ntotpr, newboxt;
+    integer *newbox, *newboxp;
+
+
+/*        NOVEMBER 2001   GLAHN   TDL   GRIB2 */
+/*        MARCH    2002   GLAHN   COMMENT IER = 715 */
+/*        MARCH    2002   GLAHN   MODIFIED TO ACCOMMODATE LX=1 ON ENTRY */
+
+/*        PURPOSE */
+/*            DETERMINES WHETHER THE NUMBER OF GROUPS SHOULD BE */
+/*            INCREASED IN ORDER TO REDUCE THE SIZE OF THE LARGE */
+/*            GROUPS, AND TO MAKE THAT ADJUSTMENT.  BY REDUCING THE */
+/*            SIZE OF THE LARGE GROUPS, LESS BITS MAY BE NECESSARY */
+/*            FOR PACKING THE GROUP SIZES AND ALL THE INFORMATION */
+/*            ABOUT THE GROUPS. */
+
+/*            THE REFERENCE FOR NOV( ) WAS REMOVED IN THE CALLING */
+/*            ROUTINE SO THAT KBIT COULD BE DETERMINED.  THIS */
+/*            FURNISHES A STARTING POINT FOR THE ITERATIONS IN REDUCE. */
+/*            HOWEVER, THE REFERENCE MUST BE CONSIDERED. */
+
+/*        DATA SET USE */
+/*           KFILDO - UNIT NUMBER FOR OUTPUT (PRINT) FILE. (OUTPUT) */
+
+/*        VARIABLES IN CALL SEQUENCE */
+/*              KFILDO = UNIT NUMBER FOR OUTPUT (PRINT) FILE.  (INPUT) */
+/*             JMIN(J) = THE MINIMUM OF EACH GROUP (J=1,LX).  IT IS */
+/*                       POSSIBLE AFTER SPLITTING THE GROUPS, JMIN( ) */
+/*                       WILL NOT BE THE MINIMUM OF THE NEW GROUP. */
+/*                       THIS DOESN'T MATTER; JMIN( ) IS REALLY THE */
+/*                       GROUP REFERENCE AND DOESN'T HAVE TO BE THE */
+/*                       SMALLEST VALUE.  (INPUT/OUTPUT) */
+/*             JMAX(J) = THE MAXIMUM OF EACH GROUP (J=1,LX). */
+/*                       (INPUT/OUTPUT) */
+/*             LBIT(J) = THE NUMBER OF BITS NECESSARY TO PACK EACH GROUP */
+/*                       (J=1,LX).  (INPUT/OUTPUT) */
+/*              NOV(J) = THE NUMBER OF VALUES IN EACH GROUP (J=1,LX). */
+/*                       (INPUT/OUTPUT) */
+/*                  LX = THE NUMBER OF GROUPS.  THIS WILL BE INCREASED */
+/*                       IF GROUPS ARE SPLIT.  (INPUT/OUTPUT) */
+/*                 NDG = THE DIMENSION OF JMIN( ), JMAX( ), LBIT( ), AND */
+/*                       NOV( ).  (INPUT) */
+/*                IBIT = THE NUMBER OF BITS NECESSARY TO PACK THE JMIN(J) */
+/*                       VALUES, J=1,LX.  (INPUT) */
+/*                JBIT = THE NUMBER OF BITS NECESSARY TO PACK THE LBIT(J) */
+/*                       VALUES, J=1,LX.  (INPUT) */
+/*                KBIT = THE NUMBER OF BITS NECESSARY TO PACK THE NOV(J) */
+/*                       VALUES, J=1,LX.  IF THE GROUPS ARE SPLIT, KBIT */
+/*                       IS REDUCED.  (INPUT/OUTPUT) */
+/*              NOVREF = REFERENCE VALUE FOR NOV( ).  (INPUT) */
+/*            IBXX2(J) = 2**J (J=0,30).  (INPUT) */
+/*                 IER = ERROR RETURN.  (OUTPUT) */
+/*                         0 = GOOD RETURN. */
+/*                       714 = PROBLEM IN ALGORITHM.  REDUCE ABORTED. */
+/*                       715 = NGP NOT LARGE ENOUGH.  REDUCE ABORTED. */
+/*           NTOTBT(J) = THE TOTAL BITS USED FOR THE PACKING BITS J */
+/*                       (J=1,30).  (INTERNAL) */
+/*            NBOXJ(J) = NEW BOXES NEEDED FOR THE PACKING BITS J */
+/*                       (J=1,30).  (INTERNAL) */
+/*           NEWBOX(L) = NUMBER OF NEW BOXES (GROUPS) FOR EACH ORIGINAL */
+/*                       GROUP (L=1,LX) FOR THE CURRENT J.  (AUTOMATIC) */
+/*                       (INTERNAL) */
+/*          NEWBOXP(L) = SAME AS NEWBOX( ) BUT FOR THE PREVIOUS J. */
+/*                       THIS ELIMINATES RECOMPUTATION.  (AUTOMATIC) */
+/*                       (INTERNAL) */
+/*               CFEED = CONTAINS THE CHARACTER REPRESENTATION */
+/*                       OF A PRINTER FORM FEED.  (CHARACTER) (INTERNAL) */
+/*               IFEED = CONTAINS THE INTEGER VALUE OF A PRINTER */
+/*                       FORM FEED.  (INTERNAL) */
+/*              IORIGB = THE ORIGINAL NUMBER OF BITS NECESSARY */
+/*                       FOR THE GROUP VALUES.  (INTERNAL) */
+/*        1         2         3         4         5         6         7 X */
+
+/*        NON SYSTEM SUBROUTINES CALLED */
+/*           NONE */
+
+
+/*        NEWBOX( ) AND NEWBOXP( ) were AUTOMATIC ARRAYS. */
+    newbox = (integer *)calloc(*ndg,sizeof(integer));
+    newboxp = (integer *)calloc(*ndg,sizeof(integer));
+
+    /* Parameter adjustments */
+    --nov;
+    --lbit;
+    --jmax;
+    --jmin;
+
+    /* Function Body */
+
+    *ier = 0;
+    if (*lx == 1) {
+	goto L410;
+    }
+/*        IF THERE IS ONLY ONE GROUP, RETURN. */
+
+    *(unsigned char *)cfeed = (char) ifeed;
+
+/*        INITIALIZE NUMBER OF NEW BOXES PER GROUP TO ZERO. */
+
+    i__1 = *lx;
+    for (l = 1; l <= i__1; ++l) {
+	newbox[l - 1] = 0;
+/* L110: */
+    }
+
+/*        INITIALIZE NUMBER OF TOTAL NEW BOXES PER J TO ZERO. */
+
+    for (j = 1; j <= 31; ++j) {
+	ntotbt[j - 1] = 999999999;
+	nboxj[j - 1] = 0;
+/* L112: */
+    }
+
+    iorigb = (*ibit + *jbit + *kbit) * *lx;
+/*        IBIT = BITS TO PACK THE JMIN( ). */
+/*        JBIT = BITS TO PACK THE LBIT( ). */
+/*        KBIT = BITS TO PACK THE NOV( ). */
+/*        LX = NUMBER OF GROUPS. */
+    ntotbt[*kbit - 1] = iorigb;
+/*           THIS IS THE VALUE OF TOTAL BITS FOR THE ORIGINAL LX */
+/*           GROUPS, WHICH REQUIRES KBITS TO PACK THE GROUP */
+/*           LENGHTS.  SETTING THIS HERE MAKES ONE LESS LOOPS */
+/*           NECESSARY BELOW. */
+
+/*        COMPUTE BITS NOW USED FOR THE PARAMETERS DEFINED. */
+
+/*        DETERMINE OTHER POSSIBILITES BY INCREASING LX AND DECREASING */
+/*        NOV( ) WITH VALUES GREATER THAN THRESHOLDS.  ASSUME A GROUP IS */
+/*        SPLIT INTO 2 OR MORE GROUPS SO THAT KBIT IS REDUCED WITHOUT */
+/*        CHANGING IBIT OR JBIT. */
+
+    jj = 0;
+
+/* Computing MIN */
+    i__1 = 30, i__2 = *kbit - 1;
+    /*for (j = min(i__1,i__2); j >= 2; --j) {*/
+    for (j = (i__1 < i__2) ? i__1 : i__2; j >= 2; --j) {
+/*           VALUES GE KBIT WILL NOT REQUIRE SPLITS.  ONCE THE TOTAL */
+/*           BITS START INCREASING WITH DECREASING J, STOP.  ALSO, THE */
+/*           NUMBER OF BITS REQUIRED IS KNOWN FOR KBITS = NTOTBT(KBIT). */
+
+	newboxt = 0;
+
+	i__1 = *lx;
+	for (l = 1; l <= i__1; ++l) {
+
+	    if (nov[l] < ibxx2[j]) {
+		newbox[l - 1] = 0;
+/*                 NO SPLITS OR NEW BOXES. */
+		goto L190;
+	    } else {
+		novl = nov[l];
+
+		m = (nov[l] - 1) / (ibxx2[j] - 1) + 1;
+/*                 M IS FOUND BY SOLVING THE EQUATION BELOW FOR M: */
+/*                 (NOV(L)+M-1)/M LT IBXX2(J) */
+/*                 M GT (NOV(L)-1)/(IBXX2(J)-1) */
+/*                 SET M = (NOV(L)-1)/(IBXX2(J)-1)+1 */
+L130:
+		novl = (nov[l] + m - 1) / m;
+/*                 THE +M-1 IS NECESSARY.  FOR INSTANCE, 15 WILL FIT */
+/*                 INTO A BOX 4 BITS WIDE, BUT WON'T DIVIDE INTO */
+/*                 TWO BOXES 3 BITS WIDE EACH. */
+
+		if (novl < ibxx2[j]) {
+		    goto L185;
+		} else {
+		    ++m;
+/* ***                  WRITE(KFILDO,135)L,NOV(L),NOVL,M,J,IBXX2(J) */
+/* *** 135              FORMAT(/' AT 135--L,NOV(L),NOVL,M,J,IBXX2(J)',6I10) */
+		    goto L130;
+		}
+
+/*                 THE ABOVE DO LOOP WILL NEVER COMPLETE. */
+	    }
+
+L185:
+	    newbox[l - 1] = m - 1;
+	    newboxt = newboxt + m - 1;
+L190:
+	    ;
+	}
+
+	nboxj[j - 1] = newboxt;
+	ntotpr = ntotbt[j];
+	ntotbt[j - 1] = (*ibit + *jbit) * (*lx + newboxt) + j * (*lx + 
+		newboxt);
+
+	if (ntotbt[j - 1] >= ntotpr) {
+	    jj = j + 1;
+/*              THE PLUS IS USED BECAUSE J DECREASES PER ITERATION. */
+	    goto L250;
+	} else {
+
+/*              SAVE THE TOTAL NEW BOXES AND NEWBOX( ) IN CASE THIS */
+/*              IS THE J TO USE. */
+
+	    newboxtp = newboxt;
+
+	    i__1 = *lx;
+	    for (l = 1; l <= i__1; ++l) {
+		newboxp[l - 1] = newbox[l - 1];
+/* L195: */
+	    }
+
+/*           WRITE(KFILDO,197)NEWBOXT,IBXX2(J) */
+/* 197        FORMAT(/' *****************************************' */
+/*    1             /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
+/*    2              I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
+/*    3             /' *****************************************') */
+/*           WRITE(KFILDO,198) (NEWBOX(L),L=1,LX) */
+/* 198        FORMAT(/' '20I6/(' '20I6)) */
+	}
+
+/* 205     WRITE(KFILDO,209)KBIT,IORIGB */
+/* 209     FORMAT(/' ORIGINAL BITS WITH KBIT OF',I5,' =',I10) */
+/*        WRITE(KFILDO,210)(N,N=2,10),(IBXX2(N),N=2,10), */
+/*    1                    (NTOTBT(N),N=2,10),(NBOXJ(N),N=2,10), */
+/*    2                    (N,N=11,20),(IBXX2(N),N=11,20), */
+/*    3                    (NTOTBT(N),N=11,20),(NBOXJ(N),N=11,20), */
+/*    4                    (N,N=21,30),(IBXX2(N),N=11,20), */
+/*    5                    (NTOTBT(N),N=21,30),(NBOXJ(N),N=21,30) */
+/* 210     FORMAT(/' THE TOTAL BYTES FOR MAXIMUM GROUP LENGTHS BY ROW'// */
+/*    1      '   J         = THE NUMBER OF BITS PER GROUP LENGTH'/ */
+/*    2      '   IBXX2(J)  = THE MAXIMUM GROUP LENGTH PLUS 1 FOR THIS J'/ */
+/*    3      '   NTOTBT(J) = THE TOTAL BITS FOR THIS J'/ */
+/*    4      '   NBOXJ(J)  = THE NEW GROUPS FOR THIS J'/ */
+/*    5      4(/10X,9I10)/4(/10I10)/4(/10I10)) */
+
+/* L200: */
+    }
+
+L250:
+    pimp = (iorigb - ntotbt[jj - 1]) / (real) iorigb * 100.f;
+/*     WRITE(KFILDO,252)PIMP,KBIT,JJ */
+/* 252  FORMAT(/' PERCENT IMPROVEMENT =',F6.1, */
+/*    1        ' BY DECREASING GROUP LENGTHS FROM',I4,' TO',I4,' BITS') */
+    if (pimp >= 2.f) {
+
+/*        WRITE(KFILDO,255)CFEED,NEWBOXTP,IBXX2(JJ) */
+/* 255     FORMAT(A1,/' *****************************************' */
+/*    1             /' THE NUMBER OF NEWBOXES PER GROUP OF THE TOTAL', */
+/*    2             I10,' FOR GROUP MAXSIZE PLUS 1 ='I10 */
+/*    2             /' *****************************************') */
+/*        WRITE(KFILDO,256) (NEWBOXP(L),L=1,LX) */
+/* 256     FORMAT(/' '20I6) */
+
+/*           ADJUST GROUP LENGTHS FOR MAXIMUM LENGTH OF JJ BITS. */
+/*           THE MIN PER GROUP AND THE NUMBER OF BITS REQUIRED */
+/*           PER GROUP ARE NOT CHANGED.  THIS MAY MEAN THAT A */
+/*           GROUP HAS A MIN (OR REFERENCE) THAT IS NOT ZERO. */
+/*           THIS SHOULD NOT MATTER TO THE UNPACKER. */
+
+	lxnkp = *lx + newboxtp;
+/*           LXNKP = THE NEW NUMBER OF BOXES */
+
+	if (lxnkp > *ndg) {
+/*              DIMENSIONS NOT LARGE ENOUGH.  PROBABLY AN ERROR */
+/*              OF SOME SORT.  ABORT. */
+/*           WRITE(KFILDO,257)NDG,LXNPK */
+/*        1         2         3         4         5         6         7 X */
+/* 257        FORMAT(/' DIMENSIONS OF JMIN, ETC. IN REDUCE =',I8, */
+/*    1              ' NOT LARGE ENOUGH FOR THE EXPANDED NUMBER OF', */
+/*    2              ' GROUPS =',I8,'.  ABORT REDUCE.') */
+	    *ier = 715;
+	    goto L410;
+/*              AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
+/*              WITHOUT CALLING REDUCE. */
+	}
+
+	lxn = lxnkp;
+/*           LXN IS THE NUMBER OF THE BOX IN THE NEW SERIES BEING */
+/*           FILLED.  IT DECREASES PER ITERATION. */
+	ibxx2m1 = ibxx2[jj] - 1;
+/*           IBXX2M1 IS THE MAXIMUM NUMBER OF VALUES PER GROUP. */
+
+	for (l = *lx; l >= 1; --l) {
+
+/*              THE VALUES IS NOV( ) REPRESENT THOSE VALUES + NOVREF. */
+/*              WHEN VALUES ARE MOVED TO ANOTHER BOX, EACH VALUE */
+/*              MOVED TO A NEW BOX REPRESENTS THAT VALUE + NOVREF. */
+/*              THIS HAS TO BE CONSIDERED IN MOVING VALUES. */
+
+	    if (newboxp[l - 1] * (ibxx2m1 + *novref) + *novref > nov[l] + *
+		    novref) {
+/*                 IF THE ABOVE TEST IS MET, THEN MOVING IBXX2M1 VALUES */
+/*                 FOR ALL NEW BOXES WILL LEAVE A NEGATIVE NUMBER FOR */
+/*                 THE LAST BOX.  NOT A TOLERABLE SITUATION. */
+		movmin = (nov[l] - newboxp[l - 1] * *novref) / newboxp[l - 1];
+		left = nov[l];
+/*                 LEFT = THE NUMBER OF VALUES TO MOVE FROM THE ORIGINAL */
+/*                 BOX TO EACH NEW BOX EXCEPT THE LAST.  LEFT IS THE */
+/*                 NUMBER LEFT TO MOVE. */
+	    } else {
+		movmin = ibxx2m1;
+/*                 MOVMIN VALUES CAN BE MOVED FOR EACH NEW BOX. */
+		left = nov[l];
+/*                 LEFT IS THE NUMBER OF VALUES LEFT TO MOVE. */
+	    }
+
+	    if (newboxp[l - 1] > 0) {
+		if ((movmin + *novref) * newboxp[l - 1] + *novref <= nov[l] + 
+			*novref && (movmin + *novref) * (newboxp[l - 1] + 1) 
+			>= nov[l] + *novref) {
+		    goto L288;
+		} else {
+/* ***D                 WRITE(KFILDO,287)L,MOVMIN,NOVREF,NEWBOXP(L),NOV(L) */
+/* ***D287              FORMAT(/' AT 287 IN REDUCE--L,MOVMIN,NOVREF,', */
+/* ***D    1                    'NEWBOXP(L),NOV(L)',5I12 */
+/* ***D    2                    ' REDUCE ABORTED.') */
+/*              WRITE(KFILDO,2870) */
+/* 2870          FORMAT(/' AN ERROR IN REDUCE ALGORITHM.  ABORT REDUCE.') */
+		    *ier = 714;
+		    goto L410;
+/*                 AN ABORT CAUSES THE CALLING PROGRAM TO REEXECUTE */
+/*                 WITHOUT CALLING REDUCE. */
+		}
+
+	    }
+
+L288:
+	    i__1 = newboxp[l - 1] + 1;
+	    for (j = 1; j <= i__1; ++j) {
+		/*move = min(movmin,left);*/
+		move = (movmin < left) ? movmin : left;
+		jmin[lxn] = jmin[l];
+		jmax[lxn] = jmax[l];
+		lbit[lxn] = lbit[l];
+		nov[lxn] = move;
+		--lxn;
+		left -= move + *novref;
+/*                 THE MOVE OF MOVE VALUES REALLY REPRESENTS A MOVE OF */
+/*                 MOVE + NOVREF VALUES. */
+/* L290: */
+	    }
+
+	    if (left != -(*novref)) {
+/* ***               WRITE(KFILDO,292)L,LXN,MOVE,LXNKP,IBXX2(JJ),LEFT,NOV(L), */
+/* ***     1                          MOVMIN */
+/* *** 292           FORMAT(' AT 292 IN REDUCE--L,LXN,MOVE,LXNKP,', */
+/* ***     1                'IBXX2(JJ),LEFT,NOV(L),MOVMIN'/8I12) */
+	    }
+
+/* L300: */
+	}
+
+	*lx = lxnkp;
+/*           LX IS NOW THE NEW NUMBER OF GROUPS. */
+	*kbit = jj;
+/*           KBIT IS NOW THE NEW NUMBER OF BITS REQUIRED FOR PACKING */
+/*           GROUP LENGHTS. */
+    }
+
+/*     WRITE(KFILDO,406)CFEED,LX */
+/* 406  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP SIZES NOV( ) AFTER REDUCTION IN SIZE', */
+/*    2           ' FOR'I10,' GROUPS', */
+/*    3          /' *****************************************') */
+/*     WRITE(KFILDO,407) (NOV(J),J=1,LX) */
+/* 407  FORMAT(/' '20I6) */
+/*     WRITE(KFILDO,408)CFEED,LX */
+/* 408  FORMAT(A1,/' *****************************************' */
+/*    1          /' THE GROUP MINIMA JMIN( ) AFTER REDUCTION IN SIZE', */
+/*    2           ' FOR'I10,' GROUPS', */
+/*    3          /' *****************************************') */
+/*     WRITE(KFILDO,409) (JMIN(J),J=1,LX) */
+/* 409  FORMAT(/' '20I6) */
+
+L410:
+    if ( newbox != 0 ) free(newbox);
+    if ( newboxp != 0 ) free(newboxp);
+    return 0;
+} /* reduce_ */
+
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/seekgb.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/seekgb.c
new file mode 100644
index 0000000..61ba019
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/seekgb.c
@@ -0,0 +1,83 @@
+/**********************************************************
+ * Version $Id: seekgb.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+void seekgb(FILE *lugb,g2int iseek,g2int mseek,g2int *lskip,g2int *lgrib)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//
+// SUBPROGRAM: seekgb         Searches a file for the next GRIB message.
+//   PRGMMR: Gilbert          ORG: W/NP11      DATE: 2002-10-28
+//
+// ABSTRACT: This subprogram searches a file for the next GRIB Message.
+//   The search is done starting at byte offset iseek of the file referenced 
+//   by lugb for mseek bytes at a time.
+//   If found, the starting position and length of the message are returned
+//   in lskip and lgrib, respectively.
+//   The search is terminated when an EOF or I/O error is encountered.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-28  GILBERT   Modified from Iredell's skgb subroutine
+//
+// USAGE:    seekgb(FILE *lugb,g2int iseek,g2int mseek,int *lskip,int *lgrib)
+//   INPUT ARGUMENTS:
+//     lugb       - FILE pointer for the file to search.  File must be
+//                  opened before this routine is called.
+//     iseek      - number of bytes in the file to skip before search
+//     mseek      - number of bytes to search at a time
+//   OUTPUT ARGUMENTS:
+//     lskip      - number of bytes to skip from the beggining of the file
+//                  to where the GRIB message starts
+//     lgrib      - number of bytes in message (set to 0, if no message found)
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//
+//$$$
+{
+      g2int  ret;
+      g2int k,k4,ipos,nread,lim,start,vers,end,lengrib;
+      unsigned char *cbuf;
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+      *lgrib=0;
+      cbuf=(unsigned char *)malloc(mseek);
+      nread=mseek;
+      ipos=iseek;
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+//  LOOP UNTIL GRIB MESSAGE IS FOUND
+
+      while (*lgrib==0 && nread==mseek) {
+
+//  READ PARTIAL SECTION
+
+        ret=fseek(lugb,ipos,SEEK_SET);
+        nread=fread(cbuf,sizeof(unsigned char),mseek,lugb);
+        lim=nread-8;
+
+//  LOOK FOR 'GRIB...' IN PARTIAL SECTION
+
+        for (k=0;k<lim;k++) {
+          gbit(cbuf,&start,(k+0)*8,4*8);
+          gbit(cbuf,&vers,(k+7)*8,1*8);
+          if (start==1196575042 && (vers==1 || vers==2)) {
+//  LOOK FOR '7777' AT END OF GRIB MESSAGE
+            if (vers == 1) gbit(cbuf,&lengrib,(k+4)*8,3*8);
+            if (vers == 2) gbit(cbuf,&lengrib,(k+12)*8,4*8);
+            ret=fseek(lugb,ipos+k+lengrib-4,SEEK_SET);
+            k4=fread(&end,sizeof(g2int),1,lugb);
+            if (k4 == 1 && end == 926365495) {      //GRIB message found
+                *lskip=ipos+k;
+                *lgrib=lengrib;
+                break;
+            }
+          }
+        }
+        ipos=ipos+lim;
+      }
+
+      free(cbuf);
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/simpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/simpack.c
new file mode 100644
index 0000000..8908310
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/simpack.c
@@ -0,0 +1,184 @@
+/**********************************************************
+ * Version $Id: simpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void simpack(g2float *fld,g2int ndpts,g2int *idrstmpl,unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    simpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-11-06
+//
+// ABSTRACT: This subroutine packs up a data field using the simple
+//   packing algorithm as defined in the GRIB2 documention.  It
+//   also fills in GRIB2 Data Representation Template 5.0 with the
+//   appropriate values.
+//
+// PROGRAM HISTORY LOG:
+// 2002-11-06  Gilbert
+//
+// USAGE:    CALL simpack(fld,ndpts,idrstmpl,cpack,lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the data values to pack
+//     ndpts    - The number of data values in array fld[]
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.0
+//                [0] = Reference value - ignored on input
+//                [1] = Binary Scale Factor
+//                [2] = Decimal Scale Factor
+//                [3] = Number of bits used to pack data, if value is
+//                      > 0 and  <= 31.
+//                      If this input value is 0 or outside above range
+//                      then the num of bits is calculated based on given 
+//                      data and scale factors.
+//                [4] = Original field type - currently ignored on input
+//                      Data values assumed to be reals.
+//
+//   OUTPUT ARGUMENT LIST: 
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.0
+//                [0] = Reference value - set by simpack routine.
+//                [1] = Binary Scale Factor - unchanged from input
+//                [2] = Decimal Scale Factor - unchanged from input
+//                [3] = Number of bits used to pack data, unchanged from 
+//                      input if value is between 0 and 31.
+//                      If this input value is 0 or outside above range
+//                      then the num of bits is calculated based on given 
+//                      data and scale factors.
+//                [4] = Original field type - currently set = 0 on output.
+//                      Data values assumed to be reals.
+//     cpack    - The packed data field
+//     lcpack   - length of packed field starting at cpack.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      static g2int zero=0;
+      g2int  *ifld;
+      g2int  j,nbits,imin,imax,maxdif,nbittot,left;
+      g2float  bscale,dscale,rmax,rmin,temp;
+      double maxnum;
+      static g2float alog2=0.69314718;       //  ln(2.0)
+      
+      bscale=int_power(2.0,-idrstmpl[1]);
+      dscale=int_power(10.0,idrstmpl[2]);
+      if (idrstmpl[3] <= 0 || idrstmpl[3] > 31)
+         nbits=0;
+      else
+         nbits=idrstmpl[3];
+//
+//  Find max and min values in the data
+//
+      rmax=fld[0];
+      rmin=fld[0];
+      for (j=1;j<ndpts;j++) {
+        if (fld[j] > rmax) rmax=fld[j];
+        if (fld[j] < rmin) rmin=fld[j];
+      }
+     
+      ifld=calloc(ndpts,sizeof(g2int));
+//
+//  If max and min values are not equal, pack up field.
+//  If they are equal, we have a constant field, and the reference
+//  value (rmin) is the value for each point in the field and
+//  set nbits to 0.
+//
+      if (rmin != rmax) {
+        //
+        //  Determine which algorithm to use based on user-supplied 
+        //  binary scale factor and number of bits.
+        //
+        if (nbits==0 && idrstmpl[1]==0) {
+           //
+           //  No binary scaling and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           imin=(g2int)rint(rmin*dscale);
+           imax=(g2int)rint(rmax*dscale);
+           maxdif=imax-imin;
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           rmin=(g2float)imin;
+           //   scale data
+           for(j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(fld[j]*dscale)-imin;
+        }
+        else if (nbits!=0 && idrstmpl[1]==0) {
+           //
+           //  Use minimum number of bits specified by user and
+           //  adjust binary scaling factor to accomodate data.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxnum=int_power(2.0,nbits)-1;
+           temp=log(maxnum/(rmax-rmin))/alog2;
+           idrstmpl[1]=(g2int)ceil(-1.0*temp);
+           bscale=int_power(2.0,-idrstmpl[1]);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        else if (nbits==0 && idrstmpl[1]!=0) {
+           //
+           //  Use binary scaling factor and calculate minumum number of 
+           //  bits in which the data will fit.
+           //
+           rmin=rmin*dscale;
+           rmax=rmax*dscale;
+           maxdif=(g2int)rint((rmax-rmin)*bscale);
+           temp=log((double)(maxdif+1))/alog2;
+           nbits=(g2int)ceil(temp);
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        else if (nbits!=0 && idrstmpl[1]!=0) {
+           //
+           //  Use binary scaling factor and use minumum number of 
+           //  bits specified by user.   Dangerous - may loose
+           //  information if binary scale factor and nbits not set
+           //  properly by user.
+           //
+           rmin=rmin*dscale;
+           //   scale data
+           for (j=0;j<ndpts;j++)
+             ifld[j]=(g2int)rint(((fld[j]*dscale)-rmin)*bscale);
+        }
+        //
+        //  Pack data, Pad last octet with Zeros, if necessary,
+        //  and calculate the length of the packed data in bytes
+        //
+        sbits(cpack,ifld+0,0,nbits,0,ndpts);
+        nbittot=nbits*ndpts;
+        left=8-(nbittot%8);
+        if (left != 8) {
+          sbit(cpack,&zero,nbittot,left);   // Pad with zeros to fill Octet
+          nbittot=nbittot+left;
+        }
+        *lcpack=nbittot/8;
+      }
+      else {
+        nbits=0;
+        *lcpack=0;
+      }
+
+//
+//  Fill in ref value and number of bits in Template 5.0
+//
+      //printf("SAGmkieee %f\n",rmin);
+      mkieee(&rmin,idrstmpl+0,1);   // ensure reference value is IEEE format
+      //printf("SAGmkieee %ld\n",idrstmpl[0]);
+      idrstmpl[3]=nbits;
+      idrstmpl[4]=0;         // original data were reals
+
+      free(ifld);
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/simunpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/simunpack.c
new file mode 100644
index 0000000..7582052
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/simunpack.c
@@ -0,0 +1,79 @@
+/**********************************************************
+ * Version $Id: simunpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include "grib2.h"
+
+
+g2int simunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,g2float *fld)
+////$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    simunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-10-29
+//
+// ABSTRACT: This subroutine unpacks a data field that was packed using a 
+//   simple packing algorithm as defined in the GRIB2 documention,
+//   using info from the GRIB2 Data Representation Template 5.0.
+//
+// PROGRAM HISTORY LOG:
+// 2002-10-29  Gilbert
+//
+// USAGE:    int simunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,
+//                         g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - pointer to the packed data field.
+//     idrstmpl - pointer to the array of values for Data Representation
+//                Template 5.0
+//     ndpts    - The number of data values to unpack
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld      - Contains the unpacked data values.  fld must be allocated
+//                with at least ndpts*sizeof(g2float) bytes before
+//                calling this routine.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$//
+{
+
+      g2int  *ifld;
+      g2int  j,nbits,itype;
+      g2float ref,bscale,dscale;
+
+      
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+      itype = idrstmpl[4];
+
+      ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+      if ( ifld == 0 ) {
+         fprintf(stderr,"Could not allocate space in simunpack.\n  Data field NOT upacked.\n");
+         return(1);
+      }
+      
+//
+//  if nbits equals 0, we have a constant field where the reference value
+//  is the data value at each gridpoint
+//
+      if (nbits != 0) {
+         gbits(cpack,ifld,0,nbits,0,ndpts);
+         for (j=0;j<ndpts;j++) {
+           fld[j]=(((g2float)ifld[j]*bscale)+ref)*dscale;
+         }
+      }
+      else {
+         for (j=0;j<ndpts;j++) {
+           fld[j]=ref;
+         }
+      }
+
+      free(ifld);
+      return(0);
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/specpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/specpack.c
new file mode 100644
index 0000000..317c947
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/specpack.c
@@ -0,0 +1,131 @@
+/**********************************************************
+ * Version $Id: specpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+void specpack(g2float *fld,g2int ndpts,g2int JJ,g2int KK,g2int MM,
+              g2int *idrstmpl,unsigned char *cpack,g2int *lcpack)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    specpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2002-12-19
+//
+// ABSTRACT: This subroutine packs a spectral data field using the complex
+//   packing algorithm for spherical harmonic data as 
+//   defined in the GRIB2 Data Representation Template 5.51.
+//
+// PROGRAM HISTORY LOG:
+// 2002-12-19  Gilbert
+//
+// USAGE:    void specpack(g2float *fld,g2int ndpts,g2int JJ,g2int KK,g2int MM,
+//                        g2int *idrstmpl,insigned char *cpack,g2int *lcpack)
+//   INPUT ARGUMENT LIST:
+//     fld[]    - Contains the packed data values
+//     ndpts    - The number of data values to pack
+//     JJ       - J - pentagonal resolution parameter
+//     KK       - K - pentagonal resolution parameter
+//     MM       - M - pentagonal resolution parameter
+//     idrstmpl - Contains the array of values for Data Representation
+//                Template 5.51
+//
+//   OUTPUT ARGUMENT LIST:
+//     cpack    - The packed data field (character*1 array)
+//     lcpack   - length of packed field cpack().
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  IBM SP
+//
+//$$$
+{
+
+      g2int    *ifld,tmplsim[5];
+      g2float  bscale,dscale,*unpk,*tfld;
+      g2float  *pscale,tscale;
+      g2int    Js,Ks,Ms,Ts,Ns,inc,incu,incp,n,Nm,m,ipos;
+
+      bscale = int_power(2.0,-idrstmpl[1]);
+      dscale = int_power(10.0,idrstmpl[2]);
+      Js=idrstmpl[5];
+      Ks=idrstmpl[6];
+      Ms=idrstmpl[7];
+      Ts=idrstmpl[8];
+
+//
+//   Calculate Laplacian scaling factors for each possible wave number.
+//
+      pscale=(g2float *)malloc((JJ+MM)*sizeof(g2float));
+      tscale=(g2float)idrstmpl[4]*1E-6;
+      for (n=Js;n<=JJ+MM;n++)
+           pscale[n]=pow((g2float)(n*(n+1)),tscale);
+//
+//   Separate spectral coeffs into two lists; one to contain unpacked
+//   values within the sub-spectrum Js, Ks, Ms, and the other with values 
+//   outside of the sub-spectrum to be packed.
+//
+      tfld=(g2float *)malloc(ndpts*sizeof(g2float));
+      unpk=(g2float *)malloc(ndpts*sizeof(g2float));
+      ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+      inc=0;
+      incu=0;
+      incp=0;
+      for (m=0;m<=MM;m++) {
+         Nm=JJ;      // triangular or trapezoidal
+         if ( KK == JJ+MM ) Nm=JJ+m;          // rhombodial
+         Ns=Js;      // triangular or trapezoidal
+         if ( Ks == Js+Ms ) Ns=Js+m;          // rhombodial
+         for (n=m;n<=Nm;n++) {
+            if (n<=Ns && m<=Ms) {       // save unpacked value
+               unpk[incu++]=fld[inc++];         // real part
+               unpk[incu++]=fld[inc++];     // imaginary part
+            }
+            else {                       // Save value to be packed and scale
+                                         // Laplacian scale factor
+               tfld[incp++]=fld[inc++]*pscale[n];      // real part
+               tfld[incp++]=fld[inc++]*pscale[n];      // imaginary part
+            }
+         }
+      }
+
+      free(pscale);
+
+      if (incu != Ts) {
+         printf("specpack: Incorrect number of unpacked values %d given:\n",(int)Ts);
+         printf("specpack: Resetting idrstmpl[8] to %d\n",(int)incu);
+         Ts=incu;
+      }
+//
+//  Add unpacked values to the packed data array in 32-bit IEEE format
+//
+      mkieee(unpk,(g2int *)cpack,Ts);
+      ipos=4*Ts;
+//
+//  Scale and pack the rest of the coefficients
+// 
+      tmplsim[1]=idrstmpl[1];
+      tmplsim[2]=idrstmpl[2];
+      tmplsim[3]=idrstmpl[3];
+      simpack(tfld,ndpts-Ts,tmplsim,cpack+ipos,lcpack);
+      *lcpack=(*lcpack)+ipos;
+//
+//  Fill in Template 5.51
+//
+      idrstmpl[0]=tmplsim[0];
+      idrstmpl[1]=tmplsim[1];
+      idrstmpl[2]=tmplsim[2];
+      idrstmpl[3]=tmplsim[3];
+      idrstmpl[8]=Ts;
+      idrstmpl[9]=1;         // Unpacked spectral data is 32-bit IEEE
+
+      free(tfld);
+      free(unpk);
+      free(ifld);
+
+      return;
+}
diff --git a/src/modules/io/io_grid_grib2/g2clib-1.0.4/specunpack.c b/src/modules/io/io_grid_grib2/g2clib-1.0.4/specunpack.c
new file mode 100644
index 0000000..07d1ffa
--- /dev/null
+++ b/src/modules/io/io_grid_grib2/g2clib-1.0.4/specunpack.c
@@ -0,0 +1,118 @@
+/**********************************************************
+ * Version $Id: specunpack.c 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "grib2.h"
+
+
+g2int specunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,g2int JJ,
+               g2int KK, g2int MM, g2float *fld)
+//$$$  SUBPROGRAM DOCUMENTATION BLOCK
+//                .      .    .                                       .
+// SUBPROGRAM:    specunpack
+//   PRGMMR: Gilbert          ORG: W/NP11    DATE: 2000-06-21
+//
+// ABSTRACT: This subroutine unpacks a spectral data field that was packed 
+//   using the complex packing algorithm for spherical harmonic data as 
+//   defined in the GRIB2 documention,
+//   using info from the GRIB2 Data Representation Template 5.51.
+//
+// PROGRAM HISTORY LOG:
+// 2000-06-21  Gilbert
+//
+// USAGE:    int specunpack(unsigned char *cpack,g2int *idrstmpl,
+//                          g2int ndpts,g2int JJ,g2int KK,g2int MM,g2float *fld)
+//   INPUT ARGUMENT LIST:
+//     cpack    - pointer to the packed data field.
+//     idrstmpl - pointer to the array of values for Data Representation
+//                Template 5.51
+//     ndpts    - The number of data values to unpack (real and imaginary parts)
+//     JJ       - J - pentagonal resolution parameter
+//     KK       - K - pentagonal resolution parameter
+//     MM       - M - pentagonal resolution parameter
+//
+//   OUTPUT ARGUMENT LIST:
+//     fld()    - Contains the unpacked data values.   fld must be allocated
+//                with at least ndpts*sizeof(g2float) bytes before
+//                calling this routine.
+//
+// REMARKS: None
+//
+// ATTRIBUTES:
+//   LANGUAGE: C
+//   MACHINE:  
+//
+//$$$
+{
+
+      g2int  *ifld,j,iofst,nbits;
+      g2float  ref,bscale,dscale,*unpk;
+      g2float  *pscale,tscale;
+      g2int   Js,Ks,Ms,Ts,Ns,Nm,n,m;
+      g2int   inc,incu,incp;
+
+      rdieee(idrstmpl+0,&ref,1);
+      bscale = int_power(2.0,idrstmpl[1]);
+      dscale = int_power(10.0,-idrstmpl[2]);
+      nbits = idrstmpl[3];
+      Js=idrstmpl[5];
+      Ks=idrstmpl[6];
+      Ms=idrstmpl[7];
+      Ts=idrstmpl[8];
+
+      if (idrstmpl[9] == 1) {           // unpacked floats are 32-bit IEEE
+
+         unpk=(g2float *)malloc(ndpts*sizeof(g2float));
+         ifld=(g2int *)malloc(ndpts*sizeof(g2int));
+
+         gbits(cpack,ifld,0,32,0,Ts);
+         iofst=32*Ts;
+         rdieee(ifld,unpk,Ts);          // read IEEE unpacked floats
+         gbits(cpack,ifld,iofst,nbits,0,ndpts-Ts);  // unpack scaled data
+//
+//   Calculate Laplacian scaling factors for each possible wave number.
+//
+         pscale=(g2float *)malloc((JJ+MM+1)*sizeof(g2float));
+         tscale=(g2float)idrstmpl[4]*1E-6;
+         for (n=Js;n<=JJ+MM;n++) 
+              pscale[n]=pow((g2float)(n*(n+1)),-tscale);
+//
+//   Assemble spectral coeffs back to original order.
+//
+         inc=0;
+         incu=0;
+         incp=0;
+         for (m=0;m<=MM;m++) {
+            Nm=JJ;      // triangular or trapezoidal
+            if ( KK == JJ+MM ) Nm=JJ+m;          // rhombodial
+            Ns=Js;      // triangular or trapezoidal
+            if ( Ks == Js+Ms ) Ns=Js+m;          // rhombodial
+            for (n=m;n<=Nm;n++) {
+               if (n<=Ns && m<=Ms) {    // grab unpacked value
+                  fld[inc++]=unpk[incu++];         // real part
+                  fld[inc++]=unpk[incu++];     // imaginary part
+               }
+               else {                       // Calc coeff from packed value
+                  fld[inc++]=(((g2float)ifld[incp++]*bscale)+ref)*
+                            dscale*pscale[n];          // real part
+                  fld[inc++]=(((g2float)ifld[incp++]*bscale)+ref)*
+                            dscale*pscale[n];          // imaginary part
+               }
+            }
+         }
+
+         free(pscale);
+         free(unpk);
+         free(ifld);
+
+      }
+      else {
+         printf("specunpack: Cannot handle 64 or 128-bit floats.\n");
+         for (j=0;j<ndpts;j++) fld[j]=0.0;
+         return -3;
+      }
+
+      return 0;
+}
diff --git a/src/modules_io/grid/io_grid_grib2/grib2_import.cpp b/src/modules/io/io_grid_grib2/grib2_import.cpp
similarity index 100%
rename from src/modules_io/grid/io_grid_grib2/grib2_import.cpp
rename to src/modules/io/io_grid_grib2/grib2_import.cpp
diff --git a/src/modules_io/grid/io_grid_grib2/grib2_import.h b/src/modules/io/io_grid_grib2/grib2_import.h
similarity index 100%
rename from src/modules_io/grid/io_grid_grib2/grib2_import.h
rename to src/modules/io/io_grid_grib2/grib2_import.h
diff --git a/src/modules/io/io_grid_image/MLB_Interface.cpp b/src/modules/io/io_grid_image/MLB_Interface.cpp
new file mode 100644
index 0000000..9298942
--- /dev/null
+++ b/src/modules/io/io_grid_image/MLB_Interface.cpp
@@ -0,0 +1,129 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 2089 2014-04-04 12:37:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         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("Import/Export - Images") );
+
+	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
diff --git a/src/modules/io/io_grid_image/MLB_Interface.h b/src/modules/io/io_grid_image/MLB_Interface.h
new file mode 100644
index 0000000..f6e552d
--- /dev/null
+++ b/src/modules/io/io_grid_image/MLB_Interface.h
@@ -0,0 +1,85 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 2089 2014-04-04 12:37:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       image_io                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__io_grid_image_H
+#define HEADER_INCLUDED__io_grid_image_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+#ifdef io_grid_image_EXPORTS
+	#define	io_grid_image_EXPORT	_SAGA_DLL_EXPORT
+#else
+	#define	io_grid_image_EXPORT	_SAGA_DLL_IMPORT
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__io_grid_image_H
diff --git a/src/modules/io/io_grid_image/Makefile.am b/src/modules/io/io_grid_image/Makefile.am
new file mode 100644
index 0000000..ab48d8c
--- /dev/null
+++ b/src/modules/io/io_grid_image/Makefile.am
@@ -0,0 +1,27 @@
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
+else
+DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
+endif
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libio_grid_image.la
+libio_grid_image_la_SOURCES =\
+grid_export.cpp\
+grid_import.cpp\
+grid_to_kml.cpp\
+MLB_Interface.cpp\
+grid_export.h\
+grid_import.h\
+grid_to_kml.h\
+MLB_Interface.h
+ 
+libio_grid_image_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/io/io_grid_image/Makefile.in b/src/modules/io/io_grid_image/Makefile.in
new file mode 100644
index 0000000..ff7b73b
--- /dev/null
+++ b/src/modules/io/io_grid_image/Makefile.in
@@ -0,0 +1,637 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_grid_image
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_grid_image_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_grid_image_la_OBJECTS = grid_export.lo grid_import.lo \
+	grid_to_kml.lo MLB_Interface.lo
+libio_grid_image_la_OBJECTS = $(am_libio_grid_image_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_grid_image_la_SOURCES)
+DIST_SOURCES = $(libio_grid_image_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@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`
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libio_grid_image.la
+libio_grid_image_la_SOURCES = \
+grid_export.cpp\
+grid_import.cpp\
+grid_to_kml.cpp\
+MLB_Interface.cpp\
+grid_export.h\
+grid_import.h\
+grid_to_kml.h\
+MLB_Interface.h
+
+libio_grid_image_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_grid_image/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_grid_image/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_grid_image.la: $(libio_grid_image_la_OBJECTS) $(libio_grid_image_la_DEPENDENCIES) $(EXTRA_libio_grid_image_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_grid_image_la_OBJECTS) $(libio_grid_image_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_export.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_to_kml.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/io/io_grid_image/grid_export.cpp b/src/modules/io/io_grid_image/grid_export.cpp
new file mode 100644
index 0000000..50dc407
--- /dev/null
+++ b/src/modules/io/io_grid_image/grid_export.cpp
@@ -0,0 +1,562 @@
+/**********************************************************
+ * Version $Id: grid_export.cpp 2091 2014-04-04 14:14:29Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       image_io                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Grid_Export.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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/filename.h>
+#include <wx/image.h>
+
+#include "grid_export.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Export::CGrid_Export(void)
+{
+	Set_Name		(_TL("Export Image (bmp, jpg, pcx, png, tif)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2005"));
+
+	Set_Description	(_TW(
+		"The module allows to save a grid as image.\n\n"
+		"On the command line, in case a shade grid is specified, "
+		"it's minimum and maximum brightness values can be specified in "
+		"percent.\n")
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRID"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SHADE"		, _TL("Shade"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_FilePath(
+		NULL	, "FILE"		, _TL("Image File"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"),
+			_TL("Windows or OS/2 Bitmap (*.bmp)")				, SG_T("*.bmp"),
+			_TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)")	, SG_T("*.jpg;*.jif;*.jpeg"),
+			_TL("Zsoft Paintbrush (*.pcx)")						, SG_T("*.pcx"),
+			_TL("Portable Network Graphics (*.png)")			, SG_T("*.png"),
+			_TL("Tagged Image File Format (*.tif, *.tiff)")		, SG_T("*.tif;*.tiff")
+		), NULL, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "FILE_KML"	, _TL("Create KML File"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	if( SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_Choice(
+			NULL	, "COLOURING"	, _TL("Colouring"),
+			_TL(""),
+			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+				_TL("stretch to grid's standard deviation"),
+				_TL("stretch to grid's value range"),
+				_TL("stretch to specified value range"),
+				_TL("lookup table"),
+				_TL("rgb coded values"),
+				_TL("same as in graphical user interface")
+			), 5
+		);
+
+		Parameters.Add_Colors(
+			NULL	, "COL_PALETTE"	, _TL("Colours Palette"),
+			_TL("")
+		);
+	}
+	else
+	{
+		Parameters.Add_Choice(
+			NULL	, "COLOURING"	, _TL("Colouring"),
+			_TL(""),
+			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+				_TL("stretch to grid's standard deviation"),
+				_TL("stretch to grid's value range"),
+				_TL("stretch to specified value range"),
+				_TL("lookup table"),
+				_TL("rgb coded values")
+			), 0
+		);
+
+		Parameters.Add_Choice(
+			NULL	, "COL_PALETTE"	, _TL("Color Palette"),
+			_TL(""),
+			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+				_TL("DEFAULT"),			_TL("DEFAULT_BRIGHT"),	_TL("BLACK_WHITE"),		_TL("BLACK_RED"),
+				_TL("BLACK_GREEN"),		_TL("BLACK_BLUE"),		_TL("WHITE_RED"),		_TL("WHITE_GREEN"),
+				_TL("WHITE_BLUE"),		_TL("YELLOW_RED"),		_TL("YELLOW_GREEN"),	_TL("YELLOW_BLUE"),
+				_TL("RED_GREEN"),		_TL("RED_BLUE"),		_TL("GREEN_BLUE"),		_TL("RED_GREY_BLUE"),
+				_TL("RED_GREY_GREEN"),	_TL("GREEN_GREY_BLUE"),	_TL("RED_GREEN_BLUE"),	_TL("RED_BLUE_GREEN"),
+				_TL("GREEN_RED_BLUE"),	_TL("RAINBOW"),			_TL("NEON"),			_TL("TOPOGRAPHY"),
+				_TL("ASPECT_1"),		_TL("ASPECT_2"),		_TL("ASPECT_3")
+			), 0
+		);
+
+		Parameters.Add_Value(
+			NULL	, "COL_COUNT"	, _TL("Number of Colors"),
+			_TL(""),
+			PARAMETER_TYPE_Int, 100
+		);
+
+		Parameters.Add_Value(
+			NULL	, "COL_REVERT"	, _TL("Revert Palette"),
+			_TL(""),
+			PARAMETER_TYPE_Bool, false
+		);
+	}
+
+	Parameters.Add_Value(
+		NULL	, "STDDEV"		, _TL("Standard Deviation"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 2.0, 0.0, true
+	);
+
+	Parameters.Add_Range(
+        NULL	, "STRETCH"		, _TL("Stretch to Value Range"),
+        _TL(""),
+        0.0, 100.0
+    );
+
+	Parameters.Add_Table(
+		NULL	, "LUT"			, _TL("Lookup Table"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	if( !SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_Range(
+			NULL	, "SHADE_BRIGHT", _TL("Shade Brightness"),
+			_TL("Allows to scale shade brightness [percent]"),
+			0.0, 100.0, 0.0, true, 100.0, true
+		);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGrid_Export::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("COLOURING")) )
+	{
+		pParameters->Get_Parameter("COL_PALETTE")->Set_Enabled(pParameter->asInt() <= 2);
+		pParameters->Get_Parameter("STDDEV"     )->Set_Enabled(pParameter->asInt() == 0);
+		pParameters->Get_Parameter("STRETCH"    )->Set_Enabled(pParameter->asInt() == 2);
+		pParameters->Get_Parameter("LUT"        )->Set_Enabled(pParameter->asInt() == 3);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Export::On_Execute(void)
+{
+	//-----------------------------------------------------
+	int			y, iy, Method;
+	CSG_Grid	*pGrid, *pShade, Grid, Shade;
+
+	//-----------------------------------------------------
+	pGrid	= Parameters("GRID"     )->asGrid();
+	pShade	= Parameters("SHADE"    )->asGrid();
+	Method	= Parameters("COLOURING")->asInt ();
+
+	if( !pGrid )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	if( Method == 5 )	// same as in graphical user interface
+	{
+		if( !SG_UI_DataObject_asImage(pGrid, &Grid) )
+		{
+			Error_Set("could not retrieve colour coding from graphical user interface.");
+
+			return( false );
+		}
+	}
+	else
+	{
+		double		zMin, zScale;
+		CSG_Colors	Colors;
+		CSG_Table	*pLUT	= Parameters("LUT")->asTable();
+
+		if( SG_UI_Get_Window_Main() )
+		{
+			Colors.Assign(Parameters("COL_PALETTE")->asColors());
+		}
+		else
+		{
+			Colors.Set_Palette(
+				Parameters("COL_PALETTE")->asInt (),
+				Parameters("COL_REVERT" )->asBool(),
+				Parameters("COL_COUNT"  )->asInt ()
+			);
+		}
+
+		switch( Method )
+		{
+		case 0:	// stretch to grid's standard deviation
+			zMin	= pGrid->Get_ArithMean() -  Parameters("STDDEV")->asDouble() * pGrid->Get_StdDev();
+			zScale	= Colors.Get_Count() / (2 * Parameters("STDDEV")->asDouble() * pGrid->Get_StdDev());
+			break;
+
+		case 1:	// stretch to grid's value range
+			zMin	= pGrid->Get_ZMin();
+			zScale	= Colors.Get_Count() / pGrid->Get_ZRange();
+			break;
+
+		case 2:	// stretch to specified value range
+			zMin	= Parameters("STRETCH")->asRange()->Get_LoVal();
+			if( zMin >= (zScale = Parameters("STRETCH")->asRange()->Get_HiVal()) )
+			{
+				Error_Set(_TL("invalid user specified value range."));
+
+				return( false );
+			}
+			zScale	= Colors.Get_Count() / (zScale - zMin);
+			break;
+
+		case 3:	// lookup table
+			if( !pLUT || pLUT->Get_Field_Count() < 5 )
+			{
+				Error_Set(_TL("invalid lookup table."));
+
+				return( false );
+			}
+			break;
+
+		case 4:	// rgb coded values
+			break;
+		}
+
+		//-------------------------------------------------
+		Grid.Create(*Get_System(), SG_DATATYPE_Int);
+
+		for(y=0, iy=Get_NY()-1; y<Get_NY() && Set_Progress(y); y++, iy--)
+		{
+			#pragma omp parallel for
+			for(int x=0; x<Get_NX(); x++)
+			{
+				double	z	= pGrid->asDouble(x, y);
+
+				if( Method == 3 )	// lookup table
+				{
+					int		i, iColor;
+
+					for(i=0, iColor=-1; i<pLUT->Get_Record_Count() && iColor<0; i++)
+					{
+						if( z >= pLUT->Get_Record(i)->asDouble(3) && z < pLUT->Get_Record(i)->asDouble(4) )
+						{
+							Grid.Set_Value(x, iy, pLUT->Get_Record(iColor = i)->asInt(0));
+						}
+					}
+
+					if( iColor < 0 )
+					{
+						Grid.Set_NoData(x, iy);
+					}
+				}
+				else if( pGrid->is_NoData(x, y) )
+				{
+					Grid.Set_NoData(x, iy);
+				}
+				else if( Method == 4 )	// rgb coded values
+				{
+					Grid.Set_Value (x, iy, z);
+				}
+				else
+				{
+					int	i	= (int)(zScale * (z - zMin));
+
+					Grid.Set_Value (x, iy, Colors[i < 0 ? 0 : i >= Colors.Get_Count() ? Colors.Get_Count() - 1 : i]);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( !pShade || pShade->Get_ZRange() <= 0.0 )
+	{
+		pShade	= NULL;
+	}
+	else if( !SG_UI_DataObject_asImage(pShade, &Shade) )
+	{
+		double	dMinBright, dMaxBright;
+
+		dMinBright	= Parameters("SHADE_BRIGHT")->asRange()->Get_LoVal() / 100.0;
+		dMaxBright	= Parameters("SHADE_BRIGHT")->asRange()->Get_HiVal() / 100.0;
+
+		if( dMinBright >= dMaxBright )
+		{
+			SG_UI_Msg_Add_Error(_TL("Minimum shade brightness must be lower than maximum shade brightness!"));
+
+			return( false );
+		}
+
+		int			nColors	= 100;
+		CSG_Colors	Colors(nColors, SG_COLORS_BLACK_WHITE, true);
+
+	    //-------------------------------------------------
+		Shade.Create(*Get_System(), SG_DATATYPE_Int);
+
+		for(y=0, iy=Get_NY()-1; y<Get_NY() && Set_Progress(y); y++, iy--)
+		{
+			#pragma omp parallel for
+			for(int x=0; x<Get_NX(); x++)
+			{
+				if( pShade->is_NoData(x, y) )
+				{
+					Shade.Set_NoData(x, iy);
+				}
+				else
+				{
+					Shade.Set_Value (x, iy, Colors[(int)(nColors * (dMaxBright - dMinBright) * (pShade->asDouble(x, y) - pShade->Get_ZMin()) / pShade->Get_ZRange() + dMinBright)]);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	wxImage	Image(Get_NX(), Get_NY());
+
+	if( Grid.Get_NoData_Count() > 0 )
+	{
+		Image.SetAlpha();
+	}
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( Grid.is_NoData(x, y) )
+			{
+				if( Image.HasAlpha() )
+				{
+					Image.SetAlpha(x, y, wxIMAGE_ALPHA_TRANSPARENT);
+				}
+
+				Image.SetRGB(x, y, 255, 255, 255);
+			}
+			else
+			{
+				if( Image.HasAlpha() )
+				{
+					Image.SetAlpha(x, y, wxIMAGE_ALPHA_OPAQUE);
+				}
+
+				int	r, g, b, c	= Grid.asInt(x, y);
+
+				r	= SG_GET_R(c);
+				g	= SG_GET_G(c);
+				b	= SG_GET_B(c);
+
+				if( pShade )
+				{
+					c	= Shade.asInt(x, y);
+
+					double d	= (SG_GET_R(c) + SG_GET_G(c) + SG_GET_B(c)) / (3.0 * 255.0);
+
+					r	= (int)(d * r);
+					g	= (int)(d * g);
+					b	= (int)(d * b);
+				}
+
+				Image.SetRGB(x, y, r, g, b);
+			}
+		}
+	}
+
+	//-------------------------------------------------
+	CSG_String	fName(Parameters("FILE")->asString());
+
+	if( !SG_File_Cmp_Extension(fName, SG_T("bmp"))
+	&&  !SG_File_Cmp_Extension(fName, SG_T("jpg"))
+	&&  !SG_File_Cmp_Extension(fName, SG_T("pcx"))
+	&&  !SG_File_Cmp_Extension(fName, SG_T("png"))
+	&&  !SG_File_Cmp_Extension(fName, SG_T("tif")) )
+	{
+		fName	= SG_File_Make_Path(NULL, fName, SG_T("png"));
+	}
+
+	//-----------------------------------------------------
+	wxImageHandler	*pImgHandler = NULL;
+
+	if( !SG_UI_Get_Window_Main() )
+	{
+		if( SG_File_Cmp_Extension(fName, SG_T("jpg")) )
+			pImgHandler = new wxJPEGHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) )
+			pImgHandler = new wxPCXHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("tif")) )
+			pImgHandler = new wxTIFFHandler;
+#ifdef _SAGA_MSW
+		else if( SG_File_Cmp_Extension(fName, SG_T("bmp")) )
+			pImgHandler = new wxBMPHandler;
+#endif
+		else // if( SG_File_Cmp_Extension(fName, SG_T("png")) )
+			pImgHandler = new wxPNGHandler;
+
+		wxImage::AddHandler(pImgHandler);
+	}
+
+	if( !Image.SaveFile(fName.c_str()) )
+	{
+		Error_Set(CSG_String::Format(SG_T("%s [%s]"), _TL("could not save image file"), fName.c_str()));
+
+		return( false );
+	}
+
+	pGrid->Get_Projection().Save(SG_File_Make_Path(NULL, fName, SG_T("prj")), SG_PROJ_FMT_WKT);
+
+	//-----------------------------------------------------
+	CSG_File	Stream;
+
+	if(      SG_File_Cmp_Extension(fName, SG_T("bmp")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("bpw")), SG_FILE_W, false);
+	else if( SG_File_Cmp_Extension(fName, SG_T("jpg")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("jgw")), SG_FILE_W, false);
+	else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("pxw")), SG_FILE_W, false);
+	else if( SG_File_Cmp_Extension(fName, SG_T("png")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("pgw")), SG_FILE_W, false);
+	else if( SG_File_Cmp_Extension(fName, SG_T("tif")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("tfw")), SG_FILE_W, false);
+
+	if( Stream.is_Open() )
+	{
+		Stream.Printf(SG_T("%.10f\n%f\n%f\n%.10f\n%.10f\n%.10f\n"),
+			 pGrid->Get_Cellsize(),
+			 0.0, 0.0,
+			-pGrid->Get_Cellsize(),
+			 pGrid->Get_XMin(),
+			 pGrid->Get_YMax()
+		);
+	}
+
+	//-----------------------------------------------------
+	if( Parameters("FILE_KML")->asBool() && Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("kml")), SG_FILE_W, false) )
+	{
+		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"));
+	}
+
+	//-----------------------------------------------------
+	if( !SG_UI_Get_Window_Main() && pImgHandler != NULL)
+	{
+		wxImage::RemoveHandler(pImgHandler->GetName());
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_export.h b/src/modules/io/io_grid_image/grid_export.h
new file mode 100644
index 0000000..0ebda08
--- /dev/null
+++ b/src/modules/io/io_grid_image/grid_export.h
@@ -0,0 +1,113 @@
+/**********************************************************
+ * Version $Id: grid_export.h 2089 2014-04-04 12:37:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       image_io                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     Grid_Export.h                     //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Grid_Export_H
+#define HEADER_INCLUDED__Grid_Export_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class io_grid_image_EXPORT CGrid_Export : public CSG_Module_Grid
+{
+public:
+	CGrid_Export(void);
+
+	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("R:Export") );	}
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Grid_Export_H
diff --git a/src/modules/io/io_grid_image/grid_import.cpp b/src/modules/io/io_grid_image/grid_import.cpp
new file mode 100644
index 0000000..796b233
--- /dev/null
+++ b/src/modules/io/io_grid_image/grid_import.cpp
@@ -0,0 +1,433 @@
+/**********************************************************
+ * Version $Id: grid_import.cpp 2089 2014-04-04 12:37:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       image_io                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Grid_Import.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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/filename.h>
+#include <wx/image.h>
+
+#include "grid_import.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Import::CGrid_Import(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Import Image (bmp, jpg, png, tif, gif, pnm, xpm)"));
+
+	Set_Author		(SG_T("(c) 2005 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"Loads an image."
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_Output(
+		NULL	, "OUT_GRID"	, _TL("Image"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "OUT_RED"		, _TL("Image (Red Channel)"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "OUT_GREEN"	, _TL("Image (Green Channel)"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "OUT_BLUE"	, _TL("Image (Blue Channel)"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_FilePath(
+		NULL	, "FILE"		, _TL("Image File"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"),
+			_TL("All Recognized File Types")					, SG_T("*.bmp;*.ico;*.gif;*.jpg;*.jif;*.jpeg;*.pcx;*.png;*.pnm;*.tif;*.tiff;*.xpm"),
+			_TL("CompuServe Graphics Interchange (*.gif)")		, SG_T("*.gif"),
+			_TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)")	, SG_T("*.jpg;*.jif;*.jpeg"),
+			_TL("Portable Network Graphics (*.png)")			, SG_T("*.png"),
+			_TL("Tagged Image File Format (*.tif, *.tiff)")		, SG_T("*.tif;*.tiff"),
+			_TL("Windows or OS/2 Bitmap (*.bmp)")				, SG_T("*.bmp"),
+			_TL("Zsoft Paintbrush (*.pcx)")						, SG_T("*.pcx"),
+			_TL("All Files")									, SG_T("*.*")
+		)
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Options"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Standard"),
+			_TL("Split Channels"),
+			_TL("Enforce True Color")
+		), 2
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Import::On_Execute(void)
+{
+	bool				bTransform;
+	int					x, y, yy, Method;
+	double				ax, ay, dx, dy, rx, ry, xMin, yMin, Cellsize;
+	CSG_Colors			Colors;
+	CSG_String			fImage, fWorld, Name;
+	CSG_Grid			*pImage;
+	CSG_File			Stream;
+	wxImage				Image;
+	wxImageHistogram	Histogram;
+
+	//-----------------------------------------------------
+	fImage	= Parameters("FILE")	->asString();
+	Method	= Parameters("METHOD")	->asInt();
+
+	Name	= SG_File_Get_Name(fImage, false);
+
+	//-----------------------------------------------------
+	wxImageHandler	*pImgHandler = NULL;
+
+	if( !SG_UI_Get_Window_Main() )
+	{
+		CSG_String	fName = SG_File_Get_Name(fImage, true);
+
+		if( SG_File_Cmp_Extension(fName, SG_T("jpg")) )
+			pImgHandler = new wxJPEGHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) )
+			pImgHandler = new wxPCXHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("tif")) )
+			pImgHandler = new wxTIFFHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("gif")) )
+			pImgHandler = new wxGIFHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("pnm")) )
+			pImgHandler = new wxPNMHandler;
+		else if( SG_File_Cmp_Extension(fName, SG_T("xpm")) )
+			pImgHandler = new wxXPMHandler;
+#ifdef _SAGA_MSW
+		else if( SG_File_Cmp_Extension(fName, SG_T("bmp")) )
+			pImgHandler = new wxBMPHandler;
+#endif
+		else // if( SG_File_Cmp_Extension(fName, SG_T("png")) )
+			pImgHandler = new wxPNGHandler;
+
+		wxImage::AddHandler(pImgHandler);
+	}
+
+	if( !Image.LoadFile(fImage.c_str()) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	     if( SG_File_Cmp_Extension(fImage, SG_T("bmp")) )
+	{
+		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("bpw"));
+	}
+	else if( SG_File_Cmp_Extension(fImage, SG_T("jpg")) )
+	{
+		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("jgw"));
+	}
+	else if( SG_File_Cmp_Extension(fImage, SG_T("png")) )
+	{
+		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("pgw"));
+	}
+	else if( SG_File_Cmp_Extension(fImage, SG_T("tif")) )
+	{
+		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("tfw"));
+	}
+	else
+	{
+		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("world"));
+	}
+
+	bTransform	= false;
+	xMin		= 0.0;
+	yMin		= 0.0;
+	Cellsize	= 1.0;
+
+	if(	Stream.Open(fWorld, SG_FILE_R, false) && fscanf(Stream.Get_Stream(), "%lf %lf %lf %lf %lf %lf ", &dx, &ry, &rx, &dy, &ax, &ay) == 6 )
+	{
+		if( dx != -dy || rx != 0.0 || ry != 0.0 )
+		{
+			bTransform	= true;
+		}
+		else
+		{
+			xMin		= ax;
+			yMin		= ay + dy * (Image.GetHeight() - 1);
+			Cellsize	= dx;
+		}
+	}
+
+
+	//-----------------------------------------------------
+	// color look-up table...
+
+	if( Method == 0 && (yy = Image.ComputeHistogram(Histogram)) <= 256 )
+	{
+		Colors.Set_Count(yy);
+
+		for(wxImageHistogram::iterator i=Histogram.begin(); i!=Histogram.end(); ++i)
+		{
+			Colors.Set_Color(i->second.index, SG_GET_R(i->first), SG_GET_G(i->first), SG_GET_B(i->first));
+		}
+
+		pImage	= SG_Create_Grid(yy <= 2 ? SG_DATATYPE_Bit : SG_DATATYPE_Byte, Image.GetWidth(), Image.GetHeight(), Cellsize, xMin, yMin);
+
+		for(y=0; y<pImage->Get_NY() && Set_Progress(y, pImage->Get_NY()); y++)
+		{
+			yy	= bTransform ? y : pImage->Get_NY() - 1 - y;
+
+			for(x=0; x<pImage->Get_NX(); x++)
+			{
+				pImage->Set_Value(x, y, Histogram[SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy))].index);
+			}
+		}
+
+		if( bTransform )
+		{
+			Set_Transformation(&pImage, ax, ay, dx, dy, rx, ry);
+		}
+
+		pImage->Set_Name(Name);
+		pImage->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
+		Parameters("OUT_GRID")->Set_Value(pImage);
+		DataObject_Set_Colors(pImage, Colors);
+		DataObject_Update(pImage, 0, Colors.Get_Count() - 1);
+	}
+
+	//-----------------------------------------------------
+	else	// true color...
+	{
+		pImage	= SG_Create_Grid(SG_DATATYPE_Int, Image.GetWidth(), Image.GetHeight(), Cellsize, xMin, yMin);
+		pImage	->Set_Name(Name);
+
+		for(y=0; y<pImage->Get_NY() && Set_Progress(y, pImage->Get_NY()); y++)
+		{
+			yy	= bTransform ? y : pImage->Get_NY() - 1 - y;
+
+			for(x=0; x<pImage->Get_NX(); x++)
+			{
+				pImage->Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy)));
+			}
+		}
+
+		if( bTransform )
+		{
+			Set_Transformation(&pImage, ax, ay, dx, dy, rx, ry);
+		}
+
+		//-------------------------------------------------
+		if( Method != 1 )	// true color...
+		{
+			pImage->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
+			pImage->Set_Name(Name);
+			pImage->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
+			Parameters("OUT_GRID")->Set_Value(pImage);
+			DataObject_Set_Colors(pImage, 100, SG_COLORS_BLACK_WHITE);
+			DataObject_Set_Parameter(pImage, "COLORS_TYPE", 6);	// Color Classification Type: RGB
+		}
+
+		//-------------------------------------------------
+		else				// split channels...
+		{
+			CSG_Grid	*pR, *pG, *pB;
+
+			pR	= SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte);
+			pG	= SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte);
+			pB	= SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte);
+
+			for(y=0; y<pImage->Get_NY() && Set_Progress(y, pImage->Get_NY()); y++)
+			{
+				for(x=0; x<pImage->Get_NX(); x++)
+				{
+					pR->Set_Value(x, y, SG_GET_R(pImage->asInt(x, y)));
+					pG->Set_Value(x, y, SG_GET_G(pImage->asInt(x, y)));
+					pB->Set_Value(x, y, SG_GET_B(pImage->asInt(x, y)));
+				}
+			}
+
+			pR->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
+			pG->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
+			pB->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
+
+			pR->Set_Name(CSG_String::Format(SG_T("%s [R]"), Name.c_str()));
+			pG->Set_Name(CSG_String::Format(SG_T("%s [G]"), Name.c_str()));
+			pB->Set_Name(CSG_String::Format(SG_T("%s [B]"), Name.c_str()));
+
+			pR->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
+			pG->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
+			pB->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
+
+			Parameters("OUT_RED")	->Set_Value(pR);
+			Parameters("OUT_GREEN")	->Set_Value(pG);
+			Parameters("OUT_BLUE")	->Set_Value(pB);
+
+			DataObject_Set_Colors(pR, 100, SG_COLORS_BLACK_RED);
+			DataObject_Set_Colors(pG, 100, SG_COLORS_BLACK_GREEN);
+			DataObject_Set_Colors(pB, 100, SG_COLORS_BLACK_BLUE);
+		}
+	}
+
+	//-----------------------------------------------------
+	if( !SG_UI_Get_Window_Main() && pImgHandler != NULL)
+	{
+		wxImage::RemoveHandler(pImgHandler->GetName());
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CGrid_Import::Set_Transformation(CSG_Grid **ppImage, double ax, double ay, double dx, double dy, double rx, double ry)
+{
+	int			x, y;
+	double		z;
+	TSG_Rect	r;
+	CSG_Vector	A(2), XSrc(2), XTgt(2);
+	CSG_Matrix	D(2, 2), DInv;
+	CSG_Grid	*pSource, *pTarget;
+
+	//-----------------------------------------------------
+	pSource		= *ppImage;
+
+	A[0]	= ax;	A[1]	= ay;
+	D[0][0]	= dx;	D[0][1]	= rx;
+	D[1][0]	= ry;	D[1][1]	= dy;
+	DInv	= D.Get_Inverse();
+
+	//-----------------------------------------------------
+	XSrc[0]	= pSource->Get_XMin();	XSrc[1]	= pSource->Get_YMin();	XTgt	= D * XSrc + A;
+	r.xMin	= r.xMax	= XTgt[0];
+	r.yMin	= r.yMax	= XTgt[1];
+
+	XSrc[0]	= pSource->Get_XMin();	XSrc[1]	= pSource->Get_YMax();	XTgt	= D * XSrc + A;
+	if( r.xMin > XTgt[0] )	r.xMin	= XTgt[0];	else if( r.xMax < XTgt[0] )	r.xMax	= XTgt[0];
+	if( r.yMin > XTgt[1] )	r.yMin	= XTgt[1];	else if( r.yMax < XTgt[1] )	r.yMax	= XTgt[1];
+
+	XSrc[0]	= pSource->Get_XMax();	XSrc[1]	= pSource->Get_YMax();	XTgt	= D * XSrc + A;
+	if( r.xMin > XTgt[0] )	r.xMin	= XTgt[0];	else if( r.xMax < XTgt[0] )	r.xMax	= XTgt[0];
+	if( r.yMin > XTgt[1] )	r.yMin	= XTgt[1];	else if( r.yMax < XTgt[1] )	r.yMax	= XTgt[1];
+
+	XSrc[0]	= pSource->Get_XMax();	XSrc[1]	= pSource->Get_YMin();	XTgt	= D * XSrc + A;
+	if( r.xMin > XTgt[0] )	r.xMin	= XTgt[0];	else if( r.xMax < XTgt[0] )	r.xMax	= XTgt[0];
+	if( r.yMin > XTgt[1] )	r.yMin	= XTgt[1];	else if( r.yMax < XTgt[1] )	r.yMax	= XTgt[1];
+
+	z	= fabs(dx) < fabs(dy) ? fabs(dx) : fabs(dy);	// guess a suitable cellsize; could be improved...
+	x	= 1 + (int)((r.xMax - r.xMin) / z);
+	y	= 1 + (int)((r.yMax - r.yMin) / z);
+
+	//-----------------------------------------------------
+	pTarget		= *ppImage	= SG_Create_Grid(pSource->Get_Type(), x, y, z, r.xMin, r.yMin);
+
+	for(y=0, XTgt[1]=pTarget->Get_YMin(); y<pTarget->Get_NY() && Set_Progress(y, pTarget->Get_NY()); y++, XTgt[1]+=pTarget->Get_Cellsize())
+	{
+		for(x=0, XTgt[0]=pTarget->Get_XMin(); x<pTarget->Get_NX(); x++, XTgt[0]+=pTarget->Get_Cellsize())
+		{
+			XSrc	= DInv * (XTgt - A);
+
+			if( pSource->Get_Value(XSrc[0], XSrc[1], z, GRID_INTERPOLATION_NearestNeighbour, false, true) )
+			{
+				pTarget->Set_Value(x, y, z);
+			}
+			else
+			{
+				pTarget->Set_NoData(x, y);
+			}
+		}
+	}
+
+	delete(pSource);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_import.h b/src/modules/io/io_grid_image/grid_import.h
new file mode 100644
index 0000000..52f209b
--- /dev/null
+++ b/src/modules/io/io_grid_image/grid_import.h
@@ -0,0 +1,113 @@
+/**********************************************************
+ * Version $Id: grid_import.h 2089 2014-04-04 12:37:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       image_io                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     Grid_Import.h                     //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Grid_Import_H
+#define HEADER_INCLUDED__Grid_Import_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class io_grid_image_EXPORT CGrid_Import : public CSG_Module
+{
+public:
+	CGrid_Import(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Import") );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	void					Set_Transformation	(CSG_Grid **ppImage, double ax, double ay, double dx, double dy, double rx, double ry);
+
+};
+
+#endif // #ifndef HEADER_INCLUDED__Grid_Import_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_to_kml.cpp b/src/modules/io/io_grid_image/grid_to_kml.cpp
new file mode 100644
index 0000000..11c2ad2
--- /dev/null
+++ b/src/modules/io/io_grid_image/grid_to_kml.cpp
@@ -0,0 +1,342 @@
+/**********************************************************
+ * Version $Id: grid_to_kml.cpp 2091 2014-04-04 14:14:29Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     io_grid_image                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    grid_to_kml.cpp                    //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "grid_to_kml.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_to_KML::CGrid_to_KML(void)
+{
+	Set_Name		(_TL("Export Grid to KML"));
+
+	Set_Author		("O.Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Uses 'Export Image' tool to create the image file. Automatically projects raster to geographic "
+		"coordinate system, if its projection is known and not geographic. "
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "GRID"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SHADE"		, _TL("Shade"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_FilePath(
+		NULL	, "FILE"		, _TL("Image File"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("Windows or OS/2 Bitmap (*.bmp)")				, SG_T("*.bmp"),
+			_TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)")	, SG_T("*.jpg;*.jif;*.jpeg"),
+			_TL("Zsoft Paintbrush (*.pcx)")						, SG_T("*.pcx"),
+			_TL("Portable Network Graphics (*.png)")			, SG_T("*.png"),
+			_TL("Tagged Image File Format (*.tif, *.tiff)")		, SG_T("*.tif;*.tiff")
+		), NULL, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "COLOURING"	, _TL("Colouring"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("stretch to grid's standard deviation"),
+			_TL("stretch to grid's value range"),
+			_TL("stretch to specified value range"),
+			_TL("lookup table"),
+			_TL("rgb coded values")
+		), 0
+	);
+
+	if( SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_Colors(
+			NULL	, "COL_PALETTE"	, _TL("Colours Palette"),
+			_TL("")
+		);
+	}
+	else
+	{
+		Parameters.Add_Choice(
+			NULL	, "COL_PALETTE"	, _TL("Color Palette"),
+			_TL(""),
+			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+				_TL("DEFAULT"),			_TL("DEFAULT_BRIGHT"),	_TL("BLACK_WHITE"),		_TL("BLACK_RED"),
+				_TL("BLACK_GREEN"),		_TL("BLACK_BLUE"),		_TL("WHITE_RED"),		_TL("WHITE_GREEN"),
+				_TL("WHITE_BLUE"),		_TL("YELLOW_RED"),		_TL("YELLOW_GREEN"),	_TL("YELLOW_BLUE"),
+				_TL("RED_GREEN"),		_TL("RED_BLUE"),		_TL("GREEN_BLUE"),		_TL("RED_GREY_BLUE"),
+				_TL("RED_GREY_GREEN"),	_TL("GREEN_GREY_BLUE"),	_TL("RED_GREEN_BLUE"),	_TL("RED_BLUE_GREEN"),
+				_TL("GREEN_RED_BLUE"),	_TL("RAINBOW"),			_TL("NEON"),			_TL("TOPOGRAPHY"),
+				_TL("ASPECT_1"),		_TL("ASPECT_2"),		_TL("ASPECT_3")
+			), 0
+		);
+
+		Parameters.Add_Value(
+			NULL	, "COL_COUNT"	, _TL("Number of Colors"),
+			_TL(""),
+			PARAMETER_TYPE_Int, 100
+		);
+
+		Parameters.Add_Value(
+			NULL	, "COL_REVERT"	, _TL("Revert Palette"),
+			_TL(""),
+			PARAMETER_TYPE_Bool, false
+		);
+	}
+
+	Parameters.Add_Value(
+		NULL	, "STDDEV"		, _TL("Standard Deviation"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 2.0, 0.0, true
+	);
+
+	Parameters.Add_Range(
+        NULL	, "STRETCH"		, _TL("Stretch to Value Range"),
+        _TL(""),
+        0.0, 100.0
+    );
+
+	Parameters.Add_Table(
+		NULL	, "LUT"			, _TL("Lookup Table"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+        NULL	, "INTERPOL"	, _TL("Interpolation"),
+        _TL("interpolate values if projection is needed"),
+        PARAMETER_TYPE_Bool, true
+    );
+
+	if( !SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_Range(
+			NULL	, "SHADE_BRIGHT", _TL("Shade Brightness"),
+			_TL("Allows to scale shade brightness, [percent]"),
+			0.0, 100.0, 0.0, true, 100.0, true
+		);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGrid_to_KML::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "COLOURING") )
+	{
+		pParameters->Get_Parameter("COL_PALETTE")->Set_Enabled(pParameter->asInt() <= 2);
+		pParameters->Get_Parameter("STDDEV"     )->Set_Enabled(pParameter->asInt() == 0);
+		pParameters->Get_Parameter("STRETCH"    )->Set_Enabled(pParameter->asInt() == 2);
+		pParameters->Get_Parameter("LUT"        )->Set_Enabled(pParameter->asInt() == 3);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "SHADE") && pParameters->Get_Parameter("SHADE_BRIGHT") )
+	{
+		pParameters->Get_Parameter("SHADE_BRIGHT")->Set_Enabled(pParameter->asGrid() != NULL);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "GRID") )
+	{
+		pParameters->Get_Parameter("INTERPOL")->Set_Enabled(pParameter->asGrid()
+			&& pParameter->asGrid()->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Projected
+		);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_to_KML::On_Execute(void)
+{
+	//-----------------------------------------------------
+	bool	bDelete	= false;
+
+	CSG_Parameters	P;
+	CSG_Module		*pModule;
+
+	CSG_Grid	Grid , *pGrid	= Parameters("GRID" )->asGrid();
+	CSG_Grid	Shade, *pShade	= Parameters("SHADE")->asGrid();
+
+	//-----------------------------------------------------
+	if( pGrid->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Undefined )
+	{
+		Message_Add(_TL("layer uses undefined coordinate system, assuming geographic coordinates"));
+	}
+	else if( pGrid->Get_Projection().Get_Type() != SG_PROJ_TYPE_CS_Geographic )
+	{
+		Message_Add(CSG_String::Format(SG_T("\n%s (%s: %s)\n"), _TL("re-projection to geographic coordinates"), _TL("original"), pGrid->Get_Projection().Get_Name().c_str()), false);
+
+		if(	(pModule = SG_Get_Module_Library_Manager().Get_Module(SG_T("pj_proj4"), 4)) == NULL )	// Coordinate Transformation (Grid)
+		{
+			return( false );
+		}
+
+		P.Assign(pModule->Get_Parameters());
+
+		pModule->Set_Manager(NULL);
+
+		if( pModule->Get_Parameters()->Set_Parameter("CRS_PROJ4"    , SG_T("+proj=longlat +ellps=WGS84 +datum=WGS84"))
+		&&  pModule->Get_Parameters()->Set_Parameter("INTERPOLATION", Parameters("INTERPOL")->asBool() ? 4 : 0)
+		&&  pModule->Get_Parameters()->Set_Parameter("SOURCE"       , pGrid)
+		&&  pModule->Execute() )
+		{
+			bDelete	= true;
+
+			pGrid	= pModule->Get_Parameters("GET_USER")->Get_Parameter("GRID")->asGrid();
+
+			if( pShade
+			&&  pModule->Get_Parameters()->Set_Parameter("SOURCE", pShade)
+			&&  pModule->Execute() )
+			{
+				pShade	= pModule->Get_Parameters("GET_USER")->Get_Parameter("GRID")->asGrid();
+			}
+			else
+			{
+				pShade	= NULL;
+			}
+		}
+
+		pModule->Get_Parameters()->Assign_Values(&P);
+		pModule->Set_Manager(P.Get_Manager());
+
+		if( !bDelete )
+		{
+			Message_Add(CSG_String::Format(SG_T("\n%s: %s\n"), _TL("re-projection"), _TL("failed")), false);
+
+			return( false );
+		}
+	}
+
+	//-----------------------------------------------------
+	if(	(pModule = SG_Get_Module_Library_Manager().Get_Module(SG_T("io_grid_image"), 0)) == NULL )	// Export Image
+	{
+		return( false );
+	}
+
+	P.Assign(pModule->Get_Parameters());
+
+	pModule->Set_Manager(NULL);
+
+	bool	bResult	= false;
+
+	if( pModule->Get_Parameters()->Set_Parameter("GRID"        , pGrid)
+	&&  pModule->Get_Parameters()->Set_Parameter("SHADE"       , pShade)
+	&&  pModule->Get_Parameters()->Set_Parameter("FILE_KML"    , true)
+	&&  pModule->Get_Parameters()->Set_Parameter("FILE"        , Parameters("FILE"))
+	&&  pModule->Get_Parameters()->Set_Parameter("COLOURING"   , Parameters("COLOURING"))
+	&&  pModule->Get_Parameters()->Set_Parameter("COL_PALETTE" , Parameters("COL_PALETTE"))
+	&&  pModule->Get_Parameters()->Set_Parameter("STDDEV"      , Parameters("STDDEV"))
+	&&  pModule->Get_Parameters()->Set_Parameter("STRETCH"     , Parameters("STRETCH"))
+	&&  pModule->Get_Parameters()->Set_Parameter("LUT"         , Parameters("LUT"))
+	&&  (SG_UI_Get_Window_Main() || pModule->Get_Parameters()->Set_Parameter("SHADE_BRIGHT", Parameters("SHADE_BRIGHT")))
+	&&  pModule->Execute() )
+	{
+		bResult	= true;
+	}
+
+	//-----------------------------------------------------
+	pModule->Get_Parameters()->Assign_Values(&P);
+	pModule->Set_Manager(P.Get_Manager());
+
+	if( bDelete )
+	{
+		delete(pGrid);
+
+		if( pShade )
+		{
+			delete(pShade);
+		}
+	}
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_to_kml.h b/src/modules/io/io_grid_image/grid_to_kml.h
new file mode 100644
index 0000000..cd444eb
--- /dev/null
+++ b/src/modules/io/io_grid_image/grid_to_kml.h
@@ -0,0 +1,111 @@
+/**********************************************************
+ * Version $Id: grid_to_kml.h 2089 2014-04-04 12:37:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     io_grid_image                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     grid_to_kml.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__grid_to_kml_H
+#define HEADER_INCLUDED__grid_to_kml_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_to_KML : public CSG_Module_Grid
+{
+public:
+	CGrid_to_KML(void);
+
+	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("R:Export") );	}
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__grid_to_kml_H
diff --git a/src/modules_io/shapes/io_shapes/MLB_Interface.cpp b/src/modules/io/io_shapes/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/MLB_Interface.cpp
rename to src/modules/io/io_shapes/MLB_Interface.cpp
diff --git a/src/modules_io/shapes/io_shapes/MLB_Interface.h b/src/modules/io/io_shapes/MLB_Interface.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/MLB_Interface.h
rename to src/modules/io/io_shapes/MLB_Interface.h
diff --git a/src/modules_io/shapes/io_shapes/Makefile.am b/src/modules/io/io_shapes/Makefile.am
similarity index 100%
rename from src/modules_io/shapes/io_shapes/Makefile.am
rename to src/modules/io/io_shapes/Makefile.am
diff --git a/src/modules/io/io_shapes/Makefile.in b/src/modules/io/io_shapes/Makefile.in
new file mode 100644
index 0000000..d0eb3bc
--- /dev/null
+++ b/src/modules/io/io_shapes/Makefile.in
@@ -0,0 +1,674 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_shapes
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_shapes_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_shapes_la_OBJECTS = atlas_bna.lo generate.lo gpx.lo gstat.lo \
+	MLB_Interface.lo pointcloud_from_file.lo \
+	pointcloud_from_text_file.lo pointcloud_to_text_file.lo stl.lo \
+	surfer_bln.lo svg.lo wasp_map.lo wktb.lo xyz.lo
+libio_shapes_la_OBJECTS = $(am_libio_shapes_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_shapes_la_SOURCES)
+DIST_SOURCES = $(libio_shapes_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1373 2012-04-13 09:54:30Z oconrad $
+#
+ at DEBUG_TRUE@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`
+ at SAGA_UNICODE_TRUE@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 = libio_shapes.la
+libio_shapes_la_SOURCES = \
+atlas_bna.cpp\
+generate.cpp\
+gpx.cpp\
+gstat.cpp\
+MLB_Interface.cpp\
+pointcloud_from_file.cpp\
+pointcloud_from_text_file.cpp\
+pointcloud_to_text_file.cpp\
+stl.cpp\
+surfer_bln.cpp\
+svg.cpp\
+wasp_map.cpp\
+wktb.cpp\
+xyz.cpp\
+atlas_bna.h\
+generate.h\
+gpx.h\
+gstat.h\
+MLB_Interface.h\
+pointcloud_from_file.h\
+pointcloud_from_text_file.h\
+pointcloud_to_text_file.h\
+stl.h\
+surfer_bln.h\
+svg.h\
+wasp_map.h\
+wktb.h\
+xyz.h
+
+libio_shapes_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_shapes/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_shapes/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_shapes.la: $(libio_shapes_la_OBJECTS) $(libio_shapes_la_DEPENDENCIES) $(EXTRA_libio_shapes_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_shapes_la_OBJECTS) $(libio_shapes_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/atlas_bna.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/generate.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gpx.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gstat.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pointcloud_from_file.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pointcloud_from_text_file.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pointcloud_to_text_file.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/surfer_bln.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wasp_map.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wktb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xyz.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/shapes/io_shapes/atlas_bna.cpp b/src/modules/io/io_shapes/atlas_bna.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/atlas_bna.cpp
rename to src/modules/io/io_shapes/atlas_bna.cpp
diff --git a/src/modules_io/shapes/io_shapes/atlas_bna.h b/src/modules/io/io_shapes/atlas_bna.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/atlas_bna.h
rename to src/modules/io/io_shapes/atlas_bna.h
diff --git a/src/modules_io/shapes/io_shapes/generate.cpp b/src/modules/io/io_shapes/generate.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/generate.cpp
rename to src/modules/io/io_shapes/generate.cpp
diff --git a/src/modules_io/shapes/io_shapes/generate.h b/src/modules/io/io_shapes/generate.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/generate.h
rename to src/modules/io/io_shapes/generate.h
diff --git a/src/modules_io/shapes/io_shapes/gpx.cpp b/src/modules/io/io_shapes/gpx.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/gpx.cpp
rename to src/modules/io/io_shapes/gpx.cpp
diff --git a/src/modules_io/shapes/io_shapes/gpx.h b/src/modules/io/io_shapes/gpx.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/gpx.h
rename to src/modules/io/io_shapes/gpx.h
diff --git a/src/modules_io/shapes/io_shapes/gstat.cpp b/src/modules/io/io_shapes/gstat.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/gstat.cpp
rename to src/modules/io/io_shapes/gstat.cpp
diff --git a/src/modules_io/shapes/io_shapes/gstat.h b/src/modules/io/io_shapes/gstat.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/gstat.h
rename to src/modules/io/io_shapes/gstat.h
diff --git a/src/modules_io/shapes/io_shapes/pointcloud_from_file.cpp b/src/modules/io/io_shapes/pointcloud_from_file.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/pointcloud_from_file.cpp
rename to src/modules/io/io_shapes/pointcloud_from_file.cpp
diff --git a/src/modules_io/shapes/io_shapes/pointcloud_from_file.h b/src/modules/io/io_shapes/pointcloud_from_file.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/pointcloud_from_file.h
rename to src/modules/io/io_shapes/pointcloud_from_file.h
diff --git a/src/modules_io/shapes/io_shapes/pointcloud_from_text_file.cpp b/src/modules/io/io_shapes/pointcloud_from_text_file.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/pointcloud_from_text_file.cpp
rename to src/modules/io/io_shapes/pointcloud_from_text_file.cpp
diff --git a/src/modules_io/shapes/io_shapes/pointcloud_from_text_file.h b/src/modules/io/io_shapes/pointcloud_from_text_file.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/pointcloud_from_text_file.h
rename to src/modules/io/io_shapes/pointcloud_from_text_file.h
diff --git a/src/modules_io/shapes/io_shapes/pointcloud_to_text_file.cpp b/src/modules/io/io_shapes/pointcloud_to_text_file.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/pointcloud_to_text_file.cpp
rename to src/modules/io/io_shapes/pointcloud_to_text_file.cpp
diff --git a/src/modules_io/shapes/io_shapes/pointcloud_to_text_file.h b/src/modules/io/io_shapes/pointcloud_to_text_file.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/pointcloud_to_text_file.h
rename to src/modules/io/io_shapes/pointcloud_to_text_file.h
diff --git a/src/modules_io/shapes/io_shapes/stl.cpp b/src/modules/io/io_shapes/stl.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/stl.cpp
rename to src/modules/io/io_shapes/stl.cpp
diff --git a/src/modules_io/shapes/io_shapes/stl.h b/src/modules/io/io_shapes/stl.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/stl.h
rename to src/modules/io/io_shapes/stl.h
diff --git a/src/modules_io/shapes/io_shapes/surfer_bln.cpp b/src/modules/io/io_shapes/surfer_bln.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/surfer_bln.cpp
rename to src/modules/io/io_shapes/surfer_bln.cpp
diff --git a/src/modules_io/shapes/io_shapes/surfer_bln.h b/src/modules/io/io_shapes/surfer_bln.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/surfer_bln.h
rename to src/modules/io/io_shapes/surfer_bln.h
diff --git a/src/modules_io/shapes/io_shapes/svg.cpp b/src/modules/io/io_shapes/svg.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/svg.cpp
rename to src/modules/io/io_shapes/svg.cpp
diff --git a/src/modules_io/shapes/io_shapes/svg.h b/src/modules/io/io_shapes/svg.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/svg.h
rename to src/modules/io/io_shapes/svg.h
diff --git a/src/modules_io/shapes/io_shapes/wasp_map.cpp b/src/modules/io/io_shapes/wasp_map.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/wasp_map.cpp
rename to src/modules/io/io_shapes/wasp_map.cpp
diff --git a/src/modules_io/shapes/io_shapes/wasp_map.h b/src/modules/io/io_shapes/wasp_map.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/wasp_map.h
rename to src/modules/io/io_shapes/wasp_map.h
diff --git a/src/modules_io/shapes/io_shapes/wktb.cpp b/src/modules/io/io_shapes/wktb.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/wktb.cpp
rename to src/modules/io/io_shapes/wktb.cpp
diff --git a/src/modules_io/shapes/io_shapes/wktb.h b/src/modules/io/io_shapes/wktb.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/wktb.h
rename to src/modules/io/io_shapes/wktb.h
diff --git a/src/modules_io/shapes/io_shapes/xyz.cpp b/src/modules/io/io_shapes/xyz.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes/xyz.cpp
rename to src/modules/io/io_shapes/xyz.cpp
diff --git a/src/modules_io/shapes/io_shapes/xyz.h b/src/modules/io/io_shapes/xyz.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes/xyz.h
rename to src/modules/io/io_shapes/xyz.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/MLB_Interface.cpp b/src/modules/io/io_shapes_dxf/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/MLB_Interface.cpp
rename to src/modules/io/io_shapes_dxf/MLB_Interface.cpp
diff --git a/src/modules_io/shapes/io_shapes_dxf/MLB_Interface.h b/src/modules/io/io_shapes_dxf/MLB_Interface.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/MLB_Interface.h
rename to src/modules/io/io_shapes_dxf/MLB_Interface.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/Makefile.am b/src/modules/io/io_shapes_dxf/Makefile.am
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/Makefile.am
rename to src/modules/io/io_shapes_dxf/Makefile.am
diff --git a/src/modules/io/io_shapes_dxf/Makefile.in b/src/modules/io/io_shapes_dxf/Makefile.in
new file mode 100644
index 0000000..ebe2768
--- /dev/null
+++ b/src/modules/io/io_shapes_dxf/Makefile.in
@@ -0,0 +1,660 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_shapes_dxf
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_shapes_dxf_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_shapes_dxf_la_OBJECTS = dxf_import.lo MLB_Interface.lo \
+	dl_dxf.lo dl_writer_ascii.lo
+libio_shapes_dxf_la_OBJECTS = $(am_libio_shapes_dxf_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_shapes_dxf_la_SOURCES)
+DIST_SOURCES = $(libio_shapes_dxf_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libio_shapes_dxf.la
+libio_shapes_dxf_la_SOURCES = \
+dxf_import.cpp\
+MLB_Interface.cpp\
+./dxflib/dl_dxf.cpp\
+./dxflib/dl_writer_ascii.cpp\
+dxf_import.h\
+MLB_Interface.h\
+./dxflib/dl_attributes.h\
+./dxflib/dl_codes.h\
+./dxflib/dl_creationadapter.h\
+./dxflib/dl_creationinterface.h\
+./dxflib/dl_dxf.h\
+./dxflib/dl_entities.h\
+./dxflib/dl_exception.h\
+./dxflib/dl_extrusion.h\
+./dxflib/dl_writer.h\
+./dxflib/dl_writer_ascii.h
+
+libio_shapes_dxf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_shapes_dxf/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_shapes_dxf/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_shapes_dxf.la: $(libio_shapes_dxf_la_OBJECTS) $(libio_shapes_dxf_la_DEPENDENCIES) $(EXTRA_libio_shapes_dxf_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_shapes_dxf_la_OBJECTS) $(libio_shapes_dxf_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dl_dxf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dl_writer_ascii.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dxf_import.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+dl_dxf.lo: ./dxflib/dl_dxf.cpp
+ at am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dl_dxf.lo -MD -MP -MF $(DEPDIR)/dl_dxf.Tpo -c -o dl_dxf.lo `test -f './dxflib/dl_dxf.cpp' || echo '$(srcdir)/'`./dxflib/dl_dxf.cpp
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dl_dxf.Tpo $(DEPDIR)/dl_dxf.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./dxflib/dl_dxf.cpp' object='dl_dxf.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dl_dxf.lo `test -f './dxflib/dl_dxf.cpp' || echo '$(srcdir)/'`./dxflib/dl_dxf.cpp
+
+dl_writer_ascii.lo: ./dxflib/dl_writer_ascii.cpp
+ at am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dl_writer_ascii.lo -MD -MP -MF $(DEPDIR)/dl_writer_ascii.Tpo -c -o dl_writer_ascii.lo `test -f './dxflib/dl_writer_ascii.cpp' || echo '$(srcdir)/'`./dxflib/dl_writer_ascii.cpp
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dl_writer_ascii.Tpo $(DEPDIR)/dl_writer_ascii.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./dxflib/dl_writer_ascii.cpp' object='dl_writer_ascii.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dl_writer_ascii.lo `test -f './dxflib/dl_writer_ascii.cpp' || echo '$(srcdir)/'`./dxflib/dl_writer_ascii.cpp
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxf_import.cpp b/src/modules/io/io_shapes_dxf/dxf_import.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxf_import.cpp
rename to src/modules/io/io_shapes_dxf/dxf_import.cpp
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxf_import.h b/src/modules/io/io_shapes_dxf/dxf_import.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxf_import.h
rename to src/modules/io/io_shapes_dxf/dxf_import.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_attributes.h b/src/modules/io/io_shapes_dxf/dxflib/dl_attributes.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_attributes.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_attributes.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_codes.h b/src/modules/io/io_shapes_dxf/dxflib/dl_codes.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_codes.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_codes.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationadapter.h b/src/modules/io/io_shapes_dxf/dxflib/dl_creationadapter.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationadapter.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_creationadapter.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationinterface.h b/src/modules/io/io_shapes_dxf/dxflib/dl_creationinterface.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationinterface.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_creationinterface.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.cpp b/src/modules/io/io_shapes_dxf/dxflib/dl_dxf.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.cpp
rename to src/modules/io/io_shapes_dxf/dxflib/dl_dxf.cpp
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.h b/src/modules/io/io_shapes_dxf/dxflib/dl_dxf.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_dxf.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_entities.h b/src/modules/io/io_shapes_dxf/dxflib/dl_entities.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_entities.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_entities.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_exception.h b/src/modules/io/io_shapes_dxf/dxflib/dl_exception.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_exception.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_exception.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_extrusion.h b/src/modules/io/io_shapes_dxf/dxflib/dl_extrusion.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_extrusion.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_extrusion.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer.h b/src/modules/io/io_shapes_dxf/dxflib/dl_writer.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_writer.h
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.cpp b/src/modules/io/io_shapes_dxf/dxflib/dl_writer_ascii.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.cpp
rename to src/modules/io/io_shapes_dxf/dxflib/dl_writer_ascii.cpp
diff --git a/src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.h b/src/modules/io/io_shapes_dxf/dxflib/dl_writer_ascii.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.h
rename to src/modules/io/io_shapes_dxf/dxflib/dl_writer_ascii.h
diff --git a/src/modules_io/shapes/io_shapes_las/MLB_Interface.cpp b/src/modules/io/io_shapes_las/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/MLB_Interface.cpp
rename to src/modules/io/io_shapes_las/MLB_Interface.cpp
diff --git a/src/modules_io/shapes/io_shapes_las/MLB_Interface.h b/src/modules/io/io_shapes_las/MLB_Interface.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/MLB_Interface.h
rename to src/modules/io/io_shapes_las/MLB_Interface.h
diff --git a/src/modules_io/shapes/io_shapes_las/Makefile.am b/src/modules/io/io_shapes_las/Makefile.am
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/Makefile.am
rename to src/modules/io/io_shapes_las/Makefile.am
diff --git a/src/modules/io/io_shapes_las/Makefile.in b/src/modules/io/io_shapes_las/Makefile.in
new file mode 100644
index 0000000..b127c21
--- /dev/null
+++ b/src/modules/io/io_shapes_las/Makefile.in
@@ -0,0 +1,642 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_shapes_las
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+ at HAVE_LLAS_TRUE@libio_shapes_las_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am__libio_shapes_las_la_SOURCES_DIST = las_export.cpp las_import.cpp \
+	las_info.cpp MLB_Interface.cpp las_export.h las_import.h \
+	las_info.h MLB_Interface.h
+ at HAVE_LLAS_TRUE@am_libio_shapes_las_la_OBJECTS = las_export.lo \
+ at HAVE_LLAS_TRUE@	las_import.lo las_info.lo MLB_Interface.lo
+libio_shapes_las_la_OBJECTS = $(am_libio_shapes_las_la_OBJECTS)
+ at HAVE_LLAS_TRUE@am_libio_shapes_las_la_rpath = -rpath $(pkglibdir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_shapes_las_la_SOURCES)
+DIST_SOURCES = $(am__libio_shapes_las_la_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
+ at HAVE_LLAS_TRUE@DEP_LIBS = -llas
+ at HAVE_LLAS_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+ at HAVE_LLAS_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core
+ at HAVE_LLAS_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+ at HAVE_LLAS_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS)
+ at HAVE_LLAS_TRUE@pkglib_LTLIBRARIES = libio_shapes_las.la
+ at HAVE_LLAS_TRUE@libio_shapes_las_la_SOURCES = \
+ at HAVE_LLAS_TRUE@las_export.cpp\
+ at HAVE_LLAS_TRUE@las_import.cpp\
+ at HAVE_LLAS_TRUE@las_info.cpp\
+ at HAVE_LLAS_TRUE@MLB_Interface.cpp\
+ at HAVE_LLAS_TRUE@las_export.h\
+ at HAVE_LLAS_TRUE@las_import.h\
+ at HAVE_LLAS_TRUE@las_info.h\
+ at HAVE_LLAS_TRUE@MLB_Interface.h
+
+ at HAVE_LLAS_TRUE@libio_shapes_las_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_shapes_las/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_shapes_las/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_shapes_las.la: $(libio_shapes_las_la_OBJECTS) $(libio_shapes_las_la_DEPENDENCIES) $(EXTRA_libio_shapes_las_la_DEPENDENCIES) 
+	$(CXXLINK) $(am_libio_shapes_las_la_rpath) $(libio_shapes_las_la_OBJECTS) $(libio_shapes_las_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/las_export.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/las_import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/las_info.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/shapes/io_shapes_las/las_export.cpp b/src/modules/io/io_shapes_las/las_export.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/las_export.cpp
rename to src/modules/io/io_shapes_las/las_export.cpp
diff --git a/src/modules_io/shapes/io_shapes_las/las_export.h b/src/modules/io/io_shapes_las/las_export.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/las_export.h
rename to src/modules/io/io_shapes_las/las_export.h
diff --git a/src/modules_io/shapes/io_shapes_las/las_import.cpp b/src/modules/io/io_shapes_las/las_import.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/las_import.cpp
rename to src/modules/io/io_shapes_las/las_import.cpp
diff --git a/src/modules_io/shapes/io_shapes_las/las_import.h b/src/modules/io/io_shapes_las/las_import.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/las_import.h
rename to src/modules/io/io_shapes_las/las_import.h
diff --git a/src/modules_io/shapes/io_shapes_las/las_info.cpp b/src/modules/io/io_shapes_las/las_info.cpp
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/las_info.cpp
rename to src/modules/io/io_shapes_las/las_info.cpp
diff --git a/src/modules_io/shapes/io_shapes_las/las_info.h b/src/modules/io/io_shapes_las/las_info.h
similarity index 100%
rename from src/modules_io/shapes/io_shapes_las/las_info.h
rename to src/modules/io/io_shapes_las/las_info.h
diff --git a/src/modules_io/table/io_table/MLB_Interface.cpp b/src/modules/io/io_table/MLB_Interface.cpp
similarity index 100%
rename from src/modules_io/table/io_table/MLB_Interface.cpp
rename to src/modules/io/io_table/MLB_Interface.cpp
diff --git a/src/modules_io/table/io_table/MLB_Interface.h b/src/modules/io/io_table/MLB_Interface.h
similarity index 100%
rename from src/modules_io/table/io_table/MLB_Interface.h
rename to src/modules/io/io_table/MLB_Interface.h
diff --git a/src/modules_io/table/io_table/Makefile.am b/src/modules/io/io_table/Makefile.am
similarity index 100%
rename from src/modules_io/table/io_table/Makefile.am
rename to src/modules/io/io_table/Makefile.am
diff --git a/src/modules/io/io_table/Makefile.in b/src/modules/io/io_table/Makefile.in
new file mode 100644
index 0000000..e0a4f5b
--- /dev/null
+++ b/src/modules/io/io_table/Makefile.in
@@ -0,0 +1,631 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_table
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_table_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_table_la_OBJECTS = io_table_txt.lo MLB_Interface.lo
+libio_table_la_OBJECTS = $(am_libio_table_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_table_la_SOURCES)
+DIST_SOURCES = $(libio_table_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libio_table.la
+libio_table_la_SOURCES = \
+io_table_txt.cpp\
+MLB_Interface.cpp\
+io_table_txt.h\
+MLB_Interface.h
+
+libio_table_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_table/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_table/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_table.la: $(libio_table_la_OBJECTS) $(libio_table_la_DEPENDENCIES) $(EXTRA_libio_table_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_table_la_OBJECTS) $(libio_table_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/io_table_txt.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_io/table/io_table/io_table_txt.cpp b/src/modules/io/io_table/io_table_txt.cpp
similarity index 100%
rename from src/modules_io/table/io_table/io_table_txt.cpp
rename to src/modules/io/io_table/io_table_txt.cpp
diff --git a/src/modules_io/table/io_table/io_table_txt.h b/src/modules/io/io_table/io_table_txt.h
similarity index 100%
rename from src/modules_io/table/io_table/io_table_txt.h
rename to src/modules/io/io_table/io_table_txt.h
diff --git a/src/modules/io/io_virtual/MLB_Interface.cpp b/src/modules/io/io_virtual/MLB_Interface.cpp
new file mode 100644
index 0000000..eb71ae7
--- /dev/null
+++ b/src/modules/io/io_virtual/MLB_Interface.cpp
@@ -0,0 +1,128 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 2012 2014-02-24 13:55:07Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 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("Import/Export - Virtual") );
+
+	case MLB_INFO_Author:
+		return( SG_T("SAGA User Group Associaton (c) 2014") );
+
+	case MLB_INFO_Description:
+		return( _TL("Tools for the handling of virtual datasets.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("File|Virtual") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "pc_create_spcvf.h"
+#include "pc_get_subset_spcvf.h"
+#include "pc_tileshape_from_spcvf.h"
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case 0:		return( new CPointCloud_Create_SPCVF );
+	case 1:		return( new CPointCloud_Get_Subset_SPCVF );
+	case 2:		return( new CPointCloud_Create_Tileshape_From_SPCVF );
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/io/io_virtual/MLB_Interface.h b/src/modules/io/io_virtual/MLB_Interface.h
new file mode 100644
index 0000000..daa3913
--- /dev/null
+++ b/src/modules/io/io_virtual/MLB_Interface.h
@@ -0,0 +1,85 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1976 2014-02-09 15:05:12Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__io_virtual_H
+#define HEADER_INCLUDED__io_virtual_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+#ifdef io_virtual_EXPORTS
+	#define	io_virtual_EXPORT	_SAGA_DLL_EXPORT
+#else
+	#define	io_virtual_EXPORT	_SAGA_DLL_IMPORT
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__io_virtual_H
diff --git a/src/modules/io/io_virtual/Makefile.am b/src/modules/io/io_virtual/Makefile.am
new file mode 100644
index 0000000..4887f8d
--- /dev/null
+++ b/src/modules/io/io_virtual/Makefile.am
@@ -0,0 +1,31 @@
+#
+# $Id: Makefile.am 2012 2014-02-24 13:55:07Z reklov_w $
+#
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
+UC_DEFS = -D_SAGA_UNICODE
+else
+DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
+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) $(DEP_DEFS) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = -fPIC -shared -avoid-version $(DEP_LFLG)
+pkglib_LTLIBRARIES = libio_virtual.la
+libio_virtual_la_SOURCES =\
+MLB_Interface.cpp\
+pc_tileshape_from_spcvf.cpp\
+pc_create_spcvf.cpp\
+pc_get_subset_spcvf.cpp\
+MLB_Interface.h\
+pc_tileshape_from_spcvf.h\
+pc_create_spcvf.h\
+pc_get_subset_spcvf.h
+
+libio_virtual_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+
diff --git a/src/modules/io/io_virtual/Makefile.in b/src/modules/io/io_virtual/Makefile.in
new file mode 100644
index 0000000..e6b2c5c
--- /dev/null
+++ b/src/modules/io/io_virtual/Makefile.in
@@ -0,0 +1,643 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/io/io_virtual
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libio_virtual_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libio_virtual_la_OBJECTS = MLB_Interface.lo \
+	pc_tileshape_from_spcvf.lo pc_create_spcvf.lo \
+	pc_get_subset_spcvf.lo
+libio_virtual_la_OBJECTS = $(am_libio_virtual_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libio_virtual_la_SOURCES)
+DIST_SOURCES = $(libio_virtual_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 2012 2014-02-24 13:55:07Z reklov_w $
+#
+ at DEBUG_TRUE@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`
+ at SAGA_UNICODE_TRUE@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 = libio_virtual.la
+libio_virtual_la_SOURCES = \
+MLB_Interface.cpp\
+pc_tileshape_from_spcvf.cpp\
+pc_create_spcvf.cpp\
+pc_get_subset_spcvf.cpp\
+MLB_Interface.h\
+pc_tileshape_from_spcvf.h\
+pc_create_spcvf.h\
+pc_get_subset_spcvf.h
+
+libio_virtual_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_virtual/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/io/io_virtual/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libio_virtual.la: $(libio_virtual_la_OBJECTS) $(libio_virtual_la_DEPENDENCIES) $(EXTRA_libio_virtual_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libio_virtual_la_OBJECTS) $(libio_virtual_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_create_spcvf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_get_subset_spcvf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_tileshape_from_spcvf.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/io/io_virtual/pc_create_spcvf.cpp b/src/modules/io/io_virtual/pc_create_spcvf.cpp
new file mode 100644
index 0000000..d842645
--- /dev/null
+++ b/src/modules/io/io_virtual/pc_create_spcvf.cpp
@@ -0,0 +1,330 @@
+/**********************************************************
+ * Version $Id: pc_create_spcvf.cpp 2015 2014-02-25 14:32:09Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  pc_create_spcvf.cpp                  //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata.at                  //
+//                                                       //
+//    contact:    LASERDATA GmbH                         //
+//                Management and Analysis of             //
+//                Laserscanning Data                     //
+//                Technikerstr. 21a                      //
+//                6020 Innsbruck                         //
+//                Austria                                //
+//                www.laserdata.at                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "pc_create_spcvf.h"
+
+#include <vector>
+#include <limits>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPointCloud_Create_SPCVF::CPointCloud_Create_SPCVF(void)
+{
+	Set_Name		(_TL("Create Virtual Point Cloud Dataset"));
+
+	Set_Author		(SG_T("V. Wichmann, LASERDATA GmbH (c) 2014"));
+
+	Set_Description	(_TW(
+		"The module allows to create a virtual point cloud dataset from "
+		"a set of SAGA point cloud files. Such a virtual "
+		"dataset is a simple XML format with the file extension .spcvf, "
+		"which describes a mosaic of individual point cloud files. Such "
+		"a virtual point cloud dataset can be used for seamless data "
+		"access with the 'Get Subset from Virtual Point Cloud' module.\n"
+		"All point cloud input datasets must share the same attribute "
+		"table structure, NoData value and projection.\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_FilePath(
+		NULL	, "FILES"		, _TL("Input Files"),
+		_TL("The input point cloud files to use"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s"),
+			_TL("SAGA Point Clouds")	, SG_T("*.spc"),
+            _TL("All Files")            , SG_T("*.*")
+        ), NULL, false, false, true
+	);
+
+	Parameters.Add_FilePath(
+		NULL	, "FILENAME"		, _TL("Filename"),
+		_TL("The full path and name of the .spcvf file"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s"),
+			_TL("SAGA Point Cloud Virtual Format (*.spcvf)")	, SG_T("*.spcvf"),
+			_TL("All Files")									, SG_T("*.*")
+		), NULL, true, false, false
+ 	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD_PATHS"	, _TL("File Paths"),
+		_TL("Choose how to handle file paths. With relative paths, you can package the *.spcvf and your point cloud tiles easily."),
+		CSG_String::Format(SG_T("%s|%s"),
+			_TL("absolute"),
+			_TL("relative")
+		), 1
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPointCloud_Create_SPCVF::On_Execute(void)
+{
+	CSG_Strings					sFiles;
+	CSG_String					sFileName;
+	int							iMethodPaths;
+
+	CSG_MetaData				SPCVF;
+	CSG_Projection				projSPCVF;
+	double						dNoData;
+	std::vector<TSG_Data_Type>	vFieldTypes;
+	std::vector<CSG_String>		vFieldNames;
+	double						dBBoxXMin = std::numeric_limits<int>::max();
+	double						dBBoxYMin = std::numeric_limits<int>::max();
+	double						dBBoxXMax = std::numeric_limits<int>::min();
+	double						dBBoxYMax = std::numeric_limits<int>::min();
+	int							iSkipped = 0, iEmpty = 0;
+
+	//-----------------------------------------------------
+	sFileName		= Parameters("FILENAME")->asString();
+	iMethodPaths	= Parameters("METHOD_PATHS")->asInt();
+
+	//-----------------------------------------------------
+    if( !Parameters("FILES")->asFilePath()->Get_FilePaths(sFiles) )
+	{
+		SG_UI_Msg_Add_Error(_TL("Please provide some input files!"));
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	SPCVF.Set_Name(SG_T("SPCVFDataset"));
+	SPCVF.Add_Property(SG_T("Version"), SG_T("1.0"));
+	
+	switch( iMethodPaths )
+	{
+	default:
+	case 0:		SPCVF.Add_Property(SG_T("Paths"), SG_T("absolute"));	break;
+	case 1:		SPCVF.Add_Property(SG_T("Paths"), SG_T("relative"));	break;
+	}
+
+	//-----------------------------------------------------
+	CSG_MetaData	*pSPCVFBBox		= SPCVF.Add_Child(SG_T("BBox"));
+
+	//-----------------------------------------------------
+	CSG_MetaData	*pSPCVFDatasets;
+
+	//-----------------------------------------------------
+	for(int i=0; i<sFiles.Get_Count() && Set_Progress(i, sFiles.Get_Count()); i++)
+	{
+		CSG_PointCloud	*pPC		= SG_Create_PointCloud(sFiles[i]);
+
+		//-----------------------------------------------------
+		if( i==0 )		// first dataset determines projection, NoData value and table structure
+		{
+			projSPCVF	= pPC->Get_Projection();
+			dNoData		= pPC->Get_NoData_Value();
+
+			for(int iField=0; iField<pPC->Get_Field_Count(); iField++)
+			{
+				vFieldTypes.push_back(pPC->Get_Field_Type(iField));
+				vFieldNames.push_back(pPC->Get_Field_Name(iField));
+			}
+
+			if( projSPCVF.is_Okay() )
+			{
+				CSG_MetaData	*pSRS	= SPCVF.Add_Child(SG_T("SRS"));
+				pSRS->Add_Property(SG_T("WKT"), projSPCVF.Get_WKT());
+			}
+
+			pSPCVFDatasets	= SPCVF.Add_Child(SG_T("Datasets"));
+		}
+		else		// validate projection, NoData value and table structure
+		{
+			bool	bSkip = false;
+
+			if( pPC->Get_Field_Count() != (int)vFieldTypes.size() )
+			{
+				bSkip = true;
+			}
+
+			if( !bSkip && projSPCVF.is_Okay() )
+			{
+				if ( !pPC->Get_Projection().is_Okay() || SG_STR_CMP(pPC->Get_Projection().Get_WKT(), projSPCVF.Get_WKT()) )
+				{
+					bSkip = true;
+				}
+			}
+
+			if( !bSkip )
+			{
+				for(int iField=0; iField<pPC->Get_Field_Count(); iField++)
+				{
+					if( pPC->Get_Field_Type(iField) != vFieldTypes.at(iField) )
+					{
+						bSkip = true;
+						break;
+					}
+
+					if( SG_STR_CMP(pPC->Get_Field_Name(iField), vFieldNames.at(iField)) )
+					{
+						bSkip = true;
+						break;
+					}
+				}
+			}
+
+			if( bSkip )
+			{
+				SG_UI_Msg_Add(CSG_String::Format(_TL("Skipping dataset %s because of incompatibility with the first input dataset!"), sFiles[i].c_str()), true);
+				delete( pPC );
+				iSkipped++;
+				continue;
+			}
+		}
+
+		//-----------------------------------------------------
+		if( pPC->Get_Point_Count() <= 0 )
+		{
+			delete( pPC );
+			iEmpty++;
+			continue;
+		}
+
+		//-----------------------------------------------------
+		CSG_MetaData	*pDataset	= pSPCVFDatasets->Add_Child(SG_T("PointCloud"));
+
+		CSG_String		sFilePath;
+
+		switch( iMethodPaths )
+		{
+		default:
+		case 0:		sFilePath = SG_File_Get_Path_Absolute(sFiles.Get_String(i));									break;
+		case 1:		sFilePath = SG_File_Get_Path_Relative(SG_File_Get_Path(sFileName), sFiles.Get_String(i));		break;
+		}
+
+		sFilePath.Replace(SG_T("\\"), SG_T("/"));
+
+		pDataset->Add_Property(SG_T("File"), sFilePath);
+
+		pDataset->Add_Property(SG_T("Points"), pPC->Get_Point_Count());
+
+		//-----------------------------------------------------
+		CSG_MetaData	*pBBox		= pDataset->Add_Child(SG_T("BBox"));
+
+		pBBox->Add_Property(SG_T("XMin"), pPC->Get_Extent().Get_XMin());
+		pBBox->Add_Property(SG_T("YMin"), pPC->Get_Extent().Get_YMin());
+		pBBox->Add_Property(SG_T("XMax"), pPC->Get_Extent().Get_XMax());
+		pBBox->Add_Property(SG_T("YMax"), pPC->Get_Extent().Get_YMax());
+
+		if( dBBoxXMin > pPC->Get_Extent().Get_XMin() )
+			dBBoxXMin = pPC->Get_Extent().Get_XMin();
+		if( dBBoxYMin > pPC->Get_Extent().Get_YMin() )
+			dBBoxYMin = pPC->Get_Extent().Get_YMin();
+		if( dBBoxXMax < pPC->Get_Extent().Get_XMax() )
+			dBBoxXMax = pPC->Get_Extent().Get_XMax();
+		if( dBBoxYMax < pPC->Get_Extent().Get_YMax() )
+			dBBoxYMax = pPC->Get_Extent().Get_YMax();
+		
+		delete( pPC );
+	}
+
+	//-----------------------------------------------------
+	pSPCVFBBox->Add_Property(SG_T("XMin"), dBBoxXMin);
+	pSPCVFBBox->Add_Property(SG_T("YMin"), dBBoxYMin);
+	pSPCVFBBox->Add_Property(SG_T("XMax"), dBBoxXMax);
+	pSPCVFBBox->Add_Property(SG_T("YMax"), dBBoxYMax);
+
+	//-----------------------------------------------------
+	if( !SPCVF.Save(sFileName) )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format(_TL("Unable to save %s file!"), sFileName.c_str()));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	if( iSkipped > 0 )
+	{
+		SG_UI_Msg_Add(CSG_String::Format(_TL("WARNING: %d dataset(s) skipped because of incompatibilities!"), iSkipped), true);
+	}
+
+	if( iEmpty > 0 )
+	{
+		SG_UI_Msg_Add(CSG_String::Format(_TL("WARNING: %d dataset(s) skipped because they are empty!"), iEmpty), true);
+	}
+
+	SG_UI_Msg_Add(CSG_String::Format(_TL("SPCVF successfully created from %d dataset(s)."), sFiles.Get_Count() - iSkipped - iEmpty), true);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_virtual/pc_create_spcvf.h b/src/modules/io/io_virtual/pc_create_spcvf.h
new file mode 100644
index 0000000..69e3e4d
--- /dev/null
+++ b/src/modules/io/io_virtual/pc_create_spcvf.h
@@ -0,0 +1,111 @@
+/**********************************************************
+ * Version $Id: pc_create_spcvf.h 1976 2014-02-09 15:05:12Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   pc_create_spcvf.h                   //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata.at                  //
+//                                                       //
+//    contact:    LASERDATA GmbH                         //
+//                Management and Analysis of             //
+//                Laserscanning Data                     //
+//                Technikerstr. 21a                      //
+//                6020 Innsbruck                         //
+//                Austria                                //
+//                www.laserdata.at                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__pc_create_spcvf_H
+#define HEADER_INCLUDED__pc_create_spcvf_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPointCloud_Create_SPCVF : public CSG_Module
+{
+public:
+	CPointCloud_Create_SPCVF(void);
+
+	virtual CSG_String			Get_MenuPath		(void)	{	return( _TL("R:Point Cloud") );	}
+
+
+protected:
+
+	virtual bool				On_Execute			(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__pc_create_spcvf_H
diff --git a/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp b/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp
new file mode 100644
index 0000000..dfdb5a8
--- /dev/null
+++ b/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp
@@ -0,0 +1,385 @@
+/**********************************************************
+ * Version $Id: pc_get_subset_spcvf.cpp 2030 2014-02-28 09:49:45Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                pc_get_subset_spcvf.cpp                //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata.at                  //
+//                                                       //
+//    contact:    LASERDATA GmbH                         //
+//                Management and Analysis of             //
+//                Laserscanning Data                     //
+//                Technikerstr. 21a                      //
+//                6020 Innsbruck                         //
+//                Austria                                //
+//                www.laserdata.at                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "pc_get_subset_spcvf.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPointCloud_Get_Subset_SPCVF::CPointCloud_Get_Subset_SPCVF(void)
+{
+	Set_Name		(_TL("Get Subset from Virtual Point Cloud"));
+
+	Set_Author		(SG_T("V. Wichmann, LASERDATA GmbH (c) 2014"));
+
+	Set_Description	(_TW(
+		"The module allows to retrieve a point cloud from a virtual "
+		"point cloud dataset by applying the provided area-of-interest "
+		"(AOI). The extent of the AOI can be provided either as "
+		"shapefile, grid or by coordinates. In case the AOI is "
+		"provided as shapefile and one or more shapes are selected, "
+		"only the extent of the selected shapes is used. Optionally, "
+		"an overlap can be added to the AOI.\n"
+		"A virtual point cloud dataset is a simple XML format "
+		"with the file extension .spcvf, which can be created "
+		"with the 'Create Virtual Point Cloud Dataset' module.\n\n"
+	));
+
+
+	//-----------------------------------------------------
+	Parameters.Add_FilePath(
+		NULL	, "FILENAME"		, _TL("Filename"),
+		_TL("The full path and name of the .spcvf file"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s"),
+			_TL("SAGA Point Cloud Virtual Format (*.spcvf)")	, SG_T("*.spcvf"),
+			_TL("All Files")									, SG_T("*.*")
+		)
+ 	);
+
+	Parameters.Add_PointCloud(
+		NULL	, "PC_OUT"			, _TL("Point Cloud"),
+		_TL("The output point cloud"),
+		PARAMETER_OUTPUT
+	);
+
+	CSG_Parameter *pNode = Parameters.Add_Node(NULL, "NODE_AOI", _TL("AOI"), _TL("AOI Input Settings"));
+
+	Parameters.Add_Shapes(
+		pNode	, "AOI_SHP"			, _TL("Shape"),
+		_TL("Shapefile describing the AOI."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		pNode	, "AOI_GRID"		, _TL("Grid"),
+		_TL("Grid describing the AOI."),
+		PARAMETER_INPUT_OPTIONAL, false
+	);
+
+	Parameters.Add_Range(
+		pNode	, "AOI_XRANGE"		, _TL("X-Extent"),
+		_TL("Minimum and maximum x-coordinate of AOI."),
+		0.0, 0.0
+	);
+	Parameters.Add_Range(
+		pNode	, "AOI_YRANGE"		, _TL("Y-Extent"),
+		_TL("Minimum and maximum y-coordinate of AOI."),
+		0.0, 0.0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "AOI_ADD_OVERLAP"	, _TL("Add Overlap"),
+		_TL("Add overlap to AOI"),
+		PARAMETER_TYPE_Bool, false
+	);
+	Parameters.Add_Value(
+		Parameters("AOI_ADD_OVERLAP")	, "OVERLAP"	, _TL("Overlap"),
+		_TL("Overlap [map units]"),
+		PARAMETER_TYPE_Double,
+		50.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPointCloud_Get_Subset_SPCVF::On_Execute(void)
+{
+	CSG_String		sFileName;
+	CSG_PointCloud	*pPC_out;
+	CSG_Shapes		*pShapes;
+	CSG_Grid		*pGrid;
+	double			dAoiXMin, dAoiYMin, dAoiXMax, dAoiYMax;
+	bool			bAddOverlap;
+	double			dOverlap;
+
+	CSG_Rect		AOI;
+	CSG_MetaData	SPCVF;
+	CSG_String		sPathSPCVF;
+	double			dBBoxXMin, dBBoxYMin, dBBoxXMax, dBBoxYMax;
+	CSG_Rect		BBoxSPCVF;
+
+
+	//-----------------------------------------------------
+	sFileName	= Parameters("FILENAME")->asString();
+	pPC_out		= Parameters("PC_OUT")->asPointCloud();
+
+	pShapes		= Parameters("AOI_SHP")->asShapes();
+	pGrid		= Parameters("AOI_GRID")->asGrid();
+	dAoiXMin	= Parameters("AOI_XRANGE")->asRange()->Get_LoVal();
+	dAoiXMax	= Parameters("AOI_XRANGE")->asRange()->Get_HiVal();
+	dAoiYMin	= Parameters("AOI_YRANGE")->asRange()->Get_LoVal();
+	dAoiYMax	= Parameters("AOI_YRANGE")->asRange()->Get_HiVal();
+
+	bAddOverlap	= Parameters("AOI_ADD_OVERLAP")->asBool();
+	dOverlap	= Parameters("OVERLAP")->asDouble();
+
+
+	//-----------------------------------------------------
+	if( pShapes == NULL && pGrid == NULL && (dAoiXMin == dAoiXMax || dAoiYMin == dAoiYMax) )
+	{
+		SG_UI_Msg_Add_Error(_TL("Please provide a valid AOI!"));
+		return( false );
+	}
+
+	if( pShapes != NULL )
+	{
+		if( pShapes->Get_Selection_Count() > 0 )
+		{
+			AOI = pShapes->Get_Selection(0)->Get_Extent();
+
+			for(int i=1; i<pShapes->Get_Selection_Count(); i++)
+			{
+				AOI.Union(pShapes->Get_Selection(i)->Get_Extent());
+			}
+		}
+		else
+		{
+			AOI = pShapes->Get_Extent();
+		}
+	}
+	else if( pGrid != NULL )
+	{
+		AOI = pGrid->Get_System().Get_Extent();
+	}
+	else
+	{
+		AOI.Assign(dAoiXMin, dAoiYMin, dAoiXMax, dAoiYMax);
+	}
+
+	if( bAddOverlap )
+	{
+		AOI.Inflate(dOverlap, false);
+	}
+
+
+	//-----------------------------------------------------
+	if( !SPCVF.Create(sFileName) || SPCVF.Get_Name().CmpNoCase(SG_T("SPCVFDataset")) )
+	{
+		SG_UI_Msg_Add_Error(_TL("Please provide a valid *.scpvf file!"));
+		return( false );
+	}
+
+
+	//-----------------------------------------------------
+	CSG_String	sMethodPaths;
+	SPCVF.Get_Property(SG_T("Paths"), sMethodPaths);
+
+	if( !sMethodPaths.CmpNoCase(SG_T("absolute")) )
+	{
+		sPathSPCVF = SG_T("");
+	}
+	else if( !sMethodPaths.CmpNoCase(SG_T("relative")) )
+	{
+		sPathSPCVF = SG_File_Get_Path(sFileName);
+		sPathSPCVF.Replace(SG_T("\\"), SG_T("/"));
+	}
+	else
+	{
+		SG_UI_Msg_Add_Error(_TL("Encountered invalid path description in *.spcvf file!"));
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	SPCVF.Get_Child(SG_T("BBox"))->Get_Property(SG_T("XMin"), dBBoxXMin);
+	SPCVF.Get_Child(SG_T("BBox"))->Get_Property(SG_T("YMin"), dBBoxYMin);
+	SPCVF.Get_Child(SG_T("BBox"))->Get_Property(SG_T("XMax"), dBBoxXMax);
+	SPCVF.Get_Child(SG_T("BBox"))->Get_Property(SG_T("YMax"), dBBoxYMax);
+	BBoxSPCVF.Assign(dBBoxXMin, dBBoxYMin, dBBoxXMax, dBBoxYMax);
+
+	if( !AOI.Intersect(BBoxSPCVF) )
+	{
+		SG_UI_Msg_Add(_TL("AOI does not intersect bounding box of SPCVF, nothing to do!"), true);
+		return( true );
+	}
+
+
+	//-----------------------------------------------------
+	CSG_MetaData	*pDatasets = SPCVF.Get_Child(SG_T("Datasets"));
+
+	CSG_Strings		sFilePaths;
+
+	for(int i=0; i<pDatasets->Get_Children_Count(); i++)
+	{
+		CSG_MetaData	*pDataset	= pDatasets->Get_Child(i);
+		CSG_MetaData	*pBBox		= pDataset->Get_Child(SG_T("BBox"));
+
+		pBBox->Get_Property(SG_T("XMin"), dBBoxXMin);
+		pBBox->Get_Property(SG_T("YMin"), dBBoxYMin);
+		pBBox->Get_Property(SG_T("XMax"), dBBoxXMax);
+		pBBox->Get_Property(SG_T("YMax"), dBBoxYMax);
+
+		CSG_Rect BBox(dBBoxXMin, dBBoxYMin, dBBoxXMax, dBBoxYMax);
+
+		if( AOI.Intersects(BBox) )
+		{
+			CSG_String sFilePath;
+
+			pDataset->Get_Property(SG_T("File"), sFilePath);
+			sFilePath.Prepend(sPathSPCVF);
+
+			sFilePaths.Add(sFilePath);
+		}
+	}
+
+	if( sFilePaths.Get_Count() == 0 )
+	{
+		SG_UI_Msg_Add(_TL("AOI does not intersect with any bounding box of the SPCVF datasets, nothing to do!"), true);
+		return( true );
+	}
+
+
+	//-----------------------------------------------------
+	int iDatasets = 0;
+
+	for(int i=0; i<sFilePaths.Get_Count() && Set_Progress(i, sFilePaths.Get_Count()); i++)
+	{
+		CSG_PointCloud	*pPC = SG_Create_PointCloud(sFilePaths.Get_String(i));
+
+		if( i == 0 )
+		{
+			pPC_out->Create(pPC);
+		}
+
+		bool bFound = false;
+
+		for(int iPoint=0; iPoint<pPC->Get_Count(); iPoint++)
+		{
+			if( AOI.Contains(pPC->Get_X(iPoint), pPC->Get_Y(iPoint)) )
+			{
+				pPC_out->Add_Point(pPC->Get_X(iPoint), pPC->Get_Y(iPoint), pPC->Get_Z(iPoint));
+
+				for(int iField=0; iField<pPC->Get_Attribute_Count(); iField++)
+				{
+					pPC_out->Set_Attribute(iPoint, iField, pPC->Get_Attribute(iPoint, iField));
+				}
+
+				bFound = true;
+			}
+		}
+
+		if( bFound )
+		{
+			iDatasets++;
+		}
+
+		delete( pPC );
+	}
+
+	if( pPC_out->Get_Count() == 0 )
+	{
+		SG_UI_Msg_Add(_TL("AOI does not intersect with any point of the SPCVF datasets, nothing to do!"), true);
+		return( true );
+	}
+
+
+	//---------------------------------------------------------
+	SG_UI_Msg_Add(CSG_String::Format(_TL("%d points from %d dataset(s) written to output point cloud."), pPC_out->Get_Count(), iDatasets), true);
+
+	CSG_Parameters	sParms;
+	DataObject_Get_Parameters(pPC_out, sParms);
+
+	if( sParms("METRIC_ZRANGE") )
+	{
+		sParms("METRIC_ZRANGE")->asRange()->Set_Range(pPC_out->Get_Minimum(2), pPC_out->Get_Maximum(2));
+	}
+
+	DataObject_Set_Parameters(pPC_out, sParms);
+	pPC_out->Set_Name(CSG_String::Format(SG_T("pc_subset_%s"), SG_File_Get_Name(sFileName, false).c_str()));
+	DataObject_Update(pPC_out);
+
+	return( true );
+}
+
+
+//---------------------------------------------------------
+int CPointCloud_Get_Subset_SPCVF::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AOI_ADD_OVERLAP")) )
+	{
+		pParameters->Get_Parameter("OVERLAP")->Set_Enabled(pParameter->asBool());
+	}
+
+	//-----------------------------------------------------
+	return (1);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_virtual/pc_get_subset_spcvf.h b/src/modules/io/io_virtual/pc_get_subset_spcvf.h
new file mode 100644
index 0000000..2326cce
--- /dev/null
+++ b/src/modules/io/io_virtual/pc_get_subset_spcvf.h
@@ -0,0 +1,113 @@
+/**********************************************************
+ * Version $Id: pc_get_subset_spcvf.h 1976 2014-02-09 15:05:12Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 pc_get_subset_spcvf.h                 //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata.at                  //
+//                                                       //
+//    contact:    LASERDATA GmbH                         //
+//                Management and Analysis of             //
+//                Laserscanning Data                     //
+//                Technikerstr. 21a                      //
+//                6020 Innsbruck                         //
+//                Austria                                //
+//                www.laserdata.at                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__pc_get_subset_spcvf_H
+#define HEADER_INCLUDED__pc_get_subset_spcvf_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPointCloud_Get_Subset_SPCVF : public CSG_Module
+{
+public:
+	CPointCloud_Get_Subset_SPCVF(void);
+
+	virtual CSG_String			Get_MenuPath		(void)	{	return( _TL("R:Point Cloud") );	}
+
+
+protected:
+
+	virtual bool				On_Execute			(void);
+
+	virtual int					On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__pc_get_subset_spcvf_H
diff --git a/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp
new file mode 100644
index 0000000..564fcd7
--- /dev/null
+++ b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp
@@ -0,0 +1,225 @@
+/**********************************************************
+ * Version $Id: pc_tileshape_from_spcvf.cpp 2015 2014-02-25 14:32:09Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              pc_tileshape_from_spcvf.cpp              //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata.at                  //
+//                                                       //
+//    contact:    LASERDATA GmbH                         //
+//                Management and Analysis of             //
+//                Laserscanning Data                     //
+//                Technikerstr. 21a                      //
+//                6020 Innsbruck                         //
+//                Austria                                //
+//                www.laserdata.at                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "pc_tileshape_from_spcvf.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPointCloud_Create_Tileshape_From_SPCVF::CPointCloud_Create_Tileshape_From_SPCVF(void)
+{
+	Set_Name		(_TL("Create Tileshape from Virtual Point Cloud"));
+
+	Set_Author		(SG_T("V. Wichmann, LASERDATA GmbH (c) 2014"));
+
+	Set_Description	(_TW(
+		"The module allows to create a polygon shapefile with the "
+		"bounding boxes of a virtual point cloud dataset.\n"
+		"A virtual point cloud dataset is a simple XML format "
+		"with the file extension .spcvf, which can be created "
+		"with the 'Create Virtual Point Cloud Dataset' module.\n\n"
+	));
+
+
+	//-----------------------------------------------------
+	Parameters.Add_FilePath(
+		NULL	, "FILENAME"		, _TL("Filename"),
+		_TL("The full path and name of the .spcvf file"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s"),
+			_TL("SAGA Point Cloud Virtual Format (*.spcvf)")	, SG_T("*.spcvf"),
+			_TL("All Files")									, SG_T("*.*")
+		)
+ 	);
+
+	Parameters.Add_Shapes(
+		NULL	, "TILE_SHP"		, _TL("Tileshape"),
+		_TL("Polygon shapefile describing the bounding boxes of spcvf tiles."),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPointCloud_Create_Tileshape_From_SPCVF::On_Execute(void)
+{
+	CSG_String		sFileName;
+	CSG_Shapes		*pShapes;
+
+	CSG_MetaData	SPCVF;
+	CSG_String		sPathSPCVF, sFilePath;
+	int				iPoints;
+	double			dBBoxXMin, dBBoxYMin, dBBoxXMax, dBBoxYMax;
+
+
+	//-----------------------------------------------------
+	sFileName	= Parameters("FILENAME")->asString();
+	pShapes		= Parameters("TILE_SHP")->asShapes();
+	
+
+	//-----------------------------------------------------
+	if( !SPCVF.Create(sFileName) || SPCVF.Get_Name().CmpNoCase(SG_T("SPCVFDataset")) )
+	{
+		SG_UI_Msg_Add_Error(_TL("Please provide a valid *.scpvf file!"));
+		return( false );
+	}
+
+
+	//-----------------------------------------------------
+	CSG_String	sMethodPaths;
+	SPCVF.Get_Property(SG_T("Paths"), sMethodPaths);
+
+	if( !sMethodPaths.CmpNoCase(SG_T("absolute")) )
+	{
+		sPathSPCVF = SG_T("");
+	}
+	else if( !sMethodPaths.CmpNoCase(SG_T("relative")) )
+	{
+		sPathSPCVF = SG_File_Get_Path(sFileName);
+		sPathSPCVF.Replace(SG_T("\\"), SG_T("/"));
+	}
+	else
+	{
+		SG_UI_Msg_Add_Error(_TL("Encountered invalid path description in *.spcvf file!"));
+		return( false );
+	}
+
+
+	//-----------------------------------------------------
+	pShapes->Destroy();
+
+	pShapes->Add_Field(_TL("ID"),		SG_DATATYPE_Int);
+	pShapes->Add_Field(_TL("Filepath"),	SG_DATATYPE_String);
+	pShapes->Add_Field(_TL("File"),		SG_DATATYPE_String);
+	pShapes->Add_Field(_TL("Points"),	SG_DATATYPE_Int);
+
+	pShapes->Set_Name(CSG_String::Format(_TL("Tileshape_%s"), SG_File_Get_Name(sFileName, false).c_str()));
+
+
+	//-----------------------------------------------------
+	CSG_MetaData	*pDatasets = SPCVF.Get_Child(SG_T("Datasets"));
+
+	for(int i=0; i<pDatasets->Get_Children_Count(); i++)
+	{
+		CSG_MetaData	*pDataset	= pDatasets->Get_Child(i);
+		CSG_MetaData	*pBBox		= pDataset->Get_Child(SG_T("BBox"));
+
+		pDataset->Get_Property(SG_T("File"), sFilePath);
+
+		pDataset->Get_Property(SG_T("Points"), iPoints);
+
+		pBBox->Get_Property(SG_T("XMin"), dBBoxXMin);
+		pBBox->Get_Property(SG_T("YMin"), dBBoxYMin);
+		pBBox->Get_Property(SG_T("XMax"), dBBoxXMax);
+		pBBox->Get_Property(SG_T("YMax"), dBBoxYMax);
+
+		//-----------------------------------------------------
+		CSG_Shape	*pShape = pShapes->Add_Shape();
+
+		pShape->Add_Point(dBBoxXMin, dBBoxYMin);
+		pShape->Add_Point(dBBoxXMin, dBBoxYMax);
+		pShape->Add_Point(dBBoxXMax, dBBoxYMax);
+		pShape->Add_Point(dBBoxXMax, dBBoxYMin);
+
+		pShape->Set_Value(0, i + 1);
+
+		if( sPathSPCVF.Length() == 0 )	// absolute paths
+		{
+			pShape->Set_Value(1, sFilePath.BeforeLast('/'));
+			pShape->Set_Value(2, sFilePath.AfterLast('/'));
+		}
+		else							// relative paths
+		{
+			pShape->Set_Value(1, sPathSPCVF);
+			pShape->Set_Value(2, sFilePath);
+		}
+
+		pShape->Set_Value(3, iPoints);
+	}
+
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+//---------------------------------------------------------
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h
new file mode 100644
index 0000000..203dbb3
--- /dev/null
+++ b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h
@@ -0,0 +1,111 @@
+/**********************************************************
+ * Version $Id: pc_tileshape_from_spcvf.h 2012 2014-02-24 13:55:07Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      io_virtual                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               pc_tileshape_from_spcvf.h               //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata.at                  //
+//                                                       //
+//    contact:    LASERDATA GmbH                         //
+//                Management and Analysis of             //
+//                Laserscanning Data                     //
+//                Technikerstr. 21a                      //
+//                6020 Innsbruck                         //
+//                Austria                                //
+//                www.laserdata.at                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__pc_tileshape_from_spcvf_H
+#define HEADER_INCLUDED__pc_tileshape_from_spcvf_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPointCloud_Create_Tileshape_From_SPCVF : public CSG_Module
+{
+public:
+	CPointCloud_Create_Tileshape_From_SPCVF(void);
+
+	virtual CSG_String			Get_MenuPath		(void)	{	return( _TL("R:Point Cloud") );	}
+
+
+protected:
+
+	virtual bool				On_Execute			(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__pc_tileshape_from_spcvf_H
diff --git a/src/modules/pointcloud/Makefile.in b/src/modules/pointcloud/Makefile.in
index c204216..5727381 100644
--- a/src/modules/pointcloud/Makefile.in
+++ b/src/modules/pointcloud/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -279,11 +303,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -347,6 +371,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -410,6 +438,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -445,13 +487,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -486,10 +525,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -567,22 +611,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/pointcloud/pointcloud_tools/Makefile.in b/src/modules/pointcloud/pointcloud_tools/Makefile.in
index 758c2ca..665dcfa 100644
--- a/src/modules/pointcloud/pointcloud_tools/Makefile.in
+++ b/src/modules/pointcloud/pointcloud_tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/pointcloud/pointcloud_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libpointcloud_tools_la_DEPENDENCIES =  \
@@ -106,6 +129,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libpointcloud_tools_la_SOURCES)
 DIST_SOURCES = $(libpointcloud_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -131,6 +159,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -158,6 +187,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -170,6 +200,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -199,6 +230,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -232,7 +264,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -328,7 +359,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -336,6 +366,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -351,13 +383,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libpointcloud_tools.la: $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libpointcloud_tools.la: $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_DEPENDENCIES) $(EXTRA_libpointcloud_tools_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -456,6 +490,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -506,10 +554,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -595,18 +648,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp b/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp
index 6b3af85..e260f82 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_attribute_calculator.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_attribute_calculator.cpp 2025 2014-02-27 12:51:31Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -136,6 +136,12 @@ CPC_Attribute_Calculator::CPC_Attribute_Calculator(void)
 		), 7
 	);
 
+	Parameters.Add_Value(
+		NULL	, "USE_NODATA"	, _TL("Use NoData"),
+		_TL("Check this in order to include NoData points in the calculation."),
+		PARAMETER_TYPE_Bool, false
+	);
+
 }
 
 
@@ -155,11 +161,13 @@ bool CPC_Attribute_Calculator::On_Execute(void)
 {
 	CSG_PointCloud	*pInput, *pResult;
 	TSG_Data_Type	Type;
+	bool			bUseNoData;
 
 
 	//---------------------------------------------------------
 	pInput		= Parameters("PC_IN")->asPointCloud();
 	pResult		= Parameters("PC_OUT")->asPointCloud();
+	bUseNoData	= Parameters("USE_NODATA")->asBool();
 
 	switch( Parameters("TYPE")->asInt() )
 	{
@@ -237,13 +245,13 @@ bool CPC_Attribute_Calculator::On_Execute(void)
 		bool	bOkay	= true;
 
 		pResult->Add_Point(pInput->Get_X(i), pInput->Get_Y(i), pInput->Get_Z(i));
-		
+
 		for( int iField=2; iField<pInput->Get_Field_Count(); iField++ )
 			pResult->Set_Value(i, iField, pInput->Get_Value(i, iField));
 
 		for( int iField=0; iField<nFields && bOkay; iField++ )
 		{
-			if( !pInput->is_NoData(i, pFields[iField]) )
+			if( !pInput->is_NoData(i, pFields[iField]) || bUseNoData )
 			{
 				Values[iField]	= pInput->Get_Value(i, pFields[iField]);
 			}
@@ -335,4 +343,4 @@ int CPC_Attribute_Calculator::On_Parameter_Changed(CSG_Parameters *pParameters,
 
     return (true);
 
-}
\ No newline at end of file
+}
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp b/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp
index f59d5b6..e6545f8 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_cut.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_cut.cpp 1983 2014-02-11 15:55:25Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -137,13 +137,13 @@ CPC_Cut::CPC_Cut(void)
 	// Shapes Extent
 
 	pParameters	= Add_Parameters	(	   "EXTENT"		, _TL("Shapes Extent")		, _TL(""));
-	pParameters	->Add_Shapes		(NULL, "EXTENT"		, _TL("Shapes Extent")		, _TL(""), PARAMETER_INPUT);
+	pParameters	->Add_Shapes		(NULL, "EXTENT"		, _TL("Shapes Extent")		, _TL(""), PARAMETER_INPUT_OPTIONAL);
 
 	//-----------------------------------------------------
 	// Polygons
 
 	pParameters	= Add_Parameters	(	   "POLYGONS"	, _TL("Polygons")			, _TL(""));
-	pParameters	->Add_Shapes		(NULL, "POLYGONS"	, _TL("Polygons")			, _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon);
+	pParameters	->Add_Shapes		(NULL, "POLYGONS"	, _TL("Polygons")			, _TL(""), PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Polygon);
 }
 
 
@@ -186,6 +186,13 @@ bool CPC_Cut::On_Execute(void)
 	case 2:	// Shapes Extent
 		if( Dlg_Parameters("EXTENT") )
 		{
+			if( Get_Parameters("EXTENT")->Get_Parameter("EXTENT")->asShapes() == NULL )
+			{
+				SG_UI_Msg_Add_Error(_TL("Please provide a shapefile with the 'Shapes Extent' parameter!"));
+
+				return( false );
+			}
+
 			return( Get_Cut(pPoints, pCut, Get_Parameters("EXTENT")->Get_Parameter("EXTENT")->asShapes()->Get_Extent(), Parameters("INVERSE")->asBool()) );
 		}
 		break;
@@ -194,6 +201,13 @@ bool CPC_Cut::On_Execute(void)
 	case 3:	// Polygons
 		if( Dlg_Parameters("POLYGONS") )
 		{
+			if( Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes() == NULL )
+			{
+				SG_UI_Msg_Add_Error(_TL("Please provide a shapefile with the 'Polygons' parameter!"));
+
+				return( false );
+			}
+
 			if( Parameters("INVERSE")->asBool() && Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes()->Get_Count() > 1 )
 			{
 				SG_UI_Msg_Add_Error(_TL("The inverse selection is not implemented for input shapefiles with more than one polygon!"));
diff --git a/src/modules/pointcloud/pointcloud_viewer/Makefile.in b/src/modules/pointcloud/pointcloud_viewer/Makefile.in
index ebd688d..a8b4702 100644
--- a/src/modules/pointcloud/pointcloud_viewer/Makefile.in
+++ b/src/modules/pointcloud/pointcloud_viewer/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/pointcloud/pointcloud_viewer
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libpointcloud_viewer_la_DEPENDENCIES =  \
@@ -106,6 +129,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libpointcloud_viewer_la_SOURCES)
 DIST_SOURCES = $(libpointcloud_viewer_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -131,6 +159,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -158,6 +187,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -170,6 +200,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -199,6 +230,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -232,7 +264,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -311,7 +342,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -319,6 +349,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -334,13 +366,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libpointcloud_viewer.la: $(libpointcloud_viewer_la_OBJECTS) $(libpointcloud_viewer_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libpointcloud_viewer.la: $(libpointcloud_viewer_la_OBJECTS) $(libpointcloud_viewer_la_DEPENDENCIES) $(EXTRA_libpointcloud_viewer_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libpointcloud_viewer_la_OBJECTS) $(libpointcloud_viewer_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -431,6 +465,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -481,10 +529,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -570,18 +623,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp b/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp
index 3f9a375..4885fa6 100644
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: points_view_control.cpp 2052 2014-03-12 14:47:06Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -359,7 +359,10 @@ void CPoints_View_Control::On_Mouse_LDown(wxMouseEvent &event)
 	m_xDown			= m_zRotate;
 	m_yDown			= m_xRotate;
 
-	CaptureMouse();
+	if( !HasCapture() )
+	{
+		CaptureMouse();
+	}
 }
 
 void CPoints_View_Control::On_Mouse_LUp(wxMouseEvent &event)
@@ -389,7 +392,10 @@ void CPoints_View_Control::On_Mouse_RDown(wxMouseEvent &event)
 	m_xDown			= m_xShift;
 	m_yDown			= m_yShift;
 
-	CaptureMouse();
+	if( !HasCapture() )
+	{
+		CaptureMouse();
+	}
 }
 
 void CPoints_View_Control::On_Mouse_RUp(wxMouseEvent &event)
@@ -419,7 +425,10 @@ void CPoints_View_Control::On_Mouse_MDown(wxMouseEvent &event)
 	m_xDown			= m_yRotate;
 	m_yDown			= m_zShift;
 
-	CaptureMouse();
+	if( !HasCapture() )
+	{
+		CaptureMouse();
+	}
 }
 
 void CPoints_View_Control::On_Mouse_MUp(wxMouseEvent &event)
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp b/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp
index a9be43c..7179b97 100644
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_dialog.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: points_view_dialog.cpp 1928 2014-01-10 12:10:05Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,7 +9,7 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//            geostatistics_kriging_variogram            //
+//					point_cloud_viewer			         //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
diff --git a/src/modules/projection/Makefile.am b/src/modules/projection/Makefile.am
new file mode 100644
index 0000000..6aaaf5a
--- /dev/null
+++ b/src/modules/projection/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = pj_georeference pj_proj4
diff --git a/src/modules/projection/Makefile.in b/src/modules/projection/Makefile.in
new file mode 100644
index 0000000..a6b0446
--- /dev/null
+++ b/src/modules/projection/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/projection
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = pj_georeference pj_proj4
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/projection/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/projection/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Collect_Points.cpp b/src/modules/projection/pj_georeference/Collect_Points.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Collect_Points.cpp
rename to src/modules/projection/pj_georeference/Collect_Points.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Collect_Points.h b/src/modules/projection/pj_georeference/Collect_Points.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Collect_Points.h
rename to src/modules/projection/pj_georeference/Collect_Points.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.cpp b/src/modules/projection/pj_georeference/Georef_Engine.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.cpp
rename to src/modules/projection/pj_georeference/Georef_Engine.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.h b/src/modules/projection/pj_georeference/Georef_Engine.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.h
rename to src/modules/projection/pj_georeference/Georef_Engine.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.cpp b/src/modules/projection/pj_georeference/Georef_Grid.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.cpp
rename to src/modules/projection/pj_georeference/Georef_Grid.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.h b/src/modules/projection/pj_georeference/Georef_Grid.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.h
rename to src/modules/projection/pj_georeference/Georef_Grid.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.cpp b/src/modules/projection/pj_georeference/Georef_Shapes.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.cpp
rename to src/modules/projection/pj_georeference/Georef_Shapes.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.h b/src/modules/projection/pj_georeference/Georef_Shapes.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.h
rename to src/modules/projection/pj_georeference/Georef_Shapes.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.cpp b/src/modules/projection/pj_georeference/MLB_Interface.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.cpp
rename to src/modules/projection/pj_georeference/MLB_Interface.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.h b/src/modules/projection/pj_georeference/MLB_Interface.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.h
rename to src/modules/projection/pj_georeference/MLB_Interface.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Makefile.am b/src/modules/projection/pj_georeference/Makefile.am
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/Makefile.am
rename to src/modules/projection/pj_georeference/Makefile.am
diff --git a/src/modules/projection/pj_georeference/Makefile.in b/src/modules/projection/pj_georeference/Makefile.in
new file mode 100644
index 0000000..775c0cb
--- /dev/null
+++ b/src/modules/projection/pj_georeference/Makefile.in
@@ -0,0 +1,652 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/projection/pj_georeference
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libpj_georeference_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libpj_georeference_la_OBJECTS = Collect_Points.lo \
+	direct_georeferencing.lo Georef_Engine.lo Georef_Grid.lo \
+	georef_grid_move.lo Georef_Shapes.lo MLB_Interface.lo \
+	set_grid_georeference.lo
+libpj_georeference_la_OBJECTS = $(am_libpj_georeference_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libpj_georeference_la_SOURCES)
+DIST_SOURCES = $(libpj_georeference_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1843 2013-09-18 10:49:15Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@DEP_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) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libpj_georeference.la
+libpj_georeference_la_SOURCES = \
+Collect_Points.cpp\
+direct_georeferencing.cpp\
+Georef_Engine.cpp\
+Georef_Grid.cpp\
+georef_grid_move.cpp\
+Georef_Shapes.cpp\
+MLB_Interface.cpp\
+set_grid_georeference.cpp\
+Collect_Points.h\
+direct_georeferencing.h\
+Georef_Engine.h\
+Georef_Grid.h\
+georef_grid_move.h\
+Georef_Shapes.h\
+MLB_Interface.h\
+set_grid_georeference.h
+
+libpj_georeference_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/projection/pj_georeference/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/projection/pj_georeference/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libpj_georeference.la: $(libpj_georeference_la_OBJECTS) $(libpj_georeference_la_DEPENDENCIES) $(EXTRA_libpj_georeference_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libpj_georeference_la_OBJECTS) $(libpj_georeference_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Collect_Points.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Georef_Engine.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Georef_Grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Georef_Shapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/direct_georeferencing.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/georef_grid_move.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/set_grid_georeference.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_projection/pj_georeference/pj_georeference/direct_georeferencing.cpp b/src/modules/projection/pj_georeference/direct_georeferencing.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/direct_georeferencing.cpp
rename to src/modules/projection/pj_georeference/direct_georeferencing.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/direct_georeferencing.h b/src/modules/projection/pj_georeference/direct_georeferencing.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/direct_georeferencing.h
rename to src/modules/projection/pj_georeference/direct_georeferencing.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.cpp b/src/modules/projection/pj_georeference/georef_grid_move.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.cpp
rename to src/modules/projection/pj_georeference/georef_grid_move.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.h b/src/modules/projection/pj_georeference/georef_grid_move.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.h
rename to src/modules/projection/pj_georeference/georef_grid_move.h
diff --git a/src/modules_projection/pj_georeference/pj_georeference/set_grid_georeference.cpp b/src/modules/projection/pj_georeference/set_grid_georeference.cpp
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/set_grid_georeference.cpp
rename to src/modules/projection/pj_georeference/set_grid_georeference.cpp
diff --git a/src/modules_projection/pj_georeference/pj_georeference/set_grid_georeference.h b/src/modules/projection/pj_georeference/set_grid_georeference.h
similarity index 100%
rename from src/modules_projection/pj_georeference/pj_georeference/set_grid_georeference.h
rename to src/modules/projection/pj_georeference/set_grid_georeference.h
diff --git a/src/modules/projection/pj_proj4/MLB_Interface.cpp b/src/modules/projection/pj_proj4/MLB_Interface.cpp
new file mode 100644
index 0000000..531c7de
--- /dev/null
+++ b/src/modules/projection/pj_proj4/MLB_Interface.cpp
@@ -0,0 +1,158 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//			The Module Link Library Interface			 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// 1. Include the appropriate SAGA-API header...
+
+#include "crs_transform.h"
+
+
+//---------------------------------------------------------
+// 2. Place general module library informations here...
+
+CSG_String Get_Info(int i)
+{
+	switch( i )
+	{
+	case MLB_INFO_Name:	default:
+		return( _TL("Projection - Proj.4") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O. Conrad (c) 2004-14") );
+
+	case MLB_INFO_Description:
+		return( CSG_CRSProjector::Get_Description() );
+
+	case MLB_INFO_Version:
+		return( _TL("2.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Projection") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "crs_assign.h"
+#include "crs_transform_shapes.h"
+#include "crs_transform_grid.h"
+
+#include "PROJ4_Shapes.h"
+#include "PROJ4_Grid.h"
+
+#include "gcs_lon_range.h"
+
+#include "gcs_graticule.h"
+
+#include "crs_indicatrix.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CCRS_Assign() );
+	case  1:	return( new CCRS_Transform_Shapes(true ) );
+	case  2:	return( new CCRS_Transform_Shapes(false) );
+	case  3:	return( new CCRS_Transform_Grid  (true ) );
+	case  4:	return( new CCRS_Transform_Grid  (false) );
+
+	case  5:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_SIMPLE, false) );
+	case  6:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_DIALOG, false) );
+	case  7:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_SIMPLE, false) );
+	case  8:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_DIALOG, false) );
+	case  9:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_SIMPLE, true) );
+	case 10:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_DIALOG, true) );
+	case 11:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_SIMPLE, true) );
+	case 12:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_DIALOG, true) );
+
+	case 13:	return( new CGCS_Grid_Longitude_Range() );
+
+	case 14:	return( new CGCS_Graticule() );
+
+	case 15:	return( new CCRS_Picker() );
+
+	case 16:	return( new CCRS_Indicatrix() );
+
+	case 20:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.h b/src/modules/projection/pj_proj4/MLB_Interface.h
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.h
rename to src/modules/projection/pj_proj4/MLB_Interface.h
diff --git a/src/modules/projection/pj_proj4/Makefile.am b/src/modules/projection/pj_proj4/Makefile.am
new file mode 100644
index 0000000..7acc2e1
--- /dev/null
+++ b/src/modules/projection/pj_proj4/Makefile.am
@@ -0,0 +1,42 @@
+#
+# $Id: Makefile.am 1443 2012-07-10 10:29:32Z oconrad $
+#
+DEP_LIBS = -lproj
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_DEFS = -D_SAGA_UNICODE
+endif
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS)
+AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = -fPIC -shared -avoid-version $(DEP_LIBS) $(LOCAL_LIBS)
+pkglib_LTLIBRARIES = libpj_proj4.la
+libpj_proj4_la_SOURCES =\
+MLB_Interface.cpp\
+crs_assign.cpp\
+crs_base.cpp\
+crs_indicatrix.cpp\
+crs_transform.cpp\
+crs_transform_grid.cpp\
+crs_transform_shapes.cpp\
+gcs_graticule.cpp\
+gcs_lon_range.cpp\
+PROJ4_Base.cpp\
+PROJ4_Grid.cpp\
+PROJ4_Shapes.cpp\
+MLB_Interface.h\
+crs_assign.h\
+crs_base.h\
+crs_indicatrix.h\
+crs_transform.h\
+crs_transform_grid.h\
+crs_transform_shapes.h\
+gcs_graticule.h\
+gcs_lon_range.h\
+PROJ4_Base.h\
+PROJ4_Grid.h\
+PROJ4_Shapes.h
+
+libpj_proj4_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules/projection/pj_proj4/Makefile.in b/src/modules/projection/pj_proj4/Makefile.in
new file mode 100644
index 0000000..bf8f7fb
--- /dev/null
+++ b/src/modules/projection/pj_proj4/Makefile.in
@@ -0,0 +1,665 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/projection/pj_proj4
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libpj_proj4_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libpj_proj4_la_OBJECTS = MLB_Interface.lo crs_assign.lo crs_base.lo \
+	crs_indicatrix.lo crs_transform.lo crs_transform_grid.lo \
+	crs_transform_shapes.lo gcs_graticule.lo gcs_lon_range.lo \
+	PROJ4_Base.lo PROJ4_Grid.lo PROJ4_Shapes.lo
+libpj_proj4_la_OBJECTS = $(am_libpj_proj4_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libpj_proj4_la_SOURCES)
+DIST_SOURCES = $(libpj_proj4_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1443 2012-07-10 10:29:32Z oconrad $
+#
+DEP_LIBS = -lproj
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@DEP_DEFS = -D_SAGA_UNICODE
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS)
+AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS) $(LOCAL_LIBS)
+pkglib_LTLIBRARIES = libpj_proj4.la
+libpj_proj4_la_SOURCES = \
+MLB_Interface.cpp\
+crs_assign.cpp\
+crs_base.cpp\
+crs_indicatrix.cpp\
+crs_transform.cpp\
+crs_transform_grid.cpp\
+crs_transform_shapes.cpp\
+gcs_graticule.cpp\
+gcs_lon_range.cpp\
+PROJ4_Base.cpp\
+PROJ4_Grid.cpp\
+PROJ4_Shapes.cpp\
+MLB_Interface.h\
+crs_assign.h\
+crs_base.h\
+crs_indicatrix.h\
+crs_transform.h\
+crs_transform_grid.h\
+crs_transform_shapes.h\
+gcs_graticule.h\
+gcs_lon_range.h\
+PROJ4_Base.h\
+PROJ4_Grid.h\
+PROJ4_Shapes.h
+
+libpj_proj4_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/projection/pj_proj4/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/projection/pj_proj4/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libpj_proj4.la: $(libpj_proj4_la_OBJECTS) $(libpj_proj4_la_DEPENDENCIES) $(EXTRA_libpj_proj4_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libpj_proj4_la_OBJECTS) $(libpj_proj4_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PROJ4_Base.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PROJ4_Grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PROJ4_Shapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_assign.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_base.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_indicatrix.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_transform.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_transform_grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_transform_shapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gcs_graticule.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gcs_lon_range.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.cpp b/src/modules/projection/pj_proj4/PROJ4_Base.cpp
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.cpp
rename to src/modules/projection/pj_proj4/PROJ4_Base.cpp
diff --git a/src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.h b/src/modules/projection/pj_proj4/PROJ4_Base.h
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.h
rename to src/modules/projection/pj_proj4/PROJ4_Base.h
diff --git a/src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.cpp b/src/modules/projection/pj_proj4/PROJ4_Grid.cpp
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.cpp
rename to src/modules/projection/pj_proj4/PROJ4_Grid.cpp
diff --git a/src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.h b/src/modules/projection/pj_proj4/PROJ4_Grid.h
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.h
rename to src/modules/projection/pj_proj4/PROJ4_Grid.h
diff --git a/src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.cpp b/src/modules/projection/pj_proj4/PROJ4_Shapes.cpp
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.cpp
rename to src/modules/projection/pj_proj4/PROJ4_Shapes.cpp
diff --git a/src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.h b/src/modules/projection/pj_proj4/PROJ4_Shapes.h
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.h
rename to src/modules/projection/pj_proj4/PROJ4_Shapes.h
diff --git a/src/modules/projection/pj_proj4/crs_assign.cpp b/src/modules/projection/pj_proj4/crs_assign.cpp
new file mode 100644
index 0000000..503be64
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_assign.cpp
@@ -0,0 +1,178 @@
+/**********************************************************
+ * Version $Id: crs_assign.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    crs_assign.cpp                     //
+//                                                       //
+//                 Copyright (C) 2010 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 "crs_assign.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCRS_Assign::CCRS_Assign(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Set Coordinate Reference System"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"The module allows to define the Coordinate Reference System (CRS) "
+		"of the supplied data sets. The module applies no transformation to "
+		"the data sets, it just updates their CRS metadata.\n"
+		"A complete and correct description of the CRS of a dataset is necessary "
+		"in order to be able to actually apply a projection with one of the "
+		"'Coordinate Transformation' modules later.\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"	, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Shapes_List(
+		NULL	, "SHAPES"	, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+//	Parameters.Add_TIN_List(
+//		NULL	, "TINS"	, _TL("TINs"),
+//		_TL(""),
+//		PARAMETER_INPUT_OPTIONAL
+//	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Assign::On_Execute(void)
+{
+	int	nTotal	= Parameters("GRIDS" )->asList()->Get_Count()
+				+ Parameters("SHAPES")->asList()->Get_Count();
+	//			+ Parameters("TINS"  )->asList()->Get_Count();
+
+	if( nTotal <= 0 )
+	{
+		Message_Dlg(_TL("nothing to do: no data in selection"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Projection	Projection;
+
+	if( !Get_Projection(Projection) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int	nProjected	= 0;
+
+	nProjected	+= Set_Projections(Projection, Parameters("GRIDS" )->asList());
+	nProjected	+= Set_Projections(Projection, Parameters("SHAPES")->asList());
+//	nProjected	+= Set_Projections(Projection, Parameters("TINS")  ->asList());
+
+	//-----------------------------------------------------
+	return( nProjected > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CCRS_Assign::Set_Projections(const CSG_Projection &Projection, CSG_Parameter_List *pList)
+{
+	int	nProjected	= 0;
+
+	for(int i=0; i<pList->Get_Count(); i++)
+	{
+		if( pList->asDataObject(i)->Get_Projection().Create(Projection) )
+		{
+			pList->asDataObject(i)->Set_Modified();
+
+			DataObject_Update(pList->asDataObject(i));
+
+			nProjected++;
+		}
+	}
+
+	return( nProjected );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_assign.h b/src/modules/projection/pj_proj4/crs_assign.h
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/crs_assign.h
rename to src/modules/projection/pj_proj4/crs_assign.h
diff --git a/src/modules/projection/pj_proj4/crs_base.cpp b/src/modules/projection/pj_proj4/crs_base.cpp
new file mode 100644
index 0000000..a621c97
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_base.cpp
@@ -0,0 +1,1100 @@
+/**********************************************************
+ * Version $Id: crs_base.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     crs_base.cpp                      //
+//                                                       //
+//                 Copyright (C) 2010 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 "crs_base.h"
+
+#include <projects.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCRS_Base::CCRS_Base(void)
+{
+	m_Projection.Create(4326);
+
+	CSG_Parameter	*pNode_0, *pNode_1;
+
+	//-----------------------------------------------------
+	if( SG_UI_Get_Window_Main() == NULL )
+	{
+		Parameters.Add_Choice(
+			NULL	, "CRS_METHOD"		, _TL("Get CRS Definition from..."),
+			_TL(""),
+			CSG_String::Format(SG_T("%s|%s|%s|"),
+				_TL("Proj4 Parameters"),
+				_TL("EPSG Code"),
+				_TL("Well Known Text File")
+			), 0
+		);
+	}
+
+	//-----------------------------------------------------
+	pNode_0	= Parameters.Add_String(
+		NULL	, "CRS_PROJ4"		, _TL("Proj4 Parameters"),
+		_TL(""),
+		m_Projection.Get_Proj4(), true
+	);
+
+	if( SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_Parameters(
+			pNode_0	, "CRS_DIALOG"		, _TL("User Defined"),
+			_TL("")
+		);
+
+		Set_User_Parameters(Parameters("CRS_DIALOG")->asParameters());
+	}
+
+	//-----------------------------------------------------
+	if( SG_UI_Get_Window_Main() )
+	{
+		pNode_1	= Parameters.Add_Parameters(pNode_0, "CRS_GRID"  , _TL("Loaded Grid")  , _TL(""));
+
+		pNode_1->asParameters()->Add_Grid(
+			NULL	, "PICK"	, _TL("Grid"),
+			_TL(""),
+			PARAMETER_INPUT_OPTIONAL, false
+		);
+
+		pNode_1	= Parameters.Add_Parameters(pNode_0, "CRS_SHAPES", _TL("Loaded Shapes"), _TL(""));
+
+		pNode_1->asParameters()->Add_Shapes(
+			NULL	, "PICK"	, _TL("Shapes"),
+			_TL(""),
+			PARAMETER_INPUT_OPTIONAL
+		);
+	}
+
+	//-----------------------------------------------------
+	Parameters.Add_FilePath(
+		pNode_0	, "CRS_FILE"		, _TL("Well Known Text File"),
+		_TL(""),
+		CSG_String::Format(
+			SG_T("%s|*.prj;*.wkt;*.txt|%s|*.prj|%s|*.wkt|%s|*.txt|%s|*.*"),
+			_TL("All Recognized Files"),
+			_TL("ESRI WKT Files (*.prj)"),
+			_TL("WKT Files (*.wkt)"),
+			_TL("Text Files (*.txt)"),
+			_TL("All Files")
+		)
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= Parameters.Add_Value(
+		pNode_0	, "CRS_EPSG"	, _TL("EPSG Code"),
+		_TL(""),
+		PARAMETER_TYPE_Int, m_Projection.Get_EPSG(), -1, true, 99999, true
+	);
+
+	if( SG_UI_Get_Window_Main() )
+	{
+		Parameters.Add_Choice(
+			pNode_1	, "CRS_EPSG_GEOGCS"	, _TL("Geographic Coordinate Systems"),
+			_TL(""),
+			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Geographic)
+		);
+
+		Parameters.Add_Choice(
+			pNode_1	, "CRS_EPSG_PROJCS"	, _TL("Projected Coordinate Systems"),
+			_TL(""),
+			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Projected)
+		);
+	}
+
+	//-----------------------------------------------------
+	Parameters.Add_Value(
+		NULL	, "PRECISE"		, _TL("Precise Datum Conversion"),
+		_TL("avoids precision problems when source and target crs use different geodedtic datums."),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Base::On_Before_Execution(void)
+{
+	m_Projection.Create(Parameters("CRS_PROJ4")->asString(), SG_PROJ_FMT_Proj4);
+
+	if( m_Projection.is_Okay() )
+	{
+		Set_User_Definition(*Parameters("CRS_DIALOG")->asParameters(), Parameters("CRS_PROJ4")->asString());
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int CCRS_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameters->Get_Identifier(), "CRS_DIALOG") )
+	{
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "PROJ_TYPE") )
+		{
+			pParameters->Get_Parameter("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[pParameter->asInt()].id)));
+		}
+
+		return( 1 );
+	}
+
+	//-----------------------------------------------------
+	CSG_Projection	Projection;
+
+	//-----------------------------------------------------
+	if( pParameters->Get_Parameter("CRS_PROJ4") )
+	{
+		Projection.Create(pParameter->asString(), SG_PROJ_FMT_Proj4);
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_DIALOG") )
+	{
+		Projection.Create(Get_User_Definition(*pParameter->asParameters()), SG_PROJ_FMT_Proj4);
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_FILE") )
+	{
+		Projection.Load(pParameter->asString());
+
+		pParameter->Set_Value(CSG_String(""));	// clear
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG") )
+	{
+		Projection.Create(pParameter->asInt());
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG_GEOGCS")
+	||	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG_PROJCS") )
+	{
+		int		EPSG;
+
+		if( pParameter->asChoice()->Get_Data(EPSG) )
+		{
+			Projection.Create(EPSG);
+		}
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_GRID")
+	||	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_SHAPES") )
+	{
+		CSG_Data_Object	*pPick	= pParameter->asParameters()->Get_Parameter("PICK")->asDataObject();
+
+		if( pPick && pPick->Get_Projection().is_Okay() )
+		{
+			Projection.Create(pPick->Get_Projection());
+		}
+	}
+
+	//-----------------------------------------------------
+	if( Projection.is_Okay() )
+	{
+		m_Projection	= Projection;
+
+		pParameters->Get_Parameter("CRS_PROJ4")->Set_Value(m_Projection.Get_Proj4());
+		pParameters->Get_Parameter("CRS_EPSG" )->Set_Value(m_Projection.Get_EPSG ());
+
+		if( pParameters->Get_Parameter("CRS_DIALOG") )
+		{
+			Set_User_Definition(*pParameters->Get_Parameter("CRS_DIALOG")->asParameters(), m_Projection.Get_Proj4());
+		}
+	}
+
+	//-----------------------------------------------------
+	return( 1 );
+}
+
+//---------------------------------------------------------
+int CCRS_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameters->Get_Identifier(), "CRS_DIALOG") )
+	{
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "PROJ_TYPE") )
+		{
+		//	pParameters->Get_Parameter("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[pParameter->asInt()].id)));
+
+			pParameters->Get_Parameter("OPTIONS")->Set_Enabled(pParameters->Get_Parameter("OPTIONS")->asParameters()->Get_Count() > 0);
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "DATUM_DEF") )
+		{
+			int		Value	= pParameter->asInt();
+
+			pParameters->Get_Parameter("DATUM"    )->Set_Enabled(Value == 0);
+			pParameters->Get_Parameter("ELLIPSOID")->Set_Enabled(Value == 1);
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "ELLIPSOID") )
+		{
+			int		Value	= pParameter->asInt();
+
+			pParameters->Get_Parameter("ELLPS_DEF")->Set_Enabled(Value == 0);
+			pParameters->Get_Parameter("ELLPS_A"  )->Set_Enabled(Value != 0);
+			pParameters->Get_Parameter("ELLPS_B"  )->Set_Enabled(Value == 1);
+			pParameters->Get_Parameter("ELLPS_F"  )->Set_Enabled(Value == 2);
+			pParameters->Get_Parameter("ELLPS_RF" )->Set_Enabled(Value == 3);
+			pParameters->Get_Parameter("ELLPS_E"  )->Set_Enabled(Value == 4);
+			pParameters->Get_Parameter("ELLPS_ES" )->Set_Enabled(Value == 5);
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "DATUM_SHIFT") )
+		{
+			int		Value	= pParameter->asInt();
+
+			pParameters->Get_Parameter("DS_DX"     )->Set_Enabled(Value == 1 || Value == 2);
+			pParameters->Get_Parameter("DS_DY"     )->Set_Enabled(Value == 1 || Value == 2);
+			pParameters->Get_Parameter("DS_DZ"     )->Set_Enabled(Value == 1 || Value == 2);
+			pParameters->Get_Parameter("DS_RX"     )->Set_Enabled(Value == 2);
+			pParameters->Get_Parameter("DS_RY"     )->Set_Enabled(Value == 2);
+			pParameters->Get_Parameter("DS_RZ"     )->Set_Enabled(Value == 2);
+			pParameters->Get_Parameter("DS_SC"     )->Set_Enabled(Value == 2);
+			pParameters->Get_Parameter("DATUM_GRID")->Set_Enabled(Value == 3);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Base::Get_Projection(CSG_Projection &Projection)
+{
+	if( Parameters("CRS_METHOD") )
+	{
+		switch( Parameters("CRS_METHOD")->asInt() )
+		{
+		case 0:	default:	// Proj4 Parameters
+			Projection.Create(Parameters("CRS_PROJ4")->asString(), SG_PROJ_FMT_Proj4);
+			break;
+
+		case 1:				// EPSG Code
+			Projection.Create(Parameters("CRS_EPSG" )->asInt());
+			break;
+
+		case 2:				// Well Known Text File
+			Projection.Load (Parameters("CRS_FILE"  )->asString());
+			break;
+		}
+	}
+	else
+	{
+		Projection	= m_Projection;
+	}
+
+	return( Projection.is_Okay() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define WGS84_ELLPS_A	6378137.000
+#define WGS84_ELLPS_B	6356752.314
+
+//---------------------------------------------------------
+bool CCRS_Base::Set_User_Parameters(CSG_Parameters *pParameters)
+{
+	CSG_Parameter	*pNode_0 = NULL, *pNode_1, *pNode_2;
+	CSG_String		sProjections, sName, sDescription, sArguments, sDatums, sEllipsoids, sUnits;
+
+	///////////////////////////////////////////////////////
+
+	// Projection -----------------------------------------
+	sDescription	= _TL("Available Projections:");
+
+	for(struct PJ_LIST *pProjection=pj_list; pProjection->id; ++pProjection)
+	{
+		sArguments		= *pProjection->descr;
+		sName			= sArguments.BeforeFirst('\n');
+		sArguments		= sArguments.AfterFirst ('\n').AfterFirst('\n').AfterFirst('\t');
+
+		sProjections	+= CSG_String::Format(SG_T("{%s}%s|")       , SG_STR_MBTOSG(pProjection->id), sName.c_str());
+		sDescription	+= CSG_String::Format(SG_T("\n[%s] %s (%s)"), SG_STR_MBTOSG(pProjection->id), sName.c_str(), sArguments.c_str());
+
+		Add_User_Projection(pProjection->id, sName, sArguments);
+	}
+
+	// Datums ---------------------------------------------
+	for(struct PJ_DATUMS *pDatum=pj_datums; pDatum->id; ++pDatum)
+	{
+		CSG_String	id      (pDatum->id);
+		CSG_String	comments(pDatum->comments);
+
+		sDatums	+= CSG_String::Format(SG_T("{%s}%s|"), id.c_str(), comments.Length() ? comments.c_str() : id.c_str());
+	}
+
+	// Ellipsoids -----------------------------------------
+	for(struct PJ_ELLPS *pEllipse=pj_ellps; pEllipse->id; ++pEllipse)
+	{
+		sEllipsoids	+= CSG_String::Format(SG_T("{%s}%s (%s, %s)|"), SG_STR_MBTOSG(pEllipse->id), SG_STR_MBTOSG(pEllipse->name), SG_STR_MBTOSG(pEllipse->major), SG_STR_MBTOSG(pEllipse->ell));
+	}
+
+	// Units ----------------------------------------------
+	for(struct PJ_UNITS *pUnit=pj_units; pUnit->id; ++pUnit)
+	{
+		sUnits	+= CSG_String::Format(SG_T("{%s}%s (%s)|"), SG_STR_MBTOSG(pUnit->id), SG_STR_MBTOSG(pUnit->name), SG_STR_MBTOSG(pUnit->to_meter));
+	}
+
+
+	///////////////////////////////////////////////////////
+
+	//-----------------------------------------------------
+	// Projection...
+
+	if( sProjections.Length() == 0 )
+	{
+		return( false );
+	}
+
+	pParameters->Add_Choice	(pNode_0, "PROJ_TYPE"	, _TL("Projection Type")			, sDescription, sProjections);
+
+
+	//-----------------------------------------------------
+	// Datum...
+
+	pNode_1	= pParameters->Add_Choice(
+		pNode_0, "DATUM_DEF"		, _TL("Datum Definition"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Predefined Datum"),
+			_TL("User Defined Datum")
+		)
+	);
+
+
+	//-----------------------------------------------------
+	// Predefined Datum...
+
+	pParameters->Add_Choice	(pNode_1, "DATUM"		, _TL("Predefined Datum")			, _TL(""), sDatums);
+
+
+	//-----------------------------------------------------
+	// Ellipsoid...
+
+	pNode_2	= pParameters->Add_Choice(
+		pNode_1, "ELLIPSOID"		, _TL("Ellipsoid Definition"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+			_TL("Predefined Ellipsoids"),
+			_TL("Semimajor Axis and Semiminor Axis"),
+			_TL("Semimajor Axis and Flattening"),
+			_TL("Semimajor Axis and Reciprocal Flattening"),
+			_TL("Semimajor Axis and Eccentricity"),
+			_TL("Semimajor Axis and Eccentricity Squared")
+		)
+	);
+
+	pParameters->Add_Choice	(pNode_2, "ELLPS_DEF"	, _TL("Predefined Ellipsoids")		, _TL(""), sEllipsoids);
+
+	pParameters->Add_Value	(pNode_2, "ELLPS_A"		, _TL("Semimajor Axis (a)")			, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_A);
+	pParameters->Add_Value	(pNode_2, "ELLPS_B"		, _TL("Semiminor Axis (b)")			, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_B);
+	pParameters->Add_Value	(pNode_2, "ELLPS_F"		, _TL("Flattening (f)")				, _TL(""), PARAMETER_TYPE_Double, (WGS84_ELLPS_A - WGS84_ELLPS_B) / WGS84_ELLPS_A);
+	pParameters->Add_Value	(pNode_2, "ELLPS_RF"	, _TL("Reciprocal Flattening (rf)")	, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_A / (WGS84_ELLPS_A - WGS84_ELLPS_B));
+	pParameters->Add_Value	(pNode_2, "ELLPS_E"		, _TL("Eccentricity (e)")			, _TL(""), PARAMETER_TYPE_Double, sqrt(WGS84_ELLPS_A*WGS84_ELLPS_A + WGS84_ELLPS_B*WGS84_ELLPS_B));
+	pParameters->Add_Value	(pNode_2, "ELLPS_ES"	, _TL("Squared Eccentricity (es)")	, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_A*WGS84_ELLPS_A + WGS84_ELLPS_B*WGS84_ELLPS_B);
+
+
+	//-----------------------------------------------------
+	// Datum Shift...
+
+	pNode_2	= pParameters->Add_Choice(
+		pNode_1, "DATUM_SHIFT"	, _TL("Datum Shift"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("none"),
+			_TL("3 parameters (translation only)"),
+			_TL("7 parameters"),
+			_TL("Datum Shift Grid")
+		)
+	);
+
+	pParameters->Add_Value	(pNode_2, "DS_DX"		, _TL("Translation X")				, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_2, "DS_DY"		, _TL("Translation Y")				, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_2, "DS_DZ"		, _TL("Translation Z")				, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_2, "DS_RX"		, _TL("Rotation X")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_2, "DS_RY"		, _TL("Rotation Y")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_2, "DS_RZ"		, _TL("Rotation Z")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_2, "DS_SC"		, _TL("Scaling")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
+
+	pParameters->Add_FilePath(
+		pNode_2, "DATUM_GRID"	, _TL("Datum Shift Grid File"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s"),
+			_TL("NTv2 Grid Shift Binary (*.gsb)")	, SG_T("*.gsb"),
+			_TL("All Files")						, SG_T("*.*")
+		), NULL, false, false, false
+	);
+
+
+	//-----------------------------------------------------
+	// General Settings...
+
+	pNode_1	= pParameters->Add_Node(pNode_0, "NODE_GENERAL"	, _TL("General Settings"), _TL(""));
+
+	pParameters->Add_Value	(pNode_1, "LON_0"		, _TL("Central Meridian")		, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_1, "LAT_0"		, _TL("Central Parallel")		, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_1, "X_0"			, _TL("False Easting")			, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_1, "Y_0"			, _TL("False Northing")			, _TL(""), PARAMETER_TYPE_Double, 0.0);
+	pParameters->Add_Value	(pNode_1, "K_0"			, _TL("Scale Factor")			, _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true);
+
+	pParameters->Add_Choice	(pNode_1, "UNIT"		, _TL("Unit")					, _TL(""), sUnits, 1);
+
+	pParameters->Add_Value	(pNode_1, "NO_DEFS"		, _TL("Ignore Defaults")		, _TL(""), PARAMETER_TYPE_Bool, false);
+
+	pParameters->Add_Value	(pNode_1, "OVER"		, _TL("Allow longitudes outside -180 to 180 Range")	, _TL(""), PARAMETER_TYPE_Bool, false);
+
+	//-----------------------------------------------------
+	pParameters->Add_Parameters(
+		pNode_0, "OPTIONS"	, _TL("Projection Settings"),
+		_TL("")
+	);
+
+	pParameters->Get_Parameter("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[0].id)));
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+#define PRM_ADD_BOL(key, name, val)	pParms->Add_Value (NULL, key, name, _TL(""), PARAMETER_TYPE_Bool  , val);
+#define PRM_ADD_INT(key, name, val)	pParms->Add_Value (NULL, key, name, _TL(""), PARAMETER_TYPE_Int   , val);
+#define PRM_ADD_FLT(key, name, val)	pParms->Add_Value (NULL, key, name, _TL(""), PARAMETER_TYPE_Double, val);
+#define PRM_ADD_STR(key, name, val)	pParms->Add_String(NULL, key, name, _TL(""), val);
+#define PRM_ADD_CHO(key, name, val)	pParms->Add_Choice(NULL, key, name, _TL(""), val);
+
+//---------------------------------------------------------
+bool CCRS_Base::Add_User_Projection(const CSG_String &sID, const CSG_String &sName, const CSG_String &sArgs)
+{
+	if( sArgs.Length() == 0 )
+	{
+		return( false );
+	}
+
+	CSG_Parameters	*pParms	= Add_Parameters(sID, sName, sArgs);
+
+//	pParms->Add_Info_String(NULL, "DESC", _TL("Description"), _TL(""), sArgs.c_str(), true);
+
+	//-----------------------------------------------------
+	// Cylindrical Projections...
+
+	if(	!sID.CmpNoCase(SG_T("cea"))			// Equal Area Cylindrical
+	||	!sID.CmpNoCase(SG_T("eqc"))			// Equidistant Cylindrical (Plate Caree) 
+	||	!sID.CmpNoCase(SG_T("merc")) )		// Mercator 
+	{
+		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 0.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("utm")) )		// Universal Transverse Mercator (UTM)
+	{
+		PRM_ADD_INT("zone"		, _TL("Zone")					, 32);
+		PRM_ADD_BOL("south"		, _TL("South")					, false);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("omerc")) )		// Oblique Mercator 
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
+		PRM_ADD_FLT("lon_1"		, _TL("Longitude 1"	)			,-20.0);
+		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 50.0);
+		PRM_ADD_FLT("lon_2"		, _TL("Longitude 2"	)			, 20.0);
+	}
+
+	//-----------------------------------------------------
+	// Pseudocylindrical Projections...
+
+	if(	!sID.CmpNoCase(SG_T("gn_sinu")) )	// General Sinusoidal Series
+	{
+		PRM_ADD_FLT("m"			, SG_T("m")						, 0.5);
+		PRM_ADD_FLT("n"			, SG_T("n")						, 1.0 + M_PI_045);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("loxim")) )		// Loximuthal
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("urmfps")) )	// Urmaev Flat-Polar Sinusoidal
+	{
+		PRM_ADD_FLT("n"			, SG_T("n")						, 1.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("urm5")) )		// Urmaev V
+	{
+		PRM_ADD_FLT("n"			, SG_T("n")						, 1.0);
+		PRM_ADD_FLT("q"			, SG_T("q")						, 1.0);
+		PRM_ADD_FLT("alphi"		, SG_T("alphi")					, 45.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("wink1"))		// Winkel I
+	||	!sID.CmpNoCase(SG_T("wag3")) )		// Wagner III
+	{
+		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 45.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("wink2")) )		// Winkel II
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
+	}
+
+
+	//-----------------------------------------------------
+	// Conic Projections...
+
+	if(	!sID.CmpNoCase(SG_T("aea"))			// Albers Equal Area
+	||	!sID.CmpNoCase(SG_T("eqdc"))		// Equidistant Conic
+	||	!sID.CmpNoCase(SG_T("euler"))		// Euler 
+	||	!sID.CmpNoCase(SG_T("imw_p"))		// International Map of the World Polyconic 
+	||	!sID.CmpNoCase(SG_T("murd1"))		// Murdoch I 
+	||	!sID.CmpNoCase(SG_T("murd2"))		// Murdoch II 
+	||	!sID.CmpNoCase(SG_T("murd3"))		// Murdoch III 
+	||	!sID.CmpNoCase(SG_T("pconic"))		// Perspective Conic 
+	||	!sID.CmpNoCase(SG_T("tissot"))		// Tissot 
+	||	!sID.CmpNoCase(SG_T("vitk1")) )		// Vitkovsky I 
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 33.0);
+		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 45.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("lcc")) )		// Lambert Conformal Conic 
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 33.0);
+		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 45.0);
+	}
+
+	if( !sID.CmpNoCase(SG_T("leac")) )		// Lambert Equal Area Conic
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 45.0);
+		PRM_ADD_BOL("south"		, _TL("South")					, false);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("rpoly")) )		// Rectangular Polyconic
+	{
+		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 45.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("mpoly")) )		// Modified Polyconic
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 33.0);
+		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 45.0);
+		PRM_ADD_BOL("lotsa"		, _TL("Lotsa")					, true);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("bonne")) )		// Bonne
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 45.0);
+	}
+
+
+	//-----------------------------------------------------
+	// Azimuthal Projections...
+
+	if(	!sID.CmpNoCase(SG_T("stere")) )		// Stereographic
+	{
+		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 45.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("ups")) )		// Universal Polar Stereographic
+	{
+		PRM_ADD_BOL("south"		, _TL("South")					, true);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("airy")) )		// Airy
+	{
+		PRM_ADD_FLT("lat_b"		, _TL("Latitude B")				, 45.0);
+		PRM_ADD_BOL("no_cut"	, _TL("No Cut")					, true);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("nsper")) )		// Near-sided perspective
+	{
+		PRM_ADD_FLT("h"			, _TL("Height of view point")	, 1.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("aeqd")) )		// Azimuthal Equidistant
+	{
+		PRM_ADD_BOL("guam"		, _TL("guam")					, true);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("hammer")) )	// Hammer & Eckert-Greifendorff
+	{
+		PRM_ADD_FLT("W"			, _TL("W")						, 0.5);
+		PRM_ADD_FLT("M"			, _TL("M")						, 1.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("wintri")) )	// Winkel Tripel 
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
+	}
+
+
+	//-----------------------------------------------------
+	// Miscellaneous Projections...
+
+	if(	!sID.CmpNoCase(SG_T("ocea"))		// Oblique Cylindrical Equal Area
+	||	!sID.CmpNoCase(SG_T("tpeqd")) )		// Two Point Equidistant 
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
+		PRM_ADD_FLT("lon_1"		, _TL("Longitude 1")			,-20.0);
+		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 50.0);
+		PRM_ADD_FLT("lon_2"		, _TL("Longitude 2"	)			, 20.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("geos")) )		// Geostationary Satellite View
+	{
+		PRM_ADD_FLT("h"			, _TL("Satellite Height [m]")	, 35785831.0);
+		PRM_ADD_CHO("sweep"		, _TL("Sweep Angle")			, "x|y|");
+	}
+
+	if(	!sID.CmpNoCase(SG_T("lsat")) )		// Space oblique for LANDSAT
+	{
+		PRM_ADD_INT("lsat"		, _TL("Landsat Satellite (1-5)"), 1.0);
+		PRM_ADD_INT("path"		, _TL("Path (1-255/233 1-3/4-5"), 1.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("labrd")) )		// Laborde
+	{
+		PRM_ADD_FLT("azi"		, _TL("Azimuth"	)				, 19.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("lagrng")) )	// Lagrange
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 0.0);
+		PRM_ADD_FLT("W"			, _TL("W")						, 2.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("chamb")) )		// Chamberlin Trimetric
+	{
+		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 30.0);
+		PRM_ADD_FLT("lon_1"		, _TL("Longitude 1"	)			,-20.0);
+		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 40.0);
+		PRM_ADD_FLT("lon_2"		, _TL("Longitude 2")			, 00.0);
+		PRM_ADD_FLT("lat_3"		, _TL("Latitude 3")				, 50.0);
+		PRM_ADD_FLT("lon_3"		, _TL("Longitude 3"	)			, 20.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("oea")) )		// Oblated Equal Area
+	{
+		PRM_ADD_FLT("m"			, _TL("m")						, 1.0);
+		PRM_ADD_FLT("n"			, _TL("n")						, 1.0);
+		PRM_ADD_FLT("theta"		, _TL("theta")					, 45.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("tpers")) )		// Tilted perspective
+	{
+		PRM_ADD_FLT("tilt"		, _TL("Tilt")					, 45.0);
+		PRM_ADD_FLT("azi"		, _TL("Azimuth")				, 45.0);
+		PRM_ADD_FLT("h"			, _TL("h")						, 1000.0);
+	}
+
+	if(	!sID.CmpNoCase(SG_T("ob_tran")) )	// General Oblique Transformation
+	{
+		PRM_ADD_FLT("o_lat_p"	, _TL("Latitude Pole")			, 40.0);
+		PRM_ADD_FLT("o_lon_p"	, _TL("Longitude Pole")			, 40.0);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define PROJ4_ADD_BOL(key, val)		if( val ) Proj4 += CSG_String::Format(SG_T("+%s "), CSG_String(key).c_str());
+#define PROJ4_ADD_INT(key, val)		Proj4 += CSG_String::Format(SG_T("+%s=%d "), CSG_String(key).c_str(), val);
+#define PROJ4_ADD_FLT(key, val)		Proj4 += CSG_String::Format(SG_T("+%s=%s "), CSG_String(key).c_str(), SG_Get_String(val, -32).c_str());
+#define PROJ4_ADD_STR(key, val)		Proj4 += CSG_String::Format(SG_T("+%s=%s "), CSG_String(key).c_str(), CSG_String(val).c_str());
+
+//---------------------------------------------------------
+CSG_String CCRS_Base::Get_User_Definition(CSG_Parameters &P)
+{
+	CSG_String	Proj4;
+
+	//-----------------------------------------------------
+	PROJ4_ADD_STR("proj"	, pj_list[P("PROJ_TYPE")->asInt()].id);
+
+	if( P("LON_0")->asDouble() )	PROJ4_ADD_FLT("lon_0", P("LON_0")->asDouble());
+	if( P("LAT_0")->asDouble() )	PROJ4_ADD_FLT("lat_0", P("LAT_0")->asDouble());
+
+	if( P("X_0"  )->asDouble() )	PROJ4_ADD_FLT("x_0"  , P("X_0"  )->asDouble());
+	if( P("Y_0"  )->asDouble() )	PROJ4_ADD_FLT("y_0"  , P("Y_0"  )->asDouble());
+
+	if( P("K_0")->asDouble() != 1.0 && P("K_0")->asDouble() > 0.0 )
+	{
+		PROJ4_ADD_FLT("k_0", P("K_0")->asDouble());
+	}
+
+	PROJ4_ADD_STR("units", pj_units[P("UNIT")->asInt()].id);
+
+	//-----------------------------------------------------
+	switch( P("DATUM_DEF")->asInt() )
+	{
+	case 0:	// predefined datum
+
+		PROJ4_ADD_STR("datum", pj_datums[P("DATUM")->asInt()].id);
+
+		break;
+
+	//-----------------------------------------------------
+	case 1:	// user defined datum
+
+		switch( P("ELLIPSOID")->asInt() )
+		{
+		case 0:	// Predefined Ellipsoid
+			PROJ4_ADD_STR("ellps", pj_ellps[P("ELLPS_DEF")->asInt()].id);
+			break;
+
+		case 1:	// Semiminor axis
+			PROJ4_ADD_FLT("a"    , P("ELLPS_A" )->asDouble());
+			PROJ4_ADD_FLT("b"    , P("ELLPS_B" )->asDouble());
+			break;
+
+		case 2:	// Flattening
+			PROJ4_ADD_FLT("a"    , P("ELLPS_A" )->asDouble());
+			PROJ4_ADD_FLT("f"    , P("ELLPS_F" )->asDouble());
+			break;
+
+		case 3:	// Reciprocal Flattening
+			PROJ4_ADD_FLT("a"    , P("ELLPS_A" )->asDouble());
+			PROJ4_ADD_FLT("rf"   , P("ELLPS_RF")->asDouble());
+			break;
+
+		case 4:	// Eccentricity
+			PROJ4_ADD_FLT("a"    , P("ELLPS_A" )->asDouble());
+			PROJ4_ADD_FLT("e"    , P("ELLPS_E" )->asDouble());
+			break;
+
+		case 5:	// Eccentricity Squared
+			PROJ4_ADD_FLT("a"    , P("ELLPS_A" )->asDouble());
+			PROJ4_ADD_FLT("es"   , P("ELLPS_ES")->asDouble());
+			break;
+		}
+
+		switch( P("DATUM_SHIFT")->asInt() )
+		{
+		case 1:	// 3 parameters
+			PROJ4_ADD_STR("towgs84", CSG_String::Format(SG_T("%s,%s,%s"),
+				SG_Get_String(P("DS_DX")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_DY")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_DZ")->asDouble(), -32).c_str())
+			);
+			break;
+
+		case 2:	// 7 parameters
+			PROJ4_ADD_STR("towgs84", CSG_String::Format(SG_T("%s,%s,%s,%s,%s,%s,%s"),
+				SG_Get_String(P("DS_DX")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_DY")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_DZ")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_RX")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_RY")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_RZ")->asDouble(), -32).c_str(),
+				SG_Get_String(P("DS_SC")->asDouble(), -32).c_str())
+			);
+			break;
+
+		case 3:	// datum shift grid...
+			if( SG_File_Exists(P("DATUM_GRID")->asString()) )
+			{
+				PROJ4_ADD_STR("nadgrids", P("DATUM_GRID")->asString());
+			}
+			break;
+		}
+
+		break;
+	}
+
+	//-----------------------------------------------------
+	for(int i=0; i<P("OPTIONS")->asParameters()->Get_Count(); i++)
+	{
+		CSG_Parameter	*p	= P("OPTIONS")->asParameters()->Get_Parameter(i);
+
+		switch( p->Get_Type() )
+		{
+		case PARAMETER_TYPE_Choice:
+		case PARAMETER_TYPE_String: PROJ4_ADD_STR(p->Get_Identifier(), p->asString());	break;
+		case PARAMETER_TYPE_Bool:   PROJ4_ADD_BOL(p->Get_Identifier(), p->asBool  ());	break;
+		case PARAMETER_TYPE_Int:    PROJ4_ADD_INT(p->Get_Identifier(), p->asInt   ());	break;
+		case PARAMETER_TYPE_Double: PROJ4_ADD_FLT(p->Get_Identifier(), p->asDouble());	break;
+		}
+	}
+
+	//-----------------------------------------------------
+	PROJ4_ADD_BOL("no_defs", P("NO_DEFS")->asBool());
+	PROJ4_ADD_BOL("over"   , P("OVER"   )->asBool());
+
+	return( Proj4 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define _K(key)					(CSG_String("+") + key)
+#define PROJ4_HAS_KEY(key)		(Proj4.Find(_K(key)) >= 0)
+#define PROJ4_HAS_VAL(key)		(Proj4.Find(_K(key)) >= 0 && !Proj4.Right(Proj4.Length() - Proj4.Find(_K(key))).BeforeFirst('=').Cmp(_K(key)))
+#define PROJ4_GET_VAL(key)		(Proj4.Right(PROJ4_HAS_VAL(key) ? Proj4.Length() - Proj4.Find(_K(key)) : 0).AfterFirst('=').BeforeFirst(' '))
+
+#define PROJ4_SET_BOL(key, id)	{             if( P(id)                                     ) P(id)->Set_Value(PROJ4_HAS_KEY(key) ? 1 : 0); }
+#define PROJ4_SET_INT(key, id)	{ int    val; if( P(id) && PROJ4_GET_VAL(key).asInt   (val) ) P(id)->Set_Value(val); }
+#define PROJ4_SET_FLT(key, id)	{ double val; if( P(id) && PROJ4_GET_VAL(key).asDouble(val) ) P(id)->Set_Value(val); }
+#define PROJ4_SET_STR(key, id)	{             if( P(id) && PROJ4_HAS_VAL(key)               ) P(id)->Set_Value(PROJ4_GET_VAL(key)); }
+
+#define PROJ4_SET_CHC(key, id)	if( P(id) ) { CSG_Parameter_Choice *pList = P(id)->asChoice(); CSG_String s(PROJ4_GET_VAL(key));\
+		for(int i=0; i<pList->Get_Count(); i++)\
+		{\
+			if( !pList->Get_Item_Data(i).Cmp(s) )\
+			{\
+				P(id)->Set_Value(i); break;\
+			}\
+		}\
+	}
+
+//---------------------------------------------------------
+bool CCRS_Base::Set_User_Definition(CSG_Parameters &P, const CSG_String &Proj4)
+{
+	P.Restore_Defaults();
+
+	PROJ4_SET_CHC("proj" , "PROJ_TYPE");
+	PROJ4_SET_CHC("datum", "DATUM"    );
+	PROJ4_SET_CHC("ellps", "ELLPS_DEF");
+	PROJ4_SET_CHC("units", "UNIT"     );
+
+	PROJ4_SET_FLT("lon_0", "LON_0"    );
+	PROJ4_SET_FLT("lat_0", "LAT_0"    );
+	PROJ4_SET_FLT("x_0"  , "X_0"      );
+	PROJ4_SET_FLT("y_0"  , "Y_0"      );
+	PROJ4_SET_FLT("k_0"  , "K_0"      );
+
+	PROJ4_SET_FLT("a"    , "ELLPS_A"  );
+	PROJ4_SET_FLT("b"    , "ELLPS_B"  );
+	PROJ4_SET_FLT("f"    , "ELLPS_F"  );
+	PROJ4_SET_FLT("rf"   , "ELLPS_RF" );
+	PROJ4_SET_FLT("e"    , "ELLPS_E"  );
+	PROJ4_SET_FLT("es"   , "ELLPS_ES" );
+
+	PROJ4_SET_BOL("no_defs", "NO_DEFS");
+	PROJ4_SET_BOL("over"   , "OVER"   );
+
+	//-----------------------------------------------------
+//	switch( P("DATUM_DEF")->asInt() )
+	if( PROJ4_HAS_VAL("datum") )	P("DATUM_DEF")->Set_Value(0);	//	case 0:	// predefined datum
+	else							P("DATUM_DEF")->Set_Value(1);	//	case 1:	// user defined datum
+
+//	switch( P("ELLIPSOID")->asInt() )
+	if( PROJ4_HAS_VAL("ellps") )	P("ELLIPSOID")->Set_Value(0);	//	case 0:	// Predefined Ellipsoid
+	if( PROJ4_HAS_VAL("b"    ) )	P("ELLIPSOID")->Set_Value(1);	//	case 1:	// Semiminor axis
+	if( PROJ4_HAS_VAL("f"    ) )	P("ELLIPSOID")->Set_Value(2);	//	case 2:	// Flattening
+	if( PROJ4_HAS_VAL("rf"   ) )	P("ELLIPSOID")->Set_Value(3);	//	case 3:	// Reciprocal Flattening
+	if( PROJ4_HAS_VAL("e"    ) )	P("ELLIPSOID")->Set_Value(4);	//	case 4:	// Eccentricity
+	if( PROJ4_HAS_VAL("es"   ) )	P("ELLIPSOID")->Set_Value(5);	//	case 5:	// Eccentricity Squared
+
+//	switch( P("DATUM_SHIFT")->asInt() )
+	CSG_String_Tokenizer	params(PROJ4_GET_VAL("towgs84"), ", ");
+
+	if( params.Get_Tokens_Count() == 3 || params.Get_Tokens_Count() == 7 )
+	{
+		P("DATUM_SHIFT")->Set_Value(1);	//	case 1:	// 3 parameters
+
+		P("DS_DX")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_DY")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_DZ")->Set_Value(params.Get_Next_Token().asDouble());
+	}
+	else if( params.Get_Tokens_Count() == 7 )
+	{
+		P("DATUM_SHIFT")->Set_Value(2);	//	case 2:	// 7 parameters
+
+		P("DS_DX")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_DY")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_DZ")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_RX")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_RY")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_RZ")->Set_Value(params.Get_Next_Token().asDouble());
+		P("DS_SC")->Set_Value(params.Get_Next_Token().asDouble());
+	}
+	else if( PROJ4_HAS_VAL("nadgrids") && SG_File_Exists(PROJ4_GET_VAL("nadgrids")) )
+	{
+		P("DATUM_SHIFT")->Set_Value(3);	//	case 3:	// datum shift grid...
+
+		PROJ4_SET_STR("nadgrids", "DATUM_GRID");
+	}
+	else
+	{
+		P("DATUM_SHIFT")->Set_Value(0);	//	case 0:	// none
+	}
+
+	//-----------------------------------------------------
+	P("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[P("PROJ_TYPE")->asInt()].id)));
+
+	for(int i=0; i<P("OPTIONS")->asParameters()->Get_Count(); i++)
+	{
+		CSG_Parameter	*p	= P("OPTIONS")->asParameters()->Get_Parameter(i);
+
+		switch( p->Get_Type() )
+		{
+		case PARAMETER_TYPE_Choice:
+		case PARAMETER_TYPE_String: p->Set_Value(PROJ4_GET_VAL(p->Get_Identifier())           );	break;
+		case PARAMETER_TYPE_Bool:   p->Set_Value(PROJ4_HAS_KEY(p->Get_Identifier()) ? 1 : 0   );	break;
+		case PARAMETER_TYPE_Int:    p->Set_Value(PROJ4_GET_VAL(p->Get_Identifier()).asInt   ());	break;
+		case PARAMETER_TYPE_Double: p->Set_Value(PROJ4_GET_VAL(p->Get_Identifier()).asDouble());	break;
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCRS_Picker::CCRS_Picker(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Coordinate Reference System Picker"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2014"));
+
+	Set_Description	(_TW(
+		"Define or pick a Coordinate Reference System (CRS). "
+		"It is intended to call this tool only from other tools."
+	));
+}
+
+//---------------------------------------------------------
+bool CCRS_Picker::On_Execute(void)
+{
+	CSG_Projection	Target;
+
+	if( !Get_Projection(Target) )
+	{
+		return( false );
+	}
+
+	Message_Add(CSG_String::Format(SG_T("\n%s: %s"), _TL("target"), Target.Get_Proj4().c_str()), false);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Projection	Target;
+
+	if( !Get_Projection(Target) || !m_Projector.Set_Target(Target) )
+	{
+		return( false );
+	}
+
+	Message_Add(CSG_String::Format(SG_T("\n%s: %s"), _TL("target"), Target.Get_Proj4().c_str()), false);
+
+	//-----------------------------------------------------
+	m_Projector.Set_Precise_Mode(Parameters("PRECISE") && Parameters("PRECISE")->asBool());
+
+	bool	bResult	= On_Execute_Transformation();
+
+	m_Projector.Destroy();
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/projection/pj_proj4/crs_base.h b/src/modules/projection/pj_proj4/crs_base.h
new file mode 100644
index 0000000..d7dd65d
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_base.h
@@ -0,0 +1,160 @@
+/**********************************************************
+ * Version $Id: crs_base.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      crs_base.h                       //
+//                                                       //
+//                 Copyright (C) 2010 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__crs_base_H
+#define HEADER_INCLUDED__crs_base_H
+
+//---------------------------------------------------------
+#include "crs_transform.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class pj_proj4_EXPORT CCRS_Base : public CSG_Module
+{
+public:
+	CCRS_Base(void);
+
+	virtual bool			do_Sync_Projections		(void)	{	return( false  );	}
+
+
+protected:
+
+	virtual bool			On_Before_Execution		(void);
+
+	virtual int				On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	bool					Get_Projection			(CSG_Projection &Projection);
+
+
+private:
+
+	CSG_Projection			m_Projection;
+
+
+	bool					Set_User_Parameters		(CSG_Parameters *pParameters);
+	bool					Add_User_Projection		(const CSG_String &sID, const CSG_String &sName, const CSG_String &sArgs);
+
+	CSG_String				Get_User_Definition		(CSG_Parameters &pParameters);
+	bool					Set_User_Definition		(CSG_Parameters &pParameters, const CSG_String &Proj4);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class pj_proj4_EXPORT CCRS_Picker : public CCRS_Base
+{
+public:
+	CCRS_Picker(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Tools") );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class pj_proj4_EXPORT CCRS_Transform : public CCRS_Base
+{
+public:
+	CCRS_Transform(void)	{}
+
+
+protected:
+
+	CSG_CRSProjector		m_Projector;
+
+
+	virtual bool			On_Execute					(void);
+
+	virtual bool			On_Execute_Transformation	(void)	= 0;
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__crs_base_H
diff --git a/src/modules/projection/pj_proj4/crs_indicatrix.cpp b/src/modules/projection/pj_proj4/crs_indicatrix.cpp
new file mode 100644
index 0000000..8ffe1a6
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_indicatrix.cpp
@@ -0,0 +1,295 @@
+/**********************************************************
+ * Version $Id: crs_indicatrix.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  crs_indicatrix.cpp                   //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "crs_indicatrix.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCRS_Indicatrix::CCRS_Indicatrix(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Tissot's Indicatrix"));
+
+	Set_Author		("O. Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Creates a shapes layer with Tissot's indicatrices for chosen projection."
+	));
+
+	Set_Description	(Get_Description() + "\n" + CSG_CRSProjector::Get_Description());
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "TARGET"	, _TL("Indicatrix"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NY"		, _TL("Number in Latitudinal Direction"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 5, 1, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NX"		, _TL("Number in Meridional Direction"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 11, 1, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SCALE"	, _TL("Size"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 25.0, 1.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	FIELD_LON	= 0,
+	FIELD_LAT,
+	FIELD_h,
+	FIELD_k,
+	FIELD_a,
+	FIELD_b,
+	FIELD_w,
+	FIELD_PHI
+};
+
+//---------------------------------------------------------
+bool CCRS_Indicatrix::On_Execute_Transformation(void)
+{
+	//-----------------------------------------------------
+	double	yStep	= 180.0 / Parameters("NY")->asDouble();
+	double	xStep	= 360.0 / Parameters("NX")->asDouble();
+
+	m_Size	= 1.0;
+	m_Scale	= (40000000.0 / 360.0) * (yStep < xStep ? yStep : xStep) * 0.005 * Parameters("SCALE")->asDouble() / m_Size;
+
+	//-----------------------------------------------------
+	m_Circle.Add(0.0, 0.0);
+	m_Circle.Add(sin(M_PI_090), cos(M_PI_090));
+	m_Circle.Add(0.0, 0.0);
+
+	for(double a=0.0; a<M_PI_360; a+=2.0*M_DEG_TO_RAD)
+	{
+		m_Circle.Add(sin(a), cos(a));
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pTarget	= Parameters("TARGET")->asShapes();
+
+	pTarget->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), _TL("Indicatrix"), m_Projector.Get_Target().Get_Name().c_str()));
+
+	pTarget->Get_Projection() = m_Projector.Get_Target();
+
+	pTarget->Add_Field("LON", SG_DATATYPE_Double);
+	pTarget->Add_Field("LAT", SG_DATATYPE_Double);
+	pTarget->Add_Field("h"  , SG_DATATYPE_Double);
+	pTarget->Add_Field("k"  , SG_DATATYPE_Double);
+	pTarget->Add_Field("a"  , SG_DATATYPE_Double);
+	pTarget->Add_Field("b"  , SG_DATATYPE_Double);
+	pTarget->Add_Field("w"  , SG_DATATYPE_Double);
+	pTarget->Add_Field("PHI", SG_DATATYPE_Double);
+
+	//-----------------------------------------------------
+	int		nDropped	= 0;
+
+	for(double lat=-90.0+yStep/2.0; lat<90.0; lat+=yStep)
+	{
+		for(double lon=-180.0+xStep/2.0; lon<180.0; lon+=xStep)
+		{
+			CSG_Shape	*pIndicatrix	= pTarget->Add_Shape();
+
+			if( !Get_Indicatrix(lon, lat, pIndicatrix) )
+			{
+				nDropped++;
+
+				pTarget->Del_Shape(pIndicatrix);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( nDropped > 0 )
+	{
+		Message_Add(CSG_String::Format(SG_T("%s: %d %s"), pTarget->Get_Name(), nDropped, _TL("shapes have been dropped")));
+	}
+
+	m_Circle.Clear();
+
+	return( pTarget->Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Indicatrix::Get_Indicatrix(double lon, double lat, CSG_Shape *pIndicatrix)
+{
+	m_Projector.Set_Source(
+		CSG_Projection(CSG_String::Format(SG_T("+proj=ortho +lon_0=%f +lat_0=%f +datum=WGS84"), lon, lat), SG_PROJ_FMT_Proj4)
+	);
+
+	TSG_Point	Center, Point;
+
+	Center.x	= 0.0;
+	Center.y	= 0.0;
+
+	if( !m_Projector.Get_Projection(Center) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Point.x		= m_Size;
+	Point.y		= 0.0;
+
+	if( !m_Projector.Get_Projection(Point) )
+	{
+		return( false );
+	}
+
+	double	h	= SG_Get_Distance(Center, Point) / m_Size;
+
+	//-----------------------------------------------------
+	Point.x		= 0.0;
+	Point.y		= m_Size;
+
+	if( !m_Projector.Get_Projection(Point) )
+	{
+		return( false );
+	}
+
+	double	k	= SG_Get_Distance(Center, Point) / m_Size;
+
+	//-----------------------------------------------------
+	double	a	= h > k ? h : k;	// major semi-axis
+	double	b	= h > k ? k : h;	// minor semi-axis
+
+	for(int iPoint=0; iPoint<m_Circle.Get_Count(); iPoint++)
+	{
+		Point.x	= m_Size * m_Circle[iPoint].x;
+		Point.y	= m_Size * m_Circle[iPoint].y;
+
+		if( !m_Projector.Get_Projection(Point) )
+		{
+			return( false );
+		}
+
+		if( iPoint >= 3 )
+		{
+			double	d	= SG_Get_Distance(Center, Point) / m_Size;
+
+			if( a < d )
+			{
+				a	= d;
+			}
+			else if( b > d )
+			{
+				b	= d;
+			}
+		}
+
+		Point.x	= Center.x + m_Scale * (Point.x - Center.x);
+		Point.y	= Center.y + m_Scale * (Point.y - Center.y);
+
+		pIndicatrix->Add_Point(Point);
+	}
+
+	//-----------------------------------------------------
+	double	w	= 2.0 * M_RAD_TO_DEG * asin((a - b) / (a + b));
+	double	phi	= a * b;
+
+	pIndicatrix->Set_Value(FIELD_LON, SG_Get_Rounded(lon, 2));
+	pIndicatrix->Set_Value(FIELD_LAT, SG_Get_Rounded(lat, 2));
+	pIndicatrix->Set_Value(FIELD_h  , SG_Get_Rounded(h  , 2));
+	pIndicatrix->Set_Value(FIELD_k  , SG_Get_Rounded(k  , 2));
+	pIndicatrix->Set_Value(FIELD_a  , SG_Get_Rounded(a  , 2));
+	pIndicatrix->Set_Value(FIELD_b  , SG_Get_Rounded(b  , 2));
+	pIndicatrix->Set_Value(FIELD_w  , SG_Get_Rounded(w  , 1));
+	pIndicatrix->Set_Value(FIELD_PHI, SG_Get_Rounded(phi, 1));
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/projection/pj_proj4/crs_indicatrix.h b/src/modules/projection/pj_proj4/crs_indicatrix.h
new file mode 100644
index 0000000..a2e5405
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_indicatrix.h
@@ -0,0 +1,109 @@
+/**********************************************************
+ * Version $Id: crs_indicatrix.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   crs_indicatrix.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__crs_indicatrix_H
+#define HEADER_INCLUDED__crs_indicatrix_H
+
+//---------------------------------------------------------
+#include "crs_base.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CCRS_Indicatrix : public CCRS_Transform
+{
+public:
+	CCRS_Indicatrix(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Tools") );	}
+
+
+
+protected:
+
+	virtual bool			On_Execute_Transformation	(void);
+
+
+private:
+
+	double					m_Scale, m_Size;
+
+	CSG_Points				m_Circle;
+
+
+	bool					Get_Indicatrix				(double lon, double lat, CSG_Shape *pIndicatrix);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__crs_indicatrix_H
diff --git a/src/modules/projection/pj_proj4/crs_transform.cpp b/src/modules/projection/pj_proj4/crs_transform.cpp
new file mode 100644
index 0000000..4445495
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_transform.cpp
@@ -0,0 +1,302 @@
+/**********************************************************
+ * Version $Id: crs_transform.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   crs_transform.cpp                   //
+//                                                       //
+//                 Copyright (C) 2010 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 "crs_transform.h"
+
+#include <projects.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define PROJ4_FREE(p)	if( p )	{	pj_free((PJ *)p);	p	= NULL;	}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_CRSProjector::CSG_CRSProjector(void)
+{
+	m_bInverse	= false;
+
+	m_pSource	= NULL;
+	m_pTarget	= NULL;
+	m_pGCS		= NULL;
+}
+
+//---------------------------------------------------------
+CSG_CRSProjector::~CSG_CRSProjector(void)
+{
+	Destroy();
+}
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Destroy(void)
+{
+	m_bInverse	= false;
+
+	PROJ4_FREE(m_pSource);
+	PROJ4_FREE(m_pTarget);
+	PROJ4_FREE(m_pGCS);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_CRSProjector::Get_Version(void)
+{
+	return( pj_release );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_CRSProjector::Get_Description(void)
+{
+	CSG_String	s;
+
+	s	+= _TL("Projection routines make use of the Proj.4 Cartographic Projections library.");
+	s	+= "\n";
+	s	+= _TW("Proj.4 was originally developed by Gerald Evenden and later continued by the "
+		       "United States Department of the Interior, Geological Survey (USGS).");
+	s	+= "\n";
+	s	+= _TL("Proj.4 Version is ") + Get_Version();
+	s	+= "\n";
+	s	+= "<a target=\"_blank\" href=\"http://trac.osgeo.org/proj/\">Proj.4 Homepage</a>";
+
+	return( s );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::_Set_Projection(const CSG_Projection &Projection, void **ppProjection, bool bInverse)
+{
+	PROJ4_FREE(*ppProjection);
+
+	//-------------------------------------------------
+	if( (*ppProjection = pj_init_plus(Projection.Get_Proj4())) == NULL )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("Proj4 [%s]: %s"), _TL("initialization"), SG_STR_MBTOSG(pj_strerrno(pj_errno))));
+
+		return( false );
+	}
+
+	//-------------------------------------------------
+	if( bInverse && ((PJ *)(*ppProjection))->inv == NULL )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("Proj4 [%s]: %s"), _TL("initialization"), _TL("inverse transformation not available")));
+
+		return( false );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Set_Source(const CSG_Projection &Projection)
+{
+	SG_UI_Msg_Add_Execution(CSG_String::Format(SG_T("\n%s: %s"), _TL("source"), Projection.Get_Proj4().c_str()), false);
+
+	return( _Set_Projection(Projection, &m_pSource,  true) && m_Source.Create(Projection) );
+}
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Set_Target(const CSG_Projection &Projection)
+{
+	SG_UI_Msg_Add_Execution(CSG_String::Format(SG_T("\n%s: %s"), _TL("target"), Projection.Get_Proj4().c_str()), false);
+
+	return( _Set_Projection(Projection, &m_pTarget, false) && m_Target.Create(Projection) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Set_Inverse(bool bOn)
+{
+	if( m_bInverse == bOn )
+	{
+		return( true );
+	}
+
+	if( m_pTarget && ((PJ *)m_pTarget)->inv )
+	{
+		m_bInverse	= bOn;
+
+		void *pTMP	= m_pSource;
+		m_pSource	= m_pTarget;
+		m_pTarget	= pTMP;
+
+		return( true );
+	}
+
+	SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("Proj4 [%s]: %s"), _TL("initialization"), _TL("inverse transformation not available")));
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Set_Precise_Mode(bool bOn)
+{
+	if( bOn )
+	{
+		if( m_pGCS == NULL )
+		{
+			return( (m_pGCS = pj_init_plus("+proj=longlat +datum=WGS84")) != NULL );
+		}
+	}
+	else
+	{
+		PROJ4_FREE(m_pGCS);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Get_Projection(double &x, double &y)	const
+{
+	if( !m_pSource || !m_pTarget )
+	{
+		return( false );
+	}
+
+	if( pj_is_latlong((PJ *)m_pSource) )
+	{
+		x	*= DEG_TO_RAD;
+		y	*= DEG_TO_RAD;
+	}
+
+	if( m_pGCS )	// precise datum conversion
+	{
+		if( pj_transform((PJ *)m_pSource, (PJ *)m_pGCS   , 1, 0, &x, &y, NULL) != 0
+		||  pj_transform((PJ *)m_pGCS   , (PJ *)m_pTarget, 1, 0, &x, &y, NULL) != 0 )
+		{
+			return( false );
+		}
+	}
+	else				// direct projection
+	{
+		if( pj_transform((PJ *)m_pSource, (PJ *)m_pTarget, 1, 0, &x, &y, NULL) != 0 )
+		{
+			return( false );
+		}
+	}
+
+	if( pj_is_latlong((PJ *)m_pTarget) )
+	{
+		x	*= RAD_TO_DEG;
+		y	*= RAD_TO_DEG;
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Get_Projection(TSG_Point &Point)	const
+{
+	return( Get_Projection(Point.x, Point.y) );
+}
+
+//---------------------------------------------------------
+bool CSG_CRSProjector::Get_Projection(CSG_Point &Point)	const
+{
+	double	x	= Point.Get_X();
+	double	y	= Point.Get_Y();
+
+	if( Get_Projection(x, y) )
+	{
+		Point.Assign(x, y);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/projection/pj_proj4/crs_transform.h b/src/modules/projection/pj_proj4/crs_transform.h
new file mode 100644
index 0000000..da5a8fd
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_transform.h
@@ -0,0 +1,126 @@
+/**********************************************************
+ * Version $Id: crs_transform.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    crs_transform.h                    //
+//                                                       //
+//                 Copyright (C) 2010 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__crs_transform_H
+#define HEADER_INCLUDED__crs_transform_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class pj_proj4_EXPORT CSG_CRSProjector
+{
+public:
+	CSG_CRSProjector(void);
+	virtual ~CSG_CRSProjector(void);
+
+	bool					Destroy						(void);
+
+	static CSG_String		Get_Version					(void);
+	static CSG_String		Get_Description				(void);
+
+	bool					Set_Source					(const CSG_Projection &Projection);
+	const CSG_Projection &	Get_Source					(void)	const		{	return( m_Source );	}
+
+	bool					Set_Target					(const CSG_Projection &Projection);
+	const CSG_Projection &	Get_Target					(void)	const		{	return( m_Target );	}
+
+	bool					Set_Inverse					(bool bOn = true);
+	bool					Get_Inverse					(void)	const		{	return( m_bInverse );	}
+
+	bool					Set_Precise_Mode			(bool bOn = true);
+	bool					Get_Precise_Mode			(void)	const		{	return( m_pGCS != NULL );	}
+
+	bool					Get_Projection				(double &x, double &y)	const;
+	bool					Get_Projection				(TSG_Point &Point)		const;
+	bool					Get_Projection				(CSG_Point &Point)		const;
+
+
+private:
+
+	bool					m_bInverse;
+
+	void					*m_pSource, *m_pTarget, *m_pGCS;
+
+	CSG_Projection			m_Source, m_Target;
+
+
+	bool					_Set_Projection			(const CSG_Projection &Projection, void **ppProjection, bool bInverse);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__crs_transform_H
diff --git a/src/modules/projection/pj_proj4/crs_transform_grid.cpp b/src/modules/projection/pj_proj4/crs_transform_grid.cpp
new file mode 100644
index 0000000..4b1abfc
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_transform_grid.cpp
@@ -0,0 +1,807 @@
+/**********************************************************
+ * Version $Id: crs_transform_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 crs_transform_grid.cpp                //
+//                                                       //
+//                 Copyright (C) 2010 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 "crs_transform_grid.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCRS_Transform_Grid::CCRS_Transform_Grid(bool bList)
+{
+	CSG_Parameter	*pNode;
+
+	m_bList	= bList;
+
+	//-----------------------------------------------------
+	Set_Name		(m_bList
+		? _TL("Coordinate Transformation (Grid List)")
+		: _TL("Coordinate Transformation (Grid)")
+	);
+
+	Set_Author		(SG_T("O. Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Coordinate transformation for grids.\n"
+	));
+
+	Set_Description	(Get_Description() + "\n" + CSG_CRSProjector::Get_Description());
+
+	//-----------------------------------------------------
+	if( m_bList )
+	{
+		pNode	= Parameters.Add_Grid_List(
+			NULL	, "SOURCE"		, _TL("Source"),
+			_TL(""),
+			PARAMETER_INPUT
+		);
+
+		Parameters.Add_Grid_List(
+			NULL	, "TARGET"		, _TL("Target"),
+			_TL(""),
+			PARAMETER_OUTPUT_OPTIONAL
+		);
+
+		m_Grid_Target.Add_Parameters_User  (Add_Parameters("GET_USER"  , _TL("User Defined Grid System"), _TL("")), false);
+		m_Grid_Target.Add_Parameters_System(Add_Parameters("GET_SYSTEM", _TL("Select Grid System")      , _TL("")));
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		pNode	= Parameters.Add_Grid(
+			NULL	, "SOURCE"		, _TL("Source"),
+			_TL(""),
+			PARAMETER_INPUT
+		);
+
+		m_Grid_Target.Add_Parameters_User  (Add_Parameters("GET_USER"  , _TL("User Defined Grid"), _TL("")));
+		m_Grid_Target.Add_Parameters_Grid  (Add_Parameters("GET_GRID"  , _TL("Select Grid")      , _TL("")));
+	}
+
+	//-----------------------------------------------------
+	Parameters.Add_Value(
+		pNode	, "CREATE_XY"	, _TL("Create X/Y Grids"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Grid_Output(NULL, "OUT_X", _TL("X Coordinates"), _TL(""));
+	Parameters.Add_Grid_Output(NULL, "OUT_Y", _TL("Y Coordinates"), _TL(""));
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		pNode	, "INTERPOLATION"	, _TL("Interpolation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("Nearest Neigbhor"),
+			_TL("Bilinear Interpolation"),
+			_TL("Inverse Distance Interpolation"),
+			_TL("Bicubic Spline Interpolation"),
+			_TL("B-Spline Interpolation")
+		), 4
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		pNode	, "TARGET_TYPE"	, _TL("Target"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("user defined grid system"),
+			_TL("existing grid system"),
+			_TL("points")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "TARGET_AREA"	, _TL("Use Target Area Polygon"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	//-----------------------------------------------------
+	CSG_Parameters	*pParameters	= Add_Parameters("POINTS", _TL("Points"), _TL(""));
+
+	pParameters->Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CCRS_Transform_Grid::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	CCRS_Transform::On_Parameter_Changed(pParameters, pParameter);
+
+	return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::On_Execute_Transformation(void)
+{
+	m_Interpolation	= Parameters("INTERPOLATION")->asInt();
+
+	//-----------------------------------------------------
+	if( m_bList )
+	{
+		int						i;
+		CSG_Parameters			Grids;
+		CSG_Parameter_Grid_List	*pSources, *pTargets, *pGrids;
+
+		pSources	= Parameters("SOURCE")->asGridList();
+		pTargets	= Parameters("TARGET")->asGridList();
+
+		pTargets->Del_Items();
+
+		pGrids		= Grids.Add_Grid_List(NULL, "GRD", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList();
+
+		for(i=0; i<pSources->Get_Count(); i++)
+		{
+			if( pSources->asGrid(i)->Get_Projection().is_Okay() )
+			{
+				pGrids->Add_Item(pSources->asGrid(i));
+			}
+			else
+			{
+				Error_Set(CSG_String::Format(SG_T("%s: %s\n"), _TL("unknown projection"), pSources->asGrid(i)->Get_Name()));
+			}
+		}
+
+		pSources	= Grids.Add_Grid_List(NULL, "SRC", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList();
+
+		while( pGrids->Get_Count() > 0 )
+		{
+			pSources->Add_Item(pGrids->asGrid(pGrids->Get_Count() - 1));
+			pGrids  ->Del_Item(pGrids->Get_Count() - 1);
+
+			for(i=pGrids->Get_Count()-1; i>=0; i--)
+			{
+				if( pGrids->asGrid(i)->Get_Projection() == pSources->asGrid(0)->Get_Projection() )
+				{
+					pSources->Add_Item(pGrids->asGrid(i));
+					pGrids  ->Del_Item(i);
+				}
+			}
+
+			m_Projector.Set_Inverse(false);
+
+			Transform(pSources);
+
+			pSources->Del_Items();
+		}
+
+		return( pTargets->Get_Count() > 0 );
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		return( Transform(Parameters("SOURCE")->asGrid()) );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid)
+{
+	if( pGrid->Get_Projection().is_Okay() && m_Projector.Set_Source(pGrid->Get_Projection()) )
+	{
+		TSG_Data_Type	Type	= m_Interpolation == 0 ? pGrid->Get_Type() : SG_DATATYPE_Float;
+
+		switch( Parameters("TARGET_TYPE")->asInt() )
+		{
+		case 0:	// create user defined grid...
+			if( Get_Target_System(pGrid->Get_System(), true) )
+			{
+				return( Transform(pGrid, m_Grid_Target.Get_User(Type)) );
+			}
+			break;
+
+		case 1:	// select existing grid system...
+			if( Dlg_Parameters("GET_GRID") )
+			{
+				return( Transform(pGrid, m_Grid_Target.Get_Grid(Type)) );
+			}
+			break;
+
+		case 2:	// points as target...
+			if( Dlg_Parameters("POINTS") )
+			{
+				CSG_Shapes	*pPoints	= Get_Parameters("POINTS")->Get_Parameter("POINTS")->asShapes();
+
+				if( pPoints == DATAOBJECT_NOTSET || pPoints == DATAOBJECT_CREATE )
+				{
+					Get_Parameters("POINTS")->Get_Parameter("POINTS")->Set_Value(pPoints = SG_Create_Shapes(SHAPE_TYPE_Point));
+				}
+
+				return( Transform(pGrid, pPoints) );
+			}
+			break;
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Transform(CSG_Parameter_Grid_List *pGrids)
+{
+	if( pGrids->Get_Count() > 0 && m_Projector.Set_Source(pGrids->asGrid(0)->Get_Projection()) )
+	{
+		CSG_Grid_System	System;
+
+		switch( Parameters("TARGET_TYPE")->asInt() )
+		{
+		case 0:	// create user defined grid system...
+			if( Get_Target_System(pGrids->asGrid(0)->Get_System(), true) && m_Grid_Target.Get_System_User(System) )
+			{
+				return( Transform(pGrids, Parameters("TARGET")->asGridList(), System) );
+			}
+			break;
+
+		case 1:	// select existing grid system...
+			if( Dlg_Parameters("GET_SYSTEM") && m_Grid_Target.Get_System(System) )
+			{
+				return( Transform(pGrids, Parameters("TARGET")->asGridList(), System) );
+			}
+			break;
+
+		case 2:	// points as target...
+			if( Dlg_Parameters("POINTS") )
+			{
+				CSG_Shapes	*pPoints	= Get_Parameters("POINTS")->Get_Parameter("POINTS")->asShapes();
+
+				if( pPoints == DATAOBJECT_NOTSET || pPoints == DATAOBJECT_CREATE )
+				{
+					Get_Parameters("POINTS")->Get_Parameter("POINTS")->Set_Value(pPoints = SG_Create_Shapes());
+				}
+
+				return( Transform(pGrids, pPoints) );
+			}
+			break;
+		}
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid, CSG_Grid *pTarget)
+{
+	if( !m_Projector.Set_Inverse(true) || !pTarget || !pGrid )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Grid	*pX, *pY;
+
+	if( !Parameters("CREATE_XY")->asBool() )
+	{
+		pX	= pY	= NULL;
+	}
+	else
+	{
+		Parameters("OUT_X")->Set_Value(pX	= SG_Create_Grid(pTarget->Get_System(), SG_DATATYPE_Float));
+		pX->Assign_NoData();
+		pX->Set_Name(_TL("X-Coordinate"));
+		pX->Get_Projection().Create(m_Projector.Get_Target());
+
+		Parameters("OUT_Y")->Set_Value(pY	= SG_Create_Grid(pTarget->Get_System(), SG_DATATYPE_Float));
+		pY->Assign_NoData();
+		pY->Set_Name(_TL("Y-Coordinate"));
+		pY->Get_Projection().Create(m_Projector.Get_Target());
+	}
+
+	//-----------------------------------------------------
+	Set_Target_Area(pGrid->Get_System(), pTarget->Get_System());
+
+	bool	bGeogCS_Adjust	= m_Projector.Get_Source().Get_Type() == SG_PROJ_TYPE_CS_Geographic && pGrid->Get_XMax() > 180.0;
+
+	//-------------------------------------------------
+	pTarget->Set_NoData_Value_Range	(pGrid->Get_NoData_Value(), pGrid->Get_NoData_hiValue());
+	pTarget->Set_ZFactor			(pGrid->Get_ZFactor());
+	pTarget->Set_Name				(CSG_String::Format(SG_T("%s"), pGrid->Get_Name()));
+	pTarget->Set_Unit				(pGrid->Get_Unit());
+	pTarget->Assign_NoData();
+	pTarget->Get_Projection().Create(m_Projector.Get_Target());
+
+	//-----------------------------------------------------
+	for(int y=0; y<pTarget->Get_NY() && Set_Progress(y, pTarget->Get_NY()); y++)
+	{
+		double	yTarget	= pTarget->Get_YMin() + y * pTarget->Get_Cellsize();
+
+		#pragma omp parallel for
+		for(int x=0; x<pTarget->Get_NX(); x++)
+		{
+			double	z, ySource, xSource	= pTarget->Get_XMin() + x * pTarget->Get_Cellsize();
+
+			if( is_In_Target_Area(x, y) && m_Projector.Get_Projection(xSource, ySource = yTarget) )
+			{
+				if( pX )	pX->Set_Value(x, y, xSource);
+				if( pY )	pY->Set_Value(x, y, ySource);
+
+				if( bGeogCS_Adjust && xSource < 0.0 )
+				{
+					xSource	+= 360.0;
+				}
+
+				if( pGrid->Get_Value(xSource, ySource, z, m_Interpolation) )
+				{
+					pTarget->Set_Value(x, y, z);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Target_Area.Destroy();
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Transform(CSG_Parameter_Grid_List *pSources, CSG_Parameter_Grid_List *pTargets, const CSG_Grid_System &Target_System)
+{
+	if( !m_Projector.Set_Inverse(true) || !pTargets || !pSources || pSources->Get_Count() < 1 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Grid	*pX, *pY;
+
+	if( !Parameters("CREATE_XY")->asBool() )
+	{
+		pX	= pY	= NULL;
+	}
+	else
+	{
+		Parameters("OUT_X")->Set_Value(pX	= SG_Create_Grid(Target_System, SG_DATATYPE_Float));
+		pX->Assign_NoData();
+		pX->Set_Name(_TL("X-Coordinate"));
+		pX->Get_Projection().Create(m_Projector.Get_Target());
+
+		Parameters("OUT_Y")->Set_Value(pY	= SG_Create_Grid(Target_System, SG_DATATYPE_Float));
+		pY->Assign_NoData();
+		pY->Set_Name(_TL("Y-Coordinate"));
+		pY->Get_Projection().Create(m_Projector.Get_Target());
+	}
+
+	//-----------------------------------------------------
+	bool	bGeogCS_Adjust	= m_Projector.Get_Source().Get_Type() == SG_PROJ_TYPE_CS_Geographic && pSources->asGrid(0)->Get_System().Get_XMax() > 180.0;
+
+	Set_Target_Area(pSources->asGrid(0)->Get_System(), Target_System);
+
+	//-----------------------------------------------------
+	int	i, n	= pTargets->Get_Count();
+
+	for(i=0; i<pSources->Get_Count(); i++)
+	{
+		CSG_Grid	*pSource	= pSources->asGrid(i);
+		CSG_Grid	*pTarget	= SG_Create_Grid(Target_System, m_Interpolation == 0 ? pSource->Get_Type() : SG_DATATYPE_Float);
+
+		if( pTarget )
+		{
+			pTarget->Set_NoData_Value_Range	(pSource->Get_NoData_Value(), pSource->Get_NoData_hiValue());
+			pTarget->Set_ZFactor			(pSource->Get_ZFactor());
+			pTarget->Set_Name				(CSG_String::Format(SG_T("%s"), pSource->Get_Name()));
+			pTarget->Set_Unit				(pSource->Get_Unit());
+			pTarget->Assign_NoData();
+			pTarget->Get_Projection().Create(m_Projector.Get_Target());
+
+			pTargets->Add_Item(pTarget);
+		}
+	}
+
+	//-------------------------------------------------
+	for(int y=0; y<Target_System.Get_NY() && Set_Progress(y, Target_System.Get_NY()); y++)
+	{
+		double	yTarget	= Target_System.Get_YMin() + y * Target_System.Get_Cellsize();
+
+		#pragma omp parallel for private(i)
+		for(int x=0; x<Target_System.Get_NX(); x++)
+		{
+			double	z, ySource, xSource	= Target_System.Get_XMin() + x * Target_System.Get_Cellsize();
+
+			if( is_In_Target_Area(x, y) && m_Projector.Get_Projection(xSource, ySource = yTarget) )
+			{
+				if( pX )	pX->Set_Value(x, y, xSource);
+				if( pY )	pY->Set_Value(x, y, ySource);
+
+				if( bGeogCS_Adjust && xSource < 0.0 )
+				{
+					xSource	+= 360.0;
+				}
+
+				for(i=0; i<pTargets->Get_Count(); i++)
+				{
+					if( pSources->asGrid(i)->Get_Value(xSource, ySource, z, m_Interpolation) )
+					{
+						pTargets->asGrid(n + i)->Set_Value(x, y, z);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Target_Area.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid, CSG_Shapes *pPoints)
+{
+	if( !pPoints || !pGrid )
+	{
+		return( false );
+	}
+
+	if( !m_Projector.Set_Source(pGrid->Get_Projection()) )
+	{
+		return( false );
+	}
+
+	int			x, y;
+	TSG_Point	Point;
+
+	pPoints->Create(SHAPE_TYPE_Point, _TL("Points"));
+	pPoints->Get_Projection()	= m_Projector.Get_Target();
+	pPoints->Add_Field(pGrid->Get_Name(), pGrid->Get_Type());
+
+	for(y=0, Point.y=pGrid->Get_YMin(); y<pGrid->Get_NY() && Set_Progress(y, pGrid->Get_NY()); y++, Point.y+=pGrid->Get_Cellsize())
+	{
+		for(x=0, Point.x=pGrid->Get_XMin(); x<pGrid->Get_NX(); x++, Point.x+=pGrid->Get_Cellsize())
+		{
+			TSG_Point	Point_Transformed	= Point;
+
+			if( !pGrid->is_NoData(x, y) && m_Projector.Get_Projection(Point_Transformed) )
+			{
+				CSG_Shape	*pPoint	= pPoints->Add_Shape();
+
+				pPoint->Add_Point(Point_Transformed);
+
+				pPoint->Set_Value(0, pGrid->asDouble(x, y));
+			}
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Transform(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pPoints)
+{
+	if( !pPoints || !pGrids || pGrids->Get_Count() < 1 )
+	{
+		return( false );
+	}
+
+	CSG_Grid	*pGrid	= pGrids->asGrid(0);
+
+	if( !m_Projector.Set_Source(pGrid->Get_Projection()) )
+	{
+		return( false );
+	}
+
+	int			x, y, i;
+	TSG_Point	Point;
+
+	pPoints->Create(SHAPE_TYPE_Point, _TL("Points"));
+	pPoints->Get_Projection()	= m_Projector.Get_Target();
+
+	for(i=0; i<pGrids->Get_Count(); i++)
+	{
+		pPoints->Add_Field(pGrids->asGrid(i)->Get_Name(), pGrids->asGrid(i)->Get_Type());
+	}
+
+	for(y=0, Point.y=pGrid->Get_YMin(); y<pGrid->Get_NY() && Set_Progress(y, pGrid->Get_NY()); y++, Point.y+=pGrid->Get_Cellsize())
+	{
+		for(x=0, Point.x=pGrid->Get_XMin(); x<pGrid->Get_NX(); x++, Point.x+=pGrid->Get_Cellsize())
+		{
+			TSG_Point	Point_Transformed	= Point;
+
+			if( m_Projector.Get_Projection(Point_Transformed) )
+			{
+				CSG_Shape	*pPoint	= pPoints->Add_Shape();
+
+				pPoint->Add_Point(Point_Transformed);
+
+				for(i=0; i<pGrids->Get_Count(); i++)
+				{
+					if( !pGrids->asGrid(i)->is_NoData(x, y) )
+					{
+						pPoint->Set_Value(i, pGrids->asGrid(i)->asDouble(x, y));
+					}
+					else
+					{
+						pPoint->Set_NoData(i);
+					}
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline void CCRS_Transform_Grid::Get_MinMax(TSG_Rect &r, double x, double y)
+{
+	if( m_Projector.Get_Projection(x, y) )
+	{
+		if( r.xMin > r.xMax )
+		{
+			r.xMin	= r.xMax	= x;
+		}
+		else if( r.xMin > x )
+		{
+			r.xMin	= x;
+		}
+		else if( r.xMax < x )
+		{
+			r.xMax	= x;
+		}
+
+		if( r.yMin > r.yMax )
+		{
+			r.yMin	= r.yMax	= y;
+		}
+		else if( r.yMin > y )
+		{
+			r.yMin	= y;
+		}
+		else if( r.yMax < y )
+		{
+			r.yMax	= y;
+		}
+	}
+}
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Get_Target_System(const CSG_Grid_System &System, bool bEdge)
+{
+	int			x, y, Resolution;
+	TSG_Rect	Extent;
+
+	Extent.xMin	= Extent.yMin	= 1.0;
+	Extent.xMax	= Extent.yMax	= 0.0;
+
+	Get_MinMax(Extent, System.Get_XMin(), System.Get_YMin());
+	Get_MinMax(Extent, System.Get_XMax(), System.Get_YMin());
+	Get_MinMax(Extent, System.Get_XMin(), System.Get_YMax());
+	Get_MinMax(Extent, System.Get_XMax(), System.Get_YMax());
+
+	Resolution	= 256;
+
+	switch( 1 )
+	{
+	case 1:	// edges
+		{
+			double	d;
+
+			int	yStep	= 1 + System.Get_NY() / Resolution;
+
+			for(y=0, d=System.Get_YMin(); y<System.Get_NY(); y+=yStep, d+=yStep*System.Get_Cellsize())
+			{
+				Get_MinMax(Extent, System.Get_XMin(), d);
+				Get_MinMax(Extent, System.Get_XMax(), d);
+			}
+
+			int	xStep	= 1 + System.Get_NX() / Resolution;
+
+			for(x=0, d=System.Get_XMin(); x<System.Get_NX(); x+=xStep, d+=xStep*System.Get_Cellsize())
+			{
+				Get_MinMax(Extent, d, System.Get_YMin());
+				Get_MinMax(Extent, d, System.Get_YMax());
+			}
+		}
+		break;
+
+	case 2:	// all cells
+		{
+			TSG_Point	p;
+
+			int	xStep	= 1 + System.Get_NX() / Resolution;
+			int	yStep	= 1 + System.Get_NY() / Resolution;
+
+			for(y=0, p.y=System.Get_YMin(); y<System.Get_NY() && Set_Progress(y, System.Get_NY()); y+=yStep, p.y+=yStep*System.Get_Cellsize())
+			{
+				for(x=0, p.x=System.Get_XMin(); x<System.Get_NX(); x+=xStep, p.x+=xStep*System.Get_Cellsize())
+				{
+					Get_MinMax(Extent, p.x, p.y);
+				}
+			}
+		}
+		break;
+	}
+
+	return(	is_Progress() && Extent.xMin < Extent.xMax && Extent.yMin < Extent.yMax
+		&&	m_Grid_Target.Init_User(Extent, System.Get_NY())
+		&&	Dlg_Parameters("GET_USER")
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Grid::Set_Target_Area(const CSG_Grid_System &Source, const CSG_Grid_System &Target)
+{
+	if( Parameters("TARGET_AREA")->asBool() == false )
+	{
+		m_Target_Area.Destroy();
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	CSG_Rect	r(Source.Get_Extent());
+
+	if( m_Projector.Get_Source().Get_Type() == SG_PROJ_TYPE_CS_Geographic )
+	{
+		if( r.Get_XMax() > 180.0 )	r.Move(-180.0, 0.0);
+		if( r.Get_YMin() < -90.0 )	r.m_rect.yMin	= -90.0;
+		if( r.Get_YMax() <  90.0 )	r.m_rect.yMax	=  90.0;
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes			Area(SHAPE_TYPE_Polygon);
+	CSG_Shape_Polygon	*pArea	= (CSG_Shape_Polygon *)Area.Add_Shape();
+	TSG_Point			p, q;
+	double				dx	= Source.Get_XRange() / 100.0;
+	double				dy	= Source.Get_YRange() / 100.0;
+
+	m_Projector.Set_Inverse(false);
+
+	for(p.x=r.Get_XMin(), p.y=r.Get_YMin(); p.y<r.Get_YMax(); p.y+=dy)
+	{
+		m_Projector.Get_Projection(q = p);	pArea->Add_Point(q);
+	}
+
+	for(p.x=r.Get_XMin(), p.y=r.Get_YMax(); p.x<r.Get_XMax(); p.x+=dx)
+	{
+		m_Projector.Get_Projection(q = p);	pArea->Add_Point(q);
+	}
+
+	for(p.x=r.Get_XMax(), p.y=r.Get_YMax(); p.y>r.Get_YMin(); p.y-=dy)
+	{
+		m_Projector.Get_Projection(q = p);	pArea->Add_Point(q);
+	}
+
+	for(p.x=r.Get_XMax(), p.y=r.Get_YMin(); p.x>r.Get_XMin(); p.x-=dx)
+	{
+		m_Projector.Get_Projection(q = p);	pArea->Add_Point(q);
+	}
+
+	m_Projector.Set_Inverse(true);
+
+	//-----------------------------------------------------
+	m_Target_Area.Create(Target, SG_DATATYPE_Char);
+	m_Target_Area.Set_NoData_Value(0);
+
+	for(int y=0; y<m_Target_Area.Get_NY() && Set_Progress(y, m_Target_Area.Get_NY()); y++)
+	{
+		double	yWorld	= Target.Get_yGrid_to_World(y);
+
+		#pragma omp parallel for
+		for(int x=0; x<m_Target_Area.Get_NX(); x++)
+		{
+			m_Target_Area.Set_Value(x, y, pArea->Contains(Target.Get_xGrid_to_World(x), yWorld) ? 1 : 0);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+inline bool CCRS_Transform_Grid::is_In_Target_Area(int x, int y)
+{
+	return( !m_Target_Area.is_Valid() || m_Target_Area.is_InGrid(x, y) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/projection/pj_proj4/crs_transform_grid.h b/src/modules/projection/pj_proj4/crs_transform_grid.h
new file mode 100644
index 0000000..7da2027
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_transform_grid.h
@@ -0,0 +1,125 @@
+/**********************************************************
+ * Version $Id: crs_transform_grid.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  crs_transform_grid.h                 //
+//                                                       //
+//                 Copyright (C) 2010 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__crs_transform_grid_H
+#define HEADER_INCLUDED__crs_transform_grid_H
+
+//---------------------------------------------------------
+#include "crs_base.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class pj_proj4_EXPORT CCRS_Transform_Grid : public CCRS_Transform
+{
+public:
+	CCRS_Transform_Grid(bool bList);
+
+
+protected:
+
+	virtual int					On_Parameter_Changed		(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute_Transformation	(void);
+
+
+private:
+
+	bool						m_bList;
+
+	int							m_Interpolation;
+
+	CSG_Parameters_Grid_Target	m_Grid_Target;
+
+	CSG_Grid					m_Target_Area;
+
+
+	bool						Transform					(CSG_Grid                *pGrid );
+	bool						Transform					(CSG_Parameter_Grid_List *pGrids);
+
+	bool						Transform					(CSG_Grid                *pGrid , CSG_Grid                *pTarget );
+	bool						Transform					(CSG_Parameter_Grid_List *pGrids, CSG_Parameter_Grid_List *pTargets, const CSG_Grid_System &Target_System);
+
+	bool						Transform					(CSG_Grid                *pGrid , CSG_Shapes *pPoints);
+	bool						Transform					(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pPoints);
+
+	void						Get_MinMax					(TSG_Rect &r, double x, double y);
+	bool						Get_Target_System			(const CSG_Grid_System &System, bool bEdge);
+
+	bool						Set_Target_Area				(const CSG_Grid_System &Source, const CSG_Grid_System &Target);
+	bool						is_In_Target_Area			(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__crs_transform_grid_H
diff --git a/src/modules/projection/pj_proj4/crs_transform_shapes.cpp b/src/modules/projection/pj_proj4/crs_transform_shapes.cpp
new file mode 100644
index 0000000..af6ae44
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_transform_shapes.cpp
@@ -0,0 +1,254 @@
+/**********************************************************
+ * Version $Id: crs_transform_shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                crs_transform_shapes.cpp               //
+//                                                       //
+//                 Copyright (C) 2010 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 "crs_transform_shapes.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCRS_Transform_Shapes::CCRS_Transform_Shapes(bool bList)
+{
+	m_bList	= bList;
+
+	//-----------------------------------------------------
+	Set_Name		(m_bList
+		? _TL("Coordinate Transformation (Shapes List)")
+		: _TL("Coordinate Transformation (Shapes)")
+	);
+
+	Set_Author		(SG_T("O. Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Coordinate transformation for shapes.\n"
+	));
+
+	Set_Description	(Get_Description() + "\n" + CSG_CRSProjector::Get_Description());
+
+	//-----------------------------------------------------
+	if( m_bList )
+	{
+		Parameters.Add_Shapes_List(
+			NULL	, "SOURCE"	, _TL("Source"),
+			_TL(""),
+			PARAMETER_INPUT
+		);
+
+		Parameters.Add_Shapes_List(
+			NULL	, "TARGET"	, _TL("Target"),
+			_TL(""),
+			PARAMETER_OUTPUT_OPTIONAL
+		);
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		Parameters.Add_Shapes(
+			NULL	, "SOURCE"	, _TL("Source"),
+			_TL(""),
+			PARAMETER_INPUT
+		);
+
+		Parameters.Add_Shapes(
+			NULL	, "TARGET"	, _TL("Target"),
+			_TL(""),
+			PARAMETER_OUTPUT
+		);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Shapes::On_Execute_Transformation(void)
+{
+	if( m_bList )
+	{
+		CSG_Parameter_Shapes_List	*pSources, *pTargets;
+
+		pSources	= Parameters("SOURCE")->asShapesList();
+		pTargets	= Parameters("TARGET")->asShapesList();
+
+		pTargets->Del_Items();
+
+		for(int i=0; i<pSources->Get_Count() && Process_Get_Okay(false); i++)
+		{
+			CSG_Shapes	*pSource	= pSources->asShapes(i);
+			CSG_Shapes	*pTarget	= SG_Create_Shapes(pSource);
+
+			if( Transform(pSource, pTarget) )
+			{
+				pTargets->Add_Item(pTarget);
+			}
+			else
+			{
+				delete(pTarget);
+			}
+		}
+
+		return( pTargets->Get_Count() > 0 );
+	}
+	else
+	{
+		CSG_Shapes	*pSource	= Parameters("SOURCE")->asShapes();
+		CSG_Shapes	*pTarget	= Parameters("TARGET")->asShapes();
+
+		if( pSource == pTarget )
+		{
+			pTarget	= SG_Create_Shapes(pSource);
+
+			if( Transform(pSource, pTarget) )
+			{
+				pSource->Assign(pTarget);
+
+				return( true );
+			}
+			else
+			{
+				delete(pTarget);
+
+				return( false );
+			}
+		}
+		else
+		{
+			pTarget->Create(pSource->Get_Type(), pSource->Get_Name(), pSource, pSource->Get_Vertex_Type());
+		}
+
+		return( Transform(pSource, pTarget) );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCRS_Transform_Shapes::Transform(CSG_Shapes *pSource, CSG_Shapes *pTarget)
+{
+	if( !pTarget || !pSource || !pSource->is_Valid() )
+	{
+		return( false );
+	}
+
+	if( !m_Projector.Set_Source(pSource->Get_Projection()) )
+	{
+		return( false );
+	}
+
+	int		nDropped	= 0;
+
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s"), _TL("Processing"), pSource->Get_Name()));
+
+	for(int iShape=0; iShape<pSource->Get_Count() && Set_Progress(iShape, pSource->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape_Source	= pSource->Get_Shape(iShape);
+		CSG_Shape	*pShape_Target	= pTarget->Add_Shape(pShape_Source, SHAPE_COPY_ATTR);
+
+		for(int iPart=0; iPart<pShape_Source->Get_Part_Count() && pShape_Target; iPart++)
+		{
+			for(int iPoint=0; iPoint<pShape_Source->Get_Point_Count(iPart) && pShape_Target; iPoint++)
+			{
+				TSG_Point	Point	= pShape_Source->Get_Point(iPoint, iPart);
+
+				if( m_Projector.Get_Projection(Point.x, Point.y) )
+				{
+					pShape_Target->Add_Point(Point.x, Point.y, iPart);
+				}
+				else
+				{
+					nDropped++;
+
+					pTarget->Del_Shape(pShape_Target);
+
+					pShape_Target	= NULL;
+				}
+			}
+		}
+	}
+
+	if( nDropped > 0 )
+	{
+		Message_Add(CSG_String::Format(SG_T("%s: %d %s"), pTarget->Get_Name(), nDropped, _TL("shapes have been dropped")));
+	}
+
+	pTarget->Get_Projection() = m_Projector.Get_Target();
+
+	return( pTarget->Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/projection/pj_proj4/crs_transform_shapes.h b/src/modules/projection/pj_proj4/crs_transform_shapes.h
new file mode 100644
index 0000000..af2aa61
--- /dev/null
+++ b/src/modules/projection/pj_proj4/crs_transform_shapes.h
@@ -0,0 +1,103 @@
+/**********************************************************
+ * Version $Id: crs_transform_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 crs_transform_shapes.h                //
+//                                                       //
+//                 Copyright (C) 2010 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__crs_transform_shapes_H
+#define HEADER_INCLUDED__crs_transform_shapes_H
+
+//---------------------------------------------------------
+#include "crs_base.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class pj_proj4_EXPORT CCRS_Transform_Shapes : public CCRS_Transform
+{
+public:
+	CCRS_Transform_Shapes(bool bList);
+
+
+protected:
+
+	virtual bool			On_Execute_Transformation	(void);
+
+	bool					Transform					(CSG_Shapes *pSource, CSG_Shapes *pTarget);
+
+
+private:
+
+	bool					m_bList;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__crs_transform_shapes_H
diff --git a/src/modules/projection/pj_proj4/gcs_graticule.cpp b/src/modules/projection/pj_proj4/gcs_graticule.cpp
new file mode 100644
index 0000000..50c6a06
--- /dev/null
+++ b/src/modules/projection/pj_proj4/gcs_graticule.cpp
@@ -0,0 +1,592 @@
+/**********************************************************
+ * Version $Id: gcs_graticule.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   gcs_graticule.cpp                   //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "gcs_graticule.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define AXIS_LEFT	1
+#define AXIS_RIGHT	2
+#define AXIS_BOTTOM	3
+#define AXIS_TOP	4
+
+//---------------------------------------------------------
+enum
+{
+	DEG_PREC_AUTO,
+	DEG_PREC_FULL,
+	DEG_PREC_SEC,
+	DEG_PREC_MIN,
+	DEG_PREC_DEG
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGCS_Graticule::CGCS_Graticule(void)
+{
+	CSG_Parameter	*pNode_0, *pNode_1;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Latitude/Longitude Graticule"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2014"));
+
+	Set_Description	(_TW(
+		"Creates a longitude/latitude graticule for the extent and projection of the input shapes layer. "
+	));
+
+	Set_Description	(Get_Description() + "\n" + CSG_CRSProjector::Get_Description());
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "GRATICULE"	, _TL("Graticule"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Line
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "COORDS"		, _TL("Frame Coordinates"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	pNode_0	= Parameters.Add_Node(
+		NULL	, "NODE_GRID"	, _TL("Graticule"),
+		_TL("")
+	);
+
+	pNode_1 = Parameters.Add_Node(pNode_0, "NODE_X"		, _TL("X Range"), _TL(""));
+	Parameters.Add_Value(pNode_1, "XMIN", _TL("Minimum"), _TL(""), PARAMETER_TYPE_Double);
+	Parameters.Add_Value(pNode_1, "XMAX", _TL("Maximum"), _TL(""), PARAMETER_TYPE_Double);
+
+	pNode_1 = Parameters.Add_Node(pNode_0, "NODE_Y"		, _TL("Y Range"), _TL(""));
+	Parameters.Add_Value(pNode_1, "YMIN", _TL("Minimum"), _TL(""), PARAMETER_TYPE_Double);
+	Parameters.Add_Value(pNode_1, "YMAX", _TL("Maximum"), _TL(""), PARAMETER_TYPE_Double);
+
+	Parameters.Add_Choice(
+		pNode_0	, "INTERVAL"	, _TL("Interval"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("fixed interval"),
+			_TL("fitted interval")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		pNode_0	, "FIXED"		, _TL("Fixed Interval (Degree)"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true, 20.0
+	);
+
+	Parameters.Add_Value(
+		pNode_0	, "FITTED"		, _TL("Number of Intervals"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 10, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode_0	, "RESOLUTION"	, _TL("Minimum Resolution (Degree)"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.5, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGCS_Graticule::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_GRID"  ))
+	||	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_SHAPES")) )
+	{
+		CSG_Rect	r(!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_GRID"))
+			? pParameter->asParameters()->Get_Parameter("PICK")->asGrid  ()->Get_Extent()
+			: pParameter->asParameters()->Get_Parameter("PICK")->asShapes()->Get_Extent()
+		);
+
+		if( r.Get_XRange() > 0.0 && r.Get_YRange() > 0.0 )
+		{
+			pParameters->Get_Parameter("XMIN")->Set_Value(r.Get_XMin());
+			pParameters->Get_Parameter("XMAX")->Set_Value(r.Get_XMax());
+			pParameters->Get_Parameter("YMIN")->Set_Value(r.Get_YMin());
+			pParameters->Get_Parameter("YMAX")->Set_Value(r.Get_YMax());
+		}
+	}
+
+	return( CCRS_Base::On_Parameter_Changed(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+int CGCS_Graticule::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INTERVAL")) )
+	{
+		pParameters->Get_Parameter("FIXED" )->Set_Enabled(pParameter->asInt() == 0);
+		pParameters->Get_Parameter("FITTED")->Set_Enabled(pParameter->asInt() == 1);
+	}
+
+	return( CCRS_Base::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGCS_Graticule::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Projection	Projection;
+
+	if( !Get_Projection(Projection) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_Projector.Set_Source(CSG_Projection("+proj=longlat +ellps=WGS84 +datum=WGS84", SG_PROJ_FMT_Proj4));
+
+	if( !m_Projector.Set_Target(Projection) )
+	{
+		m_Projector.Destroy();
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Rect	Extent(
+		Parameters("XMIN")->asDouble(),
+		Parameters("YMIN")->asDouble(),
+		Parameters("XMAX")->asDouble(),
+		Parameters("YMAX")->asDouble()
+	);
+
+	if( !Get_Graticule(Extent) )
+	{
+		m_Projector.Destroy();
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_Projector.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGCS_Graticule::Get_Graticule(const CSG_Rect &Extent)
+{
+	double		x, y, Interval;
+	CSG_Rect	r;
+
+	if( !Get_Extent(Extent, r) || (Interval = Get_Interval(r)) <= 0.0 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	r.m_rect.xMin	= Interval * floor(r.Get_XMin() / Interval);
+	r.m_rect.xMax	= Interval * ceil (r.Get_XMax() / Interval);
+	r.m_rect.yMin	= Interval * floor(r.Get_YMin() / Interval);
+	r.m_rect.yMax	= Interval * ceil (r.Get_YMax() / Interval);
+
+	r.Inflate(Interval, false);
+
+	if( r.Get_XMin() < -180.0 )	r.m_rect.xMin	= -180.0;
+	if( r.Get_XMax() >  180.0 )	r.m_rect.xMax	=  180.0;
+	if( r.Get_YMin() <  -90.0 )	r.m_rect.yMin	=  -90.0;
+	if( r.Get_YMax() >   90.0 )	r.m_rect.yMax	=   90.0;
+
+	//-----------------------------------------------------
+	double	Resolution	= Parameters("RESOLUTION")->asDouble();	if( Resolution <= 0.0 )	Resolution	= Interval;
+
+	if( Interval > Resolution )
+	{
+		Resolution	= Interval / ceil(Interval / Resolution);
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pGraticule	= Parameters("GRATICULE")->asShapes();
+
+	pGraticule->Create(SHAPE_TYPE_Line);
+	pGraticule->Set_Name(_TL("Graticule"));
+
+	pGraticule->Add_Field("TYPE"  , SG_DATATYPE_String);
+	pGraticule->Add_Field("LABEL" , SG_DATATYPE_String);
+	pGraticule->Add_Field("DEGREE", SG_DATATYPE_Double);
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pCoordinates	= Parameters("COORDS")->asShapes();
+
+	if( pCoordinates )
+	{
+		pCoordinates->Create(SHAPE_TYPE_Point);
+		pCoordinates->Set_Name(_TL("Coordinates"));
+
+		pCoordinates->Add_Field("TYPE" , SG_DATATYPE_String);
+		pCoordinates->Add_Field("LABEL", SG_DATATYPE_String);
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes	Clip(SHAPE_TYPE_Polygon);
+	CSG_Shape	*pClip	= Clip.Add_Shape();
+
+	pClip->Add_Point(Extent.Get_XMin(), Extent.Get_YMin());
+	pClip->Add_Point(Extent.Get_XMin(), Extent.Get_YMax());
+	pClip->Add_Point(Extent.Get_XMax(), Extent.Get_YMax());
+	pClip->Add_Point(Extent.Get_XMax(), Extent.Get_YMin());
+	pClip->Add_Point(Extent.Get_XMin(), Extent.Get_YMin());
+
+	//-----------------------------------------------------
+	for(y=r.Get_YMin(); y<=r.Get_YMax(); y+=Interval)
+	{
+		CSG_Shape	*pLine	= pGraticule->Add_Shape();
+
+		pLine->Set_Value(0, "LAT");
+		pLine->Set_Value(1, Get_Degree(y, DEG_PREC_DEG));
+		pLine->Set_Value(2, y);
+
+		for(x=r.Get_XMin(); x<=r.Get_XMax(); x+=Interval)
+		{
+			CSG_Point	p(x, y);	m_Projector.Get_Projection(p);	pLine->Add_Point(p);
+
+			if( Resolution < Interval && x < r.Get_XMax() )
+			{
+				for(double i=x+Resolution; i<x+Interval; i+=Resolution)
+				{
+					CSG_Point	p(i, y);	m_Projector.Get_Projection(p);	pLine->Add_Point(p);
+				}
+			}
+		}
+
+		Get_Coordinate(Extent, pCoordinates, pLine, AXIS_LEFT);
+		Get_Coordinate(Extent, pCoordinates, pLine, AXIS_RIGHT);
+
+		if( !SG_Polygon_Intersection(pLine, pClip) )
+		{
+			pGraticule->Del_Shape(pLine);
+		}
+	}
+
+	//-----------------------------------------------------
+	for(x=r.Get_XMin(); x<=r.Get_XMax(); x+=Interval)
+	{
+		CSG_Shape	*pLine	= pGraticule->Add_Shape();
+
+		pLine->Set_Value(0, "LON");
+		pLine->Set_Value(1, Get_Degree(x, DEG_PREC_DEG));
+		pLine->Set_Value(2, x);
+
+		for(y=r.Get_YMin(); y<=r.Get_YMax(); y+=Interval)
+		{
+			CSG_Point	p(x, y);	m_Projector.Get_Projection(p);	pLine->Add_Point(p);
+
+			if( Resolution < Interval && y < r.Get_YMax() )
+			{
+				for(double i=y+Resolution; i<y+Interval; i+=Resolution)
+				{
+					CSG_Point	p(x, i);	m_Projector.Get_Projection(p);	pLine->Add_Point(p);
+				}
+			}
+		}
+
+		Get_Coordinate(Extent, pCoordinates, pLine, AXIS_BOTTOM);
+		Get_Coordinate(Extent, pCoordinates, pLine, AXIS_TOP);
+
+		if( !SG_Polygon_Intersection(pLine, pClip) )
+		{
+			pGraticule->Del_Shape(pLine);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGCS_Graticule::Get_Coordinate(const CSG_Rect &Extent, CSG_Shapes *pCoordinates, CSG_Shape *pLine, int Axis)
+{
+	if( !pCoordinates || !Extent.Intersects(pLine->Get_Extent()) || pLine->Get_Point_Count(0) < 2 )
+	{
+		return( false );
+	}
+
+	TSG_Point	A[2], B[2], C;
+
+	switch( Axis )
+	{
+	case AXIS_LEFT  : A[0].x = A[1].x = Extent.Get_XMin(); A[0].y = Extent.Get_YMin(); A[1].y = Extent.Get_YMax(); break;
+	case AXIS_RIGHT : A[0].x = A[1].x = Extent.Get_XMax(); A[0].y = Extent.Get_YMin(); A[1].y = Extent.Get_YMax(); break;
+	case AXIS_BOTTOM: A[0].y = A[1].y = Extent.Get_YMin(); A[0].x = Extent.Get_XMin(); A[1].x = Extent.Get_XMax(); break;
+	case AXIS_TOP   : A[0].y = A[1].y = Extent.Get_YMax(); A[0].x = Extent.Get_XMin(); A[1].x = Extent.Get_XMax(); break;
+
+	default:
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	B[1]	= pLine->Get_Point(0);
+
+	for(int i=1; i<pLine->Get_Point_Count(); i++)
+	{
+		B[0]	= B[1];
+		B[1]	= pLine->Get_Point(i);
+
+		if( SG_Get_Crossing(C, A[0], A[1], B[0], B[1], true) )
+		{
+			CSG_Shape	*pPoint	= pCoordinates->Add_Shape();
+			pPoint->Add_Point(C);
+			pPoint->Set_Value(0, CSG_String(pLine->asString(0)) + (Axis == AXIS_LEFT || Axis == AXIS_BOTTOM ? "_MIN" : "_MAX"));
+			pPoint->Set_Value(1, pLine->asString(1));
+
+			return( true );
+		}
+	}
+
+	//-----------------------------------------------------
+	switch( Axis )
+	{
+	case AXIS_LEFT  : C	= pLine->Get_Point(0, 0, true ); break;
+	case AXIS_RIGHT : C	= pLine->Get_Point(0, 0, false); break;
+	case AXIS_BOTTOM: C	= pLine->Get_Point(0, 0, true ); break;
+	case AXIS_TOP   : C	= pLine->Get_Point(0, 0, false); break;
+	}
+
+	if( Extent.Contains(C) )
+	{
+		CSG_Shape	*pPoint	= pCoordinates->Add_Shape();
+		pPoint->Add_Point(C);
+		pPoint->Set_Value(0, CSG_String(pLine->asString(0)) + (Axis == AXIS_LEFT || Axis == AXIS_BOTTOM ? "_MIN" : "_MAX"));
+		pPoint->Set_Value(1, pLine->asString(1));
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CGCS_Graticule::Get_Interval(const CSG_Rect &Extent)
+{
+	if( Parameters("INTERVAL")->asInt() == 0 )
+	{
+		return( Parameters("FIXED")->asDouble() );
+	}
+
+	double	Interval	= Extent.Get_XRange() > Extent.Get_YRange() ? Extent.Get_XRange() : Extent.Get_YRange();
+
+	if( Interval > 360 )
+	{
+		Interval	= 360;
+	}
+
+	Interval	= Interval / Parameters("FITTED")->asInt();
+
+	double	d	= pow(10.0, (int)(log10(Interval)) - (Interval < 1.0 ? 1.0 : 0.0));
+
+	Interval	= (int)(Interval / d) * d;
+
+	return( Interval );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGCS_Graticule::Get_Extent(const CSG_Rect &Extent, CSG_Rect &r)
+{
+	if( m_Projector.Set_Inverse() )
+	{
+		double		x, y, d;
+
+		CSG_Point	p(Extent.Get_XMin(), Extent.Get_YMin());
+		
+		m_Projector.Get_Projection(p);	r.Assign(p, p);
+
+		d	= Extent.Get_XRange() / 10.0;
+
+		for(y=Extent.Get_YMin(), x=Extent.Get_XMin(); x<=Extent.Get_XMax(); x+=d)
+		{
+			p.Assign(x, y);	m_Projector.Get_Projection(p);	r.Union(p);
+		}
+
+		for(y=Extent.Get_YMax(), x=Extent.Get_XMin(); x<=Extent.Get_XMax(); x+=d)
+		{
+			p.Assign(x, y);	m_Projector.Get_Projection(p);	r.Union(p);
+		}
+
+		d	= Extent.Get_YRange() / 10.0;
+
+		for(x=Extent.Get_XMin(), y=Extent.Get_YMin(); y<=Extent.Get_YMax(); y+=d)
+		{
+			p.Assign(x, y);	m_Projector.Get_Projection(p);	r.Union(p);
+		}
+
+		for(x=Extent.Get_XMax(), y=Extent.Get_YMin(); y<=Extent.Get_YMax(); y+=d)
+		{
+			p.Assign(x, y);	m_Projector.Get_Projection(p);	r.Union(p);
+		}
+
+		m_Projector.Set_Inverse(false);
+
+		if( r.Get_XMin() < -180 ) r.m_rect.xMin = -180; else if( r.Get_XMax() > 180 ) r.m_rect.xMax = 180;
+		if( r.Get_YMin() <  -90 ) r.m_rect.yMin =  -90; else if( r.Get_YMax() >  90 ) r.m_rect.yMax =  90;
+
+		return( r.Get_XRange() > 0.0 && r.Get_YRange() > 0.0 );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CGCS_Graticule::Get_Degree(double Value, int Precision)
+{
+	if( Precision == DEG_PREC_DEG )
+	{
+		return( SG_Get_String(Value, -12) + "\xb0" );
+	}
+
+	SG_Char		c;
+	int			d, h;
+	double		s;
+	CSG_String	String;
+
+	if( Value < 0.0 )
+	{
+		Value	= -Value;
+		c		= SG_T('-');
+	}
+	else
+	{
+		c		= SG_T('+');
+	}
+
+	Value	= fmod(Value, 360.0);
+	d		= (int)Value;
+	Value	= 60.0 * (Value - d);
+	h		= (int)Value;
+	Value	= 60.0 * (Value - h);
+	s		= Value;
+
+	if( s > 0.0 || Precision == DEG_PREC_FULL )
+	{
+		String.Printf(SG_T("%c%d\xb0%02d'%02.*f''"), c, d, h, SG_Get_Significant_Decimals(s), s);
+	}
+	else if( h > 0 || Precision == DEG_PREC_MIN )
+	{
+		String.Printf(SG_T("%c%d\xb0%02d'"        ), c, d, h);
+	}
+	else
+	{
+		String.Printf(SG_T("%c%d\xb0"             ), c, d);
+	}
+
+	return( String );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/projection/pj_proj4/gcs_graticule.h b/src/modules/projection/pj_proj4/gcs_graticule.h
new file mode 100644
index 0000000..45a54e2
--- /dev/null
+++ b/src/modules/projection/pj_proj4/gcs_graticule.h
@@ -0,0 +1,113 @@
+/**********************************************************
+ * Version $Id: gcs_graticule.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Projection_Proj4                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    gcs_graticule.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__gcs_graticule_H
+#define HEADER_INCLUDED__gcs_graticule_H
+
+//---------------------------------------------------------
+#include "crs_base.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGCS_Graticule : public CCRS_Base
+{
+public:
+	CGCS_Graticule(void);
+
+	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("R:Tools") );	}
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int				On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+	CSG_CRSProjector		m_Projector;
+
+
+	bool					Get_Graticule			(const CSG_Rect &Extent);
+	bool					Get_Extent				(const CSG_Rect &Extent, CSG_Rect &rGCS);
+	bool					Get_Coordinate			(const CSG_Rect &Extent, CSG_Shapes *pCoordinates, CSG_Shape *pLine, int Axis);
+	double					Get_Interval			(const CSG_Rect &Extent);
+	CSG_String				Get_Degree				(double Value, int Precision);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__gcs_graticule_H
diff --git a/src/modules_projection/pj_proj4/pj_proj4/gcs_lon_range.cpp b/src/modules/projection/pj_proj4/gcs_lon_range.cpp
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/gcs_lon_range.cpp
rename to src/modules/projection/pj_proj4/gcs_lon_range.cpp
diff --git a/src/modules_projection/pj_proj4/pj_proj4/gcs_lon_range.h b/src/modules/projection/pj_proj4/gcs_lon_range.h
similarity index 100%
rename from src/modules_projection/pj_proj4/pj_proj4/gcs_lon_range.h
rename to src/modules/projection/pj_proj4/gcs_lon_range.h
diff --git a/src/modules/shapes/Makefile.in b/src/modules/shapes/Makefile.in
index f0ceefc..fea3696 100644
--- a/src/modules/shapes/Makefile.in
+++ b/src/modules/shapes/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -278,11 +302,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -346,6 +370,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -409,6 +437,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -444,13 +486,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -485,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -566,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp b/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp
index 3f615a2..e00dc63 100644
--- a/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Classes_To_Shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Grid_Classes_To_Shapes.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -160,7 +160,7 @@ bool CGrid_Classes_To_Shapes::On_Execute(void)
 //---------------------------------------------------------
 bool CGrid_Classes_To_Shapes::Get_Classes(void)
 {
-	long		i;
+	sLong		i;
 	int			id, x, y;
 	double		Value;
 	CSG_Grid	*pGrid;
diff --git a/src/modules/shapes/shapes_grid/Makefile.in b/src/modules/shapes/shapes_grid/Makefile.in
index 274926a..8b1f22e 100644
--- a/src/modules/shapes/shapes_grid/Makefile.in
+++ b/src/modules/shapes/shapes_grid/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_grid
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libshapes_grid_la_DEPENDENCIES =  \
@@ -108,6 +131,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libshapes_grid_la_SOURCES)
 DIST_SOURCES = $(libshapes_grid_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -133,6 +161,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -160,6 +189,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -172,6 +202,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -201,6 +232,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -234,7 +266,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -330,7 +361,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -338,6 +368,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -353,13 +385,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libshapes_grid.la: $(libshapes_grid_la_OBJECTS) $(libshapes_grid_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libshapes_grid.la: $(libshapes_grid_la_OBJECTS) $(libshapes_grid_la_DEPENDENCIES) $(EXTRA_libshapes_grid_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libshapes_grid_la_OBJECTS) $(libshapes_grid_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -458,6 +492,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -508,10 +556,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -597,18 +650,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/shapes/shapes_lines/MLB_Interface.cpp b/src/modules/shapes/shapes_lines/MLB_Interface.cpp
index 4f69ee3..b84fb3e 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: MLB_Interface.cpp 1973 2014-02-07 11:24:19Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -100,6 +100,7 @@ CSG_String Get_Info(int i)
 #include "line_polygon_intersection.h"
 #include "line_simplification.h"
 #include "line_dissolve.h"
+#include "line_split_with_lines.h"
 
 
 //---------------------------------------------------------
@@ -115,9 +116,11 @@ CSG_Module *		Create_Module(int i)
 	case  3:	return( new CLine_Polygon_Intersection );
 	case  4:	return( new CLine_Simplification );
 	case  5:	return( new CLine_Dissolve );
-	}
+	case  6:	return( new CLine_Split_with_Lines );
 
-	return( NULL );
+	case 10:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
 }
 
 
diff --git a/src/modules/shapes/shapes_lines/Makefile.am b/src/modules/shapes/shapes_lines/Makefile.am
index 36d90b2..5fdd14b 100644
--- a/src/modules/shapes/shapes_lines/Makefile.am
+++ b/src/modules/shapes/shapes_lines/Makefile.am
@@ -19,6 +19,7 @@ Lines_From_Polygons.cpp\
 line_polygon_intersection.cpp\
 line_properties.cpp\
 line_simplification.cpp\
+line_split_with_lines.cpp\
 MLB_Interface.cpp\
 line_dissolve.h\
 Lines_From_Points.h\
@@ -26,6 +27,7 @@ Lines_From_Polygons.h\
 line_polygon_intersection.h\
 line_properties.h\
 line_simplification.h\
+line_split_with_lines.h\
 MLB_Interface.h
 
 libshapes_lines_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules/shapes/shapes_lines/Makefile.in b/src/modules/shapes/shapes_lines/Makefile.in
index 1f5a19c..6a73f23 100644
--- a/src/modules/shapes/shapes_lines/Makefile.in
+++ b/src/modules/shapes/shapes_lines/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_lines
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,13 +89,20 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libshapes_lines_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 am_libshapes_lines_la_OBJECTS = line_dissolve.lo Lines_From_Points.lo \
 	Lines_From_Polygons.lo line_polygon_intersection.lo \
-	line_properties.lo line_simplification.lo MLB_Interface.lo
+	line_properties.lo line_simplification.lo \
+	line_split_with_lines.lo MLB_Interface.lo
 libshapes_lines_la_OBJECTS = $(am_libshapes_lines_la_OBJECTS)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -104,6 +128,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libshapes_lines_la_SOURCES)
 DIST_SOURCES = $(libshapes_lines_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -129,6 +158,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -156,6 +186,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -168,6 +199,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -197,6 +229,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -230,7 +263,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -268,6 +300,7 @@ Lines_From_Polygons.cpp\
 line_polygon_intersection.cpp\
 line_properties.cpp\
 line_simplification.cpp\
+line_split_with_lines.cpp\
 MLB_Interface.cpp\
 line_dissolve.h\
 Lines_From_Points.h\
@@ -275,6 +308,7 @@ Lines_From_Polygons.h\
 line_polygon_intersection.h\
 line_properties.h\
 line_simplification.h\
+line_split_with_lines.h\
 MLB_Interface.h
 
 libshapes_lines_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
@@ -314,7 +348,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -322,6 +355,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -337,13 +372,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libshapes_lines.la: $(libshapes_lines_la_OBJECTS) $(libshapes_lines_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libshapes_lines.la: $(libshapes_lines_la_OBJECTS) $(libshapes_lines_la_DEPENDENCIES) $(EXTRA_libshapes_lines_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libshapes_lines_la_OBJECTS) $(libshapes_lines_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -359,6 +396,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/line_polygon_intersection.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/line_properties.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/line_simplification.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/line_split_with_lines.Plo at am__quote@
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -436,6 +474,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -486,10 +538,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -575,18 +632,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.cpp b/src/modules/shapes/shapes_lines/line_split_with_lines.cpp
new file mode 100644
index 0000000..e6837de
--- /dev/null
+++ b/src/modules/shapes/shapes_lines/line_split_with_lines.cpp
@@ -0,0 +1,235 @@
+/**********************************************************
+ * Version $Id: line_split_with_lines.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     shapes_lines                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               line_split_with_lines.cpp               //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "line_split_with_lines.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CLine_Split_with_Lines::CLine_Split_with_Lines(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Split Lines with Lines"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2014"));
+
+	Set_Description	(_TW(
+		"Split Lines with Lines."
+	));
+
+	//-----------------------------------------------------
+	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_Line
+	);
+
+	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
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CLine_Split_with_Lines::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
+	);
+
+	//--------------------------------------------------------
+	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);
+
+		for(int iSplit=0; iSplit<pSplit->Get_Count(); iSplit++)
+		{
+			CSG_Shape_Line	*pSplit_Line	= (CSG_Shape_Line *)pSplit->Get_Shape(iSplit);
+
+			if( pLine->Intersects(pSplit_Line) )
+			{
+				for(int iPart=0; iPart<pSplit_Line->Get_Part_Count(); iPart++)
+				{
+					if( pLine->Intersects(pSplit_Line->Get_Extent()) )
+					{
+						Get_Intersection(pLine, pSplit_Line->Get_Part(iPart));
+					}
+				}
+			}
+		}
+
+		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_with_Lines::Get_Intersection(CSG_Shape *pLine, CSG_Shape_Part *pSplit)
+{
+	CSG_Shapes	New(SHAPE_TYPE_Line);
+	CSG_Shape	*pNew	= New.Add_Shape();
+
+	for(int iPart=0, jPart=0; iPart<pLine->Get_Part_Count(); iPart++, jPart++)
+	{
+		TSG_Point	A[2], B[2], C;
+
+		pNew->Add_Point(A[0] = pLine->Get_Point(0, iPart), jPart);
+
+		for(int iPoint=1; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+		{
+			A[1]	= A[0];
+			A[0]	= pLine->Get_Point(iPoint, iPart);
+			B[0]	= pSplit->Get_Point(0);
+
+			for(int jPoint=1; jPoint<pSplit->Get_Count(); jPoint++)
+			{
+				B[1]	= B[0];
+				B[0]	= pSplit->Get_Point(jPoint);
+
+				if( SG_Get_Crossing(C, A[0], A[1], B[0], B[1], true) )
+				{
+					pNew->Add_Point(C, jPart++);
+					pNew->Add_Point(C, jPart);
+				}
+			}
+
+			pNew->Add_Point(A[0], jPart);
+		}
+	}
+
+	if( pNew->Get_Part_Count() > pLine->Get_Part_Count() )
+	{
+		return( pLine->Assign(pNew, false) );
+	}
+
+	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
new file mode 100644
index 0000000..c4229fc
--- /dev/null
+++ b/src/modules/shapes/shapes_lines/line_split_with_lines.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * 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
diff --git a/src/modules/shapes/shapes_points/AddCoordinates.cpp b/src/modules/shapes/shapes_points/AddCoordinates.cpp
index 16761fd..1eb0c7d 100644
--- a/src/modules/shapes/shapes_points/AddCoordinates.cpp
+++ b/src/modules/shapes/shapes_points/AddCoordinates.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: AddCoordinates.cpp 1915 2013-12-28 16:35:03Z reklov_w $
+ * Version $Id: AddCoordinates.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     AddCoordinates.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "AddCoordinates.h"
diff --git a/src/modules/shapes/shapes_points/AddCoordinates.h b/src/modules/shapes/shapes_points/AddCoordinates.h
index e7a2e88..192c9f7 100644
--- a/src/modules/shapes/shapes_points/AddCoordinates.h
+++ b/src/modules/shapes/shapes_points/AddCoordinates.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: AddCoordinates.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: AddCoordinates.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     AddCoordinates.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "MLB_Interface.h"
diff --git a/src/modules/shapes/shapes_points/CountPoints.cpp b/src/modules/shapes/shapes_points/CountPoints.cpp
index 4a97146..0810744 100644
--- a/src/modules/shapes/shapes_points/CountPoints.cpp
+++ b/src/modules/shapes/shapes_points/CountPoints.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CountPoints.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CountPoints.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CountPoints.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/CountPoints.h b/src/modules/shapes/shapes_points/CountPoints.h
index e511577..c2a86ff 100644
--- a/src/modules/shapes/shapes_points/CountPoints.h
+++ b/src/modules/shapes/shapes_points/CountPoints.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CountPoints.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CountPoints.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CountPoints.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/CreatePointGrid.cpp b/src/modules/shapes/shapes_points/CreatePointGrid.cpp
index f6d2127..317abd4 100644
--- a/src/modules/shapes/shapes_points/CreatePointGrid.cpp
+++ b/src/modules/shapes/shapes_points/CreatePointGrid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreatePointGrid.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CreatePointGrid.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CreatePointGrid.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "CreatePointGrid.h"
diff --git a/src/modules/shapes/shapes_points/CreatePointGrid.h b/src/modules/shapes/shapes_points/CreatePointGrid.h
index 729ecee..765731a 100644
--- a/src/modules/shapes/shapes_points/CreatePointGrid.h
+++ b/src/modules/shapes/shapes_points/CreatePointGrid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreatePointGrid.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CreatePointGrid.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CreatePointGrid.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/shapes/shapes_points/DistanceMatrix.cpp b/src/modules/shapes/shapes_points/DistanceMatrix.cpp
index 14ddc5e..4262426 100644
--- a/src/modules/shapes/shapes_points/DistanceMatrix.cpp
+++ b/src/modules/shapes/shapes_points/DistanceMatrix.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: DistanceMatrix.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: DistanceMatrix.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     DistanceMatrix.cpp
@@ -17,74 +17,212 @@
 
     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
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #include "DistanceMatrix.h"
-#include <vector>
-
-
-CDistanceMatrix::CDistanceMatrix(void){
-
-	
-	Parameters.Set_Name(_TL("Distance Matrix"));
-	Parameters.Set_Description(_TW(
-		"(c) 2004 by Victor Olaya. Computes distance between pairs of points in a layer."));
-
-	Parameters.Add_Shapes(NULL, 
-						"POINTS", 
-						_TL("Points"), 
-						_TL(""), 
-						PARAMETER_INPUT);
-
-	Parameters.Add_Table(NULL, 
-						"TABLE", 
-						_TL("Distance Matrix Table"),
-						_TL(""),
-						PARAMETER_OUTPUT);
-	
-}//constructor
-
-
-CDistanceMatrix::~CDistanceMatrix(void)
-{}
-
-bool CDistanceMatrix::On_Execute(void){
-
-	int i,j,k;	
-	double dDist;
-	CSG_Points	Points;
-	CSG_Shapes *pShapes = Parameters("POINTS")->asShapes();
-	CSG_Table *pTable = Parameters("TABLE")->asTable();
-	CSG_Shape *pShape;
-	CSG_Table_Record *pRecord;
-
-	pTable->Create((CSG_Table*)NULL);
-	pTable->Set_Name(_TL("Distance Matrix"));
-
-	for(i = 0; i < pShapes->Get_Count(); i++){			
-		pShape = pShapes->Get_Shape(i);					
-		for(j = 0; j < pShape->Get_Part_Count(); j++){	
-			for(k = 0; k < pShape->Get_Point_Count(j); k++){
-				Points.Add(pShape->Get_Point(k, j).x, pShape->Get_Point(k, j).y);
-			}//for
-		}//for
-	}//for
-	for (i = 0; i < Points.Get_Count(); i++){
-		pTable->Add_Field(SG_Get_String(i).c_str(), SG_DATATYPE_Double);
-	}//for
-	for (i = 0; i < Points.Get_Count(); i++){
-		pTable->Add_Record();
-	}//for
-	for (i = 0; i < Points.Get_Count(); i++){
-		pRecord = pTable->Get_Record(i);
-		for (j = i; j < Points.Get_Count(); j++){
-			dDist = sqrt(pow(Points[i].x-Points[j].x,2) + pow(Points[i].y-Points[j].y,2));
-			pRecord->Set_Value(j, dDist);
-			pTable->Get_Record(j)->Set_Value(i, dDist);
-		}//for
-	}//for
-
-	return true;
-
-}//method
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CDistanceMatrix::CDistanceMatrix(void)
+{	
+	CSG_Parameter	*pNode;
+
+	Set_Name		(_TL("Point Distances"));
+
+	Set_Author		("V.Olaya (c) 2004, O.Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Computes distances between pairs of points."
+	));
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"), 
+		_TL(""), 
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "ID_POINTS"	, _TL("Identifier"),
+		_TL(""),
+		true
+	);
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "NEAR"		, _TL("Near Points"), 
+		_TL(""), 
+		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "ID_NEAR"		, _TL("Identifier"),
+		_TL(""),
+		true
+	);
+
+	Parameters.Add_Table(
+		NULL	, "DISTANCES"	, _TL("Distances"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "FORMAT"		, _TL("Output Format"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("complete input times near points matrix"),
+			_TL("each pair with a single record")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MAX_DIST"	, _TL("Maximum Distance"),
+		_TL("ignored if set to zero (consider all pairs)"),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CDistanceMatrix::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FORMAT") )
+	{
+		pParameters->Get_Parameter("MAX_DIST")->Set_Enabled(pParameter->asInt() == 1);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "NEAR") )
+	{
+		pParameters->Get_Parameter("ID_NEAR")->Set_Enabled(pParameter->asShapes() != NULL);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define GET_ID(p, id, i)	(id < 0 ? CSG_String::Format(SG_T("%d"), i + 1) : CSG_String(p->Get_Shape(i)->asString(id)))
+
+//---------------------------------------------------------
+bool CDistanceMatrix::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Shapes	*pPoints	= Parameters("POINTS"   )->asShapes();
+	int			id_Points	= Parameters("ID_POINTS")->asInt   ();
+	CSG_Shapes	*pNear		= Parameters("NEAR"     )->asShapes();
+	int			id_Near		= Parameters("ID_NEAR"  )->asInt   ();
+	CSG_Table	*pDistances = Parameters("DISTANCES")->asTable ();
+	double		max_Dist	= Parameters("MAX_DIST" )->asDouble();
+
+	//-----------------------------------------------------
+	if( pNear == NULL )
+	{
+		pNear	= pPoints;
+		id_Near	= id_Points;
+	}
+
+	pDistances->Destroy();
+
+	if( pPoints != pNear )
+	{
+		pDistances->Set_Name(CSG_String::Format(SG_T("%s [%s / %s]"), _TL("Distances"), pPoints->Get_Name(), pNear->Get_Name()));
+	}
+	else
+	{
+		pDistances->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Distances"), pPoints->Get_Name()));
+	}
+
+	//-----------------------------------------------------
+	if( Parameters("FORMAT")->asInt() == 1 )
+	{
+		pDistances->Add_Field("ID_POINT", SG_DATATYPE_String);
+		pDistances->Add_Field("ID_NEAR" , SG_DATATYPE_String);
+		pDistances->Add_Field("DISTANCE", SG_DATATYPE_Double);
+
+		for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+		{
+			TSG_Point	Point	= pPoints->Get_Shape(iPoint)->Get_Point(0);
+
+			for(int iNear=0; iNear<pNear->Get_Count(); iNear++)
+			{
+				if( pPoints != pNear || iPoint != iNear )
+				{
+					double	Distance	= SG_Get_Distance(Point, pNear->Get_Shape(iNear)->Get_Point(0));
+
+					if( Distance <= max_Dist || max_Dist <= 0.0 )
+					{
+						CSG_Table_Record	*pRecord	= pDistances->Add_Record();
+
+						pRecord->Set_Value(0, GET_ID(pPoints, id_Points, iPoint));
+						pRecord->Set_Value(1, GET_ID(pNear  , id_Near  , iNear ));
+						pRecord->Set_Value(2, Distance);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	else // Matrix
+	{
+		int	iNear;
+
+		pDistances->Add_Field("ID_POINT", SG_DATATYPE_String);
+
+		for(iNear=0; iNear<pNear->Get_Count(); iNear++)
+		{
+			pDistances->Add_Field(GET_ID(pNear, id_Near, iNear), SG_DATATYPE_Double);
+		}
+
+		for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+		{
+			TSG_Point	Point	= pPoints->Get_Shape(iPoint)->Get_Point(0);
+
+			CSG_Table_Record	*pRecord	= pDistances->Add_Record();
+
+			pRecord->Set_Value(0, GET_ID(pPoints, id_Points, iPoint));
+
+			for(iNear=0; iNear<pNear->Get_Count(); iNear++)
+			{
+				pRecord->Set_Value(1 + iNear, SG_Get_Distance(Point, pNear->Get_Shape(iNear)->Get_Point(0)));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_points/DistanceMatrix.h b/src/modules/shapes/shapes_points/DistanceMatrix.h
index 4d1a4fc..289664f 100644
--- a/src/modules/shapes/shapes_points/DistanceMatrix.h
+++ b/src/modules/shapes/shapes_points/DistanceMatrix.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: DistanceMatrix.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: DistanceMatrix.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     DistanceMatrix.h
@@ -17,23 +17,46 @@
 
     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
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #include "MLB_Interface.h"
 
-class CDistanceMatrix : public CSG_Module {
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CDistanceMatrix : public CSG_Module
+{
 public:
 	CDistanceMatrix(void);
-	virtual ~CDistanceMatrix(void);
-	virtual bool is_ProjectDependent(void) {return( false );}
+
 
 protected:
-	virtual bool On_Execute(void);
 
-};
\ No newline at end of file
+	virtual int		On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool	On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_points/FitNPointsToShape.cpp b/src/modules/shapes/shapes_points/FitNPointsToShape.cpp
index 8e46294..b9f0ef1 100644
--- a/src/modules/shapes/shapes_points/FitNPointsToShape.cpp
+++ b/src/modules/shapes/shapes_points/FitNPointsToShape.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FitNPointsToShape.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: FitNPointsToShape.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     FitNPointsToShape.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "FitNPointsToShape.h"
diff --git a/src/modules/shapes/shapes_points/FitNPointsToShape.h b/src/modules/shapes/shapes_points/FitNPointsToShape.h
index 568355d..4d6cc99 100644
--- a/src/modules/shapes/shapes_points/FitNPointsToShape.h
+++ b/src/modules/shapes/shapes_points/FitNPointsToShape.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FitNPointsToShape.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: FitNPointsToShape.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     FitNPointsToShape.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/shapes/shapes_points/Makefile.in b/src/modules/shapes/shapes_points/Makefile.in
index e6b6045..fcde85b 100644
--- a/src/modules/shapes/shapes_points/Makefile.in
+++ b/src/modules/shapes/shapes_points/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_points
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libshapes_points_la_DEPENDENCIES =  \
@@ -109,6 +132,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libshapes_points_la_SOURCES)
 DIST_SOURCES = $(libshapes_points_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -134,6 +162,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -161,6 +190,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -173,6 +203,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -202,6 +233,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -235,7 +267,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -345,7 +376,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -353,6 +383,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -368,13 +400,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libshapes_points.la: $(libshapes_points_la_OBJECTS) $(libshapes_points_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libshapes_points.la: $(libshapes_points_la_OBJECTS) $(libshapes_points_la_DEPENDENCIES) $(EXTRA_libshapes_points_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libshapes_points_la_OBJECTS) $(libshapes_points_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -480,6 +514,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -530,10 +578,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -619,18 +672,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/shapes/shapes_points/Points_From_Lines.cpp b/src/modules/shapes/shapes_points/Points_From_Lines.cpp
index ad1094b..209c631 100644
--- a/src/modules/shapes/shapes_points/Points_From_Lines.cpp
+++ b/src/modules/shapes/shapes_points/Points_From_Lines.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Lines.cpp 1916 2013-12-28 16:36:21Z reklov_w $
+ * Version $Id: Points_From_Lines.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 
 /*******************************************************************************
@@ -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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/Points_From_Lines.h b/src/modules/shapes/shapes_points/Points_From_Lines.h
index 354daf1..5299f40 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 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Points_From_Lines.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 
 /*******************************************************************************
@@ -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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/Points_From_Table.cpp b/src/modules/shapes/shapes_points/Points_From_Table.cpp
index ecb4049..c995ab4 100644
--- a/src/modules/shapes/shapes_points/Points_From_Table.cpp
+++ b/src/modules/shapes/shapes_points/Points_From_Table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Table.cpp 1512 2012-11-05 16:58:58Z oconrad $
+ * Version $Id: Points_From_Table.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 
 /*******************************************************************************
@@ -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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/Points_From_Table.h b/src/modules/shapes/shapes_points/Points_From_Table.h
index 5a6cb13..d10332f 100644
--- a/src/modules/shapes/shapes_points/Points_From_Table.h
+++ b/src/modules/shapes/shapes_points/Points_From_Table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Table.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Points_From_Table.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 
 /*******************************************************************************
@@ -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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/add_polygon_attributes.cpp b/src/modules/shapes/shapes_points/add_polygon_attributes.cpp
index 796f6ff..da2d818 100644
--- a/src/modules/shapes/shapes_points/add_polygon_attributes.cpp
+++ b/src/modules/shapes/shapes_points/add_polygon_attributes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: add_polygon_attributes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: add_polygon_attributes.cpp 1959 2014-02-03 12:41:37Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -113,16 +113,6 @@ CAdd_Polygon_Attributes::CAdd_Polygon_Attributes(void)
 bool CAdd_Polygon_Attributes::On_Execute(void)
 {
 	//-----------------------------------------------------
-	CSG_Parameter_Table_Fields	*pFields	= Parameters("FIELDS")->asTableFields();
-
-	if( pFields->Get_Count() == 0 )
-	{
-		Error_Set(_TL("No attributes in selection."));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
 	CSG_Shapes	*pInput		= Parameters("INPUT")->asShapes();
 
 	if( !pInput->is_Valid() )
@@ -143,6 +133,21 @@ bool CAdd_Polygon_Attributes::On_Execute(void)
 	}
 
 	//-----------------------------------------------------
+	CSG_Parameter_Table_Fields	*pFields	= Parameters("FIELDS")->asTableFields();
+
+	if( pFields->Get_Count() == 0 )
+	{
+		CSG_String	sFields;
+
+		for(int iField=0; iField<pPolygons->Get_Field_Count(); iField++)
+		{
+			sFields += CSG_String::Format(SG_T("%d,"), iField);
+		}
+
+		pFields->Set_Value(sFields);
+	}
+
+	//-----------------------------------------------------
 	CSG_Shapes	*pOutput	= Parameters("OUTPUT")->asShapes();
 
 	if( pOutput && pOutput != pInput )
diff --git a/src/modules/shapes/shapes_points/convex_hull.cpp b/src/modules/shapes/shapes_points/convex_hull.cpp
index 2c6e35d..753a34d 100644
--- a/src/modules/shapes/shapes_points/convex_hull.cpp
+++ b/src/modules/shapes/shapes_points/convex_hull.cpp
@@ -126,15 +126,15 @@ bool CConvex_Hull::On_Execute(void)
 	CSG_Shapes	*pShapes, *pHulls, *pBoxes;
 
 	//-----------------------------------------------------
-	pShapes	= Parameters("SHAPES")	->asShapes();
-	pHulls	= Parameters("HULLS")	->asShapes();
-	pBoxes	= Parameters("BOXES")	->asShapes();
+	pShapes	= Parameters("SHAPES")->asShapes();
+	pHulls	= Parameters("HULLS" )->asShapes();
+	pBoxes	= Parameters("BOXES" )->asShapes();
 
 	//-----------------------------------------------------
 	pHulls->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Convex Hull")));
-	pHulls->Add_Field(_TL("ID")			, SG_DATATYPE_Int);
-	pHulls->Add_Field(_TL("AREA")		, SG_DATATYPE_Double);
-	pHulls->Add_Field(_TL("PERIMETER")	, SG_DATATYPE_Double);
+	pHulls->Add_Field(_TL("ID"       ), SG_DATATYPE_Int);
+	pHulls->Add_Field(_TL("AREA"     ), SG_DATATYPE_Double);
+	pHulls->Add_Field(_TL("PERIMETER"), SG_DATATYPE_Double);
 
 	//-----------------------------------------------------
 	int	nOkay	= 0;
@@ -152,6 +152,14 @@ bool CConvex_Hull::On_Execute(void)
 
 		int	Construction	= Parameters("POLYPOINTS")->asInt();
 
+		if( Construction != 0 )
+		{
+			for(int iField=0; iField<pShapes->Get_Field_Count(); iField++)
+			{
+				pHulls->Add_Field(pShapes->Get_Field_Name(iField), pShapes->Get_Field_Type(iField));
+			}
+		}
+
 		for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
 		{
 			CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
@@ -165,13 +173,13 @@ bool CConvex_Hull::On_Execute(void)
 
 				if( Construction == 2 )	// one hull per shape part
 				{
-					if( Get_Chain_Hull(&Points, pHulls) )	nOkay++;	Points.Del_Records();
+					if( Get_Chain_Hull(&Points, pHulls, pShape) )	nOkay++;	Points.Del_Records();
 				}
 			}
 
 			if( Construction == 1 )	// one hull per shape
 			{
-				if( Get_Chain_Hull(&Points, pHulls) )	nOkay++;	Points.Del_Records();
+				if( Get_Chain_Hull(&Points, pHulls, pShape) )	nOkay++;	Points.Del_Records();
 			}
 		}
 
@@ -284,7 +292,7 @@ bool CConvex_Hull::Get_Bounding_Box(CSG_Shape *pHull, CSG_Shape *pBox)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CConvex_Hull::Get_Chain_Hull(CSG_Shapes *pPoints, CSG_Shapes *pHulls)
+bool CConvex_Hull::Get_Chain_Hull(CSG_Shapes *pPoints, CSG_Shapes *pHulls, CSG_Shape *pAttributes)
 {
 	int			i, n;
 	CSG_Points	Points, Hull;
@@ -330,6 +338,14 @@ bool CConvex_Hull::Get_Chain_Hull(CSG_Shapes *pPoints, CSG_Shapes *pHulls)
 	pHull->Set_Value(1, ((CSG_Shape_Polygon *)pHull)->Get_Area());
 	pHull->Set_Value(2, ((CSG_Shape_Polygon *)pHull)->Get_Perimeter());
 
+	if( pAttributes )
+	{
+		for(i=3, n=0; i<pHulls->Get_Field_Count(); i++, n++)
+		{
+			*pHull->Get_Value(i)	= *pAttributes->Get_Value(n);
+		}
+	}
+
 	//-----------------------------------------------------
 	return( true );
 }
diff --git a/src/modules/shapes/shapes_points/convex_hull.h b/src/modules/shapes/shapes_points/convex_hull.h
index 6c9de7e..953b717 100644
--- a/src/modules/shapes/shapes_points/convex_hull.h
+++ b/src/modules/shapes/shapes_points/convex_hull.h
@@ -91,7 +91,7 @@ private:
 
 	double					is_Left				(const TSG_Point &Line_A, const TSG_Point &Line_B, const TSG_Point &Point);
 
-	bool					Get_Chain_Hull		(CSG_Shapes *pPoints, CSG_Shapes *pHulls);
+	bool					Get_Chain_Hull		(CSG_Shapes *pPoints, CSG_Shapes *pHulls, CSG_Shape *pAttributes = NULL);
 	int						Get_Chain_Hull		(CSG_Points &P, CSG_Points &H);
 
 	bool					Get_Bounding_Box	(CSG_Shape *pHull, CSG_Shape *pBox);
diff --git a/src/modules/shapes/shapes_polygons/MLB_Interface.cpp b/src/modules/shapes/shapes_polygons/MLB_Interface.cpp
index b758754..41e84e4 100644
--- a/src/modules/shapes/shapes_polygons/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_polygons/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: MLB_Interface.cpp 2076 2014-03-31 10:35:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -77,7 +77,7 @@ CSG_String Get_Info(int i)
 		return( _TL("Shapes - Polygons") );
 
 	case MLB_INFO_Author:
-		return( SG_T("O. Conrad, V. Olaya (c) 2002-5") );
+		return( SG_T("O. Conrad, V. Olaya, V. Wichmann (c) 2002-14") );
 
 	case MLB_INFO_Description:
 		return( _TL("Tools for polygons.") );
@@ -107,6 +107,8 @@ CSG_String Get_Info(int i)
 #include "polygon_split_parts.h"
 #include "Polygon_Clip.h"
 #include "Polygon_SelfIntersection.h"
+#include "add_point_attributes.h"
+#include "polygon_flatten.h"
 
 
 //---------------------------------------------------------
@@ -135,9 +137,12 @@ CSG_Module *		Create_Module(int i)
 	case 17:	return( new CPolygon_Union );
 	case 18:	return( new CPolygon_Update );
 	case 19:	return( new CPolygon_Identity );
+	case 20:	return( new CAdd_Point_Attributes );
+
+	case 21:	return( new CPolygon_Flatten );
 
 	//-----------------------------------------------------
-	case 20:	return( NULL );
+	case 22:	return( NULL );
 	default:	return( MLB_INTERFACE_SKIP_MODULE );
 	}
 
diff --git a/src/modules/shapes/shapes_polygons/Makefile.am b/src/modules/shapes/shapes_polygons/Makefile.am
index bc06822..e02ade5 100644
--- a/src/modules/shapes/shapes_polygons/Makefile.am
+++ b/src/modules/shapes/shapes_polygons/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1352 2012-03-14 10:03:01Z oconrad $
+# $Id: Makefile.am 2076 2014-03-31 10:35:00Z oconrad $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -13,9 +13,11 @@ AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMP
 AM_LDFLAGS         = -fPIC -shared -avoid-version
 pkglib_LTLIBRARIES = libshapes_polygons.la
 libshapes_polygons_la_SOURCES =\
+add_point_attributes.cpp\
 MLB_Interface.cpp\
 Polygon_Centroids.cpp\
 Polygon_Clip.cpp\
+polygon_flatten.cpp\
 Polygon_Geometrics.cpp\
 Polygon_Intersection.cpp\
 Polygon_SelfIntersection.cpp\
@@ -27,9 +29,11 @@ polygon_split_parts.cpp\
 polygon_to_edges_nodes.cpp\
 polygon_to_points.cpp\
 shape_index.cpp\
+add_point_attributes.h\
 MLB_Interface.h\
 Polygon_Centroids.h\
 Polygon_Clip.h\
+polygon_flatten.h\
 Polygon_Geometrics.h\
 Polygon_Intersection.h\
 Polygon_SelfIntersection.h\
diff --git a/src/modules/shapes/shapes_polygons/Makefile.in b/src/modules/shapes/shapes_polygons/Makefile.in
index 25eb052..f651b3f 100644
--- a/src/modules/shapes/shapes_polygons/Makefile.in
+++ b/src/modules/shapes/shapes_polygons/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_polygons
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,12 +89,19 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libshapes_polygons_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libshapes_polygons_la_OBJECTS = MLB_Interface.lo \
-	Polygon_Centroids.lo Polygon_Clip.lo Polygon_Geometrics.lo \
+am_libshapes_polygons_la_OBJECTS = add_point_attributes.lo \
+	MLB_Interface.lo Polygon_Centroids.lo Polygon_Clip.lo \
+	polygon_flatten.lo Polygon_Geometrics.lo \
 	Polygon_Intersection.lo Polygon_SelfIntersection.lo \
 	Polygon_StatisticsFromPoints.lo Polygon_Union.lo \
 	Polygons_From_Lines.lo polygon_line_intersection.lo \
@@ -108,6 +132,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libshapes_polygons_la_SOURCES)
 DIST_SOURCES = $(libshapes_polygons_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -133,6 +162,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -160,6 +190,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -172,6 +203,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -201,6 +233,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -234,7 +267,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -256,7 +288,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1352 2012-03-14 10:03:01Z oconrad $
+# $Id: Makefile.am 2076 2014-03-31 10:35:00Z oconrad $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_UNICODE_TRUE at UC_DEFS = -D_SAGA_UNICODE
@@ -266,9 +298,11 @@ AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS = -fPIC -shared -avoid-version
 pkglib_LTLIBRARIES = libshapes_polygons.la
 libshapes_polygons_la_SOURCES = \
+add_point_attributes.cpp\
 MLB_Interface.cpp\
 Polygon_Centroids.cpp\
 Polygon_Clip.cpp\
+polygon_flatten.cpp\
 Polygon_Geometrics.cpp\
 Polygon_Intersection.cpp\
 Polygon_SelfIntersection.cpp\
@@ -280,9 +314,11 @@ polygon_split_parts.cpp\
 polygon_to_edges_nodes.cpp\
 polygon_to_points.cpp\
 shape_index.cpp\
+add_point_attributes.h\
 MLB_Interface.h\
 Polygon_Centroids.h\
 Polygon_Clip.h\
+polygon_flatten.h\
 Polygon_Geometrics.h\
 Polygon_Intersection.h\
 Polygon_SelfIntersection.h\
@@ -332,7 +368,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -340,6 +375,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -355,13 +392,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libshapes_polygons.la: $(libshapes_polygons_la_OBJECTS) $(libshapes_polygons_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libshapes_polygons.la: $(libshapes_polygons_la_OBJECTS) $(libshapes_polygons_la_DEPENDENCIES) $(EXTRA_libshapes_polygons_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libshapes_polygons_la_OBJECTS) $(libshapes_polygons_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -379,6 +418,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Polygon_StatisticsFromPoints.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Polygon_Union.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Polygons_From_Lines.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_point_attributes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polygon_flatten.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polygon_line_intersection.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polygon_split_parts.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polygon_to_edges_nodes.Plo at am__quote@
@@ -461,6 +502,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -511,10 +566,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -600,18 +660,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp
index 0518de3..9581293 100644
--- a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Geometrics.cpp 1334 2012-02-21 13:34:44Z reklov_w $
+ * Version $Id: Polygon_Geometrics.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Polygon_Geometrics.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h
index 8ae2c12..65fed4b 100644
--- a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Geometrics.h 1065 2011-05-18 15:58:45Z oconrad $
+ * Version $Id: Polygon_Geometrics.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Polygon_Geometrics.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp
index d62961d..8daea9e 100644
--- a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_StatisticsFromPoints.cpp 1750 2013-06-25 08:22:44Z oconrad $
+ * Version $Id: Polygon_StatisticsFromPoints.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CPolygonStatisticsFromPoints.cpp
@@ -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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h
index 89a0f6f..b1f18bc 100644
--- a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_StatisticsFromPoints.h 1449 2012-07-16 13:04:43Z oconrad $
+ * Version $Id: Polygon_StatisticsFromPoints.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     PolygonStatisticsFromPoints.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Union.cpp b/src/modules/shapes/shapes_polygons/Polygon_Union.cpp
index ed8cae7..58e2729 100644
--- a/src/modules/shapes/shapes_polygons/Polygon_Union.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_Union.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Union.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Polygon_Union.cpp 1982 2014-02-10 16:52:17Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -124,6 +124,7 @@ CPolygon_Dissolve::CPolygon_Dissolve(void)
 	Parameters.Add_Value(pNode, "STAT_RNG", _TL("Range"    ), _TL(""), PARAMETER_TYPE_Bool, false);
 	Parameters.Add_Value(pNode, "STAT_DEV", _TL("Deviation"), _TL(""), PARAMETER_TYPE_Bool, false);
 	Parameters.Add_Value(pNode, "STAT_VAR", _TL("Variance" ), _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(pNode, "STAT_LST", _TL("Listing"  ), _TL(""), PARAMETER_TYPE_Bool, false);
 	Parameters.Add_Value(pNode, "STAT_NUM", _TL("Count"    ), _TL(""), PARAMETER_TYPE_Bool, false);
 
 	Parameters.Add_Choice(
@@ -182,6 +183,7 @@ int CPolygon_Dissolve::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Par
 		pParameters->Get_Parameter("STAT_RNG")->Set_Enabled(pParameter->asInt() > 0);
 		pParameters->Get_Parameter("STAT_DEV")->Set_Enabled(pParameter->asInt() > 0);
 		pParameters->Get_Parameter("STAT_VAR")->Set_Enabled(pParameter->asInt() > 0);
+		pParameters->Get_Parameter("STAT_LST")->Set_Enabled(pParameter->asInt() > 0);
 		pParameters->Get_Parameter("STAT_NUM")->Set_Enabled(pParameter->asInt() > 0);
 
 		pParameters->Get_Parameter("STAT_NAMING")->Set_Enabled(pParameter->asInt() > 0);
@@ -300,6 +302,8 @@ bool CPolygon_Dissolve::On_Execute(void)
 		delete[](m_Statistics);
 	}
 
+	m_List.Clear();
+
 	return( pUnions->is_Valid() );
 }
 
@@ -322,9 +326,10 @@ bool CPolygon_Dissolve::Init_Statistics(CSG_Shapes *pUnions, CSG_Shapes *pPolygo
 	m_bRNG	= Parameters("STAT_RNG")->asBool();
 	m_bDEV	= Parameters("STAT_DEV")->asBool();
 	m_bVAR	= Parameters("STAT_VAR")->asBool();
+	m_bLST	= Parameters("STAT_LST")->asBool();
 	m_bNUM	= Parameters("STAT_NUM")->asBool();
 
-	if( m_Stat_pFields->Get_Count() > 0 && (m_bSUM || m_bAVG || m_bMIN || m_bMAX || m_bRNG || m_bDEV || m_bVAR || m_bNUM) )
+	if( m_Stat_pFields->Get_Count() > 0 && (m_bSUM || m_bAVG || m_bMIN || m_bMAX || m_bRNG || m_bDEV || m_bVAR || m_bLST || m_bNUM) )
 	{
 		m_Statistics	= new CSG_Simple_Statistics[m_Stat_pFields->Get_Count()];
 
@@ -342,6 +347,12 @@ bool CPolygon_Dissolve::Init_Statistics(CSG_Shapes *pUnions, CSG_Shapes *pPolygo
 			if( m_bDEV )	pUnions->Add_Field(Get_Statistics_Name("STD", s), SG_DATATYPE_Double);
 			if( m_bVAR )	pUnions->Add_Field(Get_Statistics_Name("VAR", s), SG_DATATYPE_Double);
 			if( m_bNUM )	pUnions->Add_Field(Get_Statistics_Name("NUM", s), SG_DATATYPE_Int   );
+			if( m_bLST )	pUnions->Add_Field(Get_Statistics_Name("LST", s), SG_DATATYPE_String);
+		}
+
+		if( m_bLST )
+		{
+			m_List.Set_Count(m_Stat_pFields->Get_Count());
 		}
 
 		return( true );
@@ -384,9 +395,24 @@ bool CPolygon_Dissolve::Add_Statistics(CSG_Shape *pUnion, CSG_Shape *pPolygon, b
 			if( bReset )
 			{
 				m_Statistics[iField].Create();
+
+				if( iField < m_List.Get_Count() )
+				{
+					m_List[iField].Clear();
+				}
 			}
 
 			m_Statistics[iField]	+= pPolygon->asDouble(m_Stat_pFields->Get_Index(iField));
+
+			if( iField < m_List.Get_Count() )
+			{
+				if( !m_List[iField].is_Empty() )
+				{
+					m_List[iField]	+= "|";
+				}
+
+				m_List[iField]	+= pPolygon->asString(m_Stat_pFields->Get_Index(iField));
+			}
 		}
 
 		return( true );
@@ -420,6 +446,7 @@ bool CPolygon_Dissolve::Set_Union(CSG_Shape *pUnion, bool bDissolve)
 			if( m_bDEV )	pUnion->Set_Value(jField++, m_Statistics[iField].Get_StdDev  ());
 			if( m_bVAR )	pUnion->Set_Value(jField++, m_Statistics[iField].Get_Variance());
 			if( m_bNUM )	pUnion->Set_Value(jField++, m_Statistics[iField].Get_Count   ());
+			if( m_bLST )	pUnion->Set_Value(jField++, m_List      [iField]);
 		}
 	}
 
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Union.h b/src/modules/shapes/shapes_polygons/Polygon_Union.h
index 75e2b8c..f7293e6 100644
--- a/src/modules/shapes/shapes_polygons/Polygon_Union.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_Union.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Union.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Polygon_Union.h 1982 2014-02-10 16:52:17Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -98,10 +98,12 @@ protected:
 
 private:
 
-	bool						m_bSUM, m_bAVG, m_bMIN, m_bMAX, m_bRNG, m_bDEV, m_bVAR, m_bNUM;
+	bool						m_bSUM, m_bAVG, m_bMIN, m_bMAX, m_bRNG, m_bDEV, m_bVAR, m_bLST, m_bNUM;
 
 	int							m_Stat_Offset;
 
+	CSG_Strings					m_List;
+
 	CSG_Parameter_Table_Fields	*m_Stat_pFields;
 
 	CSG_Simple_Statistics		*m_Statistics;
diff --git a/src/modules/shapes/shapes_polygons/add_point_attributes.cpp b/src/modules/shapes/shapes_polygons/add_point_attributes.cpp
new file mode 100644
index 0000000..f228e96
--- /dev/null
+++ b/src/modules/shapes/shapes_polygons/add_point_attributes.cpp
@@ -0,0 +1,265 @@
+/**********************************************************
+ * Version $Id: add_point_attributes.cpp 1958 2014-02-03 12:40:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    shapes_polygons                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                add_point_attributes.cpp               //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata                     //
+//                                                       //
+//    contact:    Volker Wichmann                        //
+//                LASERDATA GmbH                         //
+//                Management and analysis of             //
+//                laserscanning data                     //
+//                Innsbruck, Austria                     //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "add_point_attributes.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CAdd_Point_Attributes::CAdd_Point_Attributes(void)
+{
+	Set_Name		(_TL("Add Point Attributes to Polygons"));
+
+	Set_Author		(SG_T("V. Wichmann (c) 2014"));
+
+	Set_Description	(_TW(
+		"Spatial join for polygons. Retrieves for each polygon the selected "
+		"attributes from that point, which is contained in the polygon. In case "
+		"a polygon contains more than one point, the last point wins.\n"
+		"Optionally, the module allows to attach the geometrical properties "
+		"(x,y(z,m)) of each point as additional attributes.\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "INPUT"	, _TL("Polygons"),
+		_TL("Input polygon shapefile"),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	);
+
+	CSG_Parameter	*pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL("Input point shapefile"),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Fields(
+		pNode	, "FIELDS"		, _TL("Attributes"),
+		_TL("Attributes to add. Select none to add all")
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "OUTPUT"		, _TL("Result"),
+		_TL("Optional output polygon shapefile"),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon
+	);
+	
+	Parameters.Add_Value(
+		NULL	, "ADD_LOCATION_INFO",	_TL("Add Location Info"),
+		_TL("Add location information from points (x,y,(z,m))"),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CAdd_Point_Attributes::On_Execute(void)
+{
+	//-----------------------------------------------------
+	bool		bAddLocInfo	= Parameters("ADD_LOCATION_INFO")->asBool();
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pInput		= Parameters("INPUT")->asShapes();
+
+	if( !pInput->is_Valid() )
+	{
+		Error_Set(_TL("Invalid polygon layer."));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pPoints	= Parameters("POINTS")->asShapes();
+
+	if( !pPoints->is_Valid() )
+	{
+		Error_Set(_TL("Invalid points layer."));
+
+		return( false );
+	}
+
+	CSG_Parameter_Table_Fields	*pFields	= Parameters("FIELDS")->asTableFields();
+
+	if( pFields->Get_Count() == 0 )	// no fields specified, so add all
+	{
+		CSG_String	sFields;
+
+		for(int iField=0; iField<pPoints->Get_Field_Count(); iField++)
+		{
+			sFields += CSG_String::Format(SG_T("%d,"), iField);
+		}
+
+		pFields->Set_Value(sFields);
+	}
+
+	//-----------------------------------------------------
+	CSG_Shapes	*pOutput	= Parameters("OUTPUT")->asShapes();
+
+	if( pOutput && pOutput != pInput )
+	{
+		pOutput->Create(*pInput);
+	}
+	else
+	{
+		Parameters("OUTPUT")->Set_Value(pOutput	= pInput);
+	}
+
+	pOutput->Set_Name(CSG_String::Format(SG_T("%s_%s"), pInput->Get_Name(), pPoints->Get_Name()));
+
+	//-----------------------------------------------------
+	int	outField	= pOutput->Get_Field_Count();
+	int iXField		= -1;
+
+	for(int iField=0; iField<pFields->Get_Count(); iField++)
+	{
+		int	jField	= pFields->Get_Index(iField);
+
+		pOutput->Add_Field(pPoints->Get_Field_Name(jField), pPoints->Get_Field_Type(jField));
+	}
+
+	if( bAddLocInfo )
+	{
+		pOutput->Add_Field(SG_T("X"), SG_DATATYPE_Float);
+		iXField = pOutput->Get_Field_Count() - 1;
+
+		pOutput->Add_Field(SG_T("Y"), SG_DATATYPE_Float);
+
+		if( pPoints->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+		{
+			pOutput->Add_Field(SG_T("Z"), SG_DATATYPE_Float);
+
+			if( pPoints->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+			{
+				pOutput->Add_Field(SG_T("M"), SG_DATATYPE_Float);
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+	for(int iPolygon=0; iPolygon<pOutput->Get_Count() && Set_Progress(iPolygon, pOutput->Get_Count()); iPolygon++)
+	{
+		CSG_Shape_Polygon	*pPolygon	= (CSG_Shape_Polygon *)pOutput->Get_Shape(iPolygon);
+
+		//-------------------------------------------------
+		for(int iPoint=0; iPoint<pPoints->Get_Count() && Process_Get_Okay(); iPoint++)
+		{
+			CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
+
+			if( pPolygon->Contains(pPoint->Get_Point(0)) )
+			{
+				for(int iField=0; iField<pFields->Get_Count(); iField++)
+				{
+					int	jField	= pFields->Get_Index(iField);
+
+					switch( pPoints->Get_Field_Type(jField) )
+					{
+					case SG_DATATYPE_String:
+					case SG_DATATYPE_Date:
+						pPolygon->Set_Value(outField + iField, pPoint->asString(jField));
+						break;
+
+					default:
+						pPolygon->Set_Value(outField + iField, pPoint->asDouble(jField));
+						break;
+					}
+				}
+
+				if( bAddLocInfo )
+				{
+					pPolygon->Set_Value(iXField    , pPoint->Get_Point(0).x);
+					pPolygon->Set_Value(iXField + 1, pPoint->Get_Point(0).y);
+
+					if( pPoints->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+					{
+						pPolygon->Set_Value(iXField + 2, pPoint->Get_Z(0));
+
+						if( pPoints->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+						{
+							pPolygon->Set_Value(iXField + 3, pPoint->Get_M(0));
+						}
+					}
+				}
+			}
+		} // iPoint
+	} // iPolygon
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_polygons/add_point_attributes.h b/src/modules/shapes/shapes_polygons/add_point_attributes.h
new file mode 100644
index 0000000..0370582
--- /dev/null
+++ b/src/modules/shapes/shapes_polygons/add_point_attributes.h
@@ -0,0 +1,95 @@
+/**********************************************************
+ * Version $Id: add_point_attributes.h 1958 2014-02-03 12:40:27Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    shapes_polygons                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                add_point_attributes.h                 //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata                     //
+//                                                       //
+//    contact:    Volker Wichmann                        //
+//                LASERDATA GmbH                         //
+//                Management and analysis of             //
+//                laserscanning data                     //
+//                Innsbruck, Austria                     //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__add_point_attributes_H
+#define HEADER_INCLUDED__add_point_attributes_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CAdd_Point_Attributes : public CSG_Module
+{
+public:
+	CAdd_Point_Attributes(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__add_point_attributes_H
diff --git a/src/modules/shapes/shapes_polygons/polygon_flatten.cpp b/src/modules/shapes/shapes_polygons/polygon_flatten.cpp
new file mode 100644
index 0000000..0027074
--- /dev/null
+++ b/src/modules/shapes/shapes_polygons/polygon_flatten.cpp
@@ -0,0 +1,229 @@
+/**********************************************************
+ * Version $Id: polygon_flatten.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    shapes_polygon                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  polygon_flatten.cpp                  //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "polygon_flatten.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPolygon_Flatten::CPolygon_Flatten(void)
+{
+	//-----------------------------------------------------
+	Set_Name	(_TL("Flatten Polygon Layer"));
+
+	Set_Author	("O.Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Removes invalid polygons, i.e. polygons with less than three vertices, "
+		"and merges polygons belonging spatially together, i.e. forming outer "
+		"and inner rings. Inner rings are not preserved as separate polygon, "
+		"but become new part of the polygon forming the outer ring. "
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "INPUT"		, _TL("Input"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "OUTPUT"		, _TL("Output"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPolygon_Flatten::On_Execute(void)
+{
+	CSG_Shapes	*pShapes	= Parameters("INPUT")->asShapes();
+
+	if( !pShapes->is_Valid() || pShapes->Get_Count() <= 1 )
+	{
+		Message_Add(_TL("less than two polygons in layer, nothing to do!"));
+
+		return( false );
+	}
+
+	if( Parameters("OUTPUT")->asShapes() != NULL && pShapes != Parameters("OUTPUT")->asShapes() )
+	{
+		pShapes	= Parameters("OUTPUT")->asShapes();
+		pShapes->Create(*Parameters("INPUT")->asShapes());
+		pShapes->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("dissolved inner rings")));
+	}
+
+	//-----------------------------------------------------
+	int		i, j, k, n;
+
+	int		*Container	= (int *)SG_Malloc(pShapes->Get_Count() * sizeof(int));
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("find inner rings"));
+
+	for(i=0, n=0; i<pShapes->Get_Count() && Set_Progress(i, pShapes->Get_Count()); i++)
+	{
+		CSG_Shape	*pShape	= pShapes->Get_Shape(i);
+
+		if( !pShape->is_Valid() )
+		{
+			Container[i]	= -2;
+		}
+		else
+		{
+			for(j=0, k=-1; k<0 && j<pShapes->Get_Count(); j++)
+			{
+				if( j > i || (j < i && Container[j] != i) )
+				{
+					CSG_Shape_Polygon	*pPolygon	= (CSG_Shape_Polygon *)pShapes->Get_Shape(j);
+
+					if( pPolygon->Intersects(pShape) == INTERSECTION_Contains )
+					{
+						k	= j;
+						n	++;
+					}
+				}
+			}
+
+			Container[i]	= k;
+		}
+	}
+
+	Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of inner rings"), n));
+
+	if( n == 0 )
+	{
+		SG_Free(Container);
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("solve inner rings"));
+
+	for(i=0, n=0; i<pShapes->Get_Count() && Set_Progress(i, pShapes->Get_Count()); i++)
+	{
+		if( Container[i] >= 0 )
+		{
+			j	= Container[i];
+
+			while( Container[j] >= 0 )
+			{
+				j	= Container[j];
+			}
+
+			CSG_Shape	*pOuter	= pShapes->Get_Shape(j);
+			CSG_Shape	*pInner	= pShapes->Get_Shape(i);
+
+			for(int iPart=0; iPart<pInner->Get_Part_Count(); iPart++)
+			{
+				for(int iPoint=0, jPart=pOuter->Get_Part_Count(); iPoint<pInner->Get_Point_Count(iPart); iPoint++)
+				{
+					pOuter->Add_Point(pInner->Get_Point(iPoint, iPart), jPart);
+				}
+			}
+
+			pInner->Del_Parts();	// save memory
+
+			n++;
+		}
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("clean inner rings"));
+
+	for(i=0, j=pShapes->Get_Count()-1; i<pShapes->Get_Count() && Set_Progress(i, pShapes->Get_Count()); i++, j--)
+	{
+		if( Container[j] != -1 )	// valid outer ring
+		{
+			pShapes->Del_Shape(j);
+		}
+	}
+
+	//-----------------------------------------------------
+	SG_Free(Container);
+
+	if( pShapes == Parameters("INPUT")->asShapes() )
+	{
+		DataObject_Update(pShapes);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_polygons/polygon_flatten.h b/src/modules/shapes/shapes_polygons/polygon_flatten.h
new file mode 100644
index 0000000..6d9cd61
--- /dev/null
+++ b/src/modules/shapes/shapes_polygons/polygon_flatten.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * Version $Id: polygon_flatten.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    shapes_polygon                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   polygon_flatten.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__polygon_flatten_H
+#define HEADER_INCLUDED__polygon_flatten_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPolygon_Flatten : public CSG_Module
+{
+public: ////// public members and functions: //////////////
+
+	CPolygon_Flatten(void);
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual bool		On_Execute				(void);
+
+
+private: ///// private members and functions: /////////////
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__polygon_flatten_H
diff --git a/src/modules/shapes/shapes_polygons/shape_index.cpp b/src/modules/shapes/shapes_polygons/shape_index.cpp
index a339f9c..87a1259 100644
--- a/src/modules/shapes/shapes_polygons/shape_index.cpp
+++ b/src/modules/shapes/shapes_polygons/shape_index.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_index.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: shape_index.cpp 2099 2014-04-16 09:04:19Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -166,6 +166,7 @@ bool CShape_Index::On_Execute(void)
 
 				pShape->Set_Value(iField + 0, Area);
 				pShape->Set_Value(iField + 1, Perimeter);
+
 				if (Area > 0.0)
 				{
 					pShape->Set_Value(iField + 2, Perimeter / Area);
@@ -176,7 +177,9 @@ bool CShape_Index::On_Execute(void)
 					pShape->Set_NoData(iField + 2);
 					pShape->Set_NoData(iField + 3);
 				}
+
 				pShape->Set_Value(iField + 4, Distance);
+
 				if (Area > 0.0)
 				{
 					pShape->Set_Value(iField + 5, Distance / Area);
@@ -207,25 +210,24 @@ bool CShape_Index::On_Execute(void)
 //---------------------------------------------------------
 double CShape_Index::Get_Distance(CSG_Shape *pShape)
 {
-	double	d, dMax	= 0.0;
+	double	dMax	= 0.0;
 
 	for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
 	{
 		if( pShape->Get_Point_Count(iPart) > 2 )
 		{
-			TSG_Point	A, B;
-
-			A	= pShape->Get_Point(pShape->Get_Point_Count(iPart) - 1, iPart);
-
 			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
 			{
-				B	= A;
-				A	= pShape->Get_Point(iPoint, iPart);
-				d	= SG_Get_Distance(A, B);
+				TSG_Point	A	= pShape->Get_Point(iPoint, iPart);
 
-				if( dMax < d )
+				for(int jPoint=iPoint+1; jPoint<pShape->Get_Point_Count(iPart); jPoint++)
 				{
-					dMax	= d;
+					double	d	= SG_Get_Distance(A, pShape->Get_Point(jPoint, iPart));
+
+					if( dMax < d )
+					{
+						dMax	= d;
+					}
 				}
 			}
 		}
diff --git a/src/modules/shapes/shapes_tools/CreateChartLayer.cpp b/src/modules/shapes/shapes_tools/CreateChartLayer.cpp
index 5118305..2694818 100644
--- a/src/modules/shapes/shapes_tools/CreateChartLayer.cpp
+++ b/src/modules/shapes/shapes_tools/CreateChartLayer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreateChartLayer.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CreateChartLayer.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CCreateChartLayer.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #include "CreateChartLayer.h"
diff --git a/src/modules/shapes/shapes_tools/CreateChartLayer.h b/src/modules/shapes/shapes_tools/CreateChartLayer.h
index 0c22ccc..c14ffa7 100644
--- a/src/modules/shapes/shapes_tools/CreateChartLayer.h
+++ b/src/modules/shapes/shapes_tools/CreateChartLayer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreateChartLayer.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: CreateChartLayer.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     CreateChartLayer.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp b/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp
index 21aca63..a8058e3 100644
--- a/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp
+++ b/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GraticuleBuilder.cpp 1127 2011-07-06 15:53:00Z oconrad $
+ * Version $Id: GraticuleBuilder.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     GraticuleBuilder.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/GraticuleBuilder.h b/src/modules/shapes/shapes_tools/GraticuleBuilder.h
index 3379927..199e379 100644
--- a/src/modules/shapes/shapes_tools/GraticuleBuilder.h
+++ b/src/modules/shapes/shapes_tools/GraticuleBuilder.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GraticuleBuilder.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: GraticuleBuilder.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     GraticuleBuilder.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 #if _MSC_VER > 1000
diff --git a/src/modules/shapes/shapes_tools/MLB_Interface.cpp b/src/modules/shapes/shapes_tools/MLB_Interface.cpp
index 58ad464..ea88764 100644
--- a/src/modules/shapes/shapes_tools/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: MLB_Interface.cpp 2010 2014-02-21 14:43:04Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -131,6 +131,7 @@ CSG_Module *		Create_Module(int i)
 	{
 	case  0:	return( new CShapes_Create_Empty );
 	case  2:	return( new CShapes_Merge );
+	case 24:	return( new CTables_Merge );
 
 	case  3:	return( new CSelect_Numeric );
 	case  4:	return( new CSelect_String );
diff --git a/src/modules/shapes/shapes_tools/Makefile.in b/src/modules/shapes/shapes_tools/Makefile.in
index e2db256..4879084 100644
--- a/src/modules/shapes/shapes_tools/Makefile.in
+++ b/src/modules/shapes/shapes_tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libshapes_tools_la_DEPENDENCIES =  \
@@ -111,6 +134,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libshapes_tools_la_SOURCES)
 DIST_SOURCES = $(libshapes_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -136,6 +164,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -163,6 +192,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -175,6 +205,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -204,6 +235,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -237,7 +269,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -351,7 +382,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -359,6 +389,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -374,13 +406,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libshapes_tools.la: $(libshapes_tools_la_OBJECTS) $(libshapes_tools_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libshapes_tools.la: $(libshapes_tools_la_OBJECTS) $(libshapes_tools_la_DEPENDENCIES) $(EXTRA_libshapes_tools_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libshapes_tools_la_OBJECTS) $(libshapes_tools_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -488,6 +522,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -538,10 +586,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -627,18 +680,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 #install-exec-hook:
diff --git a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp
index 3839c3b..f87288f 100644
--- a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp
+++ b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: NewLayerFromSelectedShapes.cpp 1907 2013-12-15 16:24:12Z reklov_w $
+ * Version $Id: NewLayerFromSelectedShapes.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     NewLayerFromSelectedShapes.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 
diff --git a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h
index bbfc3a4..772709c 100644
--- a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h
+++ b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: NewLayerFromSelectedShapes.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: NewLayerFromSelectedShapes.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     NewLayerFromSelectedShapes.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/QueryBuilder.cpp b/src/modules/shapes/shapes_tools/QueryBuilder.cpp
index 89e509a..c99583c 100644
--- a/src/modules/shapes/shapes_tools/QueryBuilder.cpp
+++ b/src/modules/shapes/shapes_tools/QueryBuilder.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: QueryBuilder.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: QueryBuilder.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     QueryBuilder.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/QueryBuilder.h b/src/modules/shapes/shapes_tools/QueryBuilder.h
index ba6c0a6..2599b71 100644
--- a/src/modules/shapes/shapes_tools/QueryBuilder.h
+++ b/src/modules/shapes/shapes_tools/QueryBuilder.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: QueryBuilder.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: QueryBuilder.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     QueryBuilder.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 
diff --git a/src/modules/shapes/shapes_tools/SearchInTable.cpp b/src/modules/shapes/shapes_tools/SearchInTable.cpp
index 8e849c6..1afec94 100644
--- a/src/modules/shapes/shapes_tools/SearchInTable.cpp
+++ b/src/modules/shapes/shapes_tools/SearchInTable.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SearchInTable.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: SearchInTable.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SearchInTable.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/SearchInTable.h b/src/modules/shapes/shapes_tools/SearchInTable.h
index 2d4a3cf..0a30c55 100644
--- a/src/modules/shapes/shapes_tools/SearchInTable.h
+++ b/src/modules/shapes/shapes_tools/SearchInTable.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SearchInTable.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: SearchInTable.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SearchInTable.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 
diff --git a/src/modules/shapes/shapes_tools/SelectByTheme.cpp b/src/modules/shapes/shapes_tools/SelectByTheme.cpp
index 589e0f8..403ad3c 100644
--- a/src/modules/shapes/shapes_tools/SelectByTheme.cpp
+++ b/src/modules/shapes/shapes_tools/SelectByTheme.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SelectByTheme.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: SelectByTheme.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SelectByTheme.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/SelectByTheme.h b/src/modules/shapes/shapes_tools/SelectByTheme.h
index 634dc0f..e439471 100644
--- a/src/modules/shapes/shapes_tools/SelectByTheme.h
+++ b/src/modules/shapes/shapes_tools/SelectByTheme.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SelectByTheme.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: SelectByTheme.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SelectByTheme.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/SeparateShapes.cpp b/src/modules/shapes/shapes_tools/SeparateShapes.cpp
index e455f3b..81d67b8 100644
--- a/src/modules/shapes/shapes_tools/SeparateShapes.cpp
+++ b/src/modules/shapes/shapes_tools/SeparateShapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SeparateShapes.cpp 931 2011-02-21 16:03:49Z oconrad $
+ * Version $Id: SeparateShapes.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SeparateShapes.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/SeparateShapes.h b/src/modules/shapes/shapes_tools/SeparateShapes.h
index 1ff199a..675294a 100644
--- a/src/modules/shapes/shapes_tools/SeparateShapes.h
+++ b/src/modules/shapes/shapes_tools/SeparateShapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SeparateShapes.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: SeparateShapes.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     SeparateShapes.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/Shapes_Merge.cpp b/src/modules/shapes/shapes_tools/Shapes_Merge.cpp
index 1f3a9e0..59761dc 100644
--- a/src/modules/shapes/shapes_tools/Shapes_Merge.cpp
+++ b/src/modules/shapes/shapes_tools/Shapes_Merge.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes_Merge.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: Shapes_Merge.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Shapes_Merge.cpp
@@ -17,152 +17,294 @@
 
     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
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #include "Shapes_Merge.h"
-#include <string>
-#include <vector>
 
-CShapes_Merge::CShapes_Merge(void){
 
-	Set_Name(_TL("Merge Shapes Layers"));
-	Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya"));
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CShapes_Merge::CShapes_Merge(void) : CTables_Merge()
+{
+	Parameters.Del_Parameters();
+
+	Set_Name		(_TL("Merge Layers"));
+
+	Set_Author		("V.Olaya (c) 2004");
+
 	Set_Description	(_TW(
-		"(c) 2004 by Victor Olaya. Merge Shapes Layers"));
-
-	Parameters.Add_Shapes(NULL, 
-						"OUT", 
-						_TL("Merged Layer"), 
-						_TL(""), 
-						PARAMETER_OUTPUT);
-
-	Parameters.Add_Shapes(NULL, 
-						"MAIN", 
-						_TL("Main Layer"),
-						_TL("Main Layer. Output layer will have the same field in the attributes table as this layer"),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Shapes_List(NULL,
-						"LAYERS", 
-						_TL("Additional Layers"),
-						_TL("Layers to merge with main layer"),
-						PARAMETER_INPUT_OPTIONAL);
-
-}//constructor
-
-
-CShapes_Merge::~CShapes_Merge(void)
-{}
-
-bool CShapes_Merge::On_Execute(void){
-
-	CSG_Table *pTable;
-	CSG_Shapes *pShapes, *pOutput;
-	CSG_Shape *pShape, *pShape2;
-	CSG_Parameter_Shapes_List	*pShapesList;
-	CSG_Shapes* pMainShapes;
-	int i,j;
-	int iLayer, iField, nFields;
-	int iFieldMain, iFieldAdditional;
-	std::vector<int> FieldsMain, FieldsAdditional;
-	CSG_String sName1,sName2;
-	
-	pOutput = Parameters("OUT")->asShapes();
-	pMainShapes = Parameters("MAIN")->asShapes();
-	TSG_Shape_Type MainType = pMainShapes->Get_Type();
-
-	pOutput->Create(MainType, _TL("Shapes_Merge"));
-
-	pTable	= pMainShapes;
-	nFields	= pTable->Get_Field_Count();
-
-	for (i=0; i<nFields; i++)
-	{
-		pOutput->Add_Field(pTable->Get_Field_Name(i), pTable->Get_Field_Type(i));
-	}//for
-
-	pOutput->Add_Field(SG_T("LAYER_ID")	, SG_DATATYPE_Int);
-	pOutput->Add_Field(SG_T("LAYER")	, SG_DATATYPE_String);
-	
-	//copy main layer into destination
-	for(i=0; i<pMainShapes->Get_Count(); i++)
+		"Merge vector layers."
+	));
+
+	Parameters.Add_Shapes_List(
+		NULL	, "INPUT"	, _TL("Layers"),
+		_TL("Output will inherit shape type and table structure from the first layer in this list."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "MERGED"	, _TL("Merged Layer"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SRCINFO"	, _TL("Add Source Information"),
+		_TL("Adds a field with the name of the original input data set."),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MATCH"	, _TL("Match Fields by Name"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTables_Merge::CTables_Merge(void)
+{
+	Set_Name		(_TL("Merge Tables"));
+
+	Set_Author		("O.Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Merge tables."
+	));
+
+	Parameters.Add_Table_List(
+		NULL	, "INPUT"	, _TL("Tables"),
+		_TL("The resulting table inherits its field structure from the first table in this list."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "MERGED"	, _TL("Merged Table"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SRCINFO"	, _TL("Add Source Information"),
+		_TL("Adds a field with the name of the original input data set."),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MATCH"	, _TL("Match Fields by Name"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTables_Merge::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Parameter_List	*pList	= Parameters("INPUT")->asList();
+
+	if( pList->Get_Type() == PARAMETER_TYPE_Shapes_List )
 	{
-		pShape	= pMainShapes->Get_Shape(i);
-		pShape2	= pOutput->Add_Shape(pShape);
-		pShape2	->Set_Value(nFields + 0, 1);
-		pShape2	->Set_Value(nFields + 1, pMainShapes->Get_Name());
+		int	n	= pList->Get_Count();
 
-		for	(iField = 0; iField<nFields; iField++)
+		for(int i=n-1; i>0; i--)
 		{
-			if (pTable->Get_Field_Type(iField) == SG_DATATYPE_String)
+			if( ((CSG_Shapes *)pList->asDataObject(0))->Get_Type() != ((CSG_Shapes *)pList->asDataObject(i))->Get_Type() )
 			{
-				pShape2->Set_Value(iField, pShape->asString(iField));
-			}//if
-			else
+				pList->Del_Item(i);
+			}
+		}
+
+		if( n > pList->Get_Count() )
+		{
+			Message_Add(CSG_String::Format(SG_T("%s [%d]"), _TL("incompatible items have been removed from input list"), n - pList->Get_Count()));
+		}
+	}
+
+	if( pList->Get_Count() < 2 )
+	{
+		Error_Set(_TL("Nothing to do! Merging needs more than one input data set."));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Table	*pMerged	= Parameters("MERGED")->asTable();
+
+	if( pList->Get_Type() == PARAMETER_TYPE_Shapes_List )
+	{
+		CSG_Shapes	*pShapesIn = ((CSG_Shapes *)pList->asDataObject(0));
+
+		((CSG_Shapes *)pMerged)->Create(pShapesIn->Get_Type(), pShapesIn->Get_Name(), pShapesIn, pShapesIn->Get_Vertex_Type());
+
+		CSG_Shapes	*pShapesOut = ((CSG_Shapes *)pMerged);
+
+		for(int i=0; i<pShapesIn->Get_Count(); i++)
+		{
+			CSG_Shape	*pShape	= pShapesIn->Get_Shape(i);
+
+			pShapesOut->Add_Shape(pShape);
+
+			if( pShapesIn->Get_Vertex_Type() > SG_VERTEX_TYPE_XY )
 			{
-				pShape2->Set_Value(iField, pShape->asDouble(iField));
-			}//else
-		}//for
-	}//for
+				for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+				{
+					for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+					{
+						pShapesOut->Get_Shape(i)->Set_Z(pShape->Get_Z(iPoint, iPart), iPoint, iPart);
+
+						if( pShapesIn->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+						{
+							pShapesOut->Get_Shape(i)->Set_M(pShape->Get_M(iPoint, iPart), iPoint, iPart);
+						}
+					}
+				}
+			}
+		}
+	}
+	else // if( pList->Get_Type() == PARAMETER_TYPE_Table_List )
+	{
+		pMerged->Create(*((CSG_Table *)pList->asDataObject(0)));
+	}
 
-	//now copy the additional layers	
-	if( (pShapesList = Parameters("LAYERS")->asShapesList()) != NULL && pShapesList->Get_Count() > 0 )
+	pMerged->Set_Name(_TL("Merged Layers"));
+
+	//-----------------------------------------------------
+	bool	bInfo	= Parameters("SRCINFO")->asBool();
+
+	if( bInfo )
 	{
-		for (iLayer=0; iLayer<pShapesList->Get_Count(); iLayer++)
+		pMerged->Add_Field(_TL("Source"), SG_DATATYPE_String, 0);
+
+		for(int i=0; i<pMerged->Get_Count(); i++)
+		{
+			pMerged->Set_Value(i, 0, pList->asDataObject(0)->Get_Name());
+		}
+	}
+
+	int		*Index	= NULL;
+
+	//-----------------------------------------------------
+	for(int iTable=1; iTable<pList->Get_Count() && Process_Get_Okay(); iTable++)
+	{
+		CSG_Table	*pTable	= (CSG_Table *)pList->asDataObject(iTable);
+
+		//-------------------------------------------------
+		if( Parameters("MATCH")->asBool() )	// see which fields are in both attributes tables
+		{
+			Index	= (int *)SG_Realloc(Index, pTable->Get_Field_Count() * sizeof(int));
+
+			for(int i=0; i<pTable->Get_Field_Count(); i++)
+			{
+				CSG_String	Name(pTable->Get_Field_Name(i));
+
+				Index[i]	= -1;
+
+				for(int j=bInfo?1:0; Index[i]<0 && j<pMerged->Get_Field_Count(); j++)
+				{
+					if( !Name.CmpNoCase(pMerged->Get_Field_Name(j)) )
+					{
+						Index[i]	= j;
+					}
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		for(int iRecord=0; iRecord<pTable->Get_Count(); iRecord++)
 		{
-			if( (pShapes = pShapesList->asShapes(iLayer)) != NULL )
+			CSG_Table_Record	*pOutput, *pInput 	= pTable->Get_Record(iRecord);
+
+			if( pMerged->Get_ObjectType() == DATAOBJECT_TYPE_Shapes )
 			{
-				if (pShapes->Get_Type() == MainType)
+				CSG_Shape	*pShapeOut;
+
+				pOutput	= pShapeOut = ((CSG_Shapes *)pMerged)->Add_Shape(pInput, SHAPE_COPY_GEOM);
+
+				if( pMerged->asShapes()->Get_Vertex_Type() > SG_VERTEX_TYPE_XY )
 				{
-					FieldsMain.clear();
-					FieldsAdditional.clear();
+					CSG_Shape	*pShapeIn = pTable->asShapes()->Get_Shape(iRecord);
 
-					//see which fields are in both attributes tables
-					for (i=0; i<nFields; i++)
+					for(int iPart=0; iPart<pShapeIn->Get_Part_Count(); iPart++)
 					{
-						for (j=0; j<pShapes->Get_Field_Count(); j++)
+						for(int iPoint=0; iPoint<pShapeIn->Get_Point_Count(iPart); iPoint++)
 						{
-							sName1 = pShapes->Get_Field_Name(j);
-							sName2 = pTable->Get_Field_Name(i);
+							pShapeOut->Set_Z(pShapeIn->Get_Z(iPoint, iPart), iPoint, iPart);
 
-							if (!sName1.CmpNoCase(sName2))
+							if( pMerged->asShapes()->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
 							{
-								FieldsMain.push_back(i);
-								FieldsAdditional.push_back(j);
-								continue;
-							}//if
-						}//for
-					}//for
-
-					//copy shapes and attributes
-					for(i=0; i<pShapes->Get_Count(); i++)
+								pShapeOut->Set_M(pShapeIn->Get_M(iPoint, iPart), iPoint, iPart);
+							}
+						}
+					}
+				}
+			}
+			else // if( pMerged->Get_ObjectType() == DATAOBJECT_TYPE_Table )
+			{
+				pOutput	= pMerged->Add_Record();
+			}
+
+			if( bInfo )
+			{
+				pOutput->Set_Value(0, pTable->Get_Name());
+			}
+
+			if( Index )
+			{
+				for(int i=0; i<pTable->Get_Field_Count(); i++)
+				{
+					if( Index[i] >= 0 )
 					{
-						pShape	= pShapes->Get_Shape(i);					
-						pShape2 = pOutput->Add_Shape(pShape);
-						pShape2	->Set_Value(nFields + 0, 2 + iLayer);
-						pShape2	->Set_Value(nFields + 1, pShapes->Get_Name());
+						*pOutput->Get_Value(Index[i])	= *pInput->Get_Value(i);
+					}
+				}
+			}
+			else // if( !Index )
+			{
+				for(int i=0, j=bInfo?1:0; i<pTable->Get_Field_Count() && j<pMerged->Get_Field_Count(); i++, j++)
+				{
+					*pOutput->Get_Value(j)	= *pInput->Get_Value(i);
+				}
+			}
+		}
+	}
 
-						for (j=0; j<FieldsMain.size(); j++)
-						{
-							iFieldMain			= FieldsMain.at(j);
-							iFieldAdditional	= FieldsAdditional.at(j);
+	//-----------------------------------------------------
+	SG_FREE_SAFE(Index);
 
-							if (pTable->Get_Field_Type(iFieldMain) == SG_DATATYPE_String)
-							{
-								pShape2->Set_Value(iFieldMain, pShape->asString(iFieldAdditional));
-							}//if
-							else
-							{
-								pShape2->Set_Value(iFieldMain, pShape->asDouble(iFieldAdditional));
-							}//else
-						}//for
-					}//for
-				}//if
-			}//if
-		}//for
-	}//if
-
-	return true;
-
-}//method
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_tools/Shapes_Merge.h b/src/modules/shapes/shapes_tools/Shapes_Merge.h
index 913153b..4cf8acf 100644
--- a/src/modules/shapes/shapes_tools/Shapes_Merge.h
+++ b/src/modules/shapes/shapes_tools/Shapes_Merge.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes_Merge.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Shapes_Merge.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     Shapes_Merge.h
@@ -17,28 +17,72 @@
 
     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
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #ifndef HEADER_INCLUDED__Shapes_Merge_H
 #define HEADER_INCLUDED__Shapes_Merge_H
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #include "MLB_Interface.h"
 
-//---------------------------------------------------------
-class CShapes_Merge : public CSG_Module {
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTables_Merge : public CSG_Module
+{
 public:
-	CShapes_Merge(void);
-	virtual ~CShapes_Merge(void);
+	CTables_Merge(void);
 
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Shapes|Construction") );	}
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("A:Table|Tools") );	}
 
 
 protected:
-	virtual bool On_Execute(void);
+
+	virtual bool			On_Execute		(void);
 
 };
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CShapes_Merge : public CTables_Merge
+{
+public:
+	CShapes_Merge(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("A:Shapes|Construction") );	}
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #endif // #ifndef HEADER_INCLUDED__Shapes_Merge_H
diff --git a/src/modules/shapes/shapes_tools/TransformShapes.cpp b/src/modules/shapes/shapes_tools/TransformShapes.cpp
index 41c80db..25c33f5 100644
--- a/src/modules/shapes/shapes_tools/TransformShapes.cpp
+++ b/src/modules/shapes/shapes_tools/TransformShapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TransformShapes.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: TransformShapes.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     TransformShapes.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
 //---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_tools/TransformShapes.h b/src/modules/shapes/shapes_tools/TransformShapes.h
index 0f29030..54a3822 100644
--- a/src/modules/shapes/shapes_tools/TransformShapes.h
+++ b/src/modules/shapes/shapes_tools/TransformShapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TransformShapes.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id: TransformShapes.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     TransformShapes.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 #if _MSC_VER > 1000
 #pragma once
diff --git a/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp b/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp
index b9ab7d3..142a698 100644
--- a/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split_randomly.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: shapes_split_randomly.cpp 2108 2014-05-05 09:16:47Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -105,11 +105,13 @@ CShapes_Split_Randomly::CShapes_Split_Randomly(void)
 		_TL(""),
 		PARAMETER_TYPE_Double, 25.0, 0.0, true, 100.0, true
 	);
-}
 
-//---------------------------------------------------------
-CShapes_Split_Randomly::~CShapes_Split_Randomly(void)
-{}
+	Parameters.Add_Value(
+		NULL	, "EXACT"		, _TL("Exact"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
 
 
 ///////////////////////////////////////////////////////////
@@ -121,42 +123,63 @@ CShapes_Split_Randomly::~CShapes_Split_Randomly(void)
 //---------------------------------------------------------
 bool CShapes_Split_Randomly::On_Execute(void)
 {
-	double		Percent;
-	CSG_Shapes	*pShapes, *pA, *pB;
-
 	//-----------------------------------------------------
-	pShapes	= Parameters("SHAPES")	->asShapes();
-	pA		= Parameters("A")		->asShapes();
-	pB		= Parameters("B")		->asShapes();
-	Percent	= Parameters("PERCENT")	->asDouble();
+	CSG_Shapes	*pSplit[2], *pShapes	= Parameters("SHAPES")->asShapes();
+
+	if( !pShapes->is_Valid() )
+	{
+		Error_Set(SG_T("invalid input"));
+
+		return( false );
+	}
 
 	//-----------------------------------------------------
-	pA->Create(pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%d%%]"), pShapes->Get_Name(), (int)(100.5 - Percent)), pShapes);
-	pB->Create(pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%d%%]"), pShapes->Get_Name(), (int)(  0.5 + Percent)), pShapes);
+	double	Percent	= Parameters("PERCENT")->asDouble();
+
+	pSplit[0]	= Parameters("A")->asShapes();
+	pSplit[1]	= Parameters("B")->asShapes();
 
-	Percent	*= RAND_MAX / 100.0;
+	pSplit[0]->Create(pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%d%%]"), pShapes->Get_Name(), (int)(100.5 - Percent)), pShapes);
+	pSplit[1]->Create(pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%d%%]"), pShapes->Get_Name(), (int)(  0.5 + Percent)), pShapes);
 
 	//-----------------------------------------------------
-	if( pShapes->is_Valid() )
+	if( !Parameters("EXACT")->asBool() )
 	{
-		srand((unsigned)time(NULL));
+		for(int i=0; i<pShapes->Get_Count() && Set_Progress(i, pShapes->Get_Count()); i++)
+		{
+			pSplit[Percent >= CSG_Random::Get_Uniform(0, 100) ? 1 : 0]->Add_Shape(pShapes->Get_Shape(i));
+		}
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		int		i, n	= (int)(0.5 + pShapes->Get_Count() * Percent / 100.0);
+
+		CSG_Table	Random;
 
-		for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+		Random.Add_Field("INDEX"  , SG_DATATYPE_Int);
+		Random.Add_Field("PERCENT", SG_DATATYPE_Double);
+
+		for(i=0; i<pShapes->Get_Count() && Set_Progress(i, pShapes->Get_Count()); i++)
 		{
-			if( Percent < rand() )
-			{
-				pA->Add_Shape(pShapes->Get_Shape(iShape));
-			}
-			else
-			{
-				pB->Add_Shape(pShapes->Get_Shape(iShape));
-			}
+			CSG_Table_Record	*pRecord	= Random.Add_Record();
+
+			pRecord->Set_Value(0, i);
+			pRecord->Set_Value(1, CSG_Random::Get_Uniform(0, 100));
 		}
 
-		return( true );
+		Random.Set_Index(1, TABLE_INDEX_Ascending);
+
+		//-------------------------------------------------
+		for(i=0; i<pShapes->Get_Count() && Set_Progress(i, pShapes->Get_Count()); i++)
+		{
+			pSplit[i < n ? 1 : 0]->Add_Shape(pShapes->Get_Shape(Random[i].asInt(0)));
+		}
 	}
 
-	return( false );
+	//-----------------------------------------------------
+	return( true );
 }
 
 
diff --git a/src/modules/shapes/shapes_tools/shapes_split_randomly.h b/src/modules/shapes/shapes_tools/shapes_split_randomly.h
index 6b8d6fe..ece16aa 100644
--- a/src/modules/shapes/shapes_tools/shapes_split_randomly.h
+++ b/src/modules/shapes/shapes_tools/shapes_split_randomly.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split_randomly.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id: shapes_split_randomly.h 2108 2014-05-05 09:16:47Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,7 +76,6 @@ class CShapes_Split_Randomly : public CSG_Module
 {
 public:
 	CShapes_Split_Randomly(void);
-	virtual ~CShapes_Split_Randomly(void);
 
 	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Shapes|Construction") );	}
 
diff --git a/src/modules/shapes/shapes_transect/Makefile.in b/src/modules/shapes/shapes_transect/Makefile.in
index 26de2bf..b98657f 100644
--- a/src/modules/shapes/shapes_transect/Makefile.in
+++ b/src/modules/shapes/shapes_transect/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_transect
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libshapes_transect_la_DEPENDENCIES =  \
@@ -103,6 +126,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libshapes_transect_la_SOURCES)
 DIST_SOURCES = $(libshapes_transect_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -128,6 +156,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -155,6 +184,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -167,6 +197,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -196,6 +227,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -229,7 +261,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -303,7 +334,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -311,6 +341,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -326,13 +358,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libshapes_transect.la: $(libshapes_transect_la_OBJECTS) $(libshapes_transect_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libshapes_transect.la: $(libshapes_transect_la_OBJECTS) $(libshapes_transect_la_DEPENDENCIES) $(EXTRA_libshapes_transect_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libshapes_transect_la_OBJECTS) $(libshapes_transect_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -420,6 +454,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -470,10 +518,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -559,18 +612,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/simulation/Makefile.am b/src/modules/simulation/Makefile.am
new file mode 100644
index 0000000..7ec461d
--- /dev/null
+++ b/src/modules/simulation/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = sim_cellular_automata sim_ecosystems_hugget sim_erosion sim_fire_spreading sim_hydrology sim_ihacres
diff --git a/src/modules/simulation/Makefile.in b/src/modules/simulation/Makefile.in
new file mode 100644
index 0000000..2f58074
--- /dev/null
+++ b/src/modules/simulation/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/simulation
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+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
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/simulation/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/Life.cpp b/src/modules/simulation/sim_cellular_automata/Life.cpp
similarity index 100%
rename from src/modules_simulation/cellular_automata/sim_cellular_automata/Life.cpp
rename to src/modules/simulation/sim_cellular_automata/Life.cpp
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/Life.h b/src/modules/simulation/sim_cellular_automata/Life.h
similarity index 100%
rename from src/modules_simulation/cellular_automata/sim_cellular_automata/Life.h
rename to src/modules/simulation/sim_cellular_automata/Life.h
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.cpp b/src/modules/simulation/sim_cellular_automata/MLB_Interface.cpp
similarity index 100%
rename from src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.cpp
rename to src/modules/simulation/sim_cellular_automata/MLB_Interface.cpp
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.h b/src/modules/simulation/sim_cellular_automata/MLB_Interface.h
similarity index 100%
rename from src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.h
rename to src/modules/simulation/sim_cellular_automata/MLB_Interface.h
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.am b/src/modules/simulation/sim_cellular_automata/Makefile.am
similarity index 100%
rename from src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.am
rename to src/modules/simulation/sim_cellular_automata/Makefile.am
diff --git a/src/modules/simulation/sim_cellular_automata/Makefile.in b/src/modules/simulation/sim_cellular_automata/Makefile.in
new file mode 100644
index 0000000..0d203f9
--- /dev/null
+++ b/src/modules/simulation/sim_cellular_automata/Makefile.in
@@ -0,0 +1,636 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/simulation/sim_cellular_automata
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libsim_cellular_automata_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libsim_cellular_automata_la_OBJECTS = Life.lo MLB_Interface.lo \
+	Wator.lo
+libsim_cellular_automata_la_OBJECTS =  \
+	$(am_libsim_cellular_automata_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libsim_cellular_automata_la_SOURCES)
+DIST_SOURCES = $(libsim_cellular_automata_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_cellular_automata.la
+libsim_cellular_automata_la_SOURCES = \
+Life.cpp\
+MLB_Interface.cpp\
+Wator.cpp\
+Life.h\
+MLB_Interface.h\
+Wator.h
+
+libsim_cellular_automata_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_cellular_automata/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/simulation/sim_cellular_automata/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsim_cellular_automata.la: $(libsim_cellular_automata_la_OBJECTS) $(libsim_cellular_automata_la_DEPENDENCIES) $(EXTRA_libsim_cellular_automata_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libsim_cellular_automata_la_OBJECTS) $(libsim_cellular_automata_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Life.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Wator.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/simulation/sim_cellular_automata/Wator.cpp b/src/modules/simulation/sim_cellular_automata/Wator.cpp
new file mode 100644
index 0000000..bd822db
--- /dev/null
+++ b/src/modules/simulation/sim_cellular_automata/Wator.cpp
@@ -0,0 +1,493 @@
+/**********************************************************
+ * Version $Id: Wator.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Cellular_Automata                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       Wator.cpp                       //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Wator.h"
+#include <time.h>
+
+//---------------------------------------------------------
+#define FISH	1
+#define SHARK	2
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWator::CWator(void)
+{
+	CSG_Parameter	*pNode_0, *pNode_1;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Wa-Tor"));
+
+	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"Wa-Tor - an ecological simulation of predator-prey populations - "
+		"is based upon A. K. Dewdney's 'Computer Recreations' article "
+		"in the December 1984 issue of Scientific American."
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_Output(
+		NULL	, "GRID"			, _TL("Grid"),
+		_TL("")
+	);
+
+	pNode_0	= Parameters.Add_Node(
+		NULL	, "NODE_GRID"		, _TL("New Grid Dimensions"),
+		_TL("If grid is not set, a new one will be created using chosen width and height.")
+	);
+
+	Parameters.Add_Value(
+		pNode_0	, "NX"				, _TL("Width (Cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 100, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode_0	, "NY"				, _TL("Height (Cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 100, 1, true
+	);
+
+	pNode_0	= Parameters.Add_Grid(
+		NULL	, "RESULT"			, _TL("Wa-Tor"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL	, true, SG_DATATYPE_Byte
+	);
+
+	pNode_1	= Parameters.Add_Value(
+		pNode_0	, "REFRESH"			, _TL("Refresh"),
+		_TL(""),
+		PARAMETER_TYPE_Bool			, true
+	);
+
+	pNode_1	= Parameters.Add_Value(
+		pNode_0	, "INIT_FISH"		, _TL("Initial Number of Fishes [%]"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 30.0, 0.0, true, 100.0, true
+	);
+
+	pNode_1	= Parameters.Add_Value(
+		pNode_0	, "INIT_SHARK"		, _TL("Initial Number of Sharks [%]"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 7.5, 0.0, true, 100.0, true
+	);
+
+	pNode_0	= Parameters.Add_Table(
+		NULL	, "TABLE"			, _TL("Cycles"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	pNode_0	= Parameters.Add_Value(
+		NULL	, "FISH_BIRTH"		, _TL("Birth Rate of Fishes"),
+		_TL(""),
+		PARAMETER_TYPE_Int			,  3.0, 0.0, true
+	);
+
+	pNode_0	= Parameters.Add_Value(
+		NULL	, "SHARK_BIRTH"		, _TL("Birth Rate of Sharks"),
+		_TL(""),
+		PARAMETER_TYPE_Int			, 12.0, 0.0, true
+	);
+
+	pNode_0	= Parameters.Add_Value(
+		NULL	, "SHARK_STARVE"	, _TL("Max. Starvation Time for Sharks"),
+		_TL(""),
+		PARAMETER_TYPE_Int			,  4.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWator::On_Execute(void)
+{
+	bool			bRefresh;
+	int				x, y, i;
+	double			perc, Fish_perc, Shark_perc;
+	CSG_Colors			Colors;
+	CSG_Table			*pTable;
+	CSG_Table_Record	*pRecord;
+
+	//-----------------------------------------------------
+	if( (pWator = Parameters("RESULT")->asGrid()) == NULL )
+	{
+		bRefresh	= true;
+		pWator		= SG_Create_Grid(SG_DATATYPE_Byte, Parameters("NX")->asInt(), Parameters("NY")->asInt());
+		Parameters("GRID")->Set_Value(pWator);
+	}
+	else
+	{
+		bRefresh	= Parameters("REFRESH")->asBool();
+	}
+
+	pWator->Set_Name(_TL("Wa-Tor"));
+
+	Colors.Set_Count(3);
+	Colors.Set_Color(0, SG_GET_RGB(  0,   0,   0));
+	Colors.Set_Color(1, SG_GET_RGB(  0, 255,   0));
+	Colors.Set_Color(2, SG_GET_RGB(255,   0,   0));
+	DataObject_Set_Colors(pWator, Colors);
+	DataObject_Update(pWator, 0, 3, SG_UI_DATAOBJECT_SHOW);
+
+	//-----------------------------------------------------
+	Fish_Birth		= Parameters("FISH_BIRTH")	->asInt();
+	Shark_Birth		= Parameters("SHARK_BIRTH")	->asInt();
+	Shark_Starve	= Parameters("SHARK_STARVE")->asInt();
+
+	pTable			= Parameters("TABLE")		->asTable();
+	pTable->Destroy();
+	pTable->Set_Name(_TL("Wa-Tor"));
+	pTable->Add_Field("Cycle"	, SG_DATATYPE_Int);
+	pTable->Add_Field("Fishes"	, SG_DATATYPE_Int);
+	pTable->Add_Field("Sharks"	, SG_DATATYPE_Int);
+
+	pNext			= SG_Create_Grid(pWator, SG_DATATYPE_Byte);
+	pAge			= SG_Create_Grid(pWator, SG_DATATYPE_Byte);
+	pStarve			= SG_Create_Grid(pWator, SG_DATATYPE_Byte);
+
+	srand((unsigned)time(NULL));
+
+	//-----------------------------------------------------
+	if( bRefresh )
+	{
+		pWator->Assign(0.0);
+
+		Fish_perc		= Parameters("INIT_FISH" )->asDouble();
+		Shark_perc		= Parameters("INIT_SHARK")->asDouble() + Fish_perc;
+
+		for(y=0; y<pWator->Get_NY(); y++)
+		{
+			for(x=0; x<pWator->Get_NX(); x++)
+			{
+				perc	= 100.0 * (double)rand() / (double)RAND_MAX;
+
+				if( perc <= Fish_perc )
+				{
+					pWator	->Set_Value(x, y, FISH);
+				}
+				else if( perc <= Shark_perc )
+				{
+					pWator	->Set_Value(x, y, SHARK);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	pAge	->Assign();
+	pStarve	->Assign();
+
+	for(y=0; y<pWator->Get_NY(); y++)
+	{
+		for(x=0; x<pWator->Get_NX(); x++)
+		{
+			switch( pWator->asByte(x, y) )
+			{
+			case FISH:
+				pAge	->Set_Value(x, y, Fish_Birth	* (double)rand() / (double)RAND_MAX);
+				break;
+
+			case SHARK:
+				pAge	->Set_Value(x, y, Shark_Birth	* (double)rand() / (double)RAND_MAX);
+				pStarve	->Set_Value(x, y, Shark_Starve	* (double)rand() / (double)RAND_MAX);
+				break;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	SG_UI_Progress_Lock(true);
+
+	for(i=1; Process_Get_Okay(true) && Next_Cycle(); i++)
+	{
+		Process_Set_Text(CSG_String::Format(SG_T("%s: %d"), _TL("Life Cycle"), i));
+
+		pRecord	= pTable->Add_Record();
+		pRecord->Set_Value(0, i);
+		pRecord->Set_Value(1, nFishes);
+		pRecord->Set_Value(2, nSharks);
+
+		DataObject_Update(pWator, 0, 3);
+		DataObject_Update(pTable);
+	}
+
+	SG_UI_Progress_Lock(false);
+
+	//-----------------------------------------------------
+	delete(pNext);
+	delete(pAge);
+	delete(pStarve);
+
+	if( is_Progress() )
+	{
+		Message_Add(CSG_String::Format(SG_T("%s %d %s"), _TL("Dead after"), i, _TL("Life Cycles")));
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define GET_NEIGHBOR			{	ix = pWator->Get_System().Get_xTo(i, x); if( ix < 0 ) ix = pWator->Get_NX() - 1; else if( ix >= pWator->Get_NX() ) ix = 0;\
+									iy = pWator->Get_System().Get_yTo(i, y); if( iy < 0 ) iy = pWator->Get_NY() - 1; else if( iy >= pWator->Get_NY() ) iy = 0;	}
+
+#define GET_NEIGHBOR_RANDOMLY	{	i = iNeighbor[(int)((double)rand() * nNeighbors / (double)RAND_MAX)];\
+									ix = pWator->Get_System().Get_xTo(i, x); if( ix < 0 ) ix = pWator->Get_NX() - 1; else if( ix >= pWator->Get_NX() ) ix = 0;\
+									iy = pWator->Get_System().Get_yTo(i, y); if( iy < 0 ) iy = pWator->Get_NY() - 1; else if( iy >= pWator->Get_NY() ) iy = 0;	}
+
+//---------------------------------------------------------
+bool CWator::Next_Cycle(void)
+{
+	static int	iDir	= 0;
+
+	int		x, y, i, ix, iy, xx, yy, ax, ay, dx, dy,
+			iNeighbor[8], nNeighbors,
+			Age, Starve;
+
+	//-----------------------------------------------------
+	nFishes	= 0;
+	nSharks	= 0;
+
+	pNext->Assign(0.0);
+
+	switch( iDir )
+	{
+	default:
+	case 3:	ay	= pWator->Get_NY() - 1;	dy	= -1;	ax	= pWator->Get_NX() - 1;	dx	= -1;	iDir=0;	break;
+	case 2:	ay	= 0;					dy	=  1;	ax	= pWator->Get_NX() - 1;	dx	= -1;	iDir++;	break;
+	case 1:	ay	= pWator->Get_NY() - 1;	dy	= -1;	ax	= 0;					dx	=  1;	iDir++;	break;
+	case 0:	ay	= 0;					dy	=  1;	ax	= 0;					dx	=  1;	iDir++;	break;
+	}
+
+	//-----------------------------------------------------
+	for(yy=0, y=ay; yy<pWator->Get_NY(); yy++, y+=dy)
+	{
+		for(xx=0, x=ax; xx<pWator->Get_NX(); xx++, x+=dx)
+		{
+			if( pWator->asByte(x, y) == FISH )
+			{
+				nFishes++;
+
+				Age		= pAge->asInt(x, y) + 1;
+				pAge->Set_Value(x, y, 0);
+
+				for(i=0, nNeighbors=0; i<8; i++)
+				{
+					GET_NEIGHBOR;
+
+					if( pWator->asByte(ix, iy) == 0 && pNext->asByte(ix, iy) == 0 )
+					{
+						iNeighbor[nNeighbors++]	= i;
+					}
+				}
+
+				if( nNeighbors > 0 )
+				{
+					GET_NEIGHBOR_RANDOMLY;
+
+					pNext	->Set_Value(ix, iy, FISH);
+					pAge	->Set_Value(ix, iy, Age >= Fish_Birth ? 0 : Age);
+
+					if( Age >= Fish_Birth )
+					{
+						pNext	->Set_Value( x,  y, FISH);
+						pAge	->Set_Value( x,  y, Fish_Birth * (double)rand() / (double)RAND_MAX);
+					}
+					else
+					{
+						pWator	->Set_Value( x,  y, 0);
+					}
+				}
+				else
+				{
+					pNext	->Set_Value( x,  y, FISH);
+					pAge	->Set_Value( x,  y, Age >= Fish_Birth ? 0 : Fish_Birth);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(yy=0, y=ay; yy<pWator->Get_NY(); yy++, y+=dy)
+	{
+		for(xx=0, x=ax; xx<pWator->Get_NX(); xx++, x+=dx)
+		{
+			if( pWator->asByte(x, y) == SHARK )
+			{
+				nSharks++;
+
+				Age		= pAge->asInt(x, y) + 1;
+				pAge->Set_Value(x, y, 0);
+
+				Starve	= pStarve->asInt(x, y) + 1;
+				pStarve->Set_Value(x, y, 0);
+
+				for(i=0, nNeighbors=0; i<8; i++)
+				{
+					GET_NEIGHBOR;
+
+					if( pNext->asByte(ix, iy) == FISH )
+					{
+						iNeighbor[nNeighbors++]	= i;
+					}
+				}
+
+				if( nNeighbors > 0 )
+				{
+					GET_NEIGHBOR_RANDOMLY;
+
+					nFishes--;
+					pWator	->Set_Value(ix, iy, 0);
+
+					pNext	->Set_Value(ix, iy, SHARK);
+					pAge	->Set_Value(ix, iy, Age >= Shark_Birth ? 0 : Age);
+					pStarve	->Set_Value(ix, iy, 0);
+
+					if( Age >= Shark_Birth )
+					{
+						pNext	->Set_Value( x,  y, SHARK);
+						pAge	->Set_Value( x,  y, Shark_Birth * (double)rand() / (double)RAND_MAX);
+						pStarve	->Set_Value( x,  y, 0);
+					}
+					else
+					{
+						pWator	->Set_Value( x,  y, 0);
+					}
+				}
+				else if( Starve <= Shark_Starve )
+				{
+					for(i=0, nNeighbors=0; i<8; i++)
+					{
+						GET_NEIGHBOR;
+
+						if( pWator->asByte(ix, iy) == 0 && pNext->asByte(ix, iy) == 0 )
+						{
+							iNeighbor[nNeighbors++]	= i;
+						}
+					}
+
+					if( nNeighbors > 0 )
+					{
+						GET_NEIGHBOR_RANDOMLY;
+
+						pNext	->Set_Value(ix, iy, SHARK);
+						pAge	->Set_Value(ix, iy, Age >= Shark_Birth ? 0 : Age);
+						pStarve	->Set_Value(ix, iy, Starve);
+
+						if( Age >= Shark_Birth )
+						{
+							pNext	->Set_Value( x,  y, SHARK);
+							pAge	->Set_Value( x,  y, Shark_Birth * (double)rand() / (double)RAND_MAX);
+							pStarve	->Set_Value( x,  y, Starve);
+						}
+						else
+						{
+							pWator	->Set_Value( x,  y, 0);
+						}
+					}
+					else
+					{
+						pNext	->Set_Value( x,  y, SHARK);
+						pAge	->Set_Value( x,  y, Age >= Shark_Birth ? 0 : Shark_Birth);
+						pStarve	->Set_Value( x,  y, Starve);
+					}
+				}
+				else
+				{
+					nSharks--;
+				}
+			}
+		}
+	}
+
+	pWator->Assign(pNext);
+
+	return( (nFishes > 0 && nFishes < pWator->Get_NCells()) || nSharks > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/simulation/sim_cellular_automata/Wator.h b/src/modules/simulation/sim_cellular_automata/Wator.h
new file mode 100644
index 0000000..07f7a73
--- /dev/null
+++ b/src/modules/simulation/sim_cellular_automata/Wator.h
@@ -0,0 +1,117 @@
+/**********************************************************
+ * Version $Id: Wator.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   Cellular_Automata                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                        Wator.h                        //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Wator_H
+#define HEADER_INCLUDED__Wator_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CWator : public CSG_Module
+{
+public:
+	CWator(void);
+
+
+protected:
+
+	virtual bool			On_Execute(void);
+
+
+private:
+
+	int						Fish_Birth, Shark_Birth, Shark_Starve;
+
+	sLong					nFishes, nSharks;
+
+	CSG_Grid				*pWator, *pNext, *pAge, *pStarve;
+
+
+	bool					Next_Cycle(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Wator_H
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.cpp b/src/modules/simulation/sim_ecosystems_hugget/Hugget_01.cpp
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.cpp
rename to src/modules/simulation/sim_ecosystems_hugget/Hugget_01.cpp
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.h b/src/modules/simulation/sim_ecosystems_hugget/Hugget_01.h
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.h
rename to src/modules/simulation/sim_ecosystems_hugget/Hugget_01.h
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.cpp b/src/modules/simulation/sim_ecosystems_hugget/Hugget_02.cpp
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.cpp
rename to src/modules/simulation/sim_ecosystems_hugget/Hugget_02.cpp
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.h b/src/modules/simulation/sim_ecosystems_hugget/Hugget_02.h
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.h
rename to src/modules/simulation/sim_ecosystems_hugget/Hugget_02.h
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.cpp b/src/modules/simulation/sim_ecosystems_hugget/Hugget_03.cpp
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.cpp
rename to src/modules/simulation/sim_ecosystems_hugget/Hugget_03.cpp
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.h b/src/modules/simulation/sim_ecosystems_hugget/Hugget_03.h
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.h
rename to src/modules/simulation/sim_ecosystems_hugget/Hugget_03.h
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.cpp b/src/modules/simulation/sim_ecosystems_hugget/MLB_Interface.cpp
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.cpp
rename to src/modules/simulation/sim_ecosystems_hugget/MLB_Interface.cpp
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.h b/src/modules/simulation/sim_ecosystems_hugget/MLB_Interface.h
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.h
rename to src/modules/simulation/sim_ecosystems_hugget/MLB_Interface.h
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.am b/src/modules/simulation/sim_ecosystems_hugget/Makefile.am
similarity index 100%
rename from src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.am
rename to src/modules/simulation/sim_ecosystems_hugget/Makefile.am
diff --git a/src/modules/simulation/sim_ecosystems_hugget/Makefile.in b/src/modules/simulation/sim_ecosystems_hugget/Makefile.in
new file mode 100644
index 0000000..d7ac6e2
--- /dev/null
+++ b/src/modules/simulation/sim_ecosystems_hugget/Makefile.in
@@ -0,0 +1,639 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/simulation/sim_ecosystems_hugget
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libsim_ecosystems_hugget_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libsim_ecosystems_hugget_la_OBJECTS = Hugget_01.lo Hugget_02.lo \
+	Hugget_03.lo MLB_Interface.lo
+libsim_ecosystems_hugget_la_OBJECTS =  \
+	$(am_libsim_ecosystems_hugget_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libsim_ecosystems_hugget_la_SOURCES)
+DIST_SOURCES = $(libsim_ecosystems_hugget_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_ecosystems_hugget.la
+libsim_ecosystems_hugget_la_SOURCES = \
+Hugget_01.cpp\
+Hugget_02.cpp\
+Hugget_03.cpp\
+MLB_Interface.cpp\
+Hugget_01.h\
+Hugget_02.h\
+Hugget_03.h\
+MLB_Interface.h
+
+libsim_ecosystems_hugget_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_ecosystems_hugget/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/simulation/sim_ecosystems_hugget/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsim_ecosystems_hugget.la: $(libsim_ecosystems_hugget_la_OBJECTS) $(libsim_ecosystems_hugget_la_DEPENDENCIES) $(EXTRA_libsim_ecosystems_hugget_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libsim_ecosystems_hugget_la_OBJECTS) $(libsim_ecosystems_hugget_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hugget_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hugget_02.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hugget_03.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_simulation/erosion/sim_erosion/MLB_Interface.cpp b/src/modules/simulation/sim_erosion/MLB_Interface.cpp
similarity index 100%
rename from src/modules_simulation/erosion/sim_erosion/MLB_Interface.cpp
rename to src/modules/simulation/sim_erosion/MLB_Interface.cpp
diff --git a/src/modules_simulation/erosion/sim_erosion/MLB_Interface.h b/src/modules/simulation/sim_erosion/MLB_Interface.h
similarity index 100%
rename from src/modules_simulation/erosion/sim_erosion/MLB_Interface.h
rename to src/modules/simulation/sim_erosion/MLB_Interface.h
diff --git a/src/modules/simulation/sim_erosion/MMF_SAGA.cpp b/src/modules/simulation/sim_erosion/MMF_SAGA.cpp
new file mode 100644
index 0000000..e09c1ca
--- /dev/null
+++ b/src/modules/simulation/sim_erosion/MMF_SAGA.cpp
@@ -0,0 +1,1180 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      sim_erosion                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     MMF_SAGA.cpp                      //
+//                                                       //
+//                Copyright (C) 2009-12 by               //
+//                    Volker Wichmann                    //
+//                   Muhammad Setiawan                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     wichmann at laserdata                     //
+//                                                       //
+//    contact:    Volker Wichmann                        //
+//                LASERDATA GmbH                         //
+//                Management and analysis of             //
+//                laserscanning data                     //
+//                Innsbruck, Austria                     //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//  Implementation of the CMMF_SAGA class.               //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MMF_SAGA.h"
+
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Construction/Destruction				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CMMF_SAGA::CMMF_SAGA(void)
+{
+//	CSG_Parameter	*pNodeTerrain, *pNodeVegetation, *pNodeSoil, *pNodeClimate, *pNodeOptions, *pNodeOutput;
+
+	Set_Name	(_TL("MMF-SAGA Soil Erosion Model"));
+
+	Set_Author	(SG_T("(c) 2009-2012 V. Wichmann, M. Setiawan"));
+	
+	Set_Description(_TW("Soil erosion modelling with a modified MMF (Morgan-Morgan-Finney) model "
+						"(Morgan & Duzant 2008).<br/>"
+						"This module is called MMF-SAGA because some things have been implemented differently "
+						"compared to the original publication. The most important are:<br/><br/>"
+						"<ul>"
+						"<li>the extension of the model to support spatially distributed modelling</li>"
+						"<li>the introduction of a \"Channel Network\" layer</li>"
+						"<li>the introduction of a \"rainfall duration\" (time span) parameter</li>"
+						"<li>the exposure of the flow depth parameter</li>"
+						"</ul>"
+						"<br/><br/>"
+						"A more detailed description of the model, its modifications, and "
+						"model application is provided by Setiawan (2012), chapter 6.<br/>"
+						"Currently, a number of additional grid datasets are outputted to facilitate "
+						"model evaluation. This can be easily changed within the source code.<br/>"
+						"<br/><br/>"
+						"References:<br/>"
+						"<b>Morgan, R.P.C. (2001)</b>: A simple approach to soil loss prediction: a revised "
+						"Morgan-Morgan-Finney model. Catena 44: 305-322.<br/><br/>"
+						"<b>Morgan, R.P.C., Duzant, J.H. (2008)</b>: Modified MMF (Morgan-Morgan-Finney) model "
+						"for evaluating effects of crops and vegetation cover on soil erosion. Earth "
+						"Surf. Process. Landforms 32: 90-106.<br/><br/>"
+						"<a href=\"http://sourceforge.net/projects/saga-gis/files/SAGA%20-%20Documentation/Modules/MMF-SAGA_Setiawan.pdf\">"
+						"<b>Setiawan, M. A. (2012)</b>: Integrated Soil Erosion Management in the upper Serayu "
+						"Watershed, Wonosobo District, Central Java Province, Indonesia. Dissertation at "
+						"the Faculty of Geo- and Atmospheric Sciences of the University of Innsbruck, Austria.</a>"
+						"<br/><br/>"
+	));
+
+	// comments on equation numbers refer to Morgan & Duzant (2008)
+
+	
+	//pNodeTerrain = Parameters.Add_Node(NULL, "TERRAIN", _TL("Terrain"), _TL("Terrain parameters"));
+	Parameters.Add_Grid(
+		NULL, "DTM", _TL("Digital Terrain Model"), 
+		_TL("DTM, digital terrain model [m]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(
+		NULL, "S", _TL("Slope"), 
+		_TL("S, slope [rad]"), 
+		PARAMETER_INPUT
+	);
+    Parameters.Add_Grid(
+		NULL, "CHANNEL", _TL("Channel Network"), 
+		_TL("Channel network, all other cells NoData"), 
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	//pNodeVegetation = Parameters.Add_Node(NULL, "VEGETATION", _TL("Vegetation"), _TL("Vegetation parameters"));
+	Parameters.Add_Grid(	
+		NULL, "PI", _TL("Permament Interception"), 
+		_TL("PI, permanent interception expressed as the proportion [between 0-1] of rainfall"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "CC", _TL("Canopy Cover"), 
+		_TL("CC, canopy cover expressed as a portion [between 0-1] of the soil surface protected by vegetation or crop"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "PH", _TL("Plant Height"), 
+		_TL("PH, plant height [m], representing the effective height from which raindrops fall from the crop or vegetation"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "EtEo", _TL("Ratio Evapotranspiration"), 
+		_TL("Et/Eo, ratio of actual to potential evapotranspiration"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "GC", _TL("Ground cover"), 
+		_TL("GC, Ground cover expressed as a portion [between 0-1] of the soil surface protected by vegetation or crop cover on the ground"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "D", _TL("Diameter plant elements"), 
+		_TL("D, Average diameter [m] of the individual plants elements (stem, leaves) at the ground surface"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "NV", _TL("Number plant elements"), 
+		_TL("NV, Number of plant elements per unit area [number/unit area] at the ground surface"), 
+		PARAMETER_INPUT
+	);
+
+	//pNodeSoil = Parameters.Add_Node(NULL, "SOIL", _TL("Soil"), _TL("Soil parameters"));
+	Parameters.Add_Grid(	
+		NULL, "MS", _TL("Soil moisture (at FC)"), 
+		_TL("MS, Soil moisture at field capacity [% w/w]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "BD", _TL("Bulk density top layer"), 
+		_TL("BD, Bulk density of the top layer [Mg/m3]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "EHD", _TL("Effective hydrological depth"), 
+		_TL("EHD, Effective hydrological depth of the soil [m]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "LP", _TL("Sat. lateral permeability"), 
+		_TL("LP, Saturated lateral permeability of the soil [m/day]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "PER_C", _TL("Percentage clays"), 
+		_TL("c, Percentage clays [%]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "PER_Z", _TL("Percentage silt"), 
+		_TL("z, Percentage silt [%]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "PER_S", _TL("Percentage sand"), 
+		_TL("s, Percentage sand [%]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "ST", _TL("Percentage rock fragments"), 
+		_TL("ST, Percentage rock fragments on the soil surface [%]"), 
+		PARAMETER_INPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "RFR", _TL("Surface roughness"), 
+		_TL("RFR, Surface roughness [cm/m]"), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL, "TAB_METEO", _TL("Meteorological data"),
+		_TL("Meteorological data for multiple timestep modelling [model step (day); temperature (Celsius); rainfall (mm), rainfall intensity (mm/h); rainfall duration (day); timespan (days)]"),
+		PARAMETER_INPUT_OPTIONAL
+	);
+	Parameters.Add_FilePath( 
+		Parameters("TAB_METEO"), "OUT_PATH", _TL("Output file path"), 
+		_TL("Full path to the directory for the output grids of each model step"), 
+		SG_T("\0*.*\0\0*.*\0"), _TL(""), true, true
+	);
+
+	//pNodeClimate = Parameters.Add_Node(NULL, "CLIMATE", _TL("Climate"), _TL("Climate parameters"));
+	Parameters.Add_Value(
+		NULL, "INTERFLOW", _TL("Simulate Interflow"),
+		_TL("Simulate interflow"),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value( 
+		Parameters("INTERFLOW"), "T", _TL("Mean temperature"), 
+		_TL("T, mean temperature [degree C]"), 
+		PARAMETER_TYPE_Double, 
+		18.0
+	);
+
+	Parameters.Add_Value( 
+		Parameters("INTERFLOW"), "TIMESPAN", _TL("Timespan (days)"), 
+		_TL("The number of days to model."), 
+		PARAMETER_TYPE_Int, 30.0,
+        1.0, true, 365, true
+	);
+
+	Parameters.Add_Grid(	
+		Parameters("INTERFLOW"), "IF", _TL("Interflow"), 
+		_TL("IF"), 
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+	Parameters.Add_Value( 
+		NULL, "R", _TL("Rainfall"), 
+		_TL("R, height of precipitation in timespan [mm]"), 
+		PARAMETER_TYPE_Double, 
+		200.0
+	);
+	Parameters.Add_Value( 
+		NULL, "I", _TL("Rainfall intensity"), 
+		_TL("I, rainfall intensity [mm/h]"), 
+		PARAMETER_TYPE_Double, 
+		20.0
+	);
+	Parameters.Add_Value( 
+		NULL, "Rn", _TL("Rainfall Duration"), 
+		_TL("Rn, number of rain days in timespan [-]"), 
+		PARAMETER_TYPE_Double, 
+		20.0
+	);
+
+	CSG_String	choices;
+
+	for (int i=0; i<MMF_KE_I_Count; i++)
+		choices += CSG_String::Format(SG_T("%s|"), gMMF_KE_I_Key_Name[i]);
+
+	Parameters.Add_Choice(
+		NULL, "KE_I_METHOD", _TL("Relationship KE - I"),
+		_TL("Relationship between kinetic energy (KE) and rainfall intensity (I)"),
+		choices,
+		0
+	);
+
+    //pNodeOptions = Parameters.Add_Node(NULL, "OPTIONS", _TL("Model Options"), _TL("Model parameters"));
+    Parameters.Add_Value( 
+		NULL, "FLOWD_VA", _TL("Flow Depth (actual flow velocity)"), 
+		_TL("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."), 
+		PARAMETER_TYPE_Double, 0.005,
+        0.00000001, true
+	);
+    Parameters.Add_Value(
+        NULL, "CHANNELTRANSPORT", _TL("Route Soil along Channel Network"),
+        _TL("Route soil loss along channel network to outlet"),
+        PARAMETER_TYPE_Bool, false
+    );
+
+
+	//pNodeOutput = Parameters.Add_Node(NULL, "OUTPUT", _TL("Output"), _TL("Output parameters"));
+	Parameters.Add_Grid(	
+		NULL, "Q", _TL("Mean runoff"), 
+		_TL("Q, estimation of mean runoff [mm]"), 
+		PARAMETER_OUTPUT
+	);
+	Parameters.Add_Grid(	
+		NULL, "SL", _TL("Mean soil loss"), 
+		_TL("SL, estimation of mean soil loss [kg]"), 
+		PARAMETER_OUTPUT
+	);
+
+	#ifdef _TMP_OUT			// define this preprocessor variable to get intermediate grids as output
+		Parameters.Add_Grid(	
+			NULL, "Rf", _TL("Effective Rainfall"), 
+			_TL("Rf"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "KE", _TL("Total Kinetic Energy"), 
+			_TL("KE"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+				NULL, "Rc", _TL("Soil moisture storage capacity"), 
+				_TL("Rc"), 
+				PARAMETER_OUTPUT
+			);
+		Parameters.Add_Grid(	
+			NULL, "TCc", _TL("Transport Capacity Clay"), 
+			_TL("TCc"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "TCz", _TL("Transport Capacity Silt"), 
+			_TL("TCz"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "TCs", _TL("Transport Capacity Sand"), 
+			_TL("SLs"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "Gc", _TL("Available Clay"), 
+			_TL("Gc"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "Gz", _TL("Available Silt"), 
+			_TL("Gz"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "Gs", _TL("Available Sand"), 
+			_TL("Gs"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "SLc", _TL("Sediment Balance Clay"), 
+			_TL("SLc"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "SLz", _TL("Sediment Balance Silt"), 
+			_TL("SLz"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "SLs", _TL("Sediment Balance Sand"), 
+			_TL("SLs"), 
+			PARAMETER_OUTPUT
+		);
+		Parameters.Add_Grid(	
+			NULL, "TCONDc", _TL("Transport Condition Clay"), 
+			CSG_String::Format(_TL("Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"), TCOND_SED_LIMITED, TCOND_TRANS_LIMITED_TC, TCONF_TRANS_LIMITED_G), 
+			PARAMETER_OUTPUT, true, SG_DATATYPE_Int
+		);
+		Parameters.Add_Grid(	
+			NULL, "TCONDz", _TL("Transport Condition Silt"), 
+			CSG_String::Format(_TL("Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"), TCOND_SED_LIMITED, TCOND_TRANS_LIMITED_TC, TCONF_TRANS_LIMITED_G), 
+			PARAMETER_OUTPUT, true, SG_DATATYPE_Int
+		);
+		Parameters.Add_Grid(	
+			NULL, "TCONDs", _TL("Transport Condition Sand"), 
+			CSG_String::Format(_TL("Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"), TCOND_SED_LIMITED, TCOND_TRANS_LIMITED_TC, TCONF_TRANS_LIMITED_G), 
+			PARAMETER_OUTPUT, true, SG_DATATYPE_Int
+		);
+		Parameters.Add_Grid(	
+			NULL, "W_up", _TL("Upslope Flow Width"), 
+			_TL("W_up"), 
+			PARAMETER_OUTPUT
+		);
+	#endif
+}
+
+//---------------------------------------------------------
+CMMF_SAGA::~CMMF_SAGA(void)
+{
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CMMF_SAGA::On_Execute(void)
+{
+	// input grids
+	CSG_Grid	*pDTM, *pS, *pChannel, *pPI, *pCC, *pPH, *pMS, *pBD, *pEHD, *pEtEo, *pLP, *pGC, *pPer_c, *pPer_z, *pPer_s, *pST, *pD, *pNV, *pRFR;
+	// temporary grids
+	CSG_Grid	*pRf, *pKE, *pRc, *pSLc, *pSLz, *pSLs, *pW_up;
+	#ifdef _TMP_OUT
+	CSG_Grid	*pTCc, *pTCz, *pTCs, *pGc, *pGz, *pGs, *pTCondc, *pTCondz, *pTConds;
+	#endif
+	// optional meteo table
+	CSG_Table	*pMeteoTab;
+	CSG_String	sOutPath;
+
+	// interflow
+	bool		bInterflow, bFreeIF = false;
+	CSG_Grid	*pIF = NULL;
+	double		T = 0.0;
+	double		Rmod = 0.0, IF = 0.0, Z = 0.0, E = 0.0, Rc = 0.0, d_IF = 0.0;
+	// output grids
+	CSG_Grid	 *pQ, *pSL;
+
+	// input parameters
+	double		R, I, Rn;
+	int			KE_I_method;
+	
+	// temporary variables
+	double		    LD, DT, KE_DT, KE_LD, L, Q, Ro;
+	double		    per_c, per_z, per_s, ST, KE, GC, sin_S;
+	double		    n_manning, d_flow, v_flow_a, v_flow_b, v_flow_v, v_flow_t, v_flow;
+	double		    DEPc, DEPz, DEPs, Gc, Gz, Gs, TCc, TCz, TCs, SLc, SLz, SLs;
+
+    // variables
+	//double			slopeDeg;
+	double			slopeFract;
+	double		    timespan, flowd_va;
+	int			    x, y, ix, iy;
+	double		    z, d, dz[8], dzSum, d_Q, d_SLc, d_SLz, d_SLs;
+	double		    W_up, W_down, f_w;
+	const double	Convergence	= 1.1;  // convergence factor MFD after FREEMAN (1991)
+	int			    steepestN;
+	CSG_String	    InvalidGrid;
+    bool            bChannelT;
+	int				iRuns, iMstep;
+
+    // change this to false to only calculate runoff
+	bool		    bCalcSoil = true;
+
+
+	// detachability of the soil by raindrop impact
+	double		Kc = 0.1;		// [g/J]
+	double		Kz = 0.5;		// [g/J]
+	double		Ks = 0.3;		// [g/J]
+	double		Fc, Fz, Fs, F;
+
+	// detachability of the soil by runoff
+	double		DRc = 1.0;		// [-]
+	double		DRz = 1.6;		// [-]
+	double		DRs = 1.5;		// [-]
+	double		Hc, Hz, Hs, H;
+
+	// particle fall number
+	double	vs_c = 0.000002;	// fall velocity [m/s] clay
+	double	vs_z = 0.002;		// fall velocity [m/s] silt
+	double	vs_s = 0.02;		// fall velocity [m/s] sand
+	double	Nf_c, Nf_z, Nf_s;
+	// recalculation of particle fall number for sediment balance
+	double	vs_c1 = 0.00002;	// fall velocity [m/s] clay
+	double	vs_z1 = 0.02;		// fall velocity [m/s] silt
+	double	vs_s1 = 0.2;		// fall velocity [m/s] sand
+
+
+
+	pDTM		= Parameters("DTM")->asGrid();
+	pS			= Parameters("S")->asGrid();
+    pChannel    = Parameters("CHANNEL")->asGrid();
+	pPI			= Parameters("PI")->asGrid();
+	pCC			= Parameters("CC")->asGrid();
+	pPH			= Parameters("PH")->asGrid();
+	pMS			= Parameters("MS")->asGrid();
+	pBD			= Parameters("BD")->asGrid();
+	pEHD		= Parameters("EHD")->asGrid();
+	pEtEo		= Parameters("EtEo")->asGrid();
+	pLP			= Parameters("LP")->asGrid();
+	pGC			= Parameters("GC")->asGrid();
+	pPer_c		= Parameters("PER_C")->asGrid();
+	pPer_z		= Parameters("PER_Z")->asGrid();
+	pPer_s		= Parameters("PER_S")->asGrid();
+	pST			= Parameters("ST")->asGrid();
+	pD			= Parameters("D")->asGrid();
+	pNV			= Parameters("NV")->asGrid();
+	pRFR		= Parameters("RFR")->asGrid();
+	
+	pMeteoTab	= Parameters("TAB_METEO")->asTable();
+	sOutPath	= Parameters("OUT_PATH")->asString();
+
+	if (pMeteoTab != NULL)
+	{
+		if (sOutPath.Length() == 0)
+		{
+			SG_UI_Msg_Add_Error(_TL("No path for output files specified!"));
+			SG_UI_Msg_Add(_TL("Please provide a path for the output files."), true);
+			return (false);
+		}
+
+		iRuns = pMeteoTab->Get_Count();
+	}
+	else
+		iRuns = 1;
+
+
+	// check if all input grids are valid within the bounds of the DTM
+	//----------------------------------------------------------------
+	for (y=0; y<Get_NY(); y++)
+	{
+		for (x=0; x<Get_NX(); x++)
+		{
+			if (!pDTM->is_NoData(x, y))
+			{
+				InvalidGrid = SG_T("");
+
+				if (pS->is_NoData(x, y))
+					InvalidGrid = SG_T("S");
+				if (pPI->is_NoData(x, y))
+					InvalidGrid = SG_T("PI");
+				if (pCC->is_NoData(x, y))
+					InvalidGrid = SG_T("CC");
+				if (pPH->is_NoData(x, y))
+					InvalidGrid = SG_T("PH");
+				if (pMS->is_NoData(x, y))
+					InvalidGrid = SG_T("MS");
+				if (pBD->is_NoData(x, y))
+					InvalidGrid = SG_T("BD");
+				if (pEHD->is_NoData(x, y))
+					InvalidGrid = SG_T("EHD");
+				if (pEtEo->is_NoData(x, y))
+					InvalidGrid = SG_T("EtEo");
+				if (pLP->is_NoData(x, y))
+					InvalidGrid = SG_T("LP");
+				if (pGC->is_NoData(x, y))
+					InvalidGrid = SG_T("GC");
+				if (pPer_c->is_NoData(x, y))
+					InvalidGrid = SG_T("PER_C");
+				if (pPer_z->is_NoData(x, y))
+					InvalidGrid = SG_T("PER_Z");
+				if (pPer_s->is_NoData(x, y))
+					InvalidGrid = SG_T("PER_S");
+				if (pST->is_NoData(x, y))
+					InvalidGrid = SG_T("ST");
+				if (pD->is_NoData(x, y))
+					InvalidGrid = SG_T("D");
+				if (pNV->is_NoData(x, y))
+					InvalidGrid = SG_T("NV");
+				if (pRFR->is_NoData(x, y))
+					InvalidGrid = SG_T("RFR");
+
+				if (InvalidGrid.Length() > 0)
+				{
+					Error_Set(CSG_String::Format(_TL("NoData encountered in input grid %s: x %d (%.2f), y %d (%.2f)"),
+						InvalidGrid.c_str(), x, pDTM->Get_System().Get_xGrid_to_World(x), y, pDTM->Get_System().Get_yGrid_to_World(y)));
+					return (false);
+				}
+			}
+		}
+	}
+	
+	#ifdef _TMP_OUT								
+		pRf		= Parameters("Rf")->asGrid();
+		pKE		= Parameters("KE")->asGrid();
+		pRc		= Parameters("Rc")->asGrid();
+		pSLc	= Parameters("SLc")->asGrid();
+		pSLz	= Parameters("SLz")->asGrid();
+		pSLs	= Parameters("SLs")->asGrid();
+		pW_up	= Parameters("W_up")->asGrid();
+
+		pTCc	= Parameters("TCc")->asGrid();
+		pTCz	= Parameters("TCz")->asGrid();
+		pTCs	= Parameters("TCs")->asGrid();
+		pGc		= Parameters("Gc")->asGrid();
+		pGz		= Parameters("Gz")->asGrid();
+		pGs		= Parameters("Gs")->asGrid();
+		pTCondc = Parameters("TCONDc")->asGrid();
+		pTCondz = Parameters("TCONDz")->asGrid();
+		pTConds = Parameters("TCONDs")->asGrid();
+		pTCc->Assign_NoData();
+		pTCz->Assign_NoData();
+		pTCs->Assign_NoData();
+		pGc->Assign_NoData();
+		pGz->Assign_NoData();
+		pGs->Assign_NoData();
+		pTCondc->Assign_NoData();
+		pTCondz->Assign_NoData();
+		pTConds->Assign_NoData();
+	#endif
+
+	pIF			= Parameters("IF")->asGrid();
+	pQ			= Parameters("Q")->asGrid();
+	pSL			= Parameters("SL")->asGrid();
+
+	R		    = Parameters("R")->asDouble();
+	I		    = Parameters("I")->asDouble();
+	Rn		    = Parameters("Rn")->asDouble();
+	KE_I_method	= Parameters("KE_I_METHOD")->asInt();
+    timespan    = Parameters("TIMESPAN")->asInt();
+    flowd_va    = Parameters("FLOWD_VA")->asDouble();
+    bChannelT   = Parameters("CHANNELTRANSPORT")->asBool();
+	bInterflow	= Parameters("INTERFLOW")->asBool();
+	T			= Parameters("T")->asDouble();
+
+	if (bInterflow && pIF == NULL)
+	{
+		pIF		= SG_Create_Grid(pDTM);
+		bFreeIF = true;
+	}
+
+
+	// create temporary grids
+	#ifndef _TMP_OUT
+		pRf		= SG_Create_Grid(pDTM->Get_System());
+		pKE		= SG_Create_Grid(pDTM->Get_System());
+		pRc		= SG_Create_Grid(pDTM->Get_System());
+		pSLc	= SG_Create_Grid(pDTM->Get_System());
+		pSLz	= SG_Create_Grid(pDTM->Get_System());
+		pSLs	= SG_Create_Grid(pDTM->Get_System());
+		pW_up	= SG_Create_Grid(pDTM->Get_System());
+	#endif
+
+
+	for (int iRun=0; iRun<iRuns; iRun++)
+	{
+		SG_UI_Process_Set_Text(CSG_String::Format(_TL("Model step %d/%d ..."), iRun + 1, iRuns));
+
+		if (pMeteoTab != NULL)
+		{
+			iMstep		= pMeteoTab->Get_Record(iRun)->asInt(0);
+			T			= pMeteoTab->Get_Record(iRun)->asDouble(1);
+			R			= pMeteoTab->Get_Record(iRun)->asDouble(2);
+			I			= pMeteoTab->Get_Record(iRun)->asDouble(3);
+			Rn			= pMeteoTab->Get_Record(iRun)->asDouble(4);
+			timespan	= pMeteoTab->Get_Record(iRun)->asInt(5);
+		}
+
+		if (bInterflow && Rn > timespan)
+		{
+			Error_Set(CSG_String::Format(_TL("Number of raindays is greater than model timespan!")));
+			return (false);
+		}
+
+		// Initialize Grids
+		pSLc->Assign(0.0);
+		pSLz->Assign(0.0);
+		pSLs->Assign(0.0);
+		pQ->Assign(0.0);
+		pW_up->Assign(0.0);
+		if (bInterflow)
+			pIF->Assign(0.0);
+
+
+		// Estimation of rainfall energy (effective rainfall, leaf drainage, direct throughfall, kinetic energy)
+		//------------------------------------------------------------------------------------------------------
+		for (y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			for (x=0; x<Get_NX(); x++)
+			{
+				if (!pS->is_NoData(x, y) && !pPI->is_NoData(x, y) && !pCC->is_NoData(x, y) && !pPH->is_NoData(x, y))
+				{
+					pRf->Set_Value(x, y, (R * (1-pPI->asDouble(x, y))) / cos(pS->asDouble(x, y)));	// Equ. (1)
+					LD = pRf->asDouble(x, y) * pCC->asDouble(x, y);									// Equ. (2)
+					DT = pRf->asDouble(x, y) - LD;													// Equ. (3)
+				
+					switch (KE_I_method)		// Equ. (4), see Table 2 in Morgan (2001)
+					{
+					case MMF_KE_I_WISCHMEIER_SMITH_1978:
+					default:
+						KE_DT = DT * (11.87 + 8.73 * log10(I));				break;
+					case MMF_KE_I_MARSHALL_PALMER:
+						KE_DT = DT * (8.95 + 8.44 * log10(I));				break;
+					case MMF_KE_I_ZANCHI_TORRI_1980:
+						KE_DT = DT * (9.81 + 11.25 * log10(I));				break;
+					case MMF_KE_I_COUTINHO_TOMAS_1995:
+						KE_DT = DT * (35.9 * (1 - 0.56 * exp(-0.034 * I)));	break;
+					case MMF_KE_I_HUDSON_1965:
+						KE_DT = DT * (29.8 - (127.5 / I));					break;
+					case MMF_KE_I_ONEGA_ET_AL_1998:
+						KE_DT = DT * (9.81 + 10.6 * log10(I));				break;
+					case MMF_KE_I_ROSEWELL_1986:
+						KE_DT = DT * (29.0 * (1 - 0.6 * exp(-0.04 * I)));	break;
+					case MMF_KE_I_MCISAAC_1990:
+						KE_DT = DT * (26.8 * (1 - 0.29 * exp(-0.049 * I))); break;
+					}
+				
+					if (pPH->asDouble(x, y) < 0.15)
+						KE_LD = 0.0;																// Equ. (5)
+					else
+						KE_LD = LD * (15.8 * pow(pPH->asDouble(x, y), 0.5) - 5.87);					// Equ. (6)
+
+					pKE->Set_Value(x, y, KE_DT + KE_LD);											// Equ. (7)
+				}
+				else
+				{
+					pRf->Set_NoData(x, y);
+					pKE->Set_NoData(x, y);
+				}
+			}
+		}
+
+		// estimation of runoff
+		//-----------------------
+
+		if (bInterflow)
+		{
+			Z		= 300 + (25 * T) + (0.05 * T * T * T);		// Equ. (12)
+			Rmod	= R * (365/timespan);						// scale up from timespan to annual values
+			E		= Rmod / sqrt(0.9 + (Rmod*Rmod)/(Z*Z));		// Equ. (11)
+			E		= E / (365/timespan);                       // calculate E for timespan
+		}
+
+		Ro	= R / Rn;											// Equ. (9) mean rain per rain day
+
+
+		for (sLong n=0; n<Get_NCells() && Set_Progress(n); n++)
+		{
+			pDTM->Get_Sorted(n, x, y, true, false);
+
+			if (pDTM->is_NoData(x, y))	// pMS, pBD, pEHD, pEtEo, pRf, pLP, pS
+			{
+				pQ->Set_NoData(x, y);
+				pSL->Set_NoData(x, y);
+				pRc->Set_NoData(x, y);
+				if (bInterflow)
+					pIF->Set_NoData(x, y);
+			}
+			else
+			{
+				if (bInterflow)
+				{
+					Rc = (1000 * pMS->asDouble(x, y) * pBD->asDouble(x, y) * pEHD->asDouble(x, y) * pow(pEtEo->asDouble(x, y), 0.5)) - pIF->asDouble(x, y);	// Equ. (8)
+					if (Rc < 0.0)
+						Rc = 0.0;
+					pRc->Set_Value(x, y, Rc);
+				}
+				else
+					pRc->Set_Value(x, y, 1000 * pMS->asDouble(x, y) * pBD->asDouble(x, y) * pEHD->asDouble(x, y) * pow(pEtEo->asDouble(x, y), 0.5));		// Equ. (8), modified
+
+				L = Get_Cellsize() / cos(pS->asDouble(x, y));	// slope length, approx. from cellsize and slope
+
+				if (pChannel != NULL && !pChannel->is_NoData(x, y))
+					Q = pRf->asDouble(x, y) + pQ->asDouble(x, y);
+				else
+					Q = (pRf->asDouble(x, y) + pQ->asDouble(x, y)) * exp((-1.0 * pRc->asDouble(x, y)) / Ro) * pow(L/10,0.1);		// Equ. (9)
+            
+				//double Qe = pRf->asDouble(x, y) * exp((-1.0 * pRc->asDouble(x, y)) / Ro);
+			
+				if (bInterflow)
+				{
+					IF = ((R - E - Q) * pLP->asDouble(x, y) * sin(pS->asDouble(x, y))) / timespan;		// Equ. (13)
+					if (IF < 0)
+						IF = 0.0;
+				}
+
+
+				z		= pDTM->asDouble(x, y);
+				dzSum	= 0.0;
+				W_down	= 0.0;
+
+
+				// uncomment this to just route number of cells to verify flow routing
+				/*if (pChannel != NULL && !pChannel->is_NoData(x, y))
+					Q = 1.0 + pQ->asDouble(x, y);
+				else
+					Q = 0.0;
+				if (bInterflow)
+					IF = 0.0;
+				*/
+
+				if (pChannel != NULL && !pChannel->is_NoData(x, y))
+				{
+					steepestN   = pDTM->Get_Gradient_NeighborDir(x, y);
+					dzSum       = 1.0;
+				}
+				else	// MFD Freeman 1991
+				{
+					for (int i=0; i<8; i++)
+					{
+						ix	= Get_xTo(i, x);			
+						iy	= Get_yTo(i, y);			
+
+						if( pDTM->is_InGrid(ix, iy) )
+						{
+							d		= z - pDTM->asDouble(ix, iy);
+						}
+						else
+						{
+							ix		= Get_xTo(i + 4, x);
+							iy		= Get_yTo(i + 4, y);
+
+							if( pDTM->is_InGrid(ix, iy) )
+							{
+								d		= pDTM->asDouble(ix, iy) - z;
+							}
+							else
+							{
+								d		= 0.0;
+							}
+						}
+
+						if( d > 0.0 )
+						{
+							dzSum	+= (dz[i]	= pow(d / Get_Length(i), Convergence));
+						}
+						else
+						{
+							dz[i]	= 0.0;
+						}
+					}
+				}
+			
+				// flow routing
+				//-----------------------------------------------------
+				if (dzSum > 0.0)
+				{
+					if (pChannel != NULL && !pChannel->is_NoData(x, y))
+					{
+						if (steepestN != -1)
+						{
+							ix	= Get_xTo(steepestN, x);
+							iy	= Get_yTo(steepestN, y);
+
+							pQ->Add_Value(ix, iy, Q);								// distribute				
+							pW_up->Add_Value(ix, iy, Get_Length(steepestN));		// upslope CL of ix,iy
+							W_down = Get_Length(steepestN);							// downslope CL of x,y
+							if (bInterflow)
+								pIF->Add_Value(ix, iy, IF);
+						}
+					}
+					else
+					{
+						d_Q		=  Q / dzSum;
+						if (bInterflow)
+							d_IF =  IF / dzSum;
+
+						for (int i=0; i<8; i++)
+						{
+							if (dz[i] > 0.0)
+							{
+								ix	= Get_xTo(i, x);
+								iy	= Get_yTo(i, y);
+
+								if( pDTM->is_InGrid(ix, iy) )
+								{
+									pQ->Add_Value(ix, iy, d_Q * dz[i]);		// distribute
+									f_w = 0.5 * Get_Cellsize() / Get_System()->Get_UnitLength(i);
+									pW_up->Add_Value(ix, iy, f_w);			// upslope CL of ix,iy
+									W_down += f_w;							// downslope CL of x,y
+									if (bInterflow)
+										pIF->Add_Value(ix, iy, d_IF * dz[i]);
+								}
+							}
+						}
+					}
+				}
+
+				pQ->Set_Value(x, y, Q);		// write local values
+				if (bInterflow)
+					pIF->Set_Value(x, y, IF);
+
+				if (bCalcSoil)
+				{
+					// detachment of soil particles ...
+					per_c	= pPer_c->asDouble(x, y);
+					per_z	= pPer_z->asDouble(x, y);
+					per_s	= pPer_s->asDouble(x, y);
+					ST		= pST->asDouble(x, y);
+					KE		= pKE->asDouble(x, y);
+					GC		= pGC->asDouble(x, y);
+					sin_S	= sin(pS->asDouble(x, y));
+
+					// ... by raindrop impact
+					Fc	= Kc * (per_c / 100.0) * (1.0 - ST) * KE * 0.001;		// Equ. (14)
+					Fz	= Kz * (per_z / 100.0) * (1.0 - ST) * KE * 0.001;		// Equ.	(15)
+					Fs	= Ks * (per_s / 100.0) * (1.0 - ST) * KE * 0.001;		// Equ. (16)
+					F	= Fc + Fz + Fs;											// Equ. (17)
+					// ... by runoff
+					Hc	= DRc * (per_c / 100.0) * pow(Q, 1.5) * (1.0 - (GC + ST)) * pow(sin_S, 0.3) * 0.001;		// Equ. (18)
+					Hz	= DRz * (per_z / 100.0) * pow(Q, 1.5) * (1.0 - (GC + ST)) * pow(sin_S, 0.3) * 0.001;		// Equ. (19)
+					Hs	= DRs * (per_s / 100.0) * pow(Q, 1.5) * (1.0 - (GC + ST)) * pow(sin_S, 0.3) * 0.001;		// Equ. (20)
+					H	= Hc + Hz +Hs;																				// Equ. (21)
+
+					// flow velocity ...				/// input map with 3 classes
+					// ... for standard bare soil
+					n_manning = 0.015;
+					d_flow = 0.005;
+	
+					slopeFract = tan(pS->asDouble(x, y));
+					if (slopeFract == 0.0)
+						slopeFract = 0.001;	// workaround for velocity calculations, otherwise v_flow and thus TC may become NaN!
+
+					v_flow_b = 1.0 / n_manning * pow(d_flow, 0.67) * pow(slopeFract, 0.5);	// Equ. (22)
+				
+					// ... actual flow velocity
+					n_manning = 0.015;
+					// if ....		     // global method							
+					//d_flow = 0.005;	// unchannelled flow
+					//d_flow = 0.01;	// shallow rills
+					//d_flow = 0.25;	// deeper rills
+					d_flow = flowd_va;  // user supplied value
+					v_flow_a = 1.0 / n_manning * pow(d_flow, 0.67) * pow(slopeFract, 0.5) * pow(M_EULER, (-0.018*ST));	// Equ. (23)
+
+					// ... for vegetated conditions
+					if (pGC->asDouble(x, y) > 0.01)			// assuming bare soil as no ground cover
+						v_flow_v = pow(((2 * 9.81) / (pD->asDouble(x, y) * pNV->asDouble(x, y))), 0.5) * pow(slopeFract, 0.5);	// Equ. (24)
+					else
+						v_flow_v = 1.0;						// bare soil
+
+					// ... for the effect of tillage
+					d_flow = 0.005;
+					//n_manning = pow(M_EULER, log(-2.1132 + 0.0349 * pRFR->asDouble(x, y)));	// Equ. (27)
+					n_manning = pow(M_EULER, -2.1132 + 0.0349 * pRFR->asDouble(x, y));	// Equ. (27)
+					v_flow_t = 1.0 / n_manning * pow(d_flow, 0.67) * pow(slopeFract, 0.5);
+					// v_flow_t = 1.0 if not under arable cultivation and natural soil surface roughness is not accounted for
+
+					// particle fall number
+					//d_flow = 0.005;
+					d_flow = flowd_va;  // user supplied value
+
+					if (pGC->asDouble(x, y) > 0.01)						// assuming bare soil as no ground cover
+					{
+						Nf_c = (L * vs_c) / (v_flow_v * d_flow);		// Equ. (28)
+						Nf_z = (L * vs_z) / (v_flow_v * d_flow);		// Equ. (29)
+						Nf_s = (L * vs_s) / (v_flow_v * d_flow);		// Equ. (30)
+					}
+					else												// bare soil
+					{
+						Nf_c = (L * vs_c) / (v_flow_b * d_flow);		// Equ. (28)
+						Nf_z = (L * vs_z) / (v_flow_b * d_flow);		// Equ. (29)
+						Nf_s = (L * vs_s) / (v_flow_b * d_flow);		// Equ. (30)
+					}
+
+					// percentage of detached sediment deposited
+					DEPc = 44.1 * pow(Nf_c, 0.29);						// Equ. (31)
+					if (DEPc > 100.0)
+						DEPc = 100.0;
+					DEPz = 44.1 * pow(Nf_z, 0.29);						// Equ. (32)
+					if (DEPz > 100.0)
+						DEPz = 100.0;
+					DEPs = 44.1 * pow(Nf_s, 0.29);						// Equ. (33)
+					if (DEPs > 100.0)
+						DEPs = 100.0;
+
+					// delivery of detached particles to runoff
+
+					if (W_down <= 0.0)
+						W_down = 0.5 * Get_Cellsize();
+
+					if (pW_up->asDouble(x, y) == 0)
+						W_up = W_down;
+				
+
+					Gc	= (Fc + Hc) * (1.0 - DEPc / 100.0) + (pSLc->asDouble(x, y) * W_up/W_down);	// Equ. (35)
+					Gz	= (Fz + Hz) * (1.0 - DEPz / 100.0) + (pSLz->asDouble(x, y) * W_up/W_down);	// Equ. (36)
+					Gs	= (Fs + Hs) * (1.0 - DEPs / 100.0) + (pSLs->asDouble(x, y) * W_up/W_down);	// Equ. (37)
+					//G	= Gc + Gz + Gs;																		// Equ. (38)
+
+
+					// transport capacity of runoff
+					v_flow = (v_flow_a * v_flow_v * v_flow_t) / v_flow_b;
+					TCc = v_flow * (per_c / 100.0) * pow(Q, 2) * sin_S * 0.001;	// Equ. (39)
+					TCz = v_flow * (per_z / 100.0) * pow(Q, 2) * sin_S * 0.001;	// Equ. (40)
+					TCs = v_flow * (per_s / 100.0) * pow(Q, 2) * sin_S * 0.001;	// Equ. (41)
+
+					// sediment balance
+					if (TCc >= Gc)
+					{
+						SLc = Gc;
+						#ifdef _TMP_OUT
+						pTCondc->Set_Value(x, y, TCOND_SED_LIMITED);
+						#endif
+					}
+					else	// recalculation
+					{
+						if (pGC->asDouble(x, y) > 0.01)								// assuming bare soil as no ground cover
+							Nf_c = (L * vs_c1) / (v_flow_v * d_flow);				// Equ. (28)
+						else														// bare soil
+							Nf_c = (L * vs_c1) / (v_flow_b * d_flow);				// Equ. (28)
+
+						DEPc = 44.1 * pow(Nf_c, 0.29);								// Equ. (31)
+						if (DEPc > 100.0)
+							DEPc = 100.0;
+						Gc	= Gc * (1.0 - DEPc / 100.0);							// Equ. (45)
+						if (TCc >= Gc)
+						{
+							SLc = TCc;
+							#ifdef _TMP_OUT
+							pTCondc->Set_Value(x, y, TCOND_TRANS_LIMITED_TC);
+							#endif
+						}
+						else
+						{
+							SLc = Gc;
+							#ifdef _TMP_OUT
+							pTCondc->Set_Value(x, y, TCONF_TRANS_LIMITED_G);
+							#endif
+						}
+					}
+
+					if (TCz >= Gz)
+					{
+						SLz = Gz;
+						#ifdef _TMP_OUT
+						pTCondz->Set_Value(x, y, 0);
+						#endif
+					}
+					else	// recalculation
+					{
+						if (pGC->asDouble(x, y) > 0.01)								// assuming bare soil as no ground cover
+							Nf_z = (L * vs_z1) / (v_flow_v * d_flow);				// Equ. (28)
+						else														// bare soil
+							Nf_z = (L * vs_z1) / (v_flow_b * d_flow);				// Equ. (28)
+
+						DEPz = 44.1 * pow(Nf_z, 0.29);								// Equ. (31)
+						if (DEPz > 100.0)
+							DEPz = 100.0;
+						Gz	= Gz * (1.0 - DEPz / 100.0);							// Equ. (46)
+						if (TCz >= Gz)
+						{
+							SLz = TCz;
+							#ifdef _TMP_OUT
+							pTCondz->Set_Value(x, y, 1);
+							#endif
+						}
+						else
+						{
+							SLz = Gz;
+							#ifdef _TMP_OUT
+							pTCondz->Set_Value(x, y, 2);
+							#endif
+						}
+					}
+
+					if (TCs >= Gs)
+					{
+						SLs = Gs;
+						#ifdef _TMP_OUT
+						pTConds->Set_Value(x, y, 0);
+						#endif
+					}
+					else	// recalculation
+					{
+						if (pGC->asDouble(x, y) > 0.01)								// assuming bare soil as no ground cover
+							Nf_s = (L * vs_s1) / (v_flow_v * d_flow);				// Equ. (28)
+						else														// bare soil
+							Nf_s = (L * vs_s1) / (v_flow_b * d_flow);				// Equ. (28)
+
+						DEPs = 44.1 * pow(Nf_s, 0.29);								// Equ. (31)
+						if (DEPs > 100.0)
+							DEPs = 100.0;
+						Gs	= Gs * (1.0 - DEPs / 100.0);							// Equ. (47)
+						if (TCs >= Gs)
+						{
+							SLs = TCs;
+							#ifdef _TMP_OUT
+							pTConds->Set_Value(x, y, 1);
+							#endif
+						}
+						else
+						{
+							SLs = Gs;
+							#ifdef _TMP_OUT
+							pTConds->Set_Value(x, y, 2);
+							#endif
+						}
+					}
+
+					SLc *= pDTM->Get_Cellarea();
+					SLz *= pDTM->Get_Cellarea();
+					SLs *= pDTM->Get_Cellarea();
+
+					// sediment routing
+					//-----------------------------------------------------
+					if (dzSum > 0.0)
+					{
+						if (pChannel != NULL && !pChannel->is_NoData(x, y) && bChannelT)		// Transport along channel, ignore (new) sediment balance within channel
+						{
+							if (steepestN != -1)
+							{					
+								ix	= Get_xTo(steepestN, x);
+								iy	= Get_yTo(steepestN, y);
+
+								pSLc->Add_Value(ix, iy, pSLc->asDouble(x, y));
+								pSLz->Add_Value(ix, iy, pSLz->asDouble(x, y));
+								pSLs->Add_Value(ix, iy, pSLs->asDouble(x, y));
+							}
+						}
+						else if (pChannel == NULL || (pChannel != NULL && pChannel->is_NoData(x, y)))		// no channel grid used or no channel cell
+						{
+							d_SLc	=  SLc / dzSum;
+							d_SLz	=  SLz / dzSum;
+							d_SLs	=  SLs / dzSum;
+
+							for (int i=0; i<8; i++)
+							{
+								if (dz[i] > 0.0)
+								{
+									ix	= Get_xTo(i, x);
+									iy	= Get_yTo(i, y);
+
+									if( pDTM->is_InGrid(ix, iy) )
+									{
+										pSLc->Add_Value(ix, iy, d_SLc * dz[i]);		// distribute
+										pSLz->Add_Value(ix, iy, d_SLz * dz[i]);
+										pSLs->Add_Value(ix, iy, d_SLs * dz[i]);
+									}
+								}
+							}
+						}
+					}
+
+					if (pChannel != NULL && !pChannel->is_NoData(x, y))			// channel grid and channel cell: only write incoming material, ignore (new) sediment balance
+					{
+						pSL->Set_Value(x, y, pSLc->asDouble(x, y) + pSLz->asDouble(x, y) + pSLs->asDouble(x, y));
+						pSLc->Set_Value(x, y, pSLc->asDouble(x, y));
+						pSLz->Set_Value(x, y, pSLz->asDouble(x, y));
+						pSLs->Set_Value(x, y, pSLs->asDouble(x, y));
+					}
+					else  // calc mean annual soil loss
+					{
+						pSL->Set_Value(x, y, SLc + SLz + SLs);
+						pSLc->Set_Value(x, y, SLc);
+						pSLz->Set_Value(x, y, SLz);
+						pSLs->Set_Value(x, y, SLs);
+					}
+
+					#ifdef _TMP_OUT
+					pTCc->Set_Value(x, y, TCc * pDTM->Get_Cellarea());
+					pTCz->Set_Value(x, y, TCz * pDTM->Get_Cellarea());
+					pTCs->Set_Value(x, y, TCs * pDTM->Get_Cellarea());
+
+					pGc->Set_Value(x, y, Gc * pDTM->Get_Cellarea());
+					pGz->Set_Value(x, y, Gz * pDTM->Get_Cellarea());
+					pGs->Set_Value(x, y, Gs * pDTM->Get_Cellarea());
+					#endif
+				}// bCalcSoil
+			}// not NoData
+		}// for
+
+		if (pMeteoTab != NULL)
+		{
+			pQ->Save(CSG_String::Format(SG_T("%s\\%03d_Runoff"), sOutPath.c_str(), iRun + 1));
+			pSL->Save(CSG_String::Format(SG_T("%s\\%03d_SoilLoss"), sOutPath.c_str(), iRun + 1));
+		}
+	}// for model step
+
+	//-----------------------------------------------------
+	// delete temporary grids
+	#ifndef _TMP_OUT
+		delete(pRf);
+		delete(pKE);
+		delete(pRc);
+		delete(pSLc);
+		delete(pSLz);
+		delete(pSLs);
+		delete(pW_up);
+	#endif
+
+	if (bFreeIF)
+		delete(pIF);
+
+	return( true );
+}
+
+
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_simulation/erosion/sim_erosion/MMF_SAGA.h b/src/modules/simulation/sim_erosion/MMF_SAGA.h
similarity index 100%
rename from src/modules_simulation/erosion/sim_erosion/MMF_SAGA.h
rename to src/modules/simulation/sim_erosion/MMF_SAGA.h
diff --git a/src/modules_simulation/erosion/sim_erosion/Makefile.am b/src/modules/simulation/sim_erosion/Makefile.am
similarity index 100%
rename from src/modules_simulation/erosion/sim_erosion/Makefile.am
rename to src/modules/simulation/sim_erosion/Makefile.am
diff --git a/src/modules/simulation/sim_erosion/Makefile.in b/src/modules/simulation/sim_erosion/Makefile.in
new file mode 100644
index 0000000..9424831
--- /dev/null
+++ b/src/modules/simulation/sim_erosion/Makefile.in
@@ -0,0 +1,631 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/simulation/sim_erosion
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libsim_erosion_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libsim_erosion_la_OBJECTS = MMF_SAGA.lo MLB_Interface.lo
+libsim_erosion_la_OBJECTS = $(am_libsim_erosion_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libsim_erosion_la_SOURCES)
+DIST_SOURCES = $(libsim_erosion_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+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 $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_erosion.la
+libsim_erosion_la_SOURCES = \
+MMF_SAGA.cpp\
+MLB_Interface.cpp\
+MMF_SAGA.h\
+MLB_Interface.h
+
+libsim_erosion_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_erosion/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/simulation/sim_erosion/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsim_erosion.la: $(libsim_erosion_la_OBJECTS) $(libsim_erosion_la_DEPENDENCIES) $(EXTRA_libsim_erosion_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libsim_erosion_la_OBJECTS) $(libsim_erosion_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MMF_SAGA.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.cpp b/src/modules/simulation/sim_hydrology/DVWK_SoilMoisture.cpp
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.cpp
rename to src/modules/simulation/sim_hydrology/DVWK_SoilMoisture.cpp
diff --git a/src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.h b/src/modules/simulation/sim_hydrology/DVWK_SoilMoisture.h
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.h
rename to src/modules/simulation/sim_hydrology/DVWK_SoilMoisture.h
diff --git a/src/modules/simulation/sim_hydrology/KinWav_D8.cpp b/src/modules/simulation/sim_hydrology/KinWav_D8.cpp
new file mode 100644
index 0000000..3698791
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/KinWav_D8.cpp
@@ -0,0 +1,550 @@
+/**********************************************************
+ * Version $Id: KinWav_D8.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    Kinematic_Wave                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    KinWav_D8.cpp                      //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "KinWav_D8.h"
+
+//---------------------------------------------------------
+#define Beta_0		(3.0 / 5.0)
+#define Beta_1		(3.0 / 5.0 - 1.0)
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CKinWav_D8::CKinWav_D8(void)
+{
+	CSG_Parameter	*pNode;
+
+	Set_Name		(_TL("Overland Flow - Kinematic Wave D8"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2003"));
+
+	Set_Description	(_TW(
+		"Overland Flow - Kinematic Wave D8"
+		"\n\n"
+		"Reference:\n"
+		"Johnson, D.L., Miller, A.C. (1997):"
+		" A spatially distributed hydrological model utilizing raster data structures,"
+		" Computers & Geosciences, Vol.23, No.3, pp.267-272"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "FLOW"		, _TL("Runoff"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "GAUGES"		, _TL("Gauges"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table(
+		NULL	, "GAUGES_FLOW"	, _TL("Flow at Gauges"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Value(
+		NULL	, "TIME_SPAN"	, _TL("Simulation Time [h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 24.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "TIME_STEP"	, _TL("Simulation Time Step [h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double,  0.1, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "ROUGHNESS"	, _TL("Manning's Roughness"),
+		_TL(""),
+		PARAMETER_TYPE_Double,  0.03, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(NULL, "NEWTON", _TL("Newton-Raphson"), _TL(""));
+
+	Parameters.Add_Value(
+		pNode	, "NEWTON_MAXITER"	, _TL("Max. Iterations"),
+		_TL(""),
+		PARAMETER_TYPE_Int		, 100		, 1		, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "NEWTON_EPSILON"	, _TL("Epsilon"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.0001	, 0.0	, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Choice(
+		NULL	, "PRECIP"		, _TL("Precipitation"),
+		_TL("Kind of initializing Precipitation Event"),
+
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Homogenous"),
+			_TL("Above Elevation"),
+			_TL("Left Half")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "THRESHOLD"	, _TL("Threshold Elevation"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CKinWav_D8::On_Execute(void)
+{
+	double	Roughness;
+
+	//-----------------------------------------------------
+	m_pDEM				= Parameters("DEM")				->asGrid();
+	m_pFlow				= Parameters("FLOW")			->asGrid();
+
+	m_pGauges			= Parameters("GAUGES")			->asShapes();
+	m_pGauges_Flow		= Parameters("GAUGES_FLOW")		->asTable();
+
+	Newton_MaxIter		= Parameters("NEWTON_MAXITER")	->asInt();
+	Newton_Epsilon		= Parameters("NEWTON_EPSILON")	->asDouble();
+
+	Roughness			= Parameters("ROUGHNESS")		->asDouble();
+
+	//-----------------------------------------------------
+	if( Initialize(Roughness) )
+	{
+		int		x, y;
+		double	Time, Time_Span;
+
+		Gauges_Initialise();
+
+		Time_Span		= Parameters("TIME_SPAN")		->asDouble();
+		m_dTime			= Parameters("TIME_STEP")		->asDouble();
+
+		for(Time=0.0; Time<=Time_Span && Process_Get_Okay(false); Time+=m_dTime)
+		{
+			Process_Set_Text(CSG_String::Format(SG_T("%s [h]: %f (%f)"), _TL("Simulation Time"), Time, Time_Span));
+
+			Get_Precipitation(Time);
+
+			m_Flow_Last.Assign(m_pFlow);
+
+			m_pFlow->Assign(0.0);
+
+			for(sLong n=0; n<m_pDEM->Get_NCells() && Process_Get_Okay(false); n++)
+			{
+				if( m_pDEM->Get_Sorted(n, x, y) )
+				{
+					Get_Runoff(x, y);
+				}
+				else
+				{
+					m_pFlow->Set_NoData(x, y);
+				}
+			}
+
+			DataObject_Update(m_pFlow, 0.0, 100.0);
+
+			Gauges_Set_Flow(Time);
+		}
+
+		//-------------------------------------------------
+		Finalize();
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CKinWav_D8::Get_Runoff(int x, int y)
+{
+	int		Direction	= m_Direction.asChar(x, y);
+
+	if( Direction >= 0 )
+	{
+		m_pFlow->Set_Value(x, y, 
+			Get_Runoff(
+				m_pFlow		->asDouble(x, y),
+				m_Flow_Last	 .asDouble(x, y),
+				m_Alpha		 .asDouble(x, y),
+				Get_UnitLength(Direction), 0.0, 0.0
+			)
+		);
+
+		m_pFlow->Add_Value(Get_xTo(Direction, x), Get_yTo(Direction, y), m_Flow_Last.asDouble(x, y));
+	}
+}
+
+//---------------------------------------------------------
+double CKinWav_D8::Get_Runoff(double q_Up, double q_Last, double alpha, double dL, double r, double r_Last)
+{
+	double	dTdL, d, c, q, Res, dRes, dR;
+
+	//-----------------------------------------------------
+	dTdL	= m_dTime / dL;
+	dR		= m_dTime / 2.0 * (r + r_Last);
+
+
+	//-----------------------------------------------------
+	// 1. Initial estimation of q...
+
+	if( q_Last + q_Up != 0.0 )
+	{
+		d	= alpha * Beta_0 * pow((q_Last + q_Up) / 2.0, Beta_1);
+		q	= ( dTdL * q_Up + q_Last * d + dR ) / ( dTdL + d );
+	}
+	else
+	{
+		q	= dR;
+	}
+
+
+	//-----------------------------------------------------
+	// 2. Newton-Raphson...
+
+	c	= dTdL * q_Up + alpha * pow(q_Last, Beta_0) + dR;
+
+	for(int i=0; i<Newton_MaxIter; i++)
+	{
+		if( q <= 0 )
+		{
+			return( dR );
+		}
+
+		Res		= dTdL * q + alpha		    * pow(q, Beta_0) - c;
+		dRes	= dTdL     + alpha * Beta_0 * pow(q, Beta_1);
+//		if( dRes == 0.0 )	{	return( 0.0 );	}
+
+		d		= Res / dRes;
+		q		-= d;
+
+		if( fabs(d) < Newton_Epsilon )
+		{
+			break;
+		}
+	}
+
+	return( q < 0.0 ? 0.0 : q );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CKinWav_D8::Initialize(double Roughness)
+{
+	m_Flow_Last	.Create(*Get_System(), SG_DATATYPE_Float);
+	m_Alpha		.Create(*Get_System(), SG_DATATYPE_Float);
+	m_Direction	.Create(*Get_System(), SG_DATATYPE_Char);
+	m_Direction	.Set_NoData_Value(-1);
+
+	m_pFlow->Assign(0.0);
+	DataObject_Set_Colors(m_pFlow, 100, SG_COLORS_WHITE_BLUE);
+	DataObject_Update(m_pFlow, 0.0, 100.0, SG_UI_DATAOBJECT_SHOW);
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_pDEM->is_NoData(x, y) )
+			{
+				int		i, ix, iy, iMax;
+				double	z, d, dMax;
+
+				for(i=0, iMax=-1, dMax=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
+				{
+					ix	= Get_xTo(i, x);
+					iy	= Get_yTo(i, y);
+
+					if( is_InGrid(ix, iy) && (d = (z - m_pDEM->asDouble(ix, iy)) / Get_Length(i)) > dMax )
+					{
+						dMax	= d;
+						iMax	= i;
+					}
+				}
+
+				if( iMax < 0 )
+				{
+					m_Direction	 .Set_NoData(x, y);
+				}
+				else
+				{
+					m_Direction	.Set_Value(x, y, iMax);
+
+					m_Alpha		.Set_Value(x, y, pow(Roughness / sqrt(dMax), Beta_0));
+
+					if( m_Alpha.asDouble(x, y) > 10 )
+						m_Alpha.Set_Value(x, y, 10);
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CKinWav_D8::Finalize(void)
+{
+	m_Direction	.Destroy();
+	m_Alpha		.Destroy();
+	m_Flow_Last	.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CKinWav_D8::Gauges_Initialise(void)
+{
+	if( m_pGauges_Flow != NULL )
+	{
+		if( m_pGauges == NULL )
+		{
+			DataObject_Add(m_pGauges = SG_Create_Shapes(SHAPE_TYPE_Point, _TL("Gauges")));
+
+			Parameters("GAUGES")->Set_Value(m_pGauges);
+
+			m_pGauges->Add_Field(_TL("ID"), SG_DATATYPE_Int);
+
+			for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+			{
+				for(int x=0; x<Get_NX(); x++)
+				{
+					bool	bBorder	= false;
+					bool	bLowest	= true;
+
+					for(int i=0; i<8; i++)
+					{
+						int	ix	= Get_xTo(i, x);
+						int	iy	= Get_yTo(i, y);
+
+						if( !m_pDEM->is_InGrid(ix, iy) )
+						{
+							bBorder	= true;
+						}
+						else if( m_pDEM->asDouble(ix, iy) < m_pDEM->asDouble(x, y) )
+						{
+							bLowest	= false;
+						}
+					}
+
+					if( bLowest && bBorder )
+					{
+						CSG_Shape	*pGauge	= m_pGauges->Add_Shape();
+
+						pGauge->Add_Point(Get_System()->Get_Grid_to_World(x, y));
+						pGauge->Set_Value(0, m_pGauges->Get_Count() + 1);
+					}
+				}
+			}
+		}
+
+		m_pGauges_Flow->Destroy();
+		m_pGauges_Flow->Set_Name(_TL("Outlet Hydrographs"));
+		m_pGauges_Flow->Add_Field("TIME", SG_DATATYPE_Double);
+
+		for(int i=0; i<m_pGauges->Get_Count(); i++)
+		{
+			m_pGauges_Flow->Add_Field(CSG_String::Format(SG_T("GAUGE_%02d"), i + 1), SG_DATATYPE_Double);
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CKinWav_D8::Gauges_Set_Flow(double Time)
+{
+	if( m_pGauges_Flow && m_pGauges_Flow->Get_Field_Count() == m_pGauges->Get_Count() + 1 )
+	{
+		CSG_Table_Record	*pRecord	= m_pGauges_Flow->Add_Record();
+
+		pRecord->Set_Value(0, Time);
+
+		for(int i=0; i<m_pGauges->Get_Count(); i++)
+		{
+			double	Flow;
+
+			if( m_pFlow->Get_Value(m_pGauges->Get_Shape(i)->Get_Point(0), Flow) )
+			{
+				pRecord->Set_Value(i + 1, Flow);
+			}
+		}
+
+		DataObject_Update(m_pGauges_Flow);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CKinWav_D8::Get_Precipitation(double Time)
+{
+	if( Time == 0.0 )
+	{
+		int		x, y;
+		double	t;
+
+		switch( Parameters("PRECIP")->asInt() )
+		{
+		case 0:
+			(*m_pFlow)	+= 100.0;
+			break;
+
+		case 1:
+			t	= Parameters("THRESHOLD")->asDouble();
+
+			for(y=0; y<m_pDEM->Get_NY(); y++)
+			{
+				for(x=0; x<m_pDEM->Get_NX(); x++)
+				{
+					if( !m_pDEM->is_NoData(x, y) && m_pDEM->asDouble(x, y) > t )
+					{
+						m_pFlow->Add_Value(x, y, 100.0);
+					}
+				}
+			}
+			break;
+
+		case 2:
+			for(y=0; y<m_pDEM->Get_NY(); y++)
+			{
+				for(x=0; x<m_pDEM->Get_NX() / 2; x++)
+				{
+					if( !m_pDEM->is_NoData(x, y) )
+					{
+						m_pFlow->Add_Value(x, y, 100.0);
+					}
+				}
+			}
+			break;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.h b/src/modules/simulation/sim_hydrology/KinWav_D8.h
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.h
rename to src/modules/simulation/sim_hydrology/KinWav_D8.h
diff --git a/src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.cpp b/src/modules/simulation/sim_hydrology/MLB_Interface.cpp
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.cpp
rename to src/modules/simulation/sim_hydrology/MLB_Interface.cpp
diff --git a/src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.h b/src/modules/simulation/sim_hydrology/MLB_Interface.h
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.h
rename to src/modules/simulation/sim_hydrology/MLB_Interface.h
diff --git a/src/modules_simulation/hydrology/sim_hydrology/Makefile.am b/src/modules/simulation/sim_hydrology/Makefile.am
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/Makefile.am
rename to src/modules/simulation/sim_hydrology/Makefile.am
diff --git a/src/modules/simulation/sim_hydrology/Makefile.in b/src/modules/simulation/sim_hydrology/Makefile.in
new file mode 100644
index 0000000..e87e5a8
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/Makefile.in
@@ -0,0 +1,648 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/simulation/sim_hydrology
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libsim_hydrology_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libsim_hydrology_la_OBJECTS = DVWK_SoilMoisture.lo idw.lo \
+	KinWav_D8.lo MLB_Interface.lo topmodel.lo topmodel_values.lo \
+	WaterRetentionCapacity.lo
+libsim_hydrology_la_OBJECTS = $(am_libsim_hydrology_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libsim_hydrology_la_SOURCES)
+DIST_SOURCES = $(libsim_hydrology_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_hydrology.la
+libsim_hydrology_la_SOURCES = \
+DVWK_SoilMoisture.cpp\
+idw.cpp\
+KinWav_D8.cpp\
+MLB_Interface.cpp\
+topmodel.cpp\
+topmodel_values.cpp\
+WaterRetentionCapacity.cpp\
+DVWK_SoilMoisture.h\
+idw.h\
+KinWav_D8.h\
+MLB_Interface.h\
+topmodel.h\
+topmodel_values.h\
+WaterRetentionCapacity.h
+
+libsim_hydrology_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_hydrology/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/simulation/sim_hydrology/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsim_hydrology.la: $(libsim_hydrology_la_OBJECTS) $(libsim_hydrology_la_DEPENDENCIES) $(EXTRA_libsim_hydrology_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libsim_hydrology_la_OBJECTS) $(libsim_hydrology_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/DVWK_SoilMoisture.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/KinWav_D8.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/WaterRetentionCapacity.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/idw.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topmodel.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topmodel_values.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/simulation/sim_hydrology/WaterRetentionCapacity.cpp b/src/modules/simulation/sim_hydrology/WaterRetentionCapacity.cpp
new file mode 100644
index 0000000..ab28ead
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/WaterRetentionCapacity.cpp
@@ -0,0 +1,269 @@
+/**********************************************************
+ * Version $Id: WaterRetentionCapacity.cpp 966 2011-03-25 00:40:53Z johanvdw $
+ *********************************************************/
+/*******************************************************************************
+    WaterRetentionCapacity.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+#include "idw.h"
+#include "WaterRetentionCapacity.h"
+
+CWaterRetentionCapacity::CWaterRetentionCapacity(void){
+
+	Parameters.Set_Name(_TL("Water Retention Capacity"));
+	Parameters.Set_Description(_TW(
+		"(c) 2004 Victor Olaya. Water Retention Capacity (Gandullo, 1994)"));
+
+	Parameters.Add_Shapes(NULL,
+						"SHAPES",
+						_TL("Plot Holes"),
+						_TL(""),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Shapes(NULL,
+						"OUTPUT",
+						_TL("Final Parameters"),
+						_TL(""),
+						PARAMETER_OUTPUT);
+	
+	Parameters.Add_Grid(NULL,
+						"DEM",
+						_TL("DEM"),
+						_TL("DEM"),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL,
+						"RETENTION",
+						_TL("Water Retention Capacity"),
+						_TL(""),
+						PARAMETER_OUTPUT);
+
+}//constructor
+
+CWaterRetentionCapacity::~CWaterRetentionCapacity(void)
+{}
+
+bool CWaterRetentionCapacity::On_Execute(void){
+
+	int i,j;
+	int x,y;
+	int iField;
+	int iShape;
+	int iRows;
+	float fValue = 0;
+	float **pData;
+	int iX, iY;
+	float fC;
+	double dSlope,dAspect;	
+	CSG_Shape* pShape;
+	CSG_Shapes* pShapes = Parameters("SHAPES")->asShapes();
+	CSG_Grid* pDEM = Parameters("DEM")->asGrid();
+	
+	m_pRetention = Parameters("RETENTION")->asGrid();
+	m_pSlope = SG_Create_Grid(pDEM);
+	m_pOutput = Parameters("OUTPUT")->asShapes();
+
+	m_pOutput->Assign(pShapes);
+	m_pOutput->Add_Field("CCC", SG_DATATYPE_Double);
+	m_pOutput->Add_Field("CIL", SG_DATATYPE_Double);
+	m_pOutput->Add_Field(_TL("Permeability"), SG_DATATYPE_Double);
+	m_pOutput->Add_Field(_TL("Equivalent Moisture"), SG_DATATYPE_Double);
+	m_pOutput->Add_Field(_TL("Water Retention Capacity"), SG_DATATYPE_Double);
+
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(x=0; x<Get_NX(); x++){
+			if( pDEM->Get_Gradient(x, y, dSlope, dAspect) ){
+				m_pSlope->Set_Value(x, y, dSlope);				
+			}
+			else{
+				m_pSlope->Set_NoData(x, y);				
+			}
+		}
+	}
+
+	iRows = pShapes->Get_Field_Count() / 5;
+	pData = new float*[iRows];
+
+	for (iShape = 0; iShape < pShapes->Get_Count(); iShape++){
+		pShape = pShapes->Get_Shape(iShape);
+		for (i = 0; i< iRows; i++){
+			pData[i] = new float[5];
+			for (j = 0; j < 5; j++){
+				pData[i][j] = 0;
+				try{
+					pData[i][j] = pShape->asFloat(j+i*5);
+				}//try
+				catch(...){}
+			}//for
+		}//for
+		iX = (int)((pShape->Get_Point(0).x - pDEM->Get_XMin())/pDEM->Get_Cellsize());
+		iY = (int)((pShape->Get_Point(0).y - pDEM->Get_YMin())/pDEM->Get_Cellsize());
+		fC = (float)(1. - tan(m_pSlope->asFloat(iX,iY,false)));
+		pShape = m_pOutput->Get_Shape(iShape);
+		CalculateWaterRetention(pData, iRows, fC, pShape);
+	}//for
+
+	iField = m_pOutput->Get_Field_Count()-1;
+
+	CIDW IDW;
+
+	IDW.setParameters(m_pRetention, m_pOutput, iField);
+	IDW.Interpolate();
+
+	CorrectWithSlope();
+
+	return true;
+
+}//method
+
+void CWaterRetentionCapacity::CalculateWaterRetention(float **pData, 
+													   int iNumHorizons, 
+													   float fC,
+													   CSG_Table_Record *pRecord){
+
+	int i;
+	int iField;
+	float *pCCC = new float[iNumHorizons];
+	float *pCIL = new float[iNumHorizons];
+	float *pK = new float[iNumHorizons];
+	int *pPerm = new int[iNumHorizons];
+	float *pHe = new float[iNumHorizons];
+	float *pCRA = new float[iNumHorizons];
+	float fTotalDepth = 0;
+	float fWaterRetention = 0;
+	float fPerm = 0;
+	float fHe = 0;
+	float fK = 0;
+	float fCCC = 0;
+	float fCIL = 0;
+
+	pK[0] = 0;
+	for (i = 0; i < iNumHorizons; i++){
+		pCCC[i] = CalculateCCC(pData[i]);
+		pCIL[i] = CalculateCIL(pData[i]);
+		pPerm[i] = CalculatePermeability(pCCC[i], pCIL[i]);
+		pHe[i] = CalculateHe(pData[i]);
+		if (i){
+			pK[i] = CalculateK(pPerm[i-1], pPerm[i], fC);
+		}//if
+		pCRA[i] = (float)((12.5 * pHe[i] + 12.5 * (50. - pHe[i]) * pK[i] / 2.) * pData[i][1] / 100.);
+		fTotalDepth += pData[i][0];
+	}//for
+	for (i = 0; i < iNumHorizons; i++){
+		fWaterRetention += pData[i][0] / fTotalDepth * pCRA[i];
+		fCCC += pData[i][0] / fTotalDepth * pCCC[i];
+		fCIL += pData[i][0] / fTotalDepth * pCIL[i];
+		fPerm += pData[i][0] / fTotalDepth * pPerm[i];
+		fHe += pData[i][0] / fTotalDepth * pHe[i];
+		fK += pData[i][0] / fTotalDepth * pK[i];
+	}//for
+
+	iField = pRecord->Get_Table()->Get_Field_Count() - 1;
+
+	pRecord->Set_Value(iField - 4, fCCC);
+	pRecord->Set_Value(iField - 3, fCIL);
+	pRecord->Set_Value(iField - 2, fPerm);
+	pRecord->Set_Value(iField - 1, fHe);
+	pRecord->Set_Value(iField, fWaterRetention);
+
+	delete[]pCRA;
+}//method
+
+void CWaterRetentionCapacity::CorrectWithSlope(){
+
+	int x,y;
+	float fC;
+
+	for (x = 0; x < m_pRetention->Get_NX(); x++) {
+		for (y = 0; y < m_pRetention->Get_NY(); y++) {
+			fC = (float)(1. - tan(m_pSlope->asFloat(x,y,false)));
+			if (fC < 0.){
+				fC = 0.;
+			}//if
+			m_pRetention->Set_Value(x,y,m_pRetention->asFloat(x,y) * fC);
+		}//for
+	}//for
+
+}//method
+
+float CWaterRetentionCapacity::CalculateHe(float* pHorizon){
+
+	float fL = pHorizon[2];
+	float fTF = pHorizon[1];
+	float fAr = pHorizon[3];
+	float fMO = pHorizon[4];
+
+	float fHe = (float)(4.6 + 0.43 * fAr + 0.25 * fL + 1.22 * fMO);
+	return fHe;
+
+}//method
+
+
+float CWaterRetentionCapacity::CalculateCIL(float* pHorizon){
+
+	float fL = pHorizon[2];
+	float fTF = pHorizon[1];
+
+	float fCIL = (float)((fL * fTF) /10000.);
+	return fCIL;
+
+}//method
+
+float CWaterRetentionCapacity::CalculateCCC(float* pHorizon){
+
+	float fL = pHorizon[2];
+	float fTF = pHorizon[1];
+	float fAr = pHorizon[3];
+	float fMO = pHorizon[4];
+
+	float fCCC = (float)((fAr - 4.*fMO) / fTF);
+	return fCCC;
+
+}//method
+
+float CWaterRetentionCapacity::CalculateK(int iPermI, int iPermS, float fC){
+
+	float fAi = (float)((iPermI - 1) * .2);
+	float fAs = (float)((iPermS - 1) * .2);
+
+	return (float)((1. - fAi - (1 + fAs) * (1. - fC)));
+
+}//method
+
+
+int CWaterRetentionCapacity::CalculatePermeability(float fCCC, float fCIL){
+
+	int iPerm;
+	if (fCCC < 0.15){
+		iPerm = 5 - (int)((fCIL-0.1) / 0.15);
+	}//if
+	else if (fCIL < 0.2){
+		iPerm = 5 - (int)(fCCC / 0.15);
+	}//else if
+	else{
+		iPerm = (int)(5 - (fCCC + fCIL - 0.1) / 0.15);
+	}//else
+
+	if (iPerm < 1){
+		iPerm = 1;
+	}//if
+
+	return iPerm;
+
+}//method
diff --git a/src/modules/simulation/sim_hydrology/WaterRetentionCapacity.h b/src/modules/simulation/sim_hydrology/WaterRetentionCapacity.h
new file mode 100644
index 0000000..ba60bd9
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/WaterRetentionCapacity.h
@@ -0,0 +1,52 @@
+/**********************************************************
+ * Version $Id: WaterRetentionCapacity.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    WaterRetentionCapacity.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CWaterRetentionCapacity : public CSG_Module_Grid {
+
+public:
+	CWaterRetentionCapacity(void);
+	virtual ~CWaterRetentionCapacity(void);
+
+private:
+	
+	CSG_Grid *m_pSlope;
+	CSG_Grid *m_pRetention;
+	CSG_Shapes *m_pOutput;
+	
+	void CalculateWaterRetention(float**,int, float, CSG_Table_Record*);
+	void CorrectWithSlope();
+	float CalculateCCC(float*);
+	float CalculateCIL(float*);
+	int CalculatePermeability(float, float);
+	float CalculateHe(float*);
+	float CalculateK(int,int,float);
+
+protected:
+	virtual bool On_Execute(void);
+
+};
diff --git a/src/modules/simulation/sim_hydrology/idw.cpp b/src/modules/simulation/sim_hydrology/idw.cpp
new file mode 100644
index 0000000..5d80ac6
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/idw.cpp
@@ -0,0 +1,97 @@
+/**********************************************************
+ * Version $Id: idw.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    IDW.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "idw.h"
+
+CIDW::CIDW()
+{
+
+}
+
+CIDW::~CIDW()
+{
+
+}
+
+void CIDW::setParameters(CSG_Grid* pGrid, CSG_Shapes *pPoints, int iField){
+
+	m_pGrid = pGrid;
+	m_pPoints = pPoints;
+	m_iField = iField;
+
+}//method
+
+void CIDW::Interpolate(){
+
+	int x,y;
+
+	for(y=0; y<m_pGrid->Get_NY(); y++){		
+		for(x=0; x<m_pGrid->Get_NX(); x++){
+			Get_Grid_Value(x,y);
+        }// for
+    }// for
+
+}//method
+
+//---------------------------------------------------------
+bool CIDW::Get_Grid_Value(int x, int y)
+{
+	int			iPoint, nPoints;
+	double		zSum, dSum, d, dx, xPos, yPos;
+	TSG_Point	Point;
+	CSG_Shape		*pPoint;
+
+	nPoints = m_pPoints->Get_Count();
+
+	xPos	= m_pGrid->Get_XMin() + x * m_pGrid->Get_Cellsize();
+	yPos	= m_pGrid->Get_YMin() + y * m_pGrid->Get_Cellsize();
+
+	for(iPoint=0, zSum=0.0, dSum=0.0; iPoint<nPoints; iPoint++){
+		
+		pPoint = m_pPoints->Get_Shape(iPoint);
+		Point = pPoint->Get_Point(0);
+
+		dx		= Point.x - xPos;
+		d		= Point.y - yPos;
+		d		= sqrt(dx*dx + d*d);
+
+		if( d <= 0.0 ){
+			m_pGrid->Set_Value(x, y, pPoint->asDouble(m_iField) );
+			return( true );
+		}//if
+
+		d		= pow(d, -2);
+
+		zSum	+= d * pPoint->asDouble(m_iField);
+		dSum	+= d;
+	}//for
+
+	if( dSum > 0.0 ){
+		m_pGrid->Set_Value(x, y, zSum / dSum );
+		return( true );
+	}//if
+
+	m_pGrid->Set_NoData(x, y);
+
+	return( false );
+
+}//method
\ No newline at end of file
diff --git a/src/modules/simulation/sim_hydrology/idw.h b/src/modules/simulation/sim_hydrology/idw.h
new file mode 100644
index 0000000..af37fab
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/idw.h
@@ -0,0 +1,46 @@
+/**********************************************************
+ * Version $Id: idw.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Isochrones.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <saga_api/saga_api.h>
+
+class CIDW  
+{
+public:
+	
+	CIDW();
+	virtual ~CIDW();
+	void setParameters(CSG_Grid*,CSG_Shapes*,int);
+	void Interpolate();
+
+private:
+
+	CSG_Grid* m_pGrid;
+	CSG_Shapes *m_pPoints;
+	int m_iField;
+
+	bool Get_Grid_Value(int,int);
+
+};
+
diff --git a/src/modules/simulation/sim_hydrology/topmodel.cpp b/src/modules/simulation/sim_hydrology/topmodel.cpp
new file mode 100644
index 0000000..a6b4aa1
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/topmodel.cpp
@@ -0,0 +1,712 @@
+/**********************************************************
+ * Version $Id: topmodel.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     sim_hydrology                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     topmodel.cpp                      //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "topmodel.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTOPMODEL::CTOPMODEL(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	// Place information about your module here...
+
+	Set_Name		(_TL("TOPMODEL"));
+
+	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"Simple Subcatchment Version of TOPMODEL\n\n"
+
+		"Based on the 'TOPMODEL demonstration program v95.02' by Keith Beven "
+		"(Centre for Research on Environmental Systems and Statistics, "
+		"Institute of Environmental and Biological Sciences, "
+		"Lancaster University, Lancaster LA1 4YQ, UK) "
+		"and the C translation of the Fortran source codes implementated in GRASS.\n\n"
+
+		"This program allows single or multiple subcatchment calculations "
+		"but with single average rainfall and potential evapotranspiration "
+		"inputs to the whole catchment.  Subcatchment discharges are routed "
+		"to the catchment outlet using a linear routing algorithm with "
+		"constant main channel velocity and internal subcatchment "
+		"routing velocity.  The program requires ln(a/tanB) distributions "
+		"for each subcatchment.  These may be calculated using the "
+		"GRIDATB program which requires raster elevation data as input. "
+		"It is recommended that those data should be 50 m resolution or "
+		"better.\n\n"
+
+		"NOTE that TOPMODEL is not intended to be a traditional model "
+		"package but is more a collection of concepts that can be used "
+		"**** where appropriate ****. It is up to the user to verify that "
+		"the assumptions are appropriate (see discussion in "
+		"Beven et al.(1994).   This version of the model  will be "
+		"best suited to catchments with shallow soils and moderate "
+		"topography which do not suffer from excessively long dry "
+		"periods.  Ideally predicted contributing areas should be "
+		"checked against what actually happens in the catchment.\n\n"
+
+		"It includes infiltration excess calculations and parameters "
+		"based on the exponential conductivity Green-Ampt model of "
+		"Beven (HSJ, 1984) but if infiltration excess does occur it "
+		"does so over whole area of a subcatchment.  Spatial variability "
+		"in conductivities can however be handled by specifying "
+		"Ko parameter values for different subcatchments, even if they "
+		"have the same ln(a/tanB) and routing parameters, ie. to "
+		"represent different parts of the area.\n\n"
+
+		"Note that time step calculations are explicit ie. SBAR "
+		"at start of time step is used to determine contributing area. "
+		"Thus with long (daily) time steps contributing area depends on "
+		"initial value together with any volume filling effect of daily "
+		"inputs.  Also baseflow at start of time step is used to update "
+		"SBAR at end of time step."
+
+		"\n\nReferences\n"
+		"- Beven, K., Kirkby, M.J., Schofield, N., Tagg, A.F. (1984): "
+		"  Testing a physically-based flood forecasting model (TOPMODEL) for threee U.K. catchments, "
+		"  Journal of Hydrology, H.69, S.119-143.\n"
+		"\n"
+		"- Beven, K. (1997): "
+		"  TOPMODEL - a critique, "
+		"  Hydrological Processes, Vol.11, pp.1069-1085.\n"
+	));
+
+
+	//-----------------------------------------------------
+
+	Parameters.Add_Grid(
+		NULL	, "ATANB"		, _TL("Topographic Wetness Index"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "MOIST"		, _TL("Soil Moisture Deficit"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	pNode	= Parameters.Add_Table(
+		NULL	, "WEATHER"		, _TL("Weather Records"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "RECORD_P"	, _TL("Precipitation [m / dt]"),
+		_TL("")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "RECORD_ET"	, _TL("Evapotranspiration [m / dt]"),
+		_TL("")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "RECORD_DATE"	, _TL("Date/Time"),
+		_TL(""),
+		true
+	);
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Simulation Output"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DTIME"		, _TL("Time Step [h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 1.0
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NCLASSES"	, _TL("Number of Classes"),
+		_TL(""),
+		PARAMETER_TYPE_Int		, 30	, 1	, true
+	);
+
+	pNode	= NULL;	// = Parameters("MOIST");
+
+	Parameters.Add_Value(
+		pNode, "P_QS0"			, _TL("Initial subsurface flow per unit area [m/h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 3.28e-05
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_LNTE"			, _TL("Areal average of ln(T0) = ln(Te) [ln(m^2/h)]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 5.0
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_MODEL"		, _TL("Model parameter [m]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.032
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_SR0"			, _TL("Initial root zone storage deficit [m]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.002
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_SRZMAX"		, _TL("Maximum root zone storage deficit [m]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.05
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_SUZ_TD"		, _TL("Unsaturated zone time delay per unit storage deficit [h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 50.0
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_VCH"			, _TL("Main channel routing velocity [m/h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 3600.0
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_VR"			, _TL("Internal subcatchment routing velocity [m/h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 3600.0
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_K0"			, _TL("Surface hydraulic conductivity [m/h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 1.0
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_PSI"			, _TL("Wetting front suction [m]"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.02
+	);
+
+	Parameters.Add_Value(
+		pNode, "P_DTHETA"		, _TL("Water content change across the wetting front"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.1
+	);
+
+	Parameters.Add_Value(
+		pNode, "BINF"			, _TL("Green-Ampt Infiltration"),
+		_TL(""),
+		PARAMETER_TYPE_Bool		, true
+	);
+}
+
+//---------------------------------------------------------
+CTOPMODEL::~CTOPMODEL(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTOPMODEL::On_Execute(void)
+{
+	bool				bInfiltration;
+	sLong				n;
+	int					iClass, nClasses, iTime, nTimeSteps, k;
+	double				Precipitation, Evaporation, Infiltration, Infiltration_Excess;
+	CSG_String			Time;
+	CSG_Grid			*pAtanB, *pMoist, gClass;
+	CSG_Table_Record	*pRecord;
+	CSG_Table			*pTable;
+
+
+	//-----------------------------------------------------
+	// Get user inputs from the 'Parameters' object...
+
+	pAtanB			= Parameters("ATANB")		->asGrid();
+	m_pWeather		= Parameters("WEATHER")		->asTable();
+	m_fP			= Parameters("RECORD_P")	->asInt();
+	m_fET			= Parameters("RECORD_ET")	->asInt();
+	m_fTime			= Parameters("RECORD_DATE")	->asInt();
+	dTime			= Parameters("DTIME")		->asDouble();
+	nClasses		= Parameters("NCLASSES")	->asInt();
+	bInfiltration	= Parameters("BINF")		->asBool();
+
+	nTimeSteps		= m_pWeather->Get_Record_Count();
+
+	if( (pMoist = Parameters("MOIST")->asGrid()) != NULL )
+	{
+		pMoist->Set_Name(_TL("Soil Moisture Deficit"));
+		DataObject_Set_Colors(pMoist, 100, SG_COLORS_RED_GREY_BLUE, true);
+	}
+
+
+	//-----------------------------------------------------
+	pTable			= Parameters("TABLE")->asTable();
+	pTable->Destroy();
+	pTable->Set_Name(_TL("TOPMODEL - Simulation Output"));
+
+	pTable->Add_Field(_TL("Time")										, SG_DATATYPE_String);
+	pTable->Add_Field(_TL("Total flow (in watershed) [m^3/dt]")			, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Total flow [m/dt]")							, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Saturation overland flow [m/dt]")			, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Subsurface flow [m/dt]")						, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Vertical (drainage) flux [m/dt]")			, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Mean saturation deficit (in watershed) [m]")	, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Infiltration rate [m/dt]")					, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Infiltration excess runoff [m/dt]")			, SG_DATATYPE_Double);
+
+	//-----------------------------------------------------
+	Vals.Create(dTime, nTimeSteps, &Parameters, pAtanB, nClasses, &gClass);
+
+	//-----------------------------------------------------
+	inf_bPonding	= false;
+	inf_cumf		= 0.0;
+
+	for(iTime=0; iTime<nTimeSteps && Set_Progress(iTime, nTimeSteps); iTime++)
+	{
+		Get_Weather(iTime, Precipitation, Evaporation, Time);
+
+		if( bInfiltration && Precipitation > 0.0 )
+		{
+			Infiltration		= dTime * Get_Infiltration((iTime + 1) * dTime, Precipitation / dTime);
+			Infiltration_Excess	= Precipitation - Infiltration;
+			Precipitation		= Infiltration;
+		}
+		else
+		{
+			Infiltration		= 0.0;
+			Infiltration_Excess	= 0.0;
+		}
+
+		Run(Evaporation, Precipitation, Infiltration_Excess);
+
+		for(iClass=0; iClass<Vals.nreach_; iClass++)
+		{
+			k		= iTime + iClass + Vals.ndelay_;
+			if( k > nTimeSteps - 1 )
+				break;
+
+			Vals.Qt_[k]	+= Vals.qt_Total * Vals.Add[iClass];
+		}
+
+		if( pMoist )
+		{
+			for(n=0; n<gClass.Get_NCells(); n++)
+			{
+				iClass	= gClass.asInt(n);
+
+				if( iClass >= 0 && iClass < nClasses )
+				{
+					pMoist->Set_Value(n, Vals.Get_Class(iClass)->S_);
+				}
+				else
+				{
+					pMoist->Set_NoData(n);
+				}
+			}
+
+		//	DataObject_Update(pMoist);
+			DataObject_Update(pMoist, 0, 0.35, true);
+		}
+
+		pRecord	= pTable->Add_Record();
+		pRecord->Set_Value(0, Time);				// Time
+		pRecord->Set_Value(1, Vals.Qt_[iTime]);		// QT
+		pRecord->Set_Value(2, Vals.qt_Total);		// qt
+		pRecord->Set_Value(3, Vals.qo_Total);		// q0
+		pRecord->Set_Value(4, Vals.qs_Total);		// qs
+		pRecord->Set_Value(5, Vals.qv_Total);		// qv
+		pRecord->Set_Value(6, Vals.Sbar_);			// SBar
+		pRecord->Set_Value(7, Infiltration);		// Infiltration
+		pRecord->Set_Value(8, Infiltration_Excess);	// Infiltration Excess
+		DataObject_Update(pTable);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CTOPMODEL::Run(double Evaporation, double Precipitation, double Infiltration_Excess)
+{
+	int				iClass;
+	double			d, Excess;
+	CTOPMODEL_Class	*pClass;
+
+	Vals.qo_Total	= 0.0;
+	Vals.qv_Total	= 0.0;
+	Vals.qs_Total	= Vals._qs_ * exp(-Vals.Sbar_ / Vals.p_Model);
+
+	for(iClass=0; iClass<Vals.Get_Count(); iClass++)
+	{
+		pClass			= Vals.Get_Class(iClass);
+
+
+		//-------------------------------------------------
+		//  CALCULATE LOCAL STORAGE DEFICIT
+
+		pClass->S_		= Vals.Sbar_ + Vals.p_Model * (Vals.Get_Lambda() - pClass->AtanB);
+
+		if( pClass->S_ < 0.0 )
+		{
+			pClass->S_		= 0.0;
+		}
+
+
+		//-------------------------------------------------
+		//  ROOT ZONE CALCULATIONS
+
+		pClass->Srz_	-= Precipitation;
+
+		if( pClass->Srz_ < 0.0 )
+		{
+			pClass->Suz_	-= pClass->Srz_;
+			pClass->Srz_	= 0.0;
+		}
+
+
+		//-------------------------------------------------
+		//  UNSATURATED ZONE CALCULATIONS
+
+		if( pClass->Suz_ > pClass->S_ )
+		{
+			Excess			= pClass->Suz_ - pClass->S_;
+			pClass->Suz_	= pClass->S_;
+		}
+		else
+		{
+			Excess			= 0.0;
+		}
+
+
+		//-------------------------------------------------
+		//  CALCULATE DRAINAGE FROM SUZ (Vertical Soil Water Flux (qv))...
+
+		if( pClass->S_ > 0.0 )
+		{
+			if( Vals.p_Suz_TimeDelay > 0.0 )
+			{	// Methode 1...
+				d			= pClass->Suz_ / (pClass->S_ * Vals.p_Suz_TimeDelay) * dTime;	// GRASS
+			}
+			else
+			{	// Methode 2...
+				d			= -Vals.p_Suz_TimeDelay * Vals.p_K0 * exp(-pClass->S_ / Vals.p_Model);
+			}
+
+			if( d > pClass->Suz_ )
+			{
+				d			= pClass->Suz_;
+			}
+
+			pClass->Suz_	-= d;
+
+			if( pClass->Suz_ < 0.0000001 )
+			{
+				pClass->Suz_	= 0.0;
+			}
+
+			pClass->qv_		= d * pClass->Area_Rel;
+			Vals.qv_Total	+= pClass->qv_;
+		}
+		else
+		{
+			pClass->qv_		= 0.0;
+		}
+
+
+		//-------------------------------------------------
+		//  CALCULATE EVAPOTRANSPIRATION FROM ROOT ZONE DEFICIT
+
+		if( Evaporation > 0.0 )
+		{
+			d		= Evaporation * (1.0 - pClass->Srz_ / Vals.p_Srz_Max);
+
+			if( d > Vals.p_Srz_Max - pClass->Srz_ )
+			{
+				d		= Vals.p_Srz_Max - pClass->Srz_;
+			}
+
+			pClass->Srz_	+= d;
+		}
+
+
+		//-------------------------------------------------
+		pClass->qo_		= Excess * pClass->Area_Rel;
+		Vals.qo_Total	+= pClass->qo_;
+
+		pClass->qt_		= pClass->qo_ + Vals.qs_Total;
+	}
+
+	Vals.qo_Total	+= Infiltration_Excess;
+
+	Vals.qt_Total	= Vals.qo_Total + Vals.qs_Total;
+
+	Vals.Sbar_		+= Vals.qs_Total - Vals.qv_Total;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTOPMODEL::Get_Weather(int iTimeStep, double &Precipitation, double &Evaporation, CSG_String &Time)
+{
+	CSG_Table_Record	*pRecord;
+
+	if( m_pWeather && (pRecord = m_pWeather->Get_Record(iTimeStep)) != NULL )
+	{
+		Precipitation	= pRecord->asDouble(m_fP);
+		Evaporation		= pRecord->asDouble(m_fET);
+
+		if( m_fTime >= 0 )
+		{
+			Time		= pRecord->asString(m_fTime);
+		}
+		else
+		{
+			Time.Printf(SG_T("%d"), iTimeStep);
+		}
+
+		return( true );
+	}
+
+	Precipitation	= 0.0;
+	Evaporation		= 0.0;
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define NEWTON_EPSILON		0.001
+#define NEWTON_MAXITER		100
+#define	NEWTON_NTERMS		10
+
+//---------------------------------------------------------
+double CTOPMODEL::Get_Infiltration(double t, double R)
+{
+	int		i, j, factorial;
+
+	double	f, f_, f1, f2, fc, R2, cnst, pt, psi_dtheta, sum;
+
+
+	if( R <= 0.0 )
+	{
+		inf_cumf		= 0.0;
+		inf_bPonding	= 0;
+
+		return( 0.0 );
+	}
+
+	psi_dtheta	= Vals.p_Psi * Vals.p_dTheta;
+
+	if( !inf_bPonding )
+	{
+		if( inf_cumf )
+		{
+			f1				= inf_cumf;
+			R2				= -Vals.p_K0 / Vals.p_Model * (psi_dtheta + f1) / (1 - exp(f1 / Vals.p_Model));
+
+			if( R2 < R )
+			{
+				f_				= inf_cumf;
+				pt				= t - dTime;
+				inf_bPonding	= 1;
+
+				goto cont1;
+			}
+		}
+
+		f2				= inf_cumf + R * dTime;
+		R2				= -Vals.p_K0 / Vals.p_Model * (psi_dtheta + f2) / (1 - exp(f2 / Vals.p_Model));
+
+		if( f2 == 0.0 || R2 > R )
+		{
+			f				= R;
+			inf_cumf		+= f * dTime;
+			inf_bPonding	= 0;
+
+			return( f );
+		}
+
+		f_				= inf_cumf + R2 * dTime;
+
+		for(i=0; i<NEWTON_MAXITER; i++)
+		{
+			R2				= -Vals.p_K0 / Vals.p_Model * (psi_dtheta + f_) / (1 - exp(f_ / Vals.p_Model));
+
+			if( R2 > R )
+			{
+				f1				= f_;
+				f_				= (f_ + f2) / 2.0;
+				f				= f_ - f1;
+			}
+			else
+			{
+				f2				= f_;
+				f_				= (f_ + f1) / 2.0;
+				f				= f_ - f2;
+			}
+
+			if( fabs(f) < NEWTON_EPSILON )
+				break;
+		}
+
+		if( i == NEWTON_MAXITER )
+		{
+			// G_set_d_null_value(&f, 1);
+			return( 0.0 );
+		}
+
+		pt				= t - dTime + (f_ - inf_cumf) / R;
+
+		if( pt > t )
+		{
+			f				= R;
+			inf_cumf		+= f * dTime;
+			inf_bPonding	= 0;
+
+			return( f );
+		}
+
+cont1:
+		cnst			= 0.0;
+		factorial		= 1;
+		fc				= (f_ + psi_dtheta);
+
+		for(j=1; j<=NEWTON_NTERMS; j++)
+		{
+			factorial		*= j;
+			cnst			+= pow(fc / Vals.p_Model, (double) j) / (double) (j * factorial);
+		}
+
+		cnst			= log(fc) - (log(fc) + cnst) / exp(psi_dtheta / Vals.p_Model);
+		f_				+= R * (t - pt) / 2.0;
+		inf_bPonding	= 1;
+	}
+
+	for(i=0; i<NEWTON_MAXITER; i++)
+	{
+		fc				= f_ + psi_dtheta;
+		sum				= 0.0;
+		factorial		= 1;
+
+		for(j=1; j<=NEWTON_NTERMS; j++)
+		{
+			factorial		*= j;
+			sum				+= pow(fc / Vals.p_Model, (double) j) / (double) (j * factorial);
+		}
+
+		f1				= - (log(fc) - (log(fc) + sum) / exp(psi_dtheta / Vals.p_Model) - cnst) / (Vals.p_K0 / Vals.p_Model) - (t - pt);
+		f2				= (exp(f_ / Vals.p_Model) - 1.0) / (fc * Vals.p_K0 / Vals.p_Model);
+		f				= - f1 / f2;
+		f_				+= f;
+
+		if( fabs(f) < NEWTON_EPSILON )
+			break;
+	}
+
+	if( i == NEWTON_MAXITER )
+	{
+		// G_set_d_null_value(&f, 1);
+		return( 0.0 );
+	}
+
+	if( f_ < inf_cumf + R )
+	{
+		f				= (f_ - inf_cumf) / dTime;
+		inf_cumf		= f_;
+		f_				+= f * dTime;
+	}
+
+	return( f );
+}
diff --git a/src/modules_simulation/hydrology/sim_hydrology/topmodel.h b/src/modules/simulation/sim_hydrology/topmodel.h
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/topmodel.h
rename to src/modules/simulation/sim_hydrology/topmodel.h
diff --git a/src/modules/simulation/sim_hydrology/topmodel_values.cpp b/src/modules/simulation/sim_hydrology/topmodel_values.cpp
new file mode 100644
index 0000000..ef8021f
--- /dev/null
+++ b/src/modules/simulation/sim_hydrology/topmodel_values.cpp
@@ -0,0 +1,345 @@
+/**********************************************************
+ * Version $Id: topmodel_values.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     sim_hydrology                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  topmodel_values.cpp                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "topmodel_values.h"
+
+//---------------------------------------------------------
+#define RESET_ARRAY(a)		if( a ) { free(a); a = NULL; }
+#define RESET_MATRIX(n, m)	if( n > 0 && m ) { for(int i=0; i<n; i++) { if( m[i] ) { free(m[i]); } } free(m); m = NULL; }
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTOPMODEL_Class::CTOPMODEL_Class(double Srz_Init)
+{
+	Srz_		= Srz_Init;
+	Suz_		= 0.0;
+	S_			= 0.0;
+
+	qt_			= 0.0;
+	qo_			= 0.0;
+	qv_			= 0.0;
+
+	AtanB		= 0.0;
+	Area_Rel	= 0.0;
+}
+
+//---------------------------------------------------------
+CTOPMODEL_Class::~CTOPMODEL_Class(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTOPMODEL_Values::CTOPMODEL_Values(void)
+{
+	nClasses	= 0;
+	Lambda		= 0;
+
+	Add			= NULL;
+	Qt_			= NULL;
+
+	//-----------------------------------------------------
+	Channel_Count			= 3;
+
+	Channel_Distance		= (double *)malloc(Channel_Count * sizeof(double));
+	Channel_AreaRatio		= (double *)malloc(Channel_Count * sizeof(double));
+
+	Channel_Distance[0]		= 500;
+	Channel_AreaRatio[0]	= 0.0;
+
+	Channel_Distance[1]		= 1000;
+	Channel_AreaRatio[1]	= 0.5;
+
+	Channel_Distance[2]		= 1500;
+	Channel_AreaRatio[2]	= 1.0;
+}
+
+//---------------------------------------------------------
+CTOPMODEL_Values::~CTOPMODEL_Values(void)
+{
+	Destroy();
+
+	free(Channel_Distance);
+	free(Channel_AreaRatio);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CTOPMODEL_Values::Destroy(void)
+{
+	int		iClass;
+
+	if( nClasses > 0 )
+	{
+		for(iClass=0; iClass<nClasses; iClass++)
+		{
+			delete( Classes[iClass] );
+		}
+
+		free(Classes);
+
+		nClasses	= 0;
+	}
+
+	qt_Total	= 0.0;
+	qo_Total	= 0.0;
+	qv_Total	= 0.0;
+
+	RESET_ARRAY(Add);
+	RESET_ARRAY(Qt_);
+}
+
+//---------------------------------------------------------
+void CTOPMODEL_Values::Create(double dTime, int anTimeSteps, CSG_Parameters *pParameters, CSG_Grid *pAtanB, int anClasses, CSG_Grid *pClass)
+{
+	sLong	n, iClass, nCells;
+
+	double	zMin, zRange, dz;
+
+	Destroy();
+
+	if( pAtanB && anClasses > 0 )
+	{
+		//-------------------------------------------------
+		// 1. Topographic Index Classification etc...
+
+		nClasses	= anClasses;
+
+		Classes		= (CTOPMODEL_Class **)calloc(nClasses, sizeof(CTOPMODEL_Class *));
+
+		for(iClass=0; iClass<nClasses; iClass++)
+		{
+			Classes[iClass]	= new CTOPMODEL_Class(pParameters->Get_Parameter("P_SR0")->asDouble());
+		}
+
+		zMin		= pAtanB->Get_ZMin();
+		zRange		= pAtanB->Get_ZMax() - zMin;
+		dz			= zRange / (nClasses + 1);
+		nCells		= 0;
+
+		pClass->Create(pAtanB, SG_DATATYPE_Short);
+		pClass->Set_NoData_Value(-9999);
+
+		for(n=0; n<pAtanB->Get_NCells(); n++)
+		{
+			if( !pAtanB->is_NoData(n) )
+			{
+				nCells++;
+
+				iClass			= (int)((nClasses - 1.0) * (pAtanB->asDouble(n) - zMin) / zRange);
+
+				Classes[iClass]->Area_Rel++;
+
+				pClass->Set_Value(n, iClass);
+			}
+			else
+			{
+				pClass->Set_NoData(n);
+			}
+		}
+
+		Area_Total	= (double)nCells * pAtanB->Get_Cellsize() * pAtanB->Get_Cellsize();
+
+		for(iClass=0; iClass<nClasses; iClass++)
+		{
+			Classes[iClass]->AtanB		= zMin + dz * (iClass + 0.5);	// mid of class -> + 0.5...
+			Classes[iClass]->Area_Rel	/= (double)nCells;
+		}
+
+
+		//-------------------------------------------------
+		// 2. Calculate Lambda, the catchment average topographic index...
+
+		for(iClass=0, Lambda=0.0; iClass<nClasses; iClass++)
+		{
+			Lambda	+= Classes[iClass]->Area_Rel * Classes[iClass]->AtanB;
+		}
+
+
+		//-------------------------------------------------
+		// 3. Parameter Initialisation...
+
+		//-------------------------------------------------
+		p_Srz_Max		= pParameters->Get_Parameter("P_SRZMAX")->asDouble();
+		p_Model			= pParameters->Get_Parameter("P_MODEL")->asDouble();
+		p_Suz_TimeDelay	= pParameters->Get_Parameter("P_SUZ_TD")->asDouble();
+		p_K0			= pParameters->Get_Parameter("P_K0")->asDouble();
+		p_Psi			= pParameters->Get_Parameter("P_PSI")->asDouble();
+		p_dTheta		= pParameters->Get_Parameter("P_DTHETA")->asDouble();
+
+
+		//-------------------------------------------------
+		int		i, j, t;
+
+		double	A1, A2,
+				qs0_,	// Initial subsurface flow per unit area [m/h], "The first streamflow input is assumed to represent only the subsurface flow contribution in the watershed."
+				vch_,	// Main channel routing velocity [m/h]
+				vr_,	// Internal subcatchment routing velocity [m/h]
+				*tch_;	// params.nch's
+
+		//-------------------------------------------------
+		lnTe_		= log(dTime)	+ pParameters->Get_Parameter("P_LNTE")->asDouble();
+		vch_		= dTime			* pParameters->Get_Parameter("P_VCH")->asDouble();
+		vr_			= dTime			* pParameters->Get_Parameter("P_VR")->asDouble();
+		qs0_		= dTime			* pParameters->Get_Parameter("P_QS0")->asDouble();
+		_qs_		= exp(lnTe_ - Lambda);
+
+		//-------------------------------------------------
+		tch_		= (double *)malloc(Channel_Count * sizeof(double));
+		tch_[0]		= Channel_Distance[0] / vch_;
+
+		for(i=1; i<Channel_Count; i++)
+		{
+			tch_[i]		= tch_[0] + (Channel_Distance[i] - Channel_Distance[0]) / vr_;
+		}
+
+		//-------------------------------------------------
+		nreach_		= (int)tch_[Channel_Count - 1];
+		if( (double)nreach_ < tch_[Channel_Count - 1] )
+		{
+			nreach_++;
+		}
+
+		ndelay_		= (int)tch_[0];
+		nreach_		-= ndelay_;
+
+		//-------------------------------------------------
+		Add			= (double *)malloc(nreach_ * sizeof(double));
+
+		for(i=0; i<nreach_; i++)
+		{
+			t			= ndelay_ + i + 1;
+			if( t > tch_[Channel_Count - 1])
+			{
+				Add[i]		= 1.0;
+			}
+			else
+			{
+				for(j=1; j<Channel_Count; j++)
+				{
+					if( t <= tch_[j] )
+					{
+						Add[i]		= Channel_AreaRatio[j - 1]
+									+ (Channel_AreaRatio[j] - Channel_AreaRatio[j - 1])
+									* (t - tch_[j - 1]) / (tch_[j] - tch_[j - 1]);
+						break;
+					}
+				}
+			}
+		}
+
+		A1			= Add[0];
+		Add[0]		*= Area_Total;
+
+		for(i=1; i<nreach_; i++)
+		{
+			A2			= Add[i];
+			Add[i]		= A2 - A1;
+			A1			= A2;
+			Add[i]		*= Area_Total;
+		}
+
+		//-------------------------------------------------
+		Sbar_		= -p_Model * log(qs0_ / _qs_);
+
+		//-------------------------------------------------
+		Qt_			= (double *)calloc(anTimeSteps, sizeof(double));
+		for(i=0; i<anTimeSteps; i++)
+		{
+			Qt_[i]		= 0.0;
+		}
+
+		for(i=0; i<ndelay_; i++)
+		{
+			Qt_[i] = qs0_ * Area_Total;
+		}
+
+		A1			= 0.0;
+
+		for(i=0; i<nreach_; i++)
+		{
+			A1					+= Add[i];
+			Qt_[ndelay_ + i]	= qs0_ * (Area_Total - A1);
+		}
+
+		//-------------------------------------------------
+		RESET_ARRAY(tch_);
+	}
+}
diff --git a/src/modules_simulation/hydrology/sim_hydrology/topmodel_values.h b/src/modules/simulation/sim_hydrology/topmodel_values.h
similarity index 100%
rename from src/modules_simulation/hydrology/sim_hydrology/topmodel_values.h
rename to src/modules/simulation/sim_hydrology/topmodel_values.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.cpp b/src/modules/simulation/sim_ihacres/MLB_Interface.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.cpp
rename to src/modules/simulation/sim_ihacres/MLB_Interface.cpp
diff --git a/src/modules/simulation/sim_ihacres/MLB_Interface.h b/src/modules/simulation/sim_ihacres/MLB_Interface.h
new file mode 100644
index 0000000..c1022a5
--- /dev/null
+++ b/src/modules/simulation/sim_ihacres/MLB_Interface.h
@@ -0,0 +1,91 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        IHACRES                        //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 by                 //
+//                        Author                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     author at email.de                        //
+//                                                       //
+//    contact:    Author                                 //
+//                Sesame Street. 7                       //
+//                12345 Metropolis                       //
+//                Nirvana                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+/* $Log: not supported by cvs2svn $
+/* Revision 1.1  2009/10/20 07:40:39  oconrad
+/* no message
+/*
+/* Revision 1.1.1.1  2005/08/31 14:00:48  oconrad
+/* no message
+/*
+/* Revision 1.1.1.1  2005/08/17 08:25:03  oconrad
+/* no message
+/*
+/* Revision 1.1.1.1  2005/08/15 13:35:24  oconrad
+/* no message
+/*
+ */
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__ihacres_H
+#define HEADER_INCLUDED__ihacres_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__ihacres_H
diff --git a/src/modules/simulation/sim_ihacres/Makefile.am b/src/modules/simulation/sim_ihacres/Makefile.am
new file mode 100644
index 0000000..3f951c7
--- /dev/null
+++ b/src/modules/simulation/sim_ihacres/Makefile.am
@@ -0,0 +1,40 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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_ihacres.la
+libsim_ihacres_la_SOURCES =\
+convert_sl.cpp\
+ihacres_basin.cpp\
+ihacres_cal2.cpp\
+ihacres_elev.cpp\
+ihacres_elev_bands.cpp\
+ihacres_elev_cal.cpp\
+ihacres_eq.cpp\
+ihacres_v1.cpp\
+MLB_Interface.cpp\
+model_tools.cpp\
+snow_module.cpp\
+convert_sl.h\
+ihacres_basin.h\
+ihacres_cal2.h\
+ihacres_elev.h\
+ihacres_elev_bands.h\
+ihacres_elev_cal.h\
+ihacres_eq.h\
+ihacres_v1.h\
+MLB_Interface.h\
+model_tools.h\
+snow_module.h
+
+libsim_ihacres_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/simulation/sim_ihacres/Makefile.in b/src/modules/simulation/sim_ihacres/Makefile.in
new file mode 100644
index 0000000..403bbf3
--- /dev/null
+++ b/src/modules/simulation/sim_ihacres/Makefile.in
@@ -0,0 +1,661 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/simulation/sim_ihacres
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libsim_ihacres_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libsim_ihacres_la_OBJECTS = convert_sl.lo ihacres_basin.lo \
+	ihacres_cal2.lo ihacres_elev.lo ihacres_elev_bands.lo \
+	ihacres_elev_cal.lo ihacres_eq.lo ihacres_v1.lo \
+	MLB_Interface.lo model_tools.lo snow_module.lo
+libsim_ihacres_la_OBJECTS = $(am_libsim_ihacres_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libsim_ihacres_la_SOURCES)
+DIST_SOURCES = $(libsim_ihacres_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_ihacres.la
+libsim_ihacres_la_SOURCES = \
+convert_sl.cpp\
+ihacres_basin.cpp\
+ihacres_cal2.cpp\
+ihacres_elev.cpp\
+ihacres_elev_bands.cpp\
+ihacres_elev_cal.cpp\
+ihacres_eq.cpp\
+ihacres_v1.cpp\
+MLB_Interface.cpp\
+model_tools.cpp\
+snow_module.cpp\
+convert_sl.h\
+ihacres_basin.h\
+ihacres_cal2.h\
+ihacres_elev.h\
+ihacres_elev_bands.h\
+ihacres_elev_cal.h\
+ihacres_eq.h\
+ihacres_v1.h\
+MLB_Interface.h\
+model_tools.h\
+snow_module.h
+
+libsim_ihacres_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_ihacres/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/simulation/sim_ihacres/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsim_ihacres.la: $(libsim_ihacres_la_OBJECTS) $(libsim_ihacres_la_DEPENDENCIES) $(EXTRA_libsim_ihacres_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libsim_ihacres_la_OBJECTS) $(libsim_ihacres_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_sl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_basin.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_cal2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_elev.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_elev_bands.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_elev_cal.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_eq.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_v1.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/model_tools.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/snow_module.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.cpp b/src/modules/simulation/sim_ihacres/convert_sl.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.cpp
rename to src/modules/simulation/sim_ihacres/convert_sl.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.h b/src/modules/simulation/sim_ihacres/convert_sl.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.h
rename to src/modules/simulation/sim_ihacres/convert_sl.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.cpp b/src/modules/simulation/sim_ihacres/ihacres_basin.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.cpp
rename to src/modules/simulation/sim_ihacres/ihacres_basin.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.h b/src/modules/simulation/sim_ihacres/ihacres_basin.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.h
rename to src/modules/simulation/sim_ihacres/ihacres_basin.h
diff --git a/src/modules/simulation/sim_ihacres/ihacres_cal2.cpp b/src/modules/simulation/sim_ihacres/ihacres_cal2.cpp
new file mode 100644
index 0000000..174ca11
--- /dev/null
+++ b/src/modules/simulation/sim_ihacres/ihacres_cal2.cpp
@@ -0,0 +1,1117 @@
+/**********************************************************
+ * Version $Id: ihacres_cal2.cpp 1261 2011-12-16 15:12:15Z oconrad $
+ *********************************************************/
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ihacres_cal2                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    ihacres_cal.cpp                    //
+//                                                       //
+//                 Copyright (C) 2008 by                 //
+//                     Stefan Liersch                    //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     stefan.liersch at ufz.de                  //
+//                stefan.liersch at gmail.com                   //
+//                                                       //
+//                     2008-01-15                        //
+///////////////////////////////////////////////////////////
+//
+//-------------------------------------------------------//
+// References:
+// Jakeman, A.J. / Hornberger, G.M (1993).
+//   How Much Complexity Is Warranted in a
+//	 Rainfall-Runoff Model?
+//	 Water Resources Research, (29), NO. 8 (2637-2649)
+// Kokkonen, T. S. et al. (2003).
+//   Predicting daily flows in ungauged catchments:
+//   model regionalization from catchment descriptors
+//   at the Coweeta Hydrologic Laboratory, North Carolina
+//   Hydrological Processes (17), 2219-2238
+// Croke, B. F. W., W. S. Merritt, et al. (2004).
+//   A dynamic model for predicting hydrologic response
+//   to land cover changes in gauged and
+//   ungauged catchments.
+//   Journal Of Hydrology 291(1-2): 115-131.
+//-------------------------------------------------------//
+
+//---------------------------------------------------------
+// ToDo
+//---------------------------------------------------------
+//	- beste Simulation automatisch rausschreiben
+//---------------------------------------------------------
+#include <iostream> // used for textfile output (test only)
+#include <fstream>  // used for textfile output (test only)
+
+#include <stdlib.h> // random numbers
+#include <time.h>	// random numbers
+
+#include "ihacres_cal2.h"
+// #include "model_tools.h" // already in ihacres_eq.h
+#include "convert_sl.h"
+//---------------------------------------------------------
+
+///////////////////////////////////////////////////////////////////////
+//
+//		Constructor
+//
+///////////////////////////////////////////////////////////////////////
+
+Cihacres_cal2::Cihacres_cal2(void)
+{
+	//-----------------------------------------------------
+	// 1. Info...
+	Set_Name(_TL("IHACRES Calibration (2)"));
+
+	Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch"));
+
+	Set_Description(_TW("Calibration Tool for the Model IHACRES \n \n \n"
+		"Reference: \n \n"
+		"Jakeman, A.J. / Hornberger, G.M. (1993). \n"
+		"How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n"
+		"Water Resources Research, (29), NO. 8 (2637-2649) \n \n"
+		"Croke, B. F. W., W. S. Merritt, et al. (2004).\n"
+		"A dynamic model for predicting hydrologic response "
+		"to land cover changes in gauged and "
+		"ungauged catchments. \n"
+		"Journal Of Hydrology 291(1-2): 115-131."
+	));
+
+	//-----------------------------------------------------
+	// Create First Module Dialog
+	_CreateDialog1();
+	//-----------------------------------------------------
+}
+
+///////////////////////////////////////////////////////////////////////
+//
+//		Destructor
+//
+///////////////////////////////////////////////////////////////////////
+
+Cihacres_cal2::~Cihacres_cal2(void)
+{
+	//if (m_bSnowModule)
+	//{
+	//	delete m_pSnowModule;
+	//	delete[] m_pMeltRate;
+	//}
+}
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//		On_Execute()
+//
+///////////////////////////////////////////////////////////////////////
+
+
+//---------------------------------------------------------
+// This function is executed when the user is pressing the OK button
+// in the first module dialog
+bool Cihacres_cal2::On_Execute(void)
+{
+	int			first, last;
+	double		NSE_temp	= 0.0;
+	double		NSE_max		= -9999.9;
+	string		nse, nse_text;
+
+	//---------------------------------------------------------
+	// Assign parameters from First Module Dialog
+	m_pTable		= Parameters("TABLE")			->asTable();
+	// Field numbers
+	m_dateField		= Parameters("DATE_Field")		->asInt();
+	m_dischargeField= Parameters("DISCHARGE_Field")	->asInt();
+	m_pcpField		= Parameters("PCP_Field")		->asInt();
+	m_tmpField		= Parameters("TMP_Field")		->asInt();
+	m_inflowField	= Parameters("INFLOW_Field")	->asInt();
+
+	m_bUpstream		= Parameters("bUPSTREAM")		->asBool();
+
+	m_bTMP			= Parameters("USE_TMP")			->asBool();
+
+	m_nsim			= Parameters("NSIM")			->asInt();
+	m_area			= Parameters("AREA")			->asDouble();
+	//m_dev_eRainDis	= Parameters("DEV_ERAINDIS")	->asDouble();
+	//m_dev_eRainPCP	= Parameters("DEV_ERAINPCP")	->asDouble();
+	m_storconf		= Parameters("STORAGE")			->asInt();
+	m_IHAC_version	= Parameters("IHACVERS")		->asInt();
+	m_bSnowModule	= Parameters("SNOW_MODULE")		->asBool();
+	first = last	= 0;
+	//---------------------------------------------------------
+
+	//---------------------------------------------------------
+	// After pressing OK in the first Dialog Dialog2 appears.
+	// In the sec
+	if ( _CreateDialog2() )
+	//---------------------------------------------------------
+	{
+		//---------------------------------------------------------
+		// Searching the first and the last record of the time range
+		ihacres.AssignFirstLastRec(*m_pTable, first, last, m_date1, m_date2, m_dateField);
+		//---------------------------------------------------------
+
+		//---------------------------------------------------------
+		// Initialize arrays
+		m_nValues = last - first + 1;
+		_InitPointers();
+		//---------------------------------------------------------
+
+		//---------------------------------------------------------
+		// Assign selected time range to vector m_vec_date,
+		// discharge[], pcp[], and tmp[]
+		_ReadInputTable(first, last);
+		//---------------------------------------------------------
+
+		//---------------------------------------------------------
+		// Convert streamflow from m3/s to mm/day
+		if (m_bUpstream)
+		{
+			// if the subbasin is upstream (without external inflow) then everything
+			// is as it should be.
+			m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_obs_m3s,m_p_Q_obs_mmday,m_nValues,m_area);
+		} else {
+			// if the subbasin is downstream of other subbasins, thus there
+			// are external inflows the array m_p_Q_obs_mmday must be calculated as following:
+			// m_p_Q_obs_mmday =
+			// (observed streamflow at the outlet of the subbasin) - (observed inflow from the upstream subbasin(s))
+			_Calc_ObsMinInflow();
+			m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_dif_m3s, m_p_Q_obs_mmday, m_nValues, m_area);
+		}
+		// calculate sum of observed discharge in [mm]
+		m_sum_obsDisMM = ihacres.SumVector(m_p_Q_obs_mmday, m_nValues);
+		//---------------------------------------------------------
+
+		//---------------------------------------------------------
+		m_pTable = SG_Create_Table();
+		_CreateOutputTable();
+		m_counter = 0;
+		//---------------------------------------------------------
+
+		///////////////////////////////////////////////////////////
+		//
+		//		SIMULATION
+		//
+		///////////////////////////////////////////////////////////
+
+		// initialize random function
+		srand((unsigned) time(NULL)); // using time.h
+
+		for (int sim = 0; sim < m_nsim && Set_Progress(sim, m_nsim); sim++)
+		{
+			_CalcNonLinearModule();
+
+			_CalcLinearModule();
+
+			_CalcEfficiency();
+
+			// write in output table if criterion is fulfilled
+			NSE_temp = ihacres._Assign_NSE_temp(m_obj_func, m_NSE, m_NSE_highflow, m_NSE_lowflow);
+
+			if (NSE_temp > m_NSEmin)
+			{
+				if (NSE_temp > NSE_max)
+				{
+					NSE_max = NSE_temp;
+					nse = convert_sl::Double2String(NSE_max).c_str();
+					nse_text = "max. NSE ";
+					nse_text += nse;
+					Process_Set_Text(CSG_String(nse_text.c_str()));
+				}
+
+				_WriteOutputTable();
+			}
+		}
+		//---------------------------------------------------------
+		m_pTable->Set_Name(SG_T("IHACRES_cal2"));
+		Parameters("TABLEout")->Set_Value(m_pTable);
+
+
+
+		//---------------------------------------------------------
+		_DeletePointers();
+		//---------------------------------------------------------
+
+		return(true);
+
+	} // end if (_CreateDialog2())
+
+
+	return(false);
+}
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//		PRIVATE FUNCTIONS
+//
+///////////////////////////////////////////////////////////////////////
+
+
+//---------------------------------------------------------------------
+//		InitPointers()
+//---------------------------------------------------------------------
+void Cihacres_cal2::_InitPointers()
+{
+	int n = m_nValues;
+
+	m_vec_date.resize(n);
+	if (!m_bUpstream)
+	{
+		m_p_Q_Inflow_m3s = new double[n];
+		m_p_Q_dif_m3s	 = new double[n];
+	}
+	m_p_Q_obs_m3s	= new double[n];
+	m_p_Q_obs_mmday	= new double[n];
+	m_p_Q_sim_mmday	= new double[n];
+	m_pPCP			= new double[n];
+	m_pTMP			= new double[n];
+	m_pExcessRain	= new double[n];
+	m_pTw			= new double[n];
+	m_pWI			= new double[n];
+	if (m_bSnowModule)
+		m_pMeltRate	= new double[n];
+}
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+//		DeletePointers()
+//---------------------------------------------------------------------
+void Cihacres_cal2::_DeletePointers()
+{
+	m_vec_date.resize(0);
+	if (!m_bUpstream)
+	{
+		delete[] m_p_Q_Inflow_m3s;
+		delete[] m_p_Q_dif_m3s;
+	}
+	delete[] m_p_Q_obs_m3s;
+	delete[] m_p_Q_obs_mmday;
+	delete[] m_p_Q_sim_mmday;
+	delete[] m_pPCP;
+	delete[] m_pTMP;
+	delete[] m_pExcessRain;
+	delete[] m_pTw;
+	delete[] m_pWI;
+	if (m_bSnowModule)
+		delete[] m_pMeltRate;
+}
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+//		ReadInputTable()
+//---------------------------------------------------------------------
+void Cihacres_cal2::_ReadInputTable(int first, int last)
+{
+	int j, k;
+
+	for (j = 0, k = first; j < m_nValues, k < last + 1; j++, k++)
+	{
+		// put the date string into the vector
+		m_vec_date[j].append(CSG_String(m_pTable->Get_Record(k)->asString(m_dateField)));
+		m_p_Q_obs_m3s[j]= m_pTable->Get_Record(k)->asDouble(m_dischargeField);
+		m_pPCP[j]		= m_pTable->Get_Record(k)->asDouble(m_pcpField);
+		m_pTMP[j]		= m_pTable->Get_Record(k)->asDouble(m_tmpField);
+		if (!m_bUpstream)
+			m_p_Q_Inflow_m3s[j] = m_pTable->Get_Record(k)->asDouble(m_inflowField);
+	}
+}
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+//		Calculate observed streamflow time series if inflow occurs
+//---------------------------------------------------------------------
+void Cihacres_cal2::_Calc_ObsMinInflow()
+{
+	for (int i = 0; i < m_nValues; i++)
+	{
+		m_p_Q_dif_m3s[i] = m_p_Q_obs_m3s[i] - m_p_Q_Inflow_m3s[i];
+		if (m_p_Q_dif_m3s[i] < 0.0) m_p_Q_obs_mmday[i] = 0;
+	}
+}
+//---------------------------------------------------------------------
+
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//
+//							SIMULATION
+//
+//
+///////////////////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//		NON-LINEAR MODULE
+//
+///////////////////////////////////////////////////////////////////////
+
+void Cihacres_cal2::_CalcNonLinearModule()
+{
+	double eR_init = 0.0;
+	//-------------------------------------------------------------
+	// Assign random values
+	//-------------------------------------------------------------
+	if (m_bSnowModule)
+	{
+		m_SnowParms.T_Rain	= model_tools::Random_double(m_T_Rain_lb, m_T_Rain_ub);
+		m_SnowParms.T_Melt	= model_tools::Random_double(m_T_Melt_lb, m_T_Melt_ub);
+		m_SnowParms.DD_FAC	= model_tools::Random_double(m_DD_FAC_lb, m_DD_FAC_ub);
+
+		m_pSnowModule = new CSnowModule(m_pTMP, m_pPCP, m_nValues,
+			m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_SnowParms.DD_FAC);
+
+		m_pMeltRate = m_pSnowModule->Get_MeltRate(m_pMeltRate, m_nValues);
+		delete m_pSnowModule;
+	}
+
+	m_Tw	= model_tools::Random_double(m_TwConst_lb, m_TwConst_ub);
+	m_f		= model_tools::Random_double(m_f_lb, m_f_ub);
+	m_c		= model_tools::Random_double(m_c_lb, m_c_ub);
+
+	if (m_IHAC_version == 1) { // Croke etal. (2005)
+		m_l	= model_tools::Random_double(m_l_lb, m_l_ub);
+		m_p	= model_tools::Random_double(m_p_lb, m_p_ub);
+	}
+	//-------------------------------------------------------------
+
+	//-------------------------------------------------------------
+	// Simulation (non-linear module)
+	//-------------------------------------------------------------
+	switch(m_IHAC_version)
+	{
+	case 0: // Jakeman & Hornberger (1993)
+		if (m_bTMP)
+		{
+			ihacres.CalcWetnessTimeConst(m_pTMP, m_pTw, m_Tw, m_f, m_nValues);
+		}
+
+		if (m_bSnowModule)
+		{
+			ihacres.CalcWetnessIndex(m_pTw, m_pPCP, m_pTMP,	m_pWI, 0.5, m_c,
+				m_bSnowModule, m_SnowParms.T_Rain, m_nValues);
+
+			ihacres.CalcExcessRain(m_pPCP, m_pTMP, m_pWI,m_pExcessRain,eR_init,
+				m_sum_eRainGTpcp, m_nValues, m_bSnowModule,
+				m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_pMeltRate);
+		} else {
+			ihacres.CalcWetnessIndex(m_pTw, m_pPCP, m_pTMP, m_pWI, 0.5, m_c,
+				m_bSnowModule, 0, m_nValues);
+
+			ihacres.CalcExcessRain(m_pPCP, m_pTMP, m_pWI, m_pExcessRain,eR_init,
+				m_sum_eRainGTpcp, m_nValues, m_bSnowModule,
+				0,0,0);
+		} // end if (m_bSnowModule)
+
+		break;
+	case 1: // Croke et al. (2005) Redesign
+		if (m_bTMP)
+		{
+			ihacres.CalcWetnessTimeConst_Redesign(m_pTMP, m_pTw, m_Tw, m_f, m_nValues);
+		}
+
+		if (m_bSnowModule)
+		{
+			ihacres.CalcWetnessIndex_Redesign(m_pTw, m_pPCP, m_pWI, 0.5,
+				m_bSnowModule, m_SnowParms.T_Rain, m_nValues);
+
+			ihacres.CalcExcessRain_Redesign(m_pPCP, m_pTMP, m_pWI, m_pExcessRain, eR_init,
+				m_sum_eRainGTpcp, m_nValues,
+				m_c, m_l, m_p,
+				m_bSnowModule, m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_pMeltRate);
+		} else {
+			ihacres.CalcWetnessIndex_Redesign(m_pTw, m_pPCP, m_pWI, 0.5,
+				m_bSnowModule, 0, m_nValues);
+
+			ihacres.CalcExcessRain_Redesign(m_pPCP, m_pTMP, m_pWI, m_pExcessRain, eR_init,
+				m_sum_eRainGTpcp, m_nValues,
+				m_c, m_l, m_p,
+				m_bSnowModule, 0,0,0);
+		}
+		break;
+	} // end switch(m_IHAC_version)
+}
+//---------------------------------------------------------------------
+
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//		LINEAR MODULE
+//
+///////////////////////////////////////////////////////////////////////
+
+void Cihacres_cal2::_CalcLinearModule()
+{
+	//-------------------------------------------------------------
+	// Assign random values
+	//-------------------------------------------------------------
+	switch(m_storconf)
+	{
+	case 0: // single storage
+		m_a		= model_tools::Random_double(m_a_lb, m_a_ub);
+		m_b		= model_tools::Random_double(m_b_lb, m_b_ub);
+		break;
+	case 1: // two storages in parallel
+		do
+		{
+			m_aq		= model_tools::Random_double(m_aq_lb, m_aq_ub);
+			m_as		= model_tools::Random_double(m_as_lb, m_as_ub);
+			m_bq		= model_tools::Random_double(m_bq_lb, m_bq_ub);
+			// Calculate parameter m_vq to check parms aq and bq
+			// Equation after Jakeman & Hornberger (1993)
+			m_vq	= m_bq / ( 1 + m_aq );
+		}
+		while (m_vq < 0.0 || m_vq > 1.0);
+		m_bs = ihacres.Calc_Parm_BS(m_aq, m_as, m_bq);
+		break;
+	}
+	//-------------------------------------------------------------
+
+	//-------------------------------------------------------------
+	// Simulate streamflow (linear module)
+	//-------------------------------------------------------------
+	switch(m_storconf)
+	{
+	case 0: // single storage
+		ihacres.SimStreamflowSingle(m_pExcessRain, m_p_Q_obs_mmday[0],
+			m_p_Q_sim_mmday, m_delay, m_a, m_b, m_nValues);
+		break;
+	case 1: // two storages in parallel
+		ihacres.SimStreamflow2Parallel(m_pExcessRain, m_p_Q_sim_mmday, m_p_Q_obs_mmday[0],
+			m_aq, m_as, m_bq, m_bs, m_vq, m_vs, m_IHAC_version, m_nValues, m_delay);
+		break;
+	case 2: // two storages in series
+		break;
+	} // end switch(m_StorConf)
+}
+//---------------------------------------------------------------------
+
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//		EFFICIENCY
+//
+///////////////////////////////////////////////////////////////////////
+
+//---------------------------------------------------------------------
+//		Nash-Sutcliffe efficiency
+//---------------------------------------------------------------------
+void Cihacres_cal2::_CalcEfficiency()
+{
+	m_NSE			= model_tools::CalcEfficiency(m_p_Q_obs_mmday, m_p_Q_sim_mmday,m_nValues);
+	m_NSE_highflow	= model_tools::Calc_NSE_HighFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues);
+	m_NSE_lowflow	= model_tools::Calc_NSE_LowFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues);
+	m_PBIAS			= model_tools::Calc_PBIAS(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues);
+}
+//---------------------------------------------------------------------
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//							CREATE TABLES
+//
+/////////////////////////////////////////////////////////////////////////////
+
+//---------------------------------------------------------------------
+//		Create output table
+//---------------------------------------------------------------------
+void Cihacres_cal2::_CreateOutputTable()
+{
+	// creating the column titles
+	m_pTable->Add_Field("NSE",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("NSE_high",			SG_DATATYPE_Double);
+	m_pTable->Add_Field("NSE_low",			SG_DATATYPE_Double);
+	m_pTable->Add_Field("PBIAS",			SG_DATATYPE_Double);
+	m_pTable->Add_Field("eR_ovest",			SG_DATATYPE_Double);
+	m_pTable->Add_Field("vq",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("vs",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("T(q)",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("T(s)",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("Tw",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("f",				SG_DATATYPE_Double);
+	m_pTable->Add_Field("c",				SG_DATATYPE_Double);
+	if ( m_IHAC_version == 1 ) // Croke etal. (2005)
+	{
+		m_pTable->Add_Field("l",			SG_DATATYPE_Double);
+		m_pTable->Add_Field("p",			SG_DATATYPE_Double);
+	}
+	if (m_bSnowModule)
+	{
+		m_pTable->Add_Field("T_Rain",		SG_DATATYPE_Double);
+		m_pTable->Add_Field("T_Melt",		SG_DATATYPE_Double);
+		m_pTable->Add_Field("DD_FAC",		SG_DATATYPE_Double);
+	}
+	switch(m_storconf)
+	{
+	case 0: // single
+		m_pTable->Add_Field("a",			 SG_DATATYPE_Double);
+		m_pTable->Add_Field("b",			 SG_DATATYPE_Double);
+		break;
+	case 1: // two storages in parallel
+		m_pTable->Add_Field("aq",			 SG_DATATYPE_Double);
+		m_pTable->Add_Field("as",			 SG_DATATYPE_Double);
+		m_pTable->Add_Field("bq",			 SG_DATATYPE_Double);
+		m_pTable->Add_Field("bs",			 SG_DATATYPE_Double);
+		break;
+	}
+}
+//---------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------
+//		Create output table
+//---------------------------------------------------------------------
+void Cihacres_cal2::_WriteOutputTable()
+{
+	int					field = 0;
+	CSG_Table_Record	*pRecord;
+
+	// add a new record to the table
+	m_pTable->Add_Record();
+	pRecord	= m_pTable->Get_Record(m_counter);
+
+	// writing the data to the current row
+	pRecord->Set_Value(field,m_NSE); field++;
+	pRecord->Set_Value(field,m_NSE_highflow); field++;
+	pRecord->Set_Value(field,m_NSE_lowflow); field++;
+	pRecord->Set_Value(field,m_PBIAS); field++;
+	pRecord->Set_Value(field,m_sum_eRainGTpcp); field++;
+	pRecord->Set_Value(field,m_vq); field++;
+	pRecord->Set_Value(field,m_vs); field++;
+	pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_aq)); field++;
+	pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_as)); field++;
+	pRecord->Set_Value(field,m_Tw); field++;
+	pRecord->Set_Value(field,m_f); field++;
+	pRecord->Set_Value(field,m_c); field++;
+	if ( m_IHAC_version == 1 ) // Croke et al. (2005)
+	{
+		pRecord->Set_Value(field,m_l); field++;
+		pRecord->Set_Value(field,m_p); field++;
+	}
+	if ( m_bSnowModule )
+	{
+		pRecord->Set_Value(field,m_SnowParms.T_Rain); field++;
+		pRecord->Set_Value(field,m_SnowParms.T_Melt); field++;
+		pRecord->Set_Value(field,m_SnowParms.DD_FAC); field++;
+	}
+	switch(m_storconf)
+	{
+	case 0: // single
+		pRecord->Set_Value(field,m_a); field++;
+		pRecord->Set_Value(field,m_b); field++;
+		break;
+	case 1: // two storages in parallel
+		pRecord->Set_Value(field,m_aq); field++;
+		pRecord->Set_Value(field,m_as); field++;
+		pRecord->Set_Value(field,m_bq); field++;
+		pRecord->Set_Value(field,m_bs); field++;
+		break;
+	}
+	m_counter++; // record counter
+}
+//---------------------------------------------------------------------
+
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////
+//
+//		DIALOGS
+//
+///////////////////////////////////////////////////////////////////////
+
+
+//---------------------------------------------------------------------
+//		DIALOG 1
+//---------------------------------------------------------------------
+void Cihacres_cal2::_CreateDialog1()
+{
+	CSG_Parameter	*pNode;
+	CSG_String s;
+
+	pNode = Parameters.Add_Table(
+		NULL	, "TABLE"	, _TL("Table"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DATE_Field"	, _TL("Date Column"),
+		_TL("Select the column containing the Date")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DISCHARGE_Field"	, _TL("Streamflow Column"),
+		_TL("Select the Column containing Discharge Values")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "PCP_Field"	, _TL("Precipitation Column"),
+		_TL("Select the Column containing precipitation Values")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "TMP_Field"	, _TL("Temperature Column"),
+		_TL("Select the Column containing Temperature Values")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "INFLOW_Field"	, _TL("Subbasin Inflow"),
+		_TL("Select the column containing inflow data to the subbasin")
+	);
+
+	Parameters.Add_Value(
+		pNode,	"bUPSTREAM",	_TL("Is the subbasin upstream (no external inflow)"),
+		_TL("If checked, it means there is no external inflow to the subbasin"),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		pNode,	"USE_TMP",	_TL("Using temperature data?"),
+		_TL("If checked, then temperature data are used."),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	pNode = Parameters.Add_Value(
+		NULL,	"NSIM",	_TL("Number of Simulations"),
+		_TL("Number of Simulations for Calibration"),
+		PARAMETER_TYPE_Int,
+		1000, 1, true, 10000000, true
+	);
+
+	pNode = Parameters.Add_Value(
+		NULL,	"AREA",	_TL("Area of the Watershed in [km2]"),
+		_TL("Area of the Watershed in [km2] used for unit conversion"),
+		PARAMETER_TYPE_Double,
+		100.0, 0.00001, true, 0.0, false
+	);
+
+	//s.Printf(SG_T("Node2", 2);
+	//	pNode = Parameters.Add_Node(NULL,s,SG_T("Non-Linear Module",_TL(""));
+
+	//Parameters.Add_Value(
+	//	pNode,	"DEV_ERAINDIS",	_TL("Maximum Deviation: ExcessRain-Streamflow [%]"),
+	//	_TL("Maximum Deviation between estimated excess rainfall and observed streamflow volumes"),
+	//	PARAMETER_TYPE_Double,
+	//	5.0, 0.0, true, 50.0, true
+	//);
+
+	//Parameters.Add_Value(
+	//	pNode,	"DEV_ERAINPCP",	_TL("Maximum Overestimation of ExcessRain [%]"),
+	//	_TL("Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"),
+	//	PARAMETER_TYPE_Double,
+	//	5.0, 0.0, true, 50.0, true
+	//);
+
+	s.Printf(SG_T("Node3"), 3);
+	pNode = Parameters.Add_Node(NULL,s,SG_T("Storage Configuration"),_TL(""));
+
+	Parameters.Add_Choice(
+		pNode	, "STORAGE"		, _TL("Storage"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Single Storage"),			//  0
+			_TL("Two Parallel Storages"),	//  1
+			_TL("Two Storages in Series")	//  2
+		)
+	);
+
+	s.Printf(SG_T("Node4"), 4);
+	pNode = Parameters.Add_Node(NULL,s,_TL("IHACRES Version"),_TL(""));
+
+	Parameters.Add_Choice(
+		pNode	, "IHACVERS"		, _TL("IHACRES Version"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Jakeman & Hornberger (1993)"),	//  0
+			_TL("Croke et al. (2005)")			//	1
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode,	"SNOW_MODULE",	_TL("Snow Module on/off"),
+		_TL("If checked the snow module is active"),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Table_Output(
+		NULL	, "TABLEout"	, _TL("Table"),
+		_TL("")
+	);
+	Parameters.Add_Table_Output(
+		NULL	, "TABLEparms"	, _TL("Table"),
+		_TL("")
+	);
+}
+//---------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------
+//		DIALOG 2
+//---------------------------------------------------------------------
+bool Cihacres_cal2::_CreateDialog2()
+{
+	CSG_String		s;
+	CSG_Parameters	P;  // used to add Parameters in the second dialog
+	CSG_Parameter	*pNode, *pNode1;
+
+
+	//	Dialog design
+	P.Set_Name(_TL("IHACRES Model Parameters"));
+
+	s.Printf(SG_T("Node1"), 1);
+	pNode = P.Add_Node(NULL,s,SG_T("Time Range"),_TL(""));
+
+	s.Printf(SG_T("FDAY") , 1-1);
+	P.Add_String(pNode,s,_TL("First Day"),_TL(""),
+		m_pTable->Get_Record(0)->asString(m_dateField));
+
+	s.Printf(SG_T("LDAY") , 1-2);
+	P.Add_String(pNode,s,_TL("Last Day"),_TL(""),
+		m_pTable->Get_Record(m_pTable->Get_Record_Count()-1)->asString(m_dateField));
+
+	//-----------------------------------------------------------------
+	// Non-linear parameters
+	//-----------------------------------------------------------------
+	s.Printf(SG_T("Node2"), 2);
+		pNode = P.Add_Node(NULL,s,SG_T("Non-Linear Module"),_TL(""));
+
+	P.Add_Value(
+		pNode,	"TwFAC_lb",	_TL("(Tw) wetness decline time constant [lower bound]"),
+		_TW("Tw is approximately the time constant, or inversely,"
+		"the rate at which the catchment wetness declines in the absence of rainfall"),
+		PARAMETER_TYPE_Double,
+		1.0, 0.01, true, 150.0, true
+	);
+	P.Add_Value(
+		pNode,	"TwFAC_ub",	_TL("(Tw) wetness decline time constant [upper bound]"),
+		_TW("Tw is approximately the time constant, or inversely,SG_T("
+		"the rate at which the catchment wetness declines in the absence of rainfall"),
+		PARAMETER_TYPE_Double,
+		50.0, 0.01, true, 150.0, true
+		);
+
+	if (m_bTMP) // if observed temperature data are used
+	{
+		P.Add_Value(
+			pNode	, "TFAC_lb"		, _TL("(f) Temperature Modulation Factor [lower bound]"),
+			_TL("Temperature Modulation Factor f"),
+			PARAMETER_TYPE_Double,
+			0.05, 0.0001, true, 5.0, true
+		);
+		P.Add_Value(
+			pNode	, "TFAC_ub"		, _TL("(f) Temperature Modulation Factor [upper bound]"),
+			_TL("Temperature Modulation Factor f"),
+			PARAMETER_TYPE_Double,
+			0.5, 0.0001, true, 5.0, true
+		);
+	}
+
+	P.Add_Value(
+		pNode,	"CFAC_lb",	_TL("(c) Parameter [lower bound]"),
+		_TL("Parameter (c) to fit streamflow volume"),
+		PARAMETER_TYPE_Double,
+		0.001, 0.0, true, 1.0, true
+	);
+	P.Add_Value(
+		pNode,	"CFAC_ub",	_TL("(c) Parameter [upper bound]"),
+		_TL("Parameter (c) to fit streamflow volume"),
+		PARAMETER_TYPE_Double,
+		0.01, 0.0, true, 1.0, true
+	);
+
+	if (m_IHAC_version == 1) // Croke et al. (2005) Redesign
+	{
+		s.Printf(SG_T("Node2-2"), 2-2);
+		pNode1 = P.Add_Node(pNode,s,SG_T("Soil moisture index threshold"),_TL(""));
+
+		P.Add_Value(
+			pNode1	, "SMI_L_lb"		, _TL("Soil moisture index (l) [lower bound]"),
+			_TL("Soil moisture index threshold (l), lower bound"),
+			PARAMETER_TYPE_Double,
+			0.0, 0.0, true, 5.0, true
+		);
+		P.Add_Value(
+			pNode1	, "SMI_L_ub"		, _TL("Soil moisture index (l) [upper bound]"),
+			_TL("Soil moisture index threshold (l), upper bound"),
+			PARAMETER_TYPE_Double,
+			5.0, 0.0, true, 5.0, true
+		);
+		s.Printf(SG_T("Node2-3"), 2-3);
+		pNode1 = P.Add_Node(pNode,s,_TL("Power on soil moisture"),_TL(""));
+
+		P.Add_Value(
+			pNode1	, "SM_P_lb"		, _TL("Power on soil (p) [lower bound]"),
+			_TL("Power on soil moisture (p), lower bound"),
+			PARAMETER_TYPE_Double,
+			0.0, 0.0, true, 5.0, true
+		);
+		P.Add_Value(
+			pNode1	, "SM_P_ub"		, _TL("Power on soil (p) [upper bound]"),
+			_TL("Power on soil moisture (p), upper bound"),
+			PARAMETER_TYPE_Double,
+			5.0, 0.0, true, 5.0, true
+		);
+	}
+	//-----------------------------------------------------------------
+	// Linear module
+	//-----------------------------------------------------------------
+	switch(m_storconf)
+	{
+	case 0: // single storage
+		s.Printf(SG_T("Node3"), 3);
+		pNode = P.Add_Node(NULL,s,_TL("Linear Module"),_TL(""));
+
+		s.Printf(SG_T("Node3-1"), 3-1);
+		pNode1 = P.Add_Node(pNode,s,_TL("Parameter (a)"),_TL(""));
+
+		P.Add_Value(
+			pNode1,	"AFAC_lb",	_TL("(a) [lower bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			-0.5, -0.99, true, -0.01, true
+		);
+		P.Add_Value(
+			pNode1,	"AFAC_ub",	_TL("(a) [upper bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			-0.9, -0.99, true, -0.01, true
+		);
+
+		s.Printf(SG_T("Node3-2"), 3-2);
+		pNode1 = P.Add_Node(pNode,s,_TL("Parameter (b)"),_TL(""));
+
+		P.Add_Value(
+			pNode1,	"BFAC_lb",	_TL("(b) [lower bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			0.0, 0.001, true, 1.0, true
+		);
+		P.Add_Value(
+			pNode1,	"BFAC_ub",	_TL("(b) [upper bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			1.0, 0.001, true, 1.0, true
+		);
+		break;
+
+	case 1: // two parallel storages
+		s.Printf(SG_T("Node3"), 3);
+		pNode = P.Add_Node(NULL,s,_TL("Linear Module"),_TL(""));
+
+		// Parameter a
+		s.Printf(SG_T("Node3-1"), 3-1);
+		pNode1 = P.Add_Node(pNode,s,_TL("Parameter (a)"),_TL(""));
+
+		P.Add_Value(
+			pNode1,	"AQ_lb",	_TL("a(q) [lower bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			-0.5, -0.99, true, -0.01, true
+		);
+		P.Add_Value(
+			pNode1,	"AQ_ub",	_TL("a(q) [upper bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			-0.7, -0.99, true, -0.01, true
+		);
+		P.Add_Value(
+			pNode1,	"AS_lb",	_TL("a(s) [lower bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			-0.7, -0.99, true, -0.01, true
+		);
+		P.Add_Value(
+			pNode1,	"AS_ub",	_TL("a(s) [upper bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			-0.99, -0.99, true, -0.01, true
+		);
+
+		// Parameter b
+		s.Printf(SG_T("Node3-2"), 3-2);
+		pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (b)"),_TL(""));
+
+		P.Add_Value(
+			pNode1,	"BQ_lb",	_TL("b(q) [lower bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			0.0, 0.0, true, 1.0, true
+		);
+		P.Add_Value(
+			pNode1,	"BQ_ub",	_TL("b(q) [upper bound]"),
+			_TL(""),
+			PARAMETER_TYPE_Double,
+			0.5, 0.0, true, 1.0, true
+		);
+		break;
+	case 2: // two storages in series
+		break;
+	} // end switch (m_storconf)
+
+
+	//-----------------------------------------------------------------
+	// Snow module
+	//-----------------------------------------------------------------
+	if (m_bSnowModule) // if snow module is active
+	{
+		s.Printf(SG_T("Node2-4"), 2-4);
+		pNode = P.Add_Node(NULL,s,SG_T("Snow Module"),_TL(""));
+
+		P.Add_Value(
+			pNode,	"T_RAIN_lb",	_TL("Temperature Threshold for Rainfall (lower bound)"),
+			_TL("Below this threshold precipitation will fall as snow"),
+			PARAMETER_TYPE_Double,
+			-1.0, -10.0, true, 10.0, true
+		);
+		P.Add_Value(
+			pNode,	"T_RAIN_ub",	_TL("Temperature Threshold for Rainfall (upper bound)"),
+			_TL("Below this threshold precipitation will fall as snow"),
+			PARAMETER_TYPE_Double,
+			1.0, -10.0, true, 10.0, true
+		);
+		P.Add_Value(
+			pNode,	"T_MELT_lb",	_TL("Temperature Threshold for Melting (lower bound)"),
+			_TL("Above this threshold snow will start to melt"),
+			PARAMETER_TYPE_Double,
+			-1.0, -5.0, true, 10.0, true
+		);
+		P.Add_Value(
+			pNode,	"T_MELT_ub",	_TL("Temperature Threshold for Melting (upper bound)"),
+			_TL("Above this threshold snow will start to melt"),
+			PARAMETER_TYPE_Double,
+			1.0, -5.0, true, 10.0, true
+		);
+		P.Add_Value(
+			pNode,	"DD_FAC_lb",	_TL("Day-Degree Factor (lower bound)"),
+			_TL("Day-Degree Factor depends on catchment characteristics"),
+			PARAMETER_TYPE_Double,
+			0.7, 0.7, true, 9.2, true
+		);
+		P.Add_Value(
+			pNode,	"DD_FAC_ub",	_TL("Day-Degree Factor (upper bound)"),
+			_TL("Day-Degree Factor depends on catchment characteristics"),
+			PARAMETER_TYPE_Double,
+			9.2, 0.7, true, 9.2, true
+		);
+	}
+
+
+
+	s.Printf(SG_T("Node4"), 4);
+	pNode = P.Add_Node(NULL,s,SG_T("Time Delay after Start of Rainfall (INTEGER)"),_TL(""));
+
+	P.Add_Value(
+		pNode1,	"DELAY",	_TL("Time Delay (Rain-Runoff)"),
+		_TL("The delay after the start of rainfall, before the discharge starts to rise."),
+		PARAMETER_TYPE_Int,
+		1, 1, true, 100, true
+	);
+
+	s.Printf(SG_T("Node6"), 6);
+	pNode = P.Add_Node(NULL,s,SG_T("Nash-Sutcliffe Efficiency"),_TL(""));
+
+	P.Add_Choice(
+		pNode, "OBJ_FUNC"		, _TL("Objective Function"),
+		_TL(""),
+		_TL("NSE|NSE high flow|NSE low flow")
+	);
+
+	P.Add_Value(
+		pNode,	"NSEMIN",	_TL("Minimum Nash-Sutcliffe Efficiency"),
+		_TL("Minimum Nash-Sutcliffe Efficiency required to print simulation to calibration table"),
+		PARAMETER_TYPE_Double,
+		0.7, 0.1, true, 1.0, true
+	);
+	// End of second dialog design
+
+
+	if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) )
+	{
+		// assign data from second dialog
+
+		m_date1			= P(CSG_String::Format(SG_T("FDAY"),m_dateField).c_str())->asString();
+		m_date2			= P(CSG_String::Format(SG_T("LDAY"),m_dischargeField).c_str())->asString();
+
+		//-------------------------------------------------
+		// assign non-linear module parameters
+		//-------------------------------------------------
+		m_TwConst_lb	= P("TwFAC_lb")					->asDouble();
+		m_TwConst_ub	= P("TwFAC_ub")					->asDouble();
+		m_c_lb			= P("CFAC_lb")					->asDouble();
+		m_c_ub			= P("CFAC_ub")					->asDouble();
+
+		if (m_bTMP) // if observed temperature data are used
+		{
+			m_f_lb		= P("TFAC_lb")					->asDouble();
+			m_f_ub		= P("TFAC_ub")					->asDouble();
+		}
+		if (m_IHAC_version == 1)
+		{
+			m_l_lb		= P("SMI_L_lb")					->asDouble();
+			m_l_ub		= P("SMI_L_ub")					->asDouble();
+			m_p_lb		= P("SM_P_lb")					->asDouble();
+			m_p_ub		= P("SM_P_ub")					->asDouble();
+		}
+		//-------------------------------------------------
+
+		//-------------------------------------------------
+		// assign linear module parameters
+		//-------------------------------------------------
+		switch (m_storconf)
+		{
+		case 0:
+			m_a_lb		= P("AFAC_lb")				->asDouble();
+			m_a_ub		= P("AFAC_ub")				->asDouble();
+			m_b_lb		= P("BFAC_lb")				->asDouble();
+			m_b_ub		= P("BFAC_ub")				->asDouble();
+			m_delay		= P("DELAY")				->asInt();
+			m_NSEmin	= P("NSEMIN")				->asDouble();
+			break;
+		case 1: // two parallel storages
+			m_aq_lb		= P("AQ_lb")				->asDouble();
+			m_aq_ub		= P("AQ_ub")				->asDouble();
+			m_as_lb		= P("AS_lb")				->asDouble();
+			m_as_ub		= P("AS_ub")				->asDouble();
+			m_bq_lb		= P("BQ_lb")				->asDouble();
+			m_bq_ub		= P("BQ_ub")				->asDouble();
+
+			m_delay		= P("DELAY")				->asInt();
+			m_obj_func	= P("OBJ_FUNC")				->asInt();
+			m_NSEmin	= P("NSEMIN")				->asDouble();
+			break;
+		case 2: // two storages in series
+			break;
+		} // end switch
+		//-------------------------------------------------
+
+		if (m_bSnowModule)
+		{
+			m_T_Rain_lb	= P("T_RAIN_lb")			->asDouble();
+			m_T_Rain_ub	= P("T_RAIN_ub")			->asDouble();
+			m_T_Melt_lb	= P("T_MELT_lb")			->asDouble();
+			m_T_Melt_ub	= P("T_MELT_ub")			->asDouble();
+			m_DD_FAC_lb	= P("DD_FAC_lb")			->asDouble();
+			m_DD_FAC_ub	= P("DD_FAC_ub")			->asDouble();
+		}
+		return(true);
+	} else {
+		return(false);
+	}
+}
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.h b/src/modules/simulation/sim_ihacres/ihacres_cal2.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.h
rename to src/modules/simulation/sim_ihacres/ihacres_cal2.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.cpp b/src/modules/simulation/sim_ihacres/ihacres_elev.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.cpp
rename to src/modules/simulation/sim_ihacres/ihacres_elev.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.h b/src/modules/simulation/sim_ihacres/ihacres_elev.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.h
rename to src/modules/simulation/sim_ihacres/ihacres_elev.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.cpp b/src/modules/simulation/sim_ihacres/ihacres_elev_bands.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.cpp
rename to src/modules/simulation/sim_ihacres/ihacres_elev_bands.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.h b/src/modules/simulation/sim_ihacres/ihacres_elev_bands.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.h
rename to src/modules/simulation/sim_ihacres/ihacres_elev_bands.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.cpp b/src/modules/simulation/sim_ihacres/ihacres_elev_cal.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.cpp
rename to src/modules/simulation/sim_ihacres/ihacres_elev_cal.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.h b/src/modules/simulation/sim_ihacres/ihacres_elev_cal.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.h
rename to src/modules/simulation/sim_ihacres/ihacres_elev_cal.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.cpp b/src/modules/simulation/sim_ihacres/ihacres_eq.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.cpp
rename to src/modules/simulation/sim_ihacres/ihacres_eq.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.h b/src/modules/simulation/sim_ihacres/ihacres_eq.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.h
rename to src/modules/simulation/sim_ihacres/ihacres_eq.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.cpp b/src/modules/simulation/sim_ihacres/ihacres_v1.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.cpp
rename to src/modules/simulation/sim_ihacres/ihacres_v1.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.h b/src/modules/simulation/sim_ihacres/ihacres_v1.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.h
rename to src/modules/simulation/sim_ihacres/ihacres_v1.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/model_tools.cpp b/src/modules/simulation/sim_ihacres/model_tools.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/model_tools.cpp
rename to src/modules/simulation/sim_ihacres/model_tools.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/model_tools.h b/src/modules/simulation/sim_ihacres/model_tools.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/model_tools.h
rename to src/modules/simulation/sim_ihacres/model_tools.h
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/snow_module.cpp b/src/modules/simulation/sim_ihacres/snow_module.cpp
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/snow_module.cpp
rename to src/modules/simulation/sim_ihacres/snow_module.cpp
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/snow_module.h b/src/modules/simulation/sim_ihacres/snow_module.h
similarity index 100%
rename from src/modules_contrib/contrib_s_liersch/ihacres/snow_module.h
rename to src/modules/simulation/sim_ihacres/snow_module.h
diff --git a/src/modules/statistics/Makefile.am b/src/modules/statistics/Makefile.am
new file mode 100644
index 0000000..190e87b
--- /dev/null
+++ b/src/modules/statistics/Makefile.am
@@ -0,0 +1,5 @@
+if WITH_GUI
+SUBDIRS = statistics_points statistics_kriging statistics_grid statistics_regression
+else
+SUBDIRS = statistics_points statistics_grid statistics_regression
+endif
diff --git a/src/modules/statistics/Makefile.in b/src/modules/statistics/Makefile.in
new file mode 100644
index 0000000..4e97cd8
--- /dev/null
+++ b/src/modules/statistics/Makefile.in
@@ -0,0 +1,636 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/statistics
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = statistics_points statistics_grid statistics_regression \
+	statistics_kriging
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at WITH_GUI_FALSE@SUBDIRS = statistics_points statistics_grid statistics_regression
+ at WITH_GUI_TRUE@SUBDIRS = statistics_points statistics_kriging statistics_grid statistics_regression
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/statistics/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Directional_Statistics.cpp b/src/modules/statistics/statistics_grid/GSGrid_Directional_Statistics.cpp
new file mode 100644
index 0000000..62300a2
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Directional_Statistics.cpp
@@ -0,0 +1,367 @@
+/**********************************************************
+ * Version $Id: GSGrid_Directional_Statistics.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//            GSGrid_Directional_Statistics.cpp          //
+//                                                       //
+//                 Copyright (C) 2010 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 "GSGrid_Directional_Statistics.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	id_Mean		= 0,
+	id_DifMean,
+	id_Min,
+	id_Max,
+	id_Range,
+	id_Var,
+	id_StdDev,
+	id_StdDevLo,
+	id_StdDevHi,
+	id_DevMean,
+	id_Percent,
+	id_Count
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Directional_Statistics::CGSGrid_Directional_Statistics(void)
+{
+	Set_Name		(_TL("Directional Statistics for Single Grid"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Calculates for each cell statistical properties (arithmetic mean, minimum, maximum, "
+		"variance, standard deviation) of all cells lying in given direction based on the input grid. "
+	));
+
+
+	Parameters.Add_Grid(NULL, "GRID"		, _TL("Grid")								, _TL(""), PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL, "MEAN"		, _TL("Arithmetic Mean")					, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "DIFMEAN"		, _TL("Difference from Arithmetic Mean")	, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "MIN"			, _TL("Minimum")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "MAX"			, _TL("Maximum")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "RANGE"		, _TL("Range")								, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "VAR"			, _TL("Variance")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "STDDEV"		, _TL("Standard Deviation")					, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "STDDEVLO"	, _TL("Mean less Standard Deviation")		, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "STDDEVHI"	, _TL("Mean plus Standard Deviation")		, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "DEVMEAN"		, _TL("Deviation from Arithmetic Mean")		, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "PERCENT"		, _TL("Percentile")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+
+	Parameters.Add_Shapes(
+		NULL, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Shapes(
+		NULL, "POINTS_OUT"	, _TL("Directional Statistics for Points"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Value(
+		NULL, "DIRECTION"	, _TL("Direction [Degree]"),
+		_TL(""),
+		PARAMETER_TYPE_Double
+	);
+
+	Parameters.Add_Value(
+		NULL, "TOLERANCE"	, _TL("Tolerance [Degree]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 45.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "MAXDISTANCE"	, _TL("Maximum Distance [Cells]"),
+		_TL("Maximum distance parameter is ignored if set to zero (default)."),
+		PARAMETER_TYPE_Int, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Parameters(
+		NULL, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Directional_Statistics::On_Execute(void)
+{
+	int			Radius;
+	double		Direction, Tolerance, s[id_Count];
+	CSG_Shapes	*pPoints;
+
+	//-----------------------------------------------------
+	m_pGrid		= Parameters("GRID")		->asGrid();
+
+	m_pMean		= Parameters("MEAN")		->asGrid();
+	m_pDifMean	= Parameters("DIFMEAN")		->asGrid();
+	m_pMin		= Parameters("MIN")			->asGrid();
+	m_pMax		= Parameters("MAX")			->asGrid();
+	m_pRange	= Parameters("RANGE")		->asGrid();
+	m_pVar		= Parameters("VAR")			->asGrid();
+	m_pStdDev	= Parameters("STDDEV")		->asGrid();
+	m_pStdDevLo	= Parameters("STDDEVLO")	->asGrid();
+	m_pStdDevHi	= Parameters("STDDEVHI")	->asGrid();
+	m_pDevMean	= Parameters("DEVMEAN")		->asGrid();
+	m_pPercent	= Parameters("PERCENT")		->asGrid();
+
+	pPoints		= Parameters("POINTS")		->asShapes();
+
+	//-----------------------------------------------------
+	if( !(m_pMean || m_pDifMean || m_pMin || m_pMax || m_pRange || m_pVar || m_pStdDev || m_pStdDevLo || m_pStdDevHi || m_pPercent || pPoints) )
+	{
+		Message_Dlg(_TL("no target specified"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Direction	= Parameters("DIRECTION")	->asDouble() * M_DEG_TO_RAD;
+	Tolerance	= Parameters("TOLERANCE")	->asDouble() * M_DEG_TO_RAD;
+
+	Radius		= Parameters("MAXDISTANCE")	->asInt();
+
+	if( Radius <= 0 )
+	{
+		Radius	= 1 + (int)SG_Get_Length(Get_NX(), Get_NY());
+	}
+
+	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	if( !m_Cells.Set_Sector(Radius, Direction, Tolerance) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	if( m_pMean || m_pDifMean || m_pMin || m_pMax || m_pRange || m_pVar || m_pStdDev || m_pStdDevLo || m_pStdDevHi || m_pPercent )
+	{
+		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			for(int x=0; x<Get_NX(); x++)
+			{
+				if( Get_Statistics(x, y, s) )
+				{
+					if( m_pMean     )	m_pMean		->Set_Value(x, y, s[id_Mean    ]);
+					if( m_pDifMean  )	m_pDifMean	->Set_Value(x, y, s[id_DifMean ]);
+					if( m_pMin      )	m_pMin		->Set_Value(x, y, s[id_Min     ]);
+					if( m_pMax      )	m_pMax		->Set_Value(x, y, s[id_Max     ]);
+					if( m_pRange    )	m_pRange	->Set_Value(x, y, s[id_Range   ]);
+					if( m_pVar      )	m_pVar		->Set_Value(x, y, s[id_Var     ]);
+					if( m_pStdDev   )	m_pStdDev	->Set_Value(x, y, s[id_StdDev  ]);
+					if( m_pStdDevLo )	m_pStdDevLo	->Set_Value(x, y, s[id_StdDevLo]);
+					if( m_pStdDevHi )	m_pStdDevHi	->Set_Value(x, y, s[id_StdDevHi]);
+					if( m_pDevMean  )	m_pDevMean	->Set_Value(x, y, s[id_DevMean ]);
+					if( m_pPercent  )	m_pPercent	->Set_Value(x, y, s[id_Percent ]);
+				}
+				else
+				{
+					if( m_pMean     )	m_pMean		->Set_NoData(x, y);
+					if( m_pDifMean  )	m_pDifMean	->Set_NoData(x, y);
+					if( m_pMin      )	m_pMin		->Set_NoData(x, y);
+					if( m_pMax      )	m_pMax		->Set_NoData(x, y);
+					if( m_pRange    )	m_pRange	->Set_NoData(x, y);
+					if( m_pVar      )	m_pVar		->Set_NoData(x, y);
+					if( m_pStdDev   )	m_pStdDev	->Set_NoData(x, y);
+					if( m_pStdDevLo )	m_pStdDevLo	->Set_NoData(x, y);
+					if( m_pStdDevHi )	m_pStdDevHi	->Set_NoData(x, y);
+					if( m_pDevMean  )	m_pDevMean	->Set_NoData(x, y);
+					if( m_pPercent  )	m_pPercent	->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( pPoints )
+	{
+		if( Parameters("POINTS_OUT")->asShapes() && Parameters("POINTS_OUT")->asShapes() != pPoints )
+		{
+			pPoints	= Parameters("POINTS_OUT")->asShapes();
+			pPoints->Create(*Parameters("POINTS")->asShapes());
+			pPoints->Set_Name(CSG_String::Format(SG_T("%s [a: %.2f, d: %.2f]"), _TL("Directional Statistics"), Direction * M_RAD_TO_DEG, Tolerance * M_RAD_TO_DEG));
+		}
+
+		int		x, y, id_Offset	= pPoints->Get_Field_Count();
+
+		pPoints->Add_Field(_TL("MEAN")			, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("DIFF_MEAN")		, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("MIN")			, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("MAX")			, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("RANGE")			, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("VARIANCE")		, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("STDDEV")		, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("STDDEV_LO")		, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("STDDEV_HI")		, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("STDDEV_MEAN")	, SG_DATATYPE_Double);
+		pPoints->Add_Field(_TL("PERCENTILE")	, SG_DATATYPE_Double);
+
+		for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+		{
+			CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
+
+			if( Get_System()->Get_World_to_Grid(x, y, pPoint->Get_Point(0)) && Get_Statistics(x, y, s) )
+			{
+				for(int i=0; i<id_Count; i++)
+				{
+					pPoint->Set_Value(id_Offset + i, s[i]);
+				}
+			}
+			else
+			{
+				for(int i=0; i<id_Count; i++)
+				{
+					pPoint->Set_NoData(id_Offset + i);
+				}
+			}
+		}
+
+		DataObject_Update(pPoints);
+	}
+
+	//-----------------------------------------------------
+	m_Cells.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Directional_Statistics::Get_Statistics(int x, int y, double *s)
+{
+	if( m_pGrid->is_InGrid(x, y) )
+	{
+		int		i, ix, iy, nLower;
+		double	z, iz, id, iw;
+
+		CSG_Simple_Statistics	Statistics;
+
+		for(i=0, nLower=0, z=m_pGrid->asDouble(x, y); i<m_Cells.Get_Count(); i++)
+		{
+			if( m_Cells.Get_Values(i, ix = x, iy = y, id, iw, true) && id > 0.0 && m_pGrid->is_InGrid(ix, iy) )
+			{
+				Statistics.Add_Value(iz = m_pGrid->asDouble(ix, iy), iw);
+
+				if( z > iz )
+				{
+					nLower++;
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		if( Statistics.Get_Weights() > 0.0 )
+		{
+			s[id_Mean    ]	= Statistics.Get_Mean();
+			s[id_DifMean ]	= m_pGrid->asDouble(x, y) - Statistics.Get_Mean();
+			s[id_Min     ]	= Statistics.Get_Minimum();
+			s[id_Max     ]	= Statistics.Get_Maximum();
+			s[id_Range   ]	= Statistics.Get_Range();
+			s[id_Var     ]	= Statistics.Get_Variance();
+			s[id_StdDev  ]	= Statistics.Get_StdDev();
+			s[id_StdDevLo]	= Statistics.Get_Mean() - Statistics.Get_StdDev();
+			s[id_StdDevHi]	= Statistics.Get_Mean() + Statistics.Get_StdDev();
+			s[id_DevMean ]	= Statistics.Get_StdDev() > 0.0 ? ((z - Statistics.Get_Mean()) / Statistics.Get_StdDev()) : 0.0;
+			s[id_Percent ]	= 100.0 * nLower / (double)Statistics.Get_Count();
+
+			return( true );
+		}
+	}
+
+	//-----------------------------------------------------
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Directional_Statistics.h b/src/modules/statistics/statistics_grid/GSGrid_Directional_Statistics.h
new file mode 100644
index 0000000..1e0bc23
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Directional_Statistics.h
@@ -0,0 +1,113 @@
+/**********************************************************
+ * Version $Id: GSGrid_Directional_Statistics.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//            GSGrid_Directional_Statistics.h            //
+//                                                       //
+//                 Copyright (C) 2003 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__GSGrid_Directional_Statistics_H
+#define HEADER_INCLUDED__GSGrid_Directional_Statistics_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSGrid_Directional_Statistics : public CSG_Module_Grid
+{
+public:
+	CGSGrid_Directional_Statistics(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	CSG_Grid_Cell_Addressor	m_Cells;
+
+	CSG_Grid				*m_pGrid, *m_pMean, *m_pDifMean, *m_pMin, *m_pMax, *m_pRange, *m_pVar, *m_pStdDev, *m_pStdDevLo, *m_pStdDevHi, *m_pDevMean, *m_pPercent;
+
+
+	bool					Get_Statistics		(int x, int y, double *s);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSGrid_Directional_Statistics_H
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Residuals.cpp b/src/modules/statistics/statistics_grid/GSGrid_Residuals.cpp
new file mode 100644
index 0000000..dcccef0
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Residuals.cpp
@@ -0,0 +1,238 @@
+/**********************************************************
+ * Version $Id: GSGrid_Residuals.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  GSGrid_Residuals.cpp                 //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "GSGrid_Residuals.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Residuals::CGSGrid_Residuals(void)
+{
+	//-----------------------------------------------------
+	// 1. Info...
+
+	Set_Name		(_TL("Residual Analysis (Grid)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2003"));
+
+	Set_Description	(_TW("Relations of each grid cell to its neighborhood. "
+		"Wilson & Gallant (2000) used this type of calculation in terrain analysis.\n"
+		"\n"
+		"Reference:\n"
+		"- Wilson, J.P., Gallant, J.C., [Eds.] (2000): "
+		"'Terrain analysis - principles and applications', "
+		"New York, John Wiley & Sons, Inc.\n"
+	));
+
+
+	//-----------------------------------------------------
+	// 2. Parameters...
+
+	Parameters.Add_Grid(	NULL, "GRID"	, _TL("Grid")						, _TL(""), PARAMETER_INPUT);
+
+	Parameters.Add_Grid(	NULL, "MEAN"	, _TL("Mean Value")					, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "DIFF"	, _TL("Difference from Mean Value")	, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "STDDEV"	, _TL("Standard Deviation")			, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "RANGE"	, _TL("Value Range")				, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "MIN"		, _TL("Minimum Value")				, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "MAX"		, _TL("Maximum Value")				, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "DEVMEAN"	, _TL("Deviation from Mean Value")	, _TL(""), PARAMETER_OUTPUT);
+	Parameters.Add_Grid(	NULL, "PERCENT"	, _TL("Percentile")					, _TL(""), PARAMETER_OUTPUT);
+
+	Parameters.Add_Value(	NULL, "RADIUS"	, _TL("Radius (Cells)")				, _TL(""), PARAMETER_TYPE_Int, 7, 1, true);
+
+	Parameters.Add_Value(	NULL, "BCENTER"	, _TL("Include Center Cell")		, _TL(""), PARAMETER_TYPE_Bool, true);
+
+	Parameters.Add_Parameters(
+		NULL, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Residuals::On_Execute(void)
+{
+	m_pGrid		= Parameters("GRID")	->asGrid();
+
+	m_pMean		= Parameters("MEAN")	->asGrid();
+	m_pDiff		= Parameters("DIFF")	->asGrid();
+	m_pStdDev	= Parameters("STDDEV")	->asGrid();
+	m_pRange	= Parameters("RANGE")	->asGrid();
+	m_pMin		= Parameters("MIN")		->asGrid();
+	m_pMax		= Parameters("MAX")		->asGrid();
+	m_pDevMean	= Parameters("DEVMEAN")	->asGrid();
+	m_pPercent	= Parameters("PERCENT")	->asGrid();
+
+	DataObject_Set_Colors(m_pDiff	, 100, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pStdDev	, 100, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pRange	, 100, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pMin	, 100, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pMax	, 100, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pDevMean, 100, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pPercent, 100, SG_COLORS_RED_GREY_BLUE, true);
+
+	//-----------------------------------------------------
+	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	if( !m_Cells.Set_Radius(Parameters("RADIUS")->asInt()) )
+	{
+		return( false );
+	}
+
+	bool	bCenter	= Parameters("BCENTER")->asBool();
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			Get_Statistics(x, y, bCenter);
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Cells.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Residuals::Get_Statistics(int x, int y, bool bCenter)
+{
+	if( m_pGrid->is_InGrid(x, y) )
+	{
+		int		i, ix, iy, nLower;
+		double	z, iz, id, iw;
+
+		CSG_Simple_Statistics	Statistics;
+
+		for(i=0, nLower=0, z=m_pGrid->asDouble(x, y); i<m_Cells.Get_Count(); i++)
+		{
+			if( m_Cells.Get_Values(i, ix = x, iy = y, id, iw, true) && (bCenter || id > 0.0) && m_pGrid->is_InGrid(ix, iy) )
+			{
+				Statistics.Add_Value(iz = m_pGrid->asDouble(ix, iy), iw);
+
+				if( z > iz )
+				{
+					nLower++;
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		if( Statistics.Get_Weights() > 0.0 )
+		{
+			m_pMean		->Set_Value(x, y, Statistics.Get_Mean());
+			m_pDiff		->Set_Value(x, y, z - Statistics.Get_Mean());
+			m_pStdDev	->Set_Value(x, y, Statistics.Get_StdDev());
+			m_pRange	->Set_Value(x, y, Statistics.Get_Range());
+			m_pMin		->Set_Value(x, y, Statistics.Get_Minimum());
+			m_pMax		->Set_Value(x, y, Statistics.Get_Maximum());
+			m_pDevMean	->Set_Value(x, y, Statistics.Get_StdDev() > 0.0 ? ((z - Statistics.Get_Mean()) / Statistics.Get_StdDev()) : 0.0);
+			m_pPercent	->Set_Value(x, y, 100.0 * nLower / (double)Statistics.Get_Count());
+
+			return( true );
+		}
+	}
+
+	//-----------------------------------------------------
+	m_pMean		->Set_NoData(x, y);
+	m_pDiff		->Set_NoData(x, y);
+	m_pStdDev	->Set_NoData(x, y);
+	m_pRange	->Set_NoData(x, y);
+	m_pMin		->Set_NoData(x, y);
+	m_pMax		->Set_NoData(x, y);
+	m_pDevMean	->Set_NoData(x, y);
+	m_pPercent	->Set_NoData(x, y);
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Residuals.h b/src/modules/statistics/statistics_grid/GSGrid_Residuals.h
new file mode 100644
index 0000000..84da909
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Residuals.h
@@ -0,0 +1,115 @@
+/**********************************************************
+ * Version $Id: GSGrid_Residuals.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  GSGrid_Residuals.h                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GSGrid_Residuals_H
+#define HEADER_INCLUDED__GSGrid_Residuals_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSGrid_Residuals : public CSG_Module_Grid
+{
+public:
+	CGSGrid_Residuals(void);
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	CSG_Grid_Cell_Addressor	m_Cells;
+
+	CSG_Grid				*m_pGrid, *m_pMean, *m_pDiff, *m_pStdDev, *m_pRange, *m_pMin, *m_pMax, *m_pDevMean, *m_pPercent;
+
+
+	bool					Get_Statistics	(int x, int y, bool bCenter);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSGrid_Residuals_H
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Statistics.cpp b/src/modules/statistics/statistics_grid/GSGrid_Statistics.cpp
new file mode 100644
index 0000000..4eea189
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Statistics.cpp
@@ -0,0 +1,390 @@
+/**********************************************************
+ * Version $Id: GSGrid_Statistics.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 GSGrid_Statistics.cpp                 //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "GSGrid_Statistics.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Statistics::CGSGrid_Statistics(void)
+{
+	Set_Name		(_TL("Statistics for Grids"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2005"));
+
+	Set_Description	(_TW(
+		"Calculates statistical properties (arithmetic mean, minimum, maximum, "
+		"variance, standard deviation) for each cell position for the values of "
+		"the selected grids."
+	));
+
+
+	Parameters.Add_Grid_List(
+		NULL, "GRIDS"	, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(NULL, "MEAN"	, _TL("Arithmetic Mean")             , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "MIN"		, _TL("Minimum")                     , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "MAX"		, _TL("Maximum")                     , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "RANGE"	, _TL("Range")                       , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "SUM"		, _TL("Sum")                         , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "VAR"		, _TL("Variance")                    , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "STDDEV"	, _TL("Standard Deviation")          , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "STDDEVLO", _TL("Mean less Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "STDDEVHI", _TL("Mean plus Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+	Parameters.Add_Grid(NULL, "PCTL"	, _TL("Percentile")                  , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
+
+	Parameters.Add_Value(
+		NULL, "PCTL_VAL", _TL("Percentile"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGSGrid_Statistics::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PCTL")) )
+	{
+		pParameters->Get_Parameter("PCTL_VAL")->Set_Enabled(pParameter->asGrid() != NULL);
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Statistics::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
+
+	if( pGrids->Get_Count() <= 1 )
+	{
+		Error_Set(_TL("no grids in selection"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Grid	*pMean			= Parameters("MEAN"    )->asGrid();
+	CSG_Grid	*pMin			= Parameters("MIN"     )->asGrid();
+	CSG_Grid	*pMax			= Parameters("MAX"     )->asGrid();
+	CSG_Grid	*pRange			= Parameters("RANGE"   )->asGrid();
+	CSG_Grid	*pSum			= Parameters("SUM"     )->asGrid();
+	CSG_Grid	*pVar			= Parameters("VAR"     )->asGrid();
+	CSG_Grid	*pStdDev		= Parameters("STDDEV"  )->asGrid();
+	CSG_Grid	*pStdDevLo		= Parameters("STDDEVLO")->asGrid();
+	CSG_Grid	*pStdDevHi		= Parameters("STDDEVHI")->asGrid();
+	CSG_Grid	*pPercentile	= Parameters("PCTL"    )->asGrid();
+
+	if( !pMean && !pMin && !pMax && !pRange && !pSum && !pVar && !pStdDev && !pStdDevLo && !pStdDevHi && !pPercentile )
+	{
+		Error_Set(_TL("no parameter output specified"));
+
+		return( false );
+	}
+
+	double	dRank	= Parameters("PCTL_VAL")->asDouble() / 100.0;
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			CSG_Table				Values;
+			CSG_Simple_Statistics	s;
+
+			for(int i=0; i<pGrids->Get_Count(); i++)
+			{
+				if( !pGrids->asGrid(i)->is_NoData(x, y) )
+				{
+					double	z	= pGrids->asGrid(i)->asDouble(x, y);
+
+					s.Add_Value(z);
+
+					if( pPercentile )
+					{
+						if( Values.Get_Field_Count() == 0 )
+						{
+							Values.Add_Field("Z", SG_DATATYPE_Double);
+						}
+
+						Values.Add_Record()->Set_Value(0, z);
+					}
+				}
+			}
+
+			//-----------------------------------------
+			if( s.Get_Count() <= 0 )
+			{
+				if( pMean       )	pMean		->Set_NoData(x, y);
+				if( pMin        )	pMin		->Set_NoData(x, y);
+				if( pMax        )	pMax		->Set_NoData(x, y);
+				if( pRange      )	pRange		->Set_NoData(x, y);
+				if( pSum        )	pSum		->Set_NoData(x, y);
+				if( pVar        )	pVar		->Set_NoData(x, y);
+				if( pStdDev     )	pStdDev		->Set_NoData(x, y);
+				if( pStdDevLo   )	pStdDevLo	->Set_NoData(x, y);
+				if( pStdDevHi   )	pStdDevHi	->Set_NoData(x, y);
+				if( pPercentile )	pPercentile	->Set_NoData(x, y);
+			}
+			else
+			{
+				if( pMean       )	pMean		->Set_Value(x, y, s.Get_Mean());
+				if( pMin        )	pMin		->Set_Value(x, y, s.Get_Minimum());
+				if( pMax        )	pMax		->Set_Value(x, y, s.Get_Maximum());
+				if( pRange      )	pRange		->Set_Value(x, y, s.Get_Range());
+				if( pSum        )	pSum		->Set_Value(x, y, s.Get_Sum());
+				if( pVar        )	pVar		->Set_Value(x, y, s.Get_Variance());
+				if( pStdDev     )	pStdDev		->Set_Value(x, y, s.Get_StdDev());
+				if( pStdDevLo   )	pStdDevLo	->Set_Value(x, y, s.Get_Mean() - s.Get_StdDev());
+				if( pStdDevHi   )	pStdDevHi	->Set_Value(x, y, s.Get_Mean() + s.Get_StdDev());
+				if( pPercentile )
+				{
+					Values.Set_Index(0, TABLE_INDEX_Ascending);
+
+					pPercentile->Set_Value(x, y, Values.Get_Record_byIndex((int)(dRank * s.Get_Count()))->asDouble(0));
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Statistics_To_Table::CGSGrid_Statistics_To_Table(void)
+{
+	Set_Name		(_TL("Save Grid Statistics to Table"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"Calculates statistical properties (arithmetic mean, minimum, maximum, "
+		"variance, standard deviation) for each of the given grids and saves "
+		"it to a table."
+	));
+
+
+	Parameters.Add_Grid_List(
+		NULL, "GRIDS"	, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL, "STATS"	, _TL("Statistics for Grids"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(NULL, "DATA_CELLS"  , _TL("Number of Data Cells")        , _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(NULL, "NODATA_CELLS", _TL("Number of No-Data Cells")     , _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(NULL, "CELLSIZE"    , _TL("Cellsize")                    , _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(NULL, "MEAN"        , _TL("Arithmetic Mean")             , _TL(""), PARAMETER_TYPE_Bool, true);
+	Parameters.Add_Value(NULL, "MIN"         , _TL("Minimum")                     , _TL(""), PARAMETER_TYPE_Bool, true);
+	Parameters.Add_Value(NULL, "MAX"         , _TL("Maximum")                     , _TL(""), PARAMETER_TYPE_Bool, true);
+	Parameters.Add_Value(NULL, "RANGE"       , _TL("Range")                       , _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(NULL, "VAR"         , _TL("Variance")                    , _TL(""), PARAMETER_TYPE_Bool, true);
+	Parameters.Add_Value(NULL, "STDDEV"      , _TL("Standard Deviation")          , _TL(""), PARAMETER_TYPE_Bool, true);
+	Parameters.Add_Value(NULL, "STDDEVLO"    , _TL("Mean less Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(NULL, "STDDEVHI"    , _TL("Mean plus Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Value(NULL, "PCTL"        , _TL("Percentile")                  , _TL(""), PARAMETER_TYPE_Bool, false);
+
+	Parameters.Add_Value(
+		NULL, "PCTL_VAL", _TL("Percentile"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGSGrid_Statistics_To_Table::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PCTL")) )
+	{
+		pParameters->Get_Parameter("PCTL_VAL")->Set_Enabled(pParameter->asBool());
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Statistics_To_Table::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
+
+	if( pGrids->Get_Count() < 1 )
+	{
+		Error_Set(_TL("no grids in selection"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Table	*pTable	= Parameters("STATS")->asTable();
+
+	pTable->Destroy();
+	pTable->Set_Name(_TL("Statistics for Grids"));
+	pTable->Add_Field(_TL("NAME"), SG_DATATYPE_String);
+
+	if( Parameters("DATA_CELLS"  )->asBool() )	pTable->Add_Field(_TL("DATA_CELLS"  ), SG_DATATYPE_Int);
+	if( Parameters("NODATA_CELLS")->asBool() )	pTable->Add_Field(_TL("NODATA_CELLS"), SG_DATATYPE_Int);
+	if( Parameters("CELLSIZE"    )->asBool() )	pTable->Add_Field(_TL("CELLSIZE"    ), SG_DATATYPE_Double);
+	if( Parameters("MEAN"        )->asBool() )	pTable->Add_Field(_TL("MEAN"        ), SG_DATATYPE_Double);
+	if( Parameters("MIN"         )->asBool() )	pTable->Add_Field(_TL("MIN"         ), SG_DATATYPE_Double);
+	if( Parameters("MAX"         )->asBool() )	pTable->Add_Field(_TL("MAX"         ), SG_DATATYPE_Double);
+	if( Parameters("RANGE"       )->asBool() )	pTable->Add_Field(_TL("RANGE"       ), SG_DATATYPE_Double);
+	if( Parameters("VAR"         )->asBool() )	pTable->Add_Field(_TL("VAR"         ), SG_DATATYPE_Double);
+	if( Parameters("STDDEV"      )->asBool() )	pTable->Add_Field(_TL("STDDEV"      ), SG_DATATYPE_Double);
+	if( Parameters("STDDEVLO"    )->asBool() )	pTable->Add_Field(_TL("STDDEVLO"    ), SG_DATATYPE_Double);
+	if( Parameters("STDDEVHI"    )->asBool() )	pTable->Add_Field(_TL("STDDEVHI"    ), SG_DATATYPE_Double);
+	if( Parameters("PCTL"        )->asBool() )	pTable->Add_Field(_TL("PCTL"        ), SG_DATATYPE_Double);
+
+	if( pTable->Get_Field_Count() <= 1 )
+	{
+		Error_Set(_TL("no parameter output specified"));
+
+		return( false );
+	}
+
+	double	dRank	= Parameters("PCTL")->asBool() ? Parameters("PCTL_VAL")->asDouble() : -1.0;
+
+	//-----------------------------------------------------
+	for(int i=0; i<pGrids->Get_Count() && Process_Get_Okay(); i++)
+	{
+		CSG_Grid			*pGrid		= pGrids->asGrid(i);
+		CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+		pRecord->Set_Value("NAME"        , pGrid->Get_Name());
+		pRecord->Set_Value("DATA_CELLS"  , pGrid->Get_NCells() - pGrid->Get_NoData_Count());
+		pRecord->Set_Value("NODATA_CELLS", pGrid->Get_NoData_Count());
+		pRecord->Set_Value("CELLSIZE"    , pGrid->Get_Cellsize());
+		pRecord->Set_Value("MEAN"        , pGrid->Get_ArithMean());
+		pRecord->Set_Value("MIN"         , pGrid->Get_ZMin());
+		pRecord->Set_Value("MAX"         , pGrid->Get_ZMax());
+		pRecord->Set_Value("RANGE"       , pGrid->Get_ZRange());
+		pRecord->Set_Value("VAR"         , pGrid->Get_Variance());
+		pRecord->Set_Value("STDDEV"      , pGrid->Get_StdDev());
+		pRecord->Set_Value("STDDEVLO"    , pGrid->Get_ArithMean() - pGrid->Get_StdDev());
+		pRecord->Set_Value("STDDEVHI"    , pGrid->Get_ArithMean() + pGrid->Get_StdDev());
+
+		if( dRank > 0.0 && dRank < 100.0 )
+		{
+			pRecord->Set_Value("PCTL", pGrid->Get_Percentile(dRank));	// this is a time consuming operation
+		}
+	}
+
+	if( dRank > 0.0 && dRank < 100.0 )
+	{
+		pTable->Set_Field_Name(pTable->Get_Field_Count() - 1, CSG_String::Format(SG_T("%s%02d"), _TL("PCTL"), (int)dRank));
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Statistics.h b/src/modules/statistics/statistics_grid/GSGrid_Statistics.h
new file mode 100644
index 0000000..98b6b45
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Statistics.h
@@ -0,0 +1,127 @@
+/**********************************************************
+ * Version $Id: GSGrid_Statistics.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  GSGrid_Statistics.h                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GSGrid_Statistics_H
+#define HEADER_INCLUDED__GSGrid_Statistics_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSGrid_Statistics : public CSG_Module_Grid  
+{
+public:
+	CGSGrid_Statistics(void);
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSGrid_Statistics_To_Table : public CSG_Module_Grid  
+{
+public:
+	CGSGrid_Statistics_To_Table(void);
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSGrid_Statistics_H
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Variance.cpp b/src/modules/statistics/statistics_grid/GSGrid_Variance.cpp
new file mode 100644
index 0000000..14db18e
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Variance.cpp
@@ -0,0 +1,347 @@
+/**********************************************************
+ * Version $Id: GSGrid_Variance.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  GSGrid_Variance.cpp                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "GSGrid_Variance.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Variance::CGSGrid_Variance(void)
+{
+	Set_Name		(_TL("Representativeness (Grid)"));
+
+	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"Representativeness - calculation of the variance within a given search radius.\n"
+		"\n"
+		"Reference:\n"
+		"- Boehner, J., Koethe, R., Trachinow, C. (1997): "
+		"'Weiterentwicklung der automatischen Reliefanalyse auf der Basis von Digitalen Gelaendemodellen', "
+		"Goettinger Geographische Abhandlungen, Vol.100, p.3-21\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "INPUT"	, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "RESULT"	, _TL("Representativeness"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RADIUS"	, _TL("Radius (Cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 10
+	);
+
+	Parameters.Add_Value(
+		NULL	, "EXPONENT", _TL("Exponent"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1
+	);
+}
+
+//---------------------------------------------------------
+CGSGrid_Variance::~CGSGrid_Variance(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Variance::On_Execute(void)
+{
+	int		x, y;
+
+	//-----------------------------------------------------
+	pInput		= Parameters("INPUT"	)->asGrid();
+	pOutput		= Parameters("RESULT"	)->asGrid();
+
+	maxRadius	= Parameters("RADIUS"	)->asInt();
+	Exponent	= Parameters("EXPONENT"	)->asDouble();
+
+	//-----------------------------------------------------
+	Initialize();
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			pOutput->Set_Value(x,y, Get_Laenge(x,y) );
+		}
+	}
+
+	//-----------------------------------------------------
+	Finalize();
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CGSGrid_Variance::Initialize(void)
+{
+	pOutput->Assign_NoData();
+
+	V		= (double *)malloc((maxRadius + 2) * sizeof(double));
+	Z		= (int    *)malloc((maxRadius + 2) * sizeof(int   ));
+
+	g		= (double *)malloc((maxRadius + 2) * sizeof(double));
+	m		= (double *)malloc((maxRadius + 2) * sizeof(double));
+
+	rLength	= (int    *)malloc((maxRadius + 2) * sizeof(int   ));
+
+	Init_Radius();
+}
+
+//---------------------------------------------------------
+void CGSGrid_Variance::Init_Radius(void)
+{
+	int		k, maxZ;
+
+	long	i, j, iijj, 
+			rr, r1r1, z;
+
+	maxZ		= z	= 0;
+	rLength[0]	= 0;
+
+	x_diff		= y_diff	= NULL;
+
+	for(k=1; k<=maxRadius; k++) 
+	{
+		rr		= k*k;
+		r1r1	= (k - 1) * (k - 1);
+
+		for(i=-k; i<=k; i++)
+		{
+			for(j=-k; j<=k; j++) 
+			{
+				iijj	= i*i + j*j;
+
+				if( iijj<=rr && iijj>r1r1 ) 
+				{
+					if( maxZ<=z )
+					{
+						maxZ	+= 1000;
+						x_diff	= (int *)realloc(x_diff,maxZ*sizeof(int));
+						y_diff	= (int *)realloc(y_diff,maxZ*sizeof(int));
+					}
+
+					x_diff[z]	= j;
+					y_diff[z]	= i;
+
+					z++;
+				}
+			}
+		}
+
+		rLength[k]	= z;
+	}
+}
+
+//---------------------------------------------------------
+void CGSGrid_Variance::Finalize(void)
+{
+	free(V);
+	free(Z);
+
+	free(rLength);
+	free(g);
+	free(m);
+
+	free(x_diff);
+	free(y_diff);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CGSGrid_Variance::Get_Laenge(int x, int y)
+{
+	int		iRadius, Count;
+
+	double	d;
+
+	//-----------------------------------------------------
+	V[0]	= Get_GSGrid_Variance(x,y,1,Count);
+	Z[0]	= Count;
+
+	for(iRadius=1; iRadius<maxRadius; iRadius++)
+	{
+		V[iRadius]	= V[iRadius-1] + Get_GSGrid_Variance(x, y, iRadius + 1, Count);
+		Z[iRadius]	= Z[iRadius-1] + Count;
+	}
+
+	for(iRadius=0; iRadius<maxRadius; iRadius++)
+	{
+		V[iRadius]	/= (double)Z[iRadius];
+	}
+
+	//-----------------------------------------------------
+	d		= Get_Steigung();
+
+	if( d == 0.0 )
+		return( Get_Cellsize() * maxRadius );
+	else
+		return( V[maxRadius-1] / d / 2.0 );
+}
+ 
+//---------------------------------------------------------
+double CGSGrid_Variance::Get_GSGrid_Variance(int x, int y, int iRadius, int &Count)
+{
+	int		i, ix, iy;
+
+	double	d, z, Variance;
+
+	Variance	= 0;
+	z			= pInput->asDouble(x,y);
+
+	for(i=rLength[iRadius-1], Count=0; i<rLength[iRadius]; i++, Count++)
+	{
+		ix	= x + x_diff[i];
+		if( ix < 0 )
+			ix	= 0;
+		else if( ix >= Get_NX() )
+			ix	= Get_NX() - 1;
+
+		iy	= y + y_diff[i];
+		if( iy < 0 )
+			iy	= 0;
+		else if( iy >= Get_NY() )
+			iy	= Get_NY() - 1;
+
+		d			= z - pInput->asDouble(ix,iy);
+		Variance	+= d * d;
+	}
+
+	return( Variance );
+}
+
+//---------------------------------------------------------
+double CGSGrid_Variance::Get_Steigung(void)
+{
+	int		i;
+
+	double	summe_mg, summe_g;
+
+	//-----------------------------------------------------
+	// Steigungen berechnen...
+	m[0]		= V[0] / Get_Cellsize();
+
+	for(i=1; i<maxRadius; i++)
+		m[i]	= (V[i] - V[i-1]) / Get_Cellsize();
+
+	//-----------------------------------------------------
+	// Gewichte berechnen (inverse distance)...
+	for(i=0; i<maxRadius; i++)
+		g[i]	= pow(Get_Cellsize() * (i + 1), -Exponent);
+
+	//-----------------------------------------------------
+	// Berechne Summe der gewichteten Steigungen und Summe der Gewichte...
+	summe_mg	= 0;
+	summe_g		= 0;
+
+	for(i=0; i<maxRadius; i++)
+	{
+		summe_mg	+= m[i] * g[i];
+		summe_g		+= g[i];
+	}
+
+	return( summe_mg / summe_g );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Variance.h b/src/modules/statistics/statistics_grid/GSGrid_Variance.h
new file mode 100644
index 0000000..b3be539
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Variance.h
@@ -0,0 +1,127 @@
+/**********************************************************
+ * Version $Id: GSGrid_Variance.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   GSGrid_Variance.h                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GSGrid_Variance_H
+#define HEADER_INCLUDED__GSGrid_Variance_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSGrid_Variance : public CSG_Module_Grid
+{
+public:
+	CGSGrid_Variance(void);
+	virtual ~CGSGrid_Variance(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	int						maxRadius,
+							*Z, *x_diff, *y_diff, *rLength;
+
+	double					Exponent,	// Exponent fuer "inverse distance" Gewichte (calc_Steigung).
+							*V, *m, *g;
+
+	CSG_Grid				*pInput, *pOutput, *pRadius;
+
+
+	void					Initialize			(void);
+	void					Finalize			(void);
+
+	void					Init_Radius			(void);
+
+	double					Get_Laenge			(int x, int y);
+	double					Get_GSGrid_Variance	(int x, int y, int iRadius, int &Count);
+	double					Get_Steigung		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSGrid_Variance_H
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Variance_Radius.cpp b/src/modules/statistics/statistics_grid/GSGrid_Variance_Radius.cpp
new file mode 100644
index 0000000..f1dccf5
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Variance_Radius.cpp
@@ -0,0 +1,343 @@
+/**********************************************************
+ * Version $Id: GSGrid_Variance_Radius.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               GSGrid_Variance_Radius.cpp              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "GSGrid_Variance_Radius.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Variance_Radius::CGSGrid_Variance_Radius(void)
+{
+	Set_Name		(_TL("Radius of Variance (Grid)"));
+
+	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"Find the radius within which the cell values exceed the given variance criterium. "
+		"This module is closely related to the representativeness calculation "
+		"(variance within given search radius). "
+		"For easier usage, the variance criterium is entered as standard deviation value. "
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "INPUT"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "RESULT"		, _TL("Variance Radius"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "VARIANCE"	, _TL("Standard Deviation"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 1.0
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RADIUS"		, _TL("Maximum Search Radius (cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int		, 20
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "OUTPUT"		, _TL("Type of Output"),
+		_TL(""),
+
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Cells"),
+			_TL("Map Units")
+		), 0
+	);
+
+	//-----------------------------------------------------
+	pInput		= NULL;
+	pInputQ		= NULL;
+	Check		= NULL;
+	maxRadius	= 0;
+}
+
+//---------------------------------------------------------
+CGSGrid_Variance_Radius::~CGSGrid_Variance_Radius(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Variance_Radius::On_Execute(void)
+{
+	int		x, y;
+
+	//-----------------------------------------------------
+	stopVariance	= M_SQR(Parameters("VARIANCE")->asDouble());
+	maxRadius		= Parameters("RADIUS")	->asInt();
+	bWriteGridsize	= Parameters("OUTPUT")	->asInt() == 0;
+
+	pGrid			= Parameters("INPUT")	->asGrid();
+	pResult			= Parameters("RESULT")	->asGrid();
+	pResult->Set_Name(CSG_String::Format(SG_T("%s >= %f"), _TL("Radius with Variance"), stopVariance));
+
+	//-----------------------------------------------------
+	Initialize();
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			pResult->Set_Value(x, y, Get_Radius(x, y));
+		}
+	}
+
+	Finalize();
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CGSGrid_Variance_Radius::Initialize(void)
+{
+	int		x, y;
+	double	d;
+
+	//-----------------------------------------------------
+	pInput	= SG_Create_Grid(pGrid);
+	pInputQ	= SG_Create_Grid(pGrid);
+
+	for(y=0; y<Get_NY(); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			d	= pGrid->asDouble(x,y);
+			pInput	->Set_Value(x, y, d  );
+			pInputQ	->Set_Value(x, y, d*d);
+		}
+	}
+
+	//-----------------------------------------------------
+	// Radius Check-Matrix erstellen...
+	Check	= (int **)malloc((maxRadius + 1) * sizeof(int *));
+
+	for(y=0; y<=maxRadius; y++)
+	{
+		Check[y]	= (int *)malloc((maxRadius + 1) * sizeof(int));
+
+		for(x=0; x<=maxRadius; x++)
+		{
+		//	Check[y][x]	= (int)sqrt(x*x + y*y);
+			Check[y][x]	= (int)sqrt((x + 0.5) * (x + 0.5) + (y + 0.5) * (y + 0.5));
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CGSGrid_Variance_Radius::Finalize(void)
+{
+	if( pInput )
+	{
+		delete(pInput);
+		pInput		= NULL;
+	}
+
+	if( pInputQ )
+	{
+		delete(pInputQ);
+		pInputQ		= NULL;
+	}
+
+	if( Check )
+	{
+		for(int y=0; y<=maxRadius; y++)
+		{
+			free(Check[y]);
+		}
+		free(Check);
+		Check		= NULL;
+		maxRadius	= 0;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CGSGrid_Variance_Radius::Get_Radius(int xPoint, int yPoint)
+{
+	const double	sqrt2	= 1.0 / sqrt(2.0);
+
+	int		x, y, dx, dy, sRadius,
+			Radius		= 0,
+			nValues		= 0;
+
+	double	ArithMean, Variance,
+			Sum			= 0.0,
+			SumQ		= 0.0;
+
+	do
+	{
+		sRadius	= (int)(sqrt2 * (double)Radius - 4.0);
+		if( sRadius < 0 ) sRadius	= 0;
+
+		//-------------------------------------------------
+		for(dy=sRadius; dy<=Radius; dy++)
+		{
+			for(dx=sRadius; dx<=Radius; dx++)
+			{
+				if(Check[dy][dx] == Radius)
+				{
+					y	= yPoint - dy;
+
+					if(y>=0)
+					{
+						x	= xPoint - dx;
+						if(x>=0)
+						{
+							Sum			+= pInput->asDouble(x,y);
+							SumQ		+= pInputQ->asDouble(x,y);
+							nValues++;
+						}
+
+						x	= xPoint + dx;
+						if(x<Get_NX())
+						{
+							Sum			+= pInput->asDouble(x,y);
+							SumQ		+= pInputQ->asDouble(x,y);
+							nValues++;
+						}
+					}
+
+					y	= yPoint + dy;
+					if(y<Get_NY())
+					{
+						x	= xPoint - dx;
+						if(x>=0)
+						{
+							Sum			+= pInput->asDouble(x,y);
+							SumQ		+= pInputQ->asDouble(x,y);
+							nValues++;
+						}
+
+						x	= xPoint + dx;
+						if(x<Get_NX())
+						{
+							Sum			+= pInput->asDouble(x,y);
+							SumQ		+= pInputQ->asDouble(x,y);
+							nValues++;
+						}
+					}
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		if(nValues)
+		{
+			ArithMean	= Sum  / nValues;
+			Variance	= SumQ / nValues - ArithMean * ArithMean;
+
+			// Andre, das ist die Formel aus deinem Buch...
+			// Variance	= (SumQ - nValues * ArithMean * ArithMean) / nValues;
+		}
+		else
+			Variance	= 0;
+
+		Radius++;
+	}
+	while(Variance < stopVariance && Radius <= maxRadius);
+
+	return( bWriteGridsize ? Radius : Radius * Get_Cellsize() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Variance_Radius.h b/src/modules/statistics/statistics_grid/GSGrid_Variance_Radius.h
new file mode 100644
index 0000000..1348c61
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Variance_Radius.h
@@ -0,0 +1,123 @@
+/**********************************************************
+ * Version $Id: GSGrid_Variance_Radius.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                GSGrid_Variance_Radius.h               //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GSGrid_Variance_Radius_H
+#define HEADER_INCLUDED__GSGrid_Variance_Radius_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSGrid_Variance_Radius : public CSG_Module_Grid
+{
+public:
+	CGSGrid_Variance_Radius(void);
+	virtual ~CGSGrid_Variance_Radius(void);
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	bool					bWriteGridsize;
+
+	int						**Check, maxRadius;
+
+	double					stopVariance;
+
+	CSG_Grid				*pGrid, *pResult, *pInput, *pInputQ;
+
+
+	void					Initialize		(void);
+	void					Finalize		(void);
+
+	double					Get_Radius		(int xPoint, int yPoint);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSGrid_Variance_Radius_H
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Zonal_Statistics.cpp b/src/modules/statistics/statistics_grid/GSGrid_Zonal_Statistics.cpp
new file mode 100644
index 0000000..83e861d
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Zonal_Statistics.cpp
@@ -0,0 +1,581 @@
+/**********************************************************
+ * Version $Id: GSGrid_Zonal_Statistics.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSGrid_Zonal_Statistics.cpp              //
+//                                                       //
+//                Copyright (C) 2005-9 by                //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     reklovw at web.de                         //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "GSGrid_Zonal_Statistics.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Construction/Destruction				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSGrid_Zonal_Statistics::CGSGrid_Zonal_Statistics(void)
+{
+	//-----------------------------------------------------
+	// Place information about your module here...
+
+	Set_Name		(_TL("{STATZONAL_NAME} Zonal Grid Statistics"));
+
+	Set_Author		(_TL("Copyrights (c) 2005 by Volker Wichmann"));
+
+	Set_Description	(_TW("{STATZONAL_DESC} "
+		"The module calculates zonal statistics and reports these in a table. "
+		"The module can be used to create a contingency table of unique condition units (UCUs). These "
+		"units are delineated from a zonal grid (e.g. sub catchments) and optional categorical grids (e.g. "
+		"landcover, soil, ...). It is possible to calculate descriptive statistics (n, min, max, mean, standard "
+		"deviation and sum) for each UCU from optional grids with continious data (e.g. slope; aspect must be "
+		"handled specially, please use the \"Aspect\" input parameter for such a grid). The number "
+		"of input grids is only limited by available memory.\n\n"
+		"The module has four different modes of operation:\n"
+		"(1) only a zonal grid is used as input. This results in a simple contingency table with "
+		"the number of grid cells in each zone.\n"
+		"(2) a zonal grid and additional categorical grids are used as "
+		"input. This results in a contingency table with the number of cells in each UCU.\n"
+		"(3) a zonal grid "
+		"and additional grids with continuous data are used as input. This results in a contingency table "
+		"with the number of cells in each zone and some simple statistics for each zone. The statistics are "
+		"calculated for each continuous grid.\n"
+		"(4) a zonal grid, additional categorical grids and additional "
+		"grids with continuous data are used as input. This results in a contingency table with the number "
+		"of cells in each UCU and the corresponding statistics for each continuous grid.\n"
+		"\n"
+		"Depending on the mode of operation, the output table contains information about the categorical "
+		"combination of each UCU, the number of cells in each UCU and the statistics for each UCU. A "
+		"typical output table may look like this:\n"
+		"<table border=\"1\">"
+		"<tr><td>ID Zone</td><td>ID 1stCat</td><td>ID 2ndCat</td><td>Count UCU</td><td>N 1stCont</td><td>MIN 1stCont</td><td>MAX 1stCont</td><td>MEAN 1stCont</td><td>STDDEV 1stCont</td><td>SUM 1stCont</td></tr>"
+		"<tr><td>0      </td><td>2        </td><td>6        </td><td>6        </td><td>6        </td><td>708.5      </td><td>862.0      </td><td>734.5       </td><td>62.5          </td><td>4406.8     </td></tr>"
+		"<tr><td>0      </td><td>3        </td><td>4        </td><td>106      </td><td>106      </td><td>829.1      </td><td>910.1      </td><td>848.8       </td><td>28.5          </td><td>89969.0    </td></tr>"
+		"</table>"
+	));
+
+
+	Parameters.Add_Grid(
+		NULL, "ZONES"		, _TL("Zone Grid"),
+		_TL("Grid defining the zones to analyse. This grid also acts as a mask. Coding: NoData / categorial values."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL, "CATLIST"		, _TL("Categorical Grids"),
+		_TL("Grids used to delineate the UCUs. Coding: NoData / categorical values."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid_List(
+		NULL, "STATLIST"	, _TL("Grids to analyse"),
+		_TL("Grids with continuous data, statistics are calculated for each grid. Coding: NoData / continuous values."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "ASPECT"		, _TL("Aspect"),
+		_TL("Aspect grid, in radians."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL, "OUTTAB"		, _TL("Zonal Statistics"),
+		_TL("Summary table."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "SHORTNAMES"	, _TL("Short Field Names"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+//---------------------------------------------------------
+CGSGrid_Zonal_Statistics::~CGSGrid_Zonal_Statistics(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSGrid_Zonal_Statistics::On_Execute(void)
+{
+	bool					bShortNames;
+	int						x, y, nCatGrids, nStatGrids, iGrid, zoneID, catID, NDcount, catLevel, NDcountStat;
+	double					statID;
+
+	CSG_Grid				*pZones, *pGrid, *pAspect;
+	CSG_Parameter_Grid_List	*pCatList;
+	CSG_Parameter_Grid_List	*pStatList;
+
+	CList_Conti				*newZone, *startList, *runList, *newSub, *parent, *runSub, *subList;
+	CList_Stat				*runStats;
+	CSG_Table				*pOutTab;
+	CSG_Table_Record		*pRecord;
+	CSG_String				fieldName, tmpName;
+
+
+	pZones		= Parameters("ZONES")		->asGrid();
+	pCatList	= Parameters("CATLIST")		->asGridList();
+	pStatList	= Parameters("STATLIST")	->asGridList();
+	pAspect		= Parameters("ASPECT")		->asGrid();
+	pOutTab		= Parameters("OUTTAB")		->asTable();
+	bShortNames	= Parameters("SHORTNAMES")	->asBool();
+
+	nCatGrids	= pCatList	->Get_Count();
+	nStatGrids	= pStatList	->Get_Count();
+
+	NDcount		= 0;						// NoData Counter (ZoneGrid)
+	NDcountStat	= 0;						// NoData Counter (StatGrids)
+
+	CSG_String	sTabName = Parameters("OUTTAB")->asString();
+	if (pOutTab != NULL)
+	{
+		pOutTab->Destroy();
+		pOutTab->Set_Name(sTabName);
+	}
+
+	newZone		= new CList_Conti();								// create first list entry (dummy)
+	startList	= newZone;
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			runList		= startList;
+			zoneID		= pZones->asInt(x, y);								// get zone ID
+
+			while( runList->next != NULL && runList->cat < zoneID )			// search for last entry in list or insert point
+			{
+				runList = runList->next;
+			}
+
+			if( runList->dummy == true )
+			{
+				runList->cat = zoneID;										// first list entry, write and
+				runList->dummy = false;										// setup
+			}
+			else if( runList->cat == zoneID )
+				runList = runList;											// zoneID found
+			else if( runList->next == NULL && runList->cat < zoneID )		// append zoneID
+			{
+				newZone = new CList_Conti();
+				newZone->previous	= runList;
+				runList->next		= newZone;
+
+				newZone->cat	= zoneID;									// ... and write info
+				newZone->dummy	= false;
+				runList			= newZone;
+			}
+			else															// insert new entry
+			{
+				newZone = new CList_Conti();
+
+				newZone->next = runList;
+				if( runList->previous != NULL )
+				{
+					newZone->previous = runList->previous;
+					runList->previous->next = newZone;
+				}
+				runList->previous = newZone;
+
+				if( runList == startList )
+					startList = newZone;									// if new entry is first element, update startList pointer
+
+				newZone->cat	= zoneID;									// ... and write info
+				newZone->dummy	= false;
+				runList			= newZone;
+			}
+
+
+			for(iGrid=0; iGrid<nCatGrids; iGrid++)							// collect categories
+			{
+				parent  = runList;
+				if( runList->sub == NULL )									// no sub class found
+				{
+					newSub = new CList_Conti();
+					runList->sub = newSub;
+				}
+
+				runList = runList->sub;
+
+				pGrid	= pCatList->asGrid(iGrid);
+				if( !pGrid->is_NoData(x, y) )
+					catID	= pGrid->asInt(x, y);
+				else
+					catID	= (int)pGrid->Get_NoData_Value();
+
+
+				while( runList->next != NULL && runList->cat < catID )		// search for last entry in list or insert point
+				{
+					runList = runList->next;
+				}
+
+				if( runList->dummy == true )
+				{
+					runList->cat	= catID;								// first list entry, write and
+					runList->dummy	= false;								// setup
+					runList->parent	= parent;
+				}
+				else if( runList->cat == catID )
+					runList = runList;										// zoneID found, all infos already written
+				else if( runList->next == NULL && runList->cat < catID)		// append zoneID
+				{
+					newSub = new CList_Conti();
+					newSub->cat			= catID;							// ... and write info
+					newSub->previous	= runList;
+					newSub->parent		= parent;
+					newSub->dummy		= false;
+					runList->next		= newSub;
+					runList				= newSub;
+				}
+				else														// insert new entry
+				{
+					newSub = new CList_Conti();
+					newSub->cat		= catID;								// ... and write info
+					newSub->next	= runList;
+					newSub->parent	= parent;
+					newSub->dummy	= false;
+					if( runList->previous != NULL )
+					{
+						newSub->previous = runList->previous;
+						runList->previous->next = newSub;
+					}
+					else
+						parent->sub	 = newSub;
+
+					runList->previous = newSub;
+					runList	= newSub;
+				}
+			}
+
+
+			for(iGrid=0; iGrid<nStatGrids; iGrid++)							// collect statistics for StatGrids
+			{
+				if( iGrid == 0 )
+				{
+					if( runList->stats == NULL )
+						runList->stats = new CList_Stat();
+
+					runStats = runList->stats;
+				}
+				else
+				{
+					if( runStats->next == NULL )
+						runStats->next = new CList_Stat();
+
+					runStats = runStats->next;
+				}
+				if( !pStatList->asGrid(iGrid)->is_NoData(x, y) )
+				{
+					statID		= pStatList->asGrid(iGrid)->asDouble(x, y);
+
+					if( runStats->dummy == true )
+					{
+						runStats->min = statID;
+						runStats->max = statID;
+						runStats->dummy = false;
+					}
+					if( runStats->min > statID )
+						runStats->min = statID;
+					if( runStats->max < statID )
+						runStats->max = statID;
+
+					runStats->n	  += 1;
+					runStats->sum += statID;
+					runStats->dev += pow(statID, 2);
+				}
+				else
+					NDcountStat += 1;
+			}
+
+			if( pAspect != NULL )
+			{
+				for( int i=0; i<2; i++ )
+				{
+					if( nStatGrids == 0 && i == 0 )
+					{
+						if( runList->stats == NULL )
+							runList->stats = new CList_Stat();
+
+						runStats = runList->stats;
+					}
+					else
+					{
+						if( runStats->next == NULL )
+							runStats->next = new CList_Stat();
+
+						runStats = runStats->next;
+					}
+					if( !pAspect->is_NoData(x, y) )
+					{
+						statID	= pAspect->asDouble(x, y);
+
+						if( i == 0 )
+						{
+							if( runStats->dummy == true )
+							{
+								runStats->min = statID;
+								runStats->max = statID;
+								runStats->dummy = false;
+							}
+							if( runStats->min > statID )
+								runStats->min = statID;
+							if( runStats->max < statID )
+								runStats->max = statID;
+
+							statID	= sin(statID);
+						}
+						else
+							statID	= cos(statID);
+
+						runStats->n	  += 1;
+						runStats->sum += statID;
+					}
+					else
+						NDcountStat += 1;
+				}
+			}
+
+			runList->count += 1;											// sum up unique condition area
+		}
+	}
+
+
+	// Create fields in output table (1st = Zone, 2nd = Catgrid1, 3rd = Catgrid 2, ...)
+	fieldName = CSG_String::Format(SG_T("%s"),pZones->Get_Name()).BeforeFirst(SG_Char('.'));
+	if (bShortNames && fieldName.Length() > 10)
+		fieldName.Remove(10, fieldName.Length()-10);
+	pOutTab->Add_Field(fieldName, SG_DATATYPE_Int);
+
+	for(iGrid=0; iGrid<nCatGrids; iGrid++)
+	{
+		fieldName = CSG_String::Format(SG_T("%s"),pCatList->asGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.'));
+		if (bShortNames && fieldName.Length() > 10)
+			fieldName.Remove(10, fieldName.Length()-10);
+		pOutTab->Add_Field(fieldName, SG_DATATYPE_Int);
+	}
+
+	pOutTab->Add_Field("Count UCU", SG_DATATYPE_Int);
+
+	for( iGrid=0; iGrid<nStatGrids; iGrid++ )
+	{
+		tmpName		= CSG_String::Format(SG_T("%s"),pStatList->asGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.'));
+
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+1 > 10)
+			fieldName.Remove(9, fieldName.Length()-9);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sN")     , fieldName.c_str()), SG_DATATYPE_Int);
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+3 > 10)
+			fieldName.Remove(7, fieldName.Length()-7);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMIN")   , fieldName.c_str()), SG_DATATYPE_Double);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMAX")   , fieldName.c_str()), SG_DATATYPE_Double);
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+4 > 10)
+			fieldName.Remove(6, fieldName.Length()-6);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMEAN")  , fieldName.c_str()), SG_DATATYPE_Double);
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+6 > 10)
+			fieldName.Remove(4, fieldName.Length()-4);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sSTDDEV"), fieldName.c_str()), SG_DATATYPE_Double);
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+3 > 10)
+			fieldName.Remove(7, fieldName.Length()-7);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sSUM")   , fieldName.c_str()), SG_DATATYPE_Double);
+	}
+
+	if( pAspect != NULL )
+	{
+		tmpName		= CSG_String::Format(SG_T("%s"),pAspect->Get_Name()).BeforeFirst(SG_Char('.'));
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+1 > 10)
+			fieldName.Remove(9, fieldName.Length()-9);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sN")     , fieldName.c_str()), SG_DATATYPE_Int);
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+3 > 10)
+			fieldName.Remove(7, fieldName.Length()-7);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMIN")   , fieldName.c_str()), SG_DATATYPE_Double);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMAX")   , fieldName.c_str()), SG_DATATYPE_Double);
+		fieldName	= tmpName;
+		if (bShortNames && fieldName.Length()+4 > 10)
+			fieldName.Remove(6, fieldName.Length()-6);
+		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMEAN")  , fieldName.c_str()), SG_DATATYPE_Double);
+	}
+
+	int	iStatFields = 6;	// number of table fields: n, min, max, mean, stddev, sum
+
+	while( startList != NULL )												// scan zone layer list and write cat values in table
+	{
+		runList = startList;
+		while( runList->sub != NULL )										// fall down to lowest layer
+			runList = runList->sub;
+
+		subList = runList;													// use pointer to scan horizontal
+
+		while( subList != NULL )											// move forward and read all categories of this layer (including the parent layers)
+		{
+			runSub = subList;
+			catLevel = nCatGrids;
+			pRecord	= pOutTab->Add_Record();								// create new record in table
+			pRecord->Set_Value((catLevel+1), runSub->count);				// read/write field count
+
+			for(iGrid=0; iGrid<nStatGrids; iGrid++)							// read/write statistics
+			{
+				if( iGrid == 0 )
+					runStats = runSub->stats;
+				else
+					runStats = runStats->next;
+
+				pRecord->Set_Value(catLevel+2+iGrid*iStatFields, runStats->n);
+				pRecord->Set_Value(catLevel+3+iGrid*iStatFields, runStats->min);
+				pRecord->Set_Value(catLevel+4+iGrid*iStatFields, runStats->max);
+				pRecord->Set_Value(catLevel+5+iGrid*iStatFields, runStats->sum/runStats->n);
+				pRecord->Set_Value(catLevel+6+iGrid*iStatFields, sqrt((runStats->dev - runStats->n*pow(runStats->sum/runStats->n, 2)) / (runStats->n - 1))); // sample
+				//pRecord->Set_Value(catLevel+6+iGrid*iStatFields, sqrt((runStats->dev - pow(runStats->sum/runStats->n, 2)) / runStats->n)); // population
+				pRecord->Set_Value(catLevel+7+iGrid*iStatFields, runStats->sum);
+			}
+
+			if( pAspect != NULL )
+			{
+				iGrid		= nStatGrids * iStatFields;
+
+				int			n;
+				double		min, max, sumYcomp, sumXcomp, val, valYcomp, valXcomp;
+
+				if( nStatGrids == 0 )
+					runStats	= runSub->stats;
+				else
+					runStats	= runStats->next;
+				n			= runStats->n;
+				min			= runStats->min;
+				max			= runStats->max;
+				sumXcomp	= runStats->sum;
+
+				runStats	= runStats->next;
+				sumYcomp	= runStats->sum;
+
+				pRecord		->Set_Value(catLevel+2+iGrid, n);
+				pRecord		->Set_Value(catLevel+3+iGrid, min*M_RAD_TO_DEG);
+				pRecord		->Set_Value(catLevel+4+iGrid, max*M_RAD_TO_DEG);
+				valXcomp	= sumXcomp / n;
+				valYcomp	= sumYcomp / n;
+				val			= valXcomp ? fmod(M_PI_270 + atan2(valYcomp, valXcomp), M_PI_360) : (valYcomp > 0 ? M_PI_270 : (valYcomp < 0 ? M_PI_090 : -1));
+				val			= fmod(M_PI_360 - val, M_PI_360);
+				pRecord		->Set_Value(catLevel+5+iGrid, val*M_RAD_TO_DEG);
+			}
+
+			while( runSub != NULL )											// read/write categories
+			{
+				pRecord->Set_Value(catLevel, runSub->cat);
+				runSub = runSub->parent;
+				catLevel -= 1;
+			}
+			subList = subList->next;
+		}
+
+		while( runList->parent != NULL && runList->parent->next == NULL )	// move up to next 'Caterory with -> next'
+			runList = runList->parent;
+
+		if( runList->parent != NULL )										// if not upper layer (zones)
+		{
+			runList = runList->parent;										// move to parent of next 'Caterory with -> next'
+			if( runList->next != NULL && runList->parent != NULL )
+				runList->parent->sub = runList->next;						// redirect pointer to category which is next 'Categora with -> next' next
+			else if (runList->parent == NULL && runList->next != NULL )
+				startList = runList->next;									// when upper layer (zones) is reached, move to next zone
+			else
+				startList = NULL;											// reading finished
+
+			if( runList->parent == NULL )
+				startList = runList->next;									// ?? when upper layer is reached, move to next zone
+			else
+				runList->sub = runList->sub->next;							// on sub layers redirect pointer to ->next
+		}
+		else
+		{
+			if( nCatGrids == 0 )
+				startList = NULL;
+			else
+				startList = runList->next;									// ?? upper layer is reached, move to next zone
+		}
+
+
+		runList->next = NULL;
+		delete (runList);													// delete disconneted part of the list
+
+	}
+
+
+	if( NDcountStat > 0 )
+	{
+		Message_Add(CSG_String::Format(SG_T("\n\n\n%s: %d %s\n\n\n"), _TL("WARNING"), NDcountStat, _TL("NoData value(s) in statistic grid(s)!")));
+	}
+
+	return (true);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/GSGrid_Zonal_Statistics.h b/src/modules/statistics/statistics_grid/GSGrid_Zonal_Statistics.h
new file mode 100644
index 0000000..70fc151
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/GSGrid_Zonal_Statistics.h
@@ -0,0 +1,178 @@
+/**********************************************************
+ * Version $Id: GSGrid_Zonal_Statistics.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSGrid_Zonal_Statistics.h                //
+//                                                       //
+//                Copyright (C) 2005-9 by                //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     volkerwichmann at web.de                  //
+//                                                       //
+//    contact:    Volker Wichmann                        //
+//                Research Associate                     //
+//                Chair of Physical Geography		     //
+//				  KU Eichstaett-Ingolstadt				 //
+//                Ostenstr. 18                           //
+//                85072 Eichstaett                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GSGrid_Zonal_Statistics_H
+#define HEADER_INCLUDED__GSGrid_Zonal_Statistics_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CList_Stat
+{
+public:
+	CList_Stat(void)
+	{
+		n		= 0;
+		min		= max	= 0.0;
+		sum		= dev	= 0.0;
+		next	= NULL;
+		dummy	= true;
+	};
+
+	~CList_Stat(void)
+	{
+		if( next != NULL )
+			delete(next);
+		next	= NULL;
+	};
+
+	int					n;
+	double				min, max, sum, dev;
+	bool				dummy;
+
+	CList_Stat			*next;
+
+};
+
+//---------------------------------------------------------
+class CList_Conti
+{
+public:
+	CList_Conti(void)
+	{
+		cat			= 0;
+		count		= 0;
+		next		= NULL;
+		previous	= NULL;
+		parent		= NULL;
+		sub			= NULL;
+		stats		= NULL;
+		dummy		= true;
+	};
+
+	~CList_Conti(void)
+	{
+		if( stats != NULL )
+			delete(stats);
+
+		if( sub != NULL )
+			delete(sub);
+		sub		= NULL;
+
+		if( next != NULL )
+			delete(next);
+		next	 = NULL;					
+	};
+
+
+	int					cat, count;
+	bool				dummy;
+
+	CList_Conti			*next, *previous, *parent, *sub;
+
+	CList_Stat			*stats;
+
+};
+
+//---------------------------------------------------------
+class CGSGrid_Zonal_Statistics : public CSG_Module_Grid
+{
+public:
+	CGSGrid_Zonal_Statistics(void);
+	virtual ~CGSGrid_Zonal_Statistics(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSGrid_Zonal_Statistics_H
diff --git a/src/modules/statistics/statistics_grid/MLB_Interface.cpp b/src/modules/statistics/statistics_grid/MLB_Interface.cpp
new file mode 100644
index 0000000..8798d24
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/MLB_Interface.cpp
@@ -0,0 +1,148 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 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("Spatial and Geostatistics - Grids") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O.Conrad, V.Wichmann (c) 2002-10" ));
+
+	case MLB_INFO_Description:
+		return( _TL("Tools for spatial and geostatistical analyses.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Spatial and Geostatistics|Grids") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "fast_representativeness.h"
+#include "GSGrid_Residuals.h"
+#include "GSGrid_Variance.h"
+#include "GSGrid_Variance_Radius.h"
+#include "GSGrid_Statistics.h"
+#include "GSGrid_Zonal_Statistics.h"
+#include "GSGrid_Directional_Statistics.h"
+#include "grid_autocorrelation.h"
+#include "grid_pca.h"
+#include "multiband_variation.h"
+#include "grid_latlon_statistics.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CFast_Representativeness );
+	case  1:	return( new CGSGrid_Residuals );
+	case  2:	return( new CGSGrid_Variance );
+	case  3:	return( new CGSGrid_Variance_Radius );
+	case  4:	return( new CGSGrid_Statistics );
+	case  5:	return( new CGSGrid_Zonal_Statistics );
+	case  6:	return( new CGSGrid_Directional_Statistics );
+	case  7:	return( new CGrid_Autocorrelation );
+	case  8:	return( new CGrid_PCA );
+	case  9:	return( new CMultiBand_Variation );
+	case 10:	return( new CGrid_PCA_Inverse );
+	case 11:	return( new CGrid_Statistics_Latitudinal );
+	case 12:	return( new CGrid_Statistics_Meridional );
+	case 13:	return( new CGSGrid_Statistics_To_Table );
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/statistics/statistics_grid/MLB_Interface.h b/src/modules/statistics/statistics_grid/MLB_Interface.h
new file mode 100644
index 0000000..e6188af
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__statistics_grid_H
+#define HEADER_INCLUDED__statistics_grid_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__statistics_grid_H
diff --git a/src/modules/statistics/statistics_grid/Makefile.am b/src/modules/statistics/statistics_grid/Makefile.am
new file mode 100644
index 0000000..86f4601
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/Makefile.am
@@ -0,0 +1,42 @@
+#
+# $Id: Makefile.am 1554 2012-12-05 18:29:04Z oconrad $
+#
+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 = libstatistics_grid.la
+libstatistics_grid_la_SOURCES =\
+fast_representativeness.cpp\
+grid_autocorrelation.cpp\
+grid_latlon_statistics.cpp\
+grid_pca.cpp\
+multiband_variation.cpp\
+GSGrid_Directional_Statistics.cpp\
+GSGrid_Residuals.cpp\
+GSGrid_Statistics.cpp\
+GSGrid_Variance.cpp\
+GSGrid_Variance_Radius.cpp\
+GSGrid_Zonal_Statistics.cpp\
+MLB_Interface.cpp\
+fast_representativeness.h\
+grid_autocorrelation.h\
+grid_latlon_statistics.h\
+grid_pca.h\
+multiband_variation.h\
+GSGrid_Directional_Statistics.h\
+GSGrid_Residuals.h\
+GSGrid_Statistics.h\
+GSGrid_Variance.h\
+GSGrid_Variance_Radius.h\
+GSGrid_Zonal_Statistics.h\
+MLB_Interface.h
+
+libstatistics_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/statistics/statistics_grid/Makefile.in b/src/modules/statistics/statistics_grid/Makefile.in
new file mode 100644
index 0000000..2dea408
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/Makefile.in
@@ -0,0 +1,666 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/statistics/statistics_grid
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libstatistics_grid_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libstatistics_grid_la_OBJECTS = fast_representativeness.lo \
+	grid_autocorrelation.lo grid_latlon_statistics.lo grid_pca.lo \
+	multiband_variation.lo GSGrid_Directional_Statistics.lo \
+	GSGrid_Residuals.lo GSGrid_Statistics.lo GSGrid_Variance.lo \
+	GSGrid_Variance_Radius.lo GSGrid_Zonal_Statistics.lo \
+	MLB_Interface.lo
+libstatistics_grid_la_OBJECTS = $(am_libstatistics_grid_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libstatistics_grid_la_SOURCES)
+DIST_SOURCES = $(libstatistics_grid_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1554 2012-12-05 18:29:04Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libstatistics_grid.la
+libstatistics_grid_la_SOURCES = \
+fast_representativeness.cpp\
+grid_autocorrelation.cpp\
+grid_latlon_statistics.cpp\
+grid_pca.cpp\
+multiband_variation.cpp\
+GSGrid_Directional_Statistics.cpp\
+GSGrid_Residuals.cpp\
+GSGrid_Statistics.cpp\
+GSGrid_Variance.cpp\
+GSGrid_Variance_Radius.cpp\
+GSGrid_Zonal_Statistics.cpp\
+MLB_Interface.cpp\
+fast_representativeness.h\
+grid_autocorrelation.h\
+grid_latlon_statistics.h\
+grid_pca.h\
+multiband_variation.h\
+GSGrid_Directional_Statistics.h\
+GSGrid_Residuals.h\
+GSGrid_Statistics.h\
+GSGrid_Variance.h\
+GSGrid_Variance_Radius.h\
+GSGrid_Zonal_Statistics.h\
+MLB_Interface.h
+
+libstatistics_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_grid/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_grid/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libstatistics_grid.la: $(libstatistics_grid_la_OBJECTS) $(libstatistics_grid_la_DEPENDENCIES) $(EXTRA_libstatistics_grid_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libstatistics_grid_la_OBJECTS) $(libstatistics_grid_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Directional_Statistics.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Residuals.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Statistics.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Variance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Variance_Radius.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Zonal_Statistics.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fast_representativeness.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_autocorrelation.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_latlon_statistics.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_pca.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/multiband_variation.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/statistics/statistics_grid/fast_representativeness.cpp b/src/modules/statistics/statistics_grid/fast_representativeness.cpp
new file mode 100644
index 0000000..af5341d
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/fast_representativeness.cpp
@@ -0,0 +1,604 @@
+/**********************************************************
+ * Version $Id: fast_representativeness.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library                     //
+//                 imagery_segmentation                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              fast_representativeness.cpp              //
+//                                                       //
+//                   Copyright (C) 2009                  //
+//                     Andre Ringeler                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     aringel at saga-gis.org                   //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "fast_representativeness.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define eps 1.0e-6
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFast_Representativeness::CFast_Representativeness(void)
+{
+	Set_Name		(_TL("Fast Representativeness"));
+
+	Set_Author		(SG_T("A.Ringeler (c) 2009"));
+
+	Set_Description	(_TW(
+		"A fast representativeness algorithm. Resulting seeds might be used with 'Fast Region Growing'.\n"
+		"\n"
+		"References:\n"
+		"Boehner, J., Selige, T., Ringeler, A. (2006): Image segmentation using representativeness analysis and region growing. "
+		"In: Boehner, J., McCloy, K.R., Strobl, J. [Eds.]:  SAGA � Analysis and Modelling Applications. "
+		"Goettinger Geographische Abhandlungen, Vol.115, "
+		"<a href=\"http://downloads.sourceforge.net/saga-gis/gga115_03.pdf\">pdf</a>\n"
+	));
+
+	Parameters.Add_Grid(	NULL, "INPUT"		, _TL("Input"),
+		_TL("Input for module calculations."),
+		PARAMETER_INPUT, true, SG_DATATYPE_Float
+	);
+
+	Parameters.Add_Grid(	NULL, "RESULT"		, _TL("Output"),
+		_TL("Output of module calculations."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(	NULL, "RESULT_LOD", _TL("Output Lod"),
+		_TL("Output of module calculations."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(	NULL, "SEEDS"		, _TL("Output Seeds"),
+		_TL("Output of module calculations."),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
+	);
+
+	Parameters.Add_Value(	NULL, "LOD"			, _TL("Level of Generalisation"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 16, 1
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFast_Representativeness::On_Execute(void)
+{
+	double Lod;
+	CSG_Grid *Lod_Grid, *Seeds_Grid;
+
+
+	pOrgInput	= Parameters("INPUT")->asGrid();
+
+	pOutput		= Parameters("RESULT")->asGrid();
+
+	Lod_Grid	= Parameters("RESULT_LOD")->asGrid();
+
+	Seeds_Grid	= Parameters("SEEDS")->asGrid();
+	Seeds_Grid	->Set_NoData_Value(0);
+	Seeds_Grid	->Assign(0.0);
+
+	Process_Set_Text(_TL("Init Fast Representativeness"));
+	
+	FastRep_Initialize();
+
+	Process_Set_Text(_TL("Fast Representativeness"));
+	
+	FastRep_Execute();
+	
+	Process_Set_Text(_TL("Clear Fast Representativeness"));
+	
+	FastRep_Finalize();
+
+	Lod = Parameters("LOD")->asDouble();
+
+
+	CSG_Grid * GenLevel = (CSG_Grid *) new CSG_Grid(	SG_DATATYPE_Float,
+											(int)(pOrgInput->Get_NX()/Lod+1),
+											(int)(pOrgInput->Get_NY()/Lod+1),
+											pOrgInput->Get_Cellsize()*Lod,
+											pOrgInput->Get_XMin(),
+											pOrgInput->Get_YMin()
+										  ) ;
+
+	CSG_Grid * GenLevelRep = (CSG_Grid *) new CSG_Grid(	SG_DATATYPE_Float,
+											(int)(pOrgInput->Get_NX()/Lod+1),
+											(int)(pOrgInput->Get_NY()/Lod+1),
+											pOrgInput->Get_Cellsize()*Lod,
+											pOrgInput->Get_XMin(),
+											pOrgInput->Get_YMin()
+										  ) ;
+
+	GenLevel->Assign(pOrgInput); 
+
+
+	
+
+	pOrgInput = GenLevel;
+	pOutput   = GenLevelRep;
+
+	Process_Set_Text(_TL("Init Generalisation"));
+	
+	FastRep_Initialize();
+
+	Process_Set_Text(_TL("Generalisation"));
+	
+	FastRep_Execute();
+	
+	Process_Set_Text(_TL("Clear Generalisation"));
+	
+	FastRep_Finalize();
+	
+	smooth_rep(pOutput,GenLevel );
+
+	Lod_Grid->Assign(GenLevel);
+
+	Find_Local_Maxima_Minima(Lod_Grid, Seeds_Grid);
+	
+	return( true );
+}
+
+//---------------------------------------------------------
+// Repraesentanz stuff
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+void CFast_Representativeness::FastRep_Local_Sum(CSG_Grid *pInput, CSG_Grid **pOutput)
+{
+	*pOutput	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Float,
+					pInput->Get_NX()/2,
+					pInput->Get_NY()/2,
+					pInput->Get_Cellsize()*2,
+					pInput->Get_Cellsize()*2);
+	
+	for (int y = 0; y < pInput->Get_NY() - 1; y += 2)
+	for (int x = 0; x < pInput->Get_NX() - 1; x += 2)
+	{
+		float val;
+
+		if( pInput->is_NoData(x,y) || pInput->is_NoData(x + 1, y) || pInput->is_NoData(x, y + 1) || pInput->is_NoData(x + 1, y + 1))
+		{
+			(*pOutput)->Set_NoData(x/2, y/2);
+		}
+		else
+		{
+			val		=	pInput->asFloat(x, y)
+					+	pInput->asFloat(x + 1, y)
+					+	pInput->asFloat(x, y + 1)
+					+	pInput->asFloat(x + 1, y + 1);
+		
+			(*pOutput)->Set_Value(x/2, y/2, val);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFast_Representativeness::FastRep_Execute(void)
+{
+	int		x, y;
+	for (y = 0; y < pOutput->Get_NY()&&Set_Progress(y,pOutput->Get_NY());  y++)
+	{
+		for (x = 0; x < pOutput->Get_NX(); x++)
+		{
+			if( ! pOrgInput->is_NoData(x,y ))
+			pOutput->Set_Value(x, y, FastRep_Get_Laenge(x, y));
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFast_Representativeness::FastRep_Initialize(void)
+{
+	
+	double logNx2,logNy2;
+	int pow2y, pow2x;
+	int x,y;
+	sLong i;
+	sLong size;
+
+	logNx2	= log((double)pOrgInput->Get_NX())/log(2.0f);
+	
+	pow2x	= (int) logNx2;
+	
+	if (fabs(logNx2 - pow2x) > eps)
+		pow2x++;
+	
+	logNy2	= log((double)pOrgInput->Get_NY())/log(2.0f);
+	
+	pow2y	= (int) logNy2;
+	
+	if (fabs(logNy2 - pow2y) > eps)
+		pow2y++;
+	
+	Pow2Grid	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Double, 1 << pow2x, 1 << pow2y);
+	
+	for ( y = 0; y < Pow2Grid->Get_NY();  y++)
+	{
+		Set_Progress(y, Pow2Grid->Get_NY());
+		
+		for ( x = 0; x < Pow2Grid->Get_NX(); x++)
+		{
+			if (y<pOrgInput->Get_NY() && x < pOrgInput->Get_NX())
+				Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(x, y));
+			else
+			{
+				if(x >= pOrgInput->Get_NX()&&y<pOrgInput->Get_NY())
+				Pow2Grid->Set_Value(x, y,pOrgInput->asFloat(2*pOrgInput->Get_NX()-x-1, y));
+
+				if(y >= pOrgInput->Get_NY()&& x<pOrgInput->Get_NX())
+				Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(x, 2* pOrgInput->Get_NY()-y-1));
+
+				if(y >= pOrgInput->Get_NY()&& x >= pOrgInput->Get_NX())
+				{
+					Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(2*pOrgInput->Get_NX()-x-1, 2* pOrgInput->Get_NY()-y-1));
+				}
+			}
+		}
+	}	
+	
+	Pow2Grid->Standardise();
+
+	pOutput->Assign_NoData();
+		
+	size = (int)(log((double)Pow2Grid->Get_NX())/log(2.0)) - 1;
+		
+	m_deep = size;
+		
+	Sum[0] = Pow2Grid;
+		
+	for ( i = 0; i < size - 1; i++)
+	{
+		FastRep_Local_Sum(Sum[i], &Sum[i + 1]);
+	}
+	
+	QSum[0]	= (CSG_Grid *)new CSG_Grid(Pow2Grid, SG_DATATYPE_Double); // datas
+	QSum[0]->Assign(Pow2Grid);  
+	
+	for ( i = 0; i < Pow2Grid->Get_NCells() ; i++)
+	{
+		if (!QSum[0]->is_NoData(i))
+			QSum[0]->Set_Value(i,QSum[0]->asDouble(i)*Pow2Grid->asDouble(i));
+	}
+	
+	for (i = 0; i < size - 1; i++)
+	{
+		Set_Progress(i,size - 1);
+		FastRep_Local_Sum(QSum[i], &QSum[i + 1]);
+	}
+	
+	V	=(double *) malloc((m_deep + 12) * sizeof(double));
+	Z	=(int    *) malloc((m_deep + 12) * sizeof(int));
+	g	=(double *) malloc((m_deep + 12) * sizeof(double));
+	m	=(double *) malloc((m_deep + 12) * sizeof(double));
+	
+	maxRadius	= 12;
+	
+	rLength	=(int *)malloc((maxRadius + 12) * sizeof(int));
+	
+	for (i = 0; i < m_deep; i++)
+	{
+		g[i]	= 1.0 / (Get_Cellsize() * (1 <<(i)));
+	}
+	
+	FastRep_Init_Radius();
+}
+
+//---------------------------------------------------------
+void CFast_Representativeness::FastRep_Finalize(void)
+{
+	free(V);
+	free(Z);
+	free(rLength);
+	free(g);
+	free(m);
+	free(x_diff);
+	free(y_diff);
+	delete Pow2Grid;
+int		i;
+	for (i = 0; i < m_deep ; i++)
+		delete QSum[i];
+
+	for (i = 1; i < m_deep ; i++)
+		delete Sum[i];
+}
+
+//---------------------------------------------------------
+void CFast_Representativeness::FastRep_Init_Radius(void)
+{
+	int		k, maxZ;
+	
+	sLong	i, j, iijj, rr, r1r1, z;
+	
+	maxZ		= z	= 0;
+	rLength[0]	= 0;
+	
+	x_diff		= y_diff	= NULL;
+	
+	for (k = 1; k <= maxRadius; k++) 
+	{
+		rr		= k*k;
+		r1r1	=(k - 1) * (k - 1);
+		
+		for (i=-k; i <= k; i++)
+		{
+			for (j=-k; j <= k; j++) 
+			{
+				iijj	= i*i + j*j;
+				
+				if (iijj <= rr && iijj >= r1r1) 
+				{
+					if (maxZ <= z)
+					{
+						maxZ	+= 1000;
+						x_diff	=(int *)realloc(x_diff, maxZ*sizeof(int));
+						y_diff	=(int *)realloc(y_diff, maxZ*sizeof(int));
+					}
+					
+					x_diff[z]	= j;
+					y_diff[z]	= i;
+					
+					z++;
+				}
+			}
+		}
+		rLength[k]	= z;
+	}
+}	
+
+
+//---------------------------------------------------------
+double CFast_Representativeness::FastRep_Get_Laenge(int x, int y)
+{
+	int		Count;
+	
+	double	d;
+	
+	V[0]	= FastRep_Get_Variance(x, y, 1, 0, Count);
+	Z[0]	= Count;
+int ideep;
+	for (ideep = 1; ideep < m_deep; ideep++)
+	{
+		V[ideep]	= V[ideep - 1] + FastRep_Get_Variance(x, y, 4, ideep - 1, Count);
+		Z[ideep]	= Z[ideep - 1] + Count;
+	}
+
+	for (ideep = 0; ideep < m_deep; ideep++)
+	{
+		V[ideep]	=sqrt(V[ideep]/ (double)(Z[ideep]+1));
+	}
+	
+	d	= FastRep_Get_Steigung();
+	
+	if ( d == 0.0 )
+		return ( pOutput->Get_NoData_Value());
+	else
+		return ( V[m_deep - 1] / d / 2.0 );
+
+}
+ 
+//---------------------------------------------------------
+double CFast_Representativeness::FastRep_Get_Variance(int x, int y, int iRadius, int deep, int &Count)
+{
+	int		i, ix, iy;
+	
+	double	Variance;
+	
+	double	q	= 0;
+	double	s	= 0;
+	int		lnr	= 0;
+	
+	Variance	= 0;
+	
+	int size	= (1 << deep) * (1 << deep);
+	
+	double	z	= Sum[0]->asDouble(x, y);
+	
+	for (i = rLength[iRadius - 1], Count = 0; i < rLength[iRadius]; i++)
+	{
+		ix	= x/ (1 << deep) + x_diff[i];
+		if (ix < 0)
+			continue; 
+		else if (ix >= Sum[deep]->Get_NX())
+			continue;
+		
+		iy	= y/ (1 << deep) + y_diff[i];
+		if (iy < 0)
+			continue;
+		else if (iy >= Sum[deep]->Get_NY())
+			continue;
+		
+		if( !QSum[deep]->is_NoData(ix, iy))
+		{
+			Count	+=	size;
+			lnr		+=	size;
+	
+			q	+=	QSum[deep]->asDouble(ix, iy);
+			s	+=	Sum[deep]->asDouble(ix, iy);
+		}
+	}
+	
+	Variance = q + z* (-s - s +lnr*z);
+
+	if ( Variance < 0.0 ) Variance = 0.0; 
+
+	return ( Variance );
+}
+
+//---------------------------------------------------------
+double CFast_Representativeness::FastRep_Get_Steigung()
+{
+	int		i;
+	double	summe_mg, summe_g;
+	
+	m[0]		= V[0] / Get_Cellsize();
+
+	for (i = 1; i < m_deep; i++)
+	{
+		m[i]	=( V[i] - V[i-1] ) / ( Get_Cellsize()* (1 << (i) ) );
+	}
+	
+	summe_mg	=	summe_g	= 0;
+	
+	for (i = 0; i < m_deep; i++)
+	{
+		summe_mg	+= m[i] * g[i];
+		summe_g		+= g[i];
+	}
+
+	return ( summe_mg / summe_g );
+}
+
+//---------------------------------------------------------
+void CFast_Representativeness::smooth_rep(CSG_Grid * in, CSG_Grid * out)
+{
+	int x,y;
+	int i,j;
+	int xpos, ypos;
+	double val;
+	int count;
+
+	for (y = 0; y < in->Get_NY(); y++)
+		for (x = 0; x < in->Get_NX(); x++)
+		{
+			val = 0.0;
+			count = 0;
+			for (i=-3; i<= 3; i++)
+			for (j=-3; j<= 3; j++)
+			{
+				xpos = x + j;
+				ypos = y + i;
+
+				if( in->is_InGrid(xpos,ypos))
+				{
+					val += in->asDouble(xpos , ypos);
+					count ++;
+				}
+			}
+		
+			out ->Set_Value(x,y, val/(double) count );
+		}
+
+}
+
+//---------------------------------------------------------
+void CFast_Representativeness::Find_Local_Maxima_Minima(CSG_Grid * in, CSG_Grid * out)
+{
+	int x,y;
+	int i,j;
+	int xpos, ypos;
+	
+	double max, min;
+	
+	bool ismax ,ismin;
+	bool hasmax;
+
+	for (y = 2; y < in->Get_NY()-2; y++)
+		for (x = 2; x < in->Get_NX()-2; x++)
+		{
+			ismax = true;
+			ismin = true;
+			hasmax =false;
+
+			max =min = in->asDouble(x , y);
+			
+			for (i=-2; i<= 2; i++)
+			for (j=-2; j<= 2; j++)
+			{
+				xpos = x + j;
+				ypos = y + i;
+
+				if (max < in->asDouble(xpos , ypos))
+				ismax= false;
+
+				if (min > in->asDouble(xpos , ypos))
+				ismin= false;
+
+				if(out ->asInt(xpos, ypos))
+				hasmax=true;
+			}
+		
+			if (hasmax) 
+			
+			{
+				ismin = ismax =false; 
+			}
+
+			if( ismax||ismin )
+			{
+				out ->Set_Value(x,y, 1);
+			}
+			else
+			{
+				out ->Set_NoData(x,y);
+			}
+		}
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.h b/src/modules/statistics/statistics_grid/fast_representativeness.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.h
rename to src/modules/statistics/statistics_grid/fast_representativeness.h
diff --git a/src/modules/statistics/statistics_grid/grid_autocorrelation.cpp b/src/modules/statistics/statistics_grid/grid_autocorrelation.cpp
new file mode 100644
index 0000000..9952e4f
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/grid_autocorrelation.cpp
@@ -0,0 +1,213 @@
+/**********************************************************
+ * Version $Id: grid_autocorrelation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                grid_autocorrelastion.cpp              //
+//                                                       //
+//                 Copyright (C) 2010 by                 //
+//                     Jan Papmeier                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "grid_autocorrelation.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Autocorrelation::CGrid_Autocorrelation(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Global Moran's I for Grids"));
+
+	Set_Author		(SG_T("Jan Papmeier (c) 2010"));
+
+	Set_Description	(_TW(
+		"Global spatial autocorrelation for grids calculated as Moran's I.\n"
+		"\n"
+		"References:\n"
+		"- Lloyd, C.D. (2010): Spatial data analysis - An introduction for GIS users. Oxford. 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL, "GRID"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL, "RESULT"		, _TL("Result"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL, "CONTIGUITY"	, _TL("Case of contiguity"),
+		_TL("Choose case: Rook's case contiguity compares only cell wich share an edge. Queen's case contiguity compares also cells which share just corners."),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Rook"),
+			_TL("Queen")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL, "DIALOG"		, _TL("Show Result in Dialog"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Autocorrelation::On_Execute(void)
+{
+	int			nContiguity, nNeighbours;
+	double		Sum;
+	CSG_Grid	*pGrid;
+	CSG_Table	*pResult;
+	
+	//-----------------------------------------------------
+	pGrid	= Parameters("GRID")	->asGrid();
+	pResult	= Parameters("RESULT")	->asTable();
+
+	switch( Parameters("CONTIGUITY")->asInt() )
+	{
+	case 0:				nContiguity	= 2;	break;	// Rook's case
+	case 1: default:	nContiguity	= 1;	break;	// Queen's case
+	}
+
+	//-----------------------------------------------------
+	nNeighbours	= 0;
+	Sum			= 0.0;
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !pGrid->is_NoData(x, y) )
+			{
+				double	dz	= pGrid->asDouble(x, y) - pGrid->Get_ArithMean();
+
+				for(int i=0; i<8; i+=nContiguity)
+				{
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( pGrid->is_InGrid(ix, iy) )
+					{
+						nNeighbours	++;
+						Sum			+= dz * (pGrid->asDouble(ix, iy) - pGrid->Get_ArithMean());
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( nNeighbours <= 1 )
+	{
+		Message_Add(_TL("not enough neighbours"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	double	Moran_I	= (pGrid->Get_NCells() * Sum) / (pGrid->Get_Variance() * pGrid->Get_NCells() * nNeighbours);
+
+	if( pResult->Get_Field_Count() != 8 || SG_STR_CMP(_TL("Moran's I"), pResult->Get_Name()) )
+	{
+		pResult->Destroy();
+		pResult->Set_Name(_TL("Moran's I"));
+
+		pResult->Add_Field(_TL("GRID")		, SG_DATATYPE_String);
+		pResult->Add_Field(_TL("CONTIGUITY"), SG_DATATYPE_String);
+		pResult->Add_Field(_TL("MORAN_I")	, SG_DATATYPE_Double);
+		pResult->Add_Field(_TL("NEIGHBORS")	, SG_DATATYPE_Int);
+		pResult->Add_Field(_TL("NCELLS")	, SG_DATATYPE_Int);
+		pResult->Add_Field(_TL("MEAN")		, SG_DATATYPE_Double);
+		pResult->Add_Field(_TL("VARIATION")	, SG_DATATYPE_Double);
+		pResult->Add_Field(_TL("SUM")		, SG_DATATYPE_Double);
+	}
+
+	CSG_Table_Record	*pRecord	= pResult->Add_Record();
+
+	pRecord->Set_Value(0, pGrid->Get_Name());
+	pRecord->Set_Value(1, nContiguity == 2 ? _TL("Rook's case") : _TL("Queen's case"));
+	pRecord->Set_Value(2, Moran_I);
+	pRecord->Set_Value(3, nNeighbours);
+	pRecord->Set_Value(4, pGrid->Get_NCells());
+	pRecord->Set_Value(5, pGrid->Get_ArithMean());
+	pRecord->Set_Value(6, pGrid->Get_Variance() * pGrid->Get_NCells());
+	pRecord->Set_Value(7, Sum);
+
+	Message_Add(CSG_String::Format(SG_T("\n%s (%s): %f\n"), _TL("Moran's I"), pGrid->Get_Name(), Moran_I), false);
+
+	if( Parameters("DIALOG")->asBool() )
+	{
+		Message_Dlg(CSG_String::Format(SG_T("%s: %f"), _TL("Moran's I"), Moran_I), pGrid->Get_Name());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/grid_autocorrelation.h b/src/modules/statistics/statistics_grid/grid_autocorrelation.h
new file mode 100644
index 0000000..dbc000f
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/grid_autocorrelation.h
@@ -0,0 +1,91 @@
+/**********************************************************
+ * Version $Id: grid_autocorrelation.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                grid_autocorrelation.h                 //
+//                                                       //
+//                 Copyright (C) 2010 by                 //
+//                     Jan Papmeier                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__grid_autocorrelation_H
+#define HEADER_INCLUDED__grid_autocorrelation_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_Autocorrelation : public CSG_Module_Grid
+{
+public:
+	CGrid_Autocorrelation(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__grid_autocorrelation_H
diff --git a/src/modules/statistics/statistics_grid/grid_latlon_statistics.cpp b/src/modules/statistics/statistics_grid/grid_latlon_statistics.cpp
new file mode 100644
index 0000000..3422643
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/grid_latlon_statistics.cpp
@@ -0,0 +1,217 @@
+/**********************************************************
+ * Version $Id: grid_latlon_statistics.cpp 1252 2011-12-15 15:43:13Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               grid_latlon_statistics.cpp              //
+//                                                       //
+//                 Copyright (C) 2012 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 "grid_latlon_statistics.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Statistics_Latitudinal::CGrid_Statistics_Latitudinal(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Longitudinal Grid Statistics"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2012"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRID"	, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "STATS"	, _TL("Latitudinal Statistics"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Statistics_Latitudinal::On_Execute(void)
+{
+	CSG_Grid	*pGrid	= Parameters("GRID" )->asGrid();
+	CSG_Table	*pTable	= Parameters("STATS")->asTable();
+
+	pTable->Destroy();
+	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Latitudinal Statistics"), pGrid->Get_Name()));
+	pTable->Add_Field(SG_T("Y"     ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("MEAN"  ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("MIN"   ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("MAX"   ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("STDDEV"), SG_DATATYPE_Double);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		CSG_Simple_Statistics	Statistics;
+
+		for(int x=0; x<Get_NX(); x++)
+		{
+			Statistics	+= pGrid->asDouble(x, y);
+		}
+
+		CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+		pRecord->Set_Value(0, pGrid->Get_System().Get_yGrid_to_World(y));
+		pRecord->Set_Value(1, Statistics.Get_Mean   ());
+		pRecord->Set_Value(2, Statistics.Get_Minimum());
+		pRecord->Set_Value(3, Statistics.Get_Maximum());
+		pRecord->Set_Value(4, Statistics.Get_StdDev ());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Statistics_Meridional::CGrid_Statistics_Meridional(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Meridional Grid Statistics"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2012"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRID"	, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "STATS"	, _TL("Meridional Statistics"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Statistics_Meridional::On_Execute(void)
+{
+	CSG_Grid	*pGrid	= Parameters("GRID" )->asGrid();
+	CSG_Table	*pTable	= Parameters("STATS")->asTable();
+
+	pTable->Destroy();
+	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Meridional Statistics"), pGrid->Get_Name()));
+	pTable->Add_Field(SG_T("X"     ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("MEAN"  ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("MIN"   ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("MAX"   ), SG_DATATYPE_Double);
+	pTable->Add_Field(SG_T("STDDEV"), SG_DATATYPE_Double);
+
+	for(int x=0; x<Get_NX() && Set_Progress(x, Get_NX()); x++)
+	{
+		CSG_Simple_Statistics	Statistics;
+
+		for(int y=0; y<Get_NY(); y++)
+		{
+			Statistics	+= pGrid->asDouble(x, y);
+		}
+
+		CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+		pRecord->Set_Value(0, pGrid->Get_System().Get_xGrid_to_World(x));
+		pRecord->Set_Value(1, Statistics.Get_Mean   ());
+		pRecord->Set_Value(2, Statistics.Get_Minimum());
+		pRecord->Set_Value(3, Statistics.Get_Maximum());
+		pRecord->Set_Value(4, Statistics.Get_StdDev ());
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/grid_latlon_statistics.h b/src/modules/statistics/statistics_grid/grid_latlon_statistics.h
new file mode 100644
index 0000000..bdf2b8b
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/grid_latlon_statistics.h
@@ -0,0 +1,116 @@
+/**********************************************************
+ * Version $Id: grid_latlon_statistics.h 1252 2011-12-15 15:43:13Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                grid_latlon_statistics.h               //
+//                                                       //
+//                 Copyright (C) 2010 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__grid_latlon_statistics_H
+#define HEADER_INCLUDED__grid_latlon_statistics_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_Statistics_Latitudinal : public CSG_Module_Grid
+{
+public:
+	CGrid_Statistics_Latitudinal(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+};
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_Statistics_Meridional : public CSG_Module_Grid
+{
+public:
+	CGrid_Statistics_Meridional(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__grid_latlon_statistics_H
diff --git a/src/modules/statistics/statistics_grid/grid_pca.cpp b/src/modules/statistics/statistics_grid/grid_pca.cpp
new file mode 100644
index 0000000..25f86b3
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/grid_pca.cpp
@@ -0,0 +1,605 @@
+/**********************************************************
+ * Version $Id: grid_pca.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     grid_pca.cpp                      //
+//                                                       //
+//                 Copyright (C) 2010 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 "grid_pca.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_PCA::CGrid_PCA(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Principle Components Analysis"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Principle Components Analysis (PCA) for grids. "
+		"Implementation based on F. Murtagh's "
+		"<a target=\"_blank\" href=\"http://lib.stat.cmu.edu/multi/pca.c\">code</a> "
+		"as provided by the "
+		"<a target=\"_blank\" href=\"http://lib.stat.cmu.edu\">StatLib</a> web site.\n"
+		"\n"
+		"References:\n"
+		"Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "PCA"			, _TL("Principle Components"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "EIGEN"		, _TL("Eigen Vectors"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("correlation matrix"),
+			_TL("variance-covariance matrix"),
+			_TL("sums-of-squares-and-cross-products matrix")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NFIRST"		, _TL("Number of Components"),
+		_TL("maximum number of calculated first components; set to zero to get all"),
+		PARAMETER_TYPE_Int, 3, 0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_PCA::On_Execute(void)
+{
+	CSG_Vector	Eigen_Values;
+	CSG_Matrix	Eigen_Vectors, Matrix;
+
+	//-----------------------------------------------------
+	m_pGrids	= Parameters("GRIDS" )->asGridList();
+	m_Method	= Parameters("METHOD")->asInt();
+
+	m_nFeatures	= m_pGrids->Get_Count();
+
+	//-----------------------------------------------------
+	if( !Get_Matrix(Matrix) )
+	{
+		Error_Set(_TL("matrix initialisation failed"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	if( !SG_Matrix_Eigen_Reduction(Matrix, Eigen_Vectors, Eigen_Values) )
+	{
+		Error_Set(_TL("Eigen reduction failed"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Print_Eigen_Values (Eigen_Values );
+	Print_Eigen_Vectors(Eigen_Vectors);
+
+	Get_Components(Eigen_Vectors);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline bool CGrid_PCA::is_NoData(sLong iCell)
+{
+	for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
+	{
+		if( m_pGrids->asGrid(iFeature)->is_NoData(iCell) )
+		{
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline double CGrid_PCA::Get_Value(sLong iCell, int iFeature)
+{
+	CSG_Grid	*pGrid	= m_pGrids->asGrid(iFeature);
+
+	switch( m_Method )
+	{
+	default:
+	case 0:	// Correlation matrix: Center and reduce the column vectors.
+		return( (pGrid->asDouble(iCell) - pGrid->Get_ArithMean()) / (sqrt(Get_NCells() * pGrid->Get_Variance())) );
+
+	case 1:	// Variance-covariance matrix: Center the column vectors.
+		return( (pGrid->asDouble(iCell) - pGrid->Get_ArithMean()) );
+
+	case 2:	// Sums-of-squares-and-cross-products matrix
+		return( (pGrid->asDouble(iCell)) );
+	}
+}
+
+//---------------------------------------------------------
+bool CGrid_PCA::Get_Matrix(CSG_Matrix &Matrix)
+{
+	int		j1, j2;
+	sLong	iCell;
+
+	Matrix.Create(m_nFeatures, m_nFeatures);
+	Matrix.Set_Zero();
+
+	switch( m_Method )
+	{
+	//-----------------------------------------------------
+	default:
+	case 0:	// Correlation matrix: Center and reduce the column vectors.
+		for(j1=0; j1<m_nFeatures; j1++)
+		{
+			Matrix[j1][j1] = 1.0;
+		}
+
+		for(iCell=0; iCell<Get_NCells() && Set_Progress_NCells(iCell); iCell++)
+		{
+			if( !is_NoData(iCell) )
+			{
+				for(j1=0; j1<m_nFeatures-1; j1++)
+				{
+					for(j2=j1+1; j2<m_nFeatures; j2++)
+					{
+						Matrix[j1][j2]	+= Get_Value(iCell, j1) * Get_Value(iCell, j2);
+					}
+				}
+			}
+		}
+		break;
+
+	//-----------------------------------------------------
+	case 1:	// Variance-covariance matrix: Center the column vectors.
+	case 2:	// Sums-of-squares-and-cross-products matrix
+		for(iCell=0; iCell<Get_NCells() && Set_Progress_NCells(iCell); iCell++)
+		{
+			if( !is_NoData(iCell) )
+			{
+				for(j1=0; j1<m_nFeatures; j1++)
+				{
+					for(j2=j1; j2<m_nFeatures; j2++)
+					{
+						Matrix[j1][j2]	+= Get_Value(iCell, j1) * Get_Value(iCell, j2);
+					}
+				}
+			}
+		}
+		break;
+	}
+
+	//-----------------------------------------------------
+	for(j1=0; j1<m_nFeatures; j1++)
+	{
+		for(j2=j1; j2<m_nFeatures; j2++)
+		{
+			Matrix[j2][j1] = Matrix[j1][j2];
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CGrid_PCA::Print_Eigen_Values(CSG_Vector &Eigen_Values)
+{
+	int		i;
+	double	Sum, Cum;
+
+	for(i=0, Sum=0.0, Cum=0.0; i<m_nFeatures; i++)
+	{
+		Sum	+= Eigen_Values[i];
+	}
+
+	Sum	= Sum > 0.0 ? 100.0 / Sum : 0.0;
+
+	Message_Add(CSG_String::Format(SG_T("\n%s, %s, %s\n"), _TL("explained variance"), _TL("explained cumulative variance"), _TL("Eigenvalue")), false);
+
+	for(i=m_nFeatures-1; i>=0; i--)
+	{
+		Cum	+= Eigen_Values[i];
+
+		Message_Add(CSG_String::Format(SG_T("%d.\t%.2f\t%.2f\t%f\n"),
+				m_nFeatures - i,
+				Sum * Eigen_Values[i],
+				Sum * Cum,
+				Eigen_Values[i]
+			), false
+		);
+	}
+}
+
+//---------------------------------------------------------
+void CGrid_PCA::Print_Eigen_Vectors(CSG_Matrix &Eigen_Vectors)
+{
+	Message_Add(CSG_String::Format(SG_T("\n%s:\n"), _TL("Eigenvectors")), false);
+
+	for(int i=0; i<m_nFeatures; i++)
+	{
+		for(int j=m_nFeatures-1; j>=0; j--)
+		{
+			Message_Add(CSG_String::Format(SG_T("%.4f\t"), Eigen_Vectors[i][j]), false);
+		}
+
+		Message_Add(m_pGrids->asGrid(i)->Get_Name(), false);
+		Message_Add(SG_T("\n"), false);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_PCA::Get_Components(CSG_Matrix &Eigen_Vectors)
+{
+	int		i;
+
+	///////////////////////////////////////////////////////
+	//-----------------------------------------------------
+	CSG_Matrix	E(m_nFeatures, m_nFeatures);
+
+	for(i=0; i<m_nFeatures; i++)
+	{
+		for(int j=0, k=m_nFeatures-1; j<m_nFeatures; j++, k--)
+		{
+			E[j][i]	= Eigen_Vectors[i][k];
+		}
+	}
+
+	///////////////////////////////////////////////////////
+	//-----------------------------------------------------
+	CSG_Table	*pEigen	= Parameters("EIGEN")->asTable();
+
+	if( pEigen )
+	{
+		pEigen->Destroy();
+		pEigen->Set_Name(_TL("PCA Eigen Vectors"));
+
+		for(i=0; i<m_nFeatures; i++)
+		{
+			pEigen->Add_Field(m_pGrids->asGrid(i)->Get_Name(), SG_DATATYPE_Double);
+		}
+
+		for(i=0; i<m_nFeatures; i++)
+		{
+			CSG_Table_Record	*pRecord	= pEigen->Add_Record();
+
+			for(int j=0; j<m_nFeatures; j++)
+			{
+				pRecord->Set_Value(j, E[j][i]);
+			}
+		}
+	}
+
+	///////////////////////////////////////////////////////
+	//-----------------------------------------------------
+	int	nComponents	= Parameters("NFIRST")->asInt();
+
+	if( nComponents <= 0 || nComponents > m_nFeatures )
+	{
+		nComponents	= m_nFeatures;
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pPCA	= Parameters("PCA")->asGridList();
+
+	pPCA->Del_Items();
+
+	for(i=0; i<nComponents; i++)
+	{
+		pPCA->Add_Item(SG_Create_Grid(*Get_System()));
+		pPCA->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s %d"), _TL("Component"), i + 1));
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for private(i)
+		for(int x=0; x<Get_NX(); x++)
+		{
+			bool	bNoData	= false;
+
+			CSG_Vector	X(m_nFeatures);
+
+			for(i=0; i<m_nFeatures && !bNoData; i++)
+			{
+				if( m_pGrids->asGrid(i)->is_NoData(x, y) )
+				{
+					bNoData	= true;
+				}
+				else
+				{
+					X[i]	= m_pGrids->asGrid(i)->asDouble(x, y);
+				}
+			}
+
+			if( bNoData )
+			{
+				for(i=0; i<nComponents; i++)
+				{
+					pPCA->asGrid(i)->Set_NoData(x, y);
+				}
+			}
+			else
+			{
+				CSG_Vector	Y	= E * X;
+
+				for(i=0; i<nComponents; i++)
+				{
+					pPCA->asGrid(i)->Set_Value(x, y, Y[i]);
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_PCA_Inverse::CGrid_PCA_Inverse(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Inverse Principle Components Rotation"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Inverse principle components rotation for grids. "
+		"\n"
+		"References:\n"
+		"Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "PCA"			, _TL("Principle Components"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "EIGEN"		, _TL("Eigen Vectors"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_PCA_Inverse::On_Execute(void)
+{
+	int			i, nFeatures;
+	CSG_Table	*pEigen;
+
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pPCA, *pGrids;
+
+	pPCA	= Parameters("PCA"  )->asGridList();
+	pGrids	= Parameters("GRIDS")->asGridList();
+	pEigen	= Parameters("EIGEN")->asTable();
+
+	//-----------------------------------------------------
+	nFeatures	= pEigen->Get_Count();
+
+	if( nFeatures != pEigen->Get_Field_Count() )
+	{
+		Error_Set(_TL("warning: number of Eigen vectors and components differs."));
+
+		if( nFeatures > pEigen->Get_Field_Count() )
+		{
+			nFeatures	= pEigen->Get_Field_Count();
+		}
+	}
+
+	if( nFeatures != pPCA->Get_Count() )
+	{
+		Error_Set(_TL("warning: number of component grids and components differs."));
+
+		if( nFeatures > pPCA->Get_Count() )
+		{
+			nFeatures	= pPCA->Get_Count();
+		}
+	}
+
+	if( nFeatures < 2 )
+	{
+		Error_Set(_TL("nothing to do. transformation needs at least two components."));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Matrix	E(nFeatures, nFeatures);
+
+	for(i=0; i<nFeatures; i++)
+	{
+		CSG_Table_Record	*pRecord	= pEigen->Get_Record(i);
+
+		for(int j=0; j<nFeatures; j++)
+		{
+			E[j][i]	= pRecord->asDouble(j);
+		}
+	}
+
+	if( !E.Set_Inverse() )
+	{
+		Error_Set(_TL("matrix inversion failed"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pGrids->Del_Items();
+
+	for(i=0; i<nFeatures; i++)
+	{
+		pGrids->Add_Item(SG_Create_Grid(*Get_System()));
+		pGrids->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s %d"), _TL("Feature"), i + 1));
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for private(i)
+		for(int x=0; x<Get_NX(); x++)
+		{
+			bool	bNoData	= false;
+
+			CSG_Vector	Y(nFeatures);
+
+			for(i=0; i<nFeatures && !bNoData; i++)
+			{
+				if( pPCA->asGrid(i)->is_NoData(x, y) )
+				{
+					bNoData	= true;
+				}
+				else
+				{
+					Y[i]	= pPCA->asGrid(i)->asDouble(x, y);
+				}
+			}
+
+			if( bNoData )
+			{
+				for(i=0; i<nFeatures; i++)
+				{
+					pGrids->asGrid(i)->Set_NoData(x, y);
+				}
+			}
+			else
+			{
+				CSG_Vector	X	= E * Y;
+
+				for(i=0; i<nFeatures; i++)
+				{
+					pGrids->asGrid(i)->Set_Value(x, y, X[i]);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/grid_pca.h b/src/modules/statistics/statistics_grid/grid_pca.h
new file mode 100644
index 0000000..ddd5a00
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/grid_pca.h
@@ -0,0 +1,135 @@
+/**********************************************************
+ * Version $Id: grid_pca.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      grid_pca.h                       //
+//                                                       //
+//                 Copyright (C) 2010 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__grid_pca_H
+#define HEADER_INCLUDED__grid_pca_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_PCA : public CSG_Module_Grid
+{
+public:
+	CGrid_PCA(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Principle Components") );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	int						m_Method, m_nFeatures;
+
+	CSG_Parameter_Grid_List	*m_pGrids;
+
+
+	bool					is_NoData			(sLong iCell);
+	double					Get_Value			(sLong iCell, int iFeature);
+	
+	bool					Get_Matrix			(CSG_Matrix &Matrix);
+
+	void					Print_Eigen_Values	(CSG_Vector &Eigen_Values);
+	void					Print_Eigen_Vectors	(CSG_Matrix &Eigen_Vectors);
+
+	bool					Get_Components		(CSG_Matrix &Eigen_Vectors);
+
+};
+
+///////////////////////////////////////////////////////////
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_PCA_Inverse : public CSG_Module_Grid
+{
+public:
+	CGrid_PCA_Inverse(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Principle Components") );	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__grid_pca_H
diff --git a/src/modules/statistics/statistics_grid/multiband_variation.cpp b/src/modules/statistics/statistics_grid/multiband_variation.cpp
new file mode 100644
index 0000000..6161d51
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/multiband_variation.cpp
@@ -0,0 +1,276 @@
+/**********************************************************
+ * Version $Id: multiband_variation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                multiband_variation.cpp                //
+//                                                       //
+//                 Copyright (C) 2011 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 "multiband_variation.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CMultiBand_Variation::CMultiBand_Variation(void)
+{
+	Set_Name		(_TL("Multi-Band Variation"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Calculates for each cell the spectral variation based on feature space distances "
+		"to the centroid for all cells in specified neighbourhood. "
+		"The average distance has been used for Spectral Variation Hypothesis (SVH).\n"
+		"References:\n"
+		"- Palmer, M.W., Earls, P., Hoagland, B.W., White, P.S., Wohlgemuth, T. (2002): "
+		"Quantitative tools for perfecting species lists. Environmetrics 13, 121�137.\n"
+		"- "
+	));
+
+
+	Parameters.Add_Grid_List(
+		NULL	, "BANDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "MEAN"		, _TL("Mean Distance"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "STDDEV"		, _TL("Standard Deviation"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DIFF"		, _TL("Distance"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RADIUS"		, _TL("Radius [Cells]"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1.0, 1.0, true
+	);
+
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CMultiBand_Variation::On_Execute(void)
+{
+	int		x, y, Radius;
+
+	//-----------------------------------------------------
+	m_pBands	= Parameters("BANDS")	->asGridList();
+	m_pMean		= Parameters("MEAN")	->asGrid();
+	m_pStdDev	= Parameters("STDDEV")	->asGrid();
+	m_pDiff		= Parameters("DIFF")	->asGrid();
+
+	//-----------------------------------------------------
+	if( m_pBands->Get_Count() < 1 )
+	{
+		Error_Set(_TL("no input"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Radius		= Parameters("RADIUS")	->asInt();
+
+	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	if( !m_Cells.Set_Radius(Radius) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_Mask.Create(*Get_System(), SG_DATATYPE_Byte);
+	m_Mask.Set_NoData_Value(0);
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			bool	bNoData	= false;
+
+			for(int iBand=0; iBand<m_pBands->Get_Count() && !bNoData; iBand++)
+			{
+				if( m_pBands->asGrid(iBand)->is_NoData(x, y) )
+				{
+					bNoData	= true;
+				}
+			}
+
+			m_Mask.Set_Value(x, y, bNoData ? 0 : 1);
+		}
+	}
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			Get_Variation(x, y);
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Mask .Destroy();
+	m_Cells.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CMultiBand_Variation::Get_Variation(int x, int y)
+{
+	if( !m_Mask.is_NoData(x, y) )
+	{
+		int			iBand, iCell, ix, iy;
+		double		iDistance, iWeight, Weights, Distance;
+		CSG_Vector	Centroid(m_pBands->Get_Count());
+
+		//-------------------------------------------------
+		for(iCell=0, Weights=0.0; iCell<m_Cells.Get_Count(); iCell++)
+		{
+			if( m_Cells.Get_Values(iCell, ix = x, iy = y, iDistance, iWeight, true) && m_Mask.is_InGrid(ix, iy) )
+			{
+				for(iBand=0; iBand<m_pBands->Get_Count(); iBand++)
+				{
+					Centroid[iBand]	+= iWeight * m_pBands->asGrid(iBand)->asDouble(ix, iy);
+				}
+
+				Weights			+= iWeight;
+			}
+		}
+
+		//-------------------------------------------------
+		if( Weights > 0.0 )
+		{
+			CSG_Simple_Statistics	s;
+
+			Centroid	*= 1.0 / Weights;
+
+			for(iCell=0; iCell<m_Cells.Get_Count(); iCell++)
+			{
+				if( m_Cells.Get_Values(iCell, ix = x, iy = y, iDistance, iWeight, true) && m_Mask.is_InGrid(ix, iy) )
+				{
+					for(iBand=0, Distance=0.0; iBand<m_pBands->Get_Count(); iBand++)
+					{
+						Distance	+= SG_Get_Square(Centroid[iBand] - m_pBands->asGrid(iBand)->asDouble(ix, iy));
+					}
+
+					s.Add_Value(sqrt(Distance), iWeight);
+
+					if( ix == x && iy == y )
+					{
+						if( m_pDiff )	m_pDiff->Set_Value(x, y, sqrt(Distance));
+					}
+				}
+			}
+
+			if( m_pMean   )	m_pMean  ->Set_Value(x, y, s.Get_Mean());
+			if( m_pStdDev )	m_pStdDev->Set_Value(x, y, s.Get_StdDev());
+
+			return( true );
+		}
+	}
+
+	//-----------------------------------------------------
+	if( m_pMean     )	m_pMean		->Set_NoData(x, y);
+	if( m_pStdDev   )	m_pStdDev	->Set_NoData(x, y);
+	if( m_pDiff     )	m_pDiff		->Set_NoData(x, y);
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_grid/multiband_variation.h b/src/modules/statistics/statistics_grid/multiband_variation.h
new file mode 100644
index 0000000..ad887c0
--- /dev/null
+++ b/src/modules/statistics/statistics_grid/multiband_variation.h
@@ -0,0 +1,115 @@
+/**********************************************************
+ * Version $Id: multiband_variation.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    statistics_grid                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 multiband_variation.h                 //
+//                                                       //
+//                 Copyright (C) 2011 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__multiband_variation_H
+#define HEADER_INCLUDED__multiband_variation_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CMultiBand_Variation : public CSG_Module_Grid
+{
+public:
+	CMultiBand_Variation(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	CSG_Grid_Cell_Addressor	m_Cells;
+
+	CSG_Parameter_Grid_List	*m_pBands;
+
+	CSG_Grid				m_Mask, *m_pMean, *m_pStdDev, *m_pDiff;
+
+
+	bool					Get_Variation		(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__multiband_variation_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp b/src/modules/statistics/statistics_kriging/MLB_Interface.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp
rename to src/modules/statistics/statistics_kriging/MLB_Interface.cpp
diff --git a/src/modules/statistics/statistics_kriging/MLB_Interface.h b/src/modules/statistics/statistics_kriging/MLB_Interface.h
new file mode 100644
index 0000000..e379f7a
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 Geostatistics_Kriging                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__geostatistics_kriging_H
+#define HEADER_INCLUDED__geostatistics_kriging_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__geostatistics_kriging_H
diff --git a/src/modules/statistics/statistics_kriging/Makefile.am b/src/modules/statistics/statistics_kriging/Makefile.am
new file mode 100644
index 0000000..aae3613
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/Makefile.am
@@ -0,0 +1,44 @@
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
+else
+DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
+DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
+endif
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libstatistics_kriging.la
+libstatistics_kriging_la_SOURCES =\
+_kriging_base.cpp\
+_kriging_ordinary.cpp\
+_kriging_ordinary_global.cpp\
+_kriging_universal.cpp\
+_kriging_universal_global.cpp\
+kriging_base.cpp\
+kriging_ordinary.cpp\
+kriging_ordinary_global.cpp\
+kriging_universal.cpp\
+kriging_universal_global.cpp\
+MLB_Interface.cpp\
+semivariogram.cpp\
+variogram_dialog.cpp\
+_kriging_base.h\
+_kriging_ordinary.h\
+_kriging_ordinary_global.h\
+_kriging_universal.h\
+_kriging_universal_global.h\
+kriging_base.h\
+kriging_ordinary.h\
+kriging_ordinary_global.h\
+kriging_universal.h\
+kriging_universal_global.h\
+MLB_Interface.h\
+semivariogram.h\
+variogram_dialog.h
+
+libstatistics_kriging_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
diff --git a/src/modules/statistics/statistics_kriging/Makefile.in b/src/modules/statistics/statistics_kriging/Makefile.in
new file mode 100644
index 0000000..3624fe3
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/Makefile.in
@@ -0,0 +1,670 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/statistics/statistics_kriging
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libstatistics_kriging_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \
+	$(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la
+am_libstatistics_kriging_la_OBJECTS = _kriging_base.lo \
+	_kriging_ordinary.lo _kriging_ordinary_global.lo \
+	_kriging_universal.lo _kriging_universal_global.lo \
+	kriging_base.lo kriging_ordinary.lo kriging_ordinary_global.lo \
+	kriging_universal.lo kriging_universal_global.lo \
+	MLB_Interface.lo semivariogram.lo variogram_dialog.lo
+libstatistics_kriging_la_OBJECTS =  \
+	$(am_libstatistics_kriging_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libstatistics_kriging_la_SOURCES)
+DIST_SOURCES = $(libstatistics_kriging_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ at DEBUG_TRUE@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`
+DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = $(DEP_LFLG) -avoid-version
+pkglib_LTLIBRARIES = libstatistics_kriging.la
+libstatistics_kriging_la_SOURCES = \
+_kriging_base.cpp\
+_kriging_ordinary.cpp\
+_kriging_ordinary_global.cpp\
+_kriging_universal.cpp\
+_kriging_universal_global.cpp\
+kriging_base.cpp\
+kriging_ordinary.cpp\
+kriging_ordinary_global.cpp\
+kriging_universal.cpp\
+kriging_universal_global.cpp\
+MLB_Interface.cpp\
+semivariogram.cpp\
+variogram_dialog.cpp\
+_kriging_base.h\
+_kriging_ordinary.h\
+_kriging_ordinary_global.h\
+_kriging_universal.h\
+_kriging_universal_global.h\
+kriging_base.h\
+kriging_ordinary.h\
+kriging_ordinary_global.h\
+kriging_universal.h\
+kriging_universal_global.h\
+MLB_Interface.h\
+semivariogram.h\
+variogram_dialog.h
+
+libstatistics_kriging_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_kriging/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_kriging/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libstatistics_kriging.la: $(libstatistics_kriging_la_OBJECTS) $(libstatistics_kriging_la_DEPENDENCIES) $(EXTRA_libstatistics_kriging_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libstatistics_kriging_la_OBJECTS) $(libstatistics_kriging_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_base.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_ordinary.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_ordinary_global.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_universal.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_universal_global.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_base.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_ordinary.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_ordinary_global.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_universal.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_universal_global.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/semivariogram.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/variogram_dialog.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.cpp b/src/modules/statistics/statistics_kriging/_kriging_base.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.cpp
rename to src/modules/statistics/statistics_kriging/_kriging_base.cpp
diff --git a/src/modules/statistics/statistics_kriging/_kriging_base.h b/src/modules/statistics/statistics_kriging/_kriging_base.h
new file mode 100644
index 0000000..02fce3f
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/_kriging_base.h
@@ -0,0 +1,142 @@
+/**********************************************************
+ * Version $Id: _kriging_base.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 Geostatistics_Kriging                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    _Kriging_Base.h                    //
+//                                                       //
+//                 Copyright (C) 2006 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED___Kriging_Base_H
+#define HEADER_INCLUDED___Kriging_Base_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C_Kriging_Base : public CSG_Module
+{
+public:
+	C_Kriging_Base(void);
+	virtual ~C_Kriging_Base(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Without Variogram Fit") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+	bool					m_bBlock;
+
+	int						m_zField;
+
+	double					m_Block;
+
+	CSG_Points_Z			m_Points;
+
+	CSG_Vector				m_G;
+
+	CSG_Matrix				m_W;
+
+	CSG_PRQuadTree			m_Search;
+
+	CSG_Grid				*m_pGrid, *m_pVariance;
+
+	CSG_Shapes				*m_pShapes;
+
+
+	virtual bool			On_Initialise	(void)	{	return( true );	}
+
+	virtual bool			Get_Value		(double x, double y, double &z, double &Variance)	= 0;
+
+	double					Get_Weight		(double Distance);
+	double					Get_Weight		(double dx, double dy);
+
+
+private:
+
+	bool					m_bLog;
+
+	int						m_Model;
+
+	double					m_Nugget, m_Sill, m_Range, m_BLIN, m_BEXP, m_APOW, m_BPOW;
+
+
+	bool					_Get_Points		(void);
+	bool					_Get_Grid		(void);
+	CSG_Grid *				_Get_Grid		(TSG_Rect Extent);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED___Kriging_Base_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.cpp b/src/modules/statistics/statistics_kriging/_kriging_ordinary.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.cpp
rename to src/modules/statistics/statistics_kriging/_kriging_ordinary.cpp
diff --git a/src/modules/statistics/statistics_kriging/_kriging_ordinary.h b/src/modules/statistics/statistics_kriging/_kriging_ordinary.h
new file mode 100644
index 0000000..eea0aa7
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/_kriging_ordinary.h
@@ -0,0 +1,118 @@
+/**********************************************************
+ * Version $Id: _kriging_ordinary.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 Geostatistics_Kriging                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  _Kriging_Ordinary.h                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef _INTERPOLATION__Kriging_ORDINARY_H
+#define _INTERPOLATION__Kriging_ORDINARY_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "_kriging_ordinary_global.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C_Kriging_Ordinary : public C_Kriging_Ordinary_Global
+{
+public:
+	C_Kriging_Ordinary(void);
+	virtual ~C_Kriging_Ordinary(void);
+
+
+protected:
+
+	virtual bool			On_Initialise	(void);
+
+	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
+
+
+private:
+
+	int						m_nPoints_Min, m_nPoints_Max;
+
+	double					m_Radius;
+
+
+	int						Get_Weights		(double x, double y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef _INTERPOLATION__Kriging_ORDINARY_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.cpp b/src/modules/statistics/statistics_kriging/_kriging_ordinary_global.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.cpp
rename to src/modules/statistics/statistics_kriging/_kriging_ordinary_global.cpp
diff --git a/src/modules/statistics/statistics_kriging/_kriging_ordinary_global.h b/src/modules/statistics/statistics_kriging/_kriging_ordinary_global.h
new file mode 100644
index 0000000..ccd1247
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/_kriging_ordinary_global.h
@@ -0,0 +1,113 @@
+/**********************************************************
+ * Version $Id: _kriging_ordinary_global.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 Geostatistics_Kriging                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               _Kriging_Ordinary_Global.h              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED___Kriging_Ordinary_Global_H
+#define HEADER_INCLUDED___Kriging_Ordinary_Global_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "_kriging_base.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C_Kriging_Ordinary_Global : public C_Kriging_Base
+{
+public:
+	C_Kriging_Ordinary_Global(void);
+	virtual ~C_Kriging_Ordinary_Global(void);
+
+
+protected:
+
+	virtual bool			On_Initialise	(void);
+
+	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
+
+
+private:
+
+	bool					Get_Weights		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED___Kriging_Ordinary_Global_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.cpp b/src/modules/statistics/statistics_kriging/_kriging_universal.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.cpp
rename to src/modules/statistics/statistics_kriging/_kriging_universal.cpp
diff --git a/src/modules/statistics/statistics_kriging/_kriging_universal.h b/src/modules/statistics/statistics_kriging/_kriging_universal.h
new file mode 100644
index 0000000..0dc62ec
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/_kriging_universal.h
@@ -0,0 +1,118 @@
+/**********************************************************
+ * Version $Id: _kriging_universal.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 Geostatistics_Kriging                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  _Kriging_Universal.h                 //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED___Kriging_UNIVERSAL_H
+#define HEADER_INCLUDED___Kriging_UNIVERSAL_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "_kriging_universal_global.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C_Kriging_Universal : public C_Kriging_Universal_Global
+{
+public:
+	C_Kriging_Universal(void);
+	virtual ~C_Kriging_Universal(void);
+
+
+protected:
+
+	virtual bool			On_Initialise	(void);
+
+	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
+
+
+private:
+
+	int						m_nPoints_Min, m_nPoints_Max;
+
+	double					m_Radius;
+
+
+	int						Get_Weights		(double x, double y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED___Kriging_UNIVERSAL_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.cpp b/src/modules/statistics/statistics_kriging/_kriging_universal_global.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.cpp
rename to src/modules/statistics/statistics_kriging/_kriging_universal_global.cpp
diff --git a/src/modules/statistics/statistics_kriging/_kriging_universal_global.h b/src/modules/statistics/statistics_kriging/_kriging_universal_global.h
new file mode 100644
index 0000000..a4a44fb
--- /dev/null
+++ b/src/modules/statistics/statistics_kriging/_kriging_universal_global.h
@@ -0,0 +1,118 @@
+/**********************************************************
+ * Version $Id: _kriging_universal_global.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 Geostatistics_Kriging                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              _Kriging_Universal_Global.h              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED___Kriging_Universal_Global_H
+#define HEADER_INCLUDED___Kriging_Universal_Global_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "_kriging_base.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class C_Kriging_Universal_Global : public C_Kriging_Base
+{
+public:
+	C_Kriging_Universal_Global(void);
+	virtual ~C_Kriging_Universal_Global(void);
+
+
+protected:
+
+	int						m_Interpolation;
+
+	CSG_Parameter_Grid_List	*m_pGrids;
+
+
+	virtual bool			On_Initialise	(void);
+
+	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
+
+
+private:
+
+	bool					Get_Weights		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED___Kriging_Universal_Global_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp b/src/modules/statistics/statistics_kriging/kriging_base.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp
rename to src/modules/statistics/statistics_kriging/kriging_base.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h b/src/modules/statistics/statistics_kriging/kriging_base.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h
rename to src/modules/statistics/statistics_kriging/kriging_base.h
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp b/src/modules/statistics/statistics_kriging/kriging_ordinary.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp
rename to src/modules/statistics/statistics_kriging/kriging_ordinary.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.h b/src/modules/statistics/statistics_kriging/kriging_ordinary.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.h
rename to src/modules/statistics/statistics_kriging/kriging_ordinary.h
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.cpp b/src/modules/statistics/statistics_kriging/kriging_ordinary_global.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.cpp
rename to src/modules/statistics/statistics_kriging/kriging_ordinary_global.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.h b/src/modules/statistics/statistics_kriging/kriging_ordinary_global.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.h
rename to src/modules/statistics/statistics_kriging/kriging_ordinary_global.h
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp b/src/modules/statistics/statistics_kriging/kriging_universal.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp
rename to src/modules/statistics/statistics_kriging/kriging_universal.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.h b/src/modules/statistics/statistics_kriging/kriging_universal.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.h
rename to src/modules/statistics/statistics_kriging/kriging_universal.h
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.cpp b/src/modules/statistics/statistics_kriging/kriging_universal_global.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.cpp
rename to src/modules/statistics/statistics_kriging/kriging_universal_global.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.h b/src/modules/statistics/statistics_kriging/kriging_universal_global.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.h
rename to src/modules/statistics/statistics_kriging/kriging_universal_global.h
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.cpp b/src/modules/statistics/statistics_kriging/semivariogram.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.cpp
rename to src/modules/statistics/statistics_kriging/semivariogram.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h b/src/modules/statistics/statistics_kriging/semivariogram.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h
rename to src/modules/statistics/statistics_kriging/semivariogram.h
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp b/src/modules/statistics/statistics_kriging/variogram_dialog.cpp
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp
rename to src/modules/statistics/statistics_kriging/variogram_dialog.cpp
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h b/src/modules/statistics/statistics_kriging/variogram_dialog.h
similarity index 100%
rename from src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h
rename to src/modules/statistics/statistics_kriging/variogram_dialog.h
diff --git a/src/modules/statistics/statistics_points/GSPoints_Distances.cpp b/src/modules/statistics/statistics_points/GSPoints_Distances.cpp
new file mode 100644
index 0000000..96f9587
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Distances.cpp
@@ -0,0 +1,166 @@
+/**********************************************************
+ * Version $Id: GSPoints_Distances.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 GSPoints_Distances.cpp                //
+//                                                       //
+//                 Copyright (C) 2010 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 "GSPoints_Distances.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSPoints_Distances::CGSPoints_Distances(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Minimum Distance Analysis"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description(
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Minimum Distance Analysis"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SET_VALUE(s, v)	{ pRecord = pTable->Add_Record(); pRecord->Set_Value(0, s); pRecord->Set_Value(1, v); }
+
+//---------------------------------------------------------
+bool CGSPoints_Distances::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Shapes	*pPoints	= Parameters("POINTS")	->asShapes();
+	CSG_Table	*pTable		= Parameters("TABLE")	->asTable();
+
+	//-----------------------------------------------------
+	CSG_PRQuadTree			QT(pPoints, 0);
+	CSG_Simple_Statistics	s;
+
+	double	x, y, z;
+
+	for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+	{
+		TSG_Point	p	= pPoints->Get_Shape(iPoint)->Get_Point(0);
+
+		if( QT.Select_Nearest_Points(p.x, p.y, 2) && QT.Get_Selected_Point(1, x, y, z) && (x != p.x || y != p.y) )
+		{
+			s.Add_Value(SG_Get_Distance(x, y, p.x, p.y));
+		}
+	}
+
+	//-----------------------------------------------------
+	if( s.Get_Count() > 0 )
+	{
+		CSG_Table_Record	*pRecord;
+
+		pTable->Destroy();
+		pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Minimum Distance Analysis"), pPoints->Get_Name()));
+
+		pTable->Add_Field(SG_T("NAME")	, SG_DATATYPE_String);
+		pTable->Add_Field(SG_T("VALUE")	, SG_DATATYPE_Double);
+
+		SET_VALUE(_TL("Mean Average")		, s.Get_Mean());
+		SET_VALUE(_TL("Minimum")			, s.Get_Minimum());
+		SET_VALUE(_TL("Maximum")			, s.Get_Maximum());
+		SET_VALUE(_TL("Standard Deviation")	, s.Get_StdDev());
+		SET_VALUE(_TL("Duplicates")			, pPoints->Get_Count() - s.Get_Count());
+
+		DataObject_Update(pTable, SG_UI_DATAOBJECT_SHOW);
+
+		return( true );
+	}
+
+	Message_Dlg(_TL("not enough observations"));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_points/GSPoints_Distances.h b/src/modules/statistics/statistics_points/GSPoints_Distances.h
new file mode 100644
index 0000000..cf98315
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Distances.h
@@ -0,0 +1,100 @@
+/**********************************************************
+ * Version $Id: GSPoints_Distances.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  GSPoints_Distances.h                 //
+//                                                       //
+//                 Copyright (C) 2010 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__GSPoints_Distances_H
+#define HEADER_INCLUDED__GSPoints_Distances_H
+
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSPoints_Distances : public CSG_Module  
+{
+public:
+	CGSPoints_Distances(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSPoints_Distances_H
diff --git a/src/modules/statistics/statistics_points/GSPoints_Pattern_Analysis.cpp b/src/modules/statistics/statistics_points/GSPoints_Pattern_Analysis.cpp
new file mode 100644
index 0000000..0b03672
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Pattern_Analysis.cpp
@@ -0,0 +1,251 @@
+/**********************************************************
+ * Version $Id: GSPoints_Pattern_Analysis.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSPoints_Pattern_Analysis.cpp            //
+//                                                       //
+//                 Copyright (C) 2010 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 "GSPoints_Pattern_Analysis.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSPoints_Pattern_Analysis::CGSPoints_Pattern_Analysis(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Spatial Point Pattern Analysis"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description(
+		_TL("Basic measures for spatial point patterns.")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "CENTRE"		, _TL("Mean Centre"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "STDDIST"		, _TL("Standard Distance"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Value(
+		pNode	, "STEP"		, _TL("Vertex Distance [Degree]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 5.0, 0.1, true, 20.0, true
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "BBOX"		, _TL("Bounding Box"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSPoints_Pattern_Analysis::On_Execute(void)
+{
+	int						iPoint;
+	double					StdDist;
+	CSG_Shape				*pShape;
+	CSG_Shapes				*pPoints, *pShapes;
+	CSG_Simple_Statistics	X, Y, D;
+
+	//-----------------------------------------------------
+	pPoints		= Parameters("POINTS")	->asShapes();
+
+	if( pPoints->Get_Count() <= 1 )
+	{
+		Error_Set(_TL("not enough points to perform pattern analysis"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+	{
+		TSG_Point	p	= pPoints->Get_Shape(iPoint)->Get_Point(0);
+
+		X.Add_Value(p.x);
+		Y.Add_Value(p.y);
+	}
+
+	if( X.Get_Range() == 0.0 && Y.Get_Range() == 0.0 )
+	{
+		Error_Set(_TL("no variation in point pattern"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	StdDist	= 0.0;
+
+	for(iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+	{
+		TSG_Point	p	= pPoints->Get_Shape(iPoint)->Get_Point(0);
+
+		D.Add_Value(SG_Get_Distance(X.Get_Mean(), Y.Get_Mean(), p.x, p.y));
+
+		StdDist	+= SG_Get_Square(p.x - X.Get_Mean()) + SG_Get_Square(p.y - Y.Get_Mean());
+	}
+
+	StdDist	= sqrt(StdDist / D.Get_Count());
+
+	//-----------------------------------------------------
+	pShapes	= Parameters("CENTRE")	->asShapes();
+
+	pShapes	->Create(SHAPE_TYPE_Point	, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Centre")));
+	pShapes	->Add_Field(SG_T("X_CENTRE"), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("Y_CENTRE"), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("N_POINTS"), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("STDDIST" ), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("MEANDIST"), SG_DATATYPE_Double);
+
+	pShape	= pShapes->Add_Shape();
+
+	pShape	->Set_Value(0, X.Get_Mean());
+	pShape	->Set_Value(1, Y.Get_Mean());
+	pShape	->Set_Value(2, D.Get_Count());
+	pShape	->Set_Value(3, StdDist);
+	pShape	->Set_Value(4, D.Get_StdDev());
+
+	pShape	->Add_Point(X.Get_Mean(), Y.Get_Mean());
+
+	//-----------------------------------------------------
+	pShapes	= Parameters("STDDIST")	->asShapes();
+
+	pShapes	->Create(SHAPE_TYPE_Polygon	, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Standard Distance")));
+	pShapes	->Add_Field(SG_T("X_CENTRE"), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("Y_CENTRE"), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("N_POINTS"), SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("STDDIST") , SG_DATATYPE_Double);
+
+	pShape	= pShapes->Add_Shape();
+
+	pShape	->Set_Value(0, X.Get_Mean());
+	pShape	->Set_Value(1, Y.Get_Mean());
+	pShape	->Set_Value(2, X.Get_Count());
+	pShape	->Set_Value(3, StdDist);
+
+	double	dTheta	= Parameters("STEP")->asDouble() * M_DEG_TO_RAD;
+
+	for(double Theta=0.0; Theta<=M_PI_360; Theta+=dTheta)
+	{
+		pShape	->Add_Point(
+			X.Get_Mean() + StdDist * cos(Theta),
+			Y.Get_Mean() + StdDist * sin(Theta)
+		);
+	}
+
+	//-----------------------------------------------------
+	pShapes	= Parameters("BBOX")	->asShapes();
+
+	pShapes	->Create(SHAPE_TYPE_Polygon	, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Bounding Box")));
+
+	pShapes	->Add_Field(SG_T("XMIN")	, SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("XMAX")	, SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("YMIN")	, SG_DATATYPE_Double);
+	pShapes	->Add_Field(SG_T("YMAX")	, SG_DATATYPE_Double);
+
+	pShape	= pShapes->Add_Shape();
+
+	pShape	->Set_Value(0, X.Get_Minimum());
+	pShape	->Set_Value(1, X.Get_Maximum());
+	pShape	->Set_Value(2, Y.Get_Minimum());
+	pShape	->Set_Value(3, Y.Get_Maximum());
+
+	pShape	->Add_Point(X.Get_Minimum(), Y.Get_Minimum());
+	pShape	->Add_Point(X.Get_Minimum(), Y.Get_Maximum());
+	pShape	->Add_Point(X.Get_Maximum(), Y.Get_Maximum());
+	pShape	->Add_Point(X.Get_Maximum(), Y.Get_Minimum());
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_points/GSPoints_Pattern_Analysis.h b/src/modules/statistics/statistics_points/GSPoints_Pattern_Analysis.h
new file mode 100644
index 0000000..2608a60
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Pattern_Analysis.h
@@ -0,0 +1,100 @@
+/**********************************************************
+ * Version $Id: GSPoints_Pattern_Analysis.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSPoints_Pattern_Analysis.h              //
+//                                                       //
+//                 Copyright (C) 2010 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__GSPoints_Pattern_Analysis_H
+#define HEADER_INCLUDED__GSPoints_Pattern_Analysis_H
+
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSPoints_Pattern_Analysis : public CSG_Module  
+{
+public:
+	CGSPoints_Pattern_Analysis(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSPoints_Pattern_Analysis_H
diff --git a/src/modules/statistics/statistics_points/GSPoints_Semi_Variances.cpp b/src/modules/statistics/statistics_points/GSPoints_Semi_Variances.cpp
new file mode 100644
index 0000000..6cbd4b3
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Semi_Variances.cpp
@@ -0,0 +1,259 @@
+/**********************************************************
+ * Version $Id: GSPoints_Semi_Variances.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSPoints_Semi_Variances.cpp              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "GSPoints_Semi_Variances.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	FIELD_CLASSNR	= 0,
+	FIELD_DISTANCE,
+	FIELD_COUNT,
+	FIELD_VARIANCE,
+	FIELD_VARCUMUL,
+	FIELD_COVARIANCE,
+	FIELD_COVARCUMUL
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSPoints_Semi_Variances::CGSPoints_Semi_Variances(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Variogram"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2003"));
+
+	Set_Description(
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD"		, _TL("Attribute"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Table(
+		NULL	, "RESULT"		, _TL("Sample Variogram"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTCOUNT"	, _TL("Initial Number of Distance Classes"),
+		_TL(""),
+		PARAMETER_TYPE_Int		, 100, 1, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTMAX"		, _TL("Maximum Distance"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NSKIP"		, _TL("Skip Number"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSPoints_Semi_Variances::On_Execute(void)
+{
+	int					i, j, k, n, nDistances, nSkip, Attribute;
+	double				zi, zj, zMean, v, c, maxDistance, lagDistance;
+	TSG_Point			Pt_i, Pt_j;
+	CSG_Vector			Count, Variance, Covariance;
+	CSG_Table_Record	*pRecord;
+	CSG_Table			*pTable;
+	CSG_Shape			*pPoint;
+	CSG_Shapes			*pPoints;
+
+	//-----------------------------------------------------
+	pPoints		= Parameters("POINTS")		->asShapes();
+	pTable		= Parameters("RESULT")		->asTable();
+	Attribute	= Parameters("FIELD")		->asInt();
+	nSkip		= Parameters("NSKIP")		->asInt();
+	maxDistance	= Parameters("DISTMAX")		->asDouble();
+	nDistances	= Parameters("DISTCOUNT")	->asInt();
+
+	if( maxDistance <= 0.0 )
+	{
+		maxDistance	= SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange());
+	}
+
+	lagDistance	= maxDistance / nDistances;
+
+	zMean		= pPoints->Get_Mean(Attribute);
+
+	Count		.Create(nDistances);
+	Variance	.Create(nDistances);
+	Covariance	.Create(nDistances);
+
+	//-----------------------------------------------------
+	for(i=0, n=0; i<pPoints->Get_Count() && Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip)
+	{
+		pPoint	= pPoints->Get_Shape(i);
+
+		if( !pPoint->is_NoData(Attribute) )
+		{
+			Pt_i	= pPoint->Get_Point(0);
+			zi		= pPoint->asDouble(Attribute);
+
+			for(j=i+nSkip; j<pPoints->Get_Count(); j+=nSkip, n++)
+			{
+				pPoint	= pPoints->Get_Shape(j);
+
+				if( !pPoint->is_NoData(Attribute) )
+				{
+					Pt_j	= pPoint->Get_Point(0);
+					k		= (int)(SG_Get_Distance(Pt_i, Pt_j) / lagDistance);
+
+					if( k < nDistances )
+					{
+						zj	= pPoint->asDouble(Attribute);
+
+						v	= SG_Get_Square(zi - zj);
+						c	= (zi - zMean) * (zj - zMean);
+
+						Count	  [k]	++;
+						Variance  [k]	+= v;
+						Covariance[k]	+= c;
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	pTable->Destroy();
+	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Variogram"), pPoints->Get_Field_Name(Attribute)));
+	pTable->Add_Field(_TL("Class")		, SG_DATATYPE_Int);		// FIELD_CLASSNR
+	pTable->Add_Field(_TL("Distance")	, SG_DATATYPE_Double);	// FIELD_DISTANCE
+	pTable->Add_Field(_TL("Count")		, SG_DATATYPE_Int);		// FIELD_COUNT
+	pTable->Add_Field(_TL("Variance")	, SG_DATATYPE_Double);	// FIELD_VARIANCE
+	pTable->Add_Field(_TL("Cum.Var.")	, SG_DATATYPE_Double);	// FIELD_VARCUMUL
+	pTable->Add_Field(_TL("Covariance")	, SG_DATATYPE_Double);	// FIELD_COVARIANCE
+	pTable->Add_Field(_TL("Cum.Covar.")	, SG_DATATYPE_Double);	// FIELD_COVARCUMUL
+
+	for(i=0, v=0.0, c=0.0, n=0; i<nDistances; i++)
+	{
+		if( Count[i] > 0 )
+		{
+			n	+= (int)Count[i];
+			v	+= Variance  [i];
+			c	+= Covariance[i];
+
+			pRecord	= pTable->Add_Record();
+			pRecord->Set_Value(FIELD_CLASSNR	, (i + 1));
+			pRecord->Set_Value(FIELD_DISTANCE	, (i + 1) * lagDistance);
+			pRecord->Set_Value(FIELD_COUNT		, Count[i]);
+			pRecord->Set_Value(FIELD_VARIANCE	, 0.5 * Variance  [i] / Count[i]);
+			pRecord->Set_Value(FIELD_VARCUMUL	, 0.5 * v / n);
+			pRecord->Set_Value(FIELD_COVARIANCE	, 1.0 * Covariance[i] / Count[i]);
+			pRecord->Set_Value(FIELD_COVARCUMUL	, 1.0 * c / n);
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_points/GSPoints_Semi_Variances.h b/src/modules/statistics/statistics_points/GSPoints_Semi_Variances.h
new file mode 100644
index 0000000..db117f8
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Semi_Variances.h
@@ -0,0 +1,105 @@
+/**********************************************************
+ * Version $Id: GSPoints_Semi_Variances.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               GSPoints_Semi_Variances.h               //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GSPoints_Semi_Variances_H
+#define HEADER_INCLUDED__GSPoints_Semi_Variances_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSPoints_Semi_Variances : public CSG_Module  
+{
+public:
+	CGSPoints_Semi_Variances(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSPoints_Semi_Variances_H
diff --git a/src/modules/statistics/statistics_points/GSPoints_Variogram_Cloud.cpp b/src/modules/statistics/statistics_points/GSPoints_Variogram_Cloud.cpp
new file mode 100644
index 0000000..e4bef58
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Variogram_Cloud.cpp
@@ -0,0 +1,223 @@
+/**********************************************************
+ * Version $Id: GSPoints_Variogram_Cloud.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSPoints_Variogram_Cloud.cpp             //
+//                                                       //
+//                 Copyright (C) 2010 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 "GSPoints_Variogram_Cloud.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	DIF_FIELD_DISTANCE		= 0,
+	DIF_FIELD_DIRECTION,
+	DIF_FIELD_DIFFERENCE,
+	DIF_FIELD_VARIANCE,
+	DIF_FIELD_SEMIVARIANCE,
+	DIF_FIELD_COVARIANCE
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSPoints_Variogram_Cloud::CGSPoints_Variogram_Cloud(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Variogram Cloud"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2003"));
+
+	Set_Description(
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD"		, _TL("Attribute"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Table(
+		NULL	, "RESULT"		, _TL("Variogram Cloud"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTMAX"		, _TL("Maximum Distance"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NSKIP"		, _TL("Skip Number"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSPoints_Variogram_Cloud::On_Execute(void)
+{
+	int			nSkip, Attribute;
+	double		zi, zj, zMean, d, maxDistance;
+	TSG_Point	Pt_i, Pt_j;
+	CSG_Table	*pTable;
+	CSG_Shape	*pPoint;
+	CSG_Shapes	*pPoints;
+
+	//-----------------------------------------------------
+	pPoints		= Parameters("POINTS")		->asShapes();
+	pTable		= Parameters("RESULT")		->asTable();
+	Attribute	= Parameters("FIELD")		->asInt();
+	nSkip		= Parameters("NSKIP")		->asInt();
+	maxDistance	= Parameters("DISTMAX")		->asDouble();
+
+	if( maxDistance <= 0.0 )
+	{
+		maxDistance	= SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange());
+	}
+
+	zMean		= pPoints->Get_Mean(Attribute);
+
+	//-----------------------------------------------------
+	pTable->Destroy();
+	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Variogram Cloud")));
+	pTable->Add_Field(_TL("Distance")		, SG_DATATYPE_Double);	// DIF_FIELD_DISTANCE
+	pTable->Add_Field(_TL("Direction")		, SG_DATATYPE_Double);	// DIF_FIELD_DIRECTION
+	pTable->Add_Field(_TL("Difference")		, SG_DATATYPE_Double);	// DIF_FIELD_DIFFERENCE
+	pTable->Add_Field(_TL("Variance")		, SG_DATATYPE_Double);	// DIF_FIELD_VARIANCE
+	pTable->Add_Field(_TL("Semivariance")	, SG_DATATYPE_Double);	// DIF_FIELD_SEMIVARIANCE
+	pTable->Add_Field(_TL("Covariance")		, SG_DATATYPE_Double);	// DIF_FIELD_COVARIANCE
+
+	//-----------------------------------------------------
+	for(int i=0; i<pPoints->Get_Count()-nSkip && Set_Progress(i, pPoints->Get_Count()-nSkip); i+=nSkip)
+	{
+		pPoint	= pPoints->Get_Shape(i);
+
+		if( !pPoint->is_NoData(Attribute) )
+		{
+			Pt_i	= pPoint->Get_Point(0);
+			zi		= pPoint->asDouble(Attribute);
+
+			for(int j=i; j<pPoints->Get_Count() && Process_Get_Okay(); j+=nSkip)
+			{
+				pPoint	= pPoints->Get_Shape(j);
+
+				if( !pPoint->is_NoData(Attribute) )
+				{
+					Pt_j	= pPoint->Get_Point(0);
+
+					if( (d = SG_Get_Distance(Pt_i, Pt_j)) <= maxDistance )
+					{
+						CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+						zj	= pPoint->asDouble(Attribute);
+
+						pRecord->Set_Value(DIF_FIELD_DISTANCE		, d);
+						pRecord->Set_Value(DIF_FIELD_DIRECTION		, SG_Get_Angle_Of_Direction(Pt_i, Pt_j) * M_RAD_TO_DEG);
+						pRecord->Set_Value(DIF_FIELD_DIFFERENCE		, fabs(d = zi - zj));
+						pRecord->Set_Value(DIF_FIELD_VARIANCE		, d = d*d);
+						pRecord->Set_Value(DIF_FIELD_SEMIVARIANCE	, 0.5*d);
+						pRecord->Set_Value(DIF_FIELD_COVARIANCE		, (zi - zMean) * (zj - zMean));
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_points/GSPoints_Variogram_Cloud.h b/src/modules/statistics/statistics_points/GSPoints_Variogram_Cloud.h
new file mode 100644
index 0000000..7ed91f9
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Variogram_Cloud.h
@@ -0,0 +1,103 @@
+/**********************************************************
+ * Version $Id: GSPoints_Variogram_Cloud.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               GSPoints_Variogram_Cloud.h              //
+//                                                       //
+//                 Copyright (C) 2010 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__GSPoints_Variogram_Cloud_H
+#define HEADER_INCLUDED__GSPoints_Variogram_Cloud_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSPoints_Variogram_Cloud : public CSG_Module  
+{
+public:
+	CGSPoints_Variogram_Cloud(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSPoints_Variogram_Cloud_H
diff --git a/src/modules/statistics/statistics_points/GSPoints_Variogram_Surface.cpp b/src/modules/statistics/statistics_points/GSPoints_Variogram_Surface.cpp
new file mode 100644
index 0000000..5e36219
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Variogram_Surface.cpp
@@ -0,0 +1,236 @@
+/**********************************************************
+ * Version $Id: GSPoints_Variogram_Surface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             GSPoints_Variogram_Surface.cpp            //
+//                                                       //
+//                 Copyright (C) 2010 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 "GSPoints_Variogram_Surface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGSPoints_Variogram_Surface::CGSPoints_Variogram_Surface(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Variogram Surface"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description(
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD"		, _TL("Attribute"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_Output(
+		NULL	, "COUNT"		, _TL("Number of Pairs"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "VARIANCE"	, _TL("Variogram Surface"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid_Output(
+		NULL	, "COVARIANCE"	, _TL("Covariance Surface"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTCOUNT"	, _TL("Number of Distance Classes"),
+		_TL(""),
+		PARAMETER_TYPE_Int		, 10, 1, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NSKIP"		, _TL("Skip Number"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGSPoints_Variogram_Surface::On_Execute(void)
+{
+	sLong				i;
+	int					j, x, y, n, nx, ny, nSkip, Attribute, nDistances;
+	double				zi, zj, zMean, v, c, lagDistance;
+	TSG_Point			Pt_i, Pt_j;
+	CSG_Shape			*pPoint;
+	CSG_Shapes			*pPoints;
+	CSG_Grid			*pVariance, *pCovariance, *pCount;
+
+	//-----------------------------------------------------
+	pPoints		= Parameters("POINTS")		->asShapes();
+	Attribute	= Parameters("FIELD")		->asInt();
+	nSkip		= Parameters("NSKIP")		->asInt();
+	nDistances	= Parameters("DISTCOUNT")	->asInt();
+
+	lagDistance	= pPoints->Get_Extent().Get_XRange() < pPoints->Get_Extent().Get_YRange()
+				? pPoints->Get_Extent().Get_XRange() / nDistances
+				: pPoints->Get_Extent().Get_YRange() / nDistances;
+
+	nx			= 1 + (int)(pPoints->Get_Extent().Get_XRange() / lagDistance);
+	ny			= 1 + (int)(pPoints->Get_Extent().Get_YRange() / lagDistance);
+	zMean		= pPoints->Get_Mean(Attribute);
+
+	pCount		= SG_Create_Grid(SG_DATATYPE_Int  , 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance);
+	pVariance	= SG_Create_Grid(SG_DATATYPE_Float, 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance);
+	pCovariance	= SG_Create_Grid(SG_DATATYPE_Float, 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance);
+
+	pCount		->Set_Name(CSG_String::Format(SG_T("%s [%s]")    , pPoints->Get_Name(), _TL("Count")));
+	pVariance	->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Variogram Surface") , pPoints->Get_Field_Name(Attribute)));
+	pCovariance	->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Covariance Surface"), pPoints->Get_Field_Name(Attribute)));
+
+	//-----------------------------------------------------
+	for(i=0, n=0; i<pPoints->Get_Count() && Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip)
+	{
+		pPoint	= pPoints->Get_Shape(i);
+
+		if( !pPoint->is_NoData(Attribute) )
+		{
+			Pt_i	= pPoint->Get_Point(0);
+			zi		= pPoint->asDouble(Attribute);
+
+			for(j=i+nSkip; j<pPoints->Get_Count(); j+=nSkip, n++)
+			{
+				pPoint	= pPoints->Get_Shape(j);
+
+				if( !pPoint->is_NoData(Attribute) )
+				{
+					Pt_j	= pPoint->Get_Point(0);
+
+					zj	= pPoint->asDouble(Attribute);
+
+					v	= SG_Get_Square(zi - zj);
+					c	= (zi - zMean) * (zj - zMean);
+
+					Pt_j.x	= (Pt_i.x - Pt_j.x) / lagDistance;
+					Pt_j.y	= (Pt_i.y - Pt_j.y) / lagDistance;
+
+					x	= (int)(Pt_j.x + (Pt_j.x > 0.0 ? 0.5 : -0.5));
+					y	= (int)(Pt_j.y + (Pt_j.y > 0.0 ? 0.5 : -0.5));
+
+					pCount     ->Add_Value(nx + x, ny + y, 1);
+					pCount     ->Add_Value(nx - x, ny - y, 1);
+					pVariance  ->Add_Value(nx + x, ny + y, v);
+					pVariance  ->Add_Value(nx - x, ny - y, v);
+					pCovariance->Add_Value(nx + x, ny + y, c);
+					pCovariance->Add_Value(nx - x, ny - y, c);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(i=0; i<pCount->Get_NCells(); i++)
+	{
+		if( pCount->asInt(i) > 0 )
+		{
+			pVariance  ->Mul_Value(i, 0.5 / pCount->asInt(i));
+			pCovariance->Mul_Value(i, 1.0 / pCount->asInt(i));
+		}
+		else
+		{
+			pVariance  ->Set_NoData(i);
+			pCovariance->Set_NoData(i);
+		}
+	}
+
+	DataObject_Add(pCount);
+	DataObject_Add(pVariance);
+	DataObject_Add(pCovariance);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_points/GSPoints_Variogram_Surface.h b/src/modules/statistics/statistics_points/GSPoints_Variogram_Surface.h
new file mode 100644
index 0000000..06bf3bb
--- /dev/null
+++ b/src/modules/statistics/statistics_points/GSPoints_Variogram_Surface.h
@@ -0,0 +1,103 @@
+/**********************************************************
+ * Version $Id: GSPoints_Variogram_Surface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              GSPoints_Variogram_Surface.h             //
+//                                                       //
+//                 Copyright (C) 2010 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__GSPoints_Variogram_Surface_H
+#define HEADER_INCLUDED__GSPoints_Variogram_Surface_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGSPoints_Variogram_Surface : public CSG_Module  
+{
+public:
+	CGSPoints_Variogram_Surface(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GSPoints_Variogram_Surface_H
diff --git a/src/modules/statistics/statistics_points/MLB_Interface.cpp b/src/modules/statistics/statistics_points/MLB_Interface.cpp
new file mode 100644
index 0000000..c236fb0
--- /dev/null
+++ b/src/modules/statistics/statistics_points/MLB_Interface.cpp
@@ -0,0 +1,133 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 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("Spatial and Geostatistics - Points") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O.Conrad (c) 2002-10") );
+
+	case MLB_INFO_Description:
+		return( _TL("Spatial and geostatistical analyses of point data.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Spatial and Geostatistics|Points") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "GSPoints_Semi_Variances.h"
+#include "GSPoints_Variogram_Cloud.h"
+#include "GSPoints_Variogram_Surface.h"
+#include "GSPoints_Distances.h"
+#include "GSPoints_Pattern_Analysis.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CGSPoints_Semi_Variances );
+	case  1:	return( new CGSPoints_Variogram_Cloud );
+	case  2:	return( new CGSPoints_Variogram_Surface );
+	case  3:	return( new CGSPoints_Distances );
+	case  4:	return( new CGSPoints_Pattern_Analysis );
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/statistics/statistics_points/MLB_Interface.h b/src/modules/statistics/statistics_points/MLB_Interface.h
new file mode 100644
index 0000000..1484f2a
--- /dev/null
+++ b/src/modules/statistics/statistics_points/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                   statistics_points                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__statistics_points_H
+#define HEADER_INCLUDED__statistics_points_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__statistics_points_H
diff --git a/src/modules/statistics/statistics_points/Makefile.am b/src/modules/statistics/statistics_points/Makefile.am
new file mode 100644
index 0000000..b7f2ddd
--- /dev/null
+++ b/src/modules/statistics/statistics_points/Makefile.am
@@ -0,0 +1,30 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libstatistics_points.la
+libstatistics_points_la_SOURCES =\
+GSPoints_Distances.cpp\
+GSPoints_Pattern_Analysis.cpp\
+GSPoints_Semi_Variances.cpp\
+GSPoints_Variogram_Cloud.cpp\
+GSPoints_Variogram_Surface.cpp\
+MLB_Interface.cpp\
+GSPoints_Distances.h\
+GSPoints_Pattern_Analysis.h\
+GSPoints_Semi_Variances.h\
+GSPoints_Variogram_Cloud.h\
+GSPoints_Variogram_Surface.h\
+MLB_Interface.h
+
+libstatistics_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/statistics/statistics_points/Makefile.in b/src/modules/statistics/statistics_points/Makefile.in
new file mode 100644
index 0000000..46bff3b
--- /dev/null
+++ b/src/modules/statistics/statistics_points/Makefile.in
@@ -0,0 +1,647 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/statistics/statistics_points
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libstatistics_points_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libstatistics_points_la_OBJECTS = GSPoints_Distances.lo \
+	GSPoints_Pattern_Analysis.lo GSPoints_Semi_Variances.lo \
+	GSPoints_Variogram_Cloud.lo GSPoints_Variogram_Surface.lo \
+	MLB_Interface.lo
+libstatistics_points_la_OBJECTS =  \
+	$(am_libstatistics_points_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libstatistics_points_la_SOURCES)
+DIST_SOURCES = $(libstatistics_points_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libstatistics_points.la
+libstatistics_points_la_SOURCES = \
+GSPoints_Distances.cpp\
+GSPoints_Pattern_Analysis.cpp\
+GSPoints_Semi_Variances.cpp\
+GSPoints_Variogram_Cloud.cpp\
+GSPoints_Variogram_Surface.cpp\
+MLB_Interface.cpp\
+GSPoints_Distances.h\
+GSPoints_Pattern_Analysis.h\
+GSPoints_Semi_Variances.h\
+GSPoints_Variogram_Cloud.h\
+GSPoints_Variogram_Surface.h\
+MLB_Interface.h
+
+libstatistics_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_points/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_points/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libstatistics_points.la: $(libstatistics_points_la_OBJECTS) $(libstatistics_points_la_DEPENDENCIES) $(EXTRA_libstatistics_points_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libstatistics_points_la_OBJECTS) $(libstatistics_points_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Distances.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Pattern_Analysis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Semi_Variances.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Variogram_Cloud.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Variogram_Surface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/statistics/statistics_regression/MLB_Interface.cpp b/src/modules/statistics/statistics_regression/MLB_Interface.cpp
new file mode 100644
index 0000000..e53ed74
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/MLB_Interface.cpp
@@ -0,0 +1,158 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2010 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//			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("Spatial and Geostatistics - Regression") );
+
+	case MLB_INFO_Author:
+		return( _TL("O.Conrad (c) 2010" ));
+
+	case MLB_INFO_Description:
+		return( _TL("Tools for regression analyses.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Spatial and Geostatistics|Regression") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "point_grid_regression.h"
+#include "point_multi_grid_regression.h"
+#include "point_trend_surface.h"
+
+#include "gw_regression.h"
+#include "gw_regression_grid.h"
+#include "gw_multi_regression.h"
+#include "gw_multi_regression_grid.h"
+#include "gw_multi_regression_points.h"
+#include "gwr_grid_downscaling.h"
+
+#include "grid_multi_grid_regression.h"
+#include "grids_trend_polynom.h"
+
+#include "table_trend.h"
+#include "table_regression_multiple.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CPoint_Grid_Regression );
+	case  1:	return( new CPoint_Multi_Grid_Regression );
+	case  2:	return( new CPoint_Trend_Surface );
+
+	case  3:	return( new CGW_Regression );
+	case  4:	return( new CGW_Regression_Grid );
+	case  5:	return( new CGW_Multi_Regression );
+	case  6:	return( new CGW_Multi_Regression_Grid );
+	case  7:	return( new CGW_Multi_Regression_Points );
+	case 14:	return( new CGWR_Grid_Downscaling );
+
+	case  8:	return( new CGrid_Multi_Grid_Regression );
+	case  9:	return( new CGrids_Trend );
+
+	case 10:	return( new CTable_Trend );
+	case 11:	return( new CTable_Trend_Shapes );
+
+	case 12:	return( new CTable_Regression_Multiple );
+	case 13:	return( new CTable_Regression_Multiple_Shapes );
+
+	//-----------------------------------------------------
+	case 19:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/statistics/statistics_regression/MLB_Interface.h b/src/modules/statistics/statistics_regression/MLB_Interface.h
new file mode 100644
index 0000000..0612195
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/MLB_Interface.h
@@ -0,0 +1,78 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Include the SAGA-API here				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__statistics_regression_H
+#define HEADER_INCLUDED__statistics_regression_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__statistics_regression_H
diff --git a/src/modules/statistics/statistics_regression/Makefile.am b/src/modules/statistics/statistics_regression/Makefile.am
new file mode 100644
index 0000000..61a7a6a
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/Makefile.am
@@ -0,0 +1,46 @@
+#
+# $Id: Makefile.am 1738 2013-06-20 11:15:45Z 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 = libstatistics_regression.la
+libstatistics_regression_la_SOURCES =\
+grid_multi_grid_regression.cpp\
+gw_multi_regression.cpp\
+gw_multi_regression_grid.cpp\
+gw_multi_regression_points.cpp\
+gw_regression.cpp\
+gw_regression_grid.cpp\
+gwr_grid_downscaling.cpp\
+grids_trend_polynom.cpp\
+MLB_Interface.cpp\
+point_grid_regression.cpp\
+point_multi_grid_regression.cpp\
+point_trend_surface.cpp\
+table_regression_multiple.cpp\
+table_trend.cpp\
+grid_multi_grid_regression.h\
+gw_multi_regression.h\
+gw_multi_regression_grid.h\
+gw_multi_regression_points.h\
+gw_regression.h\
+gw_regression_grid.h\
+gwr_grid_downscaling.h\
+grids_trend_polynom.h\
+MLB_Interface.h\
+point_grid_regression.h\
+point_multi_grid_regression.h\
+point_trend_surface.h\
+table_regression_multiple.h\
+table_trend.h
+
+libstatistics_regression_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/statistics/statistics_regression/Makefile.in b/src/modules/statistics/statistics_regression/Makefile.in
new file mode 100644
index 0000000..833f56c
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/Makefile.in
@@ -0,0 +1,675 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/statistics/statistics_regression
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libstatistics_regression_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libstatistics_regression_la_OBJECTS =  \
+	grid_multi_grid_regression.lo gw_multi_regression.lo \
+	gw_multi_regression_grid.lo gw_multi_regression_points.lo \
+	gw_regression.lo gw_regression_grid.lo gwr_grid_downscaling.lo \
+	grids_trend_polynom.lo MLB_Interface.lo \
+	point_grid_regression.lo point_multi_grid_regression.lo \
+	point_trend_surface.lo table_regression_multiple.lo \
+	table_trend.lo
+libstatistics_regression_la_OBJECTS =  \
+	$(am_libstatistics_regression_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libstatistics_regression_la_SOURCES)
+DIST_SOURCES = $(libstatistics_regression_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1738 2013-06-20 11:15:45Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libstatistics_regression.la
+libstatistics_regression_la_SOURCES = \
+grid_multi_grid_regression.cpp\
+gw_multi_regression.cpp\
+gw_multi_regression_grid.cpp\
+gw_multi_regression_points.cpp\
+gw_regression.cpp\
+gw_regression_grid.cpp\
+gwr_grid_downscaling.cpp\
+grids_trend_polynom.cpp\
+MLB_Interface.cpp\
+point_grid_regression.cpp\
+point_multi_grid_regression.cpp\
+point_trend_surface.cpp\
+table_regression_multiple.cpp\
+table_trend.cpp\
+grid_multi_grid_regression.h\
+gw_multi_regression.h\
+gw_multi_regression_grid.h\
+gw_multi_regression_points.h\
+gw_regression.h\
+gw_regression_grid.h\
+gwr_grid_downscaling.h\
+grids_trend_polynom.h\
+MLB_Interface.h\
+point_grid_regression.h\
+point_multi_grid_regression.h\
+point_trend_surface.h\
+table_regression_multiple.h\
+table_trend.h
+
+libstatistics_regression_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_regression/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_regression/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libstatistics_regression.la: $(libstatistics_regression_la_OBJECTS) $(libstatistics_regression_la_DEPENDENCIES) $(EXTRA_libstatistics_regression_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libstatistics_regression_la_OBJECTS) $(libstatistics_regression_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_multi_grid_regression.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grids_trend_polynom.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_multi_regression.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_multi_regression_grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_multi_regression_points.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_regression.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_regression_grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gwr_grid_downscaling.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/point_grid_regression.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/point_multi_grid_regression.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/point_trend_surface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table_regression_multiple.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table_trend.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/statistics/statistics_regression/grid_multi_grid_regression.cpp b/src/modules/statistics/statistics_regression/grid_multi_grid_regression.cpp
new file mode 100644
index 0000000..f1fa0d0
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/grid_multi_grid_regression.cpp
@@ -0,0 +1,445 @@
+/**********************************************************
+ * Version $Id: grid_multi_grid_regression.cpp 1160 2011-09-14 15:11:54Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              grid_multi_grid_regression.cpp           //
+//                                                       //
+//                 Copyright (C) 2011 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "grid_multi_grid_regression.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrid_Multi_Grid_Regression::CGrid_Multi_Grid_Regression(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Multiple Regression Analysis (Grid/Grids)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Linear regression analysis of one grid as dependent and multiple grids as indepentent (predictor) variables. "
+		"Details of the regression/correlation analysis will be saved to a table. "
+		"Optionally the regression model is used to create a new grid with regression based values. "
+		"The multiple regression analysis uses a forward selection procedure. \n"
+		"\n"
+		"Reference:\n"
+		"- Bahrenberg, G., Giese, E., Nipper, J. (1992): "
+		"'Statistische Methoden in der Geographie 2 - Multivariate Statistik', "
+		"Stuttgart, 415p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEPENDENT"	, _TL("Dependent"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REGRESSION"	, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "RESIDUALS"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_COEFF"	, _TL("Details: Coefficients"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_MODEL"	, _TL("Details: Model"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_STEPS"	, _TL("Details: Steps"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"INTERPOL"		, _TL("Grid Interpolation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("Nearest Neighbor"),
+			_TL("Bilinear Interpolation"),
+			_TL("Inverse Distance Interpolation"),
+			_TL("Bicubic Spline Interpolation"),
+			_TL("B-Spline Interpolation")
+		), 4
+	);
+
+	Parameters.Add_Value(
+		NULL	, "COORD_X"		, _TL("Include X Coordinate"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "COORD_Y"		, _TL("Include Y Coordinate"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("include all"),
+			_TL("forward"),
+			_TL("backward"),
+			_TL("stepwise")
+		), 3
+	);
+
+	Parameters.Add_Value(
+		NULL	, "P_IN"		, _TL("P in"),
+		_TL("Level of significance for automated predictor selection, given as percentage"),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "P_OUT"		, _TL("P out"),
+		_TL("Level of significance for automated predictor selection, given as percentage"),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Multi_Grid_Regression::On_Execute(void)
+{
+	bool					bResult;
+	double					P_in, P_out;
+	CSG_Strings				Names;
+	CSG_Matrix				Samples;
+	CSG_Grid				*pDependent, *pRegression, *pResiduals;
+	CSG_Parameter_Grid_List	*pGrids;
+
+	//-----------------------------------------------------
+	pDependent		= Parameters("DEPENDENT")	->asGrid();
+	pGrids			= Parameters("GRIDS")		->asGridList();
+	pRegression		= Parameters("REGRESSION")	->asGrid();
+	pResiduals		= Parameters("RESIDUALS")	->asGrid();
+	P_in			= Parameters("P_IN")		->asDouble() / 100.0;
+	P_out			= Parameters("P_OUT")		->asDouble() / 100.0;
+
+	//-----------------------------------------------------
+	if( !Get_Samples(pGrids, pDependent, Samples, Names) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	switch( Parameters("METHOD")->asInt() )
+	{
+	default:
+	case 0:	bResult	= m_Regression.Get_Model         (Samples             , &Names);	break;
+	case 1:	bResult	= m_Regression.Get_Model_Forward (Samples, P_in       , &Names);	break;
+	case 2:	bResult	= m_Regression.Get_Model_Backward(Samples,       P_out, &Names);	break;
+	case 3:	bResult	= m_Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names);	break;
+	}
+
+	if( bResult == false )
+	{
+		return( false );
+	}
+
+	Message_Add(m_Regression.Get_Info(), false);
+
+	//-----------------------------------------------------
+	Set_Regression(pGrids, pDependent, pRegression, pResiduals, CSG_String::Format(SG_T("%s [%s]"), pDependent->Get_Name(), _TL("Regression Model")));
+
+	//-----------------------------------------------------
+	if( Parameters("INFO_COEFF")->asTable() )
+	{
+		Parameters("INFO_COEFF")->asTable()->Assign(m_Regression.Get_Info_Regression());
+		Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients"));
+	}
+
+	if( Parameters("INFO_MODEL")->asTable() )
+	{
+		Parameters("INFO_MODEL")->asTable()->Assign(m_Regression.Get_Info_Model());
+		Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model"));
+	}
+
+	if( Parameters("INFO_STEPS")->asTable() )
+	{
+		Parameters("INFO_STEPS")->asTable()->Assign(m_Regression.Get_Info_Steps());
+		Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps"));
+	}
+
+	//-----------------------------------------------------
+	m_Regression.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Multi_Grid_Regression::Get_Samples(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Matrix &Samples, CSG_Strings &Names)
+{
+	int			iGrid, x, y;
+	double		zGrid;
+	TSG_Point	p;
+	CSG_Vector	Sample;
+
+	//-----------------------------------------------------
+	int		Interpolation	= Parameters("INTERPOL")	->asInt();
+	bool	bCoord_X		= Parameters("COORD_X")		->asBool();
+	bool	bCoord_Y		= Parameters("COORD_Y")		->asBool();
+
+	Names	+= pDependent->Get_Name();					// Dependent Variable
+
+	for(iGrid=0; iGrid<pGrids->Get_Count(); iGrid++)	// Independent Variables
+	{
+		Names	+= pGrids->asGrid(iGrid)->Get_Name();
+	}
+
+	if( bCoord_X )	{	Names	+= SG_T("X");	}
+	if( bCoord_Y )	{	Names	+= SG_T("Y");	}
+
+	Sample.Create(1 + pGrids->Get_Count() + (bCoord_X ? 1 : 0) + (bCoord_Y ? 1 : 0));
+
+	//-----------------------------------------------------
+	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
+	{
+		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
+		{
+			if( !pDependent->is_NoData(x, y) )
+			{
+				bool		bAdd	= true;
+
+				for(iGrid=0; iGrid<pGrids->Get_Count() && bAdd; iGrid++)
+				{
+					if( pGrids->asGrid(iGrid)->Get_Value(p, zGrid, Interpolation) )
+					{
+						Sample[1 + iGrid]	= zGrid;
+					}
+					else
+					{
+						bAdd	= false;
+					}
+				}
+
+				if( bAdd )
+				{
+					Sample[0]	= pDependent->asDouble(x, y);
+
+					if( bCoord_X )	{	Sample[1 + iGrid++]	= p.x;	}
+					if( bCoord_Y )	{	Sample[1 + iGrid++]	= p.y;	}
+
+					Samples.Add_Row(Sample);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( Samples.Get_NRows() >= pGrids->Get_Count() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Multi_Grid_Regression::Set_Regression(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Grid *pRegression, CSG_Grid *pResiduals, const CSG_String &Name)
+{
+	//-----------------------------------------------------
+	int			iGrid, nGrids, x, y;
+	TSG_Point	p;
+
+	int		Interpolation	= Parameters("INTERPOL")->asInt();
+
+	CSG_Grid	**ppGrids	= (CSG_Grid **)SG_Malloc(m_Regression.Get_nPredictors() * sizeof(CSG_Grid *));
+
+	bool	bCoord_X		= false;
+	bool	bCoord_Y		= false;
+
+	for(iGrid=0, nGrids=0; iGrid<m_Regression.Get_nPredictors(); iGrid++)
+	{
+		if( m_Regression.Get_Predictor(iGrid) < pGrids->Get_Count() )
+		{
+			ppGrids[nGrids++]	= pGrids->asGrid(m_Regression.Get_Predictor(iGrid));
+		}
+		else if( m_Regression.Get_Predictor(iGrid) == pGrids->Get_Count() && Parameters("COORD_X")->asBool() )
+		{
+			bCoord_X = true;
+		}
+		else // if( m_Regression.Get_Predictor(iGrid) > pGrids->Get_Count() || Parameters("COORD_X")->asBool() == false )
+		{
+			bCoord_Y = true;
+		}
+	}
+
+	pRegression->Set_Name(Name);
+
+	if( pDependent && pResiduals )
+	{
+		pResiduals->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Name.c_str(), _TL("Residuals")));
+	}
+	else
+	{
+		pResiduals	= NULL;
+	}
+
+	//-----------------------------------------------------
+	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
+	{
+		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
+		{
+			bool	bOkay;
+			double	z	= m_Regression.Get_RConst();
+
+			for(iGrid=0, bOkay=true; bOkay && iGrid<nGrids; iGrid++)
+			{
+				double	zGrid;
+
+				if( ppGrids[iGrid]->Get_Value(p, zGrid, Interpolation) )
+				{
+					z	+= m_Regression.Get_RCoeff(iGrid) * zGrid;
+				}
+				else
+				{
+					bOkay	= false;
+				}
+			}
+
+			//---------------------------------------------
+			if( bOkay )
+			{
+				if( bCoord_X )
+				{
+					z	+= m_Regression.Get_RCoeff(iGrid++) * Get_System()->Get_xGrid_to_World(x);
+				}
+
+				if( bCoord_Y )
+				{
+					z	+= m_Regression.Get_RCoeff(iGrid++) * Get_System()->Get_yGrid_to_World(y);
+				}
+
+				pRegression->Set_Value (x, y, z);
+
+				if( pResiduals )
+				{
+					pResiduals->Set_Value(x, y, pDependent->asDouble(x, y) - z);
+				}
+			}
+			else
+			{
+				pRegression->Set_NoData(x, y);
+
+				if( pResiduals )
+				{
+					pResiduals->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	SG_Free(ppGrids);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/grid_multi_grid_regression.h b/src/modules/statistics/statistics_regression/grid_multi_grid_regression.h
new file mode 100644
index 0000000..fda4161
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/grid_multi_grid_regression.h
@@ -0,0 +1,108 @@
+/**********************************************************
+ * Version $Id: grid_multi_grid_regression.h 1160 2011-09-14 15:11:54Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               grid_multi_grid_regression.h            //
+//                                                       //
+//                 Copyright (C) 2011 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__grid_multi_grid_regression_H
+#define HEADER_INCLUDED__grid_multi_grid_regression_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_Multi_Grid_Regression : public CSG_Module_Grid
+{
+public:
+	CGrid_Multi_Grid_Regression(void);
+
+
+protected:
+
+	virtual bool				On_Execute			(void);
+
+
+private:
+
+	CSG_Regression_Multiple		m_Regression;
+
+
+	bool						Get_Samples			(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Matrix &Samples, CSG_Strings &Names);
+
+	bool						Set_Regression		(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Grid *pRegression, CSG_Grid *pResiduals, const CSG_String &Name);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__grid_multi_grid_regression_H
diff --git a/src/modules/statistics/statistics_regression/grids_trend_polynom.cpp b/src/modules/statistics/statistics_regression/grids_trend_polynom.cpp
new file mode 100644
index 0000000..898d49a
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/grids_trend_polynom.cpp
@@ -0,0 +1,304 @@
+/**********************************************************
+ * Version $Id: grids_trend_polynom.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                grids_trend_polynom.cpp                //
+//                                                       //
+//                 Copyright (C) 2011 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 "grids_trend_polynom.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGrids_Trend::CGrids_Trend(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Polynomial Trend from Grids"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Fits for each cell a polynomial trend function. "
+		"Outputs are the polynomial coefficients for the "
+		"polynomial trend function of chosen order. "
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "Y_GRIDS"	, _TL("Dependent Variables"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "COEFF"	, _TL("Polynomial Coefficients"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "R2"		, _TL("Coefficient of Determination"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL	, "ORDER"	, _TL("Polynomial Order"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "XSOURCE"	, _TL("Get Independent Variable from ..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("list order"),
+			_TL("table"),
+			_TL("grid list")
+		), 0
+	);
+
+	Parameters.Add_FixedTable(
+		NULL	, "X_TABLE"	, _TL("Independent Variable (per Grid)"),
+		_TL("")
+	)->asTable()->Add_Field(_TL("Value"), SG_DATATYPE_Double);
+
+	Parameters.Add_Grid_List(
+		NULL	, "X_GRIDS"	, _TL("Independent Variable (per Grid and Cell)"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	CSG_Table	*pTable	= Parameters("X_TABLE")->asTable();
+
+	pTable->Add_Record()->Set_Value(0, 1000.0);
+	pTable->Add_Record()->Set_Value(0,  925.0);
+	pTable->Add_Record()->Set_Value(0,  850.0);
+	pTable->Add_Record()->Set_Value(0,  700.0);
+	pTable->Add_Record()->Set_Value(0,  600.0);
+	pTable->Add_Record()->Set_Value(0,  500.0);
+	pTable->Add_Record()->Set_Value(0,  400.0);
+	pTable->Add_Record()->Set_Value(0,  300.0);
+	pTable->Add_Record()->Set_Value(0,  250.0);
+	pTable->Add_Record()->Set_Value(0,  200.0);
+	pTable->Add_Record()->Set_Value(0,  150.0);
+	pTable->Add_Record()->Set_Value(0,  100.0);
+	pTable->Add_Record()->Set_Value(0,   70.0);
+	pTable->Add_Record()->Set_Value(0,   50.0);
+	pTable->Add_Record()->Set_Value(0,   30.0);
+	pTable->Add_Record()->Set_Value(0,   20.0);
+	pTable->Add_Record()->Set_Value(0,   10.0);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGrids_Trend::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("XSOURCE")) )
+	{
+		pParameters->Get_Parameter("X_TABLE")->Set_Enabled(pParameter->asInt() == 1);	// table
+		pParameters->Get_Parameter("X_GRIDS")->Set_Enabled(pParameter->asInt() == 2);	// grid list
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrids_Trend::On_Execute(void)
+{
+	int						Order, xSource, nGrids;
+	CSG_Table				*pXTable;
+	CSG_Grid				*pR2;
+	CSG_Parameter_Grid_List	*pYGrids, *pCoeff, *pXGrids;
+
+	//-----------------------------------------------------
+	pYGrids	= Parameters("Y_GRIDS")->asGridList();
+	pCoeff	= Parameters("COEFF"  )->asGridList();
+	pR2		= Parameters("R2"     )->asGrid();
+	pXGrids	= Parameters("X_GRIDS")->asGridList();
+	pXTable	= Parameters("X_TABLE")->asTable();
+	Order	= Parameters("ORDER"  )->asInt();
+	xSource	= Parameters("XSOURCE")->asInt();
+
+	//-----------------------------------------------------
+	nGrids	= pYGrids->Get_Count();
+
+	if( nGrids <= Order )
+	{
+		Error_Set(_TL("fitting a polynom of ith order needs at least i + 1 samples"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	switch( xSource )
+	{
+	case 0:	nGrids	= pYGrids->Get_Count();	break;	// list order
+	case 1:	nGrids	= pXTable->Get_Count();	break;	// table
+	case 2:	nGrids	= pXGrids->Get_Count();	break;	// grid list
+	}
+
+	if( nGrids < pXGrids->Get_Count() )
+	{
+		Error_Set(_TL("There are less predictor variables then dependent ones."));
+
+		return( false );
+	}
+
+	if( nGrids > pXGrids->Get_Count() )
+	{
+		Message_Add(_TL("Warning: there are more predictor variables then dependent ones, surplus will be ignored."));
+
+		nGrids	= pYGrids->Get_Count();
+	}
+
+	//-----------------------------------------------------
+	pCoeff->Del_Items();
+
+	for(int i=0; i<=Order; i++)
+	{
+		pCoeff->Add_Item(SG_Create_Grid(*Get_System()));
+		pCoeff->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s [%d]"), _TL("Polynomial Coefficient"), i + 1));
+	}
+
+	if( pR2 )
+	{
+		pR2->Set_Name(CSG_String::Format(SG_T("%s"), _TL("Determination Coefficients")));
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			CSG_Trend_Polynom	Trend;
+
+			Trend.Set_Order(Order);
+
+			for(int i=0; i<nGrids; i++)
+			{
+				if( !pYGrids->asGrid(i)->is_NoData(x, y) )
+				{
+					switch( xSource )
+					{
+					case 0:	// list order
+						Trend.Add_Data(i, pYGrids->asGrid(i)->asDouble(x, y));
+						break;
+
+					case 1:	// table
+						Trend.Add_Data(pXTable->Get_Record(i)->asDouble(0), pYGrids->asGrid(i)->asDouble(x, y));
+						break;
+
+					case 2:	// grid list
+						if( !pXGrids->asGrid(i)->is_NoData(x, y) )
+						{
+							Trend.Add_Data(pXGrids->asGrid(i)->asDouble(x, y), pYGrids->asGrid(i)->asDouble(x, y));
+						}
+						break;
+					}
+				}
+			}
+
+			if( Trend.Get_Trend() )
+			{
+				for(int iOrder=0; iOrder<Trend.Get_nCoefficients(); iOrder++)
+				{
+					pCoeff->asGrid(iOrder)->Set_Value(x, y, Trend.Get_Coefficient(iOrder));
+				}
+
+				if( pR2 )	pR2->Set_Value(x, y, Trend.Get_R2());
+			}
+			else
+			{
+				for(int iOrder=0; iOrder<Trend.Get_nCoefficients(); iOrder++)
+				{
+					pCoeff->asGrid(iOrder)->Set_NoData(x, y);
+				}
+
+				if( pR2 )	pR2->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/grids_trend_polynom.h b/src/modules/statistics/statistics_regression/grids_trend_polynom.h
new file mode 100644
index 0000000..f9f476a
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/grids_trend_polynom.h
@@ -0,0 +1,105 @@
+/**********************************************************
+ * Version $Id: grids_trend_polynom.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 grids_trend_polynom.h                 //
+//                                                       //
+//                 Copyright (C) 2011 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__grids_trend_polynom_H
+#define HEADER_INCLUDED__grids_trend_polynom_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrids_Trend : public CSG_Module_Grid  
+{
+public:
+	CGrids_Trend(void);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//                                                       //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__grids_trend_polynom_H
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression.cpp b/src/modules/statistics/statistics_regression/gw_multi_regression.cpp
new file mode 100644
index 0000000..5f7e9dc
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression.cpp
@@ -0,0 +1,585 @@
+/**********************************************************
+ * Version $Id: gw_multi_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                gw_multi_regression.cpp                //
+//                                                       //
+//                 Copyright (C) 2010 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 "gw_multi_regression.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SG_ARRAY_DELETE(A)		if( A ) { delete[](A); A = NULL; }
+#define SG_ARRAY_FREE(A)		if( A ) { SG_Free (A); A = NULL; }
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGW_Multi_Regression::CGW_Multi_Regression(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Geographically Weighted Multiple Regression"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Reference:\n"
+		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL("")
+	);
+
+	Parameters.Add_Parameters(
+		pNode	, "PREDICTORS"	, _TL("Predictors"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "TARGET"		, _TL("Target Grids"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("user defined"),
+			_TL("grid")
+		), 0
+	);
+
+	m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid")	, _TL("")), false);
+	m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid")			, _TL("")), false);
+
+	m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY")   , _TL("Quality")  , false);
+	m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false);
+
+	//-----------------------------------------------------
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	);
+
+	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pSearch	= Parameters.Add_Node(
+		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
+		_TL("")
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local"),
+			_TL("global")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
+		_TL("local maximum search distance given in map units"),
+		PARAMETER_TYPE_Double	, 1000.0, 0, true
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("maximum number of nearest points"),
+			_TL("all points within search distance")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
+		_TL("minimum number of points to use"),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
+		_TL("maximum number of nearest points"),
+		PARAMETER_TYPE_Int, 20, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("all directions"),
+			_TL("quadrants")
+		)
+	);
+
+	//-----------------------------------------------------
+	m_iPredictor	= NULL;
+	m_pSlopes		= NULL;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Multi_Regression::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( m_Grid_Target.On_User_Changed(pParameters, pParameter) )
+	{
+		return( true );
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) )
+	{
+		CSG_Shapes		*pPoints		= pParameters->Get_Parameter("POINTS"    )->asShapes();
+		CSG_Parameters	*pAttributes	= pParameters->Get_Parameter("PREDICTORS")->asParameters();
+
+		pAttributes->Destroy();
+		pAttributes->Set_Name(_TL("Predictors"));
+
+		for(int i=0; pPoints && i<pPoints->Get_Field_Count(); i++)
+		{
+			switch( pPoints->Get_Field_Type(i) )
+			{
+			default:	// not numeric
+				break;
+
+			case SG_DATATYPE_Byte:
+			case SG_DATATYPE_Char:
+			case SG_DATATYPE_Word:
+			case SG_DATATYPE_Short:
+			case SG_DATATYPE_DWord:
+			case SG_DATATYPE_Int:
+			case SG_DATATYPE_ULong:
+			case SG_DATATYPE_Long:
+			case SG_DATATYPE_Float:
+			case SG_DATATYPE_Double:
+				pAttributes->Add_Value(
+					NULL, SG_Get_String(i, 0), pPoints->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false
+				);
+				break;
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+int CGW_Multi_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
+	{
+		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
+	{
+		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
+		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
+	}
+
+	m_Weighting.Enable_Parameters(pParameters);
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression::Get_Predictors(void)
+{
+	int				i;
+	CSG_Shapes		*pPoints		= Parameters("POINTS")		->asShapes();
+	CSG_Parameters	*pAttributes	= Parameters("PREDICTORS")	->asParameters();
+
+	m_nPredictors	= 0;
+	m_iPredictor	= new int[pPoints->Get_Field_Count()];
+
+	for(i=0; i<pAttributes->Get_Count(); i++)
+	{
+		if( pAttributes->Get_Parameter(i)->asBool() )
+		{
+			m_iPredictor[m_nPredictors++]	= CSG_String(pAttributes->Get_Parameter(i)->Get_Identifier()).asInt();
+		}
+	}
+
+	CSG_Parameters	*pGrids	= Get_Parameters("GRID"), Tmp;
+
+	Tmp.Assign(pGrids);
+
+	pGrids->Create(this, Tmp.Get_Name(), Tmp.Get_Description(), Tmp.Get_Identifier(), false);
+	m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY")   , _TL("Quality")  , false);
+	m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false);
+
+	pGrids->Get_Parameter("QUALITY")->Get_Parent()->asGrid_System()->Assign(*Tmp("QUALITY")->Get_Parent()->asGrid_System());
+	pGrids->Get_Parameter("QUALITY")  ->Set_Value(Tmp("QUALITY")  ->asGrid());
+	pGrids->Get_Parameter("INTERCEPT")->Set_Value(Tmp("INTERCEPT")->asGrid());
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		m_Grid_Target.Add_Grid_Parameter(SG_Get_String(i, 0),
+			CSG_String::Format(SG_T("%s [%s]"), _TL("Slope"), pPoints->Get_Field_Name(m_iPredictor[i])), false
+		);
+
+		if( Tmp(SG_Get_String(i, 0)) )
+		{
+			pGrids->Get_Parameter(SG_Get_String(i, 0))->Set_Value(Tmp(SG_Get_String(i, 0))->asGrid());
+		}
+	}
+
+	return( m_nPredictors > 0 );
+}
+
+//---------------------------------------------------------
+void CGW_Multi_Regression::Finalize(void)
+{
+	SG_ARRAY_DELETE(m_iPredictor);
+
+	SG_ARRAY_FREE  (m_pSlopes);
+
+	m_Search.Destroy();
+
+	m_y.Destroy();
+	m_z.Destroy();
+	m_w.Destroy();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pPoints		= Parameters("POINTS"           )->asShapes();
+	m_iDependent	= Parameters("DEPENDENT"        )->asInt   ();
+
+	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
+	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
+					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
+	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
+					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
+	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
+
+	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	if( !Get_Predictors() )
+	{
+		Finalize();
+
+		return( false );
+	}
+
+	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
+	{
+		Finalize();
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int		i;
+
+	m_pQuality		= NULL;
+	m_pIntercept	= NULL;
+	m_pSlopes		= (CSG_Grid **)SG_Calloc(m_nPredictors, sizeof(CSG_Grid *));
+
+	switch( Parameters("TARGET")->asInt() )
+	{
+	case 0:	// user defined...
+		if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") )
+		{
+			m_pQuality		= m_Grid_Target.Get_User(SG_T("QUALITY"  ));
+			m_pIntercept	= m_Grid_Target.Get_User(SG_T("INTERCEPT"));
+
+			for(i=0; i<m_nPredictors; i++)
+			{
+				m_pSlopes[i]	= m_Grid_Target.Get_User(SG_Get_String(i, 0));
+			}
+		}
+		break;
+
+	case 1:	// grid...
+		if( Dlg_Parameters("GRID") )
+		{
+			m_pQuality		= m_Grid_Target.Get_Grid(SG_T("QUALITY"  ));
+			m_pIntercept	= m_Grid_Target.Get_Grid(SG_T("INTERCEPT"));
+
+			for(i=0; i<m_nPredictors; i++)
+			{
+				m_pSlopes[i]	= m_Grid_Target.Get_Grid(SG_Get_String(i, 0));
+			}
+		}
+		break;
+	}
+
+	if( m_pQuality == NULL )
+	{
+		Finalize();
+
+		return( false );
+	}
+
+	m_pQuality  ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Quality")));
+	m_pIntercept->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Intercept")));
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		m_pSlopes[i]->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), m_pPoints->Get_Field_Name(m_iPredictor[i])));
+	}
+
+	//-----------------------------------------------------
+	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
+
+	m_y.Create(1 + m_nPredictors, nPoints_Max);
+	m_z.Create(nPoints_Max);
+	m_w.Create(nPoints_Max);
+
+	//-----------------------------------------------------
+	for(int y=0; y<m_pIntercept->Get_NY() && Set_Progress(y, m_pIntercept->Get_NY()); y++)
+	{
+		for(int x=0; x<m_pIntercept->Get_NX(); x++)
+		{
+			if( !Get_Regression(x, y) )
+			{
+				m_pQuality  ->Set_NoData(x, y);
+				m_pIntercept->Set_NoData(x, y);
+
+				for(i=0; i<m_nPredictors; i++)
+				{
+					m_pSlopes[i]->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Finalize();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Multi_Regression::Set_Variables(int x, int y)
+{
+	int			iPoint, jPoint, nPoints, iPredictor;
+	TSG_Point	Point;
+	CSG_Shape	*pPoint;
+
+	Point	= m_pIntercept->Get_System().Get_Grid_to_World(x, y);
+	nPoints	= m_Search.is_Okay() ? (int)m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
+
+	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
+	{
+		if( m_Search.is_Okay() )
+		{
+			double	ix, iy, iz;
+
+			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
+
+			pPoint	= m_pPoints->Get_Shape((int)iz);
+		}
+		else
+		{
+			pPoint	= m_pPoints->Get_Shape(iPoint);
+		}
+
+		if( !pPoint->is_NoData(m_iDependent) )
+		{
+			m_z[jPoint]	= pPoint->asDouble(m_iDependent);
+			m_w[jPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
+
+			for(iPredictor=0; iPredictor<m_nPredictors; iPredictor++)
+			{
+				if( !pPoint->is_NoData(m_iPredictor[iPredictor]) )
+				{
+					m_y[jPoint][iPredictor]	= pPoint->asDouble(m_iPredictor[iPredictor]);
+				}
+				else
+				{
+					iPredictor	= m_nPredictors + 1;
+				}
+			}
+
+			if( iPredictor == m_nPredictors )
+			{
+				jPoint++;
+			}
+		}
+	}
+
+	return( jPoint );
+}
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression::Get_Regression(int x, int y)
+{
+	int		nPoints	= Set_Variables(x, y);
+
+	if( nPoints < m_nPoints_Min )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			i;
+	double		zMean, rss, tss;
+	CSG_Vector	b, z;
+	CSG_Matrix	Y, YtW;
+
+	//-----------------------------------------------------
+	z  .Create(nPoints);
+	Y  .Create(1 + m_nPredictors, nPoints);
+	YtW.Create(nPoints, 1 + m_nPredictors);
+
+	for(i=0, zMean=0.0; i<nPoints; i++)
+	{
+		Y  [i][0]	= 1.0;
+		YtW[0][i]	= m_w[i];
+
+		for(int j=0; j<m_nPredictors; j++)
+		{
+			Y  [i][j + 1]	= m_y[i][j];
+			YtW[j + 1][i]	= m_y[i][j] * m_w[i];
+		}
+
+		zMean		+= (z[i] = m_z[i]);
+	}
+
+	//-----------------------------------------------------
+	b		= (YtW * Y).Get_Inverse() * (YtW * z);
+
+	zMean	/= nPoints;
+
+	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
+	{
+		double	zr	= b[0];
+
+		for(int j=0; j<m_nPredictors; j++)
+		{
+			zr	+= b[j + 1] * m_y[i][j];
+		}
+
+		rss	+= m_w[i] * SG_Get_Square(m_z[i] - zr);
+		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
+	}
+
+	m_pQuality  ->Set_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0);
+
+	m_pIntercept->Set_Value(x, y, b[0]);
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		m_pSlopes[i]->Set_Value(x, y, b[i + 1]);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression.h b/src/modules/statistics/statistics_regression/gw_multi_regression.h
new file mode 100644
index 0000000..5e1dfa8
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression.h
@@ -0,0 +1,133 @@
+/**********************************************************
+ * Version $Id: gw_multi_regression.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 gw_multi_regression.h                 //
+//                                                       //
+//                 Copyright (C) 2010 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__gw_multi_regression_H
+#define HEADER_INCLUDED__gw_multi_regression_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGW_Multi_Regression : public CSG_Module
+{
+public:
+	CGW_Multi_Regression(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	int							m_iDependent, *m_iPredictor, m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction;
+
+	double						m_Radius;
+
+	CSG_Parameters_Grid_Target	m_Grid_Target;
+
+	CSG_Distance_Weighting		m_Weighting;
+
+	CSG_PRQuadTree				m_Search;
+
+	CSG_Vector					m_z, m_w;
+
+	CSG_Matrix					m_y;
+
+	CSG_Shapes					*m_pPoints;
+
+	CSG_Grid					*m_pQuality, *m_pIntercept, **m_pSlopes;
+
+
+	void						Finalize				(void);
+
+	bool						Get_Predictors			(void);
+
+	int							Set_Variables			(int x, int y);
+
+	bool						Get_Regression			(int x, int y);
+
+	bool						Set_Residuals			(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__gw_multi_regression_H
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression_grid.cpp b/src/modules/statistics/statistics_regression/gw_multi_regression_grid.cpp
new file mode 100644
index 0000000..58bb84f
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression_grid.cpp
@@ -0,0 +1,739 @@
+/**********************************************************
+ * Version $Id: gw_multi_regression_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             gw_multi_regression_grid.cpp              //
+//                                                       //
+//                 Copyright (C) 2010 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 "gw_multi_regression_grid.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define GRID_SET_NODATA(g, x, y)	if( g ) { g->Set_NoData(x, y); }
+#define GRID_SET_VALUE(g, x, y, z)	if( g ) { g->Set_Value(x, y, z); }
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGW_Multi_Regression_Grid::CGW_Multi_Regression_Grid(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("GWR Gridding (Points/Grids)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"References:\n"
+		"- Fotheringham, S.A., Brunsdon, C., Charlton, M. (2002):"
+		" Geographically Weighted Regression: the analysis of spatially varying relationships. John Wiley & Sons."
+		" <a target=\"_blank\" href=\"http://onlinelibrary.wiley.com/doi/10.1111/j.1538-4632.2003.tb01114.x/abstract\">online</a>.\n"
+		"\n"
+		"- Fotheringham, S.A., Charlton, M., Brunsdon, C. (1998):"
+		" Geographically weighted regression: a natural evolution of the expansion method for spatial data analysis."
+		" Environment and Planning A 30(11), 1905�1927."
+		" <a target=\"_blank\" href=\"http://www.envplan.com/abstract.cgi?id=a301905\">online</a>.\n"
+		"\n"
+		"- Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "PREDICTORS"	, _TL("Predictors"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REGRESSION"	, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "QUALITY"		, _TL("Coefficient of Determination"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "MODEL"		, _TL("Regression Parameters"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MODEL_OUT"	, _TL("Output of Regression Parameters"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL("")
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "RESIDUALS"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Choice(
+		NULL	, "RESOLUTION"	, _TL("Model Resolution"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("same as predictors"),
+			_TL("user defined")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RESOLUTION_VAL"	, _TL("Resolution"),
+		_TL("map units"),
+		PARAMETER_TYPE_Double	, 1.0, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Weighting.Create_Parameters(&Parameters, false);
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pSearch	= Parameters.Add_Node(
+		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
+		_TL("")
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local"),
+			_TL("global")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
+		_TL("local maximum search distance given in map units"),
+		PARAMETER_TYPE_Double	, 1000.0, 0, true
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("maximum number of nearest points"),
+			_TL("all points within search distance")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
+		_TL("minimum number of points to use"),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
+		_TL("maximum number of nearest points"),
+		PARAMETER_TYPE_Int, 50, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("all directions"),
+			_TL("quadrants")
+		)
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Multi_Regression_Grid::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) && pParameter->asShapes() )
+	{
+		double	d	= pParameter->asShapes()->Get_Extent().Get_XRange() / 20.0;
+
+		pParameters->Get_Parameter("RESOLUTION_VAL")->Set_Value(d);
+	}
+
+	return( 1 );
+}
+
+//---------------------------------------------------------
+int CGW_Multi_Regression_Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("RESOLUTION")) )
+	{
+		pParameters->Get_Parameter("RESOLUTION_VAL"   )->Set_Enabled(pParameter->asInt() == 1);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
+	{
+		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
+		pParameters->Get_Parameter("SEARCH_POINTS_MIN")->Set_Enabled(pParameter->asInt() == 0);	// local
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
+	{
+		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
+		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
+	}
+
+	m_Weighting.Enable_Parameters(pParameters);
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::On_Execute(void)
+{
+	int		i;
+
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pPredictors	= Parameters("PREDICTORS")->asGridList();
+
+	if( !Initialize(Parameters("POINTS")->asShapes(), Parameters("DEPENDENT")->asInt(), pPredictors) )
+	{
+		Finalize();
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Grid	Quality;
+
+	m_dimModel	= *Get_System();
+
+	if( Parameters("RESOLUTION")->asInt() == 1 && Parameters("RESOLUTION_VAL")->asDouble() > Get_Cellsize() )
+	{
+		CSG_Rect	r(Get_System()->Get_Extent()); r.Inflate(0.5 * Parameters("RESOLUTION_VAL")->asDouble(), false);
+
+		m_dimModel.Assign(Parameters("RESOLUTION_VAL")->asDouble(), r);
+
+		Quality.Create(m_dimModel);
+		m_pQuality	= &Quality;
+	}
+	else
+	{
+		m_pQuality	= Parameters("QUALITY")->asGrid();
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("upsetting model domain"));
+
+	m_pPredictors	= (CSG_Grid **)SG_Calloc(m_nPredictors    , sizeof(CSG_Grid *));
+	m_pModel		= (CSG_Grid **)SG_Calloc(m_nPredictors + 1, sizeof(CSG_Grid *));
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		if( m_dimModel.Get_Cellsize() > Get_Cellsize() )	// scaling
+		{
+			m_pPredictors[i]	= SG_Create_Grid(m_dimModel);
+			m_pPredictors[i]	->Assign(pPredictors->asGrid(i), GRID_INTERPOLATION_NearestNeighbour);	// GRID_INTERPOLATION_Mean_Cells
+		}
+		else
+		{
+			m_pPredictors[i]	= pPredictors->asGrid(i);
+		}
+
+		m_pModel     [i]	= SG_Create_Grid(m_dimModel);
+		m_pModel     [i]	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPredictors->asGrid(i)->Get_Name(), _TL("Factor")));
+	}
+
+	m_pModel[m_nPredictors]	= SG_Create_Grid(m_dimModel);
+	m_pModel[m_nPredictors]	->Set_Name(_TL("Intercept"));
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("model creation"));
+
+	bool	bResult	= Get_Model();
+
+	//-----------------------------------------------------
+	if( m_dimModel.Get_Cellsize() > Get_Cellsize() )	// scaling
+	{
+		for(i=0; i<m_nPredictors; i++)
+		{
+			delete(m_pPredictors[i]);
+
+			m_pPredictors[i]	= pPredictors->asGrid(i);
+		}
+	}
+
+	//-----------------------------------------------------
+	if( bResult )
+	{
+		Process_Set_Text(_TL("model application"));
+
+		bResult	= Set_Model();
+	}
+
+	//-----------------------------------------------------
+	if( Parameters("MODEL_OUT")->asBool() )
+	{
+		CSG_Parameter_Grid_List	*pModel	= Parameters("MODEL")->asGridList();
+
+		pModel->Del_Items();
+		pModel->Add_Item(m_pModel[m_nPredictors]);
+
+		for(i=0; i<m_nPredictors; i++)
+		{
+			pModel->Add_Item(m_pModel[i]);
+		}
+	}
+	else
+	{
+		for(i=0; i<=m_nPredictors; i++)
+		{
+			delete(m_pModel[i]);
+		}
+	}
+
+	SG_FREE_SAFE(m_pModel);
+	SG_FREE_SAFE(m_pPredictors);
+
+	Finalize();
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::Initialize(CSG_Shapes *pPoints, int iDependent, CSG_Parameter_Grid_List *pPredictors)
+{
+	//-----------------------------------------------------
+	if( (m_nPredictors = pPredictors->Get_Count()) <= 0 )
+	{
+		return( false );
+	}
+
+	if( !pPoints->Get_Extent().Intersects(Get_System()->Get_Extent()) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int	iPredictor, Interpolation	= GRID_INTERPOLATION_BSpline;
+
+	m_Points.Create   (SHAPE_TYPE_Point);
+	m_Points.Set_Name (Parameters("DEPENDENT")->asString());
+	m_Points.Add_Field(Parameters("DEPENDENT")->asString(), SG_DATATYPE_Double);
+
+	for(iPredictor=0; iPredictor<pPredictors->Get_Count(); iPredictor++)
+	{
+		m_Points.Add_Field(pPredictors->asGrid(iPredictor)->Get_Name(), SG_DATATYPE_Double);
+	}
+
+	//-----------------------------------------------------
+	for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
+	{
+		CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
+
+		if( !pPoint->is_NoData(iDependent) )
+		{
+			CSG_Vector	z(1 + m_nPredictors);	z[0]	= pPoint->asDouble(iDependent);
+			TSG_Point	Point	= pPoint->Get_Point(0);
+			bool		bAdd	= true;
+
+			for(iPredictor=0; bAdd && iPredictor<m_nPredictors; iPredictor++)
+			{
+				if( !pPredictors->asGrid(iPredictor)->Get_Value(Point, z[iPredictor + 1], Interpolation) )
+				{
+					bAdd	= false;
+				}
+			}
+
+			if( bAdd )
+			{
+				(pPoint	= m_Points.Add_Shape())->Add_Point(Point);
+
+				for(iPredictor=0; iPredictor<=m_nPredictors; iPredictor++)
+				{
+					pPoint->Set_Value(iPredictor, z[iPredictor]);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
+	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
+					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
+	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
+					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
+	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
+
+	m_Weighting.Set_Parameters(&Parameters);
+
+	return( m_Points.Get_Count() > m_nPredictors
+		&& ((m_nPoints_Max <= 0 && m_Radius <= 0.0) || m_Search.Create(&m_Points, -1))
+	);
+}
+
+//---------------------------------------------------------
+void CGW_Multi_Regression_Grid::Finalize(void)
+{
+	m_Points.Destroy();
+	m_Search.Destroy();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::Get_Model(void)
+{
+	//-----------------------------------------------------
+	for(int y=0; y<m_dimModel.Get_NY() && Set_Progress(y, m_dimModel.Get_NY()); y++)
+	{
+		for(int x=0; x<m_dimModel.Get_NX(); x++)
+		{
+			double		q;
+			CSG_Vector	b;
+
+			if( Get_Regression(x, y, q, b) )
+			{
+				m_pQuality->Set_Value(x, y, q);
+
+				m_pModel[m_nPredictors]->Set_Value(x, y, b[0]);
+
+				for(int i=0; i<m_nPredictors; i++)
+				{
+					m_pModel[i]->Set_Value(x, y, b[i + 1]);
+				}
+			}
+			else
+			{
+				m_pQuality->Set_NoData(x, y);
+
+				for(int i=0; i<=m_nPredictors; i++)
+				{
+					m_pModel[i]->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::Get_Regression(int x, int y, double &Quality, CSG_Vector &b)
+{
+	//-----------------------------------------------------
+	int			i, nPoints;
+	double		zMean, zr, rss, tss;
+	CSG_Vector	z, w;
+	CSG_Matrix	Y, YtW;
+
+	if( (nPoints = Get_Variables(x, y, z, w, Y)) <= m_nPredictors )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	YtW.Create(nPoints, 1 + m_nPredictors);
+
+	for(i=0, zMean=0.0; i<nPoints; i++)
+	{
+		zMean		+= z[i];
+		YtW[0][i]	 = w[i];
+
+		for(int j=1; j<=m_nPredictors; j++)
+		{
+			YtW[j][i]	= Y[i][j] * w[i];
+		}
+	}
+
+	//-----------------------------------------------------
+	b		= (YtW * Y).Get_Inverse() * (YtW * z);
+
+	zMean	/= nPoints;
+
+	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
+	{
+		zr	= b[0];
+
+		for(int j=1; j<=m_nPredictors; j++)
+		{
+			zr	+= b[j] * Y[i][j];
+		}
+
+		rss	+= w[i] * SG_Get_Square(z[i] - zr);
+		tss	+= w[i] * SG_Get_Square(z[i] - zMean);
+	}
+
+	Quality	= tss > 0.0 ? (tss - rss) / tss : 0.0;
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+int CGW_Multi_Regression_Grid::Get_Variables(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y)
+{
+	TSG_Point	Point	= m_dimModel.Get_Grid_to_World(x, y);
+	int			nPoints	= m_Search.is_Okay() ? (int)m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_Points.Get_Count();
+
+	z.Create(nPoints);
+	w.Create(nPoints);
+	Y.Create(1 + m_nPredictors, nPoints);
+
+	for(int iPoint=0; iPoint<nPoints; iPoint++)
+	{
+		double	ix, iy, iz;
+
+		CSG_Shape	*pPoint	= m_Search.is_Okay() && m_Search.Get_Selected_Point(iPoint, ix, iy, iz)
+			? m_Points.Get_Shape((int)iz)
+			: m_Points.Get_Shape(iPoint);
+
+		z[iPoint]		= pPoint->asDouble(0);
+		w[iPoint]		= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
+		Y[iPoint][0]	= 1.0;
+
+		for(int iPredictor=1; iPredictor<=m_nPredictors; iPredictor++)
+		{
+			Y[iPoint][iPredictor]	= pPoint->asDouble(iPredictor);
+		}
+	}
+
+	return( nPoints );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::Set_Model(double x, double y, double &Value)
+{
+	if( !m_pModel[m_nPredictors]->Get_Value(x, y, Value, GRID_INTERPOLATION_BSpline) )
+	{
+		return( false );
+	}
+
+	double	Model, Predictor;
+
+	for(int i=0; i<m_nPredictors; i++)
+	{
+		if( !m_pModel     [i]->Get_Value(x, y, Model    , GRID_INTERPOLATION_BSpline)
+		||  !m_pPredictors[i]->Get_Value(x, y, Predictor, GRID_INTERPOLATION_NearestNeighbour) )
+		{
+			return( false );
+		}
+
+		Value	+= Model * Predictor;
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::Set_Model(void)
+{
+	CSG_Grid	*pRegression	= Parameters("REGRESSION")->asGrid();
+	CSG_Grid	*pQuality		= Parameters("QUALITY"   )->asGrid();
+
+	pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"    ), m_Points.Get_Name(), _TL("GWR")));
+	pQuality   ->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_Points.Get_Name(), _TL("GWR"), _TL("Quality")));
+
+	if( m_pQuality == Parameters("QUALITY")->asGrid() )
+	{
+		pQuality	= NULL;
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		double	p_y	= Get_YMin() + y * Get_Cellsize();
+
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	Value, p_x	= Get_XMin() + x * Get_Cellsize();
+
+			if( Set_Model(p_x, p_y, Value) )
+			{
+				GRID_SET_VALUE(pRegression, x, y, Value);
+				GRID_SET_VALUE(pQuality   , x, y, m_pQuality->Get_Value(p_x, p_y));
+			}
+			else
+			{
+				GRID_SET_NODATA(pRegression, x, y);
+				GRID_SET_NODATA(pQuality   , x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Set_Residuals();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Grid::Set_Residuals(void)
+{
+	CSG_Shapes	*pResiduals	= Parameters("RESIDUALS")->asShapes();
+
+	if( !pResiduals )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_Points.Get_Name(), _TL("Residuals")));
+	pResiduals->Add_Field(m_Points.Get_Field_Name(0), SG_DATATYPE_Double);
+	pResiduals->Add_Field("TREND"	, SG_DATATYPE_Double);
+	pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
+
+	//-------------------------------------------------
+	for(int iShape=0; iShape<m_Points.Get_Count() && Set_Progress(iShape, m_Points.Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= m_Points.Get_Shape(iShape);
+		double		 zShape	= pShape->asDouble(0);
+
+		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+		{
+			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			{
+				double	zRegression;
+
+				TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
+
+				if( Set_Model(Point.x, Point.y, zRegression) )
+				{
+					CSG_Shape	*pResidual	= pResiduals->Add_Shape();
+
+					pResidual->Add_Point(Point);
+					pResidual->Set_Value(0, zShape);
+					pResidual->Set_Value(1, zRegression);
+					pResidual->Set_Value(2, zShape - zRegression);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression_grid.h b/src/modules/statistics/statistics_regression/gw_multi_regression_grid.h
new file mode 100644
index 0000000..e949e72
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression_grid.h
@@ -0,0 +1,131 @@
+/**********************************************************
+ * Version $Id: gw_multi_regression_grid.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              gw_multi_regression_grid.h               //
+//                                                       //
+//                 Copyright (C) 2010 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__gw_multi_regression_grid_H
+#define HEADER_INCLUDED__gw_multi_regression_grid_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGW_Multi_Regression_Grid : public CSG_Module_Grid
+{
+public:
+	CGW_Multi_Regression_Grid(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
+
+
+protected:
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+
+private:
+
+	int							m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction;
+
+	CSG_Grid					**m_pPredictors, **m_pModel, *m_pQuality;
+
+	CSG_Grid_System				m_dimModel;
+
+	double						m_Radius;
+
+	CSG_Distance_Weighting		m_Weighting;
+
+	CSG_PRQuadTree				m_Search;
+
+	CSG_Shapes					m_Points;
+
+
+	bool						Initialize				(CSG_Shapes *pPoints, int iDependent, CSG_Parameter_Grid_List *pPredictors);
+	void						Finalize				(void);
+
+	bool						Get_Model				(void);
+	bool						Get_Regression			(int x, int y, double &Quality, CSG_Vector &b);
+	int							Get_Variables			(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y);
+
+	bool						Set_Model				(void);
+	bool						Set_Model				(double x, double y, double &Value);
+
+	bool						Set_Residuals			(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__gw_multi_regression_grid_H
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression_points.cpp b/src/modules/statistics/statistics_regression/gw_multi_regression_points.cpp
new file mode 100644
index 0000000..bae46ee
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression_points.cpp
@@ -0,0 +1,524 @@
+/**********************************************************
+ * Version $Id: gw_multi_regression_points.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             gw_multi_regression_points.cpp            //
+//                                                       //
+//                 Copyright (C) 2010 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 "gw_multi_regression_points.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SG_ARRAY_FREE(A)		if( A ) { SG_Free (A); A = NULL; }
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGW_Multi_Regression_Points::CGW_Multi_Regression_Points(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Geographically Weighted Multiple Regression (Points)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Reference:\n"
+		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL("")
+	);
+
+	Parameters.Add_Parameters(
+		pNode	, "PREDICTORS"	, _TL("Predictors"),
+		_TL("")
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "REGRESSION"		, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	);
+
+	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pSearch	= Parameters.Add_Node(
+		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
+		_TL("")
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local"),
+			_TL("global")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
+		_TL("local maximum search distance given in map units"),
+		PARAMETER_TYPE_Double	, 1000.0, 0, true
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("maximum number of nearest points"),
+			_TL("all points within search distance")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
+		_TL("minimum number of points to use"),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
+		_TL("maximum number of nearest points"),
+		PARAMETER_TYPE_Int, 20, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("all directions"),
+			_TL("quadrants")
+		)
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Multi_Regression_Points::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) )
+	{
+		CSG_Shapes		*pPoints		= pParameters->Get_Parameter("POINTS")		->asShapes();
+		CSG_Parameters	*pAttributes	= pParameters->Get_Parameter("PREDICTORS")	->asParameters();
+
+		pAttributes->Destroy();
+		pAttributes->Set_Name(_TL("Predictors"));
+
+		for(int i=0; pPoints && i<pPoints->Get_Field_Count(); i++)
+		{
+			if( SG_Data_Type_is_Numeric(pPoints->Get_Field_Type(i)) )
+			{
+				pAttributes->Add_Value(
+					NULL, SG_Get_String(i, 0), pPoints->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false
+				);
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+int CGW_Multi_Regression_Points::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
+	{
+		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
+	{
+		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
+		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
+	}
+
+	m_Weighting.Enable_Parameters(pParameters);
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Points::Get_Predictors(void)
+{
+	int				i, iDependent, *Predictor;
+	CSG_Shapes		*pPoints;
+	CSG_Parameters	*pAttributes;
+
+	//-----------------------------------------------------
+	m_pPoints		= Parameters("REGRESSION"       )->asShapes();
+
+	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
+	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
+					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
+	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
+					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
+	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
+
+	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	iDependent		= Parameters("DEPENDENT" )->asInt();
+	pPoints			= Parameters("POINTS"    )->asShapes();;
+	pAttributes		= Parameters("PREDICTORS")->asParameters();
+
+	m_pPoints->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("GWR"), pPoints->Get_Field_Name(iDependent)));
+	m_pPoints->Add_Field(pPoints->Get_Field_Name(iDependent), SG_DATATYPE_Double);
+
+	m_nPredictors	= 0;
+	Predictor		= new int[pPoints->Get_Field_Count()];
+
+	for(i=0; i<pAttributes->Get_Count(); i++)
+	{
+		CSG_Parameter	*pAttribute	= pAttributes->Get_Parameter(i);
+
+		if( pAttribute->asBool() )
+		{
+			Predictor[m_nPredictors++]	= CSG_String(pAttribute->Get_Identifier()).asInt();
+
+			m_pPoints->Add_Field(CSG_String::Format(SG_T("P%d %s"), m_nPredictors, pAttribute->Get_Name()), SG_DATATYPE_Double);
+		}
+	}
+
+	if( m_nPredictors == 0 )
+	{
+		delete[](Predictor);
+
+		Error_Set(_TL("no predictors have been selected"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_pPoints->Add_Field(SG_T("R2")			, SG_DATATYPE_Double);
+	m_pPoints->Add_Field(SG_T("REGRESSION")	, SG_DATATYPE_Double);
+	m_pPoints->Add_Field(SG_T("RESIDUAL")	, SG_DATATYPE_Double);
+	m_pPoints->Add_Field(SG_T("INTERCEPT")	, SG_DATATYPE_Double);
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		m_pPoints->Add_Field(CSG_String::Format(SG_T("R%d"), 1 + i), SG_DATATYPE_Double);
+	}
+
+	for(int iPoint=0; iPoint<pPoints->Get_Count(); iPoint++)
+	{
+		CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
+
+		bool	bAdd	= !pPoint->is_NoData(iDependent);
+
+		for(i=0; bAdd && i<m_nPredictors; i++)
+		{
+			if( pPoint->is_NoData(Predictor[i]) )
+			{
+				bAdd	= false;
+			}
+		}
+
+		if( bAdd )
+		{
+			CSG_Shape	*pAdd	= m_pPoints->Add_Shape();
+
+			pAdd->Add_Point(pPoint->Get_Point(0));
+
+			pAdd->Set_Value(0, pPoint->asDouble(iDependent));
+
+			for(i=0; i<m_nPredictors; i++)
+			{
+				pAdd->Set_Value(1 + i, pPoint->asDouble(Predictor[i]));
+			}
+		}
+	}
+
+	delete[](Predictor);
+
+	//-----------------------------------------------------
+	if( m_pPoints->Get_Count() == 0 )
+	{
+		Error_Set(_TL("invalid data"));
+
+		return( false );
+	}
+
+	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
+	{
+		Error_Set(_TL("failed to create searche engine"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
+
+	m_y.Create(1 + m_nPredictors, nPoints_Max);
+	m_z.Create(nPoints_Max);
+	m_w.Create(nPoints_Max);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+void CGW_Multi_Regression_Points::Finalize(void)
+{
+	m_Search.Destroy();
+
+	m_y.Destroy();
+	m_z.Destroy();
+	m_w.Destroy();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Points::On_Execute(void)
+{
+	//-----------------------------------------------------
+	if( !Get_Predictors() )
+	{
+		Finalize();
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(int iPoint=0; iPoint<m_pPoints->Get_Count() && Set_Progress(iPoint, m_pPoints->Get_Count()); iPoint++)
+	{
+		if( !Get_Regression(m_pPoints->Get_Shape(iPoint)) )
+		{
+		}
+	}
+
+	//-----------------------------------------------------
+	Finalize();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Multi_Regression_Points::Set_Variables(const TSG_Point &Point)
+{
+	int			iPoint, jPoint, nPoints, iPredictor;
+	CSG_Shape	*pPoint;
+
+	nPoints	= m_Search.is_Okay() ? (int)m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
+
+	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
+	{
+		if( m_Search.is_Okay() )
+		{
+			double	ix, iy, iz;
+
+			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
+
+			pPoint	= m_pPoints->Get_Shape((int)iz);
+		}
+		else
+		{
+			pPoint	= m_pPoints->Get_Shape(iPoint);
+		}
+
+		m_z[iPoint]	= pPoint->asDouble(0);
+		m_w[iPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
+
+		for(iPredictor=0; iPredictor<m_nPredictors; iPredictor++)
+		{
+			m_y[iPoint][iPredictor]	= pPoint->asDouble(1 + iPredictor);
+		}
+	}
+
+	return( nPoints );
+}
+
+//---------------------------------------------------------
+bool CGW_Multi_Regression_Points::Get_Regression(CSG_Shape *pPoint)
+{
+	int		nPoints	= Set_Variables(pPoint->Get_Point(0));
+
+	if( nPoints < m_nPoints_Min )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			i;
+	double		zMean, rss, tss;
+	CSG_Vector	b, z;
+	CSG_Matrix	Y, YtW;
+
+	//-----------------------------------------------------
+	z  .Create(nPoints);
+	Y  .Create(1 + m_nPredictors, nPoints);
+	YtW.Create(nPoints, 1 + m_nPredictors);
+
+	for(i=0, zMean=0.0; i<nPoints; i++)
+	{
+		Y  [i][0]	= 1.0;
+		YtW[0][i]	= m_w[i];
+
+		for(int j=0; j<m_nPredictors; j++)
+		{
+			Y  [i][j + 1]	= m_y[i][j];
+			YtW[j + 1][i]	= m_y[i][j] * m_w[i];
+		}
+
+		zMean		+= (z[i] = m_z[i]);
+	}
+
+	//-----------------------------------------------------
+	b		= (YtW * Y).Get_Inverse() * (YtW * m_z);
+
+	zMean	/= nPoints;
+
+	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
+	{
+		double	zr	= b[0];
+
+		for(int j=0; j<m_nPredictors; j++)
+		{
+			zr	+= b[j + 1] * m_y[i][j];
+		}
+
+		rss	+= m_w[i] * SG_Get_Square(m_z[i] - zr);
+		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
+	}
+
+	//-----------------------------------------------------
+	double	Regression	= b[0];
+
+	for(i=1; i<=m_nPredictors; i++)
+	{
+		Regression	+= b[i] * pPoint->asDouble(i);
+	}
+
+	//-----------------------------------------------------
+	pPoint->Set_Value(1 + m_nPredictors, tss > 0.0 ? (tss - rss) / tss : 0.0);	// R2
+	pPoint->Set_Value(2 + m_nPredictors, Regression);							// Regression
+	pPoint->Set_Value(3 + m_nPredictors, pPoint->asDouble(0) - Regression);		// Residual
+
+	for(i=0; i<=m_nPredictors; i++)
+	{
+		pPoint->Set_Value(4 + m_nPredictors + i, b[i]);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression_points.h b/src/modules/statistics/statistics_regression/gw_multi_regression_points.h
new file mode 100644
index 0000000..53587b0
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression_points.h
@@ -0,0 +1,129 @@
+/**********************************************************
+ * Version $Id: gw_multi_regression_points.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              gw_multi_regression_points.h             //
+//                                                       //
+//                 Copyright (C) 2010 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__gw_multi_regression_points_H
+#define HEADER_INCLUDED__gw_multi_regression_points_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGW_Multi_Regression_Points : public CSG_Module
+{
+public:
+	CGW_Multi_Regression_Points(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	int							m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction;
+
+	double						m_Radius;
+
+	CSG_Distance_Weighting		m_Weighting;
+
+	CSG_PRQuadTree				m_Search;
+
+	CSG_Vector					m_z, m_w;
+
+	CSG_Matrix					m_y;
+
+	CSG_Shapes					*m_pPoints;
+
+
+	void						Finalize				(void);
+
+	bool						Get_Predictors			(void);
+
+	int							Set_Variables			(const TSG_Point &Point);
+
+	bool						Get_Regression			(CSG_Shape *pPoint);
+
+	bool						Set_Residuals			(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__gw_multi_regression_points_H
diff --git a/src/modules/statistics/statistics_regression/gw_regression.cpp b/src/modules/statistics/statistics_regression/gw_regression.cpp
new file mode 100644
index 0000000..b194584
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_regression.cpp
@@ -0,0 +1,417 @@
+/**********************************************************
+ * Version $Id: gw_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   gw_regression.cpp                   //
+//                                                       //
+//                 Copyright (C) 2010 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 "gw_regression.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGW_Regression::CGW_Regression(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Geographically Weighted Regression"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Reference:\n"
+		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL("")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "PREDICTOR"	, _TL("Predictor"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "TARGET"		, _TL("Target Grids"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("user defined"),
+			_TL("grid")
+		), 0
+	);
+
+	m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid")	, _TL("")));
+	m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid")			, _TL("")), false);
+
+	m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY")   , _TL("Quality")  , false);
+	m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false);
+	m_Grid_Target.Add_Grid_Parameter(SG_T("SLOPE")     , _TL("Slope")    , false);
+
+	//-----------------------------------------------------
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	);
+
+	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pSearch	= Parameters.Add_Node(
+		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
+		_TL("")
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local"),
+			_TL("global")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
+		_TL("local maximum search distance given in map units"),
+		PARAMETER_TYPE_Double	, 1000.0, 0, true
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("maximum number of nearest points"),
+			_TL("all points within search distance")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
+		_TL("minimum number of points to use"),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
+		_TL("maximum number of nearest points"),
+		PARAMETER_TYPE_Int, 20, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("all directions"),
+			_TL("quadrants")
+		)
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Regression::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 );
+}
+
+//---------------------------------------------------------
+int CGW_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
+	{
+		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
+	{
+		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
+		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
+	}
+
+	m_Weighting.Enable_Parameters(pParameters);
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Regression::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pPoints		= Parameters("POINTS"   )->asShapes();
+	m_iDependent	= Parameters("DEPENDENT")->asInt   ();
+	m_iPredictor	= Parameters("PREDICTOR")->asInt   ();
+
+	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
+	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
+					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
+	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
+					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
+	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
+
+	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_pIntercept	= NULL;
+	m_pSlope		= NULL;
+	m_pQuality		= NULL;
+
+	switch( Parameters("TARGET")->asInt() )
+	{
+	case 0:	// user defined...
+		if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") )
+		{
+			m_pIntercept	= m_Grid_Target.Get_User(SG_T("INTERCEPT"));
+			m_pSlope		= m_Grid_Target.Get_User(SG_T("SLOPE"));
+			m_pQuality		= m_Grid_Target.Get_User(SG_T("QUALITY"));
+		}
+		break;
+
+	case 1:	// grid...
+		if( Dlg_Parameters("GRID") )
+		{
+			m_pIntercept	= m_Grid_Target.Get_Grid(SG_T("INTERCEPT"));
+			m_pSlope		= m_Grid_Target.Get_Grid(SG_T("SLOPE"));
+			m_pQuality		= m_Grid_Target.Get_Grid(SG_T("QUALITY"));
+		}
+		break;
+	}
+
+	if( m_pIntercept == NULL )
+	{
+		m_Search.Destroy();
+
+		return( false );
+	}
+
+	m_pIntercept->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Intercept")));
+	m_pSlope    ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Slope")));
+	m_pQuality  ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Quality")));
+
+	//-----------------------------------------------------
+	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
+
+	m_y.Create(nPoints_Max);
+	m_z.Create(nPoints_Max);
+	m_w.Create(nPoints_Max);
+
+	//-----------------------------------------------------
+	for(int y=0; y<m_pIntercept->Get_NY() && Set_Progress(y, m_pIntercept->Get_NY()); y++)
+	{
+		for(int x=0; x<m_pIntercept->Get_NX(); x++)
+		{
+			if( !Get_Regression(x, y) )
+			{
+				m_pIntercept->Set_NoData(x, y);
+				m_pSlope    ->Set_NoData(x, y);
+				m_pQuality  ->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_y.Destroy();
+	m_z.Destroy();
+	m_w.Destroy();
+
+	m_Search.Destroy();
+
+	DataObject_Update(m_pIntercept);
+	DataObject_Update(m_pSlope);
+	DataObject_Update(m_pQuality);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Regression::Set_Variables(int x, int y)
+{
+	int			iPoint, jPoint, nPoints;
+	TSG_Point	Point;
+	CSG_Shape	*pPoint;
+
+	Point	= m_pIntercept->Get_System().Get_Grid_to_World(x, y);
+	nPoints	= m_Search.is_Okay() ? (int)m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
+
+	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
+	{
+		if( m_Search.is_Okay() )
+		{
+			double	ix, iy, iz;
+
+			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
+
+			pPoint	= m_pPoints->Get_Shape((int)iz);
+		}
+		else
+		{
+			pPoint	= m_pPoints->Get_Shape(iPoint);
+		}
+
+		if( !pPoint->is_NoData(m_iDependent) && !pPoint->is_NoData(m_iPredictor) )
+		{
+			m_z[jPoint]	= pPoint->asDouble(m_iDependent);
+			m_y[jPoint]	= pPoint->asDouble(m_iPredictor);
+			m_w[jPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
+
+			jPoint++;
+		}
+	}
+
+	return( jPoint );
+}
+
+//---------------------------------------------------------
+bool CGW_Regression::Get_Regression(int x, int y)
+{
+	int		nPoints	= Set_Variables(x, y);
+
+	if( nPoints < m_nPoints_Min )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			i;
+	double		zMean, rss, tss;
+	CSG_Vector	b, z;
+	CSG_Matrix	Y, YtW;
+
+	//-----------------------------------------------------
+	z  .Create(nPoints);
+	Y  .Create(2, nPoints);
+	YtW.Create(nPoints, 2);
+
+	for(i=0, zMean=0.0; i<nPoints; i++)
+	{
+		Y  [i][0]	= 1.0;
+		Y  [i][1]	= m_y[i];
+		YtW[0][i]	= m_w[i];
+		YtW[1][i]	= m_w[i] * m_y[i];
+
+		zMean		+= (z[i] = m_z[i]);
+	}
+
+	//-----------------------------------------------------
+	b		= (YtW * Y).Get_Inverse() * (YtW * z);
+
+	zMean	/= nPoints;
+
+	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
+	{
+		rss	+= m_w[i] * SG_Get_Square(m_z[i] - (b[0] + b[1] * m_y[i]));
+		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
+	}
+
+	m_pIntercept->Set_Value(x, y, b[0]);
+	m_pSlope    ->Set_Value(x, y, b[1]);
+	m_pQuality  ->Set_Value(x, y, (tss - rss) / tss);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/gw_regression.h b/src/modules/statistics/statistics_regression/gw_regression.h
new file mode 100644
index 0000000..5251670
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_regression.h
@@ -0,0 +1,127 @@
+/**********************************************************
+ * Version $Id: gw_regression.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    gw_regression.h                    //
+//                                                       //
+//                 Copyright (C) 2010 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__GW_Regression_H
+#define HEADER_INCLUDED__GW_Regression_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGW_Regression : public CSG_Module
+{
+public:
+	CGW_Regression(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	int							m_iDependent, m_iPredictor, m_nPoints_Min, m_nPoints_Max, m_Direction;
+
+	double						m_Radius;
+
+	CSG_Parameters_Grid_Target	m_Grid_Target;
+
+	CSG_Distance_Weighting		m_Weighting;
+
+	CSG_PRQuadTree				m_Search;
+
+	CSG_Vector					m_y, m_z, m_w;
+
+	CSG_Shapes					*m_pPoints;
+
+	CSG_Grid					*m_pIntercept, *m_pSlope, *m_pQuality;
+
+
+	int							Set_Variables			(int x, int y);
+
+	bool						Get_Regression			(int x, int y);
+
+	bool						Set_Residuals			(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GW_Regression_H
diff --git a/src/modules/statistics/statistics_regression/gw_regression_grid.cpp b/src/modules/statistics/statistics_regression/gw_regression_grid.cpp
new file mode 100644
index 0000000..5bda82d
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_regression_grid.cpp
@@ -0,0 +1,469 @@
+/**********************************************************
+ * Version $Id: gw_regression_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 gw_regression_grid.cpp                //
+//                                                       //
+//                 Copyright (C) 2010 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 "gw_regression_grid.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define GRID_INIT(g, s)				if( g ) { g->Set_Name(CSG_String::Format(SG_T("%s (%s - %s)"), Parameters("DEPENDENT")->asString(), s, m_pPredictor->Get_Name())); }
+#define GRID_SET_NODATA(g, x, y)	if( g ) { g->Set_NoData(x, y); }
+#define GRID_SET_VALUE(g, x, y, z)	if( g ) { g->Set_Value(x, y, z); }
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGW_Regression_Grid::CGW_Regression_Grid(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Geographically Weighted Regression (Points/Grid)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Reference:\n"
+		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "PREDICTOR"	, _TL("Predictor"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REGRESSION"	, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "QUALITY"		, _TL("Coefficient of Determination"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "INTERCEPT"	, _TL("Intercept"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SLOPE"		, _TL("Slope"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL("")
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "RESIDUALS"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("")
+	);
+
+	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pSearch	= Parameters.Add_Node(
+		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
+		_TL("")
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local"),
+			_TL("global")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
+		_TL("local maximum search distance given in map units"),
+		PARAMETER_TYPE_Double	, 1000.0, 0, true
+	);
+
+	pNode	= Parameters.Add_Choice(
+		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("maximum number of nearest points"),
+			_TL("all points within search distance")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
+		_TL("minimum number of points to use"),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
+		_TL("maximum number of nearest points"),
+		PARAMETER_TYPE_Int, 20, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("all directions"),
+			_TL("quadrants")
+		)
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Regression_Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
+	{
+		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
+	{
+		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
+		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
+	}
+
+	m_Weighting.Enable_Parameters(pParameters);
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Regression_Grid::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pPredictor	= Parameters("PREDICTOR" )->asGrid  ();
+	m_pRegression	= Parameters("REGRESSION")->asGrid  ();
+	m_pQuality		= Parameters("QUALITY"   )->asGrid  ();
+	m_pIntercept	= Parameters("INTERCEPT" )->asGrid  ();
+	m_pSlope		= Parameters("SLOPE"     )->asGrid  ();
+	m_pPoints		= Parameters("POINTS"    )->asShapes();
+	m_iDependent	= Parameters("DEPENDENT" )->asInt   ();
+
+	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
+	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
+					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
+	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
+					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
+	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
+
+	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
+
+	//-----------------------------------------------------
+	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	GRID_INIT(m_pRegression, _TL("GWR Regression"));
+	GRID_INIT(m_pQuality   , _TL("GWR Quality"));
+	GRID_INIT(m_pIntercept , _TL("GWR Intercept"));
+	GRID_INIT(m_pSlope     , _TL("GWR Slope"));
+
+	//-----------------------------------------------------
+	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
+
+	m_y.Create(nPoints_Max);
+	m_z.Create(nPoints_Max);
+	m_w.Create(nPoints_Max);
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( m_pPredictor->is_NoData(x, y) || !Get_Regression(x, y) )
+			{
+				GRID_SET_NODATA(m_pRegression , x, y);
+				GRID_SET_NODATA(m_pIntercept  , x, y);
+				GRID_SET_NODATA(m_pSlope      , x, y);
+				GRID_SET_NODATA(m_pQuality    , x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Set_Residuals();
+
+	m_y.Destroy();
+	m_z.Destroy();
+	m_w.Destroy();
+
+	m_Search.Destroy();
+
+	DataObject_Update(m_pIntercept);
+	DataObject_Update(m_pSlope);
+	DataObject_Update(m_pQuality);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGW_Regression_Grid::Set_Variables(int x, int y)
+{
+	int			iPoint, jPoint, nPoints;
+	double		z;
+	TSG_Point	Point;
+	CSG_Shape	*pPoint;
+
+	Point	= Get_System()->Get_Grid_to_World(x, y);
+	nPoints	= m_Search.is_Okay() ? (int)m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
+
+	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
+	{
+		if( m_Search.is_Okay() )
+		{
+			double	ix, iy, iz;
+
+			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
+
+			pPoint	= m_pPoints->Get_Shape((int)iz);
+		}
+		else
+		{
+			pPoint	= m_pPoints->Get_Shape(iPoint);
+		}
+
+		if( !pPoint->is_NoData(m_iDependent) && m_pPredictor->Get_Value(pPoint->Get_Point(0), z) )
+		{
+			m_w[jPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
+			m_z[jPoint]	= pPoint->asDouble(m_iDependent);
+			m_y[jPoint]	= z;
+
+			jPoint++;
+		}
+	}
+
+	return( jPoint );
+}
+
+//---------------------------------------------------------
+bool CGW_Regression_Grid::Get_Regression(int x, int y)
+{
+	int		nPoints	= Set_Variables(x, y);
+
+	if( nPoints < m_nPoints_Min )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			i;
+	double		zMean, rss, tss;
+	CSG_Vector	b, z;
+	CSG_Matrix	Y, YtW;
+
+	//-----------------------------------------------------
+	z  .Create(nPoints);
+	Y  .Create(2, nPoints);
+	YtW.Create(nPoints, 2);
+
+	for(i=0, zMean=0.0; i<nPoints; i++)
+	{
+		Y  [i][0]	= 1.0;
+		Y  [i][1]	= m_y[i];
+		YtW[0][i]	= m_w[i];
+		YtW[1][i]	= m_w[i] * m_y[i];
+
+		zMean		+= (z[i] = m_z[i]);
+	}
+
+	//-----------------------------------------------------
+	b		= (YtW * Y).Get_Inverse() * (YtW * z);
+
+	zMean	/= nPoints;
+
+	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
+	{
+		rss	+= m_w[i] * SG_Get_Square(m_z[i] - (b[0] + b[1] * m_y[i]));
+		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
+	}
+
+	GRID_SET_VALUE(m_pRegression, x, y, b[0] + b[1] * m_pPredictor->asDouble(x, y));
+	GRID_SET_VALUE(m_pIntercept , x, y, b[0]);
+	GRID_SET_VALUE(m_pSlope     , x, y, b[1]);
+	GRID_SET_VALUE(m_pQuality   , x, y, (tss - rss) / tss);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGW_Regression_Grid::Set_Residuals(void)
+{
+	CSG_Shapes	*pResiduals	= Parameters("RESIDUALS")->asShapes();
+
+	if( !pResiduals || !m_pPoints || !m_pRegression )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pPoints->Get_Name(), _TL("Residuals")));
+	pResiduals->Add_Field(m_pPoints->Get_Field_Name(m_iDependent), SG_DATATYPE_Double);
+	pResiduals->Add_Field("TREND"	, SG_DATATYPE_Double);
+	pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
+
+	//-------------------------------------------------
+	for(int iShape=0; iShape<m_pPoints->Get_Count() && Set_Progress(iShape, m_pPoints->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= m_pPoints->Get_Shape(iShape);
+		double		 zShape	= pShape->asDouble(m_iDependent);
+
+		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+		{
+			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			{
+				double	zRegression;
+
+				TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
+
+				if( m_pRegression->Get_Value(Point, zRegression) )
+				{
+					CSG_Shape	*pResidual	= pResiduals->Add_Shape();
+
+					pResidual->Add_Point(Point);
+					pResidual->Set_Value(0, zShape);
+					pResidual->Set_Value(1, zRegression);
+					pResidual->Set_Value(2, zShape - zRegression);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/gw_regression_grid.h b/src/modules/statistics/statistics_regression/gw_regression_grid.h
new file mode 100644
index 0000000..b2254a0
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gw_regression_grid.h
@@ -0,0 +1,124 @@
+/**********************************************************
+ * Version $Id: gw_regression_grid.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 gw_regression_grid.h                  //
+//                                                       //
+//                 Copyright (C) 2010 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__gw_regression_grid_H
+#define HEADER_INCLUDED__gw_regression_grid_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGW_Regression_Grid : public CSG_Module_Grid
+{
+public:
+	CGW_Regression_Grid(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	int							m_iDependent, m_nPoints_Min, m_nPoints_Max, m_Direction;
+
+	double						m_Radius;
+
+	CSG_Distance_Weighting		m_Weighting;
+
+	CSG_PRQuadTree				m_Search;
+
+	CSG_Vector					m_y, m_z, m_w;
+
+	CSG_Shapes					*m_pPoints;
+
+	CSG_Grid					*m_pPredictor, *m_pRegression, *m_pQuality, *m_pIntercept, *m_pSlope;
+
+
+	int							Set_Variables			(int x, int y);
+
+	bool						Get_Regression			(int x, int y);
+
+	bool						Set_Residuals			(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__gw_regression_grid_H
diff --git a/src/modules/statistics/statistics_regression/gwr_grid_downscaling.cpp b/src/modules/statistics/statistics_regression/gwr_grid_downscaling.cpp
new file mode 100644
index 0000000..3479465
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gwr_grid_downscaling.cpp
@@ -0,0 +1,561 @@
+/**********************************************************
+ * Version $Id: gwr_grid_downscaling.cpp 1633 2013-03-22 13:35:15Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                gwr_grid_downscaling.cpp               //
+//                                                       //
+//                 Copyright (C) 2013 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 "gwr_grid_downscaling.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CGWR_Grid_Downscaling::CGWR_Grid_Downscaling(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("GWR Grid Downscaling"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2013"));
+
+	Set_Description	(_TW(
+		"References:\n"
+		"- Fotheringham, S.A., Brunsdon, C., Charlton, M. (2002):"
+		" Geographically Weighted Regression: the analysis of spatially varying relationships. John Wiley & Sons."
+		" <a target=\"_blank\" href=\"http://onlinelibrary.wiley.com/doi/10.1111/j.1538-4632.2003.tb01114.x/abstract\">online</a>.\n"
+		"\n"
+		"- Fotheringham, S.A., Charlton, M., Brunsdon, C. (1998):"
+		" Geographically weighted regression: a natural evolution of the expansion method for spatial data analysis."
+		" Environment and Planning A 30(11), 1905�1927."
+		" <a target=\"_blank\" href=\"http://www.envplan.com/abstract.cgi?id=a301905\">online</a>.\n"
+		"\n"
+		"- Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "PREDICTORS"	, _TL("Predictors"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REGRESSION"	, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REG_RESCORR"	, _TL("Regression with Residual Correction"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "GRID_SYSTEM"	, _TL("Grid System"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(
+		pNode	, "QUALITY"		, _TL("Coefficient of Determination"),
+		_TL(""),
+		PARAMETER_OUTPUT, false
+	);
+
+	Parameters.Add_Grid(
+		pNode	, "RESIDUALS"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT, false
+	);
+
+	Parameters.Add_Grid_List(
+		pNode	, "MODEL"		, _TL("Regression Parameters"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MODEL_OUT"	, _TL("Output of Model Parameters"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Choice(
+		NULL	, "SEARCH_RANGE"		, _TL("Search Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local"),
+			_TL("global")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "SEARCH_RADIUS"		, _TL("Search Distance [Cells]"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 10, 1, true
+	);
+
+	m_Search.Get_Weighting().Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Search.Get_Weighting().Set_BandWidth(7.0);
+	m_Search.Get_Weighting().Create_Parameters(&Parameters, false);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGWR_Grid_Downscaling::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
+	{
+		pParameters->Get_Parameter("SEARCH_RADIUS")->Set_Enabled(pParameter->asInt() == 0);	// local
+	}
+
+	m_Search.Get_Weighting().Enable_Parameters(pParameters);
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGWR_Grid_Downscaling::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Parameter_Grid_List	*pPredictors	= Parameters("PREDICTORS")->asGridList();
+
+	if( (m_nPredictors = pPredictors->Get_Count()) <= 0 )
+	{
+		return( false );
+	}
+
+	m_pDependent	= Parameters("DEPENDENT")->asGrid();
+
+	if( !m_pDependent->Get_Extent().Intersects(Get_System()->Get_Extent()) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int		i;
+
+	Process_Set_Text(_TL("upscaling of predictors"));
+
+	m_pPredictors	= (CSG_Grid **)SG_Calloc(m_nPredictors    , sizeof(CSG_Grid *));
+	m_pModel		= (CSG_Grid **)SG_Calloc(m_nPredictors + 1, sizeof(CSG_Grid *));
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		m_pPredictors[i]	= SG_Create_Grid(m_pDependent->Get_System());
+		m_pPredictors[i]	->Assign(pPredictors->asGrid(i), GRID_INTERPOLATION_NearestNeighbour);	// GRID_INTERPOLATION_Mean_Cells
+
+		m_pModel     [i]	= SG_Create_Grid(m_pDependent->Get_System());
+		m_pModel     [i]	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPredictors->asGrid(i)->Get_Name(), _TL("Factor")));
+	}
+
+	m_pModel[m_nPredictors]	= SG_Create_Grid(m_pDependent->Get_System());
+	m_pModel[m_nPredictors]	->Set_Name(_TL("Intercept"));
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("model creation"));
+
+	bool	bResult	= Get_Model();
+
+	//-----------------------------------------------------
+	for(i=0; i<m_nPredictors; i++)
+	{
+		delete(m_pPredictors[i]);
+
+		m_pPredictors[i]	= pPredictors->asGrid(i);
+	}
+
+	//-----------------------------------------------------
+	if( bResult )
+	{
+		Process_Set_Text(_TL("downscaling"));
+
+		bResult	= Set_Model();
+	}
+
+	//-----------------------------------------------------
+	if( Parameters("MODEL_OUT")->asBool() )
+	{
+		CSG_Parameter_Grid_List	*pModel	= Parameters("MODEL")->asGridList();
+
+		pModel->Del_Items();
+		pModel->Add_Item(m_pModel[m_nPredictors]);
+
+		for(i=0; i<m_nPredictors; i++)
+		{
+			pModel->Add_Item(m_pModel[i]);
+		}
+	}
+	else
+	{
+		for(i=0; i<=m_nPredictors; i++)
+		{
+			delete(m_pModel[i]);
+		}
+	}
+
+	SG_FREE_SAFE(m_pModel);
+	SG_FREE_SAFE(m_pPredictors);
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGWR_Grid_Downscaling::Set_Model(double x, double y, double &Value, double &Residual)
+{
+	if( !m_pModel[m_nPredictors]->Get_Value(x, y, Value, GRID_INTERPOLATION_BSpline) )
+	{
+		return( false );
+	}
+
+	double	Model, Predictor;
+
+	for(int i=0; i<m_nPredictors; i++)
+	{
+		if( !m_pModel     [i]->Get_Value(x, y, Model    , GRID_INTERPOLATION_BSpline)
+		||  !m_pPredictors[i]->Get_Value(x, y, Predictor, GRID_INTERPOLATION_NearestNeighbour) )
+		{
+			return( false );
+		}
+
+		Value	+= Model * Predictor;
+	}
+
+	if( !m_pResiduals->Get_Value(x, y, Residual, GRID_INTERPOLATION_BSpline) )
+	{
+		Residual	= 0.0;
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CGWR_Grid_Downscaling::Set_Model(void)
+{
+	CSG_Grid	*pRegression	= Parameters("REGRESSION" )->asGrid();
+	CSG_Grid	*pReg_ResCorr	= Parameters("REG_RESCORR")->asGrid();
+
+	pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pDependent->Get_Name(), _TL("GWR")));
+
+	if( pReg_ResCorr )
+	{
+		pReg_ResCorr->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Residual Correction")));
+	}
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		double	p_y	= Get_YMin() + y * Get_Cellsize();
+
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	Value, Residual, p_x	= Get_XMin() + x * Get_Cellsize();
+
+			if( Set_Model(p_x, p_y, Value, Residual) )
+			{
+				pRegression->Set_Value(x, y, Value);
+
+				if( pReg_ResCorr )
+				{
+					pReg_ResCorr->Set_Value(x, y, Value + Residual);
+				}
+			}
+			else
+			{
+				pRegression->Set_NoData(x, y);
+
+				if( pReg_ResCorr )
+				{
+					pReg_ResCorr->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGWR_Grid_Downscaling::Get_Model(void)
+{
+	//-----------------------------------------------------
+	m_pQuality		= Parameters("QUALITY"  )->asGrid();
+	m_pQuality		->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Quality")));
+
+	m_pResiduals	= Parameters("RESIDUALS")->asGrid();
+	m_pResiduals	->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Residuals")));
+
+	//-----------------------------------------------------
+	m_Search.Get_Weighting().Set_Parameters(&Parameters);
+
+	m_Search.Set_Radius(Parameters("SEARCH_RANGE")->asInt() == 0
+		? Parameters("SEARCH_RADIUS")->asInt() : 1 + (int)(SG_Get_Length(m_pDependent->Get_NX(), m_pDependent->Get_NY()))
+	);
+
+	//-----------------------------------------------------
+	CSG_Grid_System	System(m_pDependent->Get_System());
+
+	for(int y=0; y<System.Get_NY() && Set_Progress(y, System.Get_NY()); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<System.Get_NX(); x++)
+		{
+			if( !Get_Regression(x, y) )
+			{
+				m_pQuality  ->Set_NoData(x, y);
+				m_pResiduals->Set_NoData(x, y);
+
+				for(int i=0; i<=m_nPredictors; i++)
+				{
+					m_pModel[i]->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Search.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGWR_Grid_Downscaling::Get_Variables(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y)
+{
+	int		n	= 0;
+
+	z.Create(m_Search.Get_Count());
+	w.Create(m_Search.Get_Count());
+	Y.Create(1 + m_nPredictors, m_Search.Get_Count());
+
+	//-----------------------------------------------------
+	for(int i=0, ix, iy; i<m_Search.Get_Count(); i++)
+	{
+		double	id, iw;
+
+		if( m_Search.Get_Values(i, ix = x, iy = y, id, iw, true) && m_pDependent->is_InGrid(ix, iy) )
+		{
+			z[n]	= m_pDependent->asDouble(ix, iy);
+			w[n]	= iw;
+			Y[n][0]	= 1.0;
+
+			for(int j=0; j<m_nPredictors && iw>0.0; j++)
+			{
+				if( !m_pPredictors[j]->is_NoData(ix, iy) )
+				{
+					Y[n][j + 1]	= m_pPredictors[j]->asDouble(ix, iy);
+				}
+				else
+				{
+					iw	= 0.0;
+				}
+			}
+
+			if( iw > 0.0 )
+			{
+				n++;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	z.Set_Rows(n);
+	w.Set_Rows(n);
+	Y.Set_Rows(n);
+
+	return( n );
+}
+
+//---------------------------------------------------------
+bool CGWR_Grid_Downscaling::Get_Regression(int x, int y)
+{
+	//-----------------------------------------------------
+	int			i, nPoints;
+	double		zMean, zr, rss, tss;
+	CSG_Vector	b, z, w;
+	CSG_Matrix	Y, YtW;
+
+	if( (nPoints = Get_Variables(x, y, z, w, Y)) <= m_nPredictors )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	YtW.Create(nPoints, 1 + m_nPredictors);
+
+	for(i=0, zMean=0.0; i<nPoints; i++)
+	{
+		zMean		+= z[i];
+		YtW[0][i]	 = w[i];
+
+		for(int j=1; j<=m_nPredictors; j++)
+		{
+			YtW[j][i]	= Y[i][j] * w[i];
+		}
+	}
+
+	//-----------------------------------------------------
+	b		= (YtW * Y).Get_Inverse() * (YtW * z);
+
+	zMean	/= nPoints;
+
+	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
+	{
+		zr	= b[0];
+
+		for(int j=1; j<=m_nPredictors; j++)
+		{
+			zr	+= b[j] * Y[i][j];
+		}
+
+		rss	+= w[i] * SG_Get_Square(z[i] - zr);
+		tss	+= w[i] * SG_Get_Square(z[i] - zMean);
+	}
+
+	m_pQuality->Set_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0);
+
+	for(i=0; i<m_nPredictors; i++)
+	{
+		m_pModel[i]->Set_Value(x, y, b[i + 1]);
+	}
+
+	m_pModel[m_nPredictors]->Set_Value(x, y, b[0]);
+
+	//-----------------------------------------------------
+	if( m_pDependent->is_NoData(x, y) )
+	{
+		m_pResiduals->Set_NoData(x, y);
+	}
+	else
+	{
+		zr	= b[0];
+
+		for(i=0; i<m_nPredictors; i++)
+		{
+			if( m_pPredictors[i]->is_NoData(x, y) )
+			{
+				m_pResiduals->Set_NoData(x, y);
+
+				return( true );
+			}
+
+			zr	+= b[i + 1] * m_pPredictors[i]->asDouble(x, y);
+		}
+
+		m_pResiduals->Set_Value(x, y, m_pDependent->asDouble(x, y) - zr);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/gwr_grid_downscaling.h b/src/modules/statistics/statistics_regression/gwr_grid_downscaling.h
new file mode 100644
index 0000000..f09123d
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/gwr_grid_downscaling.h
@@ -0,0 +1,117 @@
+/**********************************************************
+ * Version $Id: gwr_grid_downscaling.h 1549 2012-11-29 16:38:50Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 gwr_grid_downscaling.h                //
+//                                                       //
+//                 Copyright (C) 2013 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__gwr_grid_downscaling_H
+#define HEADER_INCLUDED__gwr_grid_downscaling_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGWR_Grid_Downscaling : public CSG_Module_Grid
+{
+public:
+	CGWR_Grid_Downscaling(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+
+private:
+
+	int							m_nPredictors;
+
+	CSG_Grid_Cell_Addressor		m_Search;
+
+	CSG_Grid					*m_pDependent, **m_pPredictors, **m_pModel, *m_pQuality, *m_pResiduals;
+
+
+	bool						Set_Model				(double x, double y, double &Value, double &Residual);
+	bool						Set_Model				(void);
+
+	bool						Get_Model				(void);
+	int							Get_Variables			(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y);
+	bool						Get_Regression			(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__gwr_grid_downscaling_H
diff --git a/src/modules/statistics/statistics_regression/point_grid_regression.cpp b/src/modules/statistics/statistics_regression/point_grid_regression.cpp
new file mode 100644
index 0000000..b73fdc4
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/point_grid_regression.cpp
@@ -0,0 +1,333 @@
+/**********************************************************
+ * Version $Id: point_grid_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               point_grid_regression.cpp               //
+//                                                       //
+//                 Copyright (C) 2004 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "point_grid_regression.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define GRID_ZFACTOR	true
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPoint_Grid_Regression::CPoint_Grid_Regression(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Regression Analysis (Points/Grid)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2004"));
+
+	Set_Description	(_TW(
+		"Regression analysis of point attributes with grid values. "
+		"The regression function is used to create a new grid with regression based values. \n"
+		"\n"
+		"Reference:\n"
+		"- Bahrenberg, G., Giese, E., Nipper, J. (1990): "
+		"'Statistische Methoden in der Geographie 1 - Univariate und bivariate Statistik', "
+		"Stuttgart, 233p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRID"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "ATTRIBUTE"	, _TL("Attribute"),
+		_TL("")
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REGRESSION"	, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "RESIDUAL"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"INTERPOL"		, _TL("Grid Interpolation"),
+		_TL(""),
+
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("Nearest Neighbor"),
+			_TL("Bilinear Interpolation"),
+			_TL("Inverse Distance Interpolation"),
+			_TL("Bicubic Spline Interpolation"),
+			_TL("B-Spline Interpolation")
+		), 4
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Regression Function"),
+		_TL(""),
+
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+			_TL("Y = a + b * X (linear)"),
+			_TL("Y = a + b / X"),
+			_TL("Y = a / (b - X)"),
+			_TL("Y = a * X^b (power)"),
+			_TL("Y = a e^(b * X) (exponential)"),
+			_TL("Y = a + b * ln(X) (logarithmic)")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Grid_Regression::On_Execute(void)
+{
+	int					iAttribute;
+	TSG_Regression_Type	Type;
+	CSG_Shapes			*pShapes, *pResiduals;
+	CSG_Grid			*pGrid, *pRegression;
+
+	//-----------------------------------------------------
+	pGrid			= Parameters("GRID")		->asGrid();
+	pRegression		= Parameters("REGRESSION")	->asGrid();
+	pShapes			= Parameters("SHAPES")		->asShapes();
+	pResiduals		= Parameters("RESIDUAL")	->asShapes();
+	iAttribute		= Parameters("ATTRIBUTE")	->asInt();
+	m_Interpolation	= Parameters("INTERPOL")	->asInt();
+
+	switch( Parameters("METHOD")->asInt() )
+	{
+	default:
+	case 0:	Type	= REGRESSION_Linear;	break;	// Y = a + b * X
+	case 1:	Type	= REGRESSION_Rez_X;		break;	// Y = a + b / X
+	case 2:	Type	= REGRESSION_Rez_Y;		break;	// Y = a / (b - X)
+	case 3:	Type	= REGRESSION_Pow;		break;	// Y = a * X^b
+	case 4:	Type	= REGRESSION_Exp;		break;	// Y = a e^(b * X)
+	case 5:	Type	= REGRESSION_Log;		break;	// Y = a + b * ln(X)
+	}
+
+	//-----------------------------------------------------
+	if( Get_Regression(pGrid, pShapes, pResiduals, iAttribute, Type) )
+	{
+		pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Regression Model")));
+
+		Set_Regression(pGrid, pRegression);
+
+		Set_Residuals(pResiduals);
+
+		Message_Add(m_Regression.asString());
+
+		m_Regression.Destroy();
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	m_Regression.Destroy();
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Grid_Regression::Get_Regression(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Shapes *pResiduals, int iAttribute, TSG_Regression_Type Type)
+{
+	int			iShape, iPart, iPoint;
+	double		zShape, zGrid;
+	TSG_Point	Point;
+	CSG_Shape	*pShape, *pResidual;
+
+	//-----------------------------------------------------
+	if( pResiduals )
+	{
+		pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Residuals")));
+		pResiduals->Add_Field("ID"			, SG_DATATYPE_Int);
+		pResiduals->Add_Field("Y"			, SG_DATATYPE_Double);
+		pResiduals->Add_Field("X"			, SG_DATATYPE_Double);
+		pResiduals->Add_Field("Y_GUESS"		, SG_DATATYPE_Double);
+		pResiduals->Add_Field("Y_RESIDUAL"	, SG_DATATYPE_Double);
+		pResiduals->Add_Field("Y_RES_VAR"	, SG_DATATYPE_Double);
+	}
+
+	m_Regression.Destroy();
+
+	//-----------------------------------------------------
+	for(iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		pShape	= pShapes->Get_Shape(iShape);
+
+		if( !pShape->is_NoData(iAttribute) )
+		{
+			zShape	= pShape->asDouble(iAttribute);
+
+			for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					if( pGrid->Get_Value(Point = pShape->Get_Point(iPoint, iPart), zGrid, m_Interpolation, GRID_ZFACTOR) )
+					{
+						m_Regression.Add_Values(zGrid, zShape);
+
+						if( pResiduals )
+						{
+							pResidual	= pResiduals->Add_Shape();
+							pResidual->Add_Point(Point);
+							pResidual->Set_Value(0, m_Regression.Get_Count());
+							pResidual->Set_Value(1, zShape);
+							pResidual->Set_Value(2, zGrid);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( m_Regression.Calculate(Type) );
+}
+
+//---------------------------------------------------------
+bool CPoint_Grid_Regression::Set_Regression(CSG_Grid *pGrid, CSG_Grid *pRegression)
+{
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( pGrid->is_NoData(x, y) )
+				pRegression->Set_NoData(x, y);
+			else
+				pRegression->Set_Value (x, y, m_Regression.Get_y(pGrid->asDouble(x, y, GRID_ZFACTOR)));
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CPoint_Grid_Regression::Set_Residuals(CSG_Shapes *pResiduals)
+{
+	int		iPoint;
+	double	m, b, v, y;
+	CSG_Shape	*pPoint;
+
+	if( pResiduals )
+	{
+		m	= m_Regression.Get_Coefficient();
+		b	= m_Regression.Get_Constant();
+		v	= 100.0 / m_Regression.Get_yVariance();
+
+		for(iPoint=0; iPoint<pResiduals->Get_Count() && Set_Progress(iPoint, pResiduals->Get_Count()); iPoint++)
+		{
+			pPoint	= pResiduals->Get_Shape(iPoint);
+
+			pPoint->Set_Value(3, y = pPoint->asDouble(2) * m + b);
+			pPoint->Set_Value(4, y = pPoint->asDouble(1) - y);
+			pPoint->Set_Value(5, y * v);
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/point_grid_regression.h b/src/modules/statistics/statistics_regression/point_grid_regression.h
new file mode 100644
index 0000000..c5776ff
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/point_grid_regression.h
@@ -0,0 +1,110 @@
+/**********************************************************
+ * Version $Id: point_grid_regression.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                point_grid_regression.h                //
+//                                                       //
+//                 Copyright (C) 2004 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__point_grid_regression_H
+#define HEADER_INCLUDED__point_grid_regression_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPoint_Grid_Regression : public CSG_Module_Grid
+{
+public:
+	CPoint_Grid_Regression(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	int						m_Interpolation;
+
+	CSG_Regression			m_Regression;
+
+
+	bool					Get_Regression		(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Shapes *pResiduals, int iAttribute, TSG_Regression_Type Type);
+	bool					Set_Regression		(CSG_Grid *pGrid, CSG_Grid *pRegression);
+	bool					Set_Residuals		(CSG_Shapes *pResiduals);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__point_grid_regression_H
diff --git a/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp b/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp
new file mode 100644
index 0000000..88664fc
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp
@@ -0,0 +1,607 @@
+/**********************************************************
+ * Version $Id: point_multi_grid_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             point_multi_grid_regression.cpp           //
+//                                                       //
+//                 Copyright (C) 2004 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "point_multi_grid_regression.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPoint_Multi_Grid_Regression::CPoint_Multi_Grid_Regression(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Multiple Regression Analysis (Points/Grids)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2004"));
+
+	Set_Description	(_TW(
+		"Linear regression analysis of point attributes with multiple grids. "
+		"Details of the regression/correlation analysis will be saved to a table. "
+		"The regression function is used to create a new grid with regression based values. "
+		"The multiple regression analysis uses a forward selection procedure. \n"
+		"\n"
+		"Reference:\n"
+		"- Bahrenberg, G., Giese, E., Nipper, J. (1992): "
+		"'Statistische Methoden in der Geographie 2 - Multivariate Statistik', "
+		"Stuttgart, 415p.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_INPUT, true
+	);
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "ATTRIBUTE"	, _TL("Attribute"),
+		_TL("")
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_COEFF"	, _TL("Details: Coefficients"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_MODEL"	, _TL("Details: Model"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_STEPS"	, _TL("Details: Steps"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "RESIDUALS"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "REGRESSION"	, _TL("Regression"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"INTERPOL"		, _TL("Grid Interpolation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("Nearest Neighbor"),
+			_TL("Bilinear Interpolation"),
+			_TL("Inverse Distance Interpolation"),
+			_TL("Bicubic Spline Interpolation"),
+			_TL("B-Spline Interpolation")
+		), 4
+	);
+
+	Parameters.Add_Value(
+		NULL	, "COORD_X"		, _TL("Include X Coordinate"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "COORD_Y"		, _TL("Include Y Coordinate"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Value(
+		NULL	, "INTERCEPT"	, _TL("Intercept"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("include all"),
+			_TL("forward"),
+			_TL("backward"),
+			_TL("stepwise")
+		), 3
+	);
+
+	Parameters.Add_Value(
+		NULL	, "P_IN"		, _TL("P in"),
+		_TL("Level of significance for automated predictor selection, given as percentage"),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "P_OUT"		, _TL("P out"),
+		_TL("Level of significance for automated predictor selection, given as percentage"),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"CROSSVAL"		, _TL("Cross Validation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("none"),
+			_TL("leave one out"),
+			_TL("2-fold"),
+			_TL("k-fold")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CROSSVAL_K"	, _TL("Cross Validation Subsamples"),
+		_TL("number of subsamples for k-fold cross validation"),
+		PARAMETER_TYPE_Int, 10, 2, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CPoint_Multi_Grid_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CROSSVAL")) )
+	{
+		pParameters->Get_Parameter("CROSSVAL_K")->Set_Enabled(pParameter->asInt() == 3);	// k-fold
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Multi_Grid_Regression::On_Execute(void)
+{
+	bool					bResult;
+	int						iAttribute;
+	double					P_in, P_out;
+	CSG_Strings				Names;
+	CSG_Matrix				Samples;
+	CSG_Shapes				*pShapes;
+	CSG_Grid				*pRegression;
+	CSG_Parameter_Grid_List	*pGrids;
+
+	//-----------------------------------------------------
+	pGrids			= Parameters("GRIDS")		->asGridList();
+	pRegression		= Parameters("REGRESSION")	->asGrid();
+	pShapes			= Parameters("SHAPES")		->asShapes();
+	iAttribute		= Parameters("ATTRIBUTE")	->asInt();
+	P_in			= Parameters("P_IN")		->asDouble() / 100.0;
+	P_out			= Parameters("P_OUT")		->asDouble() / 100.0;
+
+	//-----------------------------------------------------
+	if( !Get_Samples(pGrids, pShapes, iAttribute, Samples, Names) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_Regression.Set_With_Intercept(Parameters("INTERCEPT")->asBool());
+
+	switch( Parameters("METHOD")->asInt() )
+	{
+	default:
+	case 0:	bResult	= m_Regression.Get_Model         (Samples             , &Names);	break;
+	case 1:	bResult	= m_Regression.Get_Model_Forward (Samples, P_in       , &Names);	break;
+	case 2:	bResult	= m_Regression.Get_Model_Backward(Samples,       P_out, &Names);	break;
+	case 3:	bResult	= m_Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names);	break;
+	}
+
+	if( bResult == false )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Message_Add(m_Regression.Get_Info(), false);
+
+	//-----------------------------------------------------
+	int	CrossVal;
+
+	switch( Parameters("CROSSVAL")->asInt() )
+	{
+	default:	CrossVal	= 0;									break;	// none
+	case 1:		CrossVal	= 1;									break;	// leave one out (LOOVC)
+	case 2:		CrossVal	= 2;									break;	// 2-fold
+	case 3:		CrossVal	= Parameters("CROSSVAL_K")->asInt();	break;	// k-fold
+	}
+
+	if( CrossVal > 0 && m_Regression.Get_CrossValidation(CrossVal) )
+	{
+		Message_Add(CSG_String::Format(SG_T("\n%s:\n"      ), _TL("Cross Validation")), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%s\n"  ), _TL("Type"   ), Parameters("CROSSVAL")->asString() ), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%d\n"  ), _TL("Samples"), m_Regression.Get_CV_nSamples()     ), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%f\n"  ), _TL("RMSE"   ), m_Regression.Get_CV_RMSE()         ), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("NRMSE"  ), m_Regression.Get_CV_NRMSE() * 100.0), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("R2"     ), m_Regression.Get_CV_R2()    * 100.0), false);
+	}
+
+	//-----------------------------------------------------
+	Set_Regression(pGrids, pRegression, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Regression Model")));
+
+	Set_Residuals(pShapes, iAttribute, pRegression);
+
+	//-----------------------------------------------------
+	if( Parameters("INFO_COEFF")->asTable() )
+	{
+		Parameters("INFO_COEFF")->asTable()->Assign(m_Regression.Get_Info_Regression());
+		Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients"));
+	}
+
+	if( Parameters("INFO_MODEL")->asTable() )
+	{
+		Parameters("INFO_MODEL")->asTable()->Assign(m_Regression.Get_Info_Model());
+		Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model"));
+	}
+
+	if( Parameters("INFO_STEPS")->asTable() )
+	{
+		Parameters("INFO_STEPS")->asTable()->Assign(m_Regression.Get_Info_Steps());
+		Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps"));
+	}
+
+	//-----------------------------------------------------
+	m_Regression.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Multi_Grid_Regression::Get_Samples(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pShapes, int iAttribute, CSG_Matrix &Samples, CSG_Strings &Names)
+{
+	int			iGrid;
+	double		zGrid;
+	CSG_Vector	Sample;
+
+	//-----------------------------------------------------
+	int		Interpolation	= Parameters("INTERPOL")	->asInt();
+	bool	bCoord_X		= Parameters("COORD_X")		->asBool();
+	bool	bCoord_Y		= Parameters("COORD_Y")		->asBool();
+
+	Names	+= pShapes->Get_Field_Name(iAttribute);		// Dependent Variable
+
+	for(iGrid=0; iGrid<pGrids->Get_Count(); iGrid++)	// Independent Variables
+	{
+		Names	+= pGrids->asGrid(iGrid)->Get_Name();
+	}
+
+	if( bCoord_X )	{	Names	+= SG_T("X");	}
+	if( bCoord_Y )	{	Names	+= SG_T("Y");	}
+
+	Sample.Create(1 + pGrids->Get_Count() + (bCoord_X ? 1 : 0) + (bCoord_Y ? 1 : 0));
+
+	//-----------------------------------------------------
+	for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+
+		if( !pShape->is_NoData(iAttribute) )
+		{
+			Sample[0]	= pShape->asDouble(iAttribute);
+
+			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					bool		bAdd	= true;
+					TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
+
+					for(iGrid=0; iGrid<pGrids->Get_Count() && bAdd; iGrid++)
+					{
+						if( pGrids->asGrid(iGrid)->Get_Value(Point, zGrid, Interpolation) )
+						{
+							Sample[1 + iGrid]	= zGrid;
+						}
+						else
+						{
+							bAdd	= false;
+						}
+					}
+
+					if( bAdd )
+					{
+						if( bCoord_X )	{	Sample[1 + iGrid++]	= Point.x;	}
+						if( bCoord_Y )	{	Sample[1 + iGrid++]	= Point.y;	}
+
+						Samples.Add_Row(Sample);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( Samples.Get_NRows() >= pGrids->Get_Count() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Multi_Grid_Regression::Set_Regression(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pRegression, const CSG_String &Name)
+{
+	if( !pRegression )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			iGrid, nGrids, x, y;
+	TSG_Point	p;
+
+	int		Interpolation	= Parameters("INTERPOL")	->asInt();
+
+	CSG_Grid	**ppGrids	= (CSG_Grid **)SG_Malloc(m_Regression.Get_nPredictors() * sizeof(CSG_Grid *));
+
+	int	iCoord_X	= -1;
+	int	iCoord_Y	= -1;
+
+	for(iGrid=0, nGrids=0; iGrid<m_Regression.Get_nPredictors(); iGrid++)
+	{
+		if( m_Regression.Get_Predictor(iGrid) < pGrids->Get_Count() )
+		{
+			ppGrids[nGrids++]	= pGrids->asGrid(m_Regression.Get_Predictor(iGrid));
+		}
+		else if( m_Regression.Get_Predictor(iGrid) == pGrids->Get_Count() && Parameters("COORD_X")->asBool() )
+		{
+			iCoord_X = iGrid;
+		}
+		else // if( m_Regression.Get_Predictor(iGrid) > pGrids->Get_Count() || Parameters("COORD_X")->asBool() == false )
+		{
+			iCoord_Y = iGrid;
+		}
+	}
+
+	pRegression->Set_Name(Name);
+
+	//-----------------------------------------------------
+	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
+	{
+		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
+		{
+			bool	bOkay;
+			double	z	= m_Regression.Get_RConst();
+
+			for(iGrid=0, bOkay=true; bOkay && iGrid<nGrids; iGrid++)
+			{
+				double	zGrid;
+
+				if( ppGrids[iGrid]->Get_Value(p, zGrid, Interpolation) )
+				{
+					z	+= m_Regression.Get_RCoeff(iGrid) * zGrid;
+				}
+				else
+				{
+					bOkay	= false;
+				}
+			}
+
+			//---------------------------------------------
+			if( bOkay )
+			{
+				if( iCoord_X >= 0 )
+				{
+					z	+= m_Regression.Get_RCoeff(iCoord_X) * p.x;
+				}
+
+				if( iCoord_Y >= 0 )
+				{
+					z	+= m_Regression.Get_RCoeff(iCoord_Y) * p.y;
+				}
+
+				pRegression->Set_Value (x, y, z);
+			}
+			else
+			{
+				pRegression->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	SG_Free(ppGrids);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Multi_Grid_Regression::Set_Residuals(CSG_Shapes *pShapes, int iAttribute, CSG_Grid *pRegression)
+{
+	CSG_Shapes	*pResiduals		= Parameters("RESIDUALS")->asShapes();
+
+	if( !pRegression || !pResiduals )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Residuals")));
+	pResiduals->Add_Field(pShapes->Get_Field_Name(iAttribute), SG_DATATYPE_Double);
+	pResiduals->Add_Field("TREND"	, SG_DATATYPE_Double);
+	pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
+
+	int	Interpolation	= Parameters("INTERPOL")->asInt();
+
+	//-------------------------------------------------
+	for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+
+		if( !pShape->is_NoData(iAttribute) )
+		{
+			double	zShape	= pShape->asDouble(iAttribute);
+
+			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					double		zGrid;
+					TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
+
+					if( pRegression->Get_Value(Point, zGrid, Interpolation) )
+					{
+						CSG_Shape	*pResidual	= pResiduals->Add_Shape();
+
+						pResidual->Add_Point(Point);
+						pResidual->Set_Value(0, zShape);
+						pResidual->Set_Value(1, zGrid);
+						pResidual->Set_Value(2, zShape - zGrid);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//	//-----------------------------------------------------
+//	Parameters.Add_Choice(
+//		NULL	,"CORRECTION"	, _TL("Adjustment"),
+//		_TL(""),
+//		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+//			_TL("Smith"),
+//			_TL("Wherry 1"),
+//			_TL("Wherry 2"),
+//			_TL("Olkin & Pratt"),
+//			_TL("Pratt"),
+//			_TL("Claudy 3")
+//		), 1
+//	);
+//
+//	TSG_Regression_Correction	m_Correction;
+//
+//	switch( Parameters("CORRECTION")->asInt() )
+//	{
+//	case 0:	m_Correction	= REGRESSION_CORR_Smith;		break;
+//	case 1:	m_Correction	= REGRESSION_CORR_Wherry_1;		break;
+//	case 2:	m_Correction	= REGRESSION_CORR_Wherry_2;		break;
+//	case 3:	m_Correction	= REGRESSION_CORR_Olkin_Pratt;	break;
+//	case 4:	m_Correction	= REGRESSION_CORR_Pratt;		break;
+//	case 5:	m_Correction	= REGRESSION_CORR_Claudy_3;		break;
+//	}
+//
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/point_multi_grid_regression.h b/src/modules/statistics/statistics_regression/point_multi_grid_regression.h
new file mode 100644
index 0000000..a4414f6
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/point_multi_grid_regression.h
@@ -0,0 +1,112 @@
+/**********************************************************
+ * Version $Id: point_multi_grid_regression.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              point_multi_grid_regression.h            //
+//                                                       //
+//                 Copyright (C) 2004 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__point_multi_grid_regression_H
+#define HEADER_INCLUDED__point_multi_grid_regression_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPoint_Multi_Grid_Regression : public CSG_Module_Grid
+{
+public:
+	CPoint_Multi_Grid_Regression(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	CSG_Regression_Multiple		m_Regression;
+
+
+	bool						Get_Samples			(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pShapes, int iAttribute, CSG_Matrix &Samples, CSG_Strings &Names);
+
+	bool						Set_Regression		(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pRegression, const CSG_String &Name);
+
+	bool						Set_Residuals		(CSG_Shapes *pShapes, int iAttribute, CSG_Grid *pRegression);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__point_multi_grid_regression_H
diff --git a/src/modules/statistics/statistics_regression/point_trend_surface.cpp b/src/modules/statistics/statistics_regression/point_trend_surface.cpp
new file mode 100644
index 0000000..91a9082
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/point_trend_surface.cpp
@@ -0,0 +1,485 @@
+/**********************************************************
+ * Version $Id: point_trend_surface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                point_trend_surface.cpp                //
+//                                                       //
+//                 Copyright (C) 2010 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 "point_trend_surface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPoint_Trend_Surface::CPoint_Trend_Surface(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Polynomial Regression"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Reference:\n"
+		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
+	));
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "ATTRIBUTE"	, _TL("Attribute"),
+		_TL("")
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "RESIDUALS"	, _TL("Residuals"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "POLYNOM"		, _TL("Polynom"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("simple planar surface"),	// a + bx + cy
+			_TL("bi-linear saddle"),		// a + bx + cy + dxy
+			_TL("quadratic surface"),		// a + bx + cy + dxy + ex2 + fy2
+			_TL("cubic surface"),			// a + bx + cy + dxy + ex2 + fy2 + gx2y + hxy2 + ix3 + iy3
+			_TL("user defined")
+		), 0
+	);
+
+	pNode	= Parameters.Add_Node(
+		NULL	, "NODE_USER"	, _TL("User Defined Polynomial"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "XORDER"		, _TL("Maximum X Order"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "YORDER"		, _TL("Maximum Y Order"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 4, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "TORDER"		, _TL("Maximum Total Order"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 4, 0, true
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "TARGET"		, _TL("Trend Surface"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("user defined"),
+			_TL("grid")
+		), 0
+	);
+
+	m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid")	, _TL("")));
+	m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid")			, _TL("")));
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CPoint_Trend_Surface::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Trend_Surface::On_Execute(void)
+{
+	int			iAttribute;
+	CSG_Shapes	*pPoints, *pResiduals;
+	CSG_Grid	*pRegression;
+
+	//-----------------------------------------------------
+	pPoints		= Parameters("POINTS")		->asShapes();
+	pResiduals	= Parameters("RESIDUALS")	->asShapes();
+	iAttribute	= Parameters("ATTRIBUTE")	->asInt();
+
+	switch( Parameters("POLYNOM")->asInt() )
+	{
+	case 0:	m_xOrder = 1; m_yOrder = 1; m_tOrder = 1;	break;	// simple planar surface	// a + bx + cy
+	case 1:	m_xOrder = 1; m_yOrder = 1; m_tOrder = 2;	break;	// bi-linear saddle"),		// a + bx + cy + dxy
+	case 2:	m_xOrder = 2; m_yOrder = 2; m_tOrder = 2;	break;	// quadratic surface"),		// a + bx + cy + dxy + ex2 + fy2
+	case 3:	m_xOrder = 3; m_yOrder = 3; m_tOrder = 3;	break;	// cubic surface"),			// a + bx + cy + dxy + ex2 + fy2 + gx2y + hxy2 + ix3 + iy3
+	case 4:
+		m_xOrder	= Parameters("XORDER")->asInt();
+		m_yOrder	= Parameters("YORDER")->asInt();
+		m_tOrder	= Parameters("TORDER")->asInt();
+		break;
+	}
+
+	//-----------------------------------------------------
+	if( !Get_Regression(pPoints, iAttribute) )
+	{
+		return( false );
+	}
+
+	Set_Message();
+
+	//-----------------------------------------------------
+	pRegression		= NULL;
+
+	switch( Parameters("TARGET")->asInt() )
+	{
+	case 0:	// user defined...
+		if( m_Grid_Target.Init_User(pPoints->Get_Extent()) && Dlg_Parameters("USER") )
+		{
+			pRegression	= m_Grid_Target.Get_User();
+		}
+		break;
+
+	case 1:	// grid...
+		if( Dlg_Parameters("GRID") )
+		{
+			pRegression	= m_Grid_Target.Get_Grid();
+		}
+		break;
+	}
+
+	if( pRegression == NULL )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Trend Surface")));
+
+	Set_Regression(pRegression);
+
+	Set_Residuals(pPoints, iAttribute, pResiduals, pRegression);
+
+	m_Coefficients.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CPoint_Trend_Surface::Get_Power(const SG_Char *Value, int Power)
+{
+	if( Power > 0 )
+	{
+		if( Power > 1 )
+		{
+			return( CSG_String::Format(SG_T("%s%d"), Value, Power) );
+		}
+
+		return( Value );
+	}
+
+	return( SG_T("") );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPoint_Trend_Surface::Get_Regression(CSG_Shapes *pPoints, int iAttribute)
+{
+	//-----------------------------------------------------
+	int		i, j, Field;
+
+	m_Names.Clear();
+
+	m_Names	+= pPoints->Get_Name();
+
+	for(i=1; i<=m_xOrder; i++)
+	{
+		m_Names	+= Get_Power(SG_T("x"), i);
+	}
+
+	for(i=1; i<=m_yOrder; i++)
+	{
+		m_Names	+= Get_Power(SG_T("y"), i);
+
+		for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
+		{
+			m_Names	+= Get_Power(SG_T("x"), j) + Get_Power(SG_T("y"), i);
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_Vector	Y, xPow, yPow;
+	CSG_Matrix	X;
+
+	Y.Create(pPoints->Get_Count());
+	X.Create(m_Names.Get_Count(), pPoints->Get_Count());
+	
+	xPow.Create(m_xOrder + 1);
+	yPow.Create(m_yOrder + 1);
+
+	xPow[0]	= 1.0;
+	yPow[0]	= 1.0;
+
+	//-----------------------------------------------------
+	for(int iShape=0; iShape<pPoints->Get_Count() && Set_Progress(iShape, pPoints->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= pPoints->Get_Shape(iShape);
+
+		if( !pShape->is_NoData(iAttribute) )
+		{
+			double		zShape	= pShape->asDouble(iAttribute);
+			TSG_Point	Point	= pShape->Get_Point(0);
+
+			Y[iShape]		= zShape;
+			X[iShape][0]	= 1.0;
+
+			for(i=1, Field=1; i<=m_xOrder; i++)
+			{
+				X[iShape][Field++]	= xPow[i]	= xPow[i - 1] * Point.x;
+			}
+
+			for(i=1; i<=m_yOrder; i++)
+			{
+				X[iShape][Field++]	= yPow[i]	= yPow[i - 1] * Point.y;
+
+				for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
+				{
+					X[iShape][Field++]	= xPow[j] * yPow[i];
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_Matrix	Xt, XtXinv;
+
+	Xt		= X;
+	Xt		.Set_Transpose();
+
+	XtXinv	= Xt * X;
+	XtXinv	.Set_Inverse();
+
+	m_Coefficients	= XtXinv * Xt * Y;
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CPoint_Trend_Surface::Set_Regression(CSG_Grid *pRegression)
+{
+	int			x, y, i, j, Field;
+	double		z;
+	TSG_Point	Point;
+	CSG_Vector	xPow(m_xOrder + 1), yPow(m_yOrder + 1);
+
+	xPow[0]	= 1.0;
+	yPow[0]	= 1.0;
+
+	for(y=0, Point.y=pRegression->Get_YMin(); y<pRegression->Get_NY() && Set_Progress(y, pRegression->Get_NY()); y++, Point.y+=pRegression->Get_Cellsize())
+	{
+		for(x=0, Point.x=pRegression->Get_XMin(); x<pRegression->Get_NX(); x++, Point.x+=pRegression->Get_Cellsize())
+		{
+			z	 = m_Coefficients[0];
+
+			for(i=1, Field=1; i<=m_xOrder; i++)
+			{
+				z	+= m_Coefficients[Field++] * (xPow[i] = xPow[i - 1] * Point.x);
+			}
+
+			for(i=1; i<=m_yOrder; i++)
+			{
+				z	+= m_Coefficients[Field++] * (yPow[i] = yPow[i - 1] * Point.y);
+
+				for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
+				{
+					z	+= m_Coefficients[Field++] * xPow[j] * yPow[i];
+				}
+			}
+
+			pRegression->Set_Value(x, y, z);
+		}
+	}
+
+	DataObject_Update(pRegression);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CPoint_Trend_Surface::Set_Residuals(CSG_Shapes *pPoints, int iAttribute, CSG_Shapes *pResiduals, CSG_Grid *pRegression)
+{
+	int			iPoint, iPart, iShape;
+	double		zShape, zGrid;
+	TSG_Point	Point;
+	CSG_Shape	*pShape, *pResidual;
+
+	//-----------------------------------------------------
+	if( pResiduals )
+	{
+		pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Residuals")));
+		pResiduals->Add_Field(pPoints->Get_Field_Name(iAttribute), SG_DATATYPE_Double);
+		pResiduals->Add_Field("POLYNOM" , SG_DATATYPE_Double);
+		pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
+
+		//-------------------------------------------------
+		for(iShape=0; iShape<pPoints->Get_Count() && Set_Progress(iShape, pPoints->Get_Count()); iShape++)
+		{
+			pShape	= pPoints->Get_Shape(iShape);
+
+			if( !pShape->is_NoData(iAttribute) )
+			{
+				zShape	= pShape->asDouble(iAttribute);
+
+				for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+				{
+					for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+					{
+						Point	= pShape->Get_Point(iPoint, iPart);
+
+						if( pRegression->Get_Value(Point, zGrid) )
+						{
+							pResidual	= pResiduals->Add_Shape();
+							pResidual->Add_Point(Point);
+							pResidual->Set_Value(0, zShape);
+							pResidual->Set_Value(1, zGrid);
+							pResidual->Set_Value(2, zShape - zGrid);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+void CPoint_Trend_Surface::Set_Message(void)
+{
+	int			i;
+	CSG_String	s;
+
+	//-----------------------------------------------------
+	s	+= CSG_String::Format(SG_T("\n%s:"), _TL("Regression"));
+
+	//-----------------------------------------------------
+	s	+= CSG_String::Format(SG_T("\n z = A"));
+
+	for(i=1; i<m_Coefficients.Get_N(); i++)
+	{
+		s	+= CSG_String::Format(SG_T(" + %c%s"), 'A' + i, m_Names[i].c_str());
+	}
+
+	s	+= SG_T("\n");
+
+	//-----------------------------------------------------
+	s	+= CSG_String::Format(SG_T("\n z = %f"), m_Coefficients[0]);
+
+	for(i=1; i<m_Coefficients.Get_N(); i++)
+	{
+		s	+= CSG_String::Format(SG_T(" %+f*%s"), m_Coefficients[i], m_Names[i].c_str());
+	}
+
+	s	+= SG_T("\n");
+
+	//-----------------------------------------------------
+	Message_Add(s, false);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/point_trend_surface.h b/src/modules/statistics/statistics_regression/point_trend_surface.h
new file mode 100644
index 0000000..cc54eb0
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/point_trend_surface.h
@@ -0,0 +1,117 @@
+/**********************************************************
+ * Version $Id: point_trend_surface.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 point_trend_surface.h                 //
+//                                                       //
+//                 Copyright (C) 2010 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__point_trend_surface_H
+#define HEADER_INCLUDED__point_trend_surface_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CPoint_Trend_Surface : public CSG_Module
+{
+public:
+	CPoint_Trend_Surface(void);
+
+
+protected:
+
+	virtual bool				On_Execute				(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	int							m_xOrder, m_yOrder, m_tOrder;
+
+	CSG_Parameters_Grid_Target	m_Grid_Target;
+
+	CSG_Vector					m_Coefficients;
+
+	CSG_Strings					m_Names;
+
+	CSG_String					Get_Power				(const SG_Char *Value, int Power);
+
+	bool						Get_Regression			(CSG_Shapes *pPoints, int iAttribute);
+	bool						Set_Regression			(CSG_Grid *pRegression);
+
+	bool						Set_Residuals			(CSG_Shapes *pPoints, int iAttribute, CSG_Shapes *pResiduals, CSG_Grid *pRegression);
+	void						Set_Message				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__point_trend_surface_H
diff --git a/src/modules/statistics/statistics_regression/table_regression_multiple.cpp b/src/modules/statistics/statistics_regression/table_regression_multiple.cpp
new file mode 100644
index 0000000..d793b3a
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/table_regression_multiple.cpp
@@ -0,0 +1,482 @@
+/**********************************************************
+ * Version $Id: table_regression_multiple.cpp 1098 2011-06-16 16:06:32Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             table_regression_multiple.cpp             //
+//                                                       //
+//                 Copyright (C) 2012 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 "table_regression_multiple.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CTable_Regression_Multiple_Base::Initialise(void)
+{
+	//-----------------------------------------------------
+	Set_Author		(SG_T("O.Conrad (c) 2012"));
+
+	Set_Description	(_TW(
+		"Multiple linear regression analysis using ordinary least squares."
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode	= Parameters("TABLE");
+
+	Parameters.Add_Table_Field(
+		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
+		_TL("")
+	);
+
+	Parameters.Add_Parameters(
+		pNode	, "PREDICTORS"	, _TL("Independent Variables"),
+		_TL("")
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_COEFF"	, _TL("Details: Coefficients"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_MODEL"	, _TL("Details: Model"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Table(
+		NULL	, "INFO_STEPS"	, _TL("Details: Steps"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("include all"),
+			_TL("forward"),
+			_TL("backward"),
+			_TL("stepwise")
+		), 3
+	);
+
+	Parameters.Add_Value(
+		NULL	, "P_IN"		, _TL("P in"),
+		_TL("Level of significance for automated predictor selection, given as percentage"),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "P_OUT"		, _TL("P out"),
+		_TL("Level of significance for automated predictor selection, given as percentage"),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	,"CROSSVAL"		, _TL("Cross Validation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("none"),
+			_TL("leave one out"),
+			_TL("2-fold"),
+			_TL("k-fold")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CROSSVAL_K"	, _TL("Cross Validation Subsamples"),
+		_TL("number of subsamples for k-fold cross validation"),
+		PARAMETER_TYPE_Int, 10, 2, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CTable_Regression_Multiple_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) )
+	{
+		CSG_Table		*pTable			= pParameter->asTable();
+		CSG_Parameters	*pPredictors	= pParameters->Get_Parameter("PREDICTORS")->asParameters();
+
+		pPredictors->Del_Parameters();
+
+		if( pTable )
+		{
+			for(int i=0; i<pTable->Get_Field_Count(); i++)
+			{
+				if( SG_Data_Type_is_Numeric(pTable->Get_Field_Type(i)) )
+				{
+					pPredictors->Add_Value(NULL, SG_Get_String(i, 0), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int CTable_Regression_Multiple_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
+	{
+		pParameters->Get_Parameter("P_IN" )->Set_Enabled(pParameter->asInt() == 1 || pParameter->asInt() == 3);	// forward or stepwise
+		pParameters->Get_Parameter("P_OUT")->Set_Enabled(pParameter->asInt() == 2 || pParameter->asInt() == 3);	// backward or stepwise
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CROSSVAL")) )
+	{
+		pParameters->Get_Parameter("CROSSVAL_K")->Set_Enabled(pParameter->asInt() == 3);	// k-fold
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTable_Regression_Multiple_Base::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Parameters	*pPredictors	= Parameters("PREDICTORS")->asParameters();
+
+	if( pPredictors->Get_Count() <= 0 )
+	{
+		Message_Add(_TL("no predictors available"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int			Dependent, iPredictor, nPredictors, *Predictors, iSample;
+	CSG_Strings	Names;
+	CSG_Table	*pTable;
+
+	Dependent	= Parameters("DEPENDENT")->asInt();
+	Predictors	= new int[pPredictors->Get_Count()];
+
+	pTable		= Parameters("TABLE")->asTable();
+
+	Names	+= pTable->Get_Field_Name(Dependent);
+
+	for(iPredictor=0, nPredictors=0; iPredictor<pPredictors->Get_Count(); iPredictor++)	// Independent Variables
+	{
+		if( pPredictors->Get_Parameter(iPredictor)->asBool() )
+		{
+			Names	+= pTable->Get_Field_Name(
+				Predictors[nPredictors++]	= CSG_String(pPredictors->Get_Parameter(iPredictor)->Get_Identifier()).asInt()
+			);
+		}
+	}
+
+	if( nPredictors <= 0 )
+	{
+		Message_Add(_TL("no predictors in selection"));
+
+		delete[](Predictors);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Vector	Sample(1 + nPredictors);
+	CSG_Matrix	Samples;
+
+	for(iSample=0; iSample<pTable->Get_Count(); iSample++)
+	{
+		CSG_Table_Record	*pRecord	= pTable->Get_Record(iSample);
+
+		if( !pRecord->is_NoData(Dependent) )
+		{
+			bool	bOkay	= true;
+
+			Sample[0]	= pRecord->asDouble(Dependent);
+
+			for(iPredictor=0; iPredictor<nPredictors && bOkay; iPredictor++)
+			{
+				if( !pRecord->is_NoData(Predictors[iPredictor]) )
+				{
+					Sample[1 + iPredictor]	= pRecord->asDouble(Predictors[iPredictor]);
+				}
+				else
+				{
+					bOkay	= false;
+				}
+			}
+
+			if( bOkay )
+			{
+				Samples.Add_Row(Sample);
+			}
+		}
+	}
+
+	if( Samples.Get_NRows() <= 0 )
+	{
+		Message_Add(_TL("no valid samples in data set"));
+
+		delete[](Predictors);
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Regression_Multiple	Regression;
+
+	double	P_in	= Parameters("P_IN" )->asDouble();
+	double	P_out	= Parameters("P_OUT")->asDouble();
+
+	switch( Parameters("METHOD")->asInt() )
+	{
+	default:
+	case 0:	if( !Regression.Get_Model         (Samples             , &Names) )	return( false );	break;
+	case 1:	if( !Regression.Get_Model_Forward (Samples, P_in       , &Names) )	return( false );	break;
+	case 2:	if( !Regression.Get_Model_Backward(Samples,       P_out, &Names) )	return( false );	break;
+	case 3:	if( !Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names) )	return( false );	break;
+	}
+
+	Message_Add(Regression.Get_Info(), false);
+
+	//-----------------------------------------------------
+	int	CrossVal;
+
+	switch( Parameters("CROSSVAL")->asInt() )
+	{
+	default:	CrossVal	= 0;									break;	// none
+	case 1:		CrossVal	= 1;									break;	// leave one out (LOOVC)
+	case 2:		CrossVal	= 2;									break;	// 2-fold
+	case 3:		CrossVal	= Parameters("CROSSVAL_K")->asInt();	break;	// k-fold
+	}
+
+	if( CrossVal > 0 && Regression.Get_CrossValidation(CrossVal) )
+	{
+		Message_Add(CSG_String::Format(SG_T("\n%s:\n"      ), _TL("Cross Validation")), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%s\n"  ), _TL("Type"   ), Parameters("CROSSVAL")->asString()), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%d\n"  ), _TL("Samples"), Regression.Get_CV_nSamples()      ), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%f\n"  ), _TL("RMSE"   ), Regression.Get_CV_RMSE()          ), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("NRMSE"  ), Regression.Get_CV_NRMSE()  * 100.0), false);
+		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("R2"     ), Regression.Get_CV_R2()     * 100.0), false);
+	}
+
+	//-----------------------------------------------------
+	if( Parameters("INFO_COEFF")->asTable() )
+	{
+		Parameters("INFO_COEFF")->asTable()->Assign(Regression.Get_Info_Regression());
+		Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients"));
+	}
+
+	if( Parameters("INFO_MODEL")->asTable() )
+	{
+		Parameters("INFO_MODEL")->asTable()->Assign(Regression.Get_Info_Model());
+		Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model"));
+	}
+
+	if( Parameters("INFO_STEPS")->asTable() )
+	{
+		Parameters("INFO_STEPS")->asTable()->Assign(Regression.Get_Info_Steps());
+		Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps"));
+	}
+
+	//-----------------------------------------------------
+	CSG_Table	*pResults	= Parameters("RESULTS")->asTable();
+
+	if( pResults != NULL && pResults != pTable )
+	{
+		if( pResults->Get_ObjectType() == DATAOBJECT_TYPE_Shapes
+		&&	pTable  ->Get_ObjectType() == DATAOBJECT_TYPE_Shapes )
+		{
+			((CSG_Shapes *)pResults)->Create(*((CSG_Shapes *)pTable));
+		}
+		else
+		{
+			pResults->Create(*pTable);
+		}
+
+		pResults->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pTable->Get_Name(), _TL("Regression")));
+
+		pTable	= pResults;
+	}
+
+	//-----------------------------------------------------
+	int	Offset	= pTable->Get_Field_Count();
+
+	pTable->Add_Field(_TL("PREDICTED"), SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("RESIDUAL" ), SG_DATATYPE_Double);
+
+	for(iSample=0; iSample<pTable->Get_Count(); iSample++)
+	{
+		CSG_Table_Record	*pRecord	= pTable->Get_Record(iSample);
+
+		bool	bOkay	= false;
+		double	z		= Regression.Get_RConst();
+
+		if( !pRecord->is_NoData(Dependent) )
+		{
+			for(iPredictor=0, bOkay=true; iPredictor<Regression.Get_nPredictors() && bOkay; iPredictor++)
+			{
+				if( !pRecord->is_NoData(Predictors[iPredictor]) )
+				{
+					z	+= Regression.Get_RCoeff(Regression.Get_Predictor(iPredictor)) * pRecord->asDouble(Predictors[iPredictor]);
+				}
+				else
+				{
+					bOkay	= false;
+				}
+			}
+		}
+
+		if( bOkay )
+		{
+			pRecord->Set_Value(Offset + 0, z);
+			pRecord->Set_Value(Offset + 1, z - pRecord->asDouble(Dependent));
+		}
+		else
+		{
+			pRecord->Set_NoData(Offset + 0);
+			pRecord->Set_NoData(Offset + 1);
+		}
+	}
+
+	if( pTable != Parameters("RESULTS")->asTable() )
+	{
+		DataObject_Update(pTable);
+	}
+
+	//-----------------------------------------------------
+	delete[](Predictors);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Regression_Multiple::CTable_Regression_Multiple(void)
+	: CTable_Regression_Multiple_Base()
+{
+	Set_Name		(_TL("Multiple Linear Regression Analysis"));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"	, _TL("Table"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Table(
+		NULL	, "RESULTS"	, _TL("Results"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Initialise();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Regression_Multiple_Shapes::CTable_Regression_Multiple_Shapes(void)
+	: CTable_Regression_Multiple_Base()
+{
+	Set_Name		(_TL("Multiple Linear Regression Analysis (Shapes)"));
+
+	Parameters.Add_Shapes(
+		NULL	, "TABLE"	, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "RESULTS"	, _TL("Results"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Initialise();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/table_regression_multiple.h b/src/modules/statistics/statistics_regression/table_regression_multiple.h
new file mode 100644
index 0000000..0dc5f4f
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/table_regression_multiple.h
@@ -0,0 +1,117 @@
+/**********************************************************
+ * Version $Id: table_regression_multiple.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              table_regression_multiple.h              //
+//                                                       //
+//                 Copyright (C) 2012 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__table_regression_multiple_H
+#define HEADER_INCLUDED__table_regression_multiple_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Regression_Multiple_Base : public CSG_Module
+{
+protected:
+
+	void						Initialise				(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+};
+
+//---------------------------------------------------------
+class CTable_Regression_Multiple : public CTable_Regression_Multiple_Base
+{
+public:
+	CTable_Regression_Multiple(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Table") );	}
+
+};
+
+//---------------------------------------------------------
+class CTable_Regression_Multiple_Shapes : public CTable_Regression_Multiple_Base
+{
+public:
+	CTable_Regression_Multiple_Shapes(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Shapes") );	}
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__table_regression_multiple_H
diff --git a/src/modules/statistics/statistics_regression/table_trend.cpp b/src/modules/statistics/statistics_regression/table_trend.cpp
new file mode 100644
index 0000000..4724d3f
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/table_trend.cpp
@@ -0,0 +1,280 @@
+/**********************************************************
+ * Version $Id: Table_Trend.cpp 1098 2011-06-16 16:06:32Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   table_trend.cpp                     //
+//                                                       //
+//                 Copyright (C) 2006 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "table_trend.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CTable_Trend_Base::Initialise(void)
+{
+	//-----------------------------------------------------
+	Set_Author		(SG_T("O.Conrad (c) 2006"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode	= Parameters("TABLE");
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD_X"		, _TL("X Values"),
+		_TL("")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD_Y"		, _TL("Y Values"),
+		_TL("")
+	);
+
+	Parameters.Add_String(
+		NULL	, "FORMULA"		, _TL("Formula"),
+		_TL(""),
+		SG_T("m * x + b")
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "FORMULAS"	, _TL("Pre-defined Formulas"),
+		_TL(""),
+
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("Linear: a + b * x"),
+			_TL("Quadric: a + b * x + c * x^2"),
+			_TL("Cubic: a + b * x + c * x^2 + d * x^3"),
+			_TL("Logarithmic: a + b * ln(x)"),
+			_TL("Power: a + b * x^c"),
+			_TL("a + b / x"),
+			_TL("a + b * (1 - exp(-x / c))"),
+			_TL("a + b * (1 - exp(-(x / c)^2))")
+		), 0
+	);
+
+	Parameters.Add_Table(
+		NULL	, "TREND"		, _TL("Table (with Trend)"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+}
+
+//---------------------------------------------------------
+int CTable_Trend_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULAS")) )
+	{
+		const SG_Char	*Formula;
+
+		switch( pParameter->asInt() )
+		{
+		default:	return( false );
+		case 0:	Formula	= SG_T("a + b * x");						break;
+		case 1:	Formula	= SG_T("a + b * x + c * x^2");				break;
+		case 2:	Formula	= SG_T("a + b * x + c * x^2 + d * x^3");	break;
+		case 3:	Formula	= SG_T("a + b * ln(x)");					break;
+		case 4:	Formula	= SG_T("a + b * x^c");						break;
+		case 5:	Formula	= SG_T("a + b / x");						break;
+		case 6:	Formula	= SG_T("a + b * (1 - exp(-x / c))");		break;
+		case 7:	Formula	= SG_T("a + b * (1 - exp(-(x / c)^2))");	break;
+		}
+
+		pParameters->Get_Parameter("FORMULA")->Set_Value(Formula);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULA")) )
+	{
+		if( !m_Trend.Set_Formula(pParameter->asString()) )
+		{
+			Message_Dlg(m_Trend.Get_Error(), _TL("Error in Formula"));
+
+			return( false );
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CTable_Trend_Base::On_Execute(void)
+{
+	int					i, j, xField, yField;
+	CSG_String			Name;
+	CSG_Table_Record	*pRecord;
+	CSG_Table			*pTable;
+
+	pTable	= Parameters("TABLE")	->asTable();
+	xField	= Parameters("FIELD_X")	->asInt();
+	yField	= Parameters("FIELD_Y")	->asInt();
+
+	//-----------------------------------------------------
+	if( m_Trend.Set_Formula(Parameters("FORMULA")->asString()) )
+	{
+		m_Trend.Clr_Data();
+
+		for(i=0; i<pTable->Get_Record_Count(); i++)
+		{
+			pRecord	= pTable->Get_Record(i);
+
+			m_Trend.Add_Data(pRecord->asDouble(xField), pRecord->asDouble(yField));
+		}
+
+		//-------------------------------------------------
+		if( m_Trend.Get_Trend() )
+		{
+			Message_Add(SG_T("\n"), false);
+			Message_Add(m_Trend.Get_Formula(), false);
+			Message_Add(SG_T("\n"), false);
+			Message_Add(CSG_String::Format(SG_T("R2 : %f"), 100.0 * m_Trend.Get_R2()), false);
+
+			if( Parameters("TREND")->asTable() == NULL )
+			{
+				pTable->Add_Field("TREND"	, SG_DATATYPE_Double);
+
+				for(i=0, j=pTable->Get_Field_Count()-1; i<m_Trend.Get_Data_Count(); i++)
+				{
+					pRecord	= pTable->Get_Record(i);
+					pRecord->Set_Value(j, m_Trend.Get_Value(m_Trend.Get_Data_X(i)));
+				}
+			}
+			else
+			{
+				Name.Printf(SG_T("%s [%s]"), pTable->Get_Name(), _TL("Trend"));
+				pTable	= Parameters("TREND")->asTable();
+				pTable->Destroy();
+				pTable->Set_Name(Name);
+				pTable->Add_Field("X"		, SG_DATATYPE_Double);
+				pTable->Add_Field("Y"		, SG_DATATYPE_Double);
+				pTable->Add_Field("Y_TREND"	, SG_DATATYPE_Double);
+
+				for(i=0; i<m_Trend.Get_Data_Count(); i++)
+				{
+					pRecord	= pTable->Add_Record();
+					pRecord->Set_Value(0, m_Trend.Get_Data_X(i));
+					pRecord->Set_Value(1, m_Trend.Get_Data_Y(i));
+					pRecord->Set_Value(2, m_Trend.Get_Value(m_Trend.Get_Data_X(i)));
+				}
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Trend::CTable_Trend(void)
+	: CTable_Trend_Base()
+{
+	Set_Name		(_TL("Trend Analysis"));
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"	, _TL("Table"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Initialise();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTable_Trend_Shapes::CTable_Trend_Shapes(void)
+	: CTable_Trend_Base()
+{
+	Set_Name		(_TL("Trend Analysis (Shapes)"));
+
+	Parameters.Add_Shapes(
+		NULL	, "TABLE"	, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Initialise();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/statistics/statistics_regression/table_trend.h b/src/modules/statistics/statistics_regression/table_trend.h
new file mode 100644
index 0000000..41f6754
--- /dev/null
+++ b/src/modules/statistics/statistics_regression/table_trend.h
@@ -0,0 +1,123 @@
+/**********************************************************
+ * Version $Id: Table_Trend.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                 statistics_regression                 //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     table_trend.h                     //
+//                                                       //
+//                 Copyright (C) 2006 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Table_Trend_H
+#define HEADER_INCLUDED__Table_Trend_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTable_Trend_Base : public CSG_Module
+{
+protected:
+
+	void						Initialise				(void);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+
+private:
+
+	CSG_Trend					m_Trend;
+
+};
+
+//---------------------------------------------------------
+class CTable_Trend : public CTable_Trend_Base
+{
+public:
+	CTable_Trend(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Table") );	}
+
+};
+
+//---------------------------------------------------------
+class CTable_Trend_Shapes : public CTable_Trend_Base
+{
+public:
+	CTable_Trend_Shapes(void);
+
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Shapes") );	}
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Table_Trend_H
diff --git a/src/modules/table/Makefile.in b/src/modules/table/Makefile.in
index fec2b76..5be3583 100644
--- a/src/modules/table/Makefile.in
+++ b/src/modules/table/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -278,11 +302,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -346,6 +370,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -409,6 +437,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -444,13 +486,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -485,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -566,22 +610,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/table/table_calculus/Makefile.in b/src/modules/table/table_calculus/Makefile.in
index eba0e3c..9327bb2 100644
--- a/src/modules/table/table_calculus/Makefile.in
+++ b/src/modules/table/table_calculus/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/table/table_calculus
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libtable_calculus_la_DEPENDENCIES =  \
@@ -105,6 +128,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libtable_calculus_la_SOURCES)
 DIST_SOURCES = $(libtable_calculus_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -130,6 +158,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -157,6 +186,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -169,6 +199,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -198,6 +229,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -231,7 +263,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -319,7 +350,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -327,6 +357,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -342,13 +374,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libtable_calculus.la: $(libtable_calculus_la_OBJECTS) $(libtable_calculus_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libtable_calculus.la: $(libtable_calculus_la_OBJECTS) $(libtable_calculus_la_DEPENDENCIES) $(EXTRA_libtable_calculus_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libtable_calculus_la_OBJECTS) $(libtable_calculus_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -443,6 +477,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -493,10 +541,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -582,18 +635,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/table/table_calculus/Table_Calculator.cpp b/src/modules/table/table_calculus/Table_Calculator.cpp
index aade9e7..9741577 100644
--- a/src/modules/table/table_calculus/Table_Calculator.cpp
+++ b/src/modules/table/table_calculus/Table_Calculator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Calculator.cpp 1889 2013-12-03 16:19:55Z reklov_w $
+ * Version $Id: Table_Calculator.cpp 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     TableCalculator.cpp
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/Table_Calculator.h b/src/modules/table/table_calculus/Table_Calculator.h
index ea2b503..d2ddd5f 100644
--- a/src/modules/table/table_calculus/Table_Calculator.h
+++ b/src/modules/table/table_calculus/Table_Calculator.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Calculator.h 1246 2011-11-25 13:42:38Z oconrad $
+ * Version $Id: Table_Calculator.h 2072 2014-03-31 08:50:43Z reklov_w $
  *********************************************************/
 /*******************************************************************************
     TableCalculator.h
@@ -17,7 +17,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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_pca.cpp b/src/modules/table/table_calculus/table_pca.cpp
index 77bb9bd..98c4388 100644
--- a/src/modules/table/table_calculus/table_pca.cpp
+++ b/src/modules/table/table_calculus/table_pca.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_pca.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: table_pca.cpp 1928 2014-01-10 12:10:05Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,7 +9,7 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                  Geostatistics_Grid                   //
+//                    table_calculus                     //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
diff --git a/src/modules/table/table_calculus/table_pca.h b/src/modules/table/table_calculus/table_pca.h
index 7011b10..131492a 100644
--- a/src/modules/table/table_calculus/table_pca.h
+++ b/src/modules/table/table_calculus/table_pca.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_pca.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: table_pca.h 1928 2014-01-10 12:10:05Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,7 +9,7 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                  Geostatistics_Grid                   //
+//                    table_calculus                     //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
diff --git a/src/modules/table/table_tools/Makefile.in b/src/modules/table/table_tools/Makefile.in
index f452475..ecd8969 100644
--- a/src/modules/table/table_tools/Makefile.in
+++ b/src/modules/table/table_tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/table/table_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libtable_tools_la_DEPENDENCIES =  \
@@ -106,6 +129,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libtable_tools_la_SOURCES)
 DIST_SOURCES = $(libtable_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -131,6 +159,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -158,6 +187,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -170,6 +200,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -199,6 +230,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -232,7 +264,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -324,7 +355,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -332,6 +362,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -347,13 +379,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libtable_tools.la: $(libtable_tools_la_OBJECTS) $(libtable_tools_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libtable_tools.la: $(libtable_tools_la_OBJECTS) $(libtable_tools_la_DEPENDENCIES) $(EXTRA_libtable_tools_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libtable_tools_la_OBJECTS) $(libtable_tools_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -450,6 +484,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -500,10 +548,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -589,18 +642,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/terrain_analysis/Makefile.am b/src/modules/terrain_analysis/Makefile.am
new file mode 100644
index 0000000..48254bc
--- /dev/null
+++ b/src/modules/terrain_analysis/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = ta_slope_stability ta_profiles ta_preprocessor ta_morphometry ta_lighting ta_hydrology ta_compound ta_channels
diff --git a/src/modules/terrain_analysis/Makefile.in b/src/modules/terrain_analysis/Makefile.in
new file mode 100644
index 0000000..dc550fd
--- /dev/null
+++ b/src/modules/terrain_analysis/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = ta_slope_stability ta_profiles ta_preprocessor ta_morphometry ta_lighting ta_hydrology ta_compound ta_channels
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp
new file mode 100644
index 0000000..da8a5dc
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp
@@ -0,0 +1,805 @@
+/**********************************************************
+ * Version $Id: ChannelNetwork.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_channels                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  ChannelNetwork.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "ChannelNetwork.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CChannelNetwork::CChannelNetwork(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name(_TL("Channel Network"));
+
+	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"This module derives a channel network based on gridded digital elevation data.\n"
+		"Use the initiation options to determine under which conditions channels shall start.\n"
+		"\n")
+	);
+
+
+	//-----------------------------------------------------
+	// Input...
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL("A grid that contains elevation data."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SINKROUTE"	, _TL("Flow Direction"),
+		_TW(
+		"An optional grid that provides information about flow directions. \n"
+		"Values between 1 to 8 force the flow of a cell to be given to one its adjacent neighbor cells "
+		"(1->NE, 2->E, 3->SE, 4->S, 5->SW, 6->W, 7->NW, 8->N). "
+		"In case of other values the algorithm will use its own routing scheme. \n"
+		"This option is in particular useful to supply the algorithm with routes that lead the flow through closed depression. "),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Grid(
+		NULL	, "CHNLNTWRK"	, _TL("Channel Network"),
+		_TW("If a cell is part of a channel its value equals the channel order. "
+		"Otherwise the cell is marked as no-data."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHNLROUTE"	, _TL("Channel Direction"),
+		_TW("If a cell is part of a channel then its value shows the flow direction of the channel "
+		"(1->NE, 2->E, 3->SE, 4->S, 5->SW, 6->W, 7->NW, 8->N). "
+		"Otherwise the cell is marked as no-data."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "SHAPES"		, _TL("Channel Network"),
+		_TL("This shapes layer will contain the resulting channel network in vector format (lines)."),
+		PARAMETER_OUTPUT		, SHAPE_TYPE_Line
+	);
+
+
+	//-----------------------------------------------------
+	// Initiation...
+
+	pNode	= Parameters.Add_Grid(
+		NULL	, "INIT_GRID"	, _TL("Initiation Grid"),
+		_TW("Dependent on the chosen 'Initiation Type' and 'Initiation Threshold' "
+		"the values of this grid control where a channel is initiated."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "INIT_METHOD"	, _TL("Initiation Type"),
+		_TL("Options:\n - Less than\n - Equals\n - Greater than\nControls under which condition a channel is initiated."),
+
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Less than"),
+			_TL("Equals"),
+			_TL("Greater than")
+		), 2
+	);
+
+	Parameters.Add_Value(
+		pNode	, "INIT_VALUE"	, _TL("Initiation Threshold"),
+		_TL("Dependent on the chosen 'Initiation Grid' and 'Initiation Type' this value controls under which condition a channel is initiated."),
+		PARAMETER_TYPE_Double	, 0.0
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid(
+		NULL	, "DIV_GRID"	, _TL("Divergence"),
+		_TL("Tracing: Convergence"),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		pNode	, "DIV_CELLS"	, _TL("Tracing: Max. Divergence"),
+		_TL("Tracing: Stop after x cells with divergent flow"),
+		PARAMETER_TYPE_Int		, 5, 1, true
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "TRACE_WEIGHT", _TL("Tracing: Weight"),
+		_TL("Tracing: Weight"),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MINLEN"		, _TL("Min. Segment Length"),
+		_TL("Minimum Segment Length (Cells)"),
+		PARAMETER_TYPE_Int		, 10
+	);
+}
+
+//---------------------------------------------------------
+CChannelNetwork::~CChannelNetwork(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CChannelNetwork::On_Execute(void)
+{
+	int		x, y, ID, Trace_Method, Init_Method;
+	sLong	n;
+	double	Init_Threshold;
+	CSG_Grid	*Trace_pRoute, *Trace_pWeight, *Init_pGrid;
+
+
+	//-----------------------------------------------------
+	pDTM				= Parameters("ELEVATION")	->asGrid();
+	pConvergence		= Parameters("DIV_GRID")	->asGrid();
+
+	pChannels			= Parameters("CHNLNTWRK")	->asGrid();
+	pChannelRoute		= Parameters("CHNLROUTE")	->asGrid();
+	pShapes				= Parameters("SHAPES")		->asShapes();
+
+	minLength			= Parameters("MINLEN")		->asInt();
+
+	maxDivCells			= Parameters("DIV_GRID")->asGrid() ? Parameters("DIV_CELLS")->asInt() : -1;
+
+
+	//-----------------------------------------------------
+	// 1. Flow Direction...
+
+	Process_Set_Text(_TL("Channel Network: Pass 1"));
+
+	pChannels->Assign();
+
+	Trace_pRoute		= Parameters("SINKROUTE")	->asGrid();
+	Trace_pWeight		= Parameters("TRACE_WEIGHT")->asGrid();
+	Trace_Method		= Trace_pWeight ? 1 : 0;
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( Trace_pRoute && (ID = Trace_pRoute->asChar(x, y)) >= 1 && ID <= 8 )
+			{
+				pChannels->Set_Value(x, y, ID);
+			}
+			else
+			{
+				switch( Trace_Method )
+				{
+				default:
+					Set_Route_Standard(x, y);
+					break;
+
+				case 1:
+					Set_Route_Weighted(x, y, Trace_pWeight, 0.0);
+					break;
+				}
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+	// 2. Initiation...
+
+	Process_Set_Text(_TL("Channel Network: Pass 2"));
+
+	pStart				= SG_Create_Grid(pDTM, SG_DATATYPE_Char);
+	Init_pGrid			= Parameters("INIT_GRID")	->asGrid();
+	Init_Method			= Parameters("INIT_METHOD")	->asInt();
+	Init_Threshold		= Parameters("INIT_VALUE")	->asDouble();
+
+	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		switch( Init_Method )
+		{
+		case 0:
+			if( Init_pGrid->asDouble(n) <= Init_Threshold )
+				pStart->Set_Value(n, 1);
+			break;
+
+		case 1:
+			if( Init_pGrid->asDouble(n) == Init_Threshold )
+				pStart->Set_Value(n, 1);
+			break;
+
+		case 2:
+			if( Init_pGrid->asDouble(n) >= Init_Threshold )
+				pStart->Set_Value(n, 1);
+			break;
+		}
+	}
+
+
+	//-----------------------------------------------------
+	// 3. Trace Channel Routes...
+
+	Process_Set_Text(_TL("Channel Network: Pass 3"));
+
+	pChannelRoute->Assign();
+
+	Direction			= NULL;
+	Direction_Buffer	= 0;
+
+	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( pDTM->Get_Sorted(n,x,y) )
+		{
+			Set_Channel_Route(x,y);
+		}
+	}
+
+	if( Direction )
+	{
+		SG_Free( Direction );
+	}
+
+	pChannels->Assign();
+
+	delete(pStart);
+
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Channel Network: Pass 4"));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			Set_Channel_Order(x,y);
+		}
+	}
+
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Channel Network: Pass 5"));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			Set_Channel_Mouth(x,y);
+		}
+	}
+
+
+	//-----------------------------------------------------
+	if( pShapes )
+	{
+		Process_Set_Text(_TL("Channel Network: Pass 6"));
+
+		pShapes->Create(SHAPE_TYPE_Line, _TL("Channel Network"));
+
+		pShapes->Add_Field("SegmentID"	,SG_DATATYPE_Int);
+		pShapes->Add_Field("Order"		,SG_DATATYPE_Int);
+		pShapes->Add_Field("Length"		,SG_DATATYPE_Double);
+
+		Lock_Create();
+
+		for(y=0, ID=1; y<Get_NY() && Set_Progress(y); y++)
+		{
+			for(x=0; x<Get_NX(); x++)
+			{
+				Set_Vector(x, y, ID++);
+			}
+		}
+
+		Lock_Destroy();
+	}
+
+
+	//-----------------------------------------------------
+	for(n=0; n<Get_NCells(); n++)
+	{
+		if( pChannels->asInt(n) == 0 )
+		{
+			pChannels->Set_NoData(n);
+			pChannelRoute->Set_NoData(n);
+		}
+	}
+
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork::Set_Route_Standard(int x, int y)
+{
+	int		i, ix, iy, iMin;
+
+	double	z, dz, dzMin;
+
+	z		= pDTM->asDouble(x,y);
+	iMin	= 0;
+
+	for(i=1; i<=8; i++)
+	{
+		ix		= Get_xTo(i,x);
+		iy		= Get_yTo(i,y);
+
+		if( !pDTM->is_InGrid(ix,iy) )
+		{
+			iMin	= i;
+			break;
+		}
+		else
+		{
+			dz		= (z - pDTM->asDouble(ix,iy)) / Get_Length(i);
+
+			if( iMin <= 0 || dzMin < dz )
+			{
+				iMin	= i;
+				dzMin	= dz;
+			}
+		}
+	}
+
+	pChannels->Set_Value(x,y, iMin );
+}
+
+//---------------------------------------------------------
+void CChannelNetwork::Set_Route_Weighted(int x, int y, CSG_Grid *pWeight, double Weight_Threshold)
+{
+	bool	bMin;
+
+	int		i, ix, iy, iMin;
+
+	double	z, dz, dzMin, w, wMin;
+
+	z		= pDTM->asDouble(x,y);
+	iMin	= 0;
+
+	for(i=1; i<=8; i++)
+	{
+		ix		= Get_xTo(i,x);
+		iy		= Get_yTo(i,y);
+
+		if( !pDTM->is_InGrid(ix, iy) )
+		{
+			iMin	= i;
+			break;
+		}
+		else
+		{
+			dz		= (z - pDTM->asDouble(ix,iy)) / Get_Length(i);
+
+			if( dz > 0 )
+			{
+				bMin	= false;
+				w		= pWeight->asDouble(ix,iy);
+
+				if(	iMin <= 0 )
+				{
+					bMin	= true;
+				}
+				else if( Weight_Threshold > 0 )
+				{
+					if( w > Weight_Threshold && wMin > Weight_Threshold )
+					{
+						if( dzMin < dz )
+						{
+							bMin	= true;
+						}
+					}
+					else if( wMin < w )
+					{
+						bMin	= true;
+					}
+				}
+				else if( wMin < w )
+				{
+					bMin	= true;
+				}
+
+				if( bMin )
+				{
+					iMin	= i;
+					wMin	= w;
+					dzMin	= dz;
+				}
+			}
+		}
+	}
+
+	pChannels->Set_Value(x,y, iMin );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork::Set_Channel_Route(int x, int y)
+{
+	const int	BUFFER_GROWSIZE	= 256;
+
+	int		xStart, yStart, i, ix, iy, goDir, m, n, nDiv;
+
+	double	z, dz, dzMin, Length;
+
+	//-----------------------------------------------------
+	if( pStart->asChar(x,y) && !pChannelRoute->asChar(x,y) )
+	{
+		Lock_Create();
+
+		n		= 0;
+		nDiv	= 0;
+		Length	= 0;
+		xStart	= x;
+		yStart	= y;
+
+		do
+		{
+			//---------------------------------------------
+			// 1. Divergence ?!...
+
+			if( pConvergence )
+			{
+				if( pConvergence->asDouble(x,y) > -1.0 )
+				{
+					nDiv++;
+				}
+				else
+				{
+					nDiv	= 0;
+				}
+			}
+
+			if( pConvergence && nDiv > maxDivCells )
+			{
+				goDir	= -1;
+			}
+			else
+			{
+				//-----------------------------------------
+				// 2. Is there any channel around ?!...
+
+				goDir	= 0;
+				z		= pDTM->asDouble(x,y);
+
+				for(i=1; i<=8; i++)
+				{
+					ix		= Get_xTo(i,x);
+					iy		= Get_yTo(i,y);
+
+					if( pDTM->is_InGrid(ix,iy) && !is_Locked(ix,iy) && pChannelRoute->asChar(ix,iy) )
+					{
+						dz		= (z - pDTM->asDouble(ix,iy)) / Get_Length(i);
+
+						if( goDir <= 0 || dzMin < dz )
+						{
+							goDir	= i;
+							dzMin	= dz;
+						}
+					}
+				}
+
+				if( goDir <= 0 )	// ...if not then go as usual...
+				{
+					goDir	= pChannels->asInt(x,y);
+				}
+
+
+				//-----------------------------------------
+				// 3. Go to Drainage Direction !...
+
+				if(	goDir > 0 )
+				{
+					Lock_Set(x,y);
+
+					x		= Get_xTo(goDir,x);
+					y		= Get_yTo(goDir,y);
+
+					Length	+= Get_UnitLength(goDir);
+
+					if( n >= Direction_Buffer )
+					{
+						Direction_Buffer	+= BUFFER_GROWSIZE;
+						Direction			= (int *)SG_Realloc(Direction, Direction_Buffer * sizeof(int));
+					}
+
+					Direction[n++]	= goDir;
+				}
+			}
+		}
+		while( goDir > 0 && pDTM->is_InGrid(x,y) && !is_Locked(x,y) && !pChannelRoute->asChar(x,y) );
+
+
+		//-------------------------------------------------
+		if( Length >= minLength )
+		{
+			x	= xStart;
+			y	= yStart;
+
+			if( goDir < 0 )
+			{
+				n	-= nDiv;
+			}
+
+			for(m=0; m<n; m++)
+			{
+				goDir	= Direction[m];
+
+				pChannelRoute->Set_Value(x,y,goDir);
+
+				for(i=0; i<8; i++)	// Don't start new channels beside existing ones...
+				{
+					ix		= Get_xTo(i,x);
+					iy		= Get_yTo(i,y);
+
+					if( pDTM->is_InGrid(ix,iy) )
+					{
+						pStart->Set_Value(ix,iy,0);
+					}
+				}
+
+				x	= Get_xTo(goDir,x);
+				y	= Get_yTo(goDir,y);
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork::Set_Channel_Order(int x, int y)
+{
+	int		i, ix, iy, j, n;
+
+	//-----------------------------------------------------
+	if( pChannelRoute->asChar(x,y) > 0 )
+	{
+		for(i=n=0, j=4; i<8; i++, j=(j+1)%8)
+		{
+			ix	= Get_xTo(i,x);
+			iy	= Get_yTo(i,y);
+
+			if( pDTM->is_InGrid(ix,iy) && pChannelRoute->asChar(ix,iy) && j == pChannelRoute->asChar(ix,iy) % 8 )
+			{
+				n++;
+			}
+		}
+
+		//-----------------------------------------------------
+		if( n == 0 )
+		{
+			Lock_Create();
+
+			do
+			{
+				Lock_Set(x,y);
+
+				pChannels->Add_Value(x,y, 1 );
+
+				i	= pChannelRoute->asChar(x,y);
+
+				if( i > 0 )
+				{
+					x	= Get_xTo(i,x);
+					y	= Get_yTo(i,y);
+				}
+			}
+			while( pDTM->is_InGrid(x,y) && i > 0 && !is_Locked(x,y) );
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CChannelNetwork::Set_Channel_Mouth(int x, int y)
+{
+	int		Order, goDir, ix, iy;
+
+	Order	= pChannels->asInt(x,y);
+
+	if( Order > 0 )
+	{
+		goDir	= pChannelRoute->asChar(x,y);
+
+		if( goDir > 0 )
+		{
+			ix	= Get_xTo(goDir,x);
+			iy	= Get_yTo(goDir,y);
+
+			if( !pDTM->is_InGrid(ix,iy) || (pChannels->asInt(ix,iy) > 0 && Order != pChannels->asInt(ix,iy)) )
+			{
+				pChannels->Set_Value(x,y, -1 );
+			}
+		}
+		else
+		{
+			pChannels->Set_Value(x,y, -1 );
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork::Set_Vector(int x, int y, int ID)
+{
+	bool	bContinue;
+
+	int		i, ix, iy, j, Order;
+
+	double	xMin, yMin, Length;
+
+	CSG_Shape	*pShape;
+
+	//-----------------------------------------------------
+	if( (Order = pChannels->asInt(x,y)) > 0 )
+	{
+		bContinue	= true;
+
+		for(i=0, j=4; i<8 && bContinue; i++, j=(j+1)%8)
+		{
+			ix	= Get_xTo(i,x);
+			iy	= Get_yTo(i,y);
+
+			if(	pDTM->is_InGrid(ix,iy)
+			&&	pChannels->asInt(ix,iy) == Order
+			&&	pChannelRoute->asChar(ix,iy) && j == pChannelRoute->asChar(ix,iy) % 8 )
+			{
+				bContinue	= false;
+			}
+		}
+
+		//-------------------------------------------------
+		if( bContinue )	// Startpunkt gefunden...
+		{
+			xMin	= pDTM->Get_XMin(),
+			yMin	= pDTM->Get_YMin();
+			ID		= 1;
+
+			pShape	= pShapes->Add_Shape();
+
+			do
+			{
+				bContinue	= false;
+				Length		= 0;
+
+				Lock_Set(x,y);
+
+				pShape->Add_Point(xMin + x * Get_Cellsize(), yMin + y * Get_Cellsize());
+
+				i	= pChannelRoute->asChar(x,y);
+
+				if( i > 0 )
+				{
+					ix		= Get_xTo(i,x);
+					iy		= Get_yTo(i,y);
+
+					Length	+= Get_Length(i);
+
+					if( pDTM->is_InGrid(ix,iy) )
+					{
+						if(	!is_Locked(ix,iy)
+						&&	(	pChannels->asInt(ix,iy) == Order
+							||	pChannels->asInt(ix,iy) < 0) )
+						{
+							x			= ix;
+							y			= iy;
+							bContinue	= true;
+						}
+						else
+						{
+							pShape->Add_Point(xMin + ix * Get_Cellsize(), yMin + iy * Get_Cellsize());
+						}
+					}
+				}
+			}
+			while( bContinue );
+
+			pShape->Set_Value(0, ID );
+			pShape->Set_Value(1, Order );
+			pShape->Set_Value(2, Length );
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.h b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.h
rename to src/modules/terrain_analysis/ta_channels/ChannelNetwork.h
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
new file mode 100644
index 0000000..34874d5
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
@@ -0,0 +1,474 @@
+/**********************************************************
+ * Version $Id: ChannelNetwork_Altitude.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_channels                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              ChannelNetwork_Altitude.cpp              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "ChannelNetwork_Altitude.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CChannelNetwork_Altitude::CChannelNetwork_Altitude(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Vertical Distance to Channel Network"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2002"));
+
+	Set_Description	(_TW(
+		"This module calculates the vertical distance to a channel network base level. "
+		"The algorithm consists of two major steps:\n"
+		" 1. Interpolation of a channel network base level elevation\n"
+		" 2. Subtraction of this base level from the original elevations\n"
+	));
+
+
+	//-----------------------------------------------------
+	// Input...
+
+	Parameters.Add_Grid(
+		NULL, "ELEVATION"	, _TL("Elevation"),
+		_TL("A grid that contains elevation data."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "CHANNELS"	, _TL("Channel Network"),
+		_TW("A grid providing information about the channel network. It is assumed that no-data cells are not part "
+		"of the channel network. Vice versa all others cells are recognised as channel network members."),
+		PARAMETER_INPUT
+	);
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Grid(
+		NULL, "DISTANCE"	, _TL("Vertical Distance to Channel Network"),
+		_TL("The resulting grid gives the altitude above the channel network in the same units as the elevation data."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "BASELEVEL"	, _TL("Channel Network Base Level"),
+		_TL("This optional grid output contains the interpolated channel network base level elevations."),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL, "THRESHOLD"	, _TL("Tension Threshold [Percentage of Cell Size]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "NOUNDERGROUND", _TL("Keep Base Level below Surface"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CChannelNetwork_Altitude::On_Execute(void)
+{
+	int			nCells, nCells_Start, iStep, nSteps;
+	double		Threshold;
+
+	//-----------------------------------------------------
+	m_pDTM				= Parameters("ELEVATION")		->asGrid();
+	m_pChannels			= Parameters("CHANNELS")		->asGrid();
+	m_pDistance			= Parameters("DISTANCE")		->asGrid();
+	m_bNoUnderground	= Parameters("NOUNDERGROUND")	->asBool();
+	Threshold			= Parameters("THRESHOLD")		->asDouble() * Get_Cellsize();
+
+	DataObject_Set_Colors(m_pDistance, 10, SG_COLORS_YELLOW_BLUE, true);
+
+	//-----------------------------------------------------
+	nCells			= Get_NX() > Get_NY() ? Get_NX() : Get_NY();
+	for(nSteps=0; pow(2.0, nSteps + 1) < nCells; nSteps++);
+	nCells_Start	= (int)pow(2.0, nSteps);
+
+	//-----------------------------------------------------
+	m_pDistance->Assign_NoData();
+
+	m_Mask.Create(*Get_System(), SG_DATATYPE_Byte);
+	m_Dist.Create(*Get_System());
+	m_Dist.Set_NoData_Value_Range(m_pDTM->Get_NoData_Value(), m_pDTM->Get_NoData_hiValue());
+
+	for(nCells=nCells_Start, iStep=1; nCells>0 && Process_Get_Okay(); nCells/=2, iStep++)
+	{
+		Process_Set_Text(CSG_String::Format(SG_T("%d [%d]"), iStep, nSteps + 1));
+
+		Set_Surface(nCells);
+
+		while( Threshold < Get_Change(nCells) && Process_Get_Okay() );
+	}
+
+	m_Mask.Destroy();
+	m_Dist.Destroy();
+
+	//-----------------------------------------------------
+	CSG_Grid	*pBase	= Parameters("BASELEVEL")->asGrid();
+
+	for(sLong n=0; n<Get_NCells(); n++)
+	{
+		if( m_pDistance->is_NoData(n) || m_pDTM->is_NoData(n) )
+		{
+			m_pDistance->Set_NoData(n);
+
+			if( pBase )	{	pBase->Set_NoData(n);	}
+		}
+		else
+		{
+			double	z	= m_pDistance->asDouble(n);
+
+			m_pDistance->Set_Value(n, m_pDTM->asDouble(n) - z);
+
+			if( pBase )	{	pBase->Set_Value(n, z);	}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork_Altitude::Set_Surface(int nCells)
+{
+	m_Dist.Assign_NoData();
+	m_Mask.Assign(0.0);
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY(); y+=nCells)
+	{
+		int	ny	= y + nCells < Get_NY() ? y + nCells : Get_NY();
+
+		for(int x=0; x<Get_NX(); x+=nCells)
+		{
+			int		nx	= x + nCells < Get_NX() ? x + nCells : Get_NX();
+
+			int		i, ix, iy, nz;
+			double	z;
+
+			for(iy=y, nz=0, z=0.0; iy<ny; iy++)
+			{
+				for(ix=x; ix<nx; ix++)
+				{
+					if( m_pChannels->is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) )
+					{
+						z	+= m_pDTM->asDouble(ix, iy);
+						nz	++;
+					}
+				}
+			}
+
+			//---------------------------------------------
+			if( nz > 0 )
+			{
+				m_Mask.Set_Value(x, y, true);
+				m_Dist.Set_Value(x, y, z / nz);
+			}
+			else
+			{
+				m_Mask.Set_Value(x, y, false);
+
+				if( m_pDistance->is_NoData(x, y) )
+				{
+					for(i=0; i<8; i++)
+					{
+						ix	= x + nCells * Get_xTo(i);
+						iy	= y + nCells * Get_yTo(i);
+
+						if( m_pDistance->is_InGrid(ix, iy) )
+						{
+							z	+= m_pDistance->asDouble(ix, iy);
+							nz	++;
+						}
+					}
+
+					m_Dist.Set_Value(x, y, nz > 0 ? z / nz : m_pDTM->asDouble(x, y));
+				}
+				else
+				{
+					m_Dist.Set_Value(x, y, m_pDistance->asDouble(x, y));
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_pDistance->Assign(&m_Dist);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CChannelNetwork_Altitude::Get_Change(int nCells)
+{
+	int		x, y;
+	double	d, dMax;
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY(); y+=nCells)
+	{
+		for(x=0; x<Get_NX(); x+=nCells)
+		{
+			if( !m_Mask.asByte(x, y) )
+			{
+				m_Dist.Set_Value(x, y, Get_Change(nCells, x, y));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(y=0, dMax=0.0; y<Get_NY(); y+=nCells)
+	{
+		for(x=0; x<Get_NX(); x+=nCells)
+		{
+			if( !m_Mask.asByte(x, y) )
+			{
+				if( dMax < (d = fabs(m_Dist.asDouble(x, y) - m_pDistance->asDouble(x, y))) )
+				{
+					dMax	= d;
+				}
+
+				m_pDistance->Set_Value(x, y, m_Dist.asDouble(x, y));
+			}
+		}
+	}
+
+	return( dMax );
+}
+
+
+//---------------------------------------------------------
+double CChannelNetwork_Altitude::Get_Change(int nCells, int x, int y)
+{
+	int		i, ix, iy;
+	double	n, d, dz;
+
+	for(i=0, d=0.0, n=0.0; i<8; i++)
+	{
+		ix	= x + nCells * Get_xTo(i);
+		iy	= y + nCells * Get_yTo(i);
+
+		if( m_pDistance->is_InGrid(ix, iy) )
+		{
+			dz	= 1.0 / Get_UnitLength(i);
+			d	+= dz * m_pDistance->asDouble(ix, iy);
+			n	+= dz;
+		}
+	}
+
+	if( n > 0.0 )
+	{
+		d	/= n;
+
+		return( m_bNoUnderground && !m_pDTM->is_NoData(x, y) && d > m_pDTM->asDouble(x, y) ? m_pDTM->asDouble(x, y) : d );
+	}
+
+	return( m_pDistance->asDouble(x, y) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CValley_Depth::CValley_Depth(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Valley Depth"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2012"));
+
+	Set_Description	(_TW(
+		"Valley depth is calculated here  vertical distance to a channel network base level. "
+		"The algorithm consists of two major steps:\n"
+		" 1. Interpolation of a channel network base level elevation\n"
+		" 2. Subtraction of this base level from the original elevations\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"		, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "VALLEY_DEPTH"	, _TL("Valley Depth"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "RIDGE_LEVEL"		, _TL("Ridge Level"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD"		, _TL("Tension Threshold [Percentage of Cell Size]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NOUNDERGROUND"	, _TL("Keep Ridge Level above Surface"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "ORDER"			, _TL("Ridge Detection Threshold"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 4, 1, true, 7, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
+	bool	bResult;\
+	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
+	if( !bResult ) return( false );\
+}
+
+#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
+
+//---------------------------------------------------------
+bool CValley_Depth::On_Execute(void)
+{
+	CSG_Grid	Inverse(*Get_System(), SG_DATATYPE_Float);
+	CSG_Grid	Ridges (*Get_System(), SG_DATATYPE_Int);
+
+	//-----------------------------------------------------
+	RUN_MODULE("grid_tools"					, 19,	// grid orientation
+			SET_PARAMETER("INPUT"			, Parameters("ELEVATION"))
+		&&	SET_PARAMETER("RESULT"			, &Inverse)
+		&&	SET_PARAMETER("METHOD"			, 3)	// invert
+	)
+
+	RUN_MODULE("ta_channels"				, 6,	// strahler order
+			SET_PARAMETER("DEM"				, &Inverse)
+		&&	SET_PARAMETER("STRAHLER"		, &Ridges)
+	)
+
+	Ridges.Set_NoData_Value_Range(0, Parameters("ORDER")->asInt());
+
+	RUN_MODULE("ta_channels"				, 3,	// vertical channel network distance
+			SET_PARAMETER("ELEVATION"		, &Inverse)
+		&&	SET_PARAMETER("CHANNELS"		, &Ridges)
+		&&	SET_PARAMETER("DISTANCE"		, Parameters("VALLEY_DEPTH"))
+		&&	SET_PARAMETER("BASELEVEL"		, Parameters("RIDGE_LEVEL"))
+		&&	SET_PARAMETER("THRESHOLD"		, Parameters("THRESHOLD"))
+		&&	SET_PARAMETER("NOUNDERGROUND"	, Parameters("NOUNDERGROUND"))
+	)
+
+	//-----------------------------------------------------
+	if( Parameters("RIDGE_LEVEL")->asGrid() )
+	{
+		Parameters("RIDGE_LEVEL")->asGrid()->Invert();
+	}
+
+	DataObject_Set_Colors(Parameters("VALLEY_DEPTH")->asGrid(), 10, SG_COLORS_YELLOW_BLUE, false);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h
rename to src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
new file mode 100644
index 0000000..912edb7
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
@@ -0,0 +1,577 @@
+/**********************************************************
+ * Version $Id: ChannelNetwork_Distance.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_channels                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              ChannelNetwork_Distance.cpp              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "ChannelNetwork_Distance.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CChannelNetwork_Distance::CChannelNetwork_Distance(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Overland Flow Distance to Channel Network"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2001-14"));
+
+	Set_Description	(_TW(
+		"This module calculates overland flow distances to a channel network "
+		"based on gridded digital elevation data and channel network information. "
+		"The flow algorithm may be either Deterministic 8 (O'Callaghan & Mark 1984) "
+		"or Multiple Flow Direction (Freeman 1991). Sediment Delivery Rates (SDR) "
+		"according to Ali & De Boer (2010) can be computed optionally. "
+		"\n\nReferences:\n"
+		"- Ali, K. F., De Boer, D. H. (2010): Spatially distributed erosion and sediment yield modeling in the upper Indus River basin."
+		" Water Resources Research, 46(8), W08504. doi:10.1029/2009WR008762\n"
+		"- Freeman, G.T., 1991: Calculating catchment area with divergent flow based on a regular grid."
+		" Computers and Geosciences, 17:413-22.\n"
+		"- O'Callaghan, J.F., Mark, D.M., 1984: The extraction of drainage networks from digital elevation data."
+		" Computer Vision, Graphics and Image Processing, 28:323-344.\n"
+		"- Nobre, A.D., Cuartas, L.A., Hodnett, M., Renno, C.D., Rodrigues, G., Silveira, A., Waterloo, M., Saleska S. (2011): Height Above the Nearest Drainage - a hydrologically relevant new terrain model."
+		" Journal of Hydrology, Vol. 404, Issues 1-2, pp. 13-29, ISSN 0022-1694, 10.1016/j.jhydrol.2011.03.051."
+		" <a target=\"_blank\" href=\"http://www.sciencedirect.com/science/article/pii/S0022169411002599\">online</a>\n"
+	));
+
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL("A grid that contains elevation data."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHANNELS"	, _TL("Channel Network"),
+		_TW("A grid providing information about the channel network. It is assumed that no-data cells are not part "
+		"of the channel network. Vice versa all others cells are recognised as channel network members."),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ROUTE"		, _TL("Preferred Routing"),
+		_TL("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."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DISTANCE"	, _TL("Overland Flow Distance"),
+		_TW("The overland flow distance in map units. "
+		"It is assumed that the (vertical) elevation data use the same units as the (horizontal) grid coordinates."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DISTVERT"	, _TL("Vertical Overland Flow Distance"),
+		_TL("This is the vertical component of the overland flow"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DISTHORZ"	, _TL("Horizontal Overland Flow Distance"),
+		_TL("This is the horizontal component of the overland flow"),
+		PARAMETER_OUTPUT
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "TIME"		, _TL("Flow Travel Time"),
+		_TL("flow travel time to channel expressed in hours based on Manning's Equation"),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SDR"			, _TL("Sediment Yield Delivery Ratio"),
+		_TL("This is the horizontal component of the overland flow"),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "FIELDS"		, _TL("Fields"),
+		_TL("If set, output is given about the number of fields a flow path visits downhill. For D8 only."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "PASSES"		, _TL("Fields Visited"),
+		_TL("Number of fields a flow path visits downhill starting at a cell. For D8 only."),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Flow Algorithm"),
+		_TL("Choose a flow routing algorithm that shall be used for the overland flow distance calculation:\n- D8\n- MFD"),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("D8"),
+			_TL("MFD")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "FLOW_B"		, _TL("Beta"),
+		_TL("catchment specific parameter for sediment delivery ratio calculation"),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Grid_or_Const(
+		NULL	, "FLOW_K"		, _TL("Manning-Strickler Coefficient"),
+		_TL("Manning-Strickler coefficient for flow travel time estimation (reciprocal of Manning's Roughness Coefficient)"),
+		20.0, 0.0, true
+	);
+
+	Parameters.Add_Grid_or_Const(
+		NULL	, "FLOW_R"		, _TL("Flow Depth"),
+		_TL("flow depth [m] for flow travel time estimation"),
+		0.05, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CChannelNetwork_Distance::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "METHOD") )
+	{
+		pParameters->Get_Parameter("FIELDS")->Set_Enabled(pParameter->asInt() == 0);
+		pParameters->Get_Parameter("PASSES")->Set_Enabled(pParameter->asInt() == 0 && pParameters->Get_Parameter("FIELDS")->asGrid() != NULL);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FIELDS") )
+	{
+		pParameters->Get_Parameter("PASSES")->Set_Enabled(pParameter->is_Enabled() && pParameter->asGrid() != NULL);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "TIME") || !SG_STR_CMP(pParameter->Get_Identifier(), "SDR") )
+	{
+		bool	bEnable	= pParameters->Get_Parameter("TIME")->asGrid() != NULL
+					||	  pParameters->Get_Parameter("SDR" )->asGrid() != NULL;
+
+		pParameters->Get_Parameter("FLOW_B")->Set_Enabled(bEnable);
+		pParameters->Get_Parameter("FLOW_K")->Set_Enabled(bEnable);
+		pParameters->Get_Parameter("FLOW_R")->Set_Enabled(bEnable);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CChannelNetwork_Distance::On_Execute(void)
+{
+	CSG_Grid	*pChannels;
+
+	//-----------------------------------------------------
+	m_pDEM		= Parameters("ELEVATION")->asGrid();
+	m_pRoute	= Parameters("ROUTE"    )->asGrid();
+	pChannels	= Parameters("CHANNELS" )->asGrid();
+
+	m_pDistance	= Parameters("DISTANCE" )->asGrid();
+	m_pDistVert	= Parameters("DISTVERT" )->asGrid();
+	m_pDistHorz	= Parameters("DISTHORZ" )->asGrid();
+
+	m_pTime		= Parameters("TIME"     )->asGrid();
+	m_pSDR		= Parameters("SDR"      )->asGrid();
+
+	m_Flow_B	= Parameters("FLOW_B"   )->asDouble();
+	m_Flow_K	= Parameters("FLOW_K"   )->asDouble();
+	m_Flow_R	= Parameters("FLOW_R"   )->asDouble();
+	m_pFlow_K	= Parameters("FLOW_K"   )->asGrid();
+	m_pFlow_R	= Parameters("FLOW_R"   )->asGrid();
+
+	int	Method	= Parameters("METHOD"   )->asInt();
+
+	//-----------------------------------------------------
+	if( m_pDistance )	m_pDistance->Assign_NoData();
+	if( m_pDistVert )	m_pDistVert->Assign_NoData();
+	if( m_pDistHorz )	m_pDistHorz->Assign_NoData();
+	if( m_pTime     )	m_pTime    ->Assign_NoData();
+	if( m_pSDR      )	m_pSDR     ->Assign_NoData();
+
+	switch( Method )
+	{
+	default:	Initialize_D8 ();	break;
+	case  1:	Initialize_MFD();	break;
+	}
+
+	m_pDEM->Set_Index(true);
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		int		x, y;
+
+		if( m_pDEM->Get_Sorted(n, x, y, false, true) && !(pChannels->is_NoData(x, y) && m_pDistance->is_NoData(x, y)) )
+		{
+			if( !pChannels->is_NoData(x, y) )
+			{
+				if( m_pDistance )	m_pDistance->Set_Value(x, y, 0.0);
+				if( m_pDistVert )	m_pDistVert->Set_Value(x, y, 0.0);
+				if( m_pDistHorz )	m_pDistHorz->Set_Value(x, y, 0.0);
+				if( m_pTime     )	m_pTime    ->Set_Value(x, y, 0.0);
+				if( m_pSDR      )	m_pSDR     ->Set_Value(x, y, 0.0);
+				if( m_pFields   )	m_pPasses  ->Set_Value(x, y, 0.0);
+			}
+
+			switch( Method )
+			{
+			default:	Execute_D8 (x, y);	break;
+			case  1:	Execute_MFD(x, y);	break;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Dir.Destroy();
+
+	for(int i=0; i<=8; i++)
+	{
+		m_Flow[i].Destroy();
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline double CChannelNetwork_Distance::Get_Travel_Time(int x, int y, int i)
+{
+	double	dz	= m_pDEM->asDouble(Get_xTo(i, x), Get_yTo(i, y)) - m_pDEM->asDouble(x, y);
+	double	dx	= Get_Length(i);
+	double	k	= m_pFlow_K && !m_pFlow_K->is_NoData(x, y) ? m_pFlow_K->asDouble(x, y) : m_Flow_K;
+	double	R	= m_pFlow_R && !m_pFlow_R->is_NoData(x, y) ? m_pFlow_R->asDouble(x, y) : m_Flow_R;
+
+	double	v	= k * pow(R, 2.0 / 3.0) * sqrt(dz / dx);	// [m / s], simplified Manning equation
+
+	return( dx / (v * 3600.0) );	// return travel time in hours
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork_Distance::Initialize_D8(void)
+{
+	m_Dir.Create(*Get_System(), SG_DATATYPE_Char);
+
+	if( (m_pFields = Parameters("FIELDS")->asGrid()) != NULL )
+	{
+		m_pPasses	= Parameters("PASSES")->asGrid();
+		m_pPasses	->Set_NoData_Value(-1.0);
+		m_pPasses	->Assign_NoData();
+	}
+
+	#pragma omp parallel for
+	for(int y=0; y<Get_NY(); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_pDEM->is_NoData(x, y) )
+			{
+				Initialize_D8(x, y);
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CChannelNetwork_Distance::Initialize_D8(int x, int y)
+{
+	int		i, iMax, iRoute;
+	double	z, dz, dzMax, dzRoute;
+
+	for(i=0, iMax=-1, dzMax=0.0, iRoute=-1, dzRoute=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
+	{
+		int	ix	= Get_xTo(i, x);
+		int	iy	= Get_yTo(i, y);
+
+		if( is_InGrid(ix, iy) && (dz = (z - m_pDEM->asDouble(ix, iy)) / Get_Length(i)) > 0.0 )
+		{
+			if( dz > dzMax )
+			{
+				iMax	= i;
+				dzMax	= dz;
+			}
+
+			if( m_pRoute && !m_pRoute->is_NoData(ix, iy) && dz > dzRoute )
+			{
+				iRoute	= i;
+				dzRoute	= dz;
+			}
+		}
+	}
+
+	m_Dir.Set_Value(x, y, iRoute >= 0 ? iRoute : iMax);
+}
+
+//---------------------------------------------------------
+void CChannelNetwork_Distance::Execute_D8(int x, int y)
+{
+	int		nPasses	= m_pFields ? m_pPasses->asInt   (x, y) : 0;
+	double	Field	= m_pFields ? m_pFields->asDouble(x, y) : 0;
+
+	double	sz	= m_pDistVert->asDouble(x, y);
+	double	sx	= m_pDistHorz->asDouble(x, y);
+	double	sd	= m_pDistance->asDouble(x, y);
+
+	for(int i=0; i<8; i++)
+	{
+		int	ix	= Get_xFrom(i, x);
+		int	iy	= Get_yFrom(i, y);
+
+		if( m_pDEM->is_InGrid(ix, iy) && m_Dir.asInt(ix, iy) == i )
+		{
+			double	dz	= m_pDEM->asDouble(ix, iy) - m_pDEM->asDouble(x, y);
+			double	dx	= Get_Length(i);
+
+			if( m_pDistVert )	m_pDistVert->Set_Value(ix, iy, sz + dz);
+			if( m_pDistHorz )	m_pDistHorz->Set_Value(ix, iy, sx + dx);
+			if( m_pDistance )	m_pDistance->Set_Value(ix, iy, sd + sqrt(dz*dz + dx*dx));
+			if( m_pTime     )	m_pTime    ->Set_Value(ix, iy, m_pTime->asDouble(x, y) + Get_Travel_Time(x, y, i));
+			if( m_pSDR      )	m_pSDR     ->Set_Value(ix, iy, m_pSDR ->asDouble(x, y) + Get_Travel_Time(x, y, i));
+			if( m_pFields   )	m_pPasses  ->Set_Value(ix, iy, Field != m_pFields->asDouble(ix, iy) ? nPasses + 1 : nPasses);
+		}
+	}
+
+	if( m_pSDR )
+	{
+		m_pSDR->Set_Value(x, y, exp(-m_Flow_B * m_pSDR->asDouble(x, y)));
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CChannelNetwork_Distance::Initialize_MFD(void)
+{
+	m_pFields	= NULL;
+	m_pPasses	= NULL;
+
+	for(int i=0; i<=8; i++)
+	{
+		m_Flow[i].Create(*Get_System(), SG_DATATYPE_Float);
+	}
+
+	#pragma omp parallel for
+	for(int y=0; y<Get_NY(); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_pDEM->is_NoData(x, y) )
+			{
+				Initialize_MFD(x, y);
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CChannelNetwork_Distance::Initialize_MFD(int x, int y)
+{
+	const double	MFD_Convergence	= 1.1;
+
+	double	Flow[8], dz, zSum = 0.0, z = m_pDEM->asDouble(x, y);
+
+	if( m_pRoute )
+	{
+		for(int i=0, ix, iy; i<8; i++)
+		{
+			if( m_pDEM->is_InGrid(ix=Get_xTo(i, x), iy=Get_yTo(i, y)) && !m_pRoute->is_NoData(ix, iy) && (dz = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
+			{
+				zSum	+= (Flow[i]	= pow(dz / Get_Length(i), MFD_Convergence));
+			}
+			else
+			{
+				Flow[i]	= 0.0;
+			}
+		}
+	}
+
+	if( zSum == 0.0 )
+	{
+		for(int i=0, ix, iy; i<8; i++)
+		{
+			if( m_pDEM->is_InGrid(ix=Get_xTo(i, x), iy=Get_yTo(i, y)) && (dz = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
+			{
+				zSum	+= (Flow[i]	= pow(dz / Get_Length(i), MFD_Convergence));
+			}
+			else
+			{
+				Flow[i]	= 0.0;
+			}
+		}
+	}
+
+	if( zSum > 0.0 )
+	{
+		m_Flow[8].Set_Value(x, y, zSum);
+
+		for(int i=0; i<8; i++)
+		{
+			if( Flow[i] > 0.0 )
+			{
+				m_Flow[i].Set_Value(x, y, Flow[i] / zSum);
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CChannelNetwork_Distance::Execute_MFD(int x, int y)
+{
+	double	df	= m_Flow[8].asDouble(x, y);
+
+	if( df > 0.0 )
+	{
+		if( m_pDistance )	m_pDistance->Mul_Value(x, y, 1.0 / df);
+		if( m_pDistVert )	m_pDistVert->Mul_Value(x, y, 1.0 / df);
+		if( m_pDistHorz )	m_pDistHorz->Mul_Value(x, y, 1.0 / df);
+		if( m_pTime     )	m_pTime    ->Mul_Value(x, y, 1.0 / df);
+		if( m_pSDR      )	m_pSDR     ->Mul_Value(x, y, 1.0 / df);
+	}
+
+	double	sz	= m_pDistVert->asDouble(x, y);
+	double	sx	= m_pDistHorz->asDouble(x, y);
+	double	sd	= m_pDistance->asDouble(x, y);
+
+	for(int i=0; i<8; i++)
+	{
+		int	ix	= Get_xTo(i, x);
+		int	iy	= Get_yTo(i, y);
+
+		if( m_pDEM->is_InGrid(ix, iy) && (df = m_Flow[(i + 4) % 8].asDouble(ix, iy)) > 0.0 )
+		{
+			double	dz	= m_pDEM->asDouble(ix, iy) - m_pDEM->asDouble(x, y);
+			double	dx	= Get_Length(i);
+			double	dt	= m_pTime || m_pSDR ? Get_Travel_Time(x, y, i) : 1.0;
+
+			if( m_pDistance->is_NoData(ix, iy) )
+			{
+				m_Flow[8].Set_Value(ix, iy, df);
+
+				if( m_pDistVert )	m_pDistVert->Set_Value(ix, iy, df * (sz + dz));
+				if( m_pDistHorz )	m_pDistHorz->Set_Value(ix, iy, df * (sx + dx));
+				if( m_pDistance )	m_pDistance->Set_Value(ix, iy, df * (sd + sqrt(dz*dz + dx*dx)));
+				if( m_pTime     )	m_pTime    ->Set_Value(ix, iy, df * (m_pTime->asDouble(x, y) + dt));
+				if( m_pSDR      )	m_pSDR     ->Set_Value(ix, iy, df * (m_pSDR ->asDouble(x, y) + dt));
+			}
+			else
+			{
+				m_Flow[8].Add_Value(ix, iy, df);
+
+				if( m_pDistVert )	m_pDistVert->Add_Value(ix, iy, df * (sz + dz));
+				if( m_pDistHorz )	m_pDistHorz->Add_Value(ix, iy, df * (sx + dx));
+				if( m_pDistance )	m_pDistance->Add_Value(ix, iy, df * (sd + sqrt(dz*dz + dx*dx)));
+				if( m_pTime     )	m_pTime    ->Add_Value(ix, iy, df * (m_pTime->asDouble(x, y) + dt));
+				if( m_pSDR      )	m_pSDR     ->Add_Value(ix, iy, df * (m_pSDR ->asDouble(x, y) + dt));
+			}
+		}
+	}
+
+	if( m_pSDR )
+	{
+		m_pSDR->Set_Value(x, y, exp(-m_Flow_B * m_pSDR->asDouble(x, y)));
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
new file mode 100644
index 0000000..27bfdeb
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
@@ -0,0 +1,127 @@
+/**********************************************************
+ * Version $Id: ChannelNetwork_Distance.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_channels                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               ChannelNetwork_Distance.h               //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__ChannelNetwork_Distance_H
+#define HEADER_INCLUDED__ChannelNetwork_Distance_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CChannelNetwork_Distance : public CSG_Module_Grid  
+{
+public:
+	CChannelNetwork_Distance(void);
+
+
+protected:
+
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+	double					m_Flow_B, m_Flow_K, m_Flow_R;
+
+	CSG_Grid				*m_pDEM, *m_pRoute, m_Dir, m_Flow[9], *m_pFlow_K, *m_pFlow_R,
+							*m_pDistance, *m_pDistVert, *m_pDistHorz,
+							*m_pFields, *m_pPasses, *m_pTime, *m_pSDR;
+
+
+	double					Get_Travel_Time			(int x, int y, int Direction);
+
+	void					Initialize_D8			(void);
+	void					Initialize_D8			(int x, int y);
+	void					Execute_D8				(int x, int y);
+
+	void					Initialize_MFD			(void);
+	void					Initialize_MFD			(int x, int y);
+	void					Execute_MFD				(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__ChannelNetwork_Distance_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp b/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp
rename to src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h b/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h
rename to src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_channels/MLB_Interface.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.cpp
rename to src/modules/terrain_analysis/ta_channels/MLB_Interface.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.h b/src/modules/terrain_analysis/ta_channels/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_channels/MLB_Interface.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.am b/src/modules/terrain_analysis/ta_channels/Makefile.am
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.am
rename to src/modules/terrain_analysis/ta_channels/Makefile.am
diff --git a/src/modules/terrain_analysis/ta_channels/Makefile.in b/src/modules/terrain_analysis/ta_channels/Makefile.in
new file mode 100644
index 0000000..ed6c54c
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/Makefile.in
@@ -0,0 +1,652 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_channels
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_channels_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_channels_la_OBJECTS = ChannelNetwork.lo \
+	ChannelNetwork_Altitude.lo ChannelNetwork_Distance.lo \
+	D8_Flow_Analysis.lo MLB_Interface.lo Strahler.lo Watersheds.lo \
+	Watersheds_ext.lo
+libta_channels_la_OBJECTS = $(am_libta_channels_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_channels_la_SOURCES)
+DIST_SOURCES = $(libta_channels_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 911 2011-02-14 16:38:15Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libta_channels.la
+libta_channels_la_SOURCES = \
+ChannelNetwork.cpp\
+ChannelNetwork_Altitude.cpp\
+ChannelNetwork_Distance.cpp\
+D8_Flow_Analysis.cpp\
+MLB_Interface.cpp\
+Strahler.cpp\
+Watersheds.cpp\
+Watersheds_ext.cpp\
+ChannelNetwork.h\
+ChannelNetwork_Altitude.h\
+ChannelNetwork_Distance.h\
+D8_Flow_Analysis.h\
+MLB_Interface.h\
+Strahler.h\
+Watersheds.h\
+Watersheds_ext.h
+
+libta_channels_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_channels/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_channels/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_channels.la: $(libta_channels_la_OBJECTS) $(libta_channels_la_DEPENDENCIES) $(EXTRA_libta_channels_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_channels_la_OBJECTS) $(libta_channels_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChannelNetwork.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChannelNetwork_Altitude.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChannelNetwork_Distance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/D8_Flow_Analysis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Strahler.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Watersheds.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Watersheds_ext.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_channels/Strahler.cpp b/src/modules/terrain_analysis/ta_channels/Strahler.cpp
new file mode 100644
index 0000000..973dd7e
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/Strahler.cpp
@@ -0,0 +1,115 @@
+/**********************************************************
+ * Version $Id: Strahler.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Strahler.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+//---------------------------------------------------------
+#include "Strahler.h"
+
+//---------------------------------------------------------
+CStrahler::CStrahler(void){
+
+	Set_Name		(_TL("Strahler Order"));
+	Set_Author		(_TL("Copyrights (c) 2004 by Victor Olaya"));
+	Set_Description	(_TW(
+		"(c) 2004 by Victor Olaya. Strahler Order Calculation"
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"), 
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "STRAHLER"	, _TL("Strahler Order"), 
+		_TL(""), 
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
+	);
+}
+
+//---------------------------------------------------------
+CStrahler::~CStrahler(void)
+{}
+
+//---------------------------------------------------------
+int CStrahler::getStrahlerOrder(int x, int y)
+{
+	int		Order	= m_pStrahler->asInt(x, y);
+
+	if( Order == 0 )
+	{
+		int		i, ix, iy, n;
+
+		for(i=0, n=0, Order=1; i<8; i++)
+		{
+			if( Get_System()->Get_Neighbor_Pos(i + 4, x, y, ix, iy) && m_pDEM->Get_Gradient_NeighborDir(ix, iy) == i )
+			{
+				int		iOrder	= getStrahlerOrder(ix, iy);
+
+				if( Order < iOrder )
+				{
+					Order	= iOrder;
+					n		= 1;
+				}
+				else if( Order == iOrder )
+				{
+					n++;
+				}
+			}
+		}
+
+		if( n > 1 )
+		{
+			Order++;
+		}
+
+		m_pStrahler->Set_Value(x, y, Order);
+	}
+
+	return( Order );
+}
+
+//---------------------------------------------------------
+bool CStrahler::On_Execute(void)
+{
+	m_pDEM		= Parameters("DEM")			->asGrid();
+	m_pStrahler	= Parameters("STRAHLER")	->asGrid();
+
+	m_pStrahler	->Set_NoData_Value(0.0);
+	m_pStrahler	->Assign(0.0);
+
+	DataObject_Set_Colors(m_pStrahler, 10, SG_COLORS_WHITE_BLUE);
+
+    for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_pDEM->is_NoData(x, y) )
+			{
+				getStrahlerOrder(x, y);
+			}
+        }
+    }
+
+	return( true );
+}
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_channels/Strahler.h b/src/modules/terrain_analysis/ta_channels/Strahler.h
new file mode 100644
index 0000000..e05a7ee
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/Strahler.h
@@ -0,0 +1,47 @@
+/**********************************************************
+ * Version $Id: Strahler.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Strahler.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__RGB_Composite_H
+#define HEADER_INCLUDED__RGB_Composite_H
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+//---------------------------------------------------------
+class CStrahler : public CSG_Module_Grid {
+
+private:
+	CSG_Grid *m_pDEM;
+	CSG_Grid *m_pStrahler;
+	int getStrahlerOrder(int, int);
+
+public:
+	CStrahler(void);
+	virtual ~CStrahler(void);
+
+protected:
+	virtual bool		On_Execute(void);
+
+};
+
+#endif // #ifndef HEADER_INCLUDED__Strahler_H
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds.cpp b/src/modules/terrain_analysis/ta_channels/Watersheds.cpp
new file mode 100644
index 0000000..c019153
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds.cpp
@@ -0,0 +1,231 @@
+/**********************************************************
+ * Version $Id: Watersheds.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_channels                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Watersheds.cpp                     //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Watersheds.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWatersheds::CWatersheds(void)
+{
+	Set_Name(_TL("Watershed Basins"));
+
+	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
+
+	Set_Description(_TL(""));
+
+	Parameters.Add_Grid(
+		NULL, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "CHANNELS"	, _TL("Channel Network"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "SINKROUTE"	, _TL("Sink Route"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL, "BASINS"		, _TL("Watershed Basins"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "MINSIZE"		, _TL("Min. Size"),
+		_TL("Minimum size of basin (cells)"),
+		PARAMETER_TYPE_Int
+	);
+}
+
+//---------------------------------------------------------
+CWatersheds::~CWatersheds(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define	NO_BASIN	-1
+
+//---------------------------------------------------------
+bool CWatersheds::On_Execute(void)
+{
+	int			x, y, nCells, nCells_Min, nBasins;
+	sLong		n;
+	CSG_Grid	*pDTM, *pSeed, *pRoute;
+
+	//-----------------------------------------------------
+	pDTM		= Parameters("ELEVATION")	->asGrid();
+	pSeed		= Parameters("CHANNELS")	->asGrid();
+	pRoute		= Parameters("SINKROUTE")	->asGrid();
+	nCells_Min	= Parameters("MINSIZE")		->asInt();
+	m_pBasins	= Parameters("BASINS")		->asGrid();
+
+	m_pBasins->Set_NoData_Value(NO_BASIN);
+	m_pBasins->Assign_NoData();
+
+	m_Direction.Create(m_pBasins, SG_DATATYPE_Char);
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( pDTM->is_NoData(x, y) )
+			{
+				m_Direction.Set_NoData(x, y);
+			}
+			else
+			{
+				if( !pRoute || (n = pRoute->asChar(x, y)) <= 0 )
+				{
+					n	= pDTM->Get_Gradient_NeighborDir(x, y);
+				}
+
+				m_Direction.Set_Value(x, y, n < 0 ? -1 : (n + 4) % 8);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(n=0, m_nBasins=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		pDTM->Get_Sorted(n, x, y, true, false);
+
+		if( !pSeed->is_NoData(x, y) && pSeed->asInt(x, y) < 0 )
+		{
+			m_nBasins++;
+
+			if( (nCells = Get_Basin(x, y)) < nCells_Min )
+			{
+				nBasins		= m_nBasins - 1;
+				m_nBasins	= NO_BASIN;
+				Get_Basin(x, y);
+				m_nBasins	= nBasins;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Direction.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CWatersheds::Get_Basin(int x, int y)
+{
+	int		i, ix, iy, nCells;
+
+	if( m_pBasins->is_NoData(x, y) && !m_Direction.is_NoData(x, y) )
+	{
+		m_pBasins->Set_Value(x, y, m_nBasins);
+
+		for(i=0, nCells=1; i<8; i++)
+		{
+			ix	= Get_xTo(i, x);
+			iy	= Get_yTo(i, y);
+
+			if( is_InGrid(ix,iy) && m_Direction.asInt(ix, iy) == i )
+			{
+				nCells	+= Get_Basin(ix, iy);
+			}
+		}
+
+		return( nCells );
+	}
+
+	return( -1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.h b/src/modules/terrain_analysis/ta_channels/Watersheds.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.h
rename to src/modules/terrain_analysis/ta_channels/Watersheds.h
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp
new file mode 100644
index 0000000..c054995
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp
@@ -0,0 +1,739 @@
+/**********************************************************
+ * Version $Id: Watersheds_ext.cpp 947 2011-03-03 11:56:34Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    Watersheds.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Watersheds_ext.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	FIELD_ID		= 0,
+	FIELD_ID_MAIN,
+	FIELD_MOUTH_X,
+	FIELD_MOUTH_Y,
+	FIELD_PERIMETER,
+	FIELD_AREA,
+	FIELD_CENTROID_X,
+	FIELD_CENTROID_Y,
+	FIELD_Z_MEAN,
+	FIELD_Z_RANGE,
+	FIELD_DIST_MEAN,
+	FIELD_DIST_MAX,
+	FIELD_CONCTIME,
+	FIELD_BASINS_UP,
+	FIELD_BASINS_DOWN,
+	FIELD_BASIN_TYPE,
+	FIELD_EQVRECT_A,
+	FIELD_EQVRECT_B,
+	FIELD_OROG_IDX,
+	FIELD_MASS_IDX
+};
+
+//---------------------------------------------------------
+#define BASIN_ADD_FIELDS(pBasins)	{\
+	pBasins->Add_Field(_TL("ID")						, SG_DATATYPE_Int);\
+	pBasins->Add_Field(_TL("Main Basin ID")				, SG_DATATYPE_Int);\
+	pBasins->Add_Field(_TL("Outlet X")					, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Outlet Y")					, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Perimeter")					, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Area")						, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Centroid X")				, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Centroid Y")				, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Mean Elevation")			, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Elevation Range")			, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Mean Flow Distance")		, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Maximum Flow Distance")		, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Concentration time (h)")	, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Upslope Basins")			, SG_DATATYPE_String);\
+	pBasins->Add_Field(_TL("Downslope Basins")			, SG_DATATYPE_Int);\
+	pBasins->Add_Field(_TL("Basin Type (Gravelius)")	, SG_DATATYPE_String);\
+	pBasins->Add_Field(_TL("Equivalent Rectangle (A)")	, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Equivalent Rectangle (B)")	, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Orographic Coefficient")	, SG_DATATYPE_Double);\
+	pBasins->Add_Field(_TL("Massivity Coefficient")		, SG_DATATYPE_Double);\
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWatersheds_ext::CWatersheds_ext(void)
+{
+	Set_Name		(_TL("Watershed Basins (Extended)"));
+
+	Set_Author		(SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Extended watershed basin analysis. "
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("DEM"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHANNELS"	, _TL("Drainage Network"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "BASINS"		, _TL("Basins"), 
+		_TL(""), 
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SUBBASINS"	, _TL("Subbasins"), 
+		_TL(""), 
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "V_BASINS"	, _TL("Basins"),
+		_TL(""), 
+		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "V_SUBBASINS"	, _TL("Subbasins"),
+		_TL(""), 
+		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "HEADS"		, _TL("River Heads"),
+		_TL(""), 
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "MOUTHS"		, _TL("River Mouths"),
+		_TL(""), 
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DISTANCE"	, _TL("Flow Distances"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatersheds_ext::On_Execute(void)
+{
+	int			x, y;
+	CSG_Grid	*pBasins, *pSubBasins, Inflows;
+	CSG_Shapes	*pHeads, *pMouths, *pVBasins, *pVSubBasins;
+
+	m_pDEM		= Parameters("DEM")			->asGrid(); 
+	m_pChannels	= Parameters("CHANNELS")	->asGrid();
+	pBasins		= Parameters("BASINS")		->asGrid();
+	pSubBasins	= Parameters("SUBBASINS")	->asGrid();
+	pVBasins	= Parameters("V_BASINS")	->asShapes();
+	pVSubBasins	= Parameters("V_SUBBASINS")	->asShapes();
+	pHeads		= Parameters("HEADS")		->asShapes();
+	pMouths		= Parameters("MOUTHS")		->asShapes();
+
+	//-----------------------------------------------------
+	Inflows		.Create(*Get_System(), SG_DATATYPE_Char);
+
+	m_Direction	.Create(*Get_System(), SG_DATATYPE_Char);
+	m_Direction	.Set_NoData_Value(-1);
+
+	m_Distance	.Create(*Get_System(), SG_DATATYPE_Float);
+	m_Distance	.Set_NoData_Value(-1);
+	m_Distance	.Assign_NoData();
+
+	pBasins		->Assign(0.0);
+	pBasins		->Set_NoData_Value(0.0);
+
+	pSubBasins	->Assign(0.0);
+	pSubBasins	->Set_NoData_Value(0.0);
+
+	pHeads		->Create(SHAPE_TYPE_Point	, _TL("Heads"));
+	pHeads		->Add_Field("ID"			, SG_DATATYPE_Int);
+	pHeads		->Add_Field("MAIN_ID"		, SG_DATATYPE_Int);
+	pHeads		->Add_Field("ELEVATION"		, SG_DATATYPE_Double);
+	pHeads		->Add_Field("DISTANCE"		, SG_DATATYPE_Double);
+
+	pMouths		->Create(SHAPE_TYPE_Point	, _TL("Mouths"));
+	pMouths		->Add_Field("ID"			, SG_DATATYPE_Int);
+	pMouths		->Add_Field("MAIN_ID"		, SG_DATATYPE_Int);
+	pMouths		->Add_Field("ELEVATION"		, SG_DATATYPE_Double);
+
+	pVBasins	->Create(SHAPE_TYPE_Polygon	, _TL("Basins"));
+	BASIN_ADD_FIELDS(pVBasins);
+
+	pVSubBasins	->Create(SHAPE_TYPE_Polygon	, _TL("Subbasins"));
+	BASIN_ADD_FIELDS(pVSubBasins);
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("flow directions..."));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			int	Direction	= -1;
+
+			if( m_pDEM->is_InGrid(x, y) )
+			{
+				double	dMax		= 0.0;
+
+				for(int i=0; i<8; i++)
+				{
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( m_pDEM->is_InGrid(ix, iy) && !m_pChannels->is_NoData(ix, iy) )
+					{
+						double	dz	= (m_pDEM->asDouble(x, y) - m_pDEM->asDouble(ix, iy)) / Get_Length(i);
+
+						if( dMax < dz )
+						{
+							dMax		= dz;
+							Direction	= i;
+						}
+					}
+				}
+
+				if( !m_pChannels->is_NoData(x, y) )
+				{
+					if( Direction >= 0 )
+					{
+						int	ix	= Get_xTo(Direction, x);
+						int	iy	= Get_yTo(Direction, y);
+
+						if( m_pDEM->is_InGrid(ix, iy) )
+						{
+							Inflows.Add_Value(ix, iy, 1);
+						}
+					}
+				}
+				else if( Direction < 0 )
+				{
+					Direction	= m_pDEM->Get_Gradient_NeighborDir(x, y);
+				}
+			}
+
+			m_Direction.Set_Value(x, y, Direction);
+		}
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("main basins..."));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pChannels->is_InGrid(x, y) && is_Outlet(x, y) )
+			{
+				Get_Basin(pBasins, pVBasins, x, y, -1);
+
+				CSG_Shape	*pMouth	= pMouths->Add_Shape();
+
+				pMouth->Add_Point(Get_System()->Get_Grid_to_World(x, y));
+
+				pMouth->Set_Value(0, pVBasins->Get_Count());	// ID
+				pMouth->Set_Value(1, pVBasins->Get_Count());	// MAIN_ID
+				pMouth->Set_Value(2, m_pDEM->asDouble(x, y));	// ELEVATION
+			}
+		}
+	}
+
+	if( Parameters("DISTANCE")->asBool() )
+	{
+		m_Distance.Set_Name(_TL("Flow Distance"));
+
+		DataObject_Add(SG_Create_Grid(m_Distance));
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("heads and mouths..."));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pChannels->is_InGrid(x, y) )
+			{
+				//-----------------------------------------
+				if( Inflows.asInt(x, y) > 1 )		// mouth, linking channels of subcatchments
+				{
+					CSG_Shape	*pMouth	= pMouths->Add_Shape();
+
+					pMouth->Add_Point(Get_System()->Get_Grid_to_World(x, y));
+
+					pMouth->Set_Value(0, pMouths->Get_Count());		// ID
+					pMouth->Set_Value(1, pBasins->asDouble(x, y));	// MAIN_ID
+					pMouth->Set_Value(2, m_pDEM->asDouble(x, y));	// ELEVATION
+				}
+
+				//-----------------------------------------
+				else if( Inflows.asInt(x, y) == 0 )	// head
+				{
+					CSG_Shape	*pHead	= pHeads->Add_Shape();
+
+					pHead->Add_Point(Get_System()->Get_Grid_to_World(x, y));
+
+					pHead->Set_Value(0, pHeads->Get_Count() + 1);
+					pHead->Set_Value(1, m_Distance.asDouble(x, y));
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("subbasins..."));
+
+	pMouths->Set_Index(1, TABLE_INDEX_Ascending, 2, TABLE_INDEX_Descending);
+
+	for(int iMouth=0; iMouth<pMouths->Get_Count() && Set_Progress(iMouth, pMouths->Get_Count()); iMouth++)
+	{
+		CSG_Shape	*pMouth	= pMouths->Get_Shape_byIndex(iMouth);
+
+		if( Get_System()->Get_World_to_Grid(x, y, pMouth->Get_Point(0)) )
+		{
+			if( pMouth->asInt(0) == pMouth->asInt(1) )
+			{
+				Get_Basin(pSubBasins, pVSubBasins, x, y, pMouth->asInt(1));
+			}
+			else
+			{
+				for(int i=0; i<8; i++)
+				{
+					int	ix	= Get_xFrom(i, x);
+					int	iy	= Get_yFrom(i, y);
+
+					if( m_pChannels->is_InGrid(ix, iy) && m_Direction.asInt(ix, iy) == i )
+					{
+						Get_Basin(pSubBasins, pVSubBasins, ix, iy, pMouth->asInt(1));
+					}
+				}
+			}
+		}
+	}
+
+	if( Parameters("DISTANCE")->asBool() )
+	{
+		m_Distance.Set_Name(_TL("Subbasin Flow Distance"));
+
+		DataObject_Add(SG_Create_Grid(m_Distance));
+	}
+
+	//-----------------------------------------------------
+	m_Distance	.Destroy();
+	m_Direction	.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline bool CWatersheds_ext::is_Outlet(int x, int y)
+{
+	int	Direction	= m_Direction.asInt(x, y);
+
+	if( Direction >= 0 )
+	{
+		int	ix	= Get_xTo(Direction, x);
+		int	iy	= Get_yTo(Direction, y);
+
+		if( m_pDEM->is_InGrid(ix, iy) )
+		{
+			return( false );
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWatersheds_ext::Get_Basin(CSG_Grid *pBasins, CSG_Shapes *pPolygons, int xMouth, int yMouth, int Main_ID)
+{
+	int						x, y, Basin_ID	= 1 + pPolygons->Get_Count();
+	CSG_Shape				*pPolygon;
+	CSG_Grid_Stack			Stack;
+	CSG_Simple_Statistics	s_Height, s_Distance;
+
+	//-----------------------------------------------------
+	Stack.Push(x = xMouth, y = yMouth);
+
+	pBasins		->Set_Value(x, y, Basin_ID);
+	m_Distance	 .Set_Value(x, y, 0.0);
+
+	s_Height	+= m_pDEM->asDouble(x, y);
+	s_Distance	+= 0.0;
+
+	//-----------------------------------------------------
+	while( Stack.Get_Size() > 0 && Process_Get_Okay() )
+	{
+		Stack.Pop(x, y);
+
+		double	d	= m_Distance.asDouble(x, y);
+
+		//-------------------------------------------------
+		for(int i=0; i<8; i++)
+		{
+			int	ix	= Get_xFrom(i, x);
+			int	iy	= Get_yFrom(i, y);
+
+			if( is_InGrid(ix, iy) && pBasins->is_NoData(ix, iy) && i == m_Direction.asInt(ix, iy) )
+			{
+				Stack.Push(ix, iy);
+
+				pBasins		->Set_Value(ix, iy, Basin_ID);
+				m_Distance	 .Set_Value(ix, iy, d + Get_Length(i));
+
+				s_Height	+= m_pDEM->asDouble(ix, iy);
+				s_Distance	+= d + Get_Length(i);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( s_Height.Get_Count() > 1 && (pPolygon = Get_Basin(pBasins, pPolygons)) != NULL )
+	{
+		double		d, Area, Perimeter, Side_A, Side_B;
+		CSG_String	Gravelius;
+
+	//	Area		= s_Height.Get_Count() * Get_System()->Get_Cellarea();
+		Area		= ((CSG_Shape_Polygon*)pPolygon)->Get_Area();
+		Perimeter	= ((CSG_Shape_Polygon*)pPolygon)->Get_Perimeter();
+
+		d			= 0.28 * Perimeter / sqrt(Area);
+		Gravelius	= d > 1.75 ? _TL("rectangular")
+					: d > 1.5  ? _TL("ovalooblonga-rectangularoblonga")
+					: d > 1.25 ? _TL("ovaloredonda-ovalooblonga")
+					:            _TL("redonda-ovaloredonda");
+
+		d			= pow(Perimeter, 2.0) - 8.0 * Area;
+		Side_A		= d > 0.0 ? (Perimeter + sqrt(d))      / 4.0 : -1.0;
+		Side_B		= d > 0.0 ? (Perimeter - 2.0 * Side_A) / 2.0 : -1.0;
+
+		pPolygon->Set_Value(FIELD_ID			, Basin_ID);
+		pPolygon->Set_Value(FIELD_ID_MAIN		, Main_ID);
+
+		pPolygon->Set_Value(FIELD_MOUTH_X		, Get_System()->Get_xGrid_to_World(xMouth));
+		pPolygon->Set_Value(FIELD_MOUTH_Y		, Get_System()->Get_yGrid_to_World(yMouth));
+
+		pPolygon->Set_Value(FIELD_PERIMETER		, Perimeter);
+		pPolygon->Set_Value(FIELD_AREA			, Area);
+
+		pPolygon->Set_Value(FIELD_CENTROID_X	, ((CSG_Shape_Polygon*)pPolygon)->Get_Centroid().x);
+		pPolygon->Set_Value(FIELD_CENTROID_Y	, ((CSG_Shape_Polygon*)pPolygon)->Get_Centroid().y);
+
+		pPolygon->Set_Value(FIELD_Z_MEAN		, s_Height  .Get_Mean());
+		pPolygon->Set_Value(FIELD_Z_RANGE		, s_Height  .Get_Range());
+
+		pPolygon->Set_Value(FIELD_DIST_MEAN		, s_Distance.Get_Mean());
+		pPolygon->Set_Value(FIELD_DIST_MAX		, s_Distance.Get_Maximum());
+
+		pPolygon->Set_Value(FIELD_CONCTIME		, s_Height.Get_Range() <= 0.0 ? -1.0 :
+			pow(0.87 * pow(s_Distance.Get_Maximum() / 1000.0, 3.0) / s_Height.Get_Range(),  0.385)
+		);
+
+		pPolygon->Set_Value(FIELD_BASIN_TYPE	, Gravelius);
+
+		pPolygon->Set_Value(FIELD_EQVRECT_A		, Side_A);
+		pPolygon->Set_Value(FIELD_EQVRECT_B		, Side_B);
+
+		pPolygon->Set_Value(FIELD_OROG_IDX		, SG_Get_Square(s_Height.Get_Mean()) / (0.0001 * Area));	// Orographic index, defined as the mean catchment altitude times the ratio of the mean catchment altitude to the orthogonal projection of drainage area (Alc�zar, Palau (2010): Establishing environmental flow regimes in a Mediterranean watershed based on a regional classification. Journal of Hydrology, V. 388
+		pPolygon->Set_Value(FIELD_MASS_IDX		, Perimeter / (0.0001 * Area));								// Perimeter / (0.0001 * Area) ??!!
+
+		pPolygon->Set_Value(FIELD_BASINS_UP		, 0.0);	// Upslope Basins
+		pPolygon->Set_Value(FIELD_BASINS_DOWN	, 0.0);	// Downslope Basins
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Shape * CWatersheds_ext::Get_Basin(CSG_Grid *pBasins, CSG_Shapes *pPolygons)
+{
+	int			x, y, nEdges, Basin_ID;
+	CSG_Grid	Edge;
+	CSG_Shape	*pPolygon	= NULL;
+
+	Basin_ID	= 1 + pPolygons->Get_Count();
+
+	//-----------------------------------------------------
+	Edge.Create(SG_DATATYPE_Char, 2 * Get_NX() + 1, 2 * Get_NY() + 1, 0.5 * Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize());
+	Edge.Set_NoData_Value(0);
+
+	for(y=0, nEdges=0; y<Get_NY() && Process_Get_Okay(); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( pBasins->asInt(x, y) == Basin_ID )
+			{
+				for(int i=0; i<8; i+=2)
+				{
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( !is_InGrid(ix, iy) || pBasins->asInt(ix, iy) != Basin_ID )
+					{
+						ix	= 1 + 2 * x;
+						iy	= 1 + 2 * y;
+
+						Edge.Set_Value(               ix,                 iy ,  1);
+						Edge.Set_Value(Get_xTo(i    , ix), Get_yTo(i    , iy), -1);
+						Edge.Set_Value(Get_xTo(i - 1, ix), Get_yTo(i - 1, iy), -1);
+
+						nEdges++;
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( nEdges > 0 )
+	{
+		for(int yEdge=0; yEdge<Edge.Get_NY(); yEdge++)	for(int xEdge=0; xEdge<Edge.Get_NX(); xEdge++)
+		{
+			int	i	= 4;
+
+			if( Edge.asInt(xEdge, yEdge) == 1 && Edge.asInt(Get_xTo(i, xEdge), Get_yTo(i, yEdge)) == -1 )
+			{
+				if( pPolygon == NULL )
+				{
+					pPolygon	= pPolygons->Add_Shape();
+				}
+
+				int	iPart	= pPolygon->Get_Part_Count();
+				int	xFirst	= x	= Get_xTo(i, xEdge);
+				int	yFirst	= y	= Get_yTo(i, yEdge);
+				i	= i + 2;
+
+				pPolygon	->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
+
+				do
+				{
+					int	ix	= Get_xTo(i + 2, x);
+					int	iy	= Get_yTo(i + 2, y);
+
+					if( Edge.is_InGrid(ix, iy) && Edge.asInt(ix, iy) == -1 )			// go right ?
+					{
+						pPolygon->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
+
+						i	= (i + 2) % 8;
+					}
+					else
+					{
+						if( Edge.asInt(ix, iy) == 1 )
+						{
+							Edge.Set_NoData(ix, iy);	// erase class id in right cells
+						}
+
+						ix	= Get_xTo(i, x);
+						iy	= Get_yTo(i, y);
+
+						if( Edge.is_InGrid(ix, iy) && Edge.asInt(ix, iy) == -1 )		// go ahead ?
+						{
+							// nop
+						}
+						else
+						{
+							ix	= Get_xTo(i + 6, x);
+							iy	= Get_yTo(i + 6, y);
+
+							if( Edge.is_InGrid(ix, iy) && Edge.asInt(ix, iy) == -1 )	// go left ?
+							{
+								pPolygon->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
+
+								i	= (i + 6) % 8;
+							}
+							else
+							{
+								return( false );
+							}
+						}
+					}
+
+					x	= ix;
+					y	= iy;
+				}
+				while( x != xFirst || y != yFirst );
+
+				pPolygon->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( pPolygon );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+/*/---------------------------------------------------------
+void CWatersheds_ext::CreateShapesLayer(void)
+{ //first shape (0) is the whole basin. 
+	CSG_Table_Record *pRecord, *pRecord2;
+	CSG_Shape *pSubbasin;
+	TSG_Point	Point;	
+	double fArea=0, fPerim=0;
+	double fSide1, fSide2;
+	double fConcTime;
+	double fMinHeight;
+	int i,j,k;	
+	int x,y;
+	int iNextX, iNextY;
+	int iX, iY;
+	int iXOrig, iYOrig;
+	int iIndex;
+	int iUpstreamBasin;
+	int iDownstreamBasin;
+	int iCode;
+	CSG_String sSubbasins;
+		
+	CSG_Points_Int		m_Heads;
+
+	
+	//-----------------------------------------------------
+	//upstream and downstream basins
+
+	CSG_Shapes	*pBasins	= Parameters("V_BASINS")->asShapes();
+
+	//-----------------------------------------------------
+	TSG_Point_Int	m_Closing;
+
+	for(i=0; i<m_Heads.Get_Count(); i++)
+	{
+		TSG_Point_Int	Point, Next	= m_Heads[i];
+
+		do
+		{
+		//	Get_Next(m_pDEM, m_pChannels, Point = Next, Next);
+
+			iDownstreamBasin	= m_pBasins->asInt(Next .x, Next .y);
+			iUpstreamBasin		= m_pBasins->asInt(Point.x, Point.y);
+
+			if( iUpstreamBasin != iDownstreamBasin && iDownstreamBasin != 0 && iUpstreamBasin != 0 )
+			{
+				for(j=0; j<pBasins->Get_Count(); j++)
+				{
+					pRecord	= pBasins->Get_Record(j);
+
+					iCode	= pRecord->asInt(0);
+
+					if( iCode == iUpstreamBasin )
+					{
+						pRecord->Set_Value(9, iDownstreamBasin);
+						pRecord->Set_Value(1, Point.x * m_pDEM->Get_Cellsize() + m_pDEM->Get_XMin());						
+						pRecord->Set_Value(2, Point.y * m_pDEM->Get_Cellsize() + m_pDEM->Get_YMin());
+					}
+				}
+			}
+		}
+		while( !(Point.x == m_Closing.x && Point.y == m_Closing.y) && (Point.x != Next.x || Point.y != Next.y) );
+	}// for
+
+	//-----------------------------------------------------
+	for (i = 1; i<pBasins->Get_Count(); i++)
+	{
+		pBasins->Get_Record(i)->Set_Value(8,SG_T(" --- "));
+		iCode = pBasins->Get_Record(i)->asInt(0);
+
+		for (j = 0; j<pBasins->Get_Count(); j++)
+		{
+			iDownstreamBasin = pBasins->Get_Record(j)->asInt(9);
+
+			if (iDownstreamBasin == iCode)
+			{
+				sSubbasins = CSG_String(pBasins->Get_Record(i)->asString(8)) + SG_T(" ")
+							+ SG_Get_String(pBasins->Get_Record(j)->asInt(0));
+
+				pBasins->Get_Record(i)->Set_Value(8, sSubbasins.c_str());
+			}//if
+		}//for
+	}//for
+
+	//-----------------------------------------------------
+}//*/
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h
new file mode 100644
index 0000000..4f70159
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h
@@ -0,0 +1,70 @@
+/**********************************************************
+ * Version $Id: Watersheds_ext.h 946 2011-03-02 15:32:39Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    Watersheds.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CWatersheds_ext : public CSG_Module_Grid
+{
+public:
+	CWatersheds_ext(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+
+private:
+
+	CSG_Grid			*m_pDEM, *m_pChannels, m_Distance, m_Direction;
+
+
+	bool				Get_Basin		(CSG_Grid *pBasins, CSG_Shapes *pPolygons, int xMouth, int yMouth, int Main_ID);
+	CSG_Shape *			Get_Basin		(CSG_Grid *pBasins, CSG_Shapes *pPolygons);
+
+	bool				is_Outlet		(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_compound/MLB_Interface.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.cpp
rename to src/modules/terrain_analysis/ta_compound/MLB_Interface.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.h b/src/modules/terrain_analysis/ta_compound/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_compound/MLB_Interface.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.am b/src/modules/terrain_analysis/ta_compound/Makefile.am
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.am
rename to src/modules/terrain_analysis/ta_compound/Makefile.am
diff --git a/src/modules/terrain_analysis/ta_compound/Makefile.in b/src/modules/terrain_analysis/ta_compound/Makefile.in
new file mode 100644
index 0000000..f256eed
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_compound/Makefile.in
@@ -0,0 +1,631 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_compound
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_compound_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_compound_la_OBJECTS = MLB_Interface.lo TA_Standard.lo
+libta_compound_la_OBJECTS = $(am_libta_compound_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_compound_la_SOURCES)
+DIST_SOURCES = $(libta_compound_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libta_compound.la
+libta_compound_la_SOURCES = \
+MLB_Interface.cpp\
+TA_Standard.cpp\
+MLB_Interface.h\
+TA_Standard.h
+
+libta_compound_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_compound/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_compound/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_compound.la: $(libta_compound_la_OBJECTS) $(libta_compound_la_DEPENDENCIES) $(EXTRA_libta_compound_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_compound_la_OBJECTS) $(libta_compound_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/TA_Standard.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_compound/TA_Standard.cpp b/src/modules/terrain_analysis/ta_compound/TA_Standard.cpp
new file mode 100644
index 0000000..d309e38
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_compound/TA_Standard.cpp
@@ -0,0 +1,348 @@
+/**********************************************************
+ * Version $Id: TA_Standard.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_compound                       //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    TA_Standard.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:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "TA_Standard.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTA_Standard::CTA_Standard(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Basic Terrain Analysis"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2005"));
+
+	Set_Description	(_TW(
+		"A selection of basic parameters and objects to be derived from a Digital Terrain Model using standard settings."
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SHADE"		, _TL("Analytical Hillshading"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SLOPE"		, _TL("Slope"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ASPECT"		, _TL("Aspect"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "HCURV"		, _TL("Plan Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "VCURV"		, _TL("Profile Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CONVERGENCE"	, _TL("Convergence Index"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SINKS"		, _TL("Closed Depressions"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CAREA"		, _TL("Catchment Area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "WETNESS"		, _TL("Wetness Index"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "LSFACTOR"	, _TL("LS-Factor"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "CHANNELS"	, _TL("Channel Network"),
+		_TL(""),
+		PARAMETER_OUTPUT		, SHAPE_TYPE_Line
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "BASINS"		, _TL("Drainage Basins"),
+		_TL(""),
+		PARAMETER_OUTPUT		, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHNL_BASE"	, _TL("Channel Network Base Level"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHNL_ALTI"	, _TL("Vertical Distance to Channel Network"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "VALL_DEPTH"	, _TL("Valley Depth"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "RSP"			, _TL("Relative Slope Position"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD"	, _TL("Channel Density"), 
+		_TL("Strahler order to begin a channel."), 
+		PARAMETER_TYPE_Int, 5, 1, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
+	bool	bResult;\
+	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
+	if( !bResult ) return( false );\
+}
+
+#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
+
+//---------------------------------------------------------
+bool CTA_Standard::On_Execute(void)
+{
+	CSG_Grid	DEMP(*Get_System(), SG_DATATYPE_Float);
+	CSG_Grid	TMP1(*Get_System(), SG_DATATYPE_Float);
+	CSG_Grid	TMP2(*Get_System(), SG_DATATYPE_Float);
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_preprocessor"		, 2,
+			SET_PARAMETER("DEM"			, Parameters("ELEVATION"))
+		&&	SET_PARAMETER("DEM_PREPROC"	, &DEMP)	// >> preprocessed DEM
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_lighting"			, 0,
+			SET_PARAMETER("ELEVATION"	, &DEMP)
+		&&	SET_PARAMETER("SHADE"		, Parameters("SHADE"))
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_morphometry"			, 0,
+			SET_PARAMETER("ELEVATION"	, &DEMP)
+		&&	SET_PARAMETER("SLOPE"		, Parameters("SLOPE"))
+		&&	SET_PARAMETER("ASPECT"		, Parameters("ASPECT"))
+		&&	SET_PARAMETER("C_CROS"		, (CSG_Grid *)NULL)
+		&&	SET_PARAMETER("C_LONG"		, (CSG_Grid *)NULL)
+	)
+
+	RUN_MODULE("grid_filter"			, 0,
+			SET_PARAMETER("INPUT"		, &DEMP)
+		&&	SET_PARAMETER("RESULT"		, &TMP1)
+		&&	SET_PARAMETER("RADIUS"		, 3)
+	)
+
+	RUN_MODULE("ta_morphometry"			, 0,
+			SET_PARAMETER("ELEVATION"	, &TMP1)
+		&&	SET_PARAMETER("SLOPE"		, &TMP2)
+		&&	SET_PARAMETER("ASPECT"		, &TMP2)
+		&&	SET_PARAMETER("C_CROS"		, Parameters("HCURV"))
+		&&	SET_PARAMETER("C_LONG"		, Parameters("VCURV"))
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_morphometry"			, 1,
+			SET_PARAMETER("ELEVATION"	, &TMP1)
+		&&	SET_PARAMETER("RESULT"		, Parameters("CONVERGENCE"))
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_hydrology"			, 0,
+			SET_PARAMETER("ELEVATION"	, &DEMP)	// << preprocessed DEM
+		&&	SET_PARAMETER("CAREA"		, Parameters("CAREA"))
+		&&	SET_PARAMETER("Method"		, 4)		// MFD
+	)
+
+	Parameters("SINKS")->asGrid()->Assign(&(TMP2 = DEMP - *Parameters("ELEVATION")->asGrid()));
+	Parameters("SINKS")->asGrid()->Set_NoData_Value(0.0);
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_hydrology"			, 19,
+			SET_PARAMETER("DEM"			, &DEMP)
+		&&	SET_PARAMETER("TCA"			, Parameters("CAREA"))
+		&&	SET_PARAMETER("WIDTH"		, &TMP2)
+		&&	SET_PARAMETER("SCA"			, &TMP1)	// >> specific catchment area
+		&&	SET_PARAMETER("METHOD"		, 1)
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_hydrology"			, 20,
+			SET_PARAMETER("SLOPE"		, Parameters("SLOPE"))
+		&&	SET_PARAMETER("AREA"		, &TMP1)	// << specific catchment area
+		&&	SET_PARAMETER("TWI"			, Parameters("WETNESS"))
+		&&	SET_PARAMETER("CONV"		, 0)
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_hydrology"			, 22,
+			SET_PARAMETER("SLOPE"		, Parameters("SLOPE"))
+		&&	SET_PARAMETER("AREA"		, &TMP1)	// << specific catchment area
+		&&	SET_PARAMETER("LS"			, Parameters("LSFACTOR"))
+		&&	SET_PARAMETER("CONV"		, 0)
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_channels"			, 5,
+			SET_PARAMETER("DEM"			, &DEMP)	// << preprocessed DEM
+		&&	SET_PARAMETER("SEGMENTS"	, Parameters("CHANNELS"))
+		&&	SET_PARAMETER("BASINS"		, Parameters("BASINS"))
+		&&	SET_PARAMETER("ORDER"		, &TMP1)
+		&&	SET_PARAMETER("THRESHOLD"	, Parameters("THRESHOLD"))
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("ta_channels"			, 3,
+			SET_PARAMETER("ELEVATION"	, &DEMP)
+		&&	SET_PARAMETER("CHANNELS"	, &TMP1)
+		&&	SET_PARAMETER("DISTANCE"	, Parameters("CHNL_ALTI"))
+		&&	SET_PARAMETER("BASELEVEL"	, Parameters("CHNL_BASE"))
+	)
+
+	//-----------------------------------------------------
+	RUN_MODULE("grid_tools"				, 19,	// grid orientation
+			SET_PARAMETER("INPUT"		, &DEMP)
+		&&	SET_PARAMETER("RESULT"		, &TMP1)
+		&&	SET_PARAMETER("METHOD"		, 3)	// invert
+	)
+
+	RUN_MODULE("ta_channels"			, 6,	// strahler order
+			SET_PARAMETER("DEM"			, &TMP1)
+		&&	SET_PARAMETER("STRAHLER"	, &TMP2)
+	)
+
+	TMP2.Set_NoData_Value_Range(0, 4);
+
+	RUN_MODULE("ta_channels"			, 3,	// vertical channel network distance
+			SET_PARAMETER("ELEVATION"	, &TMP1)
+		&&	SET_PARAMETER("CHANNELS"	, &TMP2)
+		&&	SET_PARAMETER("DISTANCE"	, Parameters("VALL_DEPTH"))
+	)
+
+	Parameters("VALL_DEPTH")->asGrid()->Set_Name(_TL("Valley Depth"));
+
+	Parameters("RSP")->asGrid()->Assign(&(TMP1 =
+		*Parameters("CHNL_ALTI")->asGrid() / (*Parameters("CHNL_ALTI")->asGrid() + *Parameters("VALL_DEPTH")->asGrid())
+	));
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.h b/src/modules/terrain_analysis/ta_compound/TA_Standard.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.h
rename to src/modules/terrain_analysis/ta_compound/TA_Standard.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/CellBalance.cpp b/src/modules/terrain_analysis/ta_hydrology/CellBalance.cpp
new file mode 100644
index 0000000..eb4db4e
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/CellBalance.cpp
@@ -0,0 +1,259 @@
+/**********************************************************
+ * Version $Id: CellBalance.cpp 1616 2013-02-27 16:23:56Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    CellBalance.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "CellBalance.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCellBalance::CCellBalance(void)
+{
+	Set_Name		(_TL("Cell Balance"));
+
+	Set_Author		(SG_T("(c) 2004 by V.Olaya, (c) 2006 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"(c) 2004 by Victor Olaya. Cell Balance Calculation\r\n"
+		"References:\r\n 1. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"
+	));
+
+	Parameters.Add_Grid(
+		NULL, "DEM"		, _TL("Elevation"),
+		_TL(""), 
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_or_Const(
+		NULL, "WEIGHTS"	, _TL("Weights"),
+		_TL(""),
+		1.0, 0.0, true
+	);
+
+	Parameters.Add_Grid(
+		NULL, "BALANCE"	, _TL("Cell Balance"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL, "METHOD"	, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Deterministic 8"),
+			_TL("Multiple Flow Direction")
+		)
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCellBalance::On_Execute(void)
+{
+	int			Method;
+	double		Weight;
+	CSG_Grid	*pWeights;
+
+	m_pDEM		= Parameters("DEM"    )->asGrid();
+	pWeights	= Parameters("WEIGHTS")->asGrid();
+	Weight		= Parameters("WEIGHTS")->asDouble();
+	m_pBalance	= Parameters("BALANCE")->asGrid();
+	Method		= Parameters("METHOD" )->asInt();
+
+	m_pBalance->Assign(0.0);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( m_pDEM->is_NoData(x, y) )
+			{
+				m_pBalance->Set_NoData(x, y);
+			}
+			else
+			{
+				if( pWeights )
+				{
+					Weight	= pWeights->is_NoData(x, y) ? 0.0 : pWeights->asDouble(x, y);
+				}
+
+				if( Weight )
+				{
+					m_pBalance->Add_Value(x, y, -Weight);
+
+					switch( Method )
+					{
+					case 0:	Set_D8	(x, y, Weight);	break;
+					case 1:	Set_MFD	(x, y, Weight);	break;
+					}
+				}
+			}
+        }
+    }
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CCellBalance::Set_D8(int x, int y, double Weight)
+{
+	int		Dir;
+
+	if( (Dir = m_pDEM->Get_Gradient_NeighborDir(x, y)) >= 0 )
+	{
+		x	+= Get_xTo(Dir);
+		y	+= Get_yTo(Dir);
+
+		if( is_InGrid(x, y) )
+		{
+			m_pBalance->Add_Value(x, y, Weight);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CCellBalance::Set_MFD(int x, int y, double Weight)
+{
+	const double	MFD_Converge	= 1.1;
+
+	int		i, ix, iy;
+	double	z, d, dzSum, dz[8];
+
+	z		= m_pDEM->asDouble(x, y);
+	dzSum	= 0.0;
+
+	for(i=0; i<8; i++)
+	{
+		ix		= Get_xTo(i, x);
+		iy		= Get_yTo(i, y);
+
+		if( m_pDEM->is_InGrid(ix, iy) && (d = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
+		{
+			dz[i]	= pow(d / Get_Length(i), MFD_Converge);
+			dzSum	+= dz[i];
+		}
+		else
+		{
+			dz[i]	= 0.0;
+		}
+	}
+
+	if( dzSum > 0.0 )
+	{
+		d		= Weight / dzSum;
+
+		for(i=0; i<8; i++)
+		{
+			if( dz[i] > 0.0 )
+			{
+				ix		= Get_xTo(i, x);
+				iy		= Get_yTo(i, y);
+
+				m_pBalance->Add_Value(ix, iy, dz[i] * d);
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+/*/---------------------------------------------------------
+#include "Helper.h"
+
+double CCellBalance::getCellBalance(int iX, int iY)
+{		
+	int iNextX, iNextY;
+	double dIn=0, dOut=0, dBalance;
+
+	for (int i = -1; i<2; i++){
+		for (int j = -1; j<2; j++){
+			if (!(i == 0) || !(j == 0)) {
+				getNextCell(m_pDEM, iX + i, iY + j, iNextX, iNextY);
+                if (iNextY == iY && iNextX == iX) {
+                    dIn+=m_pWeight->asDouble(iX+i,iY+j);                                        
+				}// if				
+			}//if				
+		}//for
+	}//for
+	
+	dOut = m_pWeight->asDouble(iX,iY);
+	dBalance = dIn-dOut;
+	
+	return dBalance;
+	
+}//function
+
+bool CCellBalance::On_Execute(void)
+{
+	m_pDEM = Parameters("DEM")->asGrid(); 
+	m_pWeight = Parameters("WEIGHT")->asGrid(); 
+	m_pBalance = Parameters("BALANCE")->asGrid();
+	m_pBalance->Assign((double)0);
+
+    for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(int x=0; x<Get_NX(); x++){			
+            m_pBalance->Set_Value(x,y,getCellBalance(x,y));
+        }// for
+    }// for
+
+	return( true );
+
+}//method /**/
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_hydrology/CellBalance.h b/src/modules/terrain_analysis/ta_hydrology/CellBalance.h
new file mode 100644
index 0000000..7e71259
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/CellBalance.h
@@ -0,0 +1,51 @@
+/**********************************************************
+ * Version $Id: CellBalance.h 1616 2013-02-27 16:23:56Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    CellBalance.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CCellBalance : public CSG_Module_Grid
+{
+public:
+	CCellBalance(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Miscellaneous") );	}
+
+
+protected:
+
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	CSG_Grid				*m_pDEM, *m_pBalance;
+
+
+	void					Set_D8			(int x, int y, double Weight);
+	void					Set_MFD			(int x, int y, double Weight);
+
+};
+
diff --git a/src/modules/terrain_analysis/ta_hydrology/EdgeContamination.cpp b/src/modules/terrain_analysis/ta_hydrology/EdgeContamination.cpp
new file mode 100644
index 0000000..f3392b7
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/EdgeContamination.cpp
@@ -0,0 +1,202 @@
+/**********************************************************
+ * Version $Id: EdgeContamination.cpp 1016 2011-04-27 18:40:36Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    EdgeContamination.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "EdgeContamination.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define NOT_VISITED -1
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CEdgeContamination::CEdgeContamination(void)
+{
+	Set_Name		(_TL("Edge Contamination"));
+
+	Set_Author		(SG_T("V.Olaya (c) 2004"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	Parameters.Add_Grid(
+		NULL	,  "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CONTAMINATION"	, _TL("Edge Contamination"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CEdgeContamination::On_Execute(void)
+{
+	int		x, y;
+
+	//-----------------------------------------------------
+	m_pDEM				= Parameters("DEM")				->asGrid(); 
+	m_pContamination	= Parameters("CONTAMINATION")	->asGrid();
+
+	//-----------------------------------------------------
+	m_pContamination->Set_NoData_Value(-2);
+
+	m_Edge.Create(*Get_System(), SG_DATATYPE_Byte);
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pDEM->is_InGrid(x, y) )
+			{
+				for(int i=0; i<8; i++)
+				{
+					if( !m_pDEM->is_InGrid(Get_xTo(i, x), Get_yTo(i, y)) )
+					{
+						m_Edge.Set_Value(x, y, 1);
+
+						break;
+					}
+				}
+
+				m_pContamination->Set_Value(x, y, -1);
+			}
+			else
+			{
+				m_pContamination->Set_NoData(x, y);
+			}
+		}
+	}
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pDEM->is_InGrid(x, y) && !m_Edge.asInt(x, y) )
+			{
+				for(int i=0; i<8; i++)
+				{
+					if( m_Edge.asInt(Get_xTo(i, x), Get_yTo(i, y)) == 1 )
+					{
+						m_Edge.Set_Value(x, y, 2);
+
+						break;
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( !m_pDEM->is_NoData(x, y) )
+			{
+				Get_Contamination(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Edge.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CEdgeContamination::Get_Contamination(int x, int y)
+{
+	if( m_pDEM->is_NoData(x, y) )
+	{
+		return( 0 );
+	}
+
+	if( m_pContamination->asInt(x, y) >= 0 )
+	{
+		return( m_pContamination->asInt(x, y) );
+	}
+
+	//-----------------------------------------------------
+	int	Contamination	= m_Edge.asInt(x, y) ? 1 : 0;
+
+	for(int i=0; i<8; i++)
+	{
+		int	ix	= Get_xFrom(i, x);
+		int	iy	= Get_yFrom(i, y);
+
+		if( m_pDEM->Get_Gradient_NeighborDir(ix, iy) == i )
+		{
+			Contamination	+= Get_Contamination(ix, iy);
+		}
+	}
+
+	m_pContamination->Set_Value(x, y, Contamination);
+
+	return( Contamination );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_hydrology/EdgeContamination.h b/src/modules/terrain_analysis/ta_hydrology/EdgeContamination.h
new file mode 100644
index 0000000..973047a
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/EdgeContamination.h
@@ -0,0 +1,70 @@
+/**********************************************************
+ * Version $Id: EdgeContamination.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    EdgeContamination.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CEdgeContamination : public CSG_Module_Grid
+{
+public:
+	CEdgeContamination(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Catchment Area" ));	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	CSG_Grid				*m_pDEM, *m_pContamination, m_Edge;
+
+
+	int						Get_Contamination	(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_hydrology/Erosion_LS_Fields.cpp b/src/modules/terrain_analysis/ta_hydrology/Erosion_LS_Fields.cpp
new file mode 100644
index 0000000..ce7b48a
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Erosion_LS_Fields.cpp
@@ -0,0 +1,808 @@
+/**********************************************************
+ * Version $Id: Erosion_LS_Fields.cpp 1637 2013-03-23 11:52:10Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 Erosion_LS_Fields.cpp                 //
+//                                                       //
+//                 Copyright (C) 2013 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 "Erosion_LS_Fields.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CErosion_LS_Fields::CErosion_LS_Fields(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		("LS-Factor, Field Based");
+
+	Set_Author		("O.Conrad (c) 2013");
+
+	Set_Description	(_TW(
+		"Calculation of slope length (LS) factor as used for the Universal Soil Loss Equation (USLE), "
+		"based on slope and (specific) catchment area, latter as substitute for slope length. "
+		"This tool takes only a Digital Elevation Model (DEM) as input and derives catchment areas "
+		"according to Freeman (1991). "
+		"Optionally field polygons can be supplied. Is this the case, calculations will be performed "
+		"field by field, i.e. catchment area calculation is restricted to each field's area. "
+		"\n"
+		"References:\n"
+		"\n"
+		"Boehner, J., Selige, T. (2006): "
+		"Spatial Prediction of Soil Attributes Using Terrain Analysis and Climate Regionalisation. "
+		"In: Boehner, J., McCloy, K.R., Strobl, J.: 'SAGA - Analysis and Modelling Applications', "
+		"Goettinger Geographische Abhandlungen, 115, 13-27.\n"
+		"\n"
+		"Desmet, P.J.J., Govers, G. (1996): "
+		"A GIS Procedure for Automatically Calculating the USLE LS Factor on Topographically Complex Landscape Units. "
+		"Journal of Soil and Water Conservation, 51(5), 427-433.\n"
+		"\n"
+		"Freeman, G.T. (1991): "
+		"Calculating catchment area with divergent flow based on a regular grid. "
+		"Computers and Geosciences, 17:413-22\n"
+		"\n"
+		"Kinnell, P.I.A. (2005): "
+		"Alternative Approaches for Determining the USLE-M Slope Length Factor for Grid Cells. "
+		"<a href=\"online\">https://www.soils.org/publications/sssaj/abstracts/69/3/0674</a>\n"
+		"\n"
+		"Moore, I.D., Grayson, R.B., Ladson, A.R. (1991): "
+		"Digital terrain modelling: a review of hydrogical, geomorphological, and biological applications. "
+		"Hydrological Processes, 5(1).\n"
+		"\n"
+		"Moore, I.D., Nieber, J.L. (1991): "
+		"Landscape assessment of soil erosion and nonpoint source pollution. "
+		"J. Minnesota Acad. Sci., 55, 18-25.\n"
+		"\n"
+		"Wischmeier, W.H., Smith, D.D. (1978): "
+		"Predicting rainfall erosion losses - A guide to conservation planning. "
+		"Agriculture Handbook No. 537: US Department of Agriculture, Washington DC.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"				, "Elevation",
+		"",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "FIELDS"			, "Fields",
+		"",
+		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "STATISTICS"		, "Field Statistics",
+		"",
+		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "UPSLOPE_AREA"	, _TL("Upslope Length Factor"),
+		"",
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "UPSLOPE_LENGTH"	, _TL("Effective Flow Length"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "UPSLOPE_SLOPE"	, _TL("Upslope Slope"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "LS_FACTOR"		, _TL("LS Factor"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "BALANCE"			, _TL("Sediment Balance"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "METHOD"			, _TL("LS Calculation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Moore & Nieber 1989"),
+			_TL("Desmet & Govers 1996"),
+			_TL("Wischmeier & Smith 1978")
+		), 0
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD_SLOPE"	, _TL("Type of Slope"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local slope"),
+			_TL("distance weighted average catchment slope")
+		), 0
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD_AREA"		, _TL("Specific Catchment Area"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("specific catchment area (contour length simply as cell size)"),
+			_TL("specific catchment area (contour length dependent on aspect)"),
+			_TL("catchment length (square root of catchment area)"),
+			_TL("effective flow length"),
+			_TL("total catchment area")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "STOP_AT_EDGE"	, _TL("Stop at Edge"),
+		"",
+		PARAMETER_TYPE_Bool, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "DESMET_GOVERS"	, _TL("Desmet & Govers"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "EROSIVITY"	, _TL("Rill/Interrill Erosivity"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "STABILITY"	, _TL("Stability"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("stable"),
+			_TL("instable (thawing)")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CErosion_LS_Fields::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "METHOD") )
+	{
+		pParameters->Get_Parameter("DESMET_GOVERS")->Set_Enabled(pParameter->asInt() == 1);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FIELDS") )
+	{
+		pParameters->Get_Parameter("STATISTICS")->Set_Enabled(pParameter->asShapes() != NULL);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CErosion_LS_Fields::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_Method		= Parameters("METHOD"        )->asInt();
+	m_Method_Slope	= Parameters("METHOD_SLOPE"  )->asInt();
+	m_Method_Area	= Parameters("METHOD_AREA"   )->asInt();
+
+	m_bStopAtEdge	= Parameters("STOP_AT_EDGE"  )->asBool();
+
+	m_Erosivity		= Parameters("EROSIVITY"     )->asDouble();
+	m_Stability		= Parameters("STABILITY"     )->asInt();
+
+	m_pDEM			= Parameters("DEM"           )->asGrid();
+	m_pUp_Area		= Parameters("UPSLOPE_AREA"  )->asGrid();
+	m_pUp_Length	= Parameters("UPSLOPE_LENGTH")->asGrid();
+	m_pUp_Slope		= Parameters("UPSLOPE_SLOPE" )->asGrid();
+	m_pLS			= Parameters("LS_FACTOR"     )->asGrid();
+
+	DataObject_Set_Colors(m_pUp_Area  , 11, SG_COLORS_WHITE_BLUE    , false);
+	DataObject_Set_Colors(m_pUp_Length, 11, SG_COLORS_YELLOW_RED    , false);
+	DataObject_Set_Colors(m_pUp_Slope , 11, SG_COLORS_YELLOW_RED    , false);
+	DataObject_Set_Colors(m_pLS       , 11, SG_COLORS_RED_GREY_GREEN, true );
+
+	if( m_pUp_Area   == NULL )	m_pUp_Area   = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float);
+	if( m_pUp_Length == NULL )	m_pUp_Length = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float);
+	if( m_pUp_Slope  == NULL )	m_pUp_Slope  = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float);
+
+	//-----------------------------------------------------
+	bool	bResult	= Set_Fields() && Get_Flow() && Get_LS();
+
+	if( bResult )
+	{
+		Get_Statistics();
+
+		Get_Balance();
+	}
+
+	//-----------------------------------------------------
+	if( m_pUp_Area   && Parameters("UPSLOPE_AREA"  )->asGrid() == NULL ) delete(m_pUp_Area  );
+	if( m_pUp_Length && Parameters("UPSLOPE_LENGTH")->asGrid() == NULL ) delete(m_pUp_Length);
+	if( m_pUp_Slope  && Parameters("UPSLOPE_SLOPE" )->asGrid() == NULL ) delete(m_pUp_Slope );
+
+	m_Fields.Destroy();
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CErosion_LS_Fields::Get_Flow(void)
+{
+	//-----------------------------------------------------
+	int		x, y;
+
+	m_pDEM->Get_Sorted(0, x, y);	// create index ...
+
+	Process_Set_Text(_TL("Flow Accumulation"));
+
+	m_pUp_Area  ->Assign(0.0);
+	m_pUp_Length->Assign(0.0);
+	m_pUp_Slope ->Assign(0.0);
+
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		double	dzSum, dz[8], Slope, Aspect;
+
+		if( m_pDEM->Get_Sorted(n, x, y) && !m_Fields.is_NoData(x, y) && m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
+		{
+			double	Up_Area		= m_pUp_Area  ->asDouble(x, y) + Get_Cellarea();
+			double	Up_Length	= m_pUp_Length->asDouble(x, y) + log(Up_Area);
+			double	Up_Slope	= m_pUp_Slope ->asDouble(x, y) + log(Up_Area) * Slope;
+
+			//---------------------------------------------
+			if( (dzSum = Get_Flow(x, y, dz)) > 0.0 )
+			{
+				for(int i=0; i<8; i++)
+				{
+					if( dz[i] > 0.0 )
+					{
+						int	ix	= Get_xTo(i, x);
+						int	iy	= Get_yTo(i, y);
+
+						m_pUp_Area  ->Add_Value(ix, iy, Up_Area   * dz[i] / dzSum);
+						m_pUp_Length->Add_Value(ix, iy, Up_Length * dz[i] / dzSum);
+						m_pUp_Slope ->Add_Value(ix, iy, Up_Slope  * dz[i] / dzSum);
+					}
+				}
+			}
+
+			//---------------------------------------------
+			switch( m_Method_Area )
+			{
+			case 0:	// specific catchment area (contour length simply as cell size)
+				m_pUp_Area->Set_Value(x, y, Up_Area / (Get_Cellsize()));
+				break;
+
+			case 1:	// specific catchment area (contour length dependent on aspect)
+				m_pUp_Area->Set_Value(x, y,	Up_Area / (Get_Cellsize() * (fabs(sin(Aspect)) + fabs(cos(Aspect)))));
+				break;
+
+			case 2:	// catchment length (square root of catchment area)
+				m_pUp_Area->Set_Value(x, y, sqrt(Up_Area));
+				break;
+
+			case 3:	// effective flow length
+				m_pUp_Area->Set_Value(x, y, Up_Length);
+				break;
+
+			case 4:	// total catchment area
+				m_pUp_Area->Set_Value(x, y, Up_Area);
+				break;
+			}
+
+			m_pUp_Length->Set_Value(x, y, Up_Length);
+			m_pUp_Slope ->Set_Value(x, y, Up_Slope / (Up_Length > M_ALMOST_ZERO ? Up_Length : M_ALMOST_ZERO));
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+double CErosion_LS_Fields::Get_Flow(int x, int y, double dz[8])
+{
+	if( m_Fields.is_NoData(x, y) )
+	{
+		return( 0.0 );
+	}
+
+	double	d, z = m_pDEM->asDouble(x, y), dzSum = 0.0;
+
+	int		ID	= m_Fields.asInt(x, y);
+
+	for(int i=0; i<8; i++)
+	{
+		dz[i]	= 0.0;
+
+		int	ix	= Get_xTo(i, x);
+		int	iy	= Get_yTo(i, y);
+
+		if(	m_pDEM->is_InGrid(ix, iy) && (d = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
+		{
+			if( ID == m_Fields.asInt(ix, iy) )
+			{
+				dzSum	+= (dz[i] = pow(d / Get_Length(i), 1.1));
+			}
+			else if( m_bStopAtEdge )
+			{
+				dzSum	+= pow(d / Get_Length(i), 1.1);
+			}
+		}
+	}
+
+	return( dzSum );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CErosion_LS_Fields::Get_LS(void)
+{
+	Process_Set_Text(_TL("LS Factor"));
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	LS	= Get_LS(x, y);
+
+			if( LS >= 0.0 )
+			{
+				m_pLS->Set_Value(x, y, LS);
+			}
+			else
+			{
+				m_pLS->Set_NoData(x, y);
+
+				m_pUp_Area  ->Set_NoData(x, y);
+				m_pUp_Length->Set_NoData(x, y);
+				m_pUp_Slope ->Set_NoData(x, y);
+			}
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+double CErosion_LS_Fields::Get_LS(int x, int y)
+{
+	double	LS, Slope, Aspect, Area, sin_Slope;
+
+	//-----------------------------------------------------
+	if( m_Fields.is_NoData(x, y) )
+	{
+		return( -1.0 );
+	}
+
+	if( !m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
+	{
+		return( -1.0 );
+	}
+
+	if( m_Method_Slope == 1 )	// distance weighted average up-slope slope
+	{
+		Slope	= m_pUp_Slope->asDouble(x, y);
+	}
+
+	if( Slope <= 0.0 )	Slope	= 0.000001;
+	if( Aspect < 0.0 )	Aspect	= 0.0;
+
+	sin_Slope	= sin(Slope);
+
+	Area		= m_pUp_Area->asDouble(x, y);
+
+	//-----------------------------------------------------
+	switch( m_Method )
+	{
+	//-----------------------------------------------------
+	default:	// Moore and Nieber
+		{
+			LS		= (0.4 + 1) * pow(Area / 22.13, 0.4) * pow(sin_Slope / 0.0896, 1.3);
+		}
+		break;
+
+	//-----------------------------------------------------
+	case 1:		// Desmet and Govers
+		{
+			double	L, S, m, x;
+
+			m		= m_Erosivity * (sin_Slope / 0.0896) / (3.0 * pow(sin_Slope, 0.8) + 0.56);
+			m		= m / (1.0 + m);
+
+			x		= fabs(sin(Aspect)) + fabs(cos(Aspect));
+
+			// x: coefficient that adjusts for width of flow at the center of the cell.
+			// It has a value of 1.0 when the flow is toward a side and sqrt(2.0) when
+			// the flow is toward a corner (Kinnel 2005).
+
+			L		= (pow(Area + Get_Cellarea(), m + 1.0) - pow(Area, m + 1.0))
+				/ (pow(Get_Cellsize(), m + 2.0) * pow(22.13, m) * pow(x, m));
+
+			//-----------------------------------------------------
+			if( Slope < 0.08975817419 )		// <  9% (= atan(0.09)), ca. 5 Degree
+			{
+				S	= 10.8 * sin_Slope + 0.03;	
+			}
+			else if( m_Stability == 0 )		// >= 9%, stable
+			{
+				S	= 16.8 * sin_Slope - 0.5;
+			}
+			else							// >= 9%, thawing, unstable
+			{
+				S	= pow(sin_Slope / 0.896, 0.6);
+			}
+
+			LS		= L * S;
+		}
+		break;
+
+	//-----------------------------------------------------
+	case 2:		// Wischmeier and Smith
+		{
+			if( Slope > 0.0505 )	// >  ca. 3�
+			{
+				LS	= sqrt(Area / 22.13)
+					* (65.41 * sin_Slope * sin_Slope + 4.56 * sin_Slope + 0.065);
+			}
+			else					// <= ca. 3�
+			{
+				LS	= pow (Area / 22.13, 3.0 * pow(Slope, 0.6))
+					* (65.41 * sin_Slope * sin_Slope + 4.56 * sin_Slope + 0.065);
+			}
+		}
+		break;
+	}
+
+	return( LS );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CErosion_LS_Fields::Get_Balance(void)
+{
+	CSG_Grid	*pBalance	= Parameters("BALANCE")->asGrid();
+
+	if( pBalance == NULL )
+	{
+		return( false );
+	}
+
+	DataObject_Set_Colors(pBalance, 11, SG_COLORS_RED_GREY_BLUE , false);
+
+	//-----------------------------------------------------
+	int		y;
+
+	CSG_Grid	dzSum(*Get_System(), SG_DATATYPE_Float);
+
+	//-----------------------------------------------------
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s 1"), _TL("Sediment Balance"), _TL("Pass")));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_Fields.is_NoData(x, y) )
+			{
+				int		ID	= m_Fields.asInt  (x, y);
+				double	z	= m_pDEM->asDouble(x, y), iz;
+				double	Sum	= 0.0;
+
+				for(int i=0; i<8; i++)
+				{
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( is_InGrid(ix, iy) && ID == m_Fields.asInt(ix, iy) && (iz = m_pDEM->asDouble(ix, iy)) < z )
+					{
+						Sum	+= atan((z - iz) / Get_Length(i));	// als Winkel !!!?
+					}
+				}
+
+				dzSum.Set_Value(x, y, Sum);
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+	Process_Set_Text(CSG_String::Format(SG_T("%s: %s 2"), _TL("Sediment Balance"), _TL("Pass")));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_Fields.is_NoData(x, y) )
+			{
+				int		ID	= m_Fields.asInt  (x, y);
+				double	z	= m_pDEM->asDouble(x, y), iz;
+				double	Sum	= -m_pLS->asDouble(x, y);
+
+				for(int i=0; i<8; i++)
+				{
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( is_InGrid(ix, iy) && ID == m_Fields.asInt(ix, iy) && dzSum.asDouble(ix, iy) > 0.0 && (iz = m_pDEM->asDouble(ix, iy)) > z )
+					{
+						iz	 = atan((z - iz) / Get_Length(i));	// als Winkel !!!?
+						Sum	+= (-iz / dzSum.asDouble(ix, iy)) * m_pLS->asDouble(ix, iy);
+					}
+				}
+
+				if( Sum > 0.0 )
+				{
+					z	=  log(1.0 + Sum);
+
+					pBalance->Set_Value (x, y, z >  5.0 ?  5.0 : z);
+				}
+				else if( Sum < 0.0 )
+				{
+					z	= -log(1.0 - Sum);
+
+					pBalance->Set_Value (x, y, z < -5.0 ? -5.0 : z);
+				}
+				else
+				{
+					pBalance->Set_NoData(x, y);
+				}
+			}
+			else
+			{
+				pBalance->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CErosion_LS_Fields::Get_Statistics(void)
+{
+	CSG_Shapes	*pFields		= Parameters("FIELDS"    )->asShapes();
+	CSG_Shapes	*pStatistics	= Parameters("STATISTICS")->asShapes();
+
+	//-----------------------------------------------------
+	if( !pStatistics || !pFields || m_nFields <= 0 || pFields->Get_Count() != m_nFields )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	int		i;
+
+	CSG_Simple_Statistics	*Statistics	= new CSG_Simple_Statistics[m_nFields];
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_pLS->is_NoData(x, y) && (i = m_Fields.asInt(x, y)) >= 0 && i < m_nFields )
+			{
+				Statistics[i]	+= m_pLS->asDouble(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	pStatistics->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pFields->Get_Name(), _TL("LS")));
+
+	pStatistics->Add_Field("NCELLS", SG_DATATYPE_Int   );
+	pStatistics->Add_Field("MEAN"  , SG_DATATYPE_Double);
+	pStatistics->Add_Field("MIN"   , SG_DATATYPE_Double);
+	pStatistics->Add_Field("MAX"   , SG_DATATYPE_Double);
+	pStatistics->Add_Field("STDDEV", SG_DATATYPE_Double);
+
+	for(i=0; i<pFields->Get_Count() && Set_Progress(i, pFields->Get_Count()); i++)
+	{
+		CSG_Shape	*pField	= pStatistics->Add_Shape(pFields->Get_Shape(i));
+
+		if( Statistics[i].Get_Count() > 0 )
+		{
+			pField->Set_Value(0, Statistics[i].Get_Count  ());
+			pField->Set_Value(1, Statistics[i].Get_Mean   ());
+			pField->Set_Value(2, Statistics[i].Get_Minimum());
+			pField->Set_Value(3, Statistics[i].Get_Maximum());
+			pField->Set_Value(4, Statistics[i].Get_StdDev ());
+		}
+		else for(int j=0; j<pFields->Get_Field_Count(); j++)
+		{
+			pField->Set_NoData(j);
+		}
+	}
+
+	//-------------------------------------------------
+	delete[](Statistics);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CErosion_LS_Fields::Set_Fields(void)
+{
+	CSG_Shapes	*pFields	= Parameters("FIELDS")->asShapes();
+
+	//-----------------------------------------------------
+	if( !pFields || pFields->Get_Count() <= 0 )
+	{
+		m_Fields.Create(*Get_System(), SG_DATATYPE_Char);
+	//	m_Fields.Set_NoData_Value(1.0);
+	//	m_Fields.Assign(0.0);
+
+		#pragma omp parallel for
+		for(int y=0; y<Get_NY(); y++)
+		{
+			for(int x=0; x<Get_NX(); x++)
+			{
+				if( !m_pDEM->is_InGrid(x, y) )
+				{
+					m_Fields.Set_NoData(x, y);
+				}
+			}
+		}
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Initializing Fields"));
+
+	m_nFields	= pFields->Get_Count();
+
+	m_Fields.Create(*Get_System(), m_nFields < pow(2.0, 16.0) - 1.0 ? SG_DATATYPE_Word : SG_DATATYPE_DWord);
+	m_Fields.Set_NoData_Value(m_nFields);
+	m_Fields.Assign_NoData();
+
+	//-----------------------------------------------------
+	for(int iField=0; iField<pFields->Get_Count() && Set_Progress(iField, pFields->Get_Count()); iField++)
+	{
+		CSG_Shape_Polygon	*pField	= (CSG_Shape_Polygon *)pFields->Get_Shape(iField);
+
+		int	xMin	= Get_System()->Get_xWorld_to_Grid(pField->Get_Extent().Get_XMin()) - 1; if( xMin <  0        ) xMin = 0;
+		int	xMax	= Get_System()->Get_xWorld_to_Grid(pField->Get_Extent().Get_XMax()) + 1; if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
+		int	yMin	= Get_System()->Get_yWorld_to_Grid(pField->Get_Extent().Get_YMin()) - 1; if( yMin <  0        ) yMin = 0;
+		int	yMax	= Get_System()->Get_yWorld_to_Grid(pField->Get_Extent().Get_YMax()) + 1; if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
+
+		for(int y=yMin; y<=yMax; y++)
+		{
+			for(int x=xMin; x<=xMax; x++)
+			{
+				if( m_pDEM->is_InGrid(x, y) && pField->Contains(Get_System()->Get_Grid_to_World(x, y)) )
+				{
+					m_Fields.Set_Value(x, y, iField);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Erosion_LS_Fields.h b/src/modules/terrain_analysis/ta_hydrology/Erosion_LS_Fields.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Erosion_LS_Fields.h
rename to src/modules/terrain_analysis/ta_hydrology/Erosion_LS_Fields.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow.cpp
new file mode 100644
index 0000000..08c4864
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow.cpp
@@ -0,0 +1,866 @@
+/**********************************************************
+ * Version $Id: Flow.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                       Flow.cpp                        //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow::CFlow(void)
+{
+	pCatch_AspectY	= NULL;
+	bPoint			= false;
+
+	//-----------------------------------------------------
+	Set_Description (_TW(
+		""
+	));
+
+
+	//-----------------------------------------------------
+	// Input...
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SINKROUTE"	, _TL("Sink Routes"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "WEIGHT"		, _TL("Weight"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "MATERIAL"	, _TL("Material"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "TARGET"		, _TL("Target"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);	
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Grid(
+		NULL	, "CAREA"		, _TL("Catchment Area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHEIGHT"		, _TL("Catchment Height"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CSLOPE"		, _TL("Catchment Slope"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ACCU_TOT"	, _TL("Total accumulated Material"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);	
+
+	Parameters.Add_Grid(
+		NULL	, "ACCU_LEFT"	, _TL("Accumulated Material from _left_ side"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);		
+
+	Parameters.Add_Grid(
+		NULL	, "ACCU_RIGHT"	, _TL("Accumulated Material from _right_ side"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);		
+	
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL	, "STEP"		, _TL("Step"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+}
+
+//---------------------------------------------------------
+CFlow::~CFlow(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow::Set_Point(int x, int y)
+{
+	bPoint	= true;
+	xPoint	= x;
+	yPoint	= y;
+}
+
+//---------------------------------------------------------
+bool CFlow::On_Execute(void)
+{
+	bool	bResult	= false;
+	sLong	n;
+	double	d;
+
+	//-------------------------------------------------
+	pDTM			= Parameters("ELEVATION")	->asGrid();
+	pRoute			= Parameters("SINKROUTE")	->asGrid();
+	pWeight			= Parameters("WEIGHT")		->asGrid();
+	pMaterial		= Parameters("MATERIAL")	->asGrid();
+	pTarget			= Parameters("TARGET")		->asGrid();
+
+	pCatch			= Parameters("CAREA")		->asGrid();
+	DataObject_Set_Colors(pCatch, 100, SG_COLORS_WHITE_BLUE);
+	pCatch_Height	= NULL;
+	pCatch_Slope	= NULL;
+	pCatch_Aspect	= NULL;
+	pFlowPath		= NULL;
+	pAccu_Tot		= NULL;
+	pAccu_Left		= NULL;
+	pAccu_Right		= NULL;
+
+	Step			= Parameters("STEP")		->asInt();
+
+	//-------------------------------------------------
+	On_Initialize();
+
+	//-------------------------------------------------
+	if( pCatch )
+	{
+		pCatch			->Assign(0.0);
+	}
+
+	if( pCatch_Height )
+	{
+		pCatch_Height	->Assign(0.0);
+	}
+
+	if( pCatch_Slope )
+	{
+		pCatch_Slope	->Assign(0.0);
+	}
+
+	if( pCatch_Aspect )
+	{
+		pCatch_Aspect	->Assign(0.0);
+		pCatch_AspectY	 = SG_Create_Grid(pCatch_Aspect);
+	}
+
+	if( pFlowPath )
+	{
+		pFlowPath		->Assign(0.0);
+	}
+
+	if( pAccu_Tot )
+	{
+		pAccu_Tot		->Assign(1.0);
+	}	
+
+	if( pAccu_Left )
+	{
+		pAccu_Left		->Assign(1.0);
+	}	
+
+	if( pAccu_Right )
+	{
+		pAccu_Right		->Assign(1.0);
+	}	
+	
+	//-------------------------------------------------
+	if( bPoint )
+	{
+		bPoint	= false;
+
+		if( is_InGrid(xPoint, yPoint) )
+		{
+			Calculate(xPoint, yPoint);
+
+			On_Finalize();
+
+			for(n=0; n<Get_NCells(); n++)
+			{
+				d	= pCatch->asDouble(n);
+				pCatch->Set_Value(n, 100.0 * d);
+			}
+
+			bResult		= true;
+		}
+	}
+	else
+	{
+		pCatch_Height	= Parameters("CHEIGHT")	->asGrid();
+		pCatch_Slope	= Parameters("CSLOPE")	->asGrid();
+		
+		pAccu_Tot		= Parameters("ACCU_TOT")	->asGrid();
+		pAccu_Left		= Parameters("ACCU_LEFT")	->asGrid();
+		pAccu_Right		= Parameters("ACCU_RIGHT")	->asGrid();
+		
+		Calculate();
+
+		On_Finalize();
+		Finalize();
+
+		bResult			= true;
+	}
+
+	//-------------------------------------------------
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow::Init_Cell(int x, int y)
+{
+	double	Weight, Material, Slope, Aspect;
+
+	Weight		= pWeight   ? pWeight  ->asDouble(x, y) : 1.0;
+	Material	= pMaterial ? pMaterial->asDouble(x, y) : 1.0;
+
+	if( pCatch )
+	{
+		pCatch			->Add_Value(x, y, Weight);
+	}
+
+	if( pCatch_Height )
+	{
+		pCatch_Height	->Add_Value(x, y, Weight * pDTM->asDouble(x, y));
+	}
+
+	if( pCatch_Slope )
+	{
+		Get_Gradient(x, y, Slope, Aspect);
+
+		pCatch_Slope	->Add_Value(x, y, Weight * Slope);
+	}
+
+	if( pCatch_Aspect && pCatch_AspectY )
+	{
+		Get_Gradient(x, y, Slope, Aspect);
+
+		pCatch_Aspect	->Add_Value(x, y, Weight * sin(Aspect));
+		pCatch_AspectY	->Add_Value(x, y, Weight * cos(Aspect));
+	}
+	
+	if( pAccu_Tot )
+	{
+		pAccu_Tot		->Set_Value(x, y, Weight * Material);
+	}	
+
+	if( pAccu_Left )
+	{
+		pAccu_Left		->Set_Value(x, y, Weight * Material);
+	}	
+
+	if( pAccu_Right )
+	{
+		pAccu_Right		->Set_Value(x, y, Weight * Material);
+	}	
+	
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow::Finalize(void)
+{
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( pDTM->is_NoData(n) )
+		{
+			if( pCatch )		{	pCatch			->Set_NoData(n);	}
+			if( pCatch_Height )	{	pCatch_Height	->Set_NoData(n);	}
+			if( pCatch_Slope )	{	pCatch_Slope	->Set_NoData(n);	}
+			if( pCatch_Aspect )	{	pCatch_Aspect	->Set_NoData(n);	}
+			if( pFlowPath )		{	pFlowPath		->Set_NoData(n);	}
+			if( pAccu_Tot )		{	pAccu_Tot		->Set_NoData(n);	}
+			if( pAccu_Left )	{	pAccu_Left		->Set_NoData(n);	}
+			if( pAccu_Right )	{	pAccu_Right		->Set_NoData(n);	}
+		}
+		else
+		{
+			//---------------------------------------------
+			double	Catch	= pCatch->asDouble(n);
+
+			if( pCatch )
+			{
+				pCatch	->Set_Value(n, Catch * Get_System()->Get_Cellarea());
+			}
+
+			if( Catch > 0.0 )
+			{
+				if( pCatch_Height )	{	pCatch_Height	->Set_Value(n, pCatch_Height->asDouble(n) / Catch - pDTM->asDouble(n));	}
+				if( pCatch_Slope )	{	pCatch_Slope	->Mul_Value(n, 1.0 / Catch);	}
+				if( pFlowPath )		{	pFlowPath		->Mul_Value(n, 1.0 / Catch);	}
+			}
+			else
+			{
+				if( pCatch_Height )	{	pCatch_Height	->Set_Value(n, pDTM->asDouble(n));	}
+				if( pCatch_Slope )	{	pCatch_Slope	->Set_Value(n, 0.0);	}
+				if( pFlowPath )		{	pFlowPath		->Set_Value(n, 0.0);	}
+			}
+
+			//---------------------------------------------
+			if( pCatch_Aspect && pCatch_AspectY )
+			{
+				double	G	= pCatch_Aspect	->asDouble(n);
+				double	H	= pCatch_AspectY->asDouble(n);
+
+				pCatch_Aspect	->Set_Value(n, G ? fmod(M_PI_270 + atan2(H, G), M_PI_360) : (H > 0 ? M_PI_270 : (H < 0 ? M_PI_090 : -1)));
+			}
+			
+			//---------------------------------------------
+			double	Material	= pMaterial ? pMaterial->asDouble(n) : 1.0;
+			double	Weight		= pWeight   ? pWeight  ->asDouble(n) : 1.0;
+
+			if( pAccu_Left && pTarget )
+			{
+				if( pTarget->is_NoData(n) )
+				{
+					pAccu_Left	->Set_NoData(n);
+				}
+				else
+				{
+					pAccu_Left	->Add_Value(n, - 0.5 * Weight * Material);
+				}
+			}
+			
+			if( pAccu_Right && pTarget )
+			{
+				if( pTarget->is_NoData(n) )
+				{	
+					pAccu_Right	->Set_NoData(n);
+				}
+				else
+				{
+					pAccu_Right	->Add_Value(n, - 0.5 * Weight * Material);
+				}
+			}			
+		}
+	}
+
+	//-----------------------------------------------------
+	if( pCatch_AspectY )
+	{
+		delete(pCatch_AspectY);
+
+		pCatch_AspectY	= NULL;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow::Get_Gradient(int x, int y, double &Slope, double &Aspect)
+{
+	pDTM->Get_Gradient(x, y, Slope, Aspect);
+}
+
+//---------------------------------------------------------
+
+///////////////////////////////////////////////////////////
+//		            SIDE-Algorithm                       //
+//					                                     //
+//              Copyright (c) 2010 by					 //
+//														 //
+//                  Thomas J. Grabs                      //
+//					                                     //
+//                                                       //
+//  website:       www.thomasgrabs.com                   //
+//					                                     //
+//            Updates and compiled versions of           //
+//           this algorithm can be found on the          //
+//                    author's website                   //
+//					                                     //
+//  Purpose:				                             //
+//	========				                             //
+//  Determine the side of a flow line relative to the    //
+//  (stream) flow direction in an adjacent grid cell     //
+//					                                     //
+//-------------------------------------------------------//
+//           !!!    PLEASE CITE    !!!                   //
+// the associated scientific article when redistributing //
+// and/or using and/or modifying this source code or     //
+// parts of it:                                          // 
+//                                                       //
+// "Calculating terrain indices along streams - a new    //
+//  method for separating stream sides,                  //
+//  Grabs, T. J. et al., published in Water Resources    //
+//  Research (WRR), please search the complete reference //
+// on the internet or on "http://www.agu.org/journals/wr"//
+//-------------------------------------------------------//
+//                                                       //
+// This source code is part of 'SAGA - System for        //
+// Automated Geoscientific Analyses'. You can            //
+// redistribute this source code 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.                                       //
+//                                                       //
+// The source code 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.                                                  //
+//														 //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+// List of variables:                                    //
+//														 //
+// x,y         : Coordinates of the grid cell containing //
+//			     the flow line.							 //
+// Direction   : Direction of the flow line				 //
+// left        : TRUE/FALSE depending on the location of //
+//			     the flow line.							 //
+// right       : TRUE/FALSE depending on the location of //
+//			     the flow line.							 //
+// FL_Dir      :  Direction of the flow line             //
+// stream1_Dir :  Streamflow direction                   //
+// stream2_Dir :  Streamflow direction (upstream)        //
+// stream1_X   :  X-coord. of stream grid cell           //
+// stream1_Y   :  Y-coord. of stream grid cell           //
+// stream2_X   :  X-coord. of (upstr.) stream grid cell  //
+// stream2_X   :  Y-coord. of (upstr.) stream grid cell  //
+// FL_Vec      :  Direction of flow line (as vector)     //
+// stream1_Vec :  Streamflow direction (as vector)       //
+// stream2_Vec :  Streamflow direction (as vector, upstr)//
+// SP          : Scalar product of 2 vectors             //
+// CP_A        : Cross product "A" of 2 vectors          //
+// CP_B        : Cross product "B" of 2 vectors          //
+// CP_C        : Cross product "C" of 2 vectors          //
+// Zcp_a       : Z component of the cross product "A"    //
+// Zcp_b       : Z component of the cross product "B"    //
+// Zcp_c       : Z component of the cross product "C"    //
+// a-z         : auxiliary variables                     //
+// NTributaries: Number of tributaries to a junction     //
+// prev_right  : auxiliary variable (true/false)         //
+// prev_left   : auxiliary variable (true/false)         //
+// is_upstream : auxiliary variable (true/false)         //
+//-------------------------------------------------------//
+//														 //
+// Conventions                                  		 //
+//-------------------------------------------------------//
+// left==true & right==false: Flow line is on the left   //
+// left==false & right==true: Flow line is on the right  //
+// left==true & right==true: The side of the flow line is//
+//                          not determined (channel head)//
+//                           or lies between             //
+//                           tributaries to a junction   //
+///////////////////////////////////////////////////////////
+
+void CFlow::Find_Sides(int x, int y, int Direction, bool &left, bool &right)
+{
+	int			FL_Dir, stream1_Dir, stream2_Dir;
+	int			stream1_X, stream1_Y;
+	int			stream2_X, stream2_Y;
+	CSG_Vector	FL_Vec(3), stream1_Vec(3), stream2_Vec(3);
+	CSG_Vector  CP_A(3), CP_B(3), CP_C(3); 
+	double		SP;
+	double		Zcp_a, Zcp_b, Zcp_c;
+
+	// Initialize the stream side variables to their default. 
+	// Default: The side of the flow line is not determined.
+	left = right = true;
+				
+    // Determine the coordinates and stream direction the adjacent
+	// grid cell, to which the flow line points.
+	FL_Dir		        = Direction;
+	stream1_X			= Get_xTo( FL_Dir, x );
+	stream1_Y			= Get_yTo( FL_Dir, y );
+	stream1_Dir			= pTarget->asInt(stream1_X, stream1_Y);
+
+	/*--Note: At this point it is already assumed that FL_Dir points to 
+	    a grid cell that belongs to the stream network. Thus, stream1_X,
+		stream1_Y and stream1_Dir have all non-missing values. If the code
+		is to be used elsewhere, one should verify that FL_Dir points to
+		a grid cell that belongs to the stream network.--*/
+	
+	// Write the direction of the flow line as vector:
+	FL_Vec[0]	= Get_xTo( FL_Dir );
+	FL_Vec[1]	= Get_yTo( FL_Dir );
+	FL_Vec[2]	= 0.0; //z-component is normally 0
+	
+	// Write the streamflow directon as vector:
+	stream1_Vec[0]		= Get_xTo( stream1_Dir );
+	stream1_Vec[1]		= Get_yTo( stream1_Dir );
+	stream1_Vec[2]		= 0.0;//z-component is normally 0
+
+	// Initialize the upstream streamflow direction vector
+	// and set all components to zero 
+	stream2_Vec[0]		= 0.0;
+	stream2_Vec[1]		= 0.0;
+	stream2_Vec[2]		= 0.0;
+	
+	// Calculate the scalar product
+	SP					= FL_Vec[0] * stream1_Vec[0] + FL_Vec[1] * stream1_Vec[1];
+	
+	// Adjust the scalar product by dividing it by the lengths of FL_Vec and stream1_Vec
+	SP = SP /sqrt( FL_Vec[0]*FL_Vec[0] + FL_Vec[1]*FL_Vec[1])
+			/sqrt(stream1_Vec[0]*stream1_Vec[0] + stream1_Vec[1]*stream1_Vec[1]);
+
+
+	if( fabs(SP - (-1)) < 0.00001)
+	{
+		// SP is (approximately) equal to -1! 
+		// The flow line is hence oriented opposite to the streamflow direction.
+		// Further calculations are skipped: The side of the flow line remains the default.
+		// This can occur if an endpoint of the streamflow direction map does *not*
+		// point to a missing value. In other words, the stream outlet lies 'inside' the 
+		// DEM and not right on the border of the DEM.
+		// Since this can be intentional, a user notification is only optional.
+
+		/*-- (optional) Notification of the user  --*/
+	}
+	else
+	{
+		/*--  Core of the SIDE-Algorithm  --*/
+
+		int		NTributaries;
+		bool	prev_right, prev_left;
+		bool	is_upstream;
+		
+		// Initialize the number of tributaries and other auxiliary variables
+		NTributaries = 0; //default: channel head
+		prev_right = prev_left = true;
+		is_upstream= false;
+					
+		// The full vector-cross-product of the streamflow direction and the flow line direction
+		// CP_A				= FL_Vec * stream1_Vec;
+		// is not calculated because it is more efficient to calculate only the z-component 
+		// of the cross-product:
+		
+		Zcp_a	= FL_Vec[0]*stream1_Vec[1] - FL_Vec[1]*stream1_Vec[0];
+
+		// Look for upstream tributaries / stream grid cells
+		for(int i=0; i<8; i++)
+		{
+			// find adjacent grid cell coordinates
+			stream2_X =  Get_xTo(i, stream1_X);
+			stream2_Y =  Get_yTo(i, stream1_Y);
+			
+			// Make sure it is within the map domain
+			if( is_InGrid(stream2_X, stream2_Y)	)
+			{
+				// Make sure it is not a missing-value
+				if ( ! pTarget->is_NoData( stream2_X, stream2_Y ) )
+				{
+					// Is the stream cell an upstream tributary?
+					stream2_Dir = pTarget->asInt(stream2_X, stream2_Y);
+					is_upstream = stream1_X == Get_xTo(stream2_Dir, stream2_X) && 
+									stream1_Y == Get_yTo(stream2_Dir, stream2_Y);
+								
+					if( is_upstream )
+					{
+						// The stream cell is an upstream tributary!
+						NTributaries++;
+						
+						// Convert the upstream streamflow direction to a vector
+						stream2_Vec[0]	= Get_xTo( stream2_Dir );
+						stream2_Vec[1]	= Get_yTo( stream2_Dir );
+						stream2_Vec[2]	= 0.0;
+						
+						//Calculate only z-component of the vector-cross-product
+						Zcp_b			= FL_Vec[0]*stream2_Vec[1] - FL_Vec[1]*stream2_Vec[0];
+						
+						//store the previous position of the flow line
+						prev_right		= right;
+						prev_left		= left;
+
+						// Test if Z components have the same sign
+						// Note that posing the condition "( Zcp_a * Zcp_b >= 0 && Zcp_b != 0)"
+						// and evaluating the sign of *only* Zcp_b
+						// is *equivalent* but presumably a tiny bit more efficient
+						// than  testing "( Zcp_a * Zcp_b > 0)"
+						// and evaluating the sign of Zcp_a *or* Zcp_b
+						// If you prefer to follow exactly the description in the WRR-article, simply
+						// replace "( Zcp_a * Zcp_b >= 0 && Zcp_b != 0)" by "(Zcp_a * Zcp_b > 0)"
+						// and it'll still work.
+						if ( Zcp_a * Zcp_b >= 0 && Zcp_b != 0)
+						{
+							//Case1: Zcp_a and Zcp_b have the same sign, thus the position of the flow  
+							//line is the same for both stream grid cells
+							//Case2: Zcp_a is zero but Zcp_b is not zero, the position of the flow line
+							//can simply be determined from the sign of Zcp_b
+							right = (Zcp_b < 0);
+							left  = !right;
+						}
+						else
+						{
+							//Since Zcp_a and Zcp_b have opposite signs (or Zcp_b is zero), the flow line
+							//is located at a sharp bend. 
+
+							//Calculate only z-component of the vector-cross-product
+							Zcp_c	= stream1_Vec[0]*stream2_Vec[1] - stream1_Vec[1]*stream2_Vec[0];
+							
+
+							right = (Zcp_c < 0);
+							left  = !right;
+						}													
+						if ( NTributaries > 1 && (right != prev_right) )
+						{
+							//It is a junction (NTributaries > 1) and the flow line lies between
+							//two tributaries
+							left = right = true;
+							//Set i to 9 in order to exit the loop (there is no use in checking
+							//for more potential tributaries since the flow line will always lie 
+							//between two tributaries
+							i = 9;
+						}
+					}
+				}
+			}		
+		}
+	}	
+}
+
+
+//---------------------------------------------------------
+void CFlow::Add_Fraction(int x, int y, int Direction, double Fraction)
+{
+	int		ix, iy;
+
+	if( is_InGrid(x, y) )
+	{
+		ix	= Get_xTo(Direction, x);
+		iy	= Get_yTo(Direction, y);
+		
+		if( is_InGrid(ix, iy) )
+		{
+			if( pCatch )
+			{
+				pCatch			->Add_Value(ix, iy, Fraction * pCatch			->asDouble(x, y));
+			}
+
+			if( pCatch_Height )
+			{
+				pCatch_Height	->Add_Value(ix, iy, Fraction * pCatch_Height	->asDouble(x, y));
+			}
+
+			if( pCatch_Slope )
+			{
+				pCatch_Slope	->Add_Value(ix, iy, Fraction * pCatch_Slope		->asDouble(x, y));
+			}
+
+			if( pFlowPath )
+			{
+				pFlowPath		->Add_Value(ix, iy, Fraction * (pFlowPath		->asDouble(x, y) + Get_Length(Direction)));
+			}
+
+			if( pCatch_Aspect && pCatch_AspectY )
+			{
+				pCatch_Aspect	->Add_Value(ix, iy, Fraction * pCatch_Aspect	->asDouble(x, y));
+				pCatch_AspectY	->Add_Value(ix, iy, Fraction * pCatch_AspectY	->asDouble(x, y));
+			}
+			
+			if( !pTarget )
+			{
+				if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, Fraction * pAccu_Tot ->asDouble(x, y));
+				if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, Fraction * pAccu_Left ->asDouble(x, y));
+				if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, Fraction * pAccu_Right ->asDouble(x, y));				
+			}
+			
+			if( pTarget ) if( pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y) )
+			{
+				if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, Fraction * pAccu_Tot ->asDouble(x, y));
+				if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, Fraction * pAccu_Left ->asDouble(x, y));
+				if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, Fraction * pAccu_Right ->asDouble(x, y));				
+			}
+			
+
+			if( pTarget ) if( !pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y))
+			{
+				
+				bool left, right;
+
+				Find_Sides(x, y, Direction, left, right);
+			
+				if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, Fraction * pAccu_Tot ->asDouble(x, y));
+				
+				if( right && !left && pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, Fraction * pAccu_Right ->asDouble(x, y));
+				
+				if( left && !right && pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, Fraction * pAccu_Left ->asDouble(x, y));
+				
+				if( left && right )
+				{
+					if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, 0.5 * Fraction * pAccu_Right ->asDouble(x, y));
+
+					if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, 0.5 * Fraction * pAccu_Left ->asDouble(x, y));			
+				}				
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFlow::Add_Portion(int x, int y, int ix, int iy, int Direction)
+{
+	if( is_InGrid(x, y) && is_InGrid(ix, iy) )
+	{
+		
+		if( pCatch )
+		{
+			pCatch			->Add_Value(ix, iy, pCatch			->asDouble(x, y));
+		}
+
+		if( pCatch_Height )
+		{
+			pCatch_Height	->Add_Value(ix, iy, pCatch_Height	->asDouble(x, y));
+		}
+
+		if( pCatch_Slope )
+		{
+			pCatch_Slope	->Add_Value(ix, iy, pCatch_Slope	->asDouble(x, y));
+		}
+
+		if( pFlowPath )
+		{
+			pFlowPath		->Add_Value(ix, iy, pFlowPath		->asDouble(x, y));
+		}
+
+		if( pCatch_Aspect && pCatch_AspectY )
+		{
+			pCatch_Aspect	->Add_Value(ix, iy, pCatch_Aspect	->asDouble(x, y));
+			pCatch_AspectY	->Add_Value(ix, iy, pCatch_AspectY	->asDouble(x, y));
+		}
+		
+		if( pTarget ) if( pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y) )
+		{
+			if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, pAccu_Tot ->asDouble(x, y));
+			if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, pAccu_Left ->asDouble(x, y));
+			if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, pAccu_Right ->asDouble(x, y));				
+		}
+		if( pTarget ) if( !pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y))
+			{
+				
+				bool left, right;
+
+				Find_Sides(x, y, Direction, left, right);
+					
+				if( pAccu_Tot )pAccu_Tot -> Add_Value(ix, iy, pAccu_Tot->asDouble(x, y));
+				
+				if( right && !left && pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, pAccu_Right->asDouble(x, y));
+				
+				if( left && !right && pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, pAccu_Left->asDouble(x, y));
+				
+				if( left && right )
+				{
+					if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, 0.5 * pAccu_Right->asDouble(x, y));
+					if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, 0.5 * pAccu_Left->asDouble(x, y));			
+				}
+				
+			}		
+		
+	}
+}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.h b/src/modules/terrain_analysis/ta_hydrology/Flow.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/FlowDepth.cpp b/src/modules/terrain_analysis/ta_hydrology/FlowDepth.cpp
new file mode 100644
index 0000000..738456c
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/FlowDepth.cpp
@@ -0,0 +1,358 @@
+/**********************************************************
+ * Version $Id: FlowDepth.cpp 1016 2011-04-27 18:40:36Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    FlowDepth.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "FlowDepth.h"
+#include "Helper.h"
+
+#define NO_DEPTH -1
+
+CFlowDepth::CFlowDepth(void){
+
+	Parameters.Set_Name(_TL("Flow Depth"));
+	Parameters.Set_Description(_TW(
+		"(c) 2004 by Victor Olaya. Flow Depth Calculation \r\n"
+		"References:\r\n 1. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"));
+
+	Parameters.Add_Grid(NULL, 
+						"DEM", 
+						_TL("Elevation Grid"), 
+						_TL(""), 
+						PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL, 
+						"FLOWDEPTH", 
+						_TL("Flow Depth Grid (m)"), 
+						_TL(""), 
+						PARAMETER_OUTPUT, 
+						true, 
+						SG_DATATYPE_Float);
+
+	Parameters.Add_Value(NULL,
+						"THRESHOLD",
+						_TL("Channel definition threshold"),
+						_TL("Channel definition threshold"),
+						PARAMETER_TYPE_Double,
+						10000.);
+
+	Parameters.Add_Value(NULL,
+						"FLOW",
+						_TL("Peak Flow (m3/s)"),
+						_TL("Peak Flow (m3/s) at selected outlet cell"),
+						PARAMETER_TYPE_Double,
+						100.);
+
+}//constructor
+
+
+CFlowDepth::~CFlowDepth(void){
+}
+
+bool CFlowDepth::On_Execute(void){
+		
+	m_pDEM			= Parameters("DEM")			->asGrid(); 
+	m_pFlowDepth	= Parameters("FLOWDEPTH")	->asGrid();
+	m_dThreshold	= Parameters("THRESHOLD")	->asDouble();
+	m_dFlow			= Parameters("FLOW")		->asDouble();
+
+	m_pCatchArea	= SG_Create_Grid(m_pDEM, SG_DATATYPE_Float);
+	m_pBasinGrid	= SG_Create_Grid(m_pDEM, SG_DATATYPE_Int);
+	m_pSlope		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Float);
+	m_pAspect		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Float);
+
+	m_pFlowDepth->Set_NoData_Value(0.);
+
+	Process_Set_Text(_TL("Calculating Catchment Area..."));
+	CalculateFlowAccGrid(m_pCatchArea, m_pDEM);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{		
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	slope, aspect;
+
+			if( m_pDEM->Get_Gradient(x, y, slope, aspect) )
+			{
+				m_pSlope	->Set_Value(x, y, slope);
+				m_pAspect	->Set_Value(x, y, aspect);
+			}
+			else
+			{
+				m_pSlope	->Set_NoData(x, y);
+				m_pAspect	->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	DataObject_Update(m_pFlowDepth, true);
+
+	return true;
+
+}//method
+
+bool CFlowDepth::On_Execute_Finish(){
+
+	delete m_pSlope;
+	delete m_pAspect;
+	delete m_pBasinGrid;
+	delete m_pCatchArea;
+
+	return true;
+
+}//method
+
+bool CFlowDepth::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode){	
+
+	int iX, iY;	
+	int iNextX, iNextY;
+	int x,y;
+	int iOutletX, iOutletY;
+	double fArea;
+	double fDepth, fPreviousDepth = 0;
+
+	if(	Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iOutletX, iOutletY) )
+	{
+		return( false );
+	}
+
+	m_pFlowDepth->Assign((double)0);
+
+	fArea = m_pCatchArea->asFloat(iOutletX, iOutletY);
+	
+	if (fArea < m_dThreshold * 2.){ //check outlet point
+		iNextX = iOutletX;
+		iNextY = iOutletY;
+		do{
+			iOutletX = iNextX;
+			iOutletY = iNextY;
+			getNextCell(m_pDEM, iOutletX, iOutletY, iNextX, iNextY);
+		}while (m_pCatchArea->asFloat(iOutletX, iOutletY) < m_dThreshold * 2. &&
+				(iOutletX != iNextX || iOutletY != iNextY));
+			
+		if (m_pCatchArea->asFloat(iOutletX, iOutletY) < m_dThreshold * 2.){
+			Message_Add(_TL("** Error : Wrong outlet point selected **"));
+			return false;
+		}//if
+		Message_Add(_TL("** Warning : Outlet point was modified **"));
+    }//if
+
+	CalculateBasinGrid(m_pBasinGrid, m_pDEM, iOutletX, iOutletY);
+
+	m_fMaxFlowAcc = m_pCatchArea->asFloat(iOutletX, iOutletY);		
+    
+    for(y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(x=0; x<Get_NX(); x++){
+			if (m_pCatchArea->asFloat(x,y) > m_dThreshold){
+				if (isHeader(x,y)){					
+					iNextX = x;
+					iNextY = y;
+					do {
+						iX = iNextX;
+						iY = iNextY;
+						if (m_pFlowDepth->asFloat(iX,iY) == 0. && m_pBasinGrid->asInt(iX, iY) != 0){
+							getNextCell(m_pDEM, iX, iY, iNextX, iNextY);
+							fDepth = CalculateFlowDepth(iX,iY);
+							if (fDepth == NO_DEPTH){
+								m_pFlowDepth->Set_Value(iX,iY, fPreviousDepth);
+							}//if
+							else{
+								fPreviousDepth = fDepth;
+							}//else
+						}//if
+					}while ((iX != iOutletX || iY != iOutletY)
+							&& (iX != iNextX || iY != iNextY));
+				}//if
+			}//if
+		}//for
+	}// for
+
+	DataObject_Update(m_pFlowDepth);
+
+	return true;
+
+}//method
+
+bool CFlowDepth::isHeader(int iX, int iY){
+
+    int iNextX, iNextY;
+	
+    for (int i = -1; i < 2; i++) {
+        for (int j = -1; j < 2; j++) {
+			if (m_pCatchArea->is_InGrid(iX+i,iY+j)){
+				if (m_pCatchArea->asFloat(iX+i,iY+j) > m_dThreshold && (i!=0 || j!=0)){
+					getNextCell(m_pDEM, iX + i, iY + j, iNextX, iNextY);
+					if (iNextX == iX && iNextY == iY) {
+						return false;
+					}//if
+				}// if
+			}//if
+        }// for
+    }// for
+
+    return true;
+		
+}// method
+
+double CFlowDepth::CalculateFlowDepth(int iX, int iY){
+
+	int iIter=0;
+	double fSup, fInf;
+	double fH;
+	double fDif;
+	double fArea;
+	double fPerim;
+	double fFlow = m_dFlow / m_fMaxFlowAcc * m_pCatchArea->asFloat(iX,iY);
+	double fSlope = tan(m_pSlope->asFloat(iX,iY));
+	bool bReturn = false;
+		
+	fSup = 100;
+	fInf = 0;
+	fH = 1;
+	
+	while (!bReturn  && fH >= 0.00001){
+		bReturn = getWetAreaAndPerimeter(iX, iY, fH, fArea, fPerim);
+		fH /= 2.0;
+	}		
+	
+	if (bReturn){
+		fDif = (sqrt(fSlope) * pow(fArea, 5.0 / 3.0)
+				/ pow(fPerim, 2.0 / 3.0) / 0.035) - fFlow;
+		do {
+			iIter++;
+			if (fDif > 0) {
+				fSup = fH;
+				fH = (fInf + fH) / 2.0;
+			}// if
+			else if (fDif < 0) {
+				fInf = fH;
+				fH = (fSup + fH) / 2.0;
+			}// else if
+			bReturn = getWetAreaAndPerimeter(iX, iY, fH, fArea, fPerim);		
+			if (!bReturn){
+				return NO_DEPTH;
+			}//if
+			if (iIter>20){
+				return NO_DEPTH;
+			}//if
+			fDif = (sqrt(fSlope) * pow(fArea, 5.0 / 3.0)
+				/ pow(fPerim, 2.0 / 3.0) / 0.035) - fFlow;
+		}while (fabs(fDif) > 0.1); 
+	}//if
+	else{
+		return NO_DEPTH;
+	}//else
+	
+	m_pFlowDepth->Set_Value(iX,iY,fH);
+
+	return fH;
+
+}//method
+
+bool CFlowDepth::getWetAreaAndPerimeter(int iX, 
+									 int iY, 
+									 double fH, 
+									 double &fArea, 
+									 double &fPerim){
+
+	int iWidth = 0;
+	int iX2, iY2;
+	int iX3, iY3;
+	int i = 0;	
+	int iStepX, iStepY;
+	int pStepX[4] = {1,1,0,1};
+	int pStepY[4] = {0,-1,1,1};
+	int iDir = (m_pAspect->asInt(iX, iY,true) / 45) % 4;
+	double fDist;
+	double fLocalDist;
+	double fBaseHeight = m_pDEM->asFloat(iX, iY);	
+	double fPerimLeft = 0;
+	double fAreaLeft = 0;
+	double fPerimRight = 0;
+	double fAreaRight = 0;
+	double fHeightDif;
+	double fLocalHeightDif;
+	
+	iStepY = pStepX[iDir]; 
+	iStepX = pStepY[iDir]; 
+	
+	fDist = M_GET_LENGTH(iStepX, iStepY) * m_pDEM->Get_Cellsize();
+	
+	do{
+		iX2 = iX + iStepX * i;
+		iY2 = iY + iStepY * i;
+		iX3 = iX + iStepX * (i+1);
+		iY3 = iY + iStepY * (i+1);	
+		if (m_pDEM->is_InGrid(iX2,iY2) && m_pDEM->is_InGrid(iX3,iY3)){
+			fHeightDif = m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX,iY);
+			if (fHeightDif >= fH){
+				fLocalHeightDif = fabs(m_pDEM->asFloat(iX,iY) + fH - m_pDEM->asFloat(iX2,iY2));
+				fLocalDist = fabs(fDist * fLocalHeightDif 
+							/ (m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2)));
+			}//if
+			else{
+				fLocalHeightDif = fabs(m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2));
+				fLocalDist = fDist;
+			}//else
+			fPerimLeft += sqrt(fLocalDist * fLocalDist + fLocalHeightDif * fLocalHeightDif);
+			fAreaLeft += (i * fLocalHeightDif + fLocalHeightDif * fLocalDist / 2.);
+		}//if
+		else{
+			return false;
+		}//else
+		i++;
+	}while(fHeightDif < fH);
+	
+	i = 0;
+	do{
+		iX2 = iX - iStepX * i;
+		iY2 = iY - iStepY * i;
+		iX3 = iX - iStepX * (i+1);
+		iY3 = iY - iStepY * (i+1);	
+		if (m_pDEM->is_InGrid(iX2,iY2) && m_pDEM->is_InGrid(iX3,iY3)){
+			fHeightDif = m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX,iY);
+			if (fHeightDif >= fH){
+				fLocalHeightDif = fabs(m_pDEM->asFloat(iX,iY) + fH - m_pDEM->asFloat(iX2,iY2));
+				fLocalDist = fabs(fDist * fLocalHeightDif 
+							/ (m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2)));
+			}//if
+			else{
+				fLocalHeightDif = fabs(m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2));
+				fLocalDist = fDist;
+			}//else
+			fPerimLeft += sqrt(fLocalDist * fLocalDist + fLocalHeightDif * fLocalHeightDif);
+			fAreaLeft += (i * fLocalHeightDif + fLocalHeightDif * fLocalDist / 2.);
+		}//if
+		else{
+			return false;
+		}//else
+		i++;
+	}while(fHeightDif < fH);
+	
+	fArea = fAreaLeft + fAreaRight;
+	fPerim = fPerimLeft +fPerimRight; 
+
+	return true;
+
+}//method
+
+
+
diff --git a/src/modules/terrain_analysis/ta_hydrology/FlowDepth.h b/src/modules/terrain_analysis/ta_hydrology/FlowDepth.h
new file mode 100644
index 0000000..4a4d00b
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/FlowDepth.h
@@ -0,0 +1,60 @@
+/**********************************************************
+ * Version $Id: FlowDepth.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    IsochronesConst.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CFlowDepth : public CSG_Module_Grid_Interactive
+{
+public:
+	CFlowDepth(void);
+	virtual ~CFlowDepth(void);	
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
+
+	bool isHeader(int,int);
+	double CalculateFlowDepth(int,int);
+	//void MarkBuffer(int,int,double);
+	bool getWetAreaAndPerimeter(int,int,double,double&,double&);
+
+
+protected:
+	virtual bool On_Execute(void);
+	virtual bool On_Execute_Finish();
+	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+
+
+private:
+	CSG_Grid *m_pDEM;
+	CSG_Grid *m_pFlowDepth;
+	CSG_Grid *m_pCatchArea;	
+	CSG_Grid *m_pSlope;
+	CSG_Grid *m_pAspect;
+	CSG_Grid *m_pBasinGrid;
+	double m_fMaxFlowAcc;
+	double m_dThreshold;
+	double m_dFlow;
+
+};
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_AreaDownslope.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.cpp
rename to src/modules/terrain_analysis/ta_hydrology/Flow_AreaDownslope.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h b/src/modules/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp
new file mode 100644
index 0000000..b5cfed9
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp
@@ -0,0 +1,601 @@
+/**********************************************************
+ * Version $Id: Flow_AreaUpslope.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 Flow_AreaUpslope.cpp                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow_AreaUpslope.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_AreaUpslope::CFlow_AreaUpslope(void)
+{
+	m_pDTM		= NULL;
+	m_pRoute	= NULL;
+	m_pFlow		= NULL;
+}
+
+//---------------------------------------------------------
+CFlow_AreaUpslope::~CFlow_AreaUpslope(void)
+{
+	Finalise();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CFlow_AreaUpslope::Get_Description(void)
+{
+	return(
+		_TW(
+			"This module allows you to specify target cells, "
+			"for which the upslope contributing area shall be identified. "
+			"The result will give "
+			"for each cell the percentage of its flow that reaches the target cell(s).\n\n"
+
+			"References:\n\n"
+
+			"Deterministic 8\n"
+			"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
+			"    'The extraction of drainage networks from digital elevation data',\n"
+			"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
+
+			"Deterministic Infinity:\n"
+			"- Tarboton, D.G. (1997):\n"
+			"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
+			"    Water Resources Research, Vol.33, No.2, p.309-319\n\n"
+
+			"Multiple Flow Direction:\n"
+			"- Freeman, G.T. (1991):\n"
+			"    'Calculating catchment area with divergent flow based on a regular grid',\n"
+			"    Computers and Geosciences, 17:413-22\n\n"
+
+			"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
+			"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
+			"    Hydrological Processes, 5:59-79\n\n"
+		)
+	);
+}
+
+//---------------------------------------------------------
+CSG_String CFlow_AreaUpslope::Get_Methods(void)
+{
+	return( CSG_String::Format(SG_T("%s|%s|%s|"),
+		_TL("Deterministic 8"),
+		_TL("Deterministic Infinity"),
+		_TL("Multiple Flow Direction")
+	));
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope::Initialise(int Method, CSG_Grid *pDTM, CSG_Grid *pRoute, CSG_Grid *pFlow, double MFD_Converge)
+{
+	Finalise();
+
+	if( pDTM && pDTM->is_Valid() && pFlow && pFlow->is_Valid() && pFlow->Get_System() == pDTM->Get_System() )
+	{
+		m_Method		= Method;
+		m_pDTM			= pDTM;
+		m_pFlow			= pFlow;
+		m_MFD_Converge	= MFD_Converge;
+
+		if( pRoute && pRoute->is_Valid() && pRoute->Get_System() == pDTM->Get_System() )
+		{
+			m_pRoute	= pRoute;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope::Finalise(void)
+{
+	m_pDTM		= NULL;
+	m_pRoute	= NULL;
+	m_pFlow		= NULL;
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope::Add_Target(int x, int y)
+{
+	if( m_pFlow && m_pFlow->is_InGrid(x, y, false) )
+	{
+		m_pFlow->Set_Value(x, y, 100.0);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope::Clr_Target(void)
+{
+	if( m_pFlow )
+	{
+		m_pFlow->Assign(0.0);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope::Get_Area(int x, int y)
+{
+	return( Clr_Target() && Add_Target(x, y) && Get_Area() );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope::Get_Area(void)
+{
+	sLong	i;
+	int		x, y;
+
+	if( m_pDTM && m_pFlow )
+	{
+		for(i=0; i<m_pDTM->Get_NCells() && SG_UI_Process_Set_Progress((double)i, (double)m_pDTM->Get_NCells()); i++)
+		{
+			if( m_pDTM->Get_Sorted(i, x, y, false) &&  m_pFlow->asDouble(x, y) > 0.0 )
+			{
+				break;
+			}
+		}
+
+		for(i++; i<m_pDTM->Get_NCells() && SG_UI_Process_Set_Progress((double)i, (double)m_pDTM->Get_NCells()); i++)
+		{
+			if( m_pDTM->Get_Sorted(i, x, y, false) && m_pFlow->asDouble(x, y) <= 0.0 )
+			{
+				Set_Value(x, y);
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_AreaUpslope::Set_Value(int x, int y)
+{
+	int		i;
+
+	if( m_pRoute && (i = m_pRoute->asChar(x, y)) >= 0 )
+	{
+		int		ix, iy;
+		double	Flow;
+
+		ix	= m_pDTM->Get_System().Get_xTo(i, x);
+		iy	= m_pDTM->Get_System().Get_yTo(i, y);
+
+		if( m_pDTM->is_InGrid(ix, iy, true) && (Flow = m_pFlow->asDouble(ix, iy)) > 0.0 )
+		{
+			m_pFlow->Set_Value(x, y, Flow);
+		}
+	}
+	else if( !m_pDTM->is_NoData(x, y) )
+	{
+		switch( m_Method )
+		{
+		case 0:	Set_D8		(x, y);	break;
+		case 1:	Set_DInf	(x, y);	break;
+		case 2:	Set_MFD		(x, y);	break;
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_AreaUpslope::Set_D8(int x, int y)
+{
+	int		i;
+
+	if( (i = m_pDTM->Get_Gradient_NeighborDir(x, y, true)) >= 0 )
+	{
+		int		ix, iy;
+		double	Flow;
+
+		ix	= m_pDTM->Get_System().Get_xTo(i, x);
+		iy	= m_pDTM->Get_System().Get_yTo(i, y);
+
+		if( m_pDTM->is_InGrid(ix, iy, true) && (Flow = m_pFlow->asDouble(ix, iy)) > 0.0 )
+		{
+			m_pFlow->Set_Value(x, y, Flow);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_AreaUpslope::Set_DInf(int x, int y)
+{
+	double	Slope, Aspect;
+
+	if( m_pDTM->Get_Gradient(x, y, Slope, Aspect) )	// && Aspect >= 0.0 )
+	{
+		int		i, ix, iy, jx, jy;
+		double	Flow;
+
+		i		= (int)(Aspect / M_PI_045);
+		ix		= m_pDTM->Get_System().Get_xTo(i, x);
+		iy		= m_pDTM->Get_System().Get_yTo(i, y);
+
+		i++;
+		jx		= m_pDTM->Get_System().Get_xTo(i, x);
+		jy		= m_pDTM->Get_System().Get_yTo(i, y);
+
+		if(	m_pDTM->is_InGrid(ix, iy) && m_pDTM->asDouble(ix, iy) < m_pDTM->asDouble(x, y)
+		&&	m_pDTM->is_InGrid(jx, jy) && m_pDTM->asDouble(jx, jy) < m_pDTM->asDouble(x, y) )
+		{
+			Aspect	= fmod(Aspect,  M_PI_045) / M_PI_045;
+
+			Flow	= m_pFlow->asDouble(ix, iy) * (1.0 - Aspect)
+					+ m_pFlow->asDouble(jx, jy) * (      Aspect);
+
+			if( Flow > 0.0 )
+			{
+				m_pFlow->Set_Value(x, y, Flow);
+			}
+
+			return;
+		}
+	}
+
+	Set_D8(x, y);
+}
+
+//---------------------------------------------------------
+void CFlow_AreaUpslope::Set_MFD(int x, int y)
+{
+	int		i, ix, iy;
+	double	z, d, f, dzSum, dz[8];
+
+	for(i=0, dzSum=0.0, z=m_pDTM->asDouble(x, y); i<8; i++)
+	{
+		dz[i]	= 0.0;
+
+		ix		= m_pDTM->Get_System().Get_xTo(i, x);
+		iy		= m_pDTM->Get_System().Get_yTo(i, y);
+
+		if( m_pDTM->is_InGrid(ix, iy) && (d = z - m_pDTM->asDouble(ix, iy)) > 0.0 )
+		{
+			dzSum	+= (d = pow(d / m_pDTM->Get_System().Get_Length(i), m_MFD_Converge));
+
+			if( (f = m_pFlow->asDouble(ix, iy)) > 0.0 )
+			{
+				dz[i]	= d * f;
+			}
+		}
+	}
+
+	if( dzSum > 0.0 )
+	{
+		for(i=0, d=0.0; i<8; i++)
+		{
+			if( dz[i] > 0.0 )
+			{
+				d	+= dz[i] / dzSum;
+			}
+		}
+
+		m_pFlow->Set_Value(x, y, d);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_AreaUpslope_Interactive::CFlow_AreaUpslope_Interactive(void)
+{
+	Set_Name		(_TL("Upslope Area"));
+	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
+
+	Set_Description	(CSG_String::Format(SG_T("%s_______\n%s"), m_Calculator.Get_Description().c_str(),
+		_TL("Interactive version (left mouse clicks will trigger the calculation for the selected cell).")
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SINKROUTE"	, _TL("Sink Routes"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "AREA"		, _TL("Upslope Area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		m_Calculator.Get_Methods(), 2
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CONVERGE"	, _TL("Convergence"),
+		_TL("Convergence factor for Multiple Flow Direction algorithm"),
+		PARAMETER_TYPE_Double	, 1.1, 0.001, true
+	);
+}
+
+//---------------------------------------------------------
+CFlow_AreaUpslope_Interactive::~CFlow_AreaUpslope_Interactive(void)
+{}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope_Interactive::On_Execute(void)
+{
+	if( m_Calculator.Initialise(
+		Parameters("METHOD")	->asInt(),
+		Parameters("ELEVATION")	->asGrid(),
+		Parameters("SINKROUTE")	->asGrid(),
+		Parameters("AREA")		->asGrid(),
+		Parameters("CONVERGE")	->asDouble()	) )
+	{
+		DataObject_Set_Colors(Parameters("AREA")->asGrid(), 100, SG_COLORS_WHITE_BLUE);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope_Interactive::On_Execute_Finish(void)
+{
+	return( m_Calculator.Finalise() );
+}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
+{
+	if(	Mode == MODULE_INTERACTIVE_LDOWN && m_Calculator.Get_Area(Get_xGrid(), Get_yGrid()) )
+	{
+		DataObject_Update(Parameters("AREA")->asGrid(), 0.0, 100.0, true);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_AreaUpslope_Area::CFlow_AreaUpslope_Area(void)
+{
+	Set_Name		(_TL("Upslope Area"));
+	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
+
+	Set_Description	(CSG_String::Format(SG_T("%s_______\n\n%s"), m_Calculator.Get_Description().c_str(),
+		_TW("This version uses all valid cells (not \'no data\' values) of a given target grid to determine the contributing area. "
+			"In case no target grid is provided as input, the specified x/y coordinates are used as target point.")
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "TARGET"		, _TL("Target Area"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL	, "TARGET_PT_X"	, _TL("Target X coordinate"),
+		_TL("The x-coordinate of the target point in world coordinates [map units]"),
+		PARAMETER_TYPE_Double, 0.0
+	);
+
+	Parameters.Add_Value(
+		NULL	, "TARGET_PT_Y"	, _TL("Target Y coordinate"),
+		_TL("The y-coordinate of the target point in world coordinates [map units]"),
+		PARAMETER_TYPE_Double, 0.0
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SINKROUTE"	, _TL("Sink Routes"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "AREA"		, _TL("Upslope Area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		m_Calculator.Get_Methods(), 2
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CONVERGE"	, _TL("Convergence"),
+		_TL("Convergence factor for Multiple Flow Direction algorithm"),
+		PARAMETER_TYPE_Double	, 1.1, 0.001, true
+	);
+}
+
+//---------------------------------------------------------
+CFlow_AreaUpslope_Area::~CFlow_AreaUpslope_Area(void)
+{}
+
+//---------------------------------------------------------
+bool CFlow_AreaUpslope_Area::On_Execute(void)
+{
+	bool	bResult	= false;
+
+	//-----------------------------------------------------
+	if( m_Calculator.Initialise(
+		Parameters("METHOD")	->asInt(),
+		Parameters("ELEVATION")	->asGrid(),
+		Parameters("SINKROUTE")	->asGrid(),
+		Parameters("AREA")		->asGrid(),
+		Parameters("CONVERGE")	->asDouble()	) )
+	{
+		if( m_Calculator.Clr_Target() )
+		{
+			int		x, y;
+			CSG_Grid	*pTarget	= Parameters("TARGET")->asGrid();
+
+			if( pTarget != NULL )
+			{
+				for(y=0; y<Get_NY() && Set_Progress(y); y++)
+				{
+					for(x=0; x<Get_NX(); x++)
+					{
+						if( !pTarget->is_NoData(x, y) && m_Calculator.Add_Target(x, y) )
+						{
+							bResult	= true;
+						}
+					}
+				}
+			}
+			else
+			{
+				Parameters("ELEVATION")->asGrid()->Get_System().Get_World_to_Grid(x, y, Parameters("TARGET_PT_X")->asDouble(), Parameters("TARGET_PT_Y")->asDouble());
+
+				if( m_Calculator.Add_Target(x, y) )
+				{
+					bResult	= true;
+				}
+				else
+				{
+					SG_UI_Msg_Add_Error(_TL("Coordinates of target point outside of DEM!"));
+				}
+			}
+
+			if( bResult )
+			{
+				m_Calculator.Get_Area();
+
+				DataObject_Set_Colors(Parameters("AREA")->asGrid(), 100, SG_COLORS_WHITE_BLUE);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Calculator.Finalise();
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h b/src/modules/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_BRM.h b/src/modules/terrain_analysis/ta_hydrology/Flow_BRM.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_BRM.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_BRM.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp
new file mode 100644
index 0000000..dcaece3
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp
@@ -0,0 +1,305 @@
+/**********************************************************
+ * Version $Id: Flow_Distance.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Flow_Distance.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:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow_Distance.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_Distance::CFlow_Distance(void)
+{
+	//-----------------------------------------------------
+	Set_Name(_TL("Flow Path Length"));
+
+	Set_Author		(SG_T("(c) 2005 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"This module calculates the average flow path length starting from the seeds, "
+		"that are given by the optional \'Seeds\' grid and optionally from cells without upslope contributing areas "
+		"(i.e. summits, ridges). Seeds will be all grid cells, that "
+		"are not \'no data\' values. If seeds are not given, only summits and ridges as given by the flow routing will be taken into account. "
+		"Available flow routing methods are based on the "
+		"\'Deterministic 8 (D8)\' (Callaghan and Mark 1984) and the \'Multiple Flow Direction (FD8)\' "
+		"(Freeman 1991, Quinn et al. 1991) algorithms.\n\n"
+
+		"References:\n\n"
+
+		"Deterministic 8\n"
+		"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
+		"    'The extraction of drainage networks from digital elevation data',\n"
+		"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
+
+		"- Freeman, G.T. (1991):\n"
+		"    'Calculating catchment area with divergent flow based on a regular grid',\n"
+		"    Computers and Geosciences, 17:413-22\n\n"
+
+		"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
+		"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
+		"    Hydrological Processes, 5:59-79\n\n")
+	);
+
+
+	//-----------------------------------------------------
+	// Input...
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SEED"		, _TL("Seeds"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Grid(
+		NULL	, "LENGTH"		, _TL("Flow Path Length"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL	, "SEEDS_ONLY"	, _TL("Seeds Only"),
+		_TL("Use only seed cells as starting points."),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Flow Routing Algorithm"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Deterministic 8 (D8)"),
+			_TL("Multiple Flow Direction (FD8)")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CONVERGENCE"	, _TL("Convergence (FD8)"),
+		_TL("Convergence factor for the \'Multiple Flow Direction\' algorithm (after Freeman 1991)"),
+		PARAMETER_TYPE_Double	, 1.1, 0.0, true
+	);
+}
+
+//---------------------------------------------------------
+CFlow_Distance::~CFlow_Distance(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_Distance::On_Execute(void)
+{
+	bool		bSeeds;
+	int			x, y, Method;
+	CSG_Grid	*pSeed;
+
+	//-------------------------------------------------
+	m_pDTM		= Parameters("ELEVATION")	->asGrid();
+	pSeed		= Parameters("SEED")		->asGrid();
+	m_pLength	= Parameters("LENGTH")		->asGrid();
+
+	m_Converge	= Parameters("CONVERGENCE")	->asDouble();
+	bSeeds		= Parameters("SEEDS_ONLY")	->asBool();
+	Method		= Parameters("METHOD")		->asInt();
+
+	m_pWeight	= SG_Create_Grid(m_pLength, SG_DATATYPE_Float);
+	m_pWeight	->Assign(0.0);
+	m_pLength	->Assign(0.0);
+
+	//-------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		m_pDTM->Get_Sorted(n, x, y, true, false);
+
+		if( pSeed && !pSeed->is_NoData(x, y) )
+		{
+			m_pLength->Set_Value(x, y, 0.0);
+			m_pWeight->Set_Value(x, y, 0.0);
+		}
+		else if( m_pWeight->asDouble(x, y) > 0.0 )
+		{
+			m_pLength->Set_Value(x, y, m_pLength->asDouble(x, y) / m_pWeight->asDouble(x, y));
+		}
+		else if( bSeeds )
+		{
+			m_pLength->Set_NoData(x, y);
+
+			continue;
+		}
+
+		switch( Method )
+		{
+		case 0:	Set_Length_D8	(x, y);	break;
+		case 1:	Set_Length_MFD	(x, y);	break;
+		}
+	}
+
+	//-------------------------------------------------
+	delete(m_pWeight);
+
+	DataObject_Set_Colors(m_pLength, 100, SG_COLORS_WHITE_BLUE);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Distance::Set_Length_D8(int x, int y)
+{
+	int		i, ix, iy;
+
+	if( m_pDTM->is_InGrid(x, y) && (i = m_pDTM->Get_Gradient_NeighborDir(x, y, true)) >= 0 )
+	{
+		ix	= Get_xTo(i, x);
+		iy	= Get_yTo(i, y);
+
+		if( m_pDTM->is_InGrid(ix, iy) )
+		{
+			m_pLength->Add_Value(ix, iy, m_pLength->asDouble(x, y) + Get_Length(i));
+			m_pWeight->Add_Value(ix, iy, 1.0);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_Distance::Set_Length_MFD(int x, int y)
+{
+	int		i, ix, iy;
+	double	z, d, dzSum, dz[8];
+
+	if( m_pDTM->is_InGrid(x, y) )
+	{
+		z		= m_pDTM->asDouble(x, y);
+		dzSum	= 0.0;
+
+		for(i=0; i<8; i++)
+		{
+			ix		= Get_xTo(i, x);
+			iy		= Get_yTo(i, y);
+
+			if( m_pDTM->is_InGrid(ix, iy) && (d = z - m_pDTM->asDouble(ix, iy)) > 0.0 )
+			{
+				dz[i]	= pow(d / Get_Length(i), m_Converge);
+				dzSum	+= dz[i];
+			}
+			else
+			{
+				dz[i]	= 0.0;
+			}
+		}
+
+		if( dzSum > 0.0 )
+		{
+			d	 = m_pLength->asDouble(x, y);
+
+			for(i=0; i<8; i++)
+			{
+				if( dz[i] > 0.0 )
+				{
+					ix		= Get_xTo(i, x);
+					iy		= Get_yTo(i, y);
+
+					dz[i]	/= dzSum;
+
+					m_pLength->Add_Value(ix, iy, dz[i] * (d + Get_Length(i)));
+					m_pWeight->Add_Value(ix, iy, dz[i]);
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_Distance.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_Parallel.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_Parallel.cpp
new file mode 100644
index 0000000..778f990
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_Parallel.cpp
@@ -0,0 +1,1175 @@
+/**********************************************************
+ * Version $Id: Flow_Parallel.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Flow_Parallel.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow_Parallel.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_Parallel::CFlow_Parallel(void)
+{
+	Set_Name		(_TL("Catchment Area (Parallel)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2001-2010, T.Grabs portions (c) 2010"));
+
+	Set_Description	(_TW(
+		"Parallel processing of cells for calculation of flow accumulation and related parameters. "
+		"This set of algorithms processes a DEM downwards from the highest to the lowest cell.\n\n"
+
+		"References:\n\n"
+
+		"Deterministic 8\n"
+		"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
+		"    'The extraction of drainage networks from digital elevation data',\n"
+		"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
+
+		"Rho 8:\n"
+		"- Fairfield, J. / Leymarie, P. (1991):\n"
+		"    'Drainage networks from grid digital elevation models',\n"
+		"    Water Resources Research, 27:709-717\n\n"
+
+		"Braunschweiger Reliefmodell:\n"
+		"- Bauer, J. / Rohdenburg, H. / Bork, H.-R. (1985):\n"
+		"    'Ein Digitales Reliefmodell als Vorraussetzung fuer ein deterministisches Modell der Wasser- und Stoff-Fluesse',\n"
+		"    Landschaftsgenese und Landschaftsoekologie, H.10, Parameteraufbereitung fuer deterministische Gebiets-Wassermodelle,\n"
+		"    Grundlagenarbeiten zu Analyse von Agrar-Oekosystemen, (Eds.: Bork, H.-R. / Rohdenburg, H.), p.1-15\n\n"
+
+		"Deterministic Infinity:\n"
+		"- Tarboton, D.G. (1997):\n"
+		"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
+		"    Water Resources Research, Vol.33, No.2, p.309-319\n\n"
+
+		"Multiple Flow Direction:\n"
+		"- Freeman, G.T. (1991):\n"
+		"    'Calculating catchment area with divergent flow based on a regular grid',\n"
+		"    Computers and Geosciences, 17:413-22\n\n"
+
+		"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
+		"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
+		"    Hydrological Processes, 5:59-79\n\n"
+		
+		"Triangular Multiple Flow Direction\n"
+		"- Seibert, J. / McGlynn, B. (2007):\n"
+		"    'A new triangular multiple flow direction algorithm for computing upslope areas from gridded digital elevation models',\n"
+		"    Water Resources Research, Vol. 43, W04501\n"
+		"    C++ Implementation into SAGA by Thomas Grabs, Copyrights (c) 2007\n"
+		"    Contact: thomas.grabs at natgeo.su.se, jan.seibert at natgeo.su.se \n"
+	));
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Grid(
+		NULL	, "CASPECT"		, _TL("Catchment Aspect"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "FLWPATH"		, _TL("Flow Path Length"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+
+	//-----------------------------------------------------
+	// Method...
+
+	Parameters.Add_Choice(
+		NULL	, "Method"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+			_TL("Deterministic 8"),
+			_TL("Rho 8"),
+			_TL("Braunschweiger Reliefmodell"),
+			_TL("Deterministic Infinity"),
+			_TL("Multiple Flow Direction"),
+			_TL("Multiple Triangular Flow Directon")
+		), 4
+	);
+
+
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL	, "DOLINEAR"	, _TL("Linear Flow"),
+		_TL("Use D8 if catchment area becomes higher than specified threshold."),
+		PARAMETER_TYPE_Bool
+	);
+
+	Parameters.Add_Value(
+		NULL	, "LINEARTHRS"	, _TL("Linear Flow Threshold"),
+		_TL("Use D8 if catchment area becomes higher than specified threshold (Cells)."),
+		PARAMETER_TYPE_Double	,	500
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "LINEARTHRS_GRID"		, _TL("Linear Flow Threshold Grid"),
+		_TL("(optional) Linear Flow Threshold Grid"),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CHDIR_GRID"			, _TL("Channel Direction"),
+		_TW("(optional) Channel Direction Grid. Must contain direction values. "
+			"For all non-missing grid cells all flow will be routed to the prescribed direction."),
+		PARAMETER_INPUT_OPTIONAL
+	);
+	
+	Parameters.Add_Value(
+		NULL	, "CONVERGENCE"	, _TL("Convergence"),
+		_TL("Convergence factor for Multiple Flow Direction Algorithm (Freeman 1991).\nApplies also to the Multiple Triangular Flow Directon Algorithm."),
+		PARAMETER_TYPE_Double, 1.1, 0.0, true
+	);
+}
+
+//---------------------------------------------------------
+CFlow_Parallel::~CFlow_Parallel(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Parallel::On_Initialize(void)
+{
+	pCatch_Aspect	= Parameters("CASPECT")->asGrid();
+	pFlowPath		= Parameters("FLWPATH")->asGrid();
+
+	TH_LinearFlow	= Parameters("DOLINEAR")->asBool() && pDTM
+					? Parameters("LINEARTHRS")->asDouble() // (pDTM->Get_NX() * pDTM->Get_NY())
+					: -1.0;
+
+	pTH_LinearFlow  = Parameters("LINEARTHRS_GRID")		->asGrid();
+
+	pD8_Direction   = Parameters("CHDIR_GRID")		    ->asGrid();
+
+	MFD_Converge	= Parameters("CONVERGENCE")->asDouble();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_Parallel::Calculate(void)
+{
+	int		x, y;
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y+=Step)
+	{
+		for(x=0; x<Get_NX(); x+=Step)
+		{
+			Init_Cell(x, y);
+		}
+	}
+
+	return( Set_Flow() );
+}
+
+//---------------------------------------------------------
+bool CFlow_Parallel::Calculate(int x, int y)
+{
+	Init_Cell(x, y);
+
+	return( Set_Flow() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_Parallel::Set_Flow(void)
+{
+	int		x, y;
+
+
+	double  THRS = 0.0;
+	
+	int		DIR  = -1;
+	
+	//-----------------------------------------------------
+	if( !pDTM->Get_Sorted(0, x, y, true, false) )
+	{
+		return( false );
+	}
+
+
+	//-----------------------------------------------------
+	int Method	= Parameters("Method")->asInt();
+
+	if( Method == 2 )
+	{
+		BRM_Init();
+	}
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		pDTM->Get_Sorted(n,x,y);
+
+		//if( !(n%(4*Get_NX())) )DataObject_Update(pFlow);
+
+		if( pTH_LinearFlow && TH_LinearFlow > 0.0)
+		{
+			if( pTH_LinearFlow->is_NoData(x, y) )
+			{
+				THRS = 0.0;
+			}
+			else
+			{
+				THRS = pTH_LinearFlow->asDouble(x, y);
+			}
+		}
+		else
+		{
+			THRS = pCatch->asDouble(x, y);
+		}
+
+		if( pD8_Direction )
+		{
+			if( pD8_Direction->is_NoData(x, y) )
+			{
+				DIR = -1;
+			}
+			else
+			{
+				DIR = pD8_Direction->asInt(x, y);
+			}
+		}
+
+		if( TH_LinearFlow > 0.0 && THRS >= TH_LinearFlow || DIR > 0)
+		{
+			Set_D8(x, y, DIR);
+		}
+		else
+		{
+			switch( Method )
+			{
+			case 0:
+				Set_D8(x, y);
+				break;
+
+			case 1:
+				Set_Rho8(x, y);
+				break;
+
+			case 3:
+				Set_DInf(x, y);
+				break;
+
+			case 4:
+				Set_MFD(x, y);
+				break;
+
+			case 5:
+				Set_MDInf(x, y);
+				break;				
+
+			case 2:
+				Set_BRM(x, y);
+				break;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( pRoute )
+	{
+		for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+		{
+			pDTM->Get_Sorted(n, x, y, false);
+
+			Check_Route(x, y);
+		}
+	}
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+void CFlow_Parallel::Check_Route(int x, int y)
+{
+	bool	bSink;
+	int		i, ix, iy;
+	double	z;
+
+	if( pRoute->asChar(x, y) > 0 )
+	{
+		z	= pDTM->asDouble(x, y);
+
+		for(i=0, bSink=true; i<8 && bSink; i++)
+		{
+			ix	= Get_xTo(i, x);
+			iy	= Get_yTo(i, y);
+
+			if( !is_InGrid(ix, iy) || z > pDTM->asDouble(ix, iy) )
+			{
+				bSink	= false;
+			}
+		}
+
+		//-------------------------------------------------
+		if( bSink )
+		{
+			i	= pRoute->asChar(x, y);
+
+			ix	= Get_xTo(i, ix);
+			iy	= Get_yTo(i, iy);
+
+			//---------------------------------------------
+			while( is_InGrid(ix, iy) )
+			{
+				Add_Portion(x, y, ix, iy, i);
+
+				i	= pRoute->asChar(ix, iy);
+
+				if( i > 0 )
+				{
+					ix	= Get_xTo(i, ix);
+					iy	= Get_yTo(i, iy);
+				}
+				else
+				{
+					i	= pDTM->Get_Gradient_NeighborDir(ix, iy);
+
+					if( i >= 0 )
+					{
+						ix	= Get_xTo(i, ix);
+						iy	= Get_yTo(i, iy);
+					}
+					else
+					{
+						ix	= -1;
+					}
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//					Deterministic 8						 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Parallel::Set_D8(		int x, int y, int dir)
+{
+	int		Direction;
+
+	if( dir > 0.0)
+	{
+		Direction	= dir;
+	}
+	else
+	{
+		Direction = pDTM->Get_Gradient_NeighborDir(x, y);
+	}
+
+	if( Direction >= 0 )
+	{
+		Add_Fraction(x, y, Direction);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//						Rho 8							 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Parallel::Set_Rho8(	int x, int y )
+{
+	int		i, ix, iy, iMax;
+
+	double	z, d, dMax;
+
+	z		= pDTM->asDouble(x, y);
+	iMax	= -1;
+
+	for(i=0; i<8; i++)
+	{
+		ix		= Get_xTo(i, x);
+		iy		= Get_yTo(i, y);
+
+		if( !pDTM->is_InGrid(ix, iy) )
+		{
+			return;
+		}
+		else
+		{
+			d		= z - pDTM->asDouble(ix, iy);
+
+			if( i % 2 == 1 )
+			{
+				d		/= 1.0 + rand() / (double)RAND_MAX;
+			}
+
+			if( iMax < 0 || (iMax >= 0 && d > dMax) )
+			{
+				iMax	= i;
+				dMax	= d;
+			}
+		}
+	}
+
+	if( iMax >= 0 )
+	{
+		Add_Fraction(x, y, iMax);
+	}
+}
+
+/*void CFlow_Parallel::Set_Rho8(	int x, int y )
+{
+	int		Direction, ix, iy;
+
+	double 	Slope, Aspect;
+
+	Get_Gradient(x, y, Slope, Aspect);
+
+	if( Aspect >= 0 )
+	{
+		Direction	= (int)(Aspect / M_PI_045);
+
+		if( fmod(Aspect, M_PI_045) / M_PI_045 > rand() / (double)RAND_MAX )
+		{
+			Direction++;
+		}
+
+		Direction	%= 8;
+
+		ix			= Get_xTo(Direction, x);
+		iy			= Get_yTo(Direction, y);
+
+		if( is_InGrid(ix, iy) && pDTM->asDouble(ix, iy) >= pDTM->asDouble(x, y) )
+		{
+			Direction	= Get_Direction_Lowest(pDTM, x, y);
+		}
+
+		Add_Fraction(x, y, Direction);
+	}
+}/**/
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Deterministic Infinity					 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Parallel::Set_DInf(	int x, int y )
+{
+	int		i, ix, iy;
+	double	s, a;
+
+	if( pDTM->Get_Gradient(x, y, s, a) && a >= 0.0 )
+	{
+		i	= (int)(a / M_PI_045);
+		a	= fmod (a , M_PI_045) / M_PI_045;
+		s	= pDTM->asDouble(x, y);
+
+		if( pDTM->is_InGrid(ix = Get_xTo(i + 0, x), iy = Get_yTo(i + 0, y)) && pDTM->asDouble(ix, iy) < s
+		&&  pDTM->is_InGrid(ix = Get_xTo(i + 1, x), iy = Get_yTo(i + 1, y)) && pDTM->asDouble(ix, iy) < s )
+		{
+			Add_Fraction(x, y,  i         , 1.0 - a);
+			Add_Fraction(x, y, (i + 1) % 8,       a);
+
+			return;
+		}
+	}
+
+	if( (i = pDTM->Get_Gradient_NeighborDir(x, y)) >= 0 )
+	{
+		Add_Fraction(x, y, i);
+	}
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Multiple Triangular Flow Directon		 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Parallel::Set_MDInf(	int x, int y )
+{
+	int		i, ii, ix, iy;
+
+	double	z, dzSum, dz[8];
+	double	hs, hr, s_facet[8], r_facet[8];
+	double	valley[8], portion[8];
+	double  cellsize, cellarea;
+	double	nx, ny, nz, n_norm;
+	bool	Dir_inGrid[8];
+
+	z			= pDTM->asDouble(x, y);
+	cellsize	= Get_Cellsize();
+	cellarea	= cellsize * cellsize;
+
+	for(i=0; i<8; i++)
+	{
+		ix		= Get_xTo(i, x);
+		iy		= Get_yTo(i, y);
+		
+		Dir_inGrid[i] = true;
+		if( x == 6 && y == 7 )
+		{
+			int k = 1;
+		}
+
+		s_facet[i] = r_facet[i] = -999.0;
+
+		if( pDTM->is_InGrid(ix, iy) )
+		{
+			dz[i]		= z - pDTM->asDouble(ix, iy);
+		}
+		else
+		{
+			dz[i]		= 0.0;
+			Dir_inGrid[i] = false;
+		}
+	}
+	for(i=0; i<8; i++)
+	{
+		hr = hs = -999.0;
+		
+		if( Dir_inGrid[i] )
+		{
+			ii = ( i < 7)? i+1 : 0;
+			
+			if( Dir_inGrid[ii] )
+			{
+				// vb-code:  nx = (z1 * yd(ii) - z2 * yd(i)) * gridsize
+				nx = ( dz[ii] * Get_yTo( i ) - dz[i] * Get_yTo( ii )) * cellsize;
+				//vb-code:  ny = (z1 * xd(ii) - z2 * xd(i)) * gridsize
+/*ERROR?*/		ny = ( dz[i] * Get_xTo( ii ) - dz[ii] * Get_xTo( i ) ) * cellsize;
+				//vb-code:  nz = (xd(ii) * yd(i) - xd(i) * yd(ii)) * gridsize ^ 2
+				nz = ( Get_xTo( i ) * Get_yTo( ii ) - Get_xTo( ii ) * Get_yTo( i )) * cellarea;
+				
+				n_norm = sqrt( nx*nx + ny*ny +nz*nz );
+				/*
+				if( nx == 0.0 )
+				{
+					hr = (ny >= 0.0)? 0.0 : M_PI;
+				} 
+				else if( nx > 0.0 )
+				{
+					hr = M_PI_090 - atan(ny / nx);
+
+				} 
+				else
+				{
+					hr = M_PI_270 - atan(ny / nx);
+				}
+				*/
+
+				if( nx == 0.0 )
+				{
+					hr = (ny >= 0.0)? 0.0 : M_PI;
+				} 
+				else if( nx < 0.0 )
+				{
+					hr = M_PI_270 - atan(ny / nx);
+				} 
+				else
+				{
+					hr = M_PI_090 - atan(ny / nx);
+				}
+				//vb-code:  hs = -Tan(arccos(nz / betrag_n))
+				hs = -tan( acos( nz/n_norm ) );
+				
+				// vb-code: If hr <= (i - 1) * PI / 4 Or hr >= i * PI / 4 Then
+				//SHOULD IT BE LIKE THIS: (( hr <= i * M_PI_045 || hr >= ii * M_PI_045 )  OR AS BELOW???
+				if( hr < i * M_PI_045 || hr > (i+1) * M_PI_045 )
+				{
+					if( dz[i] > dz[ii] )
+					{
+						hr = i * M_PI_045;
+						hs = dz[i] / Get_Length(i);
+					}
+					else
+					{
+						hr = ii * M_PI_045;
+						hs = dz[ii] / Get_Length(ii);						
+					}
+				}
+				
+			}
+			else if( dz[i] > 0.0 )
+			{
+				hr = i * M_PI_045;
+				hs = dz[i] / Get_Length(i);
+			}
+			
+			s_facet[i] = hs;
+			r_facet[i] = hr;
+		}
+	}
+	
+	dzSum		= 0.0;
+	
+	for(i=0; i<8; i++)
+	{		
+		valley[i]	= 0.0;
+		ii = (i < 7)? i+1 : 0;
+		
+		if( s_facet[i] > 0.0 )
+		{
+			if( r_facet[i] > i * M_PI_045 && r_facet[i] < (i+1) * M_PI_045 )
+			{
+				valley[i] = s_facet[i];
+			}
+			else if( r_facet[i] == r_facet[ii] )
+			{
+				valley[i] = s_facet[i];
+			}
+			else if( s_facet[ii] == -999.0 && r_facet[i] == (i+1) * M_PI_045)
+			{
+				valley[i] = s_facet[i];
+			}
+			else
+			{
+				ii = (i > 0)? i-1 : 7;
+				if( s_facet[ii] == -999.0 && r_facet[i] == i * M_PI_045 )
+				{
+					valley[i] = s_facet[i];
+				}
+			}
+			
+			valley[i] = pow(valley[i], MFD_Converge);
+			dzSum += valley[i];
+		} 
+		
+		portion[i] = 0.0;
+
+	}
+
+
+	if( dzSum )
+	{
+		for(i=0; i<8; i++)
+		{
+			if (i < 7)
+			{
+				ii = i+1;
+			}
+			else
+			{
+				ii = 0;
+				if( r_facet[i] == 0.0) r_facet[i] = M_PI_360;
+			}
+			if( valley[i] )
+			{
+				valley[i] /= dzSum;
+				//vb-code: portion(i) = portion(i) + valley(i) * (i * PI / 4 - r_facet(i)) / (PI / 4)
+				portion[i] += valley[i] * ((i+1) * M_PI_045 - r_facet[i]) / M_PI_045;
+				//vb-code: portion(ii) = portion(ii) + valley(i) * (r_facet(i) - (i - 1) * PI / 4) / (PI / 4)
+				portion[ii] += valley[i] * (r_facet[i] - i * M_PI_045) / M_PI_045;
+			}
+		}
+		for(i=0; i<8; i++)
+		{
+			Add_Fraction(x, y, i, portion[i] );
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Multiple Flow Direction					 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_Parallel::Set_MFD(	int x, int y )
+{
+	int		i, ix, iy;
+
+	double	z, d, dzSum, dz[8];
+
+	z		= pDTM->asDouble(x, y);
+	dzSum	= 0.0;
+
+	for(i=0; i<8; i++)
+	{
+		ix		= Get_xTo(i, x);
+		iy		= Get_yTo(i, y);
+
+		if( pDTM->is_InGrid(ix, iy) )
+		{
+			d		= z - pDTM->asDouble(ix, iy);
+		}
+		else
+		{
+			ix		= Get_xTo(i + 4, x);
+			iy		= Get_yTo(i + 4, y);
+
+			if( pDTM->is_InGrid(ix, iy) )
+			{
+				d		= pDTM->asDouble(ix, iy) - z;
+			}
+			else
+			{
+				d		= 0.0;
+			}
+		}
+
+		if( d > 0.0 )
+		{
+			//previously: dzSum	+= (dz[i]	= pow(d / Get_Length(i), MFD_Converge));
+			dz[i]	= pow(d / Get_Length(i), MFD_Converge);
+			dzSum	+= dz[i];
+		}
+		else
+		{
+			dz[i]	= 0.0;
+		}
+	}
+
+	if( dzSum )
+	{
+		for(i=0; i<8; i++)
+		{
+			if( dz[i] )
+			{
+				Add_Fraction(x, y, i, dz[i] / dzSum );
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Braunschweiger Reliefmodell				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow_BRM.h"
+
+#define BRM_nint(x)		((int)(x >= 0 ? x + 0.5 : x - 0.5))
+
+
+//---------------------------------------------------------
+void CFlow_Parallel::Set_BRM(	int x, int y )
+{
+	int		Dir, QBinaer,
+			ix[3], iy[3],
+			nexp[6];
+
+	double	QLinks, QMitte, QRecht,
+			nnei[6];
+
+	//-----------------------------------------------------
+	if( is_InGrid(x, y, 1) ) // Rand !!!
+	{
+		Dir	= BRM_InitRZ(x,y,ix,iy);
+
+		if( Dir >= 0 )
+		{
+			if( Dir % 2 )
+			{
+				BRM_GetDiago(Dir,x,y,ix,iy,nnei,nexp);
+				BRM_QStreuung(4,1,nnei,nexp,QBinaer,QLinks,QMitte,QRecht);
+			}
+			else
+			{
+				BRM_GetOrtho(Dir,x,y,ix,iy,nnei,nexp);
+				BRM_QStreuung(6,0,nnei,nexp,QBinaer,QLinks,QMitte,QRecht);
+			}
+
+			Add_Fraction(x,y,(Dir+1)%8,BRM_BitMtrx[0][QBinaer] ? QLinks : 0);
+			Add_Fraction(x,y,(Dir+0)%8,BRM_BitMtrx[1][QBinaer] ? QMitte : 0);
+			Add_Fraction(x,y,(Dir+7)%8,BRM_BitMtrx[2][QBinaer] ? QRecht : 0);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_Parallel::BRM_Init(void)
+{
+	int 	i;
+
+	double	DXT	= Get_Cellsize()/2,
+			DYT	= Get_Cellsize()/2;
+
+	//-----------------------------------------------------
+	BRM_kgexp[0]	= (int)(atan2(DXT     , Get_Cellsize()) * M_RAD_TO_DEG);
+	BRM_kgexp[1]	= (int)(atan2(Get_Cellsize(), DYT     ) * M_RAD_TO_DEG) + 1;
+	BRM_kgexp[2]	= (int)(atan2(Get_Cellsize(),-DYT     ) * M_RAD_TO_DEG);
+	BRM_kgexp[3]	= (int)(atan2(DXT     ,-Get_Cellsize()) * M_RAD_TO_DEG) + 1;
+
+	for(i=0; i<4; i++)
+		BRM_kgexp[i+4]	= BRM_kgexp[i] + 180;
+
+	//-----------------------------------------------------
+	for(i=0; i<=360; i++)
+	{
+		BRM_sinus[i]	= -sin(i * M_DEG_TO_RAD);
+		BRM_cosin[i]	= -cos(i * M_DEG_TO_RAD);
+	}
+
+	//---BRM_idreh---------------------------------------------
+	BRM_idreh[0]	= 180;
+	BRM_idreh[1]	= 180 -	BRM_nint(atan2(Get_Cellsize(), Get_Cellsize()) * M_RAD_TO_DEG);
+	BRM_idreh[2]	=  90;
+	BRM_idreh[3]	=		BRM_nint(atan2(Get_Cellsize(), Get_Cellsize()) * M_RAD_TO_DEG);
+	BRM_idreh[4]	=   0;
+
+	for(i=1; i<4; i++)
+		BRM_idreh[i+4]	= BRM_idreh[i] + 180;
+}
+
+//---------------------------------------------------------
+int CFlow_Parallel::BRM_InitRZ(int x, int y, int ix[3], int iy[3])
+{
+	int		i, j, Dir;
+
+	double	Slope, Aspect;
+
+	Get_Gradient(x, y, Slope, Aspect);
+
+	Aspect	*= M_RAD_TO_DEG;
+
+	if( Aspect < 0 )
+	{
+		return( -1 );
+	}
+
+	//---Kategorisierte-Exposition-------------------------
+	Dir	= 0;
+	while( Aspect > BRM_kgexp[Dir] && Dir < 8 )
+		Dir++;
+	Dir	%=8;
+
+    //---Finde-Die-3-ZielRasterZellen----------------------
+	for(i=0; i<3; i++)	// zxy[]: 0=Recht, 1=Mitte, 2=Links
+	{
+		j		= (Dir + 7 + i) % 8;
+		ix[2-i]	= Get_xTo(j,x);
+		iy[2-i]	= Get_yTo(j,y);
+	}
+
+	return(Dir);
+}
+
+//---------------------------------------------------------
+void CFlow_Parallel::BRM_GetOrtho(int Dir, int x, int y, int ix[3], int iy[3], double nnei[6], int nexp[6])
+{
+	int		jx, jy, i,
+			i0	= (Dir + 2) % 8,
+			i4	= (Dir + 6) % 8;
+
+	double	Slope, Aspect;
+
+	for(i=0; i<3; i++)
+	{
+		jx		= ix[i];
+		jy		= iy[i];
+
+		Get_Gradient(jx, jy, Slope, Aspect);
+
+		nnei[i]	= M_RAD_TO_DEG * Slope;
+		nexp[i]	= (int)(M_RAD_TO_DEG * Aspect);
+	}
+
+	jx		= Get_xTo(i0,x);
+	jy		= Get_yTo(i0,y);
+
+	Get_Gradient(jx, jy, Slope, Aspect);
+
+	nnei[3]	= M_RAD_TO_DEG * Slope;
+	nexp[3]	= (int)(M_RAD_TO_DEG * Aspect);
+
+	jx		= Get_xTo(i4,x);
+	jy		= Get_yTo(i4,y);
+
+	Get_Gradient(jx, jy, Slope, Aspect);
+
+	nnei[5]	= M_RAD_TO_DEG * Slope;
+	nexp[5]	= (int)(M_RAD_TO_DEG * Aspect);
+
+	Get_Gradient(x, y, Slope, Aspect);
+
+	nnei[4]	= M_RAD_TO_DEG * Slope;
+	nexp[4]	= (int)(M_RAD_TO_DEG * Aspect);	//[jy][jx]) ????!!!!...;
+
+	for(i=0; i<6; i++)
+		if(nexp[i]<0)
+			nexp[i]	= nexp[4];
+
+	for(i=0; i<6; i++)
+	{
+		nexp[i]	+= BRM_idreh[Dir];
+
+		if(nexp[i]>360)
+			nexp[i]	-= 360;
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_Parallel::BRM_GetDiago(int Dir, int x, int y, int ix[3], int iy[3], double nnei[6], int nexp[6])
+{
+	int		i;
+
+	double	Slope, Aspect;
+
+	Get_Gradient( x   ,  y   , Slope, Aspect);
+	nexp[0]	= (int)(M_RAD_TO_DEG * Aspect);
+	nnei[0]	= M_RAD_TO_DEG * Slope;
+
+	Get_Gradient(ix[0], iy[0], Slope, Aspect);
+	nexp[1]	= (int)(M_RAD_TO_DEG * Aspect);
+	nnei[1]	= M_RAD_TO_DEG * Slope;
+
+	Get_Gradient(ix[2], iy[2], Slope, Aspect);
+	nexp[2]	= (int)(M_RAD_TO_DEG * Aspect);
+	nnei[2]	= M_RAD_TO_DEG * Slope;
+
+	Get_Gradient(ix[1], iy[1], Slope, Aspect);
+	nexp[3]	= (int)(M_RAD_TO_DEG * Aspect);
+	nnei[3]	= M_RAD_TO_DEG * Slope;
+
+	for(i=1; i<4; i++)
+		if(nexp[i]<0)
+			nexp[i]	= nexp[0];
+
+	for(i=0; i<4; i++)
+	{
+		nexp[i]	+= BRM_idreh[Dir];
+
+		if(nexp[i]>360)
+			nexp[i]	-= 360;
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_Parallel::BRM_QStreuung(int i64, int g64, double nnei[6], int nexp[6], int &QBinaer, double &QLinks, double &QMitte, double &QRecht)
+{
+	int		i, j, ix, iy,
+			ALinks, AMitte=2, ARecht;
+
+	double	x=1, y=1, sg=0, a,
+			s[6], c[6];
+
+	ALinks	= ARecht	= 0;
+	QLinks	= QRecht	= 0.0;
+
+	for(i=0; i<i64; i++)
+		sg	+= nnei[i];
+
+	sg	= i64 / sg;
+
+	for(i=0; i<i64; i++)
+	{
+		a		= sg * nnei[i];
+		j		= nexp[i];
+		s[i]	= a * BRM_sinus[j];
+		c[i]	= a * BRM_cosin[j];
+	}
+
+    //---QLinks-ermitteln----------------------------------
+	for(i=0; i<100; i++)
+	{
+		ix	= BRM_nint(x) - 1;
+		iy	= BRM_nint(y) - 1;
+
+		for(j=0; j<i64; j++)
+		{
+			a		= BRM_g[g64][j][ix][iy];
+			x		+= s[j] * a;
+			y		+= c[j] * a;
+		}	 
+
+		if(x<1)
+		{
+			ALinks	= 0;
+			QLinks	= 0;
+			break;
+		}
+
+		if( x>8.99 || y<1 )
+		{
+			ALinks	= 4;
+			QLinks	= 1;			
+			break;
+		}
+
+		if(y>8.95)
+		{
+			if(x<1.02)
+			{
+				ALinks	= 0;
+				QLinks	= 0;
+			}
+			else
+			{
+				ALinks	= 4;
+				QLinks	= (x - 1) / 8;
+
+				if(i64==4)
+				{
+					if(QLinks<0.5)
+						QLinks	= QLinks * (1.67 - QLinks * 1.078);
+					else
+						QLinks	= QLinks * 0.869 + 0.131;
+				}
+			}
+			break;
+		}
+	}
+
+
+    //---QRechts-ermitteln---------------------------------
+	x	= 9;
+	y	= 1;
+
+	for(i=0; i<100; i++)
+	{
+		ix	= BRM_nint(x) - 1;
+		iy	= BRM_nint(y) - 1;
+
+		for(j=0; j<i64; j++)
+		{
+			a	= BRM_g[g64][j][ix][iy];
+			x	+= s[j] * a;
+			y	+= c[j] * a;
+		}
+
+		if(x>9)
+		{
+			ARecht	= 0;
+			QRecht	= 0;
+			break;
+		}
+
+		if( x<1.01 || y<1 )
+		{
+			ARecht	= 1;
+			QRecht	= 1;
+			break;
+		}
+
+		if(y>8.95)
+		{
+			if(x>8.98)
+			{
+				ARecht	= 0;
+				QRecht	= 0;
+			}
+			else
+			{
+				ARecht	= 1;
+				QRecht	= 1 - (x - 1) / 8;
+
+				if(i64==4)					
+				{
+					if(QRecht<0.5)
+						QRecht	= QRecht * (1.67 - QRecht * 1.078);
+					else
+						QRecht	= QRecht * 0.869 + 0.131;
+				}
+			}
+			break;
+		}
+	}
+
+	//---QMitte-ist-Rest-/-QBinaer'Bits-setzen-------------
+	QMitte	= 1 - QLinks - QRecht;
+	QBinaer	= ALinks + AMitte + ARecht;
+
+	if(QMitte<=0.01)
+	{
+		a		= QLinks + QRecht;
+		QLinks	/= a;
+		QRecht	/= a;
+		QMitte	= 0;
+		QBinaer	-= 2;
+	}
+}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.h b/src/modules/terrain_analysis/ta_hydrology/Flow_Parallel.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_Parallel.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp
new file mode 100644
index 0000000..7a95daa
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp
@@ -0,0 +1,737 @@
+/**********************************************************
+ * Version $Id: Flow_RecursiveDown.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                Flow_RecursiveDown.cpp                 //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow_RecursiveDown.h"
+
+//---------------------------------------------------------
+#define GET_OUTLET_DIAG__1(in, angle)		(1.0 - (1.0 - in) * tan(M_PI_090 - angle))
+#define GET_OUTLET_CROSS_1(in, angle)		(in + tan(angle))
+
+#define GET_OUTLET_DIAG__2(in, angle)		(in * tan(angle))
+#define GET_OUTLET_CROSS_2(in, angle)		(in - tan(M_PI_090 - angle))
+
+#define GET_LENGTH(a, b)					(sqrt((a)*(a) + (b)*(b)))
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_RecursiveDown::CFlow_RecursiveDown(void)
+{
+	Set_Name		(_TL("Catchment Area (Flow Tracing)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2001"));
+
+	Set_Description	(_TW(
+		"Flow tracing algorithms for calculations of flow accumulation and related parameters. "
+		"These algorithms trace the flow of each cell in a DEM separately until it finally leaves the DEM or ends in a sink.\n\n"
+
+		"References:\n\n"
+
+		"Rho 8 (this implementation adopted the original algorithm only for the flow routing and will give quite different results):\n"
+		"- Fairfield, J. / Leymarie, P. (1991):\n"
+		"    'Drainage networks from grid digital elevation models',\n"
+		"    Water Resources Research, 27:709-717\n\n"
+
+		"Kinematic Routing Algorithm:\n"
+		"- Lea, N.L. (1992):\n"
+		"    'An aspect driven kinematic routing algorithm',\n"
+		"    in: Parsons, A.J., Abrahams, A.D. (Eds.), 'Overland Flow: hydraulics and erosion mechanics', London, 147-175\n\n"
+
+		"DEMON:\n"
+		"- Costa-Cabral, M. / Burges, S.J. (1994):\n"
+		"    'Digital Elevation Model Networks (DEMON): a model of flow over hillslopes for computation of contributing and dispersal areas',\n"
+		"    Water Resources Research, 30:1681-1692\n\n")
+	);
+
+
+	//-----------------------------------------------------
+	// Method...
+
+	Parameters.Add_Choice(
+		NULL	, "Method"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Rho 8"),
+			_TL("Kinematic Routing Algorithm"),
+			_TL("DEMON")
+		), 1
+	);
+
+
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL	, "MINDQV"		, _TL("DEMON - Min. DQV"),
+		_TL("DEMON - Minium Drainage Quota Volume (DQV) for traced flow tubes"),
+		PARAMETER_TYPE_Double	,	0.0, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "CORRECT"		, _TL("Flow Correction"),
+		_TL(""),
+		PARAMETER_TYPE_Bool
+	);
+}
+
+//---------------------------------------------------------
+CFlow_RecursiveDown::~CFlow_RecursiveDown(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::On_Initialize(void)
+{
+	int		x, y;
+	double	Slope, Aspect;
+
+	//-----------------------------------------------------
+	Method			= Parameters("Method"	)->asInt();
+	DEMON_minDQV	= Parameters("MINDQV"	)->asDouble();
+	bFlowPathWeight	= Parameters("CORRECT"	)->asBool();
+
+	pLinear			= 1 ? SG_Create_Grid(pDTM, SG_DATATYPE_Float) : NULL;
+
+	//-----------------------------------------------------
+	Lock_Create();
+
+	//-----------------------------------------------------
+	switch( Method )
+	{
+	case 0: default:	// Rho 8...
+
+		pDir		= NULL;
+		pDif		= NULL;
+
+		break;
+
+	//-----------------------------------------------------
+	case 1:	case 2:		// KRA, DEMON...
+
+		pDir		= SG_Create_Grid(pDTM, SG_DATATYPE_Char);
+		pDif		= SG_Create_Grid(pDTM, SG_DATATYPE_Float);
+
+		for(y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			for(x=0; x<Get_NX(); x++)
+			{
+				if( !pDTM->is_NoData(x, y) )
+				{
+					Get_Gradient(x, y, Slope, Aspect);
+
+					if( Aspect >= 0.0 )
+					{
+						pDir->Set_Value(x, y, 2 * (((int)(Aspect / M_PI_090)) % 4));
+						pDif->Set_Value(x, y, fmod(Aspect, M_PI_090));
+					}
+				}
+			}
+		}
+
+		break;
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::On_Finalize(void)
+{
+	int		x, y, dir;
+	sLong	n;
+	double	qFlow;
+
+	//-----------------------------------------------------
+	if( pDir )
+	{
+		delete(pDir);
+	}
+
+	if( pDif )
+	{
+		delete(pDif);
+	}
+
+	Lock_Destroy();
+
+	//-----------------------------------------------------
+	if( pLinear )
+	{
+		for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+		{
+			;
+
+			if( pDTM->Get_Sorted(n, x, y) && (qFlow = pLinear->asDouble(x, y)) > 0.0 )
+			{
+				Add_Flow(x, y, qFlow);
+
+				if( (dir = pDTM->Get_Gradient_NeighborDir(x, y)) >= 0 )
+				{
+					x	= Get_xTo(dir, x);
+					y	= Get_yTo(dir, y);
+
+					if( pDTM->is_InGrid(x, y) )
+					{
+						pLinear->Add_Value(x, y, qFlow);
+					}
+				}
+			}
+		}
+
+		delete(pLinear);
+
+		pLinear	= NULL;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_RecursiveDown::Calculate(void)
+{
+	for(int y=0; y<Get_NY() && Set_Progress(y); y+=Step)
+	{	//if( !(y%2) )DataObject_Update(pFlow);
+		for(int x=0; x<Get_NX(); x+=Step)
+		{
+			Calculate(x, y);
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CFlow_RecursiveDown::Calculate(int x, int y)
+{
+	double 	Slope, Aspect, qFlow;
+
+	if( !pDTM->is_NoData(x, y) && (qFlow = pWeight ? pWeight->asDouble(x, y) : 1.0) > 0.0 )
+	{
+		Get_Gradient(x, y, Slope, Aspect);
+
+		Src_Height	= pDTM->asDouble(x,y);
+		Src_Slope	= Slope;
+
+		Add_Flow(x, y, qFlow);
+		Lock_Set(x, y, 1);
+
+		//-------------------------------------------------
+		switch( Method )
+		{
+		case 0:
+			Rho8_Start(		x, y, qFlow );
+			break;
+
+		case 1:
+			KRA_Start(		x, y, qFlow );
+			break;
+
+		case 2:
+			DEMON_Start(	x, y, qFlow );
+			break;
+		}
+
+		Lock_Set(x, y, 0);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::Add_Flow(int x, int y, double Fraction)
+{
+	if( pCatch )
+	{
+		pCatch			->Add_Value(x, y, Fraction );
+	}
+
+	if( pCatch_Height )
+	{
+		pCatch_Height	->Add_Value(x, y, Fraction * Src_Height );
+	}
+
+	if( pCatch_Slope )
+	{
+		pCatch_Slope	->Add_Value(x, y, Fraction * Src_Slope );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::Rho8_Start(int x, int y, double qFlow)
+{
+	int		dir, ix, iy;
+	double 	Slope, Aspect;
+
+	//-----------------------------------------------------
+	Get_Gradient(x, y, Slope, Aspect);
+
+	if( Aspect >= 0.0 )
+	{
+		dir		= (int)(Aspect / M_PI_045);
+
+		if( fmod(Aspect, M_PI_045) / M_PI_045 > rand() / (double)RAND_MAX )
+		{
+			dir++;
+		}
+
+		dir	%= 8;
+
+		ix		= Get_xTo(dir, x);
+		iy		= Get_yTo(dir, y);
+
+		//-------------------------------------------------
+		if( is_InGrid(ix, iy) )
+		{
+			if( is_Locked(ix, iy) )
+			{
+				if( pLinear )
+				{
+					pLinear->Add_Value(x, y, qFlow);
+				}
+			}
+			else
+			{
+				Lock_Set( x,  y, 1);
+				Add_Flow(ix, iy, qFlow);
+				Rho8_Start(ix, iy, qFlow);
+				Lock_Set( x,  y, 0);
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::KRA_Start(int x, int y, double qFlow)
+{
+	int		dir;
+	double	dif;
+
+	if( (dif = pDif->asDouble(x, y)) > M_PI_045 )	// to the right...
+	{
+		dir		= pDir->asInt(x, y) + 2;
+		dif		= 0.5 - tan(M_PI_090 - dif) / 2.0;
+	}
+	else											// to the top...
+	{
+		dir		= pDir->asInt(x, y) + 0;
+		dif		= 0.5 + tan(dif) / 2.0;
+	}
+
+	KRA_Trace(x, y, qFlow, dir, dif);
+}
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::KRA_Trace(int x, int y, double qFlow, int Direction, double from)
+{
+	bool	bLinear;
+	int		dir;
+	double	dif, to, weight;
+
+	Direction	%= 8;
+
+	x	= Get_xTo(Direction, x);
+	y	= Get_yTo(Direction, y);
+
+	//-----------------------------------------------------
+	if( pDTM->is_InGrid(x, y) && !is_Locked(x, y) )
+	{
+		Lock_Set(x, y, 1);
+
+		bLinear	= false;
+		weight	= 1.0;
+
+		dir		= pDir->asInt(x, y);
+		dif		= pDif->asDouble(x, y);
+
+		//-------------------------------------------------
+		if( Direction == dir )						// entering from the bottom...
+		{
+			if( from > 1.0 - tan(dif) )				// 1. to the right...
+			{
+				to		= GET_OUTLET_DIAG__1(from, dif);
+
+				KRA_Trace(x, y, qFlow, dir + 2, to);
+
+				if( bFlowPathWeight )
+				{
+					weight	= GET_LENGTH(1.0 - from, 1.0 - to);
+				}
+			}
+			else									// 2. to the top...
+			{
+				to		= GET_OUTLET_CROSS_1(from, dif);
+
+				KRA_Trace(x, y, qFlow, dir + 0, to);
+
+				if( bFlowPathWeight )
+				{
+					weight	= GET_LENGTH(1.0, to - from);
+				}
+			}
+		}
+		else if( (8 + Direction - dir) % 8 == 2 )	// entering from the left...
+		{
+			if( from < tan(M_PI_090 - dif) )		// 1. to the top...
+			{
+				to		= GET_OUTLET_DIAG__2(from, dif);
+
+				KRA_Trace(x, y, qFlow, dir + 0, to);
+
+				if( bFlowPathWeight )
+				{
+					weight	= GET_LENGTH(from, to);
+				}
+			}
+			else									// 2. to the right...
+			{
+				to		= GET_OUTLET_CROSS_2(from, dif);
+
+				KRA_Trace(x, y, qFlow, dir + 2, to);
+
+				if( bFlowPathWeight )
+				{
+					weight	= GET_LENGTH(1.0, from - to);
+				}
+			}
+		}
+		else										// go linear...
+		{
+			bLinear	= true;
+		}
+
+		//-------------------------------------------------
+		if( bLinear && pLinear )
+		{
+			pLinear->Add_Value(x, y, qFlow);
+		}
+		else
+		{
+			Add_Flow(x, y, weight * qFlow);
+		}
+
+		Lock_Set(x, y, 0);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//		DEMON - Digital Elevation MOdel Network			 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::DEMON_Start(int x, int y, double qFlow)
+{
+	double	dif, flow_A, flow_B;
+
+	if( (dif = pDif->asDouble(x, y)) < M_PI_045 )	// mostly to the top...
+	{
+		flow_B	= tan(dif) / 2.0;
+		flow_A	= 1.0 - flow_B;
+	}
+	else											// mostly to the right...
+	{
+		flow_A	= tan(M_PI_090 - dif) / 2.0;
+		flow_B	= 1.0 - flow_A;
+	}
+
+	flow_A	*= qFlow;
+	flow_B	*= qFlow;
+
+	if( flow_A <= DEMON_minDQV )
+	{
+		DEMON_Trace(x, y, qFlow , pDir->asInt(x, y) + 2, 0.0, 1.0);	// all to the right...
+	}
+	else if( flow_B <= DEMON_minDQV )
+	{
+		DEMON_Trace(x, y, qFlow , pDir->asInt(x, y) + 0, 0.0, 1.0);	// all to the top...
+	}
+	else
+	{
+		DEMON_Trace(x, y, flow_A, pDir->asInt(x, y) + 0, 0.0, 1.0);	// to the top...
+		DEMON_Trace(x, y, flow_B, pDir->asInt(x, y) + 2, 0.0, 1.0);	// to the right...
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_RecursiveDown::DEMON_Trace(int x, int y, double qFlow, int Direction, double from_A, double from_B)
+{
+	bool	bLinear;
+	int		dir;
+	double	dif, to_A, to_B, flow_A, flow_B, weight;
+
+	Direction	%= 8;
+
+	x	= Get_xTo(Direction, x);
+	y	= Get_yTo(Direction, y);
+
+	//-----------------------------------------------------
+	if( pDTM->is_InGrid(x, y) && !is_Locked(x, y) )
+	{
+		Lock_Set(x, y, 1);
+
+		bLinear	= false;
+		weight	= 1.0;
+
+		dir		= pDir->asInt(x, y);
+		dif		= pDif->asDouble(x, y);
+
+		//-------------------------------------------------
+		if( Direction == dir )						// entering from the bottom...
+		{
+			if( from_A >= 1.0 - tan(dif) )			// 1. completely to the right...
+			{
+				to_A	= GET_OUTLET_DIAG__1(from_A, dif);
+				to_B	= GET_OUTLET_DIAG__1(from_B, dif);
+
+				DEMON_Trace(x, y, qFlow, dir + 2, to_A, to_B);
+
+				if( bFlowPathWeight )
+				{
+					//weight	= ((1.0 - from_A) * (1.0 - to_A) - (1.0 - from_B) * (1.0 - to_B)) / 2.0;	// area...
+					weight	= GET_LENGTH(1.0 - (from_B + from_A) / 2.0, 1.0 - (to_B + to_A) / 2.0);
+				}
+			}
+			else if( from_B < 1.0 - tan(dif) )		// 2. completely to the top...
+			{
+				to_A	= GET_OUTLET_CROSS_1(from_A, dif);
+				to_B	= GET_OUTLET_CROSS_1(from_B, dif);
+
+				DEMON_Trace(x, y, qFlow, dir + 0, to_A, to_B);
+
+				if( bFlowPathWeight )
+				{
+					//weight	= from_B - from_A;	// area...
+					weight	= GET_LENGTH(1.0, to_A - from_A);
+				}
+			}
+			else									// 3. partly to the right, partly to the top...
+			{
+				to_A	= GET_OUTLET_CROSS_1(from_A, dif);
+				to_B	= GET_OUTLET_DIAG__1(from_B, dif);
+
+				dif		= 1.0 - tan(dif);
+
+				flow_A	= dif - from_A;
+				flow_B	= from_B - dif;
+				flow_A	= qFlow * flow_A / (flow_A + flow_B);
+				flow_B	= qFlow - flow_A;
+
+				if( bFlowPathWeight )
+				{
+					//weight	= (dif - from_A) + ((1.0 - dif) - (1.0 - from_B) * (1.0 - to_B)) / 2.0;	// area...
+					if( (weight = (from_A + from_B) / 2.0) < dif )	// to the top...
+					{
+						weight	= GET_LENGTH(1.0, to_A - from_A);
+					}
+					else											// to the right...
+					{
+						weight	= (1.0 - weight) / (1.0 - dif) * GET_LENGTH(1.0, to_A - from_A);
+					}
+				}
+
+				if( flow_A <= DEMON_minDQV )
+				{
+					DEMON_Trace(x, y, qFlow, dir + 2, 0.0, to_B);
+				}
+				else if( flow_B <= DEMON_minDQV )
+				{
+					DEMON_Trace(x, y, qFlow, dir + 0, to_A, 1.0);
+				}
+				else
+				{
+					DEMON_Trace(x, y, flow_A, dir + 0, to_A, 1.0);
+					DEMON_Trace(x, y, flow_B, dir + 2, 0.0, to_B);
+				}
+			}
+		}
+		else if( (8 + Direction - dir) % 8 == 2 )	// entering from the left...
+		{
+			if( from_B <= tan(M_PI_090 - dif) )		// 1. completely to the top...
+			{
+				to_A	= GET_OUTLET_DIAG__2(from_A, dif);
+				to_B	= GET_OUTLET_DIAG__2(from_B, dif);
+
+				DEMON_Trace(x, y, qFlow, dir + 0, to_A, to_B);
+
+				if( bFlowPathWeight )
+				{
+					//weight	= (from_B * to_B - from_A * to_A) / 2.0;	// area...
+					weight	= GET_LENGTH((from_A + from_B) / 2.0, (to_A + to_B) / 2.0);
+				}
+			}
+			else if( from_A > tan(M_PI_090 - dif) )	// 2. completely to the right...
+			{
+				to_A	= GET_OUTLET_CROSS_2(from_A, dif);
+				to_B	= GET_OUTLET_CROSS_2(from_B, dif);
+
+				DEMON_Trace(x, y, qFlow, dir + 2, to_A, to_B);
+
+				if( bFlowPathWeight )
+				{
+					//weight	= from_B - from_A;	// area...
+					weight	= GET_LENGTH(1.0, from_A - to_A);
+				}
+			}
+			else									// 3. partly to the top, partly to the right...
+			{
+				to_A	= GET_OUTLET_DIAG__2(from_A, dif);
+				to_B	= GET_OUTLET_CROSS_2(from_B, dif);
+
+				dif		= tan(M_PI_090 - dif);
+
+				flow_A	= dif - from_A;
+				flow_B	= from_B - dif;
+				flow_A	= qFlow * flow_A / (flow_A + flow_B);
+				flow_B	= qFlow - flow_A;
+
+				if( bFlowPathWeight )
+				{
+					//weight	= (from_B - dif) + (dif - (from_A * to_A)) / 2.0;	// area...
+					if( (weight = (from_A + from_B) / 2.0) > dif )
+					{
+						weight	= GET_LENGTH(1.0, from_B - to_B);
+					}
+					else
+					{
+						weight	= weight / dif * GET_LENGTH(1.0, from_B - to_B);
+					}
+				}
+
+				if( flow_A <= DEMON_minDQV )
+				{
+					DEMON_Trace(x, y, qFlow, dir + 2, 0.0, to_B);
+				}
+				else if( flow_B <= DEMON_minDQV )
+				{
+					DEMON_Trace(x, y, qFlow, dir + 0, to_A, 1.0);
+				}
+				else
+				{
+					DEMON_Trace(x, y, flow_A, dir + 0, to_A, 1.0);
+					DEMON_Trace(x, y, flow_B, dir + 2, 0.0, to_B);
+				}
+			}
+		}
+		else
+		{
+			bLinear	= true;
+		}
+
+		//-------------------------------------------------
+		if( bLinear && pLinear )
+		{
+			pLinear->Add_Value(x, y, qFlow);
+		}
+		else
+		{
+			if( bFlowPathWeight )
+			{
+				Add_Flow(x, y, weight * qFlow);
+				//Add_Flow(x, y, weight >= qFlow ? qFlow : weight * qFlow);
+			}
+			else
+			{
+				Add_Flow(x, y, qFlow);
+			}
+		}
+
+		Lock_Set(x, y, 0);
+	}
+}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.h b/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveDown.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveDown.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp
new file mode 100644
index 0000000..0607f48
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp
@@ -0,0 +1,471 @@
+/**********************************************************
+ * Version $Id: Flow_RecursiveUp.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 Flow_RecursiveUp.cpp                  //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Flow_RecursiveUp.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_RecursiveUp::CFlow_RecursiveUp(void)
+{
+	Set_Name		(_TL("Catchment Area (Recursive)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2001"));
+
+	Set_Description	(_TW(
+		"Recursive upward processing of cells for calculation of flow accumulation and related parameters. "
+		"This set of algorithms processes recursively all upwards connected cells until each cell of the DEM has been processed.\n\n"
+
+		"References:\n\n"
+
+		"Deterministic 8\n"
+		"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
+		"    'The extraction of drainage networks from digital elevation data',\n"
+		"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
+
+		"Rho 8:\n"
+		"- Fairfield, J. / Leymarie, P. (1991):\n"
+		"    'Drainage networks from grid digital elevation models',\n"
+		"    Water Resources Research, 27:709-717\n\n"
+
+		"Deterministic Infinity:\n"
+		"- Tarboton, D.G. (1997):\n"
+		"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
+		"    Water Resources Research, Vol.33, No.2, p.309-319\n\n"
+
+		"Multiple Flow Direction:\n"
+		"- Freeman, G.T. (1991):\n"
+		"    'Calculating catchment area with divergent flow based on a regular grid',\n"
+		"    Computers and Geosciences, 17:413-22\n\n"
+
+		"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
+		"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
+		"    Hydrological Processes, 5:59-79\n\n")
+	);
+
+
+	//-----------------------------------------------------
+	// Input...
+
+	Parameters.Add_Grid(
+		NULL	, "TARGETS"		, _TL("Target Areas"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Grid(
+		NULL	, "FLOWLEN"		, _TL("Flow Path Length"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+
+	//-----------------------------------------------------
+	// Method...
+
+	Parameters.Add_Choice(
+		NULL	, "Method"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("Deterministic 8"),
+			_TL("Rho 8"),
+			_TL("Deterministic Infinity"),
+			_TL("Multiple Flow Direction")
+		), 3
+	);
+
+
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL	, "CONVERGENCE"	, _TL("Convergence"),
+		_TL("Convergence factor for Multiple Flow Direction Algorithm (Freeman 1991)"),
+		PARAMETER_TYPE_Double	, 1.1
+	);
+
+	
+	//-----------------------------------------------------
+	// Initialisations...
+
+	Flow	= NULL;
+}
+
+//---------------------------------------------------------
+CFlow_RecursiveUp::~CFlow_RecursiveUp(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::On_Create(void)
+{
+	int		x, y, Method;
+
+	double	*p;
+
+	//-----------------------------------------------------
+	On_Destroy();
+
+	Flow	= (double ***)SG_Malloc(    Get_NY    () * sizeof(double **));
+	p		= (double   *)SG_Malloc(8 * Get_NCells() * sizeof(double   ));
+
+	for(y=0; y<Get_NY(); y++)
+	{
+		Flow[y]	= (double **)SG_Malloc( Get_NX    () * sizeof(double  *));
+
+		for(x=0; x<Get_NX(); x++, p+=8)
+		{
+			Flow[y][x]	= p;
+		}
+	}
+
+	//-----------------------------------------------------
+	Lock_Create();
+
+	Method	= Parameters("Method")->asInt();
+
+	memset(Flow[0][0], 0, 8 * Get_NCells() * sizeof(double) );
+
+	for(y=0; y<Get_NY(); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( pRoute && pRoute->asChar(x,y) > 0 )
+			{
+				Flow[y][x][pRoute->asChar(x,y) % 8]	= 1.0;
+			}
+			else
+			{
+				switch( Method )
+				{
+					case 0:
+						Set_D8(x,y);
+						break;
+
+					case 1:
+						Set_Rho8(x,y);
+						break;
+
+					case 2:
+						Set_DInf(x,y);
+						break;
+
+					case 3:
+						Set_MFD(x,y);
+						break;
+				}
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::On_Destroy(void)
+{
+	int		y;
+
+	if( Flow )
+	{
+		SG_Free(Flow[0][0]);
+
+		for(y=0; y<Get_NY(); y++)
+		{
+			SG_Free(Flow[y]);
+		}
+
+		SG_Free(Flow);
+
+		Flow	= NULL;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::On_Initialize(void)
+{
+	pFlowPath			= Parameters("FLOWLEN")->asGrid();
+
+	MFD_Converge		= Parameters("CONVERGENCE")->asDouble();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_RecursiveUp::Calculate(void)
+{
+	CSG_Grid	*pTargets	= Parameters("TARGETS")->asGrid();
+
+	On_Create();
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !pTargets || !pTargets->is_NoData(x, y) )
+			{
+				Get_Flow(x, y);
+			}
+		}
+	}
+
+	On_Destroy();
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CFlow_RecursiveUp::Calculate(int x, int y)
+{
+	On_Create();
+
+	Get_Flow(x,y);
+
+	On_Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::Get_Flow(int x, int y)
+{
+	int		i, ix, iy, j;
+
+	double	jFlow;
+
+	if( !is_Locked(x,y) )
+	{
+		Lock_Set(x,y);
+
+		Init_Cell(x,y);
+
+		for(i=0, j=4; i<8; i++, j=(j+1)%8)
+		{
+			ix	= Get_xTo(i,x);
+			iy	= Get_yTo(i,y);
+
+			if( is_InGrid(ix,iy) )
+			{
+				jFlow	= Flow[iy][ix][j];
+
+				if( jFlow > 0 )
+				{
+					Get_Flow(ix,iy);
+
+					Add_Fraction(ix,iy,j,jFlow);
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::Set_D8(int x, int y)
+{
+	int		Direction;
+
+	Direction	= pDTM->Get_Gradient_NeighborDir(x,y);
+
+	if( Direction >= 0 )
+	{
+		Flow[y][x][Direction % 8]	= 1.0;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::Set_Rho8(int x, int y)
+{
+	int		Direction;
+
+	double 	Slope, Aspect;
+
+	Get_Gradient(x, y, Slope, Aspect);
+
+	Aspect	*= M_RAD_TO_DEG;
+
+	if( Aspect >= 0 )
+	{
+		Direction	= (int)(Aspect / 45.0);
+
+		if( fmod(Aspect,45) / 45.0 > rand() / (double)RAND_MAX )
+			Direction++;
+
+		Direction	%= 8;
+
+		Flow[y][x][Direction]	= 1.0;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::Set_DInf(int x, int y)
+{
+	int		Direction;
+
+	double 	Slope, Aspect;
+
+	Get_Gradient(x, y, Slope, Aspect);
+
+	Aspect	*= M_RAD_TO_DEG;
+
+	if( Aspect >= 0 )
+	{
+		Direction	= (int)(Aspect / 45.0);
+		Aspect		= fmod(Aspect,45) / 45.0;
+
+		Flow[y][x][(Direction    ) % 8]	= 1 - Aspect;
+		Flow[y][x][(Direction + 1) % 8]	=     Aspect;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_RecursiveUp::Set_MFD(int x, int y)
+{
+	int		i, ix, iy;
+
+	double	z, d, *dz, dzSum;
+
+	z		= pDTM->asDouble(x,y);
+	dz		= Flow[y][x];
+	dzSum	= 0;
+
+	for(i=0; i<8; i++)
+	{
+		ix	= Get_xTo(i,x);
+		iy	= Get_yTo(i,y);
+
+		if( is_InGrid(ix,iy) )
+		{
+			d	= z - pDTM->asDouble(ix,iy);
+
+			if( d > 0 )
+				dzSum	+= dz[i]	= pow(d / Get_Length(i), MFD_Converge);
+		}
+	}
+
+	if( dzSum )
+	{
+		for(i=0; i<8; i++)
+			if( dz[i] > 0 )
+				dz[i]	/= dzSum;
+	}
+}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.h b/src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveUp.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.h
rename to src/modules/terrain_analysis/ta_hydrology/Flow_RecursiveUp.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Helper.cpp b/src/modules/terrain_analysis/ta_hydrology/Helper.cpp
new file mode 100644
index 0000000..071ac67
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Helper.cpp
@@ -0,0 +1,392 @@
+/**********************************************************
+ * Version $Id: Helper.cpp 1016 2011-04-27 18:40:36Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    Helper.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "Helper.h"
+
+void getNextCell(
+		CSG_Grid *g,
+		int iX,
+        int iY,
+		int &iNextX,
+		int &iNextY) {
+
+    float fDist;
+    float fMaxSlope;
+    float fSlope;
+
+    fMaxSlope = 0;
+    fSlope = 0;
+
+    if (iX < 1 || iX >= g->Get_NX() - 1 || iY < 1 || iY >= g->Get_NY() - 1
+            || g->is_NoData(iX,iY)) {
+        iNextX = iX;
+		iNextY = iY;
+		return;
+    }// if
+
+    for (int i = -1; i < 2; i++) {
+        for (int j = -1; j < 2; j++) {                	
+            if (!g->is_NoData(iX + i, iY + i)){
+                if (i == 0 || j == 0) {
+                    fDist = 1.0f;
+                }// if
+                else {
+                    fDist = 1.414f;
+                }// else
+                fSlope = (g->asFloat(iX+i,iY+j)
+                         - g->asFloat(iX,iY)) / fDist;                                				
+                if (fSlope <= fMaxSlope) {
+                    iNextX = iX+i;
+					iNextY = iY+j;                        
+                    fMaxSlope = fSlope;
+                }// if
+            }//if                    
+        }// for
+    }// for
+
+}// method
+
+void getNextCell(
+		CSG_Grid *g,
+		CSG_Grid *g2,
+		int iX,
+        int iY,
+		int &iNextX,
+		int &iNextY) {
+	
+	double fDist;
+    double fMaxSlope;
+    double fSlope;
+
+    fMaxSlope = 0.0000001;
+    fSlope = 0;
+
+    if (iX < 1 || iX >= g->Get_NX() - 1 || iY < 1 || iY >= g->Get_NY() - 1
+            || g->is_NoData(iX,iY)) {
+        iNextX = iX;
+		iNextY = iY;
+		return;
+    }// if
+
+    for (int i = -1; i < 2; i++) {
+        for (int j = -1; j < 2; j++) {                	
+            if (!g->is_NoData(iX+i,iY+j) &&
+				!g2->is_NoData(iX+i,iY+j)){ 
+                if (i == 0 || j == 0) {
+                    fDist = 1.0f;
+                }// if
+                else {
+                    fDist = 1.414f;
+                }// else
+                fSlope = (g->asFloat(iX+i,iY+j)
+                         - g->asFloat(iX,iY)) / fDist;                                				
+                if (fSlope < fMaxSlope) {
+                    iNextX = iX+i;
+					iNextY = iY+j;                        
+                    fMaxSlope = fSlope;
+                }// if
+            }//if                    
+        }// for
+    }// for
+
+}// method
+
+double FlowDistance(CSG_Grid *pDEM,
+					CSG_Grid *pBasinGrid,
+					int iBasin,
+				    int iX,
+				    int iY,
+				    int iX2,
+				    int iY2){// result in m, coords in grid coords. Returns 0 if no distance is calculated.
+            
+    bool bIsInBasin;
+	double dDist = 1;
+	int iNextX = iX;
+	int iNextY = iY;      
+
+    if (iX2 <= 0 || iX2 >= pDEM->Get_NX() || iY2 <= 0 || iY2 >= pDEM->Get_NY() || 
+            iX <= 0 || iX >= pDEM->Get_NX() || iY <= 0 || iY >= pDEM->Get_NY() ) {
+        return 0;
+    }// if
+    do {
+        iX = iNextX;
+		iY = iNextY;
+        getNextCell(pDEM,iX,iY,iNextX,iNextY);            
+        if (fabs((double)(iX - iNextX + iY - iNextY)) == 1.0) {
+            dDist = dDist + pDEM->Get_Cellsize();
+        }// if
+        else {
+            dDist = dDist + 1.414 * pDEM->Get_Cellsize();
+        }// else
+        if (iX == iX2 && iY == iY2) {
+            return dDist;
+        }// if
+		if (iBasin == GLOBAL_BASIN){
+			bIsInBasin = !pBasinGrid->is_NoData(iX,iY);
+		}//if
+		else{
+			bIsInBasin = (pBasinGrid->asInt(iX,iY) == iBasin);
+		}//else
+    }while (bIsInBasin
+		&&(iX!=iNextX || iY!=iNextY));
+
+    return 0;
+
+}// method
+
+
+double AccFlow(CSG_Grid *pGrid, CSG_Grid *pDEM, int iX, int iY){
+	
+    int iNextX, iNextY;
+	double dAccFlow = pGrid->Get_Cellsize()*pGrid->Get_Cellsize();
+			
+	for (int i = -1; i<2; i++){
+		for (int j = -1; j<2; j++){
+			if (!(i == 0) || !(j == 0)) {
+				getNextCell(pDEM, iX + i, iY + j, iNextX, iNextY);
+				if (iNextY == iY && iNextX == iX) {
+					if (pGrid->asDouble(iX+i,iY+j)!=0){
+						dAccFlow += pGrid->asDouble(iX+i,iY+j);
+					}//if
+					else{
+						dAccFlow += AccFlow (pGrid,pDEM,iX+i,iY+j);
+					}//else
+				}// if				
+			}//if				
+		}//for
+	}//for
+
+	pGrid->Set_Value(iX,iY,dAccFlow);
+
+	return dAccFlow;
+
+}// function
+
+double CalculateBasinGrid(CSG_Grid *pBasinGrid, 
+						CSG_Grid *pDEM, 			
+						int iOutletX, 
+						int iOutletY){
+
+	pBasinGrid->Assign((double)0);
+	double dAccFlow = AccFlow(pBasinGrid,pDEM,iOutletX,iOutletY);
+
+	return dAccFlow;
+
+}//function
+
+void CalculateFlowAccGrid(CSG_Grid *pFlowAccGrid, 
+						CSG_Grid *pDEM){
+
+	int x,y;
+	
+	pFlowAccGrid->Assign((double)0);
+	for(y=0; y<pDEM->Get_NY(); y++){
+		for(x=0; x<pDEM->Get_NX(); x++){
+			AccFlow(pFlowAccGrid,pDEM,x,y);
+		}//for
+	}//for
+
+	pFlowAccGrid->Set_Description(_TL("Acc. Area"));
+	pFlowAccGrid->Set_Unit(_TL("m2"));
+	
+}//function
+
+
+/*
+#include <vector>
+
+TSG_Point ** RiverProfile(int iX, 
+				  int iY, 
+				  CSG_Grid* pDEM, 
+				  CSG_Grid* pBasinGrid,
+				  CSG_Grid* pExtGrid,
+				  int &iProfileLength){
+
+    int i;
+	float fLength = 0;        	
+	int iNextX, iNextY;
+	CSG_Points	Profile;
+	CSG_Points	Ext;
+	TSG_Point		P;
+	TSG_Point		**pProfile;
+	iProfileLength = 0;
+	
+	if (!pBasinGrid->is_NoData(iX,iY)) {
+        iNextX = iX;
+		iNextY = iY;
+		do {
+			iX = iNextX;
+			iY = iNextY;
+			getNextCell(pDEM, iX, iY, iNextX, iNextY);
+		
+			if (fabs(iX - iNextX + iY - iNextY) == 1) {
+	            fLength += pDEM->Get_DX();
+            }//if
+            else {
+				fLength += (1.414f * pDEM->Get_DX());
+            }//else			
+			P.x = fLength;
+			P.y = pDEM->asFloat(iNextX, iNextY);
+			Profile.push_back(P);
+			P.y = pExtGrid->asFloat(iNextX, iNextY);
+			Ext.push_back(P);
+		}while (!pBasinGrid->is_NoData(iX, iY)
+			&& (iX != iNextX || iY != iNextY));
+
+		pProfile = new Pt*[2];
+		for (i = 0; i<2; i++){
+			pProfile[i] = new Pt [Profile.size()];
+		}//for
+		for (i = 0; i<Profile.size(); i++){			
+			pProfile[0][i]=Profile.at(i);		
+			pProfile[1][i]=Ext.at(i);		
+		}//for
+		iProfileLength = Profile.size();
+	
+	}// if
+
+	return pProfile;
+
+}//method
+
+Pt* RiverCoords(int iX,  //the resulting coords are grid coords, 
+				  int iY, 
+				  CSG_Grid* pDEM, 
+				  CSG_Grid* pBasinGrid, 				   
+				  int &iProfileLength){
+
+    float fLength = 0;        	
+	int iNextX, iNextY;
+	CSG_Points	Profile;
+	TSG_Point		P;
+	TSG_Point		*pProfile;
+	iProfileLength = 0;
+	
+	if (!pBasinGrid->is_NoData(iX,iY)) {
+        iNextX = iX;
+		iNextY = iY;
+		do {
+			iX = iNextX;
+			iY = iNextY;
+			getNextCell(pDEM, iX, iY, iNextX, iNextY);				
+			P.x = iX;
+			P.y = iY;
+			Profile.push_back(P);
+		}while (!pBasinGrid->is_NoData(iX, iY)
+			&& (iX != iNextX || iY != iNextY));
+
+		pProfile = new Pt [Profile.size()];
+		for (int i = 0; i<Profile.size(); i++){
+			pProfile[i]=Profile.at(i);
+		}//for
+		iProfileLength = Profile.size();
+	
+	}// if
+
+	return pProfile;
+
+}//method
+
+float DrainageDensity(CSG_Shapes *pHeaders,
+					  CSG_Shapes *pBasins,
+					  CSG_Grid *pBasinGrid,
+					  CSG_Grid *pDEM){
+
+	CSG_Grid * pChannelsGrid;	
+	float fLength = 0;        
+	int iX, iY;
+	int iNextX, iNextY;
+
+	pChannelsGrid = new CSG_Grid(pDEM, SG_DATATYPE_Byte);
+	pChannelsGrid->Assign(0);
+		
+	for (int i = 0; i < pHeaders->Get_Count(); i++) {
+
+        iX = (pHeaders->Get_Shape(i)->Get_Point(0).x - pBasinGrid->Get_XMin())/pBasinGrid->Get_DX();
+		iY = (pHeaders->Get_Shape(i)->Get_Point(0).y - pBasinGrid->Get_YMin())/pBasinGrid->Get_DX();  
+
+        if (!pBasinGrid->is_NoData(iX,iY)) {
+                iNextX = iX;
+				iNextY = iY;
+			do {
+				iX = iNextX;
+				iY = iNextY;
+				getNextCell(pDEM, iX, iY, iNextX, iNextY);
+			
+				if (fabs(iX - iNextX + iY - iNextY) == 1) {
+	                fLength += pChannelsGrid->Get_DX();
+                }//if
+                else {
+					fLength += (1.414f * pChannelsGrid->Get_DX());
+                }//else
+                if (pChannelsGrid->asFloat(iX,iY) == 0) {
+				    pChannelsGrid->Set_Value(iX, iY, 1);
+                }// if
+                else {
+					break;
+                }// else								
+			}while (!pBasinGrid->is_NoData(iX, iY)
+				&& (iX != iNextX || iY != iNextY));
+
+		}// if
+	}// for	
+
+	float fArea = pBasins->Get_Shape(0)->asFloat(4);
+		
+	return fLength / fArea / 10000.0;
+
+}//method
+
+void ClosingPoint(CSG_Grid* pDEM, 
+				  CSG_Grid* pBasinGrid, 
+				  int &iClosingX,
+				  int &iClosingY){
+
+    int x,y;
+	int iX,iY;
+	int iNextX, iNextY;
+
+	for (x = 0; x<pBasinGrid->Get_NX(); x++){
+		for (y = 0; y<pBasinGrid->Get_NY(); y++){
+			if (!pBasinGrid->is_NoData(x,y)){
+				iX = x;
+				iY = y;
+				goto out;
+			}//if
+		}//for
+	}//for
+	return;
+out:
+
+    iNextX = iX;
+	iNextY = iY;
+	do {
+		iX = iNextX;
+		iY = iNextY;
+		getNextCell(pDEM, iX, iY, iNextX, iNextY);
+	}while (!pBasinGrid->is_NoData(iX, iY)
+		&& (iX != iNextX || iY != iNextY));
+
+	iClosingX = iX;
+	iClosingY = iY;
+
+}//method*/
\ No newline at end of file
diff --git a/src/modules/terrain_analysis/ta_hydrology/Helper.h b/src/modules/terrain_analysis/ta_hydrology/Helper.h
new file mode 100644
index 0000000..a0195c5
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Helper.h
@@ -0,0 +1,40 @@
+/**********************************************************
+ * Version $Id: Helper.h 1016 2011-04-27 18:40:36Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    Helper.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include <saga_api/saga_api.h>
+
+#define GLOBAL_BASIN -1
+
+void getNextCell(CSG_Grid*,int,int,int &,int &);
+void getNextCell(CSG_Grid*,CSG_Grid*,int,int,int&,int&);
+double FlowDistance(CSG_Grid*,CSG_Grid*,int,int,int,int,int);
+
+double CalculateBasinGrid(CSG_Grid*, CSG_Grid*, int, int);
+void CalculateFlowAccGrid(CSG_Grid*, CSG_Grid*);
+
+//TSG_Point ** RiverProfile(int, int, CSG_Grid*, CSG_Grid*, CSG_Grid*, int &);
+//TSG_Point  * RiverCoords (int, int, CSG_Grid*, CSG_Grid*, int &);
+//float DrainageDensity(CSG_Shapes*, CSG_Shapes*, CSG_Grid*, CSG_Grid*);
+//void ClosingPoint(CSG_Grid*, CSG_Grid*, int &, int &);
diff --git a/src/modules/terrain_analysis/ta_hydrology/IsochronesConst.cpp b/src/modules/terrain_analysis/ta_hydrology/IsochronesConst.cpp
new file mode 100644
index 0000000..a5de9d2
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/IsochronesConst.cpp
@@ -0,0 +1,154 @@
+/**********************************************************
+ * Version $Id: IsochronesConst.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    IsochronesConst.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "Helper.h"
+#include "IsochronesConst.h"
+
+CIsochronesConst::CIsochronesConst(void){
+
+	Set_Name(_TL("Isochrones Constant Speed"));
+	Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya"));
+	Set_Description	(_TW(
+		"(c) 2004 by Victor Olaya. Isochrones calculation with constant speed"));
+
+	Parameters.Add_Grid(NULL, 
+						"DEM", 
+						_TL("Elevation Grid"), 
+						_TL(""), 
+						PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL, 
+						"TIME", 
+						_TL("Time Out (h)"), 
+						_TL(""), 
+						PARAMETER_OUTPUT, 
+						true, 
+						SG_DATATYPE_Double);
+
+}//constructor
+
+
+CIsochronesConst::~CIsochronesConst(void){
+	On_Execute_Finish();
+}
+
+
+void CIsochronesConst::writeTimeOut(
+        int iX1,
+        int iY1,
+        int iX2,
+        int iY2) {
+	
+    int iNextX, iNextY;
+	double dDist = 1;
+	
+	if (iX1 < 0 || iX1 >= m_pDEM->Get_NX() || iY1 < 0 || iY1 >= m_pDEM->Get_NY()
+            || m_pDEM->is_NoData(iX1,iY1)) {        
+    }// if
+	else {				
+		if (abs(iX1 - iX2 + iY1 - iY2) == 1) {
+            dDist = m_pDEM->Get_Cellsize();
+        }// if
+        else {
+            dDist = 1.414 * m_pDEM->Get_Cellsize();
+        }// else
+		m_pTime->Set_Value(iX1,iY1,m_pTime->asDouble(iX2,iY2) + dDist);        
+
+		for (int i = -1; i<2; i++){
+			for (int j = -1; j<2; j++){
+				if (!(i == 0) || !(j == 0)) {
+					getNextCell(m_pDEM, iX1 + i, iY1 + j, iNextX, iNextY);
+					if (iNextY == iY1 && iNextX == iX1) {
+						writeTimeOut(iX1 + i, iY1 + j, iX1, iY1);
+					}// if				
+				}//if				
+			}//for
+		}//for
+    }// else
+
+}// method
+
+bool CIsochronesConst::On_Execute(void){
+	
+	m_pDEM = Parameters("DEM")->asGrid(); 
+	m_pTime = Parameters("TIME")->asGrid();
+	m_pTime->Assign(0.0);
+
+	return true;
+
+}//method
+
+bool CIsochronesConst::On_Execute_Finish(void)
+{
+	return( true );
+}
+
+bool CIsochronesConst::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
+{	
+	int x,y;
+	int iX, iY;		
+	int iHighX, iHighY;
+
+	if(	Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iX, iY) )
+	{
+		return( false );
+	}
+
+	m_pTime->Assign(0.0);
+	
+	writeTimeOut(iX, iY, iX, iY);
+    
+	double dMax = m_pTime->Get_ZMax();
+
+    for(y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(x=0; x<Get_NX(); x++){
+			double dValue = m_pTime->asDouble(x,y);
+            if (dValue == dMax){
+				iHighX = x;
+				iHighY = y;				
+			}//if
+        }// for
+    }// for
+	
+	double dMaxDist = m_pTime->Get_ZMax();
+	double dH1 = m_pDEM->asDouble(iX,iY);
+	double dH2 = m_pDEM->asDouble(iHighX,iHighY);
+	double dConcTime = pow(0.87 * pow(dMaxDist / 1000, 3)
+                / (dH2 - dH1),
+                0.385);
+	double dSpeed = dMaxDist / dConcTime;
+	
+	for(y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(x=0; x<Get_NX(); x++){
+			if (m_pTime->asDouble(x,y)){
+				m_pTime->Set_Value(x,y, m_pTime->asDouble(x,y)/dSpeed);
+			}//if
+		}//for
+	}//for
+
+	m_pTime->Set_NoData_Value(0.0);
+
+	DataObject_Update(m_pTime, true);
+
+	return (true);
+
+}//method
diff --git a/src/modules/terrain_analysis/ta_hydrology/IsochronesConst.h b/src/modules/terrain_analysis/ta_hydrology/IsochronesConst.h
new file mode 100644
index 0000000..a4f297e
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/IsochronesConst.h
@@ -0,0 +1,48 @@
+/**********************************************************
+ * Version $Id: IsochronesConst.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    IsochronesConst.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#ifndef HEADER_INCLUDED__IsochronesConst_H
+#define HEADER_INCLUDED__IsochronesConst_H
+
+#include "MLB_Interface.h"
+
+class CIsochronesConst : public CSG_Module_Grid_Interactive
+{
+public:
+	CIsochronesConst(void);
+	virtual ~CIsochronesConst(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
+
+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);
+
+private:
+	CSG_Grid *m_pDEM;
+	CSG_Grid *m_pTime;	
+	void writeTimeOut(int,int,int,int);
+
+};
+
+#endif // #ifndef HEADER_INCLUDED__IsochronesConst_H
diff --git a/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp
new file mode 100644
index 0000000..e827d00
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp
@@ -0,0 +1,361 @@
+/**********************************************************
+ * Version $Id: IsochronesVar.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    IsochronesVar.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+#include "IsochronesVar.h"
+#include "Helper.h"
+
+#ifndef max
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+
+CIsochronesVar::CIsochronesVar(void){
+
+	Parameters.Set_Name(_TL("Isochrones Variable Speed"));
+	Parameters.Set_Description(_TW(
+		"(c) 2004 by Victor Olaya. C�lculo del tiempo de salida con velocidad variable.\r\n"
+		"References:\r\n"
+		"1. Al-Smadi, Mohammad: Incorporating spatial and temporal variation of "
+		"watershed response in a gis-based hydrologic model. Faculty of the Virginia Polythecnic"
+		"Insitute and State University. MsC Thesis. 1998 \r\n"
+		"Available at scholar.lib.vt.edu/theses/available/ etd-121698-112858/unrestricted/smadi.pdf"
+		"2. Mart�nez �lvarez, V.; Dal-R� Tenreiro, R.; Garc�a Garc�a, A. I.; Ayuga T�llez, F. "
+		"Modelaci�n distribuida de la escorrent�a superficial en peque�as cuencas mediante SIG. Evaluaci�n experimental.\r\n "
+		"3. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"));
+
+	Parameters.Add_Grid(NULL,
+						"DEM",
+						_TL("Elevation"),
+						_TL(""),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL,
+						"SLOPE",
+						_TL("Slope"),
+						_TL(""),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL,
+						"FLOWACC",
+						_TL("Catchment Area"),
+						_TL(""),
+						PARAMETER_INPUT);
+
+	Parameters.Add_Grid(NULL,
+						"CN",
+						_TL("Curve Number"),
+						_TL(""),
+						PARAMETER_INPUT_OPTIONAL);
+
+	Parameters.Add_Grid(NULL,
+						"MANNING",
+						_TL("Manning's N"),
+						_TL(""),
+						PARAMETER_INPUT_OPTIONAL);
+
+	Parameters.Add_Value(NULL,
+						"AVGMANNING",
+						_TL("Avg. Manning's N"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						0.15);
+
+	Parameters.Add_Value(NULL,
+						"AVGCN",
+						_TL("Avg. Curve Number"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						75);
+
+	Parameters.Add_Value(NULL,
+						"THRSMIXED",
+						_TL("Mixed Flow Threshold (ha)"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						18);
+
+	Parameters.Add_Value(NULL,
+						"THRSCHANNEL",
+						_TL("Channel Definition Threshold (ha)"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						360);
+
+	Parameters.Add_Value(NULL,
+						"AVGRAINFALL",
+						_TL("Avg. Rainfall Intensity (mm/h)"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						1);
+
+
+	Parameters.Add_Value(NULL,
+						"CHANSLOPE",
+						_TL("Channel side slope(m/m)"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						0.5);
+
+	Parameters.Add_Value(NULL,
+						"MINSPEED",
+						_TL("Min. Flow Speed (m/s)"),
+						_TL(""),
+						PARAMETER_TYPE_Double,
+						0.05);
+
+	Parameters.Add_Grid(NULL,
+						"TIME",
+						_TL("Time Out(h)"),
+						_TL(""),
+						PARAMETER_OUTPUT,
+						true,
+						SG_DATATYPE_Double);
+
+	Parameters.Add_Grid(NULL,
+						"SPEED",
+						_TL("Speed (m/s)"),
+						_TL(""),
+						PARAMETER_OUTPUT,
+						true,
+						SG_DATATYPE_Double);
+
+}//constructor
+
+
+CIsochronesVar::~CIsochronesVar(void){
+	Execute_Finish();
+}
+
+
+void CIsochronesVar::writeTimeOut(
+        int iX1,
+        int iY1,
+        int iX2,
+        int iY2) {
+
+    double dDist = 1;
+    double dD = 0;
+    double dSlope;
+    double dSpeed;
+    double dQ = 0;
+    double dH;
+    double dSup;
+    double dInf;
+    double dAcc;
+    double dArea = 0;
+    double dPerim;
+    double dDif;
+    double dManning;
+	double dCN;
+    double dI = 0;
+	int iIter;
+	int iNextX, iNextY;
+
+	if (iX1 < 0 || iX1 >= m_pDEM->Get_NX() || iY1 < 0 || iY1 >= m_pDEM->Get_NY()
+            || m_pDEM->asFloat(iX1,iY1) == m_pDEM->Get_NoData_Value()) {
+    }// if
+	else {
+
+		if (m_pCN!=NULL){
+			dCN = m_pCN->asDouble(iX1, iY1);
+			if (dCN == m_pCN->Get_NoData_Value()) {
+                dCN = m_dCN;
+			}// if
+		}//if
+		else{
+			dCN = m_dCN;
+		}//else
+		dI = Runoff(m_dRainfall, dCN);
+		dI /= 3600.0;// in mm/s
+        dI /= 1000.0;// m/s of runoff;
+
+		if (abs(iX1 - iX2 + iY1 - iY2) == 1) {
+            dDist = m_pDEM->Get_Cellsize();
+        }// if
+        else {
+            dDist = 1.44 * m_pDEM->Get_Cellsize();
+        }// else
+		dSlope = m_pSlope->asDouble(iX1,iY1);
+		dSlope = fabs(tan(dSlope));
+		dSlope = max(0.001, dSlope);
+		dAcc = m_pCatchArea->asDouble(iX1,iY1);
+        if (dAcc < m_dMixedThresh) {
+            dD = sqrt(2.0 * dAcc / 3.14159);
+			if (m_pManning!=NULL){
+				dManning = m_pManning->asDouble(iX1, iY1);
+				if (dManning == m_pManning->Get_NoData_Value()) {
+	                dManning = m_dManning;
+		        }// if
+			}//id
+			else{
+				dManning = m_dManning;
+			}//else
+            dSpeed = max(m_dMinSpeed, pow(dI * dD, 0.4)
+                    * pow(dSlope, 0.3) / pow(dManning, 0.6));
+        }// if
+        else{
+			if (dAcc < m_dChannelThresh) {
+				dManning = 0.06;
+			}//if
+			else{
+				dManning= 0.05;
+			}//if
+            dQ = dI * dAcc; // Q m3/s
+            dSup = 60;
+            dInf = 0;
+            dH = 2;
+            dArea = dH * dH / m_dChannelSlope;
+            dPerim = 2.0 * (dH / m_dChannelSlope + sqrt(dH * dH
+					+ pow(dH / m_dChannelSlope, 2.0)));
+            dDif = (sqrt(dSlope)
+                    * pow(dArea, 5.0 / 3.0)
+                    / pow(dPerim, 2.0 / 3.0) / dManning)
+                    - dQ;
+            iIter = 0;
+			do {
+                if (dDif > 0) {
+                    dSup = dH;
+                    dH = (dInf + dH) / 2.0;
+                }// if
+                else if (dDif < 0) {
+                    dInf = dH;
+                    dH = (dSup + dH) / 2.0;
+                }// else if
+                dArea = dH * dH / m_dChannelSlope;
+                dPerim = 2.0 * (dH / m_dChannelSlope + sqrt(dH * dH
+						+ pow(dH / m_dChannelSlope, 2.0)));
+                dDif = (sqrt(dSlope)
+                        * pow(dArea, 5.0 / 3.0)
+                        / pow(dPerim, 2.0 / 3.0) / dManning)
+                        - dQ;
+				iIter++;
+            }while (fabs(dDif) > 0.1);
+            dSpeed = max(m_dMinSpeed, dQ / dArea);
+        }// else
+
+		m_pTime->Set_Value(iX1,iY1,m_pTime->asDouble(iX2,iY2) + dDist / dSpeed);
+		m_pSpeed->Set_Value(iX1,iY1, dSpeed);
+
+		for (int i = -1; i<2; i++){
+			for (int j = -1; j<2; j++){
+				if (!(i == 0) || !(j == 0)) {
+					getNextCell(m_pDEM, iX1 + i, iY1 + j, iNextX, iNextY);
+					if (iNextY == iY1 && iNextX == iX1) {
+						writeTimeOut(iX1 + i, iY1 + j, iX1, iY1);
+					}// if
+				}//if
+			}//for
+		}//for
+
+    }// else
+
+}// method
+
+double CIsochronesVar::Runoff(
+        double dRainfall,
+        double dCN) {
+
+    double dS;
+    double dRunoff;
+
+    dS = (25400.0 / dCN) - 254;
+
+    if (dRainfall < (0.2 * dS)) {
+        return 0.1; //can�t be 0, because that would mean speed = 0
+    }// if
+
+    dRunoff = pow(dRainfall - 0.2 * dS, 2)
+            / (dRainfall + 0.8 * dS);
+
+    return dRunoff;
+
+}// method
+
+void CIsochronesVar::ZeroToNoData(void){
+
+
+    for(int y=0; y<Get_NY() && Set_Progress(y); y++){
+		for(int x=0; x<Get_NX(); x++){
+            if (m_pTime->asDouble(x,y) == 0){
+				m_pTime->Set_Value(x,y,m_pTime->Get_NoData_Value());
+			}//if
+            if (m_pSpeed->asDouble(x,y) == 0){
+				m_pSpeed->Set_Value(x,y,m_pSpeed->Get_NoData_Value());
+			}//if
+        }// for
+    }// for
+
+}//method
+
+bool CIsochronesVar::On_Execute(void){
+
+	m_pDEM = Parameters("DEM")->asGrid();
+	m_pTime = Parameters("TIME")->asGrid();
+	m_pSpeed = Parameters("SPEED")->asGrid();
+	m_pManning = Parameters("MANNING")->asGrid();
+	m_pSlope = Parameters("SLOPE")->asGrid();
+	m_pCatchArea = Parameters("FLOWACC")->asGrid();
+	m_pCN = Parameters("CN")->asGrid();
+	m_dMixedThresh = Parameters("THRSMIXED")->asDouble() * 10000;
+	m_dChannelThresh = Parameters("THRSCHANNEL")->asDouble() * 10000;
+	m_dCN = Parameters("AVGCN")->asDouble();
+	m_dManning = Parameters("AVGMANNING")->asDouble();
+	m_dRainfall = Parameters("AVGRAINFALL")->asDouble();
+	m_dChannelSlope = Parameters("CHANSLOPE")->asDouble();
+	m_dMinSpeed = Parameters("MINSPEED")->asDouble();
+
+	m_pTime->Assign((double)0);
+
+	return true;
+
+}//method
+
+bool CIsochronesVar::On_Execute_Finish()
+{
+	return( true );
+}
+
+bool CIsochronesVar::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 );
+	}
+	
+	m_pTime->Assign((double)0);
+
+	writeTimeOut(iX, iY, iX, iY);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++){
+		for(int x=0; x<Get_NX(); x++){
+			m_pTime->Set_Value(x,y,m_pTime->asDouble(x,y)/3600.);
+        }// for
+    }// for
+
+	ZeroToNoData();
+
+	DataObject_Update(m_pTime, true);
+
+	return (true);
+
+}//method
diff --git a/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h
new file mode 100644
index 0000000..49d9c5c
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h
@@ -0,0 +1,62 @@
+/**********************************************************
+ * Version $Id: IsochronesVar.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    IsochronesVar.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CIsochronesVar : public CSG_Module_Grid_Interactive
+{
+public:
+	CIsochronesVar(void);
+	virtual ~CIsochronesVar(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
+
+protected:
+	virtual bool On_Execute(void);
+	virtual bool On_Execute_Finish();
+	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+
+private:
+	CSG_Grid *m_pDEM;
+	CSG_Grid *m_pTime;
+	CSG_Grid *m_pSpeed;
+	CSG_Grid *m_pManning;
+	CSG_Grid *m_pCN;
+	CSG_Grid *m_pCatchArea;
+	CSG_Grid *m_pSlope;
+	double m_dManning;
+	double m_dCN;
+	double m_dRainfall;
+	double m_dMixedThresh;
+	double m_dChannelThresh;
+	double m_dChannelSlope;
+	double m_dMinSpeed;
+	void writeTimeOut(int,int,int,int);
+	void ZeroToNoData(void);
+	double Runoff(double, double);
+
+};
+
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.cpp b/src/modules/terrain_analysis/ta_hydrology/LakeFlood.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.cpp
rename to src/modules/terrain_analysis/ta_hydrology/LakeFlood.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.h b/src/modules/terrain_analysis/ta_hydrology/LakeFlood.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.h
rename to src/modules/terrain_analysis/ta_hydrology/LakeFlood.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFloodInteractive.cpp b/src/modules/terrain_analysis/ta_hydrology/LakeFloodInteractive.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFloodInteractive.cpp
rename to src/modules/terrain_analysis/ta_hydrology/LakeFloodInteractive.cpp
diff --git a/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp
new file mode 100644
index 0000000..88b82aa
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp
@@ -0,0 +1,174 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//			The Module Link Library Interface			 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+//---------------------------------------------------------
+CSG_String Get_Info(int i)
+{
+	switch( i )
+	{
+	case MLB_INFO_Name:	default:
+		return( _TL("Terrain Analysis - Hydrology") );
+
+	case MLB_INFO_Author:
+		return( SG_T("O. Conrad, V. Olaya (c) 2001-4") );
+
+	case MLB_INFO_Description:
+		return( _TL("Tools for digital terrain analysis.") );
+
+	case MLB_INFO_Version:
+		return( SG_T("1.0") );
+
+	case MLB_INFO_Menu_Path:
+		return( _TL("Terrain Analysis|Hydrology") );
+	}
+}
+
+
+//---------------------------------------------------------
+#include "Flow_Parallel.h"
+#include "Flow_RecursiveUp.h"
+#include "Flow_RecursiveDown.h"
+#include "Flow_AreaUpslope.h"
+#include "Flow_AreaDownslope.h"
+
+#include "Flow_Distance.h"
+#include "SlopeLength.h"
+
+#include "EdgeContamination.h"
+
+#include "IsochronesConst.h"
+#include "IsochronesVar.h"
+
+#include "CellBalance.h"
+#include "Sinuosity.h"
+
+#include "FlowDepth.h"
+
+#include "TopographicIndices.h"
+#include "SAGA_Wetness_Index.h"
+
+#include "LakeFlood.h"
+
+#include "flow_massflux.h"
+#include "flow_width.h"
+
+#include "melton_ruggedness.h"
+
+#include "Erosion_LS_Fields.h"
+
+#include "flow_by_slope.h"
+
+
+//---------------------------------------------------------
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CFlow_Parallel );
+	case  1:	return( new CFlow_RecursiveUp );
+	case  2:	return( new CFlow_RecursiveDown );
+	case  3:	return( new CFlow_AreaUpslope_Interactive );
+	case  4:	return( new CFlow_AreaUpslope_Area );
+	case  5:	return( new CFlow_AreaDownslope );
+	case  6:	return( new CFlow_Distance );
+	case  7:	return( new CSlopeLength );
+	case  8:	return( new CIsochronesConst );
+	case  9:	return( new CIsochronesVar );
+	case 10:	return( new CCellBalance );
+	case 11:	return( new CSinuosity );
+	case 12:	return( new CFlowDepth );
+	case 13:	return( new CEdgeContamination );
+	case 14:	return( MLB_INTERFACE_SKIP_MODULE );	// removed: CTopographicIndices
+	case 15:	return( new CSAGA_Wetness_Index );
+	case 16:	return( new CLakeFlood );
+	case 17:	return( new CLakeFloodInteractive );
+	case 18:	return( new CFlow_MassFlux );
+	case 19:	return( new CFlow_Width );
+	case 20:	return( new CTWI );
+	case 21:	return( new CStream_Power );
+	case 22:	return( new CLS_Factor );
+	case 23:	return( new CMelton_Ruggedness );
+	case 24:	return( new CTCI_Low );
+	case 25:	return( new CErosion_LS_Fields );
+	case 26:	return( new CFlow_by_Slope );
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.h b/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_hydrology/MLB_Interface.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Makefile.am b/src/modules/terrain_analysis/ta_hydrology/Makefile.am
new file mode 100644
index 0000000..45ff021
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Makefile.am
@@ -0,0 +1,68 @@
+#
+# $Id: Makefile.am 1824 2013-09-05 08:48:21Z oconrad $
+#
+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 = libta_hydrology.la
+libta_hydrology_la_SOURCES =\
+CellBalance.cpp\
+EdgeContamination.cpp\
+Erosion_LS_Fields.cpp\
+Flow.cpp\
+Flow_AreaDownslope.cpp\
+Flow_AreaUpslope.cpp\
+flow_by_slope.cpp\
+Flow_Distance.cpp\
+Flow_Parallel.cpp\
+Flow_RecursiveDown.cpp\
+Flow_RecursiveUp.cpp\
+flow_massflux.cpp\
+flow_width.cpp\
+FlowDepth.cpp\
+Helper.cpp\
+IsochronesConst.cpp\
+IsochronesVar.cpp\
+LakeFlood.cpp\
+LakeFloodInteractive.cpp\
+MLB_Interface.cpp\
+melton_ruggedness.cpp\
+SAGA_Wetness_Index.cpp\
+Sinuosity.cpp\
+SlopeLength.cpp\
+TopographicIndices.cpp\
+CellBalance.h\
+EdgeContamination.h\
+Erosion_LS_Fields.h\
+Flow.h\
+Flow_AreaDownslope.h\
+Flow_AreaUpslope.h\
+flow_by_slope.h\
+Flow_BRM.h\
+Flow_Distance.h\
+Flow_Parallel.h\
+Flow_RecursiveDown.h\
+Flow_RecursiveUp.h\
+flow_massflux.h\
+flow_width.h\
+FlowDepth.h\
+Helper.h\
+IsochronesConst.h\
+IsochronesVar.h\
+LakeFlood.h\
+MLB_Interface.h\
+melton_ruggedness.h\
+SAGA_Wetness_Index.h\
+Sinuosity.h\
+SlopeLength.h\
+TopographicIndices.h
+
+libta_hydrology_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+
diff --git a/src/modules/terrain_analysis/ta_hydrology/Makefile.in b/src/modules/terrain_analysis/ta_hydrology/Makefile.in
new file mode 100644
index 0000000..ee5ecec
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Makefile.in
@@ -0,0 +1,708 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_hydrology
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_hydrology_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_hydrology_la_OBJECTS = CellBalance.lo EdgeContamination.lo \
+	Erosion_LS_Fields.lo Flow.lo Flow_AreaDownslope.lo \
+	Flow_AreaUpslope.lo flow_by_slope.lo Flow_Distance.lo \
+	Flow_Parallel.lo Flow_RecursiveDown.lo Flow_RecursiveUp.lo \
+	flow_massflux.lo flow_width.lo FlowDepth.lo Helper.lo \
+	IsochronesConst.lo IsochronesVar.lo LakeFlood.lo \
+	LakeFloodInteractive.lo MLB_Interface.lo melton_ruggedness.lo \
+	SAGA_Wetness_Index.lo Sinuosity.lo SlopeLength.lo \
+	TopographicIndices.lo
+libta_hydrology_la_OBJECTS = $(am_libta_hydrology_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_hydrology_la_SOURCES)
+DIST_SOURCES = $(libta_hydrology_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1824 2013-09-05 08:48:21Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libta_hydrology.la
+libta_hydrology_la_SOURCES = \
+CellBalance.cpp\
+EdgeContamination.cpp\
+Erosion_LS_Fields.cpp\
+Flow.cpp\
+Flow_AreaDownslope.cpp\
+Flow_AreaUpslope.cpp\
+flow_by_slope.cpp\
+Flow_Distance.cpp\
+Flow_Parallel.cpp\
+Flow_RecursiveDown.cpp\
+Flow_RecursiveUp.cpp\
+flow_massflux.cpp\
+flow_width.cpp\
+FlowDepth.cpp\
+Helper.cpp\
+IsochronesConst.cpp\
+IsochronesVar.cpp\
+LakeFlood.cpp\
+LakeFloodInteractive.cpp\
+MLB_Interface.cpp\
+melton_ruggedness.cpp\
+SAGA_Wetness_Index.cpp\
+Sinuosity.cpp\
+SlopeLength.cpp\
+TopographicIndices.cpp\
+CellBalance.h\
+EdgeContamination.h\
+Erosion_LS_Fields.h\
+Flow.h\
+Flow_AreaDownslope.h\
+Flow_AreaUpslope.h\
+flow_by_slope.h\
+Flow_BRM.h\
+Flow_Distance.h\
+Flow_Parallel.h\
+Flow_RecursiveDown.h\
+Flow_RecursiveUp.h\
+flow_massflux.h\
+flow_width.h\
+FlowDepth.h\
+Helper.h\
+IsochronesConst.h\
+IsochronesVar.h\
+LakeFlood.h\
+MLB_Interface.h\
+melton_ruggedness.h\
+SAGA_Wetness_Index.h\
+Sinuosity.h\
+SlopeLength.h\
+TopographicIndices.h
+
+libta_hydrology_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_hydrology/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_hydrology/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_hydrology.la: $(libta_hydrology_la_OBJECTS) $(libta_hydrology_la_DEPENDENCIES) $(EXTRA_libta_hydrology_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_hydrology_la_OBJECTS) $(libta_hydrology_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/CellBalance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/EdgeContamination.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Erosion_LS_Fields.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FlowDepth.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_AreaDownslope.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_AreaUpslope.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Distance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Parallel.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_RecursiveDown.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_RecursiveUp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Helper.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/IsochronesConst.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/IsochronesVar.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LakeFlood.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LakeFloodInteractive.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SAGA_Wetness_Index.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Sinuosity.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SlopeLength.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/TopographicIndices.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flow_by_slope.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flow_massflux.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flow_width.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/melton_ruggedness.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp b/src/modules/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp
new file mode 100644
index 0000000..b93f875
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp
@@ -0,0 +1,983 @@
+/**********************************************************
+ * Version $Id: SAGA_Wetness_Index.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 SAGA_Wetness_Index.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.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "SAGA_Wetness_Index.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSAGA_Wetness_Index::CSAGA_Wetness_Index(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("SAGA Wetness Index"));
+
+	Set_Author		(SG_T("(c) 2001 by J.Boehner, O.Conrad"));
+
+	Set_Description	(_TW(
+		"The 'SAGA Wetness Index' is, as the name says, similar to the "
+		"'Topographic Wetness Index' (TWI), but it is based on a modified "
+		"catchment area calculation ('Modified Catchment Area'), which does "
+		"not think of the flow as very thin film. As result it predicts for "
+		"cells situated in valley floors with a small vertical distance to "
+		"a channel a more realistic, higher potential soil moisture compared "
+		"to the standard TWI calculation.\n\n"
+
+		"References\n"
+
+		"- Boehner, J., Koethe, R. Conrad, O., Gross, J., Ringeler, A., Selige, T. (2002): "
+		"Soil Regionalisation by Means of Terrain Analysis and Process Parameterisation. "
+		"In: Micheli, E., Nachtergaele, F., Montanarella, L. [Ed.]: Soil Classification 2001. "
+		"European Soil Bureau, Research Report No. 7, EUR 20398 EN, Luxembourg. pp.213-222."
+	));
+
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "WEIGHT"		, _TL("Weights"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "AREA"		, _TL("Catchment area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SLOPE"		, _TL("Catchment slope"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "AREA_MOD"	, _TL("Modified Catchment Area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "TWI"			, _TL("Topographic Wetness Index"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SUCTION"		, _TL("Suction"),
+		_TL("the lower this value is the stronger is the suction effect"),
+		PARAMETER_TYPE_Double	, 10.0, 0.0, true
+	);
+
+	CSG_Parameter	*pNode	= Parameters.Add_Node(
+		NULL	, "TWI_NODE"	, _TL("Topograpic Wetness Index Calculation"),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "AREA_TYPE"	, _TL("Type of Area"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("absolute catchment area"),
+			_TL("square root of catchment area"),
+			_TL("specific catchment area")
+		), 1
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "SLOPE_TYPE"	, _TL("Type of Slope"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("local slope"),
+			_TL("catchment slope")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SLOPE_MIN"	, _TL("Minimum Slope"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SLOPE_OFF"	, _TL("Offset Slope"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.1, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SLOPE_WEIGHT", _TL("Slope Weighting"),
+		_TL("weighting factor for slope in index calculation"),
+		PARAMETER_TYPE_Double	, 1.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSAGA_Wetness_Index::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pDEM		= Parameters("DEM")		->asGrid();
+	m_pSlope	= Parameters("SLOPE")	->asGrid();
+	m_pArea		= Parameters("AREA")	->asGrid();
+	m_pAreaMod	= Parameters("AREA_MOD")->asGrid();
+	m_pTWI		= Parameters("TWI")		->asGrid();
+
+	DataObject_Set_Colors(m_pArea   , 100, SG_COLORS_WHITE_BLUE);
+	DataObject_Set_Colors(m_pAreaMod, 100, SG_COLORS_WHITE_BLUE);
+	DataObject_Set_Colors(m_pSlope  , 100, SG_COLORS_YELLOW_RED);
+	DataObject_Set_Colors(m_pTWI    , 100, SG_COLORS_RED_GREY_BLUE);
+
+	m_pSlope->Set_ZFactor	(M_RAD_TO_DEG);
+	m_pSlope->Set_Unit		(_TL("Degree"));
+
+	//-----------------------------------------------------
+	Get_Area();
+
+	Get_Modified();
+
+	Get_TWI();
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CSAGA_Wetness_Index::Get_Local_Maximum(CSG_Grid *pGrid, int x, int y)
+{
+	double	z	= pGrid->asDouble(x, y);
+
+	for(int i=0, ix, iy; i<8; i++)
+	{
+		if( pGrid->Get_System().Get_Neighbor_Pos(i, x, y, ix, iy) && !pGrid->is_NoData(ix, iy) && pGrid->asDouble(ix, iy) > z )
+		{
+			z	= pGrid->asDouble(ix, iy);
+		}
+	}
+
+	return( z );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Im Unterschied zu Freeman's urspruenglichen Verfahren
+// wird der Winkel (atan(dz / dx)) und nicht das Gefaelle
+// (dz / dx) fuer die Gewichtung der Abfluszanteile benutzt!
+
+//---------------------------------------------------------
+bool CSAGA_Wetness_Index::Get_Area(void)
+{
+	const double	MFD_Converge	= 1.1;
+
+	int		x, y, i, ix, iy;
+	double	z, d, dz[8], dzSum, Area, Slope;
+
+	CSG_Grid	*pWeight	= Parameters("WEIGHT")->asGrid();
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("catchment area and slope..."));
+
+	m_pArea ->Assign(0.0);
+	m_pSlope->Assign(0.0);
+
+	m_Suction.Create(*Get_System());
+	m_Suction.Assign(0.0);
+
+	double	Suction			= Parameters("SUCTION"     )->asDouble();
+	double	Slope_Weight	= Parameters("SLOPE_WEIGHT")->asDouble();
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		m_pDEM->Get_Sorted(n, x, y, true, false);
+
+		if( m_pDEM->is_NoData(x, y) )
+		{
+			m_pArea ->Set_NoData(x, y);
+			m_pSlope->Set_NoData(x, y);
+			m_Suction.Set_NoData(x, y);
+		}
+		else
+		{
+			m_pDEM->Get_Gradient(x, y, Slope, d);
+
+			d	= pow(Suction, Slope_Weight * Slope);
+			m_Suction.Set_Value(x, y, pow(1.0 / d, exp(d)));
+
+			Area	= m_pArea ->asDouble(x, y) + (!pWeight ? 1.0 : pWeight->is_NoData(x, y) ? 0.0 : pWeight->asDouble(x, y));
+			Slope	= m_pSlope->asDouble(x, y) + Slope;
+
+			m_pArea ->Set_Value(x, y, Area);
+			m_pSlope->Set_Value(x, y, Slope / Area);
+
+			for(i=0, dzSum=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
+			{
+				if( Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) && !m_pDEM->is_NoData(ix, iy) && (d = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
+				{
+					dzSum	+= (dz[i] = pow(atan(d / Get_Length(i)), MFD_Converge));
+				}
+				else
+				{
+					dz[i]	= 0.0;
+				}
+			}
+
+			if( dzSum > 0.0 )
+			{
+				for(i=0; i<8; i++)
+				{
+					if( dz[i] > 0.0 )
+					{
+						ix		= Get_xTo(i, x);
+						iy		= Get_yTo(i, y);
+
+						d		= dz[i] / dzSum;
+
+						m_pArea ->Add_Value(ix, iy, d * Area);
+						m_pSlope->Add_Value(ix, iy, d * Slope);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	*m_pArea	*= m_pArea->Get_Cellarea();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// in den folgenden drei Schritten wird die gesaugte
+// Einzugsgebietsgroe�e CS ermittelt, wobei der t-Parameter
+// die Staerke der Saugung steuert. Werte unter 10 (z.B.  5)
+// fuehren zu einer starken Saugung, Werte ueber 10 (z.B. 15)
+// zu einer schwachen Saugung. Die gesaugte
+// Einzugsgebietsgroe�e selbst stellt bereits einen Parameter
+// dar, der die raeumliche Relief-bedingte Feuchteverteilung
+// in guter Weise annaehert
+
+//---------------------------------------------------------
+bool CSAGA_Wetness_Index::Get_Modified(void)
+{
+	int			y;
+
+	CSG_Grid	Area(*m_pArea);
+
+	m_pAreaMod->Assign(m_pArea);
+
+	//-----------------------------------------------------
+	int		nChanges	= 1;
+
+	for(int Iteration=1; nChanges && Process_Get_Okay(); Iteration++)
+	{
+		nChanges	= 0;
+
+		#pragma omp parallel for private(y) reduction(+:nChanges)
+		for(y=0; y<Get_NY(); y++)
+		{
+			Process_Get_Okay();
+
+			for(int x=0; x<Get_NX(); x++)
+			{
+				if( !m_Suction.is_NoData(x, y) )
+				{
+					double z	= m_Suction.asDouble(x, y) * Get_Local_Maximum(&Area, x, y);
+
+					if( z > Area.asDouble(x, y) )
+					{
+						nChanges++;
+
+						Area.Set_Value(x, y, z);
+					}
+				}
+			}
+		}
+
+		if( nChanges > 0 )
+		{
+			nChanges	= 0;
+
+			#pragma omp parallel for private(y)
+			for(y=0; y<Get_NY(); y++)
+			{
+				Process_Get_Okay();
+
+				for(int x=0; x<Get_NX(); x++)
+				{
+					if( Area.asDouble(x, y) != m_pAreaMod->asDouble(x, y) )
+					{
+						nChanges++;
+
+						m_pAreaMod->Set_Value(x, y, Area.asDouble(x, y));
+					}
+				}
+			}
+		}
+
+		Process_Set_Text(CSG_String::Format(SG_T("pass %d (%d > 0)"), Iteration, nChanges));
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("post-processing..."));
+
+	#pragma omp parallel for private(y)
+	for(y=0; y<Get_NY(); y++)
+	{
+		Process_Get_Okay();
+
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !Area.is_NoData(x, y) )
+			{
+				bool	bModify	= false;
+				int		n		= 0;
+				double	z		= 0.0;
+
+				for(int iy=y-1; iy<=y+1; iy++)
+				{
+					for(int ix=x-1; ix<=x+1; ix++)
+					{
+						if( Area.is_InGrid(ix, iy) )
+						{
+							if( Area.asDouble(ix, iy) > m_pArea->asDouble(ix, iy) )
+							{
+								bModify	= true;
+							}
+
+							n	++;
+							z	+= Area.asDouble(ix, iy);
+						}
+					}
+				}
+
+				m_pAreaMod->Set_Value(x, y, bModify ? z / n : Area.asDouble(x, y));
+			}
+			else
+			{
+				m_pAreaMod->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSAGA_Wetness_Index::Get_TWI(void)
+{
+	int		Area_Type	= Parameters("AREA_TYPE" )->asInt();
+	int		Slope_Type	= Parameters("SLOPE_TYPE")->asInt();
+	double	Slope_Min	= Parameters("SLOPE_MIN" )->asDouble() * M_DEG_TO_RAD;
+	double	Slope_Off	= Parameters("SLOPE_OFF" )->asDouble() * M_DEG_TO_RAD;
+
+	Process_Set_Text(_TL("topographic wetness index..."));
+
+	#pragma omp parallel
+	for(int y=0; y<Get_NY(); y++)
+	{
+		Process_Get_Okay();
+
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( m_pAreaMod->is_NoData(x, y) || m_pSlope->is_NoData(x, y) )
+			{
+				m_pTWI->Set_NoData(x, y);
+			}
+			else
+			{
+				double	s, a;
+
+				if( Slope_Type == 1 )
+				{
+					s	= m_pSlope->asDouble(x, y);
+				}
+				else
+				{
+					m_pDEM->Get_Gradient(x, y, s, a);
+				}
+
+				s	= s + Slope_Off;
+				s	= 6 * tan(Slope_Min < s ? s : Slope_Min);
+
+				a	= m_pAreaMod->asDouble(x, y);
+
+				switch( Area_Type )
+				{
+				case 1:	a	= sqrt(a);				break;	// square root of catchment area
+				case 2:	a	= a / Get_Cellsize();	break;	// specific catchment area
+				}
+
+				m_pTWI->Set_Value(x, y, log(a / s));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//        The original BSL script by J.Boehner
+//---------------------------------------------------------
+
+/*
+Matrix Loop, O("sch-hoe.grd"), N("sch-nei.grd"), M, R, UL, LL, OL, OO, OR, RR, UR, UU, X, Y, Z, C, CS, SB;
+Point ploop, p, pul, pu, pur, pl, pr, pol, po, por;
+Float a, wul, wll, wol, woo, wor, wrr, wur, wuu;
+Integer t, h, i, j, gefunden;
+
+a = 0.0174532;
+t = 10; 
+pul.x = -1;	pul.y = -1; 
+pu.x = 0;	pu.y = -1;
+pur.x = 1;	pur.y = -1;
+pl.x = -1;	pl.y = 0;
+pr.x = 1;	pr.y = 0;
+pol.x = -1;	pol.y = 1;
+po.x = 0;	po.y = 1;
+por.x = 1;	por.y = 1;
+
+M = O;
+R = O;
+UL = O;
+LL = O;
+OL = O;
+OO = O;
+OR = O;
+RR = O;
+UR = O;
+UU = O;
+X = O;
+Y = O;
+Z = O;
+C = O;
+CS = O;
+SB = O;
+
+Loop.xanz = 100000;
+Loop.yanz = 1;
+h = 0;
+i = 0;
+j = 0;
+
+// hier wird eine Hilfsmatrix X erzeugt, die in der folgenden Schleife fafuer sorgt, dass noch nicht attributisierte Rasterzellen in Ihrer Position identifiziert werden koennen //
+foreach p in X do
+{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
+	{X[p] = -10000;}
+	else
+	{X[p] = M[p];}
+}
+// hier wird eine Matrix R erzeugt, die ausgehend von lokalen Maxima fortlaufend Rangplatzziffernerzeugt //
+foreach ploop in Loop do
+{	ploop.x = 1;
+	h = h +1;
+	gefunden = 0;
+	foreach p in X do
+	{
+	if (X[p] == max9(p, X) && X[p] > -10000)
+	{X[p] = -10000; R[p] = h; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(R);
+// hier wird eine Hilfsmatrix R erzeugt, die Rangplatzziffern am Rand duch 0 ersetzt //
+foreach p in R do
+{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
+	{R[p] = 0;}
+	else
+	{R[p] = R[p];}
+}
+// hier wird eine Matrix Z erzeugt, die die positiven Winkel zu den 8 Nachbarzellen aufsummiert //
+foreach p in Z do
+{
+if(p.x == 0 && p.y == 0)
+	{
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((woo + wor + wrr) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = woo + wor + wrr;}
+	}
+else
+{
+if(p.x == 0 && p.y == (M.yanz - 1))
+	{
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wrr + wur + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1 && p.y == M.yanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1 && p.y == 0)
+	{
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((wll + wol + woo) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wll + wol + woo;}
+	}
+else	
+{
+if(p.x == 0)
+	{
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((woo + wor + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = woo + wor + wrr + wur + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wol + woo + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wol + woo + wuu;}
+	}
+else	
+{
+if(p.y == 0)
+	{
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((wll + wol + woo + wor + wrr) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wll + wol + woo + wor + wrr;}
+	}
+else	
+{
+if(p.y == M.yanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wrr + wur + wuu;}
+	}
+else	
+{	
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wol + woo + wor + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wol + woo + wor + wrr + wur + wuu;}
+	}
+}}}}}}}}
+// hier werden Grids UL bis UU (im Uhrzeigersinn) erzeugt, die angeben, welchen Anteil des Inhalts einer benachbarten Rasterzelle in die Zielrasterzelle (zentrale Rasterzelle im 9er Feld) uebergen wird //
+foreach p in UL do
+{	if (p.x == 0 || p.y == 0)
+	{UL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pul]) < 0 && Z[p+pul] > 0) 
+		{UL[p] = (atan((M[p+pul] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pul];}
+		else
+		{UL[p] = 0;}
+		}
+}
+foreach p in LL do
+{	if (p.x == 0)
+	{LL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pl]) < 0 && Z[p+pl] > 0) 
+		{LL[p] = (atan((M[p+pl] - M[p])/M.dxy))/Z[p+pl];}
+		else
+		{LL[p] = 0;}
+		}
+}
+foreach p in OL do
+{	if (p.x == 0 || p.y == M.yanz - 1)
+	{OL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pol]) < 0 && Z[p+pol] > 0) 
+		{OL[p] = (atan((M[p+pol] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pol];}
+		else
+		{OL[p] = 0;}
+		}
+}
+foreach p in OO do
+{	if (p.y == M.yanz - 1)
+	{OO[p] = 0;}
+	else	{
+		if((M[p] - M[p+po]) < 0 && Z[p+po] > 0) 
+		{OO[p] = (atan((M[p+po] - M[p])/M.dxy))/Z[p+po];}
+		else
+		{OO[p] = 0;}
+		}
+}
+foreach p in OR do
+{	if (p.x == M.xanz - 1 || p.y == M.yanz - 1)
+	{OR[p] = 0;}
+	else	{
+		if((M[p] - M[p+por]) < 0 && Z[p+por] > 0) 
+		{OR[p] = (atan((M[p+por] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+por];}
+		else
+		{OR[p] = 0;}
+		}
+}
+foreach p in RR do
+{	if (p.x == M.xanz - 1)
+	{RR[p] = 0;}
+	else	{
+		if((M[p] - M[p+pr]) < 0 && Z[p+pr] > 0) 
+		{RR[p] = (atan((M[p+pr] - M[p])/M.dxy))/Z[p+pr];}
+		else
+		{RR[p] = 0;}
+		}
+}
+foreach p in UR do
+{	if (p.x == M.xanz - 1 || p.y == 0)
+	{UR[p] = 0;}
+	else	{
+		if((M[p] - M[p+pur]) < 0 && Z[p+pur] > 0) 
+		{UR[p] = (atan((M[p+pur] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pur];}
+		else
+		{UR[p] = 0;}
+		}
+}
+foreach p in UU do
+{	if (p.y == 0)
+	{UU[p] = 0;}
+	else	{
+		if((M[p] - M[p+pu]) < 0 && Z[p+pu] > 0) 
+		{UU[p] = (atan((M[p+pu] - M[p])/M.dxy))/Z[p+pu];}
+		else
+		{UU[p] = 0;}
+		}
+}
+// in den folgenden drei Schritten wird nach der "multiple flow methode" die Einzugsgebietsgroe�e C ermittelt //
+foreach p in Z do
+{Z[p] = 1;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	i = i +1;
+	gefunden = 0;
+	foreach p in Z do
+	{	if (R[p] == i)
+		{Z[p] = 1 + Z[p+pul] * UL[p] + Z[p+pl] * LL[p] + Z[p+pol] * OL[p] + Z[p+po] * OO[p] + Z[p+por] * OR[p] + Z[p+pr] * RR[p] + Z[p+pur] * UR[p] + Z[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(Z);
+foreach p in C do
+{C[p] = Z[p] * O.dxy^2;}
+// in den folgenden drei Schritten wird die gesaugte Einzugsgebietsgroe�e CS ermittelt, wobei der t-Parameter die Staerke der Saugung steuert. Werte unter 10 (z.B.: 5) fuehren zu einer starken Saugung, Werte ueber 10 (z.B. 15) zu einer schwachen Saugung. Die gesaugte Einzugsgebietsgroe�e selbst stellt bereits einen Parameter Dar, der die raeumliche Relief-bedingte Feuchteverteilung in guter Weise annaehert //
+foreach p in X do
+{X[p] = C[p];}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	j = j +1;
+	gefunden = 0;
+	foreach p in X do
+	{
+	if ((((1/t^N[p])^exp(t^N[p])) * max9(p, X)) > X[p])
+	{X[p] = (((1/t^N[p])^exp(t^N[p])) * max9(p, X)); gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+foreach p in CS do
+{	if (isRand(p, M) == 0)
+	{
+	if(X[p] > C[p] || X[p+pul] > C[p+pul] || X[p+pl] > X[p+pl] || X[p+pol] > C[p+pol] || X[p+po] > C[p+po] || X[p+por] > C[p+por] || X[p+pr] > C[p+pr] || X[p+pur] > C[p+pur] || X[p+pu] > C[p+pu])
+	{CS[p] = ln((X[p] + X[p+pul] + X[p+pu] + X[p+pur] + X[p+pl] + X[p+pr] + X[p+pol] + X[p+po] + X[p+por])/9);}
+	else	
+	{CS[p] = ln(X[p]);}
+	}
+}
+setRandN (CS);	
+showMatrix(CS);
+// in den folgenden zwei Schritten wird der SAGA Bodenfeuchteindex SB ermittelt. Der a-Parameter muss bei den Settings definiert werden und sorgt dafuer, das nicht durch 0 dividiert wird //
+foreach p in SB do
+{SB[p] = exp(CS[p])/tan(N[p] + a);}
+foreach p in SB do
+{SB[p] = ln(SB[p]);}	
+showMatrix(SB);
+/**/
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h b/src/modules/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h
rename to src/modules/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/Sinuosity.cpp b/src/modules/terrain_analysis/ta_hydrology/Sinuosity.cpp
new file mode 100644
index 0000000..01f6005
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Sinuosity.cpp
@@ -0,0 +1,161 @@
+/**********************************************************
+ * Version $Id: Sinuosity.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    Sinuosity.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "Sinuosity.h"
+#include "Helper.h"
+
+CSinuosity::CSinuosity(void){
+
+	Parameters.Set_Name(_TL("Flow Sinuosity"));
+	Parameters.Set_Description(_TW(
+		"(c) 2004 by Victor Olaya. Flow sinuosity calculation\r\n"
+		"References:\r\n 1. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"));
+
+
+	Parameters.Add_Grid(NULL, 
+						"DEM", 
+						_TL("Elevation Grid"), 
+						_TL(""), 
+						PARAMETER_INPUT);
+	
+	Parameters.Add_Grid(NULL, 
+						"SINUOS", 
+						_TL("Sinuosity"), 
+						_TL(""), 
+						PARAMETER_OUTPUT, 
+						true, 
+						SG_DATATYPE_Double);
+
+}//constructor
+
+
+CSinuosity::~CSinuosity(void)
+{}
+
+void CSinuosity::writeDistOut(
+        int iX1,
+        int iY1,
+        int iX2,
+        int iY2) {
+	
+    int iNextX, iNextY;
+	double dDist = 1;
+	
+	if (iX1 < 0 || iX1 >= m_pDEM->Get_NX() || iY1 < 0 || iY1 >= m_pDEM->Get_NY()
+            || m_pDEM->asFloat(iX1,iY1) == m_pDEM->Get_NoData_Value()) {        
+    }// if
+	else {				
+
+		dDist = sqrt(pow((double)iX1-iX2,2)+pow((double)iY1-iY2,2))*m_pSinuosity->Get_Cellsize();
+		m_pSinuosity->Set_Value(iX1,iY1,m_pSinuosity->asDouble(iX2,iY2) + dDist);        
+
+		for (int i = -1; i<2; i++){
+			for (int j = -1; j<2; j++){
+				if (!(i == 0) || !(j == 0)) {
+					getNextCell(m_pDEM, iX1 + i, iY1 + j, iNextX, iNextY);
+					if (iNextY == iY1 && iNextX == iX1) {
+						writeDistOut(iX1 + i, iY1 + j, iX1, iY1);
+					}// if				
+				}//if				
+			}//for
+		}//for
+
+    }// else
+
+}// method
+
+void CSinuosity::ZeroToNoData(void){
+		
+    for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(int x=0; x<Get_NX(); x++){			
+            if (m_pSinuosity->asDouble(x,y) == 0){
+				m_pSinuosity->Set_Value(x,y,m_pSinuosity->Get_NoData_Value());
+			}//if
+        }// for
+    }// for
+
+}//method
+
+
+void CSinuosity::calculateSinuosity(void){
+	
+	double dDist;
+    
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
+		for(int x=0; x<Get_NX(); x++){
+            if (m_pSinuosity->asDouble(x,y) != m_pSinuosity->Get_NoData_Value()){				
+				dDist = sqrt(pow((double)x-m_iX,2)+pow((double)y-m_iY,2))*m_pSinuosity->Get_Cellsize();
+				if (dDist!=0){
+					m_pSinuosity->Set_Value(x,y,m_pSinuosity->asDouble(x,y)/dDist);
+				}//if
+			}//if
+        }// for
+    }// for
+
+}//method
+
+bool CSinuosity::On_Execute(void){
+
+	m_pDEM			= Parameters("DEM")->asGrid(); 
+	m_pSinuosity	= Parameters("SINUOS")->asGrid();
+
+	DataObject_Update(m_pSinuosity, true);
+
+	return true;
+
+}//method
+
+bool CSinuosity::On_Execute_Finish(){
+
+	return( true );
+}
+
+bool CSinuosity::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 );
+	}
+
+//	if( !m_pDEM->is_InGrid_byPos(ptWorld.Get_X(), ptWorld.Get_Y()) ){
+//		return false;
+//	}//if
+
+//	iX	= (int) ((ptWorld.Get_X() - m_pDEM->Get_XMin()) / m_pDEM->Get_Cellsize());
+//	iY	= (int) ((ptWorld.Get_Y() - m_pDEM->Get_YMin()) / m_pDEM->Get_Cellsize());
+
+	m_iX = iX;
+	m_iY = iY;
+
+	m_pSinuosity->Assign((double)0);
+	
+	writeDistOut(iX, iY, iX, iY);
+	ZeroToNoData();
+	calculateSinuosity();
+
+	DataObject_Update(m_pSinuosity);
+    
+	return true;
+
+}//method
diff --git a/src/modules/terrain_analysis/ta_hydrology/Sinuosity.h b/src/modules/terrain_analysis/ta_hydrology/Sinuosity.h
new file mode 100644
index 0000000..1527f3b
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/Sinuosity.h
@@ -0,0 +1,51 @@
+/**********************************************************
+ * Version $Id: Sinuosity.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    Sinuosity.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CSinuosity : public CSG_Module_Grid_Interactive
+{
+public:
+	CSinuosity(void);
+	virtual ~CSinuosity(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
+
+protected:
+	virtual bool On_Execute(void);
+	virtual bool On_Execute_Finish();
+	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+
+private:
+	CSG_Grid *m_pDEM;
+	CSG_Grid *m_pSinuosity;
+	void writeDistOut(int,int,int,int);
+	void ZeroToNoData(void);
+	void calculateSinuosity(void);
+	int m_iX, m_iY;	
+
+};
+
diff --git a/src/modules/terrain_analysis/ta_hydrology/SlopeLength.cpp b/src/modules/terrain_analysis/ta_hydrology/SlopeLength.cpp
new file mode 100644
index 0000000..451eb7f
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/SlopeLength.cpp
@@ -0,0 +1,155 @@
+/**********************************************************
+ * Version $Id: SlopeLength.cpp 1081 2011-06-08 08:05:26Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    SlopeLength.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "SlopeLength.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSlopeLength::CSlopeLength(void)
+{
+	Set_Name		(_TL("Slope Length"));
+
+	Set_Author		(SG_T("V.Olaya (c) 2004"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "DEM"		, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "LENGTH"	, _TL("Slope Length"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSlopeLength::On_Execute(void)
+{
+	int		x, y;
+
+	//-----------------------------------------------------
+	m_pDEM		= Parameters("DEM")		->asGrid();
+	m_pLength	= Parameters("LENGTH")	->asGrid();
+
+	//-----------------------------------------------------
+	m_Slope.Create(*Get_System());
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			double	Slope, Aspect;
+
+			if( m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
+			{
+				m_Slope   .Set_Value(x, y, Slope);
+				m_pLength->Set_Value(x, y, 0.0);
+			}
+			else
+			{
+				m_Slope   .Set_NoData(x, y);
+				m_pLength->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( m_pDEM->Get_Sorted(n, x, y) )
+		{
+			Get_Length(x, y);
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Slope.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSlopeLength::Get_Length(int x, int y)
+{
+	int		i, ix, iy;
+
+	if( m_Slope.is_InGrid(x, y) && (i = m_pDEM->Get_Gradient_NeighborDir(x, y)) >= 0 )
+	{
+		ix	= Get_xTo(i, x);
+		iy	= Get_yTo(i, y);
+
+		if( m_Slope.is_InGrid(ix, iy) )
+		{
+			if( m_Slope.asDouble(ix, iy) > 0.5 * m_Slope.asDouble(x, y) )	// ???
+			{
+				double	Length	= m_pLength->asDouble(x, y) + CSG_Module_Grid::Get_Length(i);
+			
+				if( Length > m_pLength->asDouble(ix, iy) )
+				{
+					m_pLength->Set_Value(ix, iy, Length);
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_hydrology/SlopeLength.h b/src/modules/terrain_analysis/ta_hydrology/SlopeLength.h
new file mode 100644
index 0000000..60d1805
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/SlopeLength.h
@@ -0,0 +1,70 @@
+/**********************************************************
+ * Version $Id: SlopeLength.h 1246 2011-11-25 13:42:38Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    SlopeLength.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CSlopeLength : public CSG_Module_Grid
+{
+public:
+	CSlopeLength(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Miscellaneous") );	}
+
+
+protected:
+	
+	virtual bool			On_Execute		(void);
+
+
+private:
+
+	CSG_Grid				*m_pDEM, *m_pLength, m_Slope;
+
+
+	void					Get_Length		(int x, int y);	
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.cpp b/src/modules/terrain_analysis/ta_hydrology/TopographicIndices.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.cpp
rename to src/modules/terrain_analysis/ta_hydrology/TopographicIndices.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.h b/src/modules/terrain_analysis/ta_hydrology/TopographicIndices.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.h
rename to src/modules/terrain_analysis/ta_hydrology/TopographicIndices.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/flow_by_slope.cpp b/src/modules/terrain_analysis/ta_hydrology/flow_by_slope.cpp
new file mode 100644
index 0000000..b7e4d0f
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/flow_by_slope.cpp
@@ -0,0 +1,312 @@
+/**********************************************************
+ * Version $Id: flow_by_slope.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   flow_by_slope.cpp                   //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "flow_by_slope.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CFlow_by_Slope::CFlow_by_Slope(void)
+{
+	//-----------------------------------------------------
+	Set_Name	(_TL("Slope Limited Flow Accumulation"));
+
+	Set_Author	("O.Conrad (c) 2014");
+
+	Set_Description	(_TW(
+		"Flow accumulation is calculated as upslope contributing (catchment) area "
+		"using the multiple flow direction approach of Freeman (1991). For this tool "
+		"the approach has been modified to limit the flow portion routed through a cell "
+		"depending on the local slope. If a cell is not inclined, no flow is routed "
+		"through it at all. With increasing slopes the portion of flow routed through "
+		"a cell becomes higher. Cells with slopes greater than a specified slope threshold "
+		"route their entire accumulated flow downhill. "		 
+
+		"\nReferences:\n"
+		"- Freeman, G.T. (1991):"
+		" Calculating catchment area with divergent flow based on a regular grid."
+		" Computers and Geosciences, 17:413-22\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "WEIGHT"		, _TL("Weight"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "FLOW"		, _TL("Flow Accumulation"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SLOPE_MIN"	, _TL("Slope Minimum"),
+		_TL("Assume a given minimum slope for each cell."),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SLOPE_MAX"	, _TL("Slope Threshold"),
+		_TL("Slope threshold, given as degree, above which flow transport is unlimited."),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 90.0, true
+	);
+
+	CSG_Parameter	*pNode	= Parameters.Add_Value(
+		NULL	, "B_FLOW"		, _TL("Use Flow Threshold"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Range(
+		pNode	, "T_FLOW"		, _TL("Flow Threshold"),
+		_TL("Flow threshold, given as amount of cells, above which flow transport is unlimited. Ignored if range equals zero."),
+		1.0, 100.0, 1.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CFlow_by_Slope::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "B_FLOW") )
+	{
+		pParameters->Get_Parameter("T_FLOW")->Set_Enabled(pParameter->asBool());
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CFlow_by_Slope::On_Execute(void)
+{
+	m_Slope_Min	= Parameters("SLOPE_MIN")->asDouble() * M_DEG_TO_RAD;
+	m_Slope_Max = Parameters("SLOPE_MAX")->asDouble() * M_DEG_TO_RAD;
+
+	if( m_Slope_Max <= 0.0 )
+	{
+		Error_Set(_TL("slope threshold must not be zero!"));
+
+		return( false );
+	}
+
+	if( Parameters("B_FLOW")->asBool() )
+	{
+		m_Flow_Min	= Parameters("T_FLOW")->asRange()->Get_LoVal() * Get_Cellarea();
+		m_Flow_Max	= Parameters("T_FLOW")->asRange()->Get_HiVal() * Get_Cellarea();
+	}
+	else
+	{
+		m_Flow_Min	= m_Flow_Max	= 0.0;
+	}
+
+	//-----------------------------------------------------
+	m_pDEM		= Parameters("DEM"   )->asGrid();
+	m_pFlow		= Parameters("FLOW"  )->asGrid();
+
+	m_pFlow->Assign(Get_Cellarea());
+
+	if( Parameters("WEIGHT")->asGrid() )
+	{
+		m_pFlow->Multiply(*Parameters("WEIGHT")->asGrid());
+	}
+
+	DataObject_Set_Colors(m_pFlow, 11, SG_COLORS_WHITE_BLUE, false);
+
+	//-----------------------------------------------------
+	for(sLong i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
+	{
+		int	x, y;
+
+		if( !m_pDEM->Get_Sorted(i, x, y, true) || m_pDEM->is_NoData(x, y) )
+		{
+			m_pFlow->Set_NoData(x, y);
+		}
+		else
+		{
+			Set_Area(x, y);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline double CFlow_by_Slope::Get_Fuzzy(double Value, double Minimum, double Maximum)
+{
+	return( Value <= Minimum ? 0.0 : Value >= Maximum ? 1.0 :
+		0.5 * (1.0 - cos(M_PI * ((Value - Minimum) / (Maximum - Minimum))))
+	);
+}
+
+//---------------------------------------------------------
+inline bool CFlow_by_Slope::Get_Decay(int x, int y, double &Decay)
+{
+	double	d;
+
+	if( !m_pDEM->Get_Gradient(x, y, d, Decay) )
+	{
+		return( false );
+	}
+
+	if( d < m_Slope_Min )
+	{
+		d	= m_Slope_Min;
+	}
+
+	Decay	= Get_Fuzzy(d, 0.0, m_Slope_Max);
+
+	if( m_Flow_Min > 0.0 )
+	{
+		d	= Get_Fuzzy(m_pFlow->asDouble(x, y), m_Flow_Min, m_Flow_Max);
+
+		switch( 1 )
+		{
+		default:
+			Decay	= M_GET_MAX(Decay, d);
+			break;
+
+		case 1:
+			Decay	= Decay + d - Decay * d;
+			break;
+		}
+	}
+
+	return( Decay > 0.0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CFlow_by_Slope::Set_Area(int x, int y)
+{
+	double	Decay;
+
+	if( Get_Decay(x, y, Decay) )
+	{
+		int		i, ix, iy;
+		double	z, dzSum, dz[8];
+
+		for(i=0, dzSum=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
+		{
+			if( m_pDEM->is_InGrid(ix = Get_xTo(i, x), iy = Get_yTo(i, y)) && (dz[i] = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
+			{
+				dzSum	+= (dz[i] = pow(dz[i] / Get_Length(i), 1.1));
+			}
+			else
+			{
+				dz[i]	= 0.0;
+			}
+		}
+
+		if( dzSum > 0.0 )
+		{
+			Decay	*= m_pFlow->asDouble(x, y) / dzSum;
+
+			for(i=0; i<8; i++)
+			{
+				if( dz[i] > 0.0 )
+				{
+					m_pFlow->Add_Value(Get_xTo(i, x), Get_yTo(i, y), Decay * dz[i]);
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_hydrology/flow_by_slope.h b/src/modules/terrain_analysis/ta_hydrology/flow_by_slope.h
new file mode 100644
index 0000000..b4a25db
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/flow_by_slope.h
@@ -0,0 +1,122 @@
+/**********************************************************
+ * Version $Id: flow_by_slope.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    flow_by_slope.h                    //
+//                                                       //
+//                 Copyright (C) 2003 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__flow_by_slope_H
+#define HEADER_INCLUDED__flow_by_slope_H
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CFlow_by_Slope : public CSG_Module_Grid
+{
+public: ////// public members and functions: //////////////
+
+	CFlow_by_Slope(void);
+
+	virtual CSG_String	Get_MenuPath			(void)	{	return( _TL("R:Catchment Area" ));	}
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual int			On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool		On_Execute				(void);
+
+
+private: ///// private members and functions: /////////////
+
+	double				m_Slope_Min, m_Slope_Max, m_Flow_Min, m_Flow_Max;
+
+	CSG_Grid			*m_pDEM, *m_pFlow;
+
+
+	double				Get_Fuzzy				(double Value, double Minimum, double Maximum);
+
+	bool				Get_Decay				(int x, int y, double &Decay);
+
+	void				Set_Area				(int x, int y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //												
+//                                                       //												
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__flow_by_slope_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.cpp b/src/modules/terrain_analysis/ta_hydrology/flow_massflux.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.cpp
rename to src/modules/terrain_analysis/ta_hydrology/flow_massflux.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.h b/src/modules/terrain_analysis/ta_hydrology/flow_massflux.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.h
rename to src/modules/terrain_analysis/ta_hydrology/flow_massflux.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.cpp b/src/modules/terrain_analysis/ta_hydrology/flow_width.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.cpp
rename to src/modules/terrain_analysis/ta_hydrology/flow_width.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.h b/src/modules/terrain_analysis/ta_hydrology/flow_width.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.h
rename to src/modules/terrain_analysis/ta_hydrology/flow_width.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/melton_ruggedness.cpp b/src/modules/terrain_analysis/ta_hydrology/melton_ruggedness.cpp
new file mode 100644
index 0000000..9247438
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_hydrology/melton_ruggedness.cpp
@@ -0,0 +1,188 @@
+/**********************************************************
+ * Version $Id: melton_ruggedness.cpp 1091 2011-06-16 15:50:52Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     ta_hydrology                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 melton_ruggedness.cpp                 //
+//                                                       //
+//                 Copyright (C) 2012 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                  //
+//                Bundesstr. 55                          //
+//                20146 Hamburg                          //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "melton_ruggedness.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CMelton_Ruggedness::CMelton_Ruggedness(void)
+{
+	Set_Name		(_TL("Melton Ruggedness Number"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2012"));
+
+	Set_Description	(_TW(
+		"Melton ruggedness number (MNR) is a simple flow accumulation related index, "
+		"calculated as difference between maximum and minimum elevation "
+		"in catchment area divided by square root of catchment area size. "
+		"The calculation is performed for each grid cell, therefore minimum elevation "
+		"is same as elevation at cell's position. "
+		"Due to the discrete character of a single maximum elevation, flow calculation "
+		"is simply done with Deterministic 8. "
+		"\n\n"
+		"References:\n"
+		"Marchi, L. &  Fontana, G.D. (2005): "
+		"GIS morphometric indicators for the analysis of sediment dynamics in mountain basins. "
+		"Environ. Geol. 48:218-228, DOI 10.1007/s00254-005-1292-4.\n"
+		"\n"
+		"Melton M.A. (1965): "
+		"The geomorphic and paleoclimatic significance of alluvial deposits in Southern Arizona. "
+		"J. Geol. 73:1-38.\n"
+		"\n"
+		"O'Callaghan, J.F. / Mark, D.M. (1984): "
+		"The extraction of drainage networks from digital elevation data. "
+		"Computer Vision, Graphics and Image Processing 28:323-344.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"		, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "AREA"	, _TL("Catchment Area"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ZMAX"	, _TL("Maximum Height"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "MRN"		, _TL("Melton Ruggedness Number"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CMelton_Ruggedness::On_Execute(void)
+{
+	CSG_Grid	*pDEM, *pArea, *pMRN, *pZMax;
+
+	//-----------------------------------------------------
+	pDEM		= Parameters("DEM" )->asGrid();
+	pArea		= Parameters("AREA")->asGrid();
+	pZMax		= Parameters("ZMAX")->asGrid();
+	pMRN		= Parameters("MRN" )->asGrid();
+
+	pArea->Set_NoData_Value(0.0);
+	pArea->Assign_NoData();
+	pZMax->Assign_NoData();
+	pMRN ->Assign_NoData();
+
+	//-------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		int		x, y, i, ix, iy;
+
+		if( pDEM->Get_Sorted(n, x, y, true, true) )
+		{
+			pArea->Add_Value(x, y, Get_Cellsize());
+
+			if( pZMax->is_NoData(x, y) )
+			{
+				pZMax->Set_Value(x, y, pDEM->asDouble(x, y));
+			}
+
+			if( (i = pDEM->Get_Gradient_NeighborDir(x, y, true)) >= 0 && Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) )
+			{
+				pArea->Add_Value(ix, iy, pArea->asDouble(x, y));
+
+				if( pZMax->is_NoData(ix, iy) || pZMax->asDouble(ix, iy) < pZMax->asDouble(x, y) )
+				{
+					pZMax->Set_Value(ix, iy, pZMax->asDouble(x, y));
+				}
+			}
+
+			pMRN->Set_Value(x, y, (pZMax->asDouble(x, y) - pDEM->asDouble(x, y)) / sqrt(pArea->asDouble(x, y)));
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/melton_ruggedness.h b/src/modules/terrain_analysis/ta_hydrology/melton_ruggedness.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_hydrology/melton_ruggedness.h
rename to src/modules/terrain_analysis/ta_hydrology/melton_ruggedness.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.cpp b/src/modules/terrain_analysis/ta_lighting/HillShade.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.cpp
rename to src/modules/terrain_analysis/ta_lighting/HillShade.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.h b/src/modules/terrain_analysis/ta_lighting/HillShade.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.h
rename to src/modules/terrain_analysis/ta_lighting/HillShade.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_lighting/MLB_Interface.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.cpp
rename to src/modules/terrain_analysis/ta_lighting/MLB_Interface.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.h b/src/modules/terrain_analysis/ta_lighting/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_lighting/MLB_Interface.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.am b/src/modules/terrain_analysis/ta_lighting/Makefile.am
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.am
rename to src/modules/terrain_analysis/ta_lighting/Makefile.am
diff --git a/src/modules/terrain_analysis/ta_lighting/Makefile.in b/src/modules/terrain_analysis/ta_lighting/Makefile.in
new file mode 100644
index 0000000..04064ba
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_lighting/Makefile.in
@@ -0,0 +1,655 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_lighting
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_lighting_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_lighting_la_OBJECTS = HillShade.lo MLB_Interface.lo \
+	SolarRadiation.lo topographic_correction.lo \
+	topographic_openness.lo view_shed.lo Visibility_BASE.lo \
+	Visibility_Point.lo Visibility_Points.lo
+libta_lighting_la_OBJECTS = $(am_libta_lighting_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_lighting_la_SOURCES)
+DIST_SOURCES = $(libta_lighting_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1613 2013-02-22 11:20:39Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libta_lighting.la
+libta_lighting_la_SOURCES = \
+HillShade.cpp\
+MLB_Interface.cpp\
+SolarRadiation.cpp\
+topographic_correction.cpp\
+topographic_openness.cpp\
+view_shed.cpp\
+Visibility_BASE.cpp\
+Visibility_Point.cpp\
+Visibility_Points.cpp\
+HillShade.h\
+MLB_Interface.h\
+SolarRadiation.h\
+topographic_correction.h\
+topographic_openness.h\
+view_shed.h\
+Visibility_BASE.h\
+Visibility_Point.h\
+Visibility_Points.h
+
+libta_lighting_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_lighting/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_lighting/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_lighting.la: $(libta_lighting_la_OBJECTS) $(libta_lighting_la_DEPENDENCIES) $(EXTRA_libta_lighting_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_lighting_la_OBJECTS) $(libta_lighting_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/HillShade.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SolarRadiation.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Visibility_BASE.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Visibility_Point.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Visibility_Points.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topographic_correction.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topographic_openness.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/view_shed.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp
new file mode 100644
index 0000000..3d23a88
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp
@@ -0,0 +1,1437 @@
+/**********************************************************
+ * Version $Id: SolarRadiation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_lighting                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  SolarRadiation.cpp                   //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "SolarRadiation.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSolarRadiation::CSolarRadiation(void)
+{
+	CSG_Parameter	*pNode_1, *pNode_2;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Potential Incoming Solar Radiation"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2010"));
+
+	Set_Description	(_TW(
+		"Calculation of potential incoming solar radiation (insolation).\n"
+		"\n"
+		"References:\n<ul>"
+		"<li>Boehner, J., Antonic, O. (2009): Land Surface Parameters Specific to Topo-Climatology. in Hengl, T. & Reuter, H.I. [Eds.]: Geomorphometry - Concepts, Software, Applications.</li>"
+		"<li>Oke, T.R. (1988): Boundary Layer Climates. London, Taylor & Francis.</li>"
+		"<li>Wilson, J.P., Gallant, J.C. [Eds.] (2000): Terrain Analysis - Principles and Applications. New York, John Wiley & Sons, Inc.</li>"
+		"</ul>\n"
+
+		"\n*) Most options should do well, but TAPES-G based diffuse irradiance calculation ('Atmospheric Effects' methods 2 and 3) needs further revision!"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRD_DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_SVF"			, _TL("Sky View Factor"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_VAPOUR"		, _TL("Water Vapour Pressure [mbar]"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_LAT"			, _TL("Latitude [degree]"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_LON"			, _TL("Longitude [degree]"),
+		_TL(""),
+		PARAMETER_INPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_DIRECT"		, _TL("Direct Insolation"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_DIFFUS"		, _TL("Diffuse Insolation"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_TOTAL"		, _TL("Total Insolation"),
+		_TL("Total insolation, the sum of direct and diffuse incoming solar radiation."),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "GRD_RATIO"		, _TL("Direct to Diffuse Ratio"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DURATION"		, _TL("Duration of Insolation"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SUNRISE"			, _TL("Sunrise"),
+		_TL("time of sunrise/sunset is only calculated if time span is set to single day"),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SUNSET"			, _TL("Sunset"),
+		_TL("time of sunrise/sunset is only calculated if time span is set to single day"),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Value(
+		NULL	, "SOLARCONST"		, _TL("Solar Constant [W / m\xb2]"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 1367.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "LOCALSVF"		, _TL("Local Sky View Factor"),
+		_TL("Use sky view factor based on local slope (after Oke 1988), if no sky viev factor grid is given."),
+		PARAMETER_TYPE_Bool			, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "UNITS"			, _TL("Units"),
+		_TL("Units for output radiation values."),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			SG_T("kWh / m\xb2"),
+			SG_T("kJ / m\xb2"),
+			SG_T("J / cm\xb2")
+		), 0
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= Parameters.Add_Node(
+		NULL	, "NODE_LOCATION"	, _TL("Location"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode_1	, "LATITUDE"		, _TL("Latitude"),
+		_TL(""),
+		PARAMETER_TYPE_Degree		, 53.0, -90.0, true, 90.0, true
+	);
+
+	CSG_Parameters	*pParameters	= Parameters.Add_Parameters(
+		pNode_1	, "BENDING"			, _TL("Planetary Bending"),
+		_TL("")
+	)->asParameters();
+
+	pParameters->Add_Value(
+		NULL	, "BENDING"			, _TL("Include Planetery Bending"),
+		_TL(""),
+		PARAMETER_TYPE_Bool			, false
+	);
+
+	pParameters->Add_Value(
+		NULL	, "RADIUS"			, _TL("Planetary Radius"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 6366737.96, 0.0, true
+	);
+
+	pNode_1	= pParameters->Add_Choice(
+		NULL	, "LAT_OFFSET"		, _TL("Latitude relates to grid's..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("bottom"),
+			_TL("center"),
+			_TL("top"),
+			_TL("user defined reference")
+		), 3
+	);
+
+	pParameters->Add_Value(
+		pNode_1	, "LAT_REF_USER"	, _TL("Latitude (user defined reference)"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 0.0
+	);
+
+	pNode_1	= pParameters->Add_Choice(
+		NULL	, "LON_OFFSET"		, _TL("Local time relates to grid's..."),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("left"),
+			_TL("center"),
+			_TL("right"),
+			_TL("user defined reference")
+		), 1
+	);
+
+	pParameters->Add_Value(
+		pNode_1	, "LON_REF_USER"	, _TL("Local Time (user defined reference)"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 0.0
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= Parameters.Add_Node(
+		NULL	, "NODE_TIME"		, _TL("Time"),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		pNode_1	, "PERIOD"			, _TL("Time Period"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("moment"),
+			_TL("day"),
+			_TL("range of days")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		pNode_1	, "MOMENT"			, _TL("Moment [h]"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 12.0, 0.0, true, 24.0, true
+	);
+
+	Parameters.Add_Range(
+		pNode_1	, "HOUR_RANGE"		, _TL("Time Span [h]"),
+		_TL("Time span used for the calculation of daily radiation sums."),
+		 0.0, 24.0, 0.0	, true, 24.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode_1	, "DHOUR"			, _TL("Time Resolution [h]: Day"),
+		_TL("Time step size for a day's calculation given in hours."),
+		PARAMETER_TYPE_Double		, 0.5, 0.0, true, 24.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode_1	, "DDAYS"			, _TL("Time Resolution [d]: Range of Days"),
+		_TL("Time step size for a range of days calculation given in days."),
+		PARAMETER_TYPE_Int			, 5, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode_1	, "UPDATE"			, _TL("Update"),
+		_TL("show direct insolation for each time step."),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("do not update"),
+			_TL("update, colour stretch for each time step"),
+			_TL("update, fixed colour stretch")
+		), 0
+	);
+
+	//-----------------------------------------------------
+	pNode_2	= Parameters.Add_Node(
+		pNode_1	, "NODE_DAY_A"		, _TL("Day of Year"),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		pNode_2	, "DAY_A"			, _TL("Day of Month"),
+		_TL(""),
+		SG_T("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|"), 20
+	);
+
+	Parameters.Add_Choice(
+		pNode_2	, "MON_A"			, _TL("Month"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("January")	, _TL("February")	, _TL("March")		, _TL("April")	, _TL("May")		, _TL("June"),
+			_TL("July")		, _TL("August")		, _TL("September")	, _TL("October"), _TL("November")	, _TL("December")
+		), 2
+	);
+
+	pNode_2	= Parameters.Add_Node(
+		pNode_1	, "NODE_DAY_B"		, _TL("Day of Year (End of Range)"),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		pNode_2	, "DAY_B"			, _TL("Day of Month"),
+		_TL(""),
+		SG_T("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|"), 20
+	);
+
+	Parameters.Add_Choice(
+		pNode_2	, "MON_B"			, _TL("Month"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("January")	, _TL("February")	, _TL("March")		, _TL("April")	, _TL("May")		, _TL("June"),
+			_TL("July")		, _TL("August")		, _TL("September")	, _TL("October"), _TL("November")	, _TL("December")
+		), 3
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= Parameters.Add_Node(
+		NULL	, "NODE_METHOD"		, _TL("Atmospheric Effects"),
+		_TL("")
+	);
+
+	Parameters.Add_Choice(
+		pNode_1	, "METHOD"			, _TL("Atmospheric Effects"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("Height of Atmosphere and Vapour Pressure"),
+			_TL("Air Pressure, Water and Dust Content"),
+			_TL("Lumped Atmospheric Transmittance")
+		), 0
+	);
+
+	//-----------------------------------------------------
+	pNode_2	= Parameters.Add_Node(
+		pNode_1	, "NODE_SADO"		, _TL("Height of Atmosphere and Vapour Pressure"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode_2	, "ATMOSPHERE"		, _TL("Height of Atmosphere [m]"),
+		_TL(""),
+		PARAMETER_TYPE_Double		, 12000.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode_2	, "VAPOUR"			, _TL("Water Vapour Pressure [mbar]"),
+		_TL("This value is used as constant if no vapour pressure grid is given."),
+		PARAMETER_TYPE_Double		, 10, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode_2	= Parameters.Add_Node(
+		pNode_1	, "NODE_COMPONENTS"	, _TL("Air Pressure, Water and Dust Content"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode_2	, "PRESSURE"		, _TL("Atmospheric Pressure [mbar]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1013, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode_2	, "WATER"			, _TL("Water Content [cm]"),
+		_TL("Water content of a vertical slice of atmosphere in cm: 1.5 to 1.7, average=1.68"),
+		PARAMETER_TYPE_Double, 1.68, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode_2	, "DUST"			, _TL("Dust [ppm]"),
+		_TL("Dust factor: 100 ppm (standard)"),
+		PARAMETER_TYPE_Double, 100, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode_2	= Parameters.Add_Node(
+		pNode_1	, "NODE_LUMPED"		, _TL("Lumped Atmospheric Transmittance"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode_2	, "LUMPED"			, _TL("Lumped Atmospheric Transmittance [Percent]"),
+		_TL("The transmittance of the atmosphere, usually between 60 and 80 percent."),
+		PARAMETER_TYPE_Double, 70, 0.0, true, 100.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSolarRadiation::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GRD_LAT")) )
+	{
+		pParameters->Get_Parameter("NODE_LOCATION")->Set_Enabled(pParameter->asGrid() == NULL);
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GRD_VAPOUR")) )
+	{
+		pParameters->Get_Parameter("VAPOUR")->Set_Enabled(pParameter->asGrid() == NULL);
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PERIOD")) )
+	{
+		int		Value	= pParameter->asInt();
+
+		pParameters->Get_Parameter("MOMENT"    )->Set_Enabled(Value == 0);
+		pParameters->Get_Parameter("UPDATE"    )->Set_Enabled(Value >= 1);
+		pParameters->Get_Parameter("HOUR_RANGE")->Set_Enabled(Value >= 1);
+		pParameters->Get_Parameter("DHOUR"     )->Set_Enabled(Value >= 1);
+		pParameters->Get_Parameter("NODE_DAY_A")->Set_Enabled(Value >= 1);
+		pParameters->Get_Parameter("DDAYS"     )->Set_Enabled(Value == 2);
+		pParameters->Get_Parameter("NODE_DAY_B")->Set_Enabled(Value == 2);
+	}
+
+	//-----------------------------------------------------
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
+	{
+		int		Value	= pParameter->asInt();
+
+		pParameters->Get_Parameter("GRD_VAPOUR"     )->Set_Enabled(Value == 0);
+		pParameters->Get_Parameter("NODE_SADO"      )->Set_Enabled(Value == 0);
+		pParameters->Get_Parameter("NODE_COMPONENTS")->Set_Enabled(Value == 1);
+		pParameters->Get_Parameter("NODE_LUMPED"    )->Set_Enabled(Value == 2);
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::On_Execute(void)
+{
+	int		x, y;
+
+	//-----------------------------------------------------
+	m_pDEM			= Parameters("GRD_DEM")		->asGrid();
+	m_pVapour		= Parameters("GRD_VAPOUR")	->asGrid();
+	m_pSVF			= Parameters("GRD_SVF")		->asGrid();
+
+	m_pDirect		= Parameters("GRD_DIRECT")	->asGrid();
+	m_pDiffus		= Parameters("GRD_DIFFUS")	->asGrid();
+	m_pTotal		= Parameters("GRD_TOTAL")	->asGrid();
+	m_pRatio		= Parameters("GRD_RATIO")	->asGrid();
+	m_pDuration		= Parameters("DURATION")	->asGrid();
+	m_pSunrise		= Parameters("SUNRISE")		->asGrid();
+	m_pSunset		= Parameters("SUNSET")		->asGrid();
+
+	m_bUpdate		= Parameters("UPDATE")		->asInt();
+
+	m_Solar_Const	= Parameters("SOLARCONST")	->asDouble() / 1000.0;	// >> [kW / m�]
+	m_bLocalSVF		= Parameters("LOCALSVF")	->asBool();
+
+	m_Method		= Parameters("METHOD")		->asInt();
+	m_Atmosphere	= Parameters("ATMOSPHERE")	->asDouble();
+	m_Vapour		= Parameters("VAPOUR")		->asDouble();
+	m_Transmittance	= Parameters("LUMPED")		->asDouble() / 100.0;	// percent to ratio
+	m_Pressure		= Parameters("PRESSURE")	->asDouble();
+	m_Water			= Parameters("WATER")		->asDouble();
+	m_Dust			= Parameters("DUST")		->asDouble();
+
+	m_Time			= Parameters("PERIOD")		->asInt();
+	m_dHour			= Parameters("DHOUR")		->asDouble();
+	m_dDays			= Parameters("DDAYS")		->asInt();
+
+	m_Latitude		= Parameters("LATITUDE")	->asDouble() * M_DEG_TO_RAD;
+
+	m_bBending		= Parameters("BENDING")->asParameters()->Get_Parameter("BENDING")->asBool() || Parameters("GRD_LAT")->asGrid() || Parameters("GRD_LON")->asGrid();
+
+	//-----------------------------------------------------
+	switch( m_Time )
+	{
+	case 0:	// moment
+		m_Hour_A		= Parameters("MOMENT")->asDouble();
+		m_Day_A			= Parameters("DAY_A")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_A")->asInt());
+		break;
+
+	case 1:	// day
+		m_Hour_A		= Parameters("HOUR_RANGE")->asRange()->Get_LoVal();
+		m_Hour_B		= Parameters("HOUR_RANGE")->asRange()->Get_HiVal();
+		m_Day_A			= Parameters("DAY_A")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_A")->asInt());
+		m_Day_B			= m_Day_A;
+		break;
+
+	case 2:	// range of days
+		m_Hour_A		= Parameters("HOUR_RANGE")->asRange()->Get_LoVal();
+		m_Hour_B		= Parameters("HOUR_RANGE")->asRange()->Get_HiVal();
+		m_Day_A			= Parameters("DAY_A")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_A")->asInt());
+		m_Day_B			= Parameters("DAY_B")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_B")->asInt());
+
+		if( m_Day_B < m_Day_A )
+		{
+			m_Day_B	+= 365;
+		}
+		break;
+	}
+
+	//-----------------------------------------------------
+	CSG_Colors	Colors(100, SG_COLORS_YELLOW_RED, true);
+
+	Colors.Set_Ramp(SG_GET_RGB(  0,   0,  64), SG_GET_RGB(255, 159,   0),  0, 50);
+	Colors.Set_Ramp(SG_GET_RGB(255, 159,   0), SG_GET_RGB(255, 255, 255), 50, 99);
+
+	DataObject_Set_Colors(m_pDirect  , Colors);
+	DataObject_Set_Colors(m_pDiffus  , Colors);
+	DataObject_Set_Colors(m_pTotal   , Colors);
+	DataObject_Set_Colors(m_pRatio   , 100, SG_COLORS_RED_GREY_BLUE	, true);
+	DataObject_Set_Colors(m_pDuration, 100, SG_COLORS_YELLOW_RED	, true);
+	DataObject_Set_Colors(m_pSunrise , 100, SG_COLORS_YELLOW_RED	, false);
+	DataObject_Set_Colors(m_pSunset  , 100, SG_COLORS_YELLOW_RED	, true);
+
+	//-----------------------------------------------------
+	if( m_pDuration )	m_pDuration->Assign_NoData();
+	if( m_pSunrise  )	m_pSunrise ->Assign_NoData();
+	if( m_pSunset   )	m_pSunset  ->Assign_NoData();
+
+	if( m_pDuration )	m_pDuration->Set_Unit(_TL("h"));
+	if( m_pSunrise  )	m_pSunrise ->Set_Unit(_TL("h"));
+	if( m_pSunset   )	m_pSunset  ->Set_Unit(_TL("h"));
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("initialising gradient..."));
+
+	m_Shade .Create(*Get_System(), SG_DATATYPE_Byte);
+	m_Slope .Create(*Get_System(), SG_DATATYPE_Float);
+	m_Aspect.Create(*Get_System(), SG_DATATYPE_Float);
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			double	s, a;
+
+			if( m_pDEM->Get_Gradient(x, y, s, a) )
+			{
+				m_Slope .Set_Value(x, y, s);
+				m_Aspect.Set_Value(x, y, a);
+			}
+			else
+			{
+				m_Slope .Set_NoData(x, y);
+				m_Aspect.Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( m_bBending )
+	{
+		Process_Set_Text(_TL("initialising planetary bending..."));
+
+		m_Lat			.Create(*Get_System(), SG_DATATYPE_Float);
+		m_Lon			.Create(*Get_System(), SG_DATATYPE_Float);
+		m_Sol_Height	.Create(*Get_System(), SG_DATATYPE_Float);
+		m_Sol_Azimuth	.Create(*Get_System(), SG_DATATYPE_Float);
+
+		//-------------------------------------------------
+		if( Parameters("GRD_LAT")->asGrid() || Parameters("GRD_LON")->asGrid() )
+		{
+			if( Parameters("GRD_LAT")->asGrid() )
+			{
+				m_Lat	= *Parameters("GRD_LAT")->asGrid();
+				m_Lat	*= M_DEG_TO_RAD;
+			}
+
+			if( Parameters("GRD_LON")->asGrid() )
+			{
+				m_Lon	= *Parameters("GRD_LON")->asGrid();
+				m_Lon	*= M_DEG_TO_RAD;
+			}
+		}
+
+		//-------------------------------------------------
+		else
+		{
+			int		Offset;
+			double	d, dx, dy, dxA, dyA, Radius, Reference;
+
+			Offset		= Parameters("BENDING")->asParameters()->Get_Parameter("LON_OFFSET")  ->asInt();
+			Reference	= Parameters("BENDING")->asParameters()->Get_Parameter("LON_REF_USER")->asDouble();
+			Radius		= Parameters("BENDING")->asParameters()->Get_Parameter("RADIUS")      ->asDouble();
+			d			= 1.0 / Radius;
+
+			switch( Offset )
+			{
+			case 0:	dxA	= Get_System()->Get_Extent().Get_XMin();	break;	// left
+			case 1:	dxA	= Get_System()->Get_Extent().Get_XCenter();	break;	// center
+			case 2:	dxA	= Get_System()->Get_Extent().Get_XMax();	break;	// right
+			case 3:	dxA	= Reference;								break;	// user defined coordinate
+			}
+
+			Offset		= Parameters("BENDING")->asParameters()->Get_Parameter("LAT_OFFSET")  ->asInt();
+			Reference	= Parameters("BENDING")->asParameters()->Get_Parameter("LAT_REF_USER")->asDouble();
+
+			switch( Offset )
+			{
+			case 0:	dyA	= Get_System()->Get_Extent().Get_YMin();	break;	// bottom
+			case 1:	dyA	= Get_System()->Get_Extent().Get_YCenter();	break;	// center
+			case 2:	dyA	= Get_System()->Get_Extent().Get_YMax();	break;	// top
+			case 3:	dyA	= Reference;								break;	// user defined coordinate
+			}
+
+			dxA	 = d * (Get_XMin() - dxA);
+			dyA	 = d * (Get_YMin() - dyA) + m_Latitude;
+			d	*= Get_Cellsize();
+
+			for(y=0, dy=dyA; y<Get_NY() && Set_Progress(y); y++, dy+=d)
+			{
+				for(x=0, dx=dxA; x<Get_NX(); x++, dx+=d)
+				{
+					m_Lat.Set_Value(x, y, dy);
+					m_Lon.Set_Value(x, y, dx);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( Get_Insolation() )
+	{
+		Finalise();
+
+		return( true );
+	}
+
+	Finalise();
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::Finalise(void)
+{
+	double		dUnit;
+	CSG_String	Unit;
+
+	//-----------------------------------------------------
+	if( m_Time == 0 )	// moment
+	{
+		Unit	= SG_T("W / m\xb2");
+		dUnit	= 1000.0;
+	}
+	else switch( Parameters("UNITS")->asInt() )
+	{
+	case 0: default:	// [kWh / m2]
+		Unit	= SG_T("kWh / m\xb2");
+		dUnit	= 1.0;
+		break;
+
+	case 1:				// [kJ / m2]
+		Unit	= SG_T("kJ / m\xb2");
+		dUnit	= 3600.0;
+		break;
+
+	case 2:				// [Ws / cm2] = [J / cm2]
+		Unit	= SG_T("J / cm\xb2");
+		dUnit	= 360.0;
+		break;
+	}
+
+	//-----------------------------------------------------
+	m_pDirect->Set_Unit(Unit);
+	m_pDirect->Multiply(dUnit);
+
+	m_pDiffus->Set_Unit(Unit);
+	m_pDiffus->Multiply(dUnit);
+
+	if( m_pTotal )
+	{
+		m_pTotal->Assign(m_pDirect);
+		m_pTotal->Add  (*m_pDiffus);
+
+		m_pTotal->Set_Unit(Unit);
+	}
+
+	if( m_pRatio )
+	{
+		for(sLong i=0; i<Get_NCells(); i++)
+		{
+			if( m_pDEM->is_NoData(i) )
+			{
+				m_pRatio->Set_NoData(i);
+			}
+			else
+			{
+				if( m_pDiffus->asDouble(i) > 0.0 )
+				{
+					m_pRatio->Set_Value(i, m_pDirect->asDouble(i) / m_pDiffus->asDouble(i));
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Shade			.Destroy();
+	m_Slope			.Destroy();
+	m_Aspect		.Destroy();
+
+	m_Lat			.Destroy();
+	m_Lon			.Destroy();
+	m_Sol_Height	.Destroy();
+	m_Sol_Azimuth	.Destroy();
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::Get_Insolation(void)
+{
+	//-----------------------------------------------------
+	if( m_Time == 0 )						// Moment
+	{
+		m_pDirect->Assign(0.0);
+		m_pDiffus->Assign(0.0);
+
+		Get_Insolation(m_Day_A, m_Hour_A);
+	}
+
+	//-----------------------------------------------------
+	else if( m_Time == 1 )					// One Day
+	{
+		Get_Insolation(m_Day_A);
+	}
+
+	//-----------------------------------------------------
+	else if( m_Day_B - m_Day_A <= m_dDays )	// Range of Days (one representative calculation)
+	{
+		Get_Insolation(m_Day_A + m_dDays / 2);
+
+		m_pDirect->Multiply(m_Day_B - m_Day_A);
+		m_pDiffus->Multiply(m_Day_B - m_Day_A);
+	}
+
+	//-----------------------------------------------------
+	else									// Range of Days (more than one time step)
+	{
+		CSG_Grid	Direct, Diffus;
+
+		Direct.Create(*Get_System(), SG_DATATYPE_Float);
+		Diffus.Create(*Get_System(), SG_DATATYPE_Float);
+
+		Direct.Assign(0.0);
+		Diffus.Assign(0.0);
+
+		for(int Day=m_Day_A+m_dDays/2; Day<=m_Day_B && Process_Get_Okay(false); Day+=m_dDays)
+		{
+			Get_Insolation(Day);
+
+			SG_UI_Progress_Lock(true);
+
+			Direct.Add(*m_pDirect);
+			Diffus.Add(*m_pDiffus);
+
+			SG_UI_Progress_Lock(false);
+		}
+
+		m_pDirect->Assign(&Direct);
+		m_pDiffus->Assign(&Diffus);
+
+		m_pDirect->Multiply(m_dDays);
+		m_pDiffus->Multiply(m_dDays);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::Get_Insolation(int Day)
+{
+	//-----------------------------------------------------
+	double		Range	= 0.000001 + cos(M_DEG_TO_RAD * fabs(m_Latitude)) * sin(M_PI * ((80 + Day) % 365) / 365.0);
+	CSG_Grid	Direct;
+
+	if( m_bUpdate )
+	{
+		if( m_bUpdate == 2 )
+		{
+			DataObject_Update(m_pDirect, 0.0, Range, SG_UI_DATAOBJECT_SHOW);
+		}
+		else
+		{
+			DataObject_Update(m_pDirect, SG_UI_DATAOBJECT_SHOW);
+		}
+
+		Direct.Create(*Get_System(), SG_DATATYPE_Float);
+	}
+
+	//-----------------------------------------------------
+	bool		bDay, bWasDay	= false;
+
+	m_pDirect->Assign(0.0);
+	m_pDiffus->Assign(0.0);
+
+	for(double Hour=m_Hour_A; Hour<=m_Hour_B && Set_Progress(Hour - m_Hour_A, m_Hour_B - m_Hour_A); Hour+=m_dHour)
+	{
+		Process_Set_Text(CSG_String::Format(SG_T("%s %d(%d-%d), %s %02d:%02d"), _TL("day"), Day, m_Day_A, m_Day_B, _TL("local time"), (int)Hour, (int)(60.0 * fmod(Hour, 1.0))));
+
+		SG_UI_Progress_Lock(true);
+
+		bDay	= Get_Insolation(Day, Hour);
+
+		if( m_bUpdate && (bDay || bWasDay) )
+		{
+			bWasDay	= bDay;
+
+			if( m_bUpdate == 2 )
+			{
+				DataObject_Update(m_pDirect, 0.0, Range, SG_UI_DATAOBJECT_SHOW);
+			}
+			else
+			{
+				DataObject_Update(m_pDirect, SG_UI_DATAOBJECT_SHOW);
+			}
+
+			if( bDay )
+			{
+				Direct	+= *m_pDirect;
+
+				m_pDirect->Assign(0.0);
+			}
+		}
+
+		SG_UI_Progress_Lock(false);
+	}
+
+	//-----------------------------------------------------
+	if( m_bUpdate )
+	{
+		m_pDirect->Assign(&Direct);
+	}
+
+	m_pDirect->Multiply(m_dHour);
+	m_pDiffus->Multiply(m_dHour);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::Get_Insolation(int Day, double Hour)
+{
+	//-----------------------------------------------------
+	if( m_bBending )
+	{
+		bool	bDayLight	= false;
+
+		#pragma omp parallel for
+		for(int y=0; y<Get_NY(); y++)
+		{
+			for(int x=0; x<Get_NX() && Process_Get_Okay(); x++)
+			{
+				double	Sol_Height	= -1.0, Sol_Azimuth	= -1.0;
+
+				if( Get_Solar_Position(Day, Hour, m_Lat.asDouble(x, y), m_Lon.asDouble(x, y), Sol_Height, Sol_Azimuth) )
+				{
+					bDayLight	= true;
+				}
+
+				m_Sol_Height .Set_Value(x, y, Sol_Height);
+				m_Sol_Azimuth.Set_Value(x, y, Sol_Azimuth);
+			}
+		}
+
+		if( bDayLight )
+		{
+			return( Get_Insolation(0.0, 0.0, Hour) );
+		}
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		double	Sol_Height, Sol_Azimuth;
+
+		if( Get_Solar_Position(Day, Hour, m_Latitude, 0.0, Sol_Height, Sol_Azimuth) )
+		{
+			return( Get_Insolation(Sol_Height, Sol_Azimuth, Hour) );
+		}
+	}
+
+	//-----------------------------------------------------
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::Get_Insolation(double Sol_Height, double Sol_Azimuth, double Hour)
+{
+	Get_Shade(Sol_Height, Sol_Azimuth);
+
+	#pragma omp parallel for
+	for(int y=0; y<Get_NY(); y++)
+	{
+		for(int x=0; x<Get_NX() && Process_Get_Okay(); x++)
+		{
+			if( m_pDEM->is_NoData(x, y) )
+			{
+				m_pDirect->Set_NoData(x, y);
+				m_pDiffus->Set_NoData(x, y);
+			}
+			else
+			{
+				double	Direct, Diffus;
+
+				if( Get_Irradiance(x, y,
+						m_bBending ? m_Sol_Height .asDouble(x, y) : Sol_Height,
+						m_bBending ? m_Sol_Azimuth.asDouble(x, y) : Sol_Azimuth,
+						Direct, Diffus) )
+				{
+					m_pDirect->Add_Value(x, y, Direct);
+					m_pDiffus->Add_Value(x, y, Diffus);
+
+					if( Direct > 0.0 )
+					{
+						if( m_pDuration )
+						{
+							if( m_pDuration->is_NoData(x, y) )
+							{
+								m_pDuration	->Set_Value(x, y, m_dHour);
+							}
+							else
+							{
+								m_pDuration	->Add_Value(x, y, m_dHour);
+							}
+						}
+
+						if( m_pSunrise && (m_pSunrise->is_NoData(x, y) || m_pSunrise->asDouble(x, y) > Hour) )
+						{
+							m_pSunrise	->Set_Value(x, y, Hour);
+						}
+
+						if( m_pSunset )
+						{
+							m_pSunset	->Set_Value(x, y, Hour);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline double CSolarRadiation::Get_Air_Mass(double Sol_Height)
+{
+	static const double	Air_Mass[32]	=	// Optical air mass in 1 degree increments for zenith angles >=60 [after LIST, 1968; p. 422]
+	{
+		2.00,  2.06,  2.12,  2.19,  2.27,  2.36,  2.45,  2.55, 2.65,  2.77,  2.90,  3.05,  3.21,  3.39,  3.59,  3.82,
+		4.07,  4.37,  4.72,  5.12,  5.60,  6.18,  6.88,  7.77, 8.90, 10.39, 12.44, 15.36, 19.79, 26.96, 26.96, 26.96
+	};
+
+	//-------------------------------------------------
+	double	Zenith	= M_PI_090 - Sol_Height;
+
+	if( Zenith <= 60.0 * M_DEG_TO_RAD )
+	{
+		return( 1.0 / cos(Zenith) );
+	}
+	else
+	{
+		double	z	= M_RAD_TO_DEG * Zenith - 60.0;
+		int		i	= (int)z;
+
+		return( Air_Mass[i] + (z - i) * (Air_Mass[i + 1] - Air_Mass[i]) );
+	}
+}
+
+//---------------------------------------------------------
+inline bool CSolarRadiation::Get_Irradiance(int x, int y, double Sol_Height, double Sol_Azimuth, double &Direct, double &Diffus)
+{
+	if( Sol_Height <= 0.0 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	double	Elevation, Slope, Solar_Angle;
+
+	Elevation	= m_pDEM->asDouble(x, y);
+	Slope		= m_Slope.asDouble(x, y);
+	Solar_Angle	= m_Shade.asInt(x, y) ? 0.0 : cos(Slope) * cos(Sol_Height - M_PI_090) + sin(Slope) * sin(M_PI_090 - Sol_Height) * cos(Sol_Azimuth - m_Aspect.asDouble(x, y));
+
+	//-----------------------------------------------------
+	if( m_Method == 0 )	// Boehner
+	{
+		double	A, E, Vapour;
+
+		Vapour	= m_pVapour && !m_pVapour->is_NoData(x, y) ? m_pVapour->asDouble(x, y) : m_Vapour;
+		Vapour	= Vapour > 0.0 ? sqrt(Vapour) : 0.0;
+		E		= 0.9160 - 0.05125 * Vapour;
+		A		= 0.4158 + 0.03990 * Vapour;
+
+		Direct	= pow(E, (1.0 - Elevation / m_Atmosphere) / sin(Sol_Height));
+
+		Diffus	= m_Atmosphere / (m_Atmosphere - Elevation) * (0.0001165 * SG_Get_Square(M_RAD_TO_DEG * Sol_Height) - 0.0152 * M_RAD_TO_DEG * Sol_Height + A);
+		Diffus	= Direct * sin(Sol_Height) * (1.0 / (1.0 - Diffus) - 1.0);
+	}
+
+	//-----------------------------------------------------
+	else				// TAPES
+	{
+		double	Air_Mass	= Get_Air_Mass(Sol_Height) * (m_Pressure / pow(10.0, Elevation * 5.4667E-05)) / 1013.0;
+
+		//-------------------------------------------------
+		if( m_Method == 1 )	// Air Pressure, Water and Dust Content
+		{
+			double	AW, TW, TD, TDC;
+
+			AW		= 1.0 - 0.077 * pow(m_Water * Air_Mass, 0.3);		// absorption by water vapour
+			TW		= pow(0.975, m_Water * Air_Mass);					// scattering by water vapour	| problem (?!): fortran source differs from paper
+			TD		= pow(0.950, m_Water * m_Dust / 100.0);				// scattering by dust			| problem (?!): 100ppm := 1, 300ppm := 2
+			TDC		= pow(0.900, Air_Mass) + 0.026 * (Air_Mass - 1.0);	// scattering by a dust free atmosphere
+
+			Direct	= AW * TW * TD * TDC;
+			Diffus	= 0.5 * (AW - Direct);
+		}
+
+		//-------------------------------------------------
+		else				// Lumped Atmospheric Transmittance
+		{
+			Direct	= pow(m_Transmittance, Air_Mass);
+			Diffus	= 0.271 - 0.294 * Direct;
+		}
+	}
+
+	//-----------------------------------------------------
+	Direct	= Solar_Angle <= 0.0 ? 0.0 : Solar_Angle * Direct * m_Solar_Const;
+
+	double	SVF	= m_pSVF && !m_pSVF->is_NoData(x, y) ? m_pSVF->asDouble(x, y) : m_bLocalSVF ? (1.0 + cos(Slope)) / 2.0 : 1.0;
+
+	Diffus	= m_Solar_Const * Diffus * SVF;
+
+	if( Direct < 0.0 )	{	Direct	= 0.0;	}	else if( Direct > m_Solar_Const )	{	Direct	= m_Solar_Const;	}
+	if( Diffus < 0.0 )	{	Diffus	= 0.0;	}	else if( Diffus > m_Solar_Const )	{	Diffus	= m_Solar_Const;	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+/* The original TAPES-G source code for the optical air mass computation
+C ==================================================================
+      SUBROUTINE SOLAR(ZA,RDIRN,RDIFN,ITEST)
+      COMMON/SOL1/U,D,P,TRANSM
+      PARAMETER (PI=3.14159265358979323846)
+      PARAMETER (DTOR=PI/180.)
+      DIMENSION AM(32)
+      DATA AM/2.0,2.06,2.12,2.19,2.27,2.36,2.45,2.55,2.65,2.77,2.9,
+     *  3.05,3.21,3.39,3.59,3.82,4.07,4.37,4.72,5.12,5.6,6.18,6.88,
+     *  7.77,8.9,10.39,12.44,15.36,19.79,26.96,26.96,26.96/
+      DATA PO/1013./
+C     ***************************************************************
+C     AM    Optical air mass in 1 degree increments for zenith angles
+C           >=60 [LIST, 1968; p. 422]
+C     U     Water content of a vertical slice of atmosphere in cm: 
+C           1.5 to 1.7, average=1.68
+C     D     Dust factor: 1=100 ppm (standard); 2=300 ppm
+C     P     Barometric pressure in mb
+C     PO    Standard atmospheric pressure = 1013 mb
+C     TRANSM  Transmittance of the atmosphere (0.6-0.8)
+C     AW    Accounts for absorption by water vapour
+C     TW    Accounts for scattering by water vapour
+C     TD    Accounts for scattering by dust
+C     TDC   Accounts for scattering by a dust free atmosphere
+C     **************************************************************
+C     Compute optical air mass
+C
+      IF(ZA.LE.60.) THEN
+         AMASS=1./COS(ZA*DTOR)
+      ELSE
+         Y=ZA-59.
+         I=INT(Y)
+         AMASS=AM(I)+(Y-FLOAT(I))*(AM(I+1)-AM(I))
+      ENDIF
+      AMASS2=AMASS*P/PO
+C     --------------------------------------------------------------
+C     Account for atmospheric effects using either a lumped atmos-
+C     pheric transmittance approach (ITEST=1) or by calculating the
+C     components (ITEST=2)
+C
+      IF(ITEST.EQ.1) THEN
+         RDIRN=TRANSM**AMASS2
+         RDIFN=0.271-0.294*RDIRN
+      ELSE
+         AW=1.0-0.077*(U*AMASS2)**0.3
+         TW=0.975**(U*AMASS)
+         TD=0.95**(U*D)
+         TDC=0.9**AMASS2+0.026*(AMASS2-1.0)
+         RDIRN=AW*TW*TD*TDC
+         RDIFN=0.5*(AW-RDIRN)
+      ENDIF
+      RETURN
+      END
+C ====================================================================*/
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSolarRadiation::Get_Shade(double Sol_Height, double Sol_Azimuth)
+{
+	m_Shade.Assign(0.0);
+
+	if( !m_bBending )
+	{
+		int		x, y;
+		double	dx, dy, dz;
+
+		Get_Shade_Params(Sol_Height, Sol_Azimuth, dx, dy, dz);
+
+		for(sLong i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
+		{
+			if( m_pDEM->Get_Sorted(i, x, y) && !Get_Shade_Complete(x, y) )
+			{
+				Set_Shade(x, y, dx, dy, dz);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		int		x, y, iLock;
+		sLong	i;
+
+		for(i=0, iLock=1; i<Get_NCells() && Set_Progress_NCells(i); i++, iLock++)
+		{
+			if( m_pDEM->Get_Sorted(i, x, y) && !Get_Shade_Complete(x, y) )
+			{
+				if( iLock >= 255 )
+					iLock	= 1;
+
+				if( iLock == 1 )
+					Lock_Create();
+
+				Set_Shade_Bended(x, y, iLock);
+			}
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+void CSolarRadiation::Set_Shade(int x, int y, double dx, double dy, double dz)
+{
+	for(double ix=x+0.5, iy=y+0.5, iz=m_pDEM->asDouble(x, y); ; )
+	{
+		x	= (int)(ix	+= dx);
+		y	= (int)(iy	+= dy);
+					iz	-= dz;
+
+		if( !is_InGrid(x, y) || m_pDEM->asDouble(x, y) > iz )
+		{
+			return;
+		}
+
+		m_Shade.Set_Value(x, y, 1);
+	}
+}
+
+//---------------------------------------------------------
+void CSolarRadiation::Set_Shade_Bended(int x, int y, char iLock)
+{
+	double	dx, dy, dz;
+
+	Get_Shade_Params(m_Sol_Height.asDouble(x, y), m_Sol_Azimuth.asDouble(x, y), dx, dy, dz);
+
+	for(double ix=x+0.5, iy=y+0.5, iz=m_pDEM->asDouble(x, y); ; )
+	{
+		x	= (int)(ix	+= dx);
+		y	= (int)(iy	+= dy);
+					iz	-= dz;
+
+		if( !is_InGrid(x, y) || m_pDEM->asDouble(x, y) > iz || Lock_Get(x, y) == iLock )
+		{
+			return;
+		}
+
+		m_Shade.Set_Value(x, y, 1);
+
+		//---------------------------------------------
+		Lock_Set(x, y, iLock);
+
+		Get_Shade_Params(m_Sol_Height.asDouble(x, y), m_Sol_Azimuth.asDouble(x, y), dx, dy, dz);
+	}
+}
+
+//---------------------------------------------------------
+inline bool CSolarRadiation::Get_Shade_Complete(int x, int y)
+{
+	if( m_Shade.asInt(x, y) == 1 )
+	{
+		for(int iy=y-1; iy<=y+1; iy++)
+		{
+			for(int ix=x-1; ix<x+1; ix++)
+			{
+				if( is_InGrid(ix, iy) && m_Shade.asInt(ix, iy) == 0 )
+				{
+					return( false );
+				}
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+inline void CSolarRadiation::Get_Shade_Params(double Sol_Height, double Sol_Azimuth, double &dx, double &dy, double &dz)
+{
+	dz	= Sol_Azimuth + M_PI_180;
+	dx	= sin(dz);
+	dy	= cos(dz);
+
+	if( fabs(dx) > fabs(dy) )
+	{
+		dy	/= fabs(dx);
+		dx	= dx < 0 ? -1 : 1;
+	}
+	else if( fabs(dy) > fabs(dx) )
+	{
+		dx	/= fabs(dy);
+		dy	= dy < 0 ? -1 : 1;
+	}
+	else
+	{
+		dx	= dx < 0 ? -1 : 1;
+		dy	= dy < 0 ? -1 : 1;
+	}
+
+	dz	= tan(Sol_Height) * sqrt(dx*dx + dy*dy) * Get_Cellsize();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline int CSolarRadiation::Get_Day_of_Year(int Month)
+{
+	static const int	Day[13]	= {	0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
+
+	return( Month < 0 ? 0 : Month > 12 ? Day[12] : Day[Month] );
+}
+
+//---------------------------------------------------------
+inline bool CSolarRadiation::Get_Solar_Position(int Day, double Hour, double LAT, double LON, double &Sol_Height, double &Sol_Azimuth)
+{
+	static const double	ECLIPTIC_OBL	= M_DEG_TO_RAD * 23.43999;	// obliquity of ecliptic
+
+	int		i;
+
+	double	JD, T, M, L, X, Y, Z, R, UTime,
+			DEC, RA, theta, tau,
+			Month, Year		= 2000;
+
+	//-----------------------------------------------------
+	Day	%= 365;
+
+	for(Month=1, i=0; i<=12; i++)
+	{
+		if( Day < Get_Day_of_Year(i) )
+		{
+			Month	= i;
+			Day		-= Get_Day_of_Year(i - 1);
+			break;
+		}
+	}
+
+	if( Month < 1 || Month > 12 )	// nur Tag (1 - 365) zaehlt...
+	{
+		Month		= 1;
+	}
+
+	if( Month <= 2 )
+	{
+		Month		+= 12;
+		Year		-= 1;
+	}
+
+
+	//-----------------------------------------------------
+
+//	UTime		= Hour - LON * 12.0 / M_PI;
+	UTime		= Hour;
+
+
+	//-----------------------------------------------------
+	// 1. Julian Date...
+
+	JD			= (int)(365.25 * Year) + (int)(30.6001 * (Month + 1)) - 15 + 1720996.5 + Day + UTime / 24.0;
+	T			= (JD - 2451545.0 ) / 36525.0;	// number of Julian centuries since 2000/01/01 at 12 UT (JD = 2451545.0)
+
+
+	//-----------------------------------------------------
+	// 2. Solar Coordinates (according to: Jean Meeus: Astronomical Algorithms), accuracy of 0.01 degree
+
+	M			= M_DEG_TO_RAD * (357.52910 + 35999.05030 * T - 0.0001559 * T * T - 0.00000048 * T * T * T);	// mean anomaly
+	L			= M_DEG_TO_RAD * (	(280.46645 + 36000.76983 * T + 0.0003032 * T * T)							// mean longitude
+							+	(	(1.914600 - 0.004817 * T - 0.000014  * T * T) * sin(M)
+								+	(0.019993 - 0.000101 * T) * sin(2 * M) + 0.000290 * sin(3 * M)				// true longitude
+								)
+							);
+
+
+	//-----------------------------------------------------
+	// 3. convert ecliptic longitude to right ascension RA and declination delta
+
+	X			= cos(L);
+	Y			= cos(ECLIPTIC_OBL) * sin(L);
+	Z			= sin(ECLIPTIC_OBL) * sin(L);
+	R			= sqrt(1.0 - Z*Z); 
+
+	DEC			= atan2(Z, R);
+	RA			= 2.0 * atan2(Y, (X + R));
+
+
+	//-----------------------------------------------------
+	// 4. compute sidereal time (degree) at Greenwich local sidereal time at longitude (Degree)
+
+	theta		= LON + M_DEG_TO_RAD * (280.46061837 + 360.98564736629 * (JD - 2451545.0) + T*T * (0.000387933 - T / 38710000.0));
+
+
+	//-----------------------------------------------------
+	// 5. compute local hour angle (degree)
+
+	tau			= theta - RA;
+
+
+	//-----------------------------------------------------
+	// 6. convert (tau, delta) to horizon coordinates (h, az) of the observer
+
+	Sol_Height	= asin ( sin(LAT) * sin(DEC) + cos(LAT) * cos(DEC) * cos(tau) );
+
+	Sol_Azimuth	= atan2( -sin(tau) * cos(DEC), cos(LAT) * sin(DEC) - sin(LAT) * cos(DEC) * cos(tau) );
+//	Sol_Azimuth	= atan2( -sin(Tau), cos(LAT) * tan(DEC) - sin(LAT) * cos(Tau) );	// previous formula gives same result but is better because of division by zero effects...
+
+	return( Sol_Height > 0.0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.h b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.h
rename to src/modules/terrain_analysis/ta_lighting/SolarRadiation.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_BASE.cpp b/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_BASE.cpp
rename to src/modules/terrain_analysis/ta_lighting/Visibility_BASE.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_BASE.h b/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_BASE.h
rename to src/modules/terrain_analysis/ta_lighting/Visibility_BASE.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.cpp b/src/modules/terrain_analysis/ta_lighting/Visibility_Point.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.cpp
rename to src/modules/terrain_analysis/ta_lighting/Visibility_Point.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.h b/src/modules/terrain_analysis/ta_lighting/Visibility_Point.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.h
rename to src/modules/terrain_analysis/ta_lighting/Visibility_Point.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Points.cpp b/src/modules/terrain_analysis/ta_lighting/Visibility_Points.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Points.cpp
rename to src/modules/terrain_analysis/ta_lighting/Visibility_Points.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Points.h b/src/modules/terrain_analysis/ta_lighting/Visibility_Points.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Points.h
rename to src/modules/terrain_analysis/ta_lighting/Visibility_Points.h
diff --git a/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp b/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp
new file mode 100644
index 0000000..90b4a4b
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp
@@ -0,0 +1,417 @@
+/**********************************************************
+ * Version $Id: topographic_correction.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_lighting                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               topographic_correction.cpp              //
+//                                                       //
+//                 Copyright (C) 2008 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "topographic_correction.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTopographic_Correction::CTopographic_Correction(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	Set_Name		(_TL("Topographic Correction"));
+
+	Set_Author		(_TL("Copyrights (c) 2008 by Olaf Conrad"));
+
+	Set_Description	(_TW(
+		"\n"
+		"References:\n"
+		"Civco, D. L. (1989): "
+		"'Topographic Normalization of Landsat Thematic Mapper Digital Imagery', "
+		"Photogrammetric Engineering and Remote Sensing, 55(9), pp.1303-1309.\n"
+		"\n"
+		"Law, K.H., Nichol, J. (2004): "
+		"'Topographic Correction for Differential Illumination Effects on Ikonos Satellite Imagery', "
+		"ISPRS 2004 International Society for Photogrammetry and Remote Sensing, "
+		"<a href=\"http://www.cartesia.org/geodoc/isprs2004/comm3/papers/347.pdf\">pdf</a>.\n"
+		"\n"
+		"Phua, M.-H., Saito, H. (2003): "
+		"'Estimation of biomass of a mountainous tropical forest using Landsat TM data', "
+		"Canadian Journal of Remote Sensing, 29(4), pp.429-440.\n"
+		"\n"
+		"Riano, D., Chuvieco, E. Salas, J., Aguado, I. (2003): "
+		"'Assessment of Different Topographic Corrections in Landsat-TM Data for Mapping Vegetation Types', "
+		"IEEE Transactions on Geoscience and Remote Sensing, 41(5), pp.1056-1061, "
+		"<a href=\"http://www.geogra.uah.es/~emilio/pdf/Riano2003b.pdf\">pdf</a>.\n"
+		"\n"
+		"Teillet, P.M., Guindon, B., Goodenough, D.G. (1982): "
+		"'On the slope-aspect correction of multispectral scanner data', "
+		"Canadian Journal of Remote Sensing, 8(2), pp.1537-1540.\n"
+		"\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT, false
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ORIGINAL"	, _TL("Original Image"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CORRECTED"	, _TL("Corrected Image"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	pNode	= Parameters.Add_Node(NULL, "NODE_SOLAR", _TL("Solar Position"), _TL(""));
+
+	Parameters.Add_Value(
+		pNode	, "AZI"			, _TL("Azimuth"),
+		_TL("direction of sun (degree, clockwise from North)"),
+		PARAMETER_TYPE_Double	, 180.0, 0.0, true, 360.0, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "HGT"			, _TL("Height"),
+		_TL("height of sun above horizon (degree)"),
+		PARAMETER_TYPE_Double	,  45.0, 0.0, true,  90.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("Cosine Correction (Teillet et al. 1982)"),
+			_TL("Cosine Correction (Civco 1989)"),
+			_TL("Minnaert Correction"),
+			_TL("Minnaert Correction with Slope (Riano et al. 2003)"),
+			_TL("Minnaert Correction with Slope (Law & Nichol 2004)"),
+			_TL("C Correction"),
+			_TL("Normalization (after Civco, modified by Law & Nichol)")
+		), 4
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MINNAERT"	, _TL("Minnaert Correction"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 0.5, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "MAXCELLS"	, _TL("Maximum Cells (C Correction Analysis)"),
+		_TL("Maximum number of grid cells used for trend analysis as required by C correction."),
+		PARAMETER_TYPE_Int		, 1000.0, 10.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "MAXVALUE"	, _TL("Value Range"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("1 byte (0-255)"),
+			_TL("2 byte (0-65535)")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTopographic_Correction::On_Execute(void)
+{
+	//-----------------------------------------------------
+	if( !Get_Illumination() )
+	{
+		m_Slope			.Destroy();
+		m_Illumination	.Destroy();
+
+		return( false );
+	}
+
+	if( !Get_Model() )
+	{
+		m_Slope			.Destroy();
+		m_Illumination	.Destroy();
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Topographic Correction"));
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( m_pOriginal->is_NoData(x, y) )
+			{
+				m_pCorrected->Set_NoData(x, y);
+			}
+			else
+			{
+				m_pCorrected->Set_Value(x, y, Get_Correction(
+					m_Slope       .asDouble(x, y),
+					m_Illumination.asDouble(x, y),
+					m_pOriginal  ->asDouble(x, y)
+				));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Slope			.Destroy();
+	m_Illumination	.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CTopographic_Correction::Get_Correction(double Slope, double Illumination, double Value)
+{
+	switch( m_Method )
+	{
+	case 0:	// Cosine Correction (Teillet et al. 1982)
+		if( Illumination > 0.0 )
+		{
+			Value	= Value * m_cosTz / Illumination;
+		}
+		break;
+
+	case 1:	// Cosine Correction (Civco 1989)
+		Value	= Value + (Value * ((m_Illumination.Get_ArithMean() - Illumination) / m_Illumination.Get_ArithMean()));
+		break;
+
+	case 2:	// Minnaert Correction
+		if( Illumination > 0.0 )
+		{
+			Value	= Value * pow(m_cosTz / Illumination, m_Minnaert);
+		}
+		break;
+
+	case 3:	// Minnaert Correction with Slope (Riano et al. 2003)
+		if( Illumination > 0.0 )
+		{
+			Value	= Value * cos(Slope) * pow(m_cosTz / (Illumination * cos(Slope)), m_Minnaert);
+		}
+		break;
+
+	case 4:	// Minnaert Correction with Slope (Law & Nichol 2004)
+		if( Illumination > 0.0 )
+		{
+			Value	= Value * cos(Slope) / pow(Illumination * cos(Slope), m_Minnaert);
+		}
+		break;
+
+	case 5:	// C Correction
+		Value	= Value * (m_cosTz + m_C) / (Illumination + m_C);
+		break;
+
+	case 6:	// Normalization
+		Value	= Value + ((Value * ((m_Illumination.Get_ArithMean() - Illumination) / m_Illumination.Get_ArithMean())) * m_C);
+		break;
+	}
+
+	return( Value < 0 ? 0 : Value > m_maxValue ? m_maxValue : Value );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTopographic_Correction::Get_Model(void)
+{
+	//-----------------------------------------------------
+	m_pOriginal		= Parameters("ORIGINAL")	->asGrid();
+	m_pCorrected	= Parameters("CORRECTED")	->asGrid();
+
+	m_pCorrected	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pOriginal->Get_Name(), _TL("Topographic Correction")));
+
+	m_Method		= Parameters("METHOD")		->asInt();
+
+	m_Minnaert		= Parameters("MINNAERT")	->asDouble();
+
+	switch( Parameters("MAXVALUE")->asInt() )
+	{
+	default:	m_maxValue	=   255;	break;
+	case  1:	m_maxValue	= 65535;	break;
+	}
+
+	switch( m_Method )
+	{
+	//-----------------------------------------------------
+	case 5:	// C Correction
+		{
+			Process_Set_Text(_TL("Regression Analysis"));
+
+			CSG_Regression	R;
+
+			sLong n		= Parameters("MAXCELLS")->asInt();
+			int	nStep	= Get_NCells() < n ? 1 : (int)(Get_NCells() / n);
+
+			for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n+=nStep)
+			{
+				R.Add_Values(m_pOriginal->asDouble(n), m_Illumination.asDouble(n));
+			}
+
+			if( !R.Calculate() || !R.Get_Constant() )
+			{
+				return( false );
+			}
+
+			m_C	= R.Get_Coefficient() / R.Get_Constant();
+
+			Message_Add(R.asString());
+		}
+		break;
+
+	//-----------------------------------------------------
+	case 6:	// Normalization (after Civco, modified by Law & Nichol)
+		{
+			m_C	= 1.0;
+		}
+		break;
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTopographic_Correction::Get_Illumination(void)
+{
+	Process_Set_Text(_TL("Illumination calculation"));
+
+	//-----------------------------------------------------
+	CSG_Grid	DEM, *pDEM	= Parameters("DEM")->asGrid();
+
+	if( !pDEM->Get_System().is_Equal(*Get_System()) )
+	{
+		DEM.Create(*Get_System());
+		DEM.Assign(pDEM, pDEM->Get_Cellsize() > Get_Cellsize() ? GRID_INTERPOLATION_BSpline : GRID_INTERPOLATION_Mean_Cells);
+		pDEM	= &DEM;
+	}
+
+	//-----------------------------------------------------
+	double	Azi	= Parameters("AZI")->asDouble() * M_DEG_TO_RAD;
+	double	Hgt	= Parameters("HGT")->asDouble() * M_DEG_TO_RAD;
+
+	m_cosTz	= cos(M_PI_090 - Hgt);
+	m_sinTz	= sin(M_PI_090 - Hgt);
+
+	m_Slope			.Create(*Get_System());
+	m_Illumination	.Create(*Get_System());
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	Slope, Aspect;
+
+			if( pDEM->Get_Gradient(x, y, Slope, Aspect) )
+			{
+				m_Slope			.Set_Value(x, y, Slope);
+				m_Illumination	.Set_Value(x, y, cos(Slope) * m_cosTz + sin(Slope) * m_sinTz * cos(Azi - Aspect));
+			}
+			else
+			{
+				m_Slope			.Set_Value(x, y, 0.0);
+				m_Illumination	.Set_Value(x, y, m_cosTz);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.h b/src/modules/terrain_analysis/ta_lighting/topographic_correction.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.h
rename to src/modules/terrain_analysis/ta_lighting/topographic_correction.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_openness.cpp b/src/modules/terrain_analysis/ta_lighting/topographic_openness.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_openness.cpp
rename to src/modules/terrain_analysis/ta_lighting/topographic_openness.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_openness.h b/src/modules/terrain_analysis/ta_lighting/topographic_openness.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_openness.h
rename to src/modules/terrain_analysis/ta_lighting/topographic_openness.h
diff --git a/src/modules/terrain_analysis/ta_lighting/view_shed.cpp b/src/modules/terrain_analysis/ta_lighting/view_shed.cpp
new file mode 100644
index 0000000..e2fa308
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_lighting/view_shed.cpp
@@ -0,0 +1,434 @@
+/**********************************************************
+ * Version $Id: view_shed.cpp 1972 2014-02-06 16:19:50Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      ta_lighting                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     View_Shed.cpp                     //
+//                                                       //
+//                 Copyright (C) 2008 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                  //
+//                Bundesstr. 55                          //
+//                20146 Hamburg                          //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "view_shed.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CView_Shed::CView_Shed(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Sky View Factor"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		"Calculation of visible sky, sky view factor (SVF) and related parameters.\n"
+		"\n"
+		"References:\n"
+		"Boehner, J., Antonic, O. (2009): "
+		"'Land-surface parameters specific to topo-climatology'. "
+		"in: Hengl, T., Reuter, H. (Eds.): 'Geomorphometry - Concepts, Software, Applications'. "
+		"Developments in Soil Science, Volume 33, p.195-226, Elsevier\n"
+		"\n"
+		"Hantzschel, J., Goldberg, V., Bernhofer, C. (2005): "
+		"'GIS-based regionalisation of radiation, temperature and coupling measures in complex terrain for low mountain ranges'. "
+		"Meteorological Applications, V.12:01, p.33-42, doi:10.1017/S1350482705001489\n"
+		"\n"
+		"Oke, T.R. (2000): "
+		"'Boundary Layer Climates'. "
+		"Taylor & Francis, New York. 435pp.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "VISIBLE"		, _TL("Visible Sky"),
+		_TL("The unobstructed hemisphere given as percentage."),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SVF"			, _TL("Sky View Factor"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SIMPLE"		, _TL("Sky View Factor (Simplified)"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "TERRAIN"		, _TL("Terrain View Factor"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DISTANCE"	, _TL("View Distance"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Value(
+		NULL	, "RADIUS"		, _TL("Maximum Search Radius"),
+		_TL("This value is ignored if set to zero."),
+		PARAMETER_TYPE_Double	, 10000.0, 0.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("multi scale"),
+			_TL("sectors")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "DLEVEL"		, _TL("Multi Scale Factor"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 3.0, 1.25, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "NDIRS"		, _TL("Number of Sectors"),
+		_TL(""),
+		PARAMETER_TYPE_Int	, 8.0, 3, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CView_Shed::On_Execute(void)
+{
+	CSG_Grid	*pVisible, *pSVF, *pSimple, *pTerrain, *pDistance;
+
+	m_pDEM		= Parameters("DEM"     )->asGrid();
+
+	pVisible	= Parameters("VISIBLE" )->asGrid();
+	pSVF		= Parameters("SVF"     )->asGrid();
+	pSimple		= Parameters("SIMPLE"  )->asGrid();
+	pTerrain	= Parameters("TERRAIN" )->asGrid();
+	pDistance	= Parameters("DISTANCE")->asGrid();
+
+	m_Radius	= Parameters("RADIUS"  )->asDouble();
+	m_Method	= Parameters("METHOD"  )->asInt();
+
+	DataObject_Set_Colors(pVisible	, 100, SG_COLORS_BLACK_WHITE);
+	DataObject_Set_Colors(pSVF		, 100, SG_COLORS_BLACK_WHITE);
+	DataObject_Set_Colors(pSimple	, 100, SG_COLORS_BLACK_WHITE);
+	DataObject_Set_Colors(pTerrain	, 100, SG_COLORS_BLACK_WHITE, true);
+	DataObject_Set_Colors(pDistance	, 100, SG_COLORS_RED_GREY_GREEN, true);
+
+	//-----------------------------------------------------
+	if( m_Method == 0 )	// multi scale
+	{
+		if( !m_Pyramid.Create(m_pDEM, Parameters("DLEVEL")->asDouble(), GRID_PYRAMID_Mean) )
+		{
+			return( false );
+		}
+
+		m_nLevels	= m_Pyramid.Get_Count();
+
+		if( m_Radius > 0.0 )
+		{
+			while( m_nLevels > 0 && m_Pyramid.Get_Grid(m_nLevels - 1)->Get_Cellsize() > m_Radius )
+			{
+				m_nLevels--;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	bool	bResult	= Initialise(Parameters("NDIRS")->asInt());
+
+	if( bResult )
+	{
+		if( m_Method != 0 && m_Radius <= 0.0 )
+		{
+			m_Radius	= Get_Cellsize() * M_GET_LENGTH(Get_NX(), Get_NY());
+		}
+
+		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			#pragma omp parallel for
+			for(int x=0; x<Get_NX(); x++)
+			{
+				double	Visible, SVF, Simple, Terrain, Distance;
+
+				if( Get_View_Shed(x, y, Visible, SVF, Simple, Terrain, Distance) )
+				{
+					if( pVisible  )	pVisible ->Set_Value (x, y, Visible);
+					if( pSVF      )	pSVF	 ->Set_Value (x, y, SVF);
+					if( pSimple   )	pSimple	 ->Set_Value (x, y, Simple);
+					if( pTerrain  )	pTerrain ->Set_Value (x, y, Terrain);
+					if( pDistance )	pDistance->Set_Value (x, y, Distance);
+				}
+				else
+				{
+					if( pVisible  )	pVisible ->Set_NoData(x, y);
+					if( pSVF      )	pSVF	 ->Set_NoData(x, y);
+					if( pSimple   )	pSimple	 ->Set_NoData(x, y);
+					if( pTerrain  )	pTerrain ->Set_NoData(x, y);
+					if( pDistance )	pDistance->Set_NoData(x, y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Pyramid	.Destroy();
+	m_Direction	.Clear();
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CView_Shed::Initialise(int nDirections)
+{
+	m_Direction.Set_Count(nDirections);
+
+	for(int i=0; i<nDirections; i++)
+	{
+		m_Direction[i].z	= (M_PI_360 * i) / nDirections;
+		m_Direction[i].x	= sin(m_Direction[i].z);
+		m_Direction[i].y	= cos(m_Direction[i].z);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CView_Shed::Get_View_Shed(int x, int y, double &Sky_Visible, double &Sky_Factor, double &Sky_Simple, double &Sky_Terrain, double &Distance)
+{
+	if( m_pDEM->is_NoData(x, y) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Vector	Angles(m_Direction.Get_Count()), Distances(m_Direction.Get_Count());
+
+	switch( m_Method )
+	{
+	case 0:	if( !Get_Angles_Multi_Scale(x, y, Angles, Distances) )	return( false );	break;
+	case 1:	if( !Get_Angles_Sectoral   (x, y, Angles, Distances) )	return( false );	break;
+	}
+
+	//-----------------------------------------------------
+	double	Slope, Aspect, sinSlope, cosSlope, Phi, sinPhi, cosPhi;
+
+	if( !m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
+	{
+		Slope	= Aspect	= 0.0;
+	}
+
+	sinSlope	= sin(Slope);
+	cosSlope	= cos(Slope);
+
+	Sky_Visible	= 0.0;
+	Sky_Factor	= 0.0;
+	Distance	= 0.0;
+
+	//-----------------------------------------------------
+	for(int i=0; i<m_Direction.Get_Count(); i++)
+	{
+		Phi			= atan(Angles[i]);
+		cosPhi		= cos(Phi);
+		sinPhi		= sin(Phi);
+
+		Sky_Visible	+= (M_PI_090 - Phi) * 100.0 / M_PI_090;
+		Sky_Factor	+= cosSlope * cosPhi*cosPhi + sinSlope * cos(m_Direction[i].z - Aspect) * ((M_PI_090 - Phi) - sinPhi * cosPhi);
+		Distance	+= Distances[i];
+	}
+
+	Sky_Visible	/= m_Direction.Get_Count();
+	Sky_Factor	/= m_Direction.Get_Count();
+	Distance	/= m_Direction.Get_Count();
+
+	Sky_Simple	= (1.0 + cosSlope) / 2.0;
+	Sky_Terrain	= Sky_Simple - Sky_Factor;
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CView_Shed::Get_Angles_Multi_Scale(int x, int y, CSG_Vector &Angles, CSG_Vector &Distances)
+{
+	if( !m_pDEM->is_NoData(x, y) )
+	{
+		double		z, d;
+		TSG_Point	p, q;
+
+		z	= m_pDEM->asDouble(x, y);
+		p	= Get_System()->Get_Grid_to_World(x, y);
+
+		//-------------------------------------------------
+		for(int iGrid=-1; iGrid<m_nLevels; iGrid++)
+		{
+			CSG_Grid	*pGrid	= m_Pyramid.Get_Grid(iGrid);
+
+			for(int i=0; i<m_Direction.Get_Count(); i++)
+			{
+				q.x	= p.x + pGrid->Get_Cellsize() * m_Direction[i].x;
+				q.y	= p.y + pGrid->Get_Cellsize() * m_Direction[i].y;
+
+				if( pGrid->Get_Value(q, d) && (d = (d - z) / pGrid->Get_Cellsize()) > Angles[i] )
+				{
+					Angles   [i]	= d;
+					Distances[i]	= pGrid->Get_Cellsize();
+				}
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CView_Shed::Get_Angles_Sectoral(int x, int y, CSG_Vector &Angles, CSG_Vector &Distances)
+{
+	if( !m_pDEM->is_NoData(x, y) )
+	{
+		//-------------------------------------------------
+		for(int i=0; i<m_Direction.Get_Count(); i++)
+		{
+			Get_Angle_Sectoral(x, y, i, Angles[i], Distances[i]);
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+void CView_Shed::Get_Angle_Sectoral(int x, int y, int i, double &Angle, double &Distance)
+{
+	double	iDistance, dDistance, dx, dy, ix, iy, d, z;
+
+	z			= m_pDEM->asDouble(x, y);
+	dx			= m_Direction[i].x;
+	dy			= m_Direction[i].y;
+	ix			= x;
+	iy			= y;
+	Angle		= 0.0;
+	Distance	= 0.0;
+	iDistance	= 0.0;
+	dDistance	= Get_Cellsize() * M_GET_LENGTH(dx, dy);
+
+	while( is_InGrid(x, y) && Distance <= m_Radius )
+	{
+		ix	+= dx;	x	= (int)(0.5 + ix);
+		iy	+= dy;	y	= (int)(0.5 + iy);
+		iDistance	+= dDistance;
+
+		if( m_pDEM->is_InGrid(x, y) && (d = (m_pDEM->asDouble(x, y) - z) / iDistance) > Angle )
+		{
+			Angle		= d;
+			Distance	= iDistance;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.h b/src/modules/terrain_analysis/ta_lighting/view_shed.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.h
rename to src/modules/terrain_analysis/ta_lighting/view_shed.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.cpp b/src/modules/terrain_analysis/ta_morphometry/Convergence.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.cpp
rename to src/modules/terrain_analysis/ta_morphometry/Convergence.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.h b/src/modules/terrain_analysis/ta_morphometry/Convergence.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.h
rename to src/modules/terrain_analysis/ta_morphometry/Convergence.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp b/src/modules/terrain_analysis/ta_morphometry/Convergence_Radius.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp
rename to src/modules/terrain_analysis/ta_morphometry/Convergence_Radius.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.h b/src/modules/terrain_analysis/ta_morphometry/Convergence_Radius.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.h
rename to src/modules/terrain_analysis/ta_morphometry/Convergence_Radius.h
diff --git a/src/modules/terrain_analysis/ta_morphometry/Curvature_Classification.cpp b/src/modules/terrain_analysis/ta_morphometry/Curvature_Classification.cpp
new file mode 100644
index 0000000..0b9ed55
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/Curvature_Classification.cpp
@@ -0,0 +1,265 @@
+/**********************************************************
+ * Version $Id: Curvature_Classification.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//             Curvature_Classification.cpp              //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Curvature_Classification.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CCurvature_Classification::CCurvature_Classification(void)
+{
+	Set_Name		(_TL("Curvature Classification"));
+
+	Set_Author		("O.Conrad (c) 2001");
+
+	Set_Description	(_TW(
+		"Surface curvature based terrain classification.\n"
+		"Reference:\n"
+		"Dikau, R. (1988):\n'Entwurf einer geomorphographisch-analytischen Systematik von Reliefeinheiten',\n"
+		"Heidelberger Geographische Bausteine, Heft 5\n\n"
+		"0 - V  / V\n"
+		"1 - GE / V\n"
+		"2 - X  / V\n"
+		"3 - V  / GR\n"
+		"4 - GE / GR\n"
+		"5 - X  / GR\n"
+		"6 - V  / X\n"
+		"7 - GE / X\n"
+		"8 - X  / X\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CLASS"		, _TL("Curvature Classification"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD"	, _TL("Threshold for plane"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0005, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCurvature_Classification::On_Execute(void)
+{
+	//-----------------------------------------------------
+	double		Threshold;
+	CSG_Grid	*pClass;
+
+	m_pDEM		= Parameters("DEM"      )->asGrid();
+	pClass		= Parameters("CLASS"    )->asGrid();
+	Threshold	= Parameters("THRESHOLD")->asDouble();
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	Plan, Prof;
+
+			if( Get_Curvature(x, y, Plan, Prof) )
+			{
+				pClass->Set_Value(x, y,
+						(fabs(Plan) < Threshold ? 3 : Plan < 0 ? 0 : 6)
+					+	(fabs(Prof) < Threshold ? 1 : Prof < 0 ? 0 : 2)
+				);
+			}
+			else
+			{
+				pClass->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pClass, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int Color[9]	=
+		{
+			SG_GET_RGB(  0,   0, 127),	// V / V
+			SG_GET_RGB(  0,  63, 200),	// G / V
+			SG_GET_RGB(  0, 127, 255),	// X / V
+			SG_GET_RGB(127, 200, 255),	// V / G
+			SG_GET_RGB(245, 245, 245),	// G / G
+			SG_GET_RGB(255, 200, 127),	// X / G
+			SG_GET_RGB(255, 127,   0),	// V / X
+			SG_GET_RGB(200,  63,   0),	// G / X
+			SG_GET_RGB(127,   0,   0),	// X / X
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		Name	+= _TL( "V / V" );	Desc	+= _TL( "V / V" );
+		Name	+= _TL("GE / V" );	Desc	+= _TL("GE / V" );
+		Name	+= _TL( "X / V" );	Desc	+= _TL( "X / V" );
+		Name	+= _TL( "V / GR");	Desc	+= _TL( "V / GR");
+		Name	+= _TL("GE / GR");	Desc	+= _TL("GE / GR");
+		Name	+= _TL( "X / GR");	Desc	+= _TL( "X / GR");
+		Name	+= _TL( "V / X" );	Desc	+= _TL( "V / X" );
+		Name	+= _TL("GE / X" );	Desc	+= _TL("GE / X" );
+		Name	+= _TL( "X / X" );	Desc	+= _TL( "X / X" );
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<9; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, Color[i]);
+			pRecord->Set_Value(1, Name [i].c_str());
+			pRecord->Set_Value(2, Desc [i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pClass, P);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CCurvature_Classification::Get_Curvature(int x, int y, double &Plan, double &Profile)
+{
+	static const int	Index[8]	=	{ 5, 8, 7, 6, 3, 0, 1, 2 };
+
+	if( !m_pDEM->is_InGrid(x, y) )
+	{
+		return( false );
+	}
+
+	double	z	= m_pDEM->asDouble(x, y), Z[9];	Z[4]	= 0.0;
+
+	for(int i=0, ix, iy; i<8; i++)
+	{
+		if( m_pDEM->is_InGrid(ix = Get_xTo(i, x), iy = Get_yTo(i, y)) )
+		{
+			Z[Index[i]]	= m_pDEM->asDouble(ix, iy) - z;
+		}
+		else if( m_pDEM->is_InGrid(ix = Get_xFrom(i, x), iy = Get_yFrom(i, y)) )
+		{
+			Z[Index[i]]	= z - m_pDEM->asDouble(ix, iy);
+		}
+		else
+		{
+			Z[Index[i]]	= 0.0;
+		}
+	}
+
+	double	D	= ((Z[3] + Z[5]) / 2.0 - Z[4]) * 2.00 / Get_Cellarea();
+	double	E	= ((Z[1] + Z[7]) / 2.0 - Z[4]) * 2.00 / Get_Cellarea();
+	double	F	=  (Z[0] - Z[2] - Z[6] + Z[8]) * 0.25 / Get_Cellarea();
+	double	G	=  (Z[5] - Z[3])               * 0.50 / Get_Cellsize();
+    double	H	=  (Z[7] - Z[1])               * 0.50 / Get_Cellsize();
+
+	Profile	= -2.0 * (D * G*G + E * H*H + F*G*H) / (G*G + H*H);
+	Plan	= -2.0 * (E * G*G + D * H*H - F*G*H) / (G*G + H*H);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_morphometry/Curvature_Classification.h b/src/modules/terrain_analysis/ta_morphometry/Curvature_Classification.h
new file mode 100644
index 0000000..c8eff9a
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/Curvature_Classification.h
@@ -0,0 +1,116 @@
+/**********************************************************
+ * Version $Id: Curvature_Classification.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//              Curvature_Classification.h               //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Curvature_Classification_H
+#define HEADER_INCLUDED__Curvature_Classification_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class ta_morphometry_EXPORT CCurvature_Classification : public CSG_Module_Grid
+{
+public:
+	CCurvature_Classification(void);
+
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("A:Terrain Analysis|Terrain Classification" ));	}
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	CSG_Grid				*m_pDEM;
+
+
+	bool					Get_Curvature		(int x, int y, double &Plan, double &Profile);
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Curvature_Classification_H
diff --git a/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp
new file mode 100644
index 0000000..147cd21
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp
@@ -0,0 +1,421 @@
+/**********************************************************
+ * Version $Id: Hypsometry.cpp 2103 2014-04-21 12:21:50Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Hypsometry.cpp                     //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Hypsometry.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CHypsometry::CHypsometry(void)
+{
+	//-----------------------------------------------------
+	Set_Name(_TL("Hypsometry"));
+
+	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"Calculates the hypsometric curve for a given DEM.\n\n"
+		"The hypsometric curve is an empirical cumulative distribution function of "
+		"elevations in a catchment or of a whole planet. The module calculates both "
+		"the relative (scaled from 0 to 100 percent) and absolute (minimum "
+		"to maximum values) distributions. The former scales elevation and area "
+		"by the maximum values. Such a non-dimensional curve allows to asses the "
+		"similarity of watersheds as differences in hypsometric curves arise from "
+		"different geomorphic processes shaping a landscape.\n\n"
+		"In case the hypsometric curve should not be calculated for the whole "
+		"elevation range of the input dataset, a user-specified elevation range "
+		"can be specified with the classification constant area.\n\n"
+		"The output table has two attribute columns with relative height and area "
+		"values, and two columns with absolute height and area values. In order to "
+		"plot the non-dimensional hypsometric curve as diagram, use the relative "
+		"area as x-axis values and the relative height for the y-axis. For a "
+		"diagram with absolute values, use the absolute area as x-axis values "
+		"and the absolute height for the y-axis.\n\n"
+		"References:\n"
+		"- Harlin, J.M (1978):\n"
+		"    'Statistical moments of the hypsometric curve and its density function',\n"
+		"    J. Int. Assoc. Math. Geol., Vol.10, p.59-72\n\n"
+		"- Luo, W. (2000):\n"
+		"    'Quantifying groundwater-sapping landforms with a hypsometric technique',\n"
+		"    J. of Geophysical Research, Vol.105, No.E1, p.1685-1694\n\n")
+	);
+
+
+	//-----------------------------------------------------
+	// Input...
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+
+	//-----------------------------------------------------
+	// Output...
+
+	Parameters.Add_Table(
+		NULL	, "TABLE"		, _TL("Hypsometry"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+
+	//-----------------------------------------------------
+	// Options...
+
+	Parameters.Add_Value(
+		NULL	, "COUNT"		, _TL("Number of Classes"),
+		_TL("Number of discrete intervals (bins) used for sampling"),
+		PARAMETER_TYPE_Int, 100, 1, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "SORTING"		, _TL("Sort"),
+		_TL("Choose how to sort the elevation dataset before sampling"),
+
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("up"),
+			_TL("down")
+		), 1
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Classification Constant"),
+		_TL("Choose the classification constant to use"),
+
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("height"),
+			_TL("area")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "BZRANGE"		, _TL("Use Z-Range"),
+		_TL("Use a user-specified elevation range instead of min/max of the input dataset"),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Range(
+		NULL	, "ZRANGE"		, _TL("Z-Range"),
+		_TL("User specified elevation range"),
+		0.0, 1000.0
+	);
+}
+
+//---------------------------------------------------------
+CHypsometry::~CHypsometry(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CHypsometry::On_Execute(void)
+{
+	bool	bDown;
+	int		nClasses;
+	double	zMin, zMax;
+	CSG_Grid	*pDEM;
+	CSG_Table	*pTable;
+
+	pDEM		= Parameters("ELEVATION")	->asGrid();
+	pTable		= Parameters("TABLE")		->asTable();
+	bDown		= Parameters("SORTING")		->asInt() == 1;
+	nClasses	= Parameters("COUNT")		->asInt();
+	zMin		= Parameters("BZRANGE")		->asBool() ? Parameters("ZRANGE")->asRange()->Get_LoVal() : 0.0;
+	zMax		= Parameters("BZRANGE")		->asBool() ? Parameters("ZRANGE")->asRange()->Get_HiVal() : 0.0;
+	
+	if( !bDown && Parameters("BZRANGE")->asBool() && Parameters("METHOD")->asInt() == 1 )
+	{
+		SG_UI_Msg_Add_Error(_TW("The selected module parameter configuration (classification constant area, upward sorting and use "
+								"of an user-specified elevation range) is not supported."));
+
+		return( false );
+	}
+
+	pTable->Destroy();
+	pTable->Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Hypsometric Curve"), pDEM->Get_Name()));
+	pTable->Add_Field(_TL("Relative Height"), SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Relative Area")	, SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Absolute Height"), SG_DATATYPE_Double);
+	pTable->Add_Field(_TL("Absolute Area")	, SG_DATATYPE_Double);
+
+	switch( Parameters("METHOD")->asInt() )
+	{
+	case 0:				return( Calculate_A(pDEM, pTable, bDown, nClasses) );
+	case 1:	default:	return( Calculate_B(pDEM, pTable, bDown, nClasses, zMin, zMax) );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CHypsometry::Calculate_A(CSG_Grid *pDEM, CSG_Table *pTable, bool bDown, int nClasses)
+{
+	int		i;
+	sLong	n, *Cells_Count;
+	double	z, dz, A, a, Min, Max, za, zb;
+
+	CSG_Table_Record	*pRecord;
+
+	//-----------------------------------------------------
+	// 1. Min, Max, Area...
+
+	A	= 0;
+
+	for(n=0; n<pDEM->Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( !pDEM->is_NoData(n) )
+		{
+			if( A <= 0 )
+			{
+				Min	= Max	= pDEM->asDouble(n);
+			}
+			else
+			{
+				z	= pDEM->asDouble(n);
+
+				if( Min > z )
+				{
+					Min	= z;
+				}
+				else if( Max < z )
+				{
+					Max	= z;
+				}
+			}
+
+			A++;
+		}
+	}
+
+
+	//-----------------------------------------------------
+	// 2. Hypsometric Curve...
+
+	if( A > 0 && Min < Max )
+	{
+		Cells_Count	= (sLong *)SG_Calloc(nClasses + 1, sizeof(sLong));
+
+		for(n=0; n<pDEM->Get_NCells() && Set_Progress_NCells(n); n++)
+		{
+			if( !pDEM->is_NoData(n) )
+			{
+				i	= (int)(nClasses * (Max - pDEM->asDouble(n)) / (Max - Min));
+
+				Cells_Count[i]++;
+			}
+		}
+
+		dz	= (Max - Min) / nClasses;
+		a	= A;
+
+		for(i=nClasses; i>=0; i--)
+		{
+			za	= a / A;
+			a	-= Cells_Count[bDown ? i : nClasses - i];
+			zb	= a / A;
+
+			pRecord	= pTable->Add_Record();
+			pRecord->Set_Value(0, 100.0 * i * dz / (Max - Min));	// Relative Height
+			pRecord->Set_Value(1, 100.0 * za);						// Relative Area
+			pRecord->Set_Value(2, Min +   i * dz);					// Absolute Height
+			pRecord->Set_Value(3, a * pDEM->Get_Cellarea());		// Absolute Area
+		}
+
+		SG_Free(Cells_Count);
+
+		return( true );
+	}
+
+	SG_UI_Msg_Add_Error(_TL("Total area is zero or minimum elevation is equal or lower than maximum elevation!"));
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CHypsometry::Calculate_B(CSG_Grid *pDEM, CSG_Table *pTable, bool bDown, int nClasses, double zMin, double zMax)
+{
+	int		x, y, i;
+	sLong	n, nMin, nMax, nStep, nRange;
+	double	z, zRange;
+
+	//-----------------------------------------------------
+	if( zMin < zMax && zMin < pDEM->Get_ZMax() && zMax > pDEM->Get_ZMin() )
+	{
+		for(nMin=0; nMin<pDEM->Get_NCells() && Set_Progress_NCells(nMin); nMin++)
+		{
+			if( pDEM->Get_Sorted(nMin, x, y, !bDown) && zMin <= pDEM->asDouble(x, y) )
+			{
+				zMin	= pDEM->asDouble(x, y);
+				break;
+			}
+		}
+
+		for(nMax=pDEM->Get_NCells() - 1; nMax > nMin && Set_Progress_NCells(nMax); nMax--)
+		{
+			if( pDEM->Get_Sorted(nMax, x, y, !bDown) && zMax >= pDEM->asDouble(x, y) )
+			{
+				zMax	= pDEM->asDouble(x, y);
+				break;
+			}
+		}
+	}
+	else
+	{
+		zMin	= pDEM->Get_ZMin();
+		zMax	= pDEM->Get_ZMax();
+		nMin	= 0;
+		nMax	= pDEM->Get_NCells() - 1;
+	}
+
+	//-----------------------------------------------------
+	if( (nRange = nMax - nMin) > 0 && (zRange = zMax - zMin) > 0 )
+	{
+		CSG_Table_Record	*pRecord;
+
+		pTable->Destroy();
+
+		pTable->Add_Field(_TL("Relative Height"), SG_DATATYPE_Double);
+		pTable->Add_Field(_TL("Relative Area")	, SG_DATATYPE_Double);
+		pTable->Add_Field(_TL("Absolute Height"), SG_DATATYPE_Double);
+		pTable->Add_Field(_TL("Absolute Area")	, SG_DATATYPE_Double);
+
+		pTable->Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Hypsometric Curve"), pDEM->Get_Name()));
+
+		//-------------------------------------------------
+		nStep	= nRange / nClasses;
+
+		for(i=0, n=nMax; i<=nClasses; i++, n-=nStep)
+		{
+			if( pDEM->Get_Sorted(n, x, y, !bDown) )
+			{
+				z	= pDEM->asDouble(x, y);
+
+				pRecord	= pTable->Add_Record();
+				pRecord->Set_Value(0, 100.0 * i / nClasses);				// Relative Area
+				pRecord->Set_Value(1, 100.0 * (z - zMin) / zRange);			// Relative Height
+				pRecord->Set_Value(2, z);									// Absolute Height
+				pRecord->Set_Value(3, i * nStep * pDEM->Get_Cellarea());	// Absolute Area
+			}
+		}
+
+		return( true );
+	}
+
+	SG_UI_Msg_Add_Error(CSG_String::Format(_TL("Elevation range (zMax (%.2f) - zMin (%.2f)) is equal or lower than zero!"), zMax, zMin));
+
+	return( false );
+}
+
+
+//---------------------------------------------------------
+int CHypsometry::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
+	{
+		pParameters->Get_Parameter("BZRANGE")->Set_Enabled(pParameter->asInt() == 1);
+		pParameters->Get_Parameter("ZRANGE")->Set_Enabled(pParameter->asInt() == 1);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BZRANGE")) )
+	{
+		pParameters->Get_Parameter("ZRANGE")->Set_Enabled(pParameter->asBool());
+	}
+	
+	//-----------------------------------------------------
+	return (1);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h
new file mode 100644
index 0000000..373ef54
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h
@@ -0,0 +1,114 @@
+/**********************************************************
+ * Version $Id: Hypsometry.h 2103 2014-04-21 12:21:50Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     Hypsometry.h                      //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Hypsometry_H
+#define HEADER_INCLUDED__Hypsometry_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class ta_morphometry_EXPORT CHypsometry : public CSG_Module_Grid  
+{
+public:
+	CHypsometry(void);
+	virtual ~CHypsometry(void);
+
+
+protected:
+
+	virtual bool		On_Execute		(void);
+
+	virtual int			On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+
+private:
+
+	bool				Calculate_A		(CSG_Grid *pDGM, CSG_Table *pTable, bool bDown, int nClasses);
+	bool				Calculate_B		(CSG_Grid *pDEM, CSG_Table *pTable, bool bDown, int nClasses, double zMin, double zMax);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Hypsometry_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_morphometry/MLB_Interface.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp
rename to src/modules/terrain_analysis/ta_morphometry/MLB_Interface.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.h b/src/modules/terrain_analysis/ta_morphometry/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_morphometry/MLB_Interface.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.am b/src/modules/terrain_analysis/ta_morphometry/Makefile.am
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.am
rename to src/modules/terrain_analysis/ta_morphometry/Makefile.am
diff --git a/src/modules/terrain_analysis/ta_morphometry/Makefile.in b/src/modules/terrain_analysis/ta_morphometry/Makefile.in
new file mode 100644
index 0000000..b3b8bbf
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/Makefile.in
@@ -0,0 +1,702 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_morphometry
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_morphometry_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_morphometry_la_OBJECTS = Convergence.lo Convergence_Radius.lo \
+	Curvature_Classification.lo Hypsometry.lo MLB_Interface.lo \
+	Morphometry.lo ProtectionIndex.lo RealArea.lo \
+	SurfaceSpecificPoints.lo air_flow_height.lo \
+	anisotropic_heating.lo distance_gradient.lo \
+	fuzzy_landform_elements.lo land_surface_temperature.lo \
+	mass_balance_index.lo mrvbf.lo param_scale.lo \
+	relative_heights.lo ruggedness.lo tc_iwahashi_pike.lo \
+	top_hat.lo tpi.lo wind_effect.lo
+libta_morphometry_la_OBJECTS = $(am_libta_morphometry_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_morphometry_la_SOURCES)
+DIST_SOURCES = $(libta_morphometry_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1619 2013-03-05 16:07:00Z oconrad $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libta_morphometry.la
+libta_morphometry_la_SOURCES = \
+Convergence.cpp\
+Convergence_Radius.cpp\
+Curvature_Classification.cpp\
+Hypsometry.cpp\
+MLB_Interface.cpp\
+Morphometry.cpp\
+ProtectionIndex.cpp\
+RealArea.cpp\
+SurfaceSpecificPoints.cpp\
+air_flow_height.cpp\
+anisotropic_heating.cpp\
+distance_gradient.cpp\
+fuzzy_landform_elements.cpp\
+land_surface_temperature.cpp\
+mass_balance_index.cpp\
+mrvbf.cpp\
+param_scale.cpp\
+relative_heights.cpp\
+ruggedness.cpp\
+tc_iwahashi_pike.cpp\
+top_hat.cpp\
+tpi.cpp\
+wind_effect.cpp\
+Convergence.h\
+Convergence_Radius.h\
+Curvature_Classification.h\
+Hypsometry.h\
+MLB_Interface.h\
+Morphometry.h\
+ProtectionIndex.h\
+RealArea.h\
+SurfaceSpecificPoints.h\
+air_flow_height.h\
+anisotropic_heating.h\
+distance_gradient.h\
+fuzzy_landform_elements.h\
+land_surface_temperature.h\
+mass_balance_index.h\
+mrvbf.h\
+param_scale.h\
+relative_heights.h\
+ruggedness.h\
+tc_iwahashi_pike.h\
+top_hat.h\
+tpi.h\
+wind_effect.h
+
+libta_morphometry_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_morphometry/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_morphometry/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_morphometry.la: $(libta_morphometry_la_OBJECTS) $(libta_morphometry_la_DEPENDENCIES) $(EXTRA_libta_morphometry_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_morphometry_la_OBJECTS) $(libta_morphometry_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Convergence.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Convergence_Radius.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Curvature_Classification.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hypsometry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Morphometry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ProtectionIndex.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RealArea.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SurfaceSpecificPoints.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/air_flow_height.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/anisotropic_heating.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/distance_gradient.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fuzzy_landform_elements.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/land_surface_temperature.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mass_balance_index.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mrvbf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/param_scale.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/relative_heights.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ruggedness.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tc_iwahashi_pike.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/top_hat.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tpi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wind_effect.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_morphometry/Morphometry.cpp b/src/modules/terrain_analysis/ta_morphometry/Morphometry.cpp
new file mode 100644
index 0000000..cc11457
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/Morphometry.cpp
@@ -0,0 +1,945 @@
+/**********************************************************
+ * Version $Id: Morphometry.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Morphometry.cpp                    //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Morphometry.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CMorphometry::CMorphometry(void)
+{
+	Set_Name		(_TL("Slope, Aspect, Curvature"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2001"));
+
+	Set_Description	(_TW(
+		"Calculates the local morphometric terrain parameters slope, aspect and if supported "
+		"by the chosen method also the curvature. Besides tangential curvature also its "
+		"horizontal and vertical components (i.e. plan and profile curvature) can be calculated.\n"
+
+		"\nReferences:\n\n"
+
+		"Maximum Slope\n"
+		"- Travis, M.R., Elsner, G.H., Iverson, W.D., Johnson, C.G. (1975):\n"
+		"    'VIEWIT: computation of seen areas, slope, and aspect for land-use planning',\n"
+		"    USDA F.S. Gen. Tech. Rep. PSW-11/1975, 70p. Berkeley, California, U.S.A.\n\n"
+
+		"Maximum Triangle Slope\n"
+		"- Tarboton, D.G. (1997):\n"
+		"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
+		"    Water Ressources Research, Vol.33, No.2, p.309-319\n\n"
+
+		"Least Squares or Best Fitted Plane\n"
+		"- Horn, B. K. (1981):\n"
+		"    'Hill shading and the relectance map',\n"
+		"    Proceedings of the IEEE, v. 69, no. 1, p. 14-47.\n\n"
+
+		"- Beasley, D.B., Huggins, L.F. (1982):\n"
+		"    'ANSWERS: User's manual',\n"
+		"    U.S. EPA-905/9-82-001, Chicago, IL. 54pp.\n\n"
+
+		"- Costa-Cabral, M., Burges, S.J., (1994):\n"
+		"    'Digital Elevation Model Networks (DEMON): a model of flow over hillslopes for computation of contributing and dispersal areas',\n"
+		"    Water Resources Research, v. 30, no. 6, p. 1681-1692.\n\n"
+
+		"Fit 2.Degree Polynom\n"
+		"- Evans, I.S. (1979):\n"
+		"    'An integrated system of terrain analysis and slope mapping',\n"
+		"    Final report on grant DA-ERO-591-73-G0040. University of Durham, England.\n\n"
+
+		"- Bauer, J., Rohdenburg, H., Bork, H.-R. (1985):\n"
+		"    'Ein Digitales Reliefmodell als Vorraussetzung fuer ein deterministisches Modell der Wasser- und Stoff-Fluesse',\n"
+		"    Landschaftsgenese und Landschaftsoekologie, H.10, Parameteraufbereitung fuer deterministische Gebiets-Wassermodelle,\n"
+		"    Grundlagenarbeiten zu Analyse von Agrar-Oekosystemen, (Eds.: Bork, H.-R. / Rohdenburg, H.), p.1-15\n\n"
+
+		"- Heerdegen, R.G., Beran, M.A. (1982):\n"
+		"    'Quantifying source areas through land surface curvature',\n"
+		"    Journal of Hydrology, Vol.57\n\n"
+
+		"- Olaya, V. (2006):\n"
+		"    'Basic Land-Surface Parameters',\n"
+		"     in: Hengl, T., Reuter, H.I. [Eds.]: Geomorphometry: Concepts, Software, Applications. "
+		"     Developments in Soil Science, Elsevier, Vol.33, 141-169.\n\n"
+
+		"- Zevenbergen, L.W., Thorne, C.R. (1987):\n"
+		"    'Quantitative analysis of land surface topography',\n"
+		"    Earth Surface Processes and Landforms, 12: 47-56.\n\n"
+
+		"Fit 3.Degree Polynom\n"
+		"- R.M. Haralick (1983):\n"
+		"    'Ridge and valley detection on digital images',\n"
+		"    Computer Vision, Graphics and Image Processing, Vol.22, No.1, p.28-38\n\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "SLOPE"		, _TL("Slope"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "ASPECT"		, _TL("Aspect"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_GENE"		, _TL("General Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_PROF"		, _TL("Profile Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_PLAN"		, _TL("Plan Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_TANG"		, _TL("Tangential Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_LONG"		, _TL("Longitudinal Curvature"),
+		_TL("Zevenbergen & Thorne (1987) refer to this as profile curvature"),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_CROS"		, _TL("Cross-Sectional Curvature"),
+		_TL("Zevenbergen & Thorne (1987) refer to this as plan curvature"),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_MINI"		, _TL("Minimal Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_MAXI"		, _TL("Maximal Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_TOTA"		, _TL("Total Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "C_ROTO"		, _TL("Flow Line Curvature"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
+
+	//-----------------------------------------------------
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("maximum slope (Travis et al. 1975)"),
+			_TL("maximum triangle slope (Tarboton 1997)"),
+			_TL("least squares fitted plane (Horn 1981, Costa-Cabral & Burgess 1996)"),
+			_TL("6 parameter 2nd order polynom (Evans 1979)"),
+			_TL("6 parameter 2nd order polynom (Heerdegen & Beran 1982)"),
+			_TL("6 parameter 2nd order polynom (Bauer, Rohdenburg, Bork 1985)"),
+			_TL("9 parameter 2nd order polynom (Zevenbergen & Thorne 1987)"),
+			_TL("10 parameter 3rd order polynom (Haralick 1983)")
+		), 6
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "UNIT_SLOPE"	, _TL("Slope Units"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("radians"),
+			_TL("degree"),
+			_TL("percent")
+		), 0
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "UNIT_ASPECT"	, _TL("Aspect Units"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("radians"),
+			_TL("degree")
+		), 0
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CMorphometry::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
+	{
+		bool	bOn;
+		
+		bOn	= pParameter->asInt() >= 3 || pParameter->asInt() == 0;
+		pParameters->Get_Parameter("C_GENE")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_PROF")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_PLAN")->Set_Enabled(bOn);
+
+		bOn	= pParameter->asInt() >= 3;
+		pParameters->Get_Parameter("C_TANG")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_LONG")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_CROS")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_MINI")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_MAXI")->Set_Enabled(bOn);
+		pParameters->Get_Parameter("C_TOTA")->Set_Enabled(bOn);
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CMorphometry::On_Execute(void)
+{
+	//-----------------------------------------------------
+	int	Method	= Parameters("METHOD"   )->asInt ();
+
+	m_pDTM		= Parameters("ELEVATION")->asGrid();
+
+	m_pSlope	= Parameters("SLOPE"    )->asGrid();
+	m_pAspect	= Parameters("ASPECT"   )->asGrid();
+
+	m_pC_Gene	= Parameters("C_GENE"   )->asGrid();
+	m_pC_Prof	= Parameters("C_PROF"   )->asGrid();
+	m_pC_Plan	= Parameters("C_PLAN"   )->asGrid();
+	m_pC_Tang	= Parameters("C_TANG"   )->asGrid();
+	m_pC_Long	= Parameters("C_LONG"   )->asGrid();
+	m_pC_Cros	= Parameters("C_CROS"   )->asGrid();
+	m_pC_Mini	= Parameters("C_MINI"   )->asGrid();
+	m_pC_Maxi	= Parameters("C_MAXI"   )->asGrid();
+	m_pC_Tota	= Parameters("C_TOTA"   )->asGrid();
+	m_pC_Roto	= Parameters("C_ROTO"   )->asGrid();
+
+	if( Method == 0 )
+	{
+		m_pC_Tang = m_pC_Long = m_pC_Cros = m_pC_Mini = m_pC_Maxi = m_pC_Tota = m_pC_Roto = NULL;
+	}
+	else if( Method < 3 )
+	{
+		m_pC_Gene = m_pC_Prof = m_pC_Plan =
+		m_pC_Tang = m_pC_Long = m_pC_Cros = m_pC_Mini = m_pC_Maxi = m_pC_Tota = m_pC_Roto = NULL;
+	}
+
+	//-----------------------------------------------------
+	DataObject_Set_Colors(m_pSlope , 11, SG_COLORS_YELLOW_RED   , false);
+	DataObject_Set_Colors(m_pAspect, 11, SG_COLORS_ASPECT_3     , false);
+	DataObject_Set_Colors(m_pC_Gene, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Prof, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Plan, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Tang, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Long, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Cros, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Mini, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Maxi, 11, SG_COLORS_RED_GREY_BLUE, true);
+	DataObject_Set_Colors(m_pC_Tota, 11, SG_COLORS_YELLOW_RED   , false);
+	DataObject_Set_Colors(m_pC_Roto, 11, SG_COLORS_RED_GREY_BLUE, true);
+
+	//-----------------------------------------------------
+	m_Unit_Slope	= Parameters("UNIT_SLOPE" )->asInt();
+
+	if( m_Unit_Slope == 0 )
+	{
+		m_pSlope->Set_Unit(_TL("Radians"));
+	}
+	else if( m_Unit_Slope == 1 )
+	{
+		m_pSlope->Set_Unit(_TL("Degree"));
+	}
+	else // if( m_Unit_Slope == 2 )
+	{
+		m_pSlope->Set_Unit(_TL("Percent"));
+	}
+
+	//-----------------------------------------------------
+	m_Unit_Aspect	= Parameters("UNIT_ASPECT")->asInt();
+
+	if( m_Unit_Aspect == 0 )
+	{
+		m_pAspect->Set_Unit(_TL("Radians"));
+	}
+	else // if( m_Unit_Aspect == 1 )
+	{
+		m_pAspect->Set_Unit(_TL("Degree"));
+	}
+
+	//-----------------------------------------------------
+	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_pDTM->is_NoData(x, y) )
+			{
+				Set_NoData(x, y);
+			}
+			else switch( Method )
+			{
+			case 0:	Set_MaximumSlope (x, y);	break;
+			case 1:	Set_Tarboton     (x, y);	break;
+			case 2:	Set_LeastSquare  (x, y);	break;
+			case 3:	Set_Evans        (x, y);	break;
+			case 4:	Set_Heerdegen    (x, y);	break;
+			case 5:	Set_BRM          (x, y);	break;
+			case 6:	Set_Zevenbergen  (x, y);	break;
+			case 7:	Set_Haralick     (x, y);	break;
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Indexing of the Submatrix:
+//
+//  +-------+    +-------+    +-------+
+//  | 7 0 1 |    | 2 5 8 |    | 8 5 2 |
+//  | 6 * 2 | => | 1 4 7 | or | 7 4 1 |
+//  | 5 4 3 |    | 0 3 6 |    | 6 3 0 |
+//  +-------+    +-------+    +-------+
+//
+//---------------------------------------------------------
+inline void CMorphometry::Get_SubMatrix3x3(int x, int y, double Z[9], int Orientation)
+{
+	static const int	Indexes[][8]	=
+	{
+		{ 5, 8, 7, 6, 3, 0, 1, 2 },
+		{ 5, 2, 1, 0, 3, 6, 7, 8 }
+	};
+
+	int	*Index	= (int *)Indexes[Orientation];
+
+	double	z	= m_pDTM->asDouble(x, y);
+
+	Z[4]		= 0.0;
+
+	for(int i=0; i<8; i++)
+	{
+		int ix	= Get_xTo(i, x);
+		int iy	= Get_yTo(i, y);
+
+		if( m_pDTM->is_InGrid(ix, iy) )
+		{
+			Z[Index[i]]	= m_pDTM->asDouble(ix, iy) - z;
+		}
+		else
+		{
+			ix	= Get_xTo(i + 4, x);
+			iy	= Get_yTo(i + 4, y);
+
+			if( m_pDTM->is_InGrid(ix, iy) )
+			{
+				Z[Index[i]]	= z - m_pDTM->asDouble(ix, iy);
+			}
+			else
+			{
+				Z[Index[i]]	= 0.0;
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+inline void CMorphometry::Get_SubMatrix5x5(int x, int y, double Z[25])
+{
+	double	z	= m_pDTM->asDouble(x,y);
+
+	for(int i=0, iy=y-2; iy<=y+2; iy++)
+	{
+		int	jy	= iy < 0 ? 0 : (iy >= Get_NY() ? Get_NY() - 1 : iy);
+
+		for(int ix=x-2; ix<=x+2; ix++, i++)
+		{
+			int	jx	= ix < 0 ? 0 : (ix >= Get_NX() ? Get_NX() - 1 : ix);
+
+			Z[i]	= m_pDTM->is_InGrid(jx, jy) ? m_pDTM->asDouble(jx, jy) - z : 0.0;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define SET_NODATA(grid)		if( grid ) grid->Set_NoData(x, y);
+#define SET_VALUE(grid, value)	if( grid ) grid->Set_Value(x, y, value);
+
+//---------------------------------------------------------
+inline void CMorphometry::Set_NoData(int x, int y)
+{
+	SET_NODATA(m_pSlope )
+	SET_NODATA(m_pAspect)
+	SET_NODATA(m_pC_Gene)
+	SET_NODATA(m_pC_Prof)
+	SET_NODATA(m_pC_Plan)
+	SET_NODATA(m_pC_Tang)
+	SET_NODATA(m_pC_Long)
+	SET_NODATA(m_pC_Cros)
+	SET_NODATA(m_pC_Mini)
+	SET_NODATA(m_pC_Maxi)
+	SET_NODATA(m_pC_Tota)
+	SET_NODATA(m_pC_Roto)
+}
+
+//---------------------------------------------------------
+inline void CMorphometry::Set_Gradient(int x, int y, double Slope, double Aspect)
+{
+	//-----------------------------------------------------
+	if( m_Unit_Slope == 1 )
+	{
+		SET_VALUE(m_pSlope, Slope * M_RAD_TO_DEG);
+	}
+	else if( m_Unit_Slope == 2 )
+	{
+		SET_VALUE(m_pSlope, 100.0 * tan(Slope));
+	}
+	else
+	{
+		SET_VALUE(m_pSlope, Slope);
+	}
+
+	//-----------------------------------------------------
+	if( m_Unit_Aspect == 1 && Aspect >= 0.0 )
+	{
+		SET_VALUE(m_pAspect, Aspect * M_RAD_TO_DEG);
+	}
+	else
+	{
+		SET_VALUE(m_pAspect, Aspect);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline void CMorphometry::Set_From_Polynom(int x, int y, double r, double t, double s, double p, double q)
+{
+	//-----------------------------------------------------
+	double	p2_q2	= p*p + q*q;
+
+	Set_Gradient(x, y, atan(sqrt(p2_q2)),
+		  p != 0.0 ? M_PI_180 + atan2(q, p)
+		: q >  0.0 ? M_PI_270
+		: q <  0.0 ? M_PI_090
+		: m_pAspect ? m_pAspect->Get_NoData_Value() : -1
+	);
+
+	//-----------------------------------------------------
+	if( p2_q2 )
+	{
+		double	spq = s * p * q, p2 = p*p, q2 = q*q;	r	*= 2;	t	*= 2;
+
+		SET_VALUE(m_pC_Gene, -2 * (r + t));
+		SET_VALUE(m_pC_Prof, -(r * p2 + t * q2 + 2 * spq) / (p2_q2 * pow(1 + p2_q2, 1.5)));
+		SET_VALUE(m_pC_Plan, -(t * p2 + r * q2 - 2 * spq) / (        pow(    p2_q2, 1.5)));
+		SET_VALUE(m_pC_Tang, -(t * p2 + r * q2 - 2 * spq) / (p2_q2 * pow(1 + p2_q2, 0.5)));
+		SET_VALUE(m_pC_Long, -2 * (r * p2 + t * q2 + spq) / (p2_q2                      ));
+		SET_VALUE(m_pC_Cros, -2 * (t * p2 + r * q2 - spq) / (p2_q2                      ));
+		SET_VALUE(m_pC_Mini, -r/2 - t/2 - sqrt(0.5 * (r - t)*(r - t) + s*s));
+		SET_VALUE(m_pC_Maxi, -r/2 - t/2 + sqrt(0.5 * (r - t)*(r - t) + s*s));
+		SET_VALUE(m_pC_Tota, r*r + 2 * s*s + t*t);
+		SET_VALUE(m_pC_Roto, (p2 - q2) * s - p * q * (r - t));	// rotor
+	//	SET_VALUE(m_pC_Gaus, (r * t - 2 * s*s) / (1 + p2_q2));	// total gaussian
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//					The Methods							 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Maximum Slope (Travis et al., 1975, Peucker & Douglas, 1975))
+//
+// Travis, M.R., Elsner, G.H., Iverson, W.D., and Johnson, C.G. 1975:
+//		VIEWIT: computation of seen areas, slope, and aspect for land-use planning.
+//		USDA F.S. Gen. Tech. Rep. PSW-11/1975, 70p. Berkeley, California, U.S.A.
+//
+//---------------------------------------------------------
+void CMorphometry::Set_MaximumSlope(int x, int y)
+{
+	int		i, ix, iy, j, Aspect;
+	double	z, Z[8], Slope, Curv, hCurv, a, b;
+
+	//-----------------------------------------------------
+	z		= m_pDTM->asDouble(x, y);
+    Slope	= Curv	= 0.0;
+	Aspect	= -1;
+
+	for(i=0; i<8; i++)
+	{
+		if( !m_pDTM->is_InGrid(ix = Get_xTo(i, x), iy = Get_yTo(i, y)) )
+		{
+			Z[i]	= 0.0;
+		}
+		else
+		{
+			Z[i]	= atan((z - m_pDTM->asDouble(ix, iy)) / Get_Length(i));
+			Curv	+= Z[i];
+
+			if( Z[i] > Slope )
+			{
+				Aspect	= i;
+				Slope	= Z[i];
+			}
+		}
+	}
+
+	Set_Gradient(x, y, Slope, Aspect * M_PI_045);
+
+	//-------------------------------------------------
+	if( Aspect < 0.0 )
+	{
+		SET_NODATA(m_pAspect);
+
+		SET_NODATA(m_pC_Gene);
+		SET_NODATA(m_pC_Prof);
+		SET_NODATA(m_pC_Plan);
+	}
+	else
+	{
+		//---------------------------------------------
+		// Let's now estimate the plan curvature...
+
+		for(i=Aspect+1, j=0, a=0.0; i<Aspect+8; i++, j++)
+		{
+			if( Z[i % 8] < 0.0 )
+			{
+				a	= j + Z[(i - 1) % 8] / (Z[(i - 1) % 8] - Z[i % 8]);
+				break;
+			}
+		}
+
+		if( a != 0.0 )
+		{
+			for(i=Aspect+7, j=0, b=0.0; i>Aspect; i--, j++)
+			{
+				if( Z[i % 8] < 0.0 )
+				{
+					b	= j + Z[(i + 1) % 8] / (Z[(i + 1) % 8] - Z[i % 8]);
+					break;
+				}
+			}
+
+			hCurv	=  45.0 * (a + b) - 180.0;
+		}
+		else
+		{
+			hCurv	=  180.0;
+		}
+
+		//---------------------------------------------
+		SET_VALUE(m_pC_Gene, Curv);
+		SET_VALUE(m_pC_Prof, Z[Aspect] + Z[(Aspect + 4) % 8]);
+		SET_VALUE(m_pC_Plan, hCurv);
+	}
+}
+
+//---------------------------------------------------------
+// Maximum Triangle Slope
+//
+// Tarboton, D.G. (1997):
+//		'A new method for the determination of flow directions and upslope areas in grid digital elevation models',
+//		Water Ressources Research, Vol.33, No.2, p.309-319
+//
+//---------------------------------------------------------
+void CMorphometry::Set_Tarboton(int x, int y)
+{
+	int		i, ix, iy, j;
+	double	z, Z[8], iSlope, iAspect, Slope, Aspect, G, H;
+
+	//-----------------------------------------------------
+	z		= m_pDTM->asDouble(x, y);
+
+	for(i=0; i<8; i++)
+	{
+		ix		= Get_xTo(i, x);
+		iy		= Get_yTo(i, y);
+
+		if( m_pDTM->is_InGrid(ix, iy) )
+		{
+			Z[i]	=  m_pDTM->asDouble(ix, iy);
+		}
+		else
+		{
+			ix		= Get_xTo(i + 4, x);
+			iy		= Get_yTo(i + 4, y);
+
+			if( m_pDTM->is_InGrid(ix, iy) )
+			{
+				Z[i]	=  z - (m_pDTM->asDouble(ix, iy) - z);
+			}
+			else
+			{
+				Z[i]	=  z;
+			}
+		}
+	}
+
+	//---------------------------------------------
+    Slope	=  0.0;
+	Aspect	= -1.0;
+
+	for(i=0, j=1; i<8; i++, j=(j+1)%8)
+	{
+		if( i % 2 )	// i => diagonal
+		{
+			G		= (z    - Z[j]) / Get_Cellsize();
+			H		= (Z[j]	- Z[i]) / Get_Cellsize();
+		}
+		else		// i => orthogonal
+		{
+			G		= (z    - Z[i]) / Get_Cellsize();
+			H		= (Z[i]	- Z[j]) / Get_Cellsize();
+		}
+
+		if( H < 0.0 )
+		{
+			iAspect	= 0.0;
+			iSlope	= G;
+		}
+		else if( H > G )
+		{
+			iAspect	= M_PI_045;
+			iSlope	= (z - Z[i % 2 ? i : j]) / (sqrt(2.0) * Get_Cellsize());
+		}
+		else
+		{
+			iAspect	= atan(H / G);
+			iSlope	= sqrt(G*G + H*H);
+		}
+
+		if( iSlope > Slope )
+		{
+			Aspect	= i * M_PI_045 + (i % 2 ? M_PI_045 - iAspect : iAspect);
+			Slope	= iSlope;
+		}
+	}
+
+	//---------------------------------------------
+	if( Aspect < 0.0 )
+	{
+		Set_NoData(x, y);
+	}
+	else
+	{
+		Set_Gradient(x, y, atan(Slope), Aspect);
+	}
+}
+
+//---------------------------------------------------------
+// Least Squares or Best Fit Plane (Horn 1981, Beasley & Huggins 1982, Costa-Cabral & Burgess 1994)
+//
+// Horn, B. K. (1981):
+//      Hill shading and the relectance map.
+//      Proceedings of the IEEE, v. 69, no. 1, p 14-47.
+//
+// Beasley, D.B. and Huggins, L.F. 1982:
+//		ANSWERS: User�s manual.
+//		U.S. EPA-905/9-82-001, Chicago, IL. 54pp.
+//
+// Costa-Cabral, M., and Burges, S.J., 1994:
+//		Digital Elevation Model Networks (DEMON): a model of flow over hillslopes for computation of contributing and dispersal areas
+//		Water Resources Research, v. 30, no. 6, p. 1681-1692.
+//
+//---------------------------------------------------------
+void CMorphometry::Set_LeastSquare(int x, int y)
+{
+	double	Z[9], a, b;
+
+	Get_SubMatrix3x3(x, y, Z);
+
+	a		= ((Z[2] + 2 * Z[5] + Z[8]) - (Z[0] + 2 * Z[3] + Z[6])) / (8 * Get_Cellsize());
+	b		= ((Z[6] + 2 * Z[7] + Z[8]) - (Z[0] + 2 * Z[1] + Z[2])) / (8 * Get_Cellsize());
+
+	Set_Gradient(x, y, atan(sqrt(a*a + b*b)),
+		  a != 0.0 ? M_PI_180 + atan2(b, a)
+		: b >  0.0 ? M_PI_270
+		: b <  0.0 ? M_PI_090
+		: m_pAspect ? m_pAspect->Get_NoData_Value() : -1
+	);
+}
+
+//---------------------------------------------------------
+// Quadratic Function Approximation (Heerdegen & Beran, 1984)
+//
+// Evans, I.S. (1979):
+//		An integrated system of terrain analysis and slope mapping.
+//		Final report on grant DA-ERO-591-73-G0040. University of Durham, England.
+//
+//---------------------------------------------------------
+// f(z) = Ax^2 + By^2 + Cxy + Dx + Ey + F
+//
+//---------------------------------------------------------
+void CMorphometry::Set_Evans(int x, int y)
+{
+	double	Z[9], A, B, C, D, E;
+
+	Get_SubMatrix3x3(x, y, Z, 1);
+
+	A	= (Z[0] + Z[2] + Z[3] + Z[5] + Z[6] + Z[8] - 2 * (Z[1] + Z[4] + Z[7])) / (6 * Get_Cellarea());
+	B	= (Z[0] + Z[1] + Z[2] + Z[6] + Z[7] + Z[8] - 2 * (Z[3] + Z[4] + Z[5])) / (6 * Get_Cellarea());
+	C	= (Z[2] + Z[6] - Z[0] - Z[8])                                          / (4 * Get_Cellarea());
+	D	= (Z[2] + Z[5] + Z[8] - Z[0] - Z[3] - Z[6])                            / (6 * Get_Cellsize());
+    E	= (Z[0] + Z[1] + Z[2] - Z[6] - Z[7] - Z[8])                            / (6 * Get_Cellsize());
+
+	Set_From_Polynom(x, y, A, B, C, D, E);
+}
+
+//---------------------------------------------------------
+// Quadratic Function Approximation (Heerdegen & Beran, 1984)
+//
+// Heerdegen, R.G. / Beran, M.A. (1982):
+//		Quantifying source areas through land surface curvature.
+//		Journal of Hydrology, Vol.57
+//
+//---------------------------------------------------------
+// f(z) = Ax^2 + By^2 + Cxy + Dx + Ey + F
+//
+//---------------------------------------------------------
+void CMorphometry::Set_Heerdegen(int x, int y)
+{
+	double	Z[9], A, B, C, D, E, a, b;
+
+	Get_SubMatrix3x3(x, y, Z);
+
+	a	=   Z[0] + Z[2] + Z[3] + Z[5] + Z[6] + Z[8];
+	b	=   Z[0] + Z[1] + Z[2] + Z[6] + Z[7] + Z[8];
+
+	A	= (0.3 * a - 0.2 * b)                        / (    Get_Cellarea());
+	B	= (0.3 * b - 0.2 * a)                        / (    Get_Cellarea());
+	C	= ( Z[0] - Z[2]               - Z[6] + Z[8]) / (4 * Get_Cellarea());
+	D	= (-Z[0] + Z[2] - Z[3] + Z[5] - Z[6] + Z[8]) / (6 * Get_Cellsize());
+    E	= (-Z[0] - Z[1] - Z[2] + Z[6] + Z[7] + Z[8]) / (6 * Get_Cellsize());
+
+	Set_From_Polynom(x, y, A, B, C, D, E);
+}
+
+//---------------------------------------------------------
+// Quadratic Function Approximation (Bauer, Rohdenburg & Bork, 1985)
+//
+// Bauer, J. / Rohdenburg, H. / Bork, H.-R., (1985):
+//		'Ein Digitales Reliefmodell als Vorraussetzung fuer ein deterministisches Modell der Wasser- und Stoff-Fluesse',
+//		Landschaftsgenese und Landschaftsoekologie, H.10, Parameteraufbereitung fuer deterministische Gebiets-Wassermodelle,
+//		Grundlagenarbeiten zu Analyse von Agrar-Oekosystemen, (Eds.: Bork, H.-R. / Rohdenburg, H.), p.1-15
+//
+//---------------------------------------------------------
+// f(z) = Ax^2 + By^2 + Cxy + Dx + Ey + F
+//
+//---------------------------------------------------------
+void CMorphometry::Set_BRM(int x, int y)
+{
+	double	Z[9], A, B, C, D, E;
+
+	Get_SubMatrix3x3(x, y, Z);
+
+	A	= ( (Z[0] + Z[2] + Z[3] + Z[5] + Z[6] + Z[8]) - 2 * (Z[1] + Z[4] + Z[7]) ) / (    Get_Cellarea());
+	B	= ( (Z[0] + Z[6] + Z[1] + Z[7] + Z[2] + Z[8]) - 2 * (Z[3] + Z[4] + Z[5]) ) / (    Get_Cellarea());
+    C	= (  Z[8] + Z[0] - Z[7] )                                                  / (4 * Get_Cellarea());
+	D	= ( (Z[2] - Z[0]) + (Z[5] - Z[3]) + (Z[8]-Z[6]) )                          / (6 * Get_Cellsize());
+	E	= ( (Z[6] - Z[0]) + (Z[7] - Z[1]) + (Z[8]-Z[2]) )                          / (6 * Get_Cellsize());
+
+	Set_From_Polynom(x, y, A, B, C, D, E);
+}
+
+//---------------------------------------------------------
+// Quadratic Function Approximation (Zevenbergen und Thorne, 1986)
+//
+// Zevenbergen, L.W. and C.R. Thorne. 1987:
+//		Quantitative analysis of land surface topography
+//		Earth Surface Processes and Landforms, 12: 47-56.
+//
+//---------------------------------------------------------
+// f(z) = Ax^2y^2 + Bx^2y + Cxy^2 + Dx^2 + Ey^2 + Fxy + Gx + Hy + I
+//
+//---------------------------------------------------------
+void CMorphometry::Set_Zevenbergen(int x, int y)
+{
+	double	Z[9], D, E, F, G, H;
+
+	Get_SubMatrix3x3(x, y, Z);
+
+	D	= ((Z[3] + Z[5]) / 2.0 - Z[4]) / (    Get_Cellarea());
+	E	= ((Z[1] + Z[7]) / 2.0 - Z[4]) / (    Get_Cellarea());
+	F	=  (Z[0] - Z[2] - Z[6] + Z[8]) / (4 * Get_Cellarea());
+	G	=  (Z[5] - Z[3])               / (2 * Get_Cellsize());
+    H	=  (Z[7] - Z[1])               / (2 * Get_Cellsize());
+
+	Set_From_Polynom(x, y, D, E, F, G, H);
+}
+
+//---------------------------------------------------------
+// Cubic Function Approximation (Haralick, 1991)
+//
+// R.M. Haralick (1983):
+//		'Ridge and Valley Detection on digital images',
+//		Computer Vision, Graphics and Image Processing, Vol.22, No.1, p.28-38
+//
+//---------------------------------------------------------
+// f(z) = Ax^3 + By^3 + Cx^2y + Dxy^2 + Ex^2 + Fy^2 + Gxy + Hx + Iy + J
+//
+//---------------------------------------------------------
+void CMorphometry::Set_Haralick(int x, int y)
+{
+	//-----------------------------------------------------
+	// Matrices for Finite Difference solution...
+
+	const int 	Mtrx[][5][5]	= {
+	{	{ 31,- 5,-17,- 5, 31}, {-44,-62,-68,-62,-44}, {  0,  0,  0,  0,  0}, { 44, 62, 68, 62, 44}, {-31,  5, 17,  5,-31}	},
+	{	{ 31,-44,  0, 44,-31}, {- 5,-62,  0, 62,  5}, {-17,-68,  0, 68, 17}, {- 5,-62,  0, 62,  5}, { 31,-44,  0, 44,-31}	},
+	{	{  2,  2,  2,  2,  2}, {- 1,- 1,- 1,- 1,- 1}, {- 2,- 2,- 2,- 2,- 2}, {- 1,- 1,- 1,- 1,- 1}, {  2,  2,  2,  2,  2}	},
+	{	{  4,  2,  0,- 2,- 4}, {  2,  1,  0,- 1,- 2}, {  0,  0,  0,  0,  0}, {- 2,- 1,  0,  1,  2}, {- 4,- 2,  0,  2,  4}	},
+	{	{  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}	},	};
+
+	const int	QMtrx[]			= { 4200, 4200, 700, 1000, 700 };
+
+	//-----------------------------------------------------
+	int		i, ix, iy, n;
+	double	Sum, Z[25], k[5];
+
+	Get_SubMatrix5x5(x, y, Z);
+
+	for(i=0; i<5; i++)
+	{
+		for(n=0, Sum=0.0, iy=0; iy<5; iy++)
+		{
+			for(ix=0; ix<5; ix++, n++)
+			{
+				Sum	+= Z[n] * Mtrx[i][ix][iy];
+			}
+		}
+
+		k[i]	= Sum / QMtrx[i];
+	}
+
+	Set_From_Polynom(x, y, k[4], k[2], k[3], k[1], k[0]);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.h b/src/modules/terrain_analysis/ta_morphometry/Morphometry.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.h
rename to src/modules/terrain_analysis/ta_morphometry/Morphometry.h
diff --git a/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp b/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
new file mode 100644
index 0000000..a448118
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
@@ -0,0 +1,123 @@
+/**********************************************************
+ * Version $Id: ProtectionIndex.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "ProtectionIndex.h"
+
+#define NO_DATA -1
+
+CProtectionIndex::CProtectionIndex(void){
+
+	Set_Name(_TL("Morphometric Protection Index"));
+    Set_Author(SG_T("(c) 2005 by Victor Olaya"));
+	Set_Description(_TW(
+        "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, 
+						"DEM",
+						_TL("Elevation"), 						
+						_TL(""), 
+						PARAMETER_INPUT);
+
+	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, 
+						true);
+
+}//constructor
+
+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(); 
+
+    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){
+				pProtectionIndex->Set_NoData(x,y);
+			}//if
+			else{
+				pProtectionIndex->Set_Value(x,y, dProtectionIndex);
+			}//else
+		}//for
+	}//for	
+	
+	return true;
+
+}//method
+
+double CProtectionIndex::getProtectionIndex(int x, int y){
+
+	int i,j;
+	int iDifX[] = {0,1,1,1,0,-1,-1,-1};
+	int iDifY[] = {1,1,0,-1,-1,-1,0,1};
+	double dDifHeight;
+	double dDist;
+	double dAngle;
+	double dProtectionIndex = 0;
+	double aAngle[8];
+
+	for (i = 0; i < 8; i++){
+		j = 1;
+		aAngle[i] = 0;
+		dDist = M_GET_LENGTH(iDifX[i], iDifY[i]) * j * m_pDEM->Get_Cellsize();
+		while (dDist < m_dRadius){
+			if (m_pDEM->is_InGrid(x + iDifX[i] * j, y + iDifY[i] * j)){
+				dDifHeight = m_pDEM->asDouble(x,y);
+			}//if
+			else{
+				return NO_DATA;
+			}
+			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]){
+				aAngle[i] = dAngle;
+			}//if
+			j++;
+			dDist = M_GET_LENGTH(iDifX[i], iDifY[i]) * j * m_pDEM->Get_Cellsize();
+		}//while
+		dProtectionIndex+=aAngle[i];
+	}//while
+
+	return (dProtectionIndex / 8.);
+
+}//method
diff --git a/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.h b/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.h
new file mode 100644
index 0000000..722abfe
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.h
@@ -0,0 +1,41 @@
+/**********************************************************
+ * Version $Id: ProtectionIndex.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    ProtectionIndex.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+#include "MLB_Interface.h"
+
+class CProtectionIndex : public CSG_Module_Grid
+{
+public:
+	CProtectionIndex(void);
+	virtual ~CProtectionIndex(void);
+
+protected:
+
+	bool On_Execute(void);
+
+private:
+
+	double getProtectionIndex(int x, int y);
+
+	CSG_Grid *m_pDEM;
+	double m_dRadius;
+
+};
\ No newline at end of file
diff --git a/src/modules/terrain_analysis/ta_morphometry/RealArea.cpp b/src/modules/terrain_analysis/ta_morphometry/RealArea.cpp
new file mode 100644
index 0000000..62e5a31
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/RealArea.cpp
@@ -0,0 +1,60 @@
+/**********************************************************
+ * Version $Id: RealArea.cpp 1348 2012-03-12 16:17:14Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    RealArea.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "RealArea.h"
+
+CRealArea::CRealArea(void)
+{
+	Set_Name		(_TL("Real Surface Area"));
+	Set_Author		(SG_T("V. Olaya (c) 2004"));
+	Set_Description	(_TW(
+		"Calculates real (not projected) cell area"
+	));
+
+	Parameters.Add_Grid(NULL, "DEM" , _TL("Elevation"   ), _TL(""), PARAMETER_INPUT);
+	Parameters.Add_Grid(NULL, "AREA", _TL("Surface Area"), _TL(""), PARAMETER_OUTPUT);
+}
+
+bool CRealArea::On_Execute(void)
+{
+	CSG_Grid	*pDEM	= Parameters("DEM" )->asGrid(); 
+	CSG_Grid	*pArea	= Parameters("AREA")->asGrid();
+
+    for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	s, a;
+
+			if( pDEM->Get_Gradient(x, y, s, a) )
+			{
+				pArea->Set_Value(x, y, Get_System()->Get_Cellarea() / cos(s));
+			}
+			else
+			{
+				pArea->Set_NoData(x,y);
+			}
+		}
+	}
+	
+	return( true );
+}
diff --git a/src/modules/terrain_analysis/ta_morphometry/RealArea.h b/src/modules/terrain_analysis/ta_morphometry/RealArea.h
new file mode 100644
index 0000000..0aaadca
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/RealArea.h
@@ -0,0 +1,35 @@
+/**********************************************************
+ * Version $Id: RealArea.h 1348 2012-03-12 16:17:14Z oconrad $
+ *********************************************************/
+/*******************************************************************************
+    RealArea.h
+    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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "MLB_Interface.h"
+
+class CRealArea : public CSG_Module_Grid
+{
+public:
+	CRealArea(void);
+
+
+protected:
+
+	bool	On_Execute	(void);
+
+};
diff --git a/src/modules/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp b/src/modules/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp
new file mode 100644
index 0000000..075e6c9
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp
@@ -0,0 +1,514 @@
+/**********************************************************
+ * Version $Id: SurfaceSpecificPoints.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               SurfaceSpecificPoints.cpp               //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "SurfaceSpecificPoints.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSurfaceSpecificPoints::CSurfaceSpecificPoints(void)
+{
+	CSG_Parameter	*pNode;
+
+	Set_Name		(_TL("Surface Specific Points"));
+
+	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
+
+	Set_Description	(_TW(
+		"References:\n"
+		"Peucker, T.K. and Douglas, D.H., 1975:\n"
+		"'Detection of surface-specific points by local parallel processing of discrete terrain elevation data',\n"
+		"Computer Graphics and Image Processing, 4, 375-387\n"
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "RESULT"		, _TL("Result"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL("Algorithm for the detection of Surface Specific Points"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+			_TL("Mark Highest Neighbour"),
+			_TL("Opposite Neighbours"),
+			_TL("Flow Direction"),
+			_TL("Flow Direction (up and down)"),
+			_TL("Peucker & Douglas")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		pNode	, "THRESHOLD"	, _TL("Threshold"),
+		_TL("Threshold for Peucker & Douglas Algorithm"),
+		PARAMETER_TYPE_Double	, 2
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSurfaceSpecificPoints::On_Execute(void)
+{
+	CSG_Grid	*pGrid, *pResult;
+
+	pGrid		= Parameters("ELEVATION")	->asGrid();
+	pResult		= Parameters("RESULT")		->asGrid();
+
+	switch( Parameters("METHOD")->asInt() )
+	{
+	case 0:
+		Do_MarkHighestNB	(pGrid, pResult);
+		break;
+
+	case 1:
+		Do_OppositeNB		(pGrid, pResult);
+		break;
+
+	case 2:
+		Do_FlowDirection	(pGrid, pResult);
+		break;
+
+	case 3:
+		Do_FlowDirection2	(pGrid, pResult);
+		break;
+
+	case 4:
+		Do_PeuckerDouglas	(pGrid, pResult, Parameters("THRESHOLD")->asDouble());
+		break;
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSurfaceSpecificPoints::Do_MarkHighestNB(CSG_Grid *pGrid, CSG_Grid *pResult)	// Band & Lammers...
+{
+	int		i, x, y, ix, iy, xlo, ylo, xhi, yhi;
+
+	double	lo, hi, z;
+
+	CSG_Grid	*clo, *chi;
+
+	clo		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
+	chi		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
+
+	// Pass 1: Auszaehlen...
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+        {
+			lo	= hi	= pGrid->asDouble(x,y);
+			xhi	= xlo	= x;
+			yhi	= ylo	= y;
+
+			for(i=0; i<4; i++)
+			{
+				ix	= Get_xTo(i,x);
+				iy	= Get_yTo(i,y);
+  
+				if( is_InGrid(ix,iy) )
+				{
+					z	= pGrid->asDouble(ix,iy);
+
+					if( z > hi )
+					{
+						hi	= z;
+						xhi	= ix;
+						yhi	= iy;
+					}
+					else if( z < lo )
+					{
+						lo	= z;
+						xlo	= ix;
+						ylo	= iy;
+					}
+				}
+			}
+
+			clo->Add_Value(xlo,ylo,1);
+			chi->Add_Value(xhi,yhi,1);
+		}
+	}
+
+	// Pass 2: Setzen...
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( !chi->asChar(x,y) )
+			{
+				if( !clo->asChar(x,y) )
+					pResult->Set_Value(x,y, 2);	// Sattel
+				else
+					pResult->Set_Value(x,y, 1);	// Tiefenlinie
+			}
+			else if( !clo->asChar(x,y) )
+				pResult->Set_Value(x,y, -1);	// Wasserscheide
+			else
+				pResult->Set_Value(x,y,  0);	// Nichts...
+		}
+	}
+
+	delete(clo);
+	delete(chi);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSurfaceSpecificPoints::Do_OppositeNB(CSG_Grid *pGrid, CSG_Grid *pResult)
+{
+	int		i, x, y, ix, iy, jx, jy;
+
+	double	z, iz, jz;
+
+	CSG_Grid	*clo, *chi;
+
+	clo		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
+	chi		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
+
+	// Pass 1: Auszaehlen...
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+        {
+			z	= pGrid->asDouble(x,y);
+
+			for(i=0; i<4; i++)
+			{
+				ix	= Get_xTo(i,x);
+				iy	= Get_yTo(i,y);
+
+				if( is_InGrid(ix,iy) )
+				{
+					jx	= Get_xFrom(i,x);
+					jy	= Get_yFrom(i,y);
+  
+					if( is_InGrid(jx,jy) )
+					{
+						iz	= pGrid->asDouble(ix,iy);
+						jz	= pGrid->asDouble(jx,jy);
+
+						if( iz>z && jz>z )
+							chi->Add_Value(x,y,1);
+
+						else if( iz<z && jz<z )
+							clo->Add_Value(x,y,1);
+					}
+				}
+			}
+		}
+	}
+
+	// Pass 2: Setzen...
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( chi->asChar(x,y) )
+			{
+				if( clo->asChar(x,y) )
+					pResult->Set_Value(x,y, 5);					// Sattel
+				else
+					pResult->Set_Value(x,y, chi->asChar(x,y) );	// Tiefenlinie
+			}
+			else if( clo->asChar(x,y) )
+				pResult->Set_Value(x,y, - clo->asChar(x,y) );	// Wasserscheide
+			else
+				pResult->Set_Value(x,y, 0);						// Nichts...
+		}
+	}
+
+	delete(clo);
+	delete(chi);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSurfaceSpecificPoints::Do_FlowDirection(CSG_Grid *pGrid, CSG_Grid *pResult)
+{
+	bool	bLower;
+
+	int		x, y, i, ix, iy, xLow, yLow;
+
+	double	z, iz, zLow;
+
+	pResult->Assign();
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+        {
+			z		= pGrid->asDouble(x,y);
+			bLower	= false;
+
+			for(i=0; i<8; i++)
+			{
+				ix	= Get_xTo(i,x);
+				iy	= Get_yTo(i,y);
+  
+				if( is_InGrid(ix,iy) )
+				{
+					iz	= pGrid->asDouble(ix,iy);
+
+					if(iz<z)
+					{
+						if(!bLower)
+						{
+							bLower	= true;
+							zLow	= iz;
+							xLow	= ix;
+							yLow	= iy;
+						}
+						else if(iz<zLow)
+						{
+							zLow	= iz;
+							xLow	= ix;
+							yLow	= iy;
+						}
+					}
+				}
+			}
+
+			if(bLower)
+			{
+				pResult->Add_Value(xLow, yLow, 1);
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSurfaceSpecificPoints::Do_FlowDirection2(CSG_Grid *pGrid, CSG_Grid *pResult)
+{
+	CSG_Grid	Grid(*pGrid), Result(*pResult);
+
+	Do_FlowDirection(&Grid, &Result);
+
+	Grid.Invert();
+
+	Do_FlowDirection(&Grid, pResult);
+
+	for(sLong n=0; n<Get_NCells(); n++)
+	{
+		pResult->Add_Value(n, -Result.asInt(n));
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSurfaceSpecificPoints::Do_PeuckerDouglas(CSG_Grid *pGrid, CSG_Grid *pResult, double Threshold)
+{
+	bool	wasPlus;
+
+	int		x, y, i, ix, iy, nSgn;
+
+	double	d, dPlus, dMinus, z, alt[8];
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			z	= pGrid->asDouble(x,y);
+
+			for(i=0; i<8; i++)
+			{
+				ix	= Get_xTo(i,x);
+				iy	= Get_yTo(i,y);
+
+				if( is_InGrid(ix,iy) )
+					alt[i]	= pGrid->asDouble(ix,iy);
+				else
+					alt[i]	= z;
+			}
+
+			dPlus	= dMinus	= 0;
+			nSgn	= 0;
+			wasPlus	= (alt[7] - z > 0) ? true : false;
+			
+			for(i=0; i<8; i++)
+			{
+				d	= alt[i] - z;
+
+				if(d>0)
+				{
+					dPlus	+= d;
+					if(!wasPlus)
+					{
+						nSgn++;
+						wasPlus	= true;
+					}
+				}
+				else if(d<0)
+				{
+					dMinus	-= d;
+					if(wasPlus)
+					{
+						nSgn++;
+						wasPlus	= false;
+					}
+				}
+			}
+
+			i	= 0;
+			if(!dPlus)									// Peak...
+				i	=  9;
+			else if(!dMinus)							// Pit
+				i	= -9;
+			else if(nSgn==4)							// Pass
+				i	= 1;
+			else if(nSgn==2)
+			{
+				i	= nSgn	= 0;
+
+				if(alt[7]>z)
+				{
+					while(alt[i++]>z);
+					do	nSgn++;	while(alt[i++]<z);
+				}
+				else
+				{
+					while(alt[i++]<z);
+					do	nSgn++;	while(alt[i++]>z);
+				}
+
+				i	= 0;
+
+				if(nSgn==4)
+				{
+					if(dMinus-dPlus > Threshold)		// convex break...
+						i	=  2;
+					else if(dPlus-dMinus > Threshold)	// concave break...
+						i	= -2;
+				}
+				else	// lines:
+				{
+					if(dMinus-dPlus>0)					// Ridge
+						i	=  7;
+					else								// Channel
+						i	= -7;
+				}
+			}
+
+			pResult->Set_Value(x,y,i);
+		}
+    }
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h b/src/modules/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h
rename to src/modules/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.cpp b/src/modules/terrain_analysis/ta_morphometry/air_flow_height.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.cpp
rename to src/modules/terrain_analysis/ta_morphometry/air_flow_height.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.h b/src/modules/terrain_analysis/ta_morphometry/air_flow_height.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.h
rename to src/modules/terrain_analysis/ta_morphometry/air_flow_height.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.cpp b/src/modules/terrain_analysis/ta_morphometry/anisotropic_heating.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.cpp
rename to src/modules/terrain_analysis/ta_morphometry/anisotropic_heating.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.h b/src/modules/terrain_analysis/ta_morphometry/anisotropic_heating.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.h
rename to src/modules/terrain_analysis/ta_morphometry/anisotropic_heating.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.cpp b/src/modules/terrain_analysis/ta_morphometry/distance_gradient.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.cpp
rename to src/modules/terrain_analysis/ta_morphometry/distance_gradient.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.h b/src/modules/terrain_analysis/ta_morphometry/distance_gradient.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.h
rename to src/modules/terrain_analysis/ta_morphometry/distance_gradient.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/fuzzy_landform_elements.cpp b/src/modules/terrain_analysis/ta_morphometry/fuzzy_landform_elements.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/fuzzy_landform_elements.cpp
rename to src/modules/terrain_analysis/ta_morphometry/fuzzy_landform_elements.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/fuzzy_landform_elements.h b/src/modules/terrain_analysis/ta_morphometry/fuzzy_landform_elements.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/fuzzy_landform_elements.h
rename to src/modules/terrain_analysis/ta_morphometry/fuzzy_landform_elements.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.cpp b/src/modules/terrain_analysis/ta_morphometry/land_surface_temperature.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.cpp
rename to src/modules/terrain_analysis/ta_morphometry/land_surface_temperature.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.h b/src/modules/terrain_analysis/ta_morphometry/land_surface_temperature.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.h
rename to src/modules/terrain_analysis/ta_morphometry/land_surface_temperature.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.cpp b/src/modules/terrain_analysis/ta_morphometry/mass_balance_index.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.cpp
rename to src/modules/terrain_analysis/ta_morphometry/mass_balance_index.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.h b/src/modules/terrain_analysis/ta_morphometry/mass_balance_index.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.h
rename to src/modules/terrain_analysis/ta_morphometry/mass_balance_index.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.cpp b/src/modules/terrain_analysis/ta_morphometry/mrvbf.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.cpp
rename to src/modules/terrain_analysis/ta_morphometry/mrvbf.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.h b/src/modules/terrain_analysis/ta_morphometry/mrvbf.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.h
rename to src/modules/terrain_analysis/ta_morphometry/mrvbf.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/param_scale.cpp b/src/modules/terrain_analysis/ta_morphometry/param_scale.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/param_scale.cpp
rename to src/modules/terrain_analysis/ta_morphometry/param_scale.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/param_scale.h b/src/modules/terrain_analysis/ta_morphometry/param_scale.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/param_scale.h
rename to src/modules/terrain_analysis/ta_morphometry/param_scale.h
diff --git a/src/modules/terrain_analysis/ta_morphometry/relative_heights.cpp b/src/modules/terrain_analysis/ta_morphometry/relative_heights.cpp
new file mode 100644
index 0000000..dd15e56
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/relative_heights.cpp
@@ -0,0 +1,1479 @@
+/**********************************************************
+ * Version $Id: relative_heights.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  Relative_Heights.cpp                 //
+//                                                       //
+//                 Copyright (C) 2008 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:     conrad at geowiss.uni-hamburg.de          //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Bundesstr. 55                          //
+//                20146 Hamburg                          //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "relative_heights.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CRelative_Heights::CRelative_Heights(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Relative Heights and Slope Positions"));
+
+	Set_Author		(SG_T("J.Boehner, O.Conrad (c) 2008"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "HO"			, _TL("Slope Height"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "HU"			, _TL("Valley Depth"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "NH"			, _TL("Normalized Height"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SH"			, _TL("Standardized Height"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "MS"			, _TL("Mid-Slope Positon"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "W"			, _TL("w"),
+		_TL(""),
+		PARAMETER_TYPE_Double	,  0.5, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "T"			, _TL("t"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 10.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "E"			, _TL("e"),
+		_TL(""),
+		PARAMETER_TYPE_Double	,  2.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CRelative_Heights::On_Execute(void)
+{
+	double		w, t, e;
+
+	CSG_Grid	*pDEM, *pHO, *pHU;
+
+	//-----------------------------------------------------
+	pDEM	= Parameters("DEM")	->asGrid();
+
+	pHO		= Parameters("HO")	->asGrid();
+	pHU		= Parameters("HU")	->asGrid();
+
+	w		= Parameters("W")	->asDouble();
+	t		= Parameters("T")	->asDouble();
+	e		= Parameters("E")	->asDouble();
+
+	//-----------------------------------------------------
+	Message_Add(_TL("Pass 1"));
+	Get_Heights(pDEM, pHO, true , w, t, e);
+
+	Message_Add(_TL("Pass 2"));
+	Get_Heights(pDEM, pHU, false, w, t, e);
+
+	Get_Results(pDEM, pHO, pHU);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CRelative_Heights::Get_Heights(CSG_Grid *pDEM, CSG_Grid *pH, bool bInverse, double w, double t, double e)
+{
+	CSG_Grid	Inverse;
+
+	if( bInverse )
+	{
+		Inverse.Create(*pDEM);
+		Inverse.Invert();
+		pDEM	= &Inverse;
+	}
+
+	//-----------------------------------------------------
+	return(	Get_Heights_Catchment(pDEM, pH, w)
+		&&	Get_Heights_Modified (pDEM, pH, t, e)
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CRelative_Heights::Get_Heights_Catchment(CSG_Grid *pDEM, CSG_Grid *pH, double Weight)
+{
+	const double	MFD_Converge	= 1.1;
+
+	int			x, y, i, ix, iy;
+	double		z, d, dz[8], dzSum, c, w, h;
+	CSG_Grid	C, W;
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Relative heights calculation..."));
+
+	C  .Create(*Get_System());
+	W  .Create(*Get_System());
+
+	C  .Assign(Get_System()->Get_Cellarea());
+	W  .Assign(0.0);
+	pH->Assign(0.0);
+
+	//-----------------------------------------------------
+	for(sLong n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
+	{
+		if( !pDEM->Get_Sorted(n, x, y, true, false) || pDEM->is_NoData(x, y) )
+		{
+			pH->Set_NoData(x, y);
+		}
+		else
+		{
+			z		= pDEM->asDouble(x, y);
+			c		= C    .asDouble(x, y);
+			w		= W    .asDouble(x, y) + pow(1.0 / c, Weight);		//{W[p] = (1/C[p])^w;}
+			h		= pH  ->asDouble(x, y) + pow(1.0 / c, Weight) * z;	//{H[p] = (1/C[p])^w * M[p];}
+
+			pH->Set_Value(x, y, h / w - z);	//{H[p] = -1 * (M[p] - H[p]/W[p]);}
+
+			for(i=0, dzSum=0.0; i<8; i++)
+			{
+				ix		= Get_xTo(i, x);
+				iy		= Get_yTo(i, y);
+
+				if( pDEM->is_InGrid(ix, iy) && (d = z - pDEM->asDouble(ix, iy)) > 0.0 )
+				{
+					dzSum	+= (dz[i] = pow(atan(d / Get_Length(i)), MFD_Converge));
+				}
+				else
+				{
+					dz[i]	= 0.0;
+				}
+			}
+
+			if( dzSum > 0.0 )
+			{
+				for(i=0; i<8; i++)
+				{
+					if( dz[i] > 0.0 )
+					{
+						ix		= Get_xTo(i, x);
+						iy		= Get_yTo(i, y);
+
+						d		= dz[i] / dzSum;
+
+						C  .Add_Value(ix, iy, d * c);
+						W  .Add_Value(ix, iy, d * w);	//{W[p] = W[p] + W[p+pul] * UL[p] + W[p+pl] * LL[p] + W[p+pol] * OL[p] + W[p+po] * OO[p] + W[p+por] * OR[p] + W[p+pr] * RR[p] + W[p+pur] * UR[p] + W[p+pu] * UU[p]; gefunden = 1;}
+						pH->Add_Value(ix, iy, d * h);	//{H[p] = H[p] + H[p+pul] * UL[p] + H[p+pl] * LL[p] + H[p+pol] * OL[p] + H[p+po] * OO[p] + H[p+por] * OR[p] + H[p+pr] * RR[p] + H[p+pur] * UR[p] + H[p+pu] * UU[p]; gefunden = 1;}
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// in den folgenden drei Schritten werden Maxima der
+// relativen H�he H in Abh�ngigkeit der Neigung gesaugt.
+// Der e-Parameter steuert die st�rke der Maximum-Streckung
+
+//---------------------------------------------------------
+bool CRelative_Heights::Get_Heights_Modified(CSG_Grid *pDEM, CSG_Grid *pH, double t, double e)
+{
+	int			y;
+
+	CSG_Grid	H, H_Last, T;
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Modify: pre-processing..."));
+
+	T.Create(pH);
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	z, d;
+
+			if( !pH->is_NoData(x, y) && !pDEM->is_NoData(x, y) && pDEM->Get_Gradient(x, y, z, d) )
+			{
+				pH->Set_Value(x, y, d = pow(pH->asDouble(x, y), e));	// {X[p] = H[p]^e;}
+				z	= pow(t, z);
+				z	= pow(1.0 / z, exp(z));
+				T.Set_Value(x, y, z);
+			}
+			else
+			{
+				T.Set_NoData(x, y);
+			}
+		}
+	}
+
+	H     .Create(*pH);
+	H_Last.Create(*pH);
+
+	//-----------------------------------------------------
+	int		nChanges	= 1;
+
+	for(int Iteration=1; nChanges && Process_Get_Okay(); Iteration++)
+	{
+		nChanges	= 0;
+
+		#pragma omp parallel for private(y) reduction(+:nChanges)
+		for(y=0; y<Get_NY(); y++)
+		{
+			Process_Get_Okay();
+
+			for(int x=0; x<Get_NX(); x++)
+			{
+				if( !T.is_NoData(x, y) )
+				{
+					double	z	= T.asDouble(x, y) * Get_Local_Maximum(&H, x, y);
+
+					if( z  > H.asDouble(x, y) )
+					{
+						nChanges++;
+
+						H.Set_Value(x, y, z);
+					}
+				}
+			}
+		}
+
+		if( nChanges > 0 )
+		{
+			nChanges	= 0;
+
+			#pragma omp parallel for private(y) reduction(+:nChanges)
+			for(y=0; y<Get_NY(); y++)
+			{
+				Process_Get_Okay();
+
+				for(int x=0; x<Get_NX(); x++)
+				{
+					if( H.asDouble(x, y) != H_Last.asDouble(x, y) )
+					{
+						nChanges++;
+
+						H_Last.Set_Value(x, y, H.asDouble(x, y));
+					}
+				}
+			}
+		}
+
+		Process_Set_Text(CSG_String::Format(SG_T("pass %d (%d > 0)"), Iteration, nChanges));
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Modify: post-processing..."));
+
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			bool	bRecalculate;
+			int		ix, iy, n;
+			double	z;
+
+			if( H.is_NoData(x, y) )
+			{
+				pH->Set_NoData(x, y);
+			}
+			else
+			{
+				for(iy=y-1, bRecalculate=false; iy<=y+1 && !bRecalculate; iy++)
+				{
+					for(ix=x-1; ix<=x+1 && !bRecalculate; ix++)
+					{
+						if( H.is_InGrid(ix, iy) && pH->is_InGrid(ix, iy) && H.asDouble(ix, iy) > pH->asDouble(ix, iy) )
+						{
+							bRecalculate	= true;
+						}
+					}
+				}
+
+				if( bRecalculate )
+				{
+					for(iy=y-1, z=0.0, n=0; iy<=y+1; iy++)
+					{
+						for(ix=x-1; ix<=x+1; ix++)
+						{
+							if( H.is_InGrid(ix, iy) )
+							{
+								n++;
+								z	+= H.asDouble(ix, iy);
+							}
+						}
+					}
+
+					z	= z / (double)n;
+				}
+				else	
+				{
+					z	= H.asDouble(x, y);
+				}
+
+				pH->Set_Value(x, y, pow(z, 1.0 / e));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+double CRelative_Heights::Get_Local_Maximum(CSG_Grid *pGrid, int x, int y)
+{
+	if( pGrid->is_InGrid(x, y) )
+	{
+		double	z	= pGrid->asDouble(x, y);
+
+		for(int i=0; i<8; i++)
+		{
+			int	ix	= Get_xTo(i, x);
+			int	iy	= Get_yTo(i, y);
+
+			if( pGrid->is_InGrid(ix, iy) && pGrid->asDouble(ix, iy) > z )
+			{
+				z	= pGrid->asDouble(ix, iy);
+			}
+		}
+
+		return( z );
+	}
+
+	return( 0.0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// auf Grundlage von HO und HU wird die Normierte H�he
+// (NH) mit H�henwerten zwischen minimal 0 (=unten) und
+// maximal 1 (= oben) wie beim NDVI bestimmt. Die
+// Standardisierte H�he SH streckt das Relief auf ein
+// H�henspektrum zwischen theoretisch 0 (=unten) und
+// dem Maximum der jeweiligen Scheitelbereiche, so dass
+// die urspr�ngliche Reliefenergie erhalten bleibt.
+// Selbstverst�ndlich muss f�r Anwendungen �berpr�ft
+// werden, ob und welche relativen H�hen (HU, HO, SH)
+// logarithmiert dargestellt werden. Als Beispiel ist
+// die Standardisierte H�he logarithmiert berechnet (SHL)
+
+//---------------------------------------------------------
+bool CRelative_Heights::Get_Results(CSG_Grid *pDEM, CSG_Grid *pHO, CSG_Grid *pHU)
+{
+	Process_Set_Text(_TL("Final processing..."));
+
+	CSG_Grid	*pNH	= Parameters("NH")	->asGrid();
+	CSG_Grid	*pSH	= Parameters("SH")	->asGrid();
+	CSG_Grid	*pMS	= Parameters("MS")	->asGrid();
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double	ho, hu, nh;
+
+			if( pDEM->is_NoData(x, y) || pHO->is_NoData(x, y) || pHU->is_NoData(x, y)
+			||  ((ho = pHO->asDouble(x, y)) + (hu = pHU->asDouble(x, y))) == 0.0 )
+			{
+				pNH->Set_NoData(x, y);
+				pSH->Set_NoData(x, y);
+				pMS->Set_NoData(x, y);
+			}
+			else
+			{
+				nh	= 0.5 * (1.0 + (ho - hu) / (ho + hu));
+
+				pNH->Set_Value(x, y, nh);
+				pSH->Set_Value(x, y, nh * (pDEM->asDouble(x, y) - pDEM->Get_ZMin()) + pDEM->Get_ZMin());	//, nh * pDEM->asDouble(x, y));
+				pMS->Set_Value(x, y, fabs(2.0 * nh - 1.0));
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//        The original BSL script by J.B�hner
+//---------------------------------------------------------
+
+/*
+Matrix Loop, O("sch-hoe.grd"), N("sch-nei.grd"), M, R, UL, LL, OL, OO, OR, RR, UR, UU, X, Y, Z, C, W, H, HO, HU, NH, SH, SHL;
+Point ploop, p, pul, pu, pur, pl, pr, pol, po, por;
+Float w, e, wul, wll, wol, woo, wor, wrr, wur, wuu;
+Integer t, h, i, j, k, l, m, n, o, gefunden;
+
+w = 0.5;
+e = 2; 
+t = 10; 
+pul.x = -1;	pul.y = -1; 
+pu.x = 0;	pu.y = -1;
+pur.x = 1;	pur.y = -1;
+pl.x = -1;	pl.y = 0;
+pr.x = 1;	pr.y = 0;
+pol.x = -1;	pol.y = 1;
+po.x = 0;	po.y = 1;
+por.x = 1;	por.y = 1;
+
+M = O;
+R = O;
+UL = O;
+LL = O;
+OL = O;
+OO = O;
+OR = O;
+RR = O;
+UR = O;
+UU = O;
+X = O;
+Y = O;
+Z = O;
+C = O;
+W = O;
+H = O;
+HO = O;
+HU = O;
+NH = O;
+SH = O;
+SHL = O;
+
+Loop.xanz = 100000;
+Loop.yanz = 1;
+h = 0;
+i = 0;
+j = 0;
+k = 0;
+l = 0;
+m = 0;
+n = 0;
+o = 0;
+
+// Das gesamte Verfahren besteht aus zwei identischen Schritten zur Bestimmung von H�he �ber Kulmination (HO) und H�he unter Kulmination (HU). F�r HO wird das DGM zun�chst umgedreht //
+foreach p in M do 
+{M[p] = -1 * O[p];}
+// hier wird eine Hilfsmatrix X erzeugt, die in der folgenden Schleife faf�r sorgt, dass noch nicht attributisierte Rasterzellen in Ihrer Position identifiziert werden k�nnen //
+foreach p in X do
+{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
+	{X[p] = -10000;}
+	else
+	{X[p] = M[p];}
+}
+// hier wird eine Matrix R erzeugt, die ausgehend von lokalen Maxima fortlaufend Rangplatzziffernerzeugt //
+foreach ploop in Loop do
+{	ploop.x = 1;
+	h = h +1;
+	gefunden = 0;
+	foreach p in X do
+	{
+	if (X[p] == max9(p, X) && X[p] > -10000)
+	{X[p] = -10000; R[p] = h; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(R);
+// hier wird eine Hilfsmatrix R erzeugt, die Rangplatzziffern am Rand duch 0 ersetzt //
+foreach p in R do
+{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
+	{R[p] = 0;}
+	else
+	{R[p] = R[p];}
+}
+// hier wird eine Matrix Z erzeugt, die die positiven Winkel zu den 8 Nachbarzellen aufsummiert //
+foreach p in Z do
+{
+if(p.x == 0 && p.y == 0)
+	{
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((woo + wor + wrr) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = woo + wor + wrr;}
+	}
+else
+{
+if(p.x == 0 && p.y == (M.yanz - 1))
+	{
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wrr + wur + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1 && p.y == M.yanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1 && p.y == 0)
+	{
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((wll + wol + woo) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wll + wol + woo;}
+	}
+else	
+{
+if(p.x == 0)
+	{
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((woo + wor + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = woo + wor + wrr + wur + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wol + woo + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wol + woo + wuu;}
+	}
+else	
+{
+if(p.y == 0)
+	{
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((wll + wol + woo + wor + wrr) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wll + wol + woo + wor + wrr;}
+	}
+else	
+{
+if(p.y == M.yanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wrr + wur + wuu;}
+	}
+else	
+{	
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wol + woo + wor + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wol + woo + wor + wrr + wur + wuu;}
+	}
+}}}}}}}}
+// hier werden Grids UL bis UU (im Uhrzeigersinn) erzeugt, die angeben, welchen Anteil des Inhalts einer benachbarten Rasterzelle in die Zielrasterzelle (zentrale Rasterzelle im 9er Feld) �bergen wird //
+foreach p in UL do
+{	if (p.x == 0 || p.y == 0)
+	{UL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pul]) < 0 && Z[p+pul] > 0) 
+		{UL[p] = (atan((M[p+pul] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pul];}
+		else
+		{UL[p] = 0;}
+		}
+}
+foreach p in LL do
+{	if (p.x == 0)
+	{LL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pl]) < 0 && Z[p+pl] > 0) 
+		{LL[p] = (atan((M[p+pl] - M[p])/M.dxy))/Z[p+pl];}
+		else
+		{LL[p] = 0;}
+		}
+}
+foreach p in OL do
+{	if (p.x == 0 || p.y == M.yanz - 1)
+	{OL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pol]) < 0 && Z[p+pol] > 0) 
+		{OL[p] = (atan((M[p+pol] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pol];}
+		else
+		{OL[p] = 0;}
+		}
+}
+foreach p in OO do
+{	if (p.y == M.yanz - 1)
+	{OO[p] = 0;}
+	else	{
+		if((M[p] - M[p+po]) < 0 && Z[p+po] > 0) 
+		{OO[p] = (atan((M[p+po] - M[p])/M.dxy))/Z[p+po];}
+		else
+		{OO[p] = 0;}
+		}
+}
+foreach p in OR do
+{	if (p.x == M.xanz - 1 || p.y == M.yanz - 1)
+	{OR[p] = 0;}
+	else	{
+		if((M[p] - M[p+por]) < 0 && Z[p+por] > 0) 
+		{OR[p] = (atan((M[p+por] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+por];}
+		else
+		{OR[p] = 0;}
+		}
+}
+foreach p in RR do
+{	if (p.x == M.xanz - 1)
+	{RR[p] = 0;}
+	else	{
+		if((M[p] - M[p+pr]) < 0 && Z[p+pr] > 0) 
+		{RR[p] = (atan((M[p+pr] - M[p])/M.dxy))/Z[p+pr];}
+		else
+		{RR[p] = 0;}
+		}
+}
+foreach p in UR do
+{	if (p.x == M.xanz - 1 || p.y == 0)
+	{UR[p] = 0;}
+	else	{
+		if((M[p] - M[p+pur]) < 0 && Z[p+pur] > 0) 
+		{UR[p] = (atan((M[p+pur] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pur];}
+		else
+		{UR[p] = 0;}
+		}
+}
+foreach p in UU do
+{	if (p.y == 0)
+	{UU[p] = 0;}
+	else	{
+		if((M[p] - M[p+pu]) < 0 && Z[p+pu] > 0) 
+		{UU[p] = (atan((M[p+pu] - M[p])/M.dxy))/Z[p+pu];}
+		else
+		{UU[p] = 0;}
+		}
+}
+// in den folgenden drei Schritten wird nach der "multiple flow methode" die Einzugsgebietsgr��e C ermittelt //
+foreach p in Z do
+{Z[p] = 1;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	i = i +1;
+	gefunden = 0;
+	foreach p in Z do
+	{	if (R[p] == i)
+		{Z[p] = 1 + Z[p+pul] * UL[p] + Z[p+pl] * LL[p] + Z[p+pol] * OL[p] + Z[p+po] * OO[p] + Z[p+por] * OR[p] + Z[p+pr] * RR[p] + Z[p+pur] * UR[p] + Z[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(Z);
+foreach p in C do
+{C[p] = Z[p] * M.dxy^2;}
+// in den folgenden zwei Schritten werden Gewichte umgekehrt-proportional zur Einzugsgebietsgr��e nach der multiple flow methode aufsummiert. Der w-parameter steuert die st�rke der Gewichtung //
+foreach p in W do
+{W[p] = (1/C[p])^w;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	k = k +1;
+	gefunden = 0;
+	foreach p in W do
+	{	if (R[p] == k)
+		{W[p] = W[p] + W[p+pul] * UL[p] + W[p+pl] * LL[p] + W[p+pol] * OL[p] + W[p+po] * OO[p] + W[p+por] * OR[p] + W[p+pr] * RR[p] + W[p+pur] * UR[p] + W[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(W);
+// in den folgenden zwei Schritten werden H�henwerte und Gewichte nach der multiple flow methode in der Matrix H aufsummiert, wobei lokale Maxima im Einzugsgebiet am st�rksten in H eingehen. Der w-Parameter steuert die St�rke der Maximumgewichtung //
+foreach p in H do
+{H[p] = M[p] * (1/C[p])^w;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	l = l +1;
+	gefunden = 0;
+	foreach p in H do
+	{	if (R[p] == l)
+		{H[p] = H[p] + H[p+pul] * UL[p] + H[p+pl] * LL[p] + H[p+pol] * OL[p] + H[p+po] * OO[p] + H[p+por] * OR[p] + H[p+pr] * RR[p] + H[p+pur] * UR[p] + H[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(H);
+// im folgenden Schritt wird eine relative H�he H �ber dem gewichteten arithmetischen Mittel der Einzugsgebietsgr��e bestimmt //
+foreach p in H do
+{	if (isRand(p, M) == 0)
+	{H[p] = -1 * (M[p] - H[p]/W[p]);}
+}
+setRandN(H);
+// in den folgenden drei Schritten werden Maxima der relativen H�he H in Abh�ngigkeit der Neigung gesaugt. Der e-Parameter steuert die st�rke der Maximum-Streckung //
+foreach p in X do
+{X[p] = H[p]^e;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	m = m +1;
+	gefunden = 0;
+	foreach p in X do
+	{
+	if ((((1/t^N[p])^exp(t^N[p])) * max9(p, X)) > X[p])
+	{X[p] = (((1/t^N[p])^exp(t^N[p])) * max9(p, X)); gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+foreach p in HO do
+{	if (isRand(p, M) == 0)
+	{
+	if(H[p]^e < X[p] || H[p+pul]^e < X[p+pul] || H[p+pl]^e < X[p+pl] || H[p+pol]^e < X[p+pol] || H[p+po]^e < X[p+po] || H[p+por]^e < X[p+por] || H[p+pr]^e < X[p+pr] || H[p+pur]^e < X[p+pur] || H[p+pu]^e < X[p+pu])
+	{HO[p] = ((X[p] + X[p+pul] + X[p+pu] + X[p+pur] + X[p+pl] + X[p+pr] + X[p+pol] + X[p+po] + X[p+por])/9)^(1/e);}
+	else	
+	{HO[p] = X[p]^(1/e);}
+	}
+}
+setRandN(HO);	
+foreach p in Z do
+{
+h = 0;
+i = 0;
+j = 0;
+k = 0;
+l = 0;
+m = 0;
+}
+// hier wird das DGM nicht umgedreht //
+foreach p in M do 
+{M[p] = O[p];}
+// hier wird eine Hilfsmatrix X erzeugt, die in der folgenden Schleife faf�r sorgt, dass noch nicht attributisierte Rasterzellen in Ihrer Position identifiziert werden k�nnen //
+foreach p in X do
+{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
+	{X[p] = -10000;}
+	else
+	{X[p] = M[p];}
+}
+// hier wird eine Matrix R erzeugt, die ausgehend von lokalen Maxima fortlaufend Rangplatzziffernerzeugt //
+foreach ploop in Loop do
+{	ploop.x = 1;
+	h = h +1;
+	gefunden = 0;
+	foreach p in X do
+	{
+	if (X[p] == max9(p, X) && X[p] > -10000)
+	{X[p] = -10000; R[p] = h; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(R);
+// hier wird eine Hilfsmatrix R erzeugt, die Rangplatzziffern am Rand duch 0 ersetzt //
+foreach p in R do
+{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
+	{R[p] = 0;}
+	else
+	{R[p] = R[p];}
+}
+// hier wird eine Matrix Z erzeugt, die die positiven Winkel zu den 8 Nachbarzellen aufsummiert //
+foreach p in Z do
+{
+if(p.x == 0 && p.y == 0)
+	{
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((woo + wor + wrr) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = woo + wor + wrr;}
+	}
+else
+{
+if(p.x == 0 && p.y == (M.yanz - 1))
+	{
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wrr + wur + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1 && p.y == M.yanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1 && p.y == 0)
+	{
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((wll + wol + woo) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wll + wol + woo;}
+	}
+else	
+{
+if(p.x == 0)
+	{
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((woo + wor + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = woo + wor + wrr + wur + wuu;}
+	}
+else	
+{
+if(p.x == M.xanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wol + woo + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wol + woo + wuu;}
+	}
+else	
+{
+if(p.y == 0)
+	{
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((wll + wol + woo + wor + wrr) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wll + wol + woo + wor + wrr;}
+	}
+else	
+{
+if(p.y == M.yanz - 1)
+	{
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wrr + wur + wuu;}
+	}
+else	
+{	
+	if((M[p] - M[p+pul]) > 0) 
+	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wul = 0;}
+	if((M[p] - M[p+pl]) > 0) 
+	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
+	else
+	{wll = 0;}
+	if((M[p] - M[p+pol]) > 0) 
+	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wol = 0;}
+	if((M[p] - M[p+po]) > 0) 
+	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
+	else
+	{woo = 0;}
+	if((M[p] - M[p+por]) > 0) 
+	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wor = 0;}
+	if((M[p] - M[p+pr]) > 0) 
+	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
+	else
+	{wrr = 0;}
+	if((M[p] - M[p+pur]) > 0) 
+	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
+	else
+	{wur = 0;}
+	if((M[p] - M[p+pu]) > 0) 
+	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
+	else
+	{wuu = 0;}
+	if((wul + wll + wol + woo + wor + wrr + wur + wuu) == 0)
+	{Z[p] = 0;}
+	else
+	{Z[p] = wul + wll + wol + woo + wor + wrr + wur + wuu;}
+	}
+}}}}}}}}
+// hier werden Grids UL bis UU (im Uhrzeigersinn) erzeugt, die angeben, welchen Anteil des Inhalts einer benachbarten Rasterzelle in die Zielrasterzelle (zentrale Rasterzelle im 9er Feld) �bergen wird //
+foreach p in UL do
+{	if (p.x == 0 || p.y == 0)
+	{UL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pul]) < 0 && Z[p+pul] > 0) 
+		{UL[p] = (atan((M[p+pul] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pul];}
+		else
+		{UL[p] = 0;}
+		}
+}
+foreach p in LL do
+{	if (p.x == 0)
+	{LL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pl]) < 0 && Z[p+pl] > 0) 
+		{LL[p] = (atan((M[p+pl] - M[p])/M.dxy))/Z[p+pl];}
+		else
+		{LL[p] = 0;}
+		}
+}
+foreach p in OL do
+{	if (p.x == 0 || p.y == M.yanz - 1)
+	{OL[p] = 0;}
+	else	{
+		if((M[p] - M[p+pol]) < 0 && Z[p+pol] > 0) 
+		{OL[p] = (atan((M[p+pol] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pol];}
+		else
+		{OL[p] = 0;}
+		}
+}
+foreach p in OO do
+{	if (p.y == M.yanz - 1)
+	{OO[p] = 0;}
+	else	{
+		if((M[p] - M[p+po]) < 0 && Z[p+po] > 0) 
+		{OO[p] = (atan((M[p+po] - M[p])/M.dxy))/Z[p+po];}
+		else
+		{OO[p] = 0;}
+		}
+}
+foreach p in OR do
+{	if (p.x == M.xanz - 1 || p.y == M.yanz - 1)
+	{OR[p] = 0;}
+	else	{
+		if((M[p] - M[p+por]) < 0 && Z[p+por] > 0) 
+		{OR[p] = (atan((M[p+por] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+por];}
+		else
+		{OR[p] = 0;}
+		}
+}
+foreach p in RR do
+{	if (p.x == M.xanz - 1)
+	{RR[p] = 0;}
+	else	{
+		if((M[p] - M[p+pr]) < 0 && Z[p+pr] > 0) 
+		{RR[p] = (atan((M[p+pr] - M[p])/M.dxy))/Z[p+pr];}
+		else
+		{RR[p] = 0;}
+		}
+}
+foreach p in UR do
+{	if (p.x == M.xanz - 1 || p.y == 0)
+	{UR[p] = 0;}
+	else	{
+		if((M[p] - M[p+pur]) < 0 && Z[p+pur] > 0) 
+		{UR[p] = (atan((M[p+pur] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pur];}
+		else
+		{UR[p] = 0;}
+		}
+}
+foreach p in UU do
+{	if (p.y == 0)
+	{UU[p] = 0;}
+	else	{
+		if((M[p] - M[p+pu]) < 0 && Z[p+pu] > 0) 
+		{UU[p] = (atan((M[p+pu] - M[p])/M.dxy))/Z[p+pu];}
+		else
+		{UU[p] = 0;}
+		}
+}
+// in den folgenden drei Schritten wird nach der "multiple flow methode" die Einzugsgebietsgr��e C ermittelt //
+foreach p in Z do
+{Z[p] = 1;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	i = i +1;
+	gefunden = 0;
+	foreach p in Z do
+	{	if (R[p] == i)
+		{Z[p] = 1 + Z[p+pul] * UL[p] + Z[p+pl] * LL[p] + Z[p+pol] * OL[p] + Z[p+po] * OO[p] + Z[p+por] * OR[p] + Z[p+pr] * RR[p] + Z[p+pur] * UR[p] + Z[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(Z);
+foreach p in C do
+{C[p] = Z[p] * M.dxy^2;}
+// in den folgenden zwei Schritten werden Gewichte umgekehrt-proportional zur Einzugsgebietsgr��e nach der multiple flow methode aufsummiert. Der w-parameter steuert die st�rke der Gewichtung //
+foreach p in W do
+{W[p] = (1/C[p])^w;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	k = k +1;
+	gefunden = 0;
+	foreach p in W do
+	{	if (R[p] == k)
+		{W[p] = W[p] + W[p+pul] * UL[p] + W[p+pl] * LL[p] + W[p+pol] * OL[p] + W[p+po] * OO[p] + W[p+por] * OR[p] + W[p+pr] * RR[p] + W[p+pur] * UR[p] + W[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(W);
+// in den folgenden zwei Schritten werden H�henwerte und Gewichte nach der multiple flow methode in der Matrix H aufsummiert, wobei lokale Maxima im Einzugsgebiet am st�rksten in H eingehen. Der w-Parameter steuert die St�rke der Maximumgewichtung //
+foreach p in H do
+{H[p] = M[p] * (1/C[p])^w;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	l = l +1;
+	gefunden = 0;
+	foreach p in H do
+	{	if (R[p] == l)
+		{H[p] = H[p] + H[p+pul] * UL[p] + H[p+pl] * LL[p] + H[p+pol] * OL[p] + H[p+po] * OO[p] + H[p+por] * OR[p] + H[p+pr] * RR[p] + H[p+pur] * UR[p] + H[p+pu] * UU[p]; gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+setRandN(H);
+// im folgenden Schritt wird eine relative H�he H �ber dem gewichteten arithmetischen Mittel der Einzugsgebietsgr��e bestimmt //
+foreach p in H do
+{	if (isRand(p, M) == 0)
+	{H[p] = -1 * (M[p] - H[p]/W[p]);}
+}
+setRandN(H);
+// in den folgenden drei Schritten werden Maxima der relativen H�he H in Abh�ngigkeit der Neigung gesaugt. Der e-Parameter steuert die st�rke der Maximum-Streckung //
+foreach p in X do
+{X[p] = H[p]^e;}
+foreach ploop in Loop do
+{	ploop.x = 1;
+	m = m +1;
+	gefunden = 0;
+	foreach p in X do
+	{
+	if ((((1/t^N[p])^exp(t^N[p])) * max9(p, X)) > X[p])
+	{X[p] = (((1/t^N[p])^exp(t^N[p])) * max9(p, X)); gefunden = 1;}
+	}
+	if (gefunden == 0)
+	{ploop.x = 100000;}
+}
+foreach p in HU do
+{	if (isRand(p, M) == 0)
+	{
+	if(H[p]^e < X[p] || H[p+pul]^e < X[p+pul] || H[p+pl]^e < X[p+pl] || H[p+pol]^e < X[p+pol] || H[p+po]^e < X[p+po] || H[p+por]^e < X[p+por] || H[p+pr]^e < X[p+pr] || H[p+pur]^e < X[p+pur] || H[p+pu]^e < X[p+pu])
+	{HU[p] = (((X[p] + X[p+pul] + X[p+pu] + X[p+pur] + X[p+pl] + X[p+pr] + X[p+pol] + X[p+po] + X[p+por])/9)^(1/e));}
+	else	
+	{HU[p] = (X[p]^(1/e));}
+	}
+}
+setRandN (HU);
+showMatrix(HO);
+showMatrix(HU);
+// auf Grundlage von HO und HU wird die Normierte H�he (NH) mit H�henwerten zwischen minimal 0 (=unten) und maximal 1 (= oben) wie beim NDVI bestimmt. Die Standardisierte H�he SH streckt das Relief auf ein H�henspektrum zwischen theoretisch 0 (=unten) und dem Maximum der jeweiligen Scheitelbereiche, so dass die urspr�ngliche Reliefenergie erhalten bleibt. Selbstverst�ndlich muss f�r Anwendungen �berpr�ft werden, ob und welche relativen H�hen (HU, HO, SH) logarithmiert dargestellt werden. [...]
+foreach p in NH do
+{NH[p] = 0.5 * (1 + ((HO[p] - HU[p])/(HO[p] + HU[p])));}
+showMatrix(NH);
+foreach p in SH do
+{SH[p] = NH[p] * O[p];}
+showMatrix(SH);
+foreach p in SHL do
+{SHL[p] = ln(SH[p]);}
+showMatrix(SHL);
+/**/
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.h b/src/modules/terrain_analysis/ta_morphometry/relative_heights.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.h
rename to src/modules/terrain_analysis/ta_morphometry/relative_heights.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.cpp b/src/modules/terrain_analysis/ta_morphometry/ruggedness.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.cpp
rename to src/modules/terrain_analysis/ta_morphometry/ruggedness.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.h b/src/modules/terrain_analysis/ta_morphometry/ruggedness.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.h
rename to src/modules/terrain_analysis/ta_morphometry/ruggedness.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp b/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp
rename to src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h b/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h
rename to src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/top_hat.cpp b/src/modules/terrain_analysis/ta_morphometry/top_hat.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/top_hat.cpp
rename to src/modules/terrain_analysis/ta_morphometry/top_hat.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/top_hat.h b/src/modules/terrain_analysis/ta_morphometry/top_hat.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/top_hat.h
rename to src/modules/terrain_analysis/ta_morphometry/top_hat.h
diff --git a/src/modules/terrain_analysis/ta_morphometry/tpi.cpp b/src/modules/terrain_analysis/ta_morphometry/tpi.cpp
new file mode 100644
index 0000000..cb1abf9
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_morphometry/tpi.cpp
@@ -0,0 +1,481 @@
+/**********************************************************
+ * Version $Id: tpi.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_morphometry                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                        tpi.cpp                        //
+//                                                       //
+//                 Copyright (C) 2011 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 "tpi.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTPI::CTPI(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	// 1. Info...
+
+	Set_Name		(_TL("Topographic Position Index (TPI)"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Topographic Position Index (TPI) calculation as proposed by Guisan et al. (1999). "
+		"This is literally the same as the difference to the mean calculation (residual analysis) "
+		"proposed by Wilson & Gallant (2000).\n"
+		"\n"
+		"References:\n"
+		"- Guisan, A., Weiss, S.B., Weiss, A.D. (1999): GLM versus CCA spatial modeling of plant species distribution. Plant Ecology 143: 107-122.\n"
+		"- Weiss, A.D. (2000): Topographic Position and Landforms Analysis. <a target=\"_blank\" href=\"http://www.jennessent.com/downloads/tpi-poster-tnc_18x22.pdf\">poster</a>.\n"
+		"- Wilson, J.P. & Gallant, J.C. (2000): Terrain Analysis - Principles and Applications.\n"
+	));
+
+
+	//-----------------------------------------------------
+	// 2. Parameters...
+
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	pNode	= Parameters.Add_Grid(
+		NULL	, "TPI"			, _TL("Topographic Position Index"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "STANDARD"	, _TL("Standardize"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Range(
+		NULL	, "RADIUS"		, _TL("Radius"),
+		_TL("radius in map units"),
+		0.0, 100.0, 0.0, true
+	);
+
+	m_Cells.Get_Weighting().Set_BandWidth(75.0);	// 75%
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("bandwidth has to be given as percentage of the (outer) radius")
+	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTPI::On_Execute(void)
+{
+	m_pDEM		= Parameters("DEM")	->asGrid();
+	m_pTPI		= Parameters("TPI")	->asGrid();
+
+	DataObject_Set_Colors(m_pTPI, 100, SG_COLORS_RED_GREY_BLUE, true);
+
+	//-----------------------------------------------------
+	double	r_inner	= Parameters("RADIUS")->asRange()->Get_LoVal() / Get_Cellsize();
+	double	r_outer	= Parameters("RADIUS")->asRange()->Get_HiVal() / Get_Cellsize();
+
+	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
+	m_Cells.Get_Weighting().Set_BandWidth(r_outer * m_Cells.Get_Weighting().Get_BandWidth() / 100.0);
+
+	if( !m_Cells.Set_Annulus(r_inner, r_outer) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			Get_Statistics(x, y);
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Cells.Destroy();
+
+	if( Parameters("STANDARD")->asBool() )
+	{
+		m_pTPI->Standardise();
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTPI::Get_Statistics(int x, int y)
+{
+	if( m_pDEM->is_InGrid(x, y) )
+	{
+		int		i, ix, iy;
+		double	z, id, iw;
+
+		CSG_Simple_Statistics	Statistics;
+
+		for(i=0, z=m_pDEM->asDouble(x, y); i<m_Cells.Get_Count(); i++)
+		{
+			if( m_Cells.Get_Values(i, ix = x, iy = y, id, iw, true) && id >= 0.0 && m_pDEM->is_InGrid(ix, iy) )
+			{
+				Statistics.Add_Value(m_pDEM->asDouble(ix, iy), iw);
+			}
+		}
+
+		//-------------------------------------------------
+		if( Statistics.Get_Weights() > 0.0 )
+		{
+			m_pTPI->Set_Value(x, y, z - Statistics.Get_Mean());
+
+			return( true );
+		}
+	}
+
+	//-----------------------------------------------------
+	m_pTPI->Set_NoData(x, y);
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTPI_Classification::CTPI_Classification(void)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	// 1. Info...
+
+	Set_Name		(_TL("TPI Based Landform Classification"));
+
+	Set_Author		(SG_T("O.Conrad (c) 2011"));
+
+	Set_Description	(_TW(
+		"Topographic Position Index (TPI) calculation as proposed by Guisan et al. (1999). "
+		"This is literally the same as the difference to the mean calculation (residual analysis) "
+		"proposed by Wilson & Gallant (2000).\n"
+		"\n"
+		"References:\n"
+		"- Guisan, A., Weiss, S.B., Weiss, A.D. (1999): GLM versus CCA spatial modeling of plant species distribution. Plant Ecology 143: 107-122.\n"
+		"- Weiss, A.D. (2000): Topographic Position and Landforms Analysis. <a target=\"_blank\" href=\"http://www.jennessent.com/downloads/tpi-poster-tnc_18x22.pdf\">poster</a>.\n"
+		"- Wilson, J.P. & Gallant, J.C. (2000): Terrain Analysis - Principles and Applications.\n"
+	));
+
+
+	//-----------------------------------------------------
+	// 2. Parameters...
+
+	Parameters.Add_Grid(
+		NULL	, "DEM"			, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	pNode	= Parameters.Add_Grid(
+		NULL	, "LANDFORMS"	, _TL("Landforms"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Range(
+		NULL	, "RADIUS_A"	, _TL("Radius"),
+		_TL("radius in map units"),
+		0.0, 100.0, 0.0, true
+	);
+
+	Parameters.Add_Range(
+		NULL	, "RADIUS_B"	, _TL("Radius"),
+		_TL("radius in map units"),
+		0.0, 1000.0, 0.0, true
+	);
+
+	m_Weighting.Set_BandWidth(75.0);	// 75%
+	Parameters.Add_Parameters(
+		NULL	, "WEIGHTING"	, _TL("Weighting"),
+		_TL("bandwidth has to be given as percentage of the (outer) radius")
+	)->asParameters()->Assign(m_Weighting.Get_Parameters());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	LF_CANYON		= 0,
+	LF_MID_SLOPE,
+	LF_UPLAND,
+	LF_VALLEY,
+	LF_PLAIN,
+	LF_OPEN_SLOPE,
+	LF_UPPER_SLOPE,
+	LF_LOCAL_RIDGE,
+	LF_MIDSLOPE_RIDGE,
+	LF_HIGH_RIDGE,
+	LF_COUNT
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTPI_Classification::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Grid	*pDEM		= Parameters("DEM"      )->asGrid();
+	CSG_Grid	*pLandforms	= Parameters("LANDFORMS")->asGrid();
+
+	CTPI	TPI;
+
+	TPI.Set_Manager(NULL);
+
+	TPI.Get_Parameters()->Set_Parameter("DEM"      , Parameters("DEM"      ));
+	TPI.Get_Parameters()->Set_Parameter("WEIGHTING", Parameters("WEIGHTING"));
+	TPI.Get_Parameters()->Get_Parameter("STANDARD")->Set_Value(true);
+
+	//-----------------------------------------------------
+	CSG_Grid	gA(*Get_System());
+
+	TPI.Get_Parameters()->Get_Parameter("TPI")->Set_Value(&gA);
+	TPI.Get_Parameters()->Set_Parameter("RADIUS", Parameters("RADIUS_A"));
+
+	if( !TPI.Execute() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Grid	gB(*Get_System());
+
+	TPI.Get_Parameters()->Get_Parameter("TPI")->Set_Value(&gB);
+	TPI.Get_Parameters()->Set_Parameter("RADIUS", Parameters("RADIUS_B"));
+
+	if( !TPI.Execute() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( pDEM->is_NoData(x, y) )
+			{
+				pLandforms->Set_Value(x, y, -1.0);
+			}
+			else
+			{
+				double	A	= gA.asDouble(x, y);
+				double	B	= gB.asDouble(x, y);
+
+				if( A <= -1.0 )
+				{
+					if( B <= -1.0 )
+					{	// Canyons, Deeply Incised Streams
+						pLandforms->Set_Value(x, y, LF_CANYON);
+					}
+					else if( B < 1.0 )
+					{	// Midslope Drainages, Shallow Valleys
+						pLandforms->Set_Value(x, y, LF_MID_SLOPE);
+					}
+					else // if( B >= 1.0 )
+					{	// Upland Drainages, Headwaters
+						pLandforms->Set_Value(x, y, LF_UPLAND);
+					}
+				}
+				else if( A < 1.0 )
+				{
+					if( B <= -1.0 )
+					{	// U-shaped Valleys
+						pLandforms->Set_Value(x, y, LF_VALLEY);
+					}
+					else if( B < 1.0 )
+					{
+						double	Slope, Aspect;
+
+						pDEM->Get_Gradient(x, y, Slope, Aspect);
+
+						if( Slope <= 5.0 * M_DEG_TO_RAD )
+						{	// Plains
+							pLandforms->Set_Value(x, y, LF_PLAIN);
+						}
+						else
+						{	// Open Slopes
+							pLandforms->Set_Value(x, y, LF_OPEN_SLOPE);
+						}
+					}
+					else // if( B >= 1.0 )
+					{	// Upper Slopes, Mesas
+						pLandforms->Set_Value(x, y, LF_UPPER_SLOPE);
+					}
+				}
+				else // if( A >= 1.0 )
+				{
+					if( B <= -1.0 )
+					{	// Local Ridges, Hills in Valleys
+						pLandforms->Set_Value(x, y, LF_LOCAL_RIDGE);
+					}
+					else if( B < 1.0 )
+					{	// Midslope Ridges, Small Hills in Plains
+						pLandforms->Set_Value(x, y, LF_MIDSLOPE_RIDGE);
+					}
+					else // if( B >= 1.0 )
+					{	// Mountain Tops, High Ridges
+						pLandforms->Set_Value(x, y, LF_HIGH_RIDGE);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pLandforms, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int LF_Colors[LF_COUNT]	=
+		{
+			SG_GET_RGB(  0,   0, 127),	// LF_CANYON
+			SG_GET_RGB(200, 200, 255),	// LF_MID_SLOPE
+			SG_GET_RGB(  0, 200, 255),	// LF_UPLAND
+			SG_GET_RGB(127, 127, 255),	// LF_VALLEY
+			SG_GET_RGB(255, 255, 128),	// LF_PLAIN
+			SG_GET_RGB(128, 255,   0),	// LF_OPEN_SLOPE
+			SG_GET_RGB(  0, 255,   0),	// LF_UPPER_SLOPE
+			SG_GET_RGB(255, 200, 127),	// LF_LOCAL_RIDGE
+			SG_GET_RGB(255, 127,   0),	// LF_MIDSLOPE_RIDGE
+			SG_GET_RGB(255,   0,   0)	// LF_HIGH_RIDGE
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		Name	+= _TL("Streams");				Desc	+= _TL("Canyons, Deeply Incised Streams");
+		Name	+= _TL("Midslope Drainages");	Desc	+= _TL("Midslope Drainages, Shallow Valleys");
+		Name	+= _TL("Upland Drainages");		Desc	+= _TL("Upland Drainages, Headwaters");
+		Name	+= _TL("Valleys");				Desc	+= _TL("U-shaped Valleys");
+		Name	+= _TL("Plains");				Desc	+= _TL("Plains");
+		Name	+= _TL("Open Slopes");			Desc	+= _TL("Open Slopes");
+		Name	+= _TL("Upper Slopes");			Desc	+= _TL("Upper Slopes, Mesas");
+		Name	+= _TL("Local Ridges");			Desc	+= _TL("Local Ridges, Hills in Valleys");
+		Name	+= _TL("Midslope Ridges");		Desc	+= _TL("Midslope Ridges, Small Hills in Plains");
+		Name	+= _TL("High Ridges");			Desc	+= _TL("Mountain Tops, High Ridges");
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<LF_COUNT; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, LF_Colors[i]);
+			pRecord->Set_Value(1, Name[i].c_str());
+			pRecord->Set_Value(2, Desc[i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pLandforms, P);
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.h b/src/modules/terrain_analysis/ta_morphometry/tpi.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.h
rename to src/modules/terrain_analysis/ta_morphometry/tpi.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.cpp b/src/modules/terrain_analysis/ta_morphometry/wind_effect.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.cpp
rename to src/modules/terrain_analysis/ta_morphometry/wind_effect.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.h b/src/modules/terrain_analysis/ta_morphometry/wind_effect.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.h
rename to src/modules/terrain_analysis/ta_morphometry/wind_effect.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.cpp b/src/modules/terrain_analysis/ta_preprocessor/FillSinks.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.cpp
rename to src/modules/terrain_analysis/ta_preprocessor/FillSinks.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.h b/src/modules/terrain_analysis/ta_preprocessor/FillSinks.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.h
rename to src/modules/terrain_analysis/ta_preprocessor/FillSinks.h
diff --git a/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp b/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp
new file mode 100644
index 0000000..671771c
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp
@@ -0,0 +1,293 @@
+/**********************************************************
+ * Version $Id: FillSinks_WL.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_preprocessor                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    FillSinks_WL.cpp                   //
+//                                                       //
+//                 Copyright (C) 2007 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     reklovw at web.de					     //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "FillSinks_WL.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Construction/Destruction				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+CFillSinks_WL::CFillSinks_WL(void)
+{
+
+	Set_Name		(_TL("Fill Sinks (Wang & Liu)"));
+	Set_Author		(_TL("Copyrights (c) 2007 by Volker Wichmann"));
+	Set_Description	(_TW(
+		"This module uses an algorithm proposed by Wang & Liu to identify and fill surface depressions in "
+		"digital elevation models.\n"
+		"The method was enhanced to allow the creation of hydrologic sound elevation models, i.e. not only to "
+		"fill the depression(s) but also to preserve a downward slope along the flow path. If desired, this is accomplished "
+		"by preserving a minimum slope gradient (and thus elevation difference) between cells.\n"
+		"This is the fully featured version of the module creating a depression less DEM, a flow path grid and "
+		"a grid with watershed basins. If you encounter problems processing large data sets "
+		"(e.g. LIDAR data) with this module try the basic version (Fill Sinks XXL).\n\n\n"
+		"References:\n"
+		"Wang, L. & H. Liu (2006): An efficient method for identifying and filling surface depressions in "
+		"digital elevation models for hydrologic analysis and modelling. International Journal of Geographical "
+		"Information Science, Vol. 20, No. 2: 193-213.\n"
+	));
+
+
+	Parameters.Add_Grid(	
+		NULL, "ELEV", _TL("DEM"), 
+		_TL("Digital elevation model"),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(	
+		NULL, "FILLED", _TL("Filled DEM"), 
+		_TL("Depression-free digital elevation model"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "FDIR", _TL("Flow Directions"),
+		_TL("Computed flow directions, 0=N, 1=NE, 2=E, ... 7=NW"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "WSHED", _TL("Watershed Basins"),
+		_TL("Delineated watershed basins"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "MINSLOPE", _TL("Minimum Slope [Degree]"),
+		_TL("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]"),
+		PARAMETER_TYPE_Double, 0.1, 0.0, true
+	);
+
+}
+
+//---------------------------------------------------------
+CFillSinks_WL::~CFillSinks_WL(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+
+bool CFillSinks_WL::On_Execute(void)		
+{
+	CSG_Grid	*pElev, *pSeed, *pFdir, *pWshed;
+	PriorityQ	theQueue;
+	CFillSinks_WL_Node		tempNode;
+
+	int			x, y, ix, iy, i;
+	int			inverse[8] = { 4, 5, 6, 7, 0, 1, 2, 3 };
+	double		z, iz, progress;
+	double		minslope, mindiff[8];
+	bool		preserve;
+	sLong		id;
+
+	pElev		= Parameters("ELEV")->asGrid();
+	pFilled		= Parameters("FILLED")->asGrid();
+	pFdir		= Parameters("FDIR")->asGrid();
+	pWshed		= Parameters("WSHED")->asGrid();
+	minslope	= Parameters("MINSLOPE")->asDouble();
+
+	pFilled->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pElev->Get_Name(), _TL("no sinks")));
+
+
+	if( minslope > 0.0 )
+	{
+		minslope = tan(minslope * M_DEG_TO_RAD);
+		for(i=0; i<8; i++)
+			mindiff[i] = minslope * Get_Length(i);
+		preserve = true;
+	}
+	else
+		preserve = false;
+
+
+	pSeed	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Bit, pElev->Get_NX(), pElev->Get_NY(), pElev->Get_Cellsize(), pElev->Get_XMin(), pElev->Get_YMin());
+	
+	pFilled->Assign_NoData();
+	pWshed->Assign_NoData();
+	pFdir->Assign_NoData();
+	pSeed->Assign(0.0);
+
+
+	
+	// fill priority queue with boundary, i.e. seed cells
+	id = 0;
+	for(y=0; y<Get_NY(); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( !pElev->is_NoData(x, y) )
+			{
+				for(i=0; i<8; i++)
+				{
+					ix = Get_xTo(i, x);
+					iy = Get_yTo(i, y);
+					if( !is_InGrid(ix, iy) || pElev->is_NoData(ix, iy) )
+					{
+						z = pElev->asDouble(x, y);
+						pFilled->Set_Value(x, y, z);
+						pSeed->Set_Value(x, y, 1.0);
+						pWshed->Set_Value(x, y, id);
+						id += 1;
+
+						tempNode.x		= x;
+						tempNode.y		= y;
+						tempNode.spill	= z;
+						theQueue.push( tempNode );
+						break;
+					}
+				}
+			}
+		}
+	}
+
+	// work through least cost path
+	progress = 0.0;
+
+	while( !theQueue.empty() )
+	{
+		PriorityQ::value_type tempNode = theQueue.top();
+
+		x = tempNode.x;
+		y = tempNode.y;
+		theQueue.pop();
+
+		id	= (sLong) pWshed->asDouble(x, y);
+		z	= pFilled->asDouble(x, y);
+
+		for(i=0; i<8; i++)
+		{
+			ix = Get_xTo(i, x);
+			iy = Get_yTo(i, y);
+			if( is_InGrid(ix, iy) && !pElev->is_NoData(ix, iy) )
+			{
+				if( pFilled->is_NoData(ix, iy) )
+				{
+					iz = pElev->asDouble(ix, iy);
+
+					if( preserve )
+					{
+						if( iz < (z + mindiff[i]) )
+							iz = z + mindiff[i];
+					}
+					else if( iz <= z )
+					{
+						iz = z;
+						pFdir->Set_Value(ix, iy, inverse[i]);
+					}
+
+					tempNode.x		= ix;
+					tempNode.y		= iy;
+					tempNode.spill	= iz;
+					theQueue.push( tempNode );
+
+					pFilled->Set_Value(ix, iy, iz);
+					pWshed->Set_Value(ix, iy, id);
+				}
+				else if( pSeed->asInt(ix, iy) == 1 )
+					pWshed->Set_Value(ix, iy, id);
+			}
+		}
+
+		if( pFdir->is_NoData(x, y) )
+			pFdir->Set_Value(x, y, Get_Dir(x, y, z));
+
+
+		progress += 1.0;
+		if( ((int)progress) % 10000 == 0 )
+			Set_Progress(progress, (double)pElev->Get_NCells());
+			//DataObject_Update(pFilled, pElev->Get_ZMin(), pElev->Get_ZMax(), true);
+		
+	}
+
+
+	delete (pSeed);
+	return (true);
+}
+
+
+int CFillSinks_WL::Get_Dir(int x, int y, double z)
+{
+	int		ix, iy, i, steepestn;
+	double	iz, max, gradient;
+
+	max = 0.0;
+	steepestn = -1;
+
+	for(i=0; i<8; i++)
+	{
+		ix = Get_xTo(i, x);
+		iy = Get_yTo(i, y);
+
+		if(	is_InGrid(ix, iy) && !pFilled->is_NoData(ix, iy) && (iz = pFilled->asDouble(ix, iy)) < z)
+		{
+			gradient = (z - iz) / Get_Length(i);
+			if( max < gradient )
+			{
+				max = gradient;
+				steepestn = i;
+			}
+		}
+	}
+
+	return (steepestn);
+}
\ No newline at end of file
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.h b/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.h
rename to src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL.h
diff --git a/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp b/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp
new file mode 100644
index 0000000..2d75fed
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp
@@ -0,0 +1,226 @@
+/**********************************************************
+ * Version $Id: FillSinks_WL_XXL.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_preprocessor                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    FillSinks_WL.cpp                   //
+//                                                       //
+//                 Copyright (C) 2007 by                 //
+//                    Volker Wichmann                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     reklovw at web.de					     //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "FillSinks_WL.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Construction/Destruction				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+CFillSinks_WL_XXL::CFillSinks_WL_XXL(void)
+{
+
+	Set_Name		(_TL("Fill Sinks XXL (Wang & Liu)"));
+	Set_Author		(_TL("Copyrights (c) 2007 by Volker Wichmann"));
+	Set_Description	(_TW(
+		"This module uses an algorithm proposed by Wang & Liu to identify and fill surface depressions in "
+		"digital elevation models.\n"
+		"The method was enhanced to allow the creation of hydrologic sound elevation models, i.e. not only to "
+		"fill the depression(s) but also to preserve a downward slope along the flow path. If desired, this is accomplished "
+		"by preserving a minimum slope gradient (and thus elevation difference) between cells.\n"
+		"This version of the module is designed to work on large data sets (e.g. LIDAR data), with smaller "
+		"datasets you might like to check out the fully featured standard version of the module.\n\n\n"
+		"References:\n"
+		"Wang, L. & H. Liu (2006): An efficient method for identifying and filling surface depressions in "
+		"digital elevation models for hydrologic analysis and modelling. International Journal of Geographical "
+		"Information Science, Vol. 20, No. 2: 193-213.\n"
+	));
+
+
+	Parameters.Add_Grid(	
+		NULL, "ELEV", _TL("DEM"), 
+		_TL("Digital elevation model"),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(	
+		NULL, "FILLED", _TL("Filled DEM"), 
+		_TL("Depression-free digital elevation model"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "MINSLOPE", _TL("Minimum Slope [Degree]"),
+		_TL("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]"),
+		PARAMETER_TYPE_Double, 0.1, 0.0, true
+	);
+
+}
+
+//---------------------------------------------------------
+CFillSinks_WL_XXL::~CFillSinks_WL_XXL(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+
+bool CFillSinks_WL_XXL::On_Execute(void)		
+{
+	CSG_Grid	*pElev, *pFilled;
+	PriorityQ	theQueue;
+	CFillSinks_WL_Node		tempNode;
+
+	int			x, y, ix, iy, i;
+	double		z, iz, progress;
+	double		minslope, mindiff[8];
+	bool		preserve;
+
+
+	pElev		= Parameters("ELEV")->asGrid();
+	pFilled		= Parameters("FILLED")->asGrid();
+	minslope	= Parameters("MINSLOPE")->asDouble();		
+
+	pFilled->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pElev->Get_Name(), _TL("no sinks")));
+
+
+	if( minslope > 0.0 )
+	{
+		minslope = tan(minslope * M_DEG_TO_RAD);
+		for(i=0; i<8; i++)
+			mindiff[i] = minslope * Get_Length(i);
+		preserve = true;
+	}
+	else
+		preserve = false;
+
+	
+	pFilled->Assign_NoData();
+	
+
+	// fill priority queue with boundary cells, i.e. seed cells
+	for(y=0; y<Get_NY(); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( !pElev->is_NoData(x, y) )
+			{
+				for(i=0; i<8; i++)
+				{
+					ix = Get_xTo(i, x);
+					iy = Get_yTo(i, y);
+					if( !is_InGrid(ix, iy) || pElev->is_NoData(ix, iy) )
+					{
+						z = pElev->asDouble(x, y);
+
+						tempNode.x		= x;
+						tempNode.y		= y;
+						tempNode.spill	= z;
+						theQueue.push( tempNode );
+
+						pFilled->Set_Value(x, y, z);
+						break;
+					}
+				}
+			}
+		}
+	}
+
+
+	// process queue
+	progress = 0.0;
+
+	while( !theQueue.empty() )
+	{
+		PriorityQ::value_type tempNode = theQueue.top();
+
+		x = tempNode.x;
+		y = tempNode.y;
+		theQueue.pop();
+
+		z = pFilled->asDouble(x, y);
+
+		for(i=0; i<8; i++)
+		{
+			ix = Get_xTo(i, x);
+			iy = Get_yTo(i, y);
+			if( is_InGrid(ix, iy) && !pElev->is_NoData(ix, iy) && pFilled->is_NoData(ix, iy) )
+			{
+				iz = pElev->asDouble(ix, iy);
+
+				if( preserve )
+				{
+					if( iz < (z + mindiff[i]) )
+						iz = z + mindiff[i];
+				}
+				else if( iz < z )
+					iz = z;
+
+				tempNode.x		= ix;
+				tempNode.y		= iy;
+				tempNode.spill	= iz;
+				theQueue.push( tempNode );
+
+				pFilled->Set_Value(ix, iy, iz);
+			}
+		}
+
+		progress += 1.0;
+		if( ((int)progress) % 10000 == 0 )
+			Set_Progress(progress, (double)pElev->Get_NCells());
+			//DataObject_Update(pFilled, pElev->Get_ZMin(), pElev->Get_ZMax(), true);
+		
+	}
+
+	return (true);
+}
+
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.cpp b/src/modules/terrain_analysis/ta_preprocessor/Flat_Detection.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.cpp
rename to src/modules/terrain_analysis/ta_preprocessor/Flat_Detection.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.h b/src/modules/terrain_analysis/ta_preprocessor/Flat_Detection.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.h
rename to src/modules/terrain_analysis/ta_preprocessor/Flat_Detection.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_preprocessor/MLB_Interface.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.cpp
rename to src/modules/terrain_analysis/ta_preprocessor/MLB_Interface.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.h b/src/modules/terrain_analysis/ta_preprocessor/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_preprocessor/MLB_Interface.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.am b/src/modules/terrain_analysis/ta_preprocessor/Makefile.am
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.am
rename to src/modules/terrain_analysis/ta_preprocessor/Makefile.am
diff --git a/src/modules/terrain_analysis/ta_preprocessor/Makefile.in b/src/modules/terrain_analysis/ta_preprocessor/Makefile.in
new file mode 100644
index 0000000..ba3022b
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_preprocessor/Makefile.in
@@ -0,0 +1,650 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_preprocessor
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_preprocessor_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_preprocessor_la_OBJECTS = burn_in_streams.lo FillSinks.lo \
+	FillSinks_WL.lo FillSinks_WL_XXL.lo MLB_Interface.lo \
+	Flat_Detection.lo Pit_Eliminator.lo Pit_Router.lo
+libta_preprocessor_la_OBJECTS = $(am_libta_preprocessor_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_preprocessor_la_SOURCES)
+DIST_SOURCES = $(libta_preprocessor_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libta_preprocessor.la
+libta_preprocessor_la_SOURCES = \
+burn_in_streams.cpp\
+FillSinks.cpp\
+FillSinks_WL.cpp\
+FillSinks_WL_XXL.cpp\
+MLB_Interface.cpp\
+Flat_Detection.cpp\
+Pit_Eliminator.cpp\
+Pit_Router.cpp\
+burn_in_streams.h\
+FillSinks.h\
+FillSinks_WL.h\
+MLB_Interface.h\
+Flat_Detection.h\
+Pit_Eliminator.h\
+Pit_Router.h
+
+libta_preprocessor_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_preprocessor/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_preprocessor/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_preprocessor.la: $(libta_preprocessor_la_OBJECTS) $(libta_preprocessor_la_DEPENDENCIES) $(EXTRA_libta_preprocessor_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_preprocessor_la_OBJECTS) $(libta_preprocessor_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FillSinks.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FillSinks_WL.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FillSinks_WL_XXL.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flat_Detection.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pit_Eliminator.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pit_Router.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/burn_in_streams.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.cpp b/src/modules/terrain_analysis/ta_preprocessor/Pit_Eliminator.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.cpp
rename to src/modules/terrain_analysis/ta_preprocessor/Pit_Eliminator.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.h b/src/modules/terrain_analysis/ta_preprocessor/Pit_Eliminator.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.h
rename to src/modules/terrain_analysis/ta_preprocessor/Pit_Eliminator.h
diff --git a/src/modules/terrain_analysis/ta_preprocessor/Pit_Router.cpp b/src/modules/terrain_analysis/ta_preprocessor/Pit_Router.cpp
new file mode 100644
index 0000000..e5dc9d6
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_preprocessor/Pit_Router.cpp
@@ -0,0 +1,1133 @@
+/**********************************************************
+ * Version $Id: Pit_Router.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                    ta_preprocessor                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    Pit_Router.cpp                     //
+//                                                       //
+//                 Copyright (C) 2003 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Pit_Router.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define	IS_Flat(a,b)		(a==b)
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CPit_Router::CPit_Router(void)
+{
+	Set_Name		(_TL("Sink Drainage Route Detection"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2001"));
+
+	Set_Description	(_TW(
+		""
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "ELEVATION"	, _TL("Elevation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SINKROUTE"	, _TL("Sink Route"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRESHOLD"	, _TL("Threshold"),
+		_TL(""),
+		PARAMETER_TYPE_Bool
+	);
+
+	Parameters.Add_Value(
+		NULL	, "THRSHEIGHT"	, _TL("Threshold Height"),
+		_TL(""),
+		PARAMETER_TYPE_Double	, 100
+	);
+}
+
+//---------------------------------------------------------
+CPit_Router::~CPit_Router(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPit_Router::On_Execute(void)
+{
+	return( Get_Routes(
+		Parameters("ELEVATION")->asGrid(),
+		Parameters("SINKROUTE")->asGrid(),
+		Parameters("THRESHOLD")->asBool() ? Parameters("THRSHEIGHT")->asDouble() : -1.0
+	) >= 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CPit_Router::Get_Routes(CSG_Grid *pDEM, CSG_Grid *pRoute, double Threshold)
+{
+	int			iPit, nPits, n;
+	TPit_Outlet	*pOutlet, *pNext;
+
+	//-----------------------------------------------------
+	m_pDEM		= pDEM;
+	m_pRoute	= pRoute;
+	m_Threshold	= Threshold;
+
+	//-----------------------------------------------------
+	m_pPits		= NULL;
+	m_Pit		= NULL;
+
+	m_pFlats	= NULL;
+	m_Flat		= NULL;
+
+	m_Outlets	= NULL;
+
+	//-----------------------------------------------------
+	Get_System()->Assign(m_pDEM->Get_System());
+
+	//-----------------------------------------------------
+	if( Initialize() )
+	{
+		//-------------------------------------------------
+		// 1. Pits/Flats finden...
+
+		SG_UI_Process_Set_Text(_TL("Find Pits"));
+
+		nPits	= Find_Pits();
+
+		if( nPits > 0 )
+		{
+			//---------------------------------------------
+			// 2. Pit/Flat-Zugehoerigkeiten u. pot. m_Outlets finden...
+
+			SG_UI_Process_Set_Text(_TL("Find Outlets"));
+
+			Find_Outlets(nPits);
+
+
+			//---------------------------------------------
+			// 3. Routing vornehmen...
+
+			SG_UI_Process_Set_Text(_TL("Routing"));
+
+			iPit	= 0;
+
+			do
+			{
+				pOutlet	= m_Outlets;
+
+				while( pOutlet && SG_UI_Process_Get_Okay(false) )
+				{
+					pNext	= pOutlet->Next;
+					n		= Find_Route(pOutlet);
+
+					if( n > 0 )
+					{
+						pOutlet	= m_Outlets;
+						iPit	+= n;
+						SG_UI_Process_Set_Progress(iPit, nPits);
+					}
+					else
+					{
+						pOutlet	= pNext;
+					}
+				}
+
+				if( iPit < nPits )	// Thresholding may have prevented total removal of pits...
+				{
+					for(n=0; n<nPits; n++)
+					{
+						if( !m_Pit[n].bDrained )
+						{
+							m_Pit[n].bDrained	= true;
+							iPit++;
+							break;
+						}
+					}
+				}
+			}
+			while( iPit < nPits && SG_UI_Process_Set_Progress(iPit, nPits) );
+		}
+
+
+		//-------------------------------------------------
+		// 4. Threshold
+
+		if( m_Threshold > 0.0 )
+		{
+			nPits	-= Process_Threshold();
+		}
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("Finalize"));
+
+	Finalize();
+
+	if( Process_Get_Okay(false) )
+	{
+		if( nPits > 0 )
+		{
+			Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of processed sinks"), nPits));
+
+			return( nPits );
+		}
+		else
+		{
+			Message_Add(_TL("No sinks have been detected."));
+		}
+	}
+
+	return( 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CPit_Router::Initialize(void)
+{
+	if(	m_pDEM && m_pDEM->is_Valid()
+	&&	m_pRoute && m_pRoute->is_Valid()
+	&&	m_pDEM->Get_System() == m_pRoute->Get_System()	)
+//	&&	m_pDEM->is_Compatible(m_pRoute->Get_System())	)
+	{
+		m_pRoute->Assign();
+
+		m_pPits		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Int);
+		m_pPits->Assign();
+
+		m_Pit		= NULL;
+
+		m_pFlats	= NULL;
+		m_Flat		= NULL;
+
+		m_Outlets	= NULL;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+void CPit_Router::Finalize(void)
+{
+	TPit_Outlet	*pOutlet;
+
+	if( m_pPits )
+	{
+		delete( m_pPits );
+		m_pPits		= NULL;
+	}
+
+	if( m_Pit )
+	{
+		SG_Free(m_Pit);
+		m_Pit		= NULL;
+	}
+
+	if( m_pFlats )
+	{
+		delete( m_pFlats );
+		m_pFlats	= NULL;
+	}
+
+	if( m_Flat )
+	{
+		SG_Free(m_Flat);
+		m_Flat		= NULL;
+	}
+
+	while( m_Outlets )
+	{
+		pOutlet		= m_Outlets->Next;
+		SG_Free(m_Outlets);
+		m_Outlets	= pOutlet;
+	}
+
+	m_Outlets	= NULL;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CPit_Router::Find_Pits(void)
+{
+	bool	bLower, bFlat;
+	int		x, y, i, ix, iy, nFlats, nPits;
+	sLong	n;
+	double	z;
+	TPit	*pPit;
+
+	//-----------------------------------------------------
+	nFlats		= 0;
+	nPits		= 0;
+
+	for(n=0; n<Get_NCells() && SG_UI_Process_Set_Progress((double)n, (double)Get_NCells()); n++)
+	{
+		m_pDEM->Get_Sorted(n,x,y,false);	// von tief nach hoch...
+
+		if(	x > 0 && x < Get_NX() - 1 && y > 0 && y < Get_NY() - 1	// Randzellen und Missing Values sind
+		&&	!m_pDEM->is_NoData(x, y)								// per Definition drainiert (:= 0)...
+		&&	m_pPits->asInt(x, y) == 0	)	// ...oder schon als m_Flat markiert sein...
+		{
+			z		= m_pDEM->asDouble(x,y);
+			bLower	= false;
+			bFlat	= false;
+
+			for(i=0; i<8 && !bLower; i++)
+			{
+				ix	= Get_xTo(i,x);
+				iy	= Get_yTo(i,y);
+
+				if( !m_pDEM->is_InGrid(ix, iy) || z > m_pDEM->asDouble(ix, iy) )
+				{
+					bLower	= true;
+				}
+				else if( IS_Flat(z, m_pDEM->asDouble(ix,iy)) )
+				{
+					bFlat	= true;
+				}
+			}
+
+			//-----------------------------------------
+			if( !bLower )	// Pit or Flat...
+			{
+				nPits++;
+
+				m_pPits->Set_Value(x,y, nPits);
+
+				m_Pit				= (TPit *)SG_Realloc(m_Pit, nPits * sizeof(TPit));
+				pPit			= m_Pit + nPits - 1;
+				pPit->bDrained	= false;
+				pPit->z			= z;
+
+				if( bFlat )
+				{
+					nFlats++;
+
+					m_Flat			= (TGEO_iRect *)SG_Realloc(m_Flat, nFlats * sizeof(TGEO_iRect));
+
+					Mark_Flat(x, y, m_Flat + nFlats - 1, nFlats, nPits);
+				}
+			}
+		}
+	}
+
+	return( nPits );
+}
+
+//---------------------------------------------------------
+int CPit_Router::Find_Outlets(int nPits)
+{
+	bool	bOutlet, bExArea, bGoExArea;
+
+	int		x, y, i, ix, iy, iMin,
+			iID, j, jID, Pit_ID[8];
+
+	sLong	n;
+
+	double	z, dz, dzMin;
+
+	TPit_Outlet	*pOutlet;
+
+	//-----------------------------------------------------
+	if( nPits > 0 && SG_UI_Process_Get_Okay(false) )
+	{
+		pOutlet		= NULL;
+
+		m_nJunctions	= (int  *)SG_Calloc(nPits, sizeof(int  ));
+		m_Junction	= (int **)SG_Calloc(nPits, sizeof(int *));
+
+		//-------------------------------------------------
+		for(n=0; n<Get_NCells() && SG_UI_Process_Set_Progress((double)n, (double)Get_NCells()); n++)
+		{
+			if(	m_pDEM->Get_Sorted(n, x, y, false) && m_pPits->asInt(x,y) == 0 )
+			{
+				z			= m_pDEM->asDouble(x,y);
+				iMin		= -1;
+
+				bOutlet		= false;
+				bGoExArea	= false;
+
+				//-----------------------------------------
+				for(i=0; i<8; i++)
+				{
+					ix		= Get_xTo(i,x);
+					iy		= Get_yTo(i,y);
+
+					bExArea	= !m_pDEM->is_InGrid(ix, iy);
+
+					if( bExArea || z > m_pDEM->asDouble(ix,iy) )
+					{
+						Pit_ID[i]	= iID	= bExArea ? 0 : m_pPits->asInt(ix,iy);
+
+						if( iID >= 0 )
+						{
+							for(j=0; j<i && !bOutlet; j++)
+							{
+								jID		= Pit_ID[j];
+
+								if(	jID >= 0 && !Get_Junction(iID, jID) )
+								{
+									bOutlet		= true;
+								}
+							}
+						}
+
+						//---------------------------------
+						if( !bGoExArea )
+						{
+							if( bExArea )
+							{
+								bGoExArea	= true;
+								iMin		= i;
+							}
+							else
+							{
+								dz			= (z - m_pDEM->asDouble(ix,iy)) / Get_Length(i);
+
+								if( iMin < 0 || dzMin < dz )
+								{
+									iMin	= i;
+									dzMin	= dz;
+								}
+							}
+						}
+					}
+					else
+					{
+						Pit_ID[i]	= -1;
+					}
+				}
+
+				//-----------------------------------------
+				if( bOutlet )
+				{
+					if( pOutlet )
+					{
+						pOutlet->Next		= (TPit_Outlet *)SG_Malloc(sizeof(TPit_Outlet));
+						pOutlet->Next->Prev	= pOutlet;
+						pOutlet				= pOutlet->Next;
+					}
+					else
+					{
+						m_Outlets	= pOutlet	= (TPit_Outlet *)SG_Malloc(sizeof(TPit_Outlet));
+						m_Outlets->Prev		= NULL;
+					}
+
+					pOutlet->Next	= NULL;
+					pOutlet->x		= x;
+					pOutlet->y		= y;
+					memcpy(pOutlet->Pit_ID, Pit_ID, 8 * sizeof(int));
+
+					//-------------------------------------
+					for(i=1; i<8; i++)
+					{
+						iID	= Pit_ID[i];
+
+						if( iID >= 0 )
+						{
+							for(j=0; j<i; j++)
+							{
+								jID	= Pit_ID[j];
+
+								if( jID >= 0 && !Get_Junction(iID, jID) )
+								{
+									Add_Junction(iID, jID);
+								}
+							}
+						}
+					}
+				}
+
+				//-----------------------------------------
+				if( iMin >= 0 )
+				{
+					m_pPits->Set_Value(x,y, Pit_ID[iMin] );
+				}
+			}
+		}
+
+		//-------------------------------------------------
+		for(i=0; i<nPits; i++)
+		{
+			if( m_Junction[i] )
+			{
+				SG_Free(m_Junction[i]);
+			}
+		}
+
+		SG_Free(m_Junction);
+
+		SG_Free(m_nJunctions);
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+int CPit_Router::Find_Route(TPit_Outlet *pOutlet)
+{
+	bool	bDrained, bNotDrained;
+
+	int		x, y, i, ix, iy, iMin,
+			Pit_ID, nPitsDrained;
+
+	double	z, dz, dzMin;
+
+
+	//-----------------------------------------------------
+	// 1. Ist Outlets Verbindung zw. Drained und Not Drained ???...
+
+	bDrained		= false;
+	bNotDrained		= false;
+
+	for(i=0; i<8; i++)
+	{
+		Pit_ID	= pOutlet->Pit_ID[i];
+
+		if( Pit_ID == 0 )
+		{
+			bDrained	= true;
+		}
+		else if( Pit_ID > 0 )
+		{
+			if( m_Pit[Pit_ID - 1].bDrained )
+			{
+				bDrained	= true;
+			}
+			else
+			{
+				bNotDrained	= true;
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	nPitsDrained	= 0;
+
+	if( bDrained )
+	{
+		if( bNotDrained )
+		{
+			x		= pOutlet->x;
+			y		= pOutlet->y;
+			z		= m_pDEM->asDouble(x,y);
+
+
+			//---------------------------------------------
+			// 2. Threshold ??!!...
+
+		/*	if( m_Threshold > 0.0 )
+			{
+				for(i=0; i<8; i++)
+				{
+					Pit_ID	= pOutlet->Pit_ID[i];
+
+					if( Pit_ID > 0 && !m_Pit[Pit_ID - 1].bDrained && m_Threshold < z - m_Pit[Pit_ID - 1].z )
+					{
+						pOutlet->Pit_ID[i]	= -1;
+					}
+				}
+			}/**/
+
+
+			//---------------------------------------------
+			// 3.a) nach au�en entwaessern...
+
+			if( !m_pRoute->asChar(x,y) )
+			{
+				iMin	= -1;
+
+				for(i=0; i<8; i++)
+				{
+					ix	= Get_xTo(i,x);
+					iy	= Get_yTo(i,y);
+
+					if( !m_pDEM->is_InGrid(ix, iy) || m_pRoute->asChar(ix, iy) > 0 )
+					{
+						iMin	= i;
+						break;
+					}
+					else
+					{
+						Pit_ID	= pOutlet->Pit_ID[i];
+
+						if(	Pit_ID == 0 || (Pit_ID > 0 && m_Pit[Pit_ID - 1].bDrained) )
+						{
+							dz		= (z - m_pDEM->asDouble(ix,iy)) / Get_Length(i);
+
+							if( iMin < 0 || dzMin < dz )
+							{
+								iMin	= i;
+								dzMin	= dz;
+							}
+						}
+					}
+				}
+
+				if( iMin >= 0 )
+				{
+					m_pRoute->Set_Value(x,y, iMin > 0 ? iMin : 8 );
+				}
+				else
+				{
+					SG_UI_Msg_Add_Error(_TL("Routing Error"));
+				}
+			}
+
+
+			//---------------------------------------------
+			// 3.b) Pit(s)/Flat(s) drainieren...
+
+			for(i=0; i<8; i++)
+			{
+				Pit_ID	= pOutlet->Pit_ID[i];
+
+				if( Pit_ID > 0 && !m_Pit[Pit_ID - 1].bDrained )
+				{
+					m_Pit[Pit_ID - 1].bDrained	= true;
+
+					Drain_Pit(x,y,Pit_ID);
+
+					nPitsDrained++;
+				}
+			}
+		}
+
+
+		//-------------------------------------------------
+		// 4. pOutlet entfernen...
+
+		if( pOutlet->Prev )
+		{
+			pOutlet->Prev->Next	= pOutlet->Next;
+		}
+		else
+		{
+			m_Outlets			= pOutlet->Next;
+		}
+
+		if( pOutlet->Next )
+		{
+			pOutlet->Next->Prev	= pOutlet->Prev;
+		}
+
+		SG_Free(pOutlet);
+	}
+
+	return( nPitsDrained );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CPit_Router::Add_Junction(int iID, int jID)
+{
+	int		i;
+
+	if( iID != jID )
+	{
+		if( iID > jID )
+		{
+			i	= iID;
+			iID	= jID;
+			jID	= i;
+		}
+
+		m_nJunctions[iID]++;
+
+		i	= m_nJunctions[iID];
+
+		m_Junction[iID]			= (int *)SG_Realloc(m_Junction[iID], i * sizeof(int));
+		m_Junction[iID][i-1]	= jID;
+	}
+}
+
+//---------------------------------------------------------
+bool CPit_Router::Get_Junction(int iID, int jID)
+{
+	int		i;
+
+	if(	iID == jID )
+	{
+		return( true );
+	}
+	else
+	{
+		if( iID > jID )
+		{
+			i	= iID;
+			iID	= jID;
+			jID	= i;
+		}
+
+		for(i=0; i<m_nJunctions[iID]; i++)
+		{
+			if( m_Junction[iID][i] == jID )
+			{
+				return( true );
+			}
+		}
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CPit_Router::Drain_Pit(int x, int y, int Pit_ID)
+{
+	int		i, ix, iy, iMin;
+
+	double	z, dz, dzMin;
+
+	do
+	{
+		iMin	= -1;
+
+		if( m_pFlats && m_pFlats->asInt(x,y) > 0 )
+		{
+			Drain_Flat(x,y);
+		}
+		else
+		{
+			z		= m_pDEM->asDouble(x,y);
+			dzMin	= 0;
+
+			for(i=0; i<8; i++)
+			{
+				ix	= Get_xTo(i,x);
+				iy	= Get_yTo(i,y);
+
+				if( m_pDEM->is_InGrid(ix,iy) && m_pPits->asInt(ix,iy) == Pit_ID && !m_pRoute->asChar(ix,iy) )
+				{
+					dz		= (z - m_pDEM->asDouble(ix,iy)) / Get_Length(i);
+
+					if( dzMin < dz )
+					{
+						iMin	= i;
+						dzMin	= dz;
+					}
+				}
+			}
+
+			if( iMin >= 0 )
+			{
+				x	+= Get_xTo(iMin);
+				y	+= Get_yTo(iMin);
+
+				i	= (iMin + 4) % 8;
+
+				m_pRoute->Set_Value(x,y, i > 0 ? i : 8 );
+			}
+		}
+	}
+	while( iMin >= 0 );
+}
+
+//---------------------------------------------------------
+void CPit_Router::Drain_Flat(int x, int y)
+{
+	bool		bContinue;
+
+	int			i, ix, iy, j,
+				n, nPlus,
+				Flat_ID;
+
+	TGEO_iRect	*pFlat;
+
+	//-----------------------------------------------------
+	Flat_ID	= m_pFlats->asInt(x,y);
+
+	if( Flat_ID > 0 )
+	{
+		pFlat	= m_Flat + Flat_ID - 1;
+
+		nPlus	= -1;
+
+		m_pFlats->Set_Value(x,y, nPlus );
+
+		//-------------------------------------------------
+		do
+		{
+			bContinue	= false;
+			n			= nPlus--;
+
+			for(y=pFlat->yMin; y<=pFlat->yMax; y++)
+			{
+				for(x=pFlat->xMin; x<=pFlat->xMax; x++)
+				{
+					if( m_pFlats->asInt(x,y) == n )
+					{
+						for(i=0; i<8; i++)
+						{
+							ix	= Get_xTo(i,x);
+							iy	= Get_yTo(i,y);
+
+							if(	m_pDEM->is_InGrid(ix, iy) && Flat_ID == m_pFlats->asInt(ix, iy) )
+							{
+								bContinue	= true;
+
+								j			= (i + 4) % 8;
+
+								m_pRoute->Set_Value(ix,iy, j ? j : 8 );
+								m_pFlats->Set_Value(ix,iy, nPlus );
+							}
+						}
+					}
+				}
+			}
+		}
+		while( bContinue );
+
+		//-------------------------------------------------
+		for(y=pFlat->yMin; y<=pFlat->yMax; y++)
+		{
+			for(x=pFlat->xMin; x<=pFlat->xMax; x++)
+			{
+				if( m_pFlats->asInt(x,y) < 0 )
+				{
+					m_pFlats->Set_Value(x,y, 0 );
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CPit_Router::Mark_Flat(int x, int y, TGEO_iRect *pFlat, int Flat_ID, int Pit_ID)
+{
+	bool	goStackDown;
+
+	int		i, ix, iy,
+			iStart, iStack, nStack,
+			*xMem, *yMem, *iMem;
+
+	double	z;
+
+	//-----------------------------------------------------
+	if( !m_pFlats )
+	{
+		m_pFlats		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Int);
+		//m_pFlats->Set_Cache(false);
+	}
+
+	z			= m_pDEM->asDouble(x,y);
+
+	xMem		= NULL;
+	yMem		= NULL;
+	iMem		= NULL;
+
+	iStart		= 0;
+	iStack		= 0;
+	nStack		= 0;
+
+	pFlat->xMin	= pFlat->xMax	= x;
+	pFlat->yMin	= pFlat->yMax	= y;
+
+	m_pPits->Set_Value(	x, y, Pit_ID );
+	m_pFlats->Set_Value(	x, y, Flat_ID );
+
+
+	//-----------------------------------------------------
+	do
+	{
+		goStackDown	= true;
+
+		for(i=iStart; i<8 && goStackDown; i++)
+		{
+			ix	= Get_xTo(i,x);
+			iy	= Get_yTo(i,y);
+
+			if(	m_pDEM->is_InGrid(ix, iy) && !m_pPits->asInt(ix, iy) && IS_Flat(z, m_pDEM->asDouble(ix, iy)) )
+			{
+				goStackDown		= false;
+				m_pPits->Set_Value(	ix, iy, Pit_ID );
+				m_pFlats->Set_Value(	ix, iy, Flat_ID );
+			}
+		}
+
+		//-------------------------------------------------
+		if( goStackDown )
+		{
+			iStack--;
+
+			if( iStack >= 0 )
+			{
+				x		= xMem[iStack];
+				y		= yMem[iStack];
+				iStart	= iMem[iStack];
+			}
+		}
+		else
+		{
+			if( nStack <= iStack )
+			{
+				nStack	= iStack + 32;
+				xMem	= (int  *)SG_Realloc(xMem, nStack * sizeof(int ));
+				yMem	= (int  *)SG_Realloc(yMem, nStack * sizeof(int ));
+				iMem	= (int  *)SG_Realloc(iMem, nStack * sizeof(int ));
+			}
+
+			xMem[iStack]	= x;
+			yMem[iStack]	= y;
+			iMem[iStack]	= i + 1;
+
+			x				= ix;
+			y				= iy;
+			iStart			= 0;
+
+			if( x < pFlat->xMin )
+				pFlat->xMin	= x;
+			else if( x > pFlat->xMax )
+				pFlat->xMax	= x;
+
+			if( y < pFlat->yMin )
+				pFlat->yMin	= y;
+			else if( y > pFlat->yMax )
+				pFlat->yMax	= y;
+
+			iStack++;
+		}
+	}
+	while( iStack >= 0 );
+
+	//-----------------------------------------------------
+	if( nStack > 0 )
+	{
+		SG_Free(xMem);
+		SG_Free(yMem);
+		SG_Free(iMem);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CPit_Router::Process_Threshold(void)
+{
+	int		x, y, n, i;
+
+	m_Route.Create(*Get_System(), SG_DATATYPE_Char);
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			if( m_pDEM->is_NoData(x, y) )
+			{
+				m_Route.Set_Value(x, y, -1);
+			}
+			else if( (i = m_pRoute->asInt(x, y)) > 0 )
+			{
+				m_Route.Set_Value(x, y, i % 8);
+			}
+			else
+			{
+				m_Route.Set_Value(x, y, m_pDEM->Get_Gradient_NeighborDir(x, y));
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Lock_Create();
+
+	for(i=0, n=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
+	{
+		if( m_pDEM->Get_Sorted(i, x, y, false) && m_pPits->asInt(x, y) )
+		{
+			m_zThr	= m_pDEM->asDouble(x, y) + m_Threshold;
+			m_zMax	= m_pDEM->asDouble(x, y);
+
+			Check_Threshold(x, y);
+
+			if( m_zMax > m_zThr )
+				n++;
+		}
+	}
+
+	Lock_Destroy();
+
+	//-----------------------------------------------------
+	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(x=0; x<Get_NX(); x++)
+		{
+			i	= m_Route.asInt(x, y);
+
+			if( i < 0 || i == m_pDEM->Get_Gradient_NeighborDir(x, y) )
+			{
+				m_pRoute->Set_Value(x, y, 0);
+			}
+			else
+			{
+				m_pRoute->Set_Value(x, y, i == 0 ? 8 : i);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of pits above threshold level"), n));
+
+	m_Route.Destroy();
+
+	return( n );
+}
+
+//---------------------------------------------------------
+void CPit_Router::Check_Threshold(int x, int y)
+{
+	if( Lock_Get(x, y) )
+		return;
+
+	Lock_Set(x, y);
+
+	if( m_pDEM->asDouble(x, y) > m_zMax )
+	{
+		m_zMax	= m_pDEM->asDouble(x, y);
+	}
+
+	int		i	= m_Route.asInt(x, y);
+	int		ix	= Get_xTo(i, x);
+	int		iy	= Get_yTo(i, y);
+
+	if( m_pDEM->is_InGrid(ix, iy) )
+	{
+		if( m_pDEM->asDouble(x, y) < m_pDEM->asDouble(ix, iy) || m_zMax < m_zThr )
+		{
+			Check_Threshold(ix, iy);
+		}
+	}
+
+	if( m_zMax > m_zThr )
+	{
+		m_Route.Set_Value(x, y, (i + 4) % 8);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.h b/src/modules/terrain_analysis/ta_preprocessor/Pit_Router.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.h
rename to src/modules/terrain_analysis/ta_preprocessor/Pit_Router.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.cpp b/src/modules/terrain_analysis/ta_preprocessor/burn_in_streams.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.cpp
rename to src/modules/terrain_analysis/ta_preprocessor/burn_in_streams.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.h b/src/modules/terrain_analysis/ta_preprocessor/burn_in_streams.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.h
rename to src/modules/terrain_analysis/ta_preprocessor/burn_in_streams.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.cpp b/src/modules/terrain_analysis/ta_profiles/Grid_Cross_Profiles.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.cpp
rename to src/modules/terrain_analysis/ta_profiles/Grid_Cross_Profiles.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.h b/src/modules/terrain_analysis/ta_profiles/Grid_Cross_Profiles.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.h
rename to src/modules/terrain_analysis/ta_profiles/Grid_Cross_Profiles.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.cpp b/src/modules/terrain_analysis/ta_profiles/Grid_Flow_Profile.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.cpp
rename to src/modules/terrain_analysis/ta_profiles/Grid_Flow_Profile.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.h b/src/modules/terrain_analysis/ta_profiles/Grid_Flow_Profile.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.h
rename to src/modules/terrain_analysis/ta_profiles/Grid_Flow_Profile.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.cpp b/src/modules/terrain_analysis/ta_profiles/Grid_Profile.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.cpp
rename to src/modules/terrain_analysis/ta_profiles/Grid_Profile.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.h b/src/modules/terrain_analysis/ta_profiles/Grid_Profile.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.h
rename to src/modules/terrain_analysis/ta_profiles/Grid_Profile.h
diff --git a/src/modules/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp b/src/modules/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp
new file mode 100644
index 0000000..399dddc
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp
@@ -0,0 +1,163 @@
+/**********************************************************
+ * Version $Id: Grid_ProfileFromPoints.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    ProfileFromPoints.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#include "Grid_ProfileFromPoints.h"
+
+CProfileFromPoints::CProfileFromPoints(void){
+
+	CSG_Parameter	*pNode_0, *pNode_1;
+
+	Parameters.Set_Name(_TL("Profile from points"));
+	Parameters.Set_Description(_TW("(c) 2004 by Victor Olaya. Creates a profile from coordinates stored in a table"));
+
+	Parameters.Add_Grid(NULL, 
+						"GRID",
+						_TL("Grid"), 						
+						_TL(""), 
+						PARAMETER_INPUT);
+
+	pNode_0 = Parameters.Add_Table(NULL,
+								"TABLE", 
+								_TL("Input"),
+								_TL(""),	
+								PARAMETER_INPUT);
+	
+	pNode_1	= Parameters.Add_Table_Field(pNode_0,
+									"X",
+									_TL("X"),
+									_TL(""));
+
+	pNode_1	= Parameters.Add_Table_Field(pNode_0,
+									"Y",
+									_TL("Y"),
+									_TL(""));
+
+	Parameters.Add_Table(NULL, 
+						"RESULT", 
+						_TL("Result"), 
+						_TL(""), 
+						PARAMETER_OUTPUT);
+
+}//constructor
+
+
+CProfileFromPoints::~CProfileFromPoints(void)
+{}
+
+bool CProfileFromPoints::On_Execute(void){
+	
+	CSG_Table* pTable;	
+	CSG_Table* pProfileTable;
+	CSG_Table_Record* pRecord;
+	CSG_Grid* pGrid;	
+	int iXField, iYField;	
+	int i;
+	int x1,x2,y1,y2;
+	float fPartialDist;
+	float fDist = 0;
+
+
+	pGrid = Parameters("GRID")->asGrid();
+	pTable = Parameters("TABLE")->asTable();
+	pProfileTable = Parameters("RESULT")->asTable();
+	iXField = Parameters("X")->asInt();
+	iYField = Parameters("Y")->asInt();	
+	
+	pProfileTable->Create((CSG_Table*)NULL);
+	pProfileTable->Set_Name(_TL("Profile"));
+	pProfileTable->Add_Field(_TL("Distance"), SG_DATATYPE_Double);
+	pProfileTable->Add_Field("Z", SG_DATATYPE_Double);
+
+	for (i = 0; i < pTable->Get_Record_Count()-1; i++){
+		
+		x1=(int)(0.5 + (pTable->Get_Record(i  )->asDouble(iXField) - pGrid->Get_XMin()) / pGrid->Get_Cellsize());
+		x2=(int)(0.5 + (pTable->Get_Record(i+1)->asDouble(iXField) - pGrid->Get_XMin()) / pGrid->Get_Cellsize());
+		y1=(int)(0.5 + (pTable->Get_Record(i  )->asDouble(iYField) - pGrid->Get_YMin()) / pGrid->Get_Cellsize());			
+		y2=(int)(0.5 + (pTable->Get_Record(i+1)->asDouble(iYField) - pGrid->Get_YMin()) / pGrid->Get_Cellsize());			
+
+        int x = x1, y = y1, D = 0, HX = x2 - x1, HY = y2 - y1,
+                c, M, xInc = 1, yInc = 1, iLastX = x1, iLastY = y1;
+
+        if (HX < 0) {
+            xInc = -1;
+            HX = -HX;
+        }//if
+        if (HY < 0) {
+            yInc = -1;
+            HY = -HY;
+        }//if
+        if (HY <= HX) {
+            c = 2 * HX;
+            M = 2 * HY;
+            for (;;) {                
+                fPartialDist = (float)(M_GET_LENGTH(x-iLastX, y-iLastY) * pGrid->Get_Cellsize());
+                if (pGrid->is_InGrid(x,y) && fPartialDist){
+					fDist+=fPartialDist;
+                	pRecord = pProfileTable->Add_Record();
+					pRecord->Set_Value(0, fDist);
+					pRecord->Set_Value(1, pGrid->asFloat(x,y));
+                }//if
+                iLastX = x;
+                iLastY = y;
+                if (x == x2) {
+                    break;
+                }// if
+                x += xInc;
+                D += M;
+                if (D > HX) {
+                    y += yInc;
+                    D -= c;
+                }// if
+            }// for
+        }// if
+        else {
+            c = 2 * HY;
+            M = 2 * HX;
+            for (;;) {
+                fPartialDist = (float)(M_GET_LENGTH(x-iLastX, y-iLastY) * pGrid->Get_Cellsize());
+                if (pGrid->is_InGrid(x,y) && fPartialDist){
+					fDist+=fPartialDist;
+                	pRecord = pProfileTable->Add_Record();
+					pRecord->Set_Value(0, fDist);
+					pRecord->Set_Value(1, pGrid->asFloat(x,y));
+                }//if
+                iLastX = x;
+                iLastY = y;
+                if (y == y2) {
+                    break;
+                }// if
+                y += yInc;
+                D += M;
+                if (D > HY) {
+                    x += xInc;
+                    D -= c;
+                }// if
+            }// for
+        }// else        
+     
+	}//for
+
+	return true;
+
+}// method
+
+
diff --git a/src/modules/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h b/src/modules/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h
new file mode 100644
index 0000000..a52a9f8
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h
@@ -0,0 +1,38 @@
+/**********************************************************
+ * Version $Id: Grid_ProfileFromPoints.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+/*******************************************************************************
+    ProfileFromPoints.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
+    (at your option) any later version.
+
+    This program 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
+*******************************************************************************/ 
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "MLB_Interface.h"
+
+class CProfileFromPoints : public CSG_Module_Grid {
+
+public:
+	CProfileFromPoints(void);
+	virtual ~CProfileFromPoints(void);
+
+protected:
+	virtual bool On_Execute(void);
+
+};
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp b/src/modules/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp
rename to src/modules/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.h b/src/modules/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.h
rename to src/modules/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.cpp b/src/modules/terrain_analysis/ta_profiles/Grid_Swath_Profile.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.cpp
rename to src/modules/terrain_analysis/ta_profiles/Grid_Swath_Profile.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.h b/src/modules/terrain_analysis/ta_profiles/Grid_Swath_Profile.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.h
rename to src/modules/terrain_analysis/ta_profiles/Grid_Swath_Profile.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_profiles/MLB_Interface.cpp
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.cpp
rename to src/modules/terrain_analysis/ta_profiles/MLB_Interface.cpp
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.h b/src/modules/terrain_analysis/ta_profiles/MLB_Interface.h
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.h
rename to src/modules/terrain_analysis/ta_profiles/MLB_Interface.h
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.am b/src/modules/terrain_analysis/ta_profiles/Makefile.am
similarity index 100%
rename from src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.am
rename to src/modules/terrain_analysis/ta_profiles/Makefile.am
diff --git a/src/modules/terrain_analysis/ta_profiles/Makefile.in b/src/modules/terrain_analysis/ta_profiles/Makefile.in
new file mode 100644
index 0000000..6e585ac
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_profiles/Makefile.in
@@ -0,0 +1,649 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_profiles
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_profiles_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_profiles_la_OBJECTS = Grid_Cross_Profiles.lo \
+	Grid_Flow_Profile.lo Grid_Profile.lo Grid_ProfileFromPoints.lo \
+	Grid_Profile_From_Lines.lo Grid_Swath_Profile.lo \
+	MLB_Interface.lo
+libta_profiles_la_OBJECTS = $(am_libta_profiles_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_profiles_la_SOURCES)
+DIST_SOURCES = $(libta_profiles_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libta_profiles.la
+libta_profiles_la_SOURCES = \
+Grid_Cross_Profiles.cpp\
+Grid_Flow_Profile.cpp\
+Grid_Profile.cpp\
+Grid_ProfileFromPoints.cpp\
+Grid_Profile_From_Lines.cpp\
+Grid_Swath_Profile.cpp\
+MLB_Interface.cpp\
+Grid_Cross_Profiles.h\
+Grid_Flow_Profile.h\
+Grid_Profile.h\
+Grid_ProfileFromPoints.h\
+Grid_Profile_From_Lines.h\
+Grid_Swath_Profile.h\
+MLB_Interface.h
+
+libta_profiles_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_profiles/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_profiles/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_profiles.la: $(libta_profiles_la_OBJECTS) $(libta_profiles_la_DEPENDENCIES) $(EXTRA_libta_profiles_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_profiles_la_OBJECTS) $(libta_profiles_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Cross_Profiles.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Flow_Profile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Profile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_ProfileFromPoints.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Profile_From_Lines.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Swath_Profile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp
new file mode 100644
index 0000000..adf8c31
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp
@@ -0,0 +1,226 @@
+/**********************************************************
+ * Version $Id: ANGMAP_01.cpp 1948 2014-01-17 15:09:07Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    ANGMAP_01.cpp                      //
+//                                                       //
+//                 Copyright (C) 2013 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "ANGMAP_01.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CANGMAP::CANGMAP(void)
+{
+	Set_Name		(_TL("ANGMAP"));
+
+	Set_Author		(SG_T("A. Günther (c) 2013"));
+
+	Set_Description	(_TW(
+		"\n"
+		"This module computes the acute angle raster between the topographic surface defined by slope and aspect rasters internally derived from input elevation raster, and a structural plane defined by diop direction- and dip grids. "
+		"Optionally, the dip direction and dip of the cutting line linears between the two planes can be calculated"
+		"\n"
+		"Reference: "
+		"<a href=\"http://www.sciencedirect.com/science/article/pii/S0098300403000864\">Günther, A. (2003). SLOPEMAP: programs for automated mapping of geometrical and kinematical properties of hard rock hill slopes. Computers & Geosciences, 29, 865 - 875</a>.\n"
+
+	));
+
+	Parameters.Add_Grid(
+		NULL, "DEM", "Elevation", "A Digital Elvation Model (DEM)", PARAMETER_INPUT
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "C", "Dip grid (degrees) ", "A grid representing the dip of the structure plane (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "D", "Dip direction grid (degrees) ", "A grid representing the dip direction of the structure plane (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Value(
+		NULL, "fB", "Global structure dip (degrees)", "Constant value if no raster set", PARAMETER_TYPE_Double, 45.0			//Initialisierung eines fixen wertes vs Grid f�r dip
+		);
+
+	Parameters.Add_Value(
+		NULL, "fC", "Global structure dip direction (degrees)", "Constant value if no raster set", PARAMETER_TYPE_Double, 90.0			//Initialisierung eines fixen wertes vs Grid f�r dipdir
+		);
+
+	Parameters.Add_Grid(
+		NULL, "E", "Angle", "Acute angle (degrees) grid", PARAMETER_OUTPUT
+		);
+
+	Parameters.Add_Grid(
+		NULL, "F", "CL dipdir", "Dip direction cutting line (degrees)",PARAMETER_OUTPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "G", "CL dip", "Dip cutting line (degrees)",PARAMETER_OUTPUT_OPTIONAL
+		);
+
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CANGMAP::On_Execute(void)
+{
+	double		fB	= Parameters("fB")->asDouble();
+	double		fC	= Parameters("fC")->asDouble();
+	
+	CSG_Grid	*pDEM, *pC, *pD, *pE, *pF, *pG;
+
+	pDEM	= Parameters("DEM")->asGrid();		//elevation
+	pC		= Parameters("C"  )->asGrid();		//dip grid
+	pD		= Parameters("D"  )->asGrid();		//dip dir grid
+	pE		= Parameters("E"  )->asGrid();		//output angles
+	pF		= Parameters("F"  )->asGrid();		//output ce dipdir
+	pG		= Parameters("G"  )->asGrid();		//output ce dip
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double a, b, c, d, e, f, g;
+
+			if( !pDEM->Get_Gradient(x, y, a, b)
+			||  (pC && pC->is_NoData(x, y))
+			||  (pD && pD->is_NoData(x, y))	)
+			{
+				if (pE)	pE->Set_NoData(x, y);
+				if (pF)	pF->Set_NoData(x, y);
+				if (pG)	pG->Set_NoData(x, y);
+			}
+			else
+			{
+				double	s1, s2, s3, s4, c1, c2, c3, c4;
+				double	px, py, pz;
+				double	p, pp, ff, aa;
+
+				c	=	pC ? pC->asDouble(x, y) : fB;	//Abfrage ob Raster oder Globalwerte
+				d	=	pD ? pD->asDouble(x, y) : fC;	//Abfrage ob Raster oder Globalwerte
+
+				s1	= sin(b + M_PI);
+				s2	= sin((d * M_DEG_TO_RAD) + M_PI);
+				s3	= sin((M_PI/2) - a);
+				s4	= sin((M_PI/2) - (c * M_DEG_TO_RAD));
+				c1	= cos(b + M_PI);
+				c2	= cos((d * M_DEG_TO_RAD) + M_PI);
+				c3	= cos((M_PI/2) - a);
+				c4	= cos((M_PI/2) - (c * M_DEG_TO_RAD));
+		
+				px = (s1 * c3 * s4) - (s3 * s2 * s4);
+				py = (s3 * c2 * c4) - (c1 * c3 * c4);
+				pz = (c1 * c3 * s2 * 4) - (s1 * c3 * c2 * c4);
+
+				if (pz < 0)
+				{
+					px = px * -1;
+					py = py * -1;
+					pz = pz * -1;
+				}
+		 
+				p	=	sqrt((px * px) + (py * py) + (pz * pz));
+				pp  =	pz / p;
+				ff	=	atan(pp / sqrt((1 - (pp * pp))));
+				aa	=	atan(py / px);
+
+				e	=	ff * M_RAD_TO_DEG;
+				f	=	aa * M_RAD_TO_DEG;
+
+				if (px < 0)
+					f = f + 180;
+				else if ((px < 0) && (py < 0))
+					f = f + 360;
+
+				if (f > 360)
+					f = f - 360;
+				if (f < 0)
+					f = f + 360;
+
+				g = sin(p) * M_RAD_TO_DEG;
+
+				if (pE)	pE->Set_Value(x, y, e);
+				if (pF)	pF->Set_Value(x, y, f);
+				if (pG)	pG->Set_Value(x, y, g);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h
new file mode 100644
index 0000000..5c07b5e
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h
@@ -0,0 +1,96 @@
+/**********************************************************
+ * Version $Id: ANGMAP_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      ANGMAP_01.h                      //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany								 //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CANGMAP : public CSG_Module_Grid
+{
+public:
+	CANGMAP(void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp
new file mode 100644
index 0000000..736b0e5
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp
@@ -0,0 +1,137 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2011 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                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("Terrain Analysis - Slope Stability"));
+
+	case MLB_INFO_Author:
+		return("A. G�nther (c) 2012");
+
+	case MLB_INFO_Description:
+		return(_TW(
+			"Some terrain analysis tools for slope stability \n"
+			"Developed by Andreas G�nther, BGR, B2.2"
+		));
+
+	case MLB_INFO_Version:
+		return("1.0");
+
+	case MLB_INFO_Menu_Path:
+		return(_TL("Terrain Analysis|Slope Stability"));
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "Safetyfactor_01.h"
+#include "TOBIA_01.h"
+#include "SHALSTAB_01.h"
+#include "WETNESS_01.h"
+#include "WEDGEFAIL_01.h"
+#include "ANGMAP_01.h"
+
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	switch( i )
+	{
+	case  0:	return( new CSafetyfactor );
+	case  1:	return( new CTOBIA );
+	case  2:	return( new CSHALSTAB );
+	case  3:	return( new CWETNESS );
+	case  4:	return( new CWEDGEFAIL );
+	case  5:	return( new CANGMAP );
+
+	case 11:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h
new file mode 100644
index 0000000..4e01208
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h
@@ -0,0 +1,83 @@
+/**********************************************************
+ * Version $Id: MLB_Interface.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2011 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.de                    //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                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/terrain_analysis/ta_slope_stability/Makefile.am b/src/modules/terrain_analysis/ta_slope_stability/Makefile.am
new file mode 100644
index 0000000..bdfa203
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/Makefile.am
@@ -0,0 +1,32 @@
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libta_slope_stability.la
+libta_slope_stability_la_SOURCES =\
+ANGMAP_01.cpp\
+MLB_Interface.cpp\
+Safetyfactor_01.cpp\
+SHALSTAB_01.cpp\
+TOBIA_01.cpp\
+WEDGEFAIL_01.cpp\
+WETNESS_01.cpp\
+ANGMAP_01.h\
+MLB_Interface.h\
+Safetyfactor_01.h\
+SHALSTAB_01.h\
+TOBIA_01.h\
+WEDGEFAIL_01.h\
+WETNESS_01.h
+
+libta_slope_stability_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/terrain_analysis/ta_slope_stability/Makefile.in b/src/modules/terrain_analysis/ta_slope_stability/Makefile.in
new file mode 100644
index 0000000..94a9bdf
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/Makefile.in
@@ -0,0 +1,649 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/modules/terrain_analysis/ta_slope_stability
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+	$(top_srcdir)/m4/ax_pkg_swig.m4 \
+	$(top_srcdir)/m4/ax_python_devel.m4 \
+	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
+	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libta_slope_stability_la_DEPENDENCIES =  \
+	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am_libta_slope_stability_la_OBJECTS = ANGMAP_01.lo MLB_Interface.lo \
+	Safetyfactor_01.lo SHALSTAB_01.lo TOBIA_01.lo WEDGEFAIL_01.lo \
+	WETNESS_01.lo
+libta_slope_stability_la_OBJECTS =  \
+	$(am_libta_slope_stability_la_OBJECTS)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libta_slope_stability_la_SOURCES)
+DIST_SOURCES = $(libta_slope_stability_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
+AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GOMPFLAGS = @GOMPFLAGS@
+GREP = @GREP@
+HARU_LIB = @HARU_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCAL_INCS = @LOCAL_INCS@
+LOCAL_LIBS = @LOCAL_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PG_CONFIG = @PG_CONFIG@
+POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
+POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
+POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
+#
+ at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
+ at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version 
+pkglib_LTLIBRARIES = libta_slope_stability.la
+libta_slope_stability_la_SOURCES = \
+ANGMAP_01.cpp\
+MLB_Interface.cpp\
+Safetyfactor_01.cpp\
+SHALSTAB_01.cpp\
+TOBIA_01.cpp\
+WEDGEFAIL_01.cpp\
+WETNESS_01.cpp\
+ANGMAP_01.h\
+MLB_Interface.h\
+Safetyfactor_01.h\
+SHALSTAB_01.h\
+TOBIA_01.h\
+WEDGEFAIL_01.h\
+WETNESS_01.h
+
+libta_slope_stability_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_slope_stability/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_slope_stability/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libta_slope_stability.la: $(libta_slope_stability_la_OBJECTS) $(libta_slope_stability_la_DEPENDENCIES) $(EXTRA_libta_slope_stability_la_DEPENDENCIES) 
+	$(CXXLINK) -rpath $(pkglibdir) $(libta_slope_stability_la_OBJECTS) $(libta_slope_stability_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ANGMAP_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SHALSTAB_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Safetyfactor_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/TOBIA_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/WEDGEFAIL_01.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/WETNESS_01.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp
new file mode 100644
index 0000000..1fc9bc5
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp
@@ -0,0 +1,513 @@
+/**********************************************************
+ * Version $Id: SHALSTAB_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    SHALSTAB_01.cpp                    //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "SHALSTAB_01.h"
+#include <math.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSHALSTAB::CSHALSTAB(void)
+{
+	CSG_Parameters	P;
+
+	//-----------------------------------------------------
+	
+	Set_Name		(_TL("SHALSTAB"));
+
+	Set_Author		(SG_T("A. Günther (c) 2012"));
+
+	Set_Description	(_TW(
+		"\n"
+		"This module is a realization of the SHALSTAB (""Shallow Slope Stability"") model from Montgomery & Dietrich (1994). "
+		"The model computes grid cell critical shallow groundwater recharge values (CR in mm/day) as a measure for relative shallow slope stability, utilizing "
+		"a simple model that combines a steady-state hydrologic model (a topographic wetness index) to predict groundwater pressures with an infinite slope stability model. "
+		"For computation, a slope (in radians) and a catchment area (in m2) grid are required. "
+		"Additionally, information on material density (g/cm3), material friction angle (°), material hydraulic conductivity (m/hr), bulk cohesion (MPa) "
+		"and depth to potential shear plane (m) are required that can be specified either globally or through grids. "
+		"The module produces a continuous CR (mm/day) raster with unconditionally stable cells blanked, and unconditionally unstable cells as CR = 0. "
+		"Optionally, a classified CR grid can be calculated representing seven stability classes.\n"
+		"\n"
+		"Reference: "
+		"<a href=\"http://www.agu.org/pubs/crossref/1994/93WR02979.shtml\">Montgomery D. R., Dietrich, W. E. (1994) A physically based model for the topographic control on shallow landsliding. Water Resources Research, 30, 1153-1171.</a>.\n"
+
+	));
+
+	Parameters.Add_Grid(
+		NULL, "A", "Slope grid (rad)", "A slope angle grid (in rad�ans)", PARAMETER_INPUT
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "B", "Catchment area grid (m2)", "A catchment area grid (in square meters)", PARAMETER_INPUT
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "Cmin", "Min Density grid (g/cm3)", "A grid representing minimum material density (in g/cm3)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Cmax", "Max Density grid (g/cm3)", "A grid representing maximum material density (in g/cm3)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Dmin", "Min Hydraulic conductivity grid (m/hr) ", "A grid representing minimum material hydraulic conductivity (in m/hr)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Dmax", "Max Hydraulic conductivity grid (m/hr) ", "A grid representing maximum material hydraulic conductivity (in m/hr)", PARAMETER_INPUT_OPTIONAL
+		);	
+
+	Parameters.Add_Grid(
+		NULL, "Emin", "Min Thickness grid (m)", "A grid representing minimum material thickness (in m)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Emax", "Max Thickness grid (m)", "A grid representing maximum material thickness (in m)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Fmin", "Min Friction angle grid (degree) ", "A grid representing minimum material friction angle (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);		
+
+	Parameters.Add_Grid(
+		NULL, "Fmax", "Max Friction angle grid (degree) ", "A grid representing maximum material friction angle (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Jmin", "Min Bulk cohesion grid (MPa) ", "A grid representing minimum bulk cohesion", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Jmax", "Max Bulk cohesion grid (MPa) ", "A grid representing maximum bulk cohesion", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Value(
+		NULL, "fCmin", "Global minimum density (g/cm3)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.6					//Initialisierung eines fixen wertes vs Grid f�r density
+		);
+
+	Parameters.Add_Value(
+		NULL, "fCmax", "Global maximum density (g/cm3)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.6					//Initialisierung eines fixen wertes vs Grid f�r density
+		);
+
+	Parameters.Add_Value(
+		NULL, "fDmin", "Global minimum conductivity (m/hr)", "Constant value if no raster set", PARAMETER_TYPE_Double, 2.7				//Initialisierung eines fixen wertes vs Grid f�r conductivity
+		);
+
+	Parameters.Add_Value(
+		NULL, "fDmax", "Global maximum conductivity (m/hr)", "Constant value if no raster set", PARAMETER_TYPE_Double, 2.7				//Initialisierung eines fixen wertes vs Grid f�r conductivity
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmin", "Global minimum thickness (m)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.0							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmax", "Global maximum thickness (m)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.0							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);
+	
+	Parameters.Add_Value(
+		NULL, "fFmin", "Global minimum friction angle (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 33.0				//Initialisierung eines fixen wertes vs Grid f�r friction
+		);
+
+	Parameters.Add_Value(
+		NULL, "fFmax", "Global maximum friction angle (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 33.0				//Initialisierung eines fixen wertes vs Grid f�r friction
+		);
+
+	Parameters.Add_Value(
+		NULL, "fJmin", "Global minimum bulk cohesion (MPa)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0							//Initialisierung eines fixen wertes vs Grid f�r cohesion
+		);
+
+	Parameters.Add_Value(
+		NULL, "fJmax", "Global maximum bulk cohesion (MPa)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0							//Initialisierung eines fixen wertes vs Grid f�r cohesion
+		);
+	
+	Parameters.Add_Value(
+		NULL, "fK", "Parameter sampling runs", "Number of sampling cycles",PARAMETER_TYPE_Int, 1						//Initialisierung eines fixen wertes vs Grid f�r cohesion
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "G", "CR values", "Resulting critical recharge (m/day) grid", PARAMETER_OUTPUT
+		);
+
+	Parameters.Add_Grid(
+		NULL, "H", "CR classes", "Classified critical recharge (-) grid", PARAMETER_OUTPUT_OPTIONAL
+		);
+
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	CR_NODATA		= 0,
+	CR_UNSTABLE,
+	CR_0_TO_50,
+	CR_50_TO_100,
+	CR_100_TO_200,
+	CR_200_TO_400,
+	CR_GR_400,
+	CR_STABLE,
+	CR_COUNT
+};
+
+bool CSHALSTAB::On_Execute(void)
+{
+	double		fCmin	= Parameters("fCmin")->asDouble();
+	double		fDmin	= Parameters("fDmin")->asDouble();
+	double		fEmin	= Parameters("fEmin")->asDouble();
+	double		fFmin	= Parameters("fFmin")->asDouble();	
+	double		fJmin	= Parameters("fJmin")->asDouble();
+	double		fCmax	= Parameters("fCmax")->asDouble();
+	double		fDmax	= Parameters("fDmax")->asDouble();
+	double		fEmax	= Parameters("fEmax")->asDouble();
+	double		fFmax	= Parameters("fFmax")->asDouble();	
+	double		fJmax	= Parameters("fJmax")->asDouble();
+	double		fK		= Parameters("fK")->asInt();
+	double		grav	= 9.81;
+
+	CSG_Grid	*pA, *pB, *pCmin, *pDmin, *pEmin, *pFmin, *pG, *pH, *pJmin, *pCmax, *pDmax, *pEmax, *pFmax, *pJmax;
+
+	pA		= Parameters("A"	)->asGrid();		//slope
+	pB		= Parameters("B"	)->asGrid();		//flow accumulation
+	pCmin	= Parameters("Cmin"	)->asGrid();		//density
+	pDmin	= Parameters("Dmin"	)->asGrid();		//conductivity
+	pEmin	= Parameters("Emin"	)->asGrid();		//depth
+	pFmin	= Parameters("Fmin"	)->asGrid();		//friction
+	pCmax	= Parameters("Cmax"	)->asGrid();		//density
+	pDmax	= Parameters("Dmax"	)->asGrid();		//conductivity
+	pEmax	= Parameters("Emax"	)->asGrid();		//depth
+	pFmax	= Parameters("Fmax"	)->asGrid();		//friction
+	pG		= Parameters("G"	)->asGrid();		//output critical recharge
+	pH		= Parameters("H"	)->asGrid();		//optional output classified grid
+	pJmin	= Parameters("Jmin"	)->asGrid();		//bulk cohesion
+	pJmax	= Parameters("Jmax"	)->asGrid();		//bulk cohesion
+
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double a, b, c, d, e, f, g, j, l;
+			double cmin, dmin, emin, fmin, jmin;
+			double cmax, dmax, emax, fmax, jmax;
+			double cc, dd, ee, ff, jj;
+			int cperc, dperc, eperc, fperc, jperc;
+			int rand_int, k, n;
+
+			a		=	pA->asDouble(x, y);
+			b		=	pB->asDouble(x, y);						//Abfrage ob Raster oder Globalwerte:
+			cmin	=	pCmin ? pCmin->asDouble(x, y) : fCmin;
+			dmin	=	pDmin ? pDmin->asDouble(x, y) : fDmin;
+			emin	=	pEmin ? pEmin->asDouble(x, y) : fEmin;
+			fmin	=	pFmin ? pFmin->asDouble(x, y) : fFmin;
+			jmin	=	pJmin ? pJmin->asDouble(x, y) : fJmin;
+			cmax	=	pCmax ? pCmax->asDouble(x, y) : fCmax;
+			dmax	=	pDmax ? pDmax->asDouble(x, y) : fDmax;
+			emax	=	pEmax ? pEmax->asDouble(x, y) : fEmax;
+			fmax	=	pFmax ? pFmax->asDouble(x, y) : fFmax;
+			jmax	=	pJmax ? pJmax->asDouble(x, y) : fJmax;
+			k		=	fK;
+
+			if (pA->is_NoData(x, y) || pB->is_NoData(x, y))
+			{
+				pG->Set_NoData(x, y);
+
+				if (pH)
+
+					pH->Set_Value(x, y, CR_NODATA);
+			}
+
+			else if ((pCmin || pCmax || pDmin || pDmax || pEmin || pEmax || pFmin || pFmax || pJmin || pJmax) &&
+				(pCmin && pCmax->is_NoData(x, y) || pDmin && pDmax->is_NoData(x, y) || pEmin && pEmax->is_NoData(x, y) ||
+				pFmin && pFmax->is_NoData(x, y) || pJmin && pJmax->is_NoData(x, y)))
+			{
+				pG->Set_NoData(x, y);
+
+				if (pH)
+
+					pH->Set_Value(x, y, CR_NODATA);
+			}
+
+			else
+			{
+
+				cperc = ((cmax - cmin) / cmax) * 100;				//calculate parameter range %: density
+				if (cperc > 0)
+				{
+					n = 0;
+					cc = 0;
+					while ( n < k)									//loop through specified random number iterations:
+					{
+						rand_int = rand() % cperc + 0;				//calculate random percentage
+						c = ((cmax/100) * rand_int) + cmin;			//calculate value
+						cc = cc + c;								//sum
+						n = n + 1;
+					}
+					c = cc / n;										// calculate mean from random values
+				}
+				else 
+				{
+					c = cmax;
+				}
+
+				dperc = ((dmax - dmin) / dmax) * 100;
+				if (dperc > 0)
+				{
+					n = 0;
+					dd = 0;
+					while ( n < k) 
+					{
+						rand_int = rand() % dperc + 0;
+						d = ((dmax/100) * rand_int) + dmin;
+						dd = dd + d;
+						n = n + 1;
+					}
+					d = dd / n;
+				}
+				else 
+				{
+					d = dmax;
+				}
+
+				eperc = ((emax - emin) / emax) * 100;
+				if (eperc > 0)
+				{
+					n = 0;
+					ee = 0;
+					while ( n < k) 
+					{
+						rand_int = rand() % eperc + 0;
+						e = ((emax/100) * rand_int) + emin;
+						ee = ee + e;
+						n = n + 1;
+					}
+					e = ee / n;
+				}
+				else 
+				{
+					e = emax;
+				}
+
+				fperc = ((fmax - fmin) / fmax) * 100;
+				if (fperc > 0)
+				{
+					n = 0;
+					ff = 0;
+					while ( n < k) 
+					{
+						rand_int = rand() % fperc + 0;
+						f = ((fmax/100) * rand_int) + fmin;
+						ff = ff + f;
+						n = n + 1;
+					}
+					f = ff / n;
+				}
+				else 
+				{
+					f = fmax;
+				}
+
+				jperc = ((jmax - jmin) / jmax) * 100;
+				if (jperc > 0)
+				{
+					n = 0;
+					jj = 0;
+					while ( n < k) 
+					{
+						rand_int = rand() % jperc + 0;
+						j = ((jmax/100) * rand_int) + jmin;
+						jj = jj + j;
+						n = n + 1;
+					}
+					j = jj / n;
+				}
+				else 
+				{
+					j = jmax;
+				}
+				
+					
+				l = j/((e/cos(a))*c*grav);											//calculate dimensionless cohesion 
+
+				//g	=	((((sin(a) * (d*24*e)) * c)/(b/pB->Get_Cellsize())) * (1-(tan(a)/tan(f/57.2958)))) *1000;								//cohesionless SHALSTAB calculation
+				g	=	((((sin(a) * (d*24*e)) * c)/(b/pB->Get_Cellsize())) * (1-((sin(a) - l)/(cos(a)*tan(f/57.2958))))) *1000;				//SHALSTAB calculation
+		
+			
+				//if ((tan(a) > (tan(f/57.2958) * (1-(1/c)))))							//general stability criterion
+				if (tan(a) > ((tan(f/57.2958) * (1-(1/c)))+(j/cos(a))))							
+				{
+					if (g > 0)															//critical recharge							
+						pG->Set_Value(x, y, g);
+					else
+						pG->Set_Value(x, y, 0);											//unconditionally unstable = 0
+				}
+
+				//else if (tan(a) <= (tan(f/57.2958) * (1-(1/c))))
+				else if (tan(a) <= ((tan(f/57.2958) * (1-(1/c)))+(l/cos(a))))
+				{
+					pG->Set_NoData(x, y);													//unconditionally stable = nodata
+				}
+
+				if (pH)																	//calculate optional classified grid
+				{
+				
+					//if ((tan(a) > (tan(f/57.2958) * (1-(1/c)))))
+					if (tan(a) > ((tan(f/57.2958) * (1-(1/c)))+(l/cos(a))))
+					{
+						if (g <= 0)
+							pH->Set_Value(x, y, CR_UNSTABLE);
+						else if ((g > 0) && (g <= 50))
+							pH->Set_Value(x, y, CR_0_TO_50);
+						else if ((g > 50) && (g <= 100))
+							pH->Set_Value(x, y, CR_50_TO_100);
+						else if ((g > 100) && (g <= 200))
+							pH->Set_Value(x, y, CR_100_TO_200);
+						else if ((g > 200) && (g <= 400))
+							pH->Set_Value(x, y, CR_200_TO_400);
+						else if (g > 400)
+							pH->Set_Value(x, y, CR_GR_400);
+					}
+
+					//else if (tan(a) <= (tan(f/57.2958) * (1-(1/c))))
+					else if (tan(a) <= ((tan(f/57.2958) * (1-(1/c)))+(l/cos(a))))
+					{
+						pH->Set_Value(x, y, CR_STABLE);
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pH, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int CR_Colors[CR_COUNT]	=
+		{
+			SG_GET_RGB(255, 255, 255),  // CR_NODATA
+			SG_GET_RGB(255,   0,   0),	// CR_UNSTAB
+			SG_GET_RGB(255,	128,  64),	// CR_0-50
+			SG_GET_RGB(255, 255,   0),	// CR_50-100
+			SG_GET_RGB(  0, 255,   0),	// CR_100-200
+			SG_GET_RGB(128, 255, 255),	// CR_200-400
+			SG_GET_RGB(  0,   0, 255),	// CR_>400
+			SG_GET_RGB(128, 128, 128),  // CR_STABLE
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		Name	+= _TL("No data");				Desc	+= _TL("");
+		Name	+= _TL("Uncond. unstable");		Desc	+= _TL("");
+		Name	+= _TL("0-50 mm/day");			Desc	+= _TL("");
+		Name	+= _TL("50-100 mm/day");		Desc	+= _TL("");
+		Name	+= _TL("100-200 mm/day");		Desc	+= _TL("");
+		Name	+= _TL("200-400 mm/day");		Desc	+= _TL("");
+		Name	+= _TL(">400 mm/day");			Desc	+= _TL("");
+		Name	+= _TL("Uncond. stable");		Desc	+= _TL("");
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<CR_COUNT; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, CR_Colors[i]);
+			pRecord->Set_Value(1, Name[i].c_str());
+			pRecord->Set_Value(2, Desc[i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);				// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pH, P);
+	}
+
+	return( true );
+
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h
new file mode 100644
index 0000000..a59aa2c
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h
@@ -0,0 +1,96 @@
+/**********************************************************
+ * Version $Id: SHALSTAB_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     SHALSTAB_01.h                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany								 //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CSHALSTAB : public CSG_Module_Grid
+{
+public:
+	CSHALSTAB(void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp
new file mode 100644
index 0000000..d16e268
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp
@@ -0,0 +1,462 @@
+/**********************************************************
+ * Version $Id: Safetyfactor_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  Safetyfactor_01.cpp                  //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "Safetyfactor_01.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSafetyfactor::CSafetyfactor(void)
+{
+	Set_Name		(_TL("SAFETYFACTOR"));
+
+	Set_Author		(SG_T("A. Günther (c) 2012"));
+
+	Set_Description	(_TW(
+		"This module computes a slope stability (expressed as a factor-of-safety) raster according to the traditional infinite slope model theory (see cf Selby, 1993) "
+		"The resulting raster represents the ratio of resisting forces/driving forces (fs) on a potential shear plane with fs lesser 1 unstable, fs greater 1 stable. "
+		"Except for a slope raster (in radians), all input variables can be specified either globally or distributed (through grids). "
+		"The module creates a continuous fs raster (values above 10 are truncated), and a binary stability grid with nodata = stable, 1 = unstable (optional)."
+	));
+
+	Parameters.Add_Grid(
+		NULL, "A", "Slope grid (rad)", "A slope angle grid (in rad�ans)", PARAMETER_INPUT
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Bmin", "Min thickness grid (m) ", "A grid representing minimum cell layer thicknesses to potential shear plane (in meters)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Bmax", "Max thickness grid (m) ", "A grid representing maximum cell layer thicknesses to potential shear plane (in meters)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Cmin", "Min saturation grid (-) ", "A grid representing minimum cell relative water saturation of layer (dimensionless)", PARAMETER_INPUT_OPTIONAL
+		);	
+
+	Parameters.Add_Grid(
+		NULL, "Cmax", "Max saturation grid (-) ", "A grid representing maximum cell relative water saturation of layer (dimensionless)", PARAMETER_INPUT_OPTIONAL
+		);	
+
+	Parameters.Add_Grid(
+		NULL, "Dmin", "Min friction grid (degree) ", "A grid representing minimum cell frictional shear strength of layer (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Dmax", "Max friction grid (degree) ", "A grid representing maximum cell frictional shear strength of layer (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Emin", "Min density grid (g/cm3)", "A grid representing minimum cell bulk density of layer (in grams per cubiccentimeters)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Emax", "Max density grid (g/cm3)", "A grid representing maximum cell bulk density of layer (in grams per cubiccentimeters)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Fmin", "Min cohesion grid (MPa) ", "A grid representing minimum cell layer cohesion (in Megapascals)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Fmax", "Max cohesion grid (MPa) ", "A grid representing maximum cell layer cohesion (in Megapascals)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Value(
+		NULL, "fBmin", "Min global thickness (m)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.0			//Initialisierung eines fixen wertes vs Grid f�r M�chtigkeit
+		);
+
+	Parameters.Add_Value(
+		NULL, "fBmax", "Max global thickness (m)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.0			//Initialisierung eines fixen wertes vs Grid f�r M�chtigkeit
+		);
+
+	Parameters.Add_Value(
+		NULL, "fCmin", "Min global saturation (-)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0.0			//Initialisierung eines fixen wertes vs Grid f�r wetness
+		);
+
+	Parameters.Add_Value(
+		NULL, "fCmax", "Max global saturation (-)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0.0			//Initialisierung eines fixen wertes vs Grid f�r wetness
+		);
+
+	Parameters.Add_Value(
+		NULL, "fDmin", "Min global friction (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 33.0			//Initialisierung eines fixen wertes vs Grid f�r friction
+		);
+
+	Parameters.Add_Value(
+		NULL, "fDmax", "Max global friction (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 33.0			//Initialisierung eines fixen wertes vs Grid f�r friction
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmin", "Min global density (g/cm3)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.6			//Initialisierung eines fixen wertes vs Grid f�r density
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmax", "Max global density (g/cm3)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.6			//Initialisierung eines fixen wertes vs Grid f�r density
+		);
+
+	Parameters.Add_Value(
+		NULL, "fFmin", "Min global cohesion (MPa)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0.0			//Initialisierung eines fixen wertes vs Grid f�r Cohesion
+		);
+
+	Parameters.Add_Value(
+		NULL, "fFmax", "Max global cohesion (MPa)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0.0			//Initialisierung eines fixen wertes vs Grid f�r Cohesion
+		);
+
+	Parameters.Add_Value(
+		NULL, "fI", "Parameter sampling runs", "Number of sampling cycles",PARAMETER_TYPE_Int, 1						//sampling cycles
+		);
+
+	Parameters.Add_Grid(
+		NULL, "G", "FS values", "Resulting factor-of-safety (-) grid", PARAMETER_OUTPUT
+		);
+
+	Parameters.Add_Grid(
+		NULL, "H", "FS classes", "Resulting stability (0/1) grid", PARAMETER_OUTPUT_OPTIONAL
+		);
+		
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+enum
+{
+	FS_NODATA		= 0,
+	FS_UNSTABLE,
+	FS_STAB1,
+	FS_STAB2,
+	FS_STAB3,
+	FS_STAB4,
+	FS_COUNT
+};
+
+
+bool CSafetyfactor::On_Execute(void)
+{
+	double		fBmin	= Parameters("fBmin")->asDouble();
+	double		fCmin	= Parameters("fCmin")->asDouble();
+	double		fDmin	= Parameters("fDmin")->asDouble();
+	double		fEmin	= Parameters("fEmin")->asDouble();
+	double		fFmin	= Parameters("fFmin")->asDouble();
+	double		fBmax	= Parameters("fBmax")->asDouble();
+	double		fCmax	= Parameters("fCmax")->asDouble();
+	double		fDmax	= Parameters("fDmax")->asDouble();
+	double		fEmax	= Parameters("fEmax")->asDouble();
+	double		fFmax	= Parameters("fFmax")->asDouble();
+
+	double		grav	= 9.81;
+	int			fI		= Parameters("fI")->asInt();
+	
+	CSG_Grid	*pA, *pBmin, *pCmin, *pDmin, *pEmin, *pFmin, *pBmax, *pCmax, *pDmax, *pEmax, *pFmax, *pG, *pH;
+
+	pA		= Parameters("A"	)->asGrid();		//slope
+	pBmin	= Parameters("Bmin"	)->asGrid();		//thickness
+	pCmin	= Parameters("Cmin"	)->asGrid();		//saturation
+	pDmin	= Parameters("Dmin"	)->asGrid();		//friction
+	pEmin	= Parameters("Emin"	)->asGrid();		//density
+	pFmin	= Parameters("Fmin"	)->asGrid();		//cohesion
+	pBmax	= Parameters("Bmax"	)->asGrid();
+	pCmax	= Parameters("Cmax"	)->asGrid();		//saturation
+	pDmax	= Parameters("Dmax"	)->asGrid();		//friction
+	pEmax	= Parameters("Emax"	)->asGrid();		//density
+	pFmax	= Parameters("Fmax"	)->asGrid();		//cohesion
+	pG		= Parameters("G"	)->asGrid();
+	pH		= Parameters("H"	)->asGrid();
+
+
+	
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double a, b, c, d, e, f, g;
+			double bmin, cmin, dmin, emin, fmin;
+			double bmax, cmax, dmax, emax, fmax;
+			double bb, cc, dd, ee, ff;
+			int bperc, cperc, dperc, eperc, fperc;
+			int rand_int, h, n;
+
+			a		=	pA->asDouble(x, y);
+			bmin	=	pBmin ? pBmin->asDouble(x, y) : fBmin;						//Abfrage ob Raster oder Globalwerte
+			cmin	=	pCmin ? pCmin->asDouble(x, y) : fCmin;
+			dmin	=	pDmin ? pDmin->asDouble(x, y) : fDmin;
+			emin	=	pEmin ? pEmin->asDouble(x, y) : fEmin;
+			fmin	=	pFmin ? pFmin->asDouble(x, y) : fFmin;
+			bmax	=	pBmax ? pBmax->asDouble(x, y) : fBmax;						//Abfrage ob Raster oder Globalwerte
+			cmax	=	pCmax ? pCmax->asDouble(x, y) : fCmax;
+			dmax	=	pDmax ? pDmax->asDouble(x, y) : fDmax;
+			emax	=	pEmax ? pEmax->asDouble(x, y) : fEmax;
+			fmax	=	pFmax ? pFmax->asDouble(x, y) : fFmax;
+			h		=	fI;
+
+			if (pA->is_NoData(x, y))
+			{
+				pG->Set_NoData(x, y);
+
+				if (pH)
+					pH->Set_Value(x, y, FS_NODATA);
+			}
+
+			else if( (pBmin || pBmax || pCmin || pCmax || pDmin || pDmax || pEmin || pEmax || pFmin || pFmax)
+			&&	(  pBmin && pBmax->is_NoData(x, y)
+				|| pCmin && pCmax->is_NoData(x, y)
+				|| pDmin && pDmax->is_NoData(x, y)
+				|| pEmin && pEmax->is_NoData(x, y)
+				|| pFmin && pFmax->is_NoData(x, y) ))
+			{
+				pG->Set_NoData(x, y);
+
+				if (pH)
+					pH->Set_Value(x, y, FS_NODATA);
+			}
+
+			else
+			{
+				bperc = ((bmax - bmin) / bmax) * 100;				//calculate parameter range %: density
+				if (bperc > 0)
+				{
+					n = 0;
+					bb = 0;
+					while ( n < h)									//loop through specified random number iterations:
+					{
+						rand_int = rand() % bperc + 0;				//calculate random percentage
+						b = ((bmax/100) * rand_int) + bmin;			//calculate value
+						bb = bb + b;								//sum
+						n = n + 1;
+					}
+					b = bb / n;										// calculate mean from random values
+				}
+				else 
+				{
+					b = bmax;
+				}
+
+
+				cperc = ((cmax - cmin) / cmax) * 100;				//calculate parameter range %: density
+				if (cperc > 0)
+				{
+					n = 0;
+					cc = 0;
+					while ( n < h)									//loop through specified random number iterations:
+					{
+						rand_int = rand() % cperc + 0;				//calculate random percentage
+						c = ((cmax/100) * rand_int) + cmin;			//calculate value
+						cc = cc + c;								//sum
+						n = n + 1;
+					}
+					c = cc / n;										// calculate mean from random values
+				}
+				else 
+				{
+					c = cmax;
+				}
+
+				dperc = ((dmax - dmin) / dmax) * 100;
+				if (dperc > 0)
+				{
+					n = 0;
+					dd = 0;
+					while ( n < h) 
+					{
+						rand_int = rand() % dperc + 0;
+						d = ((dmax/100) * rand_int) + dmin;
+						dd = dd + d;
+						n = n + 1;
+					}
+					d = dd / n;
+				}
+				else 
+				{
+					d = dmax;
+				}
+
+				eperc = ((emax - emin) / emax) * 100;
+				if (eperc > 0)
+				{
+					n = 0;
+					ee = 0;
+					while ( n < h) 
+					{
+						rand_int = rand() % eperc + 0;
+						e = ((emax/100) * rand_int) + emin;
+						ee = ee + e;
+						n = n + 1;
+					}
+					e = ee / n;
+				}
+				else 
+				{
+					e = emax;
+				}
+
+				fperc = ((fmax - fmin) / fmax) * 100;
+				if (fperc > 0)
+				{
+					n = 0;
+					ff = 0;
+					while ( n < h) 
+					{
+						rand_int = rand() % fperc + 0;
+						f = ((fmax/100) * rand_int) + fmin;
+						ff = ff + f;
+						n = n + 1;
+					}
+					f = ff / n;
+				}
+				else 
+				{
+					f = fmax;
+				}
+
+				g	=	((f * 1000) + (((e * grav) - (c * grav)) *				//FS calculation
+						(((b * pow(cos(a), 2) * tan(d/57.2958)))))) / 
+						((e * grav) * b * sin(a) * cos(a));
+
+				if (g < 10)														//truncate values fs>10
+					pG->Set_Value(x, y, g);
+				else
+					pG->Set_Value(x, y, 10);
+
+				if (pH)			//create optional binary stabilty grid
+				{
+					if (g < 1)
+						pH->Set_Value(x, y, FS_UNSTABLE);
+					else if ((g >= 1) && (g < 1.5))
+						pH->Set_Value(x, y, FS_STAB1);
+					else if ((g >= 1.5) && (g < 3))
+						pH->Set_Value(x, y, FS_STAB2);
+					else if ((g >= 3) && (g < 6))
+						pH->Set_Value(x, y, FS_STAB3);
+					else if (g >= 6)
+						pH->Set_Value(x, y, FS_STAB4);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pH, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int TO_Colors[FS_COUNT]	=
+		{
+			SG_GET_RGB(255, 255, 255),	// FS_NODATA
+			SG_GET_RGB(255,	  0,   0),	// FS_UNSTABLE
+			SG_GET_RGB(255,	128,  64),	// FS_STAB1
+			SG_GET_RGB(255,	255,   0),	// FS_STAB2
+			SG_GET_RGB(  0,	128, 255),	// FS_STAB3
+			SG_GET_RGB(  0,	255,   0),	// FS_STAB4
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		Name	+= _TL("NO DATA");			Desc	+= _TL("");
+		Name	+= _TL("FS <1");			Desc	+= _TL("");
+		Name	+= _TL("FS 1-1.5");			Desc	+= _TL("");
+		Name	+= _TL("FS 1.5-3");			Desc	+= _TL("");
+		Name	+= _TL("FS 3-6");			Desc	+= _TL("");
+		Name	+= _TL("FS >6");			Desc	+= _TL("");
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<FS_COUNT; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, TO_Colors[i]);
+			pRecord->Set_Value(1, Name[i].c_str());
+			pRecord->Set_Value(2, Desc[i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pH, P);
+	}
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h
new file mode 100644
index 0000000..af877c2
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h
@@ -0,0 +1,96 @@
+/**********************************************************
+ * Version $Id: Safetyfactor_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   Safetyfactor_01.h                   //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany								 //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CSafetyfactor : public CSG_Module_Grid
+{
+public:
+	CSafetyfactor(void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp
new file mode 100644
index 0000000..a8f3bc1
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp
@@ -0,0 +1,290 @@
+/**********************************************************
+ * Version $Id: TOBIA_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      TOBIA_01.cpp                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "TOBIA_01.h"
+#include <math.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CTOBIA::CTOBIA(void)
+{
+	Set_Name		(_TL("TOBIA"));
+
+	Set_Author		(SG_T("A. Günther (c) 2012"));
+
+	Set_Description	(_TW(
+		"\n"
+		"This module computes both a continuous and a categorical TOBIA (""Topography Bedding Intersection Angle"") Index according to Meentemeyer & Moody (2000) "
+		"For computation, a slope and a aspect raster (both in radians) determining slope face orientations are required. "
+		"The categorical TOBIA classifies the alignement of a geological structure to Topography into seven classes:\n"
+		"0) Underdip slope\n"
+		"1) Dip slope\n"
+		"2) Overdip slope\n"
+		"3) Steepened escarpmemt\n"
+		"4) Normal escarpment\n"
+		"5) Subdued escarpment\n"
+		"6) Orthoclinal slope\n"
+		"The continuous TOBIA index ranges from -1 to 1 (parallel orientation)\n" 
+		"The structure TOBIA should be calculated with can be set either distributed (through dip direction and dip grids, in degrees!), "
+		"or globally using integers (dip and dip direction, in degrees!). The module creates a TOBIA class integer grid, and (optionally) a continuous TOBIA index grid.\n"
+		"\n"
+		"Reference: "
+		"<a href=\"http://www.sciencedirect.com/science/article/pii/S009830040000011X\">Meentemeyer R. K., Moody A. (2000). Automated mapping of conformity between topographic and geological surfaces. Computers & Geosciences, 26, 815 - 829</a>.\n"
+
+	));
+
+	Parameters.Add_Grid(
+		NULL, "A", "Slope grid (rad)", "A slope angle grid (in rad�ans)", PARAMETER_INPUT
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "B", "Aspect grid (rad)", "A aspect angle grid (in rad�ans)", PARAMETER_INPUT
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "C", "Dip grid (degrees) ", "A grid representing the dip of the structure plane (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "D", "Dip direction grid (degrees) ", "A grid representing the dip direction of the structure plane (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Value(
+		NULL, "fB", "Global structure dip (degrees)", "Constant value if no raster set", PARAMETER_TYPE_Double, 45.0			//Initialisierung eines fixen wertes vs Grid f�r dip
+		);
+
+	Parameters.Add_Value(
+		NULL, "fC", "Global structure dip direction (degrees)", "Constant value if no raster set", PARAMETER_TYPE_Double, 90.0			//Initialisierung eines fixen wertes vs Grid f�r dipdir
+		);
+
+	Parameters.Add_Grid(
+		NULL, "E", "TOBIA classes", "Resulting TOBIA classses (1-7) grid", PARAMETER_OUTPUT
+		);
+
+	Parameters.Add_Grid(
+		NULL, "F", "TOBIA index", "Resulting TOBIA index (-) grid",PARAMETER_OUTPUT_OPTIONAL
+		);
+		
+}
+
+enum
+{
+	TO_UNDERDIP_SLOPE		= 0,
+	TO_DIP_SLOPE,
+	TO_OVERDIP_SLOPE,
+	TO_STEEPENED_ESCARPMENT,
+	TO_NORMAL_ESCARPMENT,
+	TO_SUBDUED_ESCARPMENT,
+	TO_ORTHOCLINAL_SLOPE,
+	TO_COUNT
+};
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTOBIA::On_Execute(void)
+{
+	double		fB	= Parameters("fB")->asDouble();
+	double		fC	= Parameters("fC")->asDouble();
+	
+	CSG_Grid	*pA, *pB, *pC, *pD, *pE, *pF;
+
+	pA	= Parameters("A"	)->asGrid();		//slope
+	pB	= Parameters("B"	)->asGrid();		//aspect
+	pC	= Parameters("C"	)->asGrid();		//dip grid
+	pD	= Parameters("D"	)->asGrid();		//dip dir grid
+	pE	= Parameters("E"	)->asGrid();		//output TOBIA classes
+	pF	= Parameters("F"	)->asGrid();		//output TOBIA index
+	
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double a, b, c, d, e, f;
+		
+			a	=	pA->asDouble(x, y);
+			b	=	pB->asDouble(x, y);						//Abfrage ob Raster oder Globalwerte
+			c	=	pC ? pC->asDouble(x, y) : fB;
+			d	=	pC ? pD->asDouble(x, y) : fC;
+
+			if (pA->is_NoData(x, y))
+			{
+				pE->Set_NoData(x, y);
+
+				if (pF)
+					pF->Set_NoData(x, y);
+
+			}
+
+			else if ((pC || pD) && (pC->is_NoData(x, y) || (pD->is_NoData(x, y))))
+			{
+				pE->Set_NoData(x, y);
+
+				if (pF)
+					pF->Set_NoData(x, y);
+
+			}
+
+			else
+			{
+
+				e	=	pow(pow((cos(d/57.2958) - cos(b)), 2) + pow((sin(d/57.2958) - sin(b)), 2), 0.5);												//TOBIA-classes
+		
+				if (((0 <= e) && (e < 0.7654)) && ((c - (a*57.2958)) > 5))
+					pE->Set_Value(x, y, TO_UNDERDIP_SLOPE);
+				else if (((0 <= e) && (e < 0.7654)) && ((-5 <= (c - (a*57.2958))) && ((c - (a*57.2958) <= 5))))
+					pE->Set_Value(x, y, TO_DIP_SLOPE);
+				else if (((0 <= e) && (e < 0.7654)) && ((c - (a*57.2958)) < -5))
+					pE->Set_Value(x, y, TO_OVERDIP_SLOPE);
+				else if (((1.8478 < e) && (e <= 2)) && ((c - (a*57.2958)) < -5))
+					pE->Set_Value(x, y, TO_STEEPENED_ESCARPMENT);
+				else if (((1.8478 < e) && (e <= 2)) && ((-5 <= (c - (a*57.2958))) && ((c - (a*57.2958) <= 5))))
+					pE->Set_Value(x, y, TO_NORMAL_ESCARPMENT);
+				else if (((1.8478 < e) && (e <= 2)) && ((c - (a*57.2958)) > 5))
+					pE->Set_Value(x, y, TO_SUBDUED_ESCARPMENT);
+				else if ((0.7654 < e) && (e <= 1.8478))
+					pE->Set_Value(x, y, TO_ORTHOCLINAL_SLOPE);
+				else
+					pE->Set_NoData_Value(0);
+
+				if (pF)
+				{
+					f	=	(cos((c/57.2958)) * (cos(a))) + (sin(c/57.2958) * sin(a) * ((cos((d/57.2958) - b))));				//TOBIA-index
+					pF->Set_Value(x, y, f);
+				}
+
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pE, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int TO_Colors[TO_COUNT]	=
+		{
+			SG_GET_RGB(255, 255,   0),	// TO_UNDERDIP
+			SG_GET_RGB(255,	128,   0),	// TO_DIP
+			SG_GET_RGB(255,   0,   0),	// TO_OVERDIP
+			SG_GET_RGB(  0,   0, 128),	// TO_STEEPENED
+			SG_GET_RGB(  0, 128, 255),	// TO_NORMAL
+			SG_GET_RGB(128, 255, 255),	// TO_SUBDUED
+			SG_GET_RGB(  0, 255,  64),  // TO_ORTHOCLINAL
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		Name	+= _TL("Underdip slope");			Desc	+= _TL("");
+		Name	+= _TL("Dip slope");				Desc	+= _TL("");
+		Name	+= _TL("Overdip slope");			Desc	+= _TL("");
+		Name	+= _TL("Steepened escarpment");		Desc	+= _TL("");
+		Name	+= _TL("Normal escarpment");		Desc	+= _TL("");
+		Name	+= _TL("Subdued escarpment");		Desc	+= _TL("");
+		Name	+= _TL("Orthoclinal slope");		Desc	+= _TL("");
+		
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<TO_COUNT; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, TO_Colors[i]);
+			pRecord->Set_Value(1, Name[i].c_str());
+			pRecord->Set_Value(2, Desc[i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pE, P);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h
new file mode 100644
index 0000000..c80a095
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h
@@ -0,0 +1,96 @@
+/**********************************************************
+ * Version $Id: TOBIA_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      TOBIA_01.h                       //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany								 //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CTOBIA : public CSG_Module_Grid
+{
+public:
+	CTOBIA(void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp
new file mode 100644
index 0000000..4b3f518
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp
@@ -0,0 +1,329 @@
+/**********************************************************
+ * Version $Id: WEDGEFAIL_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    WEDGEFAIL_01.cpp                   //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "WEDGEFAIL_01.h"
+#include <math.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWEDGEFAIL::CWEDGEFAIL(void)
+{
+	CSG_Parameters	P;
+
+	//-----------------------------------------------------
+	
+	Set_Name		(_TL("WEDGEFAIL"));
+
+	Set_Author		(SG_T("A. Günther (c) 2012"));
+
+	Set_Description	(_TW(
+		"\n"
+		"This module determines terrain elements where failure (slide- or topple movements) on geological discontinuies are kinematically possible "
+		"through the spatial application of common frictional feasibility criteria (Günther et al. 2012 and references therein). Both the orientation of slope elements "
+		"specified through aspect- and dip grids (in radians) are required together with the orientation of one planar structure defined through global- or grid dip direction and dip data, "
+		"or two planar structures defined by plunge direction and plunge information of their intersection line (in degrees). The shear strength of the discontinuities is specified "
+		"using global or grid-based friction angle data. Optionally, a cone value can be set allowing for some variance in discontinuity dip orientations. "
+		"The tool operates in slide (testing for plane and wedge sliding) or topple (testing for plane and wedge toppling) modes.\n"
+		"\n"
+		"Reference:\n"
+		"<a href=\"http://link.springer.com/article/10.1007/s11069-011-9771-2.\">Günther A., Wienhöfer J., Konietzky H. (2012) Automated mapping of rock slope geometry, kinematics and stability with RSS-GIS. Natural Hazards, 61, 29-49.</a>.\n"
+
+	));
+
+	Parameters.Add_Grid(
+		NULL, "DEM", "DEM", "A DEM", PARAMETER_INPUT
+		);
+	
+	/*Parameters.Add_Grid(
+		NULL, "B", "Aspect grid (rad)", "A aspect angle grid (in radians)", PARAMETER_INPUT
+		);*/
+	
+	Parameters.Add_Grid(
+		NULL, "C", "Dip/Plunge direction grid (degree) ", "A dip- or plunge direction grid (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "D", "Dip/Plunge grid (degree) ", "A dip- or plunge grid (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "Emin", "Min friction angle grid (degree) ", "A minimum discontinuity friction angle grid (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Emax", "Max friction angle grid (degree) ", "A maximum discontinuity friction angle grid (in degrees)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Value(
+		NULL, "fC", "Global dip/plunge direction (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0					//Initialisierung eines fixen wertes vs Grid f�r density
+		);
+
+	Parameters.Add_Value(
+		NULL, "fD", "Global dip/plunge (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 35						//Initialisierung eines fixen wertes vs Grid f�r conductivity
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmin", "Min global friction angle (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 35							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmax", "Max global friction angle (degree)", "Constant value if no raster set", PARAMETER_TYPE_Double, 35							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);
+
+	Parameters.Add_Value(
+		NULL, "ff", "Cone radius (degree)", "Radius of optional cone variance (in degrees)", PARAMETER_TYPE_Int, 0							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "F", "Failures", "Resulting failure cells (-) grid", PARAMETER_OUTPUT
+		);
+
+	Parameters.Add_Value(
+		NULL, "fI", "Parameter sampling runs", "Number of sampling cycles",PARAMETER_TYPE_Int, 1						//sampling cycles
+		);
+
+	Parameters.Add_Choice(
+		NULL, "METHOD"	, "Mode",
+		"Set failure mode",
+		"Slide|Topple"
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	FI_NODATA			= 0,
+	FI_FAILURE,
+	FI_NO_FAILURE,
+	FI_COUNT
+};
+
+bool CWEDGEFAIL::On_Execute(void)
+{
+	int			Method	= Parameters("METHOD"	)->asInt();
+	int			ff		= Parameters("ff"		)->asInt();
+	double		fC		= Parameters("fC"		)->asDouble();
+	double		fD		= Parameters("fD"		)->asDouble();
+	double		fEmin	= Parameters("fEmin"	)->asDouble();
+	double		fEmax	= Parameters("fEmax"	)->asDouble();
+	int			fI		= Parameters("fI"		)->asInt();
+
+	CSG_Grid	*pDEM, *pC, *pD, *pEmin, *pEmax, *pF;
+
+	pDEM			= Parameters("DEM"		)->asGrid();		//DEM
+	//pB			= Parameters("B"		)->asGrid();		//aspect
+	pC			= Parameters("C"		)->asGrid();		//dip dir
+	pD			= Parameters("D"		)->asGrid();		//dip
+	pEmin		= Parameters("Emin"		)->asGrid();		//friction
+	pEmax		= Parameters("Emax"		)->asGrid();		//friction
+	pF			= Parameters("F"		)->asGrid();		//output failure
+	
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double a, b, c, d, e, f, g;
+			double emin, emax;
+			int rand_int, eperc, h, n, ee;
+	
+			//a		=	pA->asDouble(x, y);
+			//b		=	pB->asDouble(x, y);						//Abfrage ob Raster oder Globalwerte:
+			c		=	pC ? pC->asDouble(x, y) : fC;
+			d		=	pD ? pD->asDouble(x, y) : fD;
+			emin	=	pEmin ? pEmin->asDouble(x, y) : fEmin;
+			emax	=	pEmax ? pEmax->asDouble(x, y) : fEmax;
+			h		=	fI;
+
+			if (pDEM->Get_Gradient(x, y, a, b)==false)
+			{
+				pF->Set_Value(x, y, FI_NODATA);
+			}
+
+			else if ((pC || pD) && (pC->is_NoData(x, y) || pD->is_NoData(x, y)))
+			{
+				pF->Set_Value(x, y, FI_NODATA);
+			}
+
+			else
+			{
+				eperc = (int)(((emax - emin) / emax) * 100.0);
+				if (eperc > 0)
+				{
+					n = 0;
+					ee = 0;
+					while ( n < h) 
+					{
+						rand_int = rand() % eperc + 0;
+						e = ((emax/100) * rand_int) + emin;
+						ee = ee + e;
+						n = n + 1;
+					}
+					e = ee / n;
+				}
+				else 
+				{
+					e = emax;
+				}
+
+
+				if ((b*M_RAD_TO_DEG) >= c)												//Azimuthaldifferenz in grad
+					f	=	(b*M_RAD_TO_DEG) - c;
+				else if ((b*M_RAD_TO_DEG) < c)
+					f  =	c - (b*M_RAD_TO_DEG);
+				else
+					f = 0;
+
+				g = atan((cos(f/M_RAD_TO_DEG)) * tan(a+(ff/M_RAD_TO_DEG))) * M_RAD_TO_DEG;			//Berechung apparent slope dip in direction plane/cedge
+
+				switch (Method)
+				{
+
+				case 0:				//wedge/plane slides
+
+					if ((e <= d) && (d <= g))												
+						pF->Set_Value(x, y, FI_FAILURE);
+					else
+						pF->Set_Value(x, y, FI_NO_FAILURE);
+					break;
+
+				case 1:				//wedge/plane topples
+
+					if (g >= ((e+90)-d))												
+						pF->Set_Value(x, y, FI_FAILURE);
+					else
+						pF->Set_Value(x, y, FI_NO_FAILURE);
+					break;
+
+				}
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pF, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int CR_Colors[FI_COUNT]	=
+		{
+			SG_GET_RGB(255, 255, 255),	// FI_NO_DATA
+			SG_GET_RGB(255,   0,   0),	// FI_FAILURE
+			SG_GET_RGB(255,	255, 128),	// FI_NO_FAILURE
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		
+		Name	+= _TL("No Data");			Desc	+= _TL("");
+		Name	+= _TL("Failure");			Desc	+= _TL("");
+		Name	+= _TL("No Failure");		Desc	+= _TL("");
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<FI_COUNT; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, CR_Colors[i]);
+			pRecord->Set_Value(1, Name[i].c_str());
+			pRecord->Set_Value(2, Desc[i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pF, P);
+	}
+
+	return( true );
+
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h
new file mode 100644
index 0000000..cfc7942
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h
@@ -0,0 +1,96 @@
+/**********************************************************
+ * Version $Id: WEDGEFAIL_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    WEDGEFAIL_01.h                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany								 //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CWEDGEFAIL : public CSG_Module_Grid
+{
+public:
+	CWEDGEFAIL(void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp
new file mode 100644
index 0000000..93d1b05
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp
@@ -0,0 +1,449 @@
+/**********************************************************
+ * Version $Id: WETNESS_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    WETNESS_01.cpp                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "WETNESS_01.h"
+#include <math.h>
+
+//---------------------------------------------------------
+#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
+	bool	bResult;\
+	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
+	if( !bResult ) return( false );\
+}
+
+#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWETNESS::CWETNESS(void)
+{
+	CSG_Parameters	P;
+
+	//-----------------------------------------------------
+	
+	Set_Name		(_TL("WETNESS"));
+
+	Set_Author		(SG_T("A. Günther (c) 2012"));
+
+	Set_Description	(_TW(
+		"\n"
+		"This module calculates a topographic wetness index (TWI) following Montgomery & Dietrich (1994) that can be used to estimate the degree of saturation of unconsolidated, permeable "
+		"materials above (more or less) impermeable bedrock. In contrast to the common TOPMODEL (Beven & Kirkby, 1979) - based TWI, this index differs in such that it considers "
+		"hydraulic conductivity to be constant in a soil mantle overlying relatively impermeable bedrock. Also, it uses the sine of the slope rather than its tangens, which is more correct "
+		"and significantly matters for steeper slopes that give raise to landslides. "
+		"For computation, a slope (in radians) and a catchment area (in m2) grid are required. "
+		"Additionally, information on groundwater recharge (m/hr), material hydraulic conductivity (m/hr), "
+		"and depth to potential shear plane (m) are required that can be specified either globally or through grids. "
+		"The module produces a continuous wetness index (-) where cells with WI values > 1 (overland flow) set to 1, and optionally creates a classified WI grid rendering three saturation classes:.\n"
+		"0): Low moisture (WI smaller 0.1)\n"
+		"1): Partially wet (0.1 smaller WI smaller 1)\n"
+		"2): Saturation zone (WI larger 1)\n"
+		"\n"
+		"References:\n"
+		"<a href=\"http://www.tandfonline.com/doi/abs/10.1080/02626667909491834\">Beven, K.J., Kirkby, M.J. (1979) A physically-based variable contributing area model of basin hydrology. Hydrology Science Bulletin, 24, 43-69.</a>.\n"
+		"\n"
+		"<a href=\"http://www.agu.org/pubs/crossref/1994/93WR02979.shtml\">Montgomery D. R., Dietrich, W. E. (1994) A physically based model for the topographic control on shallow landsliding. Water Resources Research, 30, 1153-1171.</a>.\n"
+
+	));
+
+	Parameters.Add_Grid(
+		NULL, "DEM", "DEM", "A DEM", PARAMETER_INPUT
+		);
+	
+	/*Parameters.Add_Grid(
+		NULL, "B", "Catchment area grid (m2)", "A catchment area grid (in square meters)", PARAMETER_INPUT
+		);
+	*/
+	Parameters.Add_Grid(
+		NULL, "Cmin", "Min hydraulic conductivity grid (m/hr) ", "A grid representing minimum material hydraulic conductivity (in m/hr)", PARAMETER_INPUT_OPTIONAL
+		);	
+	
+	Parameters.Add_Grid(
+		NULL, "Cmax", "Max hydraulic conductivity grid (m/hr) ", "A grid representing maximum material hydraulic conductivity (in m/hr)", PARAMETER_INPUT_OPTIONAL
+		);	
+
+	Parameters.Add_Grid(
+		NULL, "Dmin", "Min groundwater recharge grid (m/hr) ", "A grid representing minimum groundwater recharge (in m/hr)", PARAMETER_INPUT_OPTIONAL
+		);
+	
+	Parameters.Add_Grid(
+		NULL, "Dmax", "Max groundwater recharge grid (m/hr) ", "A grid representing maximum groundwater recharge (in m/hr)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Emin", "Min material depth grid (m)", "A grid representing minimum depth to potential shear plane (in m)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Grid(
+		NULL, "Emax", "Max material depth grid (m)", "A grid representing maximum depth to potential shear plane (in m)", PARAMETER_INPUT_OPTIONAL
+		);
+
+	Parameters.Add_Value(
+		NULL, "fCmin", "Min global material conductivity (m/hr)", "Constant value if no raster set", PARAMETER_TYPE_Double, 2.7					//Initialisierung eines fixen wertes vs Grid f�r density
+		);
+
+	Parameters.Add_Value(
+		NULL, "fCmax", "Max global material conductivity (m/hr)", "Constant value if no raster set", PARAMETER_TYPE_Double, 2.7					//Initialisierung eines fixen wertes vs Grid f�r density
+		);	
+	
+	Parameters.Add_Value(
+		NULL, "fDmin", "Min global groundwater recharge (m/hr)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0.001						//Initialisierung eines fixen wertes vs Grid f�r conductivity
+		);
+
+	Parameters.Add_Value(
+		NULL, "fDmax", "Max global groundwater recharge (m/hr)", "Constant value if no raster set", PARAMETER_TYPE_Double, 0.001						//Initialisierung eines fixen wertes vs Grid f�r conductivity
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmin", "Min global material depth (m)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.0							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);
+
+	Parameters.Add_Value(
+		NULL, "fEmax", "Max global material depth (m)", "Constant value if no raster set", PARAMETER_TYPE_Double, 1.0							//Initialisierung eines fixen wertes vs Grid f�r depth
+		);
+
+	Parameters.Add_Value(
+		NULL, "fH", "Parameter sampling runs", "Number of sampling cycles",PARAMETER_TYPE_Int, 1						//sampling cycles
+		);
+
+	Parameters.Add_Grid(
+		NULL, "F", "WI values", "Resulting wetness index (-) grid", PARAMETER_OUTPUT
+		);
+
+	Parameters.Add_Grid(
+		NULL, "G", "WI classes", "Classified wetness (-) grid", PARAMETER_OUTPUT_OPTIONAL
+		);
+
+	Parameters.Add_Choice(
+		NULL	, "Method"		, _TL("Catchment Area Calculation"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
+			_TL("Deterministic 8"),
+			_TL("Rho 8"),
+			_TL("Braunschweiger Reliefmodell"),
+			_TL("Deterministic Infinity"),
+			_TL("Multiple Flow Direction"),
+			_TL("Multiple Triangular Flow Directon")
+		), 4
+	);
+
+	Parameters.Add_Value(
+		NULL	, "PREPROC"		, _TL("Preprocessing"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	WI_NODATA			= 0,
+	WI_LOW_MOISTURE,
+	WI_PARTIALLY_WET,
+	WI_SATURATION_ZONE,
+	WI_COUNT
+};
+
+bool CWETNESS::On_Execute(void)
+{
+	double		fCmin	= Parameters("fCmin")->asDouble();
+	double		fDmin	= Parameters("fDmin")->asDouble();
+	double		fEmin	= Parameters("fEmin")->asDouble();
+	double		fCmax	= Parameters("fCmax")->asDouble();
+	double		fDmax	= Parameters("fDmax")->asDouble();
+	double		fEmax	= Parameters("fEmax")->asDouble();
+	double		fH		= Parameters("fH")->asInt();
+
+	CSG_Grid	*pDEM, *pB, *pCmin, *pDmin, *pEmin, *pCmax, *pDmax, *pEmax,*pF, *pG;
+
+	pDEM	= Parameters("DEM"	)->asGrid();		//DEM
+	pCmin	= Parameters("Cmin"	)->asGrid();		//conductivity
+	pDmin	= Parameters("Dmin"	)->asGrid();		//recharge
+	pEmin	= Parameters("Emin"	)->asGrid();		//depth
+	pCmax	= Parameters("Cmax"	)->asGrid();		//conductivity
+	pDmax	= Parameters("Dmax"	)->asGrid();		//recharge
+	pEmax	= Parameters("Emax"	)->asGrid();		//depth
+	pF		= Parameters("F"	)->asGrid();		//output wetness index
+	pG		= Parameters("G"	)->asGrid();		//output wetness classes
+
+	//-----------------------------------------------------
+	// get catchment area sizes
+	CSG_Grid	B(*Get_System(), SG_DATATYPE_Float);
+
+	pB	= &B;
+
+	if( Parameters("PREPROC")->asBool() )
+	{
+		CSG_Grid	DEM(*Get_System(), SG_DATATYPE_Float);
+
+		RUN_MODULE("ta_preprocessor"		, 2,
+				SET_PARAMETER("DEM"			, pDEM)
+			&&	SET_PARAMETER("DEM_PREPROC"	, &DEM)
+		)
+
+		RUN_MODULE("ta_hydrology"			, 0,
+				SET_PARAMETER("ELEVATION"	, &DEM)
+			&&	SET_PARAMETER("CAREA"		, pB)
+			&&	SET_PARAMETER("Method"		, Parameters("Method"))
+		)
+	}
+	else
+	{
+		RUN_MODULE("ta_hydrology"			, 0,
+				SET_PARAMETER("ELEVATION"	, pDEM)
+			&&	SET_PARAMETER("CAREA"		, pB)
+			&&	SET_PARAMETER("Method"		, Parameters("Method"))
+		)
+	}
+
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			double a, b, c, d, e, f;					//a slope, b catchment area
+			double cmin, dmin, emin;
+			double cmax, dmax, emax;
+			double cc, dd, ee;
+			int cperc, dperc, eperc;
+			int rand_int, h, n;
+		
+			b		=	pB->asDouble(x, y);						//Abfrage ob Raster oder Globalwerte:
+			cmin	=	pCmin ? pCmin->asDouble(x, y) : fCmin;
+			dmin	=	pDmin ? pDmin->asDouble(x, y) : fDmin;
+			emin	=	pEmin ? pEmin->asDouble(x, y) : fEmin;
+			cmax	=	pCmax ? pCmax->asDouble(x, y) : fCmax;
+			dmax	=	pDmax ? pDmax->asDouble(x, y) : fDmax;
+			emax	=	pEmax ? pEmax->asDouble(x, y) : fEmax;
+			h		=	fH;
+
+			if (pDEM->Get_Gradient(x, y, a, ee)==false
+			   || (pCmin && pCmin->is_NoData(x, y))
+			   || (pCmax && pCmax->is_NoData(x, y))
+			   || (pDmin && pDmin->is_NoData(x, y))
+			   || (pDmax && pDmax->is_NoData(x, y))
+			   || (pEmin && pEmin->is_NoData(x, y))
+			   || (pEmax && pEmax->is_NoData(x, y)) )
+			{
+				pF->Set_NoData(x, y);
+
+				if (pG)
+
+					pG->Set_Value(x, y, WI_NODATA);
+			}
+
+			else
+			{
+
+				cperc = ((cmax - cmin) / cmax) * 100;				//calculate parameter range %: conductivity
+				if (cperc > 0)
+				{
+					n = 0;
+					cc = 0;
+					while ( n < h)									//loop through specified random number iterations:
+					{
+						rand_int = rand() % cperc + 0;				//calculate random percentage
+						c = ((cmax/100) * rand_int) + cmin;			//calculate value
+						cc = cc + c;								//sum
+						n = n + 1;
+					}
+					c = cc / n;										// calculate mean from random values
+				}
+				else 
+				{
+					c = cmax;
+				}
+
+				dperc = ((dmax - dmin) / dmax) * 100;				//calculate parameter range %: recharge
+				if (dperc > 0)
+				{
+					n = 0;
+					dd = 0;
+					while ( n < h)									//loop through specified random number iterations:
+					{
+						rand_int = rand() % dperc + 0;				//calculate random percentage
+						d = ((dmax/100) * rand_int) + dmin;			//calculate value
+						dd = dd + d;								//sum
+						n = n + 1;
+					}
+					d = dd / n;										// calculate mean from random values
+				}
+				else 
+				{
+					d = dmax;
+				}
+
+				eperc = ((emax - emin) / emax) * 100;				//calculate parameter range %: depth
+				if (eperc > 0)
+				{
+					n = 0;
+					ee = 0;
+					while ( n < h)									//loop through specified random number iterations:
+					{
+						rand_int = rand() % eperc + 0;				//calculate random percentage
+						e = ((emax/100) * rand_int) + emin;			//calculate value
+						ee = ee + e;								//sum
+						n = n + 1;
+					}
+					e = ee / n;										// calculate mean from random values
+				}
+				else 
+				{
+					e = emax;
+				}
+		
+			
+				f	=	(d*(b/pB->Get_Cellsize()))/((c*e)*sin(a));		//Wetness index calculation
+		
+				if (f < 1)												//calculate wetness index grid
+					pF->Set_Value(x, y, f);
+				else if (f >= 1)
+					pF->Set_Value(x, y, 1);
+				else
+					pF->Set_NoData(x, y);
+
+
+				if (pG)													//calculate optional classified grid
+				{
+					if (f <= 0.1)
+						pG->Set_Value(x, y, WI_LOW_MOISTURE);
+					else if( f <= 1 )// if ((f > 0.1) && (f <= 1))
+						pG->Set_Value(x, y, WI_PARTIALLY_WET);
+					else //if (f > 1)
+						pG->Set_Value(x, y, WI_SATURATION_ZONE);
+				}
+			}
+		}
+	}
+
+
+	//-----------------------------------------------------
+
+	CSG_Parameters	P;
+
+	if( DataObject_Get_Parameters(pG, P) && P("COLORS_TYPE") && P("LUT") )
+	{
+		int CR_Colors[WI_COUNT]	=
+		{
+			SG_GET_RGB(255, 255, 255),  // WI_NODATA
+			SG_GET_RGB(255, 255,   0),	// WI_LOW_MOISTURE
+			SG_GET_RGB(0,	255,   0),	// WI_PARTIALLY_WET
+			SG_GET_RGB(0,     0, 255),	// WI_SATURATION_ZONE
+		};
+
+		//-------------------------------------------------
+		CSG_Strings	Name, Desc;
+
+		Name	+= _TL("No data");							Desc	+= _TL("");
+		Name	+= _TL("Low moisture (WI <= 0.1");			Desc	+= _TL("");
+		Name	+= _TL("Partially wet (WI = 0.1 - 1)");		Desc	+= _TL("");
+		Name	+= _TL("Saturation zone (WI > 1)");			Desc	+= _TL("");	
+
+		//-------------------------------------------------
+		CSG_Table	*pTable	= P("LUT")->asTable();
+
+		pTable->Del_Records();
+
+		for(int i=0; i<WI_COUNT; i++)
+		{
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
+
+			pRecord->Set_Value(0, CR_Colors[i]);
+			pRecord->Set_Value(1, Name[i].c_str());
+			pRecord->Set_Value(2, Desc[i].c_str());
+			pRecord->Set_Value(3, i);
+			pRecord->Set_Value(4, i);
+		}
+
+		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
+
+		DataObject_Set_Parameters(pG, P);
+	}
+
+	return( true );
+
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h
new file mode 100644
index 0000000..c6d6886
--- /dev/null
+++ b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h
@@ -0,0 +1,96 @@
+/**********************************************************
+ * Version $Id: WETNESS_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                  ta_slope_stability                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      WETNESS_01.h                     //
+//                                                       //
+//                 Copyright (C) 2012 by                 //
+//                     Andreas G�nther                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// 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:     a.guenther at bgr.de                      //
+//                                                       //
+//    contact:    Andreas G�nther                        //
+//                B2.2								     //
+//                BGR				                     //
+//                Germany								 //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CWETNESS : public CSG_Module_Grid
+{
+public:
+	CWETNESS(void);
+
+
+protected:
+
+	virtual bool				On_Execute		(void);
+
+
+private:
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/tin/Makefile.in b/src/modules/tin/Makefile.in
index 0cf323d..12a945e 100644
--- a/src/modules/tin/Makefile.in
+++ b/src/modules/tin/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -115,6 +136,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -142,6 +164,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -154,6 +177,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -183,6 +207,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -216,7 +241,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -279,11 +303,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -347,6 +371,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -410,6 +438,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -445,13 +487,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -486,10 +525,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -567,22 +611,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/tin/tin_tools/Makefile.in b/src/modules/tin/tin_tools/Makefile.in
index 1e5c6d9..dd53721 100644
--- a/src/modules/tin/tin_tools/Makefile.in
+++ b/src/modules/tin/tin_tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/tin/tin_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libtin_tools_la_DEPENDENCIES =  \
@@ -105,6 +128,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libtin_tools_la_SOURCES)
 DIST_SOURCES = $(libtin_tools_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -130,6 +158,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -157,6 +186,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -169,6 +199,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -198,6 +229,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -231,7 +263,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -317,7 +348,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -325,6 +355,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -340,13 +372,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libtin_tools.la: $(libtin_tools_la_OBJECTS) $(libtin_tools_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libtin_tools.la: $(libtin_tools_la_OBJECTS) $(libtin_tools_la_DEPENDENCIES) $(EXTRA_libtin_tools_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libtin_tools_la_OBJECTS) $(libtin_tools_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -440,6 +474,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -490,10 +538,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -579,18 +632,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp b/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp
index c14aeaf..abb6ef4 100644
--- a/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp
+++ b/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Grid_Specific_Points.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: TIN_From_Grid_Specific_Points.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -500,7 +500,7 @@ bool CTIN_From_Grid_Specific_Points::Get_FlowDirection2(CSG_Grid *pResult, CSG_G
 	Grid.Invert();
 	Get_FlowDirection(&Result, &Grid, -1, Threshold);
 
-	for(long n=0; n<Get_NCells(); n++)
+	for(sLong n=0; n<Get_NCells(); n++)
 	{
 		if( Result.asInt(n) > 0 )
 		{
diff --git a/src/modules/tin/tin_viewer/Makefile.in b/src/modules/tin/tin_viewer/Makefile.in
index 0e08caf..650f8c1 100644
--- a/src/modules/tin/tin_viewer/Makefile.in
+++ b/src/modules/tin/tin_viewer/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +51,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/tin/tin_viewer
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libtin_viewer_la_DEPENDENCIES =  \
@@ -104,6 +127,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libtin_viewer_la_SOURCES)
 DIST_SOURCES = $(libtin_viewer_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -129,6 +157,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -156,6 +185,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -168,6 +198,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -197,6 +228,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -230,7 +262,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -307,7 +338,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
 	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -315,6 +345,8 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
 	}
@@ -330,13 +362,15 @@ uninstall-pkglibLTLIBRARIES:
 
 clean-pkglibLTLIBRARIES:
 	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libtin_viewer.la: $(libtin_viewer_la_OBJECTS) $(libtin_viewer_la_DEPENDENCIES) 
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libtin_viewer.la: $(libtin_viewer_la_OBJECTS) $(libtin_viewer_la_DEPENDENCIES) $(EXTRA_libtin_viewer_la_DEPENDENCIES) 
 	$(CXXLINK) -rpath $(pkglibdir) $(libtin_viewer_la_OBJECTS) $(libtin_viewer_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -426,6 +460,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -476,10 +524,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -565,18 +618,19 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/modules_contrib/Makefile.am b/src/modules_contrib/Makefile.am
deleted file mode 100644
index 60c759d..0000000
--- a/src/modules_contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = contrib_a_perego contrib_s_liersch garden
diff --git a/src/modules_contrib/Makefile.in b/src/modules_contrib/Makefile.in
deleted file mode 100644
index 1c1d501..0000000
--- a/src/modules_contrib/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = contrib_a_perego contrib_s_liersch garden
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/contrib_a_perego/Makefile.am b/src/modules_contrib/contrib_a_perego/Makefile.am
deleted file mode 100644
index 2e43c7f..0000000
--- a/src/modules_contrib/contrib_a_perego/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = contrib_a_perego
diff --git a/src/modules_contrib/contrib_a_perego/Makefile.in b/src/modules_contrib/contrib_a_perego/Makefile.in
deleted file mode 100644
index dc34d67..0000000
--- a/src/modules_contrib/contrib_a_perego/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/contrib_a_perego
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = contrib_a_perego
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/contrib_a_perego/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/contrib_a_perego/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.h b/src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.h
deleted file mode 100644
index 5c408d3..0000000
--- a/src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__contrib_a_perego_H
-#define HEADER_INCLUDED__contrib_a_perego_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef contrib_a_perego_EXPORTS
-	#define	contrib_a_perego_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	contrib_a_perego_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__contrib_a_perego_H
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.am b/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.am
deleted file mode 100644
index 1b60872..0000000
--- a/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libcontrib_a_perego.la
-libcontrib_a_perego_la_SOURCES =\
-A1WiTh.cpp\
-A2WiTh.cpp\
-A3WiTh.cpp\
-AvWiMa1.cpp\
-AvWiMa2.cpp\
-destriping1.cpp\
-destriping2.cpp\
-directional1.cpp\
-MLB_Interface.cpp\
-A1WiTh.h\
-A2WiTh.h\
-A3WiTh.h\
-AvWiMa1.h\
-AvWiMa2.h\
-destriping1.h\
-destriping2.h\
-directional1.h\
-MLB_Interface.h
-
-libcontrib_a_perego_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.in b/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.in
deleted file mode 100644
index 940936a..0000000
--- a/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.in
+++ /dev/null
@@ -1,600 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/contrib_a_perego/contrib_a_perego
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libcontrib_a_perego_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libcontrib_a_perego_la_OBJECTS = A1WiTh.lo A2WiTh.lo A3WiTh.lo \
-	AvWiMa1.lo AvWiMa2.lo destriping1.lo destriping2.lo \
-	directional1.lo MLB_Interface.lo
-libcontrib_a_perego_la_OBJECTS = $(am_libcontrib_a_perego_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libcontrib_a_perego_la_SOURCES)
-DIST_SOURCES = $(libcontrib_a_perego_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libcontrib_a_perego.la
-libcontrib_a_perego_la_SOURCES = \
-A1WiTh.cpp\
-A2WiTh.cpp\
-A3WiTh.cpp\
-AvWiMa1.cpp\
-AvWiMa2.cpp\
-destriping1.cpp\
-destriping2.cpp\
-directional1.cpp\
-MLB_Interface.cpp\
-A1WiTh.h\
-A2WiTh.h\
-A3WiTh.h\
-AvWiMa1.h\
-AvWiMa2.h\
-destriping1.h\
-destriping2.h\
-directional1.h\
-MLB_Interface.h
-
-libcontrib_a_perego_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libcontrib_a_perego.la: $(libcontrib_a_perego_la_OBJECTS) $(libcontrib_a_perego_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libcontrib_a_perego_la_OBJECTS) $(libcontrib_a_perego_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/A1WiTh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/A2WiTh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/A3WiTh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/AvWiMa1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/AvWiMa2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/destriping1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/destriping2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/directional1.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/contrib_s_liersch/Makefile.am b/src/modules_contrib/contrib_s_liersch/Makefile.am
deleted file mode 100644
index 9ee970b..0000000
--- a/src/modules_contrib/contrib_s_liersch/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = ihacres
diff --git a/src/modules_contrib/contrib_s_liersch/Makefile.in b/src/modules_contrib/contrib_s_liersch/Makefile.in
deleted file mode 100644
index 2511df7..0000000
--- a/src/modules_contrib/contrib_s_liersch/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/contrib_s_liersch
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = ihacres
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/contrib_s_liersch/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/contrib_s_liersch/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.h b/src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.h
deleted file mode 100644
index bc8c6cf..0000000
--- a/src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        IHACRES                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 by                 //
-//                        Author                         //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     author at email.de                        //
-//                                                       //
-//    contact:    Author                                 //
-//                Sesame Street. 7                       //
-//                12345 Metropolis                       //
-//                Nirvana                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-/* $Log: not supported by cvs2svn $
-/* Revision 1.1  2009/10/20 07:40:39  oconrad
-/* no message
-/*
-/* Revision 1.1.1.1  2005/08/31 14:00:48  oconrad
-/* no message
-/*
-/* Revision 1.1.1.1  2005/08/17 08:25:03  oconrad
-/* no message
-/*
-/* Revision 1.1.1.1  2005/08/15 13:35:24  oconrad
-/* no message
-/*
- */
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__ihacres_H
-#define HEADER_INCLUDED__ihacres_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef ihacres_noDB_EXPORTS
-	#define	ihacres_noDB_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	ihacres_noDB_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__ihacres_H
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.am b/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.am
deleted file mode 100644
index d329713..0000000
--- a/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.am
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libihacres.la
-libihacres_la_SOURCES =\
-convert_sl.cpp\
-ihacres_basin.cpp\
-ihacres_cal2.cpp\
-ihacres_elev.cpp\
-ihacres_elev_bands.cpp\
-ihacres_elev_cal.cpp\
-ihacres_eq.cpp\
-ihacres_v1.cpp\
-MLB_Interface.cpp\
-model_tools.cpp\
-snow_module.cpp\
-convert_sl.h\
-ihacres_basin.h\
-ihacres_cal2.h\
-ihacres_elev.h\
-ihacres_elev_bands.h\
-ihacres_elev_cal.h\
-ihacres_eq.h\
-ihacres_v1.h\
-MLB_Interface.h\
-model_tools.h\
-snow_module.h
-
-libihacres_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.in b/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.in
deleted file mode 100644
index 3793916..0000000
--- a/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.in
+++ /dev/null
@@ -1,607 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/contrib_s_liersch/ihacres
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libihacres_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libihacres_la_OBJECTS = convert_sl.lo ihacres_basin.lo \
-	ihacres_cal2.lo ihacres_elev.lo ihacres_elev_bands.lo \
-	ihacres_elev_cal.lo ihacres_eq.lo ihacres_v1.lo \
-	MLB_Interface.lo model_tools.lo snow_module.lo
-libihacres_la_OBJECTS = $(am_libihacres_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libihacres_la_SOURCES)
-DIST_SOURCES = $(libihacres_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libihacres.la
-libihacres_la_SOURCES = \
-convert_sl.cpp\
-ihacres_basin.cpp\
-ihacres_cal2.cpp\
-ihacres_elev.cpp\
-ihacres_elev_bands.cpp\
-ihacres_elev_cal.cpp\
-ihacres_eq.cpp\
-ihacres_v1.cpp\
-MLB_Interface.cpp\
-model_tools.cpp\
-snow_module.cpp\
-convert_sl.h\
-ihacres_basin.h\
-ihacres_cal2.h\
-ihacres_elev.h\
-ihacres_elev_bands.h\
-ihacres_elev_cal.h\
-ihacres_eq.h\
-ihacres_v1.h\
-MLB_Interface.h\
-model_tools.h\
-snow_module.h
-
-libihacres_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/contrib_s_liersch/ihacres/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/contrib_s_liersch/ihacres/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libihacres.la: $(libihacres_la_OBJECTS) $(libihacres_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libihacres_la_OBJECTS) $(libihacres_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_sl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_basin.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_cal2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_elev.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_elev_bands.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_elev_cal.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_eq.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ihacres_v1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/model_tools.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/snow_module.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp b/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp
deleted file mode 100644
index f6e4afd..0000000
--- a/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp
+++ /dev/null
@@ -1,1122 +0,0 @@
-/**********************************************************
- * Version $Id: ihacres_cal2.cpp 1261 2011-12-16 15:12:15Z oconrad $
- *********************************************************/
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ihacres_cal2                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    ihacres_cal.cpp                    //
-//                                                       //
-//                 Copyright (C) 2008 by                 //
-//                     Stefan Liersch                    //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     stefan.liersch at ufz.de                  //
-//                stefan.liersch at gmail.com                   //
-//                                                       //
-//                     2008-01-15                        //
-///////////////////////////////////////////////////////////
-//                   
-//-------------------------------------------------------//
-// References:											 
-// Jakeman, A.J. / Hornberger, G.M (1993).				 
-//   How Much Complexity Is Warranted in a				 
-//	 Rainfall-Runoff Model?								 
-//	 Water Resources Research, (29), NO. 8 (2637-2649)   
-// Kokkonen, T. S. et al. (2003).
-//   Predicting daily flows in ungauged catchments:
-//   model regionalization from catchment descriptors
-//   at the Coweeta Hydrologic Laboratory, North Carolina
-//   Hydrological Processes (17), 2219-2238
-// Croke, B. F. W., W. S. Merritt, et al. (2004).
-//   A dynamic model for predicting hydrologic response
-//   to land cover changes in gauged and
-//   ungauged catchments.
-//   Journal Of Hydrology 291(1-2): 115-131.
-//-------------------------------------------------------//
-
-//---------------------------------------------------------
-// ToDo
-//---------------------------------------------------------
-//	- beste Simulation automatisch rausschreiben
-//---------------------------------------------------------
-#include <iostream> // used for textfile output (test only)
-#include <fstream>  // used for textfile output (test only)
-
-#include <stdlib.h> // random numbers
-#include <time.h>	// random numbers
-
-#include "ihacres_cal2.h"
-// #include "model_tools.h" // already in ihacres_eq.h
-#include "convert_sl.h"
-//---------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////
-//
-//		Constructor
-//
-///////////////////////////////////////////////////////////////////////
-
-Cihacres_cal2::Cihacres_cal2(void)
-{
-	//-----------------------------------------------------
-	// 1. Info...
-	Set_Name(_TL("IHACRES Calibration (2)"));
-
-	Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch"));
-
-	Set_Description(_TW("Calibration Tool for the Model IHACRES \n \n \n"
-		"Reference: \n \n"
-		"Jakeman, A.J. / Hornberger, G.M. (1993). \n"
-		"How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n"
-		"Water Resources Research, (29), NO. 8 (2637-2649) \n \n"   
-		"Croke, B. F. W., W. S. Merritt, et al. (2004).\n"
-		"A dynamic model for predicting hydrologic response "
-		"to land cover changes in gauged and "
-		"ungauged catchments. \n"
-		"Journal Of Hydrology 291(1-2): 115-131."
-	));
-
-	Parameters.Add_Table_Output(
-		NULL	, "TABLEout"	, _TL("Table"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	// Create First Module Dialog
-	_CreateDialog1();
-	//-----------------------------------------------------
-}
-
-///////////////////////////////////////////////////////////////////////
-//
-//		Destructor
-//
-///////////////////////////////////////////////////////////////////////
-
-Cihacres_cal2::~Cihacres_cal2(void)
-{
-	//if (m_bSnowModule)
-	//{
-	//	delete m_pSnowModule;
-	//	delete[] m_pMeltRate;
-	//}
-}
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//		On_Execute()
-//
-///////////////////////////////////////////////////////////////////////
-
-
-//---------------------------------------------------------
-// This function is executed when the user is pressing the OK button
-// in the first module dialog
-bool Cihacres_cal2::On_Execute(void)
-{
-	int			first, last;
-	double		NSE_temp	= 0.0;
-	double		NSE_max		= -9999.9;
-	string		nse, nse_text;
-
-	//---------------------------------------------------------
-	// Assign parameters from First Module Dialog
-	m_pTable		= Parameters("TABLE")			->asTable();
-	// Field numbers
-	m_dateField		= Parameters("DATE_Field")		->asInt();
-	m_dischargeField= Parameters("DISCHARGE_Field")	->asInt();
-	m_pcpField		= Parameters("PCP_Field")		->asInt();
-	m_tmpField		= Parameters("TMP_Field")		->asInt();
-	m_inflowField	= Parameters("INFLOW_Field")	->asInt();
-
-	m_bUpstream		= Parameters("bUPSTREAM")		->asBool();
-
-	m_bTMP			= Parameters("USE_TMP")			->asBool();
-
-	m_nsim			= Parameters("NSIM")			->asInt();
-	m_area			= Parameters("AREA")			->asDouble();
-	//m_dev_eRainDis	= Parameters("DEV_ERAINDIS")	->asDouble();
-	//m_dev_eRainPCP	= Parameters("DEV_ERAINPCP")	->asDouble();
-	m_storconf		= Parameters("STORAGE")			->asInt();
-	m_IHAC_version	= Parameters("IHACVERS")		->asInt();
-	m_bSnowModule	= Parameters("SNOW_MODULE")		->asBool();
-	first = last	= 0;
-	//---------------------------------------------------------
-
-	//---------------------------------------------------------
-	// After pressing OK in the first Dialog Dialog2 appears.
-	// In the sec
-	if ( _CreateDialog2() )
-	//---------------------------------------------------------
-	{
-		//---------------------------------------------------------
-		// Searching the first and the last record of the time range
-		ihacres.AssignFirstLastRec(*m_pTable, first, last, m_date1, m_date2, m_dateField);
-		//---------------------------------------------------------
-
-		//---------------------------------------------------------
-		// Initialize arrays
-		m_nValues = last - first + 1;
-		_InitPointers();
-		//---------------------------------------------------------
-
-		//---------------------------------------------------------
-		// Assign selected time range to vector m_vec_date, 
-		// discharge[], pcp[], and tmp[]
-		_ReadInputTable(first, last);
-		//---------------------------------------------------------
-
-		//---------------------------------------------------------
-		// Convert streamflow from m3/s to mm/day
-		if (m_bUpstream)
-		{
-			// if the subbasin is upstream (without external inflow) then everything
-			// is as it should be.
-			m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_obs_m3s,m_p_Q_obs_mmday,m_nValues,m_area);
-		} else {
-			// if the subbasin is downstream of other subbasins, thus there
-			// are external inflows the array m_p_Q_obs_mmday must be calculated as following:
-			// m_p_Q_obs_mmday =
-			// (observed streamflow at the outlet of the subbasin) - (observed inflow from the upstream subbasin(s))
-			_Calc_ObsMinInflow();
-			m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_dif_m3s, m_p_Q_obs_mmday, m_nValues, m_area);
-		}
-		// calculate sum of observed discharge in [mm]
-		m_sum_obsDisMM = ihacres.SumVector(m_p_Q_obs_mmday, m_nValues);
-		//---------------------------------------------------------
-
-		//---------------------------------------------------------
-		m_pTable = SG_Create_Table();
-		_CreateOutputTable();
-		m_counter = 0;
-		//---------------------------------------------------------
-
-		///////////////////////////////////////////////////////////
-		//
-		//		SIMULATION
-		//
-		///////////////////////////////////////////////////////////
-		
-		// initialize random function
-		srand((unsigned) time(NULL)); // using time.h
-
-		for (int sim = 0; sim < m_nsim && Set_Progress(sim, m_nsim); sim++)
-		{
-			_CalcNonLinearModule();
-
-			_CalcLinearModule();
-
-			_CalcEfficiency();
-
-			// write in output table if criterion is fulfilled
-			NSE_temp = ihacres._Assign_NSE_temp(m_obj_func, m_NSE, m_NSE_highflow, m_NSE_lowflow);
-
-			if (NSE_temp > m_NSEmin)
-			{
-				if (NSE_temp > NSE_max)
-				{
-					NSE_max = NSE_temp;
-					nse = convert_sl::Double2String(NSE_max).c_str();
-					nse_text = "max. NSE ";
-					nse_text += nse;
-					Process_Set_Text(CSG_String(nse_text.c_str()));
-				}
-
-				_WriteOutputTable();
-			}
-		}
-		//---------------------------------------------------------
-		m_pTable->Set_Name(SG_T("IHACRES_cal2"));
-		Parameters("TABLEout")->Set_Value(m_pTable);
-
-
-
-		//---------------------------------------------------------
-		_DeletePointers();
-		//---------------------------------------------------------
-
-		return(true);
-
-	} // end if (_CreateDialog2())
-
-
-	return(false);
-}
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//		PRIVATE FUNCTIONS
-//
-///////////////////////////////////////////////////////////////////////
-
-
-//---------------------------------------------------------------------
-//		InitPointers()
-//---------------------------------------------------------------------
-void Cihacres_cal2::_InitPointers()
-{
-	int n = m_nValues;
-
-	m_vec_date.resize(n);
-	if (!m_bUpstream)
-	{
-		m_p_Q_Inflow_m3s = new double[n];
-		m_p_Q_dif_m3s	 = new double[n];
-	}
-	m_p_Q_obs_m3s	= new double[n];
-	m_p_Q_obs_mmday	= new double[n];
-	m_p_Q_sim_mmday	= new double[n];
-	m_pPCP			= new double[n];
-	m_pTMP			= new double[n];
-	m_pExcessRain	= new double[n];
-	m_pTw			= new double[n];
-	m_pWI			= new double[n];
-	if (m_bSnowModule)
-		m_pMeltRate	= new double[n];
-}
-//---------------------------------------------------------------------
-
-//---------------------------------------------------------------------
-//		DeletePointers()
-//---------------------------------------------------------------------
-void Cihacres_cal2::_DeletePointers()
-{
-	m_vec_date.resize(0);
-	if (!m_bUpstream)
-	{
-		delete[] m_p_Q_Inflow_m3s;
-		delete[] m_p_Q_dif_m3s;
-	}
-	delete[] m_p_Q_obs_m3s;
-	delete[] m_p_Q_obs_mmday;
-	delete[] m_p_Q_sim_mmday;
-	delete[] m_pPCP;
-	delete[] m_pTMP;
-	delete[] m_pExcessRain;
-	delete[] m_pTw;
-	delete[] m_pWI;
-	if (m_bSnowModule)
-		delete[] m_pMeltRate;
-}
-//---------------------------------------------------------------------
-
-//---------------------------------------------------------------------
-//		ReadInputTable()
-//---------------------------------------------------------------------
-void Cihacres_cal2::_ReadInputTable(int first, int last)
-{
-	int j, k;
-
-	for (j = 0, k = first; j < m_nValues, k < last + 1; j++, k++)
-	{
-		// put the date string into the vector
-		m_vec_date[j].append(CSG_String(m_pTable->Get_Record(k)->asString(m_dateField)));
-		m_p_Q_obs_m3s[j]= m_pTable->Get_Record(k)->asDouble(m_dischargeField);
-		m_pPCP[j]		= m_pTable->Get_Record(k)->asDouble(m_pcpField);
-		m_pTMP[j]		= m_pTable->Get_Record(k)->asDouble(m_tmpField);
-		if (!m_bUpstream)
-			m_p_Q_Inflow_m3s[j] = m_pTable->Get_Record(k)->asDouble(m_inflowField);
-	}
-}
-//---------------------------------------------------------------------
-
-//---------------------------------------------------------------------
-//		Calculate observed streamflow time series if inflow occurs
-//---------------------------------------------------------------------
-void Cihacres_cal2::_Calc_ObsMinInflow()
-{
-	for (int i = 0; i < m_nValues; i++)
-	{
-		m_p_Q_dif_m3s[i] = m_p_Q_obs_m3s[i] - m_p_Q_Inflow_m3s[i];
-		if (m_p_Q_dif_m3s[i] < 0.0) m_p_Q_obs_mmday[i] = 0;
-	}
-}
-//---------------------------------------------------------------------
-
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//
-//							SIMULATION
-//
-//
-///////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//		NON-LINEAR MODULE
-//
-///////////////////////////////////////////////////////////////////////
-
-void Cihacres_cal2::_CalcNonLinearModule()
-{
-	double eR_init = 0.0;
-	//-------------------------------------------------------------
-	// Assign random values
-	//-------------------------------------------------------------
-	if (m_bSnowModule)
-	{
-		m_SnowParms.T_Rain	= model_tools::Random_double(m_T_Rain_lb, m_T_Rain_ub);
-		m_SnowParms.T_Melt	= model_tools::Random_double(m_T_Melt_lb, m_T_Melt_ub);
-		m_SnowParms.DD_FAC	= model_tools::Random_double(m_DD_FAC_lb, m_DD_FAC_ub);
-
-		m_pSnowModule = new CSnowModule(m_pTMP, m_pPCP, m_nValues,
-			m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_SnowParms.DD_FAC);
-
-		m_pMeltRate = m_pSnowModule->Get_MeltRate(m_pMeltRate, m_nValues);
-		delete m_pSnowModule;
-	}
-
-	m_Tw	= model_tools::Random_double(m_TwConst_lb, m_TwConst_ub);
-	m_f		= model_tools::Random_double(m_f_lb, m_f_ub);
-	m_c		= model_tools::Random_double(m_c_lb, m_c_ub);
-
-	if (m_IHAC_version == 1) { // Croke etal. (2005)
-		m_l	= model_tools::Random_double(m_l_lb, m_l_ub);
-		m_p	= model_tools::Random_double(m_p_lb, m_p_ub);
-	}
-	//-------------------------------------------------------------
-
-	//-------------------------------------------------------------
-	// Simulation (non-linear module)
-	//-------------------------------------------------------------
-	switch(m_IHAC_version)
-	{		
-	case 0: // Jakeman & Hornberger (1993)
-		if (m_bTMP)
-		{
-			ihacres.CalcWetnessTimeConst(m_pTMP, m_pTw, m_Tw, m_f, m_nValues);
-		}
-
-		if (m_bSnowModule)
-		{
-			ihacres.CalcWetnessIndex(m_pTw, m_pPCP, m_pTMP,	m_pWI, 0.5, m_c,
-				m_bSnowModule, m_SnowParms.T_Rain, m_nValues);
-
-			ihacres.CalcExcessRain(m_pPCP, m_pTMP, m_pWI,m_pExcessRain,eR_init,
-				m_sum_eRainGTpcp, m_nValues, m_bSnowModule,
-				m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_pMeltRate);
-		} else {
-			ihacres.CalcWetnessIndex(m_pTw, m_pPCP, m_pTMP, m_pWI, 0.5, m_c,
-				m_bSnowModule, 0, m_nValues);
-
-			ihacres.CalcExcessRain(m_pPCP, m_pTMP, m_pWI, m_pExcessRain,eR_init,
-				m_sum_eRainGTpcp, m_nValues, m_bSnowModule,
-				0,0,0);
-		} // end if (m_bSnowModule)
-
-		break;
-	case 1: // Croke et al. (2005) Redesign
-		if (m_bTMP)
-		{
-			ihacres.CalcWetnessTimeConst_Redesign(m_pTMP, m_pTw, m_Tw, m_f, m_nValues);
-		}
-
-		if (m_bSnowModule)
-		{
-			ihacres.CalcWetnessIndex_Redesign(m_pTw, m_pPCP, m_pWI, 0.5,
-				m_bSnowModule, m_SnowParms.T_Rain, m_nValues);
-
-			ihacres.CalcExcessRain_Redesign(m_pPCP, m_pTMP, m_pWI, m_pExcessRain, eR_init,
-				m_sum_eRainGTpcp, m_nValues, 
-				m_c, m_l, m_p, 
-				m_bSnowModule, m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_pMeltRate);
-		} else {
-			ihacres.CalcWetnessIndex_Redesign(m_pTw, m_pPCP, m_pWI, 0.5,
-				m_bSnowModule, 0, m_nValues);
-
-			ihacres.CalcExcessRain_Redesign(m_pPCP, m_pTMP, m_pWI, m_pExcessRain, eR_init,
-				m_sum_eRainGTpcp, m_nValues, 
-				m_c, m_l, m_p,
-				m_bSnowModule, 0,0,0);
-		}
-		break;
-	} // end switch(m_IHAC_version)
-}
-//---------------------------------------------------------------------
-
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//		LINEAR MODULE
-//
-///////////////////////////////////////////////////////////////////////
-
-void Cihacres_cal2::_CalcLinearModule()
-{
-	//-------------------------------------------------------------
-	// Assign random values
-	//-------------------------------------------------------------
-	switch(m_storconf)
-	{
-	case 0: // single storage
-		m_a		= model_tools::Random_double(m_a_lb, m_a_ub);
-		m_b		= model_tools::Random_double(m_b_lb, m_b_ub);
-		break;
-	case 1: // two storages in parallel
-		do
-		{
-			m_aq		= model_tools::Random_double(m_aq_lb, m_aq_ub);
-			m_as		= model_tools::Random_double(m_as_lb, m_as_ub);
-			m_bq		= model_tools::Random_double(m_bq_lb, m_bq_ub);
-			// Calculate parameter m_vq to check parms aq and bq
-			// Equation after Jakeman & Hornberger (1993)
-			m_vq	= m_bq / ( 1 + m_aq );
-		}
-		while (m_vq < 0.0 || m_vq > 1.0);
-		m_bs = ihacres.Calc_Parm_BS(m_aq, m_as, m_bq);
-		break;
-	}
-	//-------------------------------------------------------------
-
-	//-------------------------------------------------------------
-	// Simulate streamflow (linear module)
-	//-------------------------------------------------------------
-	switch(m_storconf)
-	{
-	case 0: // single storage
-		ihacres.SimStreamflowSingle(m_pExcessRain, m_p_Q_obs_mmday[0],
-			m_p_Q_sim_mmday, m_delay, m_a, m_b, m_nValues);
-		break;
-	case 1: // two storages in parallel
-		ihacres.SimStreamflow2Parallel(m_pExcessRain, m_p_Q_sim_mmday, m_p_Q_obs_mmday[0],
-			m_aq, m_as, m_bq, m_bs, m_vq, m_vs, m_IHAC_version, m_nValues, m_delay);
-		break;
-	case 2: // two storages in series
-		break;
-	} // end switch(m_StorConf)
-}
-//---------------------------------------------------------------------
-
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//		EFFICIENCY
-//
-///////////////////////////////////////////////////////////////////////
-
-//---------------------------------------------------------------------
-//		Nash-Sutcliffe efficiency
-//---------------------------------------------------------------------
-void Cihacres_cal2::_CalcEfficiency()
-{
-	m_NSE			= model_tools::CalcEfficiency(m_p_Q_obs_mmday, m_p_Q_sim_mmday,m_nValues);
-	m_NSE_highflow	= model_tools::Calc_NSE_HighFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues);
-	m_NSE_lowflow	= model_tools::Calc_NSE_LowFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues);
-	m_PBIAS			= model_tools::Calc_PBIAS(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues);
-}
-//---------------------------------------------------------------------
-
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-//							CREATE TABLES
-//
-/////////////////////////////////////////////////////////////////////////////
-
-//---------------------------------------------------------------------
-//		Create output table
-//---------------------------------------------------------------------
-void Cihacres_cal2::_CreateOutputTable()
-{
-	// creating the column titles
-	m_pTable->Add_Field("NSE",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("NSE_high",			SG_DATATYPE_Double);
-	m_pTable->Add_Field("NSE_low",			SG_DATATYPE_Double);
-	m_pTable->Add_Field("PBIAS",			SG_DATATYPE_Double);
-	m_pTable->Add_Field("eR_ovest",			SG_DATATYPE_Double);
-	m_pTable->Add_Field("vq",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("vs",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("T(q)",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("T(s)",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("Tw",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("f",				SG_DATATYPE_Double);
-	m_pTable->Add_Field("c",				SG_DATATYPE_Double);
-	if ( m_IHAC_version == 1 ) // Croke etal. (2005)
-	{
-		m_pTable->Add_Field("l",			SG_DATATYPE_Double);
-		m_pTable->Add_Field("p",			SG_DATATYPE_Double);
-	}
-	if (m_bSnowModule)
-	{
-		m_pTable->Add_Field("T_Rain",		SG_DATATYPE_Double);
-		m_pTable->Add_Field("T_Melt",		SG_DATATYPE_Double);
-		m_pTable->Add_Field("DD_FAC",		SG_DATATYPE_Double);
-	}
-	switch(m_storconf)
-	{
-	case 0: // single
-		m_pTable->Add_Field("a",			 SG_DATATYPE_Double);
-		m_pTable->Add_Field("b",			 SG_DATATYPE_Double);
-		break;
-	case 1: // two storages in parallel
-		m_pTable->Add_Field("aq",			 SG_DATATYPE_Double);
-		m_pTable->Add_Field("as",			 SG_DATATYPE_Double);
-		m_pTable->Add_Field("bq",			 SG_DATATYPE_Double);
-		m_pTable->Add_Field("bs",			 SG_DATATYPE_Double);
-		break;
-	}
-}
-//---------------------------------------------------------------------
-
-
-//---------------------------------------------------------------------
-//		Create output table
-//---------------------------------------------------------------------
-void Cihacres_cal2::_WriteOutputTable()
-{
-	int					field = 0;
-	CSG_Table_Record	*pRecord;
-
-	// add a new record to the table
-	m_pTable->Add_Record();
-	pRecord	= m_pTable->Get_Record(m_counter);
-
-	// writing the data to the current row
-	pRecord->Set_Value(field,m_NSE); field++;
-	pRecord->Set_Value(field,m_NSE_highflow); field++;
-	pRecord->Set_Value(field,m_NSE_lowflow); field++;
-	pRecord->Set_Value(field,m_PBIAS); field++;
-	pRecord->Set_Value(field,m_sum_eRainGTpcp); field++;
-	pRecord->Set_Value(field,m_vq); field++;
-	pRecord->Set_Value(field,m_vs); field++;
-	pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_aq)); field++;
-	pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_as)); field++;
-	pRecord->Set_Value(field,m_Tw); field++;
-	pRecord->Set_Value(field,m_f); field++;
-	pRecord->Set_Value(field,m_c); field++;
-	if ( m_IHAC_version == 1 ) // Croke et al. (2005)
-	{
-		pRecord->Set_Value(field,m_l); field++;
-		pRecord->Set_Value(field,m_p); field++;
-	}
-	if ( m_bSnowModule )
-	{
-		pRecord->Set_Value(field,m_SnowParms.T_Rain); field++;
-		pRecord->Set_Value(field,m_SnowParms.T_Melt); field++;
-		pRecord->Set_Value(field,m_SnowParms.DD_FAC); field++;
-	}
-	switch(m_storconf)
-	{
-	case 0: // single
-		pRecord->Set_Value(field,m_a); field++;
-		pRecord->Set_Value(field,m_b); field++;
-		break;
-	case 1: // two storages in parallel
-		pRecord->Set_Value(field,m_aq); field++;
-		pRecord->Set_Value(field,m_as); field++;
-		pRecord->Set_Value(field,m_bq); field++;
-		pRecord->Set_Value(field,m_bs); field++;
-		break;
-	}
-	m_counter++; // record counter
-}
-//---------------------------------------------------------------------
-
-
-
-
-
-
-///////////////////////////////////////////////////////////////////////
-//
-//		DIALOGS
-//
-///////////////////////////////////////////////////////////////////////
-
-
-//---------------------------------------------------------------------
-//		DIALOG 1
-//---------------------------------------------------------------------
-void Cihacres_cal2::_CreateDialog1()
-{
-	CSG_Parameter	*pNode;
-	CSG_String s;
-
-	pNode = Parameters.Add_Table(
-		NULL	, "TABLE"	, _TL("Table"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DATE_Field"	, _TL("Date Column"),
-		_TL("Select the column containing the Date")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DISCHARGE_Field"	, _TL("Streamflow Column"),
-		_TL("Select the Column containing Discharge Values")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "PCP_Field"	, _TL("Precipitation Column"),
-		_TL("Select the Column containing precipitation Values")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "TMP_Field"	, _TL("Temperature Column"),
-		_TL("Select the Column containing Temperature Values")
-	);
-	
-	Parameters.Add_Table_Field(
-		pNode	, "INFLOW_Field"	, _TL("Subbasin Inflow"),
-		_TL("Select the column containing inflow data to the subbasin")
-	);
-	
-	Parameters.Add_Value(
-		pNode,	"bUPSTREAM",	_TL("Is the subbasin upstream (no external inflow)"),
-		_TL("If checked, it means there is no external inflow to the subbasin"),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		pNode,	"USE_TMP",	_TL("Using temperature data?"),
-		_TL("If checked, then temperature data are used."),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	pNode = Parameters.Add_Value(
-		NULL,	"NSIM",	_TL("Number of Simulations"),
-		_TL("Number of Simulations for Calibration"),
-		PARAMETER_TYPE_Int,
-		1000, 1, true, 10000000, true
-	);
-
-	pNode = Parameters.Add_Value(
-		NULL,	"AREA",	_TL("Area of the Watershed in [km2]"),
-		_TL("Area of the Watershed in [km2] used for unit conversion"),
-		PARAMETER_TYPE_Double,
-		100.0, 0.00001, true, 0.0, false
-	);
-
-	//s.Printf(SG_T("Node2", 2);
-	//	pNode = Parameters.Add_Node(NULL,s,SG_T("Non-Linear Module",_TL(""));
-
-	//Parameters.Add_Value(
-	//	pNode,	"DEV_ERAINDIS",	_TL("Maximum Deviation: ExcessRain-Streamflow [%]"),
-	//	_TL("Maximum Deviation between estimated excess rainfall and observed streamflow volumes"),
-	//	PARAMETER_TYPE_Double,
-	//	5.0, 0.0, true, 50.0, true
-	//);
-
-	//Parameters.Add_Value(
-	//	pNode,	"DEV_ERAINPCP",	_TL("Maximum Overestimation of ExcessRain [%]"),
-	//	_TL("Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"),
-	//	PARAMETER_TYPE_Double,
-	//	5.0, 0.0, true, 50.0, true
-	//);
-
-	s.Printf(SG_T("Node3"), 3);
-	pNode = Parameters.Add_Node(NULL,s,SG_T("Storage Configuration"),_TL(""));
-
-	Parameters.Add_Choice(
-		pNode	, "STORAGE"		, _TL("Storage"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Single Storage"),			//  0
-			_TL("Two Parallel Storages"),	//  1 
-			_TL("Two Storages in Series")	//  2 
-		)
-	);
-
-	s.Printf(SG_T("Node4"), 4);
-	pNode = Parameters.Add_Node(NULL,s,_TL("IHACRES Version"),_TL(""));
-
-	Parameters.Add_Choice(
-		pNode	, "IHACVERS"		, _TL("IHACRES Version"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Jakeman & Hornberger (1993)"),	//  0
-			_TL("Croke et al. (2005)")			//	1
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode,	"SNOW_MODULE",	_TL("Snow Module on/off"),
-		_TL("If checked the snow module is active"),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Table_Output(
-		NULL	, "TABLEout"	, _TL("Table"),
-		_TL("")
-	);
-	Parameters.Add_Table_Output(
-		NULL	, "TABLEparms"	, _TL("Table"),
-		_TL("")
-	);
-}
-//---------------------------------------------------------------------
-
-
-//---------------------------------------------------------------------
-//		DIALOG 2
-//---------------------------------------------------------------------
-bool Cihacres_cal2::_CreateDialog2()
-{
-	CSG_String		s;
-	CSG_Parameters	P;  // used to add Parameters in the second dialog
-	CSG_Parameter	*pNode, *pNode1;
-
-
-	//	Dialog design
-	P.Set_Name(_TL("IHACRES Model Parameters"));
-
-	s.Printf(SG_T("Node1"), 1);
-	pNode = P.Add_Node(NULL,s,SG_T("Time Range"),_TL(""));
-
-	s.Printf(SG_T("FDAY") , 1-1);
-	P.Add_String(pNode,s,_TL("First Day"),_TL(""),
-		m_pTable->Get_Record(0)->asString(m_dateField));
-
-	s.Printf(SG_T("LDAY") , 1-2);
-	P.Add_String(pNode,s,_TL("Last Day"),_TL(""),
-		m_pTable->Get_Record(m_pTable->Get_Record_Count()-1)->asString(m_dateField));
-
-	//-----------------------------------------------------------------
-	// Non-linear parameters
-	//-----------------------------------------------------------------
-	s.Printf(SG_T("Node2"), 2);
-		pNode = P.Add_Node(NULL,s,SG_T("Non-Linear Module"),_TL(""));
-
-	P.Add_Value(
-		pNode,	"TwFAC_lb",	_TL("(Tw) wetness decline time constant [lower bound]"),
-		_TW("Tw is approximately the time constant, or inversely,"
-		"the rate at which the catchment wetness declines in the absence of rainfall"),
-		PARAMETER_TYPE_Double,
-		1.0, 0.01, true, 150.0, true
-	);
-	P.Add_Value(
-		pNode,	"TwFAC_ub",	_TL("(Tw) wetness decline time constant [upper bound]"),
-		_TW("Tw is approximately the time constant, or inversely,SG_T("
-		"the rate at which the catchment wetness declines in the absence of rainfall"),
-		PARAMETER_TYPE_Double,
-		50.0, 0.01, true, 150.0, true
-		);
-
-	if (m_bTMP) // if observed temperature data are used
-	{
-		P.Add_Value(
-			pNode	, "TFAC_lb"		, _TL("(f) Temperature Modulation Factor [lower bound]"),
-			_TL("Temperature Modulation Factor f"),
-			PARAMETER_TYPE_Double,
-			0.05, 0.0001, true, 5.0, true
-		);
-		P.Add_Value(
-			pNode	, "TFAC_ub"		, _TL("(f) Temperature Modulation Factor [upper bound]"),
-			_TL("Temperature Modulation Factor f"),
-			PARAMETER_TYPE_Double,
-			0.5, 0.0001, true, 5.0, true
-		);
-	}
-
-	P.Add_Value(
-		pNode,	"CFAC_lb",	_TL("(c) Parameter [lower bound]"),
-		_TL("Parameter (c) to fit streamflow volume"),
-		PARAMETER_TYPE_Double,
-		0.001, 0.0, true, 1.0, true
-	);
-	P.Add_Value(
-		pNode,	"CFAC_ub",	_TL("(c) Parameter [upper bound]"),
-		_TL("Parameter (c) to fit streamflow volume"),
-		PARAMETER_TYPE_Double,
-		0.01, 0.0, true, 1.0, true
-	);
-
-	if (m_IHAC_version == 1) // Croke et al. (2005) Redesign
-	{
-		s.Printf(SG_T("Node2-2"), 2-2);
-		pNode1 = P.Add_Node(pNode,s,SG_T("Soil moisture index threshold"),_TL(""));
-
-		P.Add_Value(
-			pNode1	, "SMI_L_lb"		, _TL("Soil moisture index (l) [lower bound]"),
-			_TL("Soil moisture index threshold (l), lower bound"),
-			PARAMETER_TYPE_Double,
-			0.0, 0.0, true, 5.0, true
-		);
-		P.Add_Value(
-			pNode1	, "SMI_L_ub"		, _TL("Soil moisture index (l) [upper bound]"),
-			_TL("Soil moisture index threshold (l), upper bound"),
-			PARAMETER_TYPE_Double,
-			5.0, 0.0, true, 5.0, true
-		);
-		s.Printf(SG_T("Node2-3"), 2-3);
-		pNode1 = P.Add_Node(pNode,s,_TL("Power on soil moisture"),_TL(""));
-
-		P.Add_Value(
-			pNode1	, "SM_P_lb"		, _TL("Power on soil (p) [lower bound]"),
-			_TL("Power on soil moisture (p), lower bound"),
-			PARAMETER_TYPE_Double,
-			0.0, 0.0, true, 5.0, true
-		);
-		P.Add_Value(
-			pNode1	, "SM_P_ub"		, _TL("Power on soil (p) [upper bound]"),
-			_TL("Power on soil moisture (p), upper bound"),
-			PARAMETER_TYPE_Double,
-			5.0, 0.0, true, 5.0, true
-		);
-	}
-	//-----------------------------------------------------------------
-	// Linear module
-	//-----------------------------------------------------------------
-	switch(m_storconf)
-	{
-	case 0: // single storage
-		s.Printf(SG_T("Node3"), 3);
-		pNode = P.Add_Node(NULL,s,_TL("Linear Module"),_TL(""));
-
-		s.Printf(SG_T("Node3-1"), 3-1);
-		pNode1 = P.Add_Node(pNode,s,_TL("Parameter (a)"),_TL(""));
-
-		P.Add_Value(
-			pNode1,	"AFAC_lb",	_TL("(a) [lower bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			-0.5, -0.99, true, -0.01, true
-		);
-		P.Add_Value(
-			pNode1,	"AFAC_ub",	_TL("(a) [upper bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			-0.9, -0.99, true, -0.01, true
-		);
-
-		s.Printf(SG_T("Node3-2"), 3-2);
-		pNode1 = P.Add_Node(pNode,s,_TL("Parameter (b)"),_TL(""));
-
-		P.Add_Value(
-			pNode1,	"BFAC_lb",	_TL("(b) [lower bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			0.0, 0.001, true, 1.0, true
-		);
-		P.Add_Value(
-			pNode1,	"BFAC_ub",	_TL("(b) [upper bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			1.0, 0.001, true, 1.0, true
-		);
-		break;
-
-	case 1: // two parallel storages
-		s.Printf(SG_T("Node3"), 3);
-		pNode = P.Add_Node(NULL,s,_TL("Linear Module"),_TL(""));
-
-		// Parameter a
-		s.Printf(SG_T("Node3-1"), 3-1);
-		pNode1 = P.Add_Node(pNode,s,_TL("Parameter (a)"),_TL(""));
-
-		P.Add_Value(
-			pNode1,	"AQ_lb",	_TL("a(q) [lower bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			-0.5, -0.99, true, -0.01, true
-		);
-		P.Add_Value(
-			pNode1,	"AQ_ub",	_TL("a(q) [upper bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			-0.7, -0.99, true, -0.01, true
-		);
-		P.Add_Value(
-			pNode1,	"AS_lb",	_TL("a(s) [lower bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			-0.7, -0.99, true, -0.01, true
-		);
-		P.Add_Value(
-			pNode1,	"AS_ub",	_TL("a(s) [upper bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			-0.99, -0.99, true, -0.01, true
-		);
-
-		// Parameter b
-		s.Printf(SG_T("Node3-2"), 3-2);
-		pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (b)"),_TL(""));
-
-		P.Add_Value(
-			pNode1,	"BQ_lb",	_TL("b(q) [lower bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			0.0, 0.0, true, 1.0, true
-		);
-		P.Add_Value(
-			pNode1,	"BQ_ub",	_TL("b(q) [upper bound]"),
-			_TL(""),
-			PARAMETER_TYPE_Double,
-			0.5, 0.0, true, 1.0, true
-		);
-		break;
-	case 2: // two storages in series
-		break;
-	} // end switch (m_storconf)
-
-
-	//-----------------------------------------------------------------
-	// Snow module
-	//-----------------------------------------------------------------
-	if (m_bSnowModule) // if snow module is active
-	{
-		s.Printf(SG_T("Node2-4"), 2-4);
-		pNode = P.Add_Node(NULL,s,SG_T("Snow Module"),_TL(""));
-
-		P.Add_Value(
-			pNode,	"T_RAIN_lb",	_TL("Temperature Threshold for Rainfall (lower bound)"),
-			_TL("Below this threshold precipitation will fall as snow"),
-			PARAMETER_TYPE_Double,
-			-1.0, -10.0, true, 10.0, true
-		);
-		P.Add_Value(
-			pNode,	"T_RAIN_ub",	_TL("Temperature Threshold for Rainfall (upper bound)"),
-			_TL("Below this threshold precipitation will fall as snow"),
-			PARAMETER_TYPE_Double,
-			1.0, -10.0, true, 10.0, true
-		);
-		P.Add_Value(
-			pNode,	"T_MELT_lb",	_TL("Temperature Threshold for Melting (lower bound)"),
-			_TL("Above this threshold snow will start to melt"),
-			PARAMETER_TYPE_Double,
-			-1.0, -5.0, true, 10.0, true
-		);
-		P.Add_Value(
-			pNode,	"T_MELT_ub",	_TL("Temperature Threshold for Melting (upper bound)"),
-			_TL("Above this threshold snow will start to melt"),
-			PARAMETER_TYPE_Double,
-			1.0, -5.0, true, 10.0, true
-		);
-		P.Add_Value(
-			pNode,	"DD_FAC_lb",	_TL("Day-Degree Factor (lower bound)"),
-			_TL("Day-Degree Factor depends on catchment characteristics"),
-			PARAMETER_TYPE_Double,
-			0.7, 0.7, true, 9.2, true
-		);
-		P.Add_Value(
-			pNode,	"DD_FAC_ub",	_TL("Day-Degree Factor (upper bound)"),
-			_TL("Day-Degree Factor depends on catchment characteristics"),
-			PARAMETER_TYPE_Double,
-			9.2, 0.7, true, 9.2, true
-		);
-	}
-
-
-
-	s.Printf(SG_T("Node4"), 4);
-	pNode = P.Add_Node(NULL,s,SG_T("Time Delay after Start of Rainfall (INTEGER)"),_TL(""));
-		
-	P.Add_Value(
-		pNode1,	"DELAY",	_TL("Time Delay (Rain-Runoff)"),
-		_TL("The delay after the start of rainfall, before the discharge starts to rise."),
-		PARAMETER_TYPE_Int,
-		1, 1, true, 100, true
-	);
-
-	s.Printf(SG_T("Node6"), 6);
-	pNode = P.Add_Node(NULL,s,SG_T("Nash-Sutcliffe Efficiency"),_TL(""));
-
-	P.Add_Choice(
-		pNode, "OBJ_FUNC"		, _TL("Objective Function"),
-		_TL(""),
-		_TL("NSE|NSE high flow|NSE low flow")
-	);
-
-	P.Add_Value(
-		pNode,	"NSEMIN",	_TL("Minimum Nash-Sutcliffe Efficiency"),
-		_TL("Minimum Nash-Sutcliffe Efficiency required to print simulation to calibration table"),
-		PARAMETER_TYPE_Double,
-		0.7, 0.1, true, 1.0, true
-	);
-	// End of second dialog design
-
-
-	if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) )
-	{
-		// assign data from second dialog
-
-		m_date1			= P(CSG_String::Format(SG_T("FDAY"),m_dateField).c_str())->asString();
-		m_date2			= P(CSG_String::Format(SG_T("LDAY"),m_dischargeField).c_str())->asString();
-
-		//-------------------------------------------------
-		// assign non-linear module parameters
-		//-------------------------------------------------
-		m_TwConst_lb	= P("TwFAC_lb")					->asDouble();
-		m_TwConst_ub	= P("TwFAC_ub")					->asDouble();
-		m_c_lb			= P("CFAC_lb")					->asDouble();
-		m_c_ub			= P("CFAC_ub")					->asDouble();
-
-		if (m_bTMP) // if observed temperature data are used
-		{
-			m_f_lb		= P("TFAC_lb")					->asDouble();
-			m_f_ub		= P("TFAC_ub")					->asDouble();
-		}
-		if (m_IHAC_version == 1)
-		{
-			m_l_lb		= P("SMI_L_lb")					->asDouble();
-			m_l_ub		= P("SMI_L_ub")					->asDouble();
-			m_p_lb		= P("SM_P_lb")					->asDouble();
-			m_p_ub		= P("SM_P_ub")					->asDouble();
-		}
-		//-------------------------------------------------
-
-		//-------------------------------------------------
-		// assign linear module parameters
-		//-------------------------------------------------
-		switch (m_storconf)
-		{
-		case 0:
-			m_a_lb		= P("AFAC_lb")				->asDouble();
-			m_a_ub		= P("AFAC_ub")				->asDouble();
-			m_b_lb		= P("BFAC_lb")				->asDouble();
-			m_b_ub		= P("BFAC_ub")				->asDouble();
-			m_delay		= P("DELAY")				->asInt();
-			m_NSEmin	= P("NSEMIN")				->asDouble();
-			break;
-		case 1: // two parallel storages
-			m_aq_lb		= P("AQ_lb")				->asDouble();
-			m_aq_ub		= P("AQ_ub")				->asDouble();
-			m_as_lb		= P("AS_lb")				->asDouble();
-			m_as_ub		= P("AS_ub")				->asDouble();
-			m_bq_lb		= P("BQ_lb")				->asDouble();
-			m_bq_ub		= P("BQ_ub")				->asDouble();
-
-			m_delay		= P("DELAY")				->asInt();
-			m_obj_func	= P("OBJ_FUNC")				->asInt();
-			m_NSEmin	= P("NSEMIN")				->asDouble();
-			break;
-		case 2: // two storages in series
-			break;
-		} // end switch
-		//-------------------------------------------------
-
-		if (m_bSnowModule)
-		{
-			m_T_Rain_lb	= P("T_RAIN_lb")			->asDouble();
-			m_T_Rain_ub	= P("T_RAIN_ub")			->asDouble();
-			m_T_Melt_lb	= P("T_MELT_lb")			->asDouble();
-			m_T_Melt_ub	= P("T_MELT_ub")			->asDouble();
-			m_DD_FAC_lb	= P("DD_FAC_lb")			->asDouble();
-			m_DD_FAC_ub	= P("DD_FAC_ub")			->asDouble();
-		}
-		return(true);
-	} else {
-		return(false);
-	}
-}
diff --git a/src/modules_contrib/garden/Makefile.am b/src/modules_contrib/garden/Makefile.am
deleted file mode 100644
index 78f234b..0000000
--- a/src/modules_contrib/garden/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-if WITH_GUI
-SUBDIRS = garden_3d_viewer garden_webservices
-else
-SUBDIRS = 
-endif
diff --git a/src/modules_contrib/garden/Makefile.in b/src/modules_contrib/garden/Makefile.in
deleted file mode 100644
index 05f08b0..0000000
--- a/src/modules_contrib/garden/Makefile.in
+++ /dev/null
@@ -1,590 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/garden
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = garden_3d_viewer garden_webservices
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at WITH_GUI_FALSE@SUBDIRS = 
- at WITH_GUI_TRUE@SUBDIRS = garden_3d_viewer garden_webservices
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/garden/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/garden/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.cpp b/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.cpp
deleted file mode 100644
index cf5ceab..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.cpp
+++ /dev/null
@@ -1,1016 +0,0 @@
-/**********************************************************
- * Version $Id: 3d_multigrid_view_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      3d_viewer                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              3d_multigrid_view_control.cpp            //
-//                                                       //
-//                 Copyright (C) 2013 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <wx/wxprec.h>
-
-#include <wx/settings.h>
-#include <wx/dc.h>
-#include <wx/dcclient.h>
-
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#include "3d_multigrid_view_control.h"
-#include "3d_multigrid_view_dialog.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define m_Settings	(*m_pSettings)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(C3D_MultiGrid_View_Control, wxPanel)
-	EVT_SIZE				(C3D_MultiGrid_View_Control::On_Size)
-	EVT_PAINT				(C3D_MultiGrid_View_Control::On_Paint)
-	EVT_KEY_DOWN			(C3D_MultiGrid_View_Control::On_Key_Down)
-	EVT_LEFT_DOWN			(C3D_MultiGrid_View_Control::On_Mouse_LDown)
-	EVT_LEFT_UP				(C3D_MultiGrid_View_Control::On_Mouse_LUp)
-	EVT_RIGHT_DOWN			(C3D_MultiGrid_View_Control::On_Mouse_RDown)
-	EVT_RIGHT_UP			(C3D_MultiGrid_View_Control::On_Mouse_RUp)
-	EVT_MIDDLE_DOWN			(C3D_MultiGrid_View_Control::On_Mouse_MDown)
-	EVT_MIDDLE_UP			(C3D_MultiGrid_View_Control::On_Mouse_MUp)
-	EVT_MOTION				(C3D_MultiGrid_View_Control::On_Mouse_Motion)
-	EVT_MOUSEWHEEL			(C3D_MultiGrid_View_Control::On_Mouse_Wheel)
-END_EVENT_TABLE()
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-C3D_MultiGrid_View_Control::C3D_MultiGrid_View_Control(wxWindow *pParent, CSG_Parameter_Grid_List *pGrids, int Field_Color, CSG_Parameters &Settings)
-	: wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE)
-{
-	m_pGrids	= pGrids;
-
-	m_pSettings	= &Settings;
-
-	m_cField	= Field_Color;
-
-	m_Shading	= 1;
-
-	m_Style		= 1;
-
-	m_xRotate	= 0.0;
-	m_yRotate	= 0.0;
-	m_zRotate	= 0.0;
-
-	m_xShift	= 0.0;
-	m_yShift	= 0.0;
-	m_zShift	= 1000.0;
-
-	m_bCentral	= true;
-	m_bStereo	= false;
-	m_bFrame	= true;
-
-	m_Light_Hgt	=  45.0 * M_DEG_TO_RAD;
-	m_Light_Dir	=  90.0 * M_DEG_TO_RAD;
-
-	m_dCentral	= 500.0;
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pNode	= m_pSettings->Add_Node(NULL, "NODE_CONTROL", _TL("3D View"), _TL(""));
-
-	m_pSettings->Add_Colors(
-		pNode	, "COLORS"			, _TL("Colors"),
-		_TL("")
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "BGCOLOR"			, _TL("Background Color"),
-		_TL(""),
-		PARAMETER_TYPE_Color, 0
-	);
-
-	m_pSettings->Add_Range(
-		pNode	, "C_RANGE"			, _TL("Colors Value Range"),
-		_TL("")
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "SIZE_DEF"		, _TL("Point Size: Default"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 0, 0, true
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "SIZE_SCALE"		, _TL("Point Size: Scaling"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 250.0, 1.0, true
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "EXAGGERATION"	, _TL("Exaggeration"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "STEREO_DIST"		, _TL("Stereo Eye Distance [Degree]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	//-----------------------------------------------------
-	Update_Extent();
-}
-
-//---------------------------------------------------------
-C3D_MultiGrid_View_Control::~C3D_MultiGrid_View_Control(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Size(wxSizeEvent &event)
-{
-	_Set_Size();
-
-	event.Skip();
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Paint(wxPaintEvent &WXUNUSED(event))
-{
-	if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 )
-	{
-		wxPaintDC	dc(this);
-
-		dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false);
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::Update_View(void)
-{
-	if( _Draw_Image() )
-	{
-		wxClientDC	dc(this);
-
-		dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false);
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::Update_Extent(void)
-{
-	m_Extent.Assign(m_pGrids->asGrid(0)->Get_Extent());
-
-	m_zMin	= m_pGrids->asGrid(0)->Get_ZMin();
-	m_zMax	= m_pGrids->asGrid(0)->Get_ZMax();
-
-	for(int i=1; i<m_pGrids->Get_Count(); i++)
-	{
-		m_Extent.Union(m_pGrids->asGrid(i)->Get_Extent());
-
-		if( m_zMin > m_pGrids->asGrid(i)->Get_ZMin() )
-			m_zMin = m_pGrids->asGrid(i)->Get_ZMin();
-
-		if( m_zMax < m_pGrids->asGrid(i)->Get_ZMax() )
-			m_zMax = m_pGrids->asGrid(i)->Get_ZMax();
-	}
-
-	Update_View();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Key_Down(wxKeyEvent &event)
-{
-	switch( event.GetKeyCode() )
-	{
-	default:
-		event.Skip();
-		return;
-
-	case WXK_NUMPAD_ADD:
-	case WXK_ADD:		m_xRotate	-= 4.0 * M_DEG_TO_RAD;	break;
-	case WXK_NUMPAD_SUBTRACT:
-	case WXK_SUBTRACT:	m_xRotate	+= 4.0 * M_DEG_TO_RAD;	break;
-
-	case WXK_F3:		m_yRotate	-= 4.0 * M_DEG_TO_RAD;	break;
-	case WXK_F4:		m_yRotate	+= 4.0 * M_DEG_TO_RAD;	break;
-
-	case WXK_NUMPAD_MULTIPLY:
-	case WXK_MULTIPLY:	m_zRotate	-= 4.0 * M_DEG_TO_RAD;	break;
-	case WXK_NUMPAD_DIVIDE:
-	case WXK_DIVIDE:	m_zRotate	+= 4.0 * M_DEG_TO_RAD;	break;
-
-	case WXK_INSERT:	m_xShift	-= 10.0;				break;
-	case WXK_DELETE:	m_xShift	+= 10.0;				break;
-
-	case WXK_HOME:		m_yShift	-= 10.0;				break;
-	case WXK_END:		m_yShift	+= 10.0;				break;
-
-	case WXK_PAGEUP:	m_zShift	-= 10.0;				break;
-	case WXK_PAGEDOWN:	m_zShift	+= 10.0;				break;
-
-	case 'A':			m_bStereo	= !m_bStereo;			break;
-
-	case WXK_F1:		m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() + 0.5);	break;
-	case WXK_F2:		m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() - 0.5);	break;
-
-	case WXK_F5:		m_Settings("SIZE_DEF")    ->Set_Value(m_Settings("SIZE_DEF")    ->asDouble() - 1.0);	break;
-	case WXK_F6:		m_Settings("SIZE_DEF")    ->Set_Value(m_Settings("SIZE_DEF")    ->asDouble() + 1.0);	break;
-
-	case WXK_F7:		m_Settings("SIZE_SCALE")  ->Set_Value(m_Settings("SIZE_SCALE")  ->asDouble() - 10.0);	break;
-	case WXK_F8:		m_Settings("SIZE_SCALE")  ->Set_Value(m_Settings("SIZE_SCALE")  ->asDouble() + 10.0);	break;
-	}
-
-	Update_View();
-
-	((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation();
-}
-
-//---------------------------------------------------------
-#define GET_MOUSE_X_RELDIFF	((double)(m_Mouse_Down.x - event.GetX()) / (double)GetClientSize().x)
-#define GET_MOUSE_Y_RELDIFF	((double)(m_Mouse_Down.y - event.GetY()) / (double)GetClientSize().y)
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Mouse_LDown(wxMouseEvent &event)
-{
-	SetFocus();
-
-	m_Mouse_Down	= event.GetPosition();
-	m_xDown			= m_zRotate;
-	m_yDown			= m_xRotate;
-
-	CaptureMouse();
-}
-
-void C3D_MultiGrid_View_Control::On_Mouse_LUp(wxMouseEvent &event)
-{
-	if( HasCapture() )
-	{
-		ReleaseMouse();
-	}
-
-	if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() )
-	{
-		m_zRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-		m_xRotate	= m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180;
-
-		Update_View();
-
-		((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Mouse_RDown(wxMouseEvent &event)
-{
-	SetFocus();
-
-	m_Mouse_Down	= event.GetPosition();
-	m_xDown			= m_xShift;
-	m_yDown			= m_yShift;
-
-	CaptureMouse();
-}
-
-void C3D_MultiGrid_View_Control::On_Mouse_RUp(wxMouseEvent &event)
-{
-	if( HasCapture() )
-	{
-		ReleaseMouse();
-	}
-
-	if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() )
-	{
-		m_xShift	= m_xDown - GET_MOUSE_X_RELDIFF * 1000.0;
-		m_yShift	= m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0;
-
-		Update_View();
-
-		((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Mouse_MDown(wxMouseEvent &event)
-{
-	SetFocus();
-
-	m_Mouse_Down	= event.GetPosition();
-	m_xDown			= m_yRotate;
-	m_yDown			= m_zShift;
-
-	CaptureMouse();
-}
-
-void C3D_MultiGrid_View_Control::On_Mouse_MUp(wxMouseEvent &event)
-{
-	if( HasCapture() )
-	{
-		ReleaseMouse();
-	}
-
-	if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() )
-	{
-		m_yRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-		m_zShift	= m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0;
-
-		Update_View();
-
-		((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Mouse_Motion(wxMouseEvent &event)
-{
-	if( HasCapture() && event.Dragging() )
-	{
-		if( event.LeftIsDown() )
-		{
-			m_zRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-			m_xRotate	= m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180;
-		}
-		else if( event.RightIsDown() )
-		{
-			m_xShift	= m_xDown - GET_MOUSE_X_RELDIFF * 1000.0;
-			m_yShift	= m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0;
-		}
-		else if( event.MiddleIsDown() )
-		{
-			m_yRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-			m_zShift	= m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0;
-		}
-		else
-		{
-			return;
-		}
-
-		Update_View();
-
-		((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::On_Mouse_Wheel(wxMouseEvent &event)
-{
-	if( event.GetWheelRotation() )
-	{
-		m_zShift	+= 0.5 * event.GetWheelRotation();
-
-		Update_View();
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::_Set_Size(void)
-{
-	Update_View();
-}
-
-//---------------------------------------------------------
-bool C3D_MultiGrid_View_Control::_Draw_Image(void)
-{
-	wxSize	dcSize	= GetClientSize();
-
-	if( m_pGrids->Get_Count() <= 0
-	||	dcSize.x <= 0 || dcSize.y <= 0
-	||	m_Extent.Get_XRange() <= 0.0 || m_Extent.Get_YRange() <= 0.0 )
-	{
-		return( false );
-	}
-
-	//-------------------------------------------------
-	if( !m_Image.IsOk() || dcSize.x != m_Image.GetWidth() || dcSize.y != m_Image.GetHeight() )
-	{
-		m_Image		.Create(dcSize.x, dcSize.y);
-		m_Image_zMax.Create(dcSize.x, dcSize.y);
-	}
-
-	//-------------------------------------------------
-	r_Scale		= (m_Image.GetWidth() / (double)m_Image.GetHeight()) > (m_Extent.Get_XRange() / m_Extent.Get_YRange())
-				? m_Image.GetWidth () / m_Extent.Get_XRange()
-				: m_Image.GetHeight() / m_Extent.Get_YRange();
-
-	r_sin_x		= sin(m_xRotate - M_PI_180);
-	r_cos_x		= cos(m_xRotate - M_PI_180);
-	r_sin_y		= sin(m_yRotate);
-	r_cos_y		= cos(m_yRotate);
-	r_sin_z		= sin(m_zRotate);
-	r_cos_z		= cos(m_zRotate);
-
-	r_xc		= m_Extent.Get_XCenter();
-	r_yc		= m_Extent.Get_YCenter();
-	r_zc		= m_zMin + 0.5 * (m_zMax - m_zMin);
-
-	r_Scale_z	= r_Scale * m_Settings("EXAGGERATION")->asDouble();
-
-	//-----------------------------------------------------
-	m_Size_Def		= m_Settings("SIZE_DEF")->asInt();
-	m_Size_Scale	= 1.0 / m_Settings("SIZE_SCALE")->asDouble();
-
-	_Draw_Background();
-
-	//-----------------------------------------------------
-	m_Image_zMax.Assign(999999.0);
-
-	m_Color_Mode	= COLOR_MODE_RGB;
-
-	for(int i=0; i<m_pGrids->Get_Count(); i++)
-	{
-		_Draw_Grid(m_pGrids->asGrid(i));
-	}
-
-	_Draw_Frame();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::_Draw_Grid(CSG_Grid *pGrid)
-{
-	double	z_NoData_Lo	= pGrid->Get_NoData_Value();
-	double	z_NoData_Hi	= pGrid->Get_NoData_hiValue();
-
-	CSG_Colors	Colors;
-
-	if( SG_UI_DataObject_Colors_Get(pGrid, &Colors) )
-		m_pColors	= &Colors;
-	else
-		m_pColors	= m_Settings("COLORS")->asColors();
-
-	m_cMin		= pGrid->Get_ZMin();
-	m_cScale	= m_pColors->Get_Count() / pGrid->Get_ZRange();
-
-	#pragma omp parallel for
-	for(int y=1; y<pGrid->Get_NY(); y++)
-	{
-		double	p_x, p_y[2];
-		TNode	a[2], b[2];
-
-		p_x		= pGrid->Get_XMin();
-		p_y[1]	= pGrid->Get_YMin() + y * pGrid->Get_Cellsize();
-		p_y[0]	= p_y[1] - pGrid->Get_Cellsize();
-
-		b[0].y = p_y[0]; b[0].x = p_x; b[0].z = pGrid->asDouble(0, y - 1); b[0].c = b[0].z; _Get_Projection(b[0]);
-		b[1].y = p_y[1]; b[1].x = p_x; b[1].z = pGrid->asDouble(0, y    ); b[1].c = b[1].z; _Get_Projection(b[1]);
-
-		for(int x=1; x<pGrid->Get_NX(); x++)
-		{
-			p_x	+= pGrid->Get_Cellsize();
-
-			a[0] = b[0]; b[0].y = p_y[0]; b[0].x = p_x; b[0].z = pGrid->asDouble(x, y - 1); b[0].c = b[0].z; _Get_Projection(b[0]);
-			a[1] = b[1]; b[1].y = p_y[1]; b[1].x = p_x; b[1].z = pGrid->asDouble(x, y    ); b[1].c = b[1].z; _Get_Projection(b[1]);
-
-			_Draw_Triangle(a[0], b[1], a[1], z_NoData_Lo, z_NoData_Hi);
-			_Draw_Triangle(a[0], b[1], b[0], z_NoData_Lo, z_NoData_Hi);
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Draw_Triangle(TNode a, TNode b, TNode c, double c_NoData_Lo, double c_NoData_Hi)
-{
-	if( SG_IS_BETWEEN(c_NoData_Lo, a.c, c_NoData_Hi)
-	||  SG_IS_BETWEEN(c_NoData_Lo, b.c, c_NoData_Hi)
-	||  SG_IS_BETWEEN(c_NoData_Lo, c.c, c_NoData_Hi) )
-		return;
-
-	TNode	t[3]; t[0] = a; t[1] = b; t[2] = c;
-
-	//-----------------------------------------------------
-	double	dim;
-
-	if( !m_Shading )
-	{
-		dim	= -1.0;
-	}
-	else
-	{
-		double	s, a, A, B, C;
-
-		A		= t[0].z * (t[1].x - t[2].x) + t[1].z * (t[2].x - t[0].x) + t[2].z * (t[0].x - t[1].x);
-		B		= t[0].y * (t[1].z - t[2].z) + t[1].y * (t[2].z - t[0].z) + t[2].y * (t[0].z - t[1].z);
-		C		= t[0].x * (t[1].y - t[2].y) + t[1].x * (t[2].y - t[0].y) + t[2].x * (t[0].y - t[1].y);
-
-		if( C != 0.0 )
-		{
-			A	= - A / C;
-			B	= - B / C;
-
-			s	= atan(sqrt(A*A + B*B));
-
-			if( A != 0.0 )
-				a	= M_PI_180 + atan2(B, A);
-			else
-				a	= B > 0.0 ? M_PI_270 : (B < 0.0 ? M_PI_090 : -1.0);
-		}
-
-		s	= M_PI_090 - s;
-		dim	= (acos(sin(s) * sin(m_Light_Hgt) + cos(s) * cos(m_Light_Hgt) * cos(a - m_Light_Dir))) / M_PI_090;
-	}
-
-	//-----------------------------------------------------
-	_Draw_Triangle(t, dim);
-}
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Draw_Point(int x, int y, double z, int color, int size)
-{
-	if( z > 0.0 )
-	{
-		_Draw_Pixel(x, y, z, color);
-
-		if( size > 0 && size < 50 )
-		{
-			for(int iy=1; iy<=size; iy++)
-			{
-				for(int ix=0; ix<=size; ix++)
-				{
-					if( ix*ix + iy*iy <= size*size )
-					{
-						_Draw_Pixel(x + ix, y + iy, z, color);
-						_Draw_Pixel(x + iy, y - ix, z, color);
-						_Draw_Pixel(x - ix, y - iy, z, color);
-						_Draw_Pixel(x - iy, y + ix, z, color);
-					}
-				}
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Draw_Line(TNode a, TNode b, int Color)
-{
-	if(	(a.x < 0 && b.x < 0) || (a.x >= m_Image.GetWidth () && b.x >= m_Image.GetWidth ())
-	||	(a.y < 0 && b.y < 0) || (a.y >= m_Image.GetHeight() && b.y >= m_Image.GetHeight()) )
-	{
-		return;
-	}
-
-	double	i, n, dx, dy, dz;
-
-	dx		= b.x - a.x;
-	dy		= b.y - a.y;
-	dz		= b.z - a.z;
-
-	if( b.z < 0.0 || a.z < 0.0 )
-		return;
-
-	if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 )
-	{
-		n	 = fabs(dx);
-		dx	 = dx < 0 ? -1 : 1;
-		dy	/= n;
-		dz	/= n;
-	}
-	else if( fabs(dy) > 0.0 )
-	{
-		n	 = fabs(dy);
-		dx	/= n;
-		dy	 = dy < 0 ? -1 : 1;
-		dz	/= n;
-	}
-	else
-	{
-		_Draw_Pixel((int)a.x, (int)a.y, a.z, Color);
-
-		return;
-	}
-
-	//-----------------------------------------------------
-	for(i=0; i<=n; i++, a.x+=dx, a.y+=dy, a.z+=dz)
-	{
-		_Draw_Pixel((int)a.x, (int)a.y, a.z, Color);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Draw_Triangle(TNode p[3], double dim)
-{
-	if( p[0].z < 0.0 || p[1].z < 0.0 || p[2].z < 0.0 )
-		return;
-
-	//-----------------------------------------------------
-	if( p[1].y < p[0].y ) {	TNode pp = p[1]; p[1] = p[0]; p[0] = pp;	}
-	if( p[2].y < p[0].y ) {	TNode pp = p[2]; p[2] = p[0]; p[0] = pp;	}
-	if( p[2].y < p[1].y ) {	TNode pp = p[2]; p[2] = p[1]; p[1] = pp;	}
-
-	//-----------------------------------------------------
-	TSG_Rect	r;
-
-	r.yMin	= p[0].y;
-	r.yMax	= p[2].y;
-	r.xMin	= p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x);
-	r.xMax	= p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x);
-
-	if( r.yMin >= r.yMax || r.xMin >= r.xMax )
-	{
-		return;	// no area
-	}
-
-	if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_Image.GetHeight() && r.yMax >= m_Image.GetHeight())
-	||	(r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_Image.GetWidth () && r.xMax >= m_Image.GetWidth ()) )
-	{
-		return;	// completely outside grid
-	}
-
-	//-----------------------------------------------------
-	TNode	d[3];
-
-	if( (d[0].y	= p[2].y - p[0].y) > 0.0 )
-	{
-		d[0].x	= (p[2].x - p[0].x) / d[0].y;
-		d[0].z	= (p[2].z - p[0].z) / d[0].y;
-		d[0].c	= (p[2].c - p[0].c) / d[0].y;
-	}
-
-	if( (d[1].y	= p[1].y - p[0].y) > 0.0 )
-	{
-		d[1].x	= (p[1].x - p[0].x) / d[1].y;
-		d[1].z	= (p[1].z - p[0].z) / d[1].y;
-		d[1].c	= (p[1].c - p[0].c) / d[1].y;
-	}
-
-	if( (d[2].y	= p[2].y - p[1].y) > 0.0 )
-	{
-		d[2].x	= (p[2].x - p[1].x) / d[2].y;
-		d[2].z	= (p[2].z - p[1].z) / d[2].y;
-		d[2].c	= (p[2].c - p[1].c) / d[2].y;
-	}
-
-	//-----------------------------------------------------
-	int	ay	= (int)r.yMin;	if( ay < 0 )	ay	= 0;	if( ay < r.yMin )	ay++;
-	int	by	= (int)r.yMax;	if( by >= m_Image.GetHeight() )	by	= m_Image.GetHeight() - 1;
-
-	for(int y=ay; y<=by; y++)
-	{
-		if( y <= p[1].y && d[1].y > 0.0 )
-		{
-			_Draw_Triangle_Line(y,
-				p[0].x + (y - p[0].y) * d[0].x,
-				p[0].x + (y - p[0].y) * d[1].x,
-				p[0].z + (y - p[0].y) * d[0].z,
-				p[0].z + (y - p[0].y) * d[1].z,
-				p[0].c + (y - p[0].y) * d[0].c,
-				p[0].c + (y - p[0].y) * d[1].c,
-				dim
-			);
-		}
-		else if( d[2].y > 0.0 )
-		{
-			_Draw_Triangle_Line(y,
-				p[0].x + (y - p[0].y) * d[0].x,
-				p[1].x + (y - p[1].y) * d[2].x,
-				p[0].z + (y - p[0].y) * d[0].z,
-				p[1].z + (y - p[1].y) * d[2].z,
-				p[0].c + (y - p[0].y) * d[0].c,
-				p[1].c + (y - p[1].y) * d[2].c,
-				dim
-			);
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double dim)
-{
-	if( xb < xa )
-	{
-		double	d;
-
-		d	= xa;	xa	= xb;	xb	= d;
-		d	= za;	za	= zb;	zb	= d;
-		d	= ca;	ca	= cb;	cb	= d;
-	}
-
-	if( xb > xa )
-	{
-		double	dz	= (zb - za) / (xb - xa);
-		double	dc	= (cb - ca) / (xb - xa);
-		int		ax	= (int)xa;	if( ax < 0 )	ax	= 0;	if( ax < xa )	ax++;
-		int		bx	= (int)xb;	if( bx >= m_Image.GetWidth() )	bx	= m_Image.GetWidth() - 1;
-
-		for(int x=ax; x<=bx; x++)
-		{
-			double	z	= za + dz * (x - xa);
-			double	c	= ca + dc * (x - xa);
-
-			_Draw_Pixel(x, y, z, _Get_Color(c, dim));
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::_Draw_Background(void)
-{
-	BYTE	r, g, b, *pRGB;
-	int		i, n, color;
-
-	color	= m_Settings("BGCOLOR")->asColor();
-
-	if( m_bStereo )
-	{
-		color	= (int)((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3.0);
-		color	= SG_GET_RGB(color, color, color);
-	}
-
-	r	= SG_GET_R(color);
-	g	= SG_GET_G(color);
-	b	= SG_GET_B(color);
-
-	n	= m_Image.GetWidth() * m_Image.GetHeight();
-
-	for(i=0, pRGB=m_Image.GetData(); i<n; i++)
-	{
-		*pRGB	= r;	pRGB++;
-		*pRGB	= g;	pRGB++;
-		*pRGB	= b;	pRGB++;
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Control::_Draw_Frame(void)
-{
-	if( !m_bFrame )
-	{
-		return;
-	}
-
-	int			color;
-	double		buffer	= 1.0;
-	CSG_Rect	r(m_Extent);
-	TNode		p[2][4];
-
-	r.Inflate(buffer);
-
-	color	= m_Settings("BGCOLOR")->asColor();
-	color	= SG_GET_RGB(SG_GET_R(color) + 128, SG_GET_G(color) + 128, SG_GET_B(color) + 128);
-
-	for(int i=0; i<2; i++)
-	{
-		p[i][0].x	= r.Get_XMin();	p[i][0].y	= r.Get_YMin();
-		p[i][1].x	= r.Get_XMax();	p[i][1].y	= r.Get_YMin();
-		p[i][2].x	= r.Get_XMax();	p[i][2].y	= r.Get_YMax();
-		p[i][3].x	= r.Get_XMin();	p[i][3].y	= r.Get_YMax();
-
-		p[i][0].z	= p[i][1].z = p[i][2].z = p[i][3].z = i == 0
-			? m_zMin - buffer * (m_zMax - m_zMin) / 100.0
-			: m_zMax + buffer * (m_zMax - m_zMin) / 100.0;
-
-		for(int j=0; j<4; j++)
-		{
-			_Get_Projection(p[i][j]);
-		}
-
-		_Draw_Line(p[i][0], p[i][1], color);
-		_Draw_Line(p[i][1], p[i][2], color);
-		_Draw_Line(p[i][2], p[i][3], color);
-		_Draw_Line(p[i][3], p[i][0], color);
-	}
-
-	_Draw_Line(p[0][0], p[1][0], color);
-	_Draw_Line(p[0][1], p[1][1], color);
-	_Draw_Line(p[0][2], p[1][2], color);
-	_Draw_Line(p[0][3], p[1][3], color);
-}
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Draw_Pixel(int x, int y, double z, int color)
-{
-	if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() && z < m_Image_zMax[y][x] )
-	{
-		BYTE	*RGB	= m_Image.GetData() + 3 * (y * m_Image.GetWidth() + x);
-
-		switch( m_Color_Mode )
-		{
-		case COLOR_MODE_RGB:
-			RGB[0]	= SG_GET_R(color);
-			RGB[1]	= SG_GET_G(color);
-			RGB[2]	= SG_GET_B(color);
-			break;
-
-		case COLOR_MODE_RED:
-			RGB[0]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
-			break;
-
-		case COLOR_MODE_BLUE:
-			RGB[1]	=
-			RGB[2]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
-			break;
-		}
-
-		m_Image_zMax[y][x]	= z;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline int C3D_MultiGrid_View_Control::_Get_Color(double value, double dim)
-{
-	int		Color;
-	double	iClass	= m_cScale * (value - m_cMin);
-
-	if( iClass < 0 )
-	{
-		Color	= m_pColors->Get_Color(0);
-	}
-	else if( iClass >= m_pColors->Get_Count() - 1 )
-	{
-		Color	= m_pColors->Get_Color(m_pColors->Get_Count() - 1);
-	}
-	else
-	{
-		int		a	= m_pColors->Get_Color(    (int)iClass);
-		int		b	= m_pColors->Get_Color(1 + (int)iClass);
-		double	d	= iClass - (int)iClass;
-
-		Color	= SG_GET_RGB(
-			SG_GET_R(a) + d * (SG_GET_R(b) - SG_GET_R(a)),
-			SG_GET_G(a) + d * (SG_GET_G(b) - SG_GET_G(a)),
-			SG_GET_B(a) + d * (SG_GET_B(b) - SG_GET_B(a))
-		);
-	}
-
-	if( dim >= 0.0 )
-	{
-		int	r	= (int)(dim * SG_GET_R(Color));	if( r < 0 )	r	= 0; else if( r > 255 )	r	= 255;
-		int	g	= (int)(dim * SG_GET_G(Color));	if( g < 0 )	g	= 0; else if( g > 255 )	g	= 255;
-		int	b	= (int)(dim * SG_GET_B(Color));	if( b < 0 )	b	= 0; else if( b > 255 )	b	= 255;
-
-		Color	= SG_GET_RGB(r, g, b);
-	}
-
-	return( Color );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void C3D_MultiGrid_View_Control::_Get_Projection(TNode &p)
-{
-	TSG_Point_Z	q;
-
-	p.x	= (p.x - r_xc) * r_Scale;
-	p.y	= (p.y - r_yc) * r_Scale;
-	p.z	= (p.z - r_zc) * r_Scale_z;
-
-	double	a	= (r_cos_y * p.z + r_sin_y * (r_sin_z * p.y + r_cos_z * p.x));
-	double	b	= (r_cos_z * p.y - r_sin_z * p.x);
-
-	q.x	= r_cos_y * (r_sin_z * p.y + r_cos_z * p.x) - r_sin_y * p.z;
-	q.y	= r_sin_x * a + r_cos_x * b;
-	q.z	= r_cos_x * a - r_sin_x * b;
-
-	q.x	+= m_xShift;
-	q.y	+= m_yShift;
-	q.z	+= m_zShift;
-
-	if( m_bCentral )
-	{
-		q.x	*= m_dCentral / q.z;
-		q.y	*= m_dCentral / q.z;
-	}
-	else
-	{
-		double	z	= m_dCentral / m_zShift;
-		q.x	*= z;
-		q.y	*= z;
-	//	q.z	 = -q.z;
-	}
-
-	p.x	= q.x + 0.5 * m_Image.GetWidth ();
-	p.y	= q.y + 0.5 * m_Image.GetHeight();
-	p.z	= q.z;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.h b/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.h
deleted file mode 100644
index 385573d..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/**********************************************************
- * Version $Id: 3d_multigrid_view_control.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      3d_viewer                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               3d_multigrid_view_control.h             //
-//                                                       //
-//                 Copyright (C) 2013 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__3d_multigrid_view_control_H
-#define HEADER_INCLUDED__3d_multigrid_view_control_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <saga_gdi/saga_gdi.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	COLOR_MODE_RGB,
-	COLOR_MODE_RED,
-	COLOR_MODE_BLUE
-};
-
-//---------------------------------------------------------
-typedef struct SNode
-{
-	double	x, y, z, c;
-}
-TNode;
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class C3D_MultiGrid_View_Control : public wxPanel
-{
-public:
-	C3D_MultiGrid_View_Control(wxWindow *pParent, CSG_Parameter_Grid_List *pGrids, int Field_Color, CSG_Parameters &Settings);
-	virtual ~C3D_MultiGrid_View_Control(void);
-
-	bool						m_bCentral, m_bStereo, m_bFrame;
-
-	int							m_cField, m_Style, m_Shading;
-
-	double						m_xRotate, m_yRotate, m_zRotate, m_xShift, m_yShift, m_zShift, m_dCentral, m_Light_Hgt, m_Light_Dir;
-
-	void						Update_View				(void);
-	void						Update_Extent			(void);
-
-	void						On_Size					(wxSizeEvent  &event);
-	void						On_Paint				(wxPaintEvent &event);
-	void						On_Key_Down				(wxKeyEvent   &event);
-	void						On_Mouse_LDown			(wxMouseEvent &event);
-	void						On_Mouse_LUp			(wxMouseEvent &event);
-	void						On_Mouse_RDown			(wxMouseEvent &event);
-	void						On_Mouse_RUp			(wxMouseEvent &event);
-	void						On_Mouse_MDown			(wxMouseEvent &event);
-	void						On_Mouse_MUp			(wxMouseEvent &event);
-	void						On_Mouse_Motion			(wxMouseEvent &event);
-	void						On_Mouse_Wheel			(wxMouseEvent &event);
-
-
-private:
-
-	int							m_Color_Mode, m_Size_Def;
-
-	double						m_xDown, m_yDown, m_cMin, m_cScale, m_Size_Scale, m_zMin, m_zMax;
-
-	double						r_sin_x, r_sin_y, r_sin_z, r_cos_x, r_cos_y, r_cos_z, r_xc, r_yc, r_zc, r_Scale, r_Scale_z;
-
-	CSG_Rect					m_Extent;
-
-	CSG_Matrix					m_Image_zMax;
-
-	CSG_Parameters				*m_pSettings;
-
-	CSG_Colors					*m_pColors;
-
-	CSG_Parameter_Grid_List		*m_pGrids;
-
-	wxPoint						m_Mouse_Down;
-
-	wxImage						m_Image;
-
-
-	void						_Set_Size				(void);
-
-	bool						_Draw_Image				(void);
-
-	void						_Draw_Grid				(CSG_Grid *pGrid);
-
-	void						_Draw_Point				(int iPoint);
-	void						_Draw_Point				(int x, int y, double z, int color, int Size);
-
-	void						_Draw_Line				(TNode a, TNode b, int Color);
-
-	void						_Draw_Triangle			(TNode a, TNode b, TNode c, double c_NoData_Lo, double c_NoData_Hi);
-	void						_Draw_Triangle			(TNode p[3], double dim);
-	void						_Draw_Triangle_Line		(int y, double xa, double xb, double za, double zb, double ca, double cb, double dim);
-
-	void						_Draw_Background		(void);
-	void						_Draw_Frame				(void);
-	void						_Draw_Pixel				(int x, int y, double z, int color);
-
-	int							_Get_Color				(double value, double dim = -1.0);
-
-	void						_Get_Projection			(TNode &p);
-
-
-	DECLARE_EVENT_TABLE()
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__3d_multigrid_view_control_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.cpp b/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.cpp
deleted file mode 100644
index 81b7e8d..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/**********************************************************
- * Version $Id: 3d_multigrid_view_dialog.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      3d_viewer                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              3d_multigrid_view_dialog.cpp             //
-//                                                       //
-//                 Copyright (C) 2013 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "3d_multigrid_view_control.h"
-#include "3d_multigrid_view_dialog.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(C3D_MultiGrid_View_Dialog, CSGDI_Dialog)
-	EVT_MOUSEWHEEL	(C3D_MultiGrid_View_Dialog::On_Mouse_Wheel)
-	EVT_BUTTON		(wxID_ANY	, C3D_MultiGrid_View_Dialog::On_Button)
-	EVT_CHECKBOX	(wxID_ANY	, C3D_MultiGrid_View_Dialog::On_Update_Control)
-	EVT_TEXT_ENTER	(wxID_ANY	, C3D_MultiGrid_View_Dialog::On_Update_Control)
-	EVT_SLIDER		(wxID_ANY	, C3D_MultiGrid_View_Dialog::On_Update_Control)
-	EVT_CHOICE		(wxID_ANY	, C3D_MultiGrid_View_Dialog::On_Update_Choices)
-END_EVENT_TABLE()
-
-//---------------------------------------------------------
-C3D_MultiGrid_View_Dialog::C3D_MultiGrid_View_Dialog(CSG_Parameter_Grid_List *pGrids, int Field_Color)
-	: CSGDI_Dialog(_TL("Multi-Grid 3D Viewer"), SGDI_DLG_STYLE_START_MAXIMISED)
-{
-	SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE);
-
-	//-----------------------------------------------------
-	m_Settings.Create(NULL, _TL("Viewer Settings"), _TL(""));
-
-	m_pView		= new C3D_MultiGrid_View_Control	(this, pGrids, Field_Color, m_Settings);
-
-	//-----------------------------------------------------
-	wxArrayString	Styles, Shadings;
-
-	Styles  .Add(_TL("faces and wire"));
-	Styles  .Add(_TL("faces"));
-	Styles  .Add(_TL("wire"));
-
-	Shadings.Add(_TL("none"));
-	Shadings.Add(_TL("shading"));
-	Shadings.Add(_TL("shading (fixed light source)"));
-
-	//-----------------------------------------------------
-	Add_Button(_TL("Close"), wxID_OK);
-
-	m_pBtn_Prop			= Add_Button	(_TL("Advanced Settings")	, wxID_ANY);
-
-	Add_Spacer();
-	m_pStyle			= Add_Choice	(_TL("Draw Style")			, Styles    , m_pView->m_Style);
-	m_pShading			= Add_Choice	(_TL("Shading")				, Shadings  , m_pView->m_Shading);
-
-	Add_Spacer();
-	m_pCheck_Central	= Add_CheckBox	(_TL("Central Projection")	, m_pView->m_bCentral);
-	m_pCheck_Stereo		= Add_CheckBox	(_TL("Anaglyph")			, m_pView->m_bStereo);
-	m_pCheck_Frame		= Add_CheckBox	(_TL("Bounding Box")		, m_pView->m_bFrame);
-
-	Add_Spacer();
-	m_pSlide_xRotate	= Add_Slider	(_TL("X-Rotation")			, m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0);
-	m_pSlide_yRotate	= Add_Slider	(_TL("Y-Rotation")			, m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0);
-	m_pSlide_zRotate	= Add_Slider	(_TL("Z-Rotation")			, m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0);
-
-	m_pSlide_Central	= Add_Slider	(_TL("Eye Distance")		, m_pView->m_dCentral, 1.0, 2000.0);
-
-	m_pSlide_Light_Hgt	= Add_Slider	(_TL("Light Source A")		, m_pView->m_Light_Hgt, -M_PI_090, M_PI_090);
-	m_pSlide_Light_Dir	= Add_Slider	(_TL("Light Source B")		, m_pView->m_Light_Dir, -M_PI_360, M_PI_360);
-
-//	Add_Spacer();
-//	m_pParameters		= Add_TextCtrl	(_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY);
-
-	Add_Output(m_pView);
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Dialog::On_Mouse_Wheel(wxMouseEvent &event)
-{
-	m_pView->On_Mouse_Wheel(event);
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Dialog::On_Update_Control(wxCommandEvent &event)
-{
-	if( event.GetEventObject() == m_pCheck_Central )
-	{
-		m_pView->m_bCentral		= m_pCheck_Central	->GetValue() == 1 ? 1 : 0;
-	}
-	else if( event.GetEventObject() == m_pCheck_Stereo )
-	{	
-		m_pView->m_bStereo		= m_pCheck_Stereo	->GetValue() == 1 ? 1 : 0;
-	}
-	else if( event.GetEventObject() == m_pCheck_Frame )
-	{	
-		m_pView->m_bFrame		= m_pCheck_Frame	->GetValue() == 1 ? 1 : 0;
-	}
-	else if( event.GetEventObject() == m_pSlide_xRotate )
-	{	
-		m_pView->m_xRotate		= m_pSlide_xRotate	->Get_Value() * M_DEG_TO_RAD;
-	}
-	else if( event.GetEventObject() == m_pSlide_yRotate )
-	{	
-		m_pView->m_yRotate		= m_pSlide_yRotate	->Get_Value() * M_DEG_TO_RAD;
-	}
-	else if( event.GetEventObject() == m_pSlide_zRotate )
-	{	
-		m_pView->m_zRotate		= m_pSlide_zRotate	->Get_Value() * M_DEG_TO_RAD;
-	}
-	else if( event.GetEventObject() == m_pSlide_Central )
-	{	
-		m_pView->m_dCentral		= m_pSlide_Central	->Get_Value();
-	}
-	else if( event.GetEventObject() == m_pSlide_Light_Dir )
-	{	
-		m_pView->m_Light_Dir	= m_pSlide_Light_Dir->Get_Value();
-	}
-	else if( event.GetEventObject() == m_pSlide_Light_Hgt )
-	{	
-		m_pView->m_Light_Hgt	= m_pSlide_Light_Hgt->Get_Value();
-	}
-	else
-	{
-		return;
-	}
-
-	m_pView->Update_View();
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Dialog::On_Update_Choices(wxCommandEvent &event)
-{
-	if(      event.GetEventObject() == m_pField_Color )
-	{
-		m_Settings("C_RANGE")->asRange()->Set_Range(0.0, 0.0);
-
-		m_pView		->m_cField	= m_pField_Color->GetSelection();
-
-		m_pView		->Update_Extent();
-	}
-
-	else if( event.GetEventObject() == m_pStyle )
-	{
-		m_pView		->m_Style	= m_pStyle->GetSelection();
-
-		m_pView		->Update_View();
-	}
-
-	else if( event.GetEventObject() == m_pShading )
-	{
-		m_pView		->m_Shading	= m_pShading->GetSelection();
-
-		m_pView		->Update_View();
-	}
-
-	else
-	{
-		return;
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Dialog::On_Button(wxCommandEvent &event)
-{
-	if( event.GetEventObject() == m_pBtn_Prop )
-	{
-		if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) )
-		{
-			m_pView		->Update_View();
-		}
-	}
-	else
-	{
-		event.Skip();
-	}
-}
-
-//---------------------------------------------------------
-void C3D_MultiGrid_View_Dialog::Update_Rotation(void)
-{
-	double	d;
-
-	d	= fmod(M_RAD_TO_DEG * m_pView->m_xRotate, 360.0);	if( d < -180.0 )	d	+= 360.0;	else if( d > 180.0 )	d	-= 360.0;
-	m_pSlide_xRotate->Set_Value(d);
-
-	d	= fmod(M_RAD_TO_DEG * m_pView->m_yRotate, 360.0);	if( d < -180.0 )	d	+= 360.0;	else if( d > 180.0 )	d	-= 360.0;
-	m_pSlide_yRotate->Set_Value(d);
-
-	d	= fmod(M_RAD_TO_DEG * m_pView->m_zRotate, 360.0);	if( d < -180.0 )	d	+= 360.0;	else if( d > 180.0 )	d	-= 360.0;
-	m_pSlide_zRotate->Set_Value(d);
-
-	m_pCheck_Stereo	->SetValue(m_pView->m_bStereo);
-	m_pCheck_Frame	->SetValue(m_pView->m_bFrame);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.h b/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.h
deleted file mode 100644
index 6579cd0..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/**********************************************************
- * Version $Id: 3d_multigrid_view_dialog.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      3d_viewer                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                3d_multigrid_view_dialog.h             //
-//                                                       //
-//                 Copyright (C) 2013 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__3d_multigrid_view_dialog_H
-#define HEADER_INCLUDED__3d_multigrid_view_dialog_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <saga_gdi/saga_gdi.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class C3D_MultiGrid_View_Dialog : public CSGDI_Dialog
-{
-public:
-	C3D_MultiGrid_View_Dialog(CSG_Parameter_Grid_List *pShapes, int Field_Color);
-
-	void								Update_Rotation			(void);
-
-
-private:
-
-	wxButton							*m_pBtn_Prop;
-
-	wxCheckBox							*m_pCheck_Central, *m_pCheck_Stereo, *m_pCheck_Frame;
-
-	wxChoice							*m_pField_Color, *m_pStyle, *m_pShading;
-
-	wxTextCtrl							*m_pFormula, *m_pParameters;
-
-	CSGDI_Slider						*m_pSlide_xRotate, *m_pSlide_yRotate, *m_pSlide_zRotate, *m_pSlide_Central, *m_pSlide_Light_Hgt, *m_pSlide_Light_Dir;
-
-	class C3D_MultiGrid_View_Control	*m_pView;
-
-	CSG_Parameters						m_Settings;
-
-
-	void								On_Update_Control		(wxCommandEvent &event);
-	void								On_Update_Choices		(wxCommandEvent &event);
-	void								On_Button				(wxCommandEvent &event);
-
-	void								On_Mouse_Wheel			(wxMouseEvent   &event);
-
-	DECLARE_EVENT_TABLE()
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__3d_multigrid_view_dialog_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.cpp b/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.cpp
deleted file mode 100644
index 619d845..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/**********************************************************
- * Version $Id: 3d_multigrid_view_module.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       3d_viewer                       //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              3d_multigrid_view_module.cpp             //
-//                                                       //
-//                 Copyright (C) 2013 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 for Geography                //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "3d_multigrid_view_module.h"
-#include "3d_multigrid_view_dialog.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-C3D_MultiGrid_View_Module::C3D_MultiGrid_View_Module(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Multi-Grid 3D Viewer"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"	, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool C3D_MultiGrid_View_Module::On_Execute(void)
-{
-	if( !SG_UI_Get_Window_Main() )
-	{
-		Message_Add(_TL("multi-grid viewer can only be run from graphical user interface"));
-
-		return( false );
-	}
-
-	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
-
-	if( pGrids->Get_Count() <= 0 )
-	{
-		Message_Add(_TL("multi-grid viewer will not be started"));
-
-		return( false );
-	}
-
-	C3D_MultiGrid_View_Dialog	dlg(pGrids, 0);
-
-	dlg.ShowModal();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.h b/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.h
deleted file mode 100644
index 13ce39e..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**********************************************************
- * Version $Id: 3d_multigrid_view_module.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       3d_viewer                       //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               3d_multigrid_view_module.h              //
-//                                                       //
-//                 Copyright (C) 2013 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__3d_multigrid_view_module_H
-#define HEADER_INCLUDED__3d_multigrid_view_module_H
-
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class C3D_MultiGrid_View_Module : public CSG_Module  
-{
-public:
-	C3D_MultiGrid_View_Module(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__points_view_module_H
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp b/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp
deleted file mode 100644
index 2213f9e..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp
+++ /dev/null
@@ -1,1055 +0,0 @@
-/**********************************************************
- * Version $Id: 3dshapes_view_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    3dshapes_viewer                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               3dshapes_view_control.cpp               //
-//                                                       //
-//                 Copyright (C) 2011 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <wx/wxprec.h>
-
-#include <wx/settings.h>
-#include <wx/dc.h>
-#include <wx/dcclient.h>
-
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#include "3dshapes_view_control.h"
-#include "3dshapes_view_dialog.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define m_Settings	(*m_pSettings)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(C3DShapes_View_Control, wxPanel)
-	EVT_SIZE				(C3DShapes_View_Control::On_Size)
-	EVT_PAINT				(C3DShapes_View_Control::On_Paint)
-	EVT_KEY_DOWN			(C3DShapes_View_Control::On_Key_Down)
-	EVT_LEFT_DOWN			(C3DShapes_View_Control::On_Mouse_LDown)
-	EVT_LEFT_UP				(C3DShapes_View_Control::On_Mouse_LUp)
-	EVT_RIGHT_DOWN			(C3DShapes_View_Control::On_Mouse_RDown)
-	EVT_RIGHT_UP			(C3DShapes_View_Control::On_Mouse_RUp)
-	EVT_MIDDLE_DOWN			(C3DShapes_View_Control::On_Mouse_MDown)
-	EVT_MIDDLE_UP			(C3DShapes_View_Control::On_Mouse_MUp)
-	EVT_MOTION				(C3DShapes_View_Control::On_Mouse_Motion)
-	EVT_MOUSEWHEEL			(C3DShapes_View_Control::On_Mouse_Wheel)
-END_EVENT_TABLE()
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-C3DShapes_View_Control::C3DShapes_View_Control(wxWindow *pParent, CSG_Shapes *pShapes, int Field_Color, CSG_Parameters &Settings)
-	: wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE)
-{
-	m_pShapes		= pShapes;
-
-	m_pSettings	= &Settings;
-
-	m_cField	= Field_Color;
-
-	m_Shading	= 1;
-
-	m_Style		= 1;
-	m_cWire		= SG_GET_RGB(150, 150, 150);
-
-	m_xRotate	= 0.0;
-	m_yRotate	= 0.0;
-	m_zRotate	= 0.0;
-
-	m_xShift	= 0.0;
-	m_yShift	= 0.0;
-	m_zShift	= 1000.0;
-
-	m_bCentral	= true;
-	m_bStereo	= false;
-	m_bFrame	= true;
-
-	m_Light_Hgt	=  45.0 * M_DEG_TO_RAD;
-	m_Light_Dir	=  90.0 * M_DEG_TO_RAD;
-
-	m_dCentral	= 500.0;
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pNode	= m_pSettings->Add_Node(NULL, "NODE_CONTROL", _TL("3D View"), _TL(""));
-
-	m_pSettings->Add_Colors(
-		pNode	, "COLORS"			, _TL("Colors"),
-		_TL("")
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "BGCOLOR"			, _TL("Background Color"),
-		_TL(""),
-		PARAMETER_TYPE_Color, 0
-	);
-
-	m_pSettings->Add_Range(
-		pNode	, "C_RANGE"			, _TL("Colors Value Range"),
-		_TL("")
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "COLOR_WIRE"		, _TL("Wire Frame Color"),
-		_TL(""),
-		PARAMETER_TYPE_Color, m_cWire
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "SIZE_DEF"		, _TL("Point Size: Default"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 0, 0, true
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "SIZE_SCALE"		, _TL("Point Size: Scaling"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 250.0, 1.0, true
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "EXAGGERATION"	, _TL("Exaggeration"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0
-	);
-
-	m_pSettings->Add_Value(
-		pNode	, "STEREO_DIST"		, _TL("Stereo Eye Distance [Degree]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	//-----------------------------------------------------
-	Update_Extent();
-}
-
-//---------------------------------------------------------
-C3DShapes_View_Control::~C3DShapes_View_Control(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Size(wxSizeEvent &event)
-{
-	_Set_Size();
-
-	event.Skip();
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Paint(wxPaintEvent &WXUNUSED(event))
-{
-	if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 )
-	{
-		wxPaintDC	dc(this);
-
-		dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false);
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::Update_View(void)
-{
-	if( _Draw_Image() )
-	{
-		wxClientDC	dc(this);
-
-		dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false);
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::Update_Extent(void)
-{
-	m_Extent.Assign(m_pShapes->Get_Extent());
-
-	m_zStats.Invalidate();
-	m_cStats.Invalidate();
-
-	for(int iShape=0; iShape<m_pShapes->Get_Count(); iShape++)
-	{
-		CSG_Shape	*pShape	= m_pShapes->Get_Shape(iShape);
-
-		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-		{
-			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-			{
-				m_zStats.Add_Value(pShape->Get_Z(iPoint, iPart));
-			}
-		}
-
-		m_cStats.Add_Value(pShape->asDouble(m_cField));
-	}
-
-	m_Settings("C_RANGE")->asRange()->Set_Range(
-		m_cStats.Get_Mean() - 1.5 * m_cStats.Get_StdDev(),
-		m_cStats.Get_Mean() + 1.5 * m_cStats.Get_StdDev()
-	);
-
-	Update_View();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Key_Down(wxKeyEvent &event)
-{
-	switch( event.GetKeyCode() )
-	{
-	default:
-		event.Skip();
-		return;
-
-	case WXK_NUMPAD_ADD:
-	case WXK_ADD:		m_xRotate	-= 4.0 * M_DEG_TO_RAD;	break;
-	case WXK_NUMPAD_SUBTRACT:
-	case WXK_SUBTRACT:	m_xRotate	+= 4.0 * M_DEG_TO_RAD;	break;
-
-	case WXK_F3:		m_yRotate	-= 4.0 * M_DEG_TO_RAD;	break;
-	case WXK_F4:		m_yRotate	+= 4.0 * M_DEG_TO_RAD;	break;
-
-	case WXK_NUMPAD_MULTIPLY:
-	case WXK_MULTIPLY:	m_zRotate	-= 4.0 * M_DEG_TO_RAD;	break;
-	case WXK_NUMPAD_DIVIDE:
-	case WXK_DIVIDE:	m_zRotate	+= 4.0 * M_DEG_TO_RAD;	break;
-
-	case WXK_INSERT:	m_xShift	-= 10.0;				break;
-	case WXK_DELETE:	m_xShift	+= 10.0;				break;
-
-	case WXK_HOME:		m_yShift	-= 10.0;				break;
-	case WXK_END:		m_yShift	+= 10.0;				break;
-
-	case WXK_PAGEUP:	m_zShift	-= 10.0;				break;
-	case WXK_PAGEDOWN:	m_zShift	+= 10.0;				break;
-
-	case 'A':			m_bStereo	= !m_bStereo;			break;
-
-	case WXK_F1:		m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() + 0.5);	break;
-	case WXK_F2:		m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() - 0.5);	break;
-
-	case WXK_F5:		m_Settings("SIZE_DEF")    ->Set_Value(m_Settings("SIZE_DEF")    ->asDouble() - 1.0);	break;
-	case WXK_F6:		m_Settings("SIZE_DEF")    ->Set_Value(m_Settings("SIZE_DEF")    ->asDouble() + 1.0);	break;
-
-	case WXK_F7:		m_Settings("SIZE_SCALE")  ->Set_Value(m_Settings("SIZE_SCALE")  ->asDouble() - 10.0);	break;
-	case WXK_F8:		m_Settings("SIZE_SCALE")  ->Set_Value(m_Settings("SIZE_SCALE")  ->asDouble() + 10.0);	break;
-	}
-
-	Update_View();
-
-	((C3DShapes_View_Dialog *)GetParent())->Update_Rotation();
-}
-
-//---------------------------------------------------------
-#define GET_MOUSE_X_RELDIFF	((double)(m_Mouse_Down.x - event.GetX()) / (double)GetClientSize().x)
-#define GET_MOUSE_Y_RELDIFF	((double)(m_Mouse_Down.y - event.GetY()) / (double)GetClientSize().y)
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Mouse_LDown(wxMouseEvent &event)
-{
-	SetFocus();
-
-	m_Mouse_Down	= event.GetPosition();
-	m_xDown			= m_zRotate;
-	m_yDown			= m_xRotate;
-
-	CaptureMouse();
-}
-
-void C3DShapes_View_Control::On_Mouse_LUp(wxMouseEvent &event)
-{
-	if( HasCapture() )
-	{
-		ReleaseMouse();
-	}
-
-	if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() )
-	{
-		m_zRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-		m_xRotate	= m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180;
-
-		Update_View();
-
-		((C3DShapes_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Mouse_RDown(wxMouseEvent &event)
-{
-	SetFocus();
-
-	m_Mouse_Down	= event.GetPosition();
-	m_xDown			= m_xShift;
-	m_yDown			= m_yShift;
-
-	CaptureMouse();
-}
-
-void C3DShapes_View_Control::On_Mouse_RUp(wxMouseEvent &event)
-{
-	if( HasCapture() )
-	{
-		ReleaseMouse();
-	}
-
-	if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() )
-	{
-		m_xShift	= m_xDown - GET_MOUSE_X_RELDIFF * 1000.0;
-		m_yShift	= m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0;
-
-		Update_View();
-
-		((C3DShapes_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Mouse_MDown(wxMouseEvent &event)
-{
-	SetFocus();
-
-	m_Mouse_Down	= event.GetPosition();
-	m_xDown			= m_yRotate;
-	m_yDown			= m_zShift;
-
-	CaptureMouse();
-}
-
-void C3DShapes_View_Control::On_Mouse_MUp(wxMouseEvent &event)
-{
-	if( HasCapture() )
-	{
-		ReleaseMouse();
-	}
-
-	if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() )
-	{
-		m_yRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-		m_zShift	= m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0;
-
-		Update_View();
-
-		((C3DShapes_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Mouse_Motion(wxMouseEvent &event)
-{
-	if( HasCapture() && event.Dragging() )
-	{
-		if( event.LeftIsDown() )
-		{
-			m_zRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-			m_xRotate	= m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180;
-		}
-		else if( event.RightIsDown() )
-		{
-			m_xShift	= m_xDown - GET_MOUSE_X_RELDIFF * 1000.0;
-			m_yShift	= m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0;
-		}
-		else if( event.MiddleIsDown() )
-		{
-			m_yRotate	= m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180;
-			m_zShift	= m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0;
-		}
-		else
-		{
-			return;
-		}
-
-		Update_View();
-
-		((C3DShapes_View_Dialog *)GetParent())->Update_Rotation();
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::On_Mouse_Wheel(wxMouseEvent &event)
-{
-	if( event.GetWheelRotation() )
-	{
-		m_zShift	+= 0.5 * event.GetWheelRotation();
-
-		Update_View();
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::_Set_Size(void)
-{
-	Update_View();
-}
-
-//---------------------------------------------------------
-bool C3DShapes_View_Control::_Draw_Image(void)
-{
-	wxSize	dcSize	= GetClientSize();
-
-	if( m_pShapes->Get_Count() <= 0
-	||	dcSize.x <= 0 || dcSize.y <= 0
-	||	m_Extent.Get_XRange() <= 0.0 || m_Extent.Get_YRange() <= 0.0
-	||	m_cField < 0 || m_cField >= m_pShapes->Get_Field_Count()
-	||	m_zStats.Get_Range() <= 0.0 )
-	{
-		return( false );
-	}
-
-	//-------------------------------------------------
-	if( !m_Image.IsOk() || dcSize.x != m_Image.GetWidth() || dcSize.y != m_Image.GetHeight() )
-	{
-		m_Image		.Create(dcSize.x, dcSize.y);
-		m_Image_zMax.Create(dcSize.x, dcSize.y);
-	}
-
-	//-------------------------------------------------
-	if( m_Settings("C_RANGE")->asRange()->Get_LoVal() >= m_Settings("C_RANGE")->asRange()->Get_HiVal() )
-	{
-		m_Settings("C_RANGE")->asRange()->Set_Range(
-			m_cStats.Get_Mean() - 1.5 * m_pShapes->Get_StdDev(m_cField),
-			m_cStats.Get_Mean() + 1.5 * m_pShapes->Get_StdDev(m_cField)
-		);
-	}
-
-	m_pColors	= m_Settings("COLORS")->asColors();
-	m_cMin		= m_Settings("C_RANGE")->asRange()->Get_LoVal();
-	m_cScale	= m_pColors->Get_Count() / (m_Settings("C_RANGE")->asRange()->Get_HiVal() - m_cMin);
-	m_cWire		= m_Settings("COLOR_WIRE")->asColor();
-
-	//-------------------------------------------------
-	r_Scale		= (m_Image.GetWidth() / (double)m_Image.GetHeight()) > (m_Extent.Get_XRange() / m_Extent.Get_YRange())
-				? m_Image.GetWidth () / m_Extent.Get_XRange()
-				: m_Image.GetHeight() / m_Extent.Get_YRange();
-
-	r_sin_x		= sin(m_xRotate - M_PI_180);
-	r_cos_x		= cos(m_xRotate - M_PI_180);
-	r_sin_y		= sin(m_yRotate);
-	r_cos_y		= cos(m_yRotate);
-	r_sin_z		= sin(m_zRotate);
-	r_cos_z		= cos(m_zRotate);
-
-	r_xc		= m_Extent.Get_XCenter();
-	r_yc		= m_Extent.Get_YCenter();
-	r_zc		= m_zStats.Get_Minimum() + 0.5 * m_zStats.Get_Range();
-
-	r_Scale_z	= r_Scale * m_Settings("EXAGGERATION")->asDouble();
-
-	//-------------------------------------------------
-	m_Size_Def		= m_Settings("SIZE_DEF")->asInt();
-	m_Size_Scale	= 1.0 / m_Settings("SIZE_SCALE")->asDouble();
-
-	_Draw_Background();
-
-	//-------------------------------------------------
-	if( m_bStereo == false )
-	{
-		m_Image_zMax.Assign(999999.0);
-
-		m_Color_Mode	= COLOR_MODE_RGB;
-
-		for(int i=0; i<m_pShapes->Get_Count(); i++)
-		{
-			_Draw_Shape(m_pShapes->Get_Shape(i));
-		}
-
-		_Draw_Frame();
-	}
-
-	//-------------------------------------------------
-	else
-	{
-		int		i;
-		double	d	= m_Settings("STEREO_DIST")->asDouble() / 2.0;
-
-		m_Image_zMax.Assign(999999.0);
-
-		r_sin_y	= sin(m_yRotate - d * M_DEG_TO_RAD);
-		r_cos_y	= cos(m_yRotate - d * M_DEG_TO_RAD);
-
-		m_Color_Mode	= COLOR_MODE_RED;
-
-		for(i=0; i<m_pShapes->Get_Count(); i++)
-		{
-			_Draw_Shape(m_pShapes->Get_Shape(i));
-		}
-
-		_Draw_Frame();
-
-		m_Image_zMax.Assign(999999.0);
-
-		r_sin_y	= sin(m_yRotate + d * M_DEG_TO_RAD);
-		r_cos_y	= cos(m_yRotate + d * M_DEG_TO_RAD);
-
-		m_Color_Mode	= COLOR_MODE_BLUE;
-
-		for(i=0; i<m_pShapes->Get_Count(); i++)
-		{
-			_Draw_Shape(m_pShapes->Get_Shape(i));
-		}
-
-		_Draw_Frame();
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::_Draw_Shape(CSG_Shape *pShape)
-{
-	int			c;
-	TSG_Point	p;
-	TNode		a, b;
-
-	c	= _Get_Color(pShape->asDouble(m_cField));
-
-	for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-	{
-		switch( pShape->Get_Type() )
-		{
-		case SHAPE_TYPE_Point:
-			{
-				p	= pShape->Get_Point(0, iPart);
-				a.x	= p.x;
-				a.y	= p.y;
-				a.z	= pShape->Get_Z(0, iPart);
-
-				_Get_Projection(a);
-
-				_Draw_Point(a.x, a.y, a.z, c, 1);
-			}
-			break;
-
-		case SHAPE_TYPE_Line:
-			{
-				p	= pShape->Get_Point(0, iPart);
-				a.x	= p.x;
-				a.y	= p.y;
-				a.z	= pShape->Get_Z(0, iPart);
-
-				_Get_Projection(a);
-
-				for(int iPoint=1; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-				{
-					b	= a;
-					p	= pShape->Get_Point(iPoint, iPart);
-					a.x	= p.x;
-					a.y	= p.y;
-					a.z	= pShape->Get_Z(iPoint, iPart);
-
-					_Get_Projection(a);
-
-					_Draw_Line(a, b, c);
-				}
-			}
-			break;
-
-		case SHAPE_TYPE_Polygon:
-			{
-				p	= pShape->Get_Point(pShape->Get_Point_Count(iPart) - 1, iPart);
-				a.x	= p.x;
-				a.y	= p.y;
-				a.z	= pShape->Get_Z(pShape->Get_Point_Count(iPart) - 1, iPart);
-
-				_Get_Projection(a);
-
-				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-				{
-					b	= a;
-					p	= pShape->Get_Point(iPoint, iPart);
-					a.x	= p.x;
-					a.y	= p.y;
-					a.z	= pShape->Get_Z(iPoint, iPart);
-
-					_Get_Projection(a);
-
-					_Draw_Line(a, b, c);
-				}
-			}
-			break;
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void C3DShapes_View_Control::_Draw_Point(int x, int y, double z, int color, int size)
-{
-	if( z > 0.0 )
-	{
-		_Draw_Pixel(x, y, z, color);
-
-		if( size > 0 && size < 50 )
-		{
-			for(int iy=1; iy<=size; iy++)
-			{
-				for(int ix=0; ix<=size; ix++)
-				{
-					if( ix*ix + iy*iy <= size*size )
-					{
-						_Draw_Pixel(x + ix, y + iy, z, color);
-						_Draw_Pixel(x + iy, y - ix, z, color);
-						_Draw_Pixel(x - ix, y - iy, z, color);
-						_Draw_Pixel(x - iy, y + ix, z, color);
-					}
-				}
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void C3DShapes_View_Control::_Draw_Line(TNode a, TNode b, int Color)
-{
-	if(	(a.x < 0 && b.x < 0) || (a.x >= m_Image.GetWidth () && b.x >= m_Image.GetWidth ())
-	||	(a.y < 0 && b.y < 0) || (a.y >= m_Image.GetHeight() && b.y >= m_Image.GetHeight()) )
-	{
-		return;
-	}
-
-	double	i, n, dx, dy, dz;
-
-	dx		= b.x - a.x;
-	dy		= b.y - a.y;
-	dz		= b.z - a.z;
-
-	if( b.z < 0.0 || a.z < 0.0 )
-		return;
-
-	if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 )
-	{
-		n	 = fabs(dx);
-		dx	 = dx < 0 ? -1 : 1;
-		dy	/= n;
-		dz	/= n;
-	}
-	else if( fabs(dy) > 0.0 )
-	{
-		n	 = fabs(dy);
-		dx	/= n;
-		dy	 = dy < 0 ? -1 : 1;
-		dz	/= n;
-	}
-	else
-	{
-		_Draw_Pixel((int)a.x, (int)a.y, a.z, Color);
-
-		return;
-	}
-
-	//-----------------------------------------------------
-	for(i=0; i<=n; i++, a.x+=dx, a.y+=dy, a.z+=dz)
-	{
-		_Draw_Pixel((int)a.x, (int)a.y, a.z, Color);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void C3DShapes_View_Control::_Draw_Triangle(TNode p[3], double dim)
-{
-	if( p[0].z < 0.0 || p[1].z < 0.0 || p[2].z < 0.0 )
-		return;
-
-	//-----------------------------------------------------
-	if( p[1].y < p[0].y ) {	TNode pp = p[1]; p[1] = p[0]; p[0] = pp;	}
-	if( p[2].y < p[0].y ) {	TNode pp = p[2]; p[2] = p[0]; p[0] = pp;	}
-	if( p[2].y < p[1].y ) {	TNode pp = p[2]; p[2] = p[1]; p[1] = pp;	}
-
-	//-----------------------------------------------------
-	TSG_Rect	r;
-
-	r.yMin	= p[0].y;
-	r.yMax	= p[2].y;
-	r.xMin	= p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x);
-	r.xMax	= p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x);
-
-	if( r.yMin >= r.yMax || r.xMin >= r.xMax )
-	{
-		return;	// no area
-	}
-
-	if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_Image.GetHeight() && r.yMax >= m_Image.GetHeight())
-	||	(r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_Image.GetWidth () && r.xMax >= m_Image.GetWidth ()) )
-	{
-		return;	// completely outside grid
-	}
-
-	//-----------------------------------------------------
-	TNode	d[3];
-
-	if( (d[0].y	= p[2].y - p[0].y) > 0.0 )
-	{
-		d[0].x	= (p[2].x - p[0].x) / d[0].y;
-		d[0].z	= (p[2].z - p[0].z) / d[0].y;
-		d[0].c	= (p[2].c - p[0].c) / d[0].y;
-	}
-
-	if( (d[1].y	= p[1].y - p[0].y) > 0.0 )
-	{
-		d[1].x	= (p[1].x - p[0].x) / d[1].y;
-		d[1].z	= (p[1].z - p[0].z) / d[1].y;
-		d[1].c	= (p[1].c - p[0].c) / d[1].y;
-	}
-
-	if( (d[2].y	= p[2].y - p[1].y) > 0.0 )
-	{
-		d[2].x	= (p[2].x - p[1].x) / d[2].y;
-		d[2].z	= (p[2].z - p[1].z) / d[2].y;
-		d[2].c	= (p[2].c - p[1].c) / d[2].y;
-	}
-
-	//-----------------------------------------------------
-	int	ay	= (int)r.yMin;	if( ay < 0 )	ay	= 0;	if( ay < r.yMin )	ay++;
-	int	by	= (int)r.yMax;	if( by >= m_Image.GetHeight() )	by	= m_Image.GetHeight() - 1;
-
-	for(int y=ay; y<=by; y++)
-	{
-		if( y <= p[1].y && d[1].y > 0.0 )
-		{
-			_Draw_Triangle_Line(y,
-				p[0].x + (y - p[0].y) * d[0].x,
-				p[0].x + (y - p[0].y) * d[1].x,
-				p[0].z + (y - p[0].y) * d[0].z,
-				p[0].z + (y - p[0].y) * d[1].z,
-				p[0].c + (y - p[0].y) * d[0].c,
-				p[0].c + (y - p[0].y) * d[1].c,
-				dim
-			);
-		}
-		else if( d[2].y > 0.0 )
-		{
-			_Draw_Triangle_Line(y,
-				p[0].x + (y - p[0].y) * d[0].x,
-				p[1].x + (y - p[1].y) * d[2].x,
-				p[0].z + (y - p[0].y) * d[0].z,
-				p[1].z + (y - p[1].y) * d[2].z,
-				p[0].c + (y - p[0].y) * d[0].c,
-				p[1].c + (y - p[1].y) * d[2].c,
-				dim
-			);
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void C3DShapes_View_Control::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double dim)
-{
-	if( xb < xa )
-	{
-		double	d;
-
-		d	= xa;	xa	= xb;	xb	= d;
-		d	= za;	za	= zb;	zb	= d;
-		d	= ca;	ca	= cb;	cb	= d;
-	}
-
-	if( xb > xa )
-	{
-		double	dz	= (zb - za) / (xb - xa);
-		double	dc	= (cb - ca) / (xb - xa);
-		int		ax	= (int)xa;	if( ax < 0 )	ax	= 0;	if( ax < xa )	ax++;
-		int		bx	= (int)xb;	if( bx >= m_Image.GetWidth() )	bx	= m_Image.GetWidth() - 1;
-
-		for(int x=ax; x<=bx; x++)
-		{
-			double	z	= za + dz * (x - xa);
-			double	c	= ca + dc * (x - xa);
-
-			_Draw_Pixel(x, y, z, _Get_Color(c, dim));
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::_Draw_Background(void)
-{
-	BYTE	r, g, b, *pRGB;
-	int		i, n, color;
-
-	color	= m_Settings("BGCOLOR")->asColor();
-
-	if( m_bStereo )
-	{
-		color	= (int)((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3.0);
-		color	= SG_GET_RGB(color, color, color);
-	}
-
-	r	= SG_GET_R(color);
-	g	= SG_GET_G(color);
-	b	= SG_GET_B(color);
-
-	n	= m_Image.GetWidth() * m_Image.GetHeight();
-
-	for(i=0, pRGB=m_Image.GetData(); i<n; i++)
-	{
-		*pRGB	= r;	pRGB++;
-		*pRGB	= g;	pRGB++;
-		*pRGB	= b;	pRGB++;
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Control::_Draw_Frame(void)
-{
-	if( !m_bFrame )
-	{
-		return;
-	}
-
-	int			color;
-	double		buffer	= 1.0;
-	CSG_Rect	r(m_Extent);
-	TNode		p[2][4];
-
-	r.Inflate(buffer);
-
-	color	= m_Settings("BGCOLOR")->asColor();
-	color	= SG_GET_RGB(SG_GET_R(color) + 128, SG_GET_G(color) + 128, SG_GET_B(color) + 128);
-
-	for(int i=0; i<2; i++)
-	{
-		p[i][0].x	= r.Get_XMin();	p[i][0].y	= r.Get_YMin();
-		p[i][1].x	= r.Get_XMax();	p[i][1].y	= r.Get_YMin();
-		p[i][2].x	= r.Get_XMax();	p[i][2].y	= r.Get_YMax();
-		p[i][3].x	= r.Get_XMin();	p[i][3].y	= r.Get_YMax();
-
-		p[i][0].z	= p[i][1].z = p[i][2].z = p[i][3].z = i == 0
-			? m_zStats.Get_Minimum() - buffer * m_zStats.Get_Range() / 100.0
-			: m_zStats.Get_Maximum() + buffer * m_zStats.Get_Range() / 100.0;
-
-		for(int j=0; j<4; j++)
-		{
-			_Get_Projection(p[i][j]);
-		}
-
-		_Draw_Line(p[i][0], p[i][1], color);
-		_Draw_Line(p[i][1], p[i][2], color);
-		_Draw_Line(p[i][2], p[i][3], color);
-		_Draw_Line(p[i][3], p[i][0], color);
-	}
-
-	_Draw_Line(p[0][0], p[1][0], color);
-	_Draw_Line(p[0][1], p[1][1], color);
-	_Draw_Line(p[0][2], p[1][2], color);
-	_Draw_Line(p[0][3], p[1][3], color);
-}
-
-//---------------------------------------------------------
-inline void C3DShapes_View_Control::_Draw_Pixel(int x, int y, double z, int color)
-{
-	if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() && z < m_Image_zMax[y][x] )
-	{
-		BYTE	*RGB	= m_Image.GetData() + 3 * (y * m_Image.GetWidth() + x);
-
-		switch( m_Color_Mode )
-		{
-		case COLOR_MODE_RGB:
-			RGB[0]	= SG_GET_R(color);
-			RGB[1]	= SG_GET_G(color);
-			RGB[2]	= SG_GET_B(color);
-			break;
-
-		case COLOR_MODE_RED:
-			RGB[0]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
-			break;
-
-		case COLOR_MODE_BLUE:
-			RGB[1]	= 
-			RGB[2]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
-			break;
-		}
-
-		m_Image_zMax[y][x]	= z;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline int C3DShapes_View_Control::_Get_Color(double value, double dim)
-{
-	int		Color	= (int)(m_cScale * (value - m_cMin));
-
-	Color	= m_pColors->Get_Color(Color < 0 ? 0 : (Color >= m_pColors->Get_Count() ? m_pColors->Get_Count() - 1 : Color));
-
-	if( dim >= 0.0 )
-	{
-		int	r	= (int)(dim * SG_GET_R(Color));	if( r < 0 )	r	= 0; else if( r > 255 )	r	= 255;
-		int	g	= (int)(dim * SG_GET_G(Color));	if( g < 0 )	g	= 0; else if( g > 255 )	g	= 255;
-		int	b	= (int)(dim * SG_GET_B(Color));	if( b < 0 )	b	= 0; else if( b > 255 )	b	= 255;
-
-		Color	= SG_GET_RGB(r, g, b);
-	}
-
-	return( Color );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void C3DShapes_View_Control::_Get_Projection(TNode &p)
-{
-	TSG_Point_Z	q;
-
-	p.x	= (p.x - r_xc) * r_Scale;
-	p.y	= (p.y - r_yc) * r_Scale;
-	p.z	= (p.z - r_zc) * r_Scale_z;
-
-	double	a	= (r_cos_y * p.z + r_sin_y * (r_sin_z * p.y + r_cos_z * p.x));
-	double	b	= (r_cos_z * p.y - r_sin_z * p.x);
-
-	q.x	= r_cos_y * (r_sin_z * p.y + r_cos_z * p.x) - r_sin_y * p.z;
-	q.y	= r_sin_x * a + r_cos_x * b;
-	q.z	= r_cos_x * a - r_sin_x * b;
-
-	q.x	+= m_xShift;
-	q.y	+= m_yShift;
-	q.z	+= m_zShift;
-
-	if( m_bCentral )
-	{
-		q.x	*= m_dCentral / q.z;
-		q.y	*= m_dCentral / q.z;
-	}
-	else
-	{
-		double	z	= m_dCentral / m_zShift;
-		q.x	*= z;
-		q.y	*= z;
-	//	q.z	 = -q.z;
-	}
-
-	p.x	= q.x + 0.5 * m_Image.GetWidth ();
-	p.y	= q.y + 0.5 * m_Image.GetHeight();
-	p.z	= q.z;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.h b/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.h
deleted file mode 100644
index 8c9538b..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/**********************************************************
- * Version $Id: 3dshapes_view_control.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    3dshapes_viewer                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                3dshapes_view_control.h                //
-//                                                       //
-//                 Copyright (C) 2011 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__3dshapes_view_control_H
-#define HEADER_INCLUDED__3dshapes_view_control_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <saga_gdi/saga_gdi.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	COLOR_MODE_RGB,
-	COLOR_MODE_RED,
-	COLOR_MODE_BLUE
-};
-
-//---------------------------------------------------------
-typedef struct SNode
-{
-	double	x, y, z, c;
-}
-TNode;
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class C3DShapes_View_Control : public wxPanel
-{
-public:
-	C3DShapes_View_Control(wxWindow *pParent, CSG_Shapes *pShapes, int Field_Color, CSG_Parameters &Settings);
-	virtual ~C3DShapes_View_Control(void);
-
-	bool						m_bCentral, m_bStereo, m_bFrame;
-
-	int							m_cField, m_Style, m_Shading;
-
-	double						m_xRotate, m_yRotate, m_zRotate, m_xShift, m_yShift, m_zShift, m_dCentral, m_Light_Hgt, m_Light_Dir;
-
-	void						Update_View				(void);
-	void						Update_Extent			(void);
-
-	void						On_Size					(wxSizeEvent  &event);
-	void						On_Paint				(wxPaintEvent &event);
-	void						On_Key_Down				(wxKeyEvent   &event);
-	void						On_Mouse_LDown			(wxMouseEvent &event);
-	void						On_Mouse_LUp			(wxMouseEvent &event);
-	void						On_Mouse_RDown			(wxMouseEvent &event);
-	void						On_Mouse_RUp			(wxMouseEvent &event);
-	void						On_Mouse_MDown			(wxMouseEvent &event);
-	void						On_Mouse_MUp			(wxMouseEvent &event);
-	void						On_Mouse_Motion			(wxMouseEvent &event);
-	void						On_Mouse_Wheel			(wxMouseEvent &event);
-
-
-private:
-
-	int							m_Color_Mode, m_Size_Def, m_cWire;
-
-	double						m_xDown, m_yDown, m_cMin, m_cScale, m_Size_Scale;
-
-	double						r_sin_x, r_sin_y, r_sin_z, r_cos_x, r_cos_y, r_cos_z, r_xc, r_yc, r_zc, r_Scale, r_Scale_z;
-
-	CSG_Rect					m_Extent;
-
-	CSG_Matrix					m_Image_zMax;
-
-	CSG_Simple_Statistics		m_zStats, m_cStats;
-
-	CSG_Parameters				*m_pSettings;
-
-	CSG_Colors					*m_pColors;
-
-	CSG_Shapes					*m_pShapes;
-
-	wxPoint						m_Mouse_Down;
-
-	wxImage						m_Image;
-
-
-	void						_Set_Size				(void);
-
-	bool						_Draw_Image				(void);
-
-	void						_Draw_Shape				(CSG_Shape *pShape);
-
-	void						_Draw_Point				(int iPoint);
-	void						_Draw_Point				(int x, int y, double z, int color, int Size);
-
-	void						_Draw_Line				(TNode a, TNode b, int Color);
-
-	void						_Draw_Triangle			(TNode p[3], double dim);
-	void						_Draw_Triangle_Line		(int y, double xa, double xb, double za, double zb, double ca, double cb, double dim);
-
-	void						_Draw_Background		(void);
-	void						_Draw_Frame				(void);
-	void						_Draw_Pixel				(int x, int y, double z, int color);
-
-	int							_Get_Color				(double value, double dim = -1.0);
-
-	void						_Get_Projection			(TNode &p);
-
-
-	DECLARE_EVENT_TABLE()
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__3dshapes_view_control_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.cpp b/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.cpp
deleted file mode 100644
index 3dc9f43..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.cpp
+++ /dev/null
@@ -1,268 +0,0 @@
-/**********************************************************
- * Version $Id: 3dshapes_view_dialog.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    3dshapes_viewer                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                3dshapes_view_dialog.cpp               //
-//                                                       //
-//                 Copyright (C) 2011 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "3dshapes_view_control.h"
-#include "3dshapes_view_dialog.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(C3DShapes_View_Dialog, CSGDI_Dialog)
-	EVT_MOUSEWHEEL	(C3DShapes_View_Dialog::On_Mouse_Wheel)
-	EVT_BUTTON		(wxID_ANY	, C3DShapes_View_Dialog::On_Button)
-	EVT_CHECKBOX	(wxID_ANY	, C3DShapes_View_Dialog::On_Update_Control)
-	EVT_TEXT_ENTER	(wxID_ANY	, C3DShapes_View_Dialog::On_Update_Control)
-	EVT_SLIDER		(wxID_ANY	, C3DShapes_View_Dialog::On_Update_Control)
-	EVT_CHOICE		(wxID_ANY	, C3DShapes_View_Dialog::On_Update_Choices)
-END_EVENT_TABLE()
-
-//---------------------------------------------------------
-C3DShapes_View_Dialog::C3DShapes_View_Dialog(CSG_Shapes *pShapes, int Field_Color)
-	: CSGDI_Dialog(_TL("Simple 3D Shapes Viewer"), SGDI_DLG_STYLE_START_MAXIMISED)
-{
-	SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE);
-
-	//-----------------------------------------------------
-	m_Settings.Create(NULL, _TL("Viewer Settings"), _TL(""));
-
-	m_pView		= new C3DShapes_View_Control	(this, pShapes, Field_Color, m_Settings);
-
-	//-----------------------------------------------------
-	wxArrayString	Attributes, Styles, Shadings;
-
-	for(int i=0; i<pShapes->Get_Field_Count(); i++)
-	{
-		Attributes.Add(pShapes->Get_Field_Name(i));
-	}
-
-	Styles  .Add(_TL("faces and wire"));
-	Styles  .Add(_TL("faces"));
-	Styles  .Add(_TL("wire"));
-
-	Shadings.Add(_TL("none"));
-	Shadings.Add(_TL("shading"));
-	Shadings.Add(_TL("shading (fixed light source)"));
-
-	//-----------------------------------------------------
-	Add_Button(_TL("Close"), wxID_OK);
-
-	m_pBtn_Prop			= Add_Button	(_TL("Advanced Settings")	, wxID_ANY);
-
-	Add_Spacer();
-	m_pField_Color		= Add_Choice	(_TL("Color Attribute")		, Attributes, m_pView->m_cField);
-	m_pStyle			= Add_Choice	(_TL("Draw Style")			, Styles    , m_pView->m_Style);
-	m_pShading			= Add_Choice	(_TL("Shading")				, Shadings  , m_pView->m_Shading);
-
-	Add_Spacer();
-	m_pCheck_Central	= Add_CheckBox	(_TL("Central Projection")	, m_pView->m_bCentral);
-	m_pCheck_Stereo		= Add_CheckBox	(_TL("Anaglyph")			, m_pView->m_bStereo);
-	m_pCheck_Frame		= Add_CheckBox	(_TL("Bounding Box")		, m_pView->m_bFrame);
-
-	Add_Spacer();
-	m_pSlide_xRotate	= Add_Slider	(_TL("X-Rotation")			, m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0);
-	m_pSlide_yRotate	= Add_Slider	(_TL("Y-Rotation")			, m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0);
-	m_pSlide_zRotate	= Add_Slider	(_TL("Z-Rotation")			, m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0);
-
-	m_pSlide_Central	= Add_Slider	(_TL("Eye Distance")		, m_pView->m_dCentral, 1.0, 2000.0);
-
-	m_pSlide_Light_Hgt	= Add_Slider	(_TL("Light Source A")		, m_pView->m_Light_Hgt, -M_PI_090, M_PI_090);
-	m_pSlide_Light_Dir	= Add_Slider	(_TL("Light Source B")		, m_pView->m_Light_Dir, -M_PI_360, M_PI_360);
-
-//	Add_Spacer();
-//	m_pParameters		= Add_TextCtrl	(_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY);
-
-	Add_Output(m_pView);
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Dialog::On_Mouse_Wheel(wxMouseEvent &event)
-{
-	m_pView->On_Mouse_Wheel(event);
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Dialog::On_Update_Control(wxCommandEvent &event)
-{
-	if( event.GetEventObject() == m_pCheck_Central )
-	{
-		m_pView->m_bCentral		= m_pCheck_Central	->GetValue() == 1 ? 1 : 0;
-	}
-	else if( event.GetEventObject() == m_pCheck_Stereo )
-	{	
-		m_pView->m_bStereo		= m_pCheck_Stereo	->GetValue() == 1 ? 1 : 0;
-	}
-	else if( event.GetEventObject() == m_pCheck_Frame )
-	{	
-		m_pView->m_bFrame		= m_pCheck_Frame	->GetValue() == 1 ? 1 : 0;
-	}
-	else if( event.GetEventObject() == m_pSlide_xRotate )
-	{	
-		m_pView->m_xRotate		= m_pSlide_xRotate	->Get_Value() * M_DEG_TO_RAD;
-	}
-	else if( event.GetEventObject() == m_pSlide_yRotate )
-	{	
-		m_pView->m_yRotate		= m_pSlide_yRotate	->Get_Value() * M_DEG_TO_RAD;
-	}
-	else if( event.GetEventObject() == m_pSlide_zRotate )
-	{	
-		m_pView->m_zRotate		= m_pSlide_zRotate	->Get_Value() * M_DEG_TO_RAD;
-	}
-	else if( event.GetEventObject() == m_pSlide_Central )
-	{	
-		m_pView->m_dCentral		= m_pSlide_Central	->Get_Value();
-	}
-	else if( event.GetEventObject() == m_pSlide_Light_Dir )
-	{	
-		m_pView->m_Light_Dir	= m_pSlide_Light_Dir->Get_Value();
-	}
-	else if( event.GetEventObject() == m_pSlide_Light_Hgt )
-	{	
-		m_pView->m_Light_Hgt	= m_pSlide_Light_Hgt->Get_Value();
-	}
-	else
-	{
-		return;
-	}
-
-	m_pView->Update_View();
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Dialog::On_Update_Choices(wxCommandEvent &event)
-{
-	if(      event.GetEventObject() == m_pField_Color )
-	{
-		m_Settings("C_RANGE")->asRange()->Set_Range(0.0, 0.0);
-
-		m_pView		->m_cField	= m_pField_Color->GetSelection();
-
-		m_pView		->Update_Extent();
-	}
-
-	else if( event.GetEventObject() == m_pStyle )
-	{
-		m_pView		->m_Style	= m_pStyle->GetSelection();
-
-		m_pView		->Update_View();
-	}
-
-	else if( event.GetEventObject() == m_pShading )
-	{
-		m_pView		->m_Shading	= m_pShading->GetSelection();
-
-		m_pView		->Update_View();
-	}
-
-	else
-	{
-		return;
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Dialog::On_Button(wxCommandEvent &event)
-{
-	if( event.GetEventObject() == m_pBtn_Prop )
-	{
-		if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) )
-		{
-			m_pView		->Update_View();
-		}
-	}
-	else
-	{
-		event.Skip();
-	}
-}
-
-//---------------------------------------------------------
-void C3DShapes_View_Dialog::Update_Rotation(void)
-{
-	double	d;
-
-	d	= fmod(M_RAD_TO_DEG * m_pView->m_xRotate, 360.0);	if( d < -180.0 )	d	+= 360.0;	else if( d > 180.0 )	d	-= 360.0;
-	m_pSlide_xRotate->Set_Value(d);
-
-	d	= fmod(M_RAD_TO_DEG * m_pView->m_yRotate, 360.0);	if( d < -180.0 )	d	+= 360.0;	else if( d > 180.0 )	d	-= 360.0;
-	m_pSlide_yRotate->Set_Value(d);
-
-	d	= fmod(M_RAD_TO_DEG * m_pView->m_zRotate, 360.0);	if( d < -180.0 )	d	+= 360.0;	else if( d > 180.0 )	d	-= 360.0;
-	m_pSlide_zRotate->Set_Value(d);
-
-	m_pCheck_Stereo	->SetValue(m_pView->m_bStereo);
-	m_pCheck_Frame	->SetValue(m_pView->m_bFrame);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.h b/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.h
deleted file mode 100644
index e8ced3f..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/**********************************************************
- * Version $Id: 3dshapes_view_dialog.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    3dshapes_viewer                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 3dshapes_view_dialog.h                //
-//                                                       //
-//                 Copyright (C) 2011 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__3dshapes_view_dialog_H
-#define HEADER_INCLUDED__3dshapes_view_dialog_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <saga_gdi/saga_gdi.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class C3DShapes_View_Dialog : public CSGDI_Dialog
-{
-public:
-	C3DShapes_View_Dialog(CSG_Shapes *pShapes, int Field_Color);
-
-	void							Update_Rotation			(void);
-
-
-private:
-
-	wxButton						*m_pBtn_Prop;
-
-	wxCheckBox						*m_pCheck_Central, *m_pCheck_Stereo, *m_pCheck_Frame;
-
-	wxChoice						*m_pField_Color, *m_pStyle, *m_pShading;
-
-	wxTextCtrl						*m_pFormula, *m_pParameters;
-
-	CSGDI_Slider					*m_pSlide_xRotate, *m_pSlide_yRotate, *m_pSlide_zRotate, *m_pSlide_Central, *m_pSlide_Light_Hgt, *m_pSlide_Light_Dir;
-
-	class C3DShapes_View_Control	*m_pView;
-
-	CSG_Parameters					m_Settings;
-
-
-	void							On_Update_Control		(wxCommandEvent &event);
-	void							On_Update_Choices		(wxCommandEvent &event);
-	void							On_Button				(wxCommandEvent &event);
-
-	void							On_Mouse_Wheel			(wxMouseEvent   &event);
-
-	DECLARE_EVENT_TABLE()
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__3dshapes_view_dialog_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.cpp b/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.cpp
deleted file mode 100644
index 7904528..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/**********************************************************
- * Version $Id: 3dshapes_view_module.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 3dshapes_view_module                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               3dshapes_view_module.cpp                //
-//                                                       //
-//                 Copyright (C) 2011 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 for Geography                //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "3dshapes_view_module.h"
-
-#include "3dshapes_view_dialog.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-C3DShapes_View_Module::C3DShapes_View_Module(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("3D Shapes Viewer"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"This module is a very simple viewer for 3D shapes. It is still a small plant which shall grow in SAGA's garden until it is really powerful."
-	));
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pNode	= Parameters.Add_Shapes(
-		NULL	, "SHAPES"	, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "COLOR"	, _TL("Color"),
-		_TL("")
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool C3DShapes_View_Module::On_Execute(void)
-{
-	if( !SG_UI_Get_Window_Main() )
-	{
-		Message_Add(_TL("point cloud viewer can only be run from graphical user interface"));
-
-		return( false );
-	}
-
-	CSG_Shapes	*pShapes	= Parameters("SHAPES")->asShapes();
-
-	if( pShapes->Get_Count() <= 0 )
-	{
-		Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points"));
-
-		return( false );
-	}
-
-	if( pShapes->Get_Vertex_Type() == SG_VERTEX_TYPE_XY )
-	{
-		Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points"));
-
-		return( false );
-	}
-
-	C3DShapes_View_Dialog	dlg(pShapes, Parameters("COLOR")->asInt());
-
-	dlg.ShowModal();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.h b/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.h
deleted file mode 100644
index 231df1e..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**********************************************************
- * Version $Id: 3dshapes_view_module.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    3dshapes_viewer                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 3dshapes_view_module.h                //
-//                                                       //
-//                 Copyright (C) 2011 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__3dshapes_view_module_H
-#define HEADER_INCLUDED__3dshapes_view_module_H
-
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class C3DShapes_View_Module : public CSG_Module  
-{
-public:
-	C3DShapes_View_Module(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__points_view_module_H
diff --git a/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp b/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp
deleted file mode 100644
index 85d2c09..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    3dshapes_viewer                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2011 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 for Geography                //
-//                University of Hamburg                  //
-//                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("Garden - 3D Shapes Viewer") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O.Conrad (c) 2011") );
-
-	case MLB_INFO_Description:
-		return( _TL("3D Shapes Viewer" ));
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Garden|Visualisation" ));
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "3dshapes_view_module.h"
-#include "3d_multigrid_view_module.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case 0:		return( new C3DShapes_View_Module );
-	case 1:		return( new C3D_MultiGrid_View_Module );
-
-	default:	return( NULL );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.h b/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.h
deleted file mode 100644
index 1e1ee7a..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   pointcloud_viewer                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.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 for Geography                //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H
-#define HEADER_INCLUDED__pointcloud_viewer_mlb_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef pointcloud_viewer_EXPORTS
-	#define	pointcloud_viewer_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	pointcloud_viewer_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H
diff --git a/src/modules_contrib/garden/garden_3d_viewer/Makefile.am b/src/modules_contrib/garden/garden_3d_viewer/Makefile.am
deleted file mode 100644
index f9f635f..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
-DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
-else
-DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
-DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
-endif
-DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS           = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libgarden_3d_viewer.la
-libgarden_3d_viewer_la_SOURCES =\
-MLB_Interface.cpp\
-3d_multigrid_view_control.cpp\
-3d_multigrid_view_dialog.cpp\
-3d_multigrid_view_module.cpp\
-3dshapes_view_control.cpp\
-3dshapes_view_dialog.cpp\
-3dshapes_view_module.cpp\
-MLB_Interface.h\
-3d_multigrid_view_control.h\
-3d_multigrid_view_dialog.h\
-3d_multigrid_view_module.h\
-3dshapes_view_control.h\
-3dshapes_view_dialog.h\
-3dshapes_view_module.h
-
-libgarden_3d_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
diff --git a/src/modules_contrib/garden/garden_3d_viewer/Makefile.in b/src/modules_contrib/garden/garden_3d_viewer/Makefile.in
deleted file mode 100644
index 8224666..0000000
--- a/src/modules_contrib/garden/garden_3d_viewer/Makefile.in
+++ /dev/null
@@ -1,595 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/garden/garden_3d_viewer
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libgarden_3d_viewer_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \
-	$(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la
-am_libgarden_3d_viewer_la_OBJECTS = MLB_Interface.lo \
-	3d_multigrid_view_control.lo 3d_multigrid_view_dialog.lo \
-	3d_multigrid_view_module.lo 3dshapes_view_control.lo \
-	3dshapes_view_dialog.lo 3dshapes_view_module.lo
-libgarden_3d_viewer_la_OBJECTS = $(am_libgarden_3d_viewer_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libgarden_3d_viewer_la_SOURCES)
-DIST_SOURCES = $(libgarden_3d_viewer_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@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`
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libgarden_3d_viewer.la
-libgarden_3d_viewer_la_SOURCES = \
-MLB_Interface.cpp\
-3d_multigrid_view_control.cpp\
-3d_multigrid_view_dialog.cpp\
-3d_multigrid_view_module.cpp\
-3dshapes_view_control.cpp\
-3dshapes_view_dialog.cpp\
-3dshapes_view_module.cpp\
-MLB_Interface.h\
-3d_multigrid_view_control.h\
-3d_multigrid_view_dialog.h\
-3d_multigrid_view_module.h\
-3dshapes_view_control.h\
-3dshapes_view_dialog.h\
-3dshapes_view_module.h
-
-libgarden_3d_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/garden/garden_3d_viewer/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/garden/garden_3d_viewer/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgarden_3d_viewer.la: $(libgarden_3d_viewer_la_OBJECTS) $(libgarden_3d_viewer_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_3d_viewer_la_OBJECTS) $(libgarden_3d_viewer_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_multigrid_view_control.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_multigrid_view_dialog.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_multigrid_view_module.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3dshapes_view_control.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3dshapes_view_dialog.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3dshapes_view_module.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_contrib/garden/garden_webservices/Makefile.in b/src/modules_contrib/garden/garden_webservices/Makefile.in
deleted file mode 100644
index 9895635..0000000
--- a/src/modules_contrib/garden/garden_webservices/Makefile.in
+++ /dev/null
@@ -1,581 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_contrib/garden/garden_webservices
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libgarden_webservices_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libgarden_webservices_la_OBJECTS = MLB_Interface.lo osm_import.lo \
-	wms_import.lo
-libgarden_webservices_la_OBJECTS =  \
-	$(am_libgarden_webservices_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libgarden_webservices_la_SOURCES)
-DIST_SOURCES = $(libgarden_webservices_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@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`
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libgarden_webservices.la
-libgarden_webservices_la_SOURCES = \
-MLB_Interface.cpp\
-osm_import.cpp\
-wms_import.cpp\
-MLB_Interface.h\
-osm_import.h\
-wms_import.h
-
-libgarden_webservices_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_contrib/garden/garden_webservices/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_contrib/garden/garden_webservices/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgarden_webservices.la: $(libgarden_webservices_la_OBJECTS) $(libgarden_webservices_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libgarden_webservices_la_OBJECTS) $(libgarden_webservices_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/osm_import.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wms_import.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/Makefile.am b/src/modules_geostatistics/Makefile.am
deleted file mode 100644
index f658a4d..0000000
--- a/src/modules_geostatistics/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = geostatistics
diff --git a/src/modules_geostatistics/Makefile.in b/src/modules_geostatistics/Makefile.in
deleted file mode 100644
index af8e4a9..0000000
--- a/src/modules_geostatistics/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_geostatistics
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = geostatistics
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_geostatistics/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_geostatistics/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/Makefile.am b/src/modules_geostatistics/geostatistics/Makefile.am
deleted file mode 100644
index b73ecd1..0000000
--- a/src/modules_geostatistics/geostatistics/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-if WITH_GUI
-SUBDIRS = geostatistics_points geostatistics_kriging geostatistics_grid geostatistics_regression
-else
-SUBDIRS = geostatistics_points geostatistics_grid geostatistics_regression
-endif
diff --git a/src/modules_geostatistics/geostatistics/Makefile.in b/src/modules_geostatistics/geostatistics/Makefile.in
deleted file mode 100644
index 8eac6f3..0000000
--- a/src/modules_geostatistics/geostatistics/Makefile.in
+++ /dev/null
@@ -1,591 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_geostatistics/geostatistics
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = geostatistics_points geostatistics_grid \
-	geostatistics_regression geostatistics_kriging
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at WITH_GUI_FALSE@SUBDIRS = geostatistics_points geostatistics_grid geostatistics_regression
- at WITH_GUI_TRUE@SUBDIRS = geostatistics_points geostatistics_kriging geostatistics_grid geostatistics_regression
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.cpp
deleted file mode 100644
index 8e563ef..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.cpp
+++ /dev/null
@@ -1,367 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Directional_Statistics.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//            GSGrid_Directional_Statistics.cpp          //
-//                                                       //
-//                 Copyright (C) 2010 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 "GSGrid_Directional_Statistics.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	id_Mean		= 0,
-	id_DifMean,
-	id_Min,
-	id_Max,
-	id_Range,
-	id_Var,
-	id_StdDev,
-	id_StdDevLo,
-	id_StdDevHi,
-	id_DevMean,
-	id_Percent,
-	id_Count
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Directional_Statistics::CGSGrid_Directional_Statistics(void)
-{
-	Set_Name		(_TL("Directional Statistics for Single Grid"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Calculates for each cell statistical properties (arithmetic mean, minimum, maximum, "
-		"variance, standard deviation) of all cells lying in given direction based on the input grid. "
-	));
-
-
-	Parameters.Add_Grid(NULL, "GRID"		, _TL("Grid")								, _TL(""), PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL, "MEAN"		, _TL("Arithmetic Mean")					, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "DIFMEAN"		, _TL("Difference from Arithmetic Mean")	, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "MIN"			, _TL("Minimum")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "MAX"			, _TL("Maximum")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "RANGE"		, _TL("Range")								, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "VAR"			, _TL("Variance")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "STDDEV"		, _TL("Standard Deviation")					, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "STDDEVLO"	, _TL("Mean less Standard Deviation")		, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "STDDEVHI"	, _TL("Mean plus Standard Deviation")		, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "DEVMEAN"		, _TL("Deviation from Arithmetic Mean")		, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "PERCENT"		, _TL("Percentile")							, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-
-	Parameters.Add_Shapes(
-		NULL, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Shapes(
-		NULL, "POINTS_OUT"	, _TL("Directional Statistics for Points"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Value(
-		NULL, "DIRECTION"	, _TL("Direction [Degree]"),
-		_TL(""),
-		PARAMETER_TYPE_Double
-	);
-
-	Parameters.Add_Value(
-		NULL, "TOLERANCE"	, _TL("Tolerance [Degree]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 0.0, 0.0, true, 45.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL, "MAXDISTANCE"	, _TL("Maximum Distance [Cells]"),
-		_TL("Maximum distance parameter is ignored if set to zero (default)."),
-		PARAMETER_TYPE_Int, 0.0, 0.0, true
-	);
-
-	Parameters.Add_Parameters(
-		NULL, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Directional_Statistics::On_Execute(void)
-{
-	int			Radius;
-	double		Direction, Tolerance, s[id_Count];
-	CSG_Shapes	*pPoints;
-
-	//-----------------------------------------------------
-	m_pGrid		= Parameters("GRID")		->asGrid();
-
-	m_pMean		= Parameters("MEAN")		->asGrid();
-	m_pDifMean	= Parameters("DIFMEAN")		->asGrid();
-	m_pMin		= Parameters("MIN")			->asGrid();
-	m_pMax		= Parameters("MAX")			->asGrid();
-	m_pRange	= Parameters("RANGE")		->asGrid();
-	m_pVar		= Parameters("VAR")			->asGrid();
-	m_pStdDev	= Parameters("STDDEV")		->asGrid();
-	m_pStdDevLo	= Parameters("STDDEVLO")	->asGrid();
-	m_pStdDevHi	= Parameters("STDDEVHI")	->asGrid();
-	m_pDevMean	= Parameters("DEVMEAN")		->asGrid();
-	m_pPercent	= Parameters("PERCENT")		->asGrid();
-
-	pPoints		= Parameters("POINTS")		->asShapes();
-
-	//-----------------------------------------------------
-	if( !(m_pMean || m_pDifMean || m_pMin || m_pMax || m_pRange || m_pVar || m_pStdDev || m_pStdDevLo || m_pStdDevHi || m_pPercent || pPoints) )
-	{
-		Message_Dlg(_TL("no target specified"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Direction	= Parameters("DIRECTION")	->asDouble() * M_DEG_TO_RAD;
-	Tolerance	= Parameters("TOLERANCE")	->asDouble() * M_DEG_TO_RAD;
-
-	Radius		= Parameters("MAXDISTANCE")	->asInt();
-
-	if( Radius <= 0 )
-	{
-		Radius	= 1 + (int)SG_Get_Length(Get_NX(), Get_NY());
-	}
-
-	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	if( !m_Cells.Set_Sector(Radius, Direction, Tolerance) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	if( m_pMean || m_pDifMean || m_pMin || m_pMax || m_pRange || m_pVar || m_pStdDev || m_pStdDevLo || m_pStdDevHi || m_pPercent )
-	{
-		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-		{
-			for(int x=0; x<Get_NX(); x++)
-			{
-				if( Get_Statistics(x, y, s) )
-				{
-					if( m_pMean     )	m_pMean		->Set_Value(x, y, s[id_Mean    ]);
-					if( m_pDifMean  )	m_pDifMean	->Set_Value(x, y, s[id_DifMean ]);
-					if( m_pMin      )	m_pMin		->Set_Value(x, y, s[id_Min     ]);
-					if( m_pMax      )	m_pMax		->Set_Value(x, y, s[id_Max     ]);
-					if( m_pRange    )	m_pRange	->Set_Value(x, y, s[id_Range   ]);
-					if( m_pVar      )	m_pVar		->Set_Value(x, y, s[id_Var     ]);
-					if( m_pStdDev   )	m_pStdDev	->Set_Value(x, y, s[id_StdDev  ]);
-					if( m_pStdDevLo )	m_pStdDevLo	->Set_Value(x, y, s[id_StdDevLo]);
-					if( m_pStdDevHi )	m_pStdDevHi	->Set_Value(x, y, s[id_StdDevHi]);
-					if( m_pDevMean  )	m_pDevMean	->Set_Value(x, y, s[id_DevMean ]);
-					if( m_pPercent  )	m_pPercent	->Set_Value(x, y, s[id_Percent ]);
-				}
-				else
-				{
-					if( m_pMean     )	m_pMean		->Set_NoData(x, y);
-					if( m_pDifMean  )	m_pDifMean	->Set_NoData(x, y);
-					if( m_pMin      )	m_pMin		->Set_NoData(x, y);
-					if( m_pMax      )	m_pMax		->Set_NoData(x, y);
-					if( m_pRange    )	m_pRange	->Set_NoData(x, y);
-					if( m_pVar      )	m_pVar		->Set_NoData(x, y);
-					if( m_pStdDev   )	m_pStdDev	->Set_NoData(x, y);
-					if( m_pStdDevLo )	m_pStdDevLo	->Set_NoData(x, y);
-					if( m_pStdDevHi )	m_pStdDevHi	->Set_NoData(x, y);
-					if( m_pDevMean  )	m_pDevMean	->Set_NoData(x, y);
-					if( m_pPercent  )	m_pPercent	->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( pPoints )
-	{
-		if( Parameters("POINTS_OUT")->asShapes() && Parameters("POINTS_OUT")->asShapes() != pPoints )
-		{
-			pPoints	= Parameters("POINTS_OUT")->asShapes();
-			pPoints->Create(*Parameters("POINTS")->asShapes());
-			pPoints->Set_Name(CSG_String::Format(SG_T("%s [a: %.2f, d: %.2f]"), _TL("Directional Statistics"), Direction * M_RAD_TO_DEG, Tolerance * M_RAD_TO_DEG));
-		}
-
-		int		x, y, id_Offset	= pPoints->Get_Field_Count();
-
-		pPoints->Add_Field(_TL("MEAN")			, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("DIFF_MEAN")		, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("MIN")			, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("MAX")			, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("RANGE")			, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("VARIANCE")		, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("STDDEV")		, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("STDDEV_LO")		, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("STDDEV_HI")		, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("STDDEV_MEAN")	, SG_DATATYPE_Double);
-		pPoints->Add_Field(_TL("PERCENTILE")	, SG_DATATYPE_Double);
-
-		for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
-		{
-			CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
-
-			if( Get_System()->Get_World_to_Grid(x, y, pPoint->Get_Point(0)) && Get_Statistics(x, y, s) )
-			{
-				for(int i=0; i<id_Count; i++)
-				{
-					pPoint->Set_Value(id_Offset + i, s[i]);
-				}
-			}
-			else
-			{
-				for(int i=0; i<id_Count; i++)
-				{
-					pPoint->Set_NoData(id_Offset + i);
-				}
-			}
-		}
-
-		DataObject_Update(pPoints);
-	}
-
-	//-----------------------------------------------------
-	m_Cells.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Directional_Statistics::Get_Statistics(int x, int y, double *s)
-{
-	if( m_pGrid->is_InGrid(x, y) )
-	{
-		int		i, ix, iy, nLower;
-		double	z, iz, id, iw;
-
-		CSG_Simple_Statistics	Statistics;
-
-		for(i=0, nLower=0, z=m_pGrid->asDouble(x, y); i<m_Cells.Get_Count(); i++)
-		{
-			if( m_Cells.Get_Values(i, ix = x, iy = y, id, iw, true) && id > 0.0 && m_pGrid->is_InGrid(ix, iy) )
-			{
-				Statistics.Add_Value(iz = m_pGrid->asDouble(ix, iy), iw);
-
-				if( z > iz )
-				{
-					nLower++;
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		if( Statistics.Get_Weights() > 0.0 )
-		{
-			s[id_Mean    ]	= Statistics.Get_Mean();
-			s[id_DifMean ]	= m_pGrid->asDouble(x, y) - Statistics.Get_Mean();
-			s[id_Min     ]	= Statistics.Get_Minimum();
-			s[id_Max     ]	= Statistics.Get_Maximum();
-			s[id_Range   ]	= Statistics.Get_Range();
-			s[id_Var     ]	= Statistics.Get_Variance();
-			s[id_StdDev  ]	= Statistics.Get_StdDev();
-			s[id_StdDevLo]	= Statistics.Get_Mean() - Statistics.Get_StdDev();
-			s[id_StdDevHi]	= Statistics.Get_Mean() + Statistics.Get_StdDev();
-			s[id_DevMean ]	= Statistics.Get_StdDev() > 0.0 ? ((z - Statistics.Get_Mean()) / Statistics.Get_StdDev()) : 0.0;
-			s[id_Percent ]	= 100.0 * nLower / (double)Statistics.Get_Count();
-
-			return( true );
-		}
-	}
-
-	//-----------------------------------------------------
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.h
deleted file mode 100644
index 6c555af..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Directional_Statistics.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//            GSGrid_Directional_Statistics.h            //
-//                                                       //
-//                 Copyright (C) 2003 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__GSGrid_Directional_Statistics_H
-#define HEADER_INCLUDED__GSGrid_Directional_Statistics_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSGrid_Directional_Statistics : public CSG_Module_Grid
-{
-public:
-	CGSGrid_Directional_Statistics(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	CSG_Grid_Cell_Addressor	m_Cells;
-
-	CSG_Grid				*m_pGrid, *m_pMean, *m_pDifMean, *m_pMin, *m_pMax, *m_pRange, *m_pVar, *m_pStdDev, *m_pStdDevLo, *m_pStdDevHi, *m_pDevMean, *m_pPercent;
-
-
-	bool					Get_Statistics		(int x, int y, double *s);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSGrid_Directional_Statistics_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.cpp
deleted file mode 100644
index 8098b17..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Residuals.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  GSGrid_Residuals.cpp                 //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "GSGrid_Residuals.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Residuals::CGSGrid_Residuals(void)
-{
-	//-----------------------------------------------------
-	// 1. Info...
-
-	Set_Name		(_TL("Residual Analysis (Grid)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2003"));
-
-	Set_Description	(_TW("Relations of each grid cell to its neighborhood. "
-		"Wilson & Gallant (2000) used this type of calculation in terrain analysis.\n"
-		"\n"
-		"Reference:\n"
-		"- Wilson, J.P., Gallant, J.C., [Eds.] (2000): "
-		"'Terrain analysis - principles and applications', "
-		"New York, John Wiley & Sons, Inc.\n"
-	));
-
-
-	//-----------------------------------------------------
-	// 2. Parameters...
-
-	Parameters.Add_Grid(	NULL, "GRID"	, _TL("Grid")						, _TL(""), PARAMETER_INPUT);
-
-	Parameters.Add_Grid(	NULL, "MEAN"	, _TL("Mean Value")					, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "DIFF"	, _TL("Difference from Mean Value")	, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "STDDEV"	, _TL("Standard Deviation")			, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "RANGE"	, _TL("Value Range")				, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "MIN"		, _TL("Minimum Value")				, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "MAX"		, _TL("Maximum Value")				, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "DEVMEAN"	, _TL("Deviation from Mean Value")	, _TL(""), PARAMETER_OUTPUT);
-	Parameters.Add_Grid(	NULL, "PERCENT"	, _TL("Percentile")					, _TL(""), PARAMETER_OUTPUT);
-
-	Parameters.Add_Value(	NULL, "RADIUS"	, _TL("Radius (Cells)")				, _TL(""), PARAMETER_TYPE_Int, 7, 1, true);
-
-	Parameters.Add_Parameters(
-		NULL, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Residuals::On_Execute(void)
-{
-	m_pGrid		= Parameters("GRID")	->asGrid();
-
-	m_pMean		= Parameters("MEAN")	->asGrid();
-	m_pDiff		= Parameters("DIFF")	->asGrid();
-	m_pStdDev	= Parameters("STDDEV")	->asGrid();
-	m_pRange	= Parameters("RANGE")	->asGrid();
-	m_pMin		= Parameters("MIN")		->asGrid();
-	m_pMax		= Parameters("MAX")		->asGrid();
-	m_pDevMean	= Parameters("DEVMEAN")	->asGrid();
-	m_pPercent	= Parameters("PERCENT")	->asGrid();
-
-	DataObject_Set_Colors(m_pDiff	, 100, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pStdDev	, 100, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pRange	, 100, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pMin	, 100, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pMax	, 100, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pDevMean, 100, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pPercent, 100, SG_COLORS_RED_GREY_BLUE, true);
-
-	//-----------------------------------------------------
-	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	if( !m_Cells.Set_Radius(Parameters("RADIUS")->asInt()) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			Get_Statistics(x, y);
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Cells.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Residuals::Get_Statistics(int x, int y)
-{
-	if( m_pGrid->is_InGrid(x, y) )
-	{
-		int		i, ix, iy, nLower;
-		double	z, iz, id, iw;
-
-		CSG_Simple_Statistics	Statistics;
-
-		for(i=0, nLower=0, z=m_pGrid->asDouble(x, y); i<m_Cells.Get_Count(); i++)
-		{
-			if( m_Cells.Get_Values(i, ix = x, iy = y, id, iw, true) && id > 0.0 && m_pGrid->is_InGrid(ix, iy) )
-			{
-				Statistics.Add_Value(iz = m_pGrid->asDouble(ix, iy), iw);
-
-				if( z > iz )
-				{
-					nLower++;
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		if( Statistics.Get_Weights() > 0.0 )
-		{
-			m_pMean		->Set_Value(x, y, Statistics.Get_Mean());
-			m_pDiff		->Set_Value(x, y, z - Statistics.Get_Mean());
-			m_pStdDev	->Set_Value(x, y, Statistics.Get_StdDev());
-			m_pRange	->Set_Value(x, y, Statistics.Get_Range());
-			m_pMin		->Set_Value(x, y, Statistics.Get_Minimum());
-			m_pMax		->Set_Value(x, y, Statistics.Get_Maximum());
-			m_pDevMean	->Set_Value(x, y, Statistics.Get_StdDev() > 0.0 ? ((z - Statistics.Get_Mean()) / Statistics.Get_StdDev()) : 0.0);
-			m_pPercent	->Set_Value(x, y, 100.0 * nLower / (double)Statistics.Get_Count());
-
-			return( true );
-		}
-	}
-
-	//-----------------------------------------------------
-	m_pMean		->Set_NoData(x, y);
-	m_pDiff		->Set_NoData(x, y);
-	m_pStdDev	->Set_NoData(x, y);
-	m_pRange	->Set_NoData(x, y);
-	m_pMin		->Set_NoData(x, y);
-	m_pMax		->Set_NoData(x, y);
-	m_pDevMean	->Set_NoData(x, y);
-	m_pPercent	->Set_NoData(x, y);
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.h
deleted file mode 100644
index 1d3ab86..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Residuals.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  GSGrid_Residuals.h                   //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__GSGrid_Residuals_H
-#define HEADER_INCLUDED__GSGrid_Residuals_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSGrid_Residuals : public CSG_Module_Grid
-{
-public:
-	CGSGrid_Residuals(void);
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	CSG_Grid_Cell_Addressor	m_Cells;
-
-	CSG_Grid				*m_pGrid, *m_pMean, *m_pDiff, *m_pStdDev, *m_pRange, *m_pMin, *m_pMax, *m_pDevMean, *m_pPercent;
-
-
-	bool					Get_Statistics	(int x, int y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSGrid_Residuals_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.cpp
deleted file mode 100644
index d8dbfb2..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.cpp
+++ /dev/null
@@ -1,390 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Statistics.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 GSGrid_Statistics.cpp                 //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "GSGrid_Statistics.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Statistics::CGSGrid_Statistics(void)
-{
-	Set_Name		(_TL("Statistics for Grids"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2005"));
-
-	Set_Description	(_TW(
-		"Calculates statistical properties (arithmetic mean, minimum, maximum, "
-		"variance, standard deviation) for each cell position for the values of "
-		"the selected grids."
-	));
-
-
-	Parameters.Add_Grid_List(
-		NULL, "GRIDS"	, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(NULL, "MEAN"	, _TL("Arithmetic Mean")             , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "MIN"		, _TL("Minimum")                     , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "MAX"		, _TL("Maximum")                     , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "RANGE"	, _TL("Range")                       , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "SUM"		, _TL("Sum")                         , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "VAR"		, _TL("Variance")                    , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "STDDEV"	, _TL("Standard Deviation")          , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "STDDEVLO", _TL("Mean less Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "STDDEVHI", _TL("Mean plus Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-	Parameters.Add_Grid(NULL, "PCTL"	, _TL("Percentile")                  , _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-
-	Parameters.Add_Value(
-		NULL, "PCTL_VAL", _TL("Percentile"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGSGrid_Statistics::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PCTL")) )
-	{
-		pParameters->Get_Parameter("PCTL_VAL")->Set_Enabled(pParameter->asGrid() != NULL);
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Statistics::On_Execute(void)
-{
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
-
-	if( pGrids->Get_Count() <= 1 )
-	{
-		Error_Set(_TL("no grids in selection"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Grid	*pMean			= Parameters("MEAN"    )->asGrid();
-	CSG_Grid	*pMin			= Parameters("MIN"     )->asGrid();
-	CSG_Grid	*pMax			= Parameters("MAX"     )->asGrid();
-	CSG_Grid	*pRange			= Parameters("RANGE"   )->asGrid();
-	CSG_Grid	*pSum			= Parameters("SUM"     )->asGrid();
-	CSG_Grid	*pVar			= Parameters("VAR"     )->asGrid();
-	CSG_Grid	*pStdDev		= Parameters("STDDEV"  )->asGrid();
-	CSG_Grid	*pStdDevLo		= Parameters("STDDEVLO")->asGrid();
-	CSG_Grid	*pStdDevHi		= Parameters("STDDEVHI")->asGrid();
-	CSG_Grid	*pPercentile	= Parameters("PCTL"    )->asGrid();
-
-	if( !pMean && !pMin && !pMax && !pRange && !pSum && !pVar && !pStdDev && !pStdDevLo && !pStdDevHi && !pPercentile )
-	{
-		Error_Set(_TL("no parameter output specified"));
-
-		return( false );
-	}
-
-	double	dRank	= Parameters("PCTL_VAL")->asDouble() / 100.0;
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			CSG_Table				Values;
-			CSG_Simple_Statistics	s;
-
-			for(int i=0; i<pGrids->Get_Count(); i++)
-			{
-				if( !pGrids->asGrid(i)->is_NoData(x, y) )
-				{
-					double	z	= pGrids->asGrid(i)->asDouble(x, y);
-
-					s.Add_Value(z);
-
-					if( pPercentile )
-					{
-						if( Values.Get_Field_Count() == 0 )
-						{
-							Values.Add_Field("Z", SG_DATATYPE_Double);
-						}
-
-						Values.Add_Record()->Set_Value(0, z);
-					}
-				}
-			}
-
-			//-----------------------------------------
-			if( s.Get_Count() <= 0 )
-			{
-				if( pMean       )	pMean		->Set_NoData(x, y);
-				if( pMin        )	pMin		->Set_NoData(x, y);
-				if( pMax        )	pMax		->Set_NoData(x, y);
-				if( pRange      )	pRange		->Set_NoData(x, y);
-				if( pSum        )	pSum		->Set_NoData(x, y);
-				if( pVar        )	pVar		->Set_NoData(x, y);
-				if( pStdDev     )	pStdDev		->Set_NoData(x, y);
-				if( pStdDevLo   )	pStdDevLo	->Set_NoData(x, y);
-				if( pStdDevHi   )	pStdDevHi	->Set_NoData(x, y);
-				if( pPercentile )	pPercentile	->Set_NoData(x, y);
-			}
-			else
-			{
-				if( pMean       )	pMean		->Set_Value(x, y, s.Get_Mean());
-				if( pMin        )	pMin		->Set_Value(x, y, s.Get_Minimum());
-				if( pMax        )	pMax		->Set_Value(x, y, s.Get_Maximum());
-				if( pRange      )	pRange		->Set_Value(x, y, s.Get_Range());
-				if( pSum        )	pSum		->Set_Value(x, y, s.Get_Sum());
-				if( pVar        )	pVar		->Set_Value(x, y, s.Get_Variance());
-				if( pStdDev     )	pStdDev		->Set_Value(x, y, s.Get_StdDev());
-				if( pStdDevLo   )	pStdDevLo	->Set_Value(x, y, s.Get_Mean() - s.Get_StdDev());
-				if( pStdDevHi   )	pStdDevHi	->Set_Value(x, y, s.Get_Mean() + s.Get_StdDev());
-				if( pPercentile )
-				{
-					Values.Set_Index(0, TABLE_INDEX_Ascending);
-
-					pPercentile->Set_Value(x, y, Values.Get_Record_byIndex((int)(dRank * s.Get_Count()))->asDouble(0));
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Statistics_To_Table::CGSGrid_Statistics_To_Table(void)
-{
-	Set_Name		(_TL("Save Grid Statistics to Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Calculates statistical properties (arithmetic mean, minimum, maximum, "
-		"variance, standard deviation) for each of the given grids and saves "
-		"it to a table."
-	));
-
-
-	Parameters.Add_Grid_List(
-		NULL, "GRIDS"	, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL, "STATS"	, _TL("Statistics for Grids"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(NULL, "DATA_CELLS"  , _TL("Number of Data Cells")        , _TL(""), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(NULL, "NODATA_CELLS", _TL("Number of No-Data Cells")     , _TL(""), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(NULL, "CELLSIZE"    , _TL("Cellsize")                    , _TL(""), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(NULL, "MEAN"        , _TL("Arithmetic Mean")             , _TL(""), PARAMETER_TYPE_Bool, true);
-	Parameters.Add_Value(NULL, "MIN"         , _TL("Minimum")                     , _TL(""), PARAMETER_TYPE_Bool, true);
-	Parameters.Add_Value(NULL, "MAX"         , _TL("Maximum")                     , _TL(""), PARAMETER_TYPE_Bool, true);
-	Parameters.Add_Value(NULL, "RANGE"       , _TL("Range")                       , _TL(""), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(NULL, "VAR"         , _TL("Variance")                    , _TL(""), PARAMETER_TYPE_Bool, true);
-	Parameters.Add_Value(NULL, "STDDEV"      , _TL("Standard Deviation")          , _TL(""), PARAMETER_TYPE_Bool, true);
-	Parameters.Add_Value(NULL, "STDDEVLO"    , _TL("Mean less Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(NULL, "STDDEVHI"    , _TL("Mean plus Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(NULL, "PCTL"        , _TL("Percentile")                  , _TL(""), PARAMETER_TYPE_Bool, false);
-
-	Parameters.Add_Value(
-		NULL, "PCTL_VAL", _TL("Percentile"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGSGrid_Statistics_To_Table::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PCTL")) )
-	{
-		pParameters->Get_Parameter("PCTL_VAL")->Set_Enabled(pParameter->asBool());
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Statistics_To_Table::On_Execute(void)
-{
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
-
-	if( pGrids->Get_Count() < 1 )
-	{
-		Error_Set(_TL("no grids in selection"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Table	*pTable	= Parameters("STATS")->asTable();
-
-	pTable->Destroy();
-	pTable->Set_Name(_TL("Statistics for Grids"));
-	pTable->Add_Field(_TL("NAME"), SG_DATATYPE_String);
-
-	if( Parameters("DATA_CELLS"  )->asBool() )	pTable->Add_Field(_TL("DATA_CELLS"  ), SG_DATATYPE_Int);
-	if( Parameters("NODATA_CELLS")->asBool() )	pTable->Add_Field(_TL("NODATA_CELLS"), SG_DATATYPE_Int);
-	if( Parameters("CELLSIZE"    )->asBool() )	pTable->Add_Field(_TL("CELLSIZE"    ), SG_DATATYPE_Double);
-	if( Parameters("MEAN"        )->asBool() )	pTable->Add_Field(_TL("MEAN"        ), SG_DATATYPE_Double);
-	if( Parameters("MIN"         )->asBool() )	pTable->Add_Field(_TL("MIN"         ), SG_DATATYPE_Double);
-	if( Parameters("MAX"         )->asBool() )	pTable->Add_Field(_TL("MAX"         ), SG_DATATYPE_Double);
-	if( Parameters("RANGE"       )->asBool() )	pTable->Add_Field(_TL("RANGE"       ), SG_DATATYPE_Double);
-	if( Parameters("VAR"         )->asBool() )	pTable->Add_Field(_TL("VAR"         ), SG_DATATYPE_Double);
-	if( Parameters("STDDEV"      )->asBool() )	pTable->Add_Field(_TL("STDDEV"      ), SG_DATATYPE_Double);
-	if( Parameters("STDDEVLO"    )->asBool() )	pTable->Add_Field(_TL("STDDEVLO"    ), SG_DATATYPE_Double);
-	if( Parameters("STDDEVHI"    )->asBool() )	pTable->Add_Field(_TL("STDDEVHI"    ), SG_DATATYPE_Double);
-	if( Parameters("PCTL"        )->asBool() )	pTable->Add_Field(_TL("PCTL"        ), SG_DATATYPE_Double);
-
-	if( pTable->Get_Field_Count() <= 1 )
-	{
-		Error_Set(_TL("no parameter output specified"));
-
-		return( false );
-	}
-
-	double	dRank	= Parameters("PCTL")->asBool() ? Parameters("PCTL_VAL")->asDouble() : -1.0;
-
-	//-----------------------------------------------------
-	for(int i=0; i<pGrids->Get_Count() && Process_Get_Okay(); i++)
-	{
-		CSG_Grid			*pGrid		= pGrids->asGrid(i);
-		CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-		pRecord->Set_Value("NAME"        , pGrid->Get_Name());
-		pRecord->Set_Value("DATA_CELLS"  , pGrid->Get_NCells() - pGrid->Get_NoData_Count());
-		pRecord->Set_Value("NODATA_CELLS", pGrid->Get_NoData_Count());
-		pRecord->Set_Value("CELLSIZE"    , pGrid->Get_Cellsize());
-		pRecord->Set_Value("MEAN"        , pGrid->Get_ArithMean());
-		pRecord->Set_Value("MIN"         , pGrid->Get_ZMin());
-		pRecord->Set_Value("MAX"         , pGrid->Get_ZMax());
-		pRecord->Set_Value("RANGE"       , pGrid->Get_ZRange());
-		pRecord->Set_Value("VAR"         , pGrid->Get_Variance());
-		pRecord->Set_Value("STDDEV"      , pGrid->Get_StdDev());
-		pRecord->Set_Value("STDDEVLO"    , pGrid->Get_ArithMean() - pGrid->Get_StdDev());
-		pRecord->Set_Value("STDDEVHI"    , pGrid->Get_ArithMean() + pGrid->Get_StdDev());
-
-		if( dRank > 0.0 && dRank < 100.0 )
-		{
-			pRecord->Set_Value("PCTL", pGrid->Get_Percentile(dRank));	// this is a time consuming operation
-		}
-	}
-
-	if( dRank > 0.0 && dRank < 100.0 )
-	{
-		pTable->Set_Field_Name(pTable->Get_Field_Count() - 1, CSG_String::Format(SG_T("%s%02d"), _TL("PCTL"), (int)dRank));
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.h
deleted file mode 100644
index 8b1b466..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Statistics.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  GSGrid_Statistics.h                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__GSGrid_Statistics_H
-#define HEADER_INCLUDED__GSGrid_Statistics_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSGrid_Statistics : public CSG_Module_Grid  
-{
-public:
-	CGSGrid_Statistics(void);
-
-
-protected:
-
-	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool			On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSGrid_Statistics_To_Table : public CSG_Module_Grid  
-{
-public:
-	CGSGrid_Statistics_To_Table(void);
-
-
-protected:
-
-	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool			On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSGrid_Statistics_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.cpp
deleted file mode 100644
index e3eaeac..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Variance.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  GSGrid_Variance.cpp                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "GSGrid_Variance.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Variance::CGSGrid_Variance(void)
-{
-	Set_Name		(_TL("Representativeness (Grid)"));
-
-	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"Representativeness - calculation of the variance within a given search radius.\n"
-		"\n"
-		"Reference:\n"
-		"- Boehner, J., Koethe, R., Trachinow, C. (1997): "
-		"'Weiterentwicklung der automatischen Reliefanalyse auf der Basis von Digitalen Gelaendemodellen', "
-		"Goettinger Geographische Abhandlungen, Vol.100, p.3-21\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "INPUT"	, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "RESULT"	, _TL("Representativeness"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RADIUS"	, _TL("Radius (Cells)"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 10
-	);
-
-	Parameters.Add_Value(
-		NULL	, "EXPONENT", _TL("Exponent"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1
-	);
-}
-
-//---------------------------------------------------------
-CGSGrid_Variance::~CGSGrid_Variance(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Variance::On_Execute(void)
-{
-	int		x, y;
-
-	//-----------------------------------------------------
-	pInput		= Parameters("INPUT"	)->asGrid();
-	pOutput		= Parameters("RESULT"	)->asGrid();
-
-	maxRadius	= Parameters("RADIUS"	)->asInt();
-	Exponent	= Parameters("EXPONENT"	)->asDouble();
-
-	//-----------------------------------------------------
-	Initialize();
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			pOutput->Set_Value(x,y, Get_Laenge(x,y) );
-		}
-	}
-
-	//-----------------------------------------------------
-	Finalize();
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CGSGrid_Variance::Initialize(void)
-{
-	pOutput->Assign_NoData();
-
-	V		= (double *)malloc((maxRadius + 2) * sizeof(double));
-	Z		= (int    *)malloc((maxRadius + 2) * sizeof(int   ));
-
-	g		= (double *)malloc((maxRadius + 2) * sizeof(double));
-	m		= (double *)malloc((maxRadius + 2) * sizeof(double));
-
-	rLength	= (int    *)malloc((maxRadius + 2) * sizeof(int   ));
-
-	Init_Radius();
-}
-
-//---------------------------------------------------------
-void CGSGrid_Variance::Init_Radius(void)
-{
-	int		k, maxZ;
-
-	long	i, j, iijj, 
-			rr, r1r1, z;
-
-	maxZ		= z	= 0;
-	rLength[0]	= 0;
-
-	x_diff		= y_diff	= NULL;
-
-	for(k=1; k<=maxRadius; k++) 
-	{
-		rr		= k*k;
-		r1r1	= (k - 1) * (k - 1);
-
-		for(i=-k; i<=k; i++)
-		{
-			for(j=-k; j<=k; j++) 
-			{
-				iijj	= i*i + j*j;
-
-				if( iijj<=rr && iijj>r1r1 ) 
-				{
-					if( maxZ<=z )
-					{
-						maxZ	+= 1000;
-						x_diff	= (int *)realloc(x_diff,maxZ*sizeof(int));
-						y_diff	= (int *)realloc(y_diff,maxZ*sizeof(int));
-					}
-
-					x_diff[z]	= j;
-					y_diff[z]	= i;
-
-					z++;
-				}
-			}
-		}
-
-		rLength[k]	= z;
-	}
-}
-
-//---------------------------------------------------------
-void CGSGrid_Variance::Finalize(void)
-{
-	free(V);
-	free(Z);
-
-	free(rLength);
-	free(g);
-	free(m);
-
-	free(x_diff);
-	free(y_diff);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CGSGrid_Variance::Get_Laenge(int x, int y)
-{
-	int		iRadius, Count;
-
-	double	d;
-
-	//-----------------------------------------------------
-	V[0]	= Get_GSGrid_Variance(x,y,1,Count);
-	Z[0]	= Count;
-
-	for(iRadius=1; iRadius<maxRadius; iRadius++)
-	{
-		V[iRadius]	= V[iRadius-1] + Get_GSGrid_Variance(x, y, iRadius + 1, Count);
-		Z[iRadius]	= Z[iRadius-1] + Count;
-	}
-
-	for(iRadius=0; iRadius<maxRadius; iRadius++)
-	{
-		V[iRadius]	/= (double)Z[iRadius];
-	}
-
-	//-----------------------------------------------------
-	d		= Get_Steigung();
-
-	if( d == 0.0 )
-		return( Get_Cellsize() * maxRadius );
-	else
-		return( V[maxRadius-1] / d / 2.0 );
-}
- 
-//---------------------------------------------------------
-double CGSGrid_Variance::Get_GSGrid_Variance(int x, int y, int iRadius, int &Count)
-{
-	int		i, ix, iy;
-
-	double	d, z, Variance;
-
-	Variance	= 0;
-	z			= pInput->asDouble(x,y);
-
-	for(i=rLength[iRadius-1], Count=0; i<rLength[iRadius]; i++, Count++)
-	{
-		ix	= x + x_diff[i];
-		if( ix < 0 )
-			ix	= 0;
-		else if( ix >= Get_NX() )
-			ix	= Get_NX() - 1;
-
-		iy	= y + y_diff[i];
-		if( iy < 0 )
-			iy	= 0;
-		else if( iy >= Get_NY() )
-			iy	= Get_NY() - 1;
-
-		d			= z - pInput->asDouble(ix,iy);
-		Variance	+= d * d;
-	}
-
-	return( Variance );
-}
-
-//---------------------------------------------------------
-double CGSGrid_Variance::Get_Steigung(void)
-{
-	int		i;
-
-	double	summe_mg, summe_g;
-
-	//-----------------------------------------------------
-	// Steigungen berechnen...
-	m[0]		= V[0] / Get_Cellsize();
-
-	for(i=1; i<maxRadius; i++)
-		m[i]	= (V[i] - V[i-1]) / Get_Cellsize();
-
-	//-----------------------------------------------------
-	// Gewichte berechnen (inverse distance)...
-	for(i=0; i<maxRadius; i++)
-		g[i]	= pow(Get_Cellsize() * (i + 1), -Exponent);
-
-	//-----------------------------------------------------
-	// Berechne Summe der gewichteten Steigungen und Summe der Gewichte...
-	summe_mg	= 0;
-	summe_g		= 0;
-
-	for(i=0; i<maxRadius; i++)
-	{
-		summe_mg	+= m[i] * g[i];
-		summe_g		+= g[i];
-	}
-
-	return( summe_mg / summe_g );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.h
deleted file mode 100644
index 02a9d09..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Variance.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   GSGrid_Variance.h                   //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__GSGrid_Variance_H
-#define HEADER_INCLUDED__GSGrid_Variance_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSGrid_Variance : public CSG_Module_Grid
-{
-public:
-	CGSGrid_Variance(void);
-	virtual ~CGSGrid_Variance(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	int						maxRadius,
-							*Z, *x_diff, *y_diff, *rLength;
-
-	double					Exponent,	// Exponent fuer "inverse distance" Gewichte (calc_Steigung).
-							*V, *m, *g;
-
-	CSG_Grid				*pInput, *pOutput, *pRadius;
-
-
-	void					Initialize			(void);
-	void					Finalize			(void);
-
-	void					Init_Radius			(void);
-
-	double					Get_Laenge			(int x, int y);
-	double					Get_GSGrid_Variance	(int x, int y, int iRadius, int &Count);
-	double					Get_Steigung		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSGrid_Variance_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.cpp
deleted file mode 100644
index ad71e26..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.cpp
+++ /dev/null
@@ -1,343 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Variance_Radius.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               GSGrid_Variance_Radius.cpp              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "GSGrid_Variance_Radius.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Variance_Radius::CGSGrid_Variance_Radius(void)
-{
-	Set_Name		(_TL("Radius of Variance (Grid)"));
-
-	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"Find the radius within which the cell values exceed the given variance criterium. "
-		"This module is closely related to the representativeness calculation "
-		"(variance within given search radius). "
-		"For easier usage, the variance criterium is entered as standard deviation value. "
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "INPUT"		, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "RESULT"		, _TL("Variance Radius"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "VARIANCE"	, _TL("Standard Deviation"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 1.0
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Maximum Search Radius (cells)"),
-		_TL(""),
-		PARAMETER_TYPE_Int		, 20
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "OUTPUT"		, _TL("Type of Output"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Cells"),
-			_TL("Map Units")
-		), 0
-	);
-
-	//-----------------------------------------------------
-	pInput		= NULL;
-	pInputQ		= NULL;
-	Check		= NULL;
-	maxRadius	= 0;
-}
-
-//---------------------------------------------------------
-CGSGrid_Variance_Radius::~CGSGrid_Variance_Radius(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Variance_Radius::On_Execute(void)
-{
-	int		x, y;
-
-	//-----------------------------------------------------
-	stopVariance	= M_SQR(Parameters("VARIANCE")->asDouble());
-	maxRadius		= Parameters("RADIUS")	->asInt();
-	bWriteGridsize	= Parameters("OUTPUT")	->asInt() == 0;
-
-	pGrid			= Parameters("INPUT")	->asGrid();
-	pResult			= Parameters("RESULT")	->asGrid();
-	pResult->Set_Name(CSG_String::Format(SG_T("%s >= %f"), _TL("Radius with Variance"), stopVariance));
-
-	//-----------------------------------------------------
-	Initialize();
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			pResult->Set_Value(x, y, Get_Radius(x, y));
-		}
-	}
-
-	Finalize();
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CGSGrid_Variance_Radius::Initialize(void)
-{
-	int		x, y;
-	double	d;
-
-	//-----------------------------------------------------
-	pInput	= SG_Create_Grid(pGrid);
-	pInputQ	= SG_Create_Grid(pGrid);
-
-	for(y=0; y<Get_NY(); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			d	= pGrid->asDouble(x,y);
-			pInput	->Set_Value(x, y, d  );
-			pInputQ	->Set_Value(x, y, d*d);
-		}
-	}
-
-	//-----------------------------------------------------
-	// Radius Check-Matrix erstellen...
-	Check	= (int **)malloc((maxRadius + 1) * sizeof(int *));
-
-	for(y=0; y<=maxRadius; y++)
-	{
-		Check[y]	= (int *)malloc((maxRadius + 1) * sizeof(int));
-
-		for(x=0; x<=maxRadius; x++)
-		{
-		//	Check[y][x]	= (int)sqrt(x*x + y*y);
-			Check[y][x]	= (int)sqrt((x + 0.5) * (x + 0.5) + (y + 0.5) * (y + 0.5));
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CGSGrid_Variance_Radius::Finalize(void)
-{
-	if( pInput )
-	{
-		delete(pInput);
-		pInput		= NULL;
-	}
-
-	if( pInputQ )
-	{
-		delete(pInputQ);
-		pInputQ		= NULL;
-	}
-
-	if( Check )
-	{
-		for(int y=0; y<=maxRadius; y++)
-		{
-			free(Check[y]);
-		}
-		free(Check);
-		Check		= NULL;
-		maxRadius	= 0;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CGSGrid_Variance_Radius::Get_Radius(int xPoint, int yPoint)
-{
-	const double	sqrt2	= 1.0 / sqrt(2.0);
-
-	int		x, y, dx, dy, sRadius,
-			Radius		= 0,
-			nValues		= 0;
-
-	double	ArithMean, Variance,
-			Sum			= 0.0,
-			SumQ		= 0.0;
-
-	do
-	{
-		sRadius	= (int)(sqrt2 * (double)Radius - 4.0);
-		if( sRadius < 0 ) sRadius	= 0;
-
-		//-------------------------------------------------
-		for(dy=sRadius; dy<=Radius; dy++)
-		{
-			for(dx=sRadius; dx<=Radius; dx++)
-			{
-				if(Check[dy][dx] == Radius)
-				{
-					y	= yPoint - dy;
-
-					if(y>=0)
-					{
-						x	= xPoint - dx;
-						if(x>=0)
-						{
-							Sum			+= pInput->asDouble(x,y);
-							SumQ		+= pInputQ->asDouble(x,y);
-							nValues++;
-						}
-
-						x	= xPoint + dx;
-						if(x<Get_NX())
-						{
-							Sum			+= pInput->asDouble(x,y);
-							SumQ		+= pInputQ->asDouble(x,y);
-							nValues++;
-						}
-					}
-
-					y	= yPoint + dy;
-					if(y<Get_NY())
-					{
-						x	= xPoint - dx;
-						if(x>=0)
-						{
-							Sum			+= pInput->asDouble(x,y);
-							SumQ		+= pInputQ->asDouble(x,y);
-							nValues++;
-						}
-
-						x	= xPoint + dx;
-						if(x<Get_NX())
-						{
-							Sum			+= pInput->asDouble(x,y);
-							SumQ		+= pInputQ->asDouble(x,y);
-							nValues++;
-						}
-					}
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		if(nValues)
-		{
-			ArithMean	= Sum  / nValues;
-			Variance	= SumQ / nValues - ArithMean * ArithMean;
-
-			// Andre, das ist die Formel aus deinem Buch...
-			// Variance	= (SumQ - nValues * ArithMean * ArithMean) / nValues;
-		}
-		else
-			Variance	= 0;
-
-		Radius++;
-	}
-	while(Variance < stopVariance && Radius <= maxRadius);
-
-	return( bWriteGridsize ? Radius : Radius * Get_Cellsize() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.h
deleted file mode 100644
index e6ee4ce..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Variance_Radius.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                GSGrid_Variance_Radius.h               //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__GSGrid_Variance_Radius_H
-#define HEADER_INCLUDED__GSGrid_Variance_Radius_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSGrid_Variance_Radius : public CSG_Module_Grid
-{
-public:
-	CGSGrid_Variance_Radius(void);
-	virtual ~CGSGrid_Variance_Radius(void);
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	bool					bWriteGridsize;
-
-	int						**Check, maxRadius;
-
-	double					stopVariance;
-
-	CSG_Grid				*pGrid, *pResult, *pInput, *pInputQ;
-
-
-	void					Initialize		(void);
-	void					Finalize		(void);
-
-	double					Get_Radius		(int xPoint, int yPoint);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSGrid_Variance_Radius_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.cpp
deleted file mode 100644
index 8201f3f..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.cpp
+++ /dev/null
@@ -1,581 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Zonal_Statistics.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSGrid_Zonal_Statistics.cpp              //
-//                                                       //
-//                Copyright (C) 2005-9 by                //
-//                    Volker Wichmann                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     reklovw at web.de                         //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "GSGrid_Zonal_Statistics.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Construction/Destruction				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSGrid_Zonal_Statistics::CGSGrid_Zonal_Statistics(void)
-{
-	//-----------------------------------------------------
-	// Place information about your module here...
-
-	Set_Name		(_TL("{STATZONAL_NAME} Zonal Grid Statistics"));
-
-	Set_Author		(_TL("Copyrights (c) 2005 by Volker Wichmann"));
-
-	Set_Description	(_TW("{STATZONAL_DESC} "
-		"The module calculates zonal statistics and reports these in a table. "
-		"The module can be used to create a contingency table of unique condition units (UCUs). These "
-		"units are delineated from a zonal grid (e.g. sub catchments) and optional categorical grids (e.g. "
-		"landcover, soil, ...). It is possible to calculate descriptive statistics (n, min, max, mean, standard "
-		"deviation and sum) for each UCU from optional grids with continious data (e.g. slope; aspect must be "
-		"handled specially, please use the \"Aspect\" input parameter for such a grid). The number "
-		"of input grids is only limited by available memory.\n\n"
-		"The module has four different modes of operation:\n"
-		"(1) only a zonal grid is used as input. This results in a simple contingency table with "
-		"the number of grid cells in each zone.\n"
-		"(2) a zonal grid and additional categorical grids are used as "
-		"input. This results in a contingency table with the number of cells in each UCU.\n"
-		"(3) a zonal grid "
-		"and additional grids with continuous data are used as input. This results in a contingency table "
-		"with the number of cells in each zone and some simple statistics for each zone. The statistics are "
-		"calculated for each continuous grid.\n"
-		"(4) a zonal grid, additional categorical grids and additional "
-		"grids with continuous data are used as input. This results in a contingency table with the number "
-		"of cells in each UCU and the corresponding statistics for each continuous grid.\n"
-		"\n"
-		"Depending on the mode of operation, the output table contains information about the categorical "
-		"combination of each UCU, the number of cells in each UCU and the statistics for each UCU. A "
-		"typical output table may look like this:\n"
-		"<table border=\"1\">"
-		"<tr><td>ID Zone</td><td>ID 1stCat</td><td>ID 2ndCat</td><td>Count UCU</td><td>N 1stCont</td><td>MIN 1stCont</td><td>MAX 1stCont</td><td>MEAN 1stCont</td><td>STDDEV 1stCont</td><td>SUM 1stCont</td></tr>"
-		"<tr><td>0      </td><td>2        </td><td>6        </td><td>6        </td><td>6        </td><td>708.5      </td><td>862.0      </td><td>734.5       </td><td>62.5          </td><td>4406.8     </td></tr>"
-		"<tr><td>0      </td><td>3        </td><td>4        </td><td>106      </td><td>106      </td><td>829.1      </td><td>910.1      </td><td>848.8       </td><td>28.5          </td><td>89969.0    </td></tr>"
-		"</table>"
-	));
-
-
-	Parameters.Add_Grid(
-		NULL, "ZONES"		, _TL("Zone Grid"),
-		_TL("Grid defining the zones to analyse. This grid also acts as a mask. Coding: NoData / categorial values."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL, "CATLIST"		, _TL("Categorical Grids"),
-		_TL("Grids used to delineate the UCUs. Coding: NoData / categorical values."),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid_List(
-		NULL, "STATLIST"	, _TL("Grids to analyse"),
-		_TL("Grids with continuous data, statistics are calculated for each grid. Coding: NoData / continuous values."),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "ASPECT"		, _TL("Aspect"),
-		_TL("Aspect grid, in radians."),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL, "OUTTAB"		, _TL("Zonal Statistics"),
-		_TL("Summary table."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL, "SHORTNAMES"	, _TL("Short Field Names"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-}
-
-//---------------------------------------------------------
-CGSGrid_Zonal_Statistics::~CGSGrid_Zonal_Statistics(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSGrid_Zonal_Statistics::On_Execute(void)
-{
-	bool					bShortNames;
-	int						x, y, nCatGrids, nStatGrids, iGrid, zoneID, catID, NDcount, catLevel, NDcountStat;
-	double					statID;
-
-	CSG_Grid				*pZones, *pGrid, *pAspect;
-	CSG_Parameter_Grid_List	*pCatList;
-	CSG_Parameter_Grid_List	*pStatList;
-
-	CList_Conti				*newZone, *startList, *runList, *newSub, *parent, *runSub, *subList;
-	CList_Stat				*runStats;
-	CSG_Table				*pOutTab;
-	CSG_Table_Record		*pRecord;
-	CSG_String				fieldName, tmpName;
-
-
-	pZones		= Parameters("ZONES")		->asGrid();
-	pCatList	= Parameters("CATLIST")		->asGridList();
-	pStatList	= Parameters("STATLIST")	->asGridList();
-	pAspect		= Parameters("ASPECT")		->asGrid();
-	pOutTab		= Parameters("OUTTAB")		->asTable();
-	bShortNames	= Parameters("SHORTNAMES")	->asBool();
-
-	nCatGrids	= pCatList	->Get_Count();
-	nStatGrids	= pStatList	->Get_Count();
-
-	NDcount		= 0;						// NoData Counter (ZoneGrid)
-	NDcountStat	= 0;						// NoData Counter (StatGrids)
-
-	CSG_String	sTabName = Parameters("OUTTAB")->asString();
-	if (pOutTab != NULL)
-	{
-		pOutTab->Destroy();
-		pOutTab->Set_Name(sTabName);
-	}
-
-	newZone		= new CList_Conti();								// create first list entry (dummy)
-	startList	= newZone;
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			runList		= startList;
-			zoneID		= pZones->asInt(x, y);								// get zone ID
-
-			while( runList->next != NULL && runList->cat < zoneID )			// search for last entry in list or insert point
-			{
-				runList = runList->next;
-			}
-
-			if( runList->dummy == true )
-			{
-				runList->cat = zoneID;										// first list entry, write and
-				runList->dummy = false;										// setup
-			}
-			else if( runList->cat == zoneID )
-				runList = runList;											// zoneID found
-			else if( runList->next == NULL && runList->cat < zoneID )		// append zoneID
-			{
-				newZone = new CList_Conti();
-				newZone->previous	= runList;
-				runList->next		= newZone;
-
-				newZone->cat	= zoneID;									// ... and write info
-				newZone->dummy	= false;
-				runList			= newZone;
-			}
-			else															// insert new entry
-			{
-				newZone = new CList_Conti();
-
-				newZone->next = runList;
-				if( runList->previous != NULL )
-				{
-					newZone->previous = runList->previous;
-					runList->previous->next = newZone;
-				}
-				runList->previous = newZone;
-
-				if( runList == startList )
-					startList = newZone;									// if new entry is first element, update startList pointer
-
-				newZone->cat	= zoneID;									// ... and write info
-				newZone->dummy	= false;
-				runList			= newZone;
-			}
-
-
-			for(iGrid=0; iGrid<nCatGrids; iGrid++)							// collect categories
-			{
-				parent  = runList;
-				if( runList->sub == NULL )									// no sub class found
-				{
-					newSub = new CList_Conti();
-					runList->sub = newSub;
-				}
-
-				runList = runList->sub;
-
-				pGrid	= pCatList->asGrid(iGrid);
-				if( !pGrid->is_NoData(x, y) )
-					catID	= pGrid->asInt(x, y);
-				else
-					catID	= (int)pGrid->Get_NoData_Value();
-
-
-				while( runList->next != NULL && runList->cat < catID )		// search for last entry in list or insert point
-				{
-					runList = runList->next;
-				}
-
-				if( runList->dummy == true )
-				{
-					runList->cat	= catID;								// first list entry, write and
-					runList->dummy	= false;								// setup
-					runList->parent	= parent;
-				}
-				else if( runList->cat == catID )
-					runList = runList;										// zoneID found, all infos already written
-				else if( runList->next == NULL && runList->cat < catID)		// append zoneID
-				{
-					newSub = new CList_Conti();
-					newSub->cat			= catID;							// ... and write info
-					newSub->previous	= runList;
-					newSub->parent		= parent;
-					newSub->dummy		= false;
-					runList->next		= newSub;
-					runList				= newSub;
-				}
-				else														// insert new entry
-				{
-					newSub = new CList_Conti();
-					newSub->cat		= catID;								// ... and write info
-					newSub->next	= runList;
-					newSub->parent	= parent;
-					newSub->dummy	= false;
-					if( runList->previous != NULL )
-					{
-						newSub->previous = runList->previous;
-						runList->previous->next = newSub;
-					}
-					else
-						parent->sub	 = newSub;
-
-					runList->previous = newSub;
-					runList	= newSub;
-				}
-			}
-
-
-			for(iGrid=0; iGrid<nStatGrids; iGrid++)							// collect statistics for StatGrids
-			{
-				if( iGrid == 0 )
-				{
-					if( runList->stats == NULL )
-						runList->stats = new CList_Stat();
-
-					runStats = runList->stats;
-				}
-				else
-				{
-					if( runStats->next == NULL )
-						runStats->next = new CList_Stat();
-
-					runStats = runStats->next;
-				}
-				if( !pStatList->asGrid(iGrid)->is_NoData(x, y) )
-				{
-					statID		= pStatList->asGrid(iGrid)->asDouble(x, y);
-
-					if( runStats->dummy == true )
-					{
-						runStats->min = statID;
-						runStats->max = statID;
-						runStats->dummy = false;
-					}
-					if( runStats->min > statID )
-						runStats->min = statID;
-					if( runStats->max < statID )
-						runStats->max = statID;
-
-					runStats->n	  += 1;
-					runStats->sum += statID;
-					runStats->dev += pow(statID, 2);
-				}
-				else
-					NDcountStat += 1;
-			}
-
-			if( pAspect != NULL )
-			{
-				for( int i=0; i<2; i++ )
-				{
-					if( nStatGrids == 0 && i == 0 )
-					{
-						if( runList->stats == NULL )
-							runList->stats = new CList_Stat();
-
-						runStats = runList->stats;
-					}
-					else
-					{
-						if( runStats->next == NULL )
-							runStats->next = new CList_Stat();
-
-						runStats = runStats->next;
-					}
-					if( !pAspect->is_NoData(x, y) )
-					{
-						statID	= pAspect->asDouble(x, y);
-
-						if( i == 0 )
-						{
-							if( runStats->dummy == true )
-							{
-								runStats->min = statID;
-								runStats->max = statID;
-								runStats->dummy = false;
-							}
-							if( runStats->min > statID )
-								runStats->min = statID;
-							if( runStats->max < statID )
-								runStats->max = statID;
-
-							statID	= sin(statID);
-						}
-						else
-							statID	= cos(statID);
-
-						runStats->n	  += 1;
-						runStats->sum += statID;
-					}
-					else
-						NDcountStat += 1;
-				}
-			}
-
-			runList->count += 1;											// sum up unique condition area
-		}
-	}
-
-
-	// Create fields in output table (1st = Zone, 2nd = Catgrid1, 3rd = Catgrid 2, ...)
-	fieldName = CSG_String::Format(SG_T("%s"),pZones->Get_Name()).BeforeFirst(SG_Char('.'));
-	if (bShortNames && fieldName.Length() > 10)
-		fieldName.Remove(10, fieldName.Length()-10);
-	pOutTab->Add_Field(fieldName, SG_DATATYPE_Int);
-
-	for(iGrid=0; iGrid<nCatGrids; iGrid++)
-	{
-		fieldName = CSG_String::Format(SG_T("%s"),pCatList->asGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.'));
-		if (bShortNames && fieldName.Length() > 10)
-			fieldName.Remove(10, fieldName.Length()-10);
-		pOutTab->Add_Field(fieldName, SG_DATATYPE_Int);
-	}
-
-	pOutTab->Add_Field("Count UCU", SG_DATATYPE_Int);
-
-	for( iGrid=0; iGrid<nStatGrids; iGrid++ )
-	{
-		tmpName		= CSG_String::Format(SG_T("%s"),pStatList->asGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.'));
-
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+1 > 10)
-			fieldName.Remove(9, fieldName.Length()-9);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sN")     , fieldName.c_str()), SG_DATATYPE_Int);
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+3 > 10)
-			fieldName.Remove(7, fieldName.Length()-7);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMIN")   , fieldName.c_str()), SG_DATATYPE_Double);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMAX")   , fieldName.c_str()), SG_DATATYPE_Double);
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+4 > 10)
-			fieldName.Remove(6, fieldName.Length()-6);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMEAN")  , fieldName.c_str()), SG_DATATYPE_Double);
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+6 > 10)
-			fieldName.Remove(4, fieldName.Length()-4);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sSTDDEV"), fieldName.c_str()), SG_DATATYPE_Double);
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+3 > 10)
-			fieldName.Remove(7, fieldName.Length()-7);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sSUM")   , fieldName.c_str()), SG_DATATYPE_Double);
-	}
-
-	if( pAspect != NULL )
-	{
-		tmpName		= CSG_String::Format(SG_T("%s"),pAspect->Get_Name()).BeforeFirst(SG_Char('.'));
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+1 > 10)
-			fieldName.Remove(9, fieldName.Length()-9);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sN")     , fieldName.c_str()), SG_DATATYPE_Int);
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+3 > 10)
-			fieldName.Remove(7, fieldName.Length()-7);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMIN")   , fieldName.c_str()), SG_DATATYPE_Double);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMAX")   , fieldName.c_str()), SG_DATATYPE_Double);
-		fieldName	= tmpName;
-		if (bShortNames && fieldName.Length()+4 > 10)
-			fieldName.Remove(6, fieldName.Length()-6);
-		pOutTab->Add_Field(CSG_String::Format(SG_T("%sMEAN")  , fieldName.c_str()), SG_DATATYPE_Double);
-	}
-
-	int	iStatFields = 6;	// number of table fields: n, min, max, mean, stddev, sum
-
-	while( startList != NULL )												// scan zone layer list and write cat values in table
-	{
-		runList = startList;
-		while( runList->sub != NULL )										// fall down to lowest layer
-			runList = runList->sub;
-
-		subList = runList;													// use pointer to scan horizontal
-
-		while( subList != NULL )											// move forward and read all categories of this layer (including the parent layers)
-		{
-			runSub = subList;
-			catLevel = nCatGrids;
-			pRecord	= pOutTab->Add_Record();								// create new record in table
-			pRecord->Set_Value((catLevel+1), runSub->count);				// read/write field count
-
-			for(iGrid=0; iGrid<nStatGrids; iGrid++)							// read/write statistics
-			{
-				if( iGrid == 0 )
-					runStats = runSub->stats;
-				else
-					runStats = runStats->next;
-
-				pRecord->Set_Value(catLevel+2+iGrid*iStatFields, runStats->n);
-				pRecord->Set_Value(catLevel+3+iGrid*iStatFields, runStats->min);
-				pRecord->Set_Value(catLevel+4+iGrid*iStatFields, runStats->max);
-				pRecord->Set_Value(catLevel+5+iGrid*iStatFields, runStats->sum/runStats->n);
-				pRecord->Set_Value(catLevel+6+iGrid*iStatFields, sqrt((runStats->dev - runStats->n*pow(runStats->sum/runStats->n, 2)) / (runStats->n - 1))); // sample
-				//pRecord->Set_Value(catLevel+6+iGrid*iStatFields, sqrt((runStats->dev - pow(runStats->sum/runStats->n, 2)) / runStats->n)); // population
-				pRecord->Set_Value(catLevel+7+iGrid*iStatFields, runStats->sum);
-			}
-
-			if( pAspect != NULL )
-			{
-				iGrid		= nStatGrids * iStatFields;
-
-				int			n;
-				double		min, max, sumYcomp, sumXcomp, val, valYcomp, valXcomp;
-
-				if( nStatGrids == 0 )
-					runStats	= runSub->stats;
-				else
-					runStats	= runStats->next;
-				n			= runStats->n;
-				min			= runStats->min;
-				max			= runStats->max;
-				sumXcomp	= runStats->sum;
-
-				runStats	= runStats->next;
-				sumYcomp	= runStats->sum;
-
-				pRecord		->Set_Value(catLevel+2+iGrid, n);
-				pRecord		->Set_Value(catLevel+3+iGrid, min*M_RAD_TO_DEG);
-				pRecord		->Set_Value(catLevel+4+iGrid, max*M_RAD_TO_DEG);
-				valXcomp	= sumXcomp / n;
-				valYcomp	= sumYcomp / n;
-				val			= valXcomp ? fmod(M_PI_270 + atan2(valYcomp, valXcomp), M_PI_360) : (valYcomp > 0 ? M_PI_270 : (valYcomp < 0 ? M_PI_090 : -1));
-				val			= fmod(M_PI_360 - val, M_PI_360);
-				pRecord		->Set_Value(catLevel+5+iGrid, val*M_RAD_TO_DEG);
-			}
-
-			while( runSub != NULL )											// read/write categories
-			{
-				pRecord->Set_Value(catLevel, runSub->cat);
-				runSub = runSub->parent;
-				catLevel -= 1;
-			}
-			subList = subList->next;
-		}
-
-		while( runList->parent != NULL && runList->parent->next == NULL )	// move up to next 'Caterory with -> next'
-			runList = runList->parent;
-
-		if( runList->parent != NULL )										// if not upper layer (zones)
-		{
-			runList = runList->parent;										// move to parent of next 'Caterory with -> next'
-			if( runList->next != NULL && runList->parent != NULL )
-				runList->parent->sub = runList->next;						// redirect pointer to category which is next 'Categora with -> next' next
-			else if (runList->parent == NULL && runList->next != NULL )
-				startList = runList->next;									// when upper layer (zones) is reached, move to next zone
-			else
-				startList = NULL;											// reading finished
-
-			if( runList->parent == NULL )
-				startList = runList->next;									// ?? when upper layer is reached, move to next zone
-			else
-				runList->sub = runList->sub->next;							// on sub layers redirect pointer to ->next
-		}
-		else
-		{
-			if( nCatGrids == 0 )
-				startList = NULL;
-			else
-				startList = runList->next;									// ?? upper layer is reached, move to next zone
-		}
-
-
-		runList->next = NULL;
-		delete (runList);													// delete disconneted part of the list
-
-	}
-
-
-	if( NDcountStat > 0 )
-	{
-		Message_Add(CSG_String::Format(SG_T("\n\n\n%s: %d %s\n\n\n"), _TL("WARNING"), NDcountStat, _TL("NoData value(s) in statistic grid(s)!")));
-	}
-
-	return (true);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h
deleted file mode 100644
index b896d6c..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/**********************************************************
- * Version $Id: GSGrid_Zonal_Statistics.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSGrid_Zonal_Statistics.h                //
-//                                                       //
-//                Copyright (C) 2005-9 by                //
-//                    Volker Wichmann                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     volkerwichmann at web.de                  //
-//                                                       //
-//    contact:    Volker Wichmann                        //
-//                Research Associate                     //
-//                Chair of Physical Geography		     //
-//				  KU Eichstaett-Ingolstadt				 //
-//                Ostenstr. 18                           //
-//                85072 Eichstaett                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__GSGrid_Zonal_Statistics_H
-#define HEADER_INCLUDED__GSGrid_Zonal_Statistics_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CList_Stat
-{
-public:
-	CList_Stat(void)
-	{
-		n		= 0;
-		min		= max	= 0.0;
-		sum		= dev	= 0.0;
-		next	= NULL;
-		dummy	= true;
-	};
-
-	~CList_Stat(void)
-	{
-		if( next != NULL )
-			delete(next);
-		next	= NULL;
-	};
-
-	int					n;
-	double				min, max, sum, dev;
-	bool				dummy;
-
-	CList_Stat			*next;
-
-};
-
-//---------------------------------------------------------
-class CList_Conti
-{
-public:
-	CList_Conti(void)
-	{
-		cat			= 0;
-		count		= 0;
-		next		= NULL;
-		previous	= NULL;
-		parent		= NULL;
-		sub			= NULL;
-		stats		= NULL;
-		dummy		= true;
-	};
-
-	~CList_Conti(void)
-	{
-		if( stats != NULL )
-			delete(stats);
-
-		if( sub != NULL )
-			delete(sub);
-		sub		= NULL;
-
-		if( next != NULL )
-			delete(next);
-		next	 = NULL;					
-	};
-
-
-	int					cat, count;
-	bool				dummy;
-
-	CList_Conti			*next, *previous, *parent, *sub;
-
-	CList_Stat			*stats;
-
-};
-
-//---------------------------------------------------------
-class CGSGrid_Zonal_Statistics : public CSG_Module_Grid
-{
-public:
-	CGSGrid_Zonal_Statistics(void);
-	virtual ~CGSGrid_Zonal_Statistics(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSGrid_Zonal_Statistics_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp
deleted file mode 100644
index 21d8500..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 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("Spatial and Geostatistics - Grids") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O.Conrad, V.Wichmann (c) 2002-10" ));
-
-	case MLB_INFO_Description:
-		return( _TL("Tools for spatial and geostatistical analyses.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Spatial and Geostatistics|Grids") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "fast_representativeness.h"
-#include "GSGrid_Residuals.h"
-#include "GSGrid_Variance.h"
-#include "GSGrid_Variance_Radius.h"
-#include "GSGrid_Statistics.h"
-#include "GSGrid_Zonal_Statistics.h"
-#include "GSGrid_Directional_Statistics.h"
-#include "grid_autocorrelation.h"
-#include "grid_pca.h"
-#include "multiband_variation.h"
-#include "grid_latlon_statistics.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CFast_Representativeness );
-	case  1:	return( new CGSGrid_Residuals );
-	case  2:	return( new CGSGrid_Variance );
-	case  3:	return( new CGSGrid_Variance_Radius );
-	case  4:	return( new CGSGrid_Statistics );
-	case  5:	return( new CGSGrid_Zonal_Statistics );
-	case  6:	return( new CGSGrid_Directional_Statistics );
-	case  7:	return( new CGrid_Autocorrelation );
-	case  8:	return( new CGrid_PCA );
-	case  9:	return( new CMultiBand_Variation );
-	case 10:	return( new CGrid_PCA_Inverse );
-	case 11:	return( new CGrid_Statistics_Latitudinal );
-	case 12:	return( new CGrid_Statistics_Meridional );
-	case 13:	return( new CGSGrid_Statistics_To_Table );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.h
deleted file mode 100644
index f30dcc2..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__geostatistics_grid_H
-#define HEADER_INCLUDED__geostatistics_grid_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef geostatistics_grid_EXPORTS
-	#define	geostatistics_grid_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	geostatistics_grid_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__geostatistics_grid_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.am b/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.am
deleted file mode 100644
index eb4c972..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# $Id: Makefile.am 1554 2012-12-05 18:29:04Z oconrad $
-#
-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 = libgeostatistics_grid.la
-libgeostatistics_grid_la_SOURCES =\
-fast_representativeness.cpp\
-grid_autocorrelation.cpp\
-grid_latlon_statistics.cpp\
-grid_pca.cpp\
-multiband_variation.cpp\
-GSGrid_Directional_Statistics.cpp\
-GSGrid_Residuals.cpp\
-GSGrid_Statistics.cpp\
-GSGrid_Variance.cpp\
-GSGrid_Variance_Radius.cpp\
-GSGrid_Zonal_Statistics.cpp\
-MLB_Interface.cpp\
-fast_representativeness.h\
-grid_autocorrelation.h\
-grid_latlon_statistics.h\
-grid_pca.h\
-multiband_variation.h\
-GSGrid_Directional_Statistics.h\
-GSGrid_Residuals.h\
-GSGrid_Statistics.h\
-GSGrid_Variance.h\
-GSGrid_Variance_Radius.h\
-GSGrid_Zonal_Statistics.h\
-MLB_Interface.h
-
-libgeostatistics_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.in b/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.in
deleted file mode 100644
index a84336c..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.in
+++ /dev/null
@@ -1,613 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_geostatistics/geostatistics/geostatistics_grid
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libgeostatistics_grid_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libgeostatistics_grid_la_OBJECTS = fast_representativeness.lo \
-	grid_autocorrelation.lo grid_latlon_statistics.lo grid_pca.lo \
-	multiband_variation.lo GSGrid_Directional_Statistics.lo \
-	GSGrid_Residuals.lo GSGrid_Statistics.lo GSGrid_Variance.lo \
-	GSGrid_Variance_Radius.lo GSGrid_Zonal_Statistics.lo \
-	MLB_Interface.lo
-libgeostatistics_grid_la_OBJECTS =  \
-	$(am_libgeostatistics_grid_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libgeostatistics_grid_la_SOURCES)
-DIST_SOURCES = $(libgeostatistics_grid_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1554 2012-12-05 18:29:04Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libgeostatistics_grid.la
-libgeostatistics_grid_la_SOURCES = \
-fast_representativeness.cpp\
-grid_autocorrelation.cpp\
-grid_latlon_statistics.cpp\
-grid_pca.cpp\
-multiband_variation.cpp\
-GSGrid_Directional_Statistics.cpp\
-GSGrid_Residuals.cpp\
-GSGrid_Statistics.cpp\
-GSGrid_Variance.cpp\
-GSGrid_Variance_Radius.cpp\
-GSGrid_Zonal_Statistics.cpp\
-MLB_Interface.cpp\
-fast_representativeness.h\
-grid_autocorrelation.h\
-grid_latlon_statistics.h\
-grid_pca.h\
-multiband_variation.h\
-GSGrid_Directional_Statistics.h\
-GSGrid_Residuals.h\
-GSGrid_Statistics.h\
-GSGrid_Variance.h\
-GSGrid_Variance_Radius.h\
-GSGrid_Zonal_Statistics.h\
-MLB_Interface.h
-
-libgeostatistics_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgeostatistics_grid.la: $(libgeostatistics_grid_la_OBJECTS) $(libgeostatistics_grid_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_grid_la_OBJECTS) $(libgeostatistics_grid_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Directional_Statistics.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Residuals.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Statistics.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Variance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Variance_Radius.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Zonal_Statistics.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fast_representativeness.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_autocorrelation.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_latlon_statistics.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_pca.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/multiband_variation.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.cpp
deleted file mode 100644
index d868220..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.cpp
+++ /dev/null
@@ -1,604 +0,0 @@
-/**********************************************************
- * Version $Id: fast_representativeness.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library                     //
-//                 imagery_segmentation                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              fast_representativeness.cpp              //
-//                                                       //
-//                   Copyright (C) 2009                  //
-//                     Andre Ringeler                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     aringel at saga-gis.org                   //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "fast_representativeness.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define eps 1.0e-6
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFast_Representativeness::CFast_Representativeness(void)
-{
-	Set_Name		(_TL("Fast Representativeness"));
-
-	Set_Author		(SG_T("A.Ringeler (c) 2009"));
-
-	Set_Description	(_TW(
-		"A fast representativeness algorithm. Resulting seeds might be used with 'Fast Region Growing'.\n"
-		"\n"
-		"References:\n"
-		"Boehner, J., Selige, T., Ringeler, A. (2006): Image segmentation using representativeness analysis and region growing. "
-		"In: Boehner, J., McCloy, K.R., Strobl, J. [Eds.]:  SAGA � Analysis and Modelling Applications. "
-		"Goettinger Geographische Abhandlungen, Vol.115, "
-		"<a href=\"http://downloads.sourceforge.net/saga-gis/gga115_03.pdf\">pdf</a>\n"
-	));
-
-	Parameters.Add_Grid(	NULL, "INPUT"		, _TL("Input"),
-		_TL("Input for module calculations."),
-		PARAMETER_INPUT, true, SG_DATATYPE_Float
-	);
-
-	Parameters.Add_Grid(	NULL, "RESULT"		, _TL("Output"),
-		_TL("Output of module calculations."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(	NULL, "RESULT_LOD", _TL("Output Lod"),
-		_TL("Output of module calculations."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(	NULL, "SEEDS"		, _TL("Output Seeds"),
-		_TL("Output of module calculations."),
-		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
-	);
-
-	Parameters.Add_Value(	NULL, "LOD"			, _TL("Level of Generalisation"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 16, 1
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFast_Representativeness::On_Execute(void)
-{
-	double Lod;
-	CSG_Grid *Lod_Grid, *Seeds_Grid;
-
-
-	pOrgInput	= Parameters("INPUT")->asGrid();
-
-	pOutput		= Parameters("RESULT")->asGrid();
-
-	Lod_Grid	= Parameters("RESULT_LOD")->asGrid();
-
-	Seeds_Grid	= Parameters("SEEDS")->asGrid();
-	Seeds_Grid	->Set_NoData_Value(0);
-	Seeds_Grid	->Assign(0.0);
-
-	Process_Set_Text(_TL("Init Fast Representativeness"));
-	
-	FastRep_Initialize();
-
-	Process_Set_Text(_TL("Fast Representativeness"));
-	
-	FastRep_Execute();
-	
-	Process_Set_Text(_TL("Clear Fast Representativeness"));
-	
-	FastRep_Finalize();
-
-	Lod = Parameters("LOD")->asDouble();
-
-
-	CSG_Grid * GenLevel = (CSG_Grid *) new CSG_Grid(	SG_DATATYPE_Float,
-											(int)(pOrgInput->Get_NX()/Lod+1),
-											(int)(pOrgInput->Get_NY()/Lod+1),
-											pOrgInput->Get_Cellsize()*Lod,
-											pOrgInput->Get_XMin(),
-											pOrgInput->Get_YMin()
-										  ) ;
-
-	CSG_Grid * GenLevelRep = (CSG_Grid *) new CSG_Grid(	SG_DATATYPE_Float,
-											(int)(pOrgInput->Get_NX()/Lod+1),
-											(int)(pOrgInput->Get_NY()/Lod+1),
-											pOrgInput->Get_Cellsize()*Lod,
-											pOrgInput->Get_XMin(),
-											pOrgInput->Get_YMin()
-										  ) ;
-
-	GenLevel->Assign(pOrgInput); 
-
-
-	
-
-	pOrgInput = GenLevel;
-	pOutput   = GenLevelRep;
-
-	Process_Set_Text(_TL("Init Generalisation"));
-	
-	FastRep_Initialize();
-
-	Process_Set_Text(_TL("Generalisation"));
-	
-	FastRep_Execute();
-	
-	Process_Set_Text(_TL("Clear Generalisation"));
-	
-	FastRep_Finalize();
-	
-	smooth_rep(pOutput,GenLevel );
-
-	Lod_Grid->Assign(GenLevel);
-
-	Find_Local_Maxima_Minima(Lod_Grid, Seeds_Grid);
-	
-	return( true );
-}
-
-//---------------------------------------------------------
-// Repraesentanz stuff
-//---------------------------------------------------------
-
-//---------------------------------------------------------
-void CFast_Representativeness::FastRep_Local_Sum(CSG_Grid *pInput, CSG_Grid **pOutput)
-{
-	*pOutput	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Float,
-					pInput->Get_NX()/2,
-					pInput->Get_NY()/2,
-					pInput->Get_Cellsize()*2,
-					pInput->Get_Cellsize()*2);
-	
-	for (int y = 0; y < pInput->Get_NY() - 1; y += 2)
-	for (int x = 0; x < pInput->Get_NX() - 1; x += 2)
-	{
-		float val;
-
-		if( pInput->is_NoData(x,y) || pInput->is_NoData(x + 1, y) || pInput->is_NoData(x, y + 1) || pInput->is_NoData(x + 1, y + 1))
-		{
-			(*pOutput)->Set_NoData(x/2, y/2);
-		}
-		else
-		{
-			val		=	pInput->asFloat(x, y)
-					+	pInput->asFloat(x + 1, y)
-					+	pInput->asFloat(x, y + 1)
-					+	pInput->asFloat(x + 1, y + 1);
-		
-			(*pOutput)->Set_Value(x/2, y/2, val);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFast_Representativeness::FastRep_Execute(void)
-{
-	int		x, y;
-	for (y = 0; y < pOutput->Get_NY()&&Set_Progress(y,pOutput->Get_NY());  y++)
-	{
-		for (x = 0; x < pOutput->Get_NX(); x++)
-		{
-			if( ! pOrgInput->is_NoData(x,y ))
-			pOutput->Set_Value(x, y, FastRep_Get_Laenge(x, y));
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFast_Representativeness::FastRep_Initialize(void)
-{
-	
-	double logNx2,logNy2;
-	int pow2y, pow2x;
-	int x,y;
-	long i;
-	long size;
-
-	logNx2	= log((double)pOrgInput->Get_NX())/log(2.0f);
-	
-	pow2x	= (int) logNx2;
-	
-	if (fabs(logNx2 - pow2x) > eps)
-		pow2x++;
-	
-	logNy2	= log((double)pOrgInput->Get_NY())/log(2.0f);
-	
-	pow2y	= (int) logNy2;
-	
-	if (fabs(logNy2 - pow2y) > eps)
-		pow2y++;
-	
-	Pow2Grid	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Double, 1 << pow2x, 1 << pow2y);
-	
-	for ( y = 0; y < Pow2Grid->Get_NY();  y++)
-	{
-		Set_Progress(y, Pow2Grid->Get_NY());
-		
-		for ( x = 0; x < Pow2Grid->Get_NX(); x++)
-		{
-			if (y<pOrgInput->Get_NY() && x < pOrgInput->Get_NX())
-				Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(x, y));
-			else
-			{
-				if(x >= pOrgInput->Get_NX()&&y<pOrgInput->Get_NY())
-				Pow2Grid->Set_Value(x, y,pOrgInput->asFloat(2*pOrgInput->Get_NX()-x-1, y));
-
-				if(y >= pOrgInput->Get_NY()&& x<pOrgInput->Get_NX())
-				Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(x, 2* pOrgInput->Get_NY()-y-1));
-
-				if(y >= pOrgInput->Get_NY()&& x >= pOrgInput->Get_NX())
-				{
-					Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(2*pOrgInput->Get_NX()-x-1, 2* pOrgInput->Get_NY()-y-1));
-				}
-			}
-		}
-	}	
-	
-	Pow2Grid->Standardise();
-
-	pOutput->Assign_NoData();
-		
-	size = (int)(log((double)Pow2Grid->Get_NX())/log(2.0)) - 1;
-		
-	m_deep = size;
-		
-	Sum[0] = Pow2Grid;
-		
-	for ( i = 0; i < size - 1; i++)
-	{
-		FastRep_Local_Sum(Sum[i], &Sum[i + 1]);
-	}
-	
-	QSum[0]	= (CSG_Grid *)new CSG_Grid(Pow2Grid, SG_DATATYPE_Double); // datas
-	QSum[0]->Assign(Pow2Grid);  
-	
-	for ( i = 0; i < Pow2Grid->Get_NCells() ; i++)
-	{
-		if (!QSum[0]->is_NoData(i))
-			QSum[0]->Set_Value(i,QSum[0]->asDouble(i)*Pow2Grid->asDouble(i));
-	}
-	
-	for (i = 0; i < size - 1; i++)
-	{
-		Set_Progress(i,size - 1);
-		FastRep_Local_Sum(QSum[i], &QSum[i + 1]);
-	}
-	
-	V	=(double *) malloc((m_deep + 12) * sizeof(double));
-	Z	=(int    *) malloc((m_deep + 12) * sizeof(int));
-	g	=(double *) malloc((m_deep + 12) * sizeof(double));
-	m	=(double *) malloc((m_deep + 12) * sizeof(double));
-	
-	maxRadius	= 12;
-	
-	rLength	=(int *)malloc((maxRadius + 12) * sizeof(int));
-	
-	for (i = 0; i < m_deep; i++)
-	{
-		g[i]	= 1.0 / (Get_Cellsize() * (1 <<(i)));
-	}
-	
-	FastRep_Init_Radius();
-}
-
-//---------------------------------------------------------
-void CFast_Representativeness::FastRep_Finalize(void)
-{
-	free(V);
-	free(Z);
-	free(rLength);
-	free(g);
-	free(m);
-	free(x_diff);
-	free(y_diff);
-	delete Pow2Grid;
-int		i;
-	for (i = 0; i < m_deep ; i++)
-		delete QSum[i];
-
-	for (i = 1; i < m_deep ; i++)
-		delete Sum[i];
-}
-
-//---------------------------------------------------------
-void CFast_Representativeness::FastRep_Init_Radius(void)
-{
-	int		k, maxZ;
-	
-	long	i, j, iijj, rr, r1r1, z;
-	
-	maxZ		= z	= 0;
-	rLength[0]	= 0;
-	
-	x_diff		= y_diff	= NULL;
-	
-	for (k = 1; k <= maxRadius; k++) 
-	{
-		rr		= k*k;
-		r1r1	=(k - 1) * (k - 1);
-		
-		for (i=-k; i <= k; i++)
-		{
-			for (j=-k; j <= k; j++) 
-			{
-				iijj	= i*i + j*j;
-				
-				if (iijj <= rr && iijj >= r1r1) 
-				{
-					if (maxZ <= z)
-					{
-						maxZ	+= 1000;
-						x_diff	=(int *)realloc(x_diff, maxZ*sizeof(int));
-						y_diff	=(int *)realloc(y_diff, maxZ*sizeof(int));
-					}
-					
-					x_diff[z]	= j;
-					y_diff[z]	= i;
-					
-					z++;
-				}
-			}
-		}
-		rLength[k]	= z;
-	}
-}	
-
-
-//---------------------------------------------------------
-double CFast_Representativeness::FastRep_Get_Laenge(int x, int y)
-{
-	int		Count;
-	
-	double	d;
-	
-	V[0]	= FastRep_Get_Variance(x, y, 1, 0, Count);
-	Z[0]	= Count;
-int ideep;
-	for (ideep = 1; ideep < m_deep; ideep++)
-	{
-		V[ideep]	= V[ideep - 1] + FastRep_Get_Variance(x, y, 4, ideep - 1, Count);
-		Z[ideep]	= Z[ideep - 1] + Count;
-	}
-
-	for (ideep = 0; ideep < m_deep; ideep++)
-	{
-		V[ideep]	=sqrt(V[ideep]/ (double)(Z[ideep]+1));
-	}
-	
-	d	= FastRep_Get_Steigung();
-	
-	if ( d == 0.0 )
-		return ( pOutput->Get_NoData_Value());
-	else
-		return ( V[m_deep - 1] / d / 2.0 );
-
-}
- 
-//---------------------------------------------------------
-double CFast_Representativeness::FastRep_Get_Variance(int x, int y, int iRadius, int deep, int &Count)
-{
-	int		i, ix, iy;
-	
-	double	Variance;
-	
-	double	q	= 0;
-	double	s	= 0;
-	int		lnr	= 0;
-	
-	Variance	= 0;
-	
-	int size	= (1 << deep) * (1 << deep);
-	
-	double	z	= Sum[0]->asDouble(x, y);
-	
-	for (i = rLength[iRadius - 1], Count = 0; i < rLength[iRadius]; i++)
-	{
-		ix	= x/ (1 << deep) + x_diff[i];
-		if (ix < 0)
-			continue; 
-		else if (ix >= Sum[deep]->Get_NX())
-			continue;
-		
-		iy	= y/ (1 << deep) + y_diff[i];
-		if (iy < 0)
-			continue;
-		else if (iy >= Sum[deep]->Get_NY())
-			continue;
-		
-		if( !QSum[deep]->is_NoData(ix, iy))
-		{
-			Count	+=	size;
-			lnr		+=	size;
-	
-			q	+=	QSum[deep]->asDouble(ix, iy);
-			s	+=	Sum[deep]->asDouble(ix, iy);
-		}
-	}
-	
-	Variance = q + z* (-s - s +lnr*z);
-
-	if ( Variance < 0.0 ) Variance = 0.0; 
-
-	return ( Variance );
-}
-
-//---------------------------------------------------------
-double CFast_Representativeness::FastRep_Get_Steigung()
-{
-	int		i;
-	double	summe_mg, summe_g;
-	
-	m[0]		= V[0] / Get_Cellsize();
-
-	for (i = 1; i < m_deep; i++)
-	{
-		m[i]	=( V[i] - V[i-1] ) / ( Get_Cellsize()* (1 << (i) ) );
-	}
-	
-	summe_mg	=	summe_g	= 0;
-	
-	for (i = 0; i < m_deep; i++)
-	{
-		summe_mg	+= m[i] * g[i];
-		summe_g		+= g[i];
-	}
-
-	return ( summe_mg / summe_g );
-}
-
-//---------------------------------------------------------
-void CFast_Representativeness::smooth_rep(CSG_Grid * in, CSG_Grid * out)
-{
-	int x,y;
-	int i,j;
-	int xpos, ypos;
-	double val;
-	int count;
-
-	for (y = 0; y < in->Get_NY(); y++)
-		for (x = 0; x < in->Get_NX(); x++)
-		{
-			val = 0.0;
-			count = 0;
-			for (i=-3; i<= 3; i++)
-			for (j=-3; j<= 3; j++)
-			{
-				xpos = x + j;
-				ypos = y + i;
-
-				if( in->is_InGrid(xpos,ypos))
-				{
-					val += in->asDouble(xpos , ypos);
-					count ++;
-				}
-			}
-		
-			out ->Set_Value(x,y, val/(double) count );
-		}
-
-}
-
-//---------------------------------------------------------
-void CFast_Representativeness::Find_Local_Maxima_Minima(CSG_Grid * in, CSG_Grid * out)
-{
-	int x,y;
-	int i,j;
-	int xpos, ypos;
-	
-	double max, min;
-	
-	bool ismax ,ismin;
-	bool hasmax;
-
-	for (y = 2; y < in->Get_NY()-2; y++)
-		for (x = 2; x < in->Get_NX()-2; x++)
-		{
-			ismax = true;
-			ismin = true;
-			hasmax =false;
-
-			max =min = in->asDouble(x , y);
-			
-			for (i=-2; i<= 2; i++)
-			for (j=-2; j<= 2; j++)
-			{
-				xpos = x + j;
-				ypos = y + i;
-
-				if (max < in->asDouble(xpos , ypos))
-				ismax= false;
-
-				if (min > in->asDouble(xpos , ypos))
-				ismin= false;
-
-				if(out ->asInt(xpos, ypos))
-				hasmax=true;
-			}
-		
-			if (hasmax) 
-			
-			{
-				ismin = ismax =false; 
-			}
-
-			if( ismax||ismin )
-			{
-				out ->Set_Value(x,y, 1);
-			}
-			else
-			{
-				out ->Set_NoData(x,y);
-			}
-		}
-}
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.cpp
deleted file mode 100644
index 0f04fc1..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/**********************************************************
- * Version $Id: grid_autocorrelation.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                grid_autocorrelastion.cpp              //
-//                                                       //
-//                 Copyright (C) 2010 by                 //
-//                     Jan Papmeier                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "grid_autocorrelation.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Autocorrelation::CGrid_Autocorrelation(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Global Moran's I for Grids"));
-
-	Set_Author		(SG_T("Jan Papmeier (c) 2010"));
-
-	Set_Description	(_TW(
-		"Global spatial autocorrelation for grids calculated as Moran's I.\n"
-		"\n"
-		"References:\n"
-		"- Lloyd, C.D. (2010): Spatial data analysis - An introduction for GIS users. Oxford. 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL, "GRID"		, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL, "RESULT"		, _TL("Result"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL, "CONTIGUITY"	, _TL("Case of contiguity"),
-		_TL("Choose case: Rook's case contiguity compares only cell wich share an edge. Queen's case contiguity compares also cells which share just corners."),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Rook"),
-			_TL("Queen")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL, "DIALOG"		, _TL("Show Result in Dialog"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Autocorrelation::On_Execute(void)
-{
-	int			nContiguity, nNeighbours;
-	double		Sum;
-	CSG_Grid	*pGrid;
-	CSG_Table	*pResult;
-	
-	//-----------------------------------------------------
-	pGrid	= Parameters("GRID")	->asGrid();
-	pResult	= Parameters("RESULT")	->asTable();
-
-	switch( Parameters("CONTIGUITY")->asInt() )
-	{
-	case 0:				nContiguity	= 2;	break;	// Rook's case
-	case 1: default:	nContiguity	= 1;	break;	// Queen's case
-	}
-
-	//-----------------------------------------------------
-	nNeighbours	= 0;
-	Sum			= 0.0;
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !pGrid->is_NoData(x, y) )
-			{
-				double	dz	= pGrid->asDouble(x, y) - pGrid->Get_ArithMean();
-
-				for(int i=0; i<8; i+=nContiguity)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( pGrid->is_InGrid(ix, iy) )
-					{
-						nNeighbours	++;
-						Sum			+= dz * (pGrid->asDouble(ix, iy) - pGrid->Get_ArithMean());
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( nNeighbours <= 1 )
-	{
-		Message_Add(_TL("not enough neighbours"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	double	Moran_I	= (pGrid->Get_NCells() * Sum) / (pGrid->Get_Variance() * pGrid->Get_NCells() * nNeighbours);
-
-	if( pResult->Get_Field_Count() != 8 || SG_STR_CMP(_TL("Moran's I"), pResult->Get_Name()) )
-	{
-		pResult->Destroy();
-		pResult->Set_Name(_TL("Moran's I"));
-
-		pResult->Add_Field(_TL("GRID")		, SG_DATATYPE_String);
-		pResult->Add_Field(_TL("CONTIGUITY"), SG_DATATYPE_String);
-		pResult->Add_Field(_TL("MORAN_I")	, SG_DATATYPE_Double);
-		pResult->Add_Field(_TL("NEIGHBORS")	, SG_DATATYPE_Int);
-		pResult->Add_Field(_TL("NCELLS")	, SG_DATATYPE_Int);
-		pResult->Add_Field(_TL("MEAN")		, SG_DATATYPE_Double);
-		pResult->Add_Field(_TL("VARIATION")	, SG_DATATYPE_Double);
-		pResult->Add_Field(_TL("SUM")		, SG_DATATYPE_Double);
-	}
-
-	CSG_Table_Record	*pRecord	= pResult->Add_Record();
-
-	pRecord->Set_Value(0, pGrid->Get_Name());
-	pRecord->Set_Value(1, nContiguity == 2 ? _TL("Rook's case") : _TL("Queen's case"));
-	pRecord->Set_Value(2, Moran_I);
-	pRecord->Set_Value(3, nNeighbours);
-	pRecord->Set_Value(4, pGrid->Get_NCells());
-	pRecord->Set_Value(5, pGrid->Get_ArithMean());
-	pRecord->Set_Value(6, pGrid->Get_Variance() * pGrid->Get_NCells());
-	pRecord->Set_Value(7, Sum);
-
-	Message_Add(CSG_String::Format(SG_T("\n%s (%s): %f\n"), _TL("Moran's I"), pGrid->Get_Name(), Moran_I), false);
-
-	if( Parameters("DIALOG")->asBool() )
-	{
-		Message_Dlg(CSG_String::Format(SG_T("%s: %f"), _TL("Moran's I"), Moran_I), pGrid->Get_Name());
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.h
deleted file mode 100644
index 8797863..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/**********************************************************
- * Version $Id: grid_autocorrelation.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                grid_autocorrelation.h                 //
-//                                                       //
-//                 Copyright (C) 2010 by                 //
-//                     Jan Papmeier                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__grid_autocorrelation_H
-#define HEADER_INCLUDED__grid_autocorrelation_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrid_Autocorrelation : public CSG_Module_Grid
-{
-public:
-	CGrid_Autocorrelation(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__grid_autocorrelation_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.cpp
deleted file mode 100644
index 6b797d5..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/**********************************************************
- * Version $Id: grid_latlon_statistics.cpp 1252 2011-12-15 15:43:13Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               grid_latlon_statistics.cpp              //
-//                                                       //
-//                 Copyright (C) 2012 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 "grid_latlon_statistics.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Statistics_Latitudinal::CGrid_Statistics_Latitudinal(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Longitudinal Grid Statistics"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "GRID"	, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL	, "STATS"	, _TL("Latitudinal Statistics"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Statistics_Latitudinal::On_Execute(void)
-{
-	CSG_Grid	*pGrid	= Parameters("GRID" )->asGrid();
-	CSG_Table	*pTable	= Parameters("STATS")->asTable();
-
-	pTable->Destroy();
-	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Latitudinal Statistics"), pGrid->Get_Name()));
-	pTable->Add_Field(SG_T("Y"     ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("MEAN"  ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("MIN"   ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("MAX"   ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("STDDEV"), SG_DATATYPE_Double);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		CSG_Simple_Statistics	Statistics;
-
-		for(int x=0; x<Get_NX(); x++)
-		{
-			Statistics	+= pGrid->asDouble(x, y);
-		}
-
-		CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-		pRecord->Set_Value(0, pGrid->Get_System().Get_yGrid_to_World(y));
-		pRecord->Set_Value(1, Statistics.Get_Mean   ());
-		pRecord->Set_Value(2, Statistics.Get_Minimum());
-		pRecord->Set_Value(3, Statistics.Get_Maximum());
-		pRecord->Set_Value(4, Statistics.Get_StdDev ());
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Statistics_Meridional::CGrid_Statistics_Meridional(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Meridional Grid Statistics"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "GRID"	, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL	, "STATS"	, _TL("Meridional Statistics"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Statistics_Meridional::On_Execute(void)
-{
-	CSG_Grid	*pGrid	= Parameters("GRID" )->asGrid();
-	CSG_Table	*pTable	= Parameters("STATS")->asTable();
-
-	pTable->Destroy();
-	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Meridional Statistics"), pGrid->Get_Name()));
-	pTable->Add_Field(SG_T("X"     ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("MEAN"  ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("MIN"   ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("MAX"   ), SG_DATATYPE_Double);
-	pTable->Add_Field(SG_T("STDDEV"), SG_DATATYPE_Double);
-
-	for(int x=0; x<Get_NX() && Set_Progress(x, Get_NX()); x++)
-	{
-		CSG_Simple_Statistics	Statistics;
-
-		for(int y=0; y<Get_NY(); y++)
-		{
-			Statistics	+= pGrid->asDouble(x, y);
-		}
-
-		CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-		pRecord->Set_Value(0, pGrid->Get_System().Get_xGrid_to_World(x));
-		pRecord->Set_Value(1, Statistics.Get_Mean   ());
-		pRecord->Set_Value(2, Statistics.Get_Minimum());
-		pRecord->Set_Value(3, Statistics.Get_Maximum());
-		pRecord->Set_Value(4, Statistics.Get_StdDev ());
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.h
deleted file mode 100644
index 9a74456..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**********************************************************
- * Version $Id: grid_latlon_statistics.h 1252 2011-12-15 15:43:13Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                grid_latlon_statistics.h               //
-//                                                       //
-//                 Copyright (C) 2010 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__grid_latlon_statistics_H
-#define HEADER_INCLUDED__grid_latlon_statistics_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrid_Statistics_Latitudinal : public CSG_Module_Grid
-{
-public:
-	CGrid_Statistics_Latitudinal(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-};
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrid_Statistics_Meridional : public CSG_Module_Grid
-{
-public:
-	CGrid_Statistics_Meridional(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__grid_latlon_statistics_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp
deleted file mode 100644
index 8524bdd..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp
+++ /dev/null
@@ -1,605 +0,0 @@
-/**********************************************************
- * Version $Id: grid_pca.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     grid_pca.cpp                      //
-//                                                       //
-//                 Copyright (C) 2010 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 "grid_pca.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_PCA::CGrid_PCA(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Principle Components Analysis"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Principle Components Analysis (PCA) for grids. "
-		"Implementation based on F. Murtagh's "
-		"<a target=\"_blank\" href=\"http://lib.stat.cmu.edu/multi/pca.c\">code</a> "
-		"as provided by the "
-		"<a target=\"_blank\" href=\"http://lib.stat.cmu.edu\">StatLib</a> web site.\n"
-		"\n"
-		"References:\n"
-		"Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "PCA"			, _TL("Principle Components"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Table(
-		NULL	, "EIGEN"		, _TL("Eigen Vectors"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("correlation matrix"),
-			_TL("variance-covariance matrix"),
-			_TL("sums-of-squares-and-cross-products matrix")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NFIRST"		, _TL("Number of Components"),
-		_TL("maximum number of calculated first components; set to zero to get all"),
-		PARAMETER_TYPE_Int, 3, 0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_PCA::On_Execute(void)
-{
-	CSG_Vector	Eigen_Values;
-	CSG_Matrix	Eigen_Vectors, Matrix;
-
-	//-----------------------------------------------------
-	m_pGrids	= Parameters("GRIDS" )->asGridList();
-	m_Method	= Parameters("METHOD")->asInt();
-
-	m_nFeatures	= m_pGrids->Get_Count();
-
-	//-----------------------------------------------------
-	if( !Get_Matrix(Matrix) )
-	{
-		Error_Set(_TL("matrix initialisation failed"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	if( !SG_Matrix_Eigen_Reduction(Matrix, Eigen_Vectors, Eigen_Values) )
-	{
-		Error_Set(_TL("Eigen reduction failed"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Print_Eigen_Values (Eigen_Values );
-	Print_Eigen_Vectors(Eigen_Vectors);
-
-	Get_Components(Eigen_Vectors);
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline bool CGrid_PCA::is_NoData(int iCell)
-{
-	for(int iFeature=0; iFeature<m_nFeatures; iFeature++)
-	{
-		if( m_pGrids->asGrid(iFeature)->is_NoData(iCell) )
-		{
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline double CGrid_PCA::Get_Value(int iCell, int iFeature)
-{
-	CSG_Grid	*pGrid	= m_pGrids->asGrid(iFeature);
-
-	switch( m_Method )
-	{
-	default:
-	case 0:	// Correlation matrix: Center and reduce the column vectors.
-		return( (pGrid->asDouble(iCell) - pGrid->Get_ArithMean()) / (sqrt(Get_NCells() * pGrid->Get_Variance())) );
-
-	case 1:	// Variance-covariance matrix: Center the column vectors.
-		return( (pGrid->asDouble(iCell) - pGrid->Get_ArithMean()) );
-
-	case 2:	// Sums-of-squares-and-cross-products matrix
-		return( (pGrid->asDouble(iCell)) );
-	}
-}
-
-//---------------------------------------------------------
-bool CGrid_PCA::Get_Matrix(CSG_Matrix &Matrix)
-{
-	int		j1, j2;
-	long	iCell;
-
-	Matrix.Create(m_nFeatures, m_nFeatures);
-	Matrix.Set_Zero();
-
-	switch( m_Method )
-	{
-	//-----------------------------------------------------
-	default:
-	case 0:	// Correlation matrix: Center and reduce the column vectors.
-		for(j1=0; j1<m_nFeatures; j1++)
-		{
-			Matrix[j1][j1] = 1.0;
-		}
-
-		for(iCell=0; iCell<Get_NCells() && Set_Progress_NCells(iCell); iCell++)
-		{
-			if( !is_NoData(iCell) )
-			{
-				for(j1=0; j1<m_nFeatures-1; j1++)
-				{
-					for(j2=j1+1; j2<m_nFeatures; j2++)
-					{
-						Matrix[j1][j2]	+= Get_Value(iCell, j1) * Get_Value(iCell, j2);
-					}
-				}
-			}
-		}
-		break;
-
-	//-----------------------------------------------------
-	case 1:	// Variance-covariance matrix: Center the column vectors.
-	case 2:	// Sums-of-squares-and-cross-products matrix
-		for(iCell=0; iCell<Get_NCells() && Set_Progress_NCells(iCell); iCell++)
-		{
-			if( !is_NoData(iCell) )
-			{
-				for(j1=0; j1<m_nFeatures; j1++)
-				{
-					for(j2=j1; j2<m_nFeatures; j2++)
-					{
-						Matrix[j1][j2]	+= Get_Value(iCell, j1) * Get_Value(iCell, j2);
-					}
-				}
-			}
-		}
-		break;
-	}
-
-	//-----------------------------------------------------
-	for(j1=0; j1<m_nFeatures; j1++)
-	{
-		for(j2=j1; j2<m_nFeatures; j2++)
-		{
-			Matrix[j2][j1] = Matrix[j1][j2];
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CGrid_PCA::Print_Eigen_Values(CSG_Vector &Eigen_Values)
-{
-	int		i;
-	double	Sum, Cum;
-
-	for(i=0, Sum=0.0, Cum=0.0; i<m_nFeatures; i++)
-	{
-		Sum	+= Eigen_Values[i];
-	}
-
-	Sum	= Sum > 0.0 ? 100.0 / Sum : 0.0;
-
-	Message_Add(CSG_String::Format(SG_T("\n%s, %s, %s\n"), _TL("explained variance"), _TL("explained cumulative variance"), _TL("Eigenvalue")), false);
-
-	for(i=m_nFeatures-1; i>=0; i--)
-	{
-		Cum	+= Eigen_Values[i];
-
-		Message_Add(CSG_String::Format(SG_T("%d.\t%.2f\t%.2f\t%f\n"),
-				m_nFeatures - i,
-				Sum * Eigen_Values[i],
-				Sum * Cum,
-				Eigen_Values[i]
-			), false
-		);
-	}
-}
-
-//---------------------------------------------------------
-void CGrid_PCA::Print_Eigen_Vectors(CSG_Matrix &Eigen_Vectors)
-{
-	Message_Add(CSG_String::Format(SG_T("\n%s:\n"), _TL("Eigenvectors")), false);
-
-	for(int i=0; i<m_nFeatures; i++)
-	{
-		for(int j=m_nFeatures-1; j>=0; j--)
-		{
-			Message_Add(CSG_String::Format(SG_T("%.4f\t"), Eigen_Vectors[i][j]), false);
-		}
-
-		Message_Add(m_pGrids->asGrid(i)->Get_Name(), false);
-		Message_Add(SG_T("\n"), false);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_PCA::Get_Components(CSG_Matrix &Eigen_Vectors)
-{
-	int		i;
-
-	///////////////////////////////////////////////////////
-	//-----------------------------------------------------
-	CSG_Matrix	E(m_nFeatures, m_nFeatures);
-
-	for(i=0; i<m_nFeatures; i++)
-	{
-		for(int j=0, k=m_nFeatures-1; j<m_nFeatures; j++, k--)
-		{
-			E[j][i]	= Eigen_Vectors[i][k];
-		}
-	}
-
-	///////////////////////////////////////////////////////
-	//-----------------------------------------------------
-	CSG_Table	*pEigen	= Parameters("EIGEN")->asTable();
-
-	if( pEigen )
-	{
-		pEigen->Destroy();
-		pEigen->Set_Name(_TL("PCA Eigen Vectors"));
-
-		for(i=0; i<m_nFeatures; i++)
-		{
-			pEigen->Add_Field(m_pGrids->asGrid(i)->Get_Name(), SG_DATATYPE_Double);
-		}
-
-		for(i=0; i<m_nFeatures; i++)
-		{
-			CSG_Table_Record	*pRecord	= pEigen->Add_Record();
-
-			for(int j=0; j<m_nFeatures; j++)
-			{
-				pRecord->Set_Value(j, E[j][i]);
-			}
-		}
-	}
-
-	///////////////////////////////////////////////////////
-	//-----------------------------------------------------
-	int	nComponents	= Parameters("NFIRST")->asInt();
-
-	if( nComponents <= 0 || nComponents > m_nFeatures )
-	{
-		nComponents	= m_nFeatures;
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pPCA	= Parameters("PCA")->asGridList();
-
-	pPCA->Del_Items();
-
-	for(i=0; i<nComponents; i++)
-	{
-		pPCA->Add_Item(SG_Create_Grid(*Get_System()));
-		pPCA->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s %d"), _TL("Component"), i + 1));
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for private(i)
-		for(int x=0; x<Get_NX(); x++)
-		{
-			bool	bNoData	= false;
-
-			CSG_Vector	X(m_nFeatures);
-
-			for(i=0; i<m_nFeatures && !bNoData; i++)
-			{
-				if( m_pGrids->asGrid(i)->is_NoData(x, y) )
-				{
-					bNoData	= true;
-				}
-				else
-				{
-					X[i]	= m_pGrids->asGrid(i)->asDouble(x, y);
-				}
-			}
-
-			if( bNoData )
-			{
-				for(i=0; i<nComponents; i++)
-				{
-					pPCA->asGrid(i)->Set_NoData(x, y);
-				}
-			}
-			else
-			{
-				CSG_Vector	Y	= E * X;
-
-				for(i=0; i<nComponents; i++)
-				{
-					pPCA->asGrid(i)->Set_Value(x, y, Y[i]);
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_PCA_Inverse::CGrid_PCA_Inverse(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Inverse Principle Components Rotation"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Inverse principle components rotation for grids. "
-		"\n"
-		"References:\n"
-		"Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "PCA"			, _TL("Principle Components"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL	, "EIGEN"		, _TL("Eigen Vectors"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_PCA_Inverse::On_Execute(void)
-{
-	int			i, nFeatures;
-	CSG_Table	*pEigen;
-
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pPCA, *pGrids;
-
-	pPCA	= Parameters("PCA"  )->asGridList();
-	pGrids	= Parameters("GRIDS")->asGridList();
-	pEigen	= Parameters("EIGEN")->asTable();
-
-	//-----------------------------------------------------
-	nFeatures	= pEigen->Get_Count();
-
-	if( nFeatures != pEigen->Get_Field_Count() )
-	{
-		Error_Set(_TL("warning: number of Eigen vectors and components differs."));
-
-		if( nFeatures > pEigen->Get_Field_Count() )
-		{
-			nFeatures	= pEigen->Get_Field_Count();
-		}
-	}
-
-	if( nFeatures != pPCA->Get_Count() )
-	{
-		Error_Set(_TL("warning: number of component grids and components differs."));
-
-		if( nFeatures > pPCA->Get_Count() )
-		{
-			nFeatures	= pPCA->Get_Count();
-		}
-	}
-
-	if( nFeatures < 2 )
-	{
-		Error_Set(_TL("nothing to do. transformation needs at least two components."));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Matrix	E(nFeatures, nFeatures);
-
-	for(i=0; i<nFeatures; i++)
-	{
-		CSG_Table_Record	*pRecord	= pEigen->Get_Record(i);
-
-		for(int j=0; j<nFeatures; j++)
-		{
-			E[j][i]	= pRecord->asDouble(j);
-		}
-	}
-
-	if( !E.Set_Inverse() )
-	{
-		Error_Set(_TL("matrix inversion failed"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pGrids->Del_Items();
-
-	for(i=0; i<nFeatures; i++)
-	{
-		pGrids->Add_Item(SG_Create_Grid(*Get_System()));
-		pGrids->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s %d"), _TL("Feature"), i + 1));
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for private(i)
-		for(int x=0; x<Get_NX(); x++)
-		{
-			bool	bNoData	= false;
-
-			CSG_Vector	Y(nFeatures);
-
-			for(i=0; i<nFeatures && !bNoData; i++)
-			{
-				if( pPCA->asGrid(i)->is_NoData(x, y) )
-				{
-					bNoData	= true;
-				}
-				else
-				{
-					Y[i]	= pPCA->asGrid(i)->asDouble(x, y);
-				}
-			}
-
-			if( bNoData )
-			{
-				for(i=0; i<nFeatures; i++)
-				{
-					pGrids->asGrid(i)->Set_NoData(x, y);
-				}
-			}
-			else
-			{
-				CSG_Vector	X	= E * Y;
-
-				for(i=0; i<nFeatures; i++)
-				{
-					pGrids->asGrid(i)->Set_Value(x, y, X[i]);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h
deleted file mode 100644
index 356b7bc..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/**********************************************************
- * Version $Id: grid_pca.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                      grid_pca.h                       //
-//                                                       //
-//                 Copyright (C) 2010 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__grid_pca_H
-#define HEADER_INCLUDED__grid_pca_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrid_PCA : public CSG_Module_Grid
-{
-public:
-	CGrid_PCA(void);
-
-	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Principle Components") );	}
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	int						m_Method, m_nFeatures;
-
-	CSG_Parameter_Grid_List	*m_pGrids;
-
-
-	bool					is_NoData			(int iCell);
-	double					Get_Value			(int iCell, int iFeature);
-	
-	bool					Get_Matrix			(CSG_Matrix &Matrix);
-
-	void					Print_Eigen_Values	(CSG_Vector &Eigen_Values);
-	void					Print_Eigen_Vectors	(CSG_Matrix &Eigen_Vectors);
-
-	bool					Get_Components		(CSG_Matrix &Eigen_Vectors);
-
-};
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrid_PCA_Inverse : public CSG_Module_Grid
-{
-public:
-	CGrid_PCA_Inverse(void);
-
-	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Principle Components") );	}
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__grid_pca_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.cpp b/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.cpp
deleted file mode 100644
index 6772d94..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/**********************************************************
- * Version $Id: multiband_variation.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                multiband_variation.cpp                //
-//                                                       //
-//                 Copyright (C) 2011 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 "multiband_variation.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CMultiBand_Variation::CMultiBand_Variation(void)
-{
-	Set_Name		(_TL("Multi-Band Variation"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Calculates for each cell the spectral variation based on feature space distances "
-		"to the centroid for all cells in specified neighbourhood. "
-		"The average distance has been used for Spectral Variation Hypothesis (SVH).\n"
-		"References:\n"
-		"- Palmer, M.W., Earls, P., Hoagland, B.W., White, P.S., Wohlgemuth, T. (2002): "
-		"Quantitative tools for perfecting species lists. Environmetrics 13, 121�137.\n"
-		"- "
-	));
-
-
-	Parameters.Add_Grid_List(
-		NULL	, "BANDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "MEAN"		, _TL("Mean Distance"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "STDDEV"		, _TL("Standard Deviation"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "DIFF"		, _TL("Distance"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Radius [Cells]"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1.0, 1.0, true
-	);
-
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CMultiBand_Variation::On_Execute(void)
-{
-	int		x, y, Radius;
-
-	//-----------------------------------------------------
-	m_pBands	= Parameters("BANDS")	->asGridList();
-	m_pMean		= Parameters("MEAN")	->asGrid();
-	m_pStdDev	= Parameters("STDDEV")	->asGrid();
-	m_pDiff		= Parameters("DIFF")	->asGrid();
-
-	//-----------------------------------------------------
-	if( m_pBands->Get_Count() < 1 )
-	{
-		Error_Set(_TL("no input"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Radius		= Parameters("RADIUS")	->asInt();
-
-	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	if( !m_Cells.Set_Radius(Radius) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	m_Mask.Create(*Get_System(), SG_DATATYPE_Byte);
-	m_Mask.Set_NoData_Value(0);
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			bool	bNoData	= false;
-
-			for(int iBand=0; iBand<m_pBands->Get_Count() && !bNoData; iBand++)
-			{
-				if( m_pBands->asGrid(iBand)->is_NoData(x, y) )
-				{
-					bNoData	= true;
-				}
-			}
-
-			m_Mask.Set_Value(x, y, bNoData ? 0 : 1);
-		}
-	}
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			Get_Variation(x, y);
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Mask .Destroy();
-	m_Cells.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CMultiBand_Variation::Get_Variation(int x, int y)
-{
-	if( !m_Mask.is_NoData(x, y) )
-	{
-		int			iBand, iCell, ix, iy;
-		double		iDistance, iWeight, Weights, Distance;
-		CSG_Vector	Centroid(m_pBands->Get_Count());
-
-		//-------------------------------------------------
-		for(iCell=0, Weights=0.0; iCell<m_Cells.Get_Count(); iCell++)
-		{
-			if( m_Cells.Get_Values(iCell, ix = x, iy = y, iDistance, iWeight, true) && m_Mask.is_InGrid(ix, iy) )
-			{
-				for(iBand=0; iBand<m_pBands->Get_Count(); iBand++)
-				{
-					Centroid[iBand]	+= iWeight * m_pBands->asGrid(iBand)->asDouble(ix, iy);
-				}
-
-				Weights			+= iWeight;
-			}
-		}
-
-		//-------------------------------------------------
-		if( Weights > 0.0 )
-		{
-			CSG_Simple_Statistics	s;
-
-			Centroid	*= 1.0 / Weights;
-
-			for(iCell=0; iCell<m_Cells.Get_Count(); iCell++)
-			{
-				if( m_Cells.Get_Values(iCell, ix = x, iy = y, iDistance, iWeight, true) && m_Mask.is_InGrid(ix, iy) )
-				{
-					for(iBand=0, Distance=0.0; iBand<m_pBands->Get_Count(); iBand++)
-					{
-						Distance	+= SG_Get_Square(Centroid[iBand] - m_pBands->asGrid(iBand)->asDouble(ix, iy));
-					}
-
-					s.Add_Value(sqrt(Distance), iWeight);
-
-					if( ix == x && iy == y )
-					{
-						if( m_pDiff )	m_pDiff->Set_Value(x, y, sqrt(Distance));
-					}
-				}
-			}
-
-			if( m_pMean   )	m_pMean  ->Set_Value(x, y, s.Get_Mean());
-			if( m_pStdDev )	m_pStdDev->Set_Value(x, y, s.Get_StdDev());
-
-			return( true );
-		}
-	}
-
-	//-----------------------------------------------------
-	if( m_pMean     )	m_pMean		->Set_NoData(x, y);
-	if( m_pStdDev   )	m_pStdDev	->Set_NoData(x, y);
-	if( m_pDiff     )	m_pDiff		->Set_NoData(x, y);
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.h b/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.h
deleted file mode 100644
index c19c1f6..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/**********************************************************
- * Version $Id: multiband_variation.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 multiband_variation.h                 //
-//                                                       //
-//                 Copyright (C) 2011 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__multiband_variation_H
-#define HEADER_INCLUDED__multiband_variation_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CMultiBand_Variation : public CSG_Module_Grid
-{
-public:
-	CMultiBand_Variation(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	CSG_Grid_Cell_Addressor	m_Cells;
-
-	CSG_Parameter_Grid_List	*m_pBands;
-
-	CSG_Grid				m_Mask, *m_pMean, *m_pStdDev, *m_pDiff;
-
-
-	bool					Get_Variation		(int x, int y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__multiband_variation_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.h b/src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.h
deleted file mode 100644
index affc28c..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Kriging                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__geostatistics_kriging_H
-#define HEADER_INCLUDED__geostatistics_kriging_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef geostatistics_kriging_EXPORTS
-	#define	geostatistics_kriging_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	geostatistics_kriging_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__geostatistics_kriging_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.am b/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.am
deleted file mode 100644
index 8363944..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
-DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
-else
-DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
-DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
-endif
-DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS           = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libgeostatistics_kriging.la
-libgeostatistics_kriging_la_SOURCES =\
-_kriging_base.cpp\
-_kriging_ordinary.cpp\
-_kriging_ordinary_global.cpp\
-_kriging_universal.cpp\
-_kriging_universal_global.cpp\
-kriging_base.cpp\
-kriging_ordinary.cpp\
-kriging_ordinary_global.cpp\
-kriging_universal.cpp\
-kriging_universal_global.cpp\
-MLB_Interface.cpp\
-semivariogram.cpp\
-variogram_dialog.cpp\
-_kriging_base.h\
-_kriging_ordinary.h\
-_kriging_ordinary_global.h\
-_kriging_universal.h\
-_kriging_universal_global.h\
-kriging_base.h\
-kriging_ordinary.h\
-kriging_ordinary_global.h\
-kriging_universal.h\
-kriging_universal_global.h\
-MLB_Interface.h\
-semivariogram.h\
-variogram_dialog.h
-
-libgeostatistics_kriging_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.in b/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.in
deleted file mode 100644
index c37c960..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.in
+++ /dev/null
@@ -1,617 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir =  \
-	src/modules_geostatistics/geostatistics/geostatistics_kriging
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libgeostatistics_kriging_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \
-	$(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la
-am_libgeostatistics_kriging_la_OBJECTS = _kriging_base.lo \
-	_kriging_ordinary.lo _kriging_ordinary_global.lo \
-	_kriging_universal.lo _kriging_universal_global.lo \
-	kriging_base.lo kriging_ordinary.lo kriging_ordinary_global.lo \
-	kriging_universal.lo kriging_universal_global.lo \
-	MLB_Interface.lo semivariogram.lo variogram_dialog.lo
-libgeostatistics_kriging_la_OBJECTS =  \
-	$(am_libgeostatistics_kriging_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libgeostatistics_kriging_la_SOURCES)
-DIST_SOURCES = $(libgeostatistics_kriging_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@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`
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libgeostatistics_kriging.la
-libgeostatistics_kriging_la_SOURCES = \
-_kriging_base.cpp\
-_kriging_ordinary.cpp\
-_kriging_ordinary_global.cpp\
-_kriging_universal.cpp\
-_kriging_universal_global.cpp\
-kriging_base.cpp\
-kriging_ordinary.cpp\
-kriging_ordinary_global.cpp\
-kriging_universal.cpp\
-kriging_universal_global.cpp\
-MLB_Interface.cpp\
-semivariogram.cpp\
-variogram_dialog.cpp\
-_kriging_base.h\
-_kriging_ordinary.h\
-_kriging_ordinary_global.h\
-_kriging_universal.h\
-_kriging_universal_global.h\
-kriging_base.h\
-kriging_ordinary.h\
-kriging_ordinary_global.h\
-kriging_universal.h\
-kriging_universal_global.h\
-MLB_Interface.h\
-semivariogram.h\
-variogram_dialog.h
-
-libgeostatistics_kriging_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgeostatistics_kriging.la: $(libgeostatistics_kriging_la_OBJECTS) $(libgeostatistics_kriging_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_kriging_la_OBJECTS) $(libgeostatistics_kriging_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_base.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_ordinary.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_ordinary_global.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_universal.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/_kriging_universal_global.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_base.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_ordinary.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_ordinary_global.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_universal.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kriging_universal_global.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/semivariogram.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/variogram_dialog.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h b/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h
deleted file mode 100644
index 8750acc..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/**********************************************************
- * Version $Id: _kriging_base.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Kriging                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    _Kriging_Base.h                    //
-//                                                       //
-//                 Copyright (C) 2006 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED___Kriging_Base_H
-#define HEADER_INCLUDED___Kriging_Base_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class geostatistics_kriging_EXPORT C_Kriging_Base : public CSG_Module
-{
-public:
-	C_Kriging_Base(void);
-	virtual ~C_Kriging_Base(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Without Variogram Fit") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-	bool					m_bBlock;
-
-	int						m_zField;
-
-	double					m_Block;
-
-	CSG_Points_Z			m_Points;
-
-	CSG_Vector				m_G;
-
-	CSG_Matrix				m_W;
-
-	CSG_PRQuadTree			m_Search;
-
-	CSG_Grid				*m_pGrid, *m_pVariance;
-
-	CSG_Shapes				*m_pShapes;
-
-
-	virtual bool			On_Initialise	(void)	{	return( true );	}
-
-	virtual bool			Get_Value		(double x, double y, double &z, double &Variance)	= 0;
-
-	double					Get_Weight		(double Distance);
-	double					Get_Weight		(double dx, double dy);
-
-
-private:
-
-	bool					m_bLog;
-
-	int						m_Model;
-
-	double					m_Nugget, m_Sill, m_Range, m_BLIN, m_BEXP, m_APOW, m_BPOW;
-
-
-	bool					_Get_Points		(void);
-	bool					_Get_Grid		(void);
-	CSG_Grid *				_Get_Grid		(TSG_Rect Extent);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED___Kriging_Base_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.h b/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.h
deleted file mode 100644
index aaebfa0..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/**********************************************************
- * Version $Id: _kriging_ordinary.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Kriging                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  _Kriging_Ordinary.h                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef _INTERPOLATION__Kriging_ORDINARY_H
-#define _INTERPOLATION__Kriging_ORDINARY_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "_kriging_ordinary_global.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class geostatistics_kriging_EXPORT C_Kriging_Ordinary : public C_Kriging_Ordinary_Global
-{
-public:
-	C_Kriging_Ordinary(void);
-	virtual ~C_Kriging_Ordinary(void);
-
-
-protected:
-
-	virtual bool			On_Initialise	(void);
-
-	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
-
-
-private:
-
-	int						m_nPoints_Min, m_nPoints_Max;
-
-	double					m_Radius;
-
-
-	int						Get_Weights		(double x, double y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef _INTERPOLATION__Kriging_ORDINARY_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.h b/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.h
deleted file mode 100644
index 9aa71ed..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************
- * Version $Id: _kriging_ordinary_global.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Kriging                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               _Kriging_Ordinary_Global.h              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED___Kriging_Ordinary_Global_H
-#define HEADER_INCLUDED___Kriging_Ordinary_Global_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "_kriging_base.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class geostatistics_kriging_EXPORT C_Kriging_Ordinary_Global : public C_Kriging_Base
-{
-public:
-	C_Kriging_Ordinary_Global(void);
-	virtual ~C_Kriging_Ordinary_Global(void);
-
-
-protected:
-
-	virtual bool			On_Initialise	(void);
-
-	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
-
-
-private:
-
-	bool					Get_Weights		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED___Kriging_Ordinary_Global_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.h b/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.h
deleted file mode 100644
index 318ecf3..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/**********************************************************
- * Version $Id: _kriging_universal.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Kriging                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  _Kriging_Universal.h                 //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED___Kriging_UNIVERSAL_H
-#define HEADER_INCLUDED___Kriging_UNIVERSAL_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "_kriging_universal_global.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class geostatistics_kriging_EXPORT C_Kriging_Universal : public C_Kriging_Universal_Global
-{
-public:
-	C_Kriging_Universal(void);
-	virtual ~C_Kriging_Universal(void);
-
-
-protected:
-
-	virtual bool			On_Initialise	(void);
-
-	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
-
-
-private:
-
-	int						m_nPoints_Min, m_nPoints_Max;
-
-	double					m_Radius;
-
-
-	int						Get_Weights		(double x, double y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED___Kriging_UNIVERSAL_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.h b/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.h
deleted file mode 100644
index 2060226..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/**********************************************************
- * Version $Id: _kriging_universal_global.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Kriging                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              _Kriging_Universal_Global.h              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED___Kriging_Universal_Global_H
-#define HEADER_INCLUDED___Kriging_Universal_Global_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "_kriging_base.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class geostatistics_kriging_EXPORT C_Kriging_Universal_Global : public C_Kriging_Base
-{
-public:
-	C_Kriging_Universal_Global(void);
-	virtual ~C_Kriging_Universal_Global(void);
-
-
-protected:
-
-	int						m_Interpolation;
-
-	CSG_Parameter_Grid_List	*m_pGrids;
-
-
-	virtual bool			On_Initialise	(void);
-
-	virtual bool			Get_Value		(double x, double y, double &z, double &Variance);
-
-
-private:
-
-	bool					Get_Weights		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED___Kriging_Universal_Global_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.cpp b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.cpp
deleted file mode 100644
index 2d54534..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Distances.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 GSPoints_Distances.cpp                //
-//                                                       //
-//                 Copyright (C) 2010 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 "GSPoints_Distances.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSPoints_Distances::CGSPoints_Distances(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Minimum Distance Analysis"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description(
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Minimum Distance Analysis"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SET_VALUE(s, v)	{ pRecord = pTable->Add_Record(); pRecord->Set_Value(0, s); pRecord->Set_Value(1, v); }
-
-//---------------------------------------------------------
-bool CGSPoints_Distances::On_Execute(void)
-{
-	//-----------------------------------------------------
-	CSG_Shapes	*pPoints	= Parameters("POINTS")	->asShapes();
-	CSG_Table	*pTable		= Parameters("TABLE")	->asTable();
-
-	//-----------------------------------------------------
-	CSG_PRQuadTree			QT(pPoints, 0);
-	CSG_Simple_Statistics	s;
-
-	double	x, y, z;
-
-	for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
-	{
-		TSG_Point	p	= pPoints->Get_Shape(iPoint)->Get_Point(0);
-
-		if( QT.Select_Nearest_Points(p.x, p.y, 2) && QT.Get_Selected_Point(1, x, y, z) && (x != p.x || y != p.y) )
-		{
-			s.Add_Value(SG_Get_Distance(x, y, p.x, p.y));
-		}
-	}
-
-	//-----------------------------------------------------
-	if( s.Get_Count() > 0 )
-	{
-		CSG_Table_Record	*pRecord;
-
-		pTable->Destroy();
-		pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Minimum Distance Analysis"), pPoints->Get_Name()));
-
-		pTable->Add_Field(SG_T("NAME")	, SG_DATATYPE_String);
-		pTable->Add_Field(SG_T("VALUE")	, SG_DATATYPE_Double);
-
-		SET_VALUE(_TL("Mean Average")		, s.Get_Mean());
-		SET_VALUE(_TL("Minimum")			, s.Get_Minimum());
-		SET_VALUE(_TL("Maximum")			, s.Get_Maximum());
-		SET_VALUE(_TL("Standard Deviation")	, s.Get_StdDev());
-		SET_VALUE(_TL("Duplicates")			, pPoints->Get_Count() - s.Get_Count());
-
-		DataObject_Update(pTable, SG_UI_DATAOBJECT_SHOW);
-
-		return( true );
-	}
-
-	Message_Dlg(_TL("not enough observations"));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.h b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.h
deleted file mode 100644
index c469ee2..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Distances.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  GSPoints_Distances.h                 //
-//                                                       //
-//                 Copyright (C) 2010 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__GSPoints_Distances_H
-#define HEADER_INCLUDED__GSPoints_Distances_H
-
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSPoints_Distances : public CSG_Module  
-{
-public:
-	CGSPoints_Distances(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSPoints_Distances_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.cpp b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.cpp
deleted file mode 100644
index e3fe264..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Pattern_Analysis.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSPoints_Pattern_Analysis.cpp            //
-//                                                       //
-//                 Copyright (C) 2010 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 "GSPoints_Pattern_Analysis.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSPoints_Pattern_Analysis::CGSPoints_Pattern_Analysis(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Spatial Point Pattern Analysis"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description(
-		_TL("Basic measures for spatial point patterns.")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "CENTRE"		, _TL("Mean Centre"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Point
-	);
-
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "STDDIST"		, _TL("Standard Distance"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Value(
-		pNode	, "STEP"		, _TL("Vertex Distance [Degree]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 5.0, 0.1, true, 20.0, true
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "BBOX"		, _TL("Bounding Box"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSPoints_Pattern_Analysis::On_Execute(void)
-{
-	int						iPoint;
-	double					StdDist;
-	CSG_Shape				*pShape;
-	CSG_Shapes				*pPoints, *pShapes;
-	CSG_Simple_Statistics	X, Y, D;
-
-	//-----------------------------------------------------
-	pPoints		= Parameters("POINTS")	->asShapes();
-
-	if( pPoints->Get_Count() <= 1 )
-	{
-		Error_Set(_TL("not enough points to perform pattern analysis"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
-	{
-		TSG_Point	p	= pPoints->Get_Shape(iPoint)->Get_Point(0);
-
-		X.Add_Value(p.x);
-		Y.Add_Value(p.y);
-	}
-
-	if( X.Get_Range() == 0.0 && Y.Get_Range() == 0.0 )
-	{
-		Error_Set(_TL("no variation in point pattern"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	StdDist	= 0.0;
-
-	for(iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
-	{
-		TSG_Point	p	= pPoints->Get_Shape(iPoint)->Get_Point(0);
-
-		D.Add_Value(SG_Get_Distance(X.Get_Mean(), Y.Get_Mean(), p.x, p.y));
-
-		StdDist	+= SG_Get_Square(p.x - X.Get_Mean()) + SG_Get_Square(p.y - Y.Get_Mean());
-	}
-
-	StdDist	= sqrt(StdDist / D.Get_Count());
-
-	//-----------------------------------------------------
-	pShapes	= Parameters("CENTRE")	->asShapes();
-
-	pShapes	->Create(SHAPE_TYPE_Point	, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Centre")));
-	pShapes	->Add_Field(SG_T("X_CENTRE"), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("Y_CENTRE"), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("N_POINTS"), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("STDDIST" ), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("MEANDIST"), SG_DATATYPE_Double);
-
-	pShape	= pShapes->Add_Shape();
-
-	pShape	->Set_Value(0, X.Get_Mean());
-	pShape	->Set_Value(1, Y.Get_Mean());
-	pShape	->Set_Value(2, D.Get_Count());
-	pShape	->Set_Value(3, StdDist);
-	pShape	->Set_Value(4, D.Get_StdDev());
-
-	pShape	->Add_Point(X.Get_Mean(), Y.Get_Mean());
-
-	//-----------------------------------------------------
-	pShapes	= Parameters("STDDIST")	->asShapes();
-
-	pShapes	->Create(SHAPE_TYPE_Polygon	, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Standard Distance")));
-	pShapes	->Add_Field(SG_T("X_CENTRE"), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("Y_CENTRE"), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("N_POINTS"), SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("STDDIST") , SG_DATATYPE_Double);
-
-	pShape	= pShapes->Add_Shape();
-
-	pShape	->Set_Value(0, X.Get_Mean());
-	pShape	->Set_Value(1, Y.Get_Mean());
-	pShape	->Set_Value(2, X.Get_Count());
-	pShape	->Set_Value(3, StdDist);
-
-	double	dTheta	= Parameters("STEP")->asDouble() * M_DEG_TO_RAD;
-
-	for(double Theta=0.0; Theta<=M_PI_360; Theta+=dTheta)
-	{
-		pShape	->Add_Point(
-			X.Get_Mean() + StdDist * cos(Theta),
-			Y.Get_Mean() + StdDist * sin(Theta)
-		);
-	}
-
-	//-----------------------------------------------------
-	pShapes	= Parameters("BBOX")	->asShapes();
-
-	pShapes	->Create(SHAPE_TYPE_Polygon	, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Bounding Box")));
-
-	pShapes	->Add_Field(SG_T("XMIN")	, SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("XMAX")	, SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("YMIN")	, SG_DATATYPE_Double);
-	pShapes	->Add_Field(SG_T("YMAX")	, SG_DATATYPE_Double);
-
-	pShape	= pShapes->Add_Shape();
-
-	pShape	->Set_Value(0, X.Get_Minimum());
-	pShape	->Set_Value(1, X.Get_Maximum());
-	pShape	->Set_Value(2, Y.Get_Minimum());
-	pShape	->Set_Value(3, Y.Get_Maximum());
-
-	pShape	->Add_Point(X.Get_Minimum(), Y.Get_Minimum());
-	pShape	->Add_Point(X.Get_Minimum(), Y.Get_Maximum());
-	pShape	->Add_Point(X.Get_Maximum(), Y.Get_Maximum());
-	pShape	->Add_Point(X.Get_Maximum(), Y.Get_Minimum());
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.h b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.h
deleted file mode 100644
index 4ee2d78..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Pattern_Analysis.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSPoints_Pattern_Analysis.h              //
-//                                                       //
-//                 Copyright (C) 2010 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__GSPoints_Pattern_Analysis_H
-#define HEADER_INCLUDED__GSPoints_Pattern_Analysis_H
-
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSPoints_Pattern_Analysis : public CSG_Module  
-{
-public:
-	CGSPoints_Pattern_Analysis(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSPoints_Pattern_Analysis_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.cpp b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.cpp
deleted file mode 100644
index 17a86c0..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Semi_Variances.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSPoints_Semi_Variances.cpp              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "GSPoints_Semi_Variances.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	FIELD_CLASSNR	= 0,
-	FIELD_DISTANCE,
-	FIELD_COUNT,
-	FIELD_VARIANCE,
-	FIELD_VARCUMUL,
-	FIELD_COVARIANCE,
-	FIELD_COVARCUMUL
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSPoints_Semi_Variances::CGSPoints_Semi_Variances(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Variogram"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2003"));
-
-	Set_Description(
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "FIELD"		, _TL("Attribute"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Table(
-		NULL	, "RESULT"		, _TL("Sample Variogram"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTCOUNT"	, _TL("Initial Number of Distance Classes"),
-		_TL(""),
-		PARAMETER_TYPE_Int		, 100, 1, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTMAX"		, _TL("Maximum Distance"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NSKIP"		, _TL("Skip Number"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSPoints_Semi_Variances::On_Execute(void)
-{
-	int					i, j, k, n, nDistances, nSkip, Attribute;
-	double				zi, zj, zMean, v, c, maxDistance, lagDistance;
-	TSG_Point			Pt_i, Pt_j;
-	CSG_Vector			Count, Variance, Covariance;
-	CSG_Table_Record	*pRecord;
-	CSG_Table			*pTable;
-	CSG_Shape			*pPoint;
-	CSG_Shapes			*pPoints;
-
-	//-----------------------------------------------------
-	pPoints		= Parameters("POINTS")		->asShapes();
-	pTable		= Parameters("RESULT")		->asTable();
-	Attribute	= Parameters("FIELD")		->asInt();
-	nSkip		= Parameters("NSKIP")		->asInt();
-	maxDistance	= Parameters("DISTMAX")		->asDouble();
-	nDistances	= Parameters("DISTCOUNT")	->asInt();
-
-	if( maxDistance <= 0.0 )
-	{
-		maxDistance	= SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange());
-	}
-
-	lagDistance	= maxDistance / nDistances;
-
-	zMean		= pPoints->Get_Mean(Attribute);
-
-	Count		.Create(nDistances);
-	Variance	.Create(nDistances);
-	Covariance	.Create(nDistances);
-
-	//-----------------------------------------------------
-	for(i=0, n=0; i<pPoints->Get_Count() && Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip)
-	{
-		pPoint	= pPoints->Get_Shape(i);
-
-		if( !pPoint->is_NoData(Attribute) )
-		{
-			Pt_i	= pPoint->Get_Point(0);
-			zi		= pPoint->asDouble(Attribute);
-
-			for(j=i+nSkip; j<pPoints->Get_Count(); j+=nSkip, n++)
-			{
-				pPoint	= pPoints->Get_Shape(j);
-
-				if( !pPoint->is_NoData(Attribute) )
-				{
-					Pt_j	= pPoint->Get_Point(0);
-					k		= (int)(SG_Get_Distance(Pt_i, Pt_j) / lagDistance);
-
-					if( k < nDistances )
-					{
-						zj	= pPoint->asDouble(Attribute);
-
-						v	= SG_Get_Square(zi - zj);
-						c	= (zi - zMean) * (zj - zMean);
-
-						Count	  [k]	++;
-						Variance  [k]	+= v;
-						Covariance[k]	+= c;
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	pTable->Destroy();
-	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Variogram"), pPoints->Get_Field_Name(Attribute)));
-	pTable->Add_Field(_TL("Class")		, SG_DATATYPE_Int);		// FIELD_CLASSNR
-	pTable->Add_Field(_TL("Distance")	, SG_DATATYPE_Double);	// FIELD_DISTANCE
-	pTable->Add_Field(_TL("Count")		, SG_DATATYPE_Int);		// FIELD_COUNT
-	pTable->Add_Field(_TL("Variance")	, SG_DATATYPE_Double);	// FIELD_VARIANCE
-	pTable->Add_Field(_TL("Cum.Var.")	, SG_DATATYPE_Double);	// FIELD_VARCUMUL
-	pTable->Add_Field(_TL("Covariance")	, SG_DATATYPE_Double);	// FIELD_COVARIANCE
-	pTable->Add_Field(_TL("Cum.Covar.")	, SG_DATATYPE_Double);	// FIELD_COVARCUMUL
-
-	for(i=0, v=0.0, c=0.0, n=0; i<nDistances; i++)
-	{
-		if( Count[i] > 0 )
-		{
-			n	+= (int)Count[i];
-			v	+= Variance  [i];
-			c	+= Covariance[i];
-
-			pRecord	= pTable->Add_Record();
-			pRecord->Set_Value(FIELD_CLASSNR	, (i + 1));
-			pRecord->Set_Value(FIELD_DISTANCE	, (i + 1) * lagDistance);
-			pRecord->Set_Value(FIELD_COUNT		, Count[i]);
-			pRecord->Set_Value(FIELD_VARIANCE	, 0.5 * Variance  [i] / Count[i]);
-			pRecord->Set_Value(FIELD_VARCUMUL	, 0.5 * v / n);
-			pRecord->Set_Value(FIELD_COVARIANCE	, 1.0 * Covariance[i] / Count[i]);
-			pRecord->Set_Value(FIELD_COVARCUMUL	, 1.0 * c / n);
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.h b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.h
deleted file mode 100644
index e25c3d5..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Semi_Variances.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               GSPoints_Semi_Variances.h               //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__GSPoints_Semi_Variances_H
-#define HEADER_INCLUDED__GSPoints_Semi_Variances_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSPoints_Semi_Variances : public CSG_Module  
-{
-public:
-	CGSPoints_Semi_Variances(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSPoints_Semi_Variances_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.cpp b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.cpp
deleted file mode 100644
index a04b526..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Variogram_Cloud.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSPoints_Variogram_Cloud.cpp             //
-//                                                       //
-//                 Copyright (C) 2010 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 "GSPoints_Variogram_Cloud.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	DIF_FIELD_DISTANCE		= 0,
-	DIF_FIELD_DIRECTION,
-	DIF_FIELD_DIFFERENCE,
-	DIF_FIELD_VARIANCE,
-	DIF_FIELD_SEMIVARIANCE,
-	DIF_FIELD_COVARIANCE
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSPoints_Variogram_Cloud::CGSPoints_Variogram_Cloud(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Variogram Cloud"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2003"));
-
-	Set_Description(
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "FIELD"		, _TL("Attribute"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Table(
-		NULL	, "RESULT"		, _TL("Variogram Cloud"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTMAX"		, _TL("Maximum Distance"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NSKIP"		, _TL("Skip Number"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSPoints_Variogram_Cloud::On_Execute(void)
-{
-	int			nSkip, Attribute;
-	double		zi, zj, zMean, d, maxDistance;
-	TSG_Point	Pt_i, Pt_j;
-	CSG_Table	*pTable;
-	CSG_Shape	*pPoint;
-	CSG_Shapes	*pPoints;
-
-	//-----------------------------------------------------
-	pPoints		= Parameters("POINTS")		->asShapes();
-	pTable		= Parameters("RESULT")		->asTable();
-	Attribute	= Parameters("FIELD")		->asInt();
-	nSkip		= Parameters("NSKIP")		->asInt();
-	maxDistance	= Parameters("DISTMAX")		->asDouble();
-
-	if( maxDistance <= 0.0 )
-	{
-		maxDistance	= SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange());
-	}
-
-	zMean		= pPoints->Get_Mean(Attribute);
-
-	//-----------------------------------------------------
-	pTable->Destroy();
-	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Variogram Cloud")));
-	pTable->Add_Field(_TL("Distance")		, SG_DATATYPE_Double);	// DIF_FIELD_DISTANCE
-	pTable->Add_Field(_TL("Direction")		, SG_DATATYPE_Double);	// DIF_FIELD_DIRECTION
-	pTable->Add_Field(_TL("Difference")		, SG_DATATYPE_Double);	// DIF_FIELD_DIFFERENCE
-	pTable->Add_Field(_TL("Variance")		, SG_DATATYPE_Double);	// DIF_FIELD_VARIANCE
-	pTable->Add_Field(_TL("Semivariance")	, SG_DATATYPE_Double);	// DIF_FIELD_SEMIVARIANCE
-	pTable->Add_Field(_TL("Covariance")		, SG_DATATYPE_Double);	// DIF_FIELD_COVARIANCE
-
-	//-----------------------------------------------------
-	for(int i=0; i<pPoints->Get_Count()-nSkip && Set_Progress(i, pPoints->Get_Count()-nSkip); i+=nSkip)
-	{
-		pPoint	= pPoints->Get_Shape(i);
-
-		if( !pPoint->is_NoData(Attribute) )
-		{
-			Pt_i	= pPoint->Get_Point(0);
-			zi		= pPoint->asDouble(Attribute);
-
-			for(int j=i; j<pPoints->Get_Count() && Process_Get_Okay(); j+=nSkip)
-			{
-				pPoint	= pPoints->Get_Shape(j);
-
-				if( !pPoint->is_NoData(Attribute) )
-				{
-					Pt_j	= pPoint->Get_Point(0);
-
-					if( (d = SG_Get_Distance(Pt_i, Pt_j)) <= maxDistance )
-					{
-						CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-						zj	= pPoint->asDouble(Attribute);
-
-						pRecord->Set_Value(DIF_FIELD_DISTANCE		, d);
-						pRecord->Set_Value(DIF_FIELD_DIRECTION		, SG_Get_Angle_Of_Direction(Pt_i, Pt_j) * M_RAD_TO_DEG);
-						pRecord->Set_Value(DIF_FIELD_DIFFERENCE		, fabs(d = zi - zj));
-						pRecord->Set_Value(DIF_FIELD_VARIANCE		, d = d*d);
-						pRecord->Set_Value(DIF_FIELD_SEMIVARIANCE	, 0.5*d);
-						pRecord->Set_Value(DIF_FIELD_COVARIANCE		, (zi - zMean) * (zj - zMean));
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.h b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.h
deleted file mode 100644
index b81f81c..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Variogram_Cloud.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               GSPoints_Variogram_Cloud.h              //
-//                                                       //
-//                 Copyright (C) 2010 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__GSPoints_Variogram_Cloud_H
-#define HEADER_INCLUDED__GSPoints_Variogram_Cloud_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSPoints_Variogram_Cloud : public CSG_Module  
-{
-public:
-	CGSPoints_Variogram_Cloud(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSPoints_Variogram_Cloud_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.cpp b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.cpp
deleted file mode 100644
index 7f74a0c..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Variogram_Surface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             GSPoints_Variogram_Surface.cpp            //
-//                                                       //
-//                 Copyright (C) 2010 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 "GSPoints_Variogram_Surface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGSPoints_Variogram_Surface::CGSPoints_Variogram_Surface(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Variogram Surface"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description(
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "FIELD"		, _TL("Attribute"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_Output(
-		NULL	, "COUNT"		, _TL("Number of Pairs"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "VARIANCE"	, _TL("Variogram Surface"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "COVARIANCE"	, _TL("Covariance Surface"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTCOUNT"	, _TL("Number of Distance Classes"),
-		_TL(""),
-		PARAMETER_TYPE_Int		, 10, 1, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NSKIP"		, _TL("Skip Number"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGSPoints_Variogram_Surface::On_Execute(void)
-{
-	long				i;
-	int					j, x, y, n, nx, ny, nSkip, Attribute, nDistances;
-	double				zi, zj, zMean, v, c, lagDistance;
-	TSG_Point			Pt_i, Pt_j;
-	CSG_Shape			*pPoint;
-	CSG_Shapes			*pPoints;
-	CSG_Grid			*pVariance, *pCovariance, *pCount;
-
-	//-----------------------------------------------------
-	pPoints		= Parameters("POINTS")		->asShapes();
-	Attribute	= Parameters("FIELD")		->asInt();
-	nSkip		= Parameters("NSKIP")		->asInt();
-	nDistances	= Parameters("DISTCOUNT")	->asInt();
-
-	lagDistance	= pPoints->Get_Extent().Get_XRange() < pPoints->Get_Extent().Get_YRange()
-				? pPoints->Get_Extent().Get_XRange() / nDistances
-				: pPoints->Get_Extent().Get_YRange() / nDistances;
-
-	nx			= 1 + (int)(pPoints->Get_Extent().Get_XRange() / lagDistance);
-	ny			= 1 + (int)(pPoints->Get_Extent().Get_YRange() / lagDistance);
-	zMean		= pPoints->Get_Mean(Attribute);
-
-	pCount		= SG_Create_Grid(SG_DATATYPE_Int  , 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance);
-	pVariance	= SG_Create_Grid(SG_DATATYPE_Float, 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance);
-	pCovariance	= SG_Create_Grid(SG_DATATYPE_Float, 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance);
-
-	pCount		->Set_Name(CSG_String::Format(SG_T("%s [%s]")    , pPoints->Get_Name(), _TL("Count")));
-	pVariance	->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Variogram Surface") , pPoints->Get_Field_Name(Attribute)));
-	pCovariance	->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Covariance Surface"), pPoints->Get_Field_Name(Attribute)));
-
-	//-----------------------------------------------------
-	for(i=0, n=0; i<pPoints->Get_Count() && Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip)
-	{
-		pPoint	= pPoints->Get_Shape(i);
-
-		if( !pPoint->is_NoData(Attribute) )
-		{
-			Pt_i	= pPoint->Get_Point(0);
-			zi		= pPoint->asDouble(Attribute);
-
-			for(j=i+nSkip; j<pPoints->Get_Count(); j+=nSkip, n++)
-			{
-				pPoint	= pPoints->Get_Shape(j);
-
-				if( !pPoint->is_NoData(Attribute) )
-				{
-					Pt_j	= pPoint->Get_Point(0);
-
-					zj	= pPoint->asDouble(Attribute);
-
-					v	= SG_Get_Square(zi - zj);
-					c	= (zi - zMean) * (zj - zMean);
-
-					Pt_j.x	= (Pt_i.x - Pt_j.x) / lagDistance;
-					Pt_j.y	= (Pt_i.y - Pt_j.y) / lagDistance;
-
-					x	= (int)(Pt_j.x + (Pt_j.x > 0.0 ? 0.5 : -0.5));
-					y	= (int)(Pt_j.y + (Pt_j.y > 0.0 ? 0.5 : -0.5));
-
-					pCount     ->Add_Value(nx + x, ny + y, 1);
-					pCount     ->Add_Value(nx - x, ny - y, 1);
-					pVariance  ->Add_Value(nx + x, ny + y, v);
-					pVariance  ->Add_Value(nx - x, ny - y, v);
-					pCovariance->Add_Value(nx + x, ny + y, c);
-					pCovariance->Add_Value(nx - x, ny - y, c);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(i=0; i<pCount->Get_NCells(); i++)
-	{
-		if( pCount->asInt(i) > 0 )
-		{
-			pVariance  ->Mul_Value(i, 0.5 / pCount->asInt(i));
-			pCovariance->Mul_Value(i, 1.0 / pCount->asInt(i));
-		}
-		else
-		{
-			pVariance  ->Set_NoData(i);
-			pCovariance->Set_NoData(i);
-		}
-	}
-
-	DataObject_Add(pCount);
-	DataObject_Add(pVariance);
-	DataObject_Add(pCovariance);
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.h b/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.h
deleted file mode 100644
index 63d732b..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/**********************************************************
- * Version $Id: GSPoints_Variogram_Surface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              GSPoints_Variogram_Surface.h             //
-//                                                       //
-//                 Copyright (C) 2010 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__GSPoints_Variogram_Surface_H
-#define HEADER_INCLUDED__GSPoints_Variogram_Surface_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGSPoints_Variogram_Surface : public CSG_Module  
-{
-public:
-	CGSPoints_Variogram_Surface(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GSPoints_Variogram_Surface_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp b/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp
deleted file mode 100644
index a2227df..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 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("Spatial and Geostatistics - Points") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O.Conrad (c) 2002-10") );
-
-	case MLB_INFO_Description:
-		return( _TL("Spatial and geostatistical analyses of point data.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Spatial and Geostatistics|Points") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "GSPoints_Semi_Variances.h"
-#include "GSPoints_Variogram_Cloud.h"
-#include "GSPoints_Variogram_Surface.h"
-#include "GSPoints_Distances.h"
-#include "GSPoints_Pattern_Analysis.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CGSPoints_Semi_Variances );
-	case  1:	return( new CGSPoints_Variogram_Cloud );
-	case  2:	return( new CGSPoints_Variogram_Surface );
-	case  3:	return( new CGSPoints_Distances );
-	case  4:	return( new CGSPoints_Pattern_Analysis );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.h b/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.h
deleted file mode 100644
index b8e122c..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 Geostatistics_Points                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__geostatistics_points_H
-#define HEADER_INCLUDED__geostatistics_points_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef geostatistics_points_EXPORTS
-	#define	geostatistics_points_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	geostatistics_points_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__geostatistics_points_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.am b/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.am
deleted file mode 100644
index 2f29414..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = libgeostatistics_points.la
-libgeostatistics_points_la_SOURCES =\
-GSPoints_Distances.cpp\
-GSPoints_Pattern_Analysis.cpp\
-GSPoints_Semi_Variances.cpp\
-GSPoints_Variogram_Cloud.cpp\
-GSPoints_Variogram_Surface.cpp\
-MLB_Interface.cpp\
-GSPoints_Distances.h\
-GSPoints_Pattern_Analysis.h\
-GSPoints_Semi_Variances.h\
-GSPoints_Variogram_Cloud.h\
-GSPoints_Variogram_Surface.h\
-MLB_Interface.h
-
-libgeostatistics_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.in b/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.in
deleted file mode 100644
index f6875bf..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.in
+++ /dev/null
@@ -1,593 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_geostatistics/geostatistics/geostatistics_points
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libgeostatistics_points_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libgeostatistics_points_la_OBJECTS = GSPoints_Distances.lo \
-	GSPoints_Pattern_Analysis.lo GSPoints_Semi_Variances.lo \
-	GSPoints_Variogram_Cloud.lo GSPoints_Variogram_Surface.lo \
-	MLB_Interface.lo
-libgeostatistics_points_la_OBJECTS =  \
-	$(am_libgeostatistics_points_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libgeostatistics_points_la_SOURCES)
-DIST_SOURCES = $(libgeostatistics_points_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libgeostatistics_points.la
-libgeostatistics_points_la_SOURCES = \
-GSPoints_Distances.cpp\
-GSPoints_Pattern_Analysis.cpp\
-GSPoints_Semi_Variances.cpp\
-GSPoints_Variogram_Cloud.cpp\
-GSPoints_Variogram_Surface.cpp\
-MLB_Interface.cpp\
-GSPoints_Distances.h\
-GSPoints_Pattern_Analysis.h\
-GSPoints_Semi_Variances.h\
-GSPoints_Variogram_Cloud.h\
-GSPoints_Variogram_Surface.h\
-MLB_Interface.h
-
-libgeostatistics_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_points/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_points/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgeostatistics_points.la: $(libgeostatistics_points_la_OBJECTS) $(libgeostatistics_points_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_points_la_OBJECTS) $(libgeostatistics_points_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Distances.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Pattern_Analysis.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Semi_Variances.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Variogram_Cloud.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSPoints_Variogram_Surface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp
deleted file mode 100644
index 616b7b4..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2010 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//			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("Spatial and Geostatistics - Regression") );
-
-	case MLB_INFO_Author:
-		return( _TL("O.Conrad (c) 2010" ));
-
-	case MLB_INFO_Description:
-		return( _TL("Tools for regression analyses.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Spatial and Geostatistics|Regression") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "point_grid_regression.h"
-#include "point_multi_grid_regression.h"
-#include "point_trend_surface.h"
-
-#include "gw_regression.h"
-#include "gw_regression_grid.h"
-#include "gw_multi_regression.h"
-#include "gw_multi_regression_grid.h"
-#include "gw_multi_regression_points.h"
-#include "gwr_grid_downscaling.h"
-
-#include "grid_multi_grid_regression.h"
-#include "grids_trend_polynom.h"
-
-#include "table_trend.h"
-#include "table_regression_multiple.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CPoint_Grid_Regression );
-	case  1:	return( new CPoint_Multi_Grid_Regression );
-	case  2:	return( new CPoint_Trend_Surface );
-
-	case  3:	return( new CGW_Regression );
-	case  4:	return( new CGW_Regression_Grid );
-	case  5:	return( new CGW_Multi_Regression );
-	case  6:	return( new CGW_Multi_Regression_Grid );
-	case  7:	return( new CGW_Multi_Regression_Points );
-	case 14:	return( new CGWR_Grid_Downscaling );
-
-	case  8:	return( new CGrid_Multi_Grid_Regression );
-	case  9:	return( new CGrids_Trend );
-
-	case 10:	return( new CTable_Trend );
-	case 11:	return( new CTable_Trend_Shapes );
-
-	case 12:	return( new CTable_Regression_Multiple );
-	case 13:	return( new CTable_Regression_Multiple_Shapes );
-
-	//-----------------------------------------------------
-	case 19:	return( NULL );
-	default:	return( MLB_INTERFACE_SKIP_MODULE );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.h
deleted file mode 100644
index c936440..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__geostatistics_regression_H
-#define HEADER_INCLUDED__geostatistics_regression_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef geostatistics_regression_EXPORTS
-	#define	geostatistics_regression_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	geostatistics_regression_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__geostatistics_regression_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am b/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am
deleted file mode 100644
index 11492ba..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# $Id: Makefile.am 1738 2013-06-20 11:15:45Z 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 = libgeostatistics_regression.la
-libgeostatistics_regression_la_SOURCES =\
-grid_multi_grid_regression.cpp\
-gw_multi_regression.cpp\
-gw_multi_regression_grid.cpp\
-gw_multi_regression_points.cpp\
-gw_regression.cpp\
-gw_regression_grid.cpp\
-gwr_grid_downscaling.cpp\
-grids_trend_polynom.cpp\
-MLB_Interface.cpp\
-point_grid_regression.cpp\
-point_multi_grid_regression.cpp\
-point_trend_surface.cpp\
-table_regression_multiple.cpp\
-table_trend.cpp\
-grid_multi_grid_regression.h\
-gw_multi_regression.h\
-gw_multi_regression_grid.h\
-gw_multi_regression_points.h\
-gw_regression.h\
-gw_regression_grid.h\
-gwr_grid_downscaling.h\
-grids_trend_polynom.h\
-MLB_Interface.h\
-point_grid_regression.h\
-point_multi_grid_regression.h\
-point_trend_surface.h\
-table_regression_multiple.h\
-table_trend.h
-
-libgeostatistics_regression_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.in b/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.in
deleted file mode 100644
index b221558..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.in
+++ /dev/null
@@ -1,621 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_geostatistics/geostatistics/geostatistics_regression
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libgeostatistics_regression_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libgeostatistics_regression_la_OBJECTS =  \
-	grid_multi_grid_regression.lo gw_multi_regression.lo \
-	gw_multi_regression_grid.lo gw_multi_regression_points.lo \
-	gw_regression.lo gw_regression_grid.lo gwr_grid_downscaling.lo \
-	grids_trend_polynom.lo MLB_Interface.lo \
-	point_grid_regression.lo point_multi_grid_regression.lo \
-	point_trend_surface.lo table_regression_multiple.lo \
-	table_trend.lo
-libgeostatistics_regression_la_OBJECTS =  \
-	$(am_libgeostatistics_regression_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libgeostatistics_regression_la_SOURCES)
-DIST_SOURCES = $(libgeostatistics_regression_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1738 2013-06-20 11:15:45Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libgeostatistics_regression.la
-libgeostatistics_regression_la_SOURCES = \
-grid_multi_grid_regression.cpp\
-gw_multi_regression.cpp\
-gw_multi_regression_grid.cpp\
-gw_multi_regression_points.cpp\
-gw_regression.cpp\
-gw_regression_grid.cpp\
-gwr_grid_downscaling.cpp\
-grids_trend_polynom.cpp\
-MLB_Interface.cpp\
-point_grid_regression.cpp\
-point_multi_grid_regression.cpp\
-point_trend_surface.cpp\
-table_regression_multiple.cpp\
-table_trend.cpp\
-grid_multi_grid_regression.h\
-gw_multi_regression.h\
-gw_multi_regression_grid.h\
-gw_multi_regression_points.h\
-gw_regression.h\
-gw_regression_grid.h\
-gwr_grid_downscaling.h\
-grids_trend_polynom.h\
-MLB_Interface.h\
-point_grid_regression.h\
-point_multi_grid_regression.h\
-point_trend_surface.h\
-table_regression_multiple.h\
-table_trend.h
-
-libgeostatistics_regression_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libgeostatistics_regression.la: $(libgeostatistics_regression_la_OBJECTS) $(libgeostatistics_regression_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_regression_la_OBJECTS) $(libgeostatistics_regression_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_multi_grid_regression.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grids_trend_polynom.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_multi_regression.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_multi_regression_grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_multi_regression_points.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_regression.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gw_regression_grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gwr_grid_downscaling.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/point_grid_regression.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/point_multi_grid_regression.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/point_trend_surface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table_regression_multiple.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table_trend.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.cpp
deleted file mode 100644
index a80b902..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.cpp
+++ /dev/null
@@ -1,445 +0,0 @@
-/**********************************************************
- * Version $Id: grid_multi_grid_regression.cpp 1160 2011-09-14 15:11:54Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              grid_multi_grid_regression.cpp           //
-//                                                       //
-//                 Copyright (C) 2011 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "grid_multi_grid_regression.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Multi_Grid_Regression::CGrid_Multi_Grid_Regression(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Multiple Regression Analysis (Grid/Grids)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Linear regression analysis of one grid as dependent and multiple grids as indepentent (predictor) variables. "
-		"Details of the regression/correlation analysis will be saved to a table. "
-		"Optionally the regression model is used to create a new grid with regression based values. "
-		"The multiple regression analysis uses a forward selection procedure. \n"
-		"\n"
-		"Reference:\n"
-		"- Bahrenberg, G., Giese, E., Nipper, J. (1992): "
-		"'Statistische Methoden in der Geographie 2 - Multivariate Statistik', "
-		"Stuttgart, 415p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEPENDENT"	, _TL("Dependent"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REGRESSION"	, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "RESIDUALS"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_COEFF"	, _TL("Details: Coefficients"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_MODEL"	, _TL("Details: Model"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_STEPS"	, _TL("Details: Steps"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"INTERPOL"		, _TL("Grid Interpolation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-			_TL("Nearest Neighbor"),
-			_TL("Bilinear Interpolation"),
-			_TL("Inverse Distance Interpolation"),
-			_TL("Bicubic Spline Interpolation"),
-			_TL("B-Spline Interpolation")
-		), 4
-	);
-
-	Parameters.Add_Value(
-		NULL	, "COORD_X"		, _TL("Include X Coordinate"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "COORD_Y"		, _TL("Include Y Coordinate"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("include all"),
-			_TL("forward"),
-			_TL("backward"),
-			_TL("stepwise")
-		), 3
-	);
-
-	Parameters.Add_Value(
-		NULL	, "P_IN"		, _TL("P in"),
-		_TL("Level of significance for automated predictor selection, given as percentage"),
-		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "P_OUT"		, _TL("P out"),
-		_TL("Level of significance for automated predictor selection, given as percentage"),
-		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Multi_Grid_Regression::On_Execute(void)
-{
-	bool					bResult;
-	double					P_in, P_out;
-	CSG_Strings				Names;
-	CSG_Matrix				Samples;
-	CSG_Grid				*pDependent, *pRegression, *pResiduals;
-	CSG_Parameter_Grid_List	*pGrids;
-
-	//-----------------------------------------------------
-	pDependent		= Parameters("DEPENDENT")	->asGrid();
-	pGrids			= Parameters("GRIDS")		->asGridList();
-	pRegression		= Parameters("REGRESSION")	->asGrid();
-	pResiduals		= Parameters("RESIDUALS")	->asGrid();
-	P_in			= Parameters("P_IN")		->asDouble() / 100.0;
-	P_out			= Parameters("P_OUT")		->asDouble() / 100.0;
-
-	//-----------------------------------------------------
-	if( !Get_Samples(pGrids, pDependent, Samples, Names) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	switch( Parameters("METHOD")->asInt() )
-	{
-	default:
-	case 0:	bResult	= m_Regression.Get_Model         (Samples             , &Names);	break;
-	case 1:	bResult	= m_Regression.Get_Model_Forward (Samples, P_in       , &Names);	break;
-	case 2:	bResult	= m_Regression.Get_Model_Backward(Samples,       P_out, &Names);	break;
-	case 3:	bResult	= m_Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names);	break;
-	}
-
-	if( bResult == false )
-	{
-		return( false );
-	}
-
-	Message_Add(m_Regression.Get_Info(), false);
-
-	//-----------------------------------------------------
-	Set_Regression(pGrids, pDependent, pRegression, pResiduals, CSG_String::Format(SG_T("%s [%s]"), pDependent->Get_Name(), _TL("Regression Model")));
-
-	//-----------------------------------------------------
-	if( Parameters("INFO_COEFF")->asTable() )
-	{
-		Parameters("INFO_COEFF")->asTable()->Assign(m_Regression.Get_Info_Regression());
-		Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients"));
-	}
-
-	if( Parameters("INFO_MODEL")->asTable() )
-	{
-		Parameters("INFO_MODEL")->asTable()->Assign(m_Regression.Get_Info_Model());
-		Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model"));
-	}
-
-	if( Parameters("INFO_STEPS")->asTable() )
-	{
-		Parameters("INFO_STEPS")->asTable()->Assign(m_Regression.Get_Info_Steps());
-		Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps"));
-	}
-
-	//-----------------------------------------------------
-	m_Regression.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Multi_Grid_Regression::Get_Samples(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Matrix &Samples, CSG_Strings &Names)
-{
-	int			iGrid, x, y;
-	double		zGrid;
-	TSG_Point	p;
-	CSG_Vector	Sample;
-
-	//-----------------------------------------------------
-	int		Interpolation	= Parameters("INTERPOL")	->asInt();
-	bool	bCoord_X		= Parameters("COORD_X")		->asBool();
-	bool	bCoord_Y		= Parameters("COORD_Y")		->asBool();
-
-	Names	+= pDependent->Get_Name();					// Dependent Variable
-
-	for(iGrid=0; iGrid<pGrids->Get_Count(); iGrid++)	// Independent Variables
-	{
-		Names	+= pGrids->asGrid(iGrid)->Get_Name();
-	}
-
-	if( bCoord_X )	{	Names	+= SG_T("X");	}
-	if( bCoord_Y )	{	Names	+= SG_T("Y");	}
-
-	Sample.Create(1 + pGrids->Get_Count() + (bCoord_X ? 1 : 0) + (bCoord_Y ? 1 : 0));
-
-	//-----------------------------------------------------
-	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
-	{
-		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
-		{
-			if( !pDependent->is_NoData(x, y) )
-			{
-				bool		bAdd	= true;
-
-				for(iGrid=0; iGrid<pGrids->Get_Count() && bAdd; iGrid++)
-				{
-					if( pGrids->asGrid(iGrid)->Get_Value(p, zGrid, Interpolation) )
-					{
-						Sample[1 + iGrid]	= zGrid;
-					}
-					else
-					{
-						bAdd	= false;
-					}
-				}
-
-				if( bAdd )
-				{
-					Sample[0]	= pDependent->asDouble(x, y);
-
-					if( bCoord_X )	{	Sample[1 + iGrid++]	= p.x;	}
-					if( bCoord_Y )	{	Sample[1 + iGrid++]	= p.y;	}
-
-					Samples.Add_Row(Sample);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( Samples.Get_NRows() >= pGrids->Get_Count() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Multi_Grid_Regression::Set_Regression(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Grid *pRegression, CSG_Grid *pResiduals, const CSG_String &Name)
-{
-	//-----------------------------------------------------
-	int			iGrid, nGrids, x, y;
-	TSG_Point	p;
-
-	int		Interpolation	= Parameters("INTERPOL")->asInt();
-
-	CSG_Grid	**ppGrids	= (CSG_Grid **)SG_Malloc(m_Regression.Get_nPredictors() * sizeof(CSG_Grid *));
-
-	bool	bCoord_X		= false;
-	bool	bCoord_Y		= false;
-
-	for(iGrid=0, nGrids=0; iGrid<m_Regression.Get_nPredictors(); iGrid++)
-	{
-		if( m_Regression.Get_Predictor(iGrid) < pGrids->Get_Count() )
-		{
-			ppGrids[nGrids++]	= pGrids->asGrid(m_Regression.Get_Predictor(iGrid));
-		}
-		else if( m_Regression.Get_Predictor(iGrid) == pGrids->Get_Count() && Parameters("COORD_X")->asBool() )
-		{
-			bCoord_X = true;
-		}
-		else // if( m_Regression.Get_Predictor(iGrid) > pGrids->Get_Count() || Parameters("COORD_X")->asBool() == false )
-		{
-			bCoord_Y = true;
-		}
-	}
-
-	pRegression->Set_Name(Name);
-
-	if( pDependent && pResiduals )
-	{
-		pResiduals->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Name.c_str(), _TL("Residuals")));
-	}
-	else
-	{
-		pResiduals	= NULL;
-	}
-
-	//-----------------------------------------------------
-	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
-	{
-		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
-		{
-			bool	bOkay;
-			double	z	= m_Regression.Get_RConst();
-
-			for(iGrid=0, bOkay=true; bOkay && iGrid<nGrids; iGrid++)
-			{
-				double	zGrid;
-
-				if( ppGrids[iGrid]->Get_Value(p, zGrid, Interpolation) )
-				{
-					z	+= m_Regression.Get_RCoeff(iGrid) * zGrid;
-				}
-				else
-				{
-					bOkay	= false;
-				}
-			}
-
-			//---------------------------------------------
-			if( bOkay )
-			{
-				if( bCoord_X )
-				{
-					z	+= m_Regression.Get_RCoeff(iGrid++) * Get_System()->Get_xGrid_to_World(x);
-				}
-
-				if( bCoord_Y )
-				{
-					z	+= m_Regression.Get_RCoeff(iGrid++) * Get_System()->Get_yGrid_to_World(y);
-				}
-
-				pRegression->Set_Value (x, y, z);
-
-				if( pResiduals )
-				{
-					pResiduals->Set_Value(x, y, pDependent->asDouble(x, y) - z);
-				}
-			}
-			else
-			{
-				pRegression->Set_NoData(x, y);
-
-				if( pResiduals )
-				{
-					pResiduals->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	SG_Free(ppGrids);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.h
deleted file mode 100644
index c5fdcfa..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/**********************************************************
- * Version $Id: grid_multi_grid_regression.h 1160 2011-09-14 15:11:54Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               grid_multi_grid_regression.h            //
-//                                                       //
-//                 Copyright (C) 2011 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__grid_multi_grid_regression_H
-#define HEADER_INCLUDED__grid_multi_grid_regression_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrid_Multi_Grid_Regression : public CSG_Module_Grid
-{
-public:
-	CGrid_Multi_Grid_Regression(void);
-
-
-protected:
-
-	virtual bool				On_Execute			(void);
-
-
-private:
-
-	CSG_Regression_Multiple		m_Regression;
-
-
-	bool						Get_Samples			(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Matrix &Samples, CSG_Strings &Names);
-
-	bool						Set_Regression		(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Grid *pRegression, CSG_Grid *pResiduals, const CSG_String &Name);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__grid_multi_grid_regression_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/grids_trend_polynom.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/grids_trend_polynom.cpp
deleted file mode 100644
index 70aec23..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/grids_trend_polynom.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-/**********************************************************
- * Version $Id: grids_trend_polynom.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                grids_trend_polynom.cpp                //
-//                                                       //
-//                 Copyright (C) 2011 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 "grids_trend_polynom.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrids_Trend::CGrids_Trend(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Polynomial Trend from Grids"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Fits for each cell a polynomial trend function. "
-		"Outputs are the polynomial coefficients for the "
-		"polynomial trend function of chosen order. "
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "Y_GRIDS"	, _TL("Dependent Variables"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "COEFF"	, _TL("Polynomial Coefficients"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "R2"		, _TL("Coefficient of Determination"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL	, "ORDER"	, _TL("Polynomial Order"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "XSOURCE"	, _TL("Get Independent Variable from ..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("list order"),
-			_TL("table"),
-			_TL("grid list")
-		), 0
-	);
-
-	Parameters.Add_FixedTable(
-		NULL	, "X_TABLE"	, _TL("Independent Variable (per Grid)"),
-		_TL("")
-	)->asTable()->Add_Field(_TL("Value"), SG_DATATYPE_Double);
-
-	Parameters.Add_Grid_List(
-		NULL	, "X_GRIDS"	, _TL("Independent Variable (per Grid and Cell)"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	//-----------------------------------------------------
-	CSG_Table	*pTable	= Parameters("X_TABLE")->asTable();
-
-	pTable->Add_Record()->Set_Value(0, 1000.0);
-	pTable->Add_Record()->Set_Value(0,  925.0);
-	pTable->Add_Record()->Set_Value(0,  850.0);
-	pTable->Add_Record()->Set_Value(0,  700.0);
-	pTable->Add_Record()->Set_Value(0,  600.0);
-	pTable->Add_Record()->Set_Value(0,  500.0);
-	pTable->Add_Record()->Set_Value(0,  400.0);
-	pTable->Add_Record()->Set_Value(0,  300.0);
-	pTable->Add_Record()->Set_Value(0,  250.0);
-	pTable->Add_Record()->Set_Value(0,  200.0);
-	pTable->Add_Record()->Set_Value(0,  150.0);
-	pTable->Add_Record()->Set_Value(0,  100.0);
-	pTable->Add_Record()->Set_Value(0,   70.0);
-	pTable->Add_Record()->Set_Value(0,   50.0);
-	pTable->Add_Record()->Set_Value(0,   30.0);
-	pTable->Add_Record()->Set_Value(0,   20.0);
-	pTable->Add_Record()->Set_Value(0,   10.0);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGrids_Trend::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("XSOURCE")) )
-	{
-		pParameters->Get_Parameter("X_TABLE")->Set_Enabled(pParameter->asInt() == 1);	// table
-		pParameters->Get_Parameter("X_GRIDS")->Set_Enabled(pParameter->asInt() == 2);	// grid list
-	}
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrids_Trend::On_Execute(void)
-{
-	int						Order, xSource, nGrids;
-	CSG_Table				*pXTable;
-	CSG_Grid				*pR2;
-	CSG_Parameter_Grid_List	*pYGrids, *pCoeff, *pXGrids;
-
-	//-----------------------------------------------------
-	pYGrids	= Parameters("Y_GRIDS")->asGridList();
-	pCoeff	= Parameters("COEFF"  )->asGridList();
-	pR2		= Parameters("R2"     )->asGrid();
-	pXGrids	= Parameters("X_GRIDS")->asGridList();
-	pXTable	= Parameters("X_TABLE")->asTable();
-	Order	= Parameters("ORDER"  )->asInt();
-	xSource	= Parameters("XSOURCE")->asInt();
-
-	//-----------------------------------------------------
-	nGrids	= pYGrids->Get_Count();
-
-	if( nGrids <= Order )
-	{
-		Error_Set(_TL("fitting a polynom of ith order needs at least i + 1 samples"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	switch( xSource )
-	{
-	case 0:	nGrids	= pYGrids->Get_Count();	break;	// list order
-	case 1:	nGrids	= pXTable->Get_Count();	break;	// table
-	case 2:	nGrids	= pXGrids->Get_Count();	break;	// grid list
-	}
-
-	if( nGrids < pXGrids->Get_Count() )
-	{
-		Error_Set(_TL("There are less predictor variables then dependent ones."));
-
-		return( false );
-	}
-
-	if( nGrids > pXGrids->Get_Count() )
-	{
-		Message_Add(_TL("Warning: there are more predictor variables then dependent ones, surplus will be ignored."));
-
-		nGrids	= pYGrids->Get_Count();
-	}
-
-	//-----------------------------------------------------
-	pCoeff->Del_Items();
-
-	for(int i=0; i<=Order; i++)
-	{
-		pCoeff->Add_Item(SG_Create_Grid(*Get_System()));
-		pCoeff->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s [%d]"), _TL("Polynomial Coefficient"), i + 1));
-	}
-
-	if( pR2 )
-	{
-		pR2->Set_Name(CSG_String::Format(SG_T("%s"), _TL("Determination Coefficients")));
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			CSG_Trend_Polynom	Trend;
-
-			Trend.Set_Order(Order);
-
-			for(int i=0; i<nGrids; i++)
-			{
-				if( !pYGrids->asGrid(i)->is_NoData(x, y) )
-				{
-					switch( xSource )
-					{
-					case 0:	// list order
-						Trend.Add_Data(i, pYGrids->asGrid(i)->asDouble(x, y));
-						break;
-
-					case 1:	// table
-						Trend.Add_Data(pXTable->Get_Record(i)->asDouble(0), pYGrids->asGrid(i)->asDouble(x, y));
-						break;
-
-					case 2:	// grid list
-						if( !pXGrids->asGrid(i)->is_NoData(x, y) )
-						{
-							Trend.Add_Data(pXGrids->asGrid(i)->asDouble(x, y), pYGrids->asGrid(i)->asDouble(x, y));
-						}
-						break;
-					}
-				}
-			}
-
-			if( Trend.Get_Trend() )
-			{
-				for(int iOrder=0; iOrder<Trend.Get_nCoefficients(); iOrder++)
-				{
-					pCoeff->asGrid(iOrder)->Set_Value(x, y, Trend.Get_Coefficient(iOrder));
-				}
-
-				if( pR2 )	pR2->Set_Value(x, y, Trend.Get_R2());
-			}
-			else
-			{
-				for(int iOrder=0; iOrder<Trend.Get_nCoefficients(); iOrder++)
-				{
-					pCoeff->asGrid(iOrder)->Set_NoData(x, y);
-				}
-
-				if( pR2 )	pR2->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/grids_trend_polynom.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/grids_trend_polynom.h
deleted file mode 100644
index ca09915..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/grids_trend_polynom.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/**********************************************************
- * Version $Id: grids_trend_polynom.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 grids_trend_polynom.h                 //
-//                                                       //
-//                 Copyright (C) 2011 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__grids_trend_polynom_H
-#define HEADER_INCLUDED__grids_trend_polynom_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGrids_Trend : public CSG_Module_Grid  
-{
-public:
-	CGrids_Trend(void);
-
-
-protected:
-
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__grids_trend_polynom_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.cpp
deleted file mode 100644
index 83ea87a..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.cpp
+++ /dev/null
@@ -1,585 +0,0 @@
-/**********************************************************
- * Version $Id: gw_multi_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                gw_multi_regression.cpp                //
-//                                                       //
-//                 Copyright (C) 2010 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 "gw_multi_regression.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SG_ARRAY_DELETE(A)		if( A ) { delete[](A); A = NULL; }
-#define SG_ARRAY_FREE(A)		if( A ) { SG_Free (A); A = NULL; }
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGW_Multi_Regression::CGW_Multi_Regression(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Geographically Weighted Multiple Regression"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Reference:\n"
-		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL("")
-	);
-
-	Parameters.Add_Parameters(
-		pNode	, "PREDICTORS"	, _TL("Predictors"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		NULL	, "TARGET"		, _TL("Target Grids"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("user defined"),
-			_TL("grid")
-		), 0
-	);
-
-	m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid")	, _TL("")), false);
-	m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid")			, _TL("")), false);
-
-	m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY")   , _TL("Quality")  , false);
-	m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false);
-
-	//-----------------------------------------------------
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	);
-
-	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
-	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pSearch	= Parameters.Add_Node(
-		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
-		_TL("")
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local"),
-			_TL("global")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
-		_TL("local maximum search distance given in map units"),
-		PARAMETER_TYPE_Double	, 1000.0, 0, true
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("maximum number of nearest points"),
-			_TL("all points within search distance")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
-		_TL("minimum number of points to use"),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
-		_TL("maximum number of nearest points"),
-		PARAMETER_TYPE_Int, 20, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("all directions"),
-			_TL("quadrants")
-		)
-	);
-
-	//-----------------------------------------------------
-	m_iPredictor	= NULL;
-	m_pSlopes		= NULL;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Multi_Regression::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( m_Grid_Target.On_User_Changed(pParameters, pParameter) )
-	{
-		return( true );
-	}
-
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) )
-	{
-		CSG_Shapes		*pPoints		= pParameters->Get_Parameter("POINTS"    )->asShapes();
-		CSG_Parameters	*pAttributes	= pParameters->Get_Parameter("PREDICTORS")->asParameters();
-
-		pAttributes->Destroy();
-		pAttributes->Set_Name(_TL("Predictors"));
-
-		for(int i=0; pPoints && i<pPoints->Get_Field_Count(); i++)
-		{
-			switch( pPoints->Get_Field_Type(i) )
-			{
-			default:	// not numeric
-				break;
-
-			case SG_DATATYPE_Byte:
-			case SG_DATATYPE_Char:
-			case SG_DATATYPE_Word:
-			case SG_DATATYPE_Short:
-			case SG_DATATYPE_DWord:
-			case SG_DATATYPE_Int:
-			case SG_DATATYPE_ULong:
-			case SG_DATATYPE_Long:
-			case SG_DATATYPE_Float:
-			case SG_DATATYPE_Double:
-				pAttributes->Add_Value(
-					NULL, SG_Get_String(i, 0), pPoints->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false
-				);
-				break;
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-int CGW_Multi_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
-	{
-		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
-	{
-		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
-		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
-	}
-
-	m_Weighting.Enable_Parameters(pParameters);
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression::Get_Predictors(void)
-{
-	int				i;
-	CSG_Shapes		*pPoints		= Parameters("POINTS")		->asShapes();
-	CSG_Parameters	*pAttributes	= Parameters("PREDICTORS")	->asParameters();
-
-	m_nPredictors	= 0;
-	m_iPredictor	= new int[pPoints->Get_Field_Count()];
-
-	for(i=0; i<pAttributes->Get_Count(); i++)
-	{
-		if( pAttributes->Get_Parameter(i)->asBool() )
-		{
-			m_iPredictor[m_nPredictors++]	= CSG_String(pAttributes->Get_Parameter(i)->Get_Identifier()).asInt();
-		}
-	}
-
-	CSG_Parameters	*pGrids	= Get_Parameters("GRID"), Tmp;
-
-	Tmp.Assign(pGrids);
-
-	pGrids->Create(this, Tmp.Get_Name(), Tmp.Get_Description(), Tmp.Get_Identifier(), false);
-	m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY")   , _TL("Quality")  , false);
-	m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false);
-
-	pGrids->Get_Parameter("QUALITY")->Get_Parent()->asGrid_System()->Assign(*Tmp("QUALITY")->Get_Parent()->asGrid_System());
-	pGrids->Get_Parameter("QUALITY")  ->Set_Value(Tmp("QUALITY")  ->asGrid());
-	pGrids->Get_Parameter("INTERCEPT")->Set_Value(Tmp("INTERCEPT")->asGrid());
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		m_Grid_Target.Add_Grid_Parameter(SG_Get_String(i, 0),
-			CSG_String::Format(SG_T("%s [%s]"), _TL("Slope"), pPoints->Get_Field_Name(m_iPredictor[i])), false
-		);
-
-		if( Tmp(SG_Get_String(i, 0)) )
-		{
-			pGrids->Get_Parameter(SG_Get_String(i, 0))->Set_Value(Tmp(SG_Get_String(i, 0))->asGrid());
-		}
-	}
-
-	return( m_nPredictors > 0 );
-}
-
-//---------------------------------------------------------
-void CGW_Multi_Regression::Finalize(void)
-{
-	SG_ARRAY_DELETE(m_iPredictor);
-
-	SG_ARRAY_FREE  (m_pSlopes);
-
-	m_Search.Destroy();
-
-	m_y.Destroy();
-	m_z.Destroy();
-	m_w.Destroy();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression::On_Execute(void)
-{
-	//-----------------------------------------------------
-	m_pPoints		= Parameters("POINTS"           )->asShapes();
-	m_iDependent	= Parameters("DEPENDENT"        )->asInt   ();
-
-	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
-	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
-					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
-	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
-					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
-	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
-
-	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	if( !Get_Predictors() )
-	{
-		Finalize();
-
-		return( false );
-	}
-
-	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
-	{
-		Finalize();
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int		i;
-
-	m_pQuality		= NULL;
-	m_pIntercept	= NULL;
-	m_pSlopes		= (CSG_Grid **)SG_Calloc(m_nPredictors, sizeof(CSG_Grid *));
-
-	switch( Parameters("TARGET")->asInt() )
-	{
-	case 0:	// user defined...
-		if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") )
-		{
-			m_pQuality		= m_Grid_Target.Get_User(SG_T("QUALITY"  ));
-			m_pIntercept	= m_Grid_Target.Get_User(SG_T("INTERCEPT"));
-
-			for(i=0; i<m_nPredictors; i++)
-			{
-				m_pSlopes[i]	= m_Grid_Target.Get_User(SG_Get_String(i, 0));
-			}
-		}
-		break;
-
-	case 1:	// grid...
-		if( Dlg_Parameters("GRID") )
-		{
-			m_pQuality		= m_Grid_Target.Get_Grid(SG_T("QUALITY"  ));
-			m_pIntercept	= m_Grid_Target.Get_Grid(SG_T("INTERCEPT"));
-
-			for(i=0; i<m_nPredictors; i++)
-			{
-				m_pSlopes[i]	= m_Grid_Target.Get_Grid(SG_Get_String(i, 0));
-			}
-		}
-		break;
-	}
-
-	if( m_pQuality == NULL )
-	{
-		Finalize();
-
-		return( false );
-	}
-
-	m_pQuality  ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Quality")));
-	m_pIntercept->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Intercept")));
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		m_pSlopes[i]->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), m_pPoints->Get_Field_Name(m_iPredictor[i])));
-	}
-
-	//-----------------------------------------------------
-	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
-
-	m_y.Create(1 + m_nPredictors, nPoints_Max);
-	m_z.Create(nPoints_Max);
-	m_w.Create(nPoints_Max);
-
-	//-----------------------------------------------------
-	for(int y=0; y<m_pIntercept->Get_NY() && Set_Progress(y, m_pIntercept->Get_NY()); y++)
-	{
-		for(int x=0; x<m_pIntercept->Get_NX(); x++)
-		{
-			if( !Get_Regression(x, y) )
-			{
-				m_pQuality  ->Set_NoData(x, y);
-				m_pIntercept->Set_NoData(x, y);
-
-				for(i=0; i<m_nPredictors; i++)
-				{
-					m_pSlopes[i]->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Finalize();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Multi_Regression::Set_Variables(int x, int y)
-{
-	int			iPoint, jPoint, nPoints, iPredictor;
-	TSG_Point	Point;
-	CSG_Shape	*pPoint;
-
-	Point	= m_pIntercept->Get_System().Get_Grid_to_World(x, y);
-	nPoints	= m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
-
-	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
-	{
-		if( m_Search.is_Okay() )
-		{
-			double	ix, iy, iz;
-
-			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
-
-			pPoint	= m_pPoints->Get_Shape((int)iz);
-		}
-		else
-		{
-			pPoint	= m_pPoints->Get_Shape(iPoint);
-		}
-
-		if( !pPoint->is_NoData(m_iDependent) )
-		{
-			m_z[jPoint]	= pPoint->asDouble(m_iDependent);
-			m_w[jPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
-
-			for(iPredictor=0; iPredictor<m_nPredictors; iPredictor++)
-			{
-				if( !pPoint->is_NoData(m_iPredictor[iPredictor]) )
-				{
-					m_y[jPoint][iPredictor]	= pPoint->asDouble(m_iPredictor[iPredictor]);
-				}
-				else
-				{
-					iPredictor	= m_nPredictors + 1;
-				}
-			}
-
-			if( iPredictor == m_nPredictors )
-			{
-				jPoint++;
-			}
-		}
-	}
-
-	return( jPoint );
-}
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression::Get_Regression(int x, int y)
-{
-	int		nPoints	= Set_Variables(x, y);
-
-	if( nPoints < m_nPoints_Min )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			i;
-	double		zMean, rss, tss;
-	CSG_Vector	b, z;
-	CSG_Matrix	Y, YtW;
-
-	//-----------------------------------------------------
-	z  .Create(nPoints);
-	Y  .Create(1 + m_nPredictors, nPoints);
-	YtW.Create(nPoints, 1 + m_nPredictors);
-
-	for(i=0, zMean=0.0; i<nPoints; i++)
-	{
-		Y  [i][0]	= 1.0;
-		YtW[0][i]	= m_w[i];
-
-		for(int j=0; j<m_nPredictors; j++)
-		{
-			Y  [i][j + 1]	= m_y[i][j];
-			YtW[j + 1][i]	= m_y[i][j] * m_w[i];
-		}
-
-		zMean		+= (z[i] = m_z[i]);
-	}
-
-	//-----------------------------------------------------
-	b		= (YtW * Y).Get_Inverse() * (YtW * z);
-
-	zMean	/= nPoints;
-
-	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
-	{
-		double	zr	= b[0];
-
-		for(int j=0; j<m_nPredictors; j++)
-		{
-			zr	+= b[j + 1] * m_y[i][j];
-		}
-
-		rss	+= m_w[i] * SG_Get_Square(m_z[i] - zr);
-		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
-	}
-
-	m_pQuality  ->Set_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0);
-
-	m_pIntercept->Set_Value(x, y, b[0]);
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		m_pSlopes[i]->Set_Value(x, y, b[i + 1]);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.h
deleted file mode 100644
index caccfc7..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/**********************************************************
- * Version $Id: gw_multi_regression.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 gw_multi_regression.h                 //
-//                                                       //
-//                 Copyright (C) 2010 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__gw_multi_regression_H
-#define HEADER_INCLUDED__gw_multi_regression_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGW_Multi_Regression : public CSG_Module
-{
-public:
-	CGW_Multi_Regression(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	int							m_iDependent, *m_iPredictor, m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction;
-
-	double						m_Radius;
-
-	CSG_Parameters_Grid_Target	m_Grid_Target;
-
-	CSG_Distance_Weighting		m_Weighting;
-
-	CSG_PRQuadTree				m_Search;
-
-	CSG_Vector					m_z, m_w;
-
-	CSG_Matrix					m_y;
-
-	CSG_Shapes					*m_pPoints;
-
-	CSG_Grid					*m_pQuality, *m_pIntercept, **m_pSlopes;
-
-
-	void						Finalize				(void);
-
-	bool						Get_Predictors			(void);
-
-	int							Set_Variables			(int x, int y);
-
-	bool						Get_Regression			(int x, int y);
-
-	bool						Set_Residuals			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__gw_multi_regression_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.cpp
deleted file mode 100644
index 4958df5..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.cpp
+++ /dev/null
@@ -1,739 +0,0 @@
-/**********************************************************
- * Version $Id: gw_multi_regression_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             gw_multi_regression_grid.cpp              //
-//                                                       //
-//                 Copyright (C) 2010 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 "gw_multi_regression_grid.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define GRID_SET_NODATA(g, x, y)	if( g ) { g->Set_NoData(x, y); }
-#define GRID_SET_VALUE(g, x, y, z)	if( g ) { g->Set_Value(x, y, z); }
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGW_Multi_Regression_Grid::CGW_Multi_Regression_Grid(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("GWR Gridding (Points/Grids)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"References:\n"
-		"- Fotheringham, S.A., Brunsdon, C., Charlton, M. (2002):"
-		" Geographically Weighted Regression: the analysis of spatially varying relationships. John Wiley & Sons."
-		" <a target=\"_blank\" href=\"http://onlinelibrary.wiley.com/doi/10.1111/j.1538-4632.2003.tb01114.x/abstract\">online</a>.\n"
-		"\n"
-		"- Fotheringham, S.A., Charlton, M., Brunsdon, C. (1998):"
-		" Geographically weighted regression: a natural evolution of the expansion method for spatial data analysis."
-		" Environment and Planning A 30(11), 1905�1927."
-		" <a target=\"_blank\" href=\"http://www.envplan.com/abstract.cgi?id=a301905\">online</a>.\n"
-		"\n"
-		"- Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "PREDICTORS"	, _TL("Predictors"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REGRESSION"	, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "QUALITY"		, _TL("Coefficient of Determination"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "MODEL"		, _TL("Regression Parameters"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "MODEL_OUT"	, _TL("Output of Regression Parameters"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL("")
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "RESIDUALS"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Choice(
-		NULL	, "RESOLUTION"	, _TL("Model Resolution"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("same as predictors"),
-			_TL("user defined")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RESOLUTION_VAL"	, _TL("Resolution"),
-		_TL("map units"),
-		PARAMETER_TYPE_Double	, 1.0, 0.0, true
-	);
-
-	//-----------------------------------------------------
-	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
-	m_Weighting.Create_Parameters(&Parameters, false);
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pSearch	= Parameters.Add_Node(
-		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
-		_TL("")
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local"),
-			_TL("global")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
-		_TL("local maximum search distance given in map units"),
-		PARAMETER_TYPE_Double	, 1000.0, 0, true
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("maximum number of nearest points"),
-			_TL("all points within search distance")
-		), 0
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
-		_TL("minimum number of points to use"),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
-		_TL("maximum number of nearest points"),
-		PARAMETER_TYPE_Int, 50, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("all directions"),
-			_TL("quadrants")
-		)
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Multi_Regression_Grid::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) && pParameter->asShapes() )
-	{
-		double	d	= pParameter->asShapes()->Get_Extent().Get_XRange() / 20.0;
-
-		pParameters->Get_Parameter("RESOLUTION_VAL")->Set_Value(d);
-	}
-
-	return( 1 );
-}
-
-//---------------------------------------------------------
-int CGW_Multi_Regression_Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("RESOLUTION")) )
-	{
-		pParameters->Get_Parameter("RESOLUTION_VAL"   )->Set_Enabled(pParameter->asInt() == 1);
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
-	{
-		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
-		pParameters->Get_Parameter("SEARCH_POINTS_MIN")->Set_Enabled(pParameter->asInt() == 0);	// local
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
-	{
-		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
-		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
-	}
-
-	m_Weighting.Enable_Parameters(pParameters);
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::On_Execute(void)
-{
-	int		i;
-
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pPredictors	= Parameters("PREDICTORS")->asGridList();
-
-	if( !Initialize(Parameters("POINTS")->asShapes(), Parameters("DEPENDENT")->asInt(), pPredictors) )
-	{
-		Finalize();
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Grid	Quality;
-
-	m_dimModel	= *Get_System();
-
-	if( Parameters("RESOLUTION")->asInt() == 1 && Parameters("RESOLUTION_VAL")->asDouble() > Get_Cellsize() )
-	{
-		CSG_Rect	r(Get_System()->Get_Extent()); r.Inflate(0.5 * Parameters("RESOLUTION_VAL")->asDouble(), false);
-
-		m_dimModel.Assign(Parameters("RESOLUTION_VAL")->asDouble(), r);
-
-		Quality.Create(m_dimModel);
-		m_pQuality	= &Quality;
-	}
-	else
-	{
-		m_pQuality	= Parameters("QUALITY")->asGrid();
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("upsetting model domain"));
-
-	m_pPredictors	= (CSG_Grid **)SG_Calloc(m_nPredictors    , sizeof(CSG_Grid *));
-	m_pModel		= (CSG_Grid **)SG_Calloc(m_nPredictors + 1, sizeof(CSG_Grid *));
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		if( m_dimModel.Get_Cellsize() > Get_Cellsize() )	// scaling
-		{
-			m_pPredictors[i]	= SG_Create_Grid(m_dimModel);
-			m_pPredictors[i]	->Assign(pPredictors->asGrid(i), GRID_INTERPOLATION_NearestNeighbour);	// GRID_INTERPOLATION_Mean_Cells
-		}
-		else
-		{
-			m_pPredictors[i]	= pPredictors->asGrid(i);
-		}
-
-		m_pModel     [i]	= SG_Create_Grid(m_dimModel);
-		m_pModel     [i]	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPredictors->asGrid(i)->Get_Name(), _TL("Factor")));
-	}
-
-	m_pModel[m_nPredictors]	= SG_Create_Grid(m_dimModel);
-	m_pModel[m_nPredictors]	->Set_Name(_TL("Intercept"));
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("model creation"));
-
-	bool	bResult	= Get_Model();
-
-	//-----------------------------------------------------
-	if( m_dimModel.Get_Cellsize() > Get_Cellsize() )	// scaling
-	{
-		for(i=0; i<m_nPredictors; i++)
-		{
-			delete(m_pPredictors[i]);
-
-			m_pPredictors[i]	= pPredictors->asGrid(i);
-		}
-	}
-
-	//-----------------------------------------------------
-	if( bResult )
-	{
-		Process_Set_Text(_TL("model application"));
-
-		bResult	= Set_Model();
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("MODEL_OUT")->asBool() )
-	{
-		CSG_Parameter_Grid_List	*pModel	= Parameters("MODEL")->asGridList();
-
-		pModel->Del_Items();
-		pModel->Add_Item(m_pModel[m_nPredictors]);
-
-		for(i=0; i<m_nPredictors; i++)
-		{
-			pModel->Add_Item(m_pModel[i]);
-		}
-	}
-	else
-	{
-		for(i=0; i<=m_nPredictors; i++)
-		{
-			delete(m_pModel[i]);
-		}
-	}
-
-	SG_FREE_SAFE(m_pModel);
-	SG_FREE_SAFE(m_pPredictors);
-
-	Finalize();
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::Initialize(CSG_Shapes *pPoints, int iDependent, CSG_Parameter_Grid_List *pPredictors)
-{
-	//-----------------------------------------------------
-	if( (m_nPredictors = pPredictors->Get_Count()) <= 0 )
-	{
-		return( false );
-	}
-
-	if( !pPoints->Get_Extent().Intersects(Get_System()->Get_Extent()) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int	iPredictor, Interpolation	= GRID_INTERPOLATION_BSpline;
-
-	m_Points.Create   (SHAPE_TYPE_Point);
-	m_Points.Set_Name (Parameters("DEPENDENT")->asString());
-	m_Points.Add_Field(Parameters("DEPENDENT")->asString(), SG_DATATYPE_Double);
-
-	for(iPredictor=0; iPredictor<pPredictors->Get_Count(); iPredictor++)
-	{
-		m_Points.Add_Field(pPredictors->asGrid(iPredictor)->Get_Name(), SG_DATATYPE_Double);
-	}
-
-	//-----------------------------------------------------
-	for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
-	{
-		CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
-
-		if( !pPoint->is_NoData(iDependent) )
-		{
-			CSG_Vector	z(1 + m_nPredictors);	z[0]	= pPoint->asDouble(iDependent);
-			TSG_Point	Point	= pPoint->Get_Point(0);
-			bool		bAdd	= true;
-
-			for(iPredictor=0; bAdd && iPredictor<m_nPredictors; iPredictor++)
-			{
-				if( !pPredictors->asGrid(iPredictor)->Get_Value(Point, z[iPredictor + 1], Interpolation) )
-				{
-					bAdd	= false;
-				}
-			}
-
-			if( bAdd )
-			{
-				(pPoint	= m_Points.Add_Shape())->Add_Point(Point);
-
-				for(iPredictor=0; iPredictor<=m_nPredictors; iPredictor++)
-				{
-					pPoint->Set_Value(iPredictor, z[iPredictor]);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
-	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
-					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
-	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
-					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
-	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
-
-	m_Weighting.Set_Parameters(&Parameters);
-
-	return( m_Points.Get_Count() > m_nPredictors
-		&& ((m_nPoints_Max <= 0 && m_Radius <= 0.0) || m_Search.Create(&m_Points, -1))
-	);
-}
-
-//---------------------------------------------------------
-void CGW_Multi_Regression_Grid::Finalize(void)
-{
-	m_Points.Destroy();
-	m_Search.Destroy();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::Get_Model(void)
-{
-	//-----------------------------------------------------
-	for(int y=0; y<m_dimModel.Get_NY() && Set_Progress(y, m_dimModel.Get_NY()); y++)
-	{
-		for(int x=0; x<m_dimModel.Get_NX(); x++)
-		{
-			double		q;
-			CSG_Vector	b;
-
-			if( Get_Regression(x, y, q, b) )
-			{
-				m_pQuality->Set_Value(x, y, q);
-
-				m_pModel[m_nPredictors]->Set_Value(x, y, b[0]);
-
-				for(int i=0; i<m_nPredictors; i++)
-				{
-					m_pModel[i]->Set_Value(x, y, b[i + 1]);
-				}
-			}
-			else
-			{
-				m_pQuality->Set_NoData(x, y);
-
-				for(int i=0; i<=m_nPredictors; i++)
-				{
-					m_pModel[i]->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::Get_Regression(int x, int y, double &Quality, CSG_Vector &b)
-{
-	//-----------------------------------------------------
-	int			i, nPoints;
-	double		zMean, zr, rss, tss;
-	CSG_Vector	z, w;
-	CSG_Matrix	Y, YtW;
-
-	if( (nPoints = Get_Variables(x, y, z, w, Y)) <= m_nPredictors )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	YtW.Create(nPoints, 1 + m_nPredictors);
-
-	for(i=0, zMean=0.0; i<nPoints; i++)
-	{
-		zMean		+= z[i];
-		YtW[0][i]	 = w[i];
-
-		for(int j=1; j<=m_nPredictors; j++)
-		{
-			YtW[j][i]	= Y[i][j] * w[i];
-		}
-	}
-
-	//-----------------------------------------------------
-	b		= (YtW * Y).Get_Inverse() * (YtW * z);
-
-	zMean	/= nPoints;
-
-	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
-	{
-		zr	= b[0];
-
-		for(int j=1; j<=m_nPredictors; j++)
-		{
-			zr	+= b[j] * Y[i][j];
-		}
-
-		rss	+= w[i] * SG_Get_Square(z[i] - zr);
-		tss	+= w[i] * SG_Get_Square(z[i] - zMean);
-	}
-
-	Quality	= tss > 0.0 ? (tss - rss) / tss : 0.0;
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-int CGW_Multi_Regression_Grid::Get_Variables(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y)
-{
-	TSG_Point	Point	= m_dimModel.Get_Grid_to_World(x, y);
-	int			nPoints	= m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_Points.Get_Count();
-
-	z.Create(nPoints);
-	w.Create(nPoints);
-	Y.Create(1 + m_nPredictors, nPoints);
-
-	for(int iPoint=0; iPoint<nPoints; iPoint++)
-	{
-		double	ix, iy, iz;
-
-		CSG_Shape	*pPoint	= m_Search.is_Okay() && m_Search.Get_Selected_Point(iPoint, ix, iy, iz)
-			? m_Points.Get_Shape((int)iz)
-			: m_Points.Get_Shape(iPoint);
-
-		z[iPoint]		= pPoint->asDouble(0);
-		w[iPoint]		= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
-		Y[iPoint][0]	= 1.0;
-
-		for(int iPredictor=1; iPredictor<=m_nPredictors; iPredictor++)
-		{
-			Y[iPoint][iPredictor]	= pPoint->asDouble(iPredictor);
-		}
-	}
-
-	return( nPoints );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::Set_Model(double x, double y, double &Value)
-{
-	if( !m_pModel[m_nPredictors]->Get_Value(x, y, Value, GRID_INTERPOLATION_BSpline) )
-	{
-		return( false );
-	}
-
-	double	Model, Predictor;
-
-	for(int i=0; i<m_nPredictors; i++)
-	{
-		if( !m_pModel     [i]->Get_Value(x, y, Model    , GRID_INTERPOLATION_BSpline)
-		||  !m_pPredictors[i]->Get_Value(x, y, Predictor, GRID_INTERPOLATION_NearestNeighbour) )
-		{
-			return( false );
-		}
-
-		Value	+= Model * Predictor;
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::Set_Model(void)
-{
-	CSG_Grid	*pRegression	= Parameters("REGRESSION")->asGrid();
-	CSG_Grid	*pQuality		= Parameters("QUALITY"   )->asGrid();
-
-	pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"    ), m_Points.Get_Name(), _TL("GWR")));
-	pQuality   ->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_Points.Get_Name(), _TL("GWR"), _TL("Quality")));
-
-	if( m_pQuality == Parameters("QUALITY")->asGrid() )
-	{
-		pQuality	= NULL;
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		double	p_y	= Get_YMin() + y * Get_Cellsize();
-
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	Value, p_x	= Get_XMin() + x * Get_Cellsize();
-
-			if( Set_Model(p_x, p_y, Value) )
-			{
-				GRID_SET_VALUE(pRegression, x, y, Value);
-				GRID_SET_VALUE(pQuality   , x, y, m_pQuality->Get_Value(p_x, p_y));
-			}
-			else
-			{
-				GRID_SET_NODATA(pRegression, x, y);
-				GRID_SET_NODATA(pQuality   , x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Set_Residuals();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Grid::Set_Residuals(void)
-{
-	CSG_Shapes	*pResiduals	= Parameters("RESIDUALS")->asShapes();
-
-	if( !pResiduals )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_Points.Get_Name(), _TL("Residuals")));
-	pResiduals->Add_Field(m_Points.Get_Field_Name(0), SG_DATATYPE_Double);
-	pResiduals->Add_Field("TREND"	, SG_DATATYPE_Double);
-	pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
-
-	//-------------------------------------------------
-	for(int iShape=0; iShape<m_Points.Get_Count() && Set_Progress(iShape, m_Points.Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape	= m_Points.Get_Shape(iShape);
-		double		 zShape	= pShape->asDouble(0);
-
-		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-		{
-			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-			{
-				double	zRegression;
-
-				TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
-
-				if( Set_Model(Point.x, Point.y, zRegression) )
-				{
-					CSG_Shape	*pResidual	= pResiduals->Add_Shape();
-
-					pResidual->Add_Point(Point);
-					pResidual->Set_Value(0, zShape);
-					pResidual->Set_Value(1, zRegression);
-					pResidual->Set_Value(2, zShape - zRegression);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.h
deleted file mode 100644
index 010f993..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/**********************************************************
- * Version $Id: gw_multi_regression_grid.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              gw_multi_regression_grid.h               //
-//                                                       //
-//                 Copyright (C) 2010 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__gw_multi_regression_grid_H
-#define HEADER_INCLUDED__gw_multi_regression_grid_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGW_Multi_Regression_Grid : public CSG_Module_Grid
-{
-public:
-	CGW_Multi_Regression_Grid(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
-
-
-protected:
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-
-private:
-
-	int							m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction;
-
-	CSG_Grid					**m_pPredictors, **m_pModel, *m_pQuality;
-
-	CSG_Grid_System				m_dimModel;
-
-	double						m_Radius;
-
-	CSG_Distance_Weighting		m_Weighting;
-
-	CSG_PRQuadTree				m_Search;
-
-	CSG_Shapes					m_Points;
-
-
-	bool						Initialize				(CSG_Shapes *pPoints, int iDependent, CSG_Parameter_Grid_List *pPredictors);
-	void						Finalize				(void);
-
-	bool						Get_Model				(void);
-	bool						Get_Regression			(int x, int y, double &Quality, CSG_Vector &b);
-	int							Get_Variables			(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y);
-
-	bool						Set_Model				(void);
-	bool						Set_Model				(double x, double y, double &Value);
-
-	bool						Set_Residuals			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__gw_multi_regression_grid_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.cpp
deleted file mode 100644
index 737018f..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.cpp
+++ /dev/null
@@ -1,524 +0,0 @@
-/**********************************************************
- * Version $Id: gw_multi_regression_points.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             gw_multi_regression_points.cpp            //
-//                                                       //
-//                 Copyright (C) 2010 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 "gw_multi_regression_points.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SG_ARRAY_FREE(A)		if( A ) { SG_Free (A); A = NULL; }
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGW_Multi_Regression_Points::CGW_Multi_Regression_Points(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Geographically Weighted Multiple Regression (Points)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Reference:\n"
-		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL("")
-	);
-
-	Parameters.Add_Parameters(
-		pNode	, "PREDICTORS"	, _TL("Predictors"),
-		_TL("")
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "REGRESSION"		, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Point
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	);
-
-	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
-	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pSearch	= Parameters.Add_Node(
-		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
-		_TL("")
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local"),
-			_TL("global")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
-		_TL("local maximum search distance given in map units"),
-		PARAMETER_TYPE_Double	, 1000.0, 0, true
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("maximum number of nearest points"),
-			_TL("all points within search distance")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
-		_TL("minimum number of points to use"),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
-		_TL("maximum number of nearest points"),
-		PARAMETER_TYPE_Int, 20, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("all directions"),
-			_TL("quadrants")
-		)
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Multi_Regression_Points::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) )
-	{
-		CSG_Shapes		*pPoints		= pParameters->Get_Parameter("POINTS")		->asShapes();
-		CSG_Parameters	*pAttributes	= pParameters->Get_Parameter("PREDICTORS")	->asParameters();
-
-		pAttributes->Destroy();
-		pAttributes->Set_Name(_TL("Predictors"));
-
-		for(int i=0; pPoints && i<pPoints->Get_Field_Count(); i++)
-		{
-			if( SG_Data_Type_is_Numeric(pPoints->Get_Field_Type(i)) )
-			{
-				pAttributes->Add_Value(
-					NULL, SG_Get_String(i, 0), pPoints->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false
-				);
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-int CGW_Multi_Regression_Points::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
-	{
-		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
-	{
-		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
-		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
-	}
-
-	m_Weighting.Enable_Parameters(pParameters);
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Points::Get_Predictors(void)
-{
-	int				i, iDependent, *Predictor;
-	CSG_Shapes		*pPoints;
-	CSG_Parameters	*pAttributes;
-
-	//-----------------------------------------------------
-	m_pPoints		= Parameters("REGRESSION"       )->asShapes();
-
-	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
-	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
-					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
-	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
-					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
-	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
-
-	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	iDependent		= Parameters("DEPENDENT" )->asInt();
-	pPoints			= Parameters("POINTS"    )->asShapes();;
-	pAttributes		= Parameters("PREDICTORS")->asParameters();
-
-	m_pPoints->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("GWR"), pPoints->Get_Field_Name(iDependent)));
-	m_pPoints->Add_Field(pPoints->Get_Field_Name(iDependent), SG_DATATYPE_Double);
-
-	m_nPredictors	= 0;
-	Predictor		= new int[pPoints->Get_Field_Count()];
-
-	for(i=0; i<pAttributes->Get_Count(); i++)
-	{
-		CSG_Parameter	*pAttribute	= pAttributes->Get_Parameter(i);
-
-		if( pAttribute->asBool() )
-		{
-			Predictor[m_nPredictors++]	= CSG_String(pAttribute->Get_Identifier()).asInt();
-
-			m_pPoints->Add_Field(CSG_String::Format(SG_T("P%d %s"), m_nPredictors, pAttribute->Get_Name()), SG_DATATYPE_Double);
-		}
-	}
-
-	if( m_nPredictors == 0 )
-	{
-		delete[](Predictor);
-
-		Error_Set(_TL("no predictors have been selected"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	m_pPoints->Add_Field(SG_T("R2")			, SG_DATATYPE_Double);
-	m_pPoints->Add_Field(SG_T("REGRESSION")	, SG_DATATYPE_Double);
-	m_pPoints->Add_Field(SG_T("RESIDUAL")	, SG_DATATYPE_Double);
-	m_pPoints->Add_Field(SG_T("INTERCEPT")	, SG_DATATYPE_Double);
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		m_pPoints->Add_Field(CSG_String::Format(SG_T("R%d"), 1 + i), SG_DATATYPE_Double);
-	}
-
-	for(int iPoint=0; iPoint<pPoints->Get_Count(); iPoint++)
-	{
-		CSG_Shape	*pPoint	= pPoints->Get_Shape(iPoint);
-
-		bool	bAdd	= !pPoint->is_NoData(iDependent);
-
-		for(i=0; bAdd && i<m_nPredictors; i++)
-		{
-			if( pPoint->is_NoData(Predictor[i]) )
-			{
-				bAdd	= false;
-			}
-		}
-
-		if( bAdd )
-		{
-			CSG_Shape	*pAdd	= m_pPoints->Add_Shape();
-
-			pAdd->Add_Point(pPoint->Get_Point(0));
-
-			pAdd->Set_Value(0, pPoint->asDouble(iDependent));
-
-			for(i=0; i<m_nPredictors; i++)
-			{
-				pAdd->Set_Value(1 + i, pPoint->asDouble(Predictor[i]));
-			}
-		}
-	}
-
-	delete[](Predictor);
-
-	//-----------------------------------------------------
-	if( m_pPoints->Get_Count() == 0 )
-	{
-		Error_Set(_TL("invalid data"));
-
-		return( false );
-	}
-
-	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
-	{
-		Error_Set(_TL("failed to create searche engine"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
-
-	m_y.Create(1 + m_nPredictors, nPoints_Max);
-	m_z.Create(nPoints_Max);
-	m_w.Create(nPoints_Max);
-
-	return( true );
-}
-
-//---------------------------------------------------------
-void CGW_Multi_Regression_Points::Finalize(void)
-{
-	m_Search.Destroy();
-
-	m_y.Destroy();
-	m_z.Destroy();
-	m_w.Destroy();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Points::On_Execute(void)
-{
-	//-----------------------------------------------------
-	if( !Get_Predictors() )
-	{
-		Finalize();
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(int iPoint=0; iPoint<m_pPoints->Get_Count() && Set_Progress(iPoint, m_pPoints->Get_Count()); iPoint++)
-	{
-		if( !Get_Regression(m_pPoints->Get_Shape(iPoint)) )
-		{
-		}
-	}
-
-	//-----------------------------------------------------
-	Finalize();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Multi_Regression_Points::Set_Variables(const TSG_Point &Point)
-{
-	int			iPoint, jPoint, nPoints, iPredictor;
-	CSG_Shape	*pPoint;
-
-	nPoints	= m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
-
-	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
-	{
-		if( m_Search.is_Okay() )
-		{
-			double	ix, iy, iz;
-
-			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
-
-			pPoint	= m_pPoints->Get_Shape((int)iz);
-		}
-		else
-		{
-			pPoint	= m_pPoints->Get_Shape(iPoint);
-		}
-
-		m_z[iPoint]	= pPoint->asDouble(0);
-		m_w[iPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
-
-		for(iPredictor=0; iPredictor<m_nPredictors; iPredictor++)
-		{
-			m_y[iPoint][iPredictor]	= pPoint->asDouble(1 + iPredictor);
-		}
-	}
-
-	return( nPoints );
-}
-
-//---------------------------------------------------------
-bool CGW_Multi_Regression_Points::Get_Regression(CSG_Shape *pPoint)
-{
-	int		nPoints	= Set_Variables(pPoint->Get_Point(0));
-
-	if( nPoints < m_nPoints_Min )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			i;
-	double		zMean, rss, tss;
-	CSG_Vector	b, z;
-	CSG_Matrix	Y, YtW;
-
-	//-----------------------------------------------------
-	z  .Create(nPoints);
-	Y  .Create(1 + m_nPredictors, nPoints);
-	YtW.Create(nPoints, 1 + m_nPredictors);
-
-	for(i=0, zMean=0.0; i<nPoints; i++)
-	{
-		Y  [i][0]	= 1.0;
-		YtW[0][i]	= m_w[i];
-
-		for(int j=0; j<m_nPredictors; j++)
-		{
-			Y  [i][j + 1]	= m_y[i][j];
-			YtW[j + 1][i]	= m_y[i][j] * m_w[i];
-		}
-
-		zMean		+= (z[i] = m_z[i]);
-	}
-
-	//-----------------------------------------------------
-	b		= (YtW * Y).Get_Inverse() * (YtW * m_z);
-
-	zMean	/= nPoints;
-
-	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
-	{
-		double	zr	= b[0];
-
-		for(int j=0; j<m_nPredictors; j++)
-		{
-			zr	+= b[j + 1] * m_y[i][j];
-		}
-
-		rss	+= m_w[i] * SG_Get_Square(m_z[i] - zr);
-		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
-	}
-
-	//-----------------------------------------------------
-	double	Regression	= b[0];
-
-	for(i=1; i<=m_nPredictors; i++)
-	{
-		Regression	+= b[i] * pPoint->asDouble(i);
-	}
-
-	//-----------------------------------------------------
-	pPoint->Set_Value(1 + m_nPredictors, tss > 0.0 ? (tss - rss) / tss : 0.0);	// R2
-	pPoint->Set_Value(2 + m_nPredictors, Regression);							// Regression
-	pPoint->Set_Value(3 + m_nPredictors, pPoint->asDouble(0) - Regression);		// Residual
-
-	for(i=0; i<=m_nPredictors; i++)
-	{
-		pPoint->Set_Value(4 + m_nPredictors + i, b[i]);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.h
deleted file mode 100644
index 5ee1439..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/**********************************************************
- * Version $Id: gw_multi_regression_points.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              gw_multi_regression_points.h             //
-//                                                       //
-//                 Copyright (C) 2010 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__gw_multi_regression_points_H
-#define HEADER_INCLUDED__gw_multi_regression_points_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGW_Multi_Regression_Points : public CSG_Module
-{
-public:
-	CGW_Multi_Regression_Points(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	int							m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction;
-
-	double						m_Radius;
-
-	CSG_Distance_Weighting		m_Weighting;
-
-	CSG_PRQuadTree				m_Search;
-
-	CSG_Vector					m_z, m_w;
-
-	CSG_Matrix					m_y;
-
-	CSG_Shapes					*m_pPoints;
-
-
-	void						Finalize				(void);
-
-	bool						Get_Predictors			(void);
-
-	int							Set_Variables			(const TSG_Point &Point);
-
-	bool						Get_Regression			(CSG_Shape *pPoint);
-
-	bool						Set_Residuals			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__gw_multi_regression_points_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.cpp
deleted file mode 100644
index fd3de20..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.cpp
+++ /dev/null
@@ -1,417 +0,0 @@
-/**********************************************************
- * Version $Id: gw_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   gw_regression.cpp                   //
-//                                                       //
-//                 Copyright (C) 2010 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 "gw_regression.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGW_Regression::CGW_Regression(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Geographically Weighted Regression"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Reference:\n"
-		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL("")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "PREDICTOR"	, _TL("Predictor"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		NULL	, "TARGET"		, _TL("Target Grids"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("user defined"),
-			_TL("grid")
-		), 0
-	);
-
-	m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid")	, _TL("")));
-	m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid")			, _TL("")), false);
-
-	m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY")   , _TL("Quality")  , false);
-	m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false);
-	m_Grid_Target.Add_Grid_Parameter(SG_T("SLOPE")     , _TL("Slope")    , false);
-
-	//-----------------------------------------------------
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	);
-
-	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
-	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pSearch	= Parameters.Add_Node(
-		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
-		_TL("")
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local"),
-			_TL("global")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
-		_TL("local maximum search distance given in map units"),
-		PARAMETER_TYPE_Double	, 1000.0, 0, true
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("maximum number of nearest points"),
-			_TL("all points within search distance")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
-		_TL("minimum number of points to use"),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
-		_TL("maximum number of nearest points"),
-		PARAMETER_TYPE_Int, 20, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("all directions"),
-			_TL("quadrants")
-		)
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Regression::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 );
-}
-
-//---------------------------------------------------------
-int CGW_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
-	{
-		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
-	{
-		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
-		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
-	}
-
-	m_Weighting.Enable_Parameters(pParameters);
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Regression::On_Execute(void)
-{
-	//-----------------------------------------------------
-	m_pPoints		= Parameters("POINTS"   )->asShapes();
-	m_iDependent	= Parameters("DEPENDENT")->asInt   ();
-	m_iPredictor	= Parameters("PREDICTOR")->asInt   ();
-
-	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
-	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
-					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
-	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
-					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
-	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
-
-	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	m_pIntercept	= NULL;
-	m_pSlope		= NULL;
-	m_pQuality		= NULL;
-
-	switch( Parameters("TARGET")->asInt() )
-	{
-	case 0:	// user defined...
-		if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") )
-		{
-			m_pIntercept	= m_Grid_Target.Get_User(SG_T("INTERCEPT"));
-			m_pSlope		= m_Grid_Target.Get_User(SG_T("SLOPE"));
-			m_pQuality		= m_Grid_Target.Get_User(SG_T("QUALITY"));
-		}
-		break;
-
-	case 1:	// grid...
-		if( Dlg_Parameters("GRID") )
-		{
-			m_pIntercept	= m_Grid_Target.Get_Grid(SG_T("INTERCEPT"));
-			m_pSlope		= m_Grid_Target.Get_Grid(SG_T("SLOPE"));
-			m_pQuality		= m_Grid_Target.Get_Grid(SG_T("QUALITY"));
-		}
-		break;
-	}
-
-	if( m_pIntercept == NULL )
-	{
-		m_Search.Destroy();
-
-		return( false );
-	}
-
-	m_pIntercept->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Intercept")));
-	m_pSlope    ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Slope")));
-	m_pQuality  ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Quality")));
-
-	//-----------------------------------------------------
-	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
-
-	m_y.Create(nPoints_Max);
-	m_z.Create(nPoints_Max);
-	m_w.Create(nPoints_Max);
-
-	//-----------------------------------------------------
-	for(int y=0; y<m_pIntercept->Get_NY() && Set_Progress(y, m_pIntercept->Get_NY()); y++)
-	{
-		for(int x=0; x<m_pIntercept->Get_NX(); x++)
-		{
-			if( !Get_Regression(x, y) )
-			{
-				m_pIntercept->Set_NoData(x, y);
-				m_pSlope    ->Set_NoData(x, y);
-				m_pQuality  ->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_y.Destroy();
-	m_z.Destroy();
-	m_w.Destroy();
-
-	m_Search.Destroy();
-
-	DataObject_Update(m_pIntercept);
-	DataObject_Update(m_pSlope);
-	DataObject_Update(m_pQuality);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Regression::Set_Variables(int x, int y)
-{
-	int			iPoint, jPoint, nPoints;
-	TSG_Point	Point;
-	CSG_Shape	*pPoint;
-
-	Point	= m_pIntercept->Get_System().Get_Grid_to_World(x, y);
-	nPoints	= m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
-
-	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
-	{
-		if( m_Search.is_Okay() )
-		{
-			double	ix, iy, iz;
-
-			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
-
-			pPoint	= m_pPoints->Get_Shape((int)iz);
-		}
-		else
-		{
-			pPoint	= m_pPoints->Get_Shape(iPoint);
-		}
-
-		if( !pPoint->is_NoData(m_iDependent) && !pPoint->is_NoData(m_iPredictor) )
-		{
-			m_z[jPoint]	= pPoint->asDouble(m_iDependent);
-			m_y[jPoint]	= pPoint->asDouble(m_iPredictor);
-			m_w[jPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
-
-			jPoint++;
-		}
-	}
-
-	return( jPoint );
-}
-
-//---------------------------------------------------------
-bool CGW_Regression::Get_Regression(int x, int y)
-{
-	int		nPoints	= Set_Variables(x, y);
-
-	if( nPoints < m_nPoints_Min )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			i;
-	double		zMean, rss, tss;
-	CSG_Vector	b, z;
-	CSG_Matrix	Y, YtW;
-
-	//-----------------------------------------------------
-	z  .Create(nPoints);
-	Y  .Create(2, nPoints);
-	YtW.Create(nPoints, 2);
-
-	for(i=0, zMean=0.0; i<nPoints; i++)
-	{
-		Y  [i][0]	= 1.0;
-		Y  [i][1]	= m_y[i];
-		YtW[0][i]	= m_w[i];
-		YtW[1][i]	= m_w[i] * m_y[i];
-
-		zMean		+= (z[i] = m_z[i]);
-	}
-
-	//-----------------------------------------------------
-	b		= (YtW * Y).Get_Inverse() * (YtW * z);
-
-	zMean	/= nPoints;
-
-	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
-	{
-		rss	+= m_w[i] * SG_Get_Square(m_z[i] - (b[0] + b[1] * m_y[i]));
-		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
-	}
-
-	m_pIntercept->Set_Value(x, y, b[0]);
-	m_pSlope    ->Set_Value(x, y, b[1]);
-	m_pQuality  ->Set_Value(x, y, (tss - rss) / tss);
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.h
deleted file mode 100644
index 4307205..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/**********************************************************
- * Version $Id: gw_regression.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    gw_regression.h                    //
-//                                                       //
-//                 Copyright (C) 2010 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__GW_Regression_H
-#define HEADER_INCLUDED__GW_Regression_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGW_Regression : public CSG_Module
-{
-public:
-	CGW_Regression(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	int							m_iDependent, m_iPredictor, m_nPoints_Min, m_nPoints_Max, m_Direction;
-
-	double						m_Radius;
-
-	CSG_Parameters_Grid_Target	m_Grid_Target;
-
-	CSG_Distance_Weighting		m_Weighting;
-
-	CSG_PRQuadTree				m_Search;
-
-	CSG_Vector					m_y, m_z, m_w;
-
-	CSG_Shapes					*m_pPoints;
-
-	CSG_Grid					*m_pIntercept, *m_pSlope, *m_pQuality;
-
-
-	int							Set_Variables			(int x, int y);
-
-	bool						Get_Regression			(int x, int y);
-
-	bool						Set_Residuals			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__GW_Regression_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.cpp
deleted file mode 100644
index 57b8ffa..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.cpp
+++ /dev/null
@@ -1,469 +0,0 @@
-/**********************************************************
- * Version $Id: gw_regression_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 gw_regression_grid.cpp                //
-//                                                       //
-//                 Copyright (C) 2010 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 "gw_regression_grid.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define GRID_INIT(g, s)				if( g ) { g->Set_Name(CSG_String::Format(SG_T("%s (%s - %s)"), Parameters("DEPENDENT")->asString(), s, m_pPredictor->Get_Name())); }
-#define GRID_SET_NODATA(g, x, y)	if( g ) { g->Set_NoData(x, y); }
-#define GRID_SET_VALUE(g, x, y, z)	if( g ) { g->Set_Value(x, y, z); }
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGW_Regression_Grid::CGW_Regression_Grid(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Geographically Weighted Regression (Points/Grid)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Reference:\n"
-		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "PREDICTOR"	, _TL("Predictor"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REGRESSION"	, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "QUALITY"		, _TL("Coefficient of Determination"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "INTERCEPT"	, _TL("Intercept"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SLOPE"		, _TL("Slope"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL("")
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "RESIDUALS"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("")
-	);
-
-	m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS);
-	m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pSearch	= Parameters.Add_Node(
-		NULL	, "NODE_SEARCH"			, _TL("Search Options"),
-		_TL("")
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_RANGE"		, _TL("Search Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local"),
-			_TL("global")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_RADIUS"		, _TL("Maximum Search Distance"),
-		_TL("local maximum search distance given in map units"),
-		PARAMETER_TYPE_Double	, 1000.0, 0, true
-	);
-
-	pNode	= Parameters.Add_Choice(
-		pSearch	, "SEARCH_POINTS_ALL"	, _TL("Number of Points"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("maximum number of nearest points"),
-			_TL("all points within search distance")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MIN"	, _TL("Minimum"),
-		_TL("minimum number of points to use"),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_POINTS_MAX"	, _TL("Maximum"),
-		_TL("maximum number of nearest points"),
-		PARAMETER_TYPE_Int, 20, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "SEARCH_DIRECTION"	, _TL("Search Direction"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("all directions"),
-			_TL("quadrants")
-		)
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Regression_Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
-	{
-		pParameters->Get_Parameter("SEARCH_RADIUS"    )->Set_Enabled(pParameter->asInt() == 0);	// local
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) )
-	{
-		pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points
-		pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0);	// maximum number of points per quadrant
-	}
-
-	m_Weighting.Enable_Parameters(pParameters);
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Regression_Grid::On_Execute(void)
-{
-	//-----------------------------------------------------
-	m_pPredictor	= Parameters("PREDICTOR" )->asGrid  ();
-	m_pRegression	= Parameters("REGRESSION")->asGrid  ();
-	m_pQuality		= Parameters("QUALITY"   )->asGrid  ();
-	m_pIntercept	= Parameters("INTERCEPT" )->asGrid  ();
-	m_pSlope		= Parameters("SLOPE"     )->asGrid  ();
-	m_pPoints		= Parameters("POINTS"    )->asShapes();
-	m_iDependent	= Parameters("DEPENDENT" )->asInt   ();
-
-	m_nPoints_Min	= Parameters("SEARCH_POINTS_MIN")->asInt   ();
-	m_nPoints_Max	= Parameters("SEARCH_POINTS_ALL")->asInt   () == 0
-					? Parameters("SEARCH_POINTS_MAX")->asInt   () : 0;
-	m_Radius		= Parameters("SEARCH_RANGE"     )->asInt   () == 0
-					? Parameters("SEARCH_RADIUS"    )->asDouble() : 0.0;
-	m_Direction		= Parameters("SEARCH_DIRECTION" )->asInt   () == 0 ? -1 : 4;
-
-	m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters());
-
-	//-----------------------------------------------------
-	if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	GRID_INIT(m_pRegression, _TL("GWR Regression"));
-	GRID_INIT(m_pQuality   , _TL("GWR Quality"));
-	GRID_INIT(m_pIntercept , _TL("GWR Intercept"));
-	GRID_INIT(m_pSlope     , _TL("GWR Slope"));
-
-	//-----------------------------------------------------
-	int	nPoints_Max	= m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count();
-
-	m_y.Create(nPoints_Max);
-	m_z.Create(nPoints_Max);
-	m_w.Create(nPoints_Max);
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( m_pPredictor->is_NoData(x, y) || !Get_Regression(x, y) )
-			{
-				GRID_SET_NODATA(m_pRegression , x, y);
-				GRID_SET_NODATA(m_pIntercept  , x, y);
-				GRID_SET_NODATA(m_pSlope      , x, y);
-				GRID_SET_NODATA(m_pQuality    , x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Set_Residuals();
-
-	m_y.Destroy();
-	m_z.Destroy();
-	m_w.Destroy();
-
-	m_Search.Destroy();
-
-	DataObject_Update(m_pIntercept);
-	DataObject_Update(m_pSlope);
-	DataObject_Update(m_pQuality);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGW_Regression_Grid::Set_Variables(int x, int y)
-{
-	int			iPoint, jPoint, nPoints;
-	double		z;
-	TSG_Point	Point;
-	CSG_Shape	*pPoint;
-
-	Point	= Get_System()->Get_Grid_to_World(x, y);
-	nPoints	= m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count();
-
-	for(iPoint=0, jPoint=0; iPoint<nPoints; iPoint++)
-	{
-		if( m_Search.is_Okay() )
-		{
-			double	ix, iy, iz;
-
-			m_Search.Get_Selected_Point(iPoint, ix, iy, iz);
-
-			pPoint	= m_pPoints->Get_Shape((int)iz);
-		}
-		else
-		{
-			pPoint	= m_pPoints->Get_Shape(iPoint);
-		}
-
-		if( !pPoint->is_NoData(m_iDependent) && m_pPredictor->Get_Value(pPoint->Get_Point(0), z) )
-		{
-			m_w[jPoint]	= m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0)));
-			m_z[jPoint]	= pPoint->asDouble(m_iDependent);
-			m_y[jPoint]	= z;
-
-			jPoint++;
-		}
-	}
-
-	return( jPoint );
-}
-
-//---------------------------------------------------------
-bool CGW_Regression_Grid::Get_Regression(int x, int y)
-{
-	int		nPoints	= Set_Variables(x, y);
-
-	if( nPoints < m_nPoints_Min )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			i;
-	double		zMean, rss, tss;
-	CSG_Vector	b, z;
-	CSG_Matrix	Y, YtW;
-
-	//-----------------------------------------------------
-	z  .Create(nPoints);
-	Y  .Create(2, nPoints);
-	YtW.Create(nPoints, 2);
-
-	for(i=0, zMean=0.0; i<nPoints; i++)
-	{
-		Y  [i][0]	= 1.0;
-		Y  [i][1]	= m_y[i];
-		YtW[0][i]	= m_w[i];
-		YtW[1][i]	= m_w[i] * m_y[i];
-
-		zMean		+= (z[i] = m_z[i]);
-	}
-
-	//-----------------------------------------------------
-	b		= (YtW * Y).Get_Inverse() * (YtW * z);
-
-	zMean	/= nPoints;
-
-	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
-	{
-		rss	+= m_w[i] * SG_Get_Square(m_z[i] - (b[0] + b[1] * m_y[i]));
-		tss	+= m_w[i] * SG_Get_Square(m_z[i] - zMean);
-	}
-
-	GRID_SET_VALUE(m_pRegression, x, y, b[0] + b[1] * m_pPredictor->asDouble(x, y));
-	GRID_SET_VALUE(m_pIntercept , x, y, b[0]);
-	GRID_SET_VALUE(m_pSlope     , x, y, b[1]);
-	GRID_SET_VALUE(m_pQuality   , x, y, (tss - rss) / tss);
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGW_Regression_Grid::Set_Residuals(void)
-{
-	CSG_Shapes	*pResiduals	= Parameters("RESIDUALS")->asShapes();
-
-	if( !pResiduals || !m_pPoints || !m_pRegression )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pPoints->Get_Name(), _TL("Residuals")));
-	pResiduals->Add_Field(m_pPoints->Get_Field_Name(m_iDependent), SG_DATATYPE_Double);
-	pResiduals->Add_Field("TREND"	, SG_DATATYPE_Double);
-	pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
-
-	//-------------------------------------------------
-	for(int iShape=0; iShape<m_pPoints->Get_Count() && Set_Progress(iShape, m_pPoints->Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape	= m_pPoints->Get_Shape(iShape);
-		double		 zShape	= pShape->asDouble(m_iDependent);
-
-		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-		{
-			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-			{
-				double	zRegression;
-
-				TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
-
-				if( m_pRegression->Get_Value(Point, zRegression) )
-				{
-					CSG_Shape	*pResidual	= pResiduals->Add_Shape();
-
-					pResidual->Add_Point(Point);
-					pResidual->Set_Value(0, zShape);
-					pResidual->Set_Value(1, zRegression);
-					pResidual->Set_Value(2, zShape - zRegression);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.h
deleted file mode 100644
index b2413e7..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/**********************************************************
- * Version $Id: gw_regression_grid.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 gw_regression_grid.h                  //
-//                                                       //
-//                 Copyright (C) 2010 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__gw_regression_grid_H
-#define HEADER_INCLUDED__gw_regression_grid_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGW_Regression_Grid : public CSG_Module_Grid
-{
-public:
-	CGW_Regression_Grid(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	int							m_iDependent, m_nPoints_Min, m_nPoints_Max, m_Direction;
-
-	double						m_Radius;
-
-	CSG_Distance_Weighting		m_Weighting;
-
-	CSG_PRQuadTree				m_Search;
-
-	CSG_Vector					m_y, m_z, m_w;
-
-	CSG_Shapes					*m_pPoints;
-
-	CSG_Grid					*m_pPredictor, *m_pRegression, *m_pQuality, *m_pIntercept, *m_pSlope;
-
-
-	int							Set_Variables			(int x, int y);
-
-	bool						Get_Regression			(int x, int y);
-
-	bool						Set_Residuals			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__gw_regression_grid_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gwr_grid_downscaling.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/gwr_grid_downscaling.cpp
deleted file mode 100644
index 17c2be6..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gwr_grid_downscaling.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-/**********************************************************
- * Version $Id: gwr_grid_downscaling.cpp 1633 2013-03-22 13:35:15Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                gwr_grid_downscaling.cpp               //
-//                                                       //
-//                 Copyright (C) 2013 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 "gwr_grid_downscaling.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGWR_Grid_Downscaling::CGWR_Grid_Downscaling(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("GWR Grid Downscaling"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"References:\n"
-		"- Fotheringham, S.A., Brunsdon, C., Charlton, M. (2002):"
-		" Geographically Weighted Regression: the analysis of spatially varying relationships. John Wiley & Sons."
-		" <a target=\"_blank\" href=\"http://onlinelibrary.wiley.com/doi/10.1111/j.1538-4632.2003.tb01114.x/abstract\">online</a>.\n"
-		"\n"
-		"- Fotheringham, S.A., Charlton, M., Brunsdon, C. (1998):"
-		" Geographically weighted regression: a natural evolution of the expansion method for spatial data analysis."
-		" Environment and Planning A 30(11), 1905�1927."
-		" <a target=\"_blank\" href=\"http://www.envplan.com/abstract.cgi?id=a301905\">online</a>.\n"
-		"\n"
-		"- Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "PREDICTORS"	, _TL("Predictors"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REGRESSION"	, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REG_RESCORR"	, _TL("Regression with Residual Correction"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid_System(
-		NULL	, "GRID_SYSTEM"	, _TL("Grid System"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(
-		pNode	, "QUALITY"		, _TL("Coefficient of Determination"),
-		_TL(""),
-		PARAMETER_OUTPUT, false
-	);
-
-	Parameters.Add_Grid(
-		pNode	, "RESIDUALS"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT, false
-	);
-
-	Parameters.Add_Grid_List(
-		pNode	, "MODEL"		, _TL("Regression Parameters"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "MODEL_OUT"	, _TL("Output of Model Parameters"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Choice(
-		NULL	, "SEARCH_RANGE"		, _TL("Search Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local"),
-			_TL("global")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SEARCH_RADIUS"		, _TL("Search Distance [Cells]"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 10, 1, true
-	);
-
-	m_Search.Get_Weighting().Set_Weighting(SG_DISTWGHT_GAUSS);
-	m_Search.Get_Weighting().Set_BandWidth(7.0);
-	m_Search.Get_Weighting().Create_Parameters(&Parameters, false);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGWR_Grid_Downscaling::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) )
-	{
-		pParameters->Get_Parameter("SEARCH_RADIUS")->Set_Enabled(pParameter->asInt() == 0);	// local
-	}
-
-	m_Search.Get_Weighting().Enable_Parameters(pParameters);
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGWR_Grid_Downscaling::On_Execute(void)
-{
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pPredictors	= Parameters("PREDICTORS")->asGridList();
-
-	if( (m_nPredictors = pPredictors->Get_Count()) <= 0 )
-	{
-		return( false );
-	}
-
-	m_pDependent	= Parameters("DEPENDENT")->asGrid();
-
-	if( !m_pDependent->Get_Extent().Intersects(Get_System()->Get_Extent()) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int		i;
-
-	Process_Set_Text(_TL("upscaling of predictors"));
-
-	m_pPredictors	= (CSG_Grid **)SG_Calloc(m_nPredictors    , sizeof(CSG_Grid *));
-	m_pModel		= (CSG_Grid **)SG_Calloc(m_nPredictors + 1, sizeof(CSG_Grid *));
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		m_pPredictors[i]	= SG_Create_Grid(m_pDependent->Get_System());
-		m_pPredictors[i]	->Assign(pPredictors->asGrid(i), GRID_INTERPOLATION_NearestNeighbour);	// GRID_INTERPOLATION_Mean_Cells
-
-		m_pModel     [i]	= SG_Create_Grid(m_pDependent->Get_System());
-		m_pModel     [i]	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPredictors->asGrid(i)->Get_Name(), _TL("Factor")));
-	}
-
-	m_pModel[m_nPredictors]	= SG_Create_Grid(m_pDependent->Get_System());
-	m_pModel[m_nPredictors]	->Set_Name(_TL("Intercept"));
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("model creation"));
-
-	bool	bResult	= Get_Model();
-
-	//-----------------------------------------------------
-	for(i=0; i<m_nPredictors; i++)
-	{
-		delete(m_pPredictors[i]);
-
-		m_pPredictors[i]	= pPredictors->asGrid(i);
-	}
-
-	//-----------------------------------------------------
-	if( bResult )
-	{
-		Process_Set_Text(_TL("downscaling"));
-
-		bResult	= Set_Model();
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("MODEL_OUT")->asBool() )
-	{
-		CSG_Parameter_Grid_List	*pModel	= Parameters("MODEL")->asGridList();
-
-		pModel->Del_Items();
-		pModel->Add_Item(m_pModel[m_nPredictors]);
-
-		for(i=0; i<m_nPredictors; i++)
-		{
-			pModel->Add_Item(m_pModel[i]);
-		}
-	}
-	else
-	{
-		for(i=0; i<=m_nPredictors; i++)
-		{
-			delete(m_pModel[i]);
-		}
-	}
-
-	SG_FREE_SAFE(m_pModel);
-	SG_FREE_SAFE(m_pPredictors);
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGWR_Grid_Downscaling::Set_Model(double x, double y, double &Value, double &Residual)
-{
-	if( !m_pModel[m_nPredictors]->Get_Value(x, y, Value, GRID_INTERPOLATION_BSpline) )
-	{
-		return( false );
-	}
-
-	double	Model, Predictor;
-
-	for(int i=0; i<m_nPredictors; i++)
-	{
-		if( !m_pModel     [i]->Get_Value(x, y, Model    , GRID_INTERPOLATION_BSpline)
-		||  !m_pPredictors[i]->Get_Value(x, y, Predictor, GRID_INTERPOLATION_NearestNeighbour) )
-		{
-			return( false );
-		}
-
-		Value	+= Model * Predictor;
-	}
-
-	if( !m_pResiduals->Get_Value(x, y, Residual, GRID_INTERPOLATION_BSpline) )
-	{
-		Residual	= 0.0;
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CGWR_Grid_Downscaling::Set_Model(void)
-{
-	CSG_Grid	*pRegression	= Parameters("REGRESSION" )->asGrid();
-	CSG_Grid	*pReg_ResCorr	= Parameters("REG_RESCORR")->asGrid();
-
-	pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pDependent->Get_Name(), _TL("GWR")));
-
-	if( pReg_ResCorr )
-	{
-		pReg_ResCorr->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Residual Correction")));
-	}
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		double	p_y	= Get_YMin() + y * Get_Cellsize();
-
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	Value, Residual, p_x	= Get_XMin() + x * Get_Cellsize();
-
-			if( Set_Model(p_x, p_y, Value, Residual) )
-			{
-				pRegression->Set_Value(x, y, Value);
-
-				if( pReg_ResCorr )
-				{
-					pReg_ResCorr->Set_Value(x, y, Value + Residual);
-				}
-			}
-			else
-			{
-				pRegression->Set_NoData(x, y);
-
-				if( pReg_ResCorr )
-				{
-					pReg_ResCorr->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGWR_Grid_Downscaling::Get_Model(void)
-{
-	//-----------------------------------------------------
-	m_pQuality		= Parameters("QUALITY"  )->asGrid();
-	m_pQuality		->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Quality")));
-
-	m_pResiduals	= Parameters("RESIDUALS")->asGrid();
-	m_pResiduals	->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Residuals")));
-
-	//-----------------------------------------------------
-	m_Search.Get_Weighting().Set_Parameters(&Parameters);
-
-	m_Search.Set_Radius(Parameters("SEARCH_RANGE")->asInt() == 0
-		? Parameters("SEARCH_RADIUS")->asInt() : 1 + (int)(SG_Get_Length(m_pDependent->Get_NX(), m_pDependent->Get_NY()))
-	);
-
-	//-----------------------------------------------------
-	CSG_Grid_System	System(m_pDependent->Get_System());
-
-	for(int y=0; y<System.Get_NY() && Set_Progress(y, System.Get_NY()); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<System.Get_NX(); x++)
-		{
-			if( !Get_Regression(x, y) )
-			{
-				m_pQuality  ->Set_NoData(x, y);
-				m_pResiduals->Set_NoData(x, y);
-
-				for(int i=0; i<=m_nPredictors; i++)
-				{
-					m_pModel[i]->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Search.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGWR_Grid_Downscaling::Get_Variables(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y)
-{
-	int		n	= 0;
-
-	z.Create(m_Search.Get_Count());
-	w.Create(m_Search.Get_Count());
-	Y.Create(1 + m_nPredictors, m_Search.Get_Count());
-
-	//-----------------------------------------------------
-	for(int i=0, ix, iy; i<m_Search.Get_Count(); i++)
-	{
-		double	id, iw;
-
-		if( m_Search.Get_Values(i, ix = x, iy = y, id, iw, true) && m_pDependent->is_InGrid(ix, iy) )
-		{
-			z[n]	= m_pDependent->asDouble(ix, iy);
-			w[n]	= iw;
-			Y[n][0]	= 1.0;
-
-			for(int j=0; j<m_nPredictors && iw>0.0; j++)
-			{
-				if( !m_pPredictors[j]->is_NoData(ix, iy) )
-				{
-					Y[n][j + 1]	= m_pPredictors[j]->asDouble(ix, iy);
-				}
-				else
-				{
-					iw	= 0.0;
-				}
-			}
-
-			if( iw > 0.0 )
-			{
-				n++;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	z.Set_Rows(n);
-	w.Set_Rows(n);
-	Y.Set_Rows(n);
-
-	return( n );
-}
-
-//---------------------------------------------------------
-bool CGWR_Grid_Downscaling::Get_Regression(int x, int y)
-{
-	//-----------------------------------------------------
-	int			i, nPoints;
-	double		zMean, zr, rss, tss;
-	CSG_Vector	b, z, w;
-	CSG_Matrix	Y, YtW;
-
-	if( (nPoints = Get_Variables(x, y, z, w, Y)) <= m_nPredictors )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	YtW.Create(nPoints, 1 + m_nPredictors);
-
-	for(i=0, zMean=0.0; i<nPoints; i++)
-	{
-		zMean		+= z[i];
-		YtW[0][i]	 = w[i];
-
-		for(int j=1; j<=m_nPredictors; j++)
-		{
-			YtW[j][i]	= Y[i][j] * w[i];
-		}
-	}
-
-	//-----------------------------------------------------
-	b		= (YtW * Y).Get_Inverse() * (YtW * z);
-
-	zMean	/= nPoints;
-
-	for(i=0, rss=0.0, tss=0.0; i<nPoints; i++)
-	{
-		zr	= b[0];
-
-		for(int j=1; j<=m_nPredictors; j++)
-		{
-			zr	+= b[j] * Y[i][j];
-		}
-
-		rss	+= w[i] * SG_Get_Square(z[i] - zr);
-		tss	+= w[i] * SG_Get_Square(z[i] - zMean);
-	}
-
-	m_pQuality->Set_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0);
-
-	for(i=0; i<m_nPredictors; i++)
-	{
-		m_pModel[i]->Set_Value(x, y, b[i + 1]);
-	}
-
-	m_pModel[m_nPredictors]->Set_Value(x, y, b[0]);
-
-	//-----------------------------------------------------
-	if( m_pDependent->is_NoData(x, y) )
-	{
-		m_pResiduals->Set_NoData(x, y);
-	}
-	else
-	{
-		zr	= b[0];
-
-		for(i=0; i<m_nPredictors; i++)
-		{
-			if( m_pPredictors[i]->is_NoData(x, y) )
-			{
-				m_pResiduals->Set_NoData(x, y);
-
-				return( true );
-			}
-
-			zr	+= b[i + 1] * m_pPredictors[i]->asDouble(x, y);
-		}
-
-		m_pResiduals->Set_Value(x, y, m_pDependent->asDouble(x, y) - zr);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/gwr_grid_downscaling.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/gwr_grid_downscaling.h
deleted file mode 100644
index efb4340..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/gwr_grid_downscaling.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/**********************************************************
- * Version $Id: gwr_grid_downscaling.h 1549 2012-11-29 16:38:50Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 gwr_grid_downscaling.h                //
-//                                                       //
-//                 Copyright (C) 2013 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__gwr_grid_downscaling_H
-#define HEADER_INCLUDED__gwr_grid_downscaling_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGWR_Grid_Downscaling : public CSG_Module_Grid
-{
-public:
-	CGWR_Grid_Downscaling(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:GWR") );	}
-
-
-protected:
-
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-
-private:
-
-	int							m_nPredictors;
-
-	CSG_Grid_Cell_Addressor		m_Search;
-
-	CSG_Grid					*m_pDependent, **m_pPredictors, **m_pModel, *m_pQuality, *m_pResiduals;
-
-
-	bool						Set_Model				(double x, double y, double &Value, double &Residual);
-	bool						Set_Model				(void);
-
-	bool						Get_Model				(void);
-	int							Get_Variables			(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y);
-	bool						Get_Regression			(int x, int y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__gwr_grid_downscaling_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.cpp
deleted file mode 100644
index 487186e..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/**********************************************************
- * Version $Id: point_grid_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               point_grid_regression.cpp               //
-//                                                       //
-//                 Copyright (C) 2004 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "point_grid_regression.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define GRID_ZFACTOR	true
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPoint_Grid_Regression::CPoint_Grid_Regression(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Regression Analysis (Points/Grid)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2004"));
-
-	Set_Description	(_TW(
-		"Regression analysis of point attributes with grid values. "
-		"The regression function is used to create a new grid with regression based values. \n"
-		"\n"
-		"Reference:\n"
-		"- Bahrenberg, G., Giese, E., Nipper, J. (1990): "
-		"'Statistische Methoden in der Geographie 1 - Univariate und bivariate Statistik', "
-		"Stuttgart, 233p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "GRID"		, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "ATTRIBUTE"	, _TL("Attribute"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REGRESSION"	, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "RESIDUAL"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"INTERPOL"		, _TL("Grid Interpolation"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-			_TL("Nearest Neighbor"),
-			_TL("Bilinear Interpolation"),
-			_TL("Inverse Distance Interpolation"),
-			_TL("Bicubic Spline Interpolation"),
-			_TL("B-Spline Interpolation")
-		), 4
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Regression Function"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-			_TL("Y = a + b * X (linear)"),
-			_TL("Y = a + b / X"),
-			_TL("Y = a / (b - X)"),
-			_TL("Y = a * X^b (power)"),
-			_TL("Y = a e^(b * X) (exponential)"),
-			_TL("Y = a + b * ln(X) (logarithmic)")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Grid_Regression::On_Execute(void)
-{
-	int					iAttribute;
-	TSG_Regression_Type	Type;
-	CSG_Shapes			*pShapes, *pResiduals;
-	CSG_Grid			*pGrid, *pRegression;
-
-	//-----------------------------------------------------
-	pGrid			= Parameters("GRID")		->asGrid();
-	pRegression		= Parameters("REGRESSION")	->asGrid();
-	pShapes			= Parameters("SHAPES")		->asShapes();
-	pResiduals		= Parameters("RESIDUAL")	->asShapes();
-	iAttribute		= Parameters("ATTRIBUTE")	->asInt();
-	m_Interpolation	= Parameters("INTERPOL")	->asInt();
-
-	switch( Parameters("METHOD")->asInt() )
-	{
-	default:
-	case 0:	Type	= REGRESSION_Linear;	break;	// Y = a + b * X
-	case 1:	Type	= REGRESSION_Rez_X;		break;	// Y = a + b / X
-	case 2:	Type	= REGRESSION_Rez_Y;		break;	// Y = a / (b - X)
-	case 3:	Type	= REGRESSION_Pow;		break;	// Y = a * X^b
-	case 4:	Type	= REGRESSION_Exp;		break;	// Y = a e^(b * X)
-	case 5:	Type	= REGRESSION_Log;		break;	// Y = a + b * ln(X)
-	}
-
-	//-----------------------------------------------------
-	if( Get_Regression(pGrid, pShapes, pResiduals, iAttribute, Type) )
-	{
-		pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Regression Model")));
-
-		Set_Regression(pGrid, pRegression);
-
-		Set_Residuals(pResiduals);
-
-		Message_Add(m_Regression.asString());
-
-		m_Regression.Destroy();
-
-		return( true );
-	}
-
-	//-----------------------------------------------------
-	m_Regression.Destroy();
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Grid_Regression::Get_Regression(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Shapes *pResiduals, int iAttribute, TSG_Regression_Type Type)
-{
-	int			iShape, iPart, iPoint;
-	double		zShape, zGrid;
-	TSG_Point	Point;
-	CSG_Shape	*pShape, *pResidual;
-
-	//-----------------------------------------------------
-	if( pResiduals )
-	{
-		pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Residuals")));
-		pResiduals->Add_Field("ID"			, SG_DATATYPE_Int);
-		pResiduals->Add_Field("Y"			, SG_DATATYPE_Double);
-		pResiduals->Add_Field("X"			, SG_DATATYPE_Double);
-		pResiduals->Add_Field("Y_GUESS"		, SG_DATATYPE_Double);
-		pResiduals->Add_Field("Y_RESIDUAL"	, SG_DATATYPE_Double);
-		pResiduals->Add_Field("Y_RES_VAR"	, SG_DATATYPE_Double);
-	}
-
-	m_Regression.Destroy();
-
-	//-----------------------------------------------------
-	for(iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-	{
-		pShape	= pShapes->Get_Shape(iShape);
-
-		if( !pShape->is_NoData(iAttribute) )
-		{
-			zShape	= pShape->asDouble(iAttribute);
-
-			for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-			{
-				for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-				{
-					if( pGrid->Get_Value(Point = pShape->Get_Point(iPoint, iPart), zGrid, m_Interpolation, GRID_ZFACTOR) )
-					{
-						m_Regression.Add_Values(zGrid, zShape);
-
-						if( pResiduals )
-						{
-							pResidual	= pResiduals->Add_Shape();
-							pResidual->Add_Point(Point);
-							pResidual->Set_Value(0, m_Regression.Get_Count());
-							pResidual->Set_Value(1, zShape);
-							pResidual->Set_Value(2, zGrid);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( m_Regression.Calculate(Type) );
-}
-
-//---------------------------------------------------------
-bool CPoint_Grid_Regression::Set_Regression(CSG_Grid *pGrid, CSG_Grid *pRegression)
-{
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( pGrid->is_NoData(x, y) )
-				pRegression->Set_NoData(x, y);
-			else
-				pRegression->Set_Value (x, y, m_Regression.Get_y(pGrid->asDouble(x, y, GRID_ZFACTOR)));
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CPoint_Grid_Regression::Set_Residuals(CSG_Shapes *pResiduals)
-{
-	int		iPoint;
-	double	m, b, v, y;
-	CSG_Shape	*pPoint;
-
-	if( pResiduals )
-	{
-		m	= m_Regression.Get_Coefficient();
-		b	= m_Regression.Get_Constant();
-		v	= 100.0 / m_Regression.Get_yVariance();
-
-		for(iPoint=0; iPoint<pResiduals->Get_Count() && Set_Progress(iPoint, pResiduals->Get_Count()); iPoint++)
-		{
-			pPoint	= pResiduals->Get_Shape(iPoint);
-
-			pPoint->Set_Value(3, y = pPoint->asDouble(2) * m + b);
-			pPoint->Set_Value(4, y = pPoint->asDouble(1) - y);
-			pPoint->Set_Value(5, y * v);
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.h
deleted file mode 100644
index 37dfbd5..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/**********************************************************
- * Version $Id: point_grid_regression.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                  Geostatistics_Grid                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                point_grid_regression.h                //
-//                                                       //
-//                 Copyright (C) 2004 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__point_grid_regression_H
-#define HEADER_INCLUDED__point_grid_regression_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPoint_Grid_Regression : public CSG_Module_Grid
-{
-public:
-	CPoint_Grid_Regression(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	int						m_Interpolation;
-
-	CSG_Regression			m_Regression;
-
-
-	bool					Get_Regression		(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Shapes *pResiduals, int iAttribute, TSG_Regression_Type Type);
-	bool					Set_Regression		(CSG_Grid *pGrid, CSG_Grid *pRegression);
-	bool					Set_Residuals		(CSG_Shapes *pResiduals);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__point_grid_regression_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp
deleted file mode 100644
index 2ade59e..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp
+++ /dev/null
@@ -1,607 +0,0 @@
-/**********************************************************
- * Version $Id: point_multi_grid_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             point_multi_grid_regression.cpp           //
-//                                                       //
-//                 Copyright (C) 2004 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "point_multi_grid_regression.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPoint_Multi_Grid_Regression::CPoint_Multi_Grid_Regression(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Multiple Regression Analysis (Points/Grids)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2004"));
-
-	Set_Description	(_TW(
-		"Linear regression analysis of point attributes with multiple grids. "
-		"Details of the regression/correlation analysis will be saved to a table. "
-		"The regression function is used to create a new grid with regression based values. "
-		"The multiple regression analysis uses a forward selection procedure. \n"
-		"\n"
-		"Reference:\n"
-		"- Bahrenberg, G., Giese, E., Nipper, J. (1992): "
-		"'Statistische Methoden in der Geographie 2 - Multivariate Statistik', "
-		"Stuttgart, 415p.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT, true
-	);
-
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "ATTRIBUTE"	, _TL("Attribute"),
-		_TL("")
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_COEFF"	, _TL("Details: Coefficients"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_MODEL"	, _TL("Details: Model"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_STEPS"	, _TL("Details: Steps"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "RESIDUALS"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "REGRESSION"	, _TL("Regression"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"INTERPOL"		, _TL("Grid Interpolation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-			_TL("Nearest Neighbor"),
-			_TL("Bilinear Interpolation"),
-			_TL("Inverse Distance Interpolation"),
-			_TL("Bicubic Spline Interpolation"),
-			_TL("B-Spline Interpolation")
-		), 4
-	);
-
-	Parameters.Add_Value(
-		NULL	, "COORD_X"		, _TL("Include X Coordinate"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "COORD_Y"		, _TL("Include Y Coordinate"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "INTERCEPT"	, _TL("Intercept"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("include all"),
-			_TL("forward"),
-			_TL("backward"),
-			_TL("stepwise")
-		), 3
-	);
-
-	Parameters.Add_Value(
-		NULL	, "P_IN"		, _TL("P in"),
-		_TL("Level of significance for automated predictor selection, given as percentage"),
-		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "P_OUT"		, _TL("P out"),
-		_TL("Level of significance for automated predictor selection, given as percentage"),
-		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"CROSSVAL"		, _TL("Cross Validation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("none"),
-			_TL("leave one out"),
-			_TL("2-fold"),
-			_TL("k-fold")
-		), 0
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CROSSVAL_K"	, _TL("Cross Validation Subsamples"),
-		_TL("number of subsamples for k-fold cross validation"),
-		PARAMETER_TYPE_Int, 10, 2, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CPoint_Multi_Grid_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CROSSVAL")) )
-	{
-		pParameters->Get_Parameter("CROSSVAL_K")->Set_Enabled(pParameter->asInt() == 3);	// k-fold
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Multi_Grid_Regression::On_Execute(void)
-{
-	bool					bResult;
-	int						iAttribute;
-	double					P_in, P_out;
-	CSG_Strings				Names;
-	CSG_Matrix				Samples;
-	CSG_Shapes				*pShapes;
-	CSG_Grid				*pRegression;
-	CSG_Parameter_Grid_List	*pGrids;
-
-	//-----------------------------------------------------
-	pGrids			= Parameters("GRIDS")		->asGridList();
-	pRegression		= Parameters("REGRESSION")	->asGrid();
-	pShapes			= Parameters("SHAPES")		->asShapes();
-	iAttribute		= Parameters("ATTRIBUTE")	->asInt();
-	P_in			= Parameters("P_IN")		->asDouble() / 100.0;
-	P_out			= Parameters("P_OUT")		->asDouble() / 100.0;
-
-	//-----------------------------------------------------
-	if( !Get_Samples(pGrids, pShapes, iAttribute, Samples, Names) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	m_Regression.Set_With_Intercept(Parameters("INTERCEPT")->asBool());
-
-	switch( Parameters("METHOD")->asInt() )
-	{
-	default:
-	case 0:	bResult	= m_Regression.Get_Model         (Samples             , &Names);	break;
-	case 1:	bResult	= m_Regression.Get_Model_Forward (Samples, P_in       , &Names);	break;
-	case 2:	bResult	= m_Regression.Get_Model_Backward(Samples,       P_out, &Names);	break;
-	case 3:	bResult	= m_Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names);	break;
-	}
-
-	if( bResult == false )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Message_Add(m_Regression.Get_Info(), false);
-
-	//-----------------------------------------------------
-	int	CrossVal;
-
-	switch( Parameters("CROSSVAL")->asInt() )
-	{
-	default:	CrossVal	= 0;									break;	// none
-	case 1:		CrossVal	= 1;									break;	// leave one out (LOOVC)
-	case 2:		CrossVal	= 2;									break;	// 2-fold
-	case 3:		CrossVal	= Parameters("CROSSVAL_K")->asInt();	break;	// k-fold
-	}
-
-	if( CrossVal > 0 && m_Regression.Get_CrossValidation(CrossVal) )
-	{
-		Message_Add(CSG_String::Format(SG_T("\n%s:\n"      ), _TL("Cross Validation")), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%s\n"  ), _TL("Type"   ), Parameters("CROSSVAL")->asString() ), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%d\n"  ), _TL("Samples"), m_Regression.Get_CV_nSamples()     ), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%f\n"  ), _TL("RMSE"   ), m_Regression.Get_CV_RMSE()         ), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("NRMSE"  ), m_Regression.Get_CV_NRMSE() * 100.0), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("R2"     ), m_Regression.Get_CV_R2()    * 100.0), false);
-	}
-
-	//-----------------------------------------------------
-	Set_Regression(pGrids, pRegression, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Regression Model")));
-
-	Set_Residuals(pShapes, iAttribute, pRegression);
-
-	//-----------------------------------------------------
-	if( Parameters("INFO_COEFF")->asTable() )
-	{
-		Parameters("INFO_COEFF")->asTable()->Assign(m_Regression.Get_Info_Regression());
-		Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients"));
-	}
-
-	if( Parameters("INFO_MODEL")->asTable() )
-	{
-		Parameters("INFO_MODEL")->asTable()->Assign(m_Regression.Get_Info_Model());
-		Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model"));
-	}
-
-	if( Parameters("INFO_STEPS")->asTable() )
-	{
-		Parameters("INFO_STEPS")->asTable()->Assign(m_Regression.Get_Info_Steps());
-		Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps"));
-	}
-
-	//-----------------------------------------------------
-	m_Regression.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Multi_Grid_Regression::Get_Samples(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pShapes, int iAttribute, CSG_Matrix &Samples, CSG_Strings &Names)
-{
-	int			iGrid;
-	double		zGrid;
-	CSG_Vector	Sample;
-
-	//-----------------------------------------------------
-	int		Interpolation	= Parameters("INTERPOL")	->asInt();
-	bool	bCoord_X		= Parameters("COORD_X")		->asBool();
-	bool	bCoord_Y		= Parameters("COORD_Y")		->asBool();
-
-	Names	+= pShapes->Get_Field_Name(iAttribute);		// Dependent Variable
-
-	for(iGrid=0; iGrid<pGrids->Get_Count(); iGrid++)	// Independent Variables
-	{
-		Names	+= pGrids->asGrid(iGrid)->Get_Name();
-	}
-
-	if( bCoord_X )	{	Names	+= SG_T("X");	}
-	if( bCoord_Y )	{	Names	+= SG_T("Y");	}
-
-	Sample.Create(1 + pGrids->Get_Count() + (bCoord_X ? 1 : 0) + (bCoord_Y ? 1 : 0));
-
-	//-----------------------------------------------------
-	for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
-
-		if( !pShape->is_NoData(iAttribute) )
-		{
-			Sample[0]	= pShape->asDouble(iAttribute);
-
-			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-			{
-				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-				{
-					bool		bAdd	= true;
-					TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
-
-					for(iGrid=0; iGrid<pGrids->Get_Count() && bAdd; iGrid++)
-					{
-						if( pGrids->asGrid(iGrid)->Get_Value(Point, zGrid, Interpolation) )
-						{
-							Sample[1 + iGrid]	= zGrid;
-						}
-						else
-						{
-							bAdd	= false;
-						}
-					}
-
-					if( bAdd )
-					{
-						if( bCoord_X )	{	Sample[1 + iGrid++]	= Point.x;	}
-						if( bCoord_Y )	{	Sample[1 + iGrid++]	= Point.y;	}
-
-						Samples.Add_Row(Sample);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( Samples.Get_NRows() >= pGrids->Get_Count() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Multi_Grid_Regression::Set_Regression(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pRegression, const CSG_String &Name)
-{
-	if( !pRegression )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			iGrid, nGrids, x, y;
-	TSG_Point	p;
-
-	int		Interpolation	= Parameters("INTERPOL")	->asInt();
-
-	CSG_Grid	**ppGrids	= (CSG_Grid **)SG_Malloc(m_Regression.Get_nPredictors() * sizeof(CSG_Grid *));
-
-	int	iCoord_X	= -1;
-	int	iCoord_Y	= -1;
-
-	for(iGrid=0, nGrids=0; iGrid<m_Regression.Get_nPredictors(); iGrid++)
-	{
-		if( m_Regression.Get_Predictor(iGrid) < pGrids->Get_Count() )
-		{
-			ppGrids[nGrids++]	= pGrids->asGrid(m_Regression.Get_Predictor(iGrid));
-		}
-		else if( m_Regression.Get_Predictor(iGrid) == pGrids->Get_Count() && Parameters("COORD_X")->asBool() )
-		{
-			iCoord_X = iGrid;
-		}
-		else // if( m_Regression.Get_Predictor(iGrid) > pGrids->Get_Count() || Parameters("COORD_X")->asBool() == false )
-		{
-			iCoord_Y = iGrid;
-		}
-	}
-
-	pRegression->Set_Name(Name);
-
-	//-----------------------------------------------------
-	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
-	{
-		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
-		{
-			bool	bOkay;
-			double	z	= m_Regression.Get_RConst();
-
-			for(iGrid=0, bOkay=true; bOkay && iGrid<nGrids; iGrid++)
-			{
-				double	zGrid;
-
-				if( ppGrids[iGrid]->Get_Value(p, zGrid, Interpolation) )
-				{
-					z	+= m_Regression.Get_RCoeff(iGrid) * zGrid;
-				}
-				else
-				{
-					bOkay	= false;
-				}
-			}
-
-			//---------------------------------------------
-			if( bOkay )
-			{
-				if( iCoord_X >= 0 )
-				{
-					z	+= m_Regression.Get_RCoeff(iCoord_X) * p.x;
-				}
-
-				if( iCoord_Y >= 0 )
-				{
-					z	+= m_Regression.Get_RCoeff(iCoord_Y) * p.y;
-				}
-
-				pRegression->Set_Value (x, y, z);
-			}
-			else
-			{
-				pRegression->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	SG_Free(ppGrids);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Multi_Grid_Regression::Set_Residuals(CSG_Shapes *pShapes, int iAttribute, CSG_Grid *pRegression)
-{
-	CSG_Shapes	*pResiduals		= Parameters("RESIDUALS")->asShapes();
-
-	if( !pRegression || !pResiduals )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Residuals")));
-	pResiduals->Add_Field(pShapes->Get_Field_Name(iAttribute), SG_DATATYPE_Double);
-	pResiduals->Add_Field("TREND"	, SG_DATATYPE_Double);
-	pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
-
-	int	Interpolation	= Parameters("INTERPOL")->asInt();
-
-	//-------------------------------------------------
-	for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
-
-		if( !pShape->is_NoData(iAttribute) )
-		{
-			double	zShape	= pShape->asDouble(iAttribute);
-
-			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-			{
-				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-				{
-					double		zGrid;
-					TSG_Point	Point	= pShape->Get_Point(iPoint, iPart);
-
-					if( pRegression->Get_Value(Point, zGrid, Interpolation) )
-					{
-						CSG_Shape	*pResidual	= pResiduals->Add_Shape();
-
-						pResidual->Add_Point(Point);
-						pResidual->Set_Value(0, zShape);
-						pResidual->Set_Value(1, zGrid);
-						pResidual->Set_Value(2, zShape - zGrid);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-//	//-----------------------------------------------------
-//	Parameters.Add_Choice(
-//		NULL	,"CORRECTION"	, _TL("Adjustment"),
-//		_TL(""),
-//		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-//			_TL("Smith"),
-//			_TL("Wherry 1"),
-//			_TL("Wherry 2"),
-//			_TL("Olkin & Pratt"),
-//			_TL("Pratt"),
-//			_TL("Claudy 3")
-//		), 1
-//	);
-//
-//	TSG_Regression_Correction	m_Correction;
-//
-//	switch( Parameters("CORRECTION")->asInt() )
-//	{
-//	case 0:	m_Correction	= REGRESSION_CORR_Smith;		break;
-//	case 1:	m_Correction	= REGRESSION_CORR_Wherry_1;		break;
-//	case 2:	m_Correction	= REGRESSION_CORR_Wherry_2;		break;
-//	case 3:	m_Correction	= REGRESSION_CORR_Olkin_Pratt;	break;
-//	case 4:	m_Correction	= REGRESSION_CORR_Pratt;		break;
-//	case 5:	m_Correction	= REGRESSION_CORR_Claudy_3;		break;
-//	}
-//
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h
deleted file mode 100644
index 879611a..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/**********************************************************
- * Version $Id: point_multi_grid_regression.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              point_multi_grid_regression.h            //
-//                                                       //
-//                 Copyright (C) 2004 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__point_multi_grid_regression_H
-#define HEADER_INCLUDED__point_multi_grid_regression_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPoint_Multi_Grid_Regression : public CSG_Module_Grid
-{
-public:
-	CPoint_Multi_Grid_Regression(void);
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	CSG_Regression_Multiple		m_Regression;
-
-
-	bool						Get_Samples			(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pShapes, int iAttribute, CSG_Matrix &Samples, CSG_Strings &Names);
-
-	bool						Set_Regression		(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pRegression, const CSG_String &Name);
-
-	bool						Set_Residuals		(CSG_Shapes *pShapes, int iAttribute, CSG_Grid *pRegression);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__point_multi_grid_regression_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp
deleted file mode 100644
index 9fa3278..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-/**********************************************************
- * Version $Id: point_trend_surface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                point_trend_surface.cpp                //
-//                                                       //
-//                 Copyright (C) 2010 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 "point_trend_surface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPoint_Trend_Surface::CPoint_Trend_Surface(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Polynomial Regression"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Reference:\n"
-		" - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "ATTRIBUTE"	, _TL("Attribute"),
-		_TL("")
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "RESIDUALS"	, _TL("Residuals"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "POLYNOM"		, _TL("Polynom"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-			_TL("simple planar surface"),	// a + bx + cy
-			_TL("bi-linear saddle"),		// a + bx + cy + dxy
-			_TL("quadratic surface"),		// a + bx + cy + dxy + ex2 + fy2
-			_TL("cubic surface"),			// a + bx + cy + dxy + ex2 + fy2 + gx2y + hxy2 + ix3 + iy3
-			_TL("user defined")
-		), 0
-	);
-
-	pNode	= Parameters.Add_Node(
-		NULL	, "NODE_USER"	, _TL("User Defined Polynomial"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode	, "XORDER"		, _TL("Maximum X Order"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "YORDER"		, _TL("Maximum Y Order"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 4, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "TORDER"		, _TL("Maximum Total Order"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 4, 0, true
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		NULL	, "TARGET"		, _TL("Trend Surface"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("user defined"),
-			_TL("grid")
-		), 0
-	);
-
-	m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid")	, _TL("")));
-	m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid")			, _TL("")));
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CPoint_Trend_Surface::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Trend_Surface::On_Execute(void)
-{
-	int			iAttribute;
-	CSG_Shapes	*pPoints, *pResiduals;
-	CSG_Grid	*pRegression;
-
-	//-----------------------------------------------------
-	pPoints		= Parameters("POINTS")		->asShapes();
-	pResiduals	= Parameters("RESIDUALS")	->asShapes();
-	iAttribute	= Parameters("ATTRIBUTE")	->asInt();
-
-	switch( Parameters("POLYNOM")->asInt() )
-	{
-	case 0:	m_xOrder = 1; m_yOrder = 1; m_tOrder = 1;	break;	// simple planar surface	// a + bx + cy
-	case 1:	m_xOrder = 1; m_yOrder = 1; m_tOrder = 2;	break;	// bi-linear saddle"),		// a + bx + cy + dxy
-	case 2:	m_xOrder = 2; m_yOrder = 2; m_tOrder = 2;	break;	// quadratic surface"),		// a + bx + cy + dxy + ex2 + fy2
-	case 3:	m_xOrder = 3; m_yOrder = 3; m_tOrder = 3;	break;	// cubic surface"),			// a + bx + cy + dxy + ex2 + fy2 + gx2y + hxy2 + ix3 + iy3
-	case 4:
-		m_xOrder	= Parameters("XORDER")->asInt();
-		m_yOrder	= Parameters("YORDER")->asInt();
-		m_tOrder	= Parameters("TORDER")->asInt();
-		break;
-	}
-
-	//-----------------------------------------------------
-	if( !Get_Regression(pPoints, iAttribute) )
-	{
-		return( false );
-	}
-
-	Set_Message();
-
-	//-----------------------------------------------------
-	pRegression		= NULL;
-
-	switch( Parameters("TARGET")->asInt() )
-	{
-	case 0:	// user defined...
-		if( m_Grid_Target.Init_User(pPoints->Get_Extent()) && Dlg_Parameters("USER") )
-		{
-			pRegression	= m_Grid_Target.Get_User();
-		}
-		break;
-
-	case 1:	// grid...
-		if( Dlg_Parameters("GRID") )
-		{
-			pRegression	= m_Grid_Target.Get_Grid();
-		}
-		break;
-	}
-
-	if( pRegression == NULL )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Trend Surface")));
-
-	Set_Regression(pRegression);
-
-	Set_Residuals(pPoints, iAttribute, pResiduals, pRegression);
-
-	m_Coefficients.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CPoint_Trend_Surface::Get_Power(const SG_Char *Value, int Power)
-{
-	if( Power > 0 )
-	{
-		if( Power > 1 )
-		{
-			return( CSG_String::Format(SG_T("%s%d"), Value, Power) );
-		}
-
-		return( Value );
-	}
-
-	return( SG_T("") );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPoint_Trend_Surface::Get_Regression(CSG_Shapes *pPoints, int iAttribute)
-{
-	//-----------------------------------------------------
-	int		i, j, Field;
-
-	m_Names.Clear();
-
-	m_Names	+= pPoints->Get_Name();
-
-	for(i=1; i<=m_xOrder; i++)
-	{
-		m_Names	+= Get_Power(SG_T("x"), i);
-	}
-
-	for(i=1; i<=m_yOrder; i++)
-	{
-		m_Names	+= Get_Power(SG_T("y"), i);
-
-		for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
-		{
-			m_Names	+= Get_Power(SG_T("x"), j) + Get_Power(SG_T("y"), i);
-		}
-	}
-
-	//-----------------------------------------------------
-	CSG_Vector	Y, xPow, yPow;
-	CSG_Matrix	X;
-
-	Y.Create(pPoints->Get_Count());
-	X.Create(m_Names.Get_Count(), pPoints->Get_Count());
-	
-	xPow.Create(m_xOrder + 1);
-	yPow.Create(m_yOrder + 1);
-
-	xPow[0]	= 1.0;
-	yPow[0]	= 1.0;
-
-	//-----------------------------------------------------
-	for(int iShape=0; iShape<pPoints->Get_Count() && Set_Progress(iShape, pPoints->Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape	= pPoints->Get_Shape(iShape);
-
-		if( !pShape->is_NoData(iAttribute) )
-		{
-			double		zShape	= pShape->asDouble(iAttribute);
-			TSG_Point	Point	= pShape->Get_Point(0);
-
-			Y[iShape]		= zShape;
-			X[iShape][0]	= 1.0;
-
-			for(i=1, Field=1; i<=m_xOrder; i++)
-			{
-				X[iShape][Field++]	= xPow[i]	= xPow[i - 1] * Point.x;
-			}
-
-			for(i=1; i<=m_yOrder; i++)
-			{
-				X[iShape][Field++]	= yPow[i]	= yPow[i - 1] * Point.y;
-
-				for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
-				{
-					X[iShape][Field++]	= xPow[j] * yPow[i];
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	CSG_Matrix	Xt, XtXinv;
-
-	Xt		= X;
-	Xt		.Set_Transpose();
-
-	XtXinv	= Xt * X;
-	XtXinv	.Set_Inverse();
-
-	m_Coefficients	= XtXinv * Xt * Y;
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CPoint_Trend_Surface::Set_Regression(CSG_Grid *pRegression)
-{
-	int			x, y, i, j, Field;
-	double		z;
-	TSG_Point	Point;
-	CSG_Vector	xPow(m_xOrder + 1), yPow(m_yOrder + 1);
-
-	xPow[0]	= 1.0;
-	yPow[0]	= 1.0;
-
-	for(y=0, Point.y=pRegression->Get_YMin(); y<pRegression->Get_NY() && Set_Progress(y, pRegression->Get_NY()); y++, Point.y+=pRegression->Get_Cellsize())
-	{
-		for(x=0, Point.x=pRegression->Get_XMin(); x<pRegression->Get_NX(); x++, Point.x+=pRegression->Get_Cellsize())
-		{
-			z	 = m_Coefficients[0];
-
-			for(i=1, Field=1; i<=m_xOrder; i++)
-			{
-				z	+= m_Coefficients[Field++] * (xPow[i] = xPow[i - 1] * Point.x);
-			}
-
-			for(i=1; i<=m_yOrder; i++)
-			{
-				z	+= m_Coefficients[Field++] * (yPow[i] = yPow[i - 1] * Point.y);
-
-				for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
-				{
-					z	+= m_Coefficients[Field++] * xPow[j] * yPow[i];
-				}
-			}
-
-			pRegression->Set_Value(x, y, z);
-		}
-	}
-
-	DataObject_Update(pRegression);
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CPoint_Trend_Surface::Set_Residuals(CSG_Shapes *pPoints, int iAttribute, CSG_Shapes *pResiduals, CSG_Grid *pRegression)
-{
-	int			iPoint, iPart, iShape;
-	double		zShape, zGrid;
-	TSG_Point	Point;
-	CSG_Shape	*pShape, *pResidual;
-
-	//-----------------------------------------------------
-	if( pResiduals )
-	{
-		pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Residuals")));
-		pResiduals->Add_Field(pPoints->Get_Field_Name(iAttribute), SG_DATATYPE_Double);
-		pResiduals->Add_Field("POLYNOM" , SG_DATATYPE_Double);
-		pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double);
-
-		//-------------------------------------------------
-		for(iShape=0; iShape<pPoints->Get_Count() && Set_Progress(iShape, pPoints->Get_Count()); iShape++)
-		{
-			pShape	= pPoints->Get_Shape(iShape);
-
-			if( !pShape->is_NoData(iAttribute) )
-			{
-				zShape	= pShape->asDouble(iAttribute);
-
-				for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-				{
-					for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-					{
-						Point	= pShape->Get_Point(iPoint, iPart);
-
-						if( pRegression->Get_Value(Point, zGrid) )
-						{
-							pResidual	= pResiduals->Add_Shape();
-							pResidual->Add_Point(Point);
-							pResidual->Set_Value(0, zShape);
-							pResidual->Set_Value(1, zGrid);
-							pResidual->Set_Value(2, zShape - zGrid);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-void CPoint_Trend_Surface::Set_Message(void)
-{
-	int			i;
-	CSG_String	s;
-
-	//-----------------------------------------------------
-	s	+= CSG_String::Format(SG_T("\n%s:"), _TL("Regression"));
-
-	//-----------------------------------------------------
-	s	+= CSG_String::Format(SG_T("\n z = A"));
-
-	for(i=1; i<m_Coefficients.Get_N(); i++)
-	{
-		s	+= CSG_String::Format(SG_T(" + %c%s"), 'A' + i, m_Names[i].c_str());
-	}
-
-	s	+= SG_T("\n");
-
-	//-----------------------------------------------------
-	s	+= CSG_String::Format(SG_T("\n z = %f"), m_Coefficients[0]);
-
-	for(i=1; i<m_Coefficients.Get_N(); i++)
-	{
-		s	+= CSG_String::Format(SG_T(" %+f*%s"), m_Coefficients[i], m_Names[i].c_str());
-	}
-
-	s	+= SG_T("\n");
-
-	//-----------------------------------------------------
-	Message_Add(s, false);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.h
deleted file mode 100644
index 0daeca3..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/**********************************************************
- * Version $Id: point_trend_surface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 point_trend_surface.h                 //
-//                                                       //
-//                 Copyright (C) 2010 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__point_trend_surface_H
-#define HEADER_INCLUDED__point_trend_surface_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPoint_Trend_Surface : public CSG_Module
-{
-public:
-	CPoint_Trend_Surface(void);
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	int							m_xOrder, m_yOrder, m_tOrder;
-
-	CSG_Parameters_Grid_Target	m_Grid_Target;
-
-	CSG_Vector					m_Coefficients;
-
-	CSG_Strings					m_Names;
-
-	CSG_String					Get_Power				(const SG_Char *Value, int Power);
-
-	bool						Get_Regression			(CSG_Shapes *pPoints, int iAttribute);
-	bool						Set_Regression			(CSG_Grid *pRegression);
-
-	bool						Set_Residuals			(CSG_Shapes *pPoints, int iAttribute, CSG_Shapes *pResiduals, CSG_Grid *pRegression);
-	void						Set_Message				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__point_trend_surface_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_regression_multiple.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/table_regression_multiple.cpp
deleted file mode 100644
index 0b228b5..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_regression_multiple.cpp
+++ /dev/null
@@ -1,482 +0,0 @@
-/**********************************************************
- * Version $Id: table_regression_multiple.cpp 1098 2011-06-16 16:06:32Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             table_regression_multiple.cpp             //
-//                                                       //
-//                 Copyright (C) 2012 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 "table_regression_multiple.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CTable_Regression_Multiple_Base::Initialise(void)
-{
-	//-----------------------------------------------------
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
-
-	Set_Description	(_TW(
-		"Multiple linear regression analysis using ordinary least squares."
-	));
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pNode	= Parameters("TABLE");
-
-	Parameters.Add_Table_Field(
-		pNode	, "DEPENDENT"	, _TL("Dependent Variable"),
-		_TL("")
-	);
-
-	Parameters.Add_Parameters(
-		pNode	, "PREDICTORS"	, _TL("Independent Variables"),
-		_TL("")
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_COEFF"	, _TL("Details: Coefficients"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_MODEL"	, _TL("Details: Model"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Table(
-		NULL	, "INFO_STEPS"	, _TL("Details: Steps"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("include all"),
-			_TL("forward"),
-			_TL("backward"),
-			_TL("stepwise")
-		), 3
-	);
-
-	Parameters.Add_Value(
-		NULL	, "P_IN"		, _TL("P in"),
-		_TL("Level of significance for automated predictor selection, given as percentage"),
-		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "P_OUT"		, _TL("P out"),
-		_TL("Level of significance for automated predictor selection, given as percentage"),
-		PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	,"CROSSVAL"		, _TL("Cross Validation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("none"),
-			_TL("leave one out"),
-			_TL("2-fold"),
-			_TL("k-fold")
-		), 0
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CROSSVAL_K"	, _TL("Cross Validation Subsamples"),
-		_TL("number of subsamples for k-fold cross validation"),
-		PARAMETER_TYPE_Int, 10, 2, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CTable_Regression_Multiple_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) )
-	{
-		CSG_Table		*pTable			= pParameter->asTable();
-		CSG_Parameters	*pPredictors	= pParameters->Get_Parameter("PREDICTORS")->asParameters();
-
-		pPredictors->Del_Parameters();
-
-		if( pTable )
-		{
-			for(int i=0; i<pTable->Get_Field_Count(); i++)
-			{
-				if( SG_Data_Type_is_Numeric(pTable->Get_Field_Type(i)) )
-				{
-					pPredictors->Add_Value(NULL, SG_Get_String(i, 0), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-int CTable_Regression_Multiple_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
-	{
-		pParameters->Get_Parameter("P_IN" )->Set_Enabled(pParameter->asInt() == 1 || pParameter->asInt() == 3);	// forward or stepwise
-		pParameters->Get_Parameter("P_OUT")->Set_Enabled(pParameter->asInt() == 2 || pParameter->asInt() == 3);	// backward or stepwise
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CROSSVAL")) )
-	{
-		pParameters->Get_Parameter("CROSSVAL_K")->Set_Enabled(pParameter->asInt() == 3);	// k-fold
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTable_Regression_Multiple_Base::On_Execute(void)
-{
-	//-----------------------------------------------------
-	CSG_Parameters	*pPredictors	= Parameters("PREDICTORS")->asParameters();
-
-	if( pPredictors->Get_Count() <= 0 )
-	{
-		Message_Add(_TL("no predictors available"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			Dependent, iPredictor, nPredictors, *Predictors, iSample;
-	CSG_Strings	Names;
-	CSG_Table	*pTable;
-
-	Dependent	= Parameters("DEPENDENT")->asInt();
-	Predictors	= new int[pPredictors->Get_Count()];
-
-	pTable		= Parameters("TABLE")->asTable();
-
-	Names	+= pTable->Get_Field_Name(Dependent);
-
-	for(iPredictor=0, nPredictors=0; iPredictor<pPredictors->Get_Count(); iPredictor++)	// Independent Variables
-	{
-		if( pPredictors->Get_Parameter(iPredictor)->asBool() )
-		{
-			Names	+= pTable->Get_Field_Name(
-				Predictors[nPredictors++]	= CSG_String(pPredictors->Get_Parameter(iPredictor)->Get_Identifier()).asInt()
-			);
-		}
-	}
-
-	if( nPredictors <= 0 )
-	{
-		Message_Add(_TL("no predictors in selection"));
-
-		delete[](Predictors);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Vector	Sample(1 + nPredictors);
-	CSG_Matrix	Samples;
-
-	for(iSample=0; iSample<pTable->Get_Count(); iSample++)
-	{
-		CSG_Table_Record	*pRecord	= pTable->Get_Record(iSample);
-
-		if( !pRecord->is_NoData(Dependent) )
-		{
-			bool	bOkay	= true;
-
-			Sample[0]	= pRecord->asDouble(Dependent);
-
-			for(iPredictor=0; iPredictor<nPredictors && bOkay; iPredictor++)
-			{
-				if( !pRecord->is_NoData(Predictors[iPredictor]) )
-				{
-					Sample[1 + iPredictor]	= pRecord->asDouble(Predictors[iPredictor]);
-				}
-				else
-				{
-					bOkay	= false;
-				}
-			}
-
-			if( bOkay )
-			{
-				Samples.Add_Row(Sample);
-			}
-		}
-	}
-
-	if( Samples.Get_NRows() <= 0 )
-	{
-		Message_Add(_TL("no valid samples in data set"));
-
-		delete[](Predictors);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Regression_Multiple	Regression;
-
-	double	P_in	= Parameters("P_IN" )->asDouble();
-	double	P_out	= Parameters("P_OUT")->asDouble();
-
-	switch( Parameters("METHOD")->asInt() )
-	{
-	default:
-	case 0:	if( !Regression.Get_Model         (Samples             , &Names) )	return( false );	break;
-	case 1:	if( !Regression.Get_Model_Forward (Samples, P_in       , &Names) )	return( false );	break;
-	case 2:	if( !Regression.Get_Model_Backward(Samples,       P_out, &Names) )	return( false );	break;
-	case 3:	if( !Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names) )	return( false );	break;
-	}
-
-	Message_Add(Regression.Get_Info(), false);
-
-	//-----------------------------------------------------
-	int	CrossVal;
-
-	switch( Parameters("CROSSVAL")->asInt() )
-	{
-	default:	CrossVal	= 0;									break;	// none
-	case 1:		CrossVal	= 1;									break;	// leave one out (LOOVC)
-	case 2:		CrossVal	= 2;									break;	// 2-fold
-	case 3:		CrossVal	= Parameters("CROSSVAL_K")->asInt();	break;	// k-fold
-	}
-
-	if( CrossVal > 0 && Regression.Get_CrossValidation(CrossVal) )
-	{
-		Message_Add(CSG_String::Format(SG_T("\n%s:\n"      ), _TL("Cross Validation")), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%s\n"  ), _TL("Type"   ), Parameters("CROSSVAL")->asString()), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%d\n"  ), _TL("Samples"), Regression.Get_CV_nSamples()      ), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%f\n"  ), _TL("RMSE"   ), Regression.Get_CV_RMSE()          ), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("NRMSE"  ), Regression.Get_CV_NRMSE()  * 100.0), false);
-		Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("R2"     ), Regression.Get_CV_R2()     * 100.0), false);
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("INFO_COEFF")->asTable() )
-	{
-		Parameters("INFO_COEFF")->asTable()->Assign(Regression.Get_Info_Regression());
-		Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients"));
-	}
-
-	if( Parameters("INFO_MODEL")->asTable() )
-	{
-		Parameters("INFO_MODEL")->asTable()->Assign(Regression.Get_Info_Model());
-		Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model"));
-	}
-
-	if( Parameters("INFO_STEPS")->asTable() )
-	{
-		Parameters("INFO_STEPS")->asTable()->Assign(Regression.Get_Info_Steps());
-		Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps"));
-	}
-
-	//-----------------------------------------------------
-	CSG_Table	*pResults	= Parameters("RESULTS")->asTable();
-
-	if( pResults != NULL && pResults != pTable )
-	{
-		if( pResults->Get_ObjectType() == DATAOBJECT_TYPE_Shapes
-		&&	pTable  ->Get_ObjectType() == DATAOBJECT_TYPE_Shapes )
-		{
-			((CSG_Shapes *)pResults)->Create(*((CSG_Shapes *)pTable));
-		}
-		else
-		{
-			pResults->Create(*pTable);
-		}
-
-		pResults->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pTable->Get_Name(), _TL("Regression")));
-
-		pTable	= pResults;
-	}
-
-	//-----------------------------------------------------
-	int	Offset	= pTable->Get_Field_Count();
-
-	pTable->Add_Field(_TL("PREDICTED"), SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("RESIDUAL" ), SG_DATATYPE_Double);
-
-	for(iSample=0; iSample<pTable->Get_Count(); iSample++)
-	{
-		CSG_Table_Record	*pRecord	= pTable->Get_Record(iSample);
-
-		bool	bOkay	= false;
-		double	z		= Regression.Get_RConst();
-
-		if( !pRecord->is_NoData(Dependent) )
-		{
-			for(iPredictor=0, bOkay=true; iPredictor<Regression.Get_nPredictors() && bOkay; iPredictor++)
-			{
-				if( !pRecord->is_NoData(Predictors[iPredictor]) )
-				{
-					z	+= Regression.Get_RCoeff(Regression.Get_Predictor(iPredictor)) * pRecord->asDouble(Predictors[iPredictor]);
-				}
-				else
-				{
-					bOkay	= false;
-				}
-			}
-		}
-
-		if( bOkay )
-		{
-			pRecord->Set_Value(Offset + 0, z);
-			pRecord->Set_Value(Offset + 1, z - pRecord->asDouble(Dependent));
-		}
-		else
-		{
-			pRecord->Set_NoData(Offset + 0);
-			pRecord->Set_NoData(Offset + 1);
-		}
-	}
-
-	if( pTable != Parameters("RESULTS")->asTable() )
-	{
-		DataObject_Update(pTable);
-	}
-
-	//-----------------------------------------------------
-	delete[](Predictors);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Regression_Multiple::CTable_Regression_Multiple(void)
-	: CTable_Regression_Multiple_Base()
-{
-	Set_Name		(_TL("Multiple Linear Regression Analysis"));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"	, _TL("Table"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL	, "RESULTS"	, _TL("Results"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Initialise();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Regression_Multiple_Shapes::CTable_Regression_Multiple_Shapes(void)
-	: CTable_Regression_Multiple_Base()
-{
-	Set_Name		(_TL("Multiple Linear Regression Analysis (Shapes)"));
-
-	Parameters.Add_Shapes(
-		NULL	, "TABLE"	, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "RESULTS"	, _TL("Results"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Initialise();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_regression_multiple.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/table_regression_multiple.h
deleted file mode 100644
index d6390c4..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_regression_multiple.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/**********************************************************
- * Version $Id: table_regression_multiple.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              table_regression_multiple.h              //
-//                                                       //
-//                 Copyright (C) 2012 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__table_regression_multiple_H
-#define HEADER_INCLUDED__table_regression_multiple_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Regression_Multiple_Base : public CSG_Module
-{
-protected:
-
-	void						Initialise				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-//---------------------------------------------------------
-class CTable_Regression_Multiple : public CTable_Regression_Multiple_Base
-{
-public:
-	CTable_Regression_Multiple(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Table") );	}
-
-};
-
-//---------------------------------------------------------
-class CTable_Regression_Multiple_Shapes : public CTable_Regression_Multiple_Base
-{
-public:
-	CTable_Regression_Multiple_Shapes(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Shapes") );	}
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__table_regression_multiple_H
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.cpp b/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.cpp
deleted file mode 100644
index b7b1998..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/**********************************************************
- * Version $Id: Table_Trend.cpp 1098 2011-06-16 16:06:32Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   table_trend.cpp                     //
-//                                                       //
-//                 Copyright (C) 2006 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "table_trend.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CTable_Trend_Base::Initialise(void)
-{
-	//-----------------------------------------------------
-	Set_Author		(SG_T("O.Conrad (c) 2006"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pNode	= Parameters("TABLE");
-
-	Parameters.Add_Table_Field(
-		pNode	, "FIELD_X"		, _TL("X Values"),
-		_TL("")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "FIELD_Y"		, _TL("Y Values"),
-		_TL("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "FORMULA"		, _TL("Formula"),
-		_TL(""),
-		SG_T("m * x + b")
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "FORMULAS"	, _TL("Pre-defined Formulas"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("Linear: a + b * x"),
-			_TL("Quadric: a + b * x + c * x^2"),
-			_TL("Cubic: a + b * x + c * x^2 + d * x^3"),
-			_TL("Logarithmic: a + b * ln(x)"),
-			_TL("Power: a + b * x^c"),
-			_TL("a + b / x"),
-			_TL("a + b * (1 - exp(-x / c))"),
-			_TL("a + b * (1 - exp(-(x / c)^2))")
-		), 0
-	);
-
-	Parameters.Add_Table(
-		NULL	, "TREND"		, _TL("Table (with Trend)"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-}
-
-//---------------------------------------------------------
-int CTable_Trend_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULAS")) )
-	{
-		const SG_Char	*Formula;
-
-		switch( pParameter->asInt() )
-		{
-		default:	return( false );
-		case 0:	Formula	= SG_T("a + b * x");						break;
-		case 1:	Formula	= SG_T("a + b * x + c * x^2");				break;
-		case 2:	Formula	= SG_T("a + b * x + c * x^2 + d * x^3");	break;
-		case 3:	Formula	= SG_T("a + b * ln(x)");					break;
-		case 4:	Formula	= SG_T("a + b * x^c");						break;
-		case 5:	Formula	= SG_T("a + b / x");						break;
-		case 6:	Formula	= SG_T("a + b * (1 - exp(-x / c))");		break;
-		case 7:	Formula	= SG_T("a + b * (1 - exp(-(x / c)^2))");	break;
-		}
-
-		pParameters->Get_Parameter("FORMULA")->Set_Value(Formula);
-	}
-
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULA")) )
-	{
-		if( !m_Trend.Set_Formula(pParameter->asString()) )
-		{
-			Message_Dlg(m_Trend.Get_Error(), _TL("Error in Formula"));
-
-			return( false );
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CTable_Trend_Base::On_Execute(void)
-{
-	int					i, j, xField, yField;
-	CSG_String			Name;
-	CSG_Table_Record	*pRecord;
-	CSG_Table			*pTable;
-
-	pTable	= Parameters("TABLE")	->asTable();
-	xField	= Parameters("FIELD_X")	->asInt();
-	yField	= Parameters("FIELD_Y")	->asInt();
-
-	//-----------------------------------------------------
-	if( m_Trend.Set_Formula(Parameters("FORMULA")->asString()) )
-	{
-		m_Trend.Clr_Data();
-
-		for(i=0; i<pTable->Get_Record_Count(); i++)
-		{
-			pRecord	= pTable->Get_Record(i);
-
-			m_Trend.Add_Data(pRecord->asDouble(xField), pRecord->asDouble(yField));
-		}
-
-		//-------------------------------------------------
-		if( m_Trend.Get_Trend() )
-		{
-			Message_Add(SG_T("\n"), false);
-			Message_Add(m_Trend.Get_Formula(), false);
-			Message_Add(SG_T("\n"), false);
-			Message_Add(CSG_String::Format(SG_T("R2 : %f"), 100.0 * m_Trend.Get_R2()), false);
-
-			if( Parameters("TREND")->asTable() == NULL )
-			{
-				pTable->Add_Field("TREND"	, SG_DATATYPE_Double);
-
-				for(i=0, j=pTable->Get_Field_Count()-1; i<m_Trend.Get_Data_Count(); i++)
-				{
-					pRecord	= pTable->Get_Record(i);
-					pRecord->Set_Value(j, m_Trend.Get_Value(m_Trend.Get_Data_X(i)));
-				}
-			}
-			else
-			{
-				Name.Printf(SG_T("%s [%s]"), pTable->Get_Name(), _TL("Trend"));
-				pTable	= Parameters("TREND")->asTable();
-				pTable->Destroy();
-				pTable->Set_Name(Name);
-				pTable->Add_Field("X"		, SG_DATATYPE_Double);
-				pTable->Add_Field("Y"		, SG_DATATYPE_Double);
-				pTable->Add_Field("Y_TREND"	, SG_DATATYPE_Double);
-
-				for(i=0; i<m_Trend.Get_Data_Count(); i++)
-				{
-					pRecord	= pTable->Add_Record();
-					pRecord->Set_Value(0, m_Trend.Get_Data_X(i));
-					pRecord->Set_Value(1, m_Trend.Get_Data_Y(i));
-					pRecord->Set_Value(2, m_Trend.Get_Value(m_Trend.Get_Data_X(i)));
-				}
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Trend::CTable_Trend(void)
-	: CTable_Trend_Base()
-{
-	Set_Name		(_TL("Trend Analysis"));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"	, _TL("Table"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Initialise();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Trend_Shapes::CTable_Trend_Shapes(void)
-	: CTable_Trend_Base()
-{
-	Set_Name		(_TL("Trend Analysis (Shapes)"));
-
-	Parameters.Add_Shapes(
-		NULL	, "TABLE"	, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Initialise();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.h b/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.h
deleted file mode 100644
index 0676516..0000000
--- a/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/**********************************************************
- * Version $Id: Table_Trend.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//               geostatistics_regression                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     table_trend.h                     //
-//                                                       //
-//                 Copyright (C) 2006 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Table_Trend_H
-#define HEADER_INCLUDED__Table_Trend_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Trend_Base : public CSG_Module
-{
-protected:
-
-	void						Initialise				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-
-private:
-
-	CSG_Trend					m_Trend;
-
-};
-
-//---------------------------------------------------------
-class CTable_Trend : public CTable_Trend_Base
-{
-public:
-	CTable_Trend(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Table") );	}
-
-};
-
-//---------------------------------------------------------
-class CTable_Trend_Shapes : public CTable_Trend_Base
-{
-public:
-	CTable_Trend_Shapes(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("R:Shapes") );	}
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Table_Trend_H
diff --git a/src/modules_images/Makefile.am b/src/modules_images/Makefile.am
deleted file mode 100644
index 0881ef6..0000000
--- a/src/modules_images/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = modules_imagery modules_opencv modules_vigra
diff --git a/src/modules_images/Makefile.in b/src/modules_images/Makefile.in
deleted file mode 100644
index 8fdc1d3..0000000
--- a/src/modules_images/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = modules_imagery modules_opencv modules_vigra
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/Makefile.am b/src/modules_images/modules_imagery/Makefile.am
deleted file mode 100644
index 4a8a029..0000000
--- a/src/modules_images/modules_imagery/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = imagery_classification imagery_rga imagery_segmentation imagery_svm imagery_tools
diff --git a/src/modules_images/modules_imagery/Makefile.in b/src/modules_images/modules_imagery/Makefile.in
deleted file mode 100644
index 461da8a..0000000
--- a/src/modules_images/modules_imagery/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_imagery
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = imagery_classification imagery_rga imagery_segmentation imagery_svm imagery_tools
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_imagery/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_imagery/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_classification/Makefile.in b/src/modules_images/modules_imagery/imagery_classification/Makefile.in
deleted file mode 100644
index c87f8a5..0000000
--- a/src/modules_images/modules_imagery/imagery_classification/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_imagery/imagery_classification
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libimagery_classification_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libimagery_classification_la_OBJECTS = change_detection.lo \
-	classify_cluster_analysis.lo classify_supervised.lo \
-	classify_supervised_polygons.lo decision_tree.lo \
-	MLB_Interface.lo
-libimagery_classification_la_OBJECTS =  \
-	$(am_libimagery_classification_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libimagery_classification_la_SOURCES)
-DIST_SOURCES = $(libimagery_classification_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libimagery_classification.la
-libimagery_classification_la_SOURCES = \
-change_detection.cpp\
-classify_cluster_analysis.cpp\
-classify_supervised.cpp\
-classify_supervised_polygons.cpp\
-decision_tree.cpp\
-MLB_Interface.cpp\
-change_detection.h\
-classify_cluster_analysis.h\
-classify_supervised.h\
-classify_supervised_polygons.h\
-decision_tree.h\
-MLB_Interface.h
-
-libimagery_classification_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_classification/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_classification/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libimagery_classification.la: $(libimagery_classification_la_OBJECTS) $(libimagery_classification_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_classification_la_OBJECTS) $(libimagery_classification_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/change_detection.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classify_cluster_analysis.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classify_supervised.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classify_supervised_polygons.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/decision_tree.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_classification/change_detection.cpp b/src/modules_images/modules_imagery/imagery_classification/change_detection.cpp
deleted file mode 100644
index 3853a8c..0000000
--- a/src/modules_images/modules_imagery/imagery_classification/change_detection.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-/**********************************************************
- * Version $Id: change_detection.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                imagery_classification                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  change_detection.cpp                 //
-//                                                       //
-//                 Copyright (C) 2010 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 "change_detection.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CChange_Detection::CChange_Detection(void)
-{
-	CSG_Parameter	*pNode, *pTable;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Change Detection"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Change detection for classified grids."
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid(
-		NULL	, "INITIAL"		, _TL("Initial State"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	pTable	= Parameters.Add_Table(pNode, "INI_LUT" , _TL("Look-up Table")	, _TL(""), PARAMETER_INPUT_OPTIONAL);
-	Parameters.Add_Table_Field(pTable, "INI_LUT_MIN", _TL("Value")			, _TL(""), false);
-	Parameters.Add_Table_Field(pTable, "INI_LUT_MAX", _TL("Value (Maximum)"), _TL(""), true	);
-	Parameters.Add_Table_Field(pTable, "INI_LUT_NAM", _TL("Name")			, _TL(""), true);
-
-	pNode	= Parameters.Add_Grid(
-		NULL	, "FINAL"		, _TL("Final State"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	pTable	= Parameters.Add_Table(pNode, "FIN_LUT" , _TL("Look-up Table")	, _TL(""), PARAMETER_INPUT_OPTIONAL);
-	Parameters.Add_Table_Field(pTable, "FIN_LUT_MIN", _TL("Value")			, _TL(""), false);
-	Parameters.Add_Table_Field(pTable, "FIN_LUT_MAX", _TL("Value (Maximum)"), _TL(""), true	);
-	Parameters.Add_Table_Field(pTable, "FIN_LUT_NAM", _TL("Name")			, _TL(""), true);
-
-	Parameters.Add_Grid(
-		NULL	, "CHANGE"		, _TL("Changes"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NOCHANGE"	, _TL("Report Unchanged Classes"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	pNode	= Parameters.Add_Table(
-		NULL	, "CHANGES"		, _TL("Changes"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "OUTPUT"		, _TL("Output as..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("cells"),
-			_TL("percent"),
-			_TL("area")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CChange_Detection::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INI_LUT")) )
-	{
-		pParameters->Get_Parameter("INI_LUT_MIN")->Set_Enabled(pParameter->asTable() != NULL);
-		pParameters->Get_Parameter("INI_LUT_MAX")->Set_Enabled(pParameter->asTable() != NULL);
-		pParameters->Get_Parameter("INI_LUT_NAM")->Set_Enabled(pParameter->asTable() != NULL);
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIN_LUT")) )
-	{
-		pParameters->Get_Parameter("FIN_LUT_MIN")->Set_Enabled(pParameter->asTable() != NULL);
-		pParameters->Get_Parameter("FIN_LUT_MAX")->Set_Enabled(pParameter->asTable() != NULL);
-		pParameters->Get_Parameter("FIN_LUT_NAM")->Set_Enabled(pParameter->asTable() != NULL);
-	}
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CChange_Detection::On_Execute(void)
-{
-	bool		bNoChange;
-	int			iInitial, iFinal;
-	CSG_Matrix	Identity;
-	CSG_Table	Initial, Final, *pChanges;
-	CSG_Grid	*pInitial, *pFinal, *pChange;
-
-	//-----------------------------------------------------
-	pInitial	= Parameters("INITIAL")	->asGrid();
-	pFinal		= Parameters("FINAL")	->asGrid();
-	pChange		= Parameters("CHANGE")	->asGrid();
-	pChanges	= Parameters("CHANGES")	->asTable();
-	bNoChange	= Parameters("NOCHANGE")->asBool();
-
-	if( !Get_Classes(Initial, pInitial, true) )
-	{
-		Error_Set(_TL("no class definitions for initial state"));
-
-		return( false );
-	}
-
-	if( !Get_Classes(Final, pFinal, false) )
-	{
-		Error_Set(_TL("no class definitions for final state"));
-
-		return( false );
-	}
-
-	if( !Get_Changes(Initial, Final, pChanges, Identity) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			iInitial	= Get_Class(Initial, pInitial->asDouble(x, y));
-			iFinal		= Get_Class(Final  , pFinal  ->asDouble(x, y));
-
-			if( bNoChange || !Identity[iInitial][iFinal] )
-			{
-				pChanges->Get_Record(iInitial)->Add_Value(1 + iFinal, 1);
-
-				pChange->Set_Value(x, y, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal);
-			}
-			else
-			{
-				pChange->Set_Value(x, y, -1);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameters	P;
-
-	if( DataObject_Get_Parameters(pChange, P) && P("COLORS_TYPE") && P("LUT") )
-	{
-		CSG_Table	*pLUT	= P("LUT")->asTable();
-
-		CSG_Colors	cRandom(pChanges->Get_Count());
-
-		cRandom.Random();
-
-		pLUT->Del_Records();
-
-		for(iInitial=0; iInitial<pChanges->Get_Count(); iInitial++)
-		{
-			CSG_Colors	cRamp(pChanges->Get_Field_Count() - 1);
-
-			cRamp.Set_Ramp(cRandom[iInitial], cRandom[iInitial]);
-			cRamp.Set_Ramp_Brighness(225, 50);
-
-			for(iFinal=0; iFinal<pChanges->Get_Field_Count()-1; iFinal++)
-			{
-				if( pChanges->Get_Record(iInitial)->asInt(1 + iFinal) > 0 )
-				{
-					CSG_Table_Record	*pClass	= pLUT->Add_Record();
-
-					pClass->Set_Value(0, cRamp.Get_Color(iFinal));
-					pClass->Set_Value(1, CSG_String::Format(SG_T("%s >> %s"), pChanges->Get_Record(iInitial)->asString(0), pChanges->Get_Field_Name(1 + iFinal)));
-					pClass->Set_Value(3, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal);
-					pClass->Set_Value(4, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal);
-				}
-			}
-		}
-
-		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
-
-		DataObject_Set_Parameters(pChange, P);
-	}
-
-	//-----------------------------------------------------
-	double	Factor;
-
-	switch( Parameters("OUTPUT")->asInt() )
-	{
-	default:	Factor	= 1.0;						break;	// cells
-	case 1:		Factor	= 100.0 / Get_NCells();		break;	// percent
-	case 2:		Factor	= M_SQR(Get_Cellsize());	break;	// area
-	}
-
-	if( Factor != 1.0 )
-	{
-		for(iInitial=0; iInitial<pChanges->Get_Count(); iInitial++)
-		{
-			for(iFinal=0; iFinal<pChanges->Get_Field_Count()-1; iFinal++)
-			{
-				pChanges->Get_Record(iInitial)->Mul_Value(1 + iFinal, Factor);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	pChanges	->Set_Name(CSG_String::Format(SG_T("%s [%s >> %s]"), _TL("Changes"), pInitial->Get_Name(), pFinal->Get_Name()));
-
-	pChange		->Set_Name(CSG_String::Format(SG_T("%s [%s >> %s]"), _TL("Changes"), pInitial->Get_Name(), pFinal->Get_Name()));
-	pChange		->Set_NoData_Value(-1);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	CLASS_NAM	= 0,
-	CLASS_MIN,
-	CLASS_MAX
-};
-
-//---------------------------------------------------------
-bool CChange_Detection::Get_Classes(CSG_Table &Classes, CSG_Grid *pGrid, bool bInitial)
-{
-	CSG_Table	*pClasses;
-
-	Classes.Destroy();
-
-	Classes.Add_Field(_TL("NAME")	, SG_DATATYPE_String);
-	Classes.Add_Field(_TL("MIN")	, SG_DATATYPE_Double);
-	Classes.Add_Field(_TL("MAX")	, SG_DATATYPE_Double);
-
-	//-----------------------------------------------------
-	if( (pClasses = Parameters(bInitial ? "INI_LUT" : "FIN_LUT")->asTable()) != NULL )
-	{
-		int	fNam	= Parameters(bInitial ? "INI_LUT_NAM" : "FIN_LUT_NAM")->asInt();
-		int	fMin	= Parameters(bInitial ? "INI_LUT_MIN" : "FIN_LUT_MIN")->asInt();
-		int	fMax	= Parameters(bInitial ? "INI_LUT_MAX" : "FIN_LUT_MAX")->asInt();
-
-		if( fNam < 0 || fNam >= pClasses->Get_Field_Count() )	{	fNam	= fMin;	}
-		if( fMax < 0 || fMax >= pClasses->Get_Field_Count() )	{	fMax	= fMin;	}
-
-		for(int iClass=0; iClass<pClasses->Get_Count(); iClass++)
-		{
-			CSG_Table_Record	*pClass	= Classes.Add_Record();
-
-			pClass->Set_Value(CLASS_NAM, pClasses->Get_Record(iClass)->asString(fNam));
-			pClass->Set_Value(CLASS_MIN, pClasses->Get_Record(iClass)->asDouble(fMin));
-			pClass->Set_Value(CLASS_MAX, pClasses->Get_Record(iClass)->asDouble(fMax));
-		}
-	}
-
-	//-----------------------------------------------------
-	else if( DataObject_Get_Parameter(pGrid, "LUT") )
-	{
-		pClasses	= DataObject_Get_Parameter(pGrid, "LUT")->asTable();
-
-		for(int iClass=0; iClass<pClasses->Get_Count(); iClass++)
-		{
-			CSG_Table_Record	*pClass	= Classes.Add_Record();
-
-			pClass->Set_Value(CLASS_NAM, pClasses->Get_Record(iClass)->asString(1));
-			pClass->Set_Value(CLASS_MIN, pClasses->Get_Record(iClass)->asDouble(3));
-			pClass->Set_Value(CLASS_MAX, pClasses->Get_Record(iClass)->asDouble(4));
-		}
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		double	z;
-
-		for(long i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
-		{
-			double iz	= pGrid->asDouble(pGrid->Get_Sorted(i, false, false));
-
-			if( i == 0 || iz != z )
-			{
-				CSG_Table_Record	*pClass	= Classes.Add_Record();
-
-				pClass->Set_Value(CLASS_NAM, z = iz);
-				pClass->Set_Value(CLASS_MIN, z);
-				pClass->Set_Value(CLASS_MAX, z);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( Classes.Get_Count() > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CChange_Detection::Get_Changes(CSG_Table &Initial, CSG_Table &Final, CSG_Table *pChanges, CSG_Matrix &Identity)
-{
-	int		iInitial, iFinal;
-
-	//-----------------------------------------------------
-	Identity.Create(Final.Get_Count() + 1, Initial.Get_Count() + 1);
-
-	for(iInitial=0; iInitial<Initial.Get_Count(); iInitial++)
-	{
-		CSG_String	s	= Initial[iInitial].asString(CLASS_NAM);
-
-		for(iFinal=0; iFinal<Final.Get_Count(); iFinal++)
-		{
-			Identity[iInitial][iFinal]	= s.Cmp(Final[iFinal].asString(CLASS_NAM)) ? 0 : 1;
-		}
-	}
-
-	Identity[Initial.Get_Count()][Final.Get_Count()]	= 1;	// unclassified
-
-	//-----------------------------------------------------
-	pChanges->Destroy();
-
-	pChanges->Add_Field(_TL("Name"), SG_DATATYPE_String);
-
-	for(iFinal=0; iFinal<Final.Get_Count(); iFinal++)
-	{
-		pChanges->Add_Field(Final[iFinal].asString(CLASS_NAM), SG_DATATYPE_Double);
-	}
-
-	pChanges->Add_Field(_TL("Unclassified"), SG_DATATYPE_Double);
-
-	//-----------------------------------------------------
-	for(iInitial=0; iInitial<Initial.Get_Count(); iInitial++)
-	{
-		pChanges->Add_Record()->Set_Value(0, Initial[iInitial].asString(CLASS_NAM));
-	}
-
-	pChanges->Add_Record()->Set_Value(0, _TL("Unclassified"));
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline int CChange_Detection::Cmp_Class(CSG_Table &Classes, double Value, int iClass)
-{
-	CSG_Table_Record	*pClass	= Classes.Get_Record_byIndex(iClass);
-
-	double	min	= pClass->asDouble(CLASS_MIN);
-
-	if( Value < min )
-	{
-		return( 1 );
-	}
-
-	double	max	= pClass->asDouble(CLASS_MAX);
-
-	return( min < max
-		?	(Value < max ?  0 : -1)
-		:	(Value > min ? -1 :  0)
-	);
-}
-
-//---------------------------------------------------------
-int CChange_Detection::Get_Class(CSG_Table &Classes, double Value)
-{
-	int		a, b, i, c;
-
-	if( Classes.Get_Count() > 0 )
-	{
-		if( Classes.Get_Index_Field(0) != CLASS_MIN || Classes.Get_Index_Order(0) != TABLE_INDEX_Ascending )
-		{
-			Classes.Set_Index(CLASS_MIN, TABLE_INDEX_Ascending);
-		}
-
-		for(a=0, b=Classes.Get_Record_Count()-1; a < b; )
-		{
-			i	= a + (b - a) / 2;
-			c	= Cmp_Class(Classes, Value, i);
-
-			if( c > 0 )
-			{
-				b	= b > i ? i : b - 1;
-			}
-			else if( c < 0 )
-			{
-				a	= a < i ? i : a + 1;
-			}
-			else
-			{
-				return( Classes.Get_Record_byIndex(i)->Get_Index() );
-			}
-		}
-
-		if( Cmp_Class(Classes, Value, a) == 0 )
-		{
-			return( Classes.Get_Record_byIndex(a)->Get_Index() );
-		}
-
-		if( a != b && Cmp_Class(Classes, Value, b) == 0 )
-		{
-			return( Classes.Get_Record_byIndex(b)->Get_Index() );
-		}
-	}
-
-	return( Classes.Get_Count() );	// := unclassified
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp b/src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp
deleted file mode 100644
index e944a5b..0000000
--- a/src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp
+++ /dev/null
@@ -1,847 +0,0 @@
-/**********************************************************
- * Version $Id: classify_cluster_analysis.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                imagery_classification                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               Grid_Cluster_Analysis.cpp               //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "classify_cluster_analysis.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Cluster_Analysis::CGrid_Cluster_Analysis(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Cluster Analysis for Grids"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001"));
-
-	Set_Description	(_TW(		
-		"Cluster Analysis for grids.\n\nReferences:\n\n"
-		                                                                                                                                                                                                                  
-		"Iterative Minimum Distance:\n"
-		"- Forgy, E. (1965):\n"
-		"  'Cluster Analysis of multivariate data: efficiency vs. interpretability of classifications',\n"
-		"  Biometrics 21:768\n\n"
-
-		"Hill-Climbing:"
-		"- Rubin, J. (1967):\n"
-		"  'Optimal Classification into Groups: An Approach for Solving the Taxonomy Problem',\n"
-		"  J. Theoretical Biology, 15:103-144\n\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CLUSTER"		, _TL("Clusters"),
-		_TL(""),
-		PARAMETER_OUTPUT, true, SG_DATATYPE_Int
-	);
-
-	Parameters.Add_Table(
-		NULL	, "STATISTICS"	, _TL("Statistics"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Iterative Minimum Distance (Forgy 1965)"),
-			_TL("Hill-Climbing (Rubin 1967)"),
-			_TL("Combined Minimum Distance / Hillclimbing") 
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NCLUSTER"	, _TL("Clusters"),
-		_TL("Number of clusters"),
-		PARAMETER_TYPE_Int, 10, 2, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NORMALISE"	, _TL("Normalise"),
-		_TL("Automatically normalise grids by standard deviation before clustering."),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pNode	=
-	Parameters.Add_Value(NULL	, "OLDVERSION", _TL("Old Version"), _TL("slower but memory saving"), PARAMETER_TYPE_Bool, false);
-	Parameters.Add_Value(pNode	, "UPDATEVIEW", _TL("Update View"), _TL(""), PARAMETER_TYPE_Bool, true);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Cluster_Analysis::On_Execute(void)
-{
-	if( Parameters("OLDVERSION")->asBool() )	{	return( _On_Execute() );	}
-
-	//-----------------------------------------------------
-	bool					bNormalize;
-	long					iFeature, iElement, nElements;
-	CSG_Cluster_Analysis	Analysis;
-	CSG_Grid				*pCluster;
-	CSG_Parameter_Grid_List	*pGrids;
-
-	//-----------------------------------------------------
-	pGrids		= Parameters("GRIDS")		->asGridList();
-	pCluster	= Parameters("CLUSTER")		->asGrid();
-	bNormalize	= Parameters("NORMALISE")	->asBool();
-
-	if( !Analysis.Create(pGrids->Get_Count()) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pCluster->Set_NoData_Value(-1.0);
-
-	for(iElement=0, nElements=0; iElement<Get_NCells() && Set_Progress_NCells(iElement); iElement++)
-	{
-		bool	bNoData		= false;
-
-		for(iFeature=0; iFeature<pGrids->Get_Count() && !bNoData; iFeature++)
-		{
-			if( pGrids->asGrid(iFeature)->is_NoData(iElement) )
-			{
-				bNoData	= true;
-			}
-		}
-
-		if( bNoData || !Analysis.Add_Element() )
-		{
-			pCluster->Set_Value(iElement, -1);
-		}
-		else
-		{
-			pCluster->Set_Value(iElement, 0);
-
-			for(iFeature=0; iFeature<pGrids->Get_Count(); iFeature++)
-			{
-				double	d	= pGrids->asGrid(iFeature)->asDouble(iElement);
-
-				if( bNormalize )
-				{
-					d	= (d - pGrids->asGrid(iFeature)->Get_ArithMean()) / pGrids->asGrid(iFeature)->Get_StdDev();
-				}
-
-				Analysis.Set_Feature(nElements, iFeature, d);
-			}
-
-			nElements++;
-		}
-	}
-
-	if( nElements <= 1 )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	bool	bResult	= Analysis.Execute(Parameters("METHOD")->asInt(), Parameters("NCLUSTER")->asInt());
-
-	for(iElement=0, nElements=0; iElement<Get_NCells(); iElement++)
-	{
-		Set_Progress_NCells(iElement);
-
-		if( !pCluster->is_NoData(iElement) )
-		{
-			pCluster->Set_Value(iElement, Analysis.Get_Cluster(nElements++));
-		}
-	}
-
-	Save_Statistics(pGrids, bNormalize, Analysis);
-
-	Save_LUT(pCluster, Analysis.Get_nClusters());
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CGrid_Cluster_Analysis::Save_Statistics(CSG_Parameter_Grid_List *pGrids, bool bNormalize, const CSG_Cluster_Analysis &Analysis)
-{
-	int					iCluster, iFeature;
-	CSG_String			s;
-	CSG_Table_Record	*pRecord;
-	CSG_Table			*pTable;
-
-	pTable	= Parameters("STATISTICS")->asTable();
-
-	pTable->Destroy();
-	pTable->Set_Name(_TL("Cluster Analysis"));
-
-	pTable->Add_Field(_TL("ClusterID")	, SG_DATATYPE_Int);
-	pTable->Add_Field(_TL("Elements")	, SG_DATATYPE_Int);
-	pTable->Add_Field(_TL("Std.Dev.")	, SG_DATATYPE_Double);
-
-	s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"),
-		_TL("Number of Elements")	, Analysis.Get_nElements(),
-		_TL("Number of Variables")	, Analysis.Get_nFeatures(),
-		_TL("Number of Clusters")	, Analysis.Get_nClusters(),
-		_TL("Standard Deviation")	, sqrt(Analysis.Get_SP()),
-		_TL("Cluster"), _TL("Elements"), _TL("Std.Dev.")
-	);
-
-	for(iFeature=0; iFeature<Analysis.Get_nFeatures(); iFeature++)
-	{
-		s	+= CSG_String::Format(SG_T("\t%s"), pGrids->asGrid(iFeature)->Get_Name());
-
-		pTable->Add_Field(pGrids->asGrid(iFeature)->Get_Name(), SG_DATATYPE_Double);
-	}
-
-	Message_Add(s);
-
-	for(iCluster=0; iCluster<Analysis.Get_nClusters(); iCluster++)
-	{
-		s.Printf(SG_T("\n%d\t%d\t%f"), iCluster, Analysis.Get_nMembers(iCluster), sqrt(Analysis.Get_Variance(iCluster)));
-
-		pRecord	= pTable->Add_Record();
-		pRecord->Set_Value(0, iCluster);
-		pRecord->Set_Value(1, Analysis.Get_nMembers(iCluster));
-		pRecord->Set_Value(2, sqrt(Analysis.Get_Variance(iCluster)));
-
-		for(iFeature=0; iFeature<Analysis.Get_nFeatures(); iFeature++)
-		{
-			double	Centroid	= Analysis.Get_Centroid(iCluster, iFeature);
-
-			if( bNormalize )
-			{
-				Centroid	= pGrids->asGrid(iFeature)->Get_ArithMean() + Centroid * pGrids->asGrid(iFeature)->Get_StdDev();
-			}
-
-			s	+= CSG_String::Format(SG_T("\t%f"), Centroid);
-
-			pRecord->Set_Value(iFeature + 3, Centroid);
-		}
-
-		Message_Add(s, false);
-	}
-}
-
-//---------------------------------------------------------
-void CGrid_Cluster_Analysis::Save_LUT(CSG_Grid *pCluster, int nClusters)
-{
-	CSG_Parameters	Parms;
-
-	if( DataObject_Get_Parameters(pCluster, Parms) && Parms("COLORS_TYPE") && Parms("LUT") )
-	{
-		CSG_Table_Record	*pClass;
-		CSG_Table			*pLUT	= Parms("LUT")->asTable();
-
-		for(int iCluster=0; iCluster<nClusters; iCluster++)
-		{
-			if( (pClass = pLUT->Get_Record(iCluster)) == NULL )
-			{
-				pClass	= pLUT->Add_Record();
-				pClass->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX));
-			}
-
-			pClass->Set_Value(1, CSG_String::Format(SG_T("%s %d"), _TL("Class"), iCluster + 1));
-			pClass->Set_Value(2, CSG_String::Format(SG_T("%s %d"), _TL("Class"), iCluster + 1));
-			pClass->Set_Value(3, iCluster);
-			pClass->Set_Value(4, iCluster);
-		}
-
-		while( pLUT->Get_Record_Count() > nClusters )
-		{
-			pLUT->Del_Record(pLUT->Get_Record_Count() - 1);
-		}
-
-		Parms("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
-
-		DataObject_Set_Parameters(pCluster, Parms);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-//														 //
-//				Deprecated Old Version					 //
-//														 //
-///////////////////////////////////////////////////////////
-//														 //
-//				slow, but safes memory !				 //
-//														 //
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Cluster_Analysis::_On_Execute(void)
-{
-	int						i, j, *nMembers, nCluster, nElements;
-	double					*Variances, **Centroids, SP;
-	CSG_Grid				**Grids, *pCluster;
-	CSG_Parameter_Grid_List	*pGrids;
-
-	//-----------------------------------------------------
-	pGrids		= Parameters("GRIDS")	->asGridList();
-	pCluster	= Parameters("CLUSTER")	->asGrid();
-	nCluster	= Parameters("NCLUSTER")->asInt();
-
-	if( pGrids->Get_Count() < 1 )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Grids		= (CSG_Grid **)SG_Malloc(pGrids->Get_Count() * sizeof(CSG_Grid *));
-
-	if( Parameters("NORMALISE")->asBool() )
-	{
-		for(i=0; i<pGrids->Get_Count(); i++)
-		{
-			Grids[i]	= SG_Create_Grid(pGrids->asGrid(i), SG_DATATYPE_Float);
-			Grids[i]	->Assign(pGrids->asGrid(i));
-			Grids[i]	->Standardise();
-		}
-	}
-	else
-	{
-		for(i=0; i<pGrids->Get_Count(); i++)
-		{
-			Grids[i]	= pGrids->asGrid(i);
-		}
-	}
-
-	pCluster->Set_NoData_Value(-1.0);
-	pCluster->Assign_NoData();
-
-	nMembers	= (int     *)SG_Malloc(nCluster * sizeof(int));
-	Variances	= (double  *)SG_Malloc(nCluster * sizeof(double));
-	Centroids	= (double **)SG_Malloc(nCluster * sizeof(double *));
-
-	for(i=0; i<nCluster; i++)
-	{
-		Centroids[i]	= (double  *)SG_Malloc(pGrids->Get_Count() * sizeof(double));
-	}
-
-	//-------------------------------------------------
-	switch( Parameters("METHOD")->asInt() )
-	{
-	case 0:		SP	= _MinimumDistance	(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());	break;
-	case 1:		SP	= _HillClimbing		(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());	break;
-	case 2:		SP	= _MinimumDistance	(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());
-				SP	= _HillClimbing		(Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells());	break;
-	}
-
-	//-------------------------------------------------
-	if( Parameters("NORMALISE")->asBool() )
-	{
-		for(i=0; i<pGrids->Get_Count(); i++)
-		{
-			delete(Grids[i]);
-
-			for(j=0; j<nCluster; j++)
-			{
-				Centroids[j][i]	= pGrids->asGrid(i)->Get_StdDev() * Centroids[j][i] + pGrids->asGrid(i)->Get_ArithMean();
-			}
-		}
-	}
-
-	//-------------------------------------------------
-	Save_LUT(pCluster, nCluster);
-
-	//-------------------------------------------------
-	int					iCluster, iFeature;
-	CSG_String			s;
-	CSG_Table_Record	*pRecord;
-	CSG_Table			*pTable;
-
-	pTable	= Parameters("STATISTICS")->asTable();
-
-	pTable->Destroy();
-	pTable->Set_Name(_TL("Cluster Analysis"));
-
-	pTable->Add_Field(_TL("ClusterID")	, SG_DATATYPE_Int);
-	pTable->Add_Field(_TL("Elements")	, SG_DATATYPE_Int);
-	pTable->Add_Field(_TL("Std.Dev.")	, SG_DATATYPE_Double);
-
-	s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"),
-		_TL("Number of Elements")	, nElements,
-		_TL("Number of Variables")	, pGrids->Get_Count(),
-		_TL("Number of Clusters")	, nCluster,
-		_TL("Standard Deviation")	, sqrt(SP),
-		_TL("Cluster"), _TL("Elements"), _TL("Std.Dev.")
-	);
-
-	for(iFeature=0; iFeature<pGrids->Get_Count(); iFeature++)
-	{
-		s	+= CSG_String::Format(SG_T("\t%s"), pGrids->asGrid(iFeature)->Get_Name());
-
-		pTable->Add_Field(pGrids->asGrid(iFeature)->Get_Name(), SG_DATATYPE_Double);
-	}
-
-	Message_Add(s);
-
-	for(iCluster=0; iCluster<nCluster; iCluster++)
-	{
-		Variances[iCluster]	= nMembers[iCluster] ? Variances[iCluster] / nMembers[iCluster] : 0.0;
-
-		s.Printf(SG_T("\n%d\t%d\t%f"), iCluster, nMembers[iCluster], sqrt(Variances[iCluster]));
-
-		pRecord	= pTable->Add_Record();
-		pRecord->Set_Value(0, iCluster);
-		pRecord->Set_Value(1, nMembers[iCluster]);
-		pRecord->Set_Value(2, sqrt(Variances[iCluster]));
-
-		for(iFeature=0; iFeature<pGrids->Get_Count(); iFeature++)
-		{
-			double	Centroid	= Centroids[iCluster][iFeature];
-
-			if( Parameters("NORMALISE")->asBool() )
-			{
-				Centroid	= pGrids->asGrid(iFeature)->Get_ArithMean() + Centroid * pGrids->asGrid(iFeature)->Get_StdDev();
-			}
-
-			s	+= CSG_String::Format(SG_T("\t%f"), Centroid);
-
-			pRecord->Set_Value(iFeature + 3, Centroid);
-		}
-
-		Message_Add(s, false);
-	}
-
-	//-------------------------------------------------
-	for(i=0; i<nCluster; i++)
-	{
-		SG_Free(Centroids[i]);
-	}
-
-	SG_Free(Centroids);
-	SG_Free(Variances);
-	SG_Free(nMembers);
-	SG_Free(Grids);
-
-	return( true );
-}
-
-//---------------------------------------------------------
-double CGrid_Cluster_Analysis::_MinimumDistance(CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements)
-{
-	bool	bContinue;
-	int		iElement, iGrid, iCluster, nClusterElements, nShifts, minCluster, nPasses;
-	double	d, Variance, minVariance, SP, SP_Last	= -1;
-
-	//-----------------------------------------------------
-	for(iElement=0, nClusterElements=0; iElement<nElements; iElement++)
-	{
-		for(iGrid=0, bContinue=true; iGrid<nGrids && bContinue; iGrid++)
-		{
-			if( Grids[iGrid]->is_NoData(iElement) )
-			{
-				bContinue	= false;
-			}
-		}
-
-		if( bContinue )
-		{
-			if( pCluster->asInt(iElement) < 0 || pCluster->asInt(iElement) >= nCluster )
-			{
-				pCluster->Set_Value(iElement, iElement % nCluster);
-			}
-
-			nClusterElements++;
-		}
-		else
-		{
-			pCluster->Set_Value(iElement, -1);
-		}
-	}
-
-	if( Parameters("UPDATEVIEW")->asBool() )
-	{
-		DataObject_Update(pCluster, 0, nCluster, true);
-	}
-
-	//-----------------------------------------------------
-	for(nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++)
-	{
-		for(iCluster=0; iCluster<nCluster; iCluster++)
-		{
-			Variances[iCluster]	= 0;
-			nMembers [iCluster]	= 0;
-
-			for(iGrid=0; iGrid<nGrids; iGrid++)
-			{
-				Centroids[iCluster][iGrid]	= 0;
-			}
-		}
-
-		//-------------------------------------------------
-		for(iElement=0; iElement<nElements; iElement++)
-		{
-			if( pCluster->asInt(iElement) >= 0 )
-			{
-				iCluster	= pCluster->asInt(iElement);
-				nMembers[iCluster]++;
-
-				for(iGrid=0; iGrid<nGrids; iGrid++)
-				{
-					Centroids[iCluster][iGrid]	+= Grids[iGrid]->asDouble(iElement);
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		for(iCluster=0; iCluster<nCluster; iCluster++)
-		{
-			d		= nMembers[iCluster] > 0 ? 1.0 / (double)nMembers[iCluster] : 0;
-
-			for(iGrid=0; iGrid<nGrids; iGrid++)
-			{
-				Centroids[iCluster][iGrid]	*= d;
-			}
-		}
-
-		//-------------------------------------------------
-		SP		= 0;
-		nShifts	= 0;
-
-		for(iElement=0; iElement<nElements && bContinue; iElement++)
-		{
-			if( pCluster->asInt(iElement) >= 0 )
-			{
-				minVariance	= -1;
-
-				for(iCluster=0; iCluster<nCluster; iCluster++)
-				{
-					Variance	= 0;
-
-					for(iGrid=0; iGrid<nGrids; iGrid++)
-					{
-						d			= Centroids[iCluster][iGrid] - Grids[iGrid]->asDouble(iElement);
-						Variance	+= d * d;
-					}
-
-					if( minVariance<0 || Variance<minVariance )
-					{
-						minVariance	= Variance;
-						minCluster	= iCluster;
-					}
-				}
-
-				if( pCluster->asInt(iElement) != minCluster )
-				{
-					pCluster->Set_Value(iElement, minCluster);
-					nShifts++;
-				}
-
-				SP						+= minVariance;
-				Variances[minCluster]	+= minVariance;
-			}
-		}
-
-		//-------------------------------------------------
-		if( nShifts == 0 )//|| (SP_Last >= 0 && SP >= SP_Last) )
-		{
-			bContinue	= false;
-		}
-
-		SP	/= nElements;
-
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"),
-			_TL("pass")		, nPasses,
-			_TL("change")	, SP_Last < 0.0 ? SP : SP_Last - SP
-		));
-
-		SP_Last		= SP;
-
-		if( Parameters("UPDATEVIEW")->asBool() )
-		{
-			DataObject_Update(pCluster, 0, nCluster);	// Update_Output();
-		}
-	}
-
-	nElements	= nClusterElements;
-
-	return( SP );
-}
-
-//---------------------------------------------------------
-double CGrid_Cluster_Analysis::_HillClimbing(CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements)
-{
-	bool	bContinue;
-	int		iElement, iGrid, iCluster, jCluster, kCluster, nClusterElements, noShift, nPasses;
-	double	d, e, n_iK, n_jK, V, VMin, V1, V2, SP, SP_Last	= -1;
-
-	//-----------------------------------------------------
-	for(iCluster=0; iCluster<nCluster; iCluster++)
-	{
-		Variances[iCluster]	= 0;
-		nMembers [iCluster]	= 0;
-
-		for(iGrid=0; iGrid<nGrids; iGrid++)
-		{
-			Centroids[iCluster][iGrid]	= 0;
-		}
-	}
-
-	//-----------------------------------------------------
-	for(iElement=0, nClusterElements=0; iElement<nElements; iElement++)
-	{
-		for(iGrid=0, bContinue=true; iGrid<nGrids && bContinue; iGrid++)
-		{
-			if( Grids[iGrid]->is_NoData(iElement) )
-			{
-				bContinue	= false;
-			}
-		}
-
-		if( bContinue )
-		{
-			if( pCluster->asInt(iElement) < 0 || pCluster->asInt(iElement) >= nCluster )
-			{
-				pCluster->Set_Value(iElement, iElement % nCluster);
-			}
-
-			nClusterElements++;
-
-			iCluster	= pCluster->asInt(iElement);
-
-			nMembers[iCluster]++;
-
-			V			= 0.0;
-
-			for(iGrid=0; iGrid<nGrids; iGrid++)
-			{
-				d							 = Grids[iGrid]->asDouble(iElement);
-				Centroids[iCluster][iGrid]	+= d;
-				V							+= d * d;
-			}
-
-			Variances[iCluster]	+= V;
-		}
-		else
-		{
-			pCluster->Set_Value(iElement, -1);
-		}
-	}
-
-	//-----------------------------------------------------
-	for(iCluster=0; iCluster<nCluster; iCluster++)
-	{
-		d	= nMembers[iCluster] != 0 ? 1.0 / (double)nMembers[iCluster] : 0;
-		V	= 0.0;
-
-		for(iGrid=0; iGrid<nGrids; iGrid++)
-		{
-			Centroids[iCluster][iGrid]	*= d;
-			e							 = Centroids[iCluster][iGrid];
-			V							+= e * e;
-		}
-
-		Variances[iCluster]	-= nMembers [iCluster] * V;
-	}
-
-	if( Parameters("UPDATEVIEW")->asBool() )
-	{
-		DataObject_Update(pCluster, 0, nCluster, true);
-	}
-
-	//-----------------------------------------------------
-	noShift		= 0;
-
-	for(nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++)
-	{
-		for(iElement=0; iElement<nElements && bContinue; iElement++)
-		{
-			if( pCluster->asInt(iElement) >= 0 )
-			{
-				if( noShift++ >= nElements )
-				{
-					bContinue	= false;
-				}
-				else
-				{
-
-					//-------------------------------------
-					iCluster	= pCluster->asInt(iElement);
-
-					if( nMembers[iCluster] > 1 )
-					{
-						V	= 0.0;
-
-						for(iGrid=0; iGrid<nGrids; iGrid++)
-						{
-							d	= Centroids[iCluster][iGrid] - Grids[iGrid]->asDouble(iElement);
-							V	+= d * d;
-						}
-
-						n_iK	= nMembers[iCluster];
-						V1		= V * n_iK / (n_iK - 1.0);
-						VMin	= -1.0;
-
-						//---------------------------------
-						for(jCluster=0; jCluster<nCluster; jCluster++)
-						{
-							if( jCluster != iCluster )
-							{
-								V	= 0.0;
-
-								for(iGrid=0; iGrid<nGrids; iGrid++)
-								{
-									d	= Centroids[jCluster][iGrid] - Grids[iGrid]->asDouble(iElement);
-									V	+= d * d;
-								}
-
-								n_jK	= nMembers[jCluster];
-								V2		= V * n_jK / (n_jK + 1.0);
-
-								if( VMin < 0 || V2 < VMin )
-								{
-									VMin		= V2;
-									kCluster	= jCluster;
-								}
-							}
-						}
-
-						//---------------------------------
-						if( VMin >= 0 && VMin < V1 )
-						{
-							noShift				= 0;
-							Variances[iCluster]	-= V1;
-							Variances[kCluster]	+= VMin;
-							V1					= 1.0 / (n_iK - 1.0);
-							n_jK				= nMembers[kCluster];
-							V2					= 1.0 / (n_jK + 1.0);
-
-							for(iGrid=0; iGrid<nGrids; iGrid++)
-							{
-								d							= Grids[iGrid]->asDouble(iElement);
-								Centroids[iCluster][iGrid]	= (n_iK * Centroids[iCluster][iGrid] - d) * V1;
-								Centroids[kCluster][iGrid]	= (n_jK * Centroids[kCluster][iGrid] + d) * V2;
-							}
-
-							pCluster->Set_Value(iElement, kCluster);
-
-							nMembers[iCluster]--;
-							nMembers[kCluster]++;
-						}
-					}
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		for(iCluster=0, SP=0.0; iCluster<nCluster; iCluster++)
-		{
-			SP	+= Variances[iCluster];
-		}
-
-		SP	/= nElements;
-
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"),
-			_TL("pass")		, nPasses,
-			_TL("change")	, SP_Last < 0.0 ? SP : SP_Last - SP
-		));
-
-		SP_Last		= SP;
-
-		if( Parameters("UPDATEVIEW")->asBool() )
-		{
-			DataObject_Update(pCluster, 0, nCluster);	// Update_Output();
-		}
-	}
-
-	nElements	= nClusterElements;
-
-	return( SP );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.cpp b/src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.cpp
deleted file mode 100644
index 6ea1afb..0000000
--- a/src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/**********************************************************
- * Version $Id: classify_supervised.cpp 1308 2012-01-12 15:27:56Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                imagery_classification                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              classify_supervised_polygons.cpp         //
-//                                                       //
-//                 Copyright (C) 2012 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 "classify_supervised_polygons.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	CLASS_ID	= 0,
-	CLASS_ROI_M,
-	CLASS_ROI_S,
-	CLASS_TOT_N,
-	CLASS_ROI_N
-};
-
-//---------------------------------------------------------
-#define CLASS_NPARMS	(CLASS_ROI_S - CLASS_ROI_M + 1)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPolygon_Classify_Supervised::CPolygon_Classify_Supervised(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Supervised Classification for Polygons"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
-
-	Set_Description	(_TW(
-		"Supervised Classification"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Shapes(
-		NULL	, "POLYGONS"		, _TL("Polygons"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "CLASS_ID"		, _TL("Class Identifier"),
-		_TL("")
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "CLASSES"			, _TL("Classification"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Table(
-		NULL	, "CLASS_INFO"		, _TL("Summary"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Parameters(
-		NULL	, "FEATURES"		, _TL("Features"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"			, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			CSG_Classifier_Supervised::Get_Name_of_Method(SG_CLASSIFY_SUPERVISED_MinimumDistance).c_str(),
-			CSG_Classifier_Supervised::Get_Name_of_Method(SG_CLASSIFY_SUPERVISED_SAM).c_str()
-		), 0
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NORMALISE"		, _TL("Normalise"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRESHOLD_DIST"	, _TL("Distance Threshold"),
-		_TL("Let pixel stay unclassified, if minimum or mahalanobis distance is greater than threshold."),
-		PARAMETER_TYPE_Double, 0.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRESHOLD_ANGLE"	, _TL("Spectral Angle Threshold (Degree)"),
-		_TL("Let pixel stay unclassified, if spectral angle distance is greater than threshold."),
-		PARAMETER_TYPE_Double, 0.0, 0.0, true, 90.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CPolygon_Classify_Supervised::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POLYGONS")) )
-	{
-		CSG_Shapes		*pShapes	= pParameter->asShapes();
-		CSG_Parameters	*pFeatures	= pParameters->Get_Parameter("FEATURES")->asParameters();
-
-		pFeatures->Del_Parameters();
-
-		if( pShapes && pShapes->Get_Field_Count() > 0 )
-		{
-			for(int i=0; i<pShapes->Get_Field_Count(); i++)
-			{
-				if( SG_Data_Type_is_Numeric(pShapes->Get_Field_Type(i)) )
-				{
-					pFeatures->Add_Value(NULL, CSG_String::Format(SG_T("%d_FEATURE"), i), pShapes->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( 1 );
-}
-
-//---------------------------------------------------------
-int CPolygon_Classify_Supervised::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
-	{
-		int	Value	= pParameter->asInt();
-
-		pParameters->Get_Parameter("THRESHOLD_DIST" )->Set_Enabled(Value == 0);
-		pParameters->Get_Parameter("THRESHOLD_ANGLE")->Set_Enabled(Value == 1);
-	}
-
-	//-----------------------------------------------------
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPolygon_Classify_Supervised::On_Execute(void)
-{
-	bool		bNoData;
-	int			Method, Class, i, iPolygon;
-	double		Quality;
-
-	//-------------------------------------------------
-	m_pPolygons		= Parameters("POLYGONS" )->asShapes();
-	m_Class_ID		= Parameters("CLASS_ID" )->asInt();
- 	m_pClasses		= Parameters("CLASSES"  )->asShapes();
-	m_bNormalise	= Parameters("NORMALISE")->asBool();
-	Method			= Parameters("METHOD"   )->asInt();
-
-	m_Classifier.Set_Distance_Threshold   (Parameters("THRESHOLD_DIST" )->asDouble());
-	m_Classifier.Set_Angle_Threshold      (Parameters("THRESHOLD_ANGLE")->asDouble() * M_DEG_TO_RAD);
-
-	switch( Method )
-	{
-	default:
-	case  0:	Method	= SG_CLASSIFY_SUPERVISED_MinimumDistance;	break;
-	case  1:	Method	= SG_CLASSIFY_SUPERVISED_SAM;				break;
-	}
-
-	//-------------------------------------------------
-	CSG_Parameters	*pFeatures	= Parameters("FEATURES")->asParameters();
-
-	m_Features	= (int *)SG_Calloc(m_pPolygons->Get_Field_Count(), sizeof(int));
-	m_nFeatures	= 0;
-
-	for(i=0; i<pFeatures->Get_Count(); i++)
-	{
-		if( pFeatures->Get_Parameter(i)->asBool() )
-		{
-			m_Features[m_nFeatures++]	= CSG_String(pFeatures->Get_Parameter(i)->Get_Identifier()).asInt();
-		}
-	}
-
-	if( m_nFeatures <= 0 )
-	{
-		Error_Set(_TL("no features have been selected"));
-
-		return( false );
-	}
-
-	//-------------------------------------------------
-	m_pClasses->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), m_pPolygons->Get_Name(), _TL("Classified")), NULL, m_pPolygons->Get_Vertex_Type());
-	m_pClasses->Add_Field(_TL("CLASS_NR"), SG_DATATYPE_Int);
-	m_pClasses->Add_Field(_TL("CLASS_ID"), SG_DATATYPE_String);
-	m_pClasses->Add_Field(_TL("QUALITY" ), SG_DATATYPE_Double);
-
-	CSG_Vector	Features(m_nFeatures);
-
-	m_Classifier.Create (m_nFeatures);
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("analyzing known classes"));
-
-	for(iPolygon=0; iPolygon<m_pPolygons->Get_Count() && Set_Progress(iPolygon, m_pPolygons->Get_Count()); iPolygon++)
-	{
-		CSG_Shape	*pPolygon	= m_pPolygons->Get_Shape(iPolygon);
-
-		if( SG_STR_LEN(pPolygon->asString(m_Class_ID)) > 0 )
-		{
-			for(i=0, bNoData=false; i<m_nFeatures && !bNoData; i++)
-			{
-				if( pPolygon->is_NoData(m_Features[i]) )
-				{
-					bNoData	= true;
-				}
-				else
-				{
-					Features[i]	= pPolygon->asDouble(m_Features[i]);
-					
-					if( m_bNormalise )
-					{
-						Features[i]	= (Features[i] - m_pPolygons->Get_Mean(m_Features[i])) / m_pPolygons->Get_StdDev(m_Features[i]);
-					}
-				}
-			}
-
-			if( !bNoData )
-			{
-				CSG_Simple_Statistics	*pClass	= m_Classifier.Get_Statistics(pPolygon->asString(m_Class_ID));
-
-				for(i=0; i<m_nFeatures; i++)
-				{
-					pClass[i].Add_Value(Features[i]);
-				}
-			}
-		}
-	}
-
-	if( m_Classifier.Get_Class_Count() <= 0 )
-	{
-		Error_Set(_TL("no training areas could be analysed."));
-
-		return( false );
-	}
-
-	//-------------------------------------------------
-	Process_Set_Text(_TL("running classification"));
-
-	for(iPolygon=0; iPolygon<m_pPolygons->Get_Count() && Set_Progress(iPolygon, m_pPolygons->Get_Count()); iPolygon++)
-	{
-		CSG_Shape	*pPolygon	= m_pPolygons->Get_Shape(iPolygon);
-
-		for(i=0, bNoData=false; i<m_nFeatures && !bNoData; i++)
-		{
-			if( pPolygon->is_NoData(m_Features[i]) )
-			{
-				bNoData	= true;
-			}
-			else
-			{
-				Features[i]	= pPolygon->asDouble(m_Features[i]);
-					
-				if( m_bNormalise )
-				{
-					Features[i]	= (Features[i] - m_pPolygons->Get_Mean(m_Features[i])) / m_pPolygons->Get_StdDev(m_Features[i]);
-				}
-			}
-		}
-
-		if( !bNoData )
-		{
-			if( m_Classifier.Get_Class(Features, Class, Quality, Method) )
-			{
-				CSG_Shape	*pClass	= m_pClasses->Add_Shape(pPolygon);
-
-				pClass->Set_Value(0, 1 + Class);
-				pClass->Set_Value(1, m_Classifier.Get_Class_ID(Class));
-				pClass->Set_Value(2, Quality);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Finalize();
-
-	SG_Free(m_Features);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPolygon_Classify_Supervised::Finalize(void)
-{
-	int			iClass, iFeature, iOffset, nClasses;
-	CSG_String	Name_Method, Name_Quality;
-	CSG_Table	*pTable;
-
-	//-----------------------------------------------------
-	Name_Method		= CSG_Classifier_Supervised::Get_Name_of_Method (Parameters("METHOD")->asInt());
-	Name_Quality	= CSG_Classifier_Supervised::Get_Name_of_Quality(Parameters("METHOD")->asInt());
-
-	//-----------------------------------------------------
-	pTable	= Parameters("CLASS_INFO")->asTable();
-
-	pTable->Destroy();
-	pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Class Information"), Name_Method.c_str()));
-
-	pTable->Add_Field(_TL("ID")   , SG_DATATYPE_String);	// CLASS_ID
-
-	for(iFeature=0; iFeature<m_Classifier.Get_Feature_Count(); iFeature++)
-	{
-		pTable->Add_Field(CSG_String::Format(SG_T("B%02d_MEAN")  , iFeature + 1), SG_DATATYPE_Double);	// CLASS_ROI_M
-		pTable->Add_Field(CSG_String::Format(SG_T("B%02d_STDDEV"), iFeature + 1), SG_DATATYPE_Double);	// CLASS_ROI_S
-	}
-
-	pTable->Add_Field(_TL("TOT_N"), SG_DATATYPE_Int);		// CLASS_TOT_N
-	pTable->Add_Field(_TL("ROI_N"), SG_DATATYPE_Int);		// CLASS_ROI_N
-
-	for(iClass=0; iClass<m_Classifier.Get_Class_Count(); iClass++)
-	{
-		CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-		pRecord->Set_Value(CLASS_ID   , m_Classifier.Get_Class_ID(iClass).c_str());
-
-		for(iFeature=0, iOffset=0; iFeature<m_Classifier.Get_Feature_Count(); iFeature++, iOffset+=CLASS_NPARMS)
-		{
-			CSG_Simple_Statistics	*pStatistics	= m_Classifier.Get_Statistics(iClass) + iFeature;
-
-			double	m	= m_bNormalise ? m_pPolygons->Get_Mean  (m_Features[iFeature]) : 0.0;
-			double	s	= m_bNormalise ? m_pPolygons->Get_StdDev(m_Features[iFeature]) : 1.0;
-
-			pRecord->Set_Value(iOffset + CLASS_ROI_M  , pStatistics->Get_Mean   () * s + m);
-			pRecord->Set_Value(iOffset + CLASS_ROI_S  , pStatistics->Get_StdDev () * s);
-		//	pRecord->Set_Value(iOffset + CLASS_ROI_MIN, pStatistics->Get_Minimum() * s + m);
-		//	pRecord->Set_Value(iOffset + CLASS_ROI_MAX, pStatistics->Get_Maximum() * s + m);
-		}
-
-		pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 1, m_Classifier.Get_Statistics(iClass)->Get_Count());
-		pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 2, m_Classifier.Get_Element_Count(iClass));
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameters	P;
-
-	if( DataObject_Get_Parameters(m_pClasses, P) && P("COLORS_TYPE") && P("LUT") )
-	{
-		pTable	= P("LUT")->asTable();
-
-		for(iClass=0, nClasses=0; iClass<m_Classifier.Get_Class_Count(); iClass++)
-		{
-			if( m_Classifier.Get_Element_Count(iClass) > 0 )
-			{
-				CSG_Table_Record	*pRecord	= pTable->Get_Record(nClasses++);
-
-				if( pRecord == NULL )
-				{
-					pRecord	= pTable->Add_Record();
-					pRecord->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX));
-				}
-
-				pRecord->Set_Value(1, m_Classifier.Get_Class_ID(iClass).c_str());
-				pRecord->Set_Value(2, m_Classifier.Get_Class_ID(iClass).c_str());
-				pRecord->Set_Value(3, iClass + 1);
-				pRecord->Set_Value(4, iClass + 1);
-			}
-		}
-
-		while( pTable->Get_Record_Count() > m_Classifier.Get_Class_Count() )
-		{
-			pTable->Del_Record(pTable->Get_Record_Count() - 1);
-		}
-
-		P.Set_Parameter("COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
-		P.Set_Parameter("LUT_ATTRIB" , 0);	// Lookup Table Attribute
-
-		DataObject_Set_Parameters(m_pClasses, P);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.h b/src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.h
deleted file mode 100644
index 4113f6f..0000000
--- a/src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/**********************************************************
- * Version $Id: classify_supervised.h 1308 2012-01-12 15:27:56Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                imagery_classification                 //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             classify_supervised_polygons.h            //
-//                                                       //
-//                 Copyright (C) 2012 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__classify_supervised_polygons_H
-#define HEADER_INCLUDED__classify_supervised_polygons_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPolygon_Classify_Supervised : public CSG_Module
-{
-public:
-	CPolygon_Classify_Supervised(void);
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-
-private:
-
-	bool						m_bNormalise;
-
-	int							m_Class_ID, *m_Features, m_nFeatures;
-
-	CSG_Classifier_Supervised	m_Classifier;
-
-	CSG_Shapes					*m_pPolygons, *m_pClasses;
-
-
-	bool						Finalize				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__classify_supervised_polygons_H
diff --git a/src/modules_images/modules_imagery/imagery_rga/Makefile.in b/src/modules_images/modules_imagery/imagery_rga/Makefile.in
deleted file mode 100644
index 5beb9ac..0000000
--- a/src/modules_images/modules_imagery/imagery_rga/Makefile.in
+++ /dev/null
@@ -1,577 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_imagery/imagery_rga
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libimagery_rga_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libimagery_rga_la_OBJECTS = fast_region_growing.lo MLB_Interface.lo
-libimagery_rga_la_OBJECTS = $(am_libimagery_rga_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libimagery_rga_la_SOURCES)
-DIST_SOURCES = $(libimagery_rga_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libimagery_rga.la
-libimagery_rga_la_SOURCES = \
-fast_region_growing.cpp\
-MLB_Interface.cpp\
-fast_region_growing.h\
-MLB_Interface.h
-
-libimagery_rga_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_rga/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_rga/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libimagery_rga.la: $(libimagery_rga_la_OBJECTS) $(libimagery_rga_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_rga_la_OBJECTS) $(libimagery_rga_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fast_region_growing.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/Makefile.in b/src/modules_images/modules_imagery/imagery_segmentation/Makefile.in
deleted file mode 100644
index 388048a..0000000
--- a/src/modules_images/modules_imagery/imagery_segmentation/Makefile.in
+++ /dev/null
@@ -1,588 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_imagery/imagery_segmentation
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libimagery_segmentation_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libimagery_segmentation_la_OBJECTS = grid_seeds.lo MLB_Interface.lo \
-	rga_basic.lo skeletonization.lo watershed_segmentation.lo
-libimagery_segmentation_la_OBJECTS =  \
-	$(am_libimagery_segmentation_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libimagery_segmentation_la_SOURCES)
-DIST_SOURCES = $(libimagery_segmentation_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libimagery_segmentation.la
-libimagery_segmentation_la_SOURCES = \
-grid_seeds.cpp\
-MLB_Interface.cpp\
-rga_basic.cpp\
-skeletonization.cpp\
-watershed_segmentation.cpp\
-grid_seeds.h\
-MLB_Interface.h\
-rga_basic.h\
-skeletonization.h\
-watershed_segmentation.h
-
-libimagery_segmentation_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_segmentation/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_segmentation/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libimagery_segmentation.la: $(libimagery_segmentation_la_OBJECTS) $(libimagery_segmentation_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_segmentation_la_OBJECTS) $(libimagery_segmentation_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_seeds.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rga_basic.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/skeletonization.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/watershed_segmentation.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp b/src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp
deleted file mode 100644
index 90ae3a2..0000000
--- a/src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp
+++ /dev/null
@@ -1,665 +0,0 @@
-/**********************************************************
- * Version $Id: rga_basic.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 imagery_segmentation                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    rga_basic.cpp                      //
-//                                                       //
-//                 Copyright (C) 2008 by                 //
-//                     Benni Bechtel                     //
-//                      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 "rga_basic.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCandidates::CCandidates(void)
-{
-	m_Candidates	= NULL;
-	m_nCandidates	= 0;
-	m_pLow			= NULL;
-	m_pHigh			= NULL;
-	m_nMax			= 256;
-
-	Create(m_nMax);
-}
-
-//---------------------------------------------------------
-CCandidates::CCandidates(int nMax)
-{
-	m_Candidates	= NULL;
-	m_nCandidates	= 0;
-	m_pLow			= NULL;
-	m_pHigh			= NULL;
-	m_nMax			= nMax;
-
-	Create(m_nMax);
-}
-
-//---------------------------------------------------------
-CCandidates::~CCandidates(void)
-{
-	Destroy();
-}
-
-//---------------------------------------------------------
-void CCandidates::Create(void)
-{
-	Create(m_nMax);
-}
-
-//---------------------------------------------------------
-void CCandidates::Create(int nMax)
-{
-	if( nMax <= 1 )
-	{
-		Create();
-
-		return;
-	}
-
-	Destroy();
-
-	m_nMax			= nMax;
-
-	m_Candidates	= (TCandidate *)SG_Malloc(m_nMax * sizeof(TCandidate));
-}
-
-//---------------------------------------------------------
-void CCandidates::Destroy(void)
-{
-	m_nCandidates	= 0;
-
-	if( m_Candidates )
-	{
-		SG_Free(m_Candidates);
-
-		m_Candidates	= NULL;
-	}
-
-	if( m_pLow )
-	{
-		delete(m_pLow);
-
-		m_pLow		= NULL;
-	}
-
-	if( m_pHigh )
-	{
-		delete(m_pHigh);
-
-		m_pHigh		= NULL;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CCandidates::Add(int x, int y, int Segment, double Similarity)
-{
-	if( m_Candidates && m_nCandidates < m_nMax )
-	{
-		int	iInsert	= _Find(Similarity);
-
-		memmove(m_Candidates + iInsert + 1, m_Candidates + iInsert, sizeof(TCandidate) * (m_nCandidates - iInsert));
-
-		m_Candidates[iInsert].x				= x;
-		m_Candidates[iInsert].y				= y;
-		m_Candidates[iInsert].Segment		= Segment;
-		m_Candidates[iInsert].Similarity	= Similarity;
-	}
-	else
-	{
-		if( !m_pLow )
-		{
-			int	iDivide	= m_nMax / 2;
-
-			m_pLow	= new CCandidates(m_nMax);
-			m_pHigh	= new CCandidates(m_nMax);
-
-			m_pLow ->m_nCandidates	= iDivide;
-			m_pHigh->m_nCandidates	= m_nMax - iDivide;
-
-			memcpy(m_pLow ->m_Candidates, m_Candidates                        , m_pLow ->m_nCandidates * sizeof(TCandidate));
-			memcpy(m_pHigh->m_Candidates, m_Candidates + m_pLow->m_nCandidates, m_pHigh->m_nCandidates * sizeof(TCandidate));
-
-			SG_Free(m_Candidates);
-			m_Candidates	= NULL;
-		}
-
-		if( Similarity > m_pHigh->Get_Minimum() )
-		{
-			m_pHigh->Add(x, y, Segment, Similarity);
-		}
-		else
-		{
-			m_pLow ->Add(x, y, Segment, Similarity);
-		}
-	}
-
-	m_nCandidates++;
-}
-
-//---------------------------------------------------------
-double CCandidates::Get_Minimum(void)
-{
-	if( m_nCandidates > 0 )
-	{
-		if( m_pLow )
-		{
-			return( m_pLow->Get_Minimum() );
-		}
-
-		return( m_Candidates[0].Similarity );
-	}
-
-	return( 0.0 );
-}
-
-//---------------------------------------------------------
-double CCandidates::Get_Maximum(void)
-{
-	if( m_nCandidates > 0 )
-	{
-		if( m_pHigh )
-		{
-			return( m_pHigh->Get_Maximum() );
-		}
-
-		return( m_Candidates[m_nCandidates - 1].Similarity );
-	}
-
-	return( 0.0 );
-}
-
-//---------------------------------------------------------
-int CCandidates::_Find(double Similarity)
-{
-	if( m_nCandidates == 0 )
-	{
-		return( 0 );
-	}
-
-	int		a, b;
-
-	a	= 0;
-	b	= m_nCandidates - 1;
-
-	if( Similarity < m_Candidates[a].Similarity )
-	{
-		return( a );
-	}
-
-	if( Similarity > m_Candidates[b].Similarity )
-	{
-		return( b + 1 );
-	}
-
-	for(int d=(b-a)/2 ; d>0; d/=2)
-	{
-		int		i	= a + d;
-
-		if( Similarity > m_Candidates[i].Similarity )
-		{
-			a	= a < i ? i : a + 1;
-		}
-		else
-		{
-			b	= b > i ? i : b - 1;
-		}
-	}
-
-	for(int i=a; i<=b; i++)
-	{
-		if( Similarity < m_Candidates[i].Similarity )
-		{
-			return( i );
-		}
-	}
-
-	return( b );
-}
-
-//---------------------------------------------------------
-bool CCandidates::Get(int &x, int &y, int &Segment)
-{
-	if( m_nCandidates > 0 )
-	{
-		m_nCandidates--;
-
-		if( m_Candidates )
-		{
-			x		= m_Candidates[m_nCandidates].x;
-			y		= m_Candidates[m_nCandidates].y;
-			Segment	= m_Candidates[m_nCandidates].Segment;
-		}
-		else // if( m_pLow )
-		{
-			m_pHigh->Get(x, y, Segment);
-
-			if( m_pHigh->m_nCandidates == 0 )
-			{
-				delete(m_pHigh);
-
-				CCandidates	*pLow	= m_pLow;
-
-			//	m_nCandidates	= pLow->m_nCandidates;
-				m_Candidates	= pLow->m_Candidates;
-				m_pLow			= pLow->m_pLow;
-				m_pHigh			= pLow->m_pHigh;
-
-				pLow->m_Candidates	= NULL;
-				pLow->m_pLow		= NULL;
-				pLow->m_pHigh		= NULL;
-				delete(pLow);
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SEEDFIELD_X		2
-#define SEEDFIELD_Y		(SEEDFIELD_X + 1)
-#define SEEDFIELD_Z		(SEEDFIELD_X + 2)
-
-#define NO_SEGMENT			-1
-#define NO_SIMILARITY		-1.0
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CRGA_Basic::CRGA_Basic(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Simple Region Growing"));
-
-	Set_Author		(SG_T("B. Bechtel, O. Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"\n"
-		"References\n"
-		"Bechtel, B., Ringeler, A., Boehner, J. (2008): "
-		"Segmentation for Object Extraction of Trees using MATLAB and SAGA. "
-		"In: Boehner, J., Blaschke, T., Montanarella, L. [Eds.]: SAGA - Seconds Out. "
-		"Hamburger Beitraege zur Physischen Geographie und Landschaftsoekologie, 19:59-70. "
-		"<a href=\"http://downloads.sourceforge.net/saga-gis/hbpl19_01.pdf\">download</a>\n"
-		"\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "SEEDS"		, _TL("Seeds"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "FEATURES"	, _TL("Features"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SEGMENTS"	, _TL("Segments"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SIMILARITY"	, _TL("Similarity"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Seeds"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("feature space and position"),
-			_TL("feature space")
-		), 0
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "NEIGHBOUR"	, _TL("Neighbourhood"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("4 (von Neumann)"),
-			_TL("8 (Moore)")
-		), 0
-	);
-
-	pNode	= Parameters.Add_Node(
-		NULL	, "NODE_COLSPACE"	, _TL("Feature Space Options"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SIG_1"			, _TL("Variance in Feature Space"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 1.0, 0.0, true	// 0.36
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SIG_2"			, _TL("Variance in Position Space"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 1.0, 0.0, true	// 8.2141
-	);
-
-	Parameters.Add_Value(
-		pNode	, "THRESHOLD"		, _TL("Threshold - Similarity"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 0.0, 0.0, true	// 0.15
-	);
-
-	Parameters.Add_Value(
-		pNode	, "REFRESH"			, _TL("Refresh"),
-		_TL(""),
-		PARAMETER_TYPE_Bool			, false
-	);
-
-	Parameters.Add_Value(
-		pNode	, "LEAFSIZE"		, _TL("Leaf Size (for Speed Optimisation)"),
-		_TL(""),
-		PARAMETER_TYPE_Int			, 256, 2, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CRGA_Basic::On_Execute(void)
-{
-	bool		bRefresh;
-	long		n;
-	int			x, y, i, Segment;
-	CSG_Grid	*pSeeds;
-
-	//-----------------------------------------------------
-	m_pSegments		= Parameters("SEGMENTS")	->asGrid();
-	m_pFeatures		= Parameters("FEATURES")	->asGridList();
-	m_nFeatures		= m_pFeatures->Get_Count();
-
-	pSeeds			= Parameters("SEEDS")		->asGrid();
-	m_pSeeds		= Parameters("TABLE")		->asTable();
-
-	m_pSimilarity	= Parameters("SIMILARITY")	->asGrid();
-
-	m_dNeighbour	= Parameters("NEIGHBOUR")->asInt() == 0 ? 2 : 1;
-
-	m_Var_1			= SG_Get_Square(Parameters("SIG_1")->asDouble());
-	m_Var_2			= SG_Get_Square(Parameters("SIG_2")->asDouble());
-	m_Threshold		= Parameters("THRESHOLD")	->asDouble();
-
-	m_Method		= Parameters("METHOD")		->asInt();
-	bRefresh		= Parameters("REFRESH")		->asBool();
-
-	//-----------------------------------------------------
-	m_pSegments		->Assign(-1);
-	m_pSegments		->Set_NoData_Value(-1);
-
-	m_pSimilarity	->Assign(-1);
-	m_pSimilarity	->Set_NoData_Value(-1);
-
-	//-----------------------------------------------------
-	m_pSeeds->Destroy();
-
-	m_pSeeds->Add_Field(_TL("ID")	, SG_DATATYPE_Int);
-	m_pSeeds->Add_Field(_TL("AREA")	, SG_DATATYPE_Double);
-	m_pSeeds->Add_Field(_TL("X")	, SG_DATATYPE_Double);
-	m_pSeeds->Add_Field(_TL("Y")	, SG_DATATYPE_Double);
-
-	for(i=0; i<m_pFeatures->Get_Count(); i++)
-	{
-		m_pSeeds->Add_Field(m_pFeatures->asGrid(i)->Get_Name(), SG_DATATYPE_Double);
-	}
-
-	m_Candidates.Create(Parameters("LEAFSIZE")->asInt());
-
-	//-----------------------------------------------------
-	for(y=0, n=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( !pSeeds->is_NoData(x, y) )
-			{
-				CSG_Table_Record	*pRec	= m_pSeeds->Add_Record();
-
-				pRec->Set_Value(0, n);
-				pRec->Set_Value(SEEDFIELD_X, x);
-				pRec->Set_Value(SEEDFIELD_Y, y);
-
-				for(i=0; i<m_pFeatures->Get_Count(); i++)
-				{
-					pRec->Set_Value(SEEDFIELD_Z + i, m_pFeatures->asGrid(i)->asDouble(x, y));
-				}
-
-				m_pSimilarity->Set_Value(x, y, 1.0);
-
-				Add_To_Segment(x, y, n++);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( n > 0 )
-	{
-		n	= 0;
-
-		while( n++ < Get_NCells() && Set_Progress_NCells(n) && Get_Next_Candidate(x, y, Segment) )
-		{
-			Add_To_Segment(x, y, Segment);
-
-			if( bRefresh && (n % Get_NX()) == 0 )
-			{
-				DataObject_Update(m_pSegments, 0, m_pSeeds->Get_Record_Count());
-
-				Process_Set_Text(CSG_String::Format(SG_T("%.2f"), 100.0 * m_Candidates.Get_Count() / Get_NCells()));
-			}
-		}
-
-		m_Candidates.Destroy();
-
-		return( true );
-	}
-
-	//-----------------------------------------------------
-	m_Candidates.Destroy();
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CRGA_Basic::Get_Next_Candidate(int &x, int &y, int &Segment)
-{
-	while( m_Candidates.Get(x, y, Segment) )
-	{
-		if( m_pSegments->is_NoData(x, y) )
-		{
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CRGA_Basic::Add_To_Segment(int x, int y, int Segment)
-{
-	if( is_InGrid(x, y) && m_pSegments->is_NoData(x, y) )			// if the pixel is not element of any segment...
-	{
-		int		i, ix, iy;
-
-		m_pSegments->Set_Value(x, y, Segment);						// the candidate is added to the correspondig region
-	
-		for(i=0; i<8; i+=m_dNeighbour)								// update of candidate-grid - all 8-Neigbours of the added pixel are checked
-		{
-			if( Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) && m_pSegments->is_NoData(ix, iy) )
-			{
-				double	Similarity	= Get_Similarity(ix, iy, Segment);
-
-				if(	Similarity >= m_Threshold						// a neigbour-pixel is only added as candidate if its similarity is higher than the preset threshold
-				&&	Similarity > m_pSimilarity->asDouble(ix, iy) )	// and it is not candidate for another region with a higher similarity-value yet
-				{
-					m_Candidates.Add(ix, iy, Segment, Similarity);
-
-					m_pSimilarity->Set_Value(ix, iy, Similarity);
-				}
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-double CRGA_Basic::Get_Similarity(int x, int y, int Segment)
-{
-	CSG_Table_Record	*pSeed;
-
-	if( is_InGrid(x, y) && (pSeed = m_pSeeds->Get_Record(Segment)) != NULL )
-	{
-		int		i;
-		double	a, b, Result;
-
-		switch( m_Method )
-		{
-		//-------------------------------------------------
-		case 0:	// feature space and position
-			for(i=0, a=0.0; i<m_nFeatures; i++)
-			{
-				a	+= SG_Get_Square(m_pFeatures->asGrid(i)->asDouble(x, y) - pSeed->asDouble(SEEDFIELD_Z + i));
-			}
-
-			b	= SG_Get_Square(x - pSeed->asDouble(SEEDFIELD_X))
-				+ SG_Get_Square(y - pSeed->asDouble(SEEDFIELD_Y));
-
-			Result	= a / m_Var_1 + b / m_Var_2;
-
-			break;
-
-		//-------------------------------------------------
-		case 1:	// feature space
-			for(i=0, a=0.0; i<m_nFeatures; i++)
-			{
-				a	+= SG_Get_Square(m_pFeatures->asGrid(i)->asDouble(x, y) - pSeed->asDouble(SEEDFIELD_Z + i));
-			}
-
-			Result	= a / m_Var_1;
-
-			break;
-		}
-
-		return( 1.0 / (1.0 + Result) );	// from 'distance' to 'similarity' !!!
-	//	return( exp(-0.5 * Result) );
-	}
-
-	return( -1.0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp b/src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp
deleted file mode 100644
index 90fe73c..0000000
--- a/src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp
+++ /dev/null
@@ -1,950 +0,0 @@
-/**********************************************************
- * Version $Id: skeletonization.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 imagery_segmentation                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 Grid_Skeletonize.cpp                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "skeletonization.h"
-
-//---------------------------------------------------------
-#define	skNE			1
-#define skJA			2
-
-#define SEGMENT_END		1
-#define SEGMENT_NODE	2
-#define SEGMENT_LOCKED	3
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSkeletonization::CSkeletonization(void)
-{
-	Set_Name		(_TL("Grid Skeletonization"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2002"));
-
-	Set_Description	(_TW(
-		"Simple skeletonisation methods for grids.\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL, "INPUT"			, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "RESULT"			, _TL("Skeleton"),
-		_TL(""),
-		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
-	);
-
-	Parameters.Add_Shapes(
-		NULL, "VECTOR"			, _TL("Skeleton"),
-		_TL(""), PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Choice(
-		NULL, "METHOD"			, _TL("Method"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Standard"),
-			_TL("Hilditch's Algorithm"),
-			_TL("Channel Skeleton")
-		), 0
-	);
-
-	Parameters.Add_Choice(
-		NULL, "INIT_METHOD"		, _TL("Initialisation"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Less than"),
-			_TL("Greater than") 
-		),1
-	);
-
-	Parameters.Add_Value(
-		NULL, "INIT_THRESHOLD"	, _TL("Threshold (Init.)"),
-		_TL(""),
-		PARAMETER_TYPE_Double
-	);
-
-	Parameters.Add_Value(
-		NULL, "CONVERGENCE"		, _TL("Convergence"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 3
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSkeletonization::On_Execute(void)
-{
-	int			Initiation;
-	long		n;
-	double		Threshold;
-	CSG_Grid	*pInput;
-
-	//-----------------------------------------------------
-	pInput		= Parameters("INPUT")			->asGrid();
-	pResult		= Parameters("RESULT")			->asGrid();
-
-	Initiation	= Parameters("INIT_METHOD")		->asInt();
-	Threshold	= Parameters("INIT_THRESHOLD")	->asDouble();
-
-	DataObject_Set_Colors(pResult, 3, SG_COLORS_BLACK_WHITE, true);
-	pResult->Assign(0.0);
-
-	//-----------------------------------------------------
-	for(n=0; n<Get_NCells(); n++)
-	{
-		switch( Initiation )
-		{
-		case 0: default:
-			if( pInput->asDouble(n) < Threshold )
-			{
-				pResult->Set_Value(n, 1);
-			}
-			break;
-
-		case 1:
-			if( pInput->asDouble(n) > Threshold )
-			{
-				pResult->Set_Value(n, 1);
-			}
-			break;
-		}
-	}
-
-	//-----------------------------------------------------
-	switch( Parameters("METHOD")->asInt() )
-	{
-	case 0:	default:
-		Standard_Execute();
-		break;
-
-	case 1:
-		Hilditch_Execute();
-		break;
-
-	case 2:
-		SK_Execute();
-		break;
-	}
-
-	//-------------------------------------------------
-	if( Parameters("VECTOR")->asShapes() )
-	{
-		Vectorize(Parameters("VECTOR")->asShapes());
-	}
-
-	if( 1 )
-	{
-		for(n=0; n<Get_NCells(); n++)
-		{
-			switch( Initiation )
-			{
-			case 0: default:
-				if( pInput->asDouble(n) < Threshold )
-				{
-					pResult->Add_Value(n, 1);
-				}
-				break;
-
-			case 1:
-				if( pInput->asDouble(n) > Threshold )
-				{
-					pResult->Add_Value(n, 1);
-				}
-				break;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//						Helpers							 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSkeletonization::Get_Neighbours(int x, int y, CSG_Grid *pGrid, bool Neighbours[8])
-{
-	int		i, ix, iy, nNeighbours;
-
-	nNeighbours	= 0;
-
-	for(i=0; i<8; i++)
-	{
-		ix	= Get_System()->Get_xTo(i, x);
-		iy	= Get_System()->Get_yTo(i, y);
-
-		if( pGrid->is_InGrid(ix, iy) && pGrid->asByte(ix, iy) )
-		{
-			Neighbours[i]	= true;
-
-			nNeighbours++;
-		}
-		else
-		{
-			Neighbours[i]	= false;
-		}
-	}
-
-	return( nNeighbours );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//					Vectorization						 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSkeletonization::Vectorize(CSG_Shapes *pShapes)
-{
-	bool	z[8], bPrev;
-
-	int		x, y, i, ix, iy, n, nSegments;
-
-	double	xMin, yMin, dx, dy;
-
-	CSG_Shape	*pShape;
-
-	//-----------------------------------------------------
-	pShapes->Create(SHAPE_TYPE_Line, _TL("Skeleton"));
-	pShapes->Add_Field("ID", SG_DATATYPE_Int);
-
-	Lock_Create();
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pResult->asByte(x, y) )
-			{
-				n	= Get_Neighbours(x, y, pResult, z);
-				
-				if( n == 1 )
-				{
-					Lock_Set(x, y, SEGMENT_END);
-				}
-				else if( n > 1 )
-				{
-					n	= 0;
-
-					for(i=0, bPrev=z[7]; i<8; i++)
-					{
-						if( bPrev == false && z[i] == true )
-						{
-							n++;
-						}
-
-						bPrev	= z[i];
-					}
-
-					if( n > 2 )
-					{
-						Lock_Set(x, y, SEGMENT_NODE);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	nSegments	= 0;
-
-	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
-	{
-		dx			= pResult->Get_Cellsize();
-		xMin		= pResult->Get_XMin();// + 0.5 * dx;
-		dy			= pResult->Get_Cellsize();
-		yMin		= pResult->Get_YMin();// + 0.5 * dy;
-
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( Lock_Get(x, y) == SEGMENT_NODE || Lock_Get(x, y) == SEGMENT_END )
-			{
-				Lock_Set(x, y, SEGMENT_LOCKED);
-
-				for(i=0; i<8; i++)
-				{
-					ix	= Get_System()->Get_xTo(i, x);
-					iy	= Get_System()->Get_yTo(i, y);
-
-					if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && !Lock_Get(ix, iy) )
-					{
-						pShape	= pShapes->Add_Shape();
-						pShape->Set_Value(0, ++nSegments);
-						pShape->Add_Point(xMin + dx * (double)x, yMin + dy * (double)y);
-
-						Vectorize_Trace(ix, iy, pShape);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Lock_Destroy();
-
-	Message_Dlg(CSG_String::Format(SG_T("%d %s\n"), nSegments, _TL("segments identified")), Get_Name());
-
-	return( nSegments );
-}
-
-//---------------------------------------------------------
-bool CSkeletonization::Vectorize_Trace(int x, int y, CSG_Shape *pShape)
-{
-	bool	bContinue;
-
-	int		i, ix, iy, iNext;
-
-	double	xMin, yMin, dx, dy;
-
-	//-----------------------------------------------------
-	dx			= pResult->Get_Cellsize();
-	xMin		= pResult->Get_XMin();// + 0.5 * dx;
-	dy			= pResult->Get_Cellsize();
-	yMin		= pResult->Get_YMin();// + 0.5 * dy;
-
-	bContinue	= true;
-
-	do
-	{
-		pShape->Add_Point(xMin + dx * (double)x, yMin + dy * (double)y);
-
-		if( Lock_Get(x, y) == SEGMENT_NODE || Lock_Get(x, y) == SEGMENT_END )
-		{
-			bContinue	= false;
-		}
-		else
-		{
-			Lock_Set(x, y, SEGMENT_LOCKED);
-
-			iNext	= -1;
-
-			for(i=0; i<8; i+=2)
-			{
-				ix	= Get_System()->Get_xTo(i, x);
-				iy	= Get_System()->Get_yTo(i, y);
-
-				if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && Lock_Get(ix, iy) != SEGMENT_LOCKED )
-				{
-					iNext	= i;
-
-					if( Lock_Get(ix, iy) == SEGMENT_NODE )
-					{
-						break;
-					}
-				}
-			}
-
-			if( iNext < 0 )
-			{
-				for(i=1; i<8; i+=2)
-				{
-					ix	= Get_System()->Get_xTo(i, x);
-					iy	= Get_System()->Get_yTo(i, y);
-
-					if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && Lock_Get(ix, iy) != SEGMENT_LOCKED )
-					{
-						iNext	= i;
-
-						if( Lock_Get(ix, iy) == SEGMENT_NODE )
-						{
-							break;
-						}
-					}
-				}
-			}
-
-			if( iNext < 0 )
-			{
-				bContinue	= false;
-			}
-			else
-			{
-				x	+= Get_System()->Get_xTo(iNext);
-				y	+= Get_System()->Get_yTo(iNext);
-			}
-		}
-	}
-	while( bContinue );
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//						Standard						 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSkeletonization::Standard_Execute(void)
-{
-	int		i, nChanges;
-
-	CSG_Grid	*pPrev, *pNext, *pTemp;
-
-	//-----------------------------------------------------
-	pPrev		= pResult;
-	pNext		= SG_Create_Grid(pPrev);
-
-	//-----------------------------------------------------
-	do
-	{
-		DataObject_Update(pResult, 0, 1, true);
-
-		nChanges	= 0;
-
-		for(i=0; i<8; i++)
-		{
-			nChanges	+= Standard_Step(i, pPrev, pNext);
-
-			pTemp		= pPrev;
-			pPrev		= pNext;
-			pNext		= pTemp;
-		}
-	}
-	while( nChanges > 0 && Process_Get_Okay(true) );
-
-	//-----------------------------------------------------
-	if( pNext == pResult )
-	{
-		delete(pPrev);
-	}
-	else
-	{
-		pResult->Assign(pNext);
-
-		delete(pNext);
-	}
-}
-
-//---------------------------------------------------------
-int CSkeletonization::Standard_Step(int iDir, CSG_Grid *pPrev, CSG_Grid *pNext)
-{
-	bool	z[8], bRemove;
-
-	int		x, y, nNeighbours, nChanges;
-
-	pNext->Assign();
-
-	nChanges	= 0;
-
-	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pPrev->asByte(x, y) )
-			{
-				bRemove		= false;
-				nNeighbours	= Get_Neighbours(x, y, pPrev, z);
-
-				if( nNeighbours > 1 && nNeighbours < 6 )
-				{
-					bRemove	= Standard_Check(iDir, z);
-				}
-
-				if( bRemove )
-				{
-					nChanges++;
-				}
-				else
-				{
-					pNext->Set_Value(x, y, 1);
-				}
-			}
-		}
-	}
-
-	return( nChanges );
-}
-
-//---------------------------------------------------------
-inline bool CSkeletonization::Standard_Check(int iDir, bool z[8])
-{
-	bool	bRemove;
-
-	switch( iDir )
-	{
-	default:
-		bRemove	= false;
-		break;
-
-	case 0:
-		bRemove	=	!z[7] && !z[0] && !z[1]
-				&&	 z[3] &&  z[4] &&  z[5];
-		break;
-
-	case 1:
-		bRemove	=	!z[0] && !z[1] && !z[2]
-				&&	 z[4]      &&      z[6];
-		break;
-
-	case 2:
-		bRemove	=	!z[1] && !z[2] && !z[3]
-				&&	 z[5] &&  z[6] &&  z[7];
-		break;
-
-	case 3:
-		bRemove	=	!z[2] && !z[3] && !z[4]
-				&&	 z[6]      &&      z[0];
-		break;
-
-	case 4:
-		bRemove	=	!z[3] && !z[4] && !z[5]
-				&&	 z[7] &&  z[0] &&  z[1];
-		break;
-
-	case 5:
-		bRemove	=	!z[4] && !z[5] && !z[6]
-				&&	 z[0]      &&      z[2];
-		break;
-
-	case 6:
-		bRemove	=	!z[5] && !z[6] && !z[7]
-				&&	 z[1] &&  z[2] &&  z[3];
-		break;
-
-	case 7:
-		bRemove	=	!z[6] && !z[7] && !z[0]
-				&&	 z[2]      &&      z[4];
-		break;
-	}
-
-	return( bRemove );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//						Hilditch						 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSkeletonization::Hilditch_Execute(void)
-{
-	int		nChanges;
-
-	CSG_Grid	*pPrev, *pNext, *pTemp, *pNC_Gaps;
-
-	//-----------------------------------------------------
-	pPrev		= pResult;
-	pNext		= SG_Create_Grid(pPrev);
-	pNC_Gaps	= SG_Create_Grid(pPrev, SG_DATATYPE_Char);
-
-	//-----------------------------------------------------
-	do
-	{
-		DataObject_Update(pResult, 0, 1, true);
-
-		nChanges	= Hilditch_Step(pPrev, pNext, pNC_Gaps);
-
-		pTemp		= pPrev;
-		pPrev		= pNext;
-		pNext		= pTemp;
-	}
-	while( nChanges > 0 && Process_Get_Okay(true) );
-
-	//-----------------------------------------------------
-	delete(pNC_Gaps);
-
-	if( pNext == pResult )
-	{
-		delete(pPrev);
-	}
-	else
-	{
-		pResult->Assign(pNext);
-
-		delete(pNext);
-	}
-}
-
-//---------------------------------------------------------
-int CSkeletonization::Hilditch_Step(CSG_Grid *pPrev, CSG_Grid *pNext, CSG_Grid *pNC_Gaps)
-{
-	bool	z[8], bPrev, bRemove;
-
-	int		x, y, i, nChanges, nNeighbours;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			nChanges	= 0;
-
-			if( pPrev->asByte(x, y) && Get_Neighbours(x, y, pPrev, z) > 0 )
-			{
-				for(i=0, bPrev=z[7]; i<8; i++)
-				{
-					if( bPrev == false && z[i] == true )
-					{
-						nChanges++;
-					}
-
-					bPrev	= z[i];
-				}
-			}
-
-			pNC_Gaps->Set_Value(x, y, nChanges);
-		}
-	}
-
-	//-----------------------------------------------------
-	pNext->Assign();
-
-	nChanges	= 0;
-
-	for(y=0; y<Get_NY() && Process_Get_Okay(false); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pPrev->asByte(x, y) )
-			{
-				bRemove		= false;
-				nNeighbours	= Get_Neighbours(x, y, pPrev, z);
-
-				//-----------------------------------------
-				if( 2 <= nNeighbours && nNeighbours <= 6 && pNC_Gaps->asByte(x, y) == 1 )
-				{
-					bRemove	=	Hilditch_Check(pNC_Gaps, x, y, 0, z)
-							||	Hilditch_Check(pNC_Gaps, x, y, 2, z)
-							||	Hilditch_Check(pNC_Gaps, x, y, 4, z)
-							||	Hilditch_Check(pNC_Gaps, x, y, 6, z)
-							;
-				}
-
-				//-----------------------------------------
-				if( bRemove )
-				{
-					nChanges++;
-				}
-				else
-				{
-					pNext->Set_Value(x, y, true);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( nChanges );
-}
-
-//---------------------------------------------------------
-inline bool CSkeletonization::Hilditch_Check(CSG_Grid *pNC_Gaps, int x, int y, int i0, bool z[8])
-{
-	int		ix, iy, i2, i4, i6;
-
-	i2		= (i0 + 2) % 8;
-	i4		= (i0 + 4) % 8;
-	i6		= (i0 + 6) % 8;
-
-	if( z[i0] || z[i2] || z[i6] )
-	{
-		ix		= Get_System()->Get_xTo(i0, x);
-		iy		= Get_System()->Get_yTo(i0, y);
-
-		if( pNC_Gaps->is_InGrid(ix, iy) && pNC_Gaps->asByte(ix, iy) == 1 )
-		{
-			return( false );
-		}
-	}
-
-	if( z[i0] || z[i2] || z[i4] )
-	{
-		ix		= Get_System()->Get_xTo(i2, x);
-		iy		= Get_System()->Get_yTo(i2, y);
-
-		if( pNC_Gaps->is_InGrid(ix, iy) && pNC_Gaps->asByte(ix, iy) == 1 )
-		{
-			return( false );
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//					Channel Detection					 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSkeletonization::SK_Execute(void)
-{
-	int		x, y, i, ix, iy, n,
-			Convergence, NB[8];
-
-	double	z, iz;
-
-	CSG_Grid	*pInput;
-
-	//-----------------------------------------------------
-	Convergence	= Parameters("CONVERGENCE")->asInt();
-	pInput		= Parameters("INPUT")->asGrid();
-
-	pResult->Assign();
-
-
-	//-----------------------------------------------------
-	// 1.) Find definitive channel points...
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			z	= pInput->asDouble(x, y);
-			n	= 0;
-
-			for(i=0; i<8; i++)
-			{
-				ix	= Get_System()->Get_xTo(i, x);
-				iy	= Get_System()->Get_yTo(i, y);
-
-				if( pInput->is_InGrid(ix, iy) && z < pInput->asDouble(ix, iy) )
-				{
-					n++;
-				}
-			}
-
-			if( Convergence > n )
-			{
-				pResult->Set_Value(x, y, 2);
-			}
-		}
-	}
-
-
-	//-----------------------------------------------------
-	// 2.) Find channels...
-
-	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{	
-		if( pInput->Get_Sorted(n, x, y) )	// Von oben nach unten...
-		{
-			z	= pInput->asDouble(x, y);
-
-			for(i=0; i<8; i++)
-			{
-				ix	= Get_System()->Get_xTo(i,x);
-				iy	= Get_System()->Get_yTo(i,y);
-
-				if( !pInput->is_InGrid(ix, iy) )
-				{
-					NB[i]	= skNE;
-				}
-				else
-				{
-					iz	= pInput->asDouble(ix, iy);
-
-					if( iz < z )
-					{
-						NB[i]	= skNE;
-					}
-					else if( iz > z && pResult->asByte(ix, iy) )
-					{
-						NB[i]	= skJA;
-					}
-					else
-					{
-						NB[i]	= 0;
-					}
-				}
-			}
-
-			if( SK_Connectivity(NB) )
-			{
-				pResult->Set_Value(x, y, 1);
-			}
-		}
-	}
-
-
-	//-----------------------------------------------------
-	/*/ 3.) Filter...
-
-	Lock_Create();
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			SK_Filter(x, y);
-		}
-	}
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( Lock_Get(x, y) )
-			{
-				pResult->Set_Value(x, y, 0);
-			}
-		}
-	}
-
-	Lock_Destroy();/**/
-}
-
-//---------------------------------------------------------
-int CSkeletonization::SK_Connectivity(int NB[8])
-{
-	int		i;
-
-	for(i=0; i<8; i+=2)
-	{
-		if( !NB[i] )
-		{
-			if( !NB[(i+2)%8] )	// Diagonal Connection
-			{
-			/*
-				if( ( NB[(i+1)%8]	)
-				&&	( NB[(i+3)%8] || NB[(i+4)%8] || NB[(i+5)%8] || NB[(i+6)%8] || NB[(i+7)%8] ) )
-					return(1);
-				*/
-
-				///*
-				if( ( NB[(i+1)%8]==skNE	)
-				&&	( NB[(i+3)%8]==skJA || NB[(i+4)%8]==skJA || NB[(i+5)%8]==skJA || NB[(i+6)%8]==skJA || NB[(i+7)%8]==skJA ) )
-					return(1);
-
-				if( ( NB[(i+1)%8]==skJA	)
-				&&	( NB[(i+3)%8]==skNE || NB[(i+4)%8]==skNE || NB[(i+5)%8]==skNE || NB[(i+6)%8]==skNE || NB[(i+7)%8]==skNE ) )
-					return(1);
-				//*/
-			}
-
-			//---Orthogonal-Connection---------------------------------
-			if(!NB[(i+4)%8])
-			{	/*
-				if(	( NB[(i+1)%8] || NB[(i+2)%8] || NB[(i+3)%8] )
-				&&	( NB[(i+5)%8] || NB[(i+6)%8] || NB[(i+7)%8] ) )
-					return(1);
-				*/
-
-				///*
-				if(	( NB[(i+1)%8]==skJA || NB[(i+2)%8]==skJA || NB[(i+3)%8]==skJA )
-				&&	( NB[(i+5)%8]==skNE || NB[(i+6)%8]==skNE || NB[(i+7)%8]==skNE ) )
-					return(1);
-
-				if(	( NB[(i+1)%8]==skNE || NB[(i+2)%8]==skNE || NB[(i+3)%8]==skNE )
-				&&	( NB[(i+5)%8]==skJA || NB[(i+6)%8]==skJA || NB[(i+7)%8]==skJA ) )
-					return(1);
-				//*/
-			}
-		}
-	}
-
-	return( 0 );
-}
-
-//---------------------------------------------------------
-bool CSkeletonization::SK_Filter(int x, int y)
-{
-	bool	z[8];
-
-	if( !pResult->asByte(x, y) && Get_Neighbours(x, y, pResult, z) == 4 )
-	{
-		if( z[0] && z[2] && z[4] && z[6] )
-		{
-			Lock_Set(Get_System()->Get_xTo(0, x), Get_System()->Get_yTo(0, y));
-			Lock_Set(Get_System()->Get_xTo(2, x), Get_System()->Get_yTo(2, y));
-			Lock_Set(Get_System()->Get_xTo(4, x), Get_System()->Get_yTo(4, y));
-			Lock_Set(Get_System()->Get_xTo(6, x), Get_System()->Get_yTo(6, y));
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
diff --git a/src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp b/src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp
deleted file mode 100644
index be62b89..0000000
--- a/src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp
+++ /dev/null
@@ -1,515 +0,0 @@
-/**********************************************************
- * Version $Id: watershed_segmentation.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                 imagery_segmentation                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               watershed_segmentation.cpp              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "watershed_segmentation.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	SEED_X	= 0,
-	SEED_Y,
-	SEED_Z,
-	SEED_ID,
-	SEED_JOIN
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CWatershed_Segmentation::CWatershed_Segmentation(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Watershed Segmentation"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2002"));
-
-	Set_Description	(_TW(
-		"Watershed segmentation."
-	));
-
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "GRID"		, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	pNode	= Parameters.Add_Grid(
-		NULL	, "SEGMENTS"	, _TL("Segments"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "SEEDS"		, _TL("Seed Points"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "BORDERS"		, _TL("Borders"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		pNode	, "OUTPUT"		, _TL("Output"),
-		_TL("The values of the resultant grid can be either the seed value (e.g. the local maximum) or the enumerated segment id."),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Seed Value"),
-			_TL("Segment ID")
-		), 1
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "DOWN"		, _TL("Method"),
-		_TL("Choose if you want to segmentate either on minima or on maxima."),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Minima"),
-			_TL("Maxima")
-		), 1
-	);
-
-	pNode	= Parameters.Add_Choice(
-		NULL	, "JOIN"		, _TL("Join Segments based on Threshold Value"),
-		_TL("Join segments based on threshold value."),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("do not join"),
-			_TL("seed to saddle difference"),
-			_TL("seeds difference")
-		), 0
-	);
-
-	Parameters.Add_Value(
-		pNode	, "THRESHOLD"	, _TL("Threshold"),
-		_TL("Specify a threshold value as minimum difference between neighboured segments."),
-		PARAMETER_TYPE_Double, 0.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "EDGE"		, _TL("Allow Edge Pixels to be Seeds"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "BBORDERS"	, _TL("Borders"),
-		_TL("Create borders between segments as new grid."),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatershed_Segmentation::On_Execute(void)
-{
-	//-----------------------------------------------------
-	m_pGrid		= Parameters("GRID")		->asGrid();
-	m_pSeeds	= Parameters("SEEDS")		->asShapes();
-	m_pSegments	= Parameters("SEGMENTS")	->asGrid();
-	m_bDown		= Parameters("DOWN")		->asInt() == 1;
-
-	//-----------------------------------------------------
-	m_pSeeds->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pGrid->Get_Name(), _TL("Seeds")));
-
-	m_pSeeds->Add_Field(SG_T("XCELL")	, SG_DATATYPE_Int);		// SEED_X
-	m_pSeeds->Add_Field(SG_T("YCELL")	, SG_DATATYPE_Int);		// SEED_Y
-	m_pSeeds->Add_Field(SG_T("VALUE")	, SG_DATATYPE_Double);	// SEED_Z
-	m_pSeeds->Add_Field(SG_T("ID")		, SG_DATATYPE_Int);		// SEED_ID
-	m_pSeeds->Add_Field(SG_T("ID_JOIN")	, SG_DATATYPE_Int);		// SEED_JOIN
-
-	//-----------------------------------------------------
-	m_pSegments->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pGrid->Get_Name(), _TL("Segments")));
-	m_pSegments->Set_NoData_Value(-999999.0);
-
-	m_Dir.Create(*Get_System(), SG_DATATYPE_Char);
-
-	//-----------------------------------------------------
-	if( !Get_Seeds() )
-	{
-		Message_Add(_TL("no seed points identified"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Get_Segments();
-
-	//-----------------------------------------------------
-	if( Parameters("OUTPUT")->asInt() == 0 )
-	{
-		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-		{
-			for(int x=0; x<Get_NX(); x++)
-			{
-				int	ID	= m_pSegments->asInt(x, y);
-
-				if( ID >= 0 )
-				{
-					m_pSegments->Set_Value(x, y, m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z));
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("BBORDERS")->asBool() )
-	{
-		Get_Borders();
-	}
-
-	//-----------------------------------------------------
-	m_Dir.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatershed_Segmentation::Get_Seeds(void)
-{
-	Process_Set_Text(_TL("Seeds"));
-
-	bool	bEdge, bEdge_Seeds;
-	int		x, y, i, ix, iy, iMax;
-	double	z, dz, dzMax;
-
-	//-----------------------------------------------------
-	bEdge_Seeds	= Parameters("EDGE")	->asBool();
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( !m_pGrid->is_InGrid(x, y) )
-			{
-				m_Dir.Set_Value(x, y, -1);
-				m_pSegments->Set_NoData(x, y);
-			}
-			else
-			{
-				for(i=0, iMax=-1, dzMax=0.0, z=m_pGrid->asDouble(x, y), bEdge=false; i<8; i++)
-				{
-					if( !m_pGrid->is_InGrid(ix = Get_xTo(i, x), iy = Get_yTo(i, y)) )
-					{
-						bEdge	= true;
-					}
-					else if( dzMax < (dz = (m_bDown ? m_pGrid->asDouble(ix, iy) - z : z - m_pGrid->asDouble(ix, iy)) / Get_Length(i)) )
-					{
-						dzMax	= dz;
-						iMax	= i;
-					}
-				}
-
-				//---------------------------------------------
-				m_Dir.Set_Value(x, y, iMax);
-
-				if( iMax < 0 && (bEdge_Seeds || !bEdge) )
-				{
-					int			ID	= m_pSeeds->Get_Count();
-
-					CSG_Shape	*pSeed	= m_pSeeds->Add_Shape();
-
-					pSeed->Set_Point(Get_System()->Get_Grid_to_World(x, y), 0);
-
-					pSeed->Set_Value(SEED_X		, x);
-					pSeed->Set_Value(SEED_Y		, y);
-					pSeed->Set_Value(SEED_Z		, z);
-					pSeed->Set_Value(SEED_ID	, ID);
-					pSeed->Set_Value(SEED_JOIN	, -1);
-				
-					m_pSegments->Set_Value(x, y, ID);
-				}
-				else
-				{
-					m_pSegments->Set_Value(x, y, -1);
-				}
-			}
-		}
-	}
-
-	return( m_pSeeds->Get_Count() > 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatershed_Segmentation::Get_Segments(void)
-{
-	Process_Set_Text(_TL("Segments"));
-
-	double	Threshold	= Parameters("THRESHOLD")->asDouble();
-	int		Join		= Threshold > 0.0 ? Parameters("JOIN")->asInt() : 0;
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)	
-	{
-		int		x, y, i, ID, iID;
-
-		if( m_pGrid->Get_Sorted(n, x, y, m_bDown) && (i = m_Dir.asInt(x, y)) >= 0 )
-		{
-			m_pSegments->Set_Value(x, y, ID = m_pSegments->asInt(Get_xTo(i, x), Get_yTo(i, y)));
-
-			if( Join != 0 && ID >= 0 )
-			{
-				double	z	= m_pGrid->asDouble(x, y);
-
-				for(int i=0; i<8; i++)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( m_pSegments->is_InGrid(ix, iy) && (iID = m_pSegments->asInt(ix, iy)) >= 0 )	// Border < 0, Segment >= 0
-					{
-						if( ID != iID )
-						{
-							bool	bJoin;
-
-							if( Join == 1 )
-							{
-								bJoin	=  (Threshold >= fabs(m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) - z))
-										|| (Threshold >= fabs(m_pSeeds->Get_Shape( ID)->asDouble(SEED_Z) - z));
-							}
-							else
-							{
-								bJoin	=  Threshold >= fabs(m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) - m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z));
-							}
-
-							if( bJoin )
-							{
-								if(	(m_bDown == true  && m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) < m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z))
-								||	(m_bDown == false && m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) > m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z)) )
-								{
-									Segment_Change(iID, ID);
-								}
-								else
-								{
-									Segment_Change(ID, iID);
-
-									ID	= iID;
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatershed_Segmentation::Segment_Change(int ID, int new_ID)
-{
-	bool	bContinue;
-	int		ax, ay, bx, by;
-
-	//-----------------------------------------------------
-	CSG_Shape	*pSeed	= m_pSeeds->Get_Shape(ID);
-
-	pSeed->Set_Value(SEED_JOIN, new_ID);
-
-	ax	= bx	= pSeed->asInt(SEED_X);
-	ay	= by	= pSeed->asInt(SEED_Y);
-
-	do
-	{
-		bContinue	= false;
-
-		for(int x=ax; x<=bx; x++)
-		{
-			if( m_pSegments->asInt( x, ay) == ID )
-			{
-				m_pSegments->Set_Value( x, ay, new_ID);
-
-				bContinue	= true;
-			}
-
-			if( m_pSegments->asInt( x, by) == ID )
-			{
-				m_pSegments->Set_Value( x, by, new_ID);
-
-				bContinue	= true;
-			}
-		}
-
-		for(int y=ay; y<=by; y++)
-		{
-			if( m_pSegments->asInt(ax,  y) == ID )
-			{
-				m_pSegments->Set_Value(ax,  y, new_ID);
-
-				bContinue	= true;
-			}
-
-			if( m_pSegments->asInt(bx,  y) == ID )
-			{
-				m_pSegments->Set_Value(bx,  y, new_ID);
-
-				bContinue	= true;
-			}
-		}
-
-		if( ax > 0 )			ax--;
-		if( ay > 0 )			ay--;
-		if( bx < Get_NX() - 1 )	bx++;
-		if( by < Get_NY() - 1 )	by++;
-	}
-	while( bContinue );
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatershed_Segmentation::Get_Borders(void)
-{
-	Process_Set_Text(_TL("Borders"));
-
-	CSG_Grid	*pBorders	= SG_Create_Grid(SG_DATATYPE_Byte, Get_NX() + 2, Get_NY() + 2, Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize());
-
-	pBorders->Set_NoData_Value(0);
-
-	Parameters("BORDERS")->Set_Value(pBorders);
-
-	for(int y=0, yy=1; yy<Get_NY() && Set_Progress(yy); y++, yy++)
-	{
-		for(int x=0, xx=1; xx<Get_NX(); x++, xx++)
-		{
-			int		id	= m_pSegments->asInt(x, y);
-
-			if( id != m_pSegments->asInt(xx,  y) )
-			{
-				pBorders->Set_Value(xx,  y, 1);
-			}
-
-			if( id != m_pSegments->asInt( x, yy) )
-			{
-				pBorders->Set_Value( x, yy, 1);
-			}
-
-			if( id != m_pSegments->asInt(xx, yy) )
-			{
-				pBorders->Set_Value(xx, yy, 1);
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_svm/Makefile.in b/src/modules_images/modules_imagery/imagery_svm/Makefile.in
deleted file mode 100644
index 15e7ef9..0000000
--- a/src/modules_images/modules_imagery/imagery_svm/Makefile.in
+++ /dev/null
@@ -1,576 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_imagery/imagery_svm
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libimagery_svm_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libimagery_svm_la_OBJECTS = MLB_Interface.lo svm.lo svm_grids.lo
-libimagery_svm_la_OBJECTS = $(am_libimagery_svm_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libimagery_svm_la_SOURCES)
-DIST_SOURCES = $(libimagery_svm_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libimagery_svm.la
-libimagery_svm_la_SOURCES = \
-MLB_Interface.cpp\
-svm.cpp\
-svm_grids.cpp\
-MLB_Interface.h\
-svm.h\
-svm_grids.h
-
-libimagery_svm_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_svm/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_svm/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libimagery_svm.la: $(libimagery_svm_la_OBJECTS) $(libimagery_svm_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_svm_la_OBJECTS) $(libimagery_svm_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svm_grids.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp b/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp
deleted file mode 100644
index c61e2e5..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/**********************************************************
- * Version $Id: Image_VI_Distance.cpp 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Image_VI_Distance.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Image_VI_Distance.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CImage_VI_Distance::CImage_VI_Distance(void)
-{
-	Set_Name		(_TL("Vegetation Index (Distance Based)"));
-
-	Set_Author		(SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Distance based vegetation indices.\n"
-	//	"\n<ul>"
-	//	"<li>Transformed Soil Adjusted Vegetation Index (s. McCloy, 2006)\n"
-	//	"    TSAVI = (NIR - Gain * R - Offset) * Gain / (Gain * NIR + R - Gain * Offset)</li>\n"
-	//	"<li>Transformed Soil Adjusted Vegetation Index (s. McCloy, 2006)\n"
-	//	"    ATSAVI = (NIR - Gain * R - Offset) / (Gain * NIR + R - gain * Offset + 0.8 * (1 + Gain^2))</li>\n"
-	//	"</ul>(NIR = near infrared, R = red, S = soil adjustment factor)\n"
-		"\n"
-		"References:\n"
-		"K.R. McCloy (2006): Resource Management Information Systems: Remote Sensing, GIS and Modelling. 2nd Edition, CRC Taylor & Francis, 575pp.\n"
-		"\n"
-		"N.G. Silleos, T.K. Alexandridis, I.Z. Gitas & K. Perakis (2006): "
-		"Vegetation Indices: Advances Made in Biomass Estimation and Vegetation Monitoring in the Last 30 Years, "
-		"Geocarto International, 21:4, 21-28, "
-		"<a target=\"_blank\" href=\"http://dx.doi.org/10.1080/10106040608542399\">online</a>.\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL, "RED"			, _TL("Red Reflectance"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "NIR"			, _TL("Near Infrared Reflectance"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "PVI0"		, _TL("Perpendicular Vegetation Index (Richardson and Wiegand, 1977)"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "PVI1"		, _TL("Perpendicular Vegetation Index (Perry and Lautenschlager, 1984)"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "PVI2"		, _TL("Perpendicular Vegetation Index (Walther and Shabaani)"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "PVI3"		, _TL("Perpendicular Vegetation Index (Qi, et al., 1994)"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "TSAVI"		, _TL("Transformed Soil Adjusted Vegetation Index (Baret et al. 1989)"), 
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "ATSAVI"		, _TL("Transformed Soil Adjusted Vegetation Index (Baret and Guyot, 1991)"), 
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL, "INTERCEPT"	, _TL("Intercept of Soil Line"), 
-		_TL(""), 
-		PARAMETER_TYPE_Double, 0
-	);
-
-	Parameters.Add_Value(
-		NULL, "SLOPE"		, _TL("Slope of Soil Line"), 
-		_TL(""), 
-		PARAMETER_TYPE_Double, 0.5
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CImage_VI_Distance::On_Execute(void)
-{	
-	CSG_Grid	*pRed		= Parameters("RED"   )->asGrid();
-	CSG_Grid	*pNIR		= Parameters("NIR"   )->asGrid();
-
-	CSG_Grid	*pPVI0		= Parameters("PVI0"  )->asGrid();
-	CSG_Grid	*pPVI1		= Parameters("PVI1"  )->asGrid();
-	CSG_Grid	*pPVI2		= Parameters("PVI2"  )->asGrid();
-	CSG_Grid	*pPVI3		= Parameters("PVI3"  )->asGrid();
-	CSG_Grid	*pTSAVI		= Parameters("TSAVI" )->asGrid();
-	CSG_Grid	*pATSAVI	= Parameters("ATSAVI")->asGrid();
-
-	DataObject_Set_Colors(pPVI0  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pPVI1  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pPVI2  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pPVI3  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pTSAVI , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pATSAVI, 100, SG_COLORS_WHITE_GREEN, false);
-
-	m_Slope		= Parameters("SLOPE"    )->asDouble();
-	m_Intercept	= Parameters("INTERCEPT")->asDouble();
-
-	if( m_Slope <= 0.0 )
-	{
-		Error_Set(_TL("slope value has to be greater than zero"));
-
-		return( false );
-	}
-		
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) )
-			{
-				if( pPVI0   )	pPVI0  ->Set_NoData(x, y);
-				if( pPVI1   )	pPVI1  ->Set_NoData(x, y);
-				if( pPVI2   )	pPVI2  ->Set_NoData(x, y);
-				if( pPVI3   )	pPVI3  ->Set_NoData(x, y);
-				if( pTSAVI  )	pTSAVI ->Set_NoData(x, y);
-				if( pATSAVI )	pATSAVI->Set_NoData(x, y);
-			}
-			else
-			{
-				double	R, NIR, Value;
-
-				R	= pRed->asDouble(x, y);
-				NIR	= pNIR->asDouble(x, y);
-
-				if( pPVI0   ) { if( Get_PVI0  (R, NIR, Value) ) pPVI0  ->Set_Value(x, y, Value); else pPVI0  ->Set_NoData(x, y); }
-				if( pPVI1   ) { if( Get_PVI1  (R, NIR, Value) ) pPVI1  ->Set_Value(x, y, Value); else pPVI1  ->Set_NoData(x, y); }
-				if( pPVI2   ) { if( Get_PVI2  (R, NIR, Value) ) pPVI2  ->Set_Value(x, y, Value); else pPVI2  ->Set_NoData(x, y); }
-				if( pPVI3   ) { if( Get_PVI3  (R, NIR, Value) ) pPVI3  ->Set_Value(x, y, Value); else pPVI3  ->Set_NoData(x, y); }
-				if( pTSAVI  ) { if( Get_TSAVI (R, NIR, Value) ) pTSAVI ->Set_Value(x, y, Value); else pTSAVI ->Set_NoData(x, y); }
-				if( pATSAVI ) { if( Get_ATSAVI(R, NIR, Value) ) pATSAVI->Set_Value(x, y, Value); else pATSAVI->Set_NoData(x, y); }
-			}
-        }
-    }
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline bool CImage_VI_Distance::Get_PVI0(double R, double NIR, double &Value)	// Richardson & Wiegand, 1977
-{
-	double dB1	= 1.0 / m_Slope;
-	double dB0	= R - NIR / m_Slope;
-
-	double Rgg5	= (dB1 * m_Intercept - dB0 * m_Slope) / (dB1 - m_Slope);
-	double Rgg7	= (m_Intercept - dB0) / (dB1 - m_Slope);
-	
-	Value	= sqrt(pow(Rgg5 - R, 2.0) + pow(Rgg7 - NIR, 3.0));
-
-	return( true );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Distance::Get_PVI1(double R, double NIR, double &Value)	// Perry & Rautenschlager, 1984
-{
-	if( (Value = sqrt(1.0 + m_Slope * m_Slope)) != 0.0 )
-	{
-		Value	= ((m_Slope * NIR - R) + m_Intercept) / Value;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Distance::Get_PVI2(double R, double NIR, double &Value)
-{
-	if( (Value = sqrt(1.0 + m_Intercept)) != 0.0 )
-	{
-		Value	= (NIR - m_Intercept) * (R + m_Slope) / Value;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Distance::Get_PVI3(double R, double NIR, double &Value)	// Qi et al., 1994
-{
-	Value	= (NIR * m_Intercept) - (R * m_Slope);
-
-	return( true );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Distance::Get_TSAVI(double R, double NIR, double &Value)	// Baret et al., 1989
-{
-	if( (Value = R + m_Slope * NIR - m_Slope * m_Intercept) != 0.0 )
-	{
-		Value	= m_Slope * (NIR - m_Slope) * (R - m_Intercept) / Value;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Distance::Get_ATSAVI(double R, double NIR, double &Value)	// Baret & Guyot, 1991
-{
-	if( (Value = R + m_Slope * NIR - m_Slope * m_Intercept + 0.08 * (1.0 + m_Slope*m_Slope)) != 0.0 )
-	{
-		Value	= m_Slope * (NIR - m_Slope * R - m_Intercept) / Value;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h b/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h
deleted file mode 100644
index b16b5fb..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**********************************************************
- * Version $Id: Image_VI_Distance.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Image_VI_Distance.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Image_VI_Distance_H
-#define HEADER_INCLUDED__Image_VI_Distance_H
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CImage_VI_Distance : public CSG_Module_Grid
-{
-public:
-	CImage_VI_Distance(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	double					m_Intercept, m_Slope;
-
-
-	bool					Get_PVI0		(double R, double NIR, double &Value);
-	bool					Get_PVI1		(double R, double NIR, double &Value);
-	bool					Get_PVI2		(double R, double NIR, double &Value);
-	bool					Get_PVI3		(double R, double NIR, double &Value);
-	bool					Get_TSAVI		(double R, double NIR, double &Value);
-	bool					Get_ATSAVI		(double R, double NIR, double &Value);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Image_VI_Distance_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp b/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp
deleted file mode 100644
index eb5f2ac..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp
+++ /dev/null
@@ -1,329 +0,0 @@
-/**********************************************************
- * Version $Id: Image_VI_Slope.cpp 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Image_VI_Slope.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Image_VI_Slope.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CImage_VI_Slope::CImage_VI_Slope(void)
-{
-	Set_Name		(_TL("Vegetation Index (Slope Based)"));
-
-	Set_Author		(SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Slope based vegetation indices.\n"
-		"\n<ul>"
-		"<li>Ratio Vegetation Index (Richardson and Wiegand, 1977)\n"
-		"    RVI = R / NIR</li>\n"
-		"<li>Normalized Ratio Vegetation Index (Baret and Guyot, 1991)\n"
-		"    NRVI = (RVI - 1) / (RVI + 1)</li>\n"
-		"<li>Normalized Difference Vegetation Index (Rouse et al. 1974)\n"
-		"    NDVI = (NIR - R) / (NIR + R)</li>\n"
-		"<li>Transformed Vegetation Index (Deering et al., 1975)\n"
-		"    TVI = [(NIR - R) / (NIR + R)]^0.5 + 0.5 </li>\n"
-		"<li>Corrected Transformed Ratio Vegetation Index (Perry and Lautenschlager, 1984)\n"
-		"    CTVI = [(NDVI + 0.5) / abs(NDVI + 0.5)] * [abs(NDVI + 0.5)]^0.5</li>\n"
-		"<li>Thiam's Transformed Vegetation Index (Thiam, 1997)\n"
-		"    RVI = [abs(NDVI) + 0.5]^0.5</li>\n"
-		"<li>Soil Adjusted Vegetation Index (Huete, 1988)\n"
-		"    SAVI = [(NIR - R) / (NIR + R)] * (1 + S)</li>\n"
-		"</ul>(NIR = near infrared, R = red, S = soil adjustment factor)\n"
-		"\n"
-		"References:\n"
-		"K.R. McCloy (2006): Resource Management Information Systems: Remote Sensing, GIS and Modelling. 2nd Edition, CRC Taylor & Francis, 575pp.\n"
-		"\n"
-		"N.G. Silleos, T.K. Alexandridis, I.Z. Gitas & K. Perakis (2006): "
-		"Vegetation Indices: Advances Made in Biomass Estimation and Vegetation Monitoring in the Last 30 Years, "
-		"Geocarto International, 21:4, 21-28, "
-		"<a target=\"_blank\" href=\"http://dx.doi.org/10.1080/10106040608542399\">online</a>.\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL, "RED"		, _TL("Red Reflectance"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "NIR"		, _TL("Near Infrared Reflectance"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "DVI"		, _TL("Difference Vegetation Index"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "NDVI"	, _TL("Normalized Difference Vegetation Index"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-	
-	Parameters.Add_Grid(
-		NULL, "RVI"		, _TL("Ratio Vegetation Index"), 
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "NRVI"	, _TL("Normalized Ratio Vegetation Index"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "TVI"		, _TL("Transformed Vegetation Index"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "CTVI"	, _TL("Corrected Transformed Vegetation Index"), 
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "TTVI"	, _TL("Thiam's Transformed Vegetation Index"), 
-		_TL(""), 
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "SAVI"		, _TL("Soil Adjusted Vegetation Index"), 
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL, "SOIL"	, _TL("Soil Adjustment Factor"), 
-		_TW("Soil adjustment factor for SAVI calculation. "
-			"Suggested values are 1.0 in case of very low vegetation, "
-			"0.5 for intermediate 0.5, and 0.25 for high densities (Silleos et al. 2006)."),
-		PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CImage_VI_Slope::On_Execute(void)
-{
-	CSG_Grid	*pRed		= Parameters("RED"  )->asGrid();
-	CSG_Grid	*pNIR		= Parameters("NIR"  )->asGrid();
-
-	CSG_Grid	*pDVI		= Parameters("DVI"  )->asGrid();
-	CSG_Grid	*pNDVI		= Parameters("NDVI" )->asGrid();
-	CSG_Grid	*pRVI		= Parameters("RVI"  )->asGrid();
-	CSG_Grid	*pNRVI		= Parameters("NRVI" )->asGrid();
-	CSG_Grid	*pTVI		= Parameters("TVI"  )->asGrid();
-	CSG_Grid	*pCTVI		= Parameters("CTVI" )->asGrid();
-	CSG_Grid	*pTTVI		= Parameters("TTVI" )->asGrid();
-	CSG_Grid	*pSAVI		= Parameters("SAVI" )->asGrid();
-
-	DataObject_Set_Colors(pDVI  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pNDVI , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pRVI  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pNRVI , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pTVI  , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pCTVI , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pTTVI , 100, SG_COLORS_WHITE_GREEN, false);
-	DataObject_Set_Colors(pSAVI , 100, SG_COLORS_WHITE_GREEN, false);
-
-	m_Soil	= Parameters("SOIL")->asDouble();
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) )
-			{
-				if( pDVI   )	pDVI	->Set_NoData(x, y);
-				if( pNDVI  )	pNDVI	->Set_NoData(x, y);
-				if( pRVI   )	pRVI	->Set_NoData(x, y);
-				if( pNRVI  )	pNRVI	->Set_NoData(x, y);
-				if( pTVI   )	pTVI	->Set_NoData(x, y);
-				if( pTTVI  )	pTTVI	->Set_NoData(x, y);
-				if( pCTVI  )	pCTVI	->Set_NoData(x, y);
-				if( pSAVI  )	pSAVI	->Set_NoData(x, y);
-			}
-			else
-			{
-				double	R, NIR, Value;
-
-				R	= pRed->asDouble(x, y);
-				NIR	= pNIR->asDouble(x, y);
-
-				if( pDVI   ) { if( Get_DVI  (R, NIR, Value) ) pDVI  ->Set_Value(x, y, Value); else pDVI  ->Set_NoData(x, y); }
-				if( pNDVI  ) { if( Get_NDVI (R, NIR, Value) ) pNDVI ->Set_Value(x, y, Value); else pNDVI ->Set_NoData(x, y); }
-				if( pRVI   ) { if( Get_RVI  (R, NIR, Value) ) pRVI  ->Set_Value(x, y, Value); else pRVI  ->Set_NoData(x, y); }
-				if( pNRVI  ) { if( Get_NRVI (R, NIR, Value) ) pNRVI ->Set_Value(x, y, Value); else pNRVI ->Set_NoData(x, y); }
-				if( pTVI   ) { if( Get_TVI  (R, NIR, Value) ) pTVI  ->Set_Value(x, y, Value); else pTVI  ->Set_NoData(x, y); }
-				if( pCTVI  ) { if( Get_CTVI (R, NIR, Value) ) pCTVI ->Set_Value(x, y, Value); else pCTVI ->Set_NoData(x, y); }
-				if( pTTVI  ) { if( Get_TTVI (R, NIR, Value) ) pTTVI ->Set_Value(x, y, Value); else pTTVI ->Set_NoData(x, y); }
-				if( pSAVI  ) { if( Get_SAVI (R, NIR, Value) ) pSAVI ->Set_Value(x, y, Value); else pSAVI ->Set_NoData(x, y); }
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_DVI(double R, double NIR, double &Value)
-{
-	Value	= NIR - R;
-
-	return( true );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_NDVI(double R, double NIR, double &Value)
-{
-	if( R + NIR != 0.0 )
-	{
-		Value	= (NIR - R) / (NIR + R);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_RVI(double R, double NIR, double &Value)
-{
-	if( R != 0.0 )
-	{
-		Value	= NIR / R;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_NRVI(double R, double NIR, double &Value)
-{
-	if( Get_RVI(R, NIR, Value) && Value + 1.0 != 0.0 )
-	{
-		Value	= (Value - 1.0) / (Value + 1.0);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_TVI(double R, double NIR, double &Value)
-{
-	if( Get_NDVI(R, NIR, Value) && Value > 0.0 )
-	{
-		Value	= sqrt(Value) + 0.5;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_CTVI(double R, double NIR, double &Value)
-{
-	if( Get_NDVI(R, NIR, Value) )
-	{
-		Value	+= 0.5;
-
-		Value	= Value > 0.0 ? sqrt(fabs(Value)) : -sqrt(fabs(Value));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_TTVI(double R, double NIR, double &Value)
-{
-	if( Get_NDVI(R, NIR, Value) )
-	{
-		Value	= sqrt(fabs(Value + 0.5));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CImage_VI_Slope::Get_SAVI(double R, double NIR, double &Value)
-{
-	if( Get_NDVI(R, NIR, Value) )
-	{
-		Value	= Value * (1.0 + m_Soil);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h b/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h
deleted file mode 100644
index ffa09ea..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/**********************************************************
- * Version $Id: Image_VI_Slope.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Image_VI_Slope.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Image_VI_Slope_H
-#define HEADER_INCLUDED__Image_VI_Slope_H
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CImage_VI_Slope : public CSG_Module_Grid
-{
-public:
-	CImage_VI_Slope(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	double					m_Soil, m_Offset, m_Gain;
-
-
-	bool					Get_DVI			(double R, double NIR, double &Value);
-	bool					Get_NDVI		(double R, double NIR, double &Value);
-	bool					Get_RVI			(double R, double NIR, double &Value);
-	bool					Get_NRVI		(double R, double NIR, double &Value);
-	bool					Get_TVI			(double R, double NIR, double &Value);
-	bool					Get_CTVI		(double R, double NIR, double &Value);
-	bool					Get_TTVI		(double R, double NIR, double &Value);
-	bool					Get_SAVI		(double R, double NIR, double &Value);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Image_VI_Slope_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp b/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp
deleted file mode 100644
index 8dbee23..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2009 by                 //
-//                 SAGA User Group Assoc.                //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     author at email.de                        //
-//                                                       //
-//    contact:    Author                                 //
-//                Sesame Street. 7                       //
-//                12345 Metropolis                       //
-//                Nirwana                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//			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("Imagery - Tools") );
-
-	case MLB_INFO_Author:
-		return( SG_T("SAGA User Group Assoc. (c) 2009") );
-
-	case MLB_INFO_Description:
-		return( _TL("Image processing tools.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Imagery|Tools") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "Image_VI_Distance.h"
-#include "Image_VI_Slope.h"
-#include "evi.h"
-#include "tasseled_cap.h"
-
-#include "pansharpening.h"
-
-#include "landsat_toar.h"
-#include "landsat_acca.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CImage_VI_Distance );
-	case  1:	return( new CImage_VI_Slope );
-	case  2:	return( new CEnhanced_VI );
-	case  3:	return( new CTasseled_Cap );
-
-	case  4:	return( new CPanSharp_IHS );
-	case  5:	return( new CPanSharp_Brovey );
-	case  6:	return( new CPanSharp_CN );
-	case  7:	return( new CPanSharp_PCA );
-
-	case  8:	return( new CLandsat_TOAR );
-	case  9:	return( new CLandsat_ACCA );
-
-	//-----------------------------------------------------
-	case 10:	return( NULL );
-	default:	return( MLB_INTERFACE_SKIP_MODULE );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.h b/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.h
deleted file mode 100644
index e677e60..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Library Template                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 by                 //
-//                        Author                         //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     author at email.de                        //
-//                                                       //
-//    contact:    Author                                 //
-//                Sesame Street. 7                       //
-//                12345 Metropolis                       //
-//                Nirwana                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__imagery_segmentation_H
-#define HEADER_INCLUDED__imagery_segmentation_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__imagery_segmentation_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/Makefile.in b/src/modules_images/modules_imagery/imagery_tools/Makefile.in
deleted file mode 100644
index 8379c96..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/Makefile.in
+++ /dev/null
@@ -1,597 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_imagery/imagery_tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libimagery_tools_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libimagery_tools_la_OBJECTS = evi.lo Image_VI_Distance.lo \
-	Image_VI_Slope.lo landsat_acca.lo landsat_toar.lo \
-	landsat_toar_core.lo MLB_Interface.lo pansharpening.lo \
-	tasseled_cap.lo
-libimagery_tools_la_OBJECTS = $(am_libimagery_tools_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libimagery_tools_la_SOURCES)
-DIST_SOURCES = $(libimagery_tools_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libimagery_tools.la
-libimagery_tools_la_SOURCES = \
-evi.cpp\
-Image_VI_Distance.cpp\
-Image_VI_Slope.cpp\
-landsat_acca.cpp\
-landsat_toar.cpp\
-landsat_toar_core.cpp\
-MLB_Interface.cpp\
-pansharpening.cpp\
-tasseled_cap.cpp\
-evi.h\
-Image_VI_Distance.h\
-Image_VI_Slope.h\
-landsat_acca.h\
-landsat_toar.h\
-landsat_toar_core.h\
-MLB_Interface.h\
-pansharpening.h\
-tasseled_cap.h
-
-libimagery_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_tools/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_imagery/imagery_tools/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libimagery_tools.la: $(libimagery_tools_la_OBJECTS) $(libimagery_tools_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libimagery_tools_la_OBJECTS) $(libimagery_tools_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Image_VI_Distance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Image_VI_Slope.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/evi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/landsat_acca.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/landsat_toar.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/landsat_toar_core.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pansharpening.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tasseled_cap.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_imagery/imagery_tools/evi.cpp b/src/modules_images/modules_imagery/imagery_tools/evi.cpp
deleted file mode 100644
index 3a001b2..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/evi.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/**********************************************************
- * Version $Id: evi.cpp 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                        evi.cpp                        //
-//                                                       //
-//                 Copyright (C) 2011 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 "evi.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CEnhanced_VI::CEnhanced_VI(void)
-{
-	Set_Name		(_TL("Enhanced Vegetation Index"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Enhanced Vegetation Index (EVI).\n"
-		"\n"
-		"References:\n"
-		"A Huete, K Didan, T Miura, E.P Rodriguez, X Gao, L.G Ferreira, "
-		"Overview of the radiometric and biophysical performance of the MODIS vegetation indices, "
-		"Remote Sensing of Environment, Volume 83, Issues 1-2, November 2002, Pages 195-213, ISSN 0034-4257, 10.1016/S0034-4257(02)00096-2. "
-		"<a target=\"_blank\" href=\"http://www.sciencedirect.com/science/article/pii/S0034425702000962\">online</a>\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL, "BLUE"	, _TL("Blue Reflectance"),
-		_TL(""), 
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "RED"		, _TL("Red Reflectance"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "NIR"		, _TL("Near Infrared Reflectance"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "EVI"		, _TL("Enhanced Vegetation Index"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL, "GAIN"	, _TL("Gain"), 
-		_TL(""),
-		PARAMETER_TYPE_Double, 2.5, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL, "L"		, _TL("Canopy Background Adjustment"), 
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL, "CBLUE"	, _TL("Aerosol Resistance Coefficient (Blue)"), 
-		_TL(""),
-		PARAMETER_TYPE_Double, 7.5, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL, "CRED"	, _TL("Aerosol Resistance Coefficient (Red)"), 
-		_TL(""),
-		PARAMETER_TYPE_Double, 6.0, 0.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CEnhanced_VI::On_Execute(void)
-{
-	CSG_Grid	*pBlue	= Parameters("BLUE" )->asGrid();
-	CSG_Grid	*pRed	= Parameters("RED"  )->asGrid();
-	CSG_Grid	*pNIR	= Parameters("NIR"  )->asGrid();
-
-	CSG_Grid	*pEVI	= Parameters("EVI"  )->asGrid();
-
-	double		Gain	= Parameters("GAIN" )->asDouble();
-	double		L		= Parameters("L"    )->asDouble();
-	double		CBlue	= Parameters("CBLUE")->asDouble();
-	double		CRed	= Parameters("CRED" )->asDouble();
-
-	DataObject_Set_Colors(pEVI, 100, SG_COLORS_WHITE_GREEN, false);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	d;
-
-			if( (pBlue && pBlue->is_NoData(x, y)) || pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) )
-			{
-				d	= 0.0;
-			}
-			else if( pBlue )
-			{
-				d	= L + pNIR->asDouble(x, y) + CRed * pRed->asDouble(x, y) + CBlue * pBlue->asDouble(x, y);
-			}
-			else
-			{
-				d	= L + pNIR->asDouble(x, y) + CRed * pRed->asDouble(x, y);
-			}
-
-			if( d )
-			{
-				pEVI->Set_Value(x, y, Gain * (pNIR->asDouble(x, y) - pRed->asDouble(x, y)) / d);
-			}
-			else
-			{
-				pEVI->Set_NoData(x, y);
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/evi.h b/src/modules_images/modules_imagery/imagery_tools/evi.h
deleted file mode 100644
index e52b6c6..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/evi.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/**********************************************************
- * Version $Id: Image_VI_Slope.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                         evi.h                         //
-//                                                       //
-//                 Copyright (C) 2011 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__evi_H
-#define HEADER_INCLUDED__evi_H
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CEnhanced_VI : public CSG_Module_Grid
-{
-public:
-	CEnhanced_VI(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__evi_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/landsat_acca.cpp b/src/modules_images/modules_imagery/imagery_tools/landsat_acca.cpp
deleted file mode 100644
index 9af1bd0..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/landsat_acca.cpp
+++ /dev/null
@@ -1,889 +0,0 @@
-/**********************************************************
- * Version $Id: landsat_acca.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     imagery_tools                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   landsat_acca.cpp                    //
-//                                                       //
-//                 Copyright (C) 2013 by                 //
-//            Benjamin Bechtel & 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 "landsat_acca.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define NO_DEFINED		1
-#define IS_SHADOW		2
-#define IS_COLD_CLOUD	6
-#define IS_WARM_CLOUD	9
-
-//---------------------------------------------------------
-#define LUT_SET_CLASS(id, name, color)	{ CSG_Table_Record *pR = pLUT->asTable()->Add_Record(); pR->Set_Value(0, color); pR->Set_Value(1, name); pR->Set_Value(3, id); pR->Set_Value(3, id); }
-
-//---------------------------------------------------------
-void	acca_algorithm	(CSG_Grid *pCloud, CSG_Grid *band[], int single_pass, int with_shadow, int cloud_signature);
-void	filter_holes	(CSG_Grid *pGrid);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CLandsat_ACCA::CLandsat_ACCA(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Automated Cloud Cover Assessment"));
-
-	Set_Author		(_TL("B.Bechtel, O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Automated Cloud-Cover Assessment (ACCA) for Landsat TM/ETM+ imagery as proposed by Irish (2000). "
-		"This module incorporates E.J. Tizado's GRASS GIS implementation (i.landsat.acca).\n"
-		"\n"
-		"References:\n"
-		"- Irish, R.R. (2000): Landsat 7 Automatic Cloud Cover Assessment."
-		" In Shen, S.S., Descour, M.R. (Eds.): Algorithms for Multispectral, Hyperspectral, and Ultraspectral Imagery VI. "
-		" Proceedings of SPIE, 4049: 348-355. "
-		"<a target=\"_blank\" href=\"http://landsathandbook.gsfc.nasa.gov/pdfs/ACCA_SPIE_paper.pdf\">online</a>.\n"
-		"- Irish, R.R., Barker J.L., Goward S.N., Arvidson T. (2006): "
-		" Characterization of the Landsat-7 ETM+ Automated Cloud-Cover Assessment (ACCA) Algorithm."
-		" Photogrammetric Engineering and Remote Sensing vol. 72(10): 1179-1188. "
-		"<a target=\"_blank\" href=\"http://landsathandbook.gsfc.nasa.gov/pdfs/ACCA_Special_Issue_Final.pdf\">online</a>.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(NULL, "BAND2", _TL("Landsat Band 2"), _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL, "BAND3", _TL("Landsat Band 3"), _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL, "BAND4", _TL("Landsat Band 4"), _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL, "BAND5", _TL("Landsat Band 5"), _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL, "BAND6", _TL("Landsat Band 6"), _TL(""), PARAMETER_INPUT, false);
-
-	Parameters.Add_Grid(
-		NULL	, "CLOUD"		, _TL("Cloud Cover"),
-		_TL(""),
-		PARAMETER_OUTPUT, true, SG_DATATYPE_Char
-	);
-
-	Parameters.Add_Value(
-		NULL	, "FILTER"		, _TL("Apply post-processing filter to remove small holes"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Node(
-		NULL	, "NODE_THRS"	, _TL("Thresholds"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode	, "B56C"		, _TL("B56 Composite (step 6)"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 225.0
-	);
-
-	Parameters.Add_Value(
-		pNode	, "B45R"		, _TL("B45 Ratio: Desert detection (step 10)"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Node(
-		NULL	, "NODE_CLOUD"	, _TL("Cloud Settings"),
-		_TL("")
-	);
-
-//	Parameters.Add_Value(
-//		pNode	, "HIST_N"		, _TL("Number of classes in the cloud temperature histogram"),
-//		_TL(""),
-//		PARAMETER_TYPE_Int, 100, 10, true
-//	);
-
-	Parameters.Add_Value(
-		pNode	, "CSIG"		, _TL("Always use cloud signature (step 14)"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "PASS2"		, _TL("Bypass second-pass processing, and merge warm (not ambiguous) and cold clouds"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "SHADOW"		, _TL("Include a category for cloud shadows"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CLandsat_ACCA::On_Execute(void)
-{
-	CSG_Grid	*pCloud, *pBand[5];
-
-	//-----------------------------------------------------
-	// Get parameter settings...
-
-	pBand[0]	= Parameters("BAND2")->asGrid();
-	pBand[1]	= Parameters("BAND3")->asGrid();
-	pBand[2]	= Parameters("BAND4")->asGrid();
-	pBand[3]	= Parameters("BAND5")->asGrid();
-	pBand[4]	= Parameters("BAND6")->asGrid();
-
-	pCloud		= Parameters("CLOUD")->asGrid();
-	pCloud		->Set_NoData_Value(0);
-
-	//-----------------------------------------------------
-//	int	hist_n		= Parameters("HIST_N")->asInt();
-
-	//-----------------------------------------------------
-	acca_algorithm(pCloud, pBand,
-		Parameters("PASS2" )->asBool(),
-		Parameters("SHADOW")->asBool(),
-		Parameters("CSIG"  )->asBool()
-	);
-
-	if( Parameters("FILTER")->asBool() )
-	{
-		filter_holes(pCloud);
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameter	*pLUT	= DataObject_Get_Parameter(pCloud, "LUT");
-
-	if( pLUT && pLUT->asTable() )
-	{
-		pLUT->asTable()->Del_Records();
-
-		LUT_SET_CLASS(IS_SHADOW    , _TL("Shadow"    ), SG_COLOR_BLUE_DARK);
-		LUT_SET_CLASS(IS_COLD_CLOUD, _TL("Cold Cloud"), SG_COLOR_BLUE);
-		LUT_SET_CLASS(IS_WARM_CLOUD, _TL("Warm Cloud"), SG_COLOR_BLUE_LIGHT);
-
-		DataObject_Set_Parameter(pCloud, pLUT);
-
-		DataObject_Set_Parameter(pCloud, "COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//													   //
-//													   //
-//													   //
-///////////////////////////////////////////////////////////
-
-/****************************************************************************
- *
- * MODULE:	   i.landsat.acca
- *
- * AUTHOR(S):	E. Jorge Tizado - ej.tizado at unileon.es
- *
- * PURPOSE:	  Landsat TM/ETM+ Automatic Cloud Cover Assessment
- *			   Adopted for GRASS 7 by Martin Landa <landa.martin gmail.com>
- *
- * COPYRIGHT:	(C) 2008, 2010 by the GRASS Development Team
- *
- *			   This program is free software under the GNU General Public
- *   			 License (>=v2). Read the file COPYING that comes with GRASS
- *   			 for details.
- *
- *****************************************************************************/
-
-#define SCALE		200.
-#define K_BASE		230.
-
-/* value and count */
-#define TOTAL		0
-#define WARM		1
-#define COLD		2
-#define SNOW		3
-#define SOIL		4
-
-/* signa */
-#define COVER		1
-#define SUM_COLD	0
-#define SUM_WARM	1
-#define KMEAN		2
-#define KMAX		3
-#define KMIN		4
-
-/* re-use value */
-#define KLOWER		0
-#define KUPPER		1
-#define MEAN		2
-#define SKEW		3
-#define DSTD		4
-
-
-/**********************************************************
- *
- * Automatic Cloud Cover Assessment (ACCA): Irish 2000
- *
- **********************************************************/
-
-/*--------------------------------------------------------
-  CONSTANTS
-  Usar esta forma para que via extern puedan modificarse
-  como opciones desde el programa main.
- ---------------------------------------------------------*/
-
-double th_1		= 0.08;		/* Band 3 Brightness Threshold */
-double th_1_b	= 0.07;
-double th_2[2]	= { -0.25, 0.70 };	/* Normalized Snow Difference Index */
-double th_2_b	= 0.8;
-double th_3		= 300.;		/* Band 6 Temperature Threshold */
-double th_4		= 225.;		/* Band 5/6 Composite */
-double th_4_b	= 0.08;
-double th_5		= 2.35;		/* Band 4/3 Ratio */
-double th_6		= 2.16248;	/* Band 4/2 Ratio */
-double th_7		= 1.0;		/* Band 4/5 Ratio */ ;
-double th_8		= 210.;		/* Band 5/6 Composite */
-
-//---------------------------------------------------------
-const int hist_n = 100;		/* interval of real data 100/hist_n */
-
-//---------------------------------------------------------
-#define G_message(s)	SG_UI_Msg_Add(s, false)
-
-void acca_first(CSG_Grid *pCloud, CSG_Grid *band[], int with_shadow, int count[], int cold[], int warm[], double stats[]);
-void acca_second(CSG_Grid *pCloud, CSG_Grid *band, int review_warm, double upper, double lower);
-int shadow_algorithm(double pixel[]);
-
-void hist_put(double t, int hist[]);
-double quantile(double q, int hist[]);
-double moment(int n, int hist[], int k);
-
-
-#define BAND2			0
-#define BAND3			1
-#define BAND4			2
-#define BAND5			3
-#define BAND6			4
-
-#define NO_CLOUD		0
-#define IS_CLOUD		1
-#define COLD_CLOUD		30
-#define WARM_CLOUD		50
-
-//---------------------------------------------------------
-void acca_algorithm(CSG_Grid *pCloud, CSG_Grid *band[], int single_pass, int with_shadow, int cloud_signature)
-{
-	int		i, count[5], hist_cold[hist_n], hist_warm[hist_n], review_warm;
-	double	max, value[5], signa[5], idesert, shift;
-
-	/* Reset variables ... */
-	for (i = 0; i < 5; i++) {
-	count[i] = 0;
-	value[i] = 0.;
-	}
-
-	for (i = 0; i < hist_n; i++) {
-	hist_cold[i] = hist_warm[i] = 0;
-	}
-
-	/* FIRST FILTER ... */
-	acca_first(pCloud, band, with_shadow, count, hist_cold, hist_warm, signa);
-	/* CATEGORIES: NO_DEFINED, WARM_CLOUD, COLD_CLOUD, NULL (= NO_CLOUD) */
-
-	value[WARM] = (double)count[WARM] / (double)count[TOTAL];
-	value[COLD] = (double)count[COLD] / (double)count[TOTAL];
-	value[SNOW] = (double)count[SNOW] / (double)count[TOTAL];
-	value[SOIL] = (double)count[SOIL] / (double)count[TOTAL];
-
-	value[0] = (double)(count[WARM] + count[COLD]);
-	idesert = (value[0] == 0. ? 0. : value[0] / ((double)count[SOIL]));
-
-	//-----------------------------------------------------
-	// BAND-6 CLOUD SIGNATURE DEVELOPMENT
-	if( idesert <= .5 || value[SNOW] > 0.01 )
-	{	// Only the cold clouds are used if snow or desert soil is present
-		review_warm		= 1;
-	}
-	else
-	{	// The cold and warm clouds are combined and treated as a single population
-		review_warm		= 0;
-
-		count[COLD]		+= count[WARM];
-		value[COLD]		+= value[WARM];
-		signa[SUM_COLD]	+= signa[SUM_WARM];
-
-		for(i=0; i<hist_n; i++)
-			hist_cold[i]	+= hist_warm[i];
-	}
-
-	signa[KMEAN] = SCALE * signa[SUM_COLD] / ((double)count[COLD]);
-	signa[COVER] = ((double)count[COLD]) / ((double)count[TOTAL]);
-
-/*	G_message(_TL("Preliminary scene analysis:"));
-	G_message(_TL("* Desert index: %.2lf"), idesert);
-	G_message(_TL("* Snow cover: %.2lf %%"), 100. * value[SNOW]);
-	G_message(_TL("* Cloud cover: %.2lf %%"), 100. * signa[COVER]);
-	G_message(_TL("* Temperature of clouds:"));
-	G_message(_TL("** Maximum: %.2lf K"), signa[KMAX]);
-	G_message(_TL("** Mean (%s cloud): %.2lf K"),
-		(review_warm ? "cold" : "all"), signa[KMEAN]);
-	G_message(_TL("** Minimum: %.2lf K"), signa[KMIN]);
-/**/
-	/* WARNING: re-use of the variable 'value' with new meaning */
-
-	/* step 14 */
-
-	/* To correct Irish2006: idesert has to be bigger than 0.5 to start pass 2 processing (see Irish2000)
-	   because then we have no desert condition (thanks to Matthias Eder, Germany) */
-	if( cloud_signature || (idesert > .5 && signa[COVER] > 0.004 && signa[KMEAN] < 295.) )
-	{
-		G_message(_TL("Histogram cloud signature:"));
-
-		value[MEAN]	= quantile(0.5, hist_cold) + K_BASE;
-		value[DSTD]	= sqrt(moment(2, hist_cold, 1));
-		value[SKEW]	= moment(3, hist_cold, 3) / pow(value[DSTD], 3);
-
-	/*	G_message(_TL("* Mean temperature: %.2lf K"), value[MEAN]);
-		G_message(_TL("* Standard deviation: %.2lf"), value[DSTD]);
-		G_message(_TL("* Skewness: %.2lf"), value[SKEW]);
-		G_message(_TL("* Histogram classes: %d"), hist_n);
-	/**/
-		shift = value[SKEW];
-		if (shift > 1.)
-			shift = 1.;
-		else if (shift < 0.)
-			shift = 0.;
-
-		max = quantile(0.9875, hist_cold) + K_BASE;
-		value[KUPPER] = quantile(0.975, hist_cold) + K_BASE;
-		value[KLOWER] = quantile(0.835, hist_cold) + K_BASE;
-
-	/*	G_message(_TL("* 98.75 percentile: %.2lf K"), max);
-		G_message(_TL("* 97.50 percentile: %.2lf K"), value[KUPPER]);
-		G_message(_TL("* 83.50 percentile: %.2lf K"), value[KLOWER]);
-	/**/
-		/* step 17 & 18 */
-		if (shift > 0.)
-		{
-			shift *= value[DSTD];
-
-			if ((value[KUPPER] + shift) > max)
-			{
-				if ((value[KLOWER] + shift) > max)
-				{
-					value[KLOWER] += (max - value[KUPPER]);
-				}
-				else
-				{
-					value[KLOWER] += shift;
-				}
-
-				value[KUPPER] = max;
-			}
-			else
-			{
-				value[KLOWER] += shift;
-				value[KUPPER] += shift;
-			}
-		}
-
-	/*	G_message(_TL("Maximum temperature:"));
-		G_message(_TL("* Cold cloud: %.2lf K"), value[KUPPER]);
-		G_message(_TL("* Warm cloud: %.2lf K"), value[KLOWER]);
-	/**/
-	}
-	else if( signa[KMEAN] < 295. )
-	{	// Retained warm and cold clouds
-		G_message(_TL("Result: Scene with clouds"));
-		review_warm = 0;
-		value[KUPPER] = 0.;
-		value[KLOWER] = 0.;
-	}
-	else
-	{	// Retained cold clouds
-		G_message(_TL("Result: Scene cloud free"));
-		review_warm = 1;
-		value[KUPPER] = 0.;
-		value[KLOWER] = 0.;
-	}
-
-	//-----------------------------------------------------
-	// SECOND FILTER ...
-
-	// By-pass two processing but it retains warm and cold clouds
-	if( single_pass != 0 )
-	{
-		review_warm		= -1;
-		value[KUPPER]	= 0.;
-		value[KLOWER]	= 0.;
-	}
-
-	// CATEGORIES: IS_WARM_CLOUD, IS_COLD_CLOUD, IS_SHADOW, NULL (= NO_CLOUD)
-	acca_second(pCloud, band[BAND6], review_warm, value[KUPPER], value[KLOWER]);
-
-	//-----------------------------------------------------
-	return;
-}
-
-//---------------------------------------------------------
-void acca_first(CSG_Grid *pCloud, CSG_Grid *band[], int with_shadow, int count[], int cold[], int warm[], double stats[])
-{
-	double	nsdi, rat56;
-
-	/* Creation of output file */
-	/* ----- ----- */
-	SG_UI_Msg_Add_Execution(_TL("Processing first pass..."), true);
-
-	stats[SUM_COLD]	= 0.;
-	stats[SUM_WARM]	= 0.;
-	stats[KMAX]		= 0.;
-	stats[KMIN]		= 10000.;
-
-	for(int y=0; y<pCloud->Get_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++)
-	{
-		for(int x=0; x<pCloud->Get_NX(); x++)
-		{
-			char	code	= NO_DEFINED;
-			double	pixel[5];
-
-			for(int i=BAND2; i<=BAND6; i++)	// Null when null pixel in any band
-			{
-				if( pCloud->Get_System() == band[i]->Get_System() )
-				{
-					if( band[i]->is_NoData(x, y) )
-					{
-						code	= NO_CLOUD;
-						break;
-					}
-
-					pixel[i]	= band[i]->asDouble(x, y);
-				}
-				else if( !band[i]->Get_Value(pCloud->Get_System().Get_Grid_to_World(x, y), pixel[i]) )
-				{
-					code	= NO_CLOUD;
-					break;
-				}
-			}
-
-			/* Determina los pixeles de sombras */
-			if( code == NO_DEFINED && with_shadow )
-			{
-				code = shadow_algorithm(pixel);
-			}
-
-			/* Analiza el valor de los pixeles no definidos */
-			if (code == NO_DEFINED)
-			{
-				code	= NO_CLOUD;
-				count[TOTAL]++;
-				nsdi	= (pixel[BAND2] - pixel[BAND5]) / (pixel[BAND2] + pixel[BAND5]);
-
-				/* ----------------------------------------------------- */
-				/* step 1. Brightness Threshold: Eliminates dark images */
-				if (pixel[BAND3] > th_1)
-				{
-					/* step 3. Normalized Snow Difference Index: Eliminates many types of snow */
-					if (nsdi > th_2[0] && nsdi < th_2[1])
-					{
-						/* step 5. Temperature Threshold: Eliminates warm image features */
-						if (pixel[BAND6] < th_3)
-						{
-							rat56 = (1. - pixel[BAND5]) * pixel[BAND6];
-							/* step 6. Band 5/6 Composite: Eliminates numerous categories including ice */
-							if (rat56 < th_4)
-							{
-								/* step 8. Eliminates growing vegetation */
-								if ((pixel[BAND4] / pixel[BAND3]) < th_5)
-								{
-									/* step 9. Eliminates senescing vegetation */
-									if ((pixel[BAND4] / pixel[BAND2]) < th_6)
-									{
-										/* step 10. Eliminates rocks and desert */
-										count[SOIL]++;
-
-										if ((pixel[BAND4] / pixel[BAND5]) > th_7)
-										{
-											/* step 11. Distinguishes warm clouds from cold clouds */
-											if (rat56 < th_8)
-											{
-												code = COLD_CLOUD;
-												count[COLD]++;
-												/* for statistic */
-												stats[SUM_COLD] += (pixel[BAND6] / SCALE);
-												hist_put(pixel[BAND6] - K_BASE, cold);
-											}
-											else
-											{
-												code = WARM_CLOUD;
-												count[WARM]++;
-												/* for statistic */
-												stats[SUM_WARM] += (pixel[BAND6] / SCALE);
-												hist_put(pixel[BAND6] - K_BASE, warm);
-											}
-
-											if (pixel[BAND6] > stats[KMAX])	stats[KMAX] = pixel[BAND6];
-											if (pixel[BAND6] < stats[KMIN])	stats[KMIN] = pixel[BAND6];
-										}
-										else
-										{
-											code = NO_DEFINED;
-										}
-									}
-									else
-									{
-										code = NO_DEFINED;
-										count[SOIL]++;
-									}
-								}
-								else
-								{
-									code = NO_DEFINED;
-								}
-							}
-							else
-							{
-								/* step 7 */
-								code = (pixel[BAND5] < th_4_b) ? NO_CLOUD : NO_DEFINED;
-							}
-						}
-						else
-						{
-							code = NO_CLOUD;
-						}
-					}
-					else
-					{
-						/* step 3 */
-						code = NO_CLOUD;
-				
-						if (nsdi > th_2_b)
-							count[SNOW]++;
-					}
-				}
-				else
-				{
-					/* step 2 */
-					code = (pixel[BAND3] < th_1_b) ? NO_CLOUD : NO_DEFINED;
-				}
-			}
-
-			//---------------------------------------------
-			if (code == NO_CLOUD)
-			{
-				pCloud->Set_Value(x, y, 1);
-			}
-			else
-			{
-				pCloud->Set_Value(x, y, code);
-			}
-		}
-	}
-
-	return;
-}
-
-//---------------------------------------------------------
-void acca_second(CSG_Grid *pCloud, CSG_Grid *pThermal, int review_warm, double upper, double lower)
-{
-	SG_UI_Process_Set_Text(upper == 0.0
-		? _TL("Removing ambiguous pixels...")
-		: _TL("Pass two processing...")
-	);
-
-	//-----------------------------------------------------
-	for(int y=0; y<pCloud->Get_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++)
-	{
-		double	p_y	= pCloud->Get_YMin() + y * pCloud->Get_Cellsize();
-
-		#pragma omp parallel for
-		for(int x=0; x<pCloud->Get_NX(); x++)
-		{
-			if( !pCloud->is_NoData(x, y) )
-			{
-				int	code	= pCloud->asInt(x, y);
-
-				if( code == NO_DEFINED || (code == WARM_CLOUD && review_warm == 1) )	// Resolve ambiguous pixels
-				{
-					double	t, p_x	= pCloud->Get_XMin() + x * pCloud->Get_Cellsize();
-
-					if( !pThermal->Get_Value(p_x, p_y, t) || t > upper )
-					{
-						pCloud->Set_NoData(x, y);
-					}
-					else
-					{
-						pCloud->Set_Value(x, y, t < lower ? IS_WARM_CLOUD : IS_COLD_CLOUD);
-					}
-				}
-				else if( code == COLD_CLOUD || code == WARM_CLOUD )	// Join warm (not ambiguous) and cold clouds
-				{
-					pCloud->Set_Value(x, y, (code == WARM_CLOUD && review_warm == 0) ? IS_WARM_CLOUD : IS_COLD_CLOUD);
-				}
-				else
-				{
-					pCloud->Set_Value(x, y, IS_SHADOW);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//					Cloud shadows						 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int shadow_algorithm(double pixel[])
-{
-	// I think this filter is better but not in any paper
-	if( pixel[BAND3] < 0.07 && (1 - pixel[BAND4]) * pixel[BAND6] > 240. && pixel[BAND4] / pixel[BAND2] > 1.
-	&& (pixel[BAND3] - pixel[BAND5]) / (pixel[BAND3] + pixel[BAND5]) < 0.10 )
-//	if( pixel[BAND3] < 0.07 && (1 - pixel[BAND4]) * pixel[BAND6] > 240. && pixel[BAND4] / pixel[BAND2] > 1. )
-	{
-		return IS_SHADOW;
-	}
-
-	return NO_DEFINED;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				  HISTOGRAM ANALYSIS					 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Define un factor de escala = hist_n/100 con objeto
-// de dividir el entero 1 por 100/hist_n partes y
-// aumentar la precision.
-//
-// Afecta al almacenamiento en el histograma pero
-// modifica el calculo de quantiles y momentos.
-//---------------------------------------------------------
-
-//---------------------------------------------------------
-void hist_put(double t, int hist[])
-{
-	int	i	= (int)(t * ((double)hist_n / 100.));	// scale factor
-
-	if( i < 1 )
-		i	= 1;
-	else if (i > hist_n)
-		i	= hist_n;
-
-	hist[i - 1]++;
-}
-
-//---------------------------------------------------------
-/* histogram moment */
-double moment(int n, int hist[], int k)
-{
-	int		i, total;
-	double	value, mean;
-
-	for(i=0, total=0, mean=0; i<hist_n; i++)
-	{
-		total	+= hist[i];
-		mean	+= (double)(i * hist[i]);
-	}
-
-	mean	/= ((double)total);	/* histogram mean */
-
-	for(i=0, value=0.; i<hist_n; i++)
-	{
-		value	+= (pow((i - mean), n) * ((double)hist[i]));
-	}
-
-	value	/= (double)(total);	// k	= 0;	// ???!!!
-//	value	/= (double)(total - k);
-
-	return( value / pow((double)hist_n / 100., n) );
-}
-
-//---------------------------------------------------------
-/* Real data quantile */
-double quantile(double q, int hist[])
-{
-	int		i, total;
-	double	value, qmax, qmin;
-
-	for(i=0, total=0; i<hist_n; i++)
-	{
-		total += hist[i];
-	}
-
-	for(i=hist_n-1, value=0, qmax=1.; i>=0; i--)
-	{
-		qmin	= qmax - (double)hist[i] / (double)total;
-
-		if( q >= qmin )
-		{
-			value = (q - qmin) / (qmax - qmin) + (i - 1);
-			break;
-		}
-
-		qmax	= qmin;
-	}
-
-	/* remove scale factor */
-	return (value / ((double)hist_n / 100.));
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				FILTER HOLES OF CLOUDS					 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// This a >=50% filter of 3x3
-// if >= 50% vecinos cloud then pixel set to cloud
-//---------------------------------------------------------
-void filter_holes(CSG_Grid *pCloud)
-{
-	if( pCloud->Get_NY() < 3 || pCloud->Get_NX() < 3 )
-		return;
-
-	SG_UI_Process_Set_Text(_TL("Filling small holes in clouds..."));
-
-	CSG_Grid Cloud(*pCloud);
-
-	//-----------------------------------------------------
-	for(int y=0; y<pCloud->Get_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<pCloud->Get_NX(); x++)
-		{
-			int	z	= Cloud.asInt(x, y);
-
-			if( z == 0 )
-			{
-				int	cold, warm, shadow, nulo;
-
-				cold = warm = shadow = nulo = 0;
-
-				for(int i=0; i<8; i++)
-				{
-					int	ix	= pCloud->Get_System().Get_xTo(i, x);
-					int	iy	= pCloud->Get_System().Get_yTo(i, y);
-
-					switch( Cloud.is_InGrid(ix, iy) ? Cloud.asInt(ix, iy) : -1 )
-					{
-					case IS_COLD_CLOUD:	cold  ++;	break;
-					case IS_WARM_CLOUD:	warm  ++;	break;
-					case IS_SHADOW:		shadow++;	break;
-					default:			nulo  ++;	break;
-					}
-				}
-
-				int	lim	= (cold + warm + shadow + nulo) / 2;
-
-				// Entra pixel[0] = 0
-				if( nulo < lim )
-				{
-					if( shadow >= (cold + warm) )
-						z = IS_SHADOW;
-					else
-						z = (warm > cold) ? IS_WARM_CLOUD : IS_COLD_CLOUD;
-				}
-			}
-
-			if( z != 0 )
-			{
-				pCloud->Set_Value(x, y, z);
-			}
-			else
-			{
-				pCloud->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return;
-}
-
-
-///////////////////////////////////////////////////////////
-//													   //
-//													   //
-//													   //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/landsat_acca.h b/src/modules_images/modules_imagery/imagery_tools/landsat_acca.h
deleted file mode 100644
index e02af3f..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/landsat_acca.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/**********************************************************
- * Version $Id: landsat_acca.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     imagery_tools                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    landsat_acca.h                     //
-//                                                       //
-//                 Copyright (C) 2012 by                 //
-//            Benjamin Bechtel & 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__landsat_acca_H
-#define HEADER_INCLUDED__landsat_acca_H
-
-
-///////////////////////////////////////////////////////////
-//                                                       //												
-//                                                       //												
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //												
-//                                                       //												
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CLandsat_ACCA : public CSG_Module_Grid
-{
-public:
-
-	CLandsat_ACCA(void);
-
-	virtual CSG_String	Get_MenuPath	(void)	{	return( _TL("R:Landsat") );	}
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //												
-//                                                       //												
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__landsat_acca_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/landsat_toar.cpp b/src/modules_images/modules_imagery/imagery_tools/landsat_toar.cpp
deleted file mode 100644
index 3fd424c..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/landsat_toar.cpp
+++ /dev/null
@@ -1,786 +0,0 @@
-/**********************************************************
- * Version $Id: landsat_toar.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     imagery_tools                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   landsat_toar.cpp                    //
-//                                                       //
-//                 Copyright (C) 2013 by                 //
-//            Benjamin Bechtel & 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 "landsat_toar.h"
-
-//---------------------------------------------------------
-#include "landsat_toar_core.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	mss1 = 0,	// Landsat-1 MSS
-	mss2,		// Landsat-2 MSS
-	mss3,		// Landsat-3 MSS
-	mss4,		// Landsat-4 MSS
-	mss5,		// Landsat-5 MSS
-	tm4,		// Landsat-4 TM
-	tm5,		// Landsat-5 TM
-	tm7			// Landsat-7 ETM+
-};
-
-//---------------------------------------------------------
-#define PRM_IN(id)				(CSG_String("DN_") + id)
-#define PRM_OUT(id)				(CSG_String("RF_") + id)
-#define PRM_ADD_BAND__IN(id)	Parameters.Add_Grid(pNode, PRM_IN (id), CSG_String::Format(SG_T("%s %s"), _TL("DN"), _TL("Band")) + id, _TL(""), PARAMETER_INPUT_OPTIONAL);
-#define PRM_ADD_BAND_OUT(id)	Parameters.Add_Grid(pNode, PRM_OUT(id), CSG_String::Format(SG_T("%s %s"), _TL("Reflectance"), _TL("Band")) + id, _TL(""), PARAMETER_OUTPUT_OPTIONAL);
-#define PRM_ADD_BAND(id)		PRM_ADD_BAND_IN(id); PRM_ADD_BAND_OUT(id)
-#define PRM_ENABLE_OUTPUT(id)	pParameters->Get_Parameter(PRM_OUT(id))->Set_Enabled(pParameters->Get_Parameter(PRM_IN(id))->is_Enabled() && pParameters->Get_Parameter(PRM_IN(id))->asGrid())
-
-//---------------------------------------------------------
-#define GET_DESC_INT(name, value)		CSG_String::Format(SG_T("%s: %d\n"), name, value)
-#define GET_DESC_FLT(name, value)		CSG_String::Format(SG_T("%s: %f\n"), name, value)
-#define GET_DESC_RNG(name, min, max)	CSG_String::Format(SG_T("%s: %f / %f\n"), name, min, max)
-#define GET_DESC_STR(name, value)		CSG_String(name) + ": " + CSG_String(value) + "\n"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool	Set_Date_from_String	(char *date, const CSG_String s)
-{
-	// yyyy-mm-dd
-	// 0123456789
-
-	if( s.Length() == 10 )
-	{
-		strncpy(date, s.b_str(), 11);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool	Load_MetaFile	(const CSG_String &MetaFile, lsat_data &lsat)
-{
-	if( !SG_File_Exists(MetaFile) )	// Data from metadata file
-	{
-		return( false );
-	}
-
-	if( !lsat_newdata(MetaFile, &lsat)
-	&&  !lsat_mtldata(MetaFile, &lsat)
-	&&  !lsat_metdata(MetaFile, &lsat)	)
-	{
-		return( false );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-int		Get_Sensor_Index	(int LSat_Number, const CSG_String &LSat_Sensor)
-{
-	if( !LSat_Sensor.CmpNoCase("MSS") )
-	{
-		switch( LSat_Number )
-		{
-		case 1:	return(0);	break;	// Landsat-1 MSS
-		case 2:	return(1);	break;	// Landsat-2 MSS
-		case 3:	return(2);	break;	// Landsat-3 MSS
-		case 4:	return(3);	break;	// Landsat-4 MSS
-		case 5:	return(4);	break;	// Landsat-5 MSS
-		}
-	}
-	else if( !CSG_String(LSat_Sensor).CmpNoCase("TM") )
-	{
-		switch( LSat_Number )
-		{
-		case 4:	return(5);	break;	// Landsat-1 MSS
-		case 5:	return(6);	break;	// Landsat-2 MSS
-		}
-	}
-	else if( !CSG_String(LSat_Sensor).Find("ETM") && LSat_Number == 7 )
-	{
-		return(7);	// Landsat-7 ETM+
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CLandsat_TOAR::CLandsat_TOAR(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Top of Atmosphere Reflectance"));
-
-	Set_Author		(_TL("B.Bechtel, O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Calculation of top-of-atmosphere radiance or reflectance and temperature (TOAR) for Landsat MSS/TM/ETM+. "
-		"This module incorporates E.J. Tizado's GRASS GIS implementation (i.landsat.toar).\n"
-		"\n"
-		"References:\n"
-		"<a target=\"_blank\" href=\"http://landsathandbook.gsfc.nasa.gov/\">Landsat 7 Science Data Users Handbook</a>"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid_System(NULL, "GS_SPECTRAL", _TL("Spectral"    ), _TL(""));
-	PRM_ADD_BAND__IN("10"); PRM_ADD_BAND__IN("20"); PRM_ADD_BAND__IN("30"); PRM_ADD_BAND__IN("40"); PRM_ADD_BAND__IN("50"); PRM_ADD_BAND__IN("70");
-	PRM_ADD_BAND_OUT("10"); PRM_ADD_BAND_OUT("20"); PRM_ADD_BAND_OUT("30"); PRM_ADD_BAND_OUT("40"); PRM_ADD_BAND_OUT("50"); PRM_ADD_BAND_OUT("70");
-
-	pNode	= Parameters.Add_Grid_System(NULL, "GS_THERMAL"	, _TL("Thermal"     ), _TL(""));
-	PRM_ADD_BAND__IN("60"); PRM_ADD_BAND__IN("61"); PRM_ADD_BAND__IN("62");
-	PRM_ADD_BAND_OUT("60"); PRM_ADD_BAND_OUT("61"); PRM_ADD_BAND_OUT("62");
-
-	pNode	= Parameters.Add_Grid_System(NULL, "GS_PAN"		, _TL("Panchromatic"), _TL(""));
-	PRM_ADD_BAND__IN("80");
-	PRM_ADD_BAND_OUT("80");
-
-	//-----------------------------------------------------
-	Parameters.Add_FilePath(
-		NULL	, "METAFILE"	, _TL("Metadata File"),
-		_TL("Name of Landsat metadata file (.met or MTL.txt)"),
-		CSG_String::Format(SG_T("%s|*.met;*.txt|%s|*.*"),
-			_TL("Metadata Files (*.met, *.txt)"),
-			_TL("All Files")
-		) 
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		NULL	, "SENSOR"		, _TL("Spacecraft Sensor"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("Landsat-1 MSS"),
-			_TL("Landsat-2 MSS"),
-			_TL("Landsat-3 MSS"),
-			_TL("Landsat-4 MSS"),
-			_TL("Landsat-5 MSS"),
-			_TL("Landsat-4 TM"),
-			_TL("Landsat-5 TM"),
-			_TL("Landsat-7 ETM+")
-		), 7
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_String(
-		NULL	, "DATE_ACQU"	, _TL("Image Acquisition Date"),
-		_TL("Image acquisition date (yyyy-mm-dd)"),
-		"2001-01-01"
-	);
-
-	Parameters.Add_String(
-		NULL	, "DATE_PROD"	, _TL("Image Creation Date"),
-		_TL("Image creation date (yyyy-mm-dd)"),
-		"2001-01-01"
-	);
-
-	Parameters.Add_Value(
-		NULL	, "SUN_HGT"		, _TL("Suns's Height"),
-		_TL("Sun's height above horizon in degree"),
-		PARAMETER_TYPE_Double, 45.0, 0.0, true, 90.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "AS_RAD"		, _TL("At-Sensor Radiance"),
-		_TL("Output at-sensor radiance for all bands"),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Choice(
-		NULL	, "AC_METHOD"	, _TL("Atmospheric Correction"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("uncorrected"),
-			_TL("corrected"),
-			_TL("dos1"),
-			_TL("dos2"),
-			_TL("dos2b"),
-			_TL("dos3"),
-			_TL("dos4")
-		), 0
-	);
-
-	Parameters.Add_Value(
-		pNode	, "AC_DO_CELLS"	, _TL("Minimum Number of Dark Object Cells"),
-		_TL("Minimum pixels to consider digital number as dark object"),
-		PARAMETER_TYPE_Int, 1000, 0, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "AC_RAYLEIGH"	, _TL("Rayleigh Scattering"),
-		_TL("Rayleigh atmosphere (diffuse sky irradiance)"),
-		PARAMETER_TYPE_Double, 0.0
-	);
-
-	Parameters.Add_Value(
-		pNode	, "AC_SUN_RAD"	, _TL("Solar Radiance"),
-		_TL("Percent of solar radiance in path radiance"),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true, 100.0, true
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Node(
-		NULL	, "ETM_GAIN"	, _TL("ETM+ Gain"),
-		_TL("Gain (H/L) of all Landsat ETM+ bands (1-5,61,62,7,8)")
-	);
-
-	Parameters.Add_Choice(pNode, "ETM_GAIN_10", _TL("Band 1" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_20", _TL("Band 2" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_30", _TL("Band 3" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_40", _TL("Band 4" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_50", _TL("Band 5" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_61", _TL("Band 61"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 0);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_62", _TL("Band 62"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_70", _TL("Band 7" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1);
-	Parameters.Add_Choice(pNode, "ETM_GAIN_80", _TL("Band 8" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 0);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CLandsat_TOAR::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METAFILE")) && *pParameter->asString() )
-	{
-		lsat_data	lsat;
-
-		if( !Load_MetaFile(pParameter->asString(), lsat) )
-		{
-			pParameter->Set_Value((const char *)"");
-
-			Error_Set(_TL("could not read metadata file"));
-		}
-		else
-		{
-			pParameters->Get_Parameter("SENSOR"   )->Set_Value(Get_Sensor_Index(lsat.number, lsat.sensor));
-			pParameters->Get_Parameter("DATE_ACQU")->Set_Value((const char *)lsat.date);
-			pParameters->Get_Parameter("DATE_PROD")->Set_Value((const char *)lsat.creation);
-			pParameters->Get_Parameter("SUN_HGT"  )->Set_Value(lsat.sun_elev);
-		}
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SENSOR")) )
-	{
-		pParameters->Get_Parameter("METAFILE")->Set_Value((const char *)"");
-	}
-
-	return( 0 );
-}
-
-//---------------------------------------------------------
-int CLandsat_TOAR::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AC_METHOD")) )
-	{
-		pParameters->Get_Parameter("AC_DO_CELLS")->Set_Enabled(pParameter->asInt() > 1);
-	}
-
-	if(	1 )
-	{
-		int	Sensor	= pParameters->Get_Parameter("SENSOR")->asInt();
-
-		pParameters->Get_Parameter("ETM_GAIN"  )->Set_Enabled(Sensor == tm7 && !(*pParameters->Get_Parameter("METAFILE")->asString()));
-
-		pParameters->Get_Parameter("GS_PAN"    )->Set_Enabled(Sensor == tm7);
-		pParameters->Get_Parameter("GS_THERMAL")->Set_Enabled(Sensor >= tm4);
-
-		pParameters->Get_Parameter(PRM_IN("50"))->Set_Enabled(Sensor >= tm4);
-		pParameters->Get_Parameter(PRM_IN("70"))->Set_Enabled(Sensor >= tm4);
-		pParameters->Get_Parameter(PRM_IN("60"))->Set_Enabled(Sensor == tm4 || Sensor == tm5);
-		pParameters->Get_Parameter(PRM_IN("61"))->Set_Enabled(Sensor == tm7);
-		pParameters->Get_Parameter(PRM_IN("62"))->Set_Enabled(Sensor == tm7);
-
-		PRM_ENABLE_OUTPUT("10");
-		PRM_ENABLE_OUTPUT("20");
-		PRM_ENABLE_OUTPUT("30");
-		PRM_ENABLE_OUTPUT("40");
-		PRM_ENABLE_OUTPUT("50");
-		PRM_ENABLE_OUTPUT("60");
-		PRM_ENABLE_OUTPUT("61");
-		PRM_ENABLE_OUTPUT("62");
-		PRM_ENABLE_OUTPUT("70");
-		PRM_ENABLE_OUTPUT("80");
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CLandsat_TOAR::On_Execute(void)
-{
-	//-----------------------------------------------------
-	int			Sensor, iBand, dn_dark[MAX_BANDS], dn_mode[MAX_BANDS], AC_Method, AC_nCells;
-	double		AC_Rayleigh, AC_SunRad;
-	CSG_Grid	*pInput, *pOutput;
-	lsat_data	lsat;
-
-	//-----------------------------------------------------
-	if( *Parameters("METAFILE")->asString()  )
-	{
-		if( !Load_MetaFile(Parameters("METAFILE")->asString(), lsat) )
-		{
-			Error_Set(_TL("could not read metadata file"));
-
-			return( false );
-		}
-
-		Sensor		= Get_Sensor_Index(lsat.number, lsat.sensor);
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		memset(&lsat, 0, sizeof(lsat));
-
-		if( !Set_Date_from_String(lsat.date    , Parameters("DATE_ACQU")->asString()) )
-		{
-			Error_Set(_TL("invalid acquisition date"));
-
-			return( false );
-		}
-
-		if( !Set_Date_from_String(lsat.creation, Parameters("DATE_PROD")->asString()) )
-		{
-			Error_Set(_TL("invalid production date"));
-
-			return( false );
-		}
-
-		lsat.sun_elev	= Parameters("SUN_HGT")->asDouble();
-
-		switch( Sensor = Parameters("SENSOR")->asInt() )
-		{
-		case mss1:	set_MSS1(&lsat);	break;
-		case mss2:	set_MSS2(&lsat);	break;
-		case mss3:	set_MSS3(&lsat);	break;
-		case mss4:	set_MSS4(&lsat);	break;
-		case mss5:	set_MSS5(&lsat);	break;
-		case tm4:	set_TM4 (&lsat);	break;
-		case tm5:	set_TM5 (&lsat);	break;
-		case tm7:
-			{
-				char	gain[9];
-
-				gain[0]	= Parameters("ETM_GAIN_10")->asInt() == 0 ? 'L' : 'H';
-				gain[1]	= Parameters("ETM_GAIN_20")->asInt() == 0 ? 'L' : 'H';
-				gain[2]	= Parameters("ETM_GAIN_30")->asInt() == 0 ? 'L' : 'H';
-				gain[3]	= Parameters("ETM_GAIN_40")->asInt() == 0 ? 'L' : 'H';
-				gain[4]	= Parameters("ETM_GAIN_50")->asInt() == 0 ? 'L' : 'H';
-				gain[5]	= Parameters("ETM_GAIN_61")->asInt() == 0 ? 'L' : 'H';
-				gain[6]	= Parameters("ETM_GAIN_62")->asInt() == 0 ? 'L' : 'H';
-				gain[7]	= Parameters("ETM_GAIN_70")->asInt() == 0 ? 'L' : 'H';
-				gain[8]	= Parameters("ETM_GAIN_80")->asInt() == 0 ? 'L' : 'H';
-
-				set_ETM (&lsat, gain);	// Landsat-7 requires band gain with 9 (H/L) data
-				break;
-			}
-		}
-    }
-
-
-	///////////////////////////////////////////////////////
-	//-----------------------------------------------------
-	// Atmospheric Correction
-
-	switch( Parameters("AC_METHOD")->asInt() )
-	{
-	default:	AC_Method	= UNCORRECTED;	break;
-	case 1:		AC_Method	= CORRECTED;	break;
-	case 2:		AC_Method	= DOS1;			break;
-	case 3:		AC_Method	= DOS2;			break;
-	case 4:		AC_Method	= DOS2b;		break;
-	case 5:		AC_Method	= DOS3;			break;
-	case 6:		AC_Method	= DOS4;			break;
-	}
-
-	AC_nCells	= Parameters("AC_DO_CELLS")->asInt();
-	AC_Rayleigh	= Parameters("AC_RAYLEIGH")->asDouble();
-	AC_SunRad	= Parameters("AC_SUN_RAD" )->asDouble() / 100.0;
-
-	//-----------------------------------------------------
-	for(iBand=0; iBand<lsat.bands && Process_Get_Okay(); iBand++)
-	{
-		dn_mode[iBand] = 0;
-		dn_dark[iBand] = (int)lsat.band[iBand].qcalmin;
-
-		if( !(pInput = Get_Band_Input(iBand, Sensor)) )
-		{
-			continue;
-		}
-
-		//-------------------------------------------------
-		if( AC_Method > DOS && !lsat.band[iBand].thermal )	// calculate dark pixel
-		{
-			Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("Dark Object Subtraction"), lsat.band[iBand].number, lsat.bands));
-
-			int				j;
-			unsigned long	hist[256], h_max;
-
-			memset(hist, 0, 256 * sizeof(unsigned long));
-
-			//---------------------------------------------
-			// histogram
-			for(int y=0; y<pInput->Get_NY() && Set_Progress(y, pInput->Get_NY()); y++)
-			{
-				for(int x=0, q; x<pInput->Get_NX(); x++)
-				{
-					if( !pInput->is_NoData(x, y) && (q = pInput->asInt(x, y)) != 0 && q >= lsat.band[iBand].qcalmin && q <= 255 )
-					{
-						hist[q]++;
-					}
-				}
-			}
-
-			//---------------------------------------------
-			// DN of dark object
-			for(j=(int)lsat.band[iBand].qcalmin; j<256; j++)
-			{
-				if( hist[j] >= (unsigned int)AC_nCells )
-				{
-					dn_dark[iBand] = j;
-			
-					break;
-				}
-			}
-
-			//---------------------------------------------
-			// Mode of DN
-			for(j=(int)lsat.band[iBand].qcalmin, h_max=0L; j<241; j++)
-			{
-				if( hist[j] > h_max )	// Exclude potentially saturated < 240
-				{
-					h_max = hist[j];
-					dn_mode[iBand] = j;
-				}
-			}
-
-			Message_Add(CSG_String::Format(SG_T("DN = %.2d [%lu] : mode %.2d [%lu] %s"),
-				dn_dark[iBand], hist[dn_dark[iBand]],
-				dn_mode[iBand], hist[dn_mode[iBand]],
-				hist[255] > hist[dn_mode[iBand]] ? ", excluding DN > 241" : ""
-			));
-		}
-
-		//-------------------------------------------------
-		lsat_bandctes(&lsat, iBand, AC_Method, AC_SunRad, dn_dark[iBand], AC_Rayleigh);	// calculate transformation constants
-	}
-
-
-	///////////////////////////////////////////////////////
-	//-----------------------------------------------------
-	bool	bRadiance	= Parameters("AS_RAD")->asBool();
-
-	CSG_String	sAll	= _TL("Top of Atmosphere Reflectance");	sAll	+= "\n";
-
-	sAll	+= GET_DESC_STR(_TL("Platform")              , CSG_String::Format(SG_T("Landsat-%d"), lsat.number));
-	sAll	+= GET_DESC_STR(_TL("Sensor")                , lsat.sensor);
-	sAll	+= GET_DESC_STR(_TL("Acquisition")           , lsat.date);
-	sAll	+= GET_DESC_STR(_TL("Production")            , lsat.creation);
-	sAll	+= GET_DESC_FLT(_TL("Earth-Sun Distance")    , lsat.dist_es);
-	sAll	+= GET_DESC_FLT(_TL("Solar Height")          , lsat.sun_elev);
-	sAll	+= GET_DESC_STR(_TL("Atmospheric Correction"), Parameters("AC_METHOD")->asString());
-
-	//-----------------------------------------------------
-	for(iBand=0; iBand<lsat.bands && Process_Get_Okay(); iBand++)
-	{
-		if( !(pInput  = Get_Band_Input (iBand, Sensor))
-		||  !(pOutput = Get_Band_Output(iBand, Sensor)) )
-		{
-			continue;
-		}
-
-		Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"),
-			bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance"),
-			lsat.band[iBand].number, lsat.bands
-		));
-
-		//-------------------------------------------------
-		for(int y=0; y<pInput->Get_NY() && Set_Progress(y, pInput->Get_NY()); y++)
-		{
-			#pragma omp parallel for
-			for(int x=0; x<pInput->Get_NX(); x++)
-			{
-				double	qcal;
-
-				if( pInput->is_NoData(x, y) || (qcal = pInput->asDouble(x, y)) == 0.0 || qcal < lsat.band[iBand].qcalmin )
-				{
-					pOutput->Set_NoData(x, y);
-				}
-				else
-				{
-					double	r	= lsat_qcal2rad(qcal, &lsat.band[iBand]);
-
-					if( bRadiance )
-					{
-						pOutput->Set_Value(x, y, r);
-					}
-					else if( lsat.band[iBand].thermal )
-					{
-						pOutput->Set_Value(x, y, lsat_rad2temp(r, &lsat.band[iBand]));
-					}
-					else
-					{
-						r	= lsat_rad2ref(r, &lsat.band[iBand]);
-
-						pOutput->Set_Value(x, y, r < 0.0 && AC_Method > DOS ? 0.0 : r);
-					}
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		CSG_String	sBand;
-
-		sBand	+= GET_DESC_INT(_TL("Band"                     ), lsat.band[iBand].number);
-		sBand	+= GET_DESC_STR(_TL("Type"                     ), bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance"));
-		sBand	+= GET_DESC_RNG(_TL("Calibrated Digital Number"), lsat.band[iBand].qcalmin, lsat.band[iBand].qcalmax);
-		sBand	+= GET_DESC_RNG(_TL("Calibration Constants"    ), lsat.band[iBand].lmin   , lsat.band[iBand].lmax);
-		sBand	+= GET_DESC_STR(AC_Method > DOS ? _TL("At-Surface Radiance") : _TL("At-Sensor Radiance"), CSG_String::Format(SG_T("%.5lf * DN + %.5lf"), lsat.band[iBand].gain, lsat.band[iBand].bias));
-
-		if( lsat.band[iBand].thermal )
-		{
-			sBand	+= GET_DESC_STR(_TL("At-Sensor Temperature"), CSG_String::Format(SG_T("%.3lf / ln[(%.3lf / %s) + 1.0]"), lsat.band[iBand].K2, lsat.band[iBand].K1, _TL("Radiance")));
-			sBand	+= GET_DESC_FLT(_TL("Temperature K1"       ), lsat.band[iBand].K1);
-			sBand	+= GET_DESC_FLT(_TL("Temperature K2"       ), lsat.band[iBand].K2);
-		}
-		else
-		{
-			sBand	+= GET_DESC_FLT(_TL("Mean Solar Irradiance"), lsat.band[iBand].esun);	// Mean Solar Exoatmospheric Irradiance
-			sBand	+= GET_DESC_STR(AC_Method > DOS ? _TL("At-Surface Reflectance") : _TL("At-Sensor Reflectance"), CSG_String::Format(SG_T("%s / %.5lf"), _TL("Radiance"), lsat.band[iBand].K2));
-
-			if( AC_Method > DOS )
-			{
-				double	ref_mode	= lsat_rad2ref(lsat_qcal2rad(dn_mode[iBand], &lsat.band[iBand]), &lsat.band[iBand]);
-
-				sBand	+= GET_DESC_INT(_TL("Minimum of Darkness DN Cells" ), AC_nCells);
-				sBand	+= GET_DESC_INT(_TL("Darkness Digital Number (DN)" ), dn_dark[iBand]);
-				sBand	+= GET_DESC_INT(_TL("Mode of DN"                   ), dn_mode[iBand]);
-				sBand	+= GET_DESC_FLT(_TL("Mode in Reflectance Histogram"), ref_mode);
-			}
-		}
-
-		Message_Add(sBand, true);
-
-		//-------------------------------------------------
-		pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(),
-			bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance")
-		));
-
-		if( lsat.band[iBand].thermal )
-		{
-			pOutput->Set_Unit(_TL("Kelvin"));
-		}
-
-		pOutput->Set_Description(sAll + sBand);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Grid * CLandsat_TOAR::Get_Band_Input(int iBand, int Sensor)
-{
-	switch( iBand )
-	{
-	case 0:	return( Parameters(PRM_IN("10"))->asGrid() );
-	case 1:	return( Parameters(PRM_IN("20"))->asGrid() );
-	case 2:	return( Parameters(PRM_IN("30"))->asGrid() );
-	case 3:	return( Parameters(PRM_IN("40"))->asGrid() );
-	}
-
-	switch( Sensor )
-	{
-	case tm4: case tm5:
-		switch( iBand )
-		{
-		case 4:	return( Parameters(PRM_IN("50"))->asGrid() );
-		case 5:	return( Parameters(PRM_IN("60"))->asGrid() );
-		case 6:	return( Parameters(PRM_IN("70"))->asGrid() );
-		}
-		break;
-
-	case tm7:
-		switch( iBand )
-		{
-		case 4:	return( Parameters(PRM_IN("50"))->asGrid() );
-		case 5:	return( Parameters(PRM_IN("61"))->asGrid() );
-		case 6:	return( Parameters(PRM_IN("62"))->asGrid() );
-		case 7:	return( Parameters(PRM_IN("80"))->asGrid() );
-		}
-		break;
-	}
-
-	return( NULL );
-}
-
-//---------------------------------------------------------
-CSG_Grid * CLandsat_TOAR::Get_Band_Output(int iBand, int Sensor)
-{
-	CSG_Grid	*pInput	= Get_Band_Input(iBand, Sensor);
-
-	if( pInput )
-	{
-		CSG_Parameter	*pOutput	= NULL;
-
-		switch( iBand )
-		{
-		case 0:	pOutput = Parameters(PRM_OUT("10"));	break;
-		case 1:	pOutput	= Parameters(PRM_OUT("20"));	break;
-		case 2:	pOutput	= Parameters(PRM_OUT("30"));	break;
-		case 3:	pOutput	= Parameters(PRM_OUT("40"));	break;
-		}
-
-		switch( Sensor )
-		{
-		case tm4: case tm5:
-			switch( iBand )
-			{
-			case 4:	pOutput	= Parameters(PRM_OUT("50"));	break;
-			case 5:	pOutput	= Parameters(PRM_OUT("60"));	break;
-			case 6:	pOutput	= Parameters(PRM_OUT("70"));	break;
-			}
-			break;
-
-		case tm7:
-			switch( iBand )
-			{
-			case 4:	pOutput	= Parameters(PRM_OUT("50"));	break;
-			case 5:	pOutput	= Parameters(PRM_OUT("61"));	break;
-			case 6:	pOutput	= Parameters(PRM_OUT("62"));	break;
-			case 7:	pOutput	= Parameters(PRM_OUT("80"));	break;
-			}
-			break;
-		}
-
-		if( pOutput )
-		{
-			if( !pOutput->asGrid() )
-			{
-				CSG_Grid	*pGrid	= SG_Create_Grid(pInput);
-
-				if( pGrid && pGrid->is_Valid() && pGrid->Get_System() == pInput->Get_System() )
-				{
-					pOutput->Set_Value(pGrid);
-				}
-				else
-				{
-					if( pGrid )
-					{
-						delete(pGrid);
-					}
-
-					return( NULL );
-				}
-			}
-
-			pOutput->asGrid()->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Reflectance")));
-
-			return( pOutput->asGrid() );
-		}
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/landsat_toar.h b/src/modules_images/modules_imagery/imagery_tools/landsat_toar.h
deleted file mode 100644
index 56fb0f0..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/landsat_toar.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/**********************************************************
- * Version $Id: landsat_toar.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     imagery_tools                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    landsat_toar.h                     //
-//                                                       //
-//                 Copyright (C) 2012 by                 //
-//            Benjamin Bechtel & 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__landsat_toar_H
-#define HEADER_INCLUDED__landsat_toar_H
-
-
-///////////////////////////////////////////////////////////
-//                                                       //												
-//                                                       //												
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //												
-//                                                       //												
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CLandsat_TOAR : public CSG_Module
-{
-public:
-	CLandsat_TOAR(void);
-
-	virtual CSG_String	Get_MenuPath			(void)	{	return( _TL("R:Landsat") );	}
-
-
-protected:
-
-	virtual int			On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int			On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool		On_Execute				(void);
-
-
-private:
-
-	CSG_Grid *			Get_Band_Input			(int iBand, int Sensor);
-	CSG_Grid *			Get_Band_Output			(int iBand, int Sensor);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //												
-//                                                       //												
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__landsat_toar_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/pansharpening.cpp b/src/modules_images/modules_imagery/imagery_tools/pansharpening.cpp
deleted file mode 100644
index dcf629a..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/pansharpening.cpp
+++ /dev/null
@@ -1,811 +0,0 @@
-/**********************************************************
- * Version $Id: pansharp_pca.cpp 1081 2011-06-08 08:05:26Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   pansharpening.cpp                   //
-//                                                       //
-//                 Copyright (C) 2011 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 "pansharpening.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-TSG_Grid_Interpolation	Get_Interpolation(int Interpolation)
-{
-	switch( Interpolation )
-	{
-	case 0:				return( GRID_INTERPOLATION_NearestNeighbour );
-	case 1:				return( GRID_INTERPOLATION_Bilinear );
-	case 2: default:	return( GRID_INTERPOLATION_BSpline );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPanSharp_IHS::CPanSharp_IHS(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("IHS Sharpening"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Intensity, hue, saturation (IHS) sharpening.\n"
-		"\nReferences:\n"
-		"Haydn, R., Dalke, G. W., Henkel, J., Bare, J. E. (1982): "
-		"Application of the IHS color transform to the processing of multisensor data and image enhancement. "
-		"Proceedings of the International Symposium on Remote Sensing of Arid and Semi-Arid Lands, "
-		"Cairo, Egypt (Environmental Research Institute, Ann Arbor, Mich., 1982), pp. 599�616.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(NULL	, "R"		, _TL("Red")	, _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL	, "G"		, _TL("Green")	, _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL	, "B"		, _TL("Blue")	, _TL(""), PARAMETER_INPUT);
-
-	pNode	= Parameters.Add_Grid_System(
-		NULL	, "PAN_SYSTEM"	, _TL("High Resolution Grid System"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid(
-		pNode	, "PAN"			, _TL("Panchromatic Channel"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(pNode	, "R_SHARP"	, _TL("Red")	, _TL(""), PARAMETER_OUTPUT, false);
-	Parameters.Add_Grid(pNode	, "G_SHARP"	, _TL("Green")	, _TL(""), PARAMETER_OUTPUT, false);
-	Parameters.Add_Grid(pNode	, "B_SHARP"	, _TL("Blue")	, _TL(""), PARAMETER_OUTPUT, false);
-
-	Parameters.Add_Grid_List(
-		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "RESAMPLING"	, _TL("Resampling"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("nearest neighbour"),
-			_TL("bilinear"),
-			_TL("cubic convolution")
-		), 2
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "PAN_MATCH"	, _TL("Panchromatic Channel Matching"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("normalized"),
-			_TL("standardized")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPanSharp_IHS::On_Execute(void)
-{
-	//-----------------------------------------------------
-	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
-
-	//-----------------------------------------------------
-	int			y;
-	double		r, g, b, i, h, s;
-	CSG_Grid	*pPan, *pR, *pG, *pB;
-
-	pPan	= Parameters("PAN")->asGrid();
-
-	//-----------------------------------------------------
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("R")->asGrid()->Get_Name()));
-	pR	= Parameters("R_SHARP")->asGrid();
-	pR	->Assign  (Parameters("R")->asGrid(), Interpolation);
-	pR	->Set_Name(Parameters("R")->asGrid()->Get_Name());
-
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("G")->asGrid()->Get_Name()));
-	pG	= Parameters("G_SHARP")->asGrid();
-	pG	->Assign  (Parameters("G")->asGrid(), Interpolation);
-	pG	->Set_Name(Parameters("G")->asGrid()->Get_Name());
-
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("B")->asGrid()->Get_Name()));
-	pB	= Parameters("B_SHARP")->asGrid();
-	pB	->Assign  (Parameters("B")->asGrid(), Interpolation);
-	pB	->Set_Name(Parameters("B")->asGrid()->Get_Name());
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("RGB to IHS"));
-
-	double	rMin	= pR->Get_ZMin(),	rRange	= pR->Get_ZRange();
-	double	gMin	= pG->Get_ZMin(),	gRange	= pG->Get_ZRange();
-	double	bMin	= pB->Get_ZMin(),	bRange	= pB->Get_ZRange();
-
-	for(y=0; y<pPan->Get_NY() && Set_Progress(y, pPan->Get_NY()); y++)
-	{
-		for(int x=0; x<pPan->Get_NX(); x++)
-		{
-			bool	bNoData	= true;
-
-			if( pPan->is_NoData(x, y) || pR->is_NoData(x, y) || pG->is_NoData(x, y) || pB->is_NoData(x, y) )
-			{
-				pR->Set_NoData(x, y);
-				pG->Set_NoData(x, y);
-				pB->Set_NoData(x, y);
-			}
-			else
-			{
-				r	= (pR->asDouble(x, y) - rMin) / rRange;	if( r < 0.0 ) r = 0.0; else if( r > 1.0 ) r = 1.0;
-				g	= (pG->asDouble(x, y) - gMin) / gRange;	if( g < 0.0 ) g = 0.0; else if( g > 1.0 ) g = 1.0;
-				b	= (pB->asDouble(x, y) - bMin) / bRange;	if( b < 0.0 ) b = 0.0; else if( b > 1.0 ) b = 1.0;
-
-				i	= r + g + b;
-				
-				if( i <= 0.0 )
-				{
-					h	= 0.0;
-					s	= 0.0;
-				}
-				else
-				{
-					if( r == g && g == b )			{	h	= 0.0;	}
-					else if( b < r && b < g )		{	h	= (g - b) / (i - 3 * b)    ;	}
-					else if( r < g && r < b )		{	h	= (b - r) / (i - 3 * r) + 1;	}
-					else							{	h	= (r - g) / (i - 3 * g) + 2;	}
-
-					if     ( 0.0 <= h && h < 1.0 )	{	s	= (i - 3 * b) / i;	}
-					else if( 1.0 <= h && h < 2.0 )	{	s	= (i - 3 * r) / i;	}
-					else							{	s	= (i - 3 * g) / i;	}
-				}
-
-				pR->Set_Value(x, y, i);
-				pG->Set_Value(x, y, s);
-				pB->Set_Value(x, y, h);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	double	Offset_Pan, Offset, Scale;
-
-	if( Parameters("PAN_MATCH")->asInt() == 0 )
-	{
-		Offset_Pan	= pPan->Get_ZMin();
-		Offset		= pR->Get_ZMin();
-		Scale		= pR->Get_ZRange() / pPan->Get_ZRange();
-	}
-	else
-	{
-		Offset_Pan	= pPan->Get_ArithMean();
-		Offset		= pR->Get_ArithMean();
-		Scale		= pR->Get_StdDev() / pPan->Get_StdDev();
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("IHS to RGB"));
-
-	for(y=0; y<pPan->Get_NY() && Set_Progress(y, pPan->Get_NY()); y++)
-	{
-		for(int x=0; x<pPan->Get_NX(); x++)
-		{
-			if( !pR->is_NoData(x, y) )
-			{
-				i	= Offset + Scale * (pPan->asDouble(x, y) - Offset_Pan);
-				s	= pG  ->asDouble(x, y);
-				h	= pB  ->asDouble(x, y);
-
-				if     ( 0.0 <= h && h < 1.0 )
-				{
-					r	= i * (1 + 2 * s - 3 * s * h) / 3;
-					g	= i * (1 -     s + 3 * s * h) / 3;
-					b	= i * (1 -     s            ) / 3;
-				}
-				else if( 1.0 <= h && h < 2.0 )
-				{
-					r	= i * (1 -     s                  ) / 3;
-					g	= i * (1 + 2 * s - 3 * s * (h - 1)) / 3;
-					b	= i * (1 -     s + 3 * s * (h - 1)) / 3;
-				}
-				else
-				{
-					r	= i * (1 -     s + 3 * s * (h - 2)) / 3;
-					g	= i * (1 -     s                  ) / 3;
-					b	= i * (1 + 2 * s - 3 * s * (h - 2)) / 3;
-				}
-
-				pR->Set_Value(x, y, rMin + r * rRange);
-				pG->Set_Value(x, y, gMin + g * gRange);
-				pB->Set_Value(x, y, bMin + b * bRange);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPanSharp_Brovey::CPanSharp_Brovey(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Colour Normalized Brovey Sharpening"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Colour normalized (Brovey) sharpening.\n"
-		"\n"
-		"References:\n"
-		"Vrabel, J. (1996): Multispectral Imagery Band Sharpening Study. "
-		"Photogrammetric Engineering & Remote Sensing, Vol. 62, No. 9, pp. 1075-1083.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(NULL	, "R"		, _TL("Red")	, _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL	, "G"		, _TL("Green")	, _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL	, "B"		, _TL("Blue")	, _TL(""), PARAMETER_INPUT);
-
-	pNode	= Parameters.Add_Grid_System(
-		NULL	, "PAN_SYSTEM"	, _TL("High Resolution Grid System"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid(
-		pNode	, "PAN"			, _TL("Panchromatic Channel"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(pNode	, "R_SHARP"	, _TL("Red")	, _TL(""), PARAMETER_OUTPUT, false);
-	Parameters.Add_Grid(pNode	, "G_SHARP"	, _TL("Green")	, _TL(""), PARAMETER_OUTPUT, false);
-	Parameters.Add_Grid(pNode	, "B_SHARP"	, _TL("Blue")	, _TL(""), PARAMETER_OUTPUT, false);
-
-	Parameters.Add_Grid_List(
-		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "RESAMPLING"	, _TL("Resampling"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("nearest neighbour"),
-			_TL("bilinear"),
-			_TL("cubic convolution")
-		), 2
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPanSharp_Brovey::On_Execute(void)
-{
-	//-----------------------------------------------------
-	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
-
-	//-----------------------------------------------------
-	CSG_Grid	*pPan, *pR, *pG, *pB;
-
-	pPan	= Parameters("PAN")->asGrid();
-
-	//-----------------------------------------------------
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("R")->asGrid()->Get_Name()));
-	pR	= Parameters("R_SHARP")->asGrid();
-	pR	->Assign  (Parameters("R")->asGrid(), Interpolation);
-	pR	->Set_Name(Parameters("R")->asGrid()->Get_Name());
-
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("G")->asGrid()->Get_Name()));
-	pG	= Parameters("G_SHARP")->asGrid();
-	pG	->Assign  (Parameters("G")->asGrid(), Interpolation);
-	pG	->Set_Name(Parameters("G")->asGrid()->Get_Name());
-
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("B")->asGrid()->Get_Name()));
-	pB	= Parameters("B_SHARP")->asGrid();
-	pB	->Assign  (Parameters("B")->asGrid(), Interpolation);
-	pB	->Set_Name(Parameters("B")->asGrid()->Get_Name());
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Sharpening"));
-
-	for(int y=0; y<pPan->Get_NY() && Set_Progress(y, pPan->Get_NY()); y++)
-	{
-		for(int x=0; x<pPan->Get_NX(); x++)
-		{
-			if( !pPan->is_NoData(x, y) && !pR->is_NoData(x, y) && !pG->is_NoData(x, y) && !pB->is_NoData(x, y) )
-			{
-				double	k	= (pR->asDouble(x, y) + pG->asDouble(x, y) + pB->asDouble(x, y));
-
-				if( k != 0.0 )
-				{
-					k	= pPan->asDouble(x, y) / k;
-				}
-
-				pR->Mul_Value(x, y, k);
-				pG->Mul_Value(x, y, k);
-				pB->Mul_Value(x, y, k);
-			}
-			else
-			{
-				pR->Set_NoData(x, y);
-				pG->Set_NoData(x, y);
-				pB->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPanSharp_CN::CPanSharp_CN(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Colour Normalized Spectral Sharpening"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Colour normalized spectral sharpening.\n"
-		"\n"
-		"References:\n"
-		"Vrabel, J., Doraiswamy, P., McMurtrey, J., Stern, A. (2002): "
-		"Demonstration of the Accuracy of Improved Resolution Hyperspectral Imagery. "
-		"SPIE Symposium Proceedings.\n"
-		"\n"
-		"Vrabel, J., Doraiswamy, P., Stern, A. (2002): "
-		"Application of Hyperspectral Imagery Resolution Improvement for Site-Specific Farming. "
-		"ASPRS 2002 Conference Proceedings.\n"
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid_System(
-		NULL	, "LO_RES"		, _TL("Low Resolution Grid System"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_List(
-		pNode	, "GRIDS"		, _TL("Original Channels"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "PAN"			, _TL("Panchromatic Channel"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "RESAMPLING"	, _TL("Resampling"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("nearest neighbour"),
-			_TL("bilinear"),
-			_TL("cubic convolution")
-		), 2
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPanSharp_CN::On_Execute(void)
-{
-	//-----------------------------------------------------
-	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
-
-	//-----------------------------------------------------
-	int						i;
-	CSG_Grid				*pPan;
-	CSG_Parameter_Grid_List	*pGrids, *pSharp;
-	
-	pPan	= Parameters("PAN"    )->asGrid();
-	pGrids	= Parameters("GRIDS"  )->asGridList();
-	pSharp	= Parameters("SHARPEN")->asGridList();
-
-	//-----------------------------------------------------
-	pSharp->Del_Items();
-
-	for(i=0; i<pGrids->Get_Count(); i++)
-	{
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), pGrids->asGrid(i)->Get_Name()));
-
-		CSG_Grid	*pGrid	= SG_Create_Grid(*Get_System());
-
-		pGrid->Set_Name (pGrids->asGrid(i)->Get_Name());
-		pGrid->Assign   (pGrids->asGrid(i), Interpolation);
-
-		pSharp->Add_Item(pGrid);
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	Sum	= 0.0;
-
-			if( !pPan->is_NoData(x, y) )
-			{
-				for(i=0; i<pSharp->Get_Count(); i++)
-				{
-					if( !pSharp->asGrid(i)->is_NoData(x, y) )
-					{
-						Sum	+= pSharp->asGrid(i)->asDouble (x, y);
-					}
-					else
-					{
-						Sum	 = 0.0;
-
-						break;
-					}
-				}
-			}
-
-			if( Sum )
-			{
-				Sum	= pPan->asDouble(x, y) * pSharp->Get_Count() / (Sum + pSharp->Get_Count());
-
-				for(i=0; i<pSharp->Get_Count(); i++)
-				{
-					pSharp->asGrid(i)->Mul_Value(x, y, Sum);
-				}
-			}
-			else
-			{
-				for(i=0; i<pSharp->Get_Count(); i++)
-				{
-					pSharp->asGrid(i)->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPanSharp_PCA::CPanSharp_PCA(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Principle Components Based Image Sharpening"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Principle components based image sharpening."
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid_System(
-		NULL	, "LO_RES"		, _TL("Low Resolution Grid System"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_List(
-		pNode	, "GRIDS"		, _TL("Original Channels"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "PAN"			, _TL("Panchromatic Channel"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "SHARPEN"		, _TL("Sharpend Channels"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("correlation matrix"),
-			_TL("variance-covariance matrix"),
-			_TL("sums-of-squares-and-cross-products matrix")
-		), 1
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "RESAMPLING"	, _TL("Resampling"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("nearest neighbour"),
-			_TL("bilinear"),
-			_TL("cubic convolution")
-		), 2
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "PAN_MATCH"	, _TL("Panchromatic Channel Matching"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("normalized"),
-			_TL("standardized")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define RUN_MODULE(BRETVAL, LIBRARY, MODULE, PARAMETERS, GRIDSYSTEM, CONDITION)	{\
-	\
-	BRETVAL	= false;\
-	\
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T(LIBRARY), MODULE);\
-	\
-	if(	pModule == NULL )\
-	{\
-		Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("could not find module"), SG_T(LIBRARY)));\
-	}\
-	else if( pModule->is_Grid() )\
-	{\
-		Process_Set_Text(pModule->Get_Name());\
-		\
-		CSG_Parameters	P_tmp; P_tmp.Assign(pModule->Get_Parameters());\
-		\
-		pModule->Set_Manager(NULL);\
-		\
-		((CSG_Module_Grid *)pModule)->Get_System()->Assign(GRIDSYSTEM);\
-		\
-		if( !(CONDITION) )\
-		{\
-			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not initialize module"), SG_T(LIBRARY), pModule->Get_Name().c_str()));\
-		}\
-		else if( !pModule->Execute() )\
-		{\
-			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not execute module")   , SG_T(LIBRARY), pModule->Get_Name().c_str()));\
-		}\
-		else\
-		{\
-			BRETVAL	= true;\
-		}\
-		\
-		PARAMETERS.Assign(pModule->Get_Parameters());\
-		\
-		pModule->Get_Parameters()->Assign_Values(&P_tmp);\
-	}\
-}
-
-//---------------------------------------------------------
-#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPanSharp_PCA::On_Execute(void)
-{
-	//-----------------------------------------------------
-	TSG_Grid_Interpolation	Interpolation	= Get_Interpolation(Parameters("RESAMPLING")->asInt());
-
-	//-----------------------------------------------------
-	bool			bResult;
-	CSG_Parameters	P;
-	CSG_Table		Eigen;
-
-	//-----------------------------------------------------
-	RUN_MODULE(bResult, "geostatistics_grid", 8, P, Parameters("GRIDS")->asGridList()->asGrid(0)->Get_System(),
-			SET_PARAMETER("GRIDS"	, Parameters("GRIDS"))
-		&&	SET_PARAMETER("METHOD"	, Parameters("METHOD"))
-		&&	SET_PARAMETER("EIGEN"	, &Eigen)
-		&&	SET_PARAMETER("NFIRST"	, 0)
-	);
-
-	if( !bResult )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pPCA_0	= P.Get_Parameter("PCA")->asGridList();
-	CSG_Parameter_Grid_List	*pPCA_1	= P.Add_Grid_List(NULL, "PCA_1", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList();
-
-	CSG_Grid	*PCA	= new CSG_Grid[pPCA_0->Get_Count()];
-	CSG_Grid	*pPan	= Parameters("PAN")->asGrid();
-
-	double	Offset_Pan, Offset, Scale;
-
-	if( Parameters("PAN_MATCH")->asInt() == 0 )
-	{
-		Offset_Pan	= pPan->Get_ZMin();
-		Offset		= pPCA_0->asGrid(0)->Get_ZMin();
-		Scale		= pPCA_0->asGrid(0)->Get_ZRange() / pPan->Get_ZRange();
-	}
-	else
-	{
-		Offset_Pan	= pPan->Get_ArithMean();
-		Offset		= pPCA_0->asGrid(0)->Get_ArithMean();
-		Scale		= pPCA_0->asGrid(0)->Get_StdDev() / pPan->Get_StdDev();
-	}
-
-	PCA[0].Create(*Get_System());
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( pPan->is_NoData(x, y) )
-			{
-				PCA[0].Set_NoData(x, y);
-			}
-			else
-			{
-				PCA[0].Set_Value(x, y, Offset + Scale * (pPan->asDouble(x, y) - Offset_Pan));
-			}
-		}
-	}
-
-	pPCA_1->Add_Item(&PCA[0]);
-
-	delete(pPCA_0->asGrid(0));
-
-	for(int i=1; i<pPCA_0->Get_Count(); i++)
-	{
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), pPCA_0->asGrid(i)->Get_Name()));
-
-		PCA[i].Create(*Get_System());
-		PCA[i].Assign(pPCA_0->asGrid(i), Interpolation);
-		pPCA_1->Add_Item(&PCA[i]);
-		delete(pPCA_0->asGrid(i));
-	}
-
-	//-----------------------------------------------------
-	RUN_MODULE(bResult, "geostatistics_grid", 10, P, *Get_System(),
-			SET_PARAMETER("PCA"		, P("PCA_1"))
-		&&	SET_PARAMETER("GRIDS"	, Parameters("SHARPEN"))
-		&&	SET_PARAMETER("EIGEN"	, &Eigen)
-	);
-
-	delete[](PCA);
-
-	if( !bResult )
-	{
-		return( false );
-	}
-
-	Parameters.Set_Parameter("SHARPEN", P.Get_Parameter("GRIDS"));
-
-	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS"  )->asGridList();
-	CSG_Parameter_Grid_List	*pSharp	= Parameters("SHARPEN")->asGridList();
-
-	for(int j=0; j<pGrids->Get_Count() && j<pSharp->Get_Count(); j++)
-	{
-		pSharp->asGrid(j)->Set_Name(pGrids->asGrid(j)->Get_Name());
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/pansharpening.h b/src/modules_images/modules_imagery/imagery_tools/pansharpening.h
deleted file mode 100644
index c480ab2..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/pansharpening.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/**********************************************************
- * Version $Id: pansharp_pca.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    pansharpening.h                    //
-//                                                       //
-//                 Copyright (C) 2011 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__pansharpening_pca_H
-#define HEADER_INCLUDED__pansharpening_pca_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPanSharp_IHS : public CSG_Module_Grid
-{
-public:
-	CPanSharp_IHS(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPanSharp_Brovey : public CSG_Module_Grid
-{
-public:
-	CPanSharp_Brovey(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPanSharp_CN : public CSG_Module_Grid
-{
-public:
-	CPanSharp_CN(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPanSharp_PCA : public CSG_Module_Grid
-{
-public:
-	CPanSharp_PCA(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Image Sharpening") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__pansharpening_pca_H
diff --git a/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.cpp b/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.cpp
deleted file mode 100644
index e7bec13..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-/**********************************************************
- * Version $Id: evi.cpp 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   tasseled_cap.cpp                    //
-//                                                       //
-//                 Copyright (C) 2011 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 "tasseled_cap.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTasseled_Cap::CTasseled_Cap(void)
-{
-	Set_Name		(_TL("Tasseled Cap Transformation"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Tasseled Cap Transformation as proposed for Landsat Thematic Mapper.\n"
-		"\n"
-		"References:\n"
-		"Kauth R. J. und G. S. Thomas (1976): "
-		"The Tasseled Cap - A Graphic Description of the Spectral-Temporal Development of Agricultural Crops as Seen by LANDSAT. "
-		"Proceedings of the Symposium on Machine Processing of Remotely Sensed Data. "
-		"<a target=\"_blank\" href=\"http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1160&context=lars_symp&sei-redir=1&referer=http%3A%2F%2Fwww.google.de%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3Dthe%2520tasseled%2520cap%2520--%2520a%2520graphic%2520description%2520of%2520the%2520spectral-temporal%2520development%2520of%2520agricultural%2520crops%26source%3Dweb%26cd%3D1%26ved%3D0CCEQFjAA%26url%3Dhttp%253A%252F%252Fdocs.lib.purdue.edu%252Fcgi%252Fviewcontent.cgi%253Farticle%253D1160%2526context%25 [...]
-		"\n"
-		"Huang, C., B. Wylie, L. Yang, C. Homer, and G. Zylstra. "
-		"Derivation of a Tasseled Cap Transformation Based on Landsat 7 At-Satellite Reflectance. "
-		"USGS EROS Data Center White Paper. "
-		"<a target=\"_blank\" href=\"http://landcover.usgs.gov/pdf/tasseled.pdf\">online at USGS</a>\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL, "BLUE"		, _TL("Blue (TM 1)"),
-		_TL(""), 
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "RED"			, _TL("Red (TM 2)"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "GREEN"		, _TL("Green (TM 3)"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "NIR"			, _TL("Near Infrared (TM 4)"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "MIR1"		, _TL("Mid Infrared (TM 5)"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "MIR2"		, _TL("Mid Infrared (TM 7)"), 
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "BRIGHTNESS"	, _TL("Brightness"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "GREENNESS"	, _TL("Greenness"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "WETNESS"		, _TL("Wetness"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTasseled_Cap::On_Execute(void)
-{
-	CSG_Grid	*pBand[6], *pBright, *pGreen, *pWet;
-
-	pBand[0]	= Parameters("BLUE"      )->asGrid();
-	pBand[1]	= Parameters("GREEN"     )->asGrid();
-	pBand[2]	= Parameters("RED"       )->asGrid();
-	pBand[3]	= Parameters("NIR"       )->asGrid();
-	pBand[4]	= Parameters("MIR1"      )->asGrid();
-	pBand[5]	= Parameters("MIR2"      )->asGrid();
-
-	pBright		= Parameters("BRIGHTNESS")->asGrid();
-	pGreen		= Parameters("GREENNESS" )->asGrid();
-	pWet		= Parameters("WETNESS"   )->asGrid();
-
-	DataObject_Set_Colors(pBright, 100, SG_COLORS_BLACK_WHITE  , false);
-	DataObject_Set_Colors(pGreen , 100, SG_COLORS_WHITE_GREEN  , false);
-	DataObject_Set_Colors(pWet   , 100, SG_COLORS_RED_GREY_BLUE, false);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if(	pBand[0]->is_NoData(x, y)
-			||	pBand[1]->is_NoData(x, y)
-			||	pBand[2]->is_NoData(x, y)
-			||	pBand[3]->is_NoData(x, y)
-			||	pBand[4]->is_NoData(x, y)
-			||	pBand[5]->is_NoData(x, y)
-			)
-			{
-				pBright	->Set_NoData(x, y);
-				pGreen	->Set_NoData(x, y);
-				pWet	->Set_NoData(x, y);
-			}
-			else
-			{
-				double	b[6];
-
-				b[0]	= pBand[0]->asDouble(x, y);
-				b[1]	= pBand[1]->asDouble(x, y);
-				b[2]	= pBand[2]->asDouble(x, y);
-				b[3]	= pBand[3]->asDouble(x, y);
-				b[4]	= pBand[4]->asDouble(x, y);
-				b[5]	= pBand[5]->asDouble(x, y);
-
-			    pBright	->Set_Value(x, y,
-					 0.3037 * b[0] + 0.2793 * b[1] + 0.4743 * b[2] + 0.5585 * b[3] + 0.5082 * b[4] + 0.1863 * b[5]
-				);
-
-				pGreen	->Set_Value(x, y,
-					-0.2848 * b[0] - 0.2435 * b[1] - 0.5436 * b[2] + 0.7243 * b[3] + 0.0840 * b[4] - 0.1800 * b[5]
-				);
-
-				pWet	->Set_Value(x, y,
-					 0.1509 * b[0] + 0.1973 * b[1] + 0.3279 * b[2] + 0.3406 * b[3] - 0.7112 * b[4] - 0.4572 * b[5]
-				);
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.h b/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.h
deleted file mode 100644
index ee72068..0000000
--- a/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/**********************************************************
- * Version $Id: Image_VI_Slope.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    imagery_tools                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    tasseled_cap.h                     //
-//                                                       //
-//                 Copyright (C) 2011 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__tasseled_cap_H
-#define HEADER_INCLUDED__tasseled_cap_H
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTasseled_Cap : public CSG_Module_Grid
-{
-public:
-	CTasseled_Cap(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vegetation Indices") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__tasseled_cap_H
diff --git a/src/modules_images/modules_opencv/Makefile.am b/src/modules_images/modules_opencv/Makefile.am
deleted file mode 100644
index ae53e65..0000000
--- a/src/modules_images/modules_opencv/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = opencv
diff --git a/src/modules_images/modules_opencv/Makefile.in b/src/modules_images/modules_opencv/Makefile.in
deleted file mode 100644
index 7aeef78..0000000
--- a/src/modules_images/modules_opencv/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_opencv
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = opencv
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_opencv/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_opencv/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_opencv/opencv/Makefile.am b/src/modules_images/modules_opencv/opencv/Makefile.am
deleted file mode 100644
index f26816e..0000000
--- a/src/modules_images/modules_opencv/opencv/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# $Id: Makefile.am 1856 2013-10-17 09:46:51Z oconrad $
-#
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-UC_DEFS = -D_SAGA_UNICODE
-endif
-if HAVE_CV
-DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS           = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
-AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = -fPIC -shared -avoid-version -lcv
-pkglib_LTLIBRARIES = libopencv.la
-libopencv_la_SOURCES =\
-MLB_Interface.cpp\
-opencv.cpp\
-opencv_fourier.cpp\
-opencv_morphology.cpp\
-opencv_nnet.cpp\
-opencv_svd.cpp\
-MLB_Interface.h\
-opencv.h\
-opencv_fourier.h\
-opencv_morphology.h\
-opencv_nnet.h\
-opencv_svd.h
-
-libopencv_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-endif
diff --git a/src/modules_images/modules_opencv/opencv/Makefile.in b/src/modules_images/modules_opencv/opencv/Makefile.in
deleted file mode 100644
index 5a89958..0000000
--- a/src/modules_images/modules_opencv/opencv/Makefile.in
+++ /dev/null
@@ -1,595 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_opencv/opencv
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
- at HAVE_CV_TRUE@libopencv_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am__libopencv_la_SOURCES_DIST = MLB_Interface.cpp opencv.cpp \
-	opencv_fourier.cpp opencv_morphology.cpp opencv_nnet.cpp \
-	opencv_svd.cpp MLB_Interface.h opencv.h opencv_fourier.h \
-	opencv_morphology.h opencv_nnet.h opencv_svd.h
- at HAVE_CV_TRUE@am_libopencv_la_OBJECTS = MLB_Interface.lo opencv.lo \
- at HAVE_CV_TRUE@	opencv_fourier.lo opencv_morphology.lo \
- at HAVE_CV_TRUE@	opencv_nnet.lo opencv_svd.lo
-libopencv_la_OBJECTS = $(am_libopencv_la_OBJECTS)
- at HAVE_CV_TRUE@am_libopencv_la_rpath = -rpath $(pkglibdir)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libopencv_la_SOURCES)
-DIST_SOURCES = $(am__libopencv_la_SOURCES_DIST)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1856 2013-10-17 09:46:51Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
- at HAVE_CV_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
- at HAVE_CV_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
- at HAVE_CV_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
- at HAVE_CV_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version -lcv
- at HAVE_CV_TRUE@pkglib_LTLIBRARIES = libopencv.la
- at HAVE_CV_TRUE@libopencv_la_SOURCES = \
- at HAVE_CV_TRUE@MLB_Interface.cpp\
- at HAVE_CV_TRUE@opencv.cpp\
- at HAVE_CV_TRUE@opencv_fourier.cpp\
- at HAVE_CV_TRUE@opencv_morphology.cpp\
- at HAVE_CV_TRUE@opencv_nnet.cpp\
- at HAVE_CV_TRUE@opencv_svd.cpp\
- at HAVE_CV_TRUE@MLB_Interface.h\
- at HAVE_CV_TRUE@opencv.h\
- at HAVE_CV_TRUE@opencv_fourier.h\
- at HAVE_CV_TRUE@opencv_morphology.h\
- at HAVE_CV_TRUE@opencv_nnet.h\
- at HAVE_CV_TRUE@opencv_svd.h
-
- at HAVE_CV_TRUE@libopencv_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_opencv/opencv/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_opencv/opencv/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libopencv.la: $(libopencv_la_OBJECTS) $(libopencv_la_DEPENDENCIES) 
-	$(CXXLINK) $(am_libopencv_la_rpath) $(libopencv_la_OBJECTS) $(libopencv_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_fourier.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_morphology.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_nnet.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_svd.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_vigra/Makefile.am b/src/modules_images/modules_vigra/Makefile.am
deleted file mode 100644
index 7c16bc2..0000000
--- a/src/modules_images/modules_vigra/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = vigra
diff --git a/src/modules_images/modules_vigra/Makefile.in b/src/modules_images/modules_vigra/Makefile.in
deleted file mode 100644
index 8c5b3c7..0000000
--- a/src/modules_images/modules_vigra/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_vigra
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = vigra
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_vigra/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_vigra/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_vigra/vigra/Makefile.am b/src/modules_images/modules_vigra/vigra/Makefile.am
deleted file mode 100644
index 70e15e6..0000000
--- a/src/modules_images/modules_vigra/vigra/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# $Id: Makefile.am 1896 2013-12-10 14:56:59Z oconrad $
-#
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-UC_DEFS = -D_SAGA_UNICODE
-endif
-if HAVE_VIGRA
-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 -lvigraimpex -lfftw3
-pkglib_LTLIBRARIES = libvigra.la
-libvigra_la_SOURCES =\
-vigra.h\
-vigra_edges.h\
-vigra_smoothing.h\
-vigra_distance.h\
-vigra_fft.h\
-vigra_morphology.h\
-vigra_random_forest.h\
-vigra_watershed.h\
-MLB_Interface.cpp\
-vigra.cpp\
-MLB_Interface.h\
-vigra_distance.cpp\
-vigra_fft.cpp\
-vigra_smoothing.cpp\
-vigra_edges.cpp\
-vigra_morphology.cpp\
-vigra_random_forest.cpp\
-vigra_watershed.cpp
-
-libvigra_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-endif
diff --git a/src/modules_images/modules_vigra/vigra/Makefile.in b/src/modules_images/modules_vigra/vigra/Makefile.in
deleted file mode 100644
index 4f9fcbb..0000000
--- a/src/modules_images/modules_vigra/vigra/Makefile.in
+++ /dev/null
@@ -1,608 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_images/modules_vigra/vigra
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
- at HAVE_VIGRA_TRUE@libvigra_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am__libvigra_la_SOURCES_DIST = vigra.h vigra_edges.h vigra_smoothing.h \
-	vigra_distance.h vigra_fft.h vigra_morphology.h \
-	vigra_random_forest.h vigra_watershed.h MLB_Interface.cpp \
-	vigra.cpp MLB_Interface.h vigra_distance.cpp vigra_fft.cpp \
-	vigra_smoothing.cpp vigra_edges.cpp vigra_morphology.cpp \
-	vigra_random_forest.cpp vigra_watershed.cpp
- at HAVE_VIGRA_TRUE@am_libvigra_la_OBJECTS = MLB_Interface.lo vigra.lo \
- at HAVE_VIGRA_TRUE@	vigra_distance.lo vigra_fft.lo \
- at HAVE_VIGRA_TRUE@	vigra_smoothing.lo vigra_edges.lo \
- at HAVE_VIGRA_TRUE@	vigra_morphology.lo vigra_random_forest.lo \
- at HAVE_VIGRA_TRUE@	vigra_watershed.lo
-libvigra_la_OBJECTS = $(am_libvigra_la_OBJECTS)
- at HAVE_VIGRA_TRUE@am_libvigra_la_rpath = -rpath $(pkglibdir)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libvigra_la_SOURCES)
-DIST_SOURCES = $(am__libvigra_la_SOURCES_DIST)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1896 2013-12-10 14:56:59Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
- at HAVE_VIGRA_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
- at HAVE_VIGRA_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core
- at HAVE_VIGRA_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
- at HAVE_VIGRA_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version -lvigraimpex -lfftw3
- at HAVE_VIGRA_TRUE@pkglib_LTLIBRARIES = libvigra.la
- at HAVE_VIGRA_TRUE@libvigra_la_SOURCES = \
- at HAVE_VIGRA_TRUE@vigra.h\
- at HAVE_VIGRA_TRUE@vigra_edges.h\
- at HAVE_VIGRA_TRUE@vigra_smoothing.h\
- at HAVE_VIGRA_TRUE@vigra_distance.h\
- at HAVE_VIGRA_TRUE@vigra_fft.h\
- at HAVE_VIGRA_TRUE@vigra_morphology.h\
- at HAVE_VIGRA_TRUE@vigra_random_forest.h\
- at HAVE_VIGRA_TRUE@vigra_watershed.h\
- at HAVE_VIGRA_TRUE@MLB_Interface.cpp\
- at HAVE_VIGRA_TRUE@vigra.cpp\
- at HAVE_VIGRA_TRUE@MLB_Interface.h\
- at HAVE_VIGRA_TRUE@vigra_distance.cpp\
- at HAVE_VIGRA_TRUE@vigra_fft.cpp\
- at HAVE_VIGRA_TRUE@vigra_smoothing.cpp\
- at HAVE_VIGRA_TRUE@vigra_edges.cpp\
- at HAVE_VIGRA_TRUE@vigra_morphology.cpp\
- at HAVE_VIGRA_TRUE@vigra_random_forest.cpp\
- at HAVE_VIGRA_TRUE@vigra_watershed.cpp
-
- at HAVE_VIGRA_TRUE@libvigra_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_images/modules_vigra/vigra/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_images/modules_vigra/vigra/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libvigra.la: $(libvigra_la_OBJECTS) $(libvigra_la_DEPENDENCIES) 
-	$(CXXLINK) $(am_libvigra_la_rpath) $(libvigra_la_OBJECTS) $(libvigra_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_distance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_edges.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_fft.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_morphology.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_random_forest.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_smoothing.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vigra_watershed.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_images/modules_vigra/vigra/vigra_morphology.cpp b/src/modules_images/modules_vigra/vigra/vigra_morphology.cpp
deleted file mode 100644
index 3fb1483..0000000
--- a/src/modules_images/modules_vigra/vigra/vigra_morphology.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/**********************************************************
- * Version $Id: vigra_morphology.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        VIGRA                          //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  vigra_morphology.cpp                 //
-//                                                       //
-//                 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "vigra_morphology.h"
-
-//---------------------------------------------------------
-#include <vigra/flatmorphology.hxx>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CViGrA_Morphology::CViGrA_Morphology(void)
-{
-	Set_Name		(_TL("Morphological Filter (ViGrA)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2009"));
-
-	Set_Description	(_TW(
-		"References:\n"
-		"ViGrA - Vision with Generic Algorithms\n"
-		"<a target=\"_blank\" href=\"http://hci.iwr.uni-heidelberg.de/vigra\">http://hci.iwr.uni-heidelberg.de</a>"
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "INPUT"		, _TL("Input"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "OUTPUT"		, _TL("Output"),
-		_TL(""),
-		PARAMETER_OUTPUT, SG_DATATYPE_Byte
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TYPE"		, _TL("Operation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("Dilation"),
-			_TL("Erosion"),
-			_TL("Median"),
-			_TL("User defined rank")
-		)
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Radius (cells)"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RANK"		, _TL("User defined rank"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RESCALE"		, _TL("Rescale Values (0-255)"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CViGrA_Morphology::On_Execute(void)
-{
-	bool		bRescale;
-	int			Type, Radius;
-	double		Rank;
-	CSG_Grid	*pInput, *pOutput, Rescaled;
-
-	pInput		= Parameters("INPUT")	->asGrid();
-	pOutput		= Parameters("OUTPUT")	->asGrid();
-	Type		= Parameters("TYPE")	->asInt();
-	Radius		= Parameters("RADIUS")	->asInt();
-	Rank		= Parameters("RANK")	->asDouble();
-	bRescale	= Parameters("RESCALE")	->asBool();
-
-	//-----------------------------------------------------
-	if( bRescale )
-	{
-		Rescaled.Create(*Get_System(), SG_DATATYPE_Byte);
-
-		for(long i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
-		{
-			Rescaled.Set_Value(i, 0.5 + (pInput->asDouble(i) - pInput->Get_ZMin()) * 255.0 / pInput->Get_ZRange());
-		}
-
-		pInput	= &Rescaled;
-	}
-
-	//-----------------------------------------------------
-	vigra::BImage	Input, Output(Get_NX(), Get_NY());
-
-	Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true);
-
-	switch( Type )
-	{
-	case 0:	// Dilation
-		discDilation		(srcImageRange(Input), destImage(Output), Radius);
-		break;
-
-	case 1:	// Erosion
-		discErosion			(srcImageRange(Input), destImage(Output), Radius);
-		break;
-
-	case 2:	// Median
-		discMedian			(srcImageRange(Input), destImage(Output), Radius);
-		break;
-
-	case 3:	// User defined rank
-		discRankOrderFilter	(srcImageRange(Input), destImage(Output), Radius, Rank);
-		break;
-	}
-
-	//-----------------------------------------------------
-	Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false);
-
-	pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str()));
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_vigra/vigra/vigra_random_forest.cpp b/src/modules_images/modules_vigra/vigra/vigra_random_forest.cpp
deleted file mode 100644
index 3e10d20..0000000
--- a/src/modules_images/modules_vigra/vigra/vigra_random_forest.cpp
+++ /dev/null
@@ -1,587 +0,0 @@
-/**********************************************************
- * Version $Id: vigra_random_forest.cpp 1282 2011-12-29 17:13:26Z manfred-e $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        VIGRA                          //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                vigra_random_forest.cpp                //
-//                                                       //
-//                 Copyright (C) 2013 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 "vigra_random_forest.h"
-
-//---------------------------------------------------------
-#include <vigra/random_forest.hxx>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	CLASS_ID	= 0,
-	CLASS_NAME,
-	CLASS_COUNT
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CViGrA_Random_Forest::CViGrA_Random_Forest(void)
-{
-	Set_Name		(_TL("Random Forest (ViGrA)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"References:\n"
-		"ViGrA - Vision with Generic Algorithms\n"
-		"<a target=\"_blank\" href=\"http://hci.iwr.uni-heidelberg.de/vigra\">http://hci.iwr.uni-heidelberg.de</a>"
-	));
-
-	Parameters.Add_Grid_List(
-		NULL	, "FEATURES"			, _TL("Features"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CLASSES"				, _TL("Random Forest Classification"),
-		_TL(""),
-		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "PROBABILITY"			, _TL("Prediction Probability"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL	, "BPROBABILITIES"		, _TL("Feature Probabilities"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Grid_List(
-		NULL	, "PROBABILITIES"		, _TL("Feature Probabilities"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	CSG_Parameter	*pNode	= Parameters.Add_Shapes(
-		NULL	, "TRAINING"			, _TL("Training Areas"),
-		_TL(""),
-		PARAMETER_INPUT, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "FIELD"				, _TL("Label Field"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Node(
-		NULL	, "RF_OPTIONS"			, _TL("Options"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode	, "RF_TREE_COUNT"		, _TL("Tree Count"),
-		_TL("How many trees to create?"),
-		PARAMETER_TYPE_Int, 32, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "RF_TREE_SAMPLES"		, _TL("Samples per Tree"),
-		_TL("Specifies the fraction of the total number of samples used per tree for learning."),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true, 1.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "RF_REPLACE"			, _TL("Sample with Replacement"),
-		_TL("Sample from training population with or without replacement?"),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "RF_SPLIT_MIN_SIZE"	, _TL("Minimum Node Split Size"),
-		_TL("Number of examples required for a node to be split. Choose 1 for complete growing."),
-		PARAMETER_TYPE_Int, 1, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "RF_NODE_FEATURES",	_TL("Features per Node"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("logarithmic"),
-			_TL("square root"),
-			_TL("all")
-		), 1
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "RF_STRATIFICATION",	_TL("Stratification"),
-		_TL("Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("none"),
-			_TL("equal"),
-			_TL("proportional")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CViGrA_Random_Forest::On_Execute(void)
-{
-	//-----------------------------------------------------
-	// Feature Grids
-
-	m_pFeatures	= Parameters("FEATURES")->asGridList();
-
-	for(int i=m_pFeatures->Get_Count()-1; i>=0; i--)
-	{
-		if( m_pFeatures->asGrid(i)->Get_ZRange() <= 0.0 )
-		{
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("grid has been dropped"), m_pFeatures->asGrid(i)->Get_Name()));
-
-			m_pFeatures->Del_Item(i);
-		}
-	}
-
-	if( m_pFeatures->Get_Count() <= 0 )
-	{
-		Error_Set(_TL("no valid grid in features list."));
-
-		return( false );
-	}
-
-
-	//-----------------------------------------------------
-	// Training Data
-
-	CSG_Matrix	Data;
-	CSG_Table	Classes;
-
-	if( !Get_Training(Data, Classes) )
-	{
-		Error_Set(_TL("insufficient training samples"));
-
-		return( false );
-	}
-
-	vigra::Matrix<double>	train_features(Data.Get_NRows(), m_pFeatures->Get_Count());
-	vigra::Matrix<int>		train_response(Data.Get_NRows(), 1);
-
-	for(int iSample=0; iSample<Data.Get_NRows(); iSample++)
-	{
-		train_response(iSample, 0)	= (int)Data[iSample][m_pFeatures->Get_Count()];
-
-		for(int iFeature=0; iFeature<m_pFeatures->Get_Count(); iFeature++)
-		{
-			train_features(iSample, iFeature)	= Data[iSample][iFeature];
-		}
-	}
-
-	Data.Destroy();
-
-
-	//-----------------------------------------------------
-	// Random Forest Options
-
-	vigra::RandomForestOptions	Options;
-
-	Options.tree_count(
-		Parameters("RF_TREE_COUNT")->asInt()
-	);
-
-	Options.samples_per_tree(
-		Parameters("RF_TREE_SAMPLES")->asDouble()
-	);
-
-	Options.sample_with_replacement(
-		Parameters("RF_REPLACE")->asBool()
-	);
-
-	Options.min_split_node_size(
-		Parameters("RF_SPLIT_MIN_SIZE")->asInt()
-	);
-
-	switch( Parameters("RF_NODE_FEATURES")->asInt() )
-	{
-	case  0:	Options.features_per_node(vigra::RF_LOG );	break;
-	default:	Options.features_per_node(vigra::RF_SQRT);	break;
-	case  1:	Options.features_per_node(vigra::RF_ALL );	break;
-	}
-
-	switch( Parameters("RF_STRATIFICATION")->asInt() )
-	{
-	default:	Options.use_stratification(vigra::RF_NONE        );	break;
-	case  1:	Options.use_stratification(vigra::RF_EQUAL       );	break;
-	case  2:	Options.use_stratification(vigra::RF_PROPORTIONAL);	break;
-	}
-
-
-	//-----------------------------------------------------
-	// Learning
-
-	Process_Set_Text(_TL("learning"));
-
-	vigra::RandomForest<int>	Forest(Options);
-
-	vigra::rf::visitors::OOB_Error	oob_v;	// construct visitor to calculate out-of-bag error
-
-	Forest.learn(train_features, train_response, vigra::rf::visitors::create_visitor(oob_v));
-
-	Message_Add(CSG_String::Format(SG_T("\n%s: %f"), _TL("out-of-bag error"), oob_v.oob_breiman), false);
-
-
-	//-----------------------------------------------------
-	// Output Grids
-
-	CSG_Grid	*pClasses		= Get_Class_Grid(Classes);
-
-	CSG_Grid	*pProbability	= Parameters("PROBABILITY")->asGrid();
-
-	CSG_Parameter_Grid_List	*pProbabilities	= Get_Propability_Grids(Classes);
-
-	DataObject_Set_Colors(pProbability, 11, SG_COLORS_WHITE_GREEN);
-
-
-	//-----------------------------------------------------
-	// Prediction
-
-	Process_Set_Text(_TL("prediction"));
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !pClasses->is_NoData(x, y) )
-			{
-				vigra::Matrix<double>	features(1, m_pFeatures->Get_Count());
-
-				for(int iFeature=0; iFeature<m_pFeatures->Get_Count(); iFeature++)
-				{
-					features(0, iFeature)	= m_pFeatures->asGrid(iFeature)->asDouble(x, y);
-				}
-
-				int		id	= Forest.predictLabel(features);
-
-				pClasses->Set_Value(x, y, id);
-
-				if( pProbability || pProbabilities )
-				{
-					vigra::Matrix<double>	p(1, Forest.class_count());
-
-					Forest.predictProbabilities(features, p);
-
-					if( pProbability )
-					{
-						pProbability->Set_Value(x, y, p(0, id - 1));
-					}
-
-					for(int i=0; pProbabilities && i<pProbabilities->Get_Count(); i++)
-					{
-						pProbabilities->asGrid(i)->Set_Value(x, y, p(0, i));
-					}
-				}
-			}
-			else // if( pClasses->is_NoData(x, y) )
-			{
-				if( pProbability )
-				{
-					pProbability->Set_NoData(x, y);
-				}
-
-				for(int i=0; pProbabilities && i<pProbabilities->Get_Count(); i++)
-				{
-					pProbabilities->asGrid(i)->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-
-	//-----------------------------------------------------
-	// Postprocessing
-
-	Set_Classification(Classes);
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CViGrA_Random_Forest::Get_Training(CSG_Matrix &Data, CSG_Table &Classes)
-{
-	CSG_Shapes	*pTraining	= Parameters("TRAINING")->asShapes();
-
-	int		Field	= Parameters("FIELD")->asInt();
-
-	Classes.Destroy();
-	Classes.Add_Field(SG_T("ID")   , SG_DATATYPE_Int);		// CLASS_ID
-	Classes.Add_Field(SG_T("NAME" ), SG_DATATYPE_String);	// CLASS_NAME
-	Classes.Add_Field(SG_T("COUNT"), SG_DATATYPE_Int);		// CLASS_COUNT
-
-	CSG_String	Label;
-
-	CSG_Table_Record	*pClass	= NULL;
-
-	pTraining->Set_Index(Field, TABLE_INDEX_Ascending);
-
-	for(int iTraining=0, ID=0; iTraining<pTraining->Get_Count(); iTraining++)
-	{
-		CSG_Shape	*pArea	= pTraining->Get_Shape(iTraining);
-
-		if( !pClass || Label.Cmp(pArea->asString(Field)) )
-		{
-			if( !pClass || pClass->asInt(CLASS_COUNT) > 0 )
-			{
-				pClass	= Classes.Add_Record();
-
-				ID++;
-			}
-
-			pClass->Set_Value(CLASS_ID   , ID);
-			pClass->Set_Value(CLASS_NAME , Label = pArea->asString(Field));
-			pClass->Set_Value(CLASS_COUNT, 0);
-		}
-
-		pClass->Add_Value(CLASS_COUNT, Get_Training(Data, ID, (CSG_Shape_Polygon *)pArea));
-	}
-
-	return( Data.Get_NRows() > 1 );
-}
-
-//---------------------------------------------------------
-int CViGrA_Random_Forest::Get_Training(CSG_Matrix &Data, int ID, CSG_Shape_Polygon *pArea)
-{
-	int	Count	= 0;
-
-	int	xMin	= Get_System()->Get_xWorld_to_Grid(pArea->Get_Extent().Get_XMin());	if( xMin <  0        ) xMin = 0;
-	int	xMax	= Get_System()->Get_xWorld_to_Grid(pArea->Get_Extent().Get_XMax());	if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
-	int	yMin	= Get_System()->Get_yWorld_to_Grid(pArea->Get_Extent().Get_YMin());	if( yMin <  0        ) yMin = 0;
-	int	yMax	= Get_System()->Get_yWorld_to_Grid(pArea->Get_Extent().Get_YMax());	if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
-
-	for(int y=yMin; y<=yMax; y++)
-	{
-		for(int x=xMin; x<=xMax; x++)
-		{
-			if( pArea->Contains(Get_System()->Get_Grid_to_World(x, y)) )
-			{
-				int	iRow	= Data.Get_NRows();
-
-				if( iRow == 0 )
-				{
-					Data.Create(1 + m_pFeatures->Get_Count(), 1);
-				}
-				else
-				{
-					Data.Add_Row();
-				}
-
-				Data[iRow][m_pFeatures->Get_Count()]	= ID;
-
-				for(int i=0; i<m_pFeatures->Get_Count(); i++)
-				{
-					Data[iRow][i]	= m_pFeatures->asGrid(i)->asDouble(x, y);
-				}
-
-				Count++;
-			}
-		}
-	}
-
-	return( Count );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Grid * CViGrA_Random_Forest::Get_Class_Grid(CSG_Table &Classes)
-{
-	CSG_Grid	*pClasses	= Parameters("CLASSES")->asGrid();
-
-	pClasses->Set_NoData_Value(-1.0);
-
-	#pragma omp parallel for
-	for(int i=0; i<Get_NCells(); i++)
-	{
-		bool	bOkay	= true;
-
-		for(int iFeature=0; bOkay && iFeature<m_pFeatures->Get_Count(); iFeature++)
-		{
-			bOkay	= !m_pFeatures->asGrid(iFeature)->is_NoData(i);
-		}
-
-		pClasses->Set_Value(i, bOkay ? 0.0 : -1.0);
-	}
-
-	return( pClasses );
-}
-
-//---------------------------------------------------------
-void CViGrA_Random_Forest::Set_Classification(CSG_Table &Classes)
-{
-	CSG_Grid	*pClasses	= Parameters("CLASSES")->asGrid();
-
-	CSG_Parameters	P;
-
-	if( DataObject_Get_Parameters(pClasses, P) && P("COLORS_TYPE") && P("LUT") )
-	{
-		CSG_Table	*pTable	= P("LUT")->asTable();
-
-		for(int i=0; i<Classes.Get_Count(); i++)
-		{
-			CSG_Table_Record	*pRecord	= pTable->Get_Record(i);
-
-			if( pRecord == NULL )
-			{
-				pRecord	= pTable->Add_Record();
-				pRecord->Set_Value(0, CSG_Random::Get_Uniform(0, 255*255*255));
-			}
-
-			pRecord->Set_Value(1, Classes[i].asString(1));
-			pRecord->Set_Value(2, Classes[i].asString(1));
-			pRecord->Set_Value(3, Classes[i].asInt(0));
-			pRecord->Set_Value(4, Classes[i].asInt(0));
-		}
-
-		while( pTable->Get_Record_Count() > Classes.Get_Count() )
-		{
-			pTable->Del_Record(pTable->Get_Record_Count() - 1);
-		}
-
-		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
-
-		DataObject_Set_Parameters(pClasses, P);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Parameter_Grid_List * CViGrA_Random_Forest::Get_Propability_Grids(CSG_Table &Classes)
-{
-	if( Parameters("BPROBABILITIES")->asBool() && Classes.Get_Field_Count() == 3 && Classes.Get_Count() > 0 )
-	{
-		CSG_Parameter_Grid_List	*pGrids	= Parameters("PROBABILITIES")->asGridList();
-
-		for(int i=0; i<Classes.Get_Count(); i++)
-		{
-			CSG_Grid	*pGrid;
-			
-			if( i < pGrids->Get_Count() )
-			{
-				pGrid	= pGrids->asGrid(i);
-			}
-			else
-			{
-				pGrids->Add_Item(pGrid = SG_Get_Data_Manager().Add_Grid(*Get_System()));
-
-				DataObject_Set_Colors(pGrid, 11, SG_COLORS_WHITE_GREEN);
-			}
-
-			pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Classes[i].asString(CLASS_NAME), _TL("Probability")));
-		}
-
-		return( pGrids );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_images/modules_vigra/vigra/vigra_random_forest.h b/src/modules_images/modules_vigra/vigra/vigra_random_forest.h
deleted file mode 100644
index a8d2877..0000000
--- a/src/modules_images/modules_vigra/vigra/vigra_random_forest.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/**********************************************************
- * Version $Id: vigra_random_forest.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        VIGRA                          //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 vigra_random_forest.h                 //
-//                                                       //
-//                 Copyright (C) 2013 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__vigra_random_forest_H
-#define HEADER_INCLUDED__vigra_random_forest_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "vigra.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CViGrA_Random_Forest : public CSG_Module_Grid
-{
-public:
-	CViGrA_Random_Forest(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Imagery|Classification") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-
-private:
-
-	CSG_Parameter_Grid_List		*m_pFeatures;
-
-
-	CSG_Grid *					Get_Class_Grid			(CSG_Table &Classes);
-	void						Set_Classification		(CSG_Table &Classes);
-
-	CSG_Parameter_Grid_List *	Get_Propability_Grids	(CSG_Table &Classes);
-
-	bool						Get_Training			(CSG_Matrix &Data, CSG_Table &Classes);
-	int							Get_Training			(CSG_Matrix &Data, int ID, CSG_Shape_Polygon *pArea);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__vigra_random_forest_H
diff --git a/src/modules_io/Makefile.am b/src/modules_io/Makefile.am
deleted file mode 100644
index 3a0c34c..0000000
--- a/src/modules_io/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = db docs esri_e00 gps gdal grid shapes table
diff --git a/src/modules_io/Makefile.in b/src/modules_io/Makefile.in
deleted file mode 100644
index 428049c..0000000
--- a/src/modules_io/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = db docs esri_e00 gps gdal grid shapes table
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/db/Makefile.am b/src/modules_io/db/Makefile.am
deleted file mode 100644
index e07756b..0000000
--- a/src/modules_io/db/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-if HAVE_POSTGRESQL
-if WITH_ODBC
-SUBDIRS = io_odbc io_pgsql
-else
-SUBDIRS = io_pgsql
-endif
-else
-if WITH_ODBC
-SUBDIRS = io_odbc
-else
-SUBDIRS =
-endif
-endif
diff --git a/src/modules_io/db/Makefile.in b/src/modules_io/db/Makefile.in
deleted file mode 100644
index 4884d28..0000000
--- a/src/modules_io/db/Makefile.in
+++ /dev/null
@@ -1,592 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/db
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = io_odbc io_pgsql
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at HAVE_POSTGRESQL_FALSE@@WITH_ODBC_FALSE at SUBDIRS = 
- at HAVE_POSTGRESQL_FALSE@@WITH_ODBC_TRUE at SUBDIRS = io_odbc
- at HAVE_POSTGRESQL_TRUE@@WITH_ODBC_FALSE at SUBDIRS = io_pgsql
- at HAVE_POSTGRESQL_TRUE@@WITH_ODBC_TRUE at SUBDIRS = io_odbc io_pgsql
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/db/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/db/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/db/io_odbc/MLB_Interface.cpp b/src/modules_io/db/io_odbc/MLB_Interface.cpp
deleted file mode 100644
index a323170..0000000
--- a/src/modules_io/db/io_odbc/MLB_Interface.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2004 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 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("Import/Export - ODBC/OTL") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O.Conrad (c) 2010") );
-
-	case MLB_INFO_Description:
-		return( _TW(
-			"Database access via Open Data Base Connection (ODBC) interface. "
-			"Based on the OTL (Oracle, Odbc and DB2-CLI Template Library), Version 4.0: "
-			"<a target=\"_blank\" href=\"http://otl.sourceforge.net/\">http://otl.sourceforge.net/</a>"
-		));
-
-	case MLB_INFO_Version:
-		return( _TL("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Database|ODBC") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "get_connection.h"
-#include "table.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  9:	return( new CGet_Servers );
-	case  0:	return( new CGet_Connection );
-	case  1:	return( new CDel_Connection );
-	case 11:	return( new CDel_Connections );
-	case  2:	return( new CTransaction );
-	case  3:	return( new CExecute_SQL );
-
-	case 10:	return( new CTable_List );
-	case  4:	return( new CTable_Info );
-	case  5:	return( new CTable_Load );
-	case  6:	return( new CTable_Save );
-	case  7:	return( new CTable_Drop );
-	case  8:	return( new CTable_Query );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-extern "C" _SAGA_DLL_EXPORT bool MLB_Finalize	(void)
-{
-	return( SG_ODBC_Get_Connection_Manager().Destroy() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE_CORE MLB_INTERFACE_INITIALIZE
-
-//}}AFX_SAGA
diff --git a/src/modules_io/db/io_odbc/MLB_Interface.h b/src/modules_io/db/io_odbc/MLB_Interface.h
deleted file mode 100644
index 6165afb..0000000
--- a/src/modules_io/db/io_odbc/MLB_Interface.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2004 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__io_odbc_H
-#define HEADER_INCLUDED__io_odbc_H
-
-//---------------------------------------------------------
-#include "odbc.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__io_odbc_H
diff --git a/src/modules_io/db/io_odbc/Makefile.am b/src/modules_io/db/io_odbc/Makefile.am
deleted file mode 100644
index 05907b2..0000000
--- a/src/modules_io/db/io_odbc/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $Id: Makefile.am 1828 2013-09-05 21:36:10Z manfred-e $
-#
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-DEP_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        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = $(DEP_LFLG) $(DEP_LIBS) -shared -lodbc -avoid-version
-pkglib_LTLIBRARIES = libio_odbc.la
-libio_odbc_la_SOURCES =\
-get_connection.cpp\
-MLB_Interface.cpp\
-odbc.cpp\
-table.cpp\
-get_connection.h\
-MLB_Interface.h\
-odbc.h\
-otlv4.h\
-table.h
-
-libio_odbc_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules_io/db/io_odbc/Makefile.in b/src/modules_io/db/io_odbc/Makefile.in
deleted file mode 100644
index c0ca353..0000000
--- a/src/modules_io/db/io_odbc/Makefile.in
+++ /dev/null
@@ -1,585 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/db/io_odbc
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_odbc_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_odbc_la_OBJECTS = get_connection.lo MLB_Interface.lo odbc.lo \
-	table.lo
-libio_odbc_la_OBJECTS = $(am_libio_odbc_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_odbc_la_SOURCES)
-DIST_SOURCES = $(libio_odbc_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1828 2013-09-05 21:36:10Z manfred-e $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@DEP_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 = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = $(DEP_LFLG) $(DEP_LIBS) -shared -lodbc -avoid-version
-pkglib_LTLIBRARIES = libio_odbc.la
-libio_odbc_la_SOURCES = \
-get_connection.cpp\
-MLB_Interface.cpp\
-odbc.cpp\
-table.cpp\
-get_connection.h\
-MLB_Interface.h\
-odbc.h\
-otlv4.h\
-table.h
-
-libio_odbc_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/db/io_odbc/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/db/io_odbc/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_odbc.la: $(libio_odbc_la_OBJECTS) $(libio_odbc_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_odbc_la_OBJECTS) $(libio_odbc_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_connection.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/odbc.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/db/io_odbc/get_connection.cpp b/src/modules_io/db/io_odbc/get_connection.cpp
deleted file mode 100644
index f8cdb29..0000000
--- a/src/modules_io/db/io_odbc/get_connection.cpp
+++ /dev/null
@@ -1,523 +0,0 @@
-/**********************************************************
- * Version $Id: get_connection.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Get_Connection.cpp                  //
-//                                                       //
-//                 Copyright (C) 2008 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "get_connection.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGet_Servers::CGet_Servers(void)
-{
-	Set_Name		(_TL("List ODBC Servers"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Lists all ODBC sources."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "SERVERS"		, _TL("Server"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CONNECTED"	, _TL("Only List Connected Servers"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-//---------------------------------------------------------
-bool CGet_Servers::On_Execute(void)
-{
-	bool		bConnected	= Parameters("CONNECTED")->asBool();
-	CSG_Table	*pServers	= Parameters("SERVERS"  )->asTable();
-
-	pServers->Destroy();
-	pServers->Set_Name(_TL("ODBC Servers"));
-
-	pServers->Add_Field(_TL("Server")   , SG_DATATYPE_String);
-	pServers->Add_Field(_TL("Connected"), SG_DATATYPE_Int);
-
-	CSG_Strings	Servers;
-
-	if( SG_ODBC_Get_Connection_Manager().Get_Servers(Servers) > 0 )
-	{
-		for(int i=0; i<Servers.Get_Count(); i++)
-		{
-			if( !bConnected || SG_ODBC_Get_Connection_Manager().Get_Connection(Servers[i]) )
-			{
-				CSG_Table_Record	*pServer	= pServers->Add_Record();
-
-				pServer->Set_Value(0, Servers[i]);
-				pServer->Set_Value(1, SG_ODBC_Get_Connection_Manager().Get_Connection(Servers[i]) ? 1 : 0);
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGet_Connection::CGet_Connection(void)
-{
-	Set_Name		(_TL("Connect to ODBC Source"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Connects to an ODBC source."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "SERVER"		, _TL("Server"),
-		_TL(""),
-		_TL("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "USERNAME"	, _TL("User"),
-		_TL(""),
-		_TL("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "PASSWORD"	, _TL("Password"),
-		_TL(""),
-		SG_T(""), false, true
-	);
-}
-
-//---------------------------------------------------------
-bool CGet_Connection::On_Before_Execution(void)
-{
-	CSG_String	Servers;
-
-	if( SG_ODBC_Get_Connection_Manager().Get_Servers(Servers) > 0 )
-	{
-		Parameters("SERVER")->asChoice()->Set_Items(Servers);
-
-		return( true );
-	}
-
-	Message_Dlg(
-		_TW("No ODBC server available!\n"
-			"Set up an ODBC server first."),
-		_TL("ODBC Database Connection Error")
-	);
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CGet_Connection::On_Execute(void)
-{
-	CSG_String	Server, User, Password;
-
-	Server		= Parameters("SERVER"  )->asString();
-	User		= Parameters("USERNAME")->asString();
-	Password	= Parameters("PASSWORD")->asString();
-
-	if( SG_ODBC_Get_Connection_Manager().Add_Connection(Server, User, Password) )
-	{
-		Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("ODBC source connected")));
-
-		SG_UI_ODBC_Update(Server);
-
-		return( true );
-	}
-
-	Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not connect ODBC source")));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CDel_Connection::CDel_Connection(void)
-{
-	Set_Name		(_TL("Disconnect from ODBC Source"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Disconnects an ODBC source connection."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TRANSACT"	, _TL("Transactions"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("rollback"),
-			_TL("commit")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-bool CDel_Connection::On_Execute(void)
-{
-	CSG_String	Server	= Get_Connection()->Get_Server();
-
-	if( SG_ODBC_Get_Connection_Manager().Del_Connection(Get_Connection(), Parameters("TRANSACT")->asInt() == 1) )
-	{
-		Message_Add(Server + ": " + _TL("ODBC source disconnected"));
-
-		SG_UI_ODBC_Update(Server);
-
-		return( true );
-	}
-
-	Message_Add(Server + ": " + _TL("could not disconnect ODBC source"));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CDel_Connections::CDel_Connections(void)
-{
-	Set_Name		(_TL("Disconnect All"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Disconnects all connected ODBC sources."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TRANSACT"	, _TL("Transactions"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("rollback"),
-			_TL("commit")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-bool CDel_Connections::On_Before_Execution(void)
-{
-	CSG_String	Servers;
-
-	if( SG_ODBC_Get_Connection_Manager().Get_Connections(Servers) > 0 )
-	{
-		return( true );
-	}
-
-	Message_Dlg(
-		_TL("No ODBC connection available!"),
-		_TL("ODBC Database Connection Error")
-	);
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CDel_Connections::On_Execute(void)
-{
-	bool	bCommit	= Parameters("TRANSACT")->asInt() == 1;
-
-	CSG_ODBC_Connections	&Manager	= SG_ODBC_Get_Connection_Manager();
-
-	for(int i=Manager.Get_Count()-1; i>=0; i--)
-	{
-		Manager.Del_Connection(i, bCommit);
-	}
-
-	return( Manager.Get_Count() == 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTransaction::CTransaction(void)
-{
-	Set_Name		(_TL("Commit/Rollback Transaction"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Execute a commit or rollback on open transactions with ODBC source."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "SERVERS"		, _TL("Server"),
-		_TL(""),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TRANSACT"	, _TL("Transactions"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("rollback"),
-			_TL("commit")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-bool CTransaction::On_Before_Execution(void)
-{
-	CSG_String	Servers;
-
-	if( SG_ODBC_Get_Connection_Manager().Get_Connections(Servers) > 0 )
-	{
-		Parameters("SERVERS")->asChoice()->Set_Items(Servers);
-
-		return( true );
-	}
-
-	Message_Dlg(
-		_TL("No ODBC connection available!"),
-		_TL("ODBC Database Connection Error")
-	);
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CTransaction::On_Execute(void)
-{
-	CSG_String	Server;
-
-	Server	= Parameters("SERVERS") ->asString();
-
-	CSG_ODBC_Connection	*pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(Server);
-
-	if( !pConnection )
-	{
-		return( false );
-	}
-
-	if( Parameters("TRANSACT")->asInt() == 1 )
-	{
-		if( pConnection->Commit() )
-		{
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("open transactions committed")));
-
-			SG_UI_ODBC_Update(Server);
-
-			return( true );
-		}
-	}
-	else
-	{
-		if( pConnection->Rollback() )
-		{
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("open transactions rollbacked")));
-
-			SG_UI_ODBC_Update(Server);
-
-			return( true );
-		}
-	}
-
-	Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not commit/rollback transactions.")));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CExecute_SQL::CExecute_SQL(void)
-{
-	Set_Name		(_TL("Execute SQL"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Execute SQL commands on a connected ODBC source. "
-		"Separate different commands with a semicolon (\';\'). "
-	));
-
-	Parameters.Add_String(
-		NULL	, "SQL"			, _TL("SQL Statment"),
-		_TL(""),
-		SG_T("CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);\n")
-		SG_T("INSERT INTO myTable1 (Col1, Col2) VALUES(\'First Value\', 1);\n")
-		SG_T("DROP TABLE myTable1;\n"),
-		true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "COMMIT"		, _TL("Commit"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "STOP"		, _TL("Stop on Error"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-//---------------------------------------------------------
-bool CExecute_SQL::On_Execute(void)
-{
-	if( !Get_Connection() )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	bool		bCommit	= Parameters("COMMIT")	->asBool  ();
-	bool		bStop	= Parameters("STOP")	->asBool  ();
-	CSG_String	SQL		= Parameters("SQL")		->asString();
-
-	//-----------------------------------------------------
-	if( SQL.Find(SG_T(';')) < 0 )
-	{
-		return( Get_Connection()->Execute(SQL, bCommit) );
-	}
-
-	//-----------------------------------------------------
-	int		nSuccess = 0, nErrors = 0;
-
-	SQL	+= SG_T(';');
-
-	do
-	{
-		CSG_String	s	= SQL.BeforeFirst(SG_T(';'));
-
-		s.Trim();
-
-		if( s.Length() > 0 )
-		{
-			Message_Add(s);
-
-			if( Get_Connection()->Execute(s, bCommit) )
-			{
-				nSuccess++;
-
-				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("okay")), false);
-			}
-			else
-			{
-				nErrors++;
-
-				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("failed")));
-
-				if( bStop )
-				{
-					return( false );
-				}
-			}
-		}
-
-		SQL	= SQL.AfterFirst(SG_T(';'));
-	}
-	while( SQL.Length() > 0 );
-
-	return( nErrors == 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_odbc/get_connection.h b/src/modules_io/db/io_odbc/get_connection.h
deleted file mode 100644
index 42c19c2..0000000
--- a/src/modules_io/db/io_odbc/get_connection.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/**********************************************************
- * Version $Id: get_connection.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Get_Connection.h                    //
-//                                                       //
-//                 Copyright (C) 2008 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Get_Connection_H
-#define HEADER_INCLUDED__Get_Connection_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGet_Servers : public CSG_Module
-{
-public:
-	CGet_Servers(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGet_Connection : public CSG_Module
-{
-public:
-	CGet_Connection(void);
-
-
-protected:
-
-	virtual bool				On_Before_Execution		(void);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CDel_Connection : public CSG_ODBC_Module
-{
-public:
-	CDel_Connection(void);
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CDel_Connections : public CSG_Module
-{
-public:
-	CDel_Connections(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Before_Execution		(void);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTransaction : public CSG_ODBC_Module
-{
-public:
-	CTransaction(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Before_Execution		(void);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CExecute_SQL : public CSG_ODBC_Module
-{
-public:
-	CExecute_SQL(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Get_Connection_H
diff --git a/src/modules_io/db/io_odbc/odbc.cpp b/src/modules_io/db/io_odbc/odbc.cpp
deleted file mode 100644
index 56c94c0..0000000
--- a/src/modules_io/db/io_odbc/odbc.cpp
+++ /dev/null
@@ -1,1654 +0,0 @@
-/**********************************************************
- * Version $Id: saga_odbc.cpp 1513 2012-11-06 08:33:32Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       odbc.cpp                        //
-//                                                       //
-//                 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "odbc.h"
-
-#include <stdio.h>
-#include <iostream>
-#include <string>
-
-using namespace std;
-
-//---------------------------------------------------------
-#define OTL_ODBC_MULTI_MODE
-
-#if defined(_SAGA_LINUX)
-	#define OTL_ODBC_UNIX
-#endif
-
-#if !defined(_SAGA_LINUX) && !defined(_SAGA_MSW)
-	#define OTL_ODBC_ALTERNATE_RPC
-	#define OTL_UNICODE
-
-	#if defined(__GNUC__)
-		namespace std
-		{
-			typedef unsigned short unicode_char;
-			typedef basic_string<unicode_char> unicode_string;
-		}
-
-		#define OTL_UNICODE_CHAR_TYPE	unicode_char
-		#define OTL_UNICODE_STRING_TYPE	unicode_string
-	#else
-		#define OTL_UNICODE_CHAR_TYPE	wchar_t
-		#define OTL_UNICODE_STRING_TYPE	wstring
-	#endif
-
-	#define std_string	std::wstring
-#else
-	#if defined(_UNICODE) || defined(UNICODE)
-		#undef _UNICODE
-		#undef UNICODE
-	#endif
-
-	#define OTL_ANSI_CPP			// Turn on ANSI C++ typecasts
-	#define OTL_STL					// Turn on STL features
-	#define std_string	std::string
-#endif
-
-#if defined(UNICODE)
-	#define SG_ODBC_CHAR	wchar_t
-#else
-	#define SG_ODBC_CHAR	char
-#endif
-
-#include "otlv4.h"				// include the OTL 4 header file
-
-//---------------------------------------------------------
-#include <sql.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_ODBC_Connections	g_Connections;
-
-//---------------------------------------------------------
-CSG_ODBC_Connections &	SG_ODBC_Get_Connection_Manager(void)
-{
-	return( g_Connections );
-}
-
-//---------------------------------------------------------
-bool SG_ODBC_is_Supported(void)
-{
-	return( true );
-}
-
-//---------------------------------------------------------
-void _Error_Message(const CSG_String &Message, const CSG_String &Additional = SG_T(""))
-{
-	SG_UI_Msg_Add_Execution(Message, true, SG_UI_MSG_STYLE_FAILURE);
-
-	CSG_String	s(Message);
-
-	s	+= SG_T(":\n");
-
-	if( Additional.Length() > 0 )
-	{
-		s	+= Additional;
-		s	+= SG_T("\n");
-	}
-
-	SG_UI_Msg_Add_Error(s);
-}
-
-void _Error_Message(otl_exception &e)
-{
-	CSG_String	s;
-
-	if( e.stm_text && *e.stm_text != '\0' )
-	{
-		s	= (const char *)e.stm_text;
-
-		if( e.var_info && *e.var_info != '\0' )
-		{
-			s	+= SG_T(" [");
-			s	+= (const char *)e.var_info;
-			s	+= SG_T("]");
-		}
-	}
-
-	_Error_Message((const char *)e.msg, s);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define m_Connection	(*((otl_connect *)m_pConnection))
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_ODBC_Connection::CSG_ODBC_Connection(const CSG_String &Server, const CSG_String &User, const CSG_String &Password, bool bAutoCommit)
-{
-	CSG_String	s;
-
-	m_DBMS			= SG_ODBC_DBMS_Unknown;
-	m_Size_Buffer	= 1;
-	m_bAutoCommit	= bAutoCommit;
-
-	if( User.Length() > 0 )
-	{
-		s	+= SG_T("UID=") + User     + SG_T(";");
-		s	+= SG_T("PWD=") + Password + SG_T(";");
-	}
-
-	s	+= SG_T("DSN=") + Server   + SG_T(";");
-
-	m_pConnection	= new otl_connect();
-
-	try
-	{
-		m_Connection.rlogon(s, m_bAutoCommit ? 1 : 0);
-	}
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-	}
-
-	//-----------------------------------------------------
-	if( !m_Connection.connected )
-	{
-		delete(((otl_connect *)m_pConnection));
-
-		m_pConnection	= NULL;
-	}
-	else
-	{
-		m_DSN	= Server;
-
-		//-------------------------------------------------
-		s		= Get_DBMS_Name();
-
-		if(      !s.CmpNoCase(SG_T("PostgreSQL")) )
-		{
-			m_DBMS	= SG_ODBC_DBMS_PostgreSQL;
-		}
-		else if( !s.CmpNoCase(SG_T("MySQL")) )
-		{
-			m_DBMS	= SG_ODBC_DBMS_MySQL;
-		}
-		else if( !s.CmpNoCase(SG_T("Oracle")) )
-		{
-			m_DBMS	= SG_ODBC_DBMS_Oracle;
-		}
-		else if( !s.CmpNoCase(SG_T("MSQL")) )
-		{
-			m_DBMS	= SG_ODBC_DBMS_MSSQLServer;
-		}
-		else if( !s.CmpNoCase(SG_T("ACCESS")) )
-		{
-			m_DBMS	= SG_ODBC_DBMS_Access;
-		}
-
-		//-------------------------------------------------
-		Set_Size_Buffer(is_Access() ? 1 : 50);
-
-		Set_Size_LOB_Max(4 * 32767);
-	}
-}
-
-//---------------------------------------------------------
-CSG_ODBC_Connection::~CSG_ODBC_Connection(void)
-{
-	if( is_Connected() )
-	{
-		delete(((otl_connect *)m_pConnection));
-
-		m_pConnection	= NULL;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Set_Size_Buffer(int Size)
-{
-	if( Size > 0 )
-	{
-		m_Size_Buffer	= Size;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-int CSG_ODBC_Connection::Get_Size_LOB_Max(void)	const
-{
-	return( is_Connected() ? m_Connection.get_max_long_size() : 0 );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Set_Size_LOB_Max(int Size)
-{
-	if( is_Connected() && Size > 0 )
-	{
-		m_Connection.set_max_long_size(Size);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CSG_ODBC_Connection::_Get_DBMS_Info(int What) const
-{
-	CSG_String	Result;
-
-	if( is_Connected() )
-	{
-		SQLSMALLINT	nBuffer;
-		SQLTCHAR	Buffer[256];
-
-		SQLGetInfo(m_Connection.get_connect_struct().get_hdbc(), What, (SQLPOINTER)Buffer, 255, &nBuffer);
-
-		Result	= (const SG_ODBC_CHAR *)Buffer;
-	}
-
-	return( Result );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_ODBC_Connection::Get_DBMS_Name(void) const
-{
-	return( _Get_DBMS_Info(SQL_DBMS_NAME) );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_ODBC_Connection::Get_DBMS_Version(void) const
-{
-	return( _Get_DBMS_Info(SQL_DBMS_VER) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSG_ODBC_Connection::Get_Tables(CSG_Strings &Tables) const
-{
-	Tables.Clear();
-
-	if( is_Connected() )
-	{
-		try
-		{
-			otl_stream	Stream(m_Size_Buffer, "$SQLTables", m_Connection);	// get a list of all tables in the current database.
-
-			while( !Stream.eof() )
-			{
-				std_string	Catalog, Schema, Table, Type, Remarks;
-
-				Stream >> Catalog >> Schema >> Table >> Type >> Remarks;
-
-				Tables	+= Table.c_str();
-			}
-		}
-		catch( otl_exception &e )
-		{
-			_Error_Message(e);
-		}
-	}
-
-	return( Tables.Get_Count() );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_ODBC_Connection::Get_Tables(void) const
-{
-	CSG_String	Tables;
-
-	if( is_Connected() )
-	{
-		try
-		{
-			otl_stream	Stream(m_Size_Buffer, "$SQLTables", m_Connection);	// get a list of all tables in the current database.
-
-			while( !Stream.eof() )
-			{
-				std_string	Catalog, Schema, Table, Type, Remarks;
-
-				Stream >> Catalog >> Schema >> Table >> Type >> Remarks;
-
-				Tables	+= Table.c_str();
-				Tables	+= SG_T("|");
-			}
-		}
-		catch( otl_exception &e )
-		{
-			_Error_Message(e);
-		}
-	}
-
-	return( Tables );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Exists(const CSG_String &Table_Name) const
-{
-	if( is_Connected() )
-	{
-		try
-		{
-			otl_stream	Stream(m_Size_Buffer, "$SQLTables", m_Connection);	// get a list of all tables in the current database.
-
-			while( !Stream.eof() )
-			{
-				std_string	Catalog, Schema, Table, Type, Remarks;
-
-				Stream >> Catalog >> Schema >> Table >> Type >> Remarks;
-
-				if( !Table_Name.Cmp(CSG_String(Table.c_str())) )
-				{
-					return( true );
-				}
-			}
-		}
-		catch( otl_exception &e )
-		{
-			_Error_Message(e);
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-CSG_Table CSG_ODBC_Connection::Get_Field_Desc(const CSG_String &Table_Name) const
-{
-	CSG_Table	Fields;
-
-	Fields.Set_Name(CSG_String::Format(SG_T("%s [%s]"), Table_Name.c_str(), _TL("Field Description")));
-
-	if( is_Connected() )
-	{
-		try
-		{
-			int				i, n;
-			std_string		s;
-			otl_column_desc	*desc;
-			otl_stream		Stream;
-
-			Stream.set_all_column_types(otl_all_num2str|otl_all_date2str);
-
-			Stream.open(m_Size_Buffer, CSG_String::Format(SG_T("$SQLColumns $3:'%s'"), Table_Name.c_str()), m_Connection);	// get a list of all columns.
-
-			desc	= Stream.describe_select(n);
-
-			for(i=0; i<n; i++)
-			{
-				Fields.Add_Field(CSG_String(desc[i].name), SG_DATATYPE_String);
-			}
-
-			while( !Stream.eof() )
-			{
-				CSG_Table_Record	*pField	= Fields.Add_Record();
-
-				for(i=0; i<n; i++)
-				{
-					Stream >> s;
-
-					pField->Set_Value(i, CSG_String(s.c_str()));
-				}
-			}
-		}
-		catch( otl_exception &e )
-		{
-			_Error_Message(e);
-		}
-	}
-
-	return( Fields );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_ODBC_Connection::Get_Field_Names(const CSG_String &Table_Name) const
-{
-	CSG_Table	Fields	= Get_Field_Desc(Table_Name);
-
-	CSG_String	Names;
-
-	for(int i=0; i<Fields.Get_Count(); i++)
-	{
-		Names	+= Fields[i].asString(3);
-		Names	+= SG_T("|");
-	}
-
-	return( Names );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSG_ODBC_Connection::_Get_Type_To_SQL(TSG_Data_Type Type)
-{
-	switch( Type )
-	{
-	case SG_DATATYPE_String:	return( otl_var_char   );		// strings
-
-	case SG_DATATYPE_Color:
-	case SG_DATATYPE_Char:
-	case SG_DATATYPE_Short:
-	case SG_DATATYPE_Int:
-	case SG_DATATYPE_Long:		return( otl_var_int    );		// non-floating point numbers
-
-	case SG_DATATYPE_Float:		return( otl_var_float  );		// 32-bit floating point numbers
-	case SG_DATATYPE_Double:	return( otl_var_double );		// 64-bit floating point numbers
-
-	case SG_DATATYPE_Date:		return( otl_var_char );			// dates
-
-	case SG_DATATYPE_Binary:	return( otl_var_varchar_long );	// binary
-	}
-
-	return( -1 );
-}
-
-//---------------------------------------------------------
-TSG_Data_Type CSG_ODBC_Connection::_Get_Type_From_SQL(int Type)
-{
-	switch( Type )
-	{
-	case otl_var_char:			return( SG_DATATYPE_String );	//  1 | null terminated string
-	case otl_var_short:			return( SG_DATATYPE_Short  );	//  6 | signed 16-bit integer
-	case otl_var_int:			return( SG_DATATYPE_Int    );	//  4 | signed 32-bit integer
-	case otl_var_unsigned_int:	return( SG_DATATYPE_DWord  );	//  5 | unsigned 32-bit integer
-	case otl_var_long_int:		return( SG_DATATYPE_Long   );	//  7 | signed 32-bit integer (for 32-bit, and LLP64 C++ compilers), signed 64-bit integer (for LP-64 C++ compilers)
-	case otl_var_bigint:		return( SG_DATATYPE_Long   );	// 20 | MS SQL Server, DB2, MySQL, PostgreSQL, etc. BIGINT (signed 64-bit integer) type
-	case otl_var_float:			return( SG_DATATYPE_Float  );	//  3 | 4-byte floating point number
-	case otl_var_double:		return( SG_DATATYPE_Double );	//  2 | 8-byte floating point number
-
-	case otl_var_db2date:		return( SG_DATATYPE_String );	// 17 | DB2 DATE data type
-	case otl_var_db2time:		return( SG_DATATYPE_String );	// 16 | DB2 TIME data type
-	case otl_var_ltz_timestamp:	return( SG_DATATYPE_String );	// 19 | Oracle 9i/10g/11g TIMESTAMP WITH LOCAL TIME ZONE type
-	case otl_var_timestamp:		return( SG_DATATYPE_String );	//  8 | data type that is mapped into Oracle date/timestamp, DB2 timestamp, MS SQL datetime/datetime2/time/date, Sybase timestamp, etc.
-	case otl_var_tz_timestamp:	return( SG_DATATYPE_String );	// 18 | Oracle timestamp with timezone type
-
-	case otl_var_varchar_long:	return( SG_DATATYPE_String );	//  9 | data type that is mapped into LONG in Oracle 7/8/9/10/11, TEXT in MS SQL Server and Sybase, CLOB in DB2
-	case otl_var_raw:			return( SG_DATATYPE_Binary );	// 23 | RAW, BINARY, VARBINARY, BYTEA, VARCHAR BYTE, CHAR BYTE, etc.
-	case otl_var_raw_long:		return( SG_DATATYPE_Binary );	// 10 | data type that is mapped into LONG RAW in Oracle, IMAGE in MS SQL Server and Sybase, BLOB in DB2
-	case otl_var_clob:			return( SG_DATATYPE_Binary );	// 11 | data type that is mapped into CLOB in Oracle 8/9/10/11
-	case otl_var_blob:			return( SG_DATATYPE_Binary );	// 12 | data type that is mapped into BLOB in Oracle 8/9/10/11
-	}
-
-	return( SG_DATATYPE_Undefined );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Execute(const CSG_String &SQL, bool bCommit)
-{
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	try
-	{
-		m_Connection.direct_exec(SQL);
-
-		return( bCommit ? Commit() : true );
-
-	//	if( m_Connection.direct_exec(SQL) >= 0 )
-	//	{
-	//		return( bCommit ? Commit() : true );
-	//	}
-
-	//	_Error_Message(_TL("sql excution error"), SQL);
-	}
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-void CSG_ODBC_Connection::Set_Auto_Commit(bool bOn)
-{
-	if( is_Connected() && m_bAutoCommit != bOn )
-	{
-		m_bAutoCommit	= bOn;
-
-		if( bOn )
-		{
-			m_Connection.auto_commit_on();
-		}
-		else
-		{
-			m_Connection.auto_commit_off();
-		}
-	}
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Commit(void)
-{
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	try
-	{
-		m_Connection.commit();
-
-		return( true );
-	}
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Rollback(void)
-{
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	try
-	{
-		m_Connection.rollback();
-
-		return( true );
-	}
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
-{
-	if( Table.Get_Field_Count() <= 0 )
-	{
-		_Error_Message(_TL("no attributes in table"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			iField;
-	CSG_String	SQL;
-
-	SQL.Printf(SG_T("CREATE TABLE \"%s\"("), Table_Name.c_str());
-
-	for(iField=0; iField<Table.Get_Field_Count(); iField++)
-	{
-		CSG_String	s;
-
-		switch( Table.Get_Field_Type(iField) )
-		{
-		default:
-		case SG_DATATYPE_String:
-			s	= CSG_String::Format(SG_T("VARCHAR(%d)"), Table.Get_Field_Length(iField));
-			break;
-
-		case SG_DATATYPE_Char:
-			s	= SG_T("SMALLINT");
-			break;
-
-		case SG_DATATYPE_Short:
-			s	= SG_T("SMALLINT");
-			break;
-
-		case SG_DATATYPE_Int:
-			s	= SG_T("INT");
-			break;
-
-		case SG_DATATYPE_Color:
-			s	= SG_T("INT");
-			break;
-
-		case SG_DATATYPE_Long:
-			s	= SG_T("INT");
-			break;
-
-		case SG_DATATYPE_Float:
-			s	= SG_T("FLOAT");
-			break;
-
-		case SG_DATATYPE_Double:
-			s	= is_PostgreSQL()	? SG_T("DOUBLE PRECISION")
-				: SG_T("DOUBLE");
-			break;
-
-		case SG_DATATYPE_Binary:
-			s	= is_PostgreSQL()	? SG_T("BYTEA")
-				: is_Access()		? SG_T("IMAGE")
-				: SG_T("VARBINARY");
-			break;
-		}
-
-		//-------------------------------------------------
-		char	Flag	= (int)Flags.Get_Size() == Table.Get_Field_Count() ? Flags[iField] : 0;
-
-		if( (Flag & SG_ODBC_PRIMARY_KEY) == 0 )
-		{
-			if( (Flag & SG_ODBC_UNIQUE) != 0 )
-			{
-				s	+= SG_T(" UNIQUE");
-			}
-
-			if( (Flag & SG_ODBC_NOT_NULL) != 0 )
-			{
-				s	+= SG_T(" NOT NULL");
-			}
-		}
-
-		//-------------------------------------------------
-		if( iField > 0 )
-		{
-			SQL	+= SG_T(", ");
-		}
-
-		SQL	+= CSG_String::Format(SG_T("%s %s"), Table.Get_Field_Name(iField), s.c_str());
-	}
-
-	//-----------------------------------------------------
-	if( (int)Flags.Get_Size() == Table.Get_Field_Count() )
-	{
-		CSG_String	s;
-
-		for(iField=0; iField<Table.Get_Field_Count(); iField++)
-		{
-			if( (Flags[iField] & SG_ODBC_PRIMARY_KEY) != 0 )
-			{
-				s	+= s.Length() == 0 ? SG_T(", PRIMARY KEY(") : SG_T(", ");
-				s	+= Table.Get_Field_Name(iField);
-			}
-		}
-
-		if( s.Length() > 0 )
-		{
-			SQL	+= s + SG_T(")");
-		}
-	}
-
-	//-----------------------------------------------------
-	SQL	+= SG_T(")");
-
-	//-----------------------------------------------------
-	return( Execute(SQL, bCommit) );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Drop(const CSG_String &Table_Name, bool bCommit)
-{
-	if( !Table_Exists(Table_Name) )
-	{
-		_Error_Message(_TL("database table does not exist"));
-
-		return( false );
-	}
-
-	return( Execute(CSG_String::Format(SG_T("DROP TABLE \"%s\""), Table_Name.c_str()), bCommit) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Table &Table, bool bCommit)
-{
-	//-----------------------------------------------------
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	if( !Table_Exists(Table_Name) )
-	{
-		return( false );
-	}
-
-	CSG_Table	Fields	= Get_Field_Desc(Table_Name);
-
-	if( Fields.Get_Count() != Table.Get_Field_Count() )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	try
-	{
-		bool	bLOB	= false;
-
-		int				iField, iRecord;
-		CSG_String		Insert;
-		otl_stream		Stream;
-
-		//-------------------------------------------------
-		Insert.Printf(SG_T("INSERT INTO %s VALUES("), Table_Name.c_str());
-
-		for(iField=0; iField<Table.Get_Field_Count(); iField++)
-		{
-			if( iField > 0 )
-			{
-				Insert	+= SG_T(",");
-			}
-
-			Insert	+= CSG_String::Format(SG_T(":f%d"), 1 + iField);
-
-			switch( Table.Get_Field_Type(iField) )
-			{
-			default:
-			case SG_DATATYPE_String:	Insert	+= SG_T("<varchar>");	break;
-			case SG_DATATYPE_Date:		Insert	+= SG_T("<char[12]>");	break;
-			case SG_DATATYPE_Char:		Insert	+= SG_T("<char>");		break;
-			case SG_DATATYPE_Short:		Insert	+= SG_T("<short>");		break;
-			case SG_DATATYPE_Int:		Insert	+= SG_T("<int>");		break;
-			case SG_DATATYPE_Color:		Insert	+= SG_T("<long>");		break;
-			case SG_DATATYPE_Long:		Insert	+= SG_T("<long>");		break;
-			case SG_DATATYPE_Float:		Insert	+= SG_T("<float>");		break;
-			case SG_DATATYPE_Double:	Insert	+= SG_T("<double>");	break;
-			}
-		}
-
-		Insert	+= SG_T(")");
-
-		Stream.set_all_column_types(otl_all_date2str);
-		Stream.set_lob_stream_mode(bLOB);
-		Stream.open(bLOB ? 1 : m_Size_Buffer, Insert, m_Connection);
-
-		std_string	valString;
-
-		//-------------------------------------------------
-		for(iRecord=0; iRecord<Table.Get_Count() && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
-		{
-			CSG_Table_Record	*pRecord	= Table.Get_Record(iRecord);
-
-			for(iField=0; iField<Table.Get_Field_Count(); iField++)
-			{
-				if( pRecord->is_NoData(iField) )
-				{
-					Stream << otl_null();
-				}
-				else switch( Table.Get_Field_Type(iField) )
-				{
-				default:
-				case SG_DATATYPE_String:
-				case SG_DATATYPE_Date:
-					valString	= CSG_String(pRecord->asString(iField));
-					Stream << valString;
-					break;
-
-				case SG_DATATYPE_Char:		Stream << (char)pRecord->asChar  (iField);	break;
-				case SG_DATATYPE_Short:		Stream <<       pRecord->asShort (iField);	break;
-				case SG_DATATYPE_Int:		Stream <<       pRecord->asInt   (iField);	break;
-				case SG_DATATYPE_Color:
-				case SG_DATATYPE_Long:		Stream << (long)pRecord->asInt   (iField);	break;
-				case SG_DATATYPE_Float:		Stream <<       pRecord->asFloat (iField);	break;
-				case SG_DATATYPE_Double:	Stream <<       pRecord->asDouble(iField);	break;
-				}
-			}
-		}
-	}
-	//-----------------------------------------------------
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-
-		return( false );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Save(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
-{
-	//-----------------------------------------------------
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	if( Table_Exists(Table_Name) && !Table_Drop(Table_Name, bCommit) )
-	{
-		return( false );
-	}
-
-	if( !Table_Create(Table_Name, Table, Flags, bCommit) )
-	{
-		return( false );
-	}
-
-	if( !Table_Insert(Table_Name, Table, bCommit) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::_Table_Load(CSG_Table &Table, const CSG_String &Select, const CSG_String &Name, bool bLOB)
-{
-	//-----------------------------------------------------
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	try
-	{
-		int				valInt, iField, nFields;
-		long			valLong;
-		float			valFloat;
-		double			valDouble;
-		std_string		valString;
-		otl_long_string	valRaw(m_Connection.get_max_long_size());
-		otl_column_desc	*Fields;
-		otl_stream		Stream;
-		CSG_Bytes		BLOB;
-
-		Stream.set_all_column_types	(otl_all_date2str);
-		Stream.set_lob_stream_mode	(bLOB);
-		Stream.open					(bLOB ? 1 : m_Size_Buffer, Select, m_Connection);
-
-		Fields	= Stream.describe_select(nFields);
-
-		if( Fields == NULL || nFields <= 0 )
-		{
-			_Error_Message(_TL("no fields in selection"));
-
-			return( false );
-		}
-
-		//-------------------------------------------------
-		Table.Destroy();
-		Table.Set_Name(Name);
-
-		for(iField=0; iField<nFields; iField++)
-		{
-			if( _Get_Type_From_SQL(Fields[iField].otl_var_dbtype) == SG_DATATYPE_Undefined )
-			{
-				return( false );
-			}
-
-			Table.Add_Field(Fields[iField].name, _Get_Type_From_SQL(Fields[iField].otl_var_dbtype));
-		}
-
-		//-------------------------------------------------
-		while( !Stream.eof() && SG_UI_Process_Get_Okay() )	// while not end-of-data
-		{
-			CSG_Table_Record	*pRecord	= Table.Add_Record();
-
-			for(iField=0; iField<nFields; iField++)
-			{
-				switch( Table.Get_Field_Type(iField) )
-				{
-				case SG_DATATYPE_String:	Stream >> valString; if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, CSG_String(valString.c_str()));	break;
-				case SG_DATATYPE_Short:			
-				case SG_DATATYPE_Int:		Stream >> valInt;    if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valInt);		break;
-				case SG_DATATYPE_DWord:
-				case SG_DATATYPE_Long:		Stream >> valLong;   if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valLong);		break;
-				case SG_DATATYPE_Float:		Stream >> valFloat;  if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valFloat);		break;
-				case SG_DATATYPE_Double:	Stream >> valDouble; if( Stream.is_null() ) pRecord->Set_NoData(iField); else pRecord->Set_Value(iField, valDouble);	break;
-				case SG_DATATYPE_Binary:	Stream >> valRaw;    if( Stream.is_null() ) pRecord->Set_NoData(iField); else
-					{
-						BLOB.Clear();
-
-						for(int i=0; i<valRaw.len(); i++)
-						{
-							BLOB.Add((BYTE)valRaw[i]);
-						}
-
-						pRecord->Set_Value(iField, BLOB);
-					}
-					break;
-				}
-			}
-		}
-	}
-	//-----------------------------------------------------
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-
-		return( false );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Load(CSG_Table &Table, const CSG_String &Table_Name, bool bLOB)
-{
-	return( _Table_Load(Table, CSG_String::Format(SG_T("SELECT * FROM \"%s\""), Table_Name.c_str()), Table_Name, bLOB) );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Load(CSG_Table &Table, const CSG_String &Tables, const CSG_String &Fields, const CSG_String &Where, const CSG_String &Group, const CSG_String &Having, const CSG_String &Order, bool bDistinct, bool bLOB)
-{
-	CSG_String	Select;
-
-	Select.Printf(SG_T("SELECT %s %s FROM %s"), bDistinct ? SG_T("DISTINCT") : SG_T("ALL"), Fields.c_str(), Tables.c_str());
-
-	if( Where.Length() )
-	{
-		Select	+= SG_T(" WHERE ") + Where;
-	}
-
-	if( Group.Length() )
-	{
-		Select	+= SG_T(" GROUP BY ") + Group;
-
-		if( Having.Length() )
-		{
-			Select	+= SG_T(" HAVING ") + Having;
-		}
-	}
-
-	if( Order.Length() )
-	{
-		Select	+= SG_T(" ORDER BY ") + Order;
-	}
-
-	return( _Table_Load(Table, Select, Table.Get_Name(), bLOB) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connection::Table_Load_BLOBs(CSG_Bytes_Array &BLOBs, const CSG_String &Table_Name, const CSG_String &Field, const CSG_String &Where, const CSG_String &Order)
-{
-	//-----------------------------------------------------
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	try
-	{
-		bool			bLOB	= true;
-		int				nFields;
-		otl_column_desc	*Fields;
-		otl_long_string	valRaw(m_Connection.get_max_long_size());
-		otl_stream		Stream;
-		CSG_String		Select;
-
-		//-------------------------------------------------
-		Select.Printf(SG_T("SELECT %s FROM %s"), Field.c_str(), Table_Name.c_str());
-
-		if( Where.Length() )
-		{
-			Select	+= SG_T(" WHERE ") + Where;
-		}
-
-		if( Order.Length() )
-		{
-			Select	+= SG_T(" ORDER BY ") + Order;
-		}
-
-		//-------------------------------------------------
-		Stream.set_lob_stream_mode	(bLOB);
-		Stream.open					(bLOB ? 1 : m_Size_Buffer, Select, m_Connection);
-
-		Fields	= Stream.describe_select(nFields);
-
-		if( Fields == NULL || nFields <= 0 )
-		{
-			_Error_Message(_TL("no fields in selection"));
-
-			return( false );
-		}
-
-		if( nFields != 1 )
-		{
-			_Error_Message(_TL("more than one field in selection"));
-
-			return( false );
-		}
-
-		if( _Get_Type_From_SQL(Fields[0].otl_var_dbtype) != SG_DATATYPE_Binary )//|| _Get_Type_From_SQL(Fields[0].otl_var_dbtype) != SG_DATATYPE_String )
-		{
-			_Error_Message(_TL("field cannot be mapped to binary object"));
-
-			return( false );
-		}
-
-		//-------------------------------------------------
-		BLOBs.Destroy();
-
-		while( !Stream.eof() && SG_UI_Process_Get_Okay() )	// while not end-of-data
-		{
-			CSG_Bytes	*pBLOB	= BLOBs.Add();
-
-			Stream >> valRaw;
-
-			if( !Stream.is_null() )
-			{
-				for(int i=0; i<valRaw.len(); i++)
-				{
-					pBLOB->Add((BYTE)valRaw[i]);
-				}
-			}
-		}
-	}
-	//-----------------------------------------------------
-	catch( otl_exception &e )
-	{
-		_Error_Message(e);
-
-		return( false );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_ODBC_Connections::CSG_ODBC_Connections(void)
-{
-	otl_connect::otl_initialize(); // initialize ODBC environment
-
-	m_hEnv			= SQL_NULL_HENV;
-	m_nConnections	= 0;
-	m_pConnections	= NULL;
-
-	Create();
-}
-
-//---------------------------------------------------------
-CSG_ODBC_Connections::~CSG_ODBC_Connections(void)
-{
-	Destroy();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connections::Create(void)
-{
-	Destroy();
-
-#if ODBCVER >= 0x0300
-	SQLRETURN	r	= SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_hEnv);
-#else
-	SQLRETURN	r	= SQLAllocEnv(&henv_);
-#endif
-
-	if( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO )
-	{
-		SG_UI_Msg_Add_Error(SG_T("Failed to allocate environment handle"));
-
-		return( false );
-	}
-
-#if ODBCVER >= 0x0300
-	// this should immediately follow an AllocEnv per ODBC3
-	SQLSetEnvAttr(m_hEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_UINTEGER);
-#endif
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connections::Destroy(void)
-{
-	if( m_pConnections )
-	{
-		for(int i=0; i<m_nConnections; i++)
-		{
-			delete(m_pConnections[i]);
-		}
-
-		SG_Free(m_pConnections);
-
-		m_nConnections	= 0;
-		m_pConnections	= NULL;
-	}
-
-	if( m_hEnv != SQL_NULL_HENV )
-	{
-#if ODBCVER >= 0x0300
-		SQLRETURN	r	= SQLFreeHandle(SQL_HANDLE_ENV, m_hEnv);
-#else
-		SQLRETURN	r	= SQLFreeEnv(m_hEnv);
-#endif
-
-		if( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO )
-		{
-			SG_UI_Msg_Add_Error(SG_T("Failed to close ODBC connection."));
-		}
-
-		m_hEnv	= SQL_NULL_HENV;
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_ODBC_Connection * CSG_ODBC_Connections::Add_Connection(const CSG_String &Server, const CSG_String &User, const CSG_String &Password)
-{
-	CSG_ODBC_Connection	*pConnection	= new CSG_ODBC_Connection(Server, User, Password);
-
-	if( pConnection )
-	{
-		if( pConnection->is_Connected() )
-		{
-			m_pConnections	= (CSG_ODBC_Connection **)SG_Realloc(m_pConnections, (m_nConnections + 1) * sizeof(CSG_ODBC_Connection *));
-
-			m_pConnections[m_nConnections++]	= pConnection;
-		}
-		else
-		{
-			delete(pConnection);
-
-			pConnection	= NULL;
-		}
-	}
-
-	return( pConnection );
-}
-
-//---------------------------------------------------------
-CSG_ODBC_Connection *  CSG_ODBC_Connections::Get_Connection(const CSG_String &Server)
-{
-	for(int i=0; i<m_nConnections; i++)
-	{
-		if( m_pConnections[i]->Get_Server().Cmp(Server) == 0 )
-		{
-			return( m_pConnections[i] );
-		}
-	}
-
-	return( NULL );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Connections::Del_Connection(int Index, bool bCommit)
-{
-	if( Index >= 0 && Index < m_nConnections )
-	{
-		if( bCommit )
-		{
-			m_pConnections[Index]->Commit();
-		}
-		else
-		{
-			m_pConnections[Index]->Rollback();
-		}
-
-		delete(m_pConnections[Index]);
-
-		for(m_nConnections--; Index<m_nConnections; Index++)
-		{
-			m_pConnections[Index]	= m_pConnections[Index + 1];
-		}
-
-		m_pConnections	= (CSG_ODBC_Connection **)SG_Realloc(m_pConnections, m_nConnections * sizeof(CSG_ODBC_Connection *));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-bool CSG_ODBC_Connections::Del_Connection(const CSG_String &Server, bool bCommit)
-{
-	for(int i=0; i<m_nConnections; i++)
-	{
-		if( m_pConnections[i]->Get_Server().Cmp(Server) == 0 )
-		{
-			return( Del_Connection(i, bCommit) );
-		}
-	}
-
-	return( false );
-}
-
-bool CSG_ODBC_Connections::Del_Connection(CSG_ODBC_Connection *pConnection, bool bCommit)
-{
-	return( !pConnection ? false : Del_Connection(pConnection->Get_Server(), bCommit) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Strings CSG_ODBC_Connections::Get_Servers(void)
-{
-	CSG_Strings	Servers;
-
-	SQLRETURN	r;
-	SQLSMALLINT	dsnlen, dsclen;
-	SQLTCHAR	dsn[SQL_MAX_DSN_LENGTH + 1], dsc[256];
-
-	r	= SQLDataSources(m_hEnv, SQL_FETCH_FIRST,
-			(SQLTCHAR *)dsn, SQL_MAX_DSN_LENGTH + 1, &dsnlen,
-			(SQLTCHAR *)dsc, 256,                    &dsclen
-		);
-
-	if( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO )
-	{
-		SG_UI_Msg_Add_Error(SG_T("Unable to retrieve data source names!"));
-	}
-	else
-	{
-		do
-		{
-			Servers	+= CSG_String((const SG_ODBC_CHAR *)dsn);
-
-			r	= SQLDataSources(m_hEnv, SQL_FETCH_NEXT,
-					(SQLTCHAR *)dsn, SQL_MAX_DSN_LENGTH + 1, &dsnlen,
-					(SQLTCHAR *)dsc, 256,                    &dsclen
-				);
-		}
-		while( r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO );
-	}
-
-	return( Servers );
-}
-
-//---------------------------------------------------------
-int CSG_ODBC_Connections::Get_Servers(CSG_Strings &Servers)
-{
-	Servers	= Get_Servers();
-
-	return( Servers.Get_Count() );
-}
-
-//---------------------------------------------------------
-int CSG_ODBC_Connections::Get_Servers(CSG_String &Servers)
-{
-	CSG_Strings		s	= Get_Servers();
-
-	for(int i=0; i<s.Get_Count(); i++)
-	{
-		Servers	+= s[i] + SG_T("|");
-	}
-
-	return( s.Get_Count() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Strings CSG_ODBC_Connections::Get_Connections(void)
-{
-	CSG_Strings		Connections;
-
-	for(int i=0; i<m_nConnections; i++)
-	{
-		Connections.Add(m_pConnections[i]->Get_Server());
-	}
-
-	return( Connections );
-}
-
-//---------------------------------------------------------
-int CSG_ODBC_Connections::Get_Connections(CSG_String &Connections)
-{
-	CSG_Strings		s	= Get_Connections();
-
-	Connections.Clear();
-
-	for(int i=0; i<s.Get_Count(); i++)
-	{
-		Connections	+= CSG_String::Format(SG_T("%s|"), s[i].c_str());
-	}
-
-	return( s.Get_Count() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_ODBC_Module::CSG_ODBC_Module(void)
-{
-	if( !SG_UI_Get_Window_Main() )
-	{
-		Parameters.Add_String(
-			NULL	, "ODBC_DSN"	, _TL("DSN"),
-			_TL("Data Source Name"),
-			SG_T("")
-		);
-
-		Parameters.Add_String(
-			NULL	, "ODBC_USR"	, _TL("User"),
-			_TL("User Name"),
-			SG_T("")
-		);
-
-		Parameters.Add_String(
-			NULL	, "ODBC_PWD"	, _TL("Password"),
-			_TL("Password"),
-			SG_T("")
-		);
-	}
-	else
-	{
-		Parameters.Add_Choice(
-			NULL	, "CONNECTION"	, _TL("Server Connection"),
-			_TL(""),
-			""
-		);
-	}
-
-	m_pConnection	= NULL;
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Module::On_Before_Execution(void)
-{
-	m_pConnection	= NULL;
-
-	if( !SG_UI_Get_Window_Main() )
-	{
-		m_pConnection	= SG_ODBC_Get_Connection_Manager().Add_Connection(
-			Parameters("ODBC_DSN")->asString(),
-			Parameters("ODBC_USR")->asString(),
-			Parameters("ODBC_PWD")->asString()
-		);
-
-		if( m_pConnection == NULL )
-		{
-			Message_Dlg(
-				_TL("No ODBC connection available!"),
-				_TL("ODBC Database Connection Error")
-			);
-
-			return( false );
-		}
-	}
-	else
-	{
-		CSG_String	Connections;
-
-		int	nConnections	= SG_ODBC_Get_Connection_Manager().Get_Connections(Connections);
-
-		if( nConnections <= 0 )
-		{
-			Message_Dlg(
-				_TL("No ODBC connection available!"),
-				_TL("ODBC Database Connection Error")
-			);
-
-			return( false );
-		}
-
-		if( nConnections == 1 )
-		{
-			m_pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(0);
-		}
-
-		Parameters("CONNECTION")->asChoice()->Set_Items(Connections);
-		Parameters("CONNECTION")->Set_Enabled(nConnections > 1);
-
-		if( !(m_pConnection = SG_ODBC_Get_Connection_Manager().Get_Connection(Parameters("CONNECTION")->asString())) )
-		{
-			m_pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(0);
-		}
-
-		On_Parameter_Changed(&Parameters, Parameters("CONNECTION"));
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_ODBC_Module::On_After_Execution(void)
-{
-	if( !SG_UI_Get_Window_Main() )
-	{
-		SG_ODBC_Get_Connection_Manager().Del_Connection(m_pConnection, true);
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-int CSG_ODBC_Module::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( SG_UI_Get_Window_Main() && !SG_STR_CMP(pParameter->Get_Identifier(), "CONNECTION") )
-	{
-		m_pConnection	= SG_ODBC_Get_Connection_Manager().Get_Connection(pParameter->asString());
-
-		if( m_pConnection )
-		{
-			On_Connection_Changed(pParameters);
-		}
-	}
-
-	return( -1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_ODBC_Module::Set_Constraints(CSG_Parameters *pParameters, CSG_Table *pTable)
-{
-	if( !pParameters || !pTable )
-	{
-		return( false );
-	}
-
-	pParameters->Del_Parameters();
-
-	if( pTable )
-	{
-		CSG_Parameter	*pP	= pParameters->Add_Node(NULL, "P", _TL("Primary key)")	, _TL(""));
-		CSG_Parameter	*pN	= pParameters->Add_Node(NULL, "N", _TL("Not Null")		, _TL(""));
-		CSG_Parameter	*pU	= pParameters->Add_Node(NULL, "U", _TL("Unique")		, _TL(""));
-
-		for(int i=0; i<pTable->Get_Field_Count(); i++)
-		{
-			pParameters->Add_Value(pP, CSG_String::Format(SG_T("P%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
-			pParameters->Add_Value(pN, CSG_String::Format(SG_T("N%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
-			pParameters->Add_Value(pU, CSG_String::Format(SG_T("U%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false);
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-CSG_Buffer CSG_ODBC_Module::Get_Constraints(CSG_Parameters *pParameters, CSG_Table *pTable)
-{
-	CSG_Buffer	Flags;
-
-	if( pParameters )
-	{
-		int		nFields	= pTable ? pTable->Get_Field_Count() : (pParameters->Get_Count() - 3) / 3;
-
-		if( nFields * 3 + 3 == pParameters->Get_Count() )
-		{
-			for(int i=0; i<nFields; i++)
-			{
-				char	Flag	= 0;
-
-				if( pParameters->Get_Parameter(CSG_String::Format(SG_T("P%d"), i))->asBool() )
-				{
-					Flag	|= SG_ODBC_PRIMARY_KEY;
-				}
-
-				if( pParameters->Get_Parameter(CSG_String::Format(SG_T("N%d"), i))->asBool() )
-				{
-					Flag	|= SG_ODBC_NOT_NULL;
-				}
-
-				if( pParameters->Get_Parameter(CSG_String::Format(SG_T("U%d"), i))->asBool() )
-				{
-					Flag	|= SG_ODBC_UNIQUE;
-				}
-
-				Flags	+= Flag;
-			}
-		}
-	}
-
-	return( Flags );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_odbc/odbc.h b/src/modules_io/db/io_odbc/odbc.h
deleted file mode 100644
index a7fd0c1..0000000
--- a/src/modules_io/db/io_odbc/odbc.h
+++ /dev/null
@@ -1,291 +0,0 @@
-/**********************************************************
- * Version $Id: saga_odbc.h 1507 2012-10-31 18:49:02Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                      saga_odbc.h                      //
-//                                                       //
-//                 Copyright (C) 2010 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__saga_odbc_H
-#define HEADER_INCLUDED__saga_odbc_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef io_odbc_EXPORTS
-	#define	io_odbc_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	io_odbc_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SG_ODBC_PRIMARY_KEY		0x01
-#define SG_ODBC_NOT_NULL		0x02
-#define SG_ODBC_UNIQUE			0x04
-
-//---------------------------------------------------------
-typedef enum ESG_ODBC_DBMS
-{
-	SG_ODBC_DBMS_PostgreSQL,
-	SG_ODBC_DBMS_MySQL,
-	SG_ODBC_DBMS_Oracle,
-	SG_ODBC_DBMS_MSSQLServer,
-	SG_ODBC_DBMS_Access,
-	SG_ODBC_DBMS_Unknown
-}
-TSG_ODBC_DBMS;
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_odbc_EXPORT CSG_ODBC_Connection
-{
-	friend class CSG_ODBC_Connections;
-
-public:
-
-	bool						is_Connected			(void)	const	{	return( m_pConnection != NULL );	}
-
-	void						Set_Auto_Commit			(bool bOn);
-	bool						Get_Auto_Commit			(void)	const	{	return( m_bAutoCommit );	}
-
-	int							Get_Size_Buffer			(void)	const	{	return( m_Size_Buffer );	}
-	bool						Set_Size_Buffer			(int Size);
-
-	int							Get_Size_LOB_Max		(void)	const;
-	bool						Set_Size_LOB_Max		(int Size);
-
-	CSG_String					Get_DBMS_Name			(void)	const;
-	CSG_String					Get_DBMS_Version		(void)	const;
-	TSG_ODBC_DBMS				Get_DBMS				(void)	const	{	return( m_DBMS );	}
-
-	bool						is_PostgreSQL			(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_PostgreSQL  );	}
-	bool						is_MySQL				(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_MySQL       );	}
-	bool						is_Oracle				(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_Oracle      );	}
-	bool						is_MSSQLServer			(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_MSSQLServer );	}
-	bool						is_Access				(void)	const	{	return( m_DBMS == SG_ODBC_DBMS_Access      );	}
-
-	CSG_String					Get_Server				(void)	const	{	return( m_DSN );	}
-
-	int							Get_Tables				(CSG_Strings &Tables)			const;
-	CSG_String					Get_Tables				(void)							const;
-	CSG_String					Get_Field_Names			(const CSG_String &Table_Name)	const;
-	CSG_Table					Get_Field_Desc			(const CSG_String &Table_Name)	const;
-
-	bool						Execute					(const CSG_String &SQL, bool bCommit = false);
-	bool						Commit					(void);
-	bool						Rollback				(void);
-
-	bool						Table_Exists			(const CSG_String &Table_Name)	const;
-
-	bool						Table_Create			(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
-	bool						Table_Drop				(const CSG_String &Table_Name                                                     , bool bCommit = true);
-	bool						Table_Insert			(const CSG_String &Table_Name, const CSG_Table &Table                             , bool bCommit = true);
-	bool						Table_Save				(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
-
-	bool						Table_Load				(CSG_Table &Table      , const CSG_String &Table_Name , bool bLOB = false);
-	bool						Table_Load				(CSG_Table &Table      , const CSG_String &Table_Names, const CSG_String &Fields, const CSG_String &Where = SG_T(""), const CSG_String &Group = SG_T(""), const CSG_String &Having = SG_T(""), const CSG_String &Order = SG_T(""), bool bDistinct = false, bool bLOB = false);
-	bool						Table_Load_BLOBs		(CSG_Bytes_Array &BLOBs, const CSG_String &Table_Name , const CSG_String &Field , const CSG_String &Where = SG_T(""), const CSG_String &Order = SG_T(""));
-
-
-
-private:
-
-	CSG_ODBC_Connection(const CSG_String &Server, const CSG_String &User, const CSG_String &Password, bool bAutoCommit = false);
-	virtual ~CSG_ODBC_Connection(void);
-
-
-	TSG_ODBC_DBMS				m_DBMS;
-
-	bool						m_bAutoCommit;
-
-	int							m_Size_Buffer;
-
-	void						*m_pConnection;
-
-	CSG_String					m_DSN;
-
-
-	CSG_String					_Get_DBMS_Info			(int What)	const;
-
-	int							_Get_Type_To_SQL		(TSG_Data_Type Type);
-	TSG_Data_Type				_Get_Type_From_SQL		(int Type);
-
-	bool						_Table_Load				(CSG_Table &Table, const CSG_String &Select, const CSG_String &Name, bool bLOB);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_odbc_EXPORT CSG_ODBC_Connections
-{
-public:
-	CSG_ODBC_Connections(void);
-	virtual ~CSG_ODBC_Connections(void);
-
-	bool						Create					(void);
-	bool						Destroy					(void);
-
-	int							Get_Servers				(CSG_String  &Servers);
-	int							Get_Servers				(CSG_Strings &Servers);
-	CSG_Strings					Get_Servers				(void);
-
-	int							Get_Connections			(CSG_String &Connections);
-	CSG_Strings					Get_Connections			(void);
-
-	int							Get_Count				(void)		{	return( m_nConnections );	}
-	CSG_ODBC_Connection *		Get_Connection			(int Index)	{	return( Index >= 0 && Index < m_nConnections ? m_pConnections[Index] : NULL );	}
-	CSG_ODBC_Connection *		Get_Connection			(const CSG_String &Server);
-	CSG_ODBC_Connection *		Add_Connection			(const CSG_String &Server, const CSG_String &User, const CSG_String &Password);
-	bool						Del_Connection			(int Index                       , bool bCommit);
-	bool						Del_Connection			(const CSG_String &Server        , bool bCommit);
-	bool						Del_Connection			(CSG_ODBC_Connection *pConnection, bool bCommit);
-
-
-private:
-
-	void						*m_hEnv;
-
-	int							m_nConnections;
-
-	CSG_ODBC_Connection			**m_pConnections;
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_odbc_EXPORT CSG_ODBC_Module : public CSG_Module
-{
-public:
-	CSG_ODBC_Module(void);
-
-
-protected:
-
-	virtual bool				On_Before_Execution		(void);
-	virtual bool				On_After_Execution		(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters)	{}
-
-	CSG_ODBC_Connection *		Get_Connection			(void)	{	return( m_pConnection );	}
-
-	static bool					Set_Constraints			(CSG_Parameters *pParameters, CSG_Table *pTable);
-	static CSG_Buffer			Get_Constraints			(CSG_Parameters *pParameters, CSG_Table *pTable);
-
-
-private:
-
-	CSG_ODBC_Connection			*m_pConnection;
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-io_odbc_EXPORT CSG_ODBC_Connections &	SG_ODBC_Get_Connection_Manager	(void);
-
-//---------------------------------------------------------
-io_odbc_EXPORT bool						SG_ODBC_is_Supported			(void);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__saga_odbc_H
diff --git a/src/modules_io/db/io_odbc/table.cpp b/src/modules_io/db/io_odbc/table.cpp
deleted file mode 100644
index 4d47625..0000000
--- a/src/modules_io/db/io_odbc/table.cpp
+++ /dev/null
@@ -1,476 +0,0 @@
-/**********************************************************
- * Version $Id: table.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       Table.cpp                       //
-//                                                       //
-//                 Copyright (C) 2008 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "get_connection.h"
-
-#include "table.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_List::CTable_List(void)
-{
-	Set_Name		(_TL("List Tables"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Lists all tables of an ODBC data source."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-//---------------------------------------------------------
-bool CTable_List::On_Execute(void)
-{
-	CSG_Table	*pTables	= Parameters("TABLES")->asTable();
-
-	pTables->Destroy();
-	pTables->Set_Name(_TL("Tables"));
-
-	pTables->Add_Field(_TL("Table"), SG_DATATYPE_String);
-
-	if( Get_Connection() )
-	{
-		CSG_Strings	Tables;
-
-		Get_Connection()->Get_Tables(Tables);
-
-		for(int i=0; i<Tables.Get_Count(); i++)
-		{
-			CSG_Table_Record	*pTable	= pTables->Add_Record();
-
-			pTable->Set_Value(0, Tables[i]);
-		}
-
-		pTables->Set_Name(Get_Connection()->Get_Server() + " [" + _TL("Tables") + "]");
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Info::CTable_Info(void)
-{
-	Set_Name		(_TL("List Table Fields"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Loads table information from ODBC data source."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Field Description"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CTable_Info::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
-
-	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
-	pParameter->Set_Value(pParameter->asString());
-}
-
-//---------------------------------------------------------
-bool CTable_Info::On_Execute(void)
-{
-	CSG_String	Table	= Parameters("TABLES")->asString();
-	CSG_Table	*pTable	= Parameters("TABLE" )->asTable();
-
-	CSG_Table tab = Get_Connection()->Get_Field_Desc(Table);
-	pTable->Assign(&tab);
-	pTable->Set_Name(Table + " [" + _TL("Field Description") + "]");
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Load::CTable_Load(void)
-{
-	Set_Name		(_TL("Import Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Imports a table from a database via ODBC."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Table"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CTable_Load::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
-
-	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
-	pParameter->Set_Value(pParameter->asString());
-}
-
-//---------------------------------------------------------
-bool CTable_Load::On_Execute(void)
-{
-	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
-
-	return( Get_Connection()->Table_Load(*pTable, Parameters("TABLES")->asString()) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Save::CTable_Save(void)
-{
-	Set_Name		(_TL("Export Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Exports a table to a database via ODBC."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Table"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_String(
-		NULL	, "NAME"		, _TL("Table Name"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_Parameters(
-		NULL	, "FLAGS"		, _TL("Constraints"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "EXISTS"		, _TL("If table exists..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("abort export"),
-			_TL("replace existing table"),
-			_TL("append records, if table structure allows")
-		), 0
-	);
-}
-
-//---------------------------------------------------------
-int CTable_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) )
-	{
-		pParameters->Get_Parameter("NAME")->Set_Value(pParameter->asTable() ? pParameter->asTable()->Get_Name() : SG_T(""));
-
-		Set_Constraints(pParameters->Get_Parameter("FLAGS")->asParameters(), pParameter->asTable());
-	}
-
-	return( CSG_ODBC_Module::On_Parameter_Changed(pParameters, pParameter) );
-}
-
-//---------------------------------------------------------
-bool CTable_Save::On_Execute(void)
-{
-	bool		bResult	= false;
-	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
-	CSG_String	Name	= Parameters("NAME" )->asString();	if( Name.Length() == 0 )	Name	= pTable->Get_Name();
-
-	//-----------------------------------------------------
-	if( Get_Connection()->Table_Exists(Name) )
-	{
-		Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Name.c_str()));
-
-		switch( Parameters("EXISTS")->asInt() )
-		{
-		case 0:	// abort export
-			break;
-
-		case 1:	// replace existing table
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("dropping table"), Name.c_str()));
-
-			if( !Get_Connection()->Table_Drop(Name, false) )
-			{
-				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
-			}
-			else
-			{
-				bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(Parameters("FLAGS")->asParameters(), pTable));
-			}
-			break;
-
-		case 2:	// append records, if table structure allows
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("appending to existing table"), Name.c_str()));
-
-			if( !(bResult = Get_Connection()->Table_Insert(Name, *pTable)) )
-			{
-				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
-			}
-			break;
-		}
-	}
-	else
-	{
-		bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(Parameters("FLAGS")->asParameters(), pTable));
-	}
-
-	//-----------------------------------------------------
-	if( bResult )
-	{
-		SG_UI_ODBC_Update(Get_Connection()->Get_Server());
-	}
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Drop::CTable_Drop(void)
-{
-	Set_Name		(_TL("Drop Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Deletes a table from a database via ODBC."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CTable_Drop::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
-
-	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
-	pParameter->Set_Value(pParameter->asString());
-}
-
-//---------------------------------------------------------
-bool CTable_Drop::On_Execute(void)
-{
-	if( Get_Connection()->Table_Drop(Parameters("TABLES")->asChoice()->asString()) )
-	{
-		SG_UI_ODBC_Update(Get_Connection()->Get_Server());
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Query::CTable_Query(void)
-{
-	CSG_Parameter	*pNode;
-
-	Set_Name		(_TL("Import Table from SQL Query"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Import a SQL table from a database via ODBC."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Table from SQL Query"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_String(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "FIELDS"		, _TL("Fields"),
-		_TL(""),
-		SG_T("*")
-	);
-
-	Parameters.Add_String(
-		NULL	, "WHERE"		, _TL("Where"),
-		_TL(""),
-		SG_T("")
-	);
-
-	pNode	= Parameters.Add_String(
-		NULL	, "GROUP"		, _TL("Group by"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_String(
-		pNode	, "HAVING"		, _TL("Having"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "ORDER"		, _TL("Order by"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTINCT"	, _TL("Distinct"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-//---------------------------------------------------------
-bool CTable_Query::On_Execute(void)
-{
-	CSG_Table	*pTable		= Parameters("TABLE"   )->asTable ();
-	CSG_String	Tables		= Parameters("TABLES"  )->asString();
-	CSG_String	Fields		= Parameters("FIELDS"  )->asString();
-	CSG_String	Where		= Parameters("WHERE"   )->asString();
-	CSG_String	Group		= Parameters("GROUP"   )->asString();
-	CSG_String	Having		= Parameters("HAVING"  )->asString();
-	CSG_String	Order		= Parameters("ORDER"   )->asString();
-	bool		bDistinct	= Parameters("DISTINCT")->asBool  ();
-
-	return( Get_Connection()->Table_Load(*pTable, Tables, Fields, Where, Group, Having, Order, bDistinct) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_odbc/table.h b/src/modules_io/db/io_odbc/table.h
deleted file mode 100644
index e1e8574..0000000
--- a/src/modules_io/db/io_odbc/table.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/**********************************************************
- * Version $Id: table.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        io_odbc                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       Table.h                         //
-//                                                       //
-//                 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:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Table_H
-#define HEADER_INCLUDED__Table_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_List : public CSG_ODBC_Module
-{
-public:
-	CTable_List(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Info : public CSG_ODBC_Module
-{
-public:
-	CTable_Info(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Load : public CSG_ODBC_Module
-{
-public:
-	CTable_Load(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Save : public CSG_ODBC_Module
-{
-public:
-	CTable_Save(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Drop : public CSG_ODBC_Module
-{
-public:
-	CTable_Drop(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Query : public CSG_ODBC_Module
-{
-public:
-	CTable_Query(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Table_H
diff --git a/src/modules_io/db/io_pgsql/MLB_Interface.cpp b/src/modules_io/db/io_pgsql/MLB_Interface.cpp
deleted file mode 100644
index f9dae2e..0000000
--- a/src/modules_io/db/io_pgsql/MLB_Interface.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 911 2011-11-11 11:11:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2013 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.de                    //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                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("Import/Export - PostgreSQL") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O. Conrad (c) 2013") );
-
-	case MLB_INFO_Description:
-		return( _TL("Accessing PostgreSQL databases.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Database|PostgreSQL") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "get_connection.h"
-#include "table.h"
-#include "pgis_shapes.h"
-#include "pgis_raster.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CGet_Connections );
-	case  1:	return( new CGet_Connection );
-	case  2:	return( new CDel_Connection );
-	case  3:	return( new CDel_Connections );
-	case  4:	return( new CTransaction_Start );
-	case  5:	return( new CTransaction_Stop );
-	case  6:	return( new CExecute_SQL );
-
-	case 10:	return( new CTable_List );
-	case 11:	return( new CTable_Info );
-	case 12:	return( new CTable_Load );
-	case 13:	return( new CTable_Save );
-	case 14:	return( new CTable_Drop );
-	case 15:	return( new CTable_Query );
-
-	case 20:	return( new CShapes_Load );
-	case 21:	return( new CShapes_Save );
-	case 22:	return( new CShapes_SRID_Update );
-
-	case 30:	return( new CRaster_Load );
-	case 31:	return( new CRaster_Save );
-	case 32:	return( new CRaster_SRID_Update );
-
-	case 40:	return( NULL );
-	default:	return( MLB_INTERFACE_SKIP_MODULE );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_io/db/io_pgsql/MLB_Interface.h b/src/modules_io/db/io_pgsql/MLB_Interface.h
deleted file mode 100644
index 79c34b0..0000000
--- a/src/modules_io/db/io_pgsql/MLB_Interface.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 911 2011-11-11 11:11:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2013 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.de                    //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__io_pgsql_MLB_Interface_H
-#define HEADER_INCLUDED__io_pgsql_MLB_Interface_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef io_pgsql_EXPORTS
-	#define	io_pgsql_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	io_pgsql_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-//---------------------------------------------------------
-#include "io_pgsql.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__io_pgsql_MLB_Interface_H
diff --git a/src/modules_io/db/io_pgsql/Makefile.am b/src/modules_io/db/io_pgsql/Makefile.am
deleted file mode 100644
index ab21623..0000000
--- a/src/modules_io/db/io_pgsql/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# $Id: Makefile.am 1790 2013-08-20 09:23:17Z reklov_w $
-#
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-DEP_DEFS = -D_SAGA_UNICODE
-endif
-DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS           = -I$(top_srcdir)/src/saga_core $(POSTGRESQL_CFLAGS)
-AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = $(DEP_LFLG) $(POSTGRESQL_LDFLAGS) $(DEP_LIBS) -shared -lpq -avoid-version
-pkglib_LTLIBRARIES = libio_pgsql.la
-libio_pgsql_la_SOURCES =\
-get_connection.cpp\
-MLB_Interface.cpp\
-io_pgsql.cpp\
-pgis_raster.cpp\
-pgis_shapes.cpp\
-table.cpp\
-get_connection.h\
-MLB_Interface.h\
-io_pgsql.h\
-pgis_raster.h\
-pgis_shapes.h\
-table.h
-
-libio_pgsql_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules_io/db/io_pgsql/Makefile.in b/src/modules_io/db/io_pgsql/Makefile.in
deleted file mode 100644
index f146fb5..0000000
--- a/src/modules_io/db/io_pgsql/Makefile.in
+++ /dev/null
@@ -1,590 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/db/io_pgsql
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_pgsql_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_pgsql_la_OBJECTS = get_connection.lo MLB_Interface.lo \
-	io_pgsql.lo pgis_raster.lo pgis_shapes.lo table.lo
-libio_pgsql_la_OBJECTS = $(am_libio_pgsql_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_pgsql_la_SOURCES)
-DIST_SOURCES = $(libio_pgsql_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1790 2013-08-20 09:23:17Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@DEP_DEFS = -D_SAGA_UNICODE
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core $(POSTGRESQL_CFLAGS)
-AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = $(DEP_LFLG) $(POSTGRESQL_LDFLAGS) $(DEP_LIBS) -shared -lpq -avoid-version
-pkglib_LTLIBRARIES = libio_pgsql.la
-libio_pgsql_la_SOURCES = \
-get_connection.cpp\
-MLB_Interface.cpp\
-io_pgsql.cpp\
-pgis_raster.cpp\
-pgis_shapes.cpp\
-table.cpp\
-get_connection.h\
-MLB_Interface.h\
-io_pgsql.h\
-pgis_raster.h\
-pgis_shapes.h\
-table.h
-
-libio_pgsql_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/db/io_pgsql/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/db/io_pgsql/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_pgsql.la: $(libio_pgsql_la_OBJECTS) $(libio_pgsql_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_pgsql_la_OBJECTS) $(libio_pgsql_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_connection.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/io_pgsql.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pgis_raster.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pgis_shapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/db/io_pgsql/get_connection.cpp b/src/modules_io/db/io_pgsql/get_connection.cpp
deleted file mode 100644
index 52eee7f..0000000
--- a/src/modules_io/db/io_pgsql/get_connection.cpp
+++ /dev/null
@@ -1,583 +0,0 @@
-/**********************************************************
- * Version $Id: get_connection.cpp 1509 2012-11-01 16:39:43Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Get_Connection.cpp                  //
-//                                                       //
-//                 Copyright (C) 2013 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 "get_connection.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGet_Connections::CGet_Connections(void)
-{
-	Set_Name		(_TL("List PostgreSQL Connections"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Lists all PostgreSQL sources."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "CONNECTIONS"		, _TL("Connections"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-//---------------------------------------------------------
-bool CGet_Connections::On_Execute(void)
-{
-	CSG_Table	*pConnections	= Parameters("CONNECTIONS")->asTable();
-
-	pConnections->Destroy();
-	pConnections->Set_Name(_TL("PostgreSQL Connections"));
-
-	pConnections->Add_Field(_TL("Name"    ), SG_DATATYPE_String);
-	pConnections->Add_Field(_TL("Host"    ), SG_DATATYPE_String);
-	pConnections->Add_Field(_TL("Port"    ), SG_DATATYPE_Int);
-	pConnections->Add_Field(_TL("Database"), SG_DATATYPE_String);
-	pConnections->Add_Field(_TL("Version" ), SG_DATATYPE_String);
-	pConnections->Add_Field(_TL("PostGIS" ), SG_DATATYPE_String);
-
-	for(int i=0; i<SG_PG_Get_Connection_Manager().Get_Count(); i++)
-	{
-		CSG_PG_Connection	*pConnection = SG_PG_Get_Connection_Manager().Get_Connection(i);
-		CSG_Table_Record	*pRecord     = pConnections->Add_Record();
-
-		pRecord->Set_Value(0, pConnection->Get_Connection());
-		pRecord->Set_Value(1, pConnection->Get_Host());
-		pRecord->Set_Value(2, pConnection->Get_Port());
-		pRecord->Set_Value(3, pConnection->Get_DBName());
-		pRecord->Set_Value(4, pConnection->Get_Version());
-		pRecord->Set_Value(5, pConnection->Get_PostGIS());
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGet_Connection::CGet_Connection(void)
-{
-	Set_Name		(_TL("Connect to PostgreSQL"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Connect to PostgreSQL data source."
-	));
-
-	Parameters.Add_String(
-		NULL	, "PG_HOST"		, _TL("Host"),
-		_TL("Password"),
-		"localhost"
-	);
-
-	Parameters.Add_Value(
-		NULL	, "PG_PORT"		, _TL("Port"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 5432, 0, true
-	);
-
-	Parameters.Add_String(
-		NULL	, "PG_NAME"		, _TL("Database"),
-		_TL("Database Name"),
-		"geo_test"
-	);
-
-	Parameters.Add_String(
-		NULL	, "PG_USER"		, _TL("User"),
-		_TL("User Name"),
-		"postgres"
-	);
-
-	Parameters.Add_String(
-		NULL	, "PG_PWD"		, _TL("Password"),
-		_TL("Password"),
-		"postgres", false, true
-	);
-}
-
-//---------------------------------------------------------
-bool CGet_Connection::On_Execute(void)
-{
-	CSG_String	Connection	= CSG_String::Format(SG_T("%s [%s:%d]"),
-		Parameters("PG_NAME")->asString(),
-		Parameters("PG_HOST")->asString(),
-		Parameters("PG_PORT")->asInt()
-	);
-
-	if( SG_PG_Get_Connection_Manager().Get_Connection(Connection) )
-	{
-		Message_Add(Connection + ": " + _TL("PostgreSQL source is already connected"));
-
-		return( false );
-	}
-
-	CSG_PG_Connection	*pConnection	= SG_PG_Get_Connection_Manager().Add_Connection(
-		Parameters("PG_NAME")->asString(),
-		Parameters("PG_USER")->asString(),
-		Parameters("PG_PWD" )->asString(),
-		Parameters("PG_HOST")->asString(),
-		Parameters("PG_PORT")->asInt()
-	);
-
-	if( pConnection )
-	{
-		Message_Add(Connection + ": " + _TL("PostgreSQL source connected"));
-
-		pConnection->GUI_Update();
-
-		return( true );
-	}
-
-	Message_Add(Connection + ": " + _TL("could not connect to PostgreSQL source"));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CDel_Connection::CDel_Connection(void)
-{
-	Set_Name		(_TL("Disconnect from PostgreSQL"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Disconnect PostgreSQL data source."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TRANSACT"	, _TL("Transactions"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("rollback"),
-			_TL("commit")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-bool CDel_Connection::On_Execute(void)
-{
-	CSG_String	Connection	= Get_Connection()->Get_Connection();
-
-	if( SG_PG_Get_Connection_Manager().Del_Connection(Get_Connection(), Parameters("TRANSACT")->asInt() == 1) )
-	{
-		Message_Add(Connection + ": " + _TL("PostgreSQL source disconnected"));
-
-		SG_UI_ODBC_Update(Connection);
-
-		return( true );
-	}
-
-	Message_Add(Connection + ": " + _TL("could not disconnect PostgreSQL source"));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CDel_Connections::CDel_Connections(void)
-{
-	Set_Name		(_TL("Disconnect All"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Disconnects all PostgreSQL connections."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TRANSACT"	, _TL("Transactions"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("rollback"),
-			_TL("commit")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-bool CDel_Connections::On_Before_Execution(void)
-{
-	if( SG_PG_Get_Connection_Manager().Get_Count() > 0 )
-	{
-		return( true );
-	}
-
-	Message_Dlg(
-		_TL("No PostgreSQL connection available!"),
-		_TL("PostgreSQL Database Connection Error")
-	);
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CDel_Connections::On_Execute(void)
-{
-	bool	bCommit	= Parameters("TRANSACT")->asInt() == 1;
-
-	CSG_PG_Connections	&Manager	= SG_PG_Get_Connection_Manager();
-
-	for(int i=Manager.Get_Count()-1; i>=0; i--)
-	{
-		Manager.Del_Connection(i, bCommit);
-	}
-
-	SG_UI_ODBC_Update("");
-
-	return( Manager.Get_Count() == 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTransaction_Start::CTransaction_Start(void)
-{
-	Set_Name		(_TL("Begin Transaction"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Begins a transaction, which will be finished later with a commit or rollback. "
-		"Tries to add a save point, if already in transaction mode. "
-	));
-
-	Parameters.Add_String(
-		NULL	, "SAVEPOINT"	, _TL("Save Point"),
-		_TL(""),
-		"SAVEPOINT_01"
-	);
-}
-
-//---------------------------------------------------------
-void CTransaction_Start::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	pParameters->Get_Parameter("SAVEPOINT")->Set_Enabled(Get_Connection()->is_Transaction());
-}
-
-//---------------------------------------------------------
-bool CTransaction_Start::On_Execute(void)
-{
-	if( !Get_Connection()->is_Transaction() )
-	{
-		if( Get_Connection()->Begin() )
-		{
-			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("transaction started"));
-
-			return( true );
-		}
-
-		Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("could not start transaction"));
-	}
-	else
-	{
-		if( Get_Connection()->Begin(Parameters("SAVEPOINT")->asString()) )
-		{
-			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("save point added"));
-
-			return( true );
-		}
-
-		Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("could not add save point"));
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTransaction_Stop::CTransaction_Stop(void)
-{
-	Set_Name		(_TL("Commit/Rollback Transaction"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Execute a commit or rollback on open transactions with PostgreSQL source."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TRANSACT"	, _TL("Transactions"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("rollback"),
-			_TL("commit")
-		), 1
-	);
-
-	Parameters.Add_String(
-		NULL	, "SAVEPOINT"	, _TL("Save Point"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-bool CTransaction_Stop::On_Execute(void)
-{
-	if( !Get_Connection()->is_Transaction() )
-	{
-		Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("not in transaction"));
-
-		return( false );
-	}
-
-	if( Parameters("TRANSACT")->asInt() == 1 )
-	{
-		if( Get_Connection()->Commit(Parameters("SAVEPOINT")->asString()) )
-		{
-			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("open transactions committed"));
-
-			SG_UI_ODBC_Update(Get_Connection()->Get_Connection());
-
-			return( true );
-		}
-	}
-	else
-	{
-		if( Get_Connection()->Rollback(Parameters("SAVEPOINT")->asString()) )
-		{
-			Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("open transactions rolled back"));
-
-			SG_UI_ODBC_Update(Get_Connection()->Get_Connection());
-
-			return( true );
-		}
-	}
-
-	Message_Add(Get_Connection()->Get_Connection() + ": " + _TL("could not commit/rollback transactions."));
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CExecute_SQL::CExecute_SQL(void)
-{
-	Set_Name		(_TL("Execute SQL"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Execute SQL commands on a connected PostgreSQL source. "
-		"Separate different commands with a semicolon (\';\'). "
-	));
-
-	Parameters.Add_String(
-		NULL	, "SQL"			, _TL("SQL Statment"),
-		_TL(""),
-		SG_T("CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);\n")
-		SG_T("INSERT INTO myTable1 (Col1, Col2) VALUES(\'First Value\', 1);\n")
-		SG_T("DROP TABLE myTable1;\n"),
-		true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "OUTPUT"		, _TL("Show Results"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "STOP"		, _TL("Stop on Error"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-//---------------------------------------------------------
-bool CExecute_SQL::On_Execute(void)
-{
-	//-----------------------------------------------------
-	bool		bOutput	= Parameters("OUTPUT")->asBool  ();
-	bool		bStop	= Parameters("STOP"  )->asBool  ();
-	CSG_String	SQL		= Parameters("SQL"   )->asString();
-
-	//-----------------------------------------------------
-	if( SQL.Find(SG_T(';')) < 0 )
-	{
-		return( Get_Connection()->Execute(SQL) );
-	}
-
-	//-----------------------------------------------------
-	int		nSuccess = 0, nErrors = 0;
-
-	SQL	+= SG_T(';');
-
-	do
-	{
-		CSG_String	s	= SQL.BeforeFirst(SG_T(';'));
-
-		s.Trim();
-
-		if( s.Length() > 0 )
-		{
-			CSG_Table	Table, *pTable;	pTable	= bOutput ? &Table : NULL;
-
-			Message_Add(s);
-
-			if( Get_Connection()->Execute(s, pTable) )
-			{
-				nSuccess++;
-
-				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("okay")), false);
-
-				if( pTable && pTable->Get_Count() )
-				{
-					int		iField, iRecord;
-
-					s	= "\n";
-
-					for(iField=0; iField<pTable->Get_Field_Count(); iField++)
-					{
-						s	+= iField > 0 ? "\t" : "\n";
-						s	+= pTable->Get_Field_Name(iField);
-					}
-
-					s	= "\n___";
-
-					for(iRecord=0; iRecord<pTable->Get_Count(); iRecord++)
-					{
-						CSG_Table_Record	*pRecord	= pTable->Get_Record(iRecord);
-
-						for(iField=0; iField<pTable->Get_Field_Count(); iField++)
-						{
-							s	+= iField > 0 ? "\t" : "\n";
-							s	+= pRecord->asString(iField);
-						}
-
-						Message_Add(s, false);	s.Clear();
-					}
-
-					Message_Add("\n", false);
-				}
-			}
-			else
-			{
-				nErrors++;
-
-				Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("failed")));
-
-				if( bStop )
-				{
-					return( false );
-				}
-			}
-		}
-
-		SQL	= SQL.AfterFirst(SG_T(';'));
-	}
-	while( SQL.Length() > 0 );
-
-	return( nErrors == 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_pgsql/get_connection.h b/src/modules_io/db/io_pgsql/get_connection.h
deleted file mode 100644
index 41ee55c..0000000
--- a/src/modules_io/db/io_pgsql/get_connection.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/**********************************************************
- * Version $Id: get_connection.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Get_Connection.h                    //
-//                                                       //
-//                 Copyright (C) 2013 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__Get_Connection_H
-#define HEADER_INCLUDED__Get_Connection_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGet_Connections : public CSG_Module
-{
-public:
-	CGet_Connections(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CGet_Connection : public CSG_Module
-{
-public:
-	CGet_Connection(void);
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CDel_Connection : public CSG_PG_Module
-{
-public:
-	CDel_Connection(void);
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CDel_Connections : public CSG_Module
-{
-public:
-	CDel_Connections(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Before_Execution		(void);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTransaction_Start : public CSG_PG_Module
-{
-public:
-	CTransaction_Start(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTransaction_Stop : public CSG_PG_Module
-{
-public:
-	CTransaction_Stop(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CExecute_SQL : public CSG_PG_Module
-{
-public:
-	CExecute_SQL(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Get_Connection_H
diff --git a/src/modules_io/db/io_pgsql/io_pgsql.cpp b/src/modules_io/db/io_pgsql/io_pgsql.cpp
deleted file mode 100644
index 5476083..0000000
--- a/src/modules_io/db/io_pgsql/io_pgsql.cpp
+++ /dev/null
@@ -1,1858 +0,0 @@
-/**********************************************************
- * Version $Id: io_pgsql.cpp 911 2011-11-11 11:11:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     io_pgsql.cpp                      //
-//                                                       //
-//                 Copyright (C) 2013 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.de                    //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "io_pgsql.h"
-
-#include <libpq-fe.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_PG_Connections	g_Connections;
-
-//---------------------------------------------------------
-CSG_PG_Connections &	SG_PG_Get_Connection_Manager(void)
-{
-	return( g_Connections );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void _Error_Message(const CSG_String &Message, const CSG_String &Additional = SG_T(""))
-{
-	SG_UI_Msg_Add_Execution(Message, true, SG_UI_MSG_STYLE_FAILURE);
-
-	CSG_String	s(Message);
-
-	if( Additional.Length() > 0 )
-	{
-		s	+= SG_T(":\n");
-		s	+= Additional;
-		s	+= SG_T("\n");
-	}
-
-	SG_UI_Msg_Add_Error(s);
-}
-
-//---------------------------------------------------------
-void _Error_Message(const CSG_String &Message, PGconn *pConnection)
-{
-	CSG_String	Error	= PQerrorMessage(pConnection);
-
-	_Error_Message(Message, Error);
-}
-
-//---------------------------------------------------------
-void _Error_Message(PGconn *pConnection)
-{
-	CSG_String	Error	= PQerrorMessage(pConnection);
-
-	_Error_Message(Error);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define m_pgConnection	((PGconn   *)m_pConnection)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_PG_Connection::CSG_PG_Connection(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit)
-{
-	Create(Host, Port, Name, User, Password, bAutoCommit);
-}
-
-bool CSG_PG_Connection::Create(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit)
-{
-	m_bTransaction	= false;
-
-	m_pConnection	= PQsetdbLogin(Host, CSG_String::Format(SG_T("%d"), Port), NULL, NULL, Name, User, Password);
-
-	if( PQstatus(m_pgConnection) != CONNECTION_OK )
-	{
-		_Error_Message((_TL("Connection to database failed"), m_pgConnection));
-
-		Destroy();
-
-		return( false );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-CSG_PG_Connection::~CSG_PG_Connection(void)
-{
-	Destroy();
-}
-
-bool CSG_PG_Connection::Destroy(void)
-{
-	if( !is_Connected() )	{	return( false );	}
-
-	PQfinish(m_pgConnection);
-
-	m_pConnection	= NULL;
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SG_PG_BOOL		16
-#define	SG_PG_BYTEA		17
-#define	SG_PG_CHAR		18
-#define	SG_PG_NAME		19
-#define	SG_PG_INT8		20
-#define	SG_PG_INT2		21
-#define	SG_PG_INT4		23
-#define	SG_PG_TEXT		25
-#define	SG_PG_OID		26
-#define	SG_PG_FLOAT4	700
-#define	SG_PG_FLOAT8	701
-#define SG_PG_VARCHAR	1043
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Type_To_SQL(TSG_Data_Type Type, int Size)
-{
-	switch( Type )
-	{
-	case SG_DATATYPE_String:	return( CSG_String::Format(SG_T("varchar(%d)"), Size > 0 ? Size : 1) );
-	case SG_DATATYPE_Date:		return( "varchar(16)"      );
-	case SG_DATATYPE_Char:		return( "char(1)"          );
-	case SG_DATATYPE_Byte:		return( "smallint"         );
-	case SG_DATATYPE_Short:		return( "smallint"         );
-	case SG_DATATYPE_Int:		return( "integer"          );
-	case SG_DATATYPE_Long:		return( "bigint"           );
-	case SG_DATATYPE_Color:		return( "integer"          );
-	case SG_DATATYPE_Float:		return( "real"             );
-	case SG_DATATYPE_Double:	return( "double precision" );
-	case SG_DATATYPE_Binary:	return( "bytea"            );
-
-	default:	return( "text" );
-	}
-}
-
-//---------------------------------------------------------
-TSG_Data_Type CSG_PG_Connection::Get_Type_From_SQL(int Type)
-{
-	switch( Type )
-	{
-	case SG_PG_VARCHAR:	return( SG_DATATYPE_String );
-	case SG_PG_NAME:	return( SG_DATATYPE_String );
-	case SG_PG_TEXT:	return( SG_DATATYPE_String );
-
-	case SG_PG_INT2:	return( SG_DATATYPE_Short  );	// 2 bytes integer
-	case SG_PG_INT4:	return( SG_DATATYPE_Int    );	// 4 bytes integer
-	case SG_PG_INT8:	return( SG_DATATYPE_Long   );	// 8 bytes integer
-	case SG_PG_FLOAT4:	return( SG_DATATYPE_Float  );	// 4 bytes floating point, inexact
-	case SG_PG_FLOAT8:	return( SG_DATATYPE_Double );	// 8 bytes floating point, inexact
-
-	case SG_PG_BYTEA:	return( SG_DATATYPE_Binary );
-	}
-
-	return( SG_DATATYPE_String );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Raster_Type_To_SQL(TSG_Data_Type Type)
-{
-	switch( Type )
-	{
-	case SG_DATATYPE_Bit:		return( "1BB"   );
-	case SG_DATATYPE_Char:		return( "8BSI"  );
-	case SG_DATATYPE_Byte:		return( "8BUI"  );
-	case SG_DATATYPE_Short:		return( "16BSI" );
-	case SG_DATATYPE_Word:		return( "16BUI" );
-	case SG_DATATYPE_Int:		return( "32BSI" );
-	case SG_DATATYPE_DWord:		return( "32BUI" );
-	case SG_DATATYPE_Long:		return( "32BSI" );
-	case SG_DATATYPE_Float:		return( "32BF"  );
-	case SG_DATATYPE_Double:	return( "64BF"  );
-	}
-
-	return( "64BF" );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSG_PG_Connection::GUI_Update(void) const
-{
-	SG_UI_ODBC_Update(Get_Connection());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Connection(void) const
-{
-	return( Get_DBName() + " [" + Get_Host() + ":" + Get_Port() + "]" );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Host(void) const
-{
-	return( PQhost(m_pgConnection) );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Port(void) const
-{
-	return( PQport(m_pgConnection) );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_User(void) const
-{
-	return( PQuser(m_pgConnection) );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_DBName(void) const
-{
-	return( PQdb  (m_pgConnection) );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Version(void) const
-{
-	int	Version	= PQserverVersion(m_pgConnection);
-
-	return( CSG_String::Format(SG_T("%d.%d.%d"),
-		(Version / 100) / 100,
-		(Version / 100) % 100,
-		(Version % 100)
-	));
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::has_Version(int Major, int Minor, int Revision) const
-{
-	int	Version	= PQserverVersion(m_pgConnection);
-
-	return( Version >= (Major * 10000 + Minor * 100 + Revision) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_PostGIS(void) const
-{
-	CSG_Table	t;
-
-	if( _Table_Load(t, "SELECT PostGIS_Lib_Version()", "") && t.Get_Count() == 1 && t.Get_Field_Count() == 1 )
-	{
-		return( t[0][0].asString() );
-	}
-
-	return( "" );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::has_PostGIS(double minVersion)
-{
-	CSG_Table	t;
-
-	return( _Table_Load(t, "SELECT PostGIS_Lib_Version()", "") && t.Get_Count() == 1 && t.Get_Field_Count() == 1
-		&& 0.0001 * t[0][0].asDouble() >= minVersion
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSG_PG_Connection::Get_Tables(CSG_Strings &Tables) const
-{
-	Tables.Clear();
-
-	if( is_Connected() )
-	{
-		PGresult	*pResult	= PQexec(m_pgConnection,
-			"SELECT table_name FROM information_schema.tables WHERE table_schema='public' ORDER BY table_name"
-		);
-
-		if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
-		{
-			_Error_Message(_TL("listing of database tables failed"), m_pgConnection);
-		}
-		else
-		{
-			for(int iRecord=0; iRecord<PQntuples(pResult); iRecord++)
-			{
-				Tables	+= PQgetvalue(pResult, iRecord, 0);
-			}
-		}
-
-		PQclear(pResult);
-	}
-
-	return( Tables.Get_Count() );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Tables(void) const
-{
-	CSG_String	List;
-	CSG_Strings	Tables;
-
-	if( Get_Tables(Tables) )
-	{
-		for(int i=0; i<Tables.Get_Count(); i++)
-		{
-			List	+= Tables[i] + '|';
-		}
-	}
-
-	return( List );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Exists(const CSG_String &Table_Name) const
-{
-	CSG_Strings	Tables;
-
-	if( Get_Tables(Tables) )
-	{
-		for(int i=0; i<Tables.Get_Count(); i++)
-		{
-			if( Table_Name.Cmp(Tables[i]) == 0 )
-			{
-				return( true );
-			}
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-CSG_Table CSG_PG_Connection::Get_Field_Desc(const CSG_String &Table_Name) const
-{
-	CSG_Table	Fields;
-
-	Fields.Set_Name(CSG_String::Format(SG_T("%s [%s]"), Table_Name.c_str(), _TL("Field Description")));
-
-	Fields.Add_Field(_TL("NAME"     ), SG_DATATYPE_String);
-	Fields.Add_Field(_TL("TYPE"     ), SG_DATATYPE_String);
-	Fields.Add_Field(_TL("SIZE"     ), SG_DATATYPE_Int);
-	Fields.Add_Field(_TL("PRECISION"), SG_DATATYPE_Int);
-
-	if( is_Connected() )
-	{
-		CSG_String	s;
-
-		s	+= "SELECT column_name, udt_name, character_maximum_length, numeric_precision ";
-		s	+= "FROM information_schema.columns WHERE table_schema='public' AND table_name='";
-		s	+= Table_Name;
-		s	+= "' ORDER BY ordinal_position";
-
-		PGresult	*pResult	= PQexec(m_pgConnection, s);
-
-		if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
-		{
-			_Error_Message(_TL("listing of table columns failed"), m_pgConnection);
-		}
-		else
-		{
-			for(int iRecord=0; iRecord<PQntuples(pResult); iRecord++)
-			{
-				CSG_Table_Record	*pRecord	= Fields.Add_Record();
-
-				for(int iField=0; iField<Fields.Get_Field_Count(); iField++)
-				{
-					pRecord->Set_Value(iField, PQgetvalue(pResult, iRecord, iField));
-				}
-			}
-		}
-
-		PQclear(pResult);
-	}
-
-	return( Fields );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_PG_Connection::Get_Field_Names(const CSG_String &Table_Name) const
-{
-	CSG_Table	Fields	= Get_Field_Desc(Table_Name);
-
-	CSG_String	Names;
-
-	for(int i=0; i<Fields.Get_Count(); i++)
-	{
-		Names	+= Fields[i].asString(3);
-		Names	+= SG_T("|");
-	}
-
-	return( Names );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Execute(const CSG_String &SQL, CSG_Table *pTable)
-{
-	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
-
-	PGresult	*pResult	= PQexec(m_pgConnection, SQL);
-
-	bool	bResult;
-
-	switch( PQresultStatus(pResult) )
-	{
-	default:
-		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
-
-		bResult	= false;
-		break;
-
-	case PGRES_COMMAND_OK:
-		bResult	= true;
-		break;
-
-	case PGRES_TUPLES_OK:
-		if( pTable )
-		{
-			_Table_Load(*pTable, pResult);
-
-			pTable->Set_Name(_TL("Query Result"));
-		}
-
-		bResult	= true;
-		break;
-	}
-
-	PQclear(pResult);
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Begin(const CSG_String &SavePoint)
-{
-	CSG_String	Command;
-
-	if( SavePoint.is_Empty() )
-	{
-		if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
-		if( is_Transaction() )	{	_Error_Message(_TL("already in transaction"));	return( false );	}
-
-		Command	= "BEGIN";
-	}
-	else
-	{
-		if( !is_Transaction() )	{	_Error_Message(_TL("not in transaction"));	return( false );	}
-
-		Command	= "SAVEPOINT " + SavePoint;
-	}
-
-	PGresult	*pResult	= PQexec(m_pgConnection, Command);
-	bool		 bResult	= PQresultStatus(pResult) == PGRES_COMMAND_OK;
-
-	if( bResult )
-	{
-		m_bTransaction	= true;
-	}
-	else if( SavePoint.is_Empty() )
-	{
-		_Error_Message(_TL("begin transaction command failed"), m_pgConnection);
-	}
-	else
-	{
-		_Error_Message(_TL("could not add save point"), m_pgConnection);
-	}
-
-	PQclear(pResult);
-
-	return( bResult );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Rollback(const CSG_String &SavePoint)
-{
-	if( !is_Transaction() )	{	_Error_Message(_TL("not in transaction"));	return( false );	}
-
-	CSG_String	Command	= "ROLLBACK";
-
-	if( !SavePoint.is_Empty() )
-	{
-		Command	+= " TO SAVEPOINT " + SavePoint;
-	}
-
-	PGresult	*pResult	= PQexec(m_pgConnection, Command);
-
-	if( PQresultStatus(pResult) != PGRES_COMMAND_OK )
-	{
-		_Error_Message(_TL("rollback transaction command failed"), m_pgConnection);
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	if( SavePoint.is_Empty() )
-	{
-		m_bTransaction	= false;
-	}
-
-	PQclear(pResult);
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Commit(const CSG_String &SavePoint)
-{
-	if( !is_Transaction() )	{	_Error_Message(_TL("not in transaction"));	return( false );	}
-
-	CSG_String	Command;
-
-	if( SavePoint.is_Empty() )
-	{
-		Command	= "COMMIT";
-	}
-	else
-	{
-		Command	= "RELEASE SAVEPOINT " + SavePoint;
-	}
-
-	PGresult	*pResult	= PQexec(m_pgConnection, Command);
-
-	if( PQresultStatus(pResult) != PGRES_COMMAND_OK )
-	{
-		_Error_Message(_TL("commit transaction command failed"), m_pgConnection);
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	m_bTransaction	= false;
-
-	PQclear(pResult);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
-{
-	if( Table.Get_Field_Count() <= 0 )
-	{
-		_Error_Message(_TL("no attributes in table"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int			iField;
-	CSG_String	SQL;
-
-	SQL.Printf(SG_T("CREATE TABLE \"%s\"("), Table_Name.c_str());
-
-	//-----------------------------------------------------
-	for(iField=0; iField<Table.Get_Field_Count(); iField++)
-	{
-		CSG_String	s	= Get_Type_To_SQL(Table.Get_Field_Type(iField), Table.Get_Field_Length(iField));
-
-		char	Flag	= (int)Flags.Get_Size() == Table.Get_Field_Count() ? Flags[iField] : 0;
-
-		if( (Flag & SG_PG_PRIMARY_KEY) == 0 )
-		{
-			if( (Flag & SG_PG_UNIQUE) != 0 )
-			{
-				s	+= SG_T(" UNIQUE");
-			}
-
-			if( (Flag & SG_PG_NOT_NULL) != 0 )
-			{
-				s	+= SG_T(" NOT NULL");
-			}
-		}
-
-		if( iField > 0 )
-		{
-			SQL	+= SG_T(", ");
-		}
-
-		SQL	+= CSG_String::Format(SG_T("%s %s"), Table.Get_Field_Name(iField), s.c_str());
-	}
-
-	//-----------------------------------------------------
-	if( (int)Flags.Get_Size() == Table.Get_Field_Count() )
-	{
-		CSG_String	s;
-
-		for(iField=0; iField<Table.Get_Field_Count(); iField++)
-		{
-			if( (Flags[iField] & SG_PG_PRIMARY_KEY) != 0 )
-			{
-				s	+= s.Length() == 0 ? SG_T(", PRIMARY KEY(") : SG_T(", ");
-				s	+= Table.Get_Field_Name(iField);
-			}
-		}
-
-		if( s.Length() > 0 )
-		{
-			SQL	+= s + SG_T(")");
-		}
-	}
-
-	//-----------------------------------------------------
-	SQL	+= SG_T(")");
-
-	return( Execute(SQL) );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Drop(const CSG_String &Table_Name, bool bCommit)
-{
-	if( !Table_Exists(Table_Name) )
-	{
-		_Error_Message(_TL("database table does not exist"));
-
-		return( false );
-	}
-
-	return( Execute(CSG_String::Format(SG_T("DROP TABLE \"%s\""), Table_Name.c_str())) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Table &Table, bool bCommit)
-{
-	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
-
-	//-----------------------------------------------------
-	if( !Table_Exists(Table_Name) )
-	{
-		return( false );
-	}
-
-	if( Table.Get_Field_Count() <= 0 || Table.Get_Field_Count() != Get_Field_Desc(Table_Name).Get_Count() )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int		iField, nFields	= Table.Get_Field_Count();
-
-	char	**Values		= (char **)SG_Malloc(nFields * sizeof(char *));
-	char	**paramValues	= (char **)SG_Malloc(nFields * sizeof(char *));
-	int		 *paramLengths	= (int   *)SG_Malloc(nFields * sizeof(int   ));
-	int		 *paramFormats	= (int   *)SG_Malloc(nFields * sizeof(int   ));
-//	Oid		 *paramTypes	= (Oid   *)SG_Malloc(nFields * sizeof(Oid   ));
-
-	CSG_String	Insert("INSERT INTO " + Table_Name + " VALUES(");
-
-	for(iField=0; iField<nFields; iField++)
-	{
-		Insert	+= CSG_String::Format(SG_T("$%d%c"), 1 + iField, iField < nFields - 1 ? SG_T(',') : SG_T(')'));
-
-		paramFormats[iField]	= Table.Get_Field_Type(iField) == SG_DATATYPE_Binary ? 1 : 0;
-
-		switch( Table.Get_Field_Type(iField) )
-		{
-		default:
-		case SG_DATATYPE_Date:
-		case SG_DATATYPE_String:
-			Values [iField]	= (char *)SG_Malloc((1 + Table.Get_Field_Length(iField)) * sizeof(char));
-			break;
-
-		case SG_DATATYPE_Short:
-		case SG_DATATYPE_Int:
-		case SG_DATATYPE_Color:
-		case SG_DATATYPE_Long:
-		case SG_DATATYPE_Float:
-		case SG_DATATYPE_Double:
-			Values [iField]	= (char *)SG_Malloc(256);
-			break;
-
-		case SG_DATATYPE_Binary:
-			break;
-		}
-	}
-
-	//-----------------------------------------------------
-	for(int iRecord=0; iRecord<Table.Get_Count() && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
-	{
-		CSG_Table_Record	*pRecord	= Table.Get_Record(iRecord);
-
-		for(iField=0; iField<Table.Get_Field_Count(); iField++)
-		{
-			if( pRecord->is_NoData(iField) )
-			{
-				paramValues [iField]	= NULL;
-			}
-			else if( Table.Get_Field_Type(iField) == SG_DATATYPE_Binary )
-			{
-				paramValues [iField]	= (char *)pRecord->Get_Value(iField)->asBinary().Get_Bytes();
-				paramLengths[iField]	=         pRecord->Get_Value(iField)->asBinary().Get_Count();
-			}
-			else
-			{
-				sprintf(Values[iField], "%s", CSG_String(pRecord->asString(iField)).b_str());
-
-				paramValues [iField]	= Values[iField];
-			}
-		}
-
-		PQexecParams(m_pgConnection, Insert, nFields, NULL, paramValues, paramLengths, paramFormats, 0);
-	}
-
-	//-----------------------------------------------------
-	for(iField=0; iField<nFields; iField++)
-	{
-		if( Table.Get_Field_Type(iField) != SG_DATATYPE_Binary )
-		{
-			SG_Free(Values[iField]);
-		}
-	}
-
-	SG_Free(Values);
-	SG_Free(paramValues);
-	SG_Free(paramLengths);
-	SG_Free(paramFormats);
-//	SG_Free(paramTypes);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Save(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags, bool bCommit)
-{
-	//-----------------------------------------------------
-	if( !is_Connected() )
-	{
-		_Error_Message(_TL("no database connection"));
-
-		return( false );
-	}
-
-	if( Table_Exists(Table_Name) && !Table_Drop(Table_Name, bCommit) )
-	{
-		return( false );
-	}
-
-	if( !Table_Create(Table_Name, Table, Flags, bCommit) )
-	{
-		return( false );
-	}
-
-	if( !Table_Insert(Table_Name, Table, bCommit) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, const CSG_String &Select, const CSG_String &Name) const
-{
-	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
-
-	//-----------------------------------------------------
-	PGresult	*pResult	= PQexec(m_pgConnection, Select);
-
-	bool	bResult	= _Table_Load(Table, pResult);
-
-	Table.Set_Name(Name);
-
-	PQclear(pResult);
-
-	return( bResult );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, void *_pResult) const
-{
-	//-----------------------------------------------------
-	PGresult	*pResult	= (PGresult *)_pResult;
-
-	if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
-	{
-		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int		iField, nFields	= PQnfields(pResult);
-
-	if( nFields <= 0 )
-	{
-		_Error_Message(_TL("no fields in selection"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Table.Destroy();
-
-	for(iField=0; iField<nFields; iField++)
-	{
-		Table.Add_Field(PQfname(pResult, iField), Get_Type_From_SQL(PQftype(pResult, iField)));
-	}
-
-	//-----------------------------------------------------
-	int		iRecord, nRecords	= PQntuples(pResult);
-
-	for(iRecord=0; iRecord<nRecords && SG_UI_Process_Set_Progress(iRecord, nRecords); iRecord++)
-	{
-		CSG_Table_Record	*pRecord	= Table.Add_Record();
-
-		for(iField=0; pRecord && iField<nFields; iField++)
-		{
-			if( PQgetisnull(pResult, iRecord, iField) )
-			{
-				pRecord->Set_NoData(iField);
-			}
-			else switch( Table.Get_Field_Type(iField) )
-			{
-			default:
-				pRecord->Set_Value(iField, PQgetvalue(pResult, iRecord, iField));
-				break;
-
-			case SG_DATATYPE_Binary:
-				{
-					CSG_Bytes	Binary;
-					
-					Binary.fromHexString(PQgetvalue(pResult, iRecord, iField) + 2);
-
-					pRecord->Set_Value(iField, Binary);
-				}
-				break;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Load(CSG_Table &Table, const CSG_String &Table_Name)
-{
-	return( _Table_Load(Table, CSG_String::Format(SG_T("SELECT * FROM \"%s\""), Table_Name.c_str()), Table_Name) );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Table_Load(CSG_Table &Table, const CSG_String &Tables, const CSG_String &Fields, const CSG_String &Where, const CSG_String &Group, const CSG_String &Having, const CSG_String &Order, bool bDistinct)
-{
-	CSG_String	Select;
-
-	Select.Printf(SG_T("SELECT %s %s FROM %s"), bDistinct ? SG_T("DISTINCT") : SG_T("ALL"), Fields.c_str(), Tables.c_str());
-
-	if( Where.Length() )
-	{
-		Select	+= SG_T(" WHERE ") + Where;
-	}
-
-	if( Group.Length() )
-	{
-		Select	+= SG_T(" GROUP BY ") + Group;
-
-		if( Having.Length() )
-		{
-			Select	+= SG_T(" HAVING ") + Having;
-		}
-	}
-
-	if( Order.Length() )
-	{
-		Select	+= SG_T(" ORDER BY ") + Order;
-	}
-
-	return( _Table_Load(Table, Select, Table.Get_Name()) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Shapes_Load(CSG_Shapes *pShapes, const CSG_String &Name)
-{
-	CSG_Table	Info;
-
-	if( !Table_Load(Info, "geometry_columns", "*", "f_table_name='" + Name + "'") || Info.Get_Count() != 1 )
-	{
-		_Error_Message(_TL("table has no geometry field"));
-
-		return( false );
-	}
-
-	int	SRID	= Info[0].asInt("srid");
-
-	CSG_String	Fields, Geometry	= Info[0].asString("f_geometry_column");
-
-	Info	= Get_Field_Desc(Name);
-
-	if( Info.Get_Count() == 0 )
-	{
-		return( false );
-	}
-
-	for(int i=0; i<Info.Get_Count(); i++)
-	{
-		if( Geometry.Cmp(Info[i].asString(0)) )
-		{
-			Fields	+= CSG_String::Format(SG_T("\"%s\","), Info[i].asString(0));
-		}
-	}
-
-	bool	bBinary	= has_Version(9);	// previous versions did not support hex strings
-
-	Fields	+= (bBinary ? "ST_AsBinary(" : "ST_AsText(") + Geometry + ") AS __geometry__";
-
-	return( Shapes_Load(pShapes, Name, "SELECT " + Fields + " FROM \"" + Name + "\"", "__geometry__", bBinary, SRID) );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Shapes_Load(CSG_Shapes *pShapes, const CSG_String &Name, const CSG_String &Select, const CSG_String &Geometry_Field, bool bBinary, int SRID)
-{
-	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
-	if( !has_PostGIS () )	{	_Error_Message(_TL("not a PostGIS database"));	return( false );	}
-
-	//-----------------------------------------------------
-	PGresult	*pResult	= PQexec(m_pgConnection, Select);
-
-	if( PQresultStatus(pResult) != PGRES_TUPLES_OK )
-	{
-		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int		iField, jField, gField, nFields, iRecord, nRecords;
-
-	if( (nFields = PQnfields(pResult)) <= 0 )
-	{
-		_Error_Message(_TL("no fields in selection"));
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	if( (nRecords = PQntuples(pResult)) <= 0 )
-	{
-		_Error_Message(_TL("no records in selection"));
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(iField=0, gField=-1; gField<0 && iField<nFields; iField++)
-	{
-		if( !Geometry_Field.CmpNoCase(PQfname(pResult, iField)) )
-		{
-			gField	= iField;
-		}
-	}
-
-	if( gField < 0 )
-	{
-		_Error_Message(_TL("no geometry in selection"));
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	TSG_Shape_Type	Type;
-	CSG_Bytes		Binary;
-
-	if( bBinary )
-	{
-		Binary.fromHexString(PQgetvalue(pResult, 0, gField) + 2);
-
-		Type	= CSG_Shapes_OGIS_Converter::to_ShapeType(Binary.asDWord(1, false));
-	}
-	else
-	{
-		Type	= CSG_Shapes_OGIS_Converter::to_ShapeType(CSG_String(PQgetvalue(pResult, 0, gField)).BeforeFirst('('));
-	}
-
-	if( Type == SHAPE_TYPE_Undefined )
-	{
-		_Error_Message(_TL("unsupported vector type"));
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	pShapes->Create(Type, Name);
-
-	pShapes->Get_Projection().Create(SRID);
-
-	for(iField=0; iField<nFields; iField++)
-	{
-		if( iField != gField )
-		{
-			pShapes->Add_Field(PQfname(pResult, iField), Get_Type_From_SQL(PQftype(pResult, iField)));
-		}
-	}
-
-	//-----------------------------------------------------
-	for(iRecord=0; iRecord<nRecords && SG_UI_Process_Set_Progress(iRecord, nRecords); iRecord++)
-	{
-		CSG_Shape	*pRecord	= pShapes->Add_Shape();
-
-		if( bBinary )
-		{
-			Binary.fromHexString(PQgetvalue(pResult, iRecord, gField) + 2);
-
-			CSG_Shapes_OGIS_Converter::from_WKBinary(Binary, pRecord);
-		}
-		else
-		{
-			CSG_Shapes_OGIS_Converter::from_WKText(PQgetvalue(pResult, iRecord, gField), pRecord);
-		}
-
-		for(iField=0, jField=0; iField<nFields; iField++)
-		{
-			if( iField != gField )
-			{
-				if( PQgetisnull(pResult, iRecord, iField) )
-				{
-					pRecord->Set_NoData(jField++);
-				}
-				else switch( pShapes->Get_Field_Type(jField) )
-				{
-				default:
-					pRecord->Set_Value(jField++, PQgetvalue(pResult, iRecord, iField));
-					break;
-
-				case SG_DATATYPE_Binary:
-					Binary.fromHexString(PQgetvalue(pResult, iRecord, iField) + 2);
-
-					pRecord->Set_Value(jField++, Binary);
-					break;
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	PQclear(pResult);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Raster_Load(const CSG_String &Table, const CSG_String &Where, const CSG_String &Order, const CSG_String &Names, CSG_Parameter_Grid_List *pList)
-{
-	CSG_Table	Info;
-
-	if( !Table_Load(Info, "raster_columns", "*", CSG_String("r_table_name = '") + Table + "'") || Info.Get_Count() != 1 )
-	{
-		return( false );
-	}
-
-	CSG_String	Geometry	= Info[0].asString("r_raster_column");
-
-	//-----------------------------------------------------
-	if( Names.is_Empty() || !Table_Load(Info, Table, Names, Where, "", "", Order) )
-	{
-		Info.Destroy();
-	}
-
-	//-----------------------------------------------------
-	bool	bBinary	= true;
-
-	CSG_String	Select	= "COPY (SELECT ST_AsBinary(\"" + Geometry + "\") AS rastbin FROM \"" + Table + "\"";
-
-	if( Where.Length() )	Select	+= SG_T(" WHERE ")    + Where;
-	if( Order.Length() )	Select	+= SG_T(" ORDER BY ") + Order;
-
-	Select	+= ") TO STDOUT";	if( bBinary )	Select	+= " WITH (FORMAT 'binary')";
-
-	//-----------------------------------------------------
-	PGresult	*pResult	= PQexec(m_pgConnection, Select);
-
-	if( PQresultStatus(pResult) != PGRES_COPY_OUT )
-	{
-		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	char	*Bytes;
-	int		nBytes, nOkay, iBand;
-
-	for(iBand=0, nOkay=0; SG_UI_Process_Get_Okay() && (nBytes = PQgetCopyData(m_pgConnection, &Bytes, 0)) > 0; iBand++)
-	{
-		CSG_Bytes	Band;
-
-		if( bBinary )
-		{
-			int		Offset	= iBand == 0 ? 25 : 6;
-
-			if( *((short *)Bytes) > 0 && nBytes > Offset )
-			{
-				Band.Create((BYTE *)(Bytes + Offset), nBytes - Offset);
-			}
-		}
-		else if( nBytes > 3 )
-		{
-			Band.fromHexString(Bytes + 3);
-		}
-
-		PQfreemem(Bytes);
-
-		//-------------------------------------------------
-		CSG_Grid	*pGrid	= SG_Create_Grid();
-
-		if( Band.Get_Count() > 0 && CSG_Grid_OGIS_Converter::from_WKBinary(Band, pGrid) )
-		{
-			if( iBand < Info.Get_Count() )
-			{
-				pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"  ), Table.c_str(), Info[iBand].asString(0)));
-			}
-			else
-			{
-				pGrid->Set_Name(CSG_String::Format(SG_T("%s [%02d]"), Table.c_str(), iBand + 1));
-			}
-
-			SG_Get_Data_Manager().Add(pGrid);
-
-			if( pList )
-			{
-				pList->Add_Item(pGrid);
-			}
-
-			nOkay++;
-		}
-		else
-		{
-			delete(pGrid);
-		}
-	}
-
-	//-----------------------------------------------------
-	PQclear(pResult);
-
-	return( nOkay > 0 );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connection::Raster_Save(CSG_Grid *pGrid, int SRID, const CSG_String &Table, const CSG_String &Field)
-{
-	CSG_Table	Info;
-
-	if( !Table_Load(Info, "raster_columns", "*", CSG_String("r_table_name = '") + Table + "'") || Info.Get_Count() != 1 )
-	{
-		return( false );
-	}
-
-	CSG_String	Geometry	= Info[0].asString("r_raster_column");
-
-	//-----------------------------------------------------
-	bool	bBinary	= false;	// binary raster import not (yet??!!) supported
-
-	CSG_String	Select	= "COPY \"" + Table + "\" (\"" + Geometry + "\") FROM STDIN";	if( bBinary )	Select	+= " WITH (FORMAT 'binary')";
-
-	//-----------------------------------------------------
-	PGresult	*pResult	= PQexec(m_pgConnection, Select);
-
-	if( PQresultStatus(pResult) != PGRES_COPY_IN )
-	{
-		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
-
-		PQclear(pResult);
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Bytes	Band;
-
-	if( CSG_Grid_OGIS_Converter::to_WKBinary(Band, pGrid, SRID) )
-	{
-		if( bBinary )
-		{
-			PQputCopyData(m_pgConnection, (const char *)Band.Get_Bytes(), Band.Get_Count());
-		}
-		else
-		{
-			CSG_String	hex(Band.toHexString());
-
-			PQputCopyData(m_pgConnection, hex, hex.Length());
-		}
-
-		PQputCopyEnd (m_pgConnection, NULL);
-	}
-
-	//-----------------------------------------------------
-	PQclear(pResult);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_PG_Connections::CSG_PG_Connections(void)
-{
-	m_nConnections	= 0;
-	m_pConnections	= NULL;
-
-	Create();
-}
-
-//---------------------------------------------------------
-CSG_PG_Connections::~CSG_PG_Connections(void)
-{
-	Destroy();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Connections::Create(void)
-{
-	Destroy();
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connections::Destroy(void)
-{
-	if( m_pConnections )
-	{
-		for(int i=0; i<m_nConnections; i++)
-		{
-			delete(m_pConnections[i]);
-		}
-
-		SG_Free(m_pConnections);
-
-		m_nConnections	= 0;
-		m_pConnections	= NULL;
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_PG_Connection * CSG_PG_Connections::Add_Connection(const CSG_String &Name, const CSG_String &User, const CSG_String &Password, const CSG_String &Host, int Port)
-{
-	CSG_PG_Connection	*pConnection	= new CSG_PG_Connection(Host, Port, Name, User, Password);
-
-	if( pConnection )
-	{
-		if( pConnection->is_Connected() )
-		{
-			m_pConnections	= (CSG_PG_Connection **)SG_Realloc(m_pConnections, (m_nConnections + 1) * sizeof(CSG_PG_Connection *));
-
-			m_pConnections[m_nConnections++]	= pConnection;
-		}
-		else
-		{
-			delete(pConnection);
-
-			pConnection	= NULL;
-		}
-	}
-
-	return( pConnection );
-}
-
-//---------------------------------------------------------
-CSG_PG_Connection *  CSG_PG_Connections::Get_Connection(const CSG_String &Name)
-{
-	for(int i=0; i<m_nConnections; i++)
-	{
-		if( Name.Cmp(m_pConnections[i]->Get_Connection()) == 0 )
-		{
-			return( m_pConnections[i] );
-		}
-	}
-
-	return( NULL );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Connections::Del_Connection(int Index, bool bCommit)
-{
-	if( Index >= 0 && Index < m_nConnections )
-	{
-		if( m_pConnections[Index]->is_Transaction() )
-		{
-			if( bCommit )
-			{
-				m_pConnections[Index]->Commit();
-			}
-			else
-			{
-				m_pConnections[Index]->Rollback();
-			}
-		}
-
-		delete(m_pConnections[Index]);
-
-		for(m_nConnections--; Index<m_nConnections; Index++)
-		{
-			m_pConnections[Index]	= m_pConnections[Index + 1];
-		}
-
-		m_pConnections	= (CSG_PG_Connection **)SG_Realloc(m_pConnections, m_nConnections * sizeof(CSG_PG_Connection *));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-bool CSG_PG_Connections::Del_Connection(const CSG_String &Name, bool bCommit)
-{
-	for(int i=0; i<m_nConnections; i++)
-	{
-		if( Name.Cmp(m_pConnections[i]->Get_Connection()) == 0 )
-		{
-			return( Del_Connection(i, bCommit) );
-		}
-	}
-
-	return( false );
-}
-
-bool CSG_PG_Connections::Del_Connection(CSG_PG_Connection *pConnection, bool bCommit)
-{
-	return( !pConnection ? false : Del_Connection(pConnection->Get_Connection(), bCommit) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Strings CSG_PG_Connections::Get_Servers(void)
-{
-	CSG_Strings	Servers;
-
-	return( Servers );
-}
-
-//---------------------------------------------------------
-int CSG_PG_Connections::Get_Servers(CSG_Strings &Servers)
-{
-	Servers	= Get_Servers();
-
-	return( Servers.Get_Count() );
-}
-
-//---------------------------------------------------------
-int CSG_PG_Connections::Get_Servers(CSG_String &Servers)
-{
-	CSG_Strings		s	= Get_Servers();
-
-	for(int i=0; i<s.Get_Count(); i++)
-	{
-		Servers	+= s[i] + SG_T("|");
-	}
-
-	return( s.Get_Count() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Strings CSG_PG_Connections::Get_Connections(void)
-{
-	CSG_Strings		Connections;
-
-	for(int i=0; i<m_nConnections; i++)
-	{
-		Connections.Add(m_pConnections[i]->Get_Connection());
-	}
-
-	return( Connections );
-}
-
-//---------------------------------------------------------
-int CSG_PG_Connections::Get_Connections(CSG_String &Connections)
-{
-	Connections.Clear();
-
-	for(int i=0; i<m_nConnections; i++)
-	{
-		Connections	+= m_pConnections[i]->Get_Connection() + "|";
-	}
-
-	return( m_nConnections );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_PG_Module::CSG_PG_Module(void)
-{
-	if( !SG_UI_Get_Window_Main() )
-	{
-		Parameters.Add_String(
-			NULL	, "PG_HOST"		, _TL("Host"),
-			_TL("Password"),
-			SG_T("")
-		);
-
-		Parameters.Add_Value(
-			NULL	, "PG_PORT"		, _TL("Port"),
-			_TL(""),
-			PARAMETER_TYPE_Int, 5432, 0, true
-		);
-
-		Parameters.Add_String(
-			NULL	, "PG_NAME"		, _TL("Database"),
-			_TL("Database Name"),
-			SG_T("")
-		);
-
-		Parameters.Add_String(
-			NULL	, "PG_USER"		, _TL("User"),
-			_TL("User Name"),
-			SG_T("")
-		);
-
-		Parameters.Add_String(
-			NULL	, "PG_PWD"		, _TL("Password"),
-			_TL("Password"),
-			SG_T("")
-		);
-	}
-	else
-	{
-		Parameters.Add_Choice(
-			NULL	, "CONNECTION", _TL("Available Connections"),
-			_TL(""),
-			""
-		);
-	}
-
-	m_pConnection	= NULL;
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Module::On_Before_Execution(void)
-{
-	m_pConnection	= NULL;
-
-	if( !SG_UI_Get_Window_Main() )
-	{
-		m_pConnection	= SG_PG_Get_Connection_Manager().Add_Connection(
-			Parameters("PG_NAME")->asString(),
-			Parameters("PG_USER")->asString(),
-			Parameters("PG_PWD" )->asString(),
-			Parameters("PG_HOST")->asString(),
-			Parameters("PG_PORT")->asInt()
-		);
-	}
-	else
-	{
-		CSG_String	Connections;
-
-		int	nConnections	= SG_PG_Get_Connection_Manager().Get_Connections(Connections);
-
-		if( nConnections <= 0 )
-		{
-			Message_Dlg(
-				_TL("No PostgreSQL connection available!"),
-				_TL("PostgreSQL Database Connection Error")
-			);
-
-			return( false );
-		}
-
-		if( nConnections == 1 || !(m_pConnection = SG_PG_Get_Connection_Manager().Get_Connection(Parameters("CONNECTION")->asString())) )
-		{
-			m_pConnection	= SG_PG_Get_Connection_Manager().Get_Connection(0);
-		}
-
-		Parameters("CONNECTION")->asChoice()->Set_Items(Connections);
-		Parameters("CONNECTION")->Set_Enabled(nConnections > 1);
-		Parameters("CONNECTION")->Set_Value(m_pConnection->Get_Connection());
-
-		On_Parameter_Changed(&Parameters, Parameters("CONNECTION"));
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Module::On_After_Execution(void)
-{
-	if( !SG_UI_Get_Window_Main() )
-	{
-		SG_PG_Get_Connection_Manager().Del_Connection(m_pConnection, true);
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-int CSG_PG_Module::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( SG_UI_Get_Window_Main() )
-	{
-		//-------------------------------------------------
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG_GEOGCS")
-		||	!SG_STR_CMP(pParameter->Get_Identifier(), "CRS_EPSG_PROJCS") )
-		{
-			int		EPSG;
-
-			if( pParameter->asChoice()->Get_Data(EPSG) )
-			{
-				pParameters->Get_Parameter("CRS_EPSG")->Set_Value(EPSG);
-			}
-		}
-
-		//-------------------------------------------------
-		if( !SG_STR_CMP(pParameter->Get_Identifier(), "CONNECTION") )
-		{
-			m_pConnection	= SG_PG_Get_Connection_Manager().Get_Connection(pParameter->asString());
-
-			if( m_pConnection )
-			{
-				On_Connection_Changed(pParameters);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Module::Add_SRID_Picker(CSG_Parameters *pParameters)
-{
-	if( !pParameters )
-	{
-		pParameters	= &Parameters;
-	}
-
-	if( pParameters->Get_Parameter("CRS_EPSG") )
-	{
-		return( false );	// don't add twice ...
-	}
-
-	CSG_Parameter	*pNode	= pParameters->Add_Value(
-		NULL	, "CRS_EPSG"	, _TL("EPSG Code"),
-		_TL(""),
-		PARAMETER_TYPE_Int, -1, -1, true
-	);
-
-	if( SG_UI_Get_Window_Main() )
-	{
-		pParameters->Add_Choice(
-			pNode	, "CRS_EPSG_GEOGCS"	, _TL("Geographic Coordinate Systems"),
-			_TL(""),
-			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Geographic)
-		);
-
-		pParameters->Add_Choice(
-			pNode	, "CRS_EPSG_PROJCS"	, _TL("Projected Coordinate Systems"),
-			_TL(""),
-			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Projected)
-		);
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Module::Set_SRID_Picker_Enabled(CSG_Parameters *pParameters, bool bEnable)
-{
-	CSG_Parameter	*pParameter	= pParameters ? pParameters->Get_Parameter("CRS_EPSG") : NULL;
-
-	if( pParameter )
-	{
-		pParameter->Set_Enabled(bEnable);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_PG_Module::Set_SRID(CSG_Parameters *pParameters, int SRID)
-{
-	CSG_Parameter	*pParameter	= pParameters ? pParameters->Get_Parameter("CRS_EPSG") : NULL;
-
-	CSG_Projection	Projection;
-
-	if( pParameter && SG_Get_Projections().Get_Projection(Projection, SRID) )
-	{
-		pParameter->Set_Value(SRID);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-int CSG_PG_Module::Get_SRID(CSG_Parameters *pParameters)
-{
-	if( !pParameters )
-	{
-		pParameters	= &Parameters;
-	}
-
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("CRS_EPSG");
-
-	return( pParameter ? pParameter->asInt() : -1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_PG_Module::Set_Constraints(CSG_Parameters *pParameters, const CSG_String &Identifier)
-{
-	CSG_Parameter	*pParent	= pParameters ? pParameters->Get_Parameter(Identifier) : NULL;
-
-	if( !pParent || (pParent->Get_Type() != PARAMETER_TYPE_Table && pParent->Get_Type() != PARAMETER_TYPE_Shapes) )
-	{
-		return( false );
-	}
-
-	pParameters->Add_Table_Fields(pParent, Identifier + "_PK", _TL("Primary Key"), _TL(""));
-	pParameters->Add_Table_Fields(pParent, Identifier + "_NN", _TL("Not Null"   ), _TL(""));
-	pParameters->Add_Table_Fields(pParent, Identifier + "_UQ", _TL("Unique"     ), _TL(""));
-
-	return( true );
-}
-
-//---------------------------------------------------------
-CSG_Buffer CSG_PG_Module::Get_Constraints(CSG_Parameters *pParameters, const CSG_String &Identifier)
-{
-	CSG_Buffer		Flags;
-
-	CSG_Parameter	*pParent	= pParameters ? pParameters->Get_Parameter(Identifier) : NULL;
-
-	if( !pParent || (pParent->Get_Type() != PARAMETER_TYPE_Table && pParent->Get_Type() != PARAMETER_TYPE_Shapes) )
-	{
-		return( Flags );
-	}
-
-	CSG_Parameter	*pFields;
-
-	Flags.Set_Size(((CSG_Table *)pParent->asDataObject())->Get_Field_Count());
-
-	memset(Flags.Get_Data(), 0, Flags.Get_Size());
-
-	if( (pFields = pParameters->Get_Parameter(Identifier + "_PK")) != NULL && pFields->Get_Type() == PARAMETER_TYPE_Table_Fields )
-	{
-		for(int i=0, Index; i<pFields->asTableFields()->Get_Count(); i++)
-		{
-			if( (Index = pFields->asTableFields()->Get_Index(i)) >= 0 && Index < (int)Flags.Get_Size() )
-			{
-				Flags.Get_Data()[Index]	|= SG_PG_PRIMARY_KEY;
-			}
-		}
-	}
-
-	if( (pFields = pParameters->Get_Parameter(Identifier + "_NN")) != NULL && pFields->Get_Type() == PARAMETER_TYPE_Table_Fields )
-	{
-		for(int i=0, Index; i<pFields->asTableFields()->Get_Count(); i++)
-		{
-			if( (Index = pFields->asTableFields()->Get_Index(i)) >= 0 && Index < (int)Flags.Get_Size() )
-			{
-				Flags.Get_Data()[Index]	|= SG_PG_NOT_NULL;
-			}
-		}
-	}
-
-	if( (pFields = pParameters->Get_Parameter(Identifier + "_UQ")) != NULL && pFields->Get_Type() == PARAMETER_TYPE_Table_Fields )
-	{
-		for(int i=0, Index; i<pFields->asTableFields()->Get_Count(); i++)
-		{
-			if( (Index = pFields->asTableFields()->Get_Index(i)) >= 0 && Index < (int)Flags.Get_Size() )
-			{
-				Flags.Get_Data()[Index]	|= SG_PG_UNIQUE;
-			}
-		}
-	}
-
-	return( Flags );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_pgsql/io_pgsql.h b/src/modules_io/db/io_pgsql/io_pgsql.h
deleted file mode 100644
index 5d97409..0000000
--- a/src/modules_io/db/io_pgsql/io_pgsql.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/**********************************************************
- * Version $Id: io_pgsql.cpp 911 2011-11-11 11:11:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                      io_pgsql.h                       //
-//                                                       //
-//                 Copyright (C) 2013 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.de                    //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__io_pgsql_H
-#define HEADER_INCLUDED__io_pgsql_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SG_PG_PRIMARY_KEY	0x01
-#define SG_PG_NOT_NULL		0x02
-#define SG_PG_UNIQUE		0x04
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_pgsql_EXPORT CSG_PG_Connection
-{
-	friend class CSG_PG_Connections;
-
-public:
-
-	static CSG_String			Get_Type_To_SQL			(TSG_Data_Type Type, int Size = 0);
-	static TSG_Data_Type		Get_Type_From_SQL		(int Type);
-	static CSG_String			Get_Raster_Type_To_SQL	(TSG_Data_Type Type);
-
-	void						GUI_Update				(void)	const;
-
-	bool						is_Connected			(void)	const	{	return( m_pConnection != NULL );	}
-
-	CSG_String					Get_Connection			(void)	const;
-
-	CSG_String					Get_Host				(void)	const;
-	CSG_String					Get_Port				(void)	const;
-	CSG_String					Get_User				(void)	const;
-	CSG_String					Get_DBName				(void)	const;
-	CSG_String					Get_Version				(void)	const;
-	bool						has_Version				(int Major, int Minor = 0, int Revision = 0) const;
-
-	CSG_String					Get_PostGIS				(void)	const;
-	bool						has_PostGIS				(double minVersion = 0.0);
-
-	int							Get_Tables				(CSG_Strings &Tables)			const;
-	CSG_String					Get_Tables				(void)							const;
-	CSG_String					Get_Field_Names			(const CSG_String &Table_Name)	const;
-	CSG_Table					Get_Field_Desc			(const CSG_String &Table_Name)	const;
-
-	bool						Execute					(const CSG_String &SQL, CSG_Table *pTable = NULL);
-
-	bool						Begin					(const CSG_String &SavePoint = "");
-	bool						Rollback				(const CSG_String &SavePoint = "");
-	bool						Commit					(const CSG_String &SavePoint = "");
-	bool						is_Transaction			(void)	const	{	return( is_Connected() && m_bTransaction );	}
-
-	bool						Table_Exists			(const CSG_String &Table_Name)	const;
-
-	bool						Table_Create			(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
-	bool						Table_Drop				(const CSG_String &Table_Name                                                     , bool bCommit = true);
-	bool						Table_Insert			(const CSG_String &Table_Name, const CSG_Table &Table                             , bool bCommit = true);
-	bool						Table_Save				(const CSG_String &Table_Name, const CSG_Table &Table, const CSG_Buffer &Flags = 0, bool bCommit = true);
-
-	bool						Table_Load				(CSG_Table &Data, const CSG_String &Table );
-	bool						Table_Load				(CSG_Table &Data, const CSG_String &Tables, const CSG_String &Fields, const CSG_String &Where = "", const CSG_String &Group = "", const CSG_String &Having = "", const CSG_String &Order = "", bool bDistinct = false);
-
-	bool						Shapes_Load				(CSG_Shapes *pShapes, const CSG_String &Table);
-	bool						Shapes_Load				(CSG_Shapes *pShapes, const CSG_String &Name, const CSG_String &Select, const CSG_String &Geometry_Field, bool bBinary, int SRID = -1);
-
-	bool						Raster_Load				(const CSG_String &Table, const CSG_String &Where = "", const CSG_String &Order = "", const CSG_String &Names = "", CSG_Parameter_Grid_List *pList = NULL);
-	bool						Raster_Save				(CSG_Grid *pGrid, int SRID, const CSG_String &Table, const CSG_String &Field);
-	
-
-private:
-
-								CSG_PG_Connection		(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit = false);
-	bool						Create					(const CSG_String &Host, int Port, const CSG_String &Name, const CSG_String &User, const CSG_String &Password, bool bAutoCommit = false);
-
-	virtual ~CSG_PG_Connection(void);
-
-	bool						Destroy					(void);
-
-
-private:
-
-	void						*m_pConnection;
-
-	bool						m_bTransaction;
-
-
-	bool						_Table_Load				(CSG_Table &Data, const CSG_String &Select, const CSG_String &Name = "")	const;
-	bool						_Table_Load				(CSG_Table &Data, void *pResult)	const;
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_pgsql_EXPORT CSG_PG_Connections
-{
-public:
-	CSG_PG_Connections(void);
-	virtual ~CSG_PG_Connections(void);
-
-	bool						Create					(void);
-	bool						Destroy					(void);
-
-	int							Get_Servers				(CSG_String  &Servers);
-	int							Get_Servers				(CSG_Strings &Servers);
-	CSG_Strings					Get_Servers				(void);
-
-	int							Get_Connections			(CSG_String &Connections);
-	CSG_Strings					Get_Connections			(void);
-
-	int							Get_Count				(void)		{	return( m_nConnections );	}
-	CSG_PG_Connection *			Get_Connection			(int Index)	{	return( Index >= 0 && Index < m_nConnections ? m_pConnections[Index] : NULL );	}
-	CSG_PG_Connection *			Get_Connection			(const CSG_String &Name);
-	CSG_PG_Connection *			Add_Connection			(const CSG_String &Name, const CSG_String &User, const CSG_String &Password, const CSG_String &Host = "localhost", int Port = 5432);
-	bool						Del_Connection			(int Index                     , bool bCommit);
-	bool						Del_Connection			(const CSG_String &Name        , bool bCommit);
-	bool						Del_Connection			(CSG_PG_Connection *pConnection, bool bCommit);
-
-
-private:
-
-	int							m_nConnections;
-
-	CSG_PG_Connection			**m_pConnections;
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_pgsql_EXPORT CSG_PG_Module : public CSG_Module
-{
-public:
-	CSG_PG_Module(void);
-
-
-protected:
-
-	virtual bool				On_Before_Execution		(void);
-	virtual bool				On_After_Execution		(void);
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters)	{}
-
-	CSG_PG_Connection *			Get_Connection			(void)	{	return( m_pConnection );	}
-
-	bool						Add_SRID_Picker			(CSG_Parameters *pParameters = NULL);
-	bool						Set_SRID_Picker_Enabled	(CSG_Parameters *pParameters, bool bEnable = true);
-	bool						Set_SRID				(CSG_Parameters *pParameters, int SRID);
-	int							Get_SRID				(CSG_Parameters *pParameters = NULL);
-
-	static bool					Set_Constraints			(CSG_Parameters *pParameters, const CSG_String &Identifier);
-	static CSG_Buffer			Get_Constraints			(CSG_Parameters *pParameters, const CSG_String &Identifier);
-
-
-private:
-
-	CSG_PG_Connection			*m_pConnection;
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-io_pgsql_EXPORT CSG_PG_Connections &	SG_PG_Get_Connection_Manager	(void);
-
-//---------------------------------------------------------
-io_pgsql_EXPORT bool					SG_PG_is_Supported				(void);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__io_pgsql_H
diff --git a/src/modules_io/db/io_pgsql/pgis_raster.cpp b/src/modules_io/db/io_pgsql/pgis_raster.cpp
deleted file mode 100644
index fa8c6b2..0000000
--- a/src/modules_io/db/io_pgsql/pgis_raster.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-/**********************************************************
- * Version $Id: pgis_raster.cpp 1646 2013-04-10 16:29:00Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    pgis_raster.cpp                    //
-//                                                       //
-//                 Copyright (C) 2013 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 "pgis_raster.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CRaster_Load::CRaster_Load(void)
-{
-	Set_Name		(_TL("Import Raster from PostGIS"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Imports grids from a PostGIS database."
-	));
-
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CRaster_Load::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_String	s;
-	CSG_Table	t;
-
-	if( Get_Connection()->Table_Load(t, SG_T("raster_columns")) )
-	{
-		for(int i=0; i<t.Get_Count(); i++)
-		{
-			s	+= t[i].asString(SG_T("r_table_name")) + CSG_String("|");
-		}
-	}
-
-	pParameters->Get_Parameter("TABLES")->asChoice()->Set_Items(s);
-}
-
-//---------------------------------------------------------
-bool CRaster_Load::On_Execute(void)
-{
-	CSG_String	Table	= Parameters("TABLES")->asString();
-
-	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
-
-	pGrids->Del_Items();
-
-	if( !Get_Connection()->Raster_Load(Table, "", "", "", pGrids) )//, "rid=4") )
-	{
-		return( false );
-	}
-
-	return( pGrids->Get_Count() > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CRaster_Save::CRaster_Save(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Export Raster to PostGIS"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Exports grids to a PostGIS database."
-	));
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid_System(
-		NULL	, "GRID_SYSTEM"	, _TL("Grid System"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_List(
-		pNode	, "GRIDS"		, _TL("Bands"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_String(
-		NULL	, "NAME"		, _TL("Table Name"),
-		_TL(""),
-		""
-	);
-
-	Parameters.Add_Value(
-		NULL	, "GRID_NAME"	, _TL("Add Grid Name Field"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Add_SRID_Picker();
-}
-
-//---------------------------------------------------------
-bool CRaster_Save::On_Execute(void)
-{
-	if( !Get_Connection()->Table_Exists(SG_T("spatial_ref_sys")) || !Get_Connection()->Table_Exists(SG_T("geometry_columns")) )
-	{
-		SG_UI_Dlg_Message(_TL("Not a valid PostGIS database!"), _TL("Database Connection Error"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
-
-	CSG_String	SavePoint, Name	= Parameters("NAME")->asString();
-
-	if( Name.Length() == 0 )
-		return( false );
-
-	bool	bGridName	= Parameters("GRID_NAME")->asBool();
-
-	//-----------------------------------------------------
-	Get_Connection()->Begin(SavePoint = Get_Connection()->is_Transaction() ? "RASTER_SAVE" : "");
-
-	//-----------------------------------------------------
-	if( !Get_Connection()->Table_Exists(Name) )
-	{
-		CSG_String	SQL	= "CREATE TABLE \"" + Name + "\" (\"rid\" serial PRIMARY KEY, \"raster\" raster"
-			+ (bGridName ? ", \"name\" varchar(64))" : ")");
-		
-		if( !Get_Connection()->Execute(SQL) )
-		{
-			Get_Connection()->Rollback(SavePoint);
-
-			return( false );
-		}
-	}
-
-	//-----------------------------------------------------
-	for(int i=0; i<pGrids->Get_Count(); i++)
-	{
-		CSG_Bytes	WKB;
-
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %s [%d/%d]"), _TL("export grid"), pGrids->asGrid(i)->Get_Name(), i + 1, pGrids->Get_Count()));
-
-		if( !bGridName )
-		{
-			if( !Get_Connection()->Raster_Save(pGrids->asGrid(i), Get_SRID(), Name, "") )
-			{
-				Get_Connection()->Rollback(SavePoint);
-
-				return( false );
-			}
-		}
-		else if( CSG_Grid_OGIS_Converter::to_WKBinary(WKB, pGrids->asGrid(i), Get_SRID()) )
-		{
-			CSG_String	SQL	= "INSERT INTO \"" + Name + "\" (\"raster\", \"name\") VALUES("
-				+ "ST_AddBand('" + WKB.toHexString() + "'::raster, '"
-				+ CSG_PG_Connection::Get_Raster_Type_To_SQL(pGrids->asGrid(i)->Get_Type()) + "'::text, 0, NULL), '"
-				+ pGrids->asGrid(i)->Get_Name() + "')";
-
-			if( !Get_Connection()->Execute(SQL) )
-			{
-				Get_Connection()->Rollback(SavePoint);
-
-				return( false );
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Get_Connection()->Commit(SavePoint);
-
-	Get_Connection()->GUI_Update();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CRaster_SRID_Update::CRaster_SRID_Update(void)
-{
-	Set_Name		(_TL("Update Raster SRID"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		" Change the SRID of all rasters in the user-specified column and table."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-
-	Add_SRID_Picker();
-}
-
-//---------------------------------------------------------
-void CRaster_SRID_Update::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_String	s;
-	CSG_Table	t;
-
-	if( Get_Connection()->Table_Load(t, SG_T("raster_columns")) )
-	{
-		for(int i=0; i<t.Get_Count(); i++)
-		{
-			s	+= t[i].asString(SG_T("r_table_name")) + CSG_String("|");
-		}
-	}
-
-	pParameters->Get_Parameter("TABLES")->asChoice()->Set_Items(s);
-}
-
-//---------------------------------------------------------
-bool CRaster_SRID_Update::On_Execute(void)
-{
-	if( !Get_Connection()->has_PostGIS(2.1) )	{	Error_Set(_TL("not supported by PostGIS versions less than 2.1"));	return( false );	}
-
-	//-----------------------------------------------------
-	CSG_String	Select;
-	CSG_Table	Table;
-
-	Select.Printf(SG_T("r_table_name='%s'"), Parameters("TABLES")->asString());
-
-	if( !Get_Connection()->Table_Load(Table, "raster_columns", "*", Select) || Table.Get_Count() != 1 )
-	{
-		return( false );
-	}
-
-	Select.Printf(SG_T("SELECT UpdateRasterSRID('%s', '%s', %d)"),
-		Parameters("TABLES")->asString(),
-		Table[0].asString("r_raster_column"),
-		Get_SRID()
-	);
-
-	//-----------------------------------------------------
-	if( !Get_Connection()->Execute(Select) )
-	{
-		return( false );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-	
\ No newline at end of file
diff --git a/src/modules_io/db/io_pgsql/pgis_raster.h b/src/modules_io/db/io_pgsql/pgis_raster.h
deleted file mode 100644
index b1f2126..0000000
--- a/src/modules_io/db/io_pgsql/pgis_raster.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/**********************************************************
- * Version $Id: pgis_raster.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     pgis_raster.h                     //
-//                                                       //
-//                 Copyright (C) 2013 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__pgis_raster_H
-#define HEADER_INCLUDED__pgis_raster_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CRaster_Load : public CSG_PG_Module
-{
-public:
-	CRaster_Load(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Raster") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CRaster_Save : public CSG_PG_Module
-{
-public:
-	CRaster_Save(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Raster") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CRaster_SRID_Update : public CSG_PG_Module
-{
-public:
-	CRaster_SRID_Update(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Raster") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__pgis_raster_H
diff --git a/src/modules_io/db/io_pgsql/pgis_shapes.cpp b/src/modules_io/db/io_pgsql/pgis_shapes.cpp
deleted file mode 100644
index 2262257..0000000
--- a/src/modules_io/db/io_pgsql/pgis_shapes.cpp
+++ /dev/null
@@ -1,445 +0,0 @@
-/**********************************************************
- * Version $Id: pgis_shapes.cpp 1646 2013-04-10 16:29:00Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   PGIS_Shapes.cpp                     //
-//                                                       //
-//                 Copyright (C) 2013 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 "pgis_shapes.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CShapes_Load::CShapes_Load(void)
-{
-	Set_Name		(_TL("Import Shapes from PostGIS"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Imports shapes from a PostGIS database."
-	));
-
-	Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CShapes_Load::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_String	s;
-	CSG_Table	t;
-
-	if( Get_Connection()->Table_Load(t, SG_T("geometry_columns")) )
-	{
-		for(int i=0; i<t.Get_Count(); i++)
-		{
-			s	+= t[i].asString(SG_T("f_table_name")) + CSG_String("|");
-		}
-	}
-
-	Parameters("TABLES")->asChoice()->Set_Items(s);
-}
-
-//---------------------------------------------------------
-bool CShapes_Load::On_Execute(void)
-{
-	CSG_Shapes	*pShapes	= Parameters("SHAPES")->asShapes();
-	CSG_String	Name		= Parameters("TABLES")->asString();
-
-	if( !Get_Connection()->Shapes_Load(pShapes, Name) )
-	{
-		Error_Set(_TL("unable to load vector data from PostGIS database") + CSG_String(":\n") + Name);
-
-		return( false );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CShapes_Save::CShapes_Save(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Export Shapes to PostGIS"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Exports shapes to a PostGIS database."
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Set_Constraints(&Parameters, "SHAPES");
-
-	Parameters.Add_String(
-		NULL	, "NAME"		, _TL("Table Name"),
-		_TL("if empty shapes layers's name is used as table name"),
-		SG_T("")
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "EXISTS"		, _TL("If table exists..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("abort export"),
-			_TL("replace existing table"),
-			_TL("append records, if table structure allows")
-		), 0
-	);
-
-	Add_SRID_Picker();
-}
-
-//---------------------------------------------------------
-int CShapes_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHAPES") )
-	{
-		CSG_Shapes	*pShapes	= pParameter->asShapes() ? pParameter->asShapes() : NULL;
-
-		pParameters->Get_Parameter("NAME")->Set_Value(pShapes ? pShapes->Get_Name() : SG_T(""));
-
-		Set_SRID(pParameters, pShapes ? pShapes->Get_Projection().Get_EPSG() : -1);
-	}
-
-	return( CSG_PG_Module::On_Parameter_Changed(pParameters, pParameter) );
-}
-
-//---------------------------------------------------------
-bool CShapes_Save::On_Execute(void)
-{
-	if( !Get_Connection()->has_PostGIS() )
-	{
-		Error_Set(_TL("not a valid PostGIS database!"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Shapes	*pShapes;
-	CSG_String	SQL, Name, Type, Field, SavePoint;
-
-	pShapes		= Parameters("SHAPES")->asShapes();
-	Name		= Parameters("NAME"  )->asString();	if( Name.Length() == 0 )	Name	= pShapes->Get_Name();
-
-	Field		= "geometry";
-
-	int	SRID	= Get_SRID();
-
-	//-----------------------------------------------------
-	if( !CSG_Shapes_OGIS_Converter::from_ShapeType(Type, pShapes->Get_Type(), pShapes->Get_Vertex_Type()) )
-	{
-		Error_Set(_TL("invalid or unsupported shape or vertex type"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Get_Connection()->Begin(SavePoint = Get_Connection()->is_Transaction() ? "SHAPES_SAVE" : "");
-
-	//-----------------------------------------------------
-	if( Get_Connection()->Table_Exists(Name) )
-	{
-		Message_Add(_TL("table already exists") + CSG_String(": ") + Name);
-
-		switch( Parameters("EXISTS")->asInt() )
-		{
-		case 0:	// abort export
-			return( false );
-
-		case 1:	// replace existing table
-			Message_Add(_TL("trying to drop table") + CSG_String(": ") + Name);
-
-			if( !Get_Connection()->Table_Drop(Name, false) )
-			{
-				Message_Add(CSG_String(" ...") + _TL("failed") + "!");
-
-				return( false );
-			}
-
-			break;
-
-		case 2:	// append records, if table structure allows
-			break;
-		}
-	}
-
-	//-----------------------------------------------------
-	if( !Get_Connection()->Table_Exists(Name) )
-	{
-		if( !Get_Connection()->Table_Create(Name, *pShapes, Get_Constraints(&Parameters, "SHAPES"), false) )
-		{
-			Error_Set(_TL("could not create table"));
-
-			Get_Connection()->Rollback(SavePoint);
-
-			return( false );
-		}
-
-		//-------------------------------------------------
-		// SELECT AddGeometryColumn(<table_name>, <column_name>, <srid>, <type>, <dimension>)
-
-		SQL.Printf(SG_T("SELECT AddGeometryColumn('%s', '%s', %d, '%s', %d)"),
-			Name.c_str(), Field.c_str(), SRID, Type.c_str(),
-			pShapes->Get_Vertex_Type() == SG_VERTEX_TYPE_XY  ? 2 :
-			pShapes->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZ ? 3 : 4
-		);
-
-		if( !Get_Connection()->Execute(SQL) )
-		{
-			Error_Set(_TL("could not create geometry field"));
-
-			Get_Connection()->Rollback(SavePoint);
-
-			return( false );
-		}
-	}
-
-	//-----------------------------------------------------
-	bool	bBinary	= Get_Connection()->has_Version(9);
-
-	int		iShape, iField, nAdded;
-
-	CSG_String	Insert	= "INSERT INTO \"" + Name + "\" (" + Field;
-
-	for(iField=0; iField<pShapes->Get_Field_Count(); iField++)
-	{
-		Insert	+= CSG_String(", ") + pShapes->Get_Field_Name(iField);
-	}
-
-	Insert	+= ") VALUES (";
-
-	//-----------------------------------------------------
-	for(iShape=0, nAdded=0; iShape==nAdded && iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
-
-		if( pShape->is_Valid() )
-		{
-			SQL	= Insert;
-
-			if( bBinary )
-			{
-				CSG_Bytes	WKB;
-
-				CSG_Shapes_OGIS_Converter::to_WKBinary(pShape, WKB);
-
-				SQL	+= "ST_GeomFromWKB(E'\\\\x" + WKB.toHexString() + CSG_String::Format(SG_T("', %d)"), SRID);
-			}
-			else
-			{
-				CSG_String	WKT;
-
-				CSG_Shapes_OGIS_Converter::to_WKText(pShape, WKT);
-
-				SQL	+= "ST_GeomFromText('" + WKT + CSG_String::Format(SG_T("', %d)"), SRID);
-			}
-
-			for(iField=0; iField<pShapes->Get_Field_Count(); iField++)
-			{
-				CSG_String	s = pShape->asString(iField);
-
-				if( pShapes->Get_Field_Type(iField) == SG_DATATYPE_String )
-				{
-					s.Replace(SG_T("'"), SG_T("\""));
-					s	= SG_T("'") + s + SG_T("'");
-				}
-
-				SQL	+= SG_T(", ")  + s;
-			}
-
-			SQL	+= SG_T(")");
-
-			if( Get_Connection()->Execute(SQL) )
-			{
-				nAdded++;
-			}
-			else
-			{
-				Message_Add(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("could not save shape"), 1 + iShape, pShapes->Get_Count()));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( nAdded < pShapes->Get_Count() )
-	{
-		Message_Add(SQL);
-
-		Get_Connection()->Rollback(SavePoint);
-
-		return( false );
-	}
-
-	Get_Connection()->Commit(SavePoint);
-
-	Get_Connection()->GUI_Update();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CShapes_SRID_Update::CShapes_SRID_Update(void)
-{
-	Set_Name		(_TL("Update Shapes SRID"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		" Change the SRID of all geometries in the user-specified column and table."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-
-	Add_SRID_Picker();
-}
-
-//---------------------------------------------------------
-void CShapes_SRID_Update::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_String	s;
-	CSG_Table	t;
-
-	if( Get_Connection()->Table_Load(t, SG_T("geometry_columns")) )
-	{
-		for(int i=0; i<t.Get_Count(); i++)
-		{
-			s	+= t[i].asString(SG_T("f_table_name")) + CSG_String("|");
-		}
-	}
-
-	pParameters->Get_Parameter("TABLES")->asChoice()->Set_Items(s);
-}
-
-//---------------------------------------------------------
-bool CShapes_SRID_Update::On_Execute(void)
-{
-	if( !Get_Connection()->has_PostGIS() )	{	Error_Set(_TL("no PostGIS layer"));	return( false );	}
-
-	//-----------------------------------------------------
-	CSG_String	Select;
-	CSG_Table	Table;
-
-	Select.Printf(SG_T("f_table_name='%s'"), Parameters("TABLES")->asString());
-
-	if( !Get_Connection()->Table_Load(Table, "geometry_columns", "*", Select) || Table.Get_Count() != 1 )
-	{
-		return( false );
-	}
-
-	Select.Printf(SG_T("SELECT UpdateGeometrySRID('%s', '%s', %d)"),
-		Parameters("TABLES")->asString(),
-		Table[0].asString("f_geometry_column"),
-		Get_SRID()
-	);
-
-	//-----------------------------------------------------
-	if( !Get_Connection()->Execute(Select) )
-	{
-		return( false );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_pgsql/pgis_shapes.h b/src/modules_io/db/io_pgsql/pgis_shapes.h
deleted file mode 100644
index ce2dfcd..0000000
--- a/src/modules_io/db/io_pgsql/pgis_shapes.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/**********************************************************
- * Version $Id: pgis_shapes.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     PGIS_Shapes.h                     //
-//                                                       //
-//                 Copyright (C) 2013 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__PGIS_Shapes_H
-#define HEADER_INCLUDED__PGIS_Shapes_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CShapes_Load : public CSG_PG_Module
-{
-public:
-	CShapes_Load(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Shapes") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CShapes_Save : public CSG_PG_Module
-{
-public:
-	CShapes_Save(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Shapes") );	}
-
-
-protected:
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CShapes_SRID_Update : public CSG_PG_Module
-{
-public:
-	CShapes_SRID_Update(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Shapes") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__PGIS_Shapes_H
diff --git a/src/modules_io/db/io_pgsql/table.cpp b/src/modules_io/db/io_pgsql/table.cpp
deleted file mode 100644
index d60af69..0000000
--- a/src/modules_io/db/io_pgsql/table.cpp
+++ /dev/null
@@ -1,489 +0,0 @@
-/**********************************************************
- * Version $Id: table.cpp 1508 2012-11-01 16:13:43Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       Table.cpp                       //
-//                                                       //
-//                 Copyright (C) 2013 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 "get_connection.h"
-
-#include "table.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_List::CTable_List(void)
-{
-	Set_Name		(_TL("List Tables"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Lists all tables of an PostgreSQL data source."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-//---------------------------------------------------------
-bool CTable_List::On_Execute(void)
-{
-	CSG_Strings	Tables;
-	CSG_Table	*pTables	= Parameters("TABLES")->asTable();
-
-	pTables->Destroy();
-	pTables->Set_Name(Get_Connection()->Get_Connection() + " [" + _TL("Tables") + "]");
-
-	pTables->Add_Field(_TL("Table"), SG_DATATYPE_String);
-	pTables->Add_Field(_TL("Type" ), SG_DATATYPE_String);
-
-	if( Get_Connection()->Get_Tables(Tables) )
-	{
-		CSG_Table	t;
-
-		for(int i=0; i<Tables.Get_Count(); i++)
-		{
-			CSG_Table_Record	*pTable	= pTables->Add_Record();
-
-			pTable->Set_Value(0, Tables[i]);
-
-			if( Get_Connection()->Table_Load(t, "geometry_columns", "type", CSG_String::Format(SG_T("f_table_name='%s'"), Tables[i].c_str())) && t.Get_Count() == 1 )
-			{
-				pTable->Set_Value(1, t[0][0].asString());
-			}
-			else if( Get_Connection()->Table_Load(t, "raster_columns", "*", CSG_String::Format(SG_T("r_table_name='%s'"), Tables[i].c_str())) && t.Get_Count() == 1 )
-			{
-				pTable->Set_Value(1, "RASTER");
-			}
-			else
-			{
-				pTable->Set_Value(1, "TABLE");
-			}
-		}
-	}
-
-	return( pTables->Get_Count() > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Info::CTable_Info(void)
-{
-	Set_Name		(_TL("List Table Fields"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Loads table information from PostgreSQL data source."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Field Description"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CTable_Info::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
-
-	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
-	pParameter->Set_Value(pParameter->asString());
-}
-
-//---------------------------------------------------------
-bool CTable_Info::On_Execute(void)
-{
-	CSG_String	Table	= Parameters("TABLES")->asString();
-	CSG_Table	*pTable	= Parameters("TABLE" )->asTable();
-
-	CSG_Table tab = Get_Connection()->Get_Field_Desc(Table);
-	pTable->Assign(&tab);
-	pTable->Set_Name(Table + " [" + _TL("Field Description") + "]");
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Load::CTable_Load(void)
-{
-	Set_Name		(_TL("Import Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Imports a table from a PostgreSQL database."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Table"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CTable_Load::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
-
-	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
-	pParameter->Set_Value(pParameter->asString());
-}
-
-//---------------------------------------------------------
-bool CTable_Load::On_Execute(void)
-{
-	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
-
-	return( Get_Connection()->Table_Load(*pTable, Parameters("TABLES")->asString()) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Save::CTable_Save(void)
-{
-	Set_Name		(_TL("Export Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Exports a table to a PostgreSQL database."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Table"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Set_Constraints(&Parameters, "TABLE");
-
-	Parameters.Add_String(
-		NULL	, "NAME"		, _TL("Table Name"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "EXISTS"		, _TL("If table exists..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("abort export"),
-			_TL("replace existing table"),
-			_TL("append records, if table structure allows")
-		), 0
-	);
-}
-
-//---------------------------------------------------------
-int CTable_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) )
-	{
-		pParameters->Get_Parameter("NAME")->Set_Value(pParameter->asTable() ? pParameter->asTable()->Get_Name() : SG_T(""));
-	}
-
-	return( CSG_PG_Module::On_Parameter_Changed(pParameters, pParameter) );
-}
-
-//---------------------------------------------------------
-bool CTable_Save::On_Execute(void)
-{
-	bool		bResult	= false;
-	CSG_Table	*pTable	= Parameters("TABLE")->asTable();
-	CSG_String	Name	= Parameters("NAME" )->asString();	if( Name.Length() == 0 )	Name	= pTable->Get_Name();
-
-	//-----------------------------------------------------
-	CSG_String	SavePoint;
-
-	Get_Connection()->Begin(SavePoint = Get_Connection()->is_Transaction() ? "SHAPES_SAVE" : "");
-
-	//-----------------------------------------------------
-	if( Get_Connection()->Table_Exists(Name) )
-	{
-		Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Name.c_str()));
-
-		switch( Parameters("EXISTS")->asInt() )
-		{
-		case 0:	// abort export
-			break;
-
-		case 1:	// replace existing table
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("dropping table"), Name.c_str()));
-
-			if( !Get_Connection()->Table_Drop(Name, false) )
-			{
-				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
-			}
-			else
-			{
-				bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(&Parameters, "TABLE"));
-			}
-			break;
-
-		case 2:	// append records, if table structure allows
-			Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("appending to existing table"), Name.c_str()));
-
-			if( !(bResult = Get_Connection()->Table_Insert(Name, *pTable)) )
-			{
-				Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed")));
-			}
-			break;
-		}
-	}
-	else
-	{
-		bResult	= Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(&Parameters, "TABLE"));
-	}
-
-	//-----------------------------------------------------
-	if( !bResult )
-	{
-		Get_Connection()->Rollback(SavePoint);
-	}
-	else
-	{
-		Get_Connection()->Commit(SavePoint);
-
-		Get_Connection()->GUI_Update();
-	}
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Drop::CTable_Drop(void)
-{
-	Set_Name		(_TL("Drop Table"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Deletes a table from a PostgreSQL database."
-	));
-
-	Parameters.Add_Choice(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		""
-	);
-}
-
-//---------------------------------------------------------
-void CTable_Drop::On_Connection_Changed(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pParameter	= pParameters->Get_Parameter("TABLES");
-
-	pParameter->asChoice()->Set_Items(Get_Connection()->Get_Tables());
-	pParameter->Set_Value(pParameter->asString());
-}
-
-//---------------------------------------------------------
-bool CTable_Drop::On_Execute(void)
-{
-	if( Get_Connection()->Table_Drop(Parameters("TABLES")->asChoice()->asString()) )
-	{
-		Get_Connection()->GUI_Update();
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTable_Query::CTable_Query(void)
-{
-	CSG_Parameter	*pNode;
-
-	Set_Name		(_TL("Import Table from SQL Query"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
-
-	Set_Description	(_TW(
-		"Import a SQL table from a PostgreSQL database."
-	));
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Table from SQL Query"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_String(
-		NULL	, "TABLES"		, _TL("Tables"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "FIELDS"		, _TL("Fields"),
-		_TL(""),
-		SG_T("*")
-	);
-
-	Parameters.Add_String(
-		NULL	, "WHERE"		, _TL("Where"),
-		_TL(""),
-		SG_T("")
-	);
-
-	pNode	= Parameters.Add_String(
-		NULL	, "GROUP"		, _TL("Group by"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_String(
-		pNode	, "HAVING"		, _TL("Having"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_String(
-		NULL	, "ORDER"		, _TL("Order by"),
-		_TL(""),
-		SG_T("")
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTINCT"	, _TL("Distinct"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-//---------------------------------------------------------
-bool CTable_Query::On_Execute(void)
-{
-	CSG_Table	*pTable		= Parameters("TABLE"   )->asTable ();
-	CSG_String	Tables		= Parameters("TABLES"  )->asString();
-	CSG_String	Fields		= Parameters("FIELDS"  )->asString();
-	CSG_String	Where		= Parameters("WHERE"   )->asString();
-	CSG_String	Group		= Parameters("GROUP"   )->asString();
-	CSG_String	Having		= Parameters("HAVING"  )->asString();
-	CSG_String	Order		= Parameters("ORDER"   )->asString();
-	bool		bDistinct	= Parameters("DISTINCT")->asBool  ();
-
-	return( Get_Connection()->Table_Load(*pTable, Tables, Fields, Where, Group, Having, Order, bDistinct) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/db/io_pgsql/table.h b/src/modules_io/db/io_pgsql/table.h
deleted file mode 100644
index 2a59b9e..0000000
--- a/src/modules_io/db/io_pgsql/table.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/**********************************************************
- * Version $Id: table.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       io_pgsql                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       Table.h                         //
-//                                                       //
-//                 Copyright (C) 2013 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__Table_H
-#define HEADER_INCLUDED__Table_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_List : public CSG_PG_Module
-{
-public:
-	CTable_List(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Info : public CSG_PG_Module
-{
-public:
-	CTable_Info(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tools") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Load : public CSG_PG_Module
-{
-public:
-	CTable_Load(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Save : public CSG_PG_Module
-{
-public:
-	CTable_Save(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Drop : public CSG_PG_Module
-{
-public:
-	CTable_Drop(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual void				On_Connection_Changed	(CSG_Parameters *pParameters);
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CTable_Query : public CSG_PG_Module
-{
-public:
-	CTable_Query(void);
-
-	virtual CSG_String			Get_MenuPath			(void)	{	return( SG_T("R:Tables") );	}
-
-
-protected:
-
-	virtual bool				On_Execute				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Table_H
diff --git a/src/modules_io/docs/Makefile.in b/src/modules_io/docs/Makefile.in
deleted file mode 100644
index 00b4945..0000000
--- a/src/modules_io/docs/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/docs
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = docs_html docs_pdf
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/docs/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/docs/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/docs/docs_html/CreateWebContent.cpp b/src/modules_io/docs/docs_html/CreateWebContent.cpp
deleted file mode 100644
index 01d2fd6..0000000
--- a/src/modules_io/docs/docs_html/CreateWebContent.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/**********************************************************
- * Version $Id: CreateWebContent.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    PhotoLinks.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-#include "CreateWebContent.h"
-
-CCreateWebContent::CCreateWebContent(void)
-{
-	CSG_Parameter *pNode;
-	
-	//-----------------------------------------------------
-	Parameters.Set_Name(_TL("Create Web Content"));
-
-	Parameters.Set_Description(_TL(""));
-
-	pNode = Parameters.Add_Shapes(NULL, 
-						"SHAPES", 
-						_TL("Shapes"),
-						_TL(""),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Table_Field(pNode,
-								"NAME",
-								_TL("Name Field"),
-								_TL(""));
-	
-	Parameters.Add_FilePath(NULL,
-							"OUTPUTPATH",
-							_TL("Path for HTML Files"),
-							_TL(""),
-							_TL(""),
-							_TL(""),
-							true,
-							true);
-
-}
-
-CCreateWebContent::~CCreateWebContent(void)
-{}
-
-bool CCreateWebContent::On_Execute(void)
-{
-	m_bDown	= false;
-	m_pShapes = Parameters("SHAPES")->asShapes();
-
-	m_iNameField = Parameters("NAME")->asInt();
-	m_sOutputPath = Parameters("OUTPUTPATH")->asString();
-
-	m_pShapes->Add_Field("HTML", SG_DATATYPE_String);
-	m_iField = m_pShapes->Get_Field_Count() - 1;
-	
-	m_Pictures = new std::vector<CSG_String> [m_pShapes->Get_Count()];
-	m_Links = new std::vector<CSG_String> [m_pShapes->Get_Count()];
-	m_LinksDescription = new std::vector<CSG_String> [m_pShapes->Get_Count()];
-
-	return true ;
-}
-
-bool CCreateWebContent::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
-{
-	int i;
-	int iIndex, iShape;
-	CSG_Rect r;
-
-	switch( Mode ){
-	case MODULE_INTERACTIVE_LDOWN:
-		
-		if( m_bDown == false ){
-			m_bDown	= true;
-			m_ptDown = ptWorld;
-		}//if
-		
-		return true ;
-
-	case MODULE_INTERACTIVE_LUP:
-		if( m_bDown == true ){
-			m_bDown	= false;
-
-			r.Assign(m_ptDown.Get_X(), m_ptDown.Get_Y(), ptWorld.Get_X(), ptWorld.Get_Y());
-
-			if( r.Get_XRange() == 0.0 && r.Get_YRange() == 0.0 ){
-				m_pShapes->Select(m_pShapes->Get_Shape(m_ptDown), is_Shift());
-			}//if
-			else{
-				m_pShapes->Select(r, is_Shift());
-			}//else
-
-			DataObject_Update(m_pShapes, true);
-			
-		}//if
-		
-		return true;
-
-	case MODULE_INTERACTIVE_RDOWN:
-
-		CSG_String	sFileName;
-		CSG_Strings	files;
-		CSG_Parameters	dlg_files;
-		dlg_files.Add_FilePath(NULL, "FILES", _TL("Files"), _TL(""), _TL("Images|*.bmp;*.jpg;*.png;*.tif|HTML Files|*.htm|All Files|*.*"), NULL, false, false, true);
-
-		if( Dlg_Parameters(&dlg_files, _TL("Add Link to Files")) && dlg_files("FILES")->asFilePath()->Get_FilePaths(files) )
-		{
-			for (iShape = 0; iShape < m_pShapes->Get_Selection_Count(); iShape++){
-				iIndex = m_pShapes->Get_Selection(iShape)->Get_Index();
-				for (i = 0; i < files.Get_Count(); i++)
-				{
-					sFileName = "file://";
-					sFileName.Append((CSG_String)files[i]);
-					if (SG_File_Cmp_Extension (files[i],SG_T("htm"))){						
-						m_LinksDescription[iIndex].push_back(SG_File_Get_Name(files[i], true));
-						m_Links[iIndex].push_back(sFileName);
-					}//if
-					else if (  SG_File_Cmp_Extension (files[i],SG_T("bmp")) 
-							|| SG_File_Cmp_Extension (files[i],SG_T("jpg")) 
-							|| SG_File_Cmp_Extension (files[i],SG_T("png")) 				
-							|| SG_File_Cmp_Extension (files[i],SG_T("tif"))){
-						m_Pictures[iIndex].push_back(sFileName);
-					}//else
-				}				
-				sFileName = SG_File_Make_Path(m_sOutputPath.c_str(), m_pShapes->Get_Shape(iIndex)->asString(m_iNameField), SG_T("htm"));
-				m_pShapes->Get_Shape(iIndex)->Set_Value(m_iField, sFileName);
-			}
-		}
-		break;
-
-	}//switch
-
-	return false ;
-
-}//method
-
-bool CCreateWebContent::On_Execute_Finish(void){
-
-	int i,j;
-	CSG_String sFileName;
-	CSG_Doc_HTML HTMLDoc;
-
-	for (i = 0; i < m_pShapes->Get_Count(); i++){
-		Set_Progress(i, m_pShapes->Get_Count());
-		const SG_Char **Pictures;
-
-		if (m_Pictures[i].size() || m_Links[i].size()){
-			HTMLDoc.Open(m_pShapes->Get_Shape(i)->asString(m_iNameField));
-			Pictures = new const SG_Char *[m_Pictures[i].size()];
-			for (j = 0; j < m_Pictures[i].size(); j++){
-				Pictures[j] = m_Pictures[i].at(j).c_str();
-			}//for*/
-		
-			HTMLDoc.AddThumbnails(Pictures, m_Pictures[i].size(), 4);
-			HTMLDoc.AddLineBreak();
-			for (j = 0; j < m_Links[i].size(); j++){
-				HTMLDoc.AddHyperlink(m_LinksDescription[i].at(j).c_str(), m_Links[i].at(j).c_str());
-				HTMLDoc.AddLineBreak();
-			}//for
-
-			sFileName = SG_File_Make_Path(m_sOutputPath.c_str(), m_pShapes->Get_Shape(i)->asString(m_iNameField), SG_T("htm"));
-			HTMLDoc.Save(sFileName);
-		}//if
-
-	}//for
-
-	return true;
-
-}//method
diff --git a/src/modules_io/docs/docs_html/CreateWebContent.h b/src/modules_io/docs/docs_html/CreateWebContent.h
deleted file mode 100644
index 28b1b2f..0000000
--- a/src/modules_io/docs/docs_html/CreateWebContent.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**********************************************************
- * Version $Id: CreateWebContent.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Photolinks.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#ifndef HEADER_INCLUDED__CreateWebContent_H
-#define HEADER_INCLUDED__CreateWebContent_H
-
-#include "doc_html.h"
-#include <vector>
-
-class CCreateWebContent : public CSG_Module_Interactive
-{
-public:
-
-	CCreateWebContent(void);
-	virtual ~CCreateWebContent(void);
-
-protected:
-
-	virtual bool				On_Execute(void);
-	virtual bool				On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
-	virtual bool				On_Execute_Finish(void);
-
-private:
-
-	bool						m_bDown;
-	CSG_Point					m_ptDown;
-	CSG_Shapes						*m_pShapes;
-	int							m_iField, m_iNameField;
-	CSG_String					m_sOutputPath;
-
-	std::vector<CSG_String>	*m_Pictures;
-	std::vector<CSG_String>	*m_Links;
-	std::vector<CSG_String>	*m_LinksDescription;
-
-};
-
-#endif // #ifndef HEADER_INCLUDED__CreateWebContent_H
diff --git a/src/modules_io/docs/docs_html/Makefile.in b/src/modules_io/docs/docs_html/Makefile.in
deleted file mode 100644
index 9f7e2fe..0000000
--- a/src/modules_io/docs/docs_html/Makefile.in
+++ /dev/null
@@ -1,587 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/docs/docs_html
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libdocs_html_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libdocs_html_la_OBJECTS = CreateWebContent.lo doc_html.lo \
-	doc_svg.lo MLB_Interface.lo svg_interactive_map.lo
-libdocs_html_la_OBJECTS = $(am_libdocs_html_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libdocs_html_la_SOURCES)
-DIST_SOURCES = $(libdocs_html_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libdocs_html.la
-libdocs_html_la_SOURCES = \
-CreateWebContent.cpp\
-doc_html.cpp\
-doc_svg.cpp\
-MLB_Interface.cpp\
-svg_interactive_map.cpp\
-CreateWebContent.h\
-doc_html.h\
-doc_svg.h\
-MLB_Interface.h\
-svg_interactive_map.h
-
-libdocs_html_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/docs/docs_html/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/docs/docs_html/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libdocs_html.la: $(libdocs_html_la_OBJECTS) $(libdocs_html_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libdocs_html_la_OBJECTS) $(libdocs_html_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/CreateWebContent.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/doc_html.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/doc_svg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svg_interactive_map.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/docs/docs_html/svg_interactive_map.cpp b/src/modules_io/docs/docs_html/svg_interactive_map.cpp
deleted file mode 100644
index 35116be..0000000
--- a/src/modules_io/docs/docs_html/svg_interactive_map.cpp
+++ /dev/null
@@ -1,2897 +0,0 @@
-/**********************************************************
- * Version $Id: svg_interactive_map.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       docs_html                       //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              SVG_Interactive_map.cpp                  //
-//                                                       //
-//          Copyright (C) 2005 by Victor Olaya           //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "svg_interactive_map.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define MAP_WINDOW_WIDTH	550.
-#define MAP_WINDOW_HEIGHT	700.
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSVG_Interactive_Map::CSVG_Interactive_Map(void)
-{
-	Set_Name		(_TL("SVG Interactive Map"));
-
-	Set_Author		(SG_T("V.Olaya"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	Parameters.Add_FilePath(
-		NULL	, "FILENAME"	, _TL("[FLD] SVG File"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|*.svg|%s|*.*"),
-			_TL("SVG - Scalable Vector Graphics Files (*.svg)"),
-			_TL("All Files")
-		), NULL, true, false
-	);
-
-	Parameters.Add_Shapes_List(
-		NULL	, "LIST"		, _TL("Shapes Layers"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("[FLD] Index Layer"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-}
-
-//---------------------------------------------------------
-CSVG_Interactive_Map::~CSVG_Interactive_Map(void)
-{}
-
-//---------------------------------------------------------
-bool CSVG_Interactive_Map::On_Execute(void)
-{
-	CSG_String				FileName;
-	CSG_Shapes				*pIndexLayer;
-	CSVG_Interactive_Map	SVG;
-
-	Process_Set_Text(CSG_String::Format(SG_T("%s..."), _TL("[MSG] Save as Interactive SVG")));
-
-	pIndexLayer		= Parameters("SHAPES")		->asShapes();
-	FileName		= Parameters("FILENAME")	->asString();
-
-	return( SVG.Create_From_Map(Parameters("LIST")->asShapesList(), pIndexLayer, FileName) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSVG_Interactive_Map::Create_From_Map(CSG_Parameter_Shapes_List *pList, CSG_Shapes *pIndexLayer, const SG_Char *Filename)
-{
-	int		i;
-
-	if( pList->Get_Count() <= 0 )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	m_Directory	= SG_File_Get_Path(Filename);
-
-	CSG_Rect	r(pList->asShapes(0)->Get_Extent());
-
-	for(i=1; i<pList->Get_Count(); i++)
-	{
-		r.Union(pList->asShapes(i)->Get_Extent());
-	}
-
-	_Add_Opening(r);
-
-	//-----------------------------------------------------
-	m_sSVGCode.Append(SG_T("<g id=\"mainMapGroup\" transform=\"translate(0,0)\">\n"));
-
-	for(i=pList->Get_Count()-1; i>=0; i--)
-	{
-		_Add_Shapes	(pList->asShapes(i));
-	}
-
-	m_sSVGCode.Append(SG_T("</g>\n</svg>\n"));
-
-	//-----------------------------------------------------
-	_Add_CheckBoxes(pList);
-
-	_Add_ReferenceMap(pIndexLayer, r);
-
-	m_sSVGCode.Append(_Get_Code_Closing_1());
-
-	if( !Save(Filename) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("checkbox")			, SG_T("js")), _Get_Code_CheckBox());
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("mapApp")			, SG_T("js")), _Get_Code_MapApp	());
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("timer")			, SG_T("js")), _Get_Code_Timer	());
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("slider")			, SG_T("js")), _Get_Code_Slider	());
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("helper_functions")	, SG_T("js")), _Get_Code_Helper	());
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("button")			, SG_T("js")), _Get_Code_Buttons	());
-	_Write_Code(SG_File_Make_Path(m_Directory, SG_T("navigation")		, SG_T("js")), CSG_String::Format(SG_T("%s%s"), _Get_Code_Navigation_1(), _Get_Code_Navigation_2()));
-
-	return( true );
-}
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Write_Code(const CSG_String &FileName, const CSG_String &Code)
-{
-	CSG_File	Stream;
-
-	if( Stream.Open(FileName, SG_FILE_W, false) )
-	{
-		Stream.Write(Code);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Add_Opening(CSG_Rect r)
-{
-	CSG_String sViewBox;
-	double Width, Height;
-	double OffsetX, OffsetY;
-
-	m_sSVGCode.Append(_Get_Opening_Code_1());
-	m_sSVGCode.Append(SG_Get_String(r.Get_XRange(),2));
-	m_sSVGCode.Append(SG_T("),"));
-	m_sSVGCode.Append(SG_Get_String(r.Get_XRange() / 400.,2));
-	m_sSVGCode.Append(_Get_Opening_Code_2());
-
-	if (r.Get_XRange() / r.Get_YRange()  > MAP_WINDOW_WIDTH / MAP_WINDOW_HEIGHT)
-	{
-		Width = r.Get_XRange();
-		Height =  r.Get_XRange() * MAP_WINDOW_HEIGHT / MAP_WINDOW_WIDTH;
-	}
-	else
-	{
-		Height = r.Get_YRange();
-		Width = r.Get_YRange() / MAP_WINDOW_HEIGHT * MAP_WINDOW_WIDTH;
-	}
-
-	OffsetX = (Width - r.Get_XRange()) / 2.;
-	OffsetY = (Height - r.Get_YRange()) / 2.;
-
-	sViewBox.Append(SG_Get_String(r.Get_XMin() - OffsetX,2));
-	sViewBox.Append(SG_T(" "));
-	sViewBox.Append(SG_Get_String(-r.Get_YMax() - OffsetY,2));
-	sViewBox.Append(SG_T(" "));
-	sViewBox.Append(SG_Get_String(Width,2));
-	sViewBox.Append(SG_T(" "));
-	sViewBox.Append(SG_Get_String(Height,2));
-
-	_AddAttribute(SG_T("viewBox"), sViewBox);	
-	m_sSVGCode.Append(SG_T(">\n"));
-
-	m_dWidth = Width;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Add_ReferenceMap(CSG_Shapes *pIndexLayer, CSG_Rect r)
-{
-	int i;
-	CSG_String sViewBox;
-	double Line_Width, Point_Width;
-	double Width, Height;
-	double OffsetX, OffsetY;
-	CSG_Shape *pShape;
-
-	if (r.Get_XRange() / r.Get_YRange()  > MAP_WINDOW_WIDTH / MAP_WINDOW_HEIGHT)
-	{
-		Width = r.Get_XRange();
-		Height =  r.Get_XRange() * MAP_WINDOW_HEIGHT / MAP_WINDOW_WIDTH;
-	}
-	else
-	{
-		Height = r.Get_YRange();
-		Width = r.Get_YRange() / MAP_WINDOW_HEIGHT * MAP_WINDOW_WIDTH;
-	}
-
-	OffsetX = (Width - r.Get_XRange()) / 2.;
-	OffsetY = (Height - r.Get_YRange()) / 2.;
-
-	sViewBox.Append(SG_Get_String(r.Get_XMin() - OffsetX,2));
-	sViewBox.Append(SG_T(" "));
-	sViewBox.Append(SG_Get_String(- r.Get_YMax() - OffsetY,2));
-	sViewBox.Append(SG_T(" "));
-	sViewBox.Append(SG_Get_String(Width,2));
-	sViewBox.Append(SG_T(" "));
-	sViewBox.Append(SG_Get_String(Height,2));
-
-	_AddAttribute(SG_T("viewBox"), sViewBox);	
-
-	m_sSVGCode.Append(_Get_Code_3());
-	
-	if (pIndexLayer)
-	{
-		m_sSVGCode.Append(SG_T("<g id=\"index\">\n"));
-		for (i = 0; i < pIndexLayer->Get_Count(); i++)
-		{
-			pShape = pIndexLayer->Get_Shape(i);
-			Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH;
-			Point_Width *= 5;
-			_Add_Shape(pShape, 0, 0, Line_Width, Point_Width);
-		}
-		m_sSVGCode.Append(SG_T("</g>\n"));
-	}
-
-	m_sSVGCode.Append(_Get_Code_4());
-		
-	_AddAttribute(SG_T("x"), r.Get_XMin() - OffsetX);
-	_AddAttribute(SG_T("y"), - r.Get_YMax() - OffsetY);
-	_AddAttribute(SG_T("width"), Width);
-	_AddAttribute(SG_T("height"), Height);
-
-	m_sSVGCode.Append(_Get_Code_5());
-
-}
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Add_Grid(CSG_Grid *pLayer)
-{
-/*	CSG_String Filename;
-	wxBitmap BMP;
-	
-	if( pLayer->Get_Image_Grid(BMP) )
-	{
-		Filename	= SG_File_Make_Path(m_Directory.c_str(), pLayer->Get_Name(), SG_T("jpg"));
-		BMP.SaveFile(Filename, wxBITMAP_TYPE_JPEG);
-
-		m_sSVGCode.Append(SG_T("<image "));
-
-		_AddAttribute(SG_T("id")			, pLayer->Get_Name());
-		_AddAttribute(SG_T("x")			, ((CSG_Grid *)pLayer->Get_Object())->Get_XMin());
-		_AddAttribute(SG_T("y")			,-((CSG_Grid *)pLayer->Get_Object())->Get_YMax());
-		_AddAttribute(SG_T("width")		, ((CSG_Grid *)pLayer->Get_Object())->Get_XRange());
-		_AddAttribute(SG_T("height")		, ((CSG_Grid *)pLayer->Get_Object())->Get_YRange());
-		_AddAttribute(SG_T("xlink:href")	, SG_File_Get_Name(Filename, true));
-
-		m_sSVGCode.Append(SG_T("/>"));
-	}
-/**/
-}
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Add_Shapes(CSG_Shapes *pLayer)
-{
-	int i;
-	int Line_Color, Fill_Color; 
-	double Line_Width, Point_Width;
-	CSG_Shape *pShape;
-	CSG_String sLabel;
-
-	m_sSVGCode.Append(SG_T("<g id=\""));
-	m_sSVGCode.Append(pLayer->Get_Name());		
-	m_sSVGCode.Append(SG_T("\" >\n"));
-	
-//	int	iColorField = pLayer->Get_Color_Field();
-
-	m_sSVGCode.Append(SG_T("<g transform=\"scale(1,-1)\">\n"));
-
-	for (i = 0; i < pLayer->Get_Count(); i++)
-	{
-		pShape = pLayer->Get_Shape(i);
-//		Line_Color = Fill_Color = pLayer->Get_Classifier()->Get_Class_Color_byValue(pShape->asDouble(iColorField));
-		Line_Color = SG_COLOR_BLACK;
-		Fill_Color = SG_COLOR_GREEN;
-		Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH;
-		Point_Width *= 5;
-		_Add_Shape(pShape, Fill_Color, Line_Color, Line_Width, Point_Width);
-	}
-	
-//	if (pLayer->Get_Label_Field() >= 0)
-	{
-/*		m_sSVGCode.Append(SG_T("<g transform=\"scale(0.01,-0.01)\"\n>"));
-		for (i = 0; i < pLayer->Get_Count(); i++)
-		{
-			double	dSize;
-
-			pShape = pLayer->Get_Shape(i);
-			Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH;
-			sLabel = pShape->asString(pLayer->Get_Label_Field());
-			switch( pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_SIZE_TYPE"))->asInt() )
-			{
-				case 0:	default:
-					dSize = Line_Width * pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_FONT"))->asFont()->GetPointSize();
-					_Add_Label(sLabel, pShape, dSize, SG_T("%"));
-					break;
-				case 1:
-					dSize =  pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_SIZE"))->asDouble();
-					_Add_Label(sLabel, pShape, dSize, SG_T(""));
-					break;
-			}
-		}
-
-		m_sSVGCode.Append(SG_T("</g>\n"));
-/**/
-	}
-
-	m_sSVGCode.Append(SG_T("</g>\n</g>\n"));
-}
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Add_Label(const SG_Char* Label, CSG_Shape *pShape, double dSize, const SG_Char* Unit)
-{
-
-	int iPoint, iPart;
-	TSG_Point Point;
-
-	switch( pShape->Get_Type() )
-	{
-	case SHAPE_TYPE_Point:
-	case SHAPE_TYPE_Points:
-		for(iPoint=0; iPoint < pShape->Get_Point_Count(0); iPoint++)
-		{
-			Point = pShape->Get_Point(iPoint);
-			Draw_Text(100 * Point.x, -100 * Point.y, Label, 0, SG_T("Verdana"), 100 * dSize);
-		}
-		break;
-
-	case SHAPE_TYPE_Line:
-		///************///
-		break;
-
-	case SHAPE_TYPE_Polygon:
-		
-		for (iPart = 0; iPart < pShape->Get_Part_Count(); iPart++)
-		{
-			if(! ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) )
-			{
-				Point = ((CSG_Shape_Polygon *)pShape)->Get_Centroid(iPart);
-				Draw_Text(100 * Point.x, -100 * Point.y, Label, 0, SG_T("Verdana"), 100 * dSize);
-			}
-		}
-		break;
-	}
-
-}
-
-//---------------------------------------------------------
-bool CSVG_Interactive_Map::_Add_Shape(CSG_Shape *pShape, int Fill_Color, int Line_Color, double Line_Width, double Point_Width)
-{
-	if( pShape && pShape->is_Valid() )
-	{
-		int				iPart, iPoint;
-		TSG_Point		Point;
-		CSG_Points	Points;
-
-		for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-		{
-			Points.Clear();
-
-			for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-			{
-				Point = pShape->Get_Point(iPoint, iPart);
-				Points.Add(Point.x, Point.y);
-			}
-
-			switch( pShape->Get_Type() )
-			{
-			case SHAPE_TYPE_Point:
-			case SHAPE_TYPE_Points:
-				for(iPoint=0; iPoint<Points.Get_Count(); iPoint++)
-				{
-					Draw_Circle(Points[iPoint].x, Points[iPoint].y, Point_Width, Fill_Color, 0, Line_Width);
-				}
-				break;
-
-			case SHAPE_TYPE_Line:
-				Draw_Line(Points, Line_Width, Line_Color);
-				break;
-
-			case SHAPE_TYPE_Polygon:
-				if( ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) )
-				{
-					Draw_Polygon(Points, -1, 0, 0.01);
-				}
-				else
-				{
-					Draw_Polygon(Points, Fill_Color, 0, 0.01);
-				}
-				break;
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-void CSVG_Interactive_Map::_Add_CheckBoxes(CSG_Parameter_Shapes_List *pList)
-{
-
-	int i;
-	CSG_String s;
-	int x,y;
-	int iRow = 1;
-	
-	m_sSVGCode.Append(_Get_Code_1());	// 2* <g> open
-	m_sSVGCode.Append(_TL("Layers"));
-	m_sSVGCode.Append(SG_T("</text>\n"));
-
-	for (i = 0; i < pList->Get_Count(); i++)
-	{
-		y = iRow * 30;
-
-		if (i % 2)
-		{
-			x = 200;		
-			iRow++;
-		}
-		else
-		{
-			x = 0;
-		}
-	
-		m_sSVGCode.Append(SG_T("<g "));
-		s = SG_T("translate(");
-		s.Append(SG_Get_String(x,0));
-		s.Append(SG_T(" "));
-		s.Append(SG_Get_String(y,0));
-		s.Append(SG_T("))"));
-		_AddAttribute(SG_T("transform"), s);
-		m_sSVGCode.Append(SG_T(">\n"));
-
-		m_sSVGCode.Append(SG_T("<use "));
-		s = SG_T("checkBox");
-		s.Append(pList->asShapes(i)->Get_Name());
-		_AddAttribute(SG_T("id"), s);
-		_AddAttribute(SG_T("xlink:href"), SG_T("#checkBoxRect"));
-		s = SG_T("checkBoxScript(evt,'");
-		s.Append(pList->asShapes(i)->Get_Name());
-		s.Append(SG_T("');"));
-		_AddAttribute(SG_T("onclick"), s);
-		m_sSVGCode.Append(SG_T("/>\n"));
-
-		m_sSVGCode.Append(SG_T("<use "));
-		s = SG_T("checkCross");
-		s.Append(pList->asShapes(i)->Get_Name());
-		_AddAttribute(SG_T("id"), s);
-		_AddAttribute(SG_T("xlink:href"), SG_T("#checkBoxCross"));		
-		_AddAttribute(SG_T("visibility"), SG_T("visible"));
-		m_sSVGCode.Append(SG_T("/>\n"));
-
-		m_sSVGCode.Append(SG_T("</g>\n"));
-	}
-
-	m_sSVGCode.Append(SG_T("<g font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" pointer-events=\"none\">\n"));
-	
-	iRow = 1;
-		
-	for (i = 0; i < pList->Get_Count(); i++)
-	{
-		y = iRow * 30 + 6;
-
-		if (i % 2)
-		{
-			x = 212;
-			iRow++;
-		}
-		else
-		{
-			x = 12;
-		}
-
-		m_sSVGCode.Append(SG_T("<text "));	
-		_AddAttribute(SG_T("x"), x);
-		_AddAttribute(SG_T("y"), y);
-		m_sSVGCode.Append(SG_T(">"));
-		m_sSVGCode.Append(pList->asShapes(i)->Get_Name());
-		m_sSVGCode.Append(SG_T("</text>\n"));	
-
-	}
-
-	m_sSVGCode.Append(SG_T("</g>\n"));
-
-	m_sSVGCode.Append(_Get_Code_2());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Opening_Code_1(void)
-{
-	return(
-		"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
-		"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" [\n"
-		"<!ATTLIST svg\n"
-		"	xmlns:attrib CDATA #IMPLIED\n"
-		"	xmlns:batik CDATA #IMPLIED\n"
-		">\n"
-		"<!ATTLIST g\n"
-		"	batik:static CDATA #IMPLIED\n"
-		">\n"
-		"<!ATTLIST image\n"
-		"	batik:static CDATA #IMPLIED\n"
-		">\n"
-		"<!ATTLIST path\n"
-		"	batik:static CDATA #IMPLIED\n"
-		">\n"
-		"]>\n"
-		"<?AdobeSVGViewer save=\"snapshot\"?>\n"
-		"<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 1024 768\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:attrib=\"http://www.carto.net/attrib\" xmlns:batik=\"http://xml.apache.org/batik/ext\" onload=\"init(evt);\" zoomAndPan=\"disable\">\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"helper_functions.js\"/>\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"mapApp.js\"/>\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"timer.js\"/>\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"slider.js\"/>\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"button.js\"/>\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"checkbox.js\"/>\n"
-		"	<script type=\"text/ecmascript\" xlink:href=\"navigation.js\"/>\n"
-		"	<script type=\"text/ecmascript\"><![CDATA[\n"
-		"		//global variables for mapApp and map object\n"
-		"		var myMapApp = new mapApp();\n"
-		"		var myMainMap;\n"
-		"		function init(evt) {\n"
-		"			//dynamic layer array that allow loading from database\n"
-		"			var dynamicLayers = new Array();\n"
-		"			//initialize digiLayers (layers that allow digitizing)\n"
-		"			var digiLayers = new Array();\n"
-		"			//initialize myMainMap object\n"
-		"			myMainMap = new map(\"mainMap\"),"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Opening_Code_2(void)
-{
-	return(
-		"),0.6,0,0,\"\"),1,true,\"coordX\"),\"coordY\"),dynamicLayers,digiLayers,\"\"));\n"
-		"			//initialize refMapDragger object\n"
-		"			myMapApp.refMapDragger = new dragObj(\"dragRectForRefMap\"),\"referenceMap\"),\"myDragCross\"),0.1,true,\"coordX\"),\"coordY\"),myMainMap);\n"
-		"			//create zoom slider	\n"
-		"			myMapApp.zoomSlider = new slider(715,75,myMainMap.minWidth,715,165,myMainMap.maxWidth,myMainMap.maxWidth,\"mapZoomSlider\"),\"dimgray\"),2,10,\"sliderSymbol\"),myMapApp.refMapDragger,true);\n"
-		"			//now initialize buttons\n"
-		"			myMapApp.buttons = new Array();\n"
-		"			//groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset\n"
-		"			myMapApp.buttons[\"zoomIn\"] = new button(\"zoomIn\"),zoomImageButtons,\"rect\"),undefined,\"magnifyerZoomIn\"),705,47,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"zoomOut\"] = new button(\"zoomOut\"),zoomImageButtons,\"rect\"),undefined,\"magnifyerZoomOut\"),705,173,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"infoButton\"] = new switchbutton(\"infoButton\"),zoomImageSwitchButtons,\"rect\"),undefined,\"infoBut\"),746,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n"
-		"			statusChange(\"Mode: Infomode\"));\n"
-		"			myMapApp.buttons[\"zoomFull\"] = new button(\"zoomFull\"),zoomImageButtons,\"rect\"),undefined,\"magnifyerFull\"),771,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"zoomManual\"] = new switchbutton(\"zoomManual\"),zoomImageSwitchButtons,\"rect\"),undefined,\"magnifyerManual\"),796,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"panManual\"] = new switchbutton(\"panManual\"),zoomImageSwitchButtons,\"rect\"),undefined,\"symbPan\"),821,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"recenterMap\"] = new switchbutton(\"recenterMap\"),zoomImageSwitchButtons,\"rect\"),undefined,\"symbRecenter\"),846,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"backwardExtent\"] = new button(\"backwardExtent\"),zoomImageButtons,\"rect\"),undefined,\"symbArrowLeft\"),871,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			myMapApp.buttons[\"forwardExtent\"] = new button(\"forwardExtent\"),zoomImageButtons,\"rect\"),undefined,\"symbArrowRight\"),896,74,20,20,10,\"\"),\"\"),\"white\"),\"rgb(235,235,235)\"),\"dimgray\"),1);\n"
-		"			//see if we need to disable buttons\n"
-		"			myMainMap.checkButtons();\n"
-		"			//load function specific to the current map project\n"
-		"			loadProjectSpecific();\n"
-		"		}\n"
-		"		function loadProjectSpecific() {\n"
-		"			//adopt width and height of map extent\n"
-		"			document.getElementById(\"myScaleTextW\")).firstChild.nodeValue = formatNumberString(myMainMap.curWidth.toFixed(myMainMap.nrDecimals)) + myMainMap.units;\n"
-		"			document.getElementById(\"myScaleTextH\")).firstChild.nodeValue = formatNumberString(myMainMap.curHeight.toFixed(myMainMap.nrDecimals)) + myMainMap.units;\n"
-		"		}\n"
-		"]]></script>\n"
-		"	<defs>\n"
-		"		<!-- Symbols for checkboxes -->\n"
-		"		<symbol id=\"checkBoxRect\" overflow=\"visible\">\n"
-		"			<rect x=\"-6\" y=\"-6\" width=\"12\" height=\"12\" fill=\"white\" stroke=\"dimgray\" stroke-width=\"1.5\"/>\n"
-		"		</symbol>\n"
-		"		<symbol id=\"checkBoxCross\" overflow=\"visible\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"1\" pointer-events=\"none\">\n"
-		"			<line x1=\"-5\" y1=\"-5\" x2=\"5\" y2=\"5\"/>\n"
-		"			<line x1=\"-5\" y1=\"5\" x2=\"5\" y2=\"-5\"/>\n"
-		"		</symbol>\n"
-		"		<!-- Symbols for Zoom Magnifyer glasses -->\n"
-		"		<symbol id=\"magnifyerFull\" overflow=\"visible\">\n"
-		"			<text y=\"7.5\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"18px\" font-weight=\"bold\" text-anchor=\"middle\" pointer-events=\"none\">F</text>\n"
-		"		</symbol>\n"
-		"		<symbol id=\"infoBut\" overflow=\"visible\">\n"
-		"			<circle fill=\"none\" stroke=\"dimgray\" stroke-width=\"1.5\" r=\"7.5\" />\n"
-		"			<text y=\"5\" font-family=\"sans-serif\" font-size=\"13px\" font-weight=\"bold\" fill=\"dimgray\" text-anchor=\"middle\" pointer-events=\"none\">i</text>\n"
-		"		</symbol>\n"
-		"		<symbol id=\"magnifyerManual\" overflow=\"visible\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"1.5\">\n"
-		"			<rect x=\"-6\" y=\"-6\" width=\"12\" height=\"12\" stroke-dasharray=\"1.5,1.5\"/>\n"
-		"			<line x1=\"-3\" y1=\"0\" x2=\"3\" y2=\"0\" />\n"
-		"			<line x1=\"0\" y1=\"-3\" x2=\"0\" y2=\"3\" />\n"
-		"		</symbol>\n"
-		"		<symbol id=\"magnifyerZoomIn\" overflow=\"visible\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"2\">\n"
-		"			<line x1=\"-4\" y1=\"0\" x2=\"4\" y2=\"0\"/>\n"
-		"			<line x1=\"0\" y1=\"-4\" x2=\"0\" y2=\"4\"/>\n"
-		"		</symbol>\n"
-		"		<symbol id=\"magnifyerZoomOut\" overflow=\"visible\">\n"
-		"			<line x1=\"-4\" y1=\"0\" x2=\"4\" y2=\"0\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"2\" />\n"
-		"		</symbol>\n"
-		"		<!-- hand symbol for panning -->\n"
-		"		<symbol id=\"symbPan\" overflow=\"visible\">\n"
-		"			<path transform=\"scale(1.2)\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"1\" d=\"M-2 6 C -2.2 2.5 -8.0 -0 -5.7 -1.9 C -4.3 -2.5 -3.3 -0.5 -2.5 0.7 C -3.2 -2.1 -5.5 -5.2 -3.6 -5.8 C -2.1 -6.3 -1.6 -3.6 -1.1 -1.9 C -0.9 -4.2 -1.6 -6.4 -0.2 -6.6 C 1.4 -6.8 0.9 -3 1.1 -1.9 C 1.5 -3.5 1.2 -6.1 2.5 -6.1 C 3.9 -6.1 3.5 -3.2 3.6 -1.6 C 4 -2.9 4.1 -4.3 5.3 -4.4 C 7.3 -3.5 4 2.2 3 6z\"/>\n"
-		"		</symbol>\n"
-		"		<!-- Symbol for Arrows -->\n"
-		"		<symbol id=\"symbArrow\" overflow=\"visible\">\n"
-		"			<polyline fill=\"none\" stroke=\"dimgray\" stroke-width=\"1\" points=\"-3,-6 3,-6 3,1 5,1 0,7 -5,1 -3,1 -3,-5\"/>\n"
-		"		</symbol>\n"
-		"		<symbol id=\"symbArrowLeft\" overflow=\"visible\">\n"
-		"			<use xlink:href=\"#symbArrow\" transform=\"rotate(90)\" />\n"
-		"		</symbol>\n"
-		"		<symbol id=\"symbArrowRight\" overflow=\"visible\">\n"
-		"			<use xlink:href=\"#symbArrow\" transform=\"rotate(-90)\" />\n"
-		"		</symbol>\n"
-		"		<!-- Symbol for Recentering Map -->\n"
-		"		<symbol id=\"symbRecenter\" overflow=\"visible\">\n"
-		"			<circle fill=\"dimgray\" cx=\"0\" cy=\"0\" r=\"1\" pointer-events=\"none\"/>\n"
-		"			<g fill=\"none\" stroke=\"dimgray\" stroke-width=\"1.5\" pointer-events=\"none\">\n"
-		"				<line x1=\"-7\" y1=\"-7\" x2=\"-3\" y2=\"-3\"/>\n"
-		"				<line x1=\"7\" y1=\"7\" x2=\"3\" y2=\"3\"/>\n"
-		"				<line x1=\"-7\" y1=\"7\" x2=\"-3\" y2=\"3\"/>\n"
-		"				<line x1=\"7\" y1=\"-7\" x2=\"3\" y2=\"-3\"/>\n"
-		"			</g>\n"
-		"		</symbol>\n"
-		"		<!-- Symbol for Slider -->\n"
-		"		<symbol id=\"sliderSymbol\" overflow=\"visible\" pointer-events=\"none\">\n"
-		"			<line x1=\"0\" y1=\"-5\" x2=\"0\" y2=\"5\" fill=\"none\" stroke=\"dimgray\" stroke-width=\"5\"/>\n"
-		"		</symbol>\n"
-		"		<!-- Symbol for Dragging if zoomed in far -->\n"
-		"		<symbol id=\"myDragCrossSymbol\" overflow=\"visible\" stroke-width=\"2000\" fill=\"none\" stroke=\"darkblue\" pointer-events=\"none\">\n"
-		"			<line x1=\"-7000\" y1=\"0\" x2=\"-2500\" y2=\"0\"/>\n"
-		"			<line x1=\"7000\" y1=\"0\" x2=\"2500\" y2=\"0\"/>\n"
-		"			<line x1=\"0\" y1=\"-3300\" x2=\"0\" y2=\"-7800\"/>\n"
-		"			<line x1=\"0\" y1=\"3300\" x2=\"0\" y2=\"7800\"/>\n"
-		"		</symbol>\n"
-		"		<!-- Marker for Extent-Arrows -->\n"
-		"		<marker id=\"myStartArrow\" overflow=\"visible\" orient=\"auto\">\n"
-		"			<polyline fill=\"dimgray\" points=\"-0.5,0 8,-2 8,2\"/>\n"
-		"		</marker>\n"
-		"		<marker id=\"myEndArrow\" overflow=\"visible\" orient=\"auto\">\n"
-		"			<polyline fill=\"dimgray\" points=\"0.5,0 -8,-2 -8,2\"/>\n"
-		"		</marker>\n"
-		"	</defs>\n"
-		"	<rect x=\"-500\" y=\"-500\" width=\"3000\" height=\"3000\" stroke=\"none\" fill=\"aliceblue\" />\n"
-		"	<!-- Main Map Frame -->\n"
-		"	<svg id=\"mainMap\" x=\"0\" y=\"15\" width=\"550\" height=\"700\"	cursor=\"crosshair\" "
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_1(void)
-{
-	return(
-		"<g>\n"
-		"		<g font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" pointer-events=\"none\">"
-		"			<text id=\"coordX\" x=\"745\" y=\"145\">X:</text>\n"
-		"			<text id=\"coordY\" x=\"845\" y=\"145\">Y:</text>\n"
-		"		</g>\n"
-		"		<g>"
-		"			<!-- vertical line, displays current height of map extent -->\n"
-		"			<line stroke=\"dimgray\" stroke-width=\"1.5\" marker-start=\"url(#myStartArrow)\" marker-end=\"url(#myEndArrow)\" x1=\"561\" y1=\"15\" x2=\"561\" y2=\"715\"/>\n"
-		"			<rect fill=\"aliceblue\" x=\"555\" y=\"330\" width=\"12\" height=\"70\"/>\n"
-		"			<text id=\"myScaleTextH\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" text-anchor=\"middle\" transform=\"translate(556,365),rotate(90)\" pointer-events=\"none\">-</text>\n"
-		"			<!-- horizontal line, displays current width of map extent -->\n"
-		"			<line stroke=\"dimgray\" stroke-width=\"1.5\" marker-start=\"url(#myStartArrow)\" marker-end=\"url(#myEndArrow)\" x1=\"0\" y1=\"723\" x2=\"553.1\" y2=\"723\"/>\n"
-		"			<rect fill=\"aliceblue\" x=\"242\" y=\"717\" width=\"70\" height=\"12\"/>\n"
-		"			<text id=\"myScaleTextW\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"15px\" text-anchor=\"middle\" transform=\"translate(277,728)\" pointer-events=\"none\">-</text>\n"
-		"			<!-- small rectangle in lower right corner, onclick displays current map extent in real world coordinates -->\n"
-		"			<rect fill=\"dimgray\" x=\"558.5\" y=\"720.5\" width=\"5\" height=\"5\" onclick=\"showExtent()\" />\n"
-		"		</g>\n"
-		"		<g transform=\"translate(590 225)\">\n"
-		"			<text font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"18px\" font-weight=\"bold\" x=\"-10\" y=\"0\" pointer-events=\"none\">"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_2(void)
-{
-	return(
-		"</g>\n"
-		"   <g text-rendering=\"optimizeLegibility\" font-family=\"sans-serif\" fill=\"dimgray\" font-size=\"12px\">\n"
-		"		<!-- text with this id is required to show help texts -->\n"
-		"		<text id=\"statusText\" x=\"745\" y=\"125\">Statusbar: Your Status Text</text>\n"
-		"   </g>\n"
-		"</g>\n"
-		"<svg id=\"referenceMap\" x=\"580\" y=\"45\" "
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_3(void)
-{
-	return(
-		"width=\"118.52\" height=\"150\" onmousedown=\"myMapApp.refMapDragger.handleEvent(evt)\" onmousemove=\"myMapApp.refMapDragger.handleEvent(evt)\" onmouseup=\"myMapApp.refMapDragger.handleEvent(evt)\" onmouseout=\"myMapApp.refMapDragger.handleEvent(evt)\" cursor=\"crosshair\">\n"
-		"		<g transform=\"scale(1,-1)\"\n>"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_4(void)
-{
-	return(
-		"		</g>\n"
-		"		<rect id=\"dragRectForRefMap\" fill=\"lightskyblue\" fill-opacity=\"0.4\" "
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_5(void)
-{
-	return(
-		" pointer-events=\"none\" />\n	"
-		"		<use id=\"myDragCross\" x=\"0\" y=\"0\" xlink:href=\"#myDragCrossSymbol\" visibility=\"hidden\" />\n"
-		"	</svg>\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Closing_1(void)
-{
-	return(
-		"	<g>\n"
-		"		<!-- empty group where zoomSlider is later appended -->\n"
-		"		<g id=\"mapZoomSlider\"/>\n"
-		"		<!-- button for zoom-in, above slider -->\n"
-		"		<g id=\"zoomIn\" cursor=\"pointer\" />\n"
-		"		<!-- button for zoom-out, below slider -->\n"
-		"		<g id=\"zoomOut\" cursor=\"pointer\" />\n"
-		"		<!-- info button -->\n"
-		"		<g id=\"infoButton\" cursor=\"pointer\" />\n"
-		"		<!-- button for full view (f) -->\n"
-		"		<g id=\"zoomFull\" cursor=\"pointer\" />\n"
-		"		<!-- button for manual zoom (rectangle) -->\n"
-		"		<g id=\"zoomManual\" cursor=\"pointer\" />\n"
-		"		<!-- button for manual pan -->\n"
-		"		<g id=\"panManual\" cursor=\"pointer\" />\n"
-		"		<!-- button for redefining map center -->\n"
-		"		<g id=\"recenterMap\" cursor=\"pointer\" />\n"
-		"		<!-- button for backwarding map extent (extent history) -->\n"
-		"		<g id=\"backwardExtent\" cursor=\"pointer\" />\n"
-		"		<!-- button for forwarding map extent (extent history) -->\n"
-		"		<g id=\"forwardExtent\" cursor=\"pointer\" />\n"
-		"	</g>\n"
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														//
-//														//
-//														//
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_CheckBox(void)
-{
-	return(
-		"function checkBoxScript(evt,myLayer) { //checkBox for toggling layers an contextMenue\n"
-		"	var myLayerObj = document.getElementById(myLayer);\n"
-		"	var myCheckCrossObj = document.getElementById(\"checkCross\"+myLayer);\n"
-		"	var myCheckCrossVisibility = myCheckCrossObj.getAttributeNS(null,\"visibility\"));\n"
-		"	if (evt.type == \"click\" && evt.detail == 1) {\n"
-		"	if (myCheckCrossVisibility == \"visible\")) {\n"
-		"		myLayerObj.setAttributeNS(null,\"visibility\"),\"hidden\"));\n"
-		"		myCheckCrossObj.setAttributeNS(null,\"visibility\"),\"hidden\"));\n"
-		"		//you can do if/else or switch statements to set different actions on activating a checkbox here\n"
-		"		//myLayer holds the currentLayer name\n"
-		"	}\n"
-		"	else {\n"
-		"		myLayerObj.setAttributeNS(null,\"visibility\"),\"visible\"));\n"
-		"		myCheckCrossObj.setAttributeNS(null,\"visibility\"),\"visible\"));\n"
-		"	}\n"
-		"	}\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_MapApp(void)
-{
-	return(
-		"//holds data on window size\n"
-		"function mapApp() {\n"
-		"	if (!document.documentElement.getScreenCTM) {\n"
-		"	this.resetFactors();\n"
-		"	//add resize event to document element\n"
-		"	document.documentElement.addEventListener(\"SVGResize\"),this,false);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"mapApp.prototype.handleEvent = function(evt) {\n"
-		"	if (evt.type == \"SVGResize\")) {\n"
-		"	this.resetFactors();\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"mapApp.prototype.resetFactors = function() {\n"
-		"	if (!document.documentElement.getScreenCTM) {\n"
-		"	//case for viewers that don't support .getScreenCTM, such as ASV3\n"
-		"	//calculate ratio and offset values of app window\n"
-		"	var viewBoxArray = document.documentElement.getAttributeNS(null,\"viewBox\")).split(\" \"));\n"
-		"	var myRatio = viewBoxArray[2]/viewBoxArray[3];\n"
-		"	if ((window.innerWidth/window.innerHeight) > myRatio) { //case window is more wide than myRatio\n"
-		"		this.scaleFactor = viewBoxArray[3] / window.innerHeight;\n"
-		"	}\n"
-		"	else { //case window is more tall than myRatio\n"
-		"		this.scaleFactor = viewBoxArray[2] / window.innerWidth;\n"
-		"	}\n"
-		"	this.offsetX = (window.innerWidth - viewBoxArray[2] * 1 / this.scaleFactor) / 2;\n"
-		"	this.offsetY = (window.innerHeight - viewBoxArray[3] * 1 / this.scaleFactor) / 2;\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"mapApp.prototype.calcCoord = function(evt,ctmNode) {\n"
-		"	var svgPoint = document.documentElement.createSVGPoint();\n"
-		"	svgPoint.x = evt.clientX;\n"
-		"	svgPoint.y = evt.clientY;\n"
-		"	if (!document.documentElement.getScreenCTM) {\n"
-		"	//case ASV3 a. Corel\n"
-		"	svgPoint.x = (svgPoint.x	- this.offsetX) * this.scaleFactor;\n"
-		"	svgPoint.y = (svgPoint.y - this.offsetY) * this.scaleFactor;\n"
-		"	//undo the effect of transformations\n"
-		"	if (ctmNode) {\n"
-		"		var ctm = getTransformToRootElement(ctmNode).inverse();\n"
-		"	}\n"
-		"	else {\n"
-		"		var ctm = getTransformToRootElement(evt.target).inverse();\n"
-		"	}\n"
-		"	svgPoint = svgPoint.matrixTransform(ctm);\n"
-		"\n"
-		"	}\n"
-		"	else {\n"
-		"	if (ctmNode) {\n"
-		"		var matrix = ctmNode.getScreenCTM();\n"
-		"	}\n"
-		"	else {\n"
-		"		var matrix = evt.target.getScreenCTM();\n"
-		"	}\n"
-		"	svgPoint = svgPoint.matrixTransform(matrix.inverse());\n"
-		"	}\n"
-		"	return svgPoint;\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Timer(void)
-{
-	return(
-		"// source/credits: \"Algorithm\": http://www.codingforums.com/showthread.php?s=&threadid=10531\n"
-		"// The constructor should be called with\n"
-		"// the parent object (optional, defaults to window).\n"
-		"\n"
-		"function Timer(){\n"
-		"	this.obj = (arguments.length)?arguments[0]:window;\n"
-		"	return this;\n"
-		"}\n"
-		"\n"
-		"// The set functions should be called with:\n"
-		"// - The name of the object method (as a string) (required)\n"
-		"// - The millisecond delay (required)\n"
-		"// - Any number of extra arguments, which will all be\n"
-		"//	passed to the method when it is evaluated.\n"
-		"\n"
-		"Timer.prototype.setInterval = function(func, msec){\n"
-		"	var i = Timer.getNew();\n"
-		"	var t = Timer.buildCall(this.obj, i, arguments);\n"
-		"	Timer.set[i].timer = window.setInterval(t,msec);\n"
-		"	return i;\n"
-		"}\n"
-		"Timer.prototype.setTimeout = function(func, msec){\n"
-		"	var i = Timer.getNew();\n"
-		"	Timer.buildCall(this.obj, i, arguments);\n"
-		"	Timer.set[i].timer = window.setTimeout(\"Timer.callOnce(\"+i+\"));\"),msec);\n"
-		"	return i;\n"
-		"}\n"
-		"\n"
-		"// The clear functions should be called with\n"
-		"// the return value from the equivalent set function.\n"
-		"\n"
-		"Timer.prototype.clearInterval = function(i){\n"
-		"	if(!Timer.set[i]) return;\n"
-		"	window.clearInterval(Timer.set[i].timer);\n"
-		"	Timer.set[i] = null;\n"
-		"}\n"
-		"Timer.prototype.clearTimeout = function(i){\n"
-		"	if(!Timer.set[i]) return;\n"
-		"	window.clearTimeout(Timer.set[i].timer);\n"
-		"	Timer.set[i] = null;\n"
-		"}\n"
-		"\n"
-		"// Private data\n"
-		"\n"
-		"Timer.set = new Array();\n"
-		"Timer.buildCall = function(obj, i, args){\n"
-		"	var t = \"\");\n"
-		"	Timer.set[i] = new Array();\n"
-		"	if(obj != window){\n"
-		"	Timer.set[i].obj = obj;\n"
-		"	t = \"Timer.set[\"+i+\"].obj.\");\n"
-		"	}\n"
-		"	t += args[0]+\"(\");\n"
-		"	if(args.length > 2){\n"
-		"	Timer.set[i][0] = args[2];\n"
-		"	t += \"Timer.set[\"+i+\"][0]\");\n"
-		"	for(var j=1; (j+2)<args.length; j++){\n"
-		"		Timer.set[i][j] = args[j+2];\n"
-		"		t += \"), Timer.set[\"+i+\"][\"+j+\"]\");\n"
-		"	}}\n"
-		"	t += \"));\");\n"
-		"	Timer.set[i].call = t;\n"
-		"	return t;\n"
-		"}\n"
-		"Timer.callOnce = function(i){\n"
-		"	if(!Timer.set[i]) return;\n"
-		"	eval(Timer.set[i].call);\n"
-		"	Timer.set[i] = null;\n"
-		"}\n"
-		"Timer.getNew = function(){\n"
-		"	var i = 0;\n"
-		"	while(Timer.set[i]) i++;\n"
-		"	return i;\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Slider(void)
-{
-	return(
-		"//slider properties\n"
-		"function slider(x1,y1,value1,x2,y2,value2,startVal,sliderGroupId,sliderColor,visSliderWidth,invisSliderWidth,sliderSymb,functionToCall,mouseMoveBool) {\n"
-		"	this.x1 = x1;\n"
-		"	this.y1 = y1;\n"
-		"	this.value1 = value1;\n"
-		"	this.x2 = x2;\n"
-		"	this.y2 = y2;\n"
-		"	this.value2 = value2;\n"
-		"	this.startVal = startVal;\n"
-		"	this.value = startVal;\n"
-		"	this.sliderGroupId = sliderGroupId;\n"
-		"	this.sliderGroup = document.getElementById(this.sliderGroupId);\n"
-		"	this.sliderColor = sliderColor;\n"
-		"	this.visSliderWidth = visSliderWidth;\n"
-		"	this.invisSliderWidth = invisSliderWidth;\n"
-		"	this.sliderSymb = sliderSymb;\n"
-		"	this.functionToCall = functionToCall;\n"
-		"	this.mouseMoveBool = mouseMoveBool;\n"
-		"	this.length = toPolarDist((this.x2 - this.x1),(this.y2 - this.y1));\n"
-		"	this.direction = toPolarDir((this.x2 - this.x1),(this.y2 - this.y1));\n"
-		"	this.sliderLine = null;\n"
-		"	this.createSlider();\n"
-		"	this.slideStatus = 0;\n"
-		"}\n"
-		"\n"
-		"//create slider\n"
-		"slider.prototype.createSlider = function() {\n"
-		"	this.sliderLine = document.createElementNS(svgNS,\"line\"));\n"
-		"	this.sliderLine.setAttributeNS(null,\"x1\"),this.x1);\n"
-		"	this.sliderLine.setAttributeNS(null,\"y1\"),this.y1);\n"
-		"	this.sliderLine.setAttributeNS(null,\"x2\"),this.x2);\n"
-		"	this.sliderLine.setAttributeNS(null,\"y2\"),this.y2);\n"
-		"	this.sliderLine.setAttributeNS(null,\"stroke\"),this.sliderColor);\n"
-		"	this.sliderLine.setAttributeNS(null,\"stroke-width\"),this.invisSliderWidth);\n"
-		"	this.sliderLine.setAttributeNS(null,\"opacity\"),\"0\"));\n"
-		"	this.sliderLine.setAttributeNS(null,\"stroke-linecap\"),\"square\"));\n"
-		"	this.sliderLine.setAttributeNS(null,\"id\"),this.sliderGroupId+\"_invisibleSliderLine\"));\n"
-		"	this.sliderLine.addEventListener(\"mousedown\"),this,false);\n"
-		"	this.sliderGroup.appendChild(this.sliderLine);\n"
-		"	var mySliderLine = document.createElementNS(svgNS,\"line\"));\n"
-		"	mySliderLine.setAttributeNS(null,\"x1\"),this.x1);\n"
-		"	mySliderLine.setAttributeNS(null,\"y1\"),this.y1);\n"
-		"	mySliderLine.setAttributeNS(null,\"x2\"),this.x2);\n"
-		"	mySliderLine.setAttributeNS(null,\"y2\"),this.y2);\n"
-		"	mySliderLine.setAttributeNS(null,\"stroke\"),this.sliderColor);\n"
-		"	mySliderLine.setAttributeNS(null,\"stroke-width\"),this.visSliderWidth);\n"
-		"	mySliderLine.setAttributeNS(null,\"id\"),this.sliderGroupId+\"_visibleSliderLine\"));\n"
-		"	mySliderLine.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
-		"	this.sliderGroup.appendChild(mySliderLine);\n"
-		"	mySliderSymb = document.createElementNS(svgNS,\"use\"));\n"
-		"	mySliderSymb.setAttributeNS(xlinkNS,\"xlink:href\"),\"#\"+this.sliderSymb);\n"
-		"	var myStartDistance = this.length - ((this.value2 - this.startVal) / (this.value2 - this.value1)) * this.length;\n"
-		"	var myPosX = this.x1 + toRectX(this.direction,myStartDistance);\n"
-		"	var myPosY = this.y1 + toRectY(this.direction,myStartDistance);\n"
-		"	var myTransformString = \"translate(\"+myPosX+\"),\"+myPosY+\")) rotate(\" + Math.round(this.direction / Math.PI * 180) + \"))\");\n"
-		"	mySliderSymb.setAttributeNS(null,\"transform\"),myTransformString);\n"
-		"	mySliderSymb.setAttributeNS(null,\"id\"),this.sliderGroupId+\"_sliderSymbol\"));\n"
-		"	this.sliderGroup.appendChild(mySliderSymb);\n"
-		"}\n"
-		"\n"
-		"//remove all slider elements\n"
-		"slider.prototype.removeSlider = function() {\n"
-		"	var mySliderSymb = document.getElementById(this.sliderGroup+\"_sliderSymbol\"));\n"
-		"	this.sliderGroup.removeChild(mySliderSymb);\n"
-		"	var mySliderLine = document.getElementById(this.sliderGroup+\"_visibleSliderLine\"));\n"
-		"	this.sliderGroup.removeChild(mySliderLine);\n"
-		"	var mySliderLine = document.getElementById(this.sliderGroup+\"_invisibleSliderLine\"));\n"
-		"	this.sliderGroup.removeChild(mySliderLine);\n"
-		"}\n"
-		"\n"
-		"//handle events\n"
-		"slider.prototype.handleEvent = function(evt) {\n"
-		"	this.drag(evt);\n"
-		"}\n"
-		"\n"
-		"//drag slider\n"
-		"slider.prototype.drag = function(evt) {\n"
-		"	if (evt.type == \"mousedown\" || (evt.type == \"mousemove\" && this.slideStatus == 1)) {\n"
-		"	//get coordinate in slider coordinate system\n"
-		"	var coordPoint = myMapApp.calcCoord(evt,this.sliderLine);\n"
-		"	//draw normal line for first vertex\n"
-		"	var ax = this.x2 - this.x1;\n"
-		"	var ay = this.y2 - this.y1;\n"
-		"	//normal vector 1\n"
-		"	var px1 = parseFloat(this.x1) + ay * -1;\n"
-		"	var py1 = parseFloat(this.y1) + ax;\n"
-		"	//normal vector 2\n"
-		"	var px2 = parseFloat(this.x2) + ay * -1;\n"
-		"	var py2 = parseFloat(this.y2) + ax;\n"
-		"		\n"
-		"	if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 0 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 1) {\n"
-		"		if (evt.type == \"mousedown\" && evt.detail == 1) {\n"
-		"		this.slideStatus = 1;\n"
-		"		document.documentElement.addEventListener(\"mousemove\"),this,false);\n"
-		"		document.documentElement.addEventListener(\"mouseup\"),this,false);\n"
-		"		}\n"
-		"		myNewPos = intersect2lines(this.x1,this.y1,this.x2,this.y2,coordPoint.x,coordPoint.y,coordPoint.x + ay * -1,coordPoint.y + ax);\n"
-		"		var myPercentage = toPolarDist(myNewPos['x'] - this.x1,myNewPos['y'] - this.y1) / this.length;\n"
-		"		this.value = this.value1 + myPercentage * (this.value2 - this.value1);\n"
-		"	}\n"
-		"	else {\n"
-		"		var myNewPos = new Array();\n"
-		"		if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 0 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 0) {\n"
-		"		//more than max\n"
-		"		this.value = this.value2;\n"
-		"		myNewPos['x'] = this.x2;\n"
-		"		myNewPos['y'] = this.y2;\n"
-		"		}\n"
-		"		if (leftOfTest(coordPoint.x,coordPoint.y,this.x1,this.y1,px1,py1) == 1 && leftOfTest(coordPoint.x,coordPoint.y,this.x2,this.y2,px2,py2) == 1) {\n"
-		"		//less than min\n"
-		"		this.value = this.value1;\n"
-		"		myNewPos['x'] = this.x1;\n"
-		"		myNewPos['y'] = this.y1;\n"
-		"		}\n"
-		"	}\n"
-		"	var myTransformString = \"translate(\"+myNewPos['x']+\"),\"+myNewPos['y']+\")) rotate(\" + Math.round(this.direction / Math.PI * 180) + \"))\");\n"
-		"	document.getElementById(this.sliderGroupId+\"_sliderSymbol\")).setAttributeNS(null,\"transform\"),myTransformString);\n"
-		"	this.getValue();\n"
-		"	}\n"
-		"	if (evt.type == \"mouseup\" && evt.detail == 1) {\n"
-		"	if (this.slideStatus == 1) {\n"
-		"		this.slideStatus = 2;\n"
-		"		document.documentElement.removeEventListener(\"mousemove\"),this,false);\n"
-		"		document.documentElement.removeEventListener(\"mouseup\"),this,false);\n"
-		"		this.getValue();\n"
-		"	}\n"
-		"	this.slideStatus = 0;\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//this code is executed, after the slider is released\n"
-		"//you can use switch/if to detect which slider was used (use this.sliderGroup) for that\n"
-		"slider.prototype.getValue = function() {\n"
-		"	if (this.slideStatus == 1 && this.mouseMoveBool == true) {\n"
-		"	if (typeof(this.functionToCall) == \"function\")) {\n"
-		"		this.functionToCall(\"change\"),this.sliderGroupId,this.value);\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == \"object\")) {\n"
-		"		this.functionToCall.getSliderVal(\"change\"),this.sliderGroupId,this.value);\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == \"string\")) {\n"
-		"		eval(this.functionToCall+\"('change','\"+this.sliderGroupId+\"',\"+this.value+\"))\"));\n"
-		"	}\n"
-		"	}\n"
-		"	if (this.slideStatus == 2) {\n"
-		"	if (typeof(this.functionToCall) == \"function\")) {\n"
-		"		this.functionToCall(\"release\"),this.sliderGroupId,this.value);\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == \"object\")) {\n"
-		"		this.functionToCall.getSliderVal(\"release\"),this.sliderGroupId,this.value);\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == \"string\")) {\n"
-		"		eval(this.functionToCall+\"('release','\"+this.sliderGroupId+\"',\"+this.value+\"))\"));\n"
-		"	}\n"
-		"	}\n"
-		"}	\n"
-		"\n"
-		"//this is to set the value from other scripts\n"
-		"slider.prototype.setValue = function(value) {\n"
-		"	var myPercAlLine = (value - this.value1) / (this.value2 - this.value1);\n"
-		"	this.value = myPercAlLine;\n"
-		"	var myPosX = this.x1 + toRectX(this.direction,this.length * myPercAlLine);\n"
-		"	var myPosY = this.y1 + toRectY(this.direction,this.length * myPercAlLine);\n"
-		"	var myTransformString = \"translate(\"+myPosX+\"),\"+myPosY+\")) rotate(\" + Math.round(this.direction / Math.PI * 180) + \"))\");\n"
-		"	document.getElementById(this.sliderGroupId+\"_sliderSymbol\")).setAttributeNS(null,\"transform\"),myTransformString);\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Helper(void)
-{
-	return(
-		"/*\n"
-		"ECMAScript helper functions\n"
-		"Copyright (C) <2004>	<Andreas Neumann>\n"
-		"Version 1.1, 2004-11-18\n"
-		"neumann at karto.baug.ethz.ch\n"
-		"http://www.carto.net/\n"
-		"http://www.carto.net/neumann/\n"
-		"\n"
-		"Credits: numerous people on svgdevelopers at yahoogroups.com\n"
-		"\n"
-		"This ECMA script library is free software; you can redistribute it and/or\n"
-		"modify it under the terms of the GNU Lesser General Public\n"
-		"License as published by the Free Software Foundation; either\n"
-		"version 2.1 of the License, or (at your option) any later version.\n"
-		"\n"
-		"This library is distributed in the hope that it will be useful,\n"
-		"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNU\n"
-		"Lesser General Public License for more details.\n"
-		"\n"
-		"You should have received a copy of the GNU Lesser General Public\n"
-		"License along with this library (http://www.carto.net/papers/svg/resources/lesser_gpl.txt); if not, write to the Free Software\n"
-		"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA	02111-1307	USA\n"
-		"\n"
-		"----\n"
-		"\n"
-		"original document site: http://www.carto.net/papers/svg/resources/helper_functions.js\n"
-		"Please contact the author in case you want to use code or ideas commercially.\n"
-		"If you use this code, please include this copyright header, the included full\n"
-		"LGPL 2.1 text and read the terms provided in the LGPL 2.1 license\n"
-		"(http://www.gnu.org/copyleft/lesser.txt)\n"
-		"\n"
-		"-------------------------------\n"
-		"\n"
-		"Please report bugs and send improvements to neumann at karto.baug.ethz.ch\n"
-		"If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)\n"
-		"somewhere in the source-code-comment or the \"about\" of your project and give credits, thanks!\n"
-		"\n"
-		"*/\n"
-		"\n"
-		"//global variables necessary to create elements in these namespaces, do not delete them!!!!\n"
-		"var svgNS = \"http://www.w3.org/2000/svg\");\n"
-		"var xlinkNS = \"http://www.w3.org/1999/xlink\");\n"
-		"var cartoNS = \"http://www.carto.net/attrib\");\n"
-		"var attribNS = \"http://www.carto.net/attrib\");\n"
-		"var batikNS = \"http://xml.apache.org/batik/ext\");\n"
-		"\n"
-		"/* ----------------------- helper functions to calculate stuff ---------------- */\n"
-		"/* ---------------------------------------------------------------------------- */\n"
-		"function toPolarDir(xdiff,ydiff) { // Subroutine for calculating polar Coordinates\n"
-		"	direction = (Math.atan2(ydiff,xdiff));\n"
-		"	//result is angle in radian\n"
-		"	return(direction);\n"
-		"}\n"
-		"\n"
-		"function toPolarDist(xdiff,ydiff) { // Subroutine for calculating polar Coordinates\n"
-		"	distance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n"
-		"	return(distance);\n"
-		"}\n"
-		"\n"
-		"function toRectX(direction,distance) { // Subroutine for calculating cartesic coordinates\n"
-		"	x = distance * Math.cos(direction);\n"
-		"	y = distance * Math.sin(direction);\n"
-		"	return(x);\n"
-		"}\n"
-		"\n"
-		"function toRectY(direction,distance) { // Subroutine for calculating cartesic coordinates\n"
-		"	x = distance * Math.cos(direction);\n"
-		"	y = distance * Math.sin(direction);\n"
-		"	return(y);\n"
-		"}\n"
-		"\n"
-		"//Converts degrees to radians.\n"
-		"function DegToRad(deg) {\n"
-		"	return (deg / 180.0 * Math.PI);\n"
-		"}\n"
-		"\n"
-		"//Converts radians to degrees.\n"
-		"function RadToDeg(rad) {\n"
-		"	return (rad / Math.PI * 180.0);\n"
-		"}\n"
-		"\n"
-		"//converts decimal degrees to degree/minutes/seconds\n"
-		"function dd2dms(dd) {\n"
-		"	var minutes = (dd - Math.floor(dd)) * 60;\n"
-		"	var seconds = (minutes - Math.floor(minutes)) * 60;\n"
-		"	var minutes = Math.floor(minutes);\n"
-		"	var degrees = Math.floor(dd);\n"
-		"	return {deg:degrees,min:minutes,sec:seconds};\n"
-		"}\n"
-		"\n"
-		"//converts degree/minutes/seconds to decimal degrees\n"
-		"function dms2dd(deg,min,sec) {\n"
-		"	return deg + (min / 60) + (sec / 3600);\n"
-		"}\n"
-		"\n"
-		"//log functions that do not exist in Math object\n"
-		"function log(x,b) {\n"
-		"	if(b==null) b=Math.E;\n"
-		"	return Math.log(x)/Math.log(b);\n"
-		"}\n"
-		"\n"
-		"//gets 4 z-values (4 corners), a position, delta x and delty and a cellsize as input and returns interpolated z-value\n"
-		"function intBilinear(za,zb,zc,zd,xpos,ypos,ax,ay,cellsize) { //bilinear interpolation function\n"
-		"	e = (xpos - ax) / cellsize;\n"
-		"	f = (ypos - ay) / cellsize;\n"
-		"\n"
-		"	//calculation of weights\n"
-		"	wa = (1 - e) * (1 - f);\n"
-		"	wb = e * (1 - f);\n"
-		"	wc = e * f;\n"
-		"	wd = f * (1 - e);\n"
-		"\n"
-		"	height_interpol = wa * zc + wb * zd + wc * za + wd * zb;\n"
-		"\n"
-		"	return (height_interpol);	\n"
-		"}\n"
-		"\n"
-		"//test if point is left of or right of, result is 1 (leftof) or 0 (rightof)\n"
-		"function leftOfTest(pointx,pointy,linex1,liney1,linex2,liney2) {\n"
-		"	result = (liney1 - pointy) * (linex2 - linex1) - (linex1 - pointx) * (liney2 - liney1);\n"
-		"	if (result < 0) {\n"
-		"	leftof = 1; //case left of\n"
-		"	}\n"
-		"	else {\n"
-		"	leftof = 0; //case left of	\n"
-		"	}\n"
-		"	return(leftof);\n"
-		"}\n"
-		"\n"
-		"//input is point coordinate, and 2 line coordinates\n"
-		"function distFromLine(xpoint,ypoint,linex1,liney1,linex2,liney2) {\n"
-		"	dx = linex2 - linex1;\n"
-		"	dy = liney2 - liney1;\n"
-		"	distance = (dy * (xpoint - linex1) - dx * (ypoint - liney1)) / Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2));\n"
-		"	return(distance);\n"
-		"}\n"
-		"\n"
-		"//converts radian value to degrees\n"
-		"function radian2deg(radian) {\n"
-		"	deg = radian / Math.PI * 180;\n"
-		"	return(deg);\n"
-		"}\n"
-		"\n"
-		"//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian\n"
-		"//Formula: Acos from	Scalaproduct of the two vectors divided by ( norm (deutsch Betrag) vector 1 by norm vector 2\n"
-		"//see http://www.mathe-online.at/mathint/vect2/i.html#Winkel\n"
-		"function angleBetwTwoLines(a1,a2,b1,b2) {\n"
-		"	angle = Math.acos((a1 * b1 + a2 * b2) / (Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2)) * Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2))));\n"
-		"	return(angle);\n"
-		"}\n"
-		"\n"
-		"//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is new vector c2 returned as array\n"
-		"//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)\n"
-		"//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale\n"
-		"function calcBisectorVector(a1,a2,b1,b2) {\n"
-		"	betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));\n"
-		"	betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));\n"
-		"	c = new Array();\n"
-		"	c[0] = a1 / betraga + b1 / betragb;\n"
-		"	c[1] = a2 / betraga + b2 / betragb;\n"
-		"	return(c);\n"
-		"}\n"
-		"\n"
-		"//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian\n"
-		"//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)\n"
-		"//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale\n"
-		"function calcBisectorAngle(a1,a2,b1,b2) {\n"
-		"	betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));\n"
-		"	betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));\n"
-		"	c1 = a1 / betraga + b1 / betragb;\n"
-		"	c2 = a2 / betraga + b2 / betragb;\n"
-		"	angle = toPolarDir(c1,c2);\n"
-		"	return(angle);\n"
-		"}\n"
-		"\n"
-		"function intersect2lines(line1x1,line1y1,line1x2,line1y2,line2x1,line2y1,line2x2,line2y2) {\n"
-		"	//formula see http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/\n"
-		"	var result = new Array();\n"
-		"	var denominator = (line2y2 - line2y1)*(line1x2 - line1x1) - (line2x2 - line2x1)*(line1y2 - line1y1);\n"
-		"	if (denominator == 0) {\n"
-		"	alert(\"lines are parallel\"));\n"
-		"	}\n"
-		"	else {\n"
-		"	ua = ((line2x2 - line2x1)*(line1y1 - line2y1) - (line2y2 - line2y1)*(line1x1 - line2x1)) / denominator;\n"
-		"	ub = ((line1x2 - line1x1)*(line1y1 - line2y1) - (line1y2 - line1y1)*(line1x1 - line2x1)) / denominator;\n"
-		"	}\n"
-		"	result[\"x\"] = line1x1 + ua * (line1x2 - line1x1);\n"
-		"	result[\"y\"] = line1y1 + ua * (line1y2 - line1y1);\n"
-		"	return(result);\n"
-		"}\n"
-		"\n"
-		"/* ----------------------- helper function to sort arrays ---------------- */\n"
-		"/* ----------------------------------------------------------------------- */\n"
-		"//my own sort function, uses only first part of string (population value)\n"
-		"function mySort(a,b) {\n"
-		"	var myResulta = a.split(\"+\"));\n"
-		"	var myResultb = b.split(\"+\"));\n"
-		"	if (parseFloat(myResulta[0]) < parseFloat(myResultb[0])) {\n"
-		"	return 1;\n"
-		"	}\n"
-		"	else {\n"
-		"	return -1;\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"/* ----------------------- helper function format number strings -------------- */\n"
-		"/* ---------------------------------------------------------------------------- */\n"
-		"//formatting number strings\n"
-		"//this function add's \"'\" to a number every third digit\n"
-		"function formatNumberString(myString) {\n"
-		"	//check if of type string, if number, convert it to string\n"
-		"	if (typeof(myString) == \"number\")) {\n"
-		"	myTempString = myString.toString();\n"
-		"	}\n"
-		"	else {\n"
-		"	myTempString = myString;\n"
-		"	}\n"
-		"	var myNewString=\"\");\n"
-		"	//if it contains a comma, it will be split\n"
-		"	var splitResults = myTempString.split(\".\"));\n"
-		"	var myCounter= splitResults[0].length;\n"
-		"	if (myCounter > 3) {\n"
-		"	while(myCounter > 0) {\n"
-		"		if (myCounter > 3) {\n"
-		"		myNewString = \"),\" + splitResults[0].substr(myCounter - 3,3) + myNewString;\n"
-		"		}\n"
-		"		else {\n"
-		"		myNewString = splitResults[0].substr(0,myCounter) + myNewString;\n"
-		"		}\n"
-		"		myCounter -= 3;\n"
-		"	}\n"
-		"	}\n"
-		"	else {\n"
-		"	myNewString = splitResults[0];\n"
-		"	}\n"
-		"	//concatenate if it contains a comma\n"
-		"	if (splitResults[1]) {\n"
-		"	myNewString = myNewString + \".\" + splitResults[1];\n"
-		"	}\n"
-		"	return myNewString;\n"
-		"}\n"
-		"\n"
-		"//function for status Bar\n"
-		"function statusChange(statusText) {\n"
-		"	document.getElementById(\"statusText\")).firstChild.nodeValue = \"Statusbar: \" + statusText;\n"
-		"}\n"
-		"\n"
-		"//scale an object\n"
-		"function scaleObject(evt,factor) {\n"
-		"//reference to the currently selected object\n"
-		"	var element = evt.currentTarget;\n"
-		"	var myX = element.getAttributeNS(null,\"x\"));\n"
-		"	var myY = element.getAttributeNS(null,\"y\"));\n"
-		"	var newtransform = \"scale(\" + factor + \")) translate(\" + (myX * 1 / factor - myX) + \" \" + (myY * 1 / factor - myY) +\"))\");\n"
-		"	element.setAttributeNS(null,'transform', newtransform);\n"
-		"}\n"
-		"\n"
-		"//this code is copied from Kevin Lindsey\n"
-		"//http://www.kevlindev.com/tutorials/basics/transformations/toUserSpace/index.htm\n"
-		"function getTransformToRootElement(node) {\n"
-		"	try {\n"
-		"	//this part is for fully conformant players\n"
-		"	var CTM = node.getTransformToElement(document.documentElement);\n"
-		"	}\n"
-		"	catch (ex) {\n"
-		"	//this part is for ASV3 or other non-conformant players\n"
-		"	// Initialize our CTM the node's Current Transformation Matrix\n"
-		"	var CTM = node.getCTM();\n"
-		"	// Work our way through the ancestor nodes stopping at the SVG Document\n"
-		"	while ( ( node = node.parentNode ) != document ) {\n"
-		"		// Multiply the new CTM to the one with what we have accumulated so far\n"
-		"		CTM = node.getCTM().multiply(CTM);\n"
-		"	}\n"
-		"	}\n"
-		"	return CTM;\n"
-		"}\n"
-		"\n"
-		"//calculate HSV 2 RGB: HSV (h 0 to 360, sat and val are between 0 and 1), RGB between 0 and 255\n"
-		"function hsv2rgb(hue,sat,val) {\n"
-		"	//alert(\"Hue:\"+hue);\n"
-		"	var rgbArr = new Array();\n"
-		"	if ( sat == 0) {\n"
-		"	rgbArr[\"red\"] = Math.round(val * 255);\n"
-		"	rgbArr[\"green\"] = Math.round(val * 255);\n"
-		"	rgbArr[\"blue\"] = Math.round(val * 255);\n"
-		"	}\n"
-		"	else {\n"
-		"	var h = hue / 60;\n"
-		"	var i = Math.floor(h);\n"
-		"	var f = h - i;\n"
-		"	if (i % 2 == 0) {\n"
-		"		f = 1 - f;\n"
-		"	}\n"
-		"	var m = val * (1 - sat); \n"
-		"	var n = val * (1 - sat * f);\n"
-		"	switch(i) {\n"
-		"		case 0:\n"
-		"		rgbArr[\"red\"] = val;\n"
-		"		rgbArr[\"green\"] = n;\n"
-		"		rgbArr[\"blue\"] = m;\n"
-		"		break;\n"
-		"		case 1:\n"
-		"		rgbArr[\"red\"] = n;\n"
-		"		rgbArr[\"green\"] = val;\n"
-		"		rgbArr[\"blue\"] = m;\n"
-		"		break;\n"
-		"		case 2:\n"
-		"		rgbArr[\"red\"] = m;\n"
-		"		rgbArr[\"green\"] = val;\n"
-		"		rgbArr[\"blue\"] = n;\n"
-		"		break;\n"
-		"		case 3:\n"
-		"		rgbArr[\"red\"] = m;\n"
-		"		rgbArr[\"green\"] = n;\n"
-		"		rgbArr[\"blue\"] = val;\n"
-		"		break;\n"
-		"		case 4:\n"
-		"		rgbArr[\"red\"] = n;\n"
-		"		rgbArr[\"green\"] = m;\n"
-		"		rgbArr[\"blue\"] = val;\n"
-		"		break;\n"
-		"		case 5:\n"
-		"		rgbArr[\"red\"] = val;\n"
-		"		rgbArr[\"green\"] = m;\n"
-		"		rgbArr[\"blue\"] = n;\n"
-		"		break;\n"
-		"		case 6:\n"
-		"		rgbArr[\"red\"] = val;\n"
-		"		rgbArr[\"green\"] = n;\n"
-		"		rgbArr[\"blue\"] = m;\n"
-		"		break;\n"
-		"	}\n"
-		"	rgbArr[\"red\"] = Math.round(rgbArr[\"red\"] * 255);\n"
-		"	rgbArr[\"green\"] = Math.round(rgbArr[\"green\"] * 255);\n"
-		"	rgbArr[\"blue\"] = Math.round(rgbArr[\"blue\"] * 255);\n"
-		"	}\n"
-		"	return rgbArr;\n"
-		"}\n"
-		"\n"
-		"//calculate rgb to hsv values\n"
-		"function rgb2hsv (red,green,blue) {\n"
-		"	//input between 0 and 255 --> normalize to 0 to 1\n"
-		"	//result = \n"
-		"	var hsvArr = new Array();\n"
-		"	red = red / 255;\n"
-		"	green = green / 255;\n"
-		"	blue = blue / 255;\n"
-		"	myMax = Math.max(red, Math.max(green,blue));\n"
-		"	myMin = Math.min(red, Math.min(green,blue));\n"
-		"	v = myMax;\n"
-		"	if (myMax > 0) {\n"
-		"	s = (myMax - myMin) / myMax;\n"
-		"	}\n"
-		"	else {\n"
-		"	s = 0;\n"
-		"	}\n"
-		"	if (s > 0) {\n"
-		"	myDiff = myMax - myMin;\n"
-		"	rc = (myMax - red) / myDiff;\n"
-		"	gc = (myMax - green) / myDiff;\n"
-		"	bc = (myMax - blue) / myDiff;\n"
-		"	if (red == myMax) {\n"
-		"		h = (bc - gc) / 6;\n"
-		"	}\n"
-		"	if (green == myMax) {\n"
-		"		h = (2 + rc - bc) / 6;\n"
-		"	}\n"
-		"	if (blue == myMax) {\n"
-		"		h = (4 + gc - rc) / 6;\n"
-		"	}\n"
-		"	}\n"
-		"	else {\n"
-		"	h = 0;\n"
-		"	}\n"
-		"	if (h < 0) {\n"
-		"	h += 1;\n"
-		"	}\n"
-		"	hsvArr[\"hue\"] = Math.round(h * 360);\n"
-		"	hsvArr[\"sat\"] = s;\n"
-		"	hsvArr[\"val\"] = v;\n"
-		"	return hsvArr;\n"
-		"}\n"
-		"\n"
-		"//populate an array that can be addressed by both a key or an index nr\n"
-		"function assArrayPopulate(arrayKeys,arrayValues) {\n"
-		"	var returnArray = new Array();\n"
-		"	if (arrayKeys.length != arrayValues.length) {\n"
-		"	alert(\"error: arrays do not have same length!\"));\n"
-		"	}\n"
-		"	else {\n"
-		"	for (i=0;i<arrayKeys.length;i++) {\n"
-		"		returnArray[arrayKeys[i]] = arrayValues[i];\n"
-		"	}\n"
-		"	}\n"
-		"	return returnArray;\n"
-		"}\n"
-		"\n"
-		"//replace special (non-ASCII) characters with their charCode\n"
-		"function replaceSpecialChars(myString) {\n"
-		"	for (i=161;i<256;i++) {\n"
-		"		re = new RegExp(\"&#\"+i+\");\"),\"g\"));\n"
-		"		myString = myString.replace(re,String.fromCharCode(i));\n"
-		"	}\n"
-		"	return myString;\n"
-		"}\n"
-		"\n"
-		"/* ----------------------- getXMLData object ----------------------------- */\n"
-		"/* ----------------------------------------------------------------------- */\n"
-		"//this object allows to make network requests using getURL or XMLHttpRequest\n"
-		"//you may specify a url and a callBackFunction\n"
-		"//the callBackFunction receives a XML node representing the rootElement of the fragment received\n"
-		"function getXMLData(url,callBackFunction) {\n"
-		"	this.url = url;\n"
-		"	this.callBackFunction = callBackFunction;\n"
-		"	this.xmlRequest = null;\n"
-		"} \n"
-		"\n"
-		"getXMLData.prototype.getData = function() {\n"
-		"	//call getURL() if available\n"
-		"	if (window.getURL) {\n"
-		"	getURL(this.url,this);\n"
-		"	}\n"
-		"	//or call XMLHttpRequest() if available\n"
-		"	else if (window.XMLHttpRequest) {\n"
-		"	this.xmlRequest = new XMLHttpRequest();\n"
-		"	this.xmlRequest.overrideMimeType(\"text/xml\"));\n"
-		"	this.xmlRequest.open(\"GET\"),this.url,true);\n"
-		"	this.xmlRequest.onreadystatechange = this;\n"
-		"	this.xmlRequest.send(null);\n"
-		"	}\n"
-		"	//write an error message if neither method is available\n"
-		"	else {\n"
-		"	alert(\"your browser/svg viewer neither supports window.getURL nor window.XMLHttpRequest!\"));\n"
-		"	}	\n"
-		"}\n"
-		"\n"
-		"//this is the callback method for the getURL function\n"
-		"getXMLData.prototype.operationComplete = function(data) {\n"
-		"	//check if data has a success property\n"
-		"	if (data.success) {\n"
-		"	//parse content of the XML format to the variable \"node\"\n"
-		"	var node = parseXML(data.content,document);\n"
-		"	this.callBackFunction(node.firstChild);\n"
-		"	}\n"
-		"	else {\n"
-		"	alert(\"something went wrong with dynamic loading of geometry!\"));\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//this method receives data from XMLHttpRequest\n"
-		"getXMLData.prototype.handleEvent = function() {\n"
-		"	if (this.xmlRequest.readyState == 4) {\n"
-		"	this.callBackFunction(this.xmlRequest.responseXML.documentElement);\n"
-		"	}	\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Buttons(void)
-{
-	return(
-		"function button(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
-		"	if (arguments.length > 0) {\n"
-		"	this.init(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"button.prototype.init = function(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
-		"	this.groupId = groupId; //the group id where all new content is appended to\n"
-		"	this.functionToCall = functionToCall; //function to be called if button was pressed\n"
-		"	this.buttonType = buttonType; //button type: currently either \"rect\" or \"ellipse\"\n"
-		"	this.buttonText = buttonText; //default value to be filled in when textbox is created\n"
-		"	this.buttonSymbolId = buttonSymbolId; //id to a symbol to be used as a button graphics\n"
-		"	this.x = x; //left of button rectangle\n"
-		"	this.y = y; //top of button rectangle\n"
-		"	this.width = width; //button rectangle width\n"
-		"	this.height = height; //button rectangle height\n"
-		"	this.fontSize = fontSize; //font size in user units/pixels\n"
-		"	this.fontFamily = fontFamily; //font family for text element, can be an empty string for image buttons\n"
-		"	this.textFill = textFill; //the fill color of the text for text buttons, can be an empty string for image buttons\n"
-		"	this.buttonFill = buttonFill; //the fill color of the button rectangle or ellipse\n"
-		"	this.shadeLightFill = shadeLightFill; //light fill color simulating 3d effect\n"
-		"	this.shadeDarkFill = shadeDarkFill; //dark fill color simulating 3d effect\n"
-		"	this.shadowOffset = shadowOffset; //shadow offset in viewBox units\n"
-		"	this.buttonGroup = document.getElementById(this.groupId); //reference to the button group node\n"
-		"	this.upperLeftLine = null; //later a reference to the upper left line simulating 3d effect\n"
-		"	this.buttonRect = null; //later a reference to the button area (rect)\n"
-		"	this.buttonTextElement = null; //later a reference to the button text\n"
-		"	this.buttonSymbolInstance = null; //later a reference to the button symbol\n"
-		"	this.deActivateRect = null; //later a reference to a rectangle that can be used to deactivate the button\n"
-		"	this.activated = true; //a property indicating if button is activated or not\n"
-		"	this.lowerRightLine = null; //later a reference to the lower right line simulating 3d effect\n"
-		"	this.createButton(); //method to initialize button\n"
-		"	this.timer = new Timer(this); //a Timer instance for calling the functionToCall\n"
-		"	this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms\n"
-		"}\n"
-		"\n"
-		"//create button\n"
-		"button.prototype.createButton = function() {\n"
-		"	//create upper left button line or ellipse\n"
-		"	if (this.buttonType == \"rect\")) {\n"
-		"	this.upperLeftShadow = document.createElementNS(svgNS,\"rect\"));\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"x\"),this.x - this.shadowOffset);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"y\"),this.y - this.shadowOffset);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"width\"),this.width);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"height\"),this.height);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"points\"),this.x+\"),\"+(this.y+this.height)+\" \"+this.x+\"),\"+this.y+\" \"+(this.x+this.width)+\"),\"+this.y);\n"
-		"	}\n"
-		"	else if (this.buttonType == \"ellipse\")) {\n"
-		"	this.upperLeftShadow = document.createElementNS(svgNS,\"ellipse\"));\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5 - this.shadowOffset);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5 - this.shadowOffset);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"rx\"),this.width * 0.5);\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"ry\"),this.height * 0.5);\n"
-		"	}\n"
-		"	else {\n"
-		"	alert(\"buttonType '\"+this.buttonType+\"' not supported. You need to specify 'rect' or 'ellipse'\"));\n"
-		"	}\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);\n"
-		"	this.buttonGroup.appendChild(this.upperLeftShadow);\n"
-		"\n"
-		"	//create lower right button line or ellipse\n"
-		"	if (this.buttonType == \"rect\")) {\n"
-		"	this.lowerRightShadow = document.createElementNS(svgNS,\"rect\"));\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"x\"),this.x + this.shadowOffset);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"y\"),this.y + this.shadowOffset);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"width\"),this.width);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"height\"),this.height);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"points\"),this.x+\"),\"+(this.y+this.height)+\" \"+this.x+\"),\"+this.y+\" \"+(this.x+this.width)+\"),\"+this.y);\n"
-		"	}\n"
-		"	else if (this.buttonType == \"ellipse\")) {\n"
-		"	this.lowerRightShadow = document.createElementNS(svgNS,\"ellipse\"));\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5 + this.shadowOffset);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5 + this.shadowOffset);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"rx\"),this.width * 0.5);\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"ry\"),this.height * 0.5);\n"
-		"	}\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);\n"
-		"	this.buttonGroup.appendChild(this.lowerRightShadow);\n"
-		"\n"
-		"	//create buttonRect\n"
-		"	if (this.buttonType == \"rect\")) {\n"
-		"	this.buttonRect = document.createElementNS(svgNS,\"rect\"));\n"
-		"	this.buttonRect.setAttributeNS(null,\"x\"),this.x);\n"
-		"	this.buttonRect.setAttributeNS(null,\"y\"),this.y);\n"
-		"	this.buttonRect.setAttributeNS(null,\"width\"),this.width);\n"
-		"	this.buttonRect.setAttributeNS(null,\"height\"),this.height);\n"
-		"	}\n"
-		"	else if (this.buttonType == \"ellipse\")) {\n"
-		"	this.buttonRect = document.createElementNS(svgNS,\"ellipse\"));\n"
-		"	this.buttonRect.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5);\n"
-		"	this.buttonRect.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5);\n"
-		"	this.buttonRect.setAttributeNS(null,\"rx\"),this.width * 0.5);\n"
-		"	this.buttonRect.setAttributeNS(null,\"ry\"),this.height * 0.5);\n"
-		"	}\n"
-		"	this.buttonRect.setAttributeNS(null,\"fill\"),this.buttonFill);\n"
-		"	this.buttonRect.setAttributeNS(null,\"cursor\"),\"pointer\"));\n"
-		"	this.buttonRect.addEventListener(\"mousedown\"),this,false);\n"
-		"	this.buttonRect.addEventListener(\"mouseup\"),this,false);\n"
-		"	this.buttonRect.addEventListener(\"click\"),this,false);\n"
-		"	this.buttonGroup.appendChild(this.buttonRect);\n"
-		"	\n"
-		"	if (this.buttonText != undefined) {\n"
-		"	//create text element and add clipping path attribute\n"
-		"	this.buttonTextElement = document.createElementNS(svgNS,\"text\"));\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"x\"),(this.x + this.width / 2));\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"y\"),(this.y + this.height - ((this.height - this.fontSize) / 1.75)));\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"fill\"),this.textFill);\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"font-family\"),this.fontFamily);\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"font-size\"),this.fontSize+\"px\"));\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
-		"	this.buttonTextElement.setAttributeNS(null,\"text-anchor\"),\"middle\"));\n"
-		"	this.buttonTextElement.setAttributeNS(\"http://www.w3.org/XML/1998/namespace\"),\"space\"),\"preserve\"));\n"
-		"	var textboxTextContent = document.createTextNode(this.buttonText);\n"
-		"	this.buttonTextElement.appendChild(textboxTextContent);\n"
-		"	this.buttonGroup.appendChild(this.buttonTextElement);\n"
-		"	}\n"
-		"	\n"
-		"	if (this.buttonSymbolId != undefined) {\n"
-		"	this.buttonSymbolInstance = document.createElementNS(svgNS,\"use\"));\n"
-		"	this.buttonSymbolInstance.setAttributeNS(null,\"x\"),(this.x + this.width / 2));\n"
-		"	this.buttonSymbolInstance.setAttributeNS(null,\"y\"),(this.y + this.height / 2));\n"
-		"	this.buttonSymbolInstance.setAttributeNS(xlinkNS,\"href\"),\"#\"+this.buttonSymbolId);\n"
-		"	this.buttonSymbolInstance.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
-		"	this.buttonGroup.appendChild(this.buttonSymbolInstance);\n"
-		"	}\n"
-		"	\n"
-		"	//create rectangle to deactivate the button\n"
-		"	if (this.buttonType == \"rect\")) {\n"
-		"	this.deActivateRect = document.createElementNS(svgNS,\"rect\"));\n"
-		"	this.deActivateRect.setAttributeNS(null,\"x\"),this.x - this.shadowOffset);\n"
-		"	this.deActivateRect.setAttributeNS(null,\"y\"),this.y - this.shadowOffset);\n"
-		"	this.deActivateRect.setAttributeNS(null,\"width\"),this.width + this.shadowOffset * 2);\n"
-		"	this.deActivateRect.setAttributeNS(null,\"height\"),this.height + this.shadowOffset * 2);\n"
-		"	}\n"
-		"	else if (this.buttonType == \"ellipse\")) {\n"
-		"	this.deActivateRect = document.createElementNS(svgNS,\"ellipse\"));\n"
-		"	this.deActivateRect.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5);\n"
-		"	this.deActivateRect.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5);\n"
-		"	this.deActivateRect.setAttributeNS(null,\"rx\"),this.width * 0.5 + this.shadowOffset);\n"
-		"	this.deActivateRect.setAttributeNS(null,\"ry\"),this.height * 0.5 + this.shadowOffset);\n"
-		"	}\n"
-		"	\n"
-		"	this.deActivateRect.setAttributeNS(null,\"fill\"),\"white\"));\n"
-		"	this.deActivateRect.setAttributeNS(null,\"fill-opacity\"),\"0.5\"));\n"
-		"	this.deActivateRect.setAttributeNS(null,\"stroke\"),\"none\"));\n"
-		"	this.deActivateRect.setAttributeNS(null,\"display\"),\"none\"));\n"
-		"	this.deActivateRect.setAttributeNS(null,\"cursor\"),\"default\"));\n"
-		"	this.buttonGroup.appendChild(this.deActivateRect);\n"
-		"}\n"
-		"\n"
-		"//remove all textbox elements\n"
-		"button.prototype.removeButton = function() {\n"
-		"	this.buttonGroup.removeChild(this.upperLeftShadow);\n"
-		"	this.buttonGroup.removeChild(this.lowerRightShadow);\n"
-		"	this.buttonGroup.removeChild(this.buttonRect);\n"
-		"	if (this.buttonTextElement) {\n"
-		"	this.buttonGroup.removeChild(this.buttonTextElement);	\n"
-		"	}\n"
-		"	if (this.buttonSymbolInstance) {\n"
-		"	this.buttonGroup.removeChild(this.buttonSymbolInstance);	\n"
-		"	}\n"
-		"	this.buttonGroup.removeChild(this.deActivateRect);\n"
-		"}\n"
-		"\n"
-		"//click on and write in textbox\n"
-		"button.prototype.handleEvent = function(evt) {\n"
-		"	if (evt.type == \"mousedown\")) {\n"
-		"	this.togglePressed(\"pressed\"));\n"
-		"	document.documentElement.addEventListener(\"mouseup\"),this,false);	\n"
-		"	}\n"
-		"	if (evt.type == \"mouseup\")) {\n"
-		"	this.togglePressed(\"released\"));\n"
-		"	document.documentElement.removeEventListener(\"mouseup\"),this,false);	\n"
-		"	}\n"
-		"	if (evt.type == \"click\")) {\n"
-		"	//for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround\n"
-		"	//attention: only some of the evt properties are forwarded here, you can add more, if you need them\n"
-		"	var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}\n"
-		"	this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt)\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"button.prototype.togglePressed = function(type) {\n"
-		"	if (type == \"pressed\")) {\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);	\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);\n"
-		"	}\n"
-		"	if (type == \"released\")) {\n"
-		"	this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);	\n"
-		"	this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);	\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"button.prototype.fireFunction = function(evt) {\n"
-		"	if (typeof(this.functionToCall) == \"function\")) {\n"
-		"	if (this.buttonTextElement) {\n"
-		"		this.functionToCall(this.groupId,evt,this.buttonText);\n"
-		"	}\n"
-		"	if (this.buttonSymbolInstance) {\n"
-		"		this.functionToCall(this.groupId,evt);\n"
-		"	}\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == \"object\")) {\n"
-		"	if (this.buttonTextElement) {\n"
-		"		this.functionToCall.buttonPressed(this.groupId,evt,this.buttonText);\n"
-		"	}\n"
-		"	if (this.buttonSymbolInstance) {\n"
-		"		this.functionToCall.buttonPressed(this.groupId,evt);\n"
-		"	}\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == undefined) {\n"
-		"	return;	\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"button.prototype.getTextValue = function() {\n"
-		"	return this.buttonText;\n"
-		"}	\n"
-		"\n"
-		"button.prototype.setTextValue = function(value) {\n"
-		"	this.buttonText = value;\n"
-		"	this.buttonTextElement.firstChild.nodeValue=this.buttonText;\n"
-		"}\n"
-		"\n"
-		"button.prototype.activate = function(value) {\n"
-		"	this.deActivateRect.setAttributeNS(null,\"display\"),\"none\"));\n"
-		"	this.activated = true;\n"
-		"}\n"
-		"\n"
-		"button.prototype.deactivate = function(value) {\n"
-		"	this.deActivateRect.setAttributeNS(null,\"display\"),\"inherit\"));\n"
-		"	this.activated = false;\n"
-		"}\n"
-		"\n"
-		"//switchbutton\n"
-		"//initialize inheritance\n"
-		"switchbutton.prototype = new button();\n"
-		"switchbutton.prototype.constructor = switchbutton;\n"
-		"switchbutton.superclass = button.prototype;\n"
-		"\n"
-		"function switchbutton(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
-		"	if (arguments.length > 0) {\n"
-		"	this.init(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"switchbutton.prototype.init = function(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n"
-		"	switchbutton.superclass.init.call(this,groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n"
-		"	this.on = false;\n"
-		"}\n"
-		"\n"
-		"//overwriting handleEventcode\n"
-		"switchbutton.prototype.handleEvent = function(evt) {\n"
-		"	//for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround\n"
-		"	//attention: only some of the evt properties are forwarded here, you can add more, if you need them\n"
-		"	var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}\n"
-		"	if (evt.type == \"click\")) {\n"
-		"	if (this.on) {\n"
-		"		this.on = false;\n"
-		"		this.togglePressed(\"released\"));\n"
-		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n"
-		"	}\n"
-		"	else {\n"
-		"		this.on = true;\n"
-		"		this.togglePressed(\"pressed\"));		\n"
-		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n"
-		"	}\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"switchbutton.prototype.getSwitchValue = function() {\n"
-		"	return this.on;\n"
-		"}\n"
-		"\n"
-		"switchbutton.prototype.setSwitchValue = function(onOrOff,firefunction) {\n"
-		"	this.on = onOrOff;\n"
-		"	//artificial timer event - don't use the values!\n"
-		"	var timerEvt = {x:0,y:0,type:\"click\"),detail:1,timeStamp:0}\n"
-		"	if (this.on) {\n"
-		"	this.togglePressed(\"pressed\"));\n"
-		"	if (firefunction) {\n"
-		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n"
-		"	}\n"
-		"	}\n"
-		"	else {\n"
-		"	this.togglePressed(\"released\"));		\n"
-		"	if (firefunction) {\n"
-		"		this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt)\n"
-		"	}\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//overwriting fireFunction code\n"
-		"switchbutton.prototype.fireFunction = function(evt) {\n"
-		"	if (typeof(this.functionToCall) == \"function\")) {\n"
-		"	if (this.buttonTextElement) {\n"
-		"		this.functionToCall(this.groupId,evt,this.on,this.buttonText);\n"
-		"	}\n"
-		"	if (this.buttonSymbolInstance) {\n"
-		"		this.functionToCall(this.groupId,evt,this.on);\n"
-		"	}\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == \"object\")) {\n"
-		"	if (this.buttonTextElement) {\n"
-		"		this.functionToCall.buttonPressed(this.groupId,evt,this.on,this.buttonText);\n"
-		"	}\n"
-		"	if (this.buttonSymbolInstance) {\n"
-		"		this.functionToCall.buttonPressed(this.groupId,evt,this.on);\n"
-		"	}\n"
-		"	}\n"
-		"	if (typeof(this.functionToCall) == undefined) {\n"
-		"	return;	\n"
-		"	}\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Navigation_1(void)
-{
-	return(
-		"/*\n"
-		"Scripts for SVG only webmapping application navigation tools\n"
-		"Copyright (C) <2005>  <Andreas Neumann>\n"
-		"Version 1.1, 2005-10-05\n"
-		"neumann at karto.baug.ethz.ch\n"
-		"http://www.carto.net/\n"
-		"http://www.carto.net/neumann/\n"
-		"\n"
-		"Credits: numerous people on svgdevelopers at yahoogroups.com\n"
-		"\n"
-		"This ECMA script library is free software; you can redistribute it and/or\n"
-		"modify it under the terms of the GNU Lesser General Public\n"
-		"License as published by the Free Software Foundation; either\n"
-		"version 2.1 of the License, or (at your option) any later version.\n"
-		"\n"
-		"This library is distributed in the hope that it will be useful,\n"
-		"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
-		"Lesser General Public License for more details.\n"
-		"\n"
-		"You should have received a copy of the GNU Lesser General Public\n"
-		"License along with this library (http://www.carto.net/papers/svg/navigationTools/lesser_gpl.txt); if not, write to the Free Software\n"
-		"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
-		"\n"
-		"----\n"
-		"\n"
-		"current version: 1.1\n"
-		"\n"
-		"version history:\n"
-		"1.0 initial version\n"
-		"1.01 (2005-02-15) added cleanUp() method to map and dragObj objects, some fixes in the documentation\n"
-		"1.02 (2005-02-20) fixed problems with double clicks, the second click of a double click is now ignored, using the evt.detail property\n"
-		"1.03 (2005-02-22) introduced timestamp and nrLayerToLoad array for dynamic loading (getUrl)\n"
-		"1.04 (2005-09-15) introduced a few changes with coordinate calculation to support MozillaSVG, introduced epsg and unitsFactor property based on a suggestion by Bruce Rindahl\n"
-		"1.1 (2005-10-05) introduced button object (see button.js file), introduced zoom and pan \"modes\" for repeated actions in the same mode, introduced history of map extents with the ability to go back and forth in the list of previous map extents, some internal changes in the code (e.g. less global variables), added experimental support for the batik SVG 1.2 \"static\" attribute to improve performance while panning the map, added cursors to give better status feedback\n"
-		"\n"
-		"original document site: http://www.carto.net/papers/svg/navigationTools/\n"
-		"Please contact the author in case you want to use code or ideas commercially.\n"
-		"If you use this code, please include this copyright header, the included full\n"
-		"LGPL 2.1 text and read the terms provided in the LGPL 2.1 license\n"
-		"(http://www.gnu.org/copyleft/lesser.txt)\n"
-		"\n"
-		"-------------------------------\n"
-		"\n"
-		"Please report bugs and send improvements to neumann at karto.baug.ethz.ch\n"
-		"If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)\n"
-		"somewhere in the source-code-comment or the \"about\" of your project and give credits, thanks!\n"
-		"\n"
-		"*/\n"
-		"\n"
-		"//constructor: holds data on map and initializes various references\n"
-		"function map(mapName,maxWidth,minWidth,zoomFact,nrDecimals,epsg,units,unitsFactor,showCoords,coordXId,coordYId,dynamicLayers,digiLayers,activeDigiLayer) {\n"
-		"	this.mapName = mapName; //id of svg element containing the map geometry\n"
-		"	this.mapSVG = document.getElementById(this.mapName); //reference to nested SVG element holding the map-graphics\n"
-		"	this.mainMapGroup = document.getElementById(this.mapName+\"Group\")); //group within mainmap - to be transformed when panning manually\n"
-		"	this.dynamicLayers = dynamicLayers; //an associative array holding ids of values that are loaded from the web server dynamically (.getUrl())\n"
-		"	this.nrLayerToLoad = 0; //statusVariable to indicate how many layers are still to load\n"
-		"	this.maxWidth = maxWidth; //max map width\n"
-		"	this.minWidth = minWidth; //min map width, after zooming in\n"
-		"	this.zoomFact = zoomFact; //ratio to zoom in or out in relation to previous viewBox\n"
-		"	this.digiLayers = digiLayers; //references to digiLayers (for digitizing tools)\n"
-		"	this.activeDigiLayer = activeDigiLayer; //active Digi Layer, key is final group id where geometry should be copied to after digitizing\n"
-		"	this.pixXOffset = parseFloat(this.mapSVG.getAttributeNS(null,\"x\"))); //offset from left margin of outer viewBox\n"
-		"	this.pixYOffset = parseFloat(this.mapSVG.getAttributeNS(null,\"y\"))); //offset from top margin of outer viewBox\n"
-		"	var viewBoxArray = this.mapSVG.getAttributeNS(null,\"viewBox\")).split(\" \"));\n"
-		"	this.curxOrig = parseFloat(viewBoxArray[0]); //holds the current xOrig\n"
-		"	this.curyOrig = parseFloat(viewBoxArray[1]); //holds the current yOrig\n"
-		"	this.curWidth = parseFloat(viewBoxArray[2]); //holds the current map width\n"
-		"	this.curHeight = parseFloat(viewBoxArray[3]); //holds the current map height\n"
-		"	this.pixWidth = parseFloat(this.mapSVG.getAttributeNS(null,\"width\"))); //holds width of the map in pixel coordinates\n"
-		"	this.pixHeight = parseFloat(this.mapSVG.getAttributeNS(null,\"height\"))); //holds height of the map in pixel coordinates\n"
-		"	this.pixSize = this.curWidth / this.pixWidth; //size of a screen pixel in map units\n"
-		"	this.zoomVal = this.maxWidth / this.curWidth * 100; //zoomVal in relation to initial zoom\n"
-		"	this.nrDecimals = nrDecimals; //nr of decimal places to be displayed for show coordinates or accuracy when working with digitizing\n"
-		"	this.epsg = epsg; //epsg projection code - can be used for building URL strings for loading data from a WMS or spatial database, if you don't need it just input any number\n"
-		"	this.navStatus = \"info\"); //to indicate status in navigation, default is \"info\"), no navigation mode active\n"
-		"	this.units = units; //holds a string with map units, e.g. \"m\"), alternatively String.fromCharCode(176) for degrees\n"
-		"	this.unitsFactor = unitsFactor; //a factor for unit conversion. Can be used f.e. to output feet coordinates when data is meter, If you don't need a conversion, just use a factor of 1\n"
-		"	this.showCoords = showCoords;\n"
-		"	//initialize array of timestamp/layertoLoad values\n"
-		"	this.nrLayerToLoad = new Array();\n"
-		"	this.timestamp = null; //holds the timestamp after a zoom or pan occured\n"
-		"	//initialize coordinate display if showCoords == true\n"
-		"	if (this.showCoords == true) {\n"
-		"		//add event listener for coordinate display\n"
-		"		this.mapSVG.addEventListener(\"mousemove\"),this,false);\n"
-		"		if (typeof(coordXId) == \"string\")) {\n"
-		"			this.coordXText = document.getElementById(coordXId).firstChild;\n"
-		"		}\n"
-		"		else {\n"
-		"			alert(\"Error: coordXId needs to be an id of type string\"));\n"
-		"		}\n"
-		"		if (typeof(coordYId) == \"string\")) {\n"
-		"			this.coordYText = document.getElementById(coordYId).firstChild;\n"
-		"		}\n"
-		"		else {\n"
-		"			alert(\"Error: coordYId needs to be an id of type string\"));\n"
-		"		}\n"
-		"	}\n"
-		"	//a new array containing map extents\n"
-		"	this.mapExtents = new Array();\n"
-		"	this.mapExtents.push({xmin:this.curxOrig,ymin:((this.curyOrig + this.curHeight) * -1),xmax:(this.curxOrig + this.curWidth),ymax:(this.curyOrig * -1)});\n"
-		"	this.curMapExtentIndex = 0;\n"
-		"	//create background-element to receive events for showing coordinates\n"
-		"	//this rect is also used for manual zooming and panning\n"
-		"	this.backgroundRect = document.createElementNS(svgNS,\"rect\"));\n"
-		"	this.backgroundRect.setAttributeNS(null,\"x\"),this.curxOrig);\n"
-		"	this.backgroundRect.setAttributeNS(null,\"y\"),this.curyOrig);\n"
-		"	this.backgroundRect.setAttributeNS(null,\"width\"),this.curWidth);\n"
-		"	this.backgroundRect.setAttributeNS(null,\"height\"),this.curHeight);\n"
-		"	this.backgroundRect.setAttributeNS(null,\"fill\"),\"none\"));\n"
-		"	this.backgroundRect.setAttributeNS(null,\"stroke\"),\"none\"));\n"
-		"	this.backgroundRect.setAttributeNS(null,\"pointer-events\"),\"fill\"));\n"
-		"	this.backgroundRect.setAttributeNS(null,\"id\"),\"mapBackgroundRect\"));\n"
-		"	this.backgroundRect.addEventListener(\"mousedown\"),this,false);\n"
-		"	this.backgroundRect.addEventListener(\"mousemove\"),this,false);\n"
-		"	this.backgroundRect.addEventListener(\"mouseup\"),this,false);\n"
-		"	this.backgroundRect.addEventListener(\"mouseout\"),this,false);\n"
-		"	this.backgroundRect.addEventListener(\"click\"),this,false);\n"
-		"	this.mainMapGroup.insertBefore(this.backgroundRect,this.mainMapGroup.firstChild);\n"
-		"	//determine if viewer is capable of getScreenCTM\n"
-		"	if (document.documentElement.getScreenCTM) {\n"
-		"		this.getScreenCTM = true;\n"
-		"	}\n"
-		"	else {\n"
-		"		this.getScreenCTM = false;		\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//resets viewBox of main map after zooming and panning\n"
-		"map.prototype.newViewBox = function(refRectId,history) {\n"
-		"	var myRefRect = document.getElementById(refRectId);\n"
-		"	this.curxOrig = parseFloat(myRefRect.getAttributeNS(null,\"x\")));\n"
-		"	this.curyOrig = parseFloat(myRefRect.getAttributeNS(null,\"y\")));\n"
-		"	this.curWidth = parseFloat(myRefRect.getAttributeNS(null,\"width\")));\n"
-		"	this.curHeight = parseFloat(myRefRect.getAttributeNS(null,\"height\")));\n"
-		"	var myViewBoxString = this.curxOrig + \" \" + this.curyOrig + \" \" + this.curWidth + \" \" + this.curHeight;\n"
-		"	this.pixSize = this.curWidth / this.pixWidth;\n"
-		"	this.zoomVal = this.maxWidth / this.curWidth * 100;\n"
-		"	this.mapSVG.setAttributeNS(null,\"viewBox\"),myViewBoxString);\n"
-		"	myMapApp.zoomSlider.setValue(this.curWidth);\n"
-		"	loadProjectSpecific();\n"
-		"	if (history) {\n"
-		"	    this.mapExtents.push({xmin:this.curxOrig,ymin:((this.curyOrig + this.curHeight) * -1),xmax:(this.curxOrig + this.curWidth),ymax:(this.curyOrig * -1)});\n"
-		"               this.curMapExtentIndex = (this.mapExtents.length - 1);\n"
-		"	}\n"
-		"	this.checkButtons();\n"
-		"}\n"
-		"\n"
-		"map.prototype.backwardExtent = function() {\n"
-		"    if (this.curMapExtentIndex != 0) {\n"
-		"        this.curMapExtentIndex--;\n"
-		"        this.setNewViewBox(this.mapExtents[this.curMapExtentIndex].xmin,this.mapExtents[this.curMapExtentIndex].ymin,this.mapExtents[this.curMapExtentIndex].xmax,this.mapExtents[this.curMapExtentIndex].ymax,false);\n"
-		"    }\n"
-		"}\n"
-		"\n"
-		"map.prototype.forwardExtent = function() {\n"
-		"    if (this.mapExtents.length != (this.curMapExtentIndex + 1)) {\n"
-		"        this.curMapExtentIndex++;\n"
-		"        this.setNewViewBox(this.mapExtents[this.curMapExtentIndex].xmin,this.mapExtents[this.curMapExtentIndex].ymin,this.mapExtents[this.curMapExtentIndex].xmax,this.mapExtents[this.curMapExtentIndex].ymax,false);\n"
-		"    }\n"
-		"}\n"
-		"\n"
-		"map.prototype.checkButtons = function() {\n"
-		"           //check extent history\n"
-		"           if (this.curMapExtentIndex == 0) {\n"
-		"                if (myMapApp.buttons[\"backwardExtent\"].activated) {\n"
-		"                  myMapApp.buttons[\"backwardExtent\"].deactivate();\n"
-		"                }\n"
-		"           }\n"
-		"           else {\n"
-		"                if (!myMapApp.buttons[\"backwardExtent\"].activated) {\n"
-		"                  myMapApp.buttons[\"backwardExtent\"].activate();\n"
-		"                }           \n"
-		"           }\n"
-		"           if (this.mapExtents.length == (this.curMapExtentIndex + 1)) {\n"
-		"                if (myMapApp.buttons[\"forwardExtent\"].activated) {\n"
-		"                   myMapApp.buttons[\"forwardExtent\"].deactivate();\n"
-		"                }\n"
-		"           }\n"
-		"           else {\n"
-		"                if (!myMapApp.buttons[\"forwardExtent\"].activated) {\n"
-		"                  myMapApp.buttons[\"forwardExtent\"].activate();\n"
-		"                }           \n"
-		"           }\n"
-		" \n"
-		"           //maximum map width reached, cannot zoom out further\n"
-		"           if (this.curWidth >= this.maxWidth) {\n"
-		"               if (myMapApp.buttons[\"zoomOut\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomOut\"].deactivate();\n"
-		"               }\n"
-		"               if (myMapApp.buttons[\"zoomFull\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomFull\"].deactivate();\n"
-		"               }\n"
-		"               if (myMapApp.buttons[\"panManual\"].activated) {\n"
-		"                   myMapApp.buttons[\"panManual\"].deactivate();\n"
-		"               }\n"
-		"               if (myMapApp.buttons[\"recenterMap\"].activated) {\n"
-		"                   myMapApp.buttons[\"recenterMap\"].deactivate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomIn\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomIn\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomManual\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomManual\"].activate();\n"
-		"               }\n"
-		"           }\n"
-		"           //minimum map width reached, cannot zoom in further\n"
-		"           else if (this.curWidth <= this.minWidth) {\n"
-		"               if (myMapApp.buttons[\"zoomIn\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomIn\"].deactivate();\n"
-		"               }\n"
-		"               if (myMapApp.buttons[\"zoomManual\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomManual\"].deactivate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomOut\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomOut\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomFull\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomFull\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"panManual\"].activated) {\n"
-		"                   myMapApp.buttons[\"panManual\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"recenterMap\"].activated) {\n"
-		"                   myMapApp.buttons[\"recenterMap\"].activate();\n"
-		"               }           \n"
-		"           }\n"
-		"           //in between\n"
-		"           else {\n"
-		"               if (!myMapApp.buttons[\"zoomIn\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomIn\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomManual\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomManual\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomOut\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomOut\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"zoomFull\"].activated) {\n"
-		"                   myMapApp.buttons[\"zoomFull\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"panManual\"].activated) {\n"
-		"                   myMapApp.buttons[\"panManual\"].activate();\n"
-		"               }\n"
-		"               if (!myMapApp.buttons[\"recenterMap\"].activated) {\n"
-		"                   myMapApp.buttons[\"recenterMap\"].activate();\n"
-		"               }           \n"
-		"           }           \n"
-		"}\n"
-		"\n"
-		"map.prototype.setNewViewBox = function(xmin,ymin,xmax,ymax,history) {\n"
-		"	//check if within constraints\n"
-		"	if (xmin < myMapApp.refMapDragger.constrXmin) {\n"
-		"		xmin = myMapApp.refMapDragger.constrXmin;\n"
-		"	}\n"
-		"	if (xmax > myMapApp.refMapDragger.constrXmax) {\n"
-		"		xmax = myMapApp.refMapDragger.constrXmin;\n"
-		"	}\n"
-		"	if (ymin < (myMapApp.refMapDragger.constrYmax * -1)) {\n"
-		"		ymin = myMapApp.refMapDragger.constrYmax * -1;\n"
-		"	}\n"
-		"	if (ymax > (myMapApp.refMapDragger.constrYmin * -1)) {\n"
-		"		ymax = myMapApp.refMapDragger.constrYmin * -1;\n"
-		"	}\n"
-		"	\n"
-		"	var origWidth = xmax - xmin;\n"
-		"	var origHeight = ymax - ymin;\n"
-		"	var myRatio = this.curWidth/this.curHeight;\n"
-		"	\n"
-		"	if (origWidth / origHeight > myRatio) { //case rect is more wide than ratio\n"
-		"		var newWidth = origWidth;\n"
-		"		var newHeight = origWidth * 1 / myRatio;\n"
-		"		ymin = (ymax + (newHeight - origHeight) / 2) * -1;\n"
-		"	}\n"
-		"	else {\n"
-		"		var newHeight = origHeight;\n"
-		"		var newWidth = newHeight * myRatio;\n"
-		"		xmin = xmin - (newWidth - origWidth) / 2;\n"
-		"		ymin = ymax * -1;\n"
-		"	}\n"
-		"	//check if within constraints\n"
-		"	if (xmin < myMapApp.refMapDragger.constrXmin) {\n"
-		"		xmin = myMapApp.refMapDragger.constrXmin;\n"
-		"	}\n"
-		"	if (ymin < myMapApp.refMapDragger.constrYmin) {\n"
-		"		ymin = myMapApp.refMapDragger.constrYmin;\n"
-		"	}\n"
-		"	if ((xmin + newWidth) > myMapApp.refMapDragger.constrXmax) {\n"
-		"		xmin = myMapApp.refMapDragger.constrXmax - newWidth;\n"
-		"	}\n"
-		"	if ((ymin + newHeight) > myMapApp.refMapDragger.constrYmax) {\n"
-		"		ymin = myMapApp.refMapDragger.constrYmax - newHeight;\n"
-		"	}		\n"
-		"	myMapApp.refMapDragger.newView(xmin,ymin,newWidth,newHeight);\n"
-		"	this.newViewBox(myMapApp.refMapDragger.dragId,history);\n"
-		"}\n"
-		"\n"
-		"//handles events associated with navigation\n"
-		"map.prototype.handleEvent = function(evt) {\n"
-		"	var callerId = evt.currentTarget.getAttributeNS(null,\"id\"));\n"
-		"	if (callerId.match(/\\bzoomBgRectManual/)) {\n"
-		"		this.zoomManDragRect(evt);\n"
-		"	}\n"
-		"	if (callerId.match(/\\bzoomBgRectRecenter/)) {\n"
-		"		this.recenterFinally(evt);\n"
-		"	}\n"
-		"	if (callerId.match(/\\bbgPanManual/)) {\n"
-		"		this.panManualFinally(evt);\n"
-		"	}\n"
-		"	if (callerId == \"mainMap\" && evt.type == \"mousemove\")) {\n"
-		"		if (this.navStatus != \"panmanualActive\")) {\n"
-		"		    this.showCoordinates(evt);\n"
-		"		}\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//calcs coordinates; relies on myMapApp to handle different window sizes and resizing of windows\n"
-		"map.prototype.calcCoord = function(evt) {\n"
-		"	//with getScreenCTM the values are already in the inner coordinate system\n"
-		"	if (!this.getScreenCTM) {\n"
-		"		var coords = myMapApp.calcCoord(evt,this.mapSVG);\n"
-		"		coords.x = this.curxOrig + (coords.x - this.pixXOffset) * this.pixSize;\n"
-		"		coords.y = (this.curyOrig + (coords.y - this.pixYOffset) * this.pixSize);\n"
-		"	}\n"
-		"	else {	\n"
-		"		var coords = myMapApp.calcCoord(evt,this.mainMapGroup);\n"
-		"	}\n"
-		"	return coords;\n"
-		"}\n"
-		"\n"
-		"//displays x and y coordinates in two separate text elements\n"
-		"map.prototype.showCoordinates = function(evt) {\n"
-		"	var mapCoords = this.calcCoord(evt);\n"
-		"	this.coordXText.nodeValue = \"X: \" + formatNumberString((mapCoords.x * this.unitsFactor).toFixed(this.nrDecimals)) + this.units;\n"
-		"	this.coordYText.nodeValue = \"Y: \" + formatNumberString((mapCoords.y * this.unitsFactor * -1).toFixed(this.nrDecimals)) + this.units;\n"
-		"}\n"
-		"\n"
-		"//checks for and removes temporary rectangle objects\n"
-		"map.prototype.stopNavModes = function() {\n"
-		"	if (this.navStatus != \"info\")) {\n"
-		"                    	if (this.navStatus == \"zoomManual\")) {\n"
-		"                    	    myMapApp.buttons[\"zoomManual\"].setSwitchValue(false,false);\n"
-		"                    	}\n"
-		"                     	if (this.navStatus == \"panmanual\" || this.navStatus == \"panmanualActive\")) {\n"
-		"                    	    myMapApp.buttons[\"panManual\"].setSwitchValue(false,false);\n"
-		"                    	}\n"
-		"                    	if (this.navStatus == \"recenter\")) {\n"
-		"                    	    myMapApp.buttons[\"recenterMap\"].setSwitchValue(false,false);\n"
-		"                    	}\n"
-		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"mapBackgroundRect\"));\n"
-		"		myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n"
-		"		this.navStatus = \"info\");\n"
-		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"crosshair\"));\n"
-		"		statusChange(\"Mode: Infomode\"));\n"
-		"	               this.mainMapGroup.insertBefore(this.backgroundRect,this.mainMapGroup.firstChild);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//starts manual zooming mode\n"
-		"map.prototype.zoomManual = function(evt) {\n"
-		"	if (Math.round(myMainMap.curWidth) > myMainMap.minWidth && evt.detail == 1) {\n"
-		"		this.navStatus = \"zoomManual\");\n"
-		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"zoomBgRectManual\"));	\n"
-		"	               this.mainMapGroup.appendChild(this.backgroundRect);\n"
-		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"se-resize\"));\n"
-		"		statusChange(\"Click and drag rectangle for new map extent.\"));\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//manages manual zooming by drawing a rectangle\n"
-		"map.prototype.zoomManDragRect = function(evt) {\n"
-		"	var mapCoords = this.calcCoord(evt);\n"
-		"	var myX = mapCoords.x;\n"
-		"	var myY = mapCoords.y;\n"
-		"	var myYXFact = this.curHeight / this.curWidth;\n"
-		"	if (evt.type == \"mousedown\")) {\n"
-		"		this.manZoomActive = 1;\n"
-		"		this.zoomRect = document.createElementNS(svgNS,\"rect\"));\n"
-		"		var myLineWidth = this.curWidth * 0.003;\n"
-		"		this.zoomRect.setAttributeNS(null,\"id\"),\"zoomRect\"));\n"
-		"		this.zoomRect.setAttributeNS(null,\"fill\"),\"white\"));\n"
-		"		this.zoomRect.setAttributeNS(null,\"fill-opacity\"),\"0.5\"));\n"
-		"		this.zoomRect.setAttributeNS(null,\"stroke\"),\"dimgray\"));\n"
-		"		this.zoomRect.setAttributeNS(null,\"stroke-width\"),myLineWidth);\n"
-		"		this.zoomRect.setAttributeNS(null,\"stroke-dasharray\"),(myLineWidth*3)+\"),\"+myLineWidth);\n"
-		"		this.zoomRect.setAttributeNS(null,\"pointer-events\"),\"none\"));\n"
-		"		this.zoomRect.setAttributeNS(null,\"x\"),myX);\n"
-		"		this.zoomRect.setAttributeNS(null,\"y\"),myY);\n"
-		"		this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n"
-		"		this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);\n"
-		"		this.mainMapGroup.appendChild(this.zoomRect);\n"
-		"		this.zoomRectOrigX = myX;\n"
-		"		this.zoomRectOrigY = myY;\n"
-		"	}\n"
-		"	if (evt.type == \"mousemove\" && this.manZoomActive == 1) {\n"
-		"		var myZoomWidth = myX - this.zoomRectOrigX;\n"
-		"		if (myZoomWidth < 0) {\n"
-		"			if (Math.abs(myZoomWidth) < this.minWidth) {\n"
-		"				this.zoomRect.setAttributeNS(null,\"x\"),this.zoomRectOrigX - this.minWidth);\n"
-		"				this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY - this.minWidth * myYXFact);\n"
-		"				this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n"
-		"				this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);\n"
-		"			}\n"
-		"			else {\n"
-		"				this.zoomRect.setAttributeNS(null,\"x\"),myX);\n"
-		"				this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY - Math.abs(myZoomWidth) * myYXFact);\n"
-		"				this.zoomRect.setAttributeNS(null,\"width\"),Math.abs(myZoomWidth));\n"
-		"				this.zoomRect.setAttributeNS(null,\"height\"),Math.abs(myZoomWidth) * myYXFact);			\n"
-		"			}\n"
-		"		}\n"
-		"		else {\n"
-		"			this.zoomRect.setAttributeNS(null,\"x\"),this.zoomRectOrigX);\n"
-		"			this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY);\n"
-		"			if (myZoomWidth < this.minWidth) {\n"
-		"				this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n"
-		"				this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);		\n"
-		"			}\n"
-		"			else {\n"
-		"				this.zoomRect.setAttributeNS(null,\"width\"),myZoomWidth);\n"
-		"				this.zoomRect.setAttributeNS(null,\"height\"),myZoomWidth * myYXFact);\n"
-		"			}\n"
-		"		}\n"
-		"	}\n"
-		"	if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.manZoomActive == 1) {\n"
-		"		this.manZoomActive = 0;\n"
-		"		if (parseFloat(this.zoomRect.getAttributeNS(null,\"width\"))) > this.curWidth * 0.02) {\n"
-		"			myMapApp.refMapDragger.newView(parseFloat(this.zoomRect.getAttributeNS(null,\"x\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"y\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"width\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"height\"))));\n"
-		"			this.newViewBox(myMapApp.refMapDragger.dragId,true);\n"
-		"		}\n"
-		"		this.mainMapGroup.removeChild(this.zoomRect);\n"
-		"		statusChange(\"Mode: Manual Zooming\"));\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//initializes recentering mode\n"
-		"map.prototype.recenter = function(evt) {\n"
-		"	if (evt.detail == 1) {\n"
-		"		this.navStatus = \"recenter\");\n"
-		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"zoomBgRectRecenter\"));	\n"
-		"	               this.mainMapGroup.appendChild(this.backgroundRect);\n"
-		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"pointer\"));\n"
-		"		statusChange(\"Click in map to define new map center.\"));\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//finishes recentering after mouse-click\n"
-		"map.prototype.recenterFinally = function(evt) {\n"
-		"	if (evt.type == \"click\")) {\n"
-		"		var mapCoords = this.calcCoord(evt);\n"
-		"		var myX = mapCoords.x;\n"
-		"		var myY = mapCoords.y;\n"
-		"		var myNewX = myX - this.curWidth / 2;\n"
-		"		var myNewY = myY - this.curHeight / 2;\n"
-		"		\n"
-		"		//check if within constraints\n"
-		"		if (myNewX < myMapApp.refMapDragger.constrXmin) {\n"
-		"			myNewX = myMapApp.refMapDragger.constrXmin;\n"
-		"		}\n"
-		"		if (myNewY < myMapApp.refMapDragger.constrYmin) {\n"
-		"			myNewY = myMapApp.refMapDragger.constrYmin;\n"
-		"		}\n"
-		"		if ((myNewX + this.curWidth) > myMapApp.refMapDragger.constrXmax) {\n"
-		"			myNewX = myMapApp.refMapDragger.constrXmax - this.curWidth;\n"
-		"		}\n"
-		"		if ((myNewY + this.curHeight) > myMapApp.refMapDragger.constrYmax) {\n"
-		"			myNewY = myMapApp.refMapDragger.constrYmax - this.curHeight;\n"
-		"		}\n"
-		"		myMapApp.refMapDragger.newView(myNewX,myNewY,this.curWidth,this.curHeight);\n"
-		"		this.newViewBox(myMapApp.refMapDragger.dragId,true);\n"
-		"		statusChange(\"Mode: Recentering Map\"));\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//initializes manual panning\n"
-		"map.prototype.panManual = function(evt) {\n"
-		"	if (evt.detail == 1) {\n"
-		"		this.navStatus = \"panmanual\");\n"
-		"                              this.backgroundRect.setAttributeNS(null,\"id\"),\"bgPanManual\"));	\n"
-		"	               this.mainMapGroup.appendChild(this.backgroundRect);\n"
-		"	               this.mapSVG.setAttributeNS(null,\"cursor\"),\"move\"));\n"
-		"		statusChange(\"Mouse down and move to pan the map\"));\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//manages and finishes manual panning\n"
-		"map.prototype.panManualFinally = function(evt) {\n"
-		"	if (evt.type == \"mousedown\")) {\n"
-		"		this.navStatus = \"panmanualActive\");\n"
-		"		this.panCoords = this.calcCoord(evt);\n"
-		"		this.panCoorX = this.panCoords.x;\n"
-		"		this.panCoorY = this.panCoords.y;\n"
-		"		this.diffX = 0;\n"
-		"		this.diffY = 0;\n"
-		"		this.mainMapGroup.setAttributeNS(batikNS,\"static\"),\"true\"));\n"
-		"	}\n"
-		"	if (evt.type == \"mousemove\" && this.navStatus == \"panmanualActive\")) {\n"
-		"		var mapCoords = this.calcCoord(evt);\n"
-		"		if (this.getScreenCTM) {\n"
-		"			this.diffX = this.panCoorX - mapCoords.x + this.diffX;\n"
-		"			this.diffY = this.panCoorY - mapCoords.y + this.diffY;\n"
-		"		}\n"
-		"		else {\n"
-		"			this.diffX = this.panCoorX - mapCoords.x;\n"
-		"			this.diffY = this.panCoorY - mapCoords.y;		\n"
-		"		}\n"
-		"		var myNewX = this.curxOrig + this.diffX;\n"
-		"		var myNewY = this.curyOrig + this.diffY;\n"
-		"		//check if within constraints\n"
-		"		if (myNewX < myMapApp.refMapDragger.constrXmin) {\n"
-		"			var myNewXTemp = myMapApp.refMapDragger.constrXmin;\n"
-		"			this.diffX = this.diffX + (myNewXTemp - myNewX);\n"
-		"			myNewX = myNewXTemp;\n"
-		"		}\n"
-		"		if (myNewY < myMapApp.refMapDragger.constrYmin) {\n"
-		"			var myNewYTemp = myMapApp.refMapDragger.constrYmin;\n"
-		"			this.diffY = this.diffY + (myNewYTemp - myNewY);\n"
-		"			myNewY = myNewYTemp;\n"
-		"		}\n"
-		"		if ((myNewX + this.curWidth) > myMapApp.refMapDragger.constrXmax) {\n"
-		"			var myNewXTemp = myMapApp.refMapDragger.constrXmax - this.curWidth;\n"
-		"			this.diffX = this.diffX + (myNewXTemp - myNewX);\n"
-		"			myNewX = myNewXTemp;\n"
-		"		}\n"
-		"		if ((myNewY + this.curHeight) > myMapApp.refMapDragger.constrYmax) {\n"
-		"			var myNewYTemp = myMapApp.refMapDragger.constrYmax - this.curHeight;\n"
-		"			this.diffY = this.diffY + (myNewYTemp - myNewY);\n"
-		"			myNewY = myNewYTemp;\n"
-		"		}	\n"
-		"		var transformString = \"translate(\"+(this.diffX * -1) +\"),\"+(this.diffY * -1)+\"))\");\n"
-		"		this.mainMapGroup.setAttributeNS(null,\"transform\"),transformString);\n"
-		"		myMapApp.refMapDragger.newView(myNewX,myNewY,this.curWidth,this.curHeight);\n"
-		"	}\n"
-		"	if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.navStatus == \"panmanualActive\")) {\n"
-		"		this.navStatus = \"panmanual\");\n"
-		"		this.mainMapGroup.setAttributeNS(batikNS,\"static\"),\"false\"));\n"
-		"		this.mainMapGroup.setAttributeNS(null,\"transform\"),\"translate(0,0)\"));\n"
-		"		this.newViewBox(myMapApp.refMapDragger.dragId,true);			\n"
-		"		statusChange(\"Mode: Manual Panning\"));	\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//remove all temporarily added elements and event listeners\n"
-		"map.prototype.cleanUp = function() {\n"
-		"			//remove background rect\n"
-		"			this.backgroundRect.parentNode.removeChild(this.backgroundRect);\n"
-		"			//remove eventlisteners\n"
-		"			if (this.showCoords == true) {\n"
-		"				//add event listener for coordinate display\n"
-		"				this.mapSVG.removeEventListener(\"mousemove\"),this,false);\n"
-		"			}\n"
-		"\n"
-		"}\n"
-		"\n"
-		"//make an element (rectangle) draggable within constraints\n"
-		"function dragObj(dragId,referenceMap,myDragSymbol,dragSymbThreshold,showCoords,coordXId,coordYId,mainMapObj) {\n"
-		"	this.dragId = dragId;\n"
-		"	this.myDragger = document.getElementById(this.dragId);\n"
-		"	this.myRefMap = document.getElementById(referenceMap);\n"
-		"	this.myDragSymbol = document.getElementById(myDragSymbol);	\n"
-		"	this.dragSymbThreshold = dragSymbThreshold;\n"
-		"	var viewBox = this.myRefMap.getAttributeNS(null,\"viewBox\")).split(\" \"));\n"
-		"	this.constrXmin = parseFloat(viewBox[0]);\n"
-		"	this.constrYmin = parseFloat(viewBox[1]);\n"
-		"	this.constrXmax = this.constrXmin + parseFloat(viewBox[2]);\n"
-		"	this.constrYmax = this.constrYmin + parseFloat(viewBox[3]);\n"
-		"	this.refMapX = parseFloat(this.myRefMap.getAttributeNS(null,\"x\")));\n"
-		"	this.refMapY = parseFloat(this.myRefMap.getAttributeNS(null,\"y\")));\n"
-		"	this.refMapWidth = parseFloat(this.myRefMap.getAttributeNS(null,\"width\")));\n"
-		"	this.pixSize = (this.constrXmax - this.constrXmin) / this.refMapWidth;\n"
-		"	this.mainMapObj = mainMapObj;\n"
-		"	//initialize coordinate display if showCoords == true\n"
-		"	this.showCoords = showCoords;\n"
-		"	if (this.showCoords == true) {\n"
-		"		if (typeof(coordXId) == \"string\")) {\n"
-		"			this.coordXText = document.getElementById(coordXId).firstChild;\n"
-		"		}\n"
-		"		else {\n"
-		"			alert(\"Error: coordXId needs to be an id of type string\"));\n"
-		"		}\n"
-		"		if (typeof(coordYId) == \"string\")) {\n"
-		"			this.coordYText = document.getElementById(coordYId).firstChild;\n"
-		"		}\n"
-		"		else {\n"
-		"			alert(\"Error: coordYId needs to be an id of type string\"));\n"
-		"		}\n"
-		"	}\n"
-		"	//determine if viewer is capable of getScreenCTM\n"
-		"	if (document.documentElement.getScreenCTM) {\n"
-		"		this.getScreenCTM = true;\n"
-		"	}\n"
-		"	else {\n"
-		"		this.getScreenCTM = false;		\n"
-		"	}\n"
-		"	this.status = false;\n"
-		"}\n"
-		"\n"
-		"dragObj.prototype.calcCoord = function(evt) {\n"
-		"	//with getScreenCTM the values are already in the inner coordinate system but without using the outer offset\n"
-		"	var coordPoint = myMapApp.calcCoord(evt,this.myRefMap);\n"
-		"	if (!this.getScreenCTM) {\n"
-		"		coordPoint.x = this.constrXmin + (coordPoint.x - this.refMapX) * this.pixSize;\n"
-		"		coordPoint.y = this.constrYmin + (coordPoint.y - this.refMapY) * this.pixSize;\n"
-		"	}\n"
-		"	return coordPoint;\n"
-		"}\n"
-		"\n"
-		"dragObj.prototype.handleEvent = function(evt) {\n"
-		"	if (evt.type == \"mousemove\")) {\n"
-		"		var mapCoords = this.calcCoord(evt);\n"
-		"		this.coordXText.nodeValue = \"X: \" + formatNumberString(mapCoords.x.toFixed(this.mainMapObj.nrDecimals)) + this.mainMapObj.units;\n"
-		"		this.coordYText.nodeValue = \"Y: \" + formatNumberString((mapCoords.y * -1).toFixed(this.mainMapObj.nrDecimals)) + this.mainMapObj.units;\n"
-		"	}\n"
-		"	this.drag(evt);\n"
-		"}\n"
-		"\n"
-		"dragObj.prototype.newView = function(x,y,width,height) {\n"
-		"	this.myDragger.setAttributeNS(null,\"x\"),x);\n"
-		"	this.myDragger.setAttributeNS(null,\"y\"),y);\n"
-		"	this.myDragger.setAttributeNS(null,\"width\"),width);\n"
-		"	this.myDragger.setAttributeNS(null,\"height\"),height);\n"
-		"	this.myDragSymbol.setAttributeNS(null,\"x\"),(x + width/2));\n"
-		"	this.myDragSymbol.setAttributeNS(null,\"y\"),(y + height/2));\n"
-		"	if (width < this.dragSymbThreshold) {\n"
-		"		this.myDragSymbol.setAttributeNS(null,\"visibility\"),\"visible\"));\n"
-		"	}\n"
-		"	else {\n"
-		"		this.myDragSymbol.setAttributeNS(null,\"visibility\"),\"hidden\"));	\n"
-		"	}\n"
-		"}\n"
-		"\n"
-	);
-}
-
-//---------------------------------------------------------
-const char * CSVG_Interactive_Map::_Get_Code_Navigation_2(void)
-{
-	return(
-		"//this method was previously called \"resizeDragger\" - now renamed to .getSliderVal\n"
-		"//this method receives values from the zoom slider\n"
-		"dragObj.prototype.getSliderVal = function(status,sliderGroupName,width) {\n"
-		"	var myX = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n"
-		"	var myY = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n"
-		"	var myWidth = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n"
-		"	var myHeight = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n"
-		"	var myCenterX = myX + myWidth / 2;\n"
-		"	var myCenterY = myY + myHeight / 2;\n"
-		"	var myRatio = myHeight / myWidth;\n"
-		"	var toMoveX = myCenterX - width / 2;\n"
-		"	var toMoveY = myCenterY - width * myRatio / 2;\n"
-		"	if (toMoveX < this.constrXmin) {\n"
-		"		toMoveX = this.constrXmin;\n"
-		"	}\n"
-		"	if ((toMoveX + width) > this.constrXmax) {\n"
-		"		toMoveX = this.constrXmax - width;\n"
-		"	}\n"
-		"	if (toMoveY < this.constrYmin) {\n"
-		"		toMoveY = this.constrYmin;\n"
-		"	}\n"
-		"	if ((toMoveY + width * myRatio) > this.constrYmax) {\n"
-		"		toMoveY = this.constrYmax - width * myRatio;\n"
-		"	}\n"
-		"	this.newView(toMoveX,toMoveY,width,width * myRatio);\n"
-		"	if (status == \"release\")) {\n"
-		"	           myMainMap.stopNavModes();\n"
-		"		this.mainMapObj.newViewBox(this.dragId,true);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"dragObj.prototype.drag = function(evt) {\n"
-		"	if (evt.type == \"mousedown\")) {\n"
-		"		this.myRefMap.setAttributeNS(null,\"cursor\"),\"move\"));\n"
-		"		this.status = true;\n"
-		"	}\n"
-		"	if ((evt.type == \"mousemove\" || evt.type == \"mousedown\")) && this.status == true) {\n"
-		"		var coords = this.calcCoord(evt);\n"
-		"		var newEvtX = coords.x;\n"
-		"		var newEvtY = coords.y;\n"
-		"		var myX = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n"
-		"		var myY = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n"
-		"		var myWidth = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n"
-		"		var myHeight = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n"
-		"		var toMoveX = newEvtX - myWidth / 2;\n"
-		"		var toMoveY = newEvtY - myHeight / 2;\n"
-		"		if (toMoveX < this.constrXmin) {\n"
-		"			toMoveX = this.constrXmin;\n"
-		"		}\n"
-		"		if ((toMoveX + myWidth) > this.constrXmax) {\n"
-		"			toMoveX = this.constrXmax - myWidth;\n"
-		"		}\n"
-		"		if (toMoveY < this.constrYmin) {\n"
-		"			toMoveY = this.constrYmin;\n"
-		"		}\n"
-		"		if ((toMoveY + myHeight) > this.constrYmax) {\n"
-		"			toMoveY = this.constrYmax - myHeight;\n"
-		"		}\n"
-		"		this.newView(toMoveX,toMoveY,myWidth,myHeight);\n"
-		"	}\n"
-		"	if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.status == true) {\n"
-		"		this.status = false;\n"
-		"		if (evt.detail == 1) { //second click is ignored\n"
-		"		               this.myRefMap.setAttributeNS(null,\"cursor\"),\"crosshair\"));\n"
-		"			this.mainMapObj.newViewBox('dragRectForRefMap',true);\n"
-		"		}\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"dragObj.prototype.zoom = function(inOrOut) {\n"
-		"	var myOldX = this.myDragger.getAttributeNS(null,\"x\"));\n"
-		"	var myOldY = this.myDragger.getAttributeNS(null,\"y\"));\n"
-		"	var myOldWidth = this.myDragger.getAttributeNS(null,\"width\"));\n"
-		"	var myOldHeight = this.myDragger.getAttributeNS(null,\"height\"));\n"
-		"	switch (inOrOut) {\n"
-		"		case \"in\":\n"
-		"			var myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myOldWidth * this.mainMapObj.zoomFact * 0.5);\n"
-		"			var myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myOldHeight * this.mainMapObj.zoomFact * 0.5);\n"
-		"			var myNewWidth = myOldWidth * this.mainMapObj.zoomFact;\n"
-		"			var myNewHeight = myOldHeight * this.mainMapObj.zoomFact;\n"
-		"			if (myNewWidth < this.mainMapObj.minWidth) {\n"
-		"				var myYXFact = this.mainMapObj.curHeight / this.mainMapObj.curWidth;\n"
-		"				myNewWidth = this.mainMapObj.minWidth;\n"
-		"				myNewHeight = myNewWidth * myYXFact;\n"
-		"				myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myNewWidth * 0.5);\n"
-		"				myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myNewHeight * 0.5);\n"
-		"			}\n"
-		"			break;\n"
-		"		case \"out\":\n"
-		"			var myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myOldWidth * (1 + this.mainMapObj.zoomFact) * 0.5);\n"
-		"			var myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myOldHeight * (1 + this.mainMapObj.zoomFact) * 0.5);\n"
-		"			var myNewWidth = myOldWidth * (1 + this.mainMapObj.zoomFact);\n"
-		"			var myNewHeight = myOldHeight * (1 + this.mainMapObj.zoomFact);\n"
-		"			break;\n"
-		"		default:\n"
-		"			var myNewX = this.constrXmin;\n"
-		"			var myNewY = this.constrYmin;\n"
-		"			var myNewWidth = this.constrXmax - this.constrXmin;\n"
-		"			var myNewHeight = this.constrYmax - this.constrYmin;\n"
-		"			break;\n"
-		"	}	\n"
-		"	//check if within constraints\n"
-		"	if (myNewWidth > (this.constrXmax - this.constrXmin)) {\n"
-		"		myNewWidth = this.constrXmax - this.constrXmin;\n"
-		"	}\n"
-		"	if (myNewHeight > (this.constrYmax - this.constrYmin)) {\n"
-		"		myNewHeight = this.constrYmax - this.constrYmin;\n"
-		"	}\n"
-		"	if (myNewX < this.constrXmin) {\n"
-		"		myNewX = this.constrXmin;\n"
-		"	}\n"
-		"	if (myNewY < this.constrYmin) {\n"
-		"		myNewY = this.constrYmin;\n"
-		"	}\n"
-		"	if ((myNewX + myNewWidth) > this.constrXmax) {\n"
-		"		myNewX = this.constrXmax - myNewWidth;\n"
-		"	}\n"
-		"	if ((myNewY + myNewHeight) > this.constrYmax) {\n"
-		"		myNewY = this.constrYmax - myNewHeight;\n"
-		"	}\n"
-		"	this.newView(myNewX,myNewY,myNewWidth,myNewHeight);\n"
-		"	this.mainMapObj.newViewBox(this.dragId,true);\n"
-		"}\n"
-		"\n"
-		"dragObj.prototype.pan = function (myX,myY,howmuch) {\n"
-		"	//get values from draggable rectangle\n"
-		"	var xulcorner = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n"
-		"	var yulcorner = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n"
-		"	var width = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n"
-		"	var height = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n"
-		"\n"
-		"	//set values of draggable rectangle\n"
-		"	var rectXulcorner = xulcorner + howmuch * width * myX;\n"
-		"	var rectYulcorner = yulcorner + howmuch * height * myY;\n"
-		"	//check if within constraints\n"
-		"	if (rectXulcorner < this.constrXmin) {\n"
-		"		rectXulcorner = this.constrXmin;\n"
-		"	}\n"
-		"	if (rectYulcorner < this.constrYmin) {\n"
-		"		rectYulcorner = this.constrYmin;\n"
-		"	}\n"
-		"	if ((rectXulcorner + width) > this.constrXmax) {\n"
-		"		rectXulcorner = this.constrXmax - width;\n"
-		"	}\n"
-		"	if ((rectYulcorner + height) > this.constrYmax) {\n"
-		"		rectYulcorner = this.constrYmax - height;\n"
-		"	}\n"
-		"	this.newView(rectXulcorner,rectYulcorner,width,height);\n"
-		"\n"
-		"	//set viewport of main map\n"
-		"	if ((xulcorner != rectXulcorner) || (yulcorner != rectYulcorner)) {\n"
-		"		this.mainMapObj.newViewBox(this.dragId,true);\n"
-		"	}\n"
-		"\n"
-		"	statusChange(\"map ready ...\"));\n"
-		"}\n"
-		"\n"
-		"//remove all temporarily used elements and event listeners\n"
-		"dragObj.prototype.cleanUp = function() {\n"
-		"	//remove eventlisteners\n"
-		"	if (this.showCoords == true) {\n"
-		"		//add event listener for coordinate display\n"
-		"		this.myRefMap.removeEventListener(\"mousemove\"),this,false);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"function zoomIt(evt,inOrOut) {\n"
-		"	if (evt.detail == 1) { //only react on first click, double click: second click is ignored\n"
-		"		if (inOrOut == \"in\")) {\n"
-		"			if (Math.round(myMainMap.curWidth) > myMainMap.minWidth) {\n"
-		"				myMapApp.refMapDragger.zoom(\"in\"));\n"
-		"			}\n"
-		"			else {\n"
-		"				statusChange(\"Maximum zoom factor reached. Cannot zoom in any more.\"));\n"
-		"			}\n"
-		"		}\n"
-		"		if (inOrOut == \"out\")) {\n"
-		"			if (Math.round(myMainMap.curWidth) < myMainMap.maxWidth) {\n"
-		"				myMapApp.refMapDragger.zoom(\"out\"));\n"
-		"			}\n"
-		"			else {\n"
-		"				statusChange(\"Minimum zoom factor reached. Cannot zoom out any more.\"));\n"
-		"			}\n"
-		"		}\n"
-		"		if (inOrOut == \"full\")) {\n"
-		"			if (Math.round(myMainMap.curWidth) < myMainMap.maxWidth) {\n"
-		"				myMapApp.refMapDragger.zoom(\"full\"));\n"
-		"			}\n"
-		"			else {\n"
-		"				statusChange(\"Full view already reached.\"));\n"
-		"			}\n"
-		"		}\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//this function starts various zoom actions or map extent history functions\n"
-		"function zoomImageButtons(id,evt) {\n"
-		"	myMainMap.stopNavModes();\n"
-		"	if (id == \"zoomIn\")) {\n"
-		"		zoomIt(evt,'in');\n"
-		"	}\n"
-		"	if (id == \"zoomOut\")) {\n"
-		"		zoomIt(evt,'out');\n"
-		"	}\n"
-		"	if (id == \"zoomFull\")) {\n"
-		"		zoomIt(evt,'full');\n"
-		"	}\n"
-		"	if (id == \"backwardExtent\")) {\n"
-		"		myMainMap.backwardExtent();\n"
-		"	}\n"
-		"	if (id == \"forwardExtent\")) {\n"
-		"		myMainMap.forwardExtent();\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//this function starts various interactive zoom or pan modes\n"
-		"function zoomImageSwitchButtons(id,evt,onOrOff) {\n"
-		"	myMainMap.stopNavModes();\n"
-		"	if (onOrOff) {\n"
-		"                      if (id == \"infoButton\")) {\n"
-		"                      \n"
-		"                      }\n"
-		"                      else {\n"
-		"		    if (id == \"zoomManual\")) {\n"
-		"			    myMainMap.zoomManual(evt);\n"
-		"		    }\n"
-		"		    if (id == \"panManual\")) {\n"
-		"			    myMainMap.panManual(evt);\n"
-		"		    }\n"
-		"		    if (id == \"recenterMap\")) {\n"
-		"			    myMainMap.recenter(evt);\n"
-		"		    }\n"
-		"		    if (myMapApp.buttons[\"infoButton\"].getSwitchValue()) {\n"
-		"		        myMapApp.buttons[\"infoButton\"].setSwitchValue(false,false);\n"
-		"		    }\n"
-		"		}\n"
-		"	}\n"
-		"	else {\n"
-		"	    if (id == \"infoButton\")) {\n"
-		"	        myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n"
-		"	    }\n"
-		"	}\n"
-		"}\n"
-		"\n"
-		"//alert map extent\n"
-		"function showExtent() {\n"
-		"	with(myMainMap) {\n"
-		"		alert(\n"
-		"         \"Xmin=\"+curxOrig.toFixed(nrDecimals)+units+\n"
-		"         \"); Xmax=\"+(curxOrig + curWidth).toFixed(nrDecimals)+units+\n"
-		"         \"\\nYmin=\"+((curyOrig + curHeight) * -1).toFixed(nrDecimals) +units+\n"
-		"         \"); Ymax=\"+(curyOrig*-1).toFixed(nrDecimals)+units+\n"
-		"         \"\\nWidth=\"+curWidth.toFixed(nrDecimals)+units+\n"
-		"         \"); Height=\"+curHeight.toFixed(nrDecimals)+units);\n"
-		"	}\n"
-		"}\n"
-		"\n"
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_pdf/Makefile.in b/src/modules_io/docs/docs_pdf/Makefile.in
deleted file mode 100644
index f4988ca..0000000
--- a/src/modules_io/docs/docs_pdf/Makefile.in
+++ /dev/null
@@ -1,592 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/docs/docs_pdf
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
- at HAVE_HARU_TRUE@libdocs_pdf_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am__libdocs_pdf_la_SOURCES_DIST = doc_pdf.cpp MLB_Interface.cpp \
-	Profile_Cross_Sections.cpp Shapes_Report.cpp \
-	Shapes_Summary.cpp doc_pdf.h MLB_Interface.h \
-	Profile_Cross_Sections.h Shapes_Report.h Shapes_Summary.h
- at HAVE_HARU_TRUE@am_libdocs_pdf_la_OBJECTS = doc_pdf.lo \
- at HAVE_HARU_TRUE@	MLB_Interface.lo Profile_Cross_Sections.lo \
- at HAVE_HARU_TRUE@	Shapes_Report.lo Shapes_Summary.lo
-libdocs_pdf_la_OBJECTS = $(am_libdocs_pdf_la_OBJECTS)
- at HAVE_HARU_TRUE@am_libdocs_pdf_la_rpath = -rpath $(pkglibdir)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libdocs_pdf_la_SOURCES)
-DIST_SOURCES = $(am__libdocs_pdf_la_SOURCES_DIST)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
- at HAVE_HARU_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
- at HAVE_HARU_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core
- at HAVE_HARU_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(DISABLELIBHARU) $(GOMPFLAGS)
- at HAVE_HARU_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version $(HARU_LIB)
- at HAVE_HARU_TRUE@pkglib_LTLIBRARIES = libdocs_pdf.la
- at HAVE_HARU_TRUE@libdocs_pdf_la_SOURCES = \
- at HAVE_HARU_TRUE@doc_pdf.cpp\
- at HAVE_HARU_TRUE@MLB_Interface.cpp\
- at HAVE_HARU_TRUE@Profile_Cross_Sections.cpp\
- at HAVE_HARU_TRUE@Shapes_Report.cpp\
- at HAVE_HARU_TRUE@Shapes_Summary.cpp\
- at HAVE_HARU_TRUE@doc_pdf.h\
- at HAVE_HARU_TRUE@MLB_Interface.h\
- at HAVE_HARU_TRUE@Profile_Cross_Sections.h\
- at HAVE_HARU_TRUE@Shapes_Report.h\
- at HAVE_HARU_TRUE@Shapes_Summary.h
-
- at HAVE_HARU_TRUE@libdocs_pdf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/docs/docs_pdf/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/docs/docs_pdf/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libdocs_pdf.la: $(libdocs_pdf_la_OBJECTS) $(libdocs_pdf_la_DEPENDENCIES) 
-	$(CXXLINK) $(am_libdocs_pdf_la_rpath) $(libdocs_pdf_la_OBJECTS) $(libdocs_pdf_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Profile_Cross_Sections.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Shapes_Report.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Shapes_Summary.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/doc_pdf.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp b/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp
deleted file mode 100644
index d75e496..0000000
--- a/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp
+++ /dev/null
@@ -1,1459 +0,0 @@
-/**********************************************************
- * Version $Id: Profile_Cross_Sections.cpp 1230 2011-11-22 11:12:10Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    CrossSections.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Profile_Cross_Sections.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define OFFSET_X 100
-#define OFFSET_Y 50
-#define TABLE_WIDTH 450
-#define TABLE_LANDSCAPE_WIDTH 680
-#define TABLE_OFFSET_X 70
-#define TABLE_CELLPAD 10
-#define SECTIONS_PER_PAGE 3
-#define CROSS_SECTION_HEIGHT 200
-#define CROSS_SECTION_WIDTH 400
-#define PROFILE_HEIGHT 320
-#define PROFILE_WIDTH 1000
-#define GUITAR_LEYEND_WIDTH 50
-#define GUITAR_LEYEND_HEIGHT 230
-#define GUITAR_WIDTH PROFILE_WIDTH
-#define GUITAR_HEIGHT GUITAR_LEYEND_HEIGHT
-#define SEPARATION 35
-#define VOLUMES_TABLE_COLUMNS 7
-#define VOLUMES_TABLE_COLUMN_WIDTH ((596 - 2 * OFFSET_X) / VOLUMES_TABLE_COLUMNS)
-#define VOLUMES_TABLE_ROW_HEIGHT 20
-#define VOLUMES_TABLE_HEADER_SEPARATION 35
-#define VOLUMES_TABLE_MAX_ROWS 30
-#define SLOPE_RATIO (1. / 3.)
-#define LONG_SEGMENT 5000.
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//Compute the dot product AB ? BC
-double dot(double *A, double *B, double *C){
-    
-    double AB[2],BC[2];
-    AB[0] = B[0]-A[0];
-    AB[1] = B[1]-A[1];
-    BC[0] = C[0]-B[0];
-    BC[1] = C[1]-B[1];
-    double dot = AB[0] * BC[0] + AB[1] * BC[1];
-    
-	return dot;
-}
-
-//---------------------------------------------------------
-//Compute the cross product AB x AC
-double cross(double *A, double *B, double *C){
-    
-    double AB[2],AC[2];
-    AB[0] = B[0]-A[0];
-    AB[1] = B[1]-A[1];
-    AC[0] = C[0]-A[0];
-    AC[1] = C[1]-A[1];
-    double cross = AB[0] * AC[1] - AB[1] * AC[0];
-    
-	return cross;
-}
-
-//---------------------------------------------------------
-//Compute the distance from A to B
-double distance(double *A, double *B){
-    double d1 = A[0] - B[0];
-    double d2 = A[1] - B[1];
-    return sqrt(d1*d1+d2*d2);
-}
-
-//---------------------------------------------------------
-//Compute the distance from AB to C
-double linePointDist(double *A, double *B, double *C){
-    double dist = cross(A,B,C) / distance(A,B);
-
-    return fabs(dist);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SLOPE_TRANSITION 1
-#define DITCH_WIDTH 1
-
-CProfile_Cross_Sections_PDF::CProfile_Cross_Sections_PDF(){}
-
-CProfile_Cross_Sections_PDF::~CProfile_Cross_Sections_PDF(){}
-
-void CProfile_Cross_Sections_PDF::AddCrossSections(TSG_Point ** pCrossSections, 
-									 double *pHeight,
-									 TSG_Point * pRoadSection,
-									 int iSections,
-									 int iCrossSectionPoints,
-									 int iRoadPoints){
-	
-	int i,j;
-	std::vector<TSG_Point> ModifiedRoadSection;
-	std::vector<TSG_Point> ModifiedCrossSection;
-	TSG_Point  *pModifiedRoadSection;
-	TSG_Point  *pModifiedCrossSection;
-	int iCrossSectionPointsB;
-	int iRoadPointsB;
-	
-	Add_Page_Title (_TL("Cross Sections"), PDF_TITLE_01, PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT);
-
-	for (i = 0; i < iSections; i++){
-		m_iOffsetY = OFFSET_Y + (int)(CROSS_SECTION_HEIGHT * 1.1 * (i % SECTIONS_PER_PAGE));
-		if (m_iOffsetY == OFFSET_Y){
-			Add_Page();
-		}//if
-		
-		iCrossSectionPointsB = iCrossSectionPoints;
-		iRoadPointsB = iRoadPoints;
-		AdjustSections(pCrossSections[i], pRoadSection, ModifiedCrossSection, ModifiedRoadSection,
-						pHeight[i], iCrossSectionPointsB, iRoadPointsB);
-
-		pModifiedCrossSection = new TSG_Point [iCrossSectionPointsB];
-		pModifiedRoadSection = new TSG_Point [iRoadPointsB];
-		for (j = 0; j < iCrossSectionPointsB; j++){
-			pModifiedCrossSection[j] = ModifiedCrossSection[j];
-		}//for
-		for (j = 0; j < iRoadPointsB; j++){
-			pModifiedRoadSection[j] = ModifiedRoadSection[j];
-		}//for
-		
-		AddCrossSection(pModifiedCrossSection, pModifiedRoadSection,
-						 iCrossSectionPointsB, iRoadPointsB);
-
-		delete [] pModifiedRoadSection;
-		delete [] pModifiedCrossSection;
-	}//for
-	
-}//method
-
-void CProfile_Cross_Sections_PDF::AddCrossSection(TSG_Point * pCrossSection,
-									 TSG_Point * pRoadSection,
-									 int iCrossSectionPoints,
-									 int iRoadPoints){
-
-	int i;	
-    int iMag;
-	int iNumLines;
-	int iFirstPoint, iLastPoint;
-    double fMinLine = 0;
-	double fMaxY, fMinY;
-	double fMaxX, fMinX;
-	double fStep;
-    double fX, fY;
-	double fOffsetX;
-	double fDifX, fDifY;
-	double fRatio;
-	double fHeight;
-	CSG_String sValue;
-	CSG_Points Points;
-
-	iFirstPoint = 0;
-	iLastPoint = iCrossSectionPoints - 1;
-
-	for (i = 1; i < iCrossSectionPoints; i++) {
-		if (pCrossSection[i].x > pRoadSection[0].x){
-			iFirstPoint = i - 1;
-			break;
-		}//if
-	}//for
-	for (i = 1; i < iCrossSectionPoints; i++) {
-		if (pCrossSection[i].x > pRoadSection[iRoadPoints - 1].x){
-			iLastPoint = i;
-			break;
-		}//if
-	}//for
-    
-	fMinX = pCrossSection[iFirstPoint].x;
-	fMaxX = pCrossSection[iLastPoint].x;
-
-	fDifX = fMaxX - fMinX;
-
-	fMaxY  = pCrossSection[0].y;
-	fMinY  = pCrossSection[0].y;
-		    		    
-	for (i = iFirstPoint ; i < iLastPoint + 1; i++) {
-	    if (pCrossSection[i].y > fMaxY) {
-	        fMaxY = pCrossSection[i].y;
-	    }// if
-	    if (pCrossSection[i].y < fMinY) {
-	        fMinY = pCrossSection[i].y;
-	    }// if
-    }//for    
-	
-	for (i = 0; i < iRoadPoints; i++) {
-	    if (pRoadSection[i].y > fMaxY) {
-	        fMaxY = pRoadSection[i].y;
-	    }// if
-	    if (pRoadSection[i].y < fMinY) {
-	        fMinY = pRoadSection[i].y;
-	    }// if
-    }//for 
-
-	fDifY = fMaxY - fMinY;
-
-	fRatio = (fDifX / fDifY) / (CROSS_SECTION_WIDTH / CROSS_SECTION_HEIGHT);
-	if (fRatio > 1){
-		fMaxY = fMaxY + fDifY / 2. * (fRatio - 1.);
-		fMinY = fMinY - fDifY / 2. * (fRatio - 1.);
-
-	}//if
-	else{
-		fMaxX = fMaxX + fDifX / 2. * (1. / fRatio - 1.);
-		fMinX = fMinX - fDifX / 2. * (1. / fRatio - 1.);
-	}//else
-
-	fMaxX = fMaxX + fDifX * .05;
-	fMinX = fMinX - fDifX * .05;
-	fMaxY = fMaxY + fDifY * .05;
-	fMinY = fMinY - fDifY * .05;
-
-	iMag = (int) (log(fMaxY - fMinY) / log(10.0));
-	fStep = (double) ((int) pow(10.0, (double) iMag));                
-	if (fStep == 0){
-		fStep = 1.;
-	}//if
-	if (fMinY < 0) {        	
-		iMag = (int) (log(fabs(fMinY)) / log(10.0));
-		fMinLine = -(int) pow(10.0, (double) iMag);
-	}// if
-	else {
-		fMinLine=(int)(((int)(fMinY/fStep)) *fStep);
-	}//else
-
-	iNumLines = (int) ((fMaxY - fMinY) / fStep);
-
-	while (iNumLines < 8) {
-		fStep = fStep / 2.0;
-		iNumLines = (int) ((fMaxY - fMinY) / fStep);
-	}// while
-	iNumLines = (int) ((fMaxY - fMinLine) / fStep);
-
-	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
-
-	//horizontal lines
-
-	for (i = 0; i < iNumLines; i++) {
-        fY = m_iOffsetY + CROSS_SECTION_HEIGHT
-                - ((fMinLine + fStep * i - fMinY) / (fMaxY - fMinY)) * CROSS_SECTION_HEIGHT;		
-        if (fY <= m_iOffsetY + CROSS_SECTION_HEIGHT && fY >= m_iOffsetY) {
-			fY = fHeight - fY;
-			sValue = SG_Get_String(fMinLine + fStep * (double) i);			
-			Draw_Text(OFFSET_X - 10, fY, SG_Get_String(fMinLine + fStep * (double) i).c_str(),
-					9, PDF_STYLE_TEXT_ALIGN_H_RIGHT);
-			Draw_Line(OFFSET_X, fY, OFFSET_X - 5, fY, 0);
-        }// if
-    }// for	
-
-	iMag = (int) (log(fMaxX - fMinX) / log(10.0));
-	fStep = (double) pow(10.0, (double) iMag);                
-
-	iNumLines = (int) ((fMaxX-fMinX) / fStep);
-	
-	while (iNumLines < 3) {
-		fStep = fStep / 2.0;
-		iNumLines = (int) ((fMaxX-fMinX) / fStep);
-	}// while    
-	fMinLine = (int)(((int)(fMinX/fStep)) * fStep);          
-	while (fMinLine<fMinX){
-		fMinLine+=fStep;
-	}//while
-	fOffsetX = fMinX-fMinLine;
-
-	//vertical lines
-
-	for (i = 0; i < iNumLines; i++) {
-		fX = OFFSET_X + ((fStep * (double) i-fOffsetX) / (fMaxX-fMinX)) * CROSS_SECTION_WIDTH;
-		if (fX >= OFFSET_X && fX < OFFSET_X + CROSS_SECTION_WIDTH){
-			if (fabs(fStep * (double)i+fMinLine) > 100000) {
-				sValue = SG_Get_String(fStep * (double)i+fMinLine);
-			}// if 
-			else {
-				sValue = SG_Get_String(fStep * (double)i+fMinLine, 2, true);
-			}// else
-			Draw_Line (fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT,
-						fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT - 10);
-			Draw_Text(fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT - 15, 
-					SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9, 
-					PDF_STYLE_TEXT_ALIGN_H_CENTER | PDF_STYLE_TEXT_ALIGN_V_TOP );
-		}//if
-	}// for
-	
-	//axis
-	
-	Draw_Line (OFFSET_X, fHeight - m_iOffsetY, 
-				OFFSET_X, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 2);
-	Draw_Line (OFFSET_X, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 
-				OFFSET_X + CROSS_SECTION_WIDTH, 
-				fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 2);
-
-	//cross sections
-	
-	fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
-			- CROSS_SECTION_HEIGHT * ((pCrossSection[iFirstPoint].y - fMinY) / (fMaxY - fMinY));
-	fY = fHeight - fY;
-	fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pCrossSection[iFirstPoint].x - fMinX) / (fMaxX - fMinX));
-
-	Points.Add(fX,fY);
-	
-	for (i = iFirstPoint + 1; i < iLastPoint + 1; i++) {
-		fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
-			- CROSS_SECTION_HEIGHT * ((pCrossSection[i].y - fMinY) / (fMaxY - fMinY));
-		fY = fHeight - fY;
-		fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pCrossSection[i].x - fMinX) / (fMaxX - fMinX));
-		Points.Add(fX,fY);
-		if (pCrossSection[i].x > fMaxX){
-			break;
-		}//if
-	}// for
-	Draw_Line(Points, 2, 0x00bb00);
-
-	fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
-			- CROSS_SECTION_HEIGHT * ((pRoadSection[0].y - fMinY) / (fMaxY - fMinY));
-	fY = fHeight - fY;
-	fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pRoadSection[0].x - fMinX) / (fMaxX - fMinX));
-
-	Points.Clear();
-	Points.Add(fX,fY);	        
-	
-	for (i = 1; i < iRoadPoints; i++) {
-		fY = m_iOffsetY + CROSS_SECTION_HEIGHT 
-			- CROSS_SECTION_HEIGHT * ((pRoadSection[i].y - fMinY) / (fMaxY - fMinY));
-		fY = fHeight - fY;
-		fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pRoadSection[i].x - fMinX) / (fMaxX - fMinX));
-		Points.Add(fX,fY);	
-	}// for
-	Draw_Line(Points, 0, 0x0000bb);
-
-
-}//method
-
-void CProfile_Cross_Sections_PDF::AddVolumesTable(TSG_Point * pProfile,
-									TSG_Point ** pCrossSections, 
-									 double *pHeight,
-									 TSG_Point * pRoadSection,
-									 int iSections,
-									 int iCrossSectionPoints,
-									 int iRoadPoints){
-
-
-	int i,j;
-	int iRow;
-	int iRowsWritten = 0;
-	double fDist;
-	double fX,fY;
-	double fXBox, fYBox;
-	double fIn, fOut;
-	double fInPrev, fOutPrev;
-	double fVolume;
-	double fHeight;
-	CSG_String sHeader[] = {_TL("Section"),_TL("Dist."),_TL("Area +"),_TL("Area -"),_TL("Partial D."),_TL("Vol. +"), _TL("Vol. -")};
-			
-	Add_Page_Title(_TL("Volumes"), PDF_TITLE_01);
-
-	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
-	
-	for (i = 0; i < iSections; i++){
-		iRow = iRowsWritten % VOLUMES_TABLE_MAX_ROWS;
-		if (iRow == 0){
-			Add_Page();
-			Draw_Rectangle(OFFSET_X, fHeight - OFFSET_Y,
-							OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * VOLUMES_TABLE_COLUMNS,
-							fHeight - OFFSET_Y - VOLUMES_TABLE_ROW_HEIGHT);			
-			fY = OFFSET_Y + VOLUMES_TABLE_ROW_HEIGHT * .6;
-			fY = fHeight - fY;
-			for (j = 0; j < VOLUMES_TABLE_COLUMNS; j++){
-				fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j + VOLUMES_TABLE_COLUMN_WIDTH / 2.;				
-				Draw_Text(fX, fY, sHeader[j].c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-
-				fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * (j + 1);
-				Draw_Line(fX, fHeight - OFFSET_Y, 
-							fX, fHeight - (OFFSET_Y + VOLUMES_TABLE_ROW_HEIGHT),
-							0);
-			}//for
-			if (i){
-				i--;
-			}//if
-		}//if
-		for (j = 0; j < 4; j++){
-			fYBox = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * iRow;
-			fYBox = fHeight - fYBox;
-			fXBox = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j;			
-			Draw_Rectangle(fXBox, fYBox, fXBox + VOLUMES_TABLE_COLUMN_WIDTH, 
-							fYBox - VOLUMES_TABLE_ROW_HEIGHT);			
-		}//for
-		fDist = pProfile[i].x;		
-		fY = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow + .6);
-		fY = fHeight - fY;
-		fX = OFFSET_X + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-		Draw_Text(fX, fY, SG_Get_String(i,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-
-		fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-		Draw_Text(fX, fY, SG_Get_String(fDist,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-
-		CalculateAreas(pCrossSections[i], pRoadSection, pHeight[i], iCrossSectionPoints, 
-						iRoadPoints,fIn, fOut);
-
-		fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 2 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-		Draw_Text(fX, fY, SG_Get_String(fIn,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-
-		fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 3 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-		Draw_Text(fX, fY, SG_Get_String(fOut,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-
-		if (iRow > 0){
-			for (j = 4; j < 7; j++){
-				fYBox = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow - .5);
-				fYBox = fHeight - fYBox;
-				fXBox = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j;			
-				Draw_Rectangle(fXBox, fYBox, fXBox + VOLUMES_TABLE_COLUMN_WIDTH, 
-								fYBox - VOLUMES_TABLE_ROW_HEIGHT);				
-			}//for
-			fY = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow + .1) ;
-			fY = fHeight - fY;
-
-			fDist = (pProfile[i].x - pProfile[i-1].x);
-			fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 4 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-			Draw_Text(fX, fY, SG_Get_String(fDist,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-
-			fVolume = (pProfile[i].x - pProfile[i-1].x) * (fIn + fInPrev) / 2.;
-			fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 5 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-			Draw_Text(fX, fY, SG_Get_String(fVolume,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-			
-			fVolume = (pProfile[i].x - pProfile[i-1].x) * (fOut + fOutPrev) / 2.;
-			fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 6 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.;
-			Draw_Text(fX, fY, SG_Get_String(fVolume,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER);
-		}//if
-
-		fInPrev = fIn;
-		fOutPrev = fOut;
-		iRowsWritten++;
-
-	}//for
-
-}//Method
-
-void CProfile_Cross_Sections_PDF::AdjustSections(TSG_Point * pCrossSection,
-									TSG_Point * pRoadSection,
-									std::vector<TSG_Point > &ModifiedCrossSection,
-									std::vector<TSG_Point > &ModifiedRoadSection,
-									double fHeight,
-									int &iCrossSectionPoints, 
-									int &iRoadPoints){
-
-	bool bDitchAdded;
-	int i,j;
-	int iSgn;
-	int iRoadPointsToAdd = 0;
-	int iCrossSectionPointsToAdd = 0;
-	double fX, fY;
-	TSG_Point  P;
-
-	ModifiedCrossSection.clear();
-	ModifiedRoadSection.clear();
-
-	//left half
-
-	for (i = 0 ; i < iCrossSectionPoints - 1; i++){
-		if (pCrossSection[i].x < pRoadSection[0].x && 
-				pCrossSection[i+1].x >= pRoadSection[0].x){
-			break;
-		}//if
-	}//for
-
-	if (i == iCrossSectionPoints - 1){
-		if (pRoadSection[0].y  + fHeight < pCrossSection[0].y){
-			P.x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH 
-				- fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO;
-			P.y = pCrossSection[0].y - fHeight;
-			ModifiedRoadSection.push_back(P);
-			P.y = pCrossSection[0].y;
-			ModifiedCrossSection.push_back(P);
-			iCrossSectionPointsToAdd++;
-			iRoadPointsToAdd++;			
-			
-			P.x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;
-			P.y = pRoadSection[0].y;
-			ModifiedRoadSection.push_back(P);
-			iRoadPointsToAdd++;
-
-			P.x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;	
-			P.y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION;
-			ModifiedRoadSection.push_back(P);
-			iRoadPointsToAdd++;
-
-			P.x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION;
-			ModifiedRoadSection.push_back(P);
-			iRoadPointsToAdd++;
-		}//if		
-		P.x = pRoadSection[0].x - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO;
-		P.y = pCrossSection[0].y - fHeight;
-		ModifiedRoadSection.push_back(P);
-		P.y = pCrossSection[0].y;
-		ModifiedCrossSection.push_back(P);
-		iCrossSectionPointsToAdd++;
-		iRoadPointsToAdd++;
-	}//if
-	else{
-		bDitchAdded = false;
-		for (j = 0; j < 4; j++){ //4 dummy points
-			ModifiedRoadSection.push_back(pRoadSection[0]);
-		}//for	
-		for (j = i ; j >= 0; j--){
-			if (ModifiedRoadSection[1].y  + fHeight > pCrossSection[j+1].y){
-				iSgn = -1;
-			}//if
-			else{
-				iSgn = 1;
-			}//else
-			Intersect_Lines(ModifiedRoadSection[1].x, ModifiedRoadSection[1].y + fHeight, 
-							ModifiedRoadSection[1].x - LONG_SEGMENT / SLOPE_RATIO,
-							ModifiedRoadSection[1].y + LONG_SEGMENT * iSgn + fHeight,
-							pCrossSection[j].x, pCrossSection[j].y,
-							pCrossSection[j+1].x, pCrossSection[j+1].y,
-							fX,fY);
-			if (pCrossSection[j].x < fX && pCrossSection[j+1].x >= fX){
-				if (iSgn == 1){
-					if(!bDitchAdded){
-						ModifiedRoadSection[1].x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;
-						ModifiedRoadSection[1].y = pRoadSection[0].y;						
-						iRoadPointsToAdd++;
-
-						ModifiedRoadSection[2].x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH;	
-						ModifiedRoadSection[2].y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION;						
-						iRoadPointsToAdd++;
-
-						ModifiedRoadSection[3].x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION;
-						ModifiedRoadSection[3].y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION;						
-						iRoadPointsToAdd++;
-						
-						j = i + 1;
-						bDitchAdded = true;
-					}//if
-					else{
-						ModifiedRoadSection[0].x = fX;
-						ModifiedRoadSection[0].y = fY - fHeight;
-						iRoadPointsToAdd++;
-						break;
-					}//else
-				}//if
-				else{
-					ModifiedRoadSection[0].x = fX;
-					ModifiedRoadSection[0].y = fY - fHeight;
-					iRoadPointsToAdd++;
-					break;
-				}//else
-			}//if
-		}//for
-		if (j < 0){
-			ModifiedRoadSection[0].x = pRoadSection[0].x - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO;
-			ModifiedRoadSection[0].y = pCrossSection[0].y - fHeight;
-			P.x = ModifiedRoadSection[0].x;
-			P.y = pCrossSection[0].y;
-			ModifiedCrossSection.push_back(P);
-			iCrossSectionPointsToAdd++;
-			iRoadPointsToAdd++;
-		}//if*/
-	}//else
-
-	//add the central points
-
-	for (i = 0; i < iCrossSectionPoints; i++){
-		ModifiedCrossSection.push_back(pCrossSection[i]);
-	}//for
-	
-	ModifiedRoadSection.resize(iRoadPoints + iRoadPointsToAdd);
-	for (i = 0; i < iRoadPoints; i++){
-		ModifiedRoadSection[i + iRoadPointsToAdd].x = pRoadSection[i].x;
-		ModifiedRoadSection[i + iRoadPointsToAdd].y = pRoadSection[i].y;
-	}//for	
-	for (i = 0; i < iRoadPoints + iRoadPointsToAdd; i++){
-		ModifiedRoadSection[i].x = ModifiedRoadSection[i].x;
-		ModifiedRoadSection[i].y = ModifiedRoadSection[i].y + fHeight;
-	}//for
-
-	iRoadPoints += iRoadPointsToAdd;
-	iCrossSectionPoints += iCrossSectionPointsToAdd;
-
-	// right half
-
-	for (i = 0 ; i < iCrossSectionPoints - 1; i++){
-		if (ModifiedCrossSection[i].x < ModifiedRoadSection[iRoadPoints-1].x && 
-				ModifiedCrossSection[i+1].x >= ModifiedRoadSection[iRoadPoints-1].x){
-			break;
-		}//if
-	}//for
-	if (i == iCrossSectionPoints - 1){
-		if (ModifiedRoadSection[iRoadPoints-1].y  + fHeight < ModifiedCrossSection[iCrossSectionPoints-1].y){
-			P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION;
-			P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION;
-			ModifiedRoadSection.push_back(P);
-			iRoadPoints++;
-
-			P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;	
-			ModifiedRoadSection.push_back(P);
-			iRoadPoints++;
-
-			P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;
-			P.y = ModifiedRoadSection[iRoadPoints-3].y;
-			ModifiedRoadSection.push_back(P);
-			iRoadPoints++;
-		}//if		
-		P.x = ModifiedRoadSection[iRoadPoints-1].x 
-				+ fabs(ModifiedCrossSection[iCrossSectionPoints-1].y 
-				- ModifiedRoadSection[iRoadPoints-1].y) / SLOPE_RATIO;
-		P.y = ModifiedCrossSection[iCrossSectionPoints-1].y ;
-		ModifiedRoadSection.push_back(P);
-		ModifiedCrossSection.push_back(P);
-		iCrossSectionPoints++;
-		iRoadPoints++;
-	}//if
-	else{
-		bDitchAdded = false;
-		for (j = i ; j < iCrossSectionPoints - 1; j++){
-			if (ModifiedRoadSection[iRoadPoints-1].y > ModifiedCrossSection[j].y){
-				iSgn = -1;
-			}//if
-			else{
-				iSgn = 1;
-			}//else
-			if (iSgn == 1 && !bDitchAdded){
-				P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION;
-				P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION;
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-
-				P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;	
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-
-				P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;
-				P.y = ModifiedRoadSection[iRoadPoints-3].y;
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-				
-				if (ModifiedRoadSection[iRoadPoints-1].y > ModifiedCrossSection[j].y){
-					iSgn = -1;
-				}//if
-				else{
-					iSgn = 1;
-				}//else
-
-				bDitchAdded = true;
-
-			}//if
-
-			Intersect_Lines(ModifiedRoadSection[iRoadPoints-1].x, ModifiedRoadSection[iRoadPoints-1].y, 
-							ModifiedRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
-							ModifiedRoadSection[iRoadPoints-1].y + LONG_SEGMENT * iSgn,
-							ModifiedCrossSection[j].x, ModifiedCrossSection[j].y,
-							ModifiedCrossSection[j+1].x, ModifiedCrossSection[j+1].y,
-							fX,fY);
-
-			if (ModifiedCrossSection[j].x < fX && ModifiedCrossSection[j+1].x >= fX){
-				P.x = fX;
-				P.y = fY;
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-				break;
-			}//if
-		}//for
-		if (j == iCrossSectionPoints - 1){
-			if (ModifiedRoadSection[iRoadPoints-1].y  + fHeight < ModifiedCrossSection[iCrossSectionPoints-1].y
-					&& !bDitchAdded){
-				
-				P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION;
-				P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION;
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-
-				P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;	
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-
-				P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH;
-				P.y = ModifiedRoadSection[iRoadPoints-3].y;
-				ModifiedRoadSection.push_back(P);
-				iRoadPoints++;
-
-			}//if		
-			P.x = ModifiedRoadSection[iRoadPoints-1].x 
-					+ fabs(ModifiedCrossSection[iCrossSectionPoints-1].y 
-					- ModifiedRoadSection[iRoadPoints-1].y) / SLOPE_RATIO;
-			P.y = ModifiedCrossSection[iCrossSectionPoints-1].y ;
-			ModifiedRoadSection.push_back(P);
-			ModifiedCrossSection.push_back(P);
-			iCrossSectionPoints++;
-			iRoadPoints++;
-
-		}//if*/
-	}//else
-
-}//method
-
-void CProfile_Cross_Sections_PDF::Intersect_Lines(double x0,double y0,double x1,double y1,
-									double x2,double y2,double x3,double y3,
-									double &xi,double &yi){
-
-	double a1,b1,c1, 
-		  a2,b2,c2,
-		  det_inv,  
-		  m1,m2;    
-
-	if ((x1-x0)!=0)
-	   m1 = (y1-y0)/(x1-x0);
-	else
-	   m1 = (double)1e+10;   
-
-	if ((x3-x2)!=0)
-	   m2 = (y3-y2)/(x3-x2);
-	else
-	   m2 = (double)1e+10;   
-
-	a1 = m1;
-	a2 = m2;
-
-	b1 = -1;
-	b2 = -1;
-
-	c1 = (y0-m1*x0);
-	c2 = (y2-m2*x2);
-
-	det_inv = 1/(a1*b2 - a2*b1);
-
-	xi=((b1*c2 - b2*c1)*det_inv);
-	yi=((a2*c1 - a1*c2)*det_inv);
-
-} //method
-
-void CProfile_Cross_Sections_PDF::CalculateAreas(TSG_Point * pCrossSection,
-									TSG_Point * pRoadSection,
-									double fHeight,
-									int iCrossSectionPoints, 
-									int iRoadPoints,
-									double &fPositiveArea,
-									double &fNegativeArea){
-
-	int i;
-	CSG_Shapes *pRoadShapes, *pCrossSectionShapes, *pResultShapes;
-	CSG_Shape *pRoadShape, *pCrossSectionShape, *pResultShape;
-
-	pResultShapes = new CSG_Shapes;
-	pResultShapes->Create(SHAPE_TYPE_Polygon);
-	pResultShape = pResultShapes->Add_Shape();
-	pRoadShapes = new CSG_Shapes;
-	pRoadShapes->Create(SHAPE_TYPE_Polygon);
-	pRoadShape = pRoadShapes->Add_Shape();
-	pCrossSectionShapes = new CSG_Shapes;
-	pCrossSectionShapes->Create(SHAPE_TYPE_Polygon);
-	pCrossSectionShape = pCrossSectionShapes->Add_Shape();
-	
-	for (i = 0; i < iRoadPoints; i++){
-		pRoadShape->Add_Point(pRoadSection[i].x, pRoadSection[i].y + fHeight);
-	}//for
-	pRoadShape->Add_Point(pRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
-						pRoadSection[iRoadPoints-1].y + fHeight + LONG_SEGMENT);
-	
-	pRoadShape->Add_Point(pRoadSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
-						pRoadSection[0].y + fHeight + LONG_SEGMENT);
-						
-	for (i = 0; i < iCrossSectionPoints; i++){
-		pCrossSectionShape->Add_Point(pCrossSection[i].x, pCrossSection[i].y);
-	}//for
-	pCrossSectionShape->Add_Point(pCrossSection[iCrossSectionPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
-						pCrossSection[iCrossSectionPoints-1].y - LONG_SEGMENT);
-	
-	pCrossSectionShape->Add_Point(pCrossSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
-						pCrossSection[0].y - LONG_SEGMENT);		
-
-	if (SG_Polygon_Intersection(pCrossSectionShape, pRoadShape, pResultShape)){
-		fNegativeArea = ((CSG_Shape_Polygon*)pResultShape)->Get_Area();
-	}//if
-	else{
-		fNegativeArea = 0;
-	}//else
-
-	pCrossSectionShape->Del_Parts();
-	pRoadShape->Del_Parts();
-	pResultShape->Del_Parts();
-	
-	for (i = 0; i < iRoadPoints; i++){
-		pRoadShape->Add_Point(pRoadSection[i].x, pRoadSection[i].y + fHeight);
-	}//for
-	pRoadShape->Add_Point(pRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
-						pRoadSection[iRoadPoints-1].y + fHeight - LONG_SEGMENT);
-	
-	pRoadShape->Add_Point(pRoadSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
-						pRoadSection[0].y + fHeight - LONG_SEGMENT);
-						
-	for (i = 0; i < iCrossSectionPoints; i++){
-		pCrossSectionShape->Add_Point(pCrossSection[i].x, pCrossSection[i].y);
-	}//for
-	pCrossSectionShape->Add_Point(pCrossSection[iCrossSectionPoints-1].x + LONG_SEGMENT / SLOPE_RATIO,
-						pCrossSection[iCrossSectionPoints-1].y + LONG_SEGMENT);
-	
-	pCrossSectionShape->Add_Point(pCrossSection[0].x - LONG_SEGMENT / SLOPE_RATIO,
-						pCrossSection[0].y + LONG_SEGMENT);		
-	
-	if (SG_Polygon_Intersection(pCrossSectionShape, pRoadShape, pResultShape)){
-		fPositiveArea = ((CSG_Shape_Polygon*)pResultShape)->Get_Area();
-	}//if
-	else{
-		fPositiveArea = 0;
-	}//else
-
-	delete pRoadShapes;
-	delete pCrossSectionShapes;
-	delete pResultShapes;
-				
-}//method
-
-void CProfile_Cross_Sections_PDF::AddLongitudinalProfile(TSG_Point * pProfile,
-											double *pHeight,
-											int iNumPoints){
-
-	int i;	
-    int iMag;
-	int iNumLines;
-    double fMinLine = 0;
-	double fMaxY, fMinY;
-	double fMaxX, fMinX;
-	double fStep;
-    double fX, fY;
-	double fOffsetX;
-	CSG_String sValue;
-	CSG_Points Points;
-	double fHeight;
-	
-	Add_Page_Title(_TL("Longitudinal Profile"), PDF_TITLE_01);
-	
-	Add_Page(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE);
-
-	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
-
-	m_iOffsetY = 50;
-
-	fMaxY  = pProfile[0].y;
-	fMinY  = pProfile[0].y;
-		    		    
-	for (i = 0; i < iNumPoints; i++) {
-	    if (pProfile[i].y > fMaxY) {
-	        fMaxY = pProfile[i].y;
-	    }// if
-	    if (pProfile[i].y < fMinY) {
-	        fMinY = pProfile[i].y;
-	    }// if
-		if (pHeight[i] > fMaxY) {
-	        fMaxY = pHeight[i];
-	    }// if
-	    if (pHeight[i] < fMinY) {
-	        fMinY = pHeight[i];
-	    }// if
-    }//for    
-	
-	iMag = (int) (log(fMaxY - fMinY) / log(10.0));
-	fStep = (double) ((int) pow(10.0, (double) iMag));                
-	if (fStep == 0){
-		fStep = 1.;
-	}//if
-	if (fMinY < 0) {        	
-		iMag = (int) (log(fabs(fMinY)) / log(10.0));
-		fMinLine = -(int) pow(10.0, (double) iMag);
-	}// if
-	else {
-		fMinLine=(int)(((int)(fMinY/fStep)) *fStep);
-	}//else
-
-	iNumLines = (int) ((fMaxY - fMinY) / fStep);
-
-	while (iNumLines < 8) {
-		fStep = fStep / 2.0;
-		iNumLines = (int) ((fMaxY - fMinY) / fStep);
-	}// while
-	iNumLines = (int) ((fMaxY - fMinLine) / fStep);
-
-	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
-
-	for (i = 0; i < iNumLines; i++) {
-        fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION;
-		fY = m_iOffsetY + PROFILE_HEIGHT
-                - ((fMinLine + fStep * i - fMinY) / (fMaxY - fMinY)) * PROFILE_HEIGHT;		
-        if (fY <= m_iOffsetY + PROFILE_HEIGHT && fY >= m_iOffsetY) {
-			fY = fHeight - fY;
-			sValue = SG_Get_String(fMinLine + fStep * (double) i);
-			Draw_Text(fX - 10, fY, SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9,
-				PDF_STYLE_TEXT_ALIGN_H_RIGHT);
-			Draw_Line(fX, fY, fX - 5, fY, 0);
-        }// if
-    }// for	
-
-	fMinX = pProfile[0].x;
-	fMaxX = pProfile[iNumPoints - 1].x;
-
-	iMag = (int) (log(fMaxX - fMinX) / log(10.0));
-	fStep = (double) pow(10.0, (double) iMag);                
-
-	iNumLines = (int) ((fMaxX-fMinX) / fStep);
-	
-	while (iNumLines < 3) {
-		fStep = fStep / 2.0;
-		iNumLines = (int) ((fMaxX-fMinX) / fStep);
-	}// while    
-	fMinLine = (int)(((int)(fMinX/fStep)) * fStep);          
-	while (fMinLine<fMinX){
-		fMinLine+=fStep;
-	}//while
-	fOffsetX = fMinX-fMinLine;
-
-	for (i = 0; i < iNumLines; i++) {
-		fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-				+ ((fStep * (double) i-fOffsetX) / (fMaxX-fMinX)) * PROFILE_WIDTH;
-		if (fX>=OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-				&& fX < OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH){
-			if (fabs(fStep * (double)i+fMinLine) > 100000) {
-				sValue = SG_Get_String(fStep * (double)i+fMinLine);
-			}// if 
-			else {
-				sValue = SG_Get_String(fStep * (double)i+fMinLine, 2, true);
-			}// else
-			Draw_Text(fX, fHeight - m_iOffsetY - PROFILE_HEIGHT - 15,
-				SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9,
-				PDF_STYLE_TEXT_ALIGN_H_CENTER | PDF_STYLE_TEXT_ALIGN_V_TOP);
-			Draw_Line(fX, fHeight - m_iOffsetY - PROFILE_HEIGHT,
-					fX, fHeight - m_iOffsetY - PROFILE_HEIGHT - 10, 0);
-		}//if
-	}// for
-	
-	Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, 	fHeight - m_iOffsetY,
-			OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, 
-			fHeight - m_iOffsetY - PROFILE_HEIGHT, 2);
-	Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, 
-				fHeight - m_iOffsetY - PROFILE_HEIGHT,
-				OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH, 
-				fHeight - m_iOffsetY - PROFILE_HEIGHT, 2);
-		
-	fY = m_iOffsetY + PROFILE_HEIGHT 
-			- PROFILE_HEIGHT * ((pProfile[0].y - fMinY) / (fMaxY - fMinY));
-	fY = fHeight - fY;
-	fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-		+ PROFILE_WIDTH * ((pProfile[0].x - fMinX) / (fMaxX - fMinX));
-	Points.Add(fX, fY);	        
-	for (i = 1; i < iNumPoints; i++) {
-		fY = m_iOffsetY + PROFILE_HEIGHT 
-			- PROFILE_HEIGHT * ((pProfile[i].y - fMinY) / (fMaxY - fMinY));
-		fY = fHeight - fY;
-		fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-			+ PROFILE_WIDTH * ((pProfile[i].x - fMinX) / (fMaxX - fMinX));
-		Points.Add(fX, fY);
-	}// for
-	Draw_Line(Points, 2, 0x00bb00);
-
-	Points.Clear();
-	
-	fY = m_iOffsetY + PROFILE_HEIGHT 
-			- PROFILE_HEIGHT * ((pHeight[0] - fMinY) / (fMaxY - fMinY));
-	fY = fHeight - fY;
-	fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-		+ PROFILE_WIDTH * ((pProfile[0].x - fMinX) / (fMaxX - fMinX));
-	Points.Add(fX,fY);
-	for (i = 1; i < iNumPoints; i++) {
-		fY = m_iOffsetY + PROFILE_HEIGHT 
-			- PROFILE_HEIGHT * ((pHeight[i] - fMinY) / (fMaxY - fMinY));
-		fY = fHeight - fY;
-		fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-			+ PROFILE_WIDTH * ((pProfile[i].x - fMinX) / (fMaxX - fMinX));
-		Points.Add(fX, fY);
-	}// for
-	Draw_Line(Points, 2, 0x0000bb);
-
-	DrawGuitar(pProfile, pHeight, iNumPoints);
-
-}//method
-
-void CProfile_Cross_Sections_PDF::DrawGuitar(TSG_Point *pProfile, 
-							   double *pHeight, 
-							   int iNumPoints){
-
-	int i;
-	double fY;
-	double fMinX, fMaxX;
-	double fDif;
-	CSG_String sValue;
-	CSG_String sField [] = {"Distancia","Dist. Parcial.", "Elevacion del terreno", "Elevaci�n de la calzada", " ", " "};
-	double fHeight;
-
-	fMinX = pProfile[0].x;
-	fMaxX = pProfile[iNumPoints - 1].x;
-
-	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
-	
-	for (i = 0; i < 7; i++){
-		fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * i;
-		fY = fHeight - fY;
-		Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, fY,
-				OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + GUITAR_WIDTH, fY, 0, 0x880000);
-		if (i){
-			Draw_Text(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION - 10, 
-						fY + GUITAR_LEYEND_HEIGHT / 13, 
-						sField[i-1].c_str(),
-						9,
-						PDF_STYLE_TEXT_ALIGN_V_CENTER | PDF_STYLE_TEXT_ALIGN_H_RIGHT);
-		
-		}//if
-	}//for
-	
-	AddGuitarValue(0, 0, fMinX, fMaxX, 1);
-	for (i = 0; i < iNumPoints; i++) {
-		AddGuitarValue(pProfile[i].x, pProfile[i].x / 1000, fMinX, fMaxX, 0);
-		if (i){
-			AddGuitarValue(pProfile[i].x, pProfile[i].x / 1000 - pProfile[i-1].x / 1000, 
-							fMinX, fMaxX, 1);
-		}//if
-		fDif = pProfile[i].y - pHeight[i];
-		AddGuitarValue(pProfile[i].x, pProfile[i].y, fMinX, fMaxX, 2);
-		AddGuitarValue(pProfile[i].x, pHeight[i], fMinX, fMaxX, 3);
-		if (fDif > 0){
-			AddGuitarValue(pProfile[i].x, fDif, fMinX, fMaxX, 4);
-		}//if
-		else{
-			AddGuitarValue(pProfile[i].x, fDif, fMinX, fMaxX, 5);
-		}//else
-
-
-	}// for
-
-}//method
-
-void CProfile_Cross_Sections_PDF::AddGuitarValue(double fXValue,
-								   double fValue,
-								   double fMinX,
-								   double fMaxX,								   
-								   int iLine){
-
-	double fX,fY;
-	double fHeight;
-	
-	fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin();
-	
-	fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION 
-		+ PROFILE_WIDTH * ((fXValue - fMinX) / (fMaxX - fMinX));
-	fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * (iLine + 1);
-	fY = fHeight - fY;
-
-	Draw_Line(fX, fY, fX, fY + 3, 0, 0x880000);
-
-	fY += 3;
-	fX += 3;
-	
-	Draw_Text(fX, fY, SG_Get_String(fValue, 2).c_str(), 8, 
-			0, 
-			3.14159/2.);
-		
-	fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * iLine;
-	fY = fHeight - fY;
-	fX -= 3;
-
-	Draw_Line(fX, fY, fX, fY - 3, 0, 0x880000);
-
-}//method
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CProfile_Cross_Sections::CProfile_Cross_Sections(void){
-
-	CSG_Parameter *pNode;
-
-	Parameters.Set_Name(_TL("Terrain Path Cross Sections"));
-	Parameters.Set_Description(_TW("(c) 2004 Victor Olaya. Cross Sections"));
-
-	Parameters.Add_Grid(NULL,
-						"DEM",
-						_TL("DEM"),
-						_TL("Digital Terrain Model"),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Shapes(NULL,
-						"LINES",
-						_TL("Path"),
-						_TL(""),
-						PARAMETER_INPUT, 
-						SHAPE_TYPE_Line);
-
-	Parameters.Add_Shapes(NULL,
-						"SECTIONS",
-						_TL("Cross Sections"),
-						_TL(""),
-						PARAMETER_OUTPUT);
-
-	Parameters.Add_Value(NULL,
-						"NUMPOINTS",
-						_TL("Number of points"),
-						_TL("Number of points on each side of the section"),
-						PARAMETER_TYPE_Int,
-						10,
-						1,
-						true);
-
-	Parameters.Add_Value(NULL,
-						"INTERVAL",
-						_TL("Interval"),
-						_TL("Interval between points (in grid units)."),
-						PARAMETER_TYPE_Double,
-						10);
-
-	Parameters.Add_Value(NULL,
-						"STEP",
-						_TL("n"),
-						_TL("Draw a section each n points"),
-						PARAMETER_TYPE_Int,
-						2);
-
-	pNode = Parameters.Add_Node(NULL,
-						"PDFNODE",
-						_TL("PDF Documents"),
-						_TL(""));
-
-	Parameters.Add_Value(pNode,
-						"PDF",
-						_TL("Create PDF Documents"),
-						_TL(""),
-						PARAMETER_TYPE_Bool,
-						true);	
-
-	Parameters.Add_FilePath(pNode,
-							"OUTPUTPATH",
-							_TL("Folder for PDF Files"),
-							_TL(""),
-							_TL(""),
-							_TL(""),
-							true,
-							true);
-
-	Parameters.Add_Value(pNode,
-						"WIDTH",
-						_TL("Road Width"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						5.);
-
-	Parameters.Add_Value(pNode,
-						"SLOPE",
-						_TL("Side Slope"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						.5);
-
-	Parameters.Add_Value(pNode,
-						"THRESHOLD",
-						_TL("Height Threshold"),
-						_TL("Height threshold for optimal profile calculation"),
-						PARAMETER_TYPE_Double,
-						.5);
-}//constructor
-
-
-CProfile_Cross_Sections::~CProfile_Cross_Sections(void){}
-
-bool CProfile_Cross_Sections::On_Execute(void){
-
-	CSG_Shapes *pLines;
-	CSG_Shape *pShape, *pSection;
-	CSG_Grid *pDEM;
-	TSG_Point	Point, Point2;
-	double fInterval;
-	double fStepX, fStepY;
-	int iNumPoints;
-	int i,j,k;
-	int iPoint;
-	int iField = 0;
-	int iStep;
-	double dX, dY;
-	double dX2, dY2;
-	double dDistance;
-	double dHeight;
-	bool bCopy;
-
-	m_pSections = Parameters("SECTIONS")->asShapes();
-	pLines = Parameters("LINES")->asShapes();
-	pDEM = Parameters("DEM")->asGrid();
-	fInterval = (double) Parameters("INTERVAL")->asDouble();
-	iNumPoints = Parameters("NUMPOINTS")->asInt();
-	iStep = Parameters("STEP")->asInt();
-
-	if(pLines == m_pSections){
-		bCopy = true;
-		m_pSections	= SG_Create_Shapes();
-	}//if
-	else{
-		bCopy = false;
-	}//else
-
-	m_pSections->Create(SHAPE_TYPE_Line, _TL("Cross Sections"));
-	for (i = iNumPoints; i > 0; i--){
-		m_pSections->Add_Field(CSG_String::Format(SG_T("-%s"), SG_Get_String(fInterval * i, 2).c_str()),
-										SG_DATATYPE_Double);
-	}//for
-	m_pSections->Add_Field("0", SG_DATATYPE_Double);
-	for (i = 1; i < iNumPoints +1; i++){
-		m_pSections->Add_Field(SG_Get_String(fInterval * i).c_str(), SG_DATATYPE_Double);
-	}//for
-	for(i=0; i<pLines->Get_Count() && Set_Progress(i, pLines->Get_Count()); i++){
-		pShape = pLines->Get_Shape(i);
-		for(j=0; j<pShape->Get_Part_Count(); j++){
-			for(k=0; k<pShape->Get_Point_Count(j)-1; k+=iStep){
-				Point = pShape->Get_Point(k,j);
-				Point2 = pShape->Get_Point(k+1,j);
-				dDistance = sqrt(pow(Point2.x - Point.x,2) + pow(Point2.y - Point.y,2));
-				dX = (Point.x + Point2.x) / 2.;
-				dY = (Point.y + Point2.y) / 2.;
-				fStepX = (Point2.y - Point.y) / dDistance * fInterval;
-				fStepY = -(Point2.x - Point.x) / dDistance * fInterval;
-				pSection = m_pSections->Add_Shape();
-				pSection->Add_Point(dX + iNumPoints * fStepX,
-								dY + iNumPoints * fStepY);
-				pSection->Add_Point(dX - iNumPoints * fStepX,
-								dY - iNumPoints * fStepY);
-				iField = 0;
-				for (iPoint = iNumPoints; iPoint > 0; iPoint--){
-					dX2 = dX - iPoint * fStepX;
-					dY2 = dY - iPoint * fStepY;
-					dHeight = pDEM->Get_Value(dX2, dY2);
-					pSection->Set_Value(iField, dHeight);
-					iField++;
-				}//for
-				dHeight = pDEM->Get_Value(dX, dY);
-				pSection->Set_Value(iField, dHeight);
-				iField++;
-				for (iPoint = 1; iPoint < iNumPoints +1; iPoint++){
-					dX2 = dX + iPoint * fStepX;
-					dY2 = dY + iPoint * fStepY;
-					dHeight = pDEM->Get_Value(dX2, dY2);
-					pSection->Set_Value(iField, dHeight);
-					iField++;
-				}//for*/
-			}//for
-		}//for
-	}//for
-
-	if (Parameters("PDF")->asBool()){
-		CreatePDFDocs();
-	}//if
-
-	if(bCopy){
-		pLines->Assign(m_pSections);
-		delete(m_pSections);
-	}//if
-
-	return true;
-
-}// method
-
-void CProfile_Cross_Sections::CreatePDFDocs(){
-
-	CSG_String sFilePath;
-			
-	if (Parameters("OUTPUTPATH")->asString()){
-		m_DocEngine.Open(_TL("SECTIONS"));
-		sFilePath = SG_File_Make_Path(Parameters("OUTPUTPATH")->asString(), _TL("Sections"), _TL("pdf"));
-	}//if
-	else{
-		Message_Add(_TL("\n** Error : Invalid parameters **\n"));
-		return;
-	}//else
-
-	AddLongitudinalProfiles();
-	AddCrossSections();
-
-	if (m_DocEngine.Save(sFilePath)){
-		if (!m_DocEngine.Close()){
-			Message_Add(_TL("\n\n ** Error : Could not close PDF engine ** \n\n"));
-		}
-	}//if
-	else{
-		Message_Add(_TL("\n\n ** Error : Could not save PDF file ** \n\n"));
-	}//else
-
-
-}//method
-
-
-void CProfile_Cross_Sections::AddLongitudinalProfiles(){
-
-	int i,j,k;
-	int iIndex = 0;	
-	int iNumPoints = Parameters("NUMPOINTS")->asInt();
-	int iStep = Parameters("STEP")->asInt();
-	int iFirstPoint = 0;
-	int iLastPoint;
-	int iSections;
-	double fX1, fY1, fX2, fY2;
-	double fDistance, fDistanceSum = 0;
-	double fDist;
-	double fThreshold = (double)Parameters("THRESHOLD")->asDouble();
-	bool bValid;
-	CSG_Shape *pShape;
-	CSG_Table *pTable;
-	TSG_Point	Point, Point2;
-	CSG_Shapes* pLines = Parameters("LINES")->asShapes();
-
-	pTable = m_pSections;
-	iSections = pTable->Get_Record_Count();
-
-	m_pProfile = new TSG_Point[iSections];
-
-	for(i=0; i<pLines->Get_Count() && Set_Progress(i, pLines->Get_Count()); i++){
-		pShape = pLines->Get_Shape(i);
-		for(j=0; j<pShape->Get_Part_Count(); j++){
-			Point = pShape->Get_Point(0,j);
-			for(k=0; k<pShape->Get_Point_Count(j)-1; k+=iStep){
-				Point2 = pShape->Get_Point(k,j);
-				fDistance = sqrt(pow(Point2.x - Point.x,2) + pow(Point2.y - Point.y,2));
-				m_pProfile[iIndex].x = fDistanceSum + fDistance / 2.;
-				m_pProfile[iIndex].y = pTable->Get_Record(iIndex)->asFloat(iNumPoints);
-				fDistanceSum += fDistance;
-				iIndex++;
-				Point.x = Point2.x;
-				Point.y = Point2.y;
-			}//for
-		}//for
-	}//for*/
-
-	m_pHeight = new double[iSections];
-
-	for (i = 0; i < iSections; i++){
-		m_pHeight[i] = 1500;
-	}
-	
-	iLastPoint = iSections - 1;
-	while(iFirstPoint != iSections - 1){
-		fX1 = m_pProfile[iFirstPoint].x;
-		fY1 = m_pProfile[iFirstPoint].y;
-		fX2 = m_pProfile[iLastPoint].x;
-		fY2 = m_pProfile[iLastPoint].y;
-		bValid = true;
-		for (i = iFirstPoint; i < iLastPoint; i++){			
-			fDist = CalculatePointLineDist(fX1,fY1,fX2,fY2, m_pProfile[i].x, m_pProfile[i].y);
-			if (fDist > fThreshold){
-				iLastPoint--;
-				bValid = false;
-				break;
-			}//if
-		}//for
-		if (bValid){
-			for (j = iFirstPoint; j < iLastPoint + 1; j++){
-				m_pHeight[j] = m_pProfile[iFirstPoint].y + 
-					(m_pProfile[j].x - m_pProfile[iFirstPoint].x) 
-					/ (m_pProfile[iLastPoint].x - m_pProfile[iFirstPoint].x)
-					* (m_pProfile[iLastPoint].y - m_pProfile[iFirstPoint].y);
-			}//for			
-			iFirstPoint = iLastPoint;
-			iLastPoint = iSections - 1;			
-		}//if
-	}//while
-	
-	
-	m_DocEngine.AddLongitudinalProfile(m_pProfile, m_pHeight, iSections);
-
-}//method
-
-double CProfile_Cross_Sections::CalculatePointLineDist(double fX1, double fY1, double fX2, double fY2, double fPX, double fPY){
-
-	double *pA, *pB, *pC;
-
-	pA = new double[2];
-	pA[0] = fX1;
-	pA[1] = fY1;
-	pB = new double[2];
-	pB[0] = fX2;
-	pB[1] = fY2;
-	pC = new double[2];
-	pC[0] = fPX;
-	pC[1] = fPY;
-	
-	return linePointDist(pA, pB, pC);
-
-}//method
-
-void CProfile_Cross_Sections::AddCrossSections(){
-
-	int i,j;
-	int iRoadPoints;
-	int iNumPoints = Parameters("NUMPOINTS")->asInt();
-	double fInterval = (double) Parameters("INTERVAL")->asDouble();
-	CSG_Table *pTable;
-	TSG_Point *pRoadSection;
-	TSG_Point **pCrossSections;
-	double dWidth = Parameters("WIDTH")->asDouble();
-
-	pRoadSection = new TSG_Point [2];
-	pRoadSection[0].x = -dWidth / 2.;
-	pRoadSection[0].y = 0;
-	pRoadSection[1].x = dWidth / 2.;
-	pRoadSection[1].y = 0;
-
-	pTable = m_pSections;
-	pCrossSections = new TSG_Point *[pTable->Get_Record_Count()];
-
-	for (i = 0; i < pTable->Get_Record_Count(); i++){
-		pCrossSections[i] = new TSG_Point [pTable->Get_Field_Count()];
-		for (j = 0; j < pTable->Get_Field_Count(); j++){
-			pCrossSections[i][j].x = -fInterval * iNumPoints + fInterval * j;
-			pCrossSections[i][j].y = pTable->Get_Record(i)->asFloat(j);
-		}//for
-	}//for
-
-	iRoadPoints = 2;
-
-	m_DocEngine.AddCrossSections(pCrossSections, m_pHeight, pRoadSection, pTable->Get_Record_Count(),
-								pTable->Get_Field_Count(), iRoadPoints);
-	m_DocEngine.AddVolumesTable(m_pProfile, pCrossSections, m_pHeight, pRoadSection,
-								pTable->Get_Record_Count(),	pTable->Get_Field_Count(), iRoadPoints);
-
-}//method
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.h b/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.h
deleted file mode 100644
index 37a3766..0000000
--- a/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/**********************************************************
- * Version $Id: Profile_Cross_Sections.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    CrossSections.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-//---------------------------------------------------------
-#include "doc_pdf.h"
-
-#include <vector>
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CProfile_Cross_Sections_PDF : public CSG_Doc_PDF   
-{
-public:
-	CProfile_Cross_Sections_PDF();
-	~CProfile_Cross_Sections_PDF();
-	void AddCrossSections(TSG_Point **,double*,TSG_Point *,int,int,int);	
-	void AddLongitudinalProfile(TSG_Point *, double*, int);
-	void AddVolumesTable(TSG_Point *,TSG_Point **,double*,TSG_Point *,int,int,int);	
-
-private:
-	char *m_pPath;
-	int m_iCanvasHeight;
-	int m_iTableWidth;
-	int m_iOffsetY;
-	CSG_String m_sName;
-
-	void AddCrossSection(TSG_Point *,TSG_Point *,int,int);
-	void DrawGuitar(TSG_Point *,double*, int);
-	void AddGuitarValue(double,double,double,double,int);
-	void AdjustSections(TSG_Point *,TSG_Point *,std::vector<TSG_Point >&,std::vector<TSG_Point >&,double,int&,int&);
-	void Intersect_Lines(double,double,double,double,double,double,double,double,double&,double&);
-	void CalculateAreas(TSG_Point*,TSG_Point*,double,int,int,double&,double&);
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CProfile_Cross_Sections : public CSG_Module_Grid
-{
-public:
-	CProfile_Cross_Sections(void);
-	virtual ~CProfile_Cross_Sections(void);
-
-protected:
-
-	bool On_Execute(void);
-
-private:
-
-	CProfile_Cross_Sections_PDF m_DocEngine;
-	CSG_Shapes *m_pSections;
-	double *m_pHeight;
-	TSG_Point *m_pProfile;
-
-	void CreatePDFDocs();
-	void AddLongitudinalProfiles();
-	void AddCrossSections();
-	double CalculatePointLineDist(double,double,double,double,double,double);
-
-};
-
-///////////////////////////////////////////////////////////
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_pdf/Shapes_Summary.cpp b/src/modules_io/docs/docs_pdf/Shapes_Summary.cpp
deleted file mode 100644
index 29784d9..0000000
--- a/src/modules_io/docs/docs_pdf/Shapes_Summary.cpp
+++ /dev/null
@@ -1,575 +0,0 @@
-/**********************************************************
- * Version $Id: Shapes_Summary.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Summarize.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Shapes_Summary.h"
-
-#define VERY_LARGE_NUMBER 9999999999.
-
-CSG_String sParam[] = {"[Sum]", "[Mean]", "[Variance]", "[Minimum]", "[Maximum]"};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define PDF_PAGE_WIDTH_A4       596
-#define PDF_PAGE_HEIGHT_A4      842
-#define PDF_PAGE_WIDTH_A3 PDF_PAGE_HEIGHT_A4
-#define PDF_PAGE_HEIGHT_A3 (sqrt(2.) * PDF_PAGE_HEIGHT_A4)
-#define OFFSET_X 50
-#define OFFSET_Y 50
-#define LINE_SPACEMENT 12
-#define SUMMARY_LAYOUT_HEADER 50
-#define MAX_SUMMARY_LAYOUT_HEIGHT (PDF_PAGE_WIDTH_A3 - 2 * OFFSET_Y - LINE_SPACEMENT)
-#define MAX_SUMMARY_LAYOUT_WIDTH MAX_SUMMARY_LAYOUT_HEIGHT
-#define SUMMARY_LAYOUT_SEPARATION 30
-#define MAX_SUMMARY_TABLE_WIDTH (PDF_PAGE_HEIGHT_A3 - 2 * OFFSET_X - MAX_SUMMARY_LAYOUT_WIDTH - SUMMARY_LAYOUT_SEPARATION)
-#define MAX_ROWS_IN_SUMMARY_LAYOUT (MAX_SUMMARY_LAYOUT_HEIGHT / TABLE_CELL_HEIGHT)
-#define SUMMARY_STATISTICS_GRAPH_HEIGHT 120
-#define SUMMARY_STATISTICS_GRAPH_WIDTH (PDF_PAGE_WIDTH_A4 - 2 * OFFSET_X)
-#define SUMMARY_STATISTICS_GRAPH_SEPARATION 120
-#define GRATICULE_SEPARATION 20
-#define SUMMARY_TABLE_CELL_HEIGHT 13.0
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
-CShapes_Summary_PDF::CShapes_Summary_PDF(){
-
-}//constructor
-
-CShapes_Summary_PDF::~CShapes_Summary_PDF(){}
-
-void CShapes_Summary_PDF::AddClassSummaryPage(CSG_Shapes *pShapes, 
-											   CSG_Table *pTable,
-											   int iClass,
-											   CSG_String sTitle){
-
-	int i;
-	double fPaperHeight;
-	double fRealWidth, fRealHeight;
-	double fX, fY;
-	CSG_Table *pClassTable;
-	CSG_Table_Record *pRecord;
-	CSG_Rect CanvasExtent, TableExtent;
-	TSG_Rect Extent;
-	
-
-	Add_Page(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE);
-	Add_Outline_Item(sTitle.c_str());
-
-	fPaperHeight = Get_Size_Page().Get_YRange();
-
-	Draw_Text(PDF_PAGE_HEIGHT_A3 - OFFSET_X, fPaperHeight - OFFSET_Y, sTitle, 
-				25, PDF_STYLE_TEXT_ALIGN_H_RIGHT, 0.0, SG_GET_RGB(0, 0, 0));
-
-	Draw_Line(OFFSET_X, fPaperHeight - OFFSET_Y - 5, 
-				PDF_PAGE_HEIGHT_A3 - OFFSET_X, fPaperHeight - OFFSET_Y - 5, 4 );
-
-	Extent = pShapes->Get_Extent();
-	fRealWidth = Extent.xMax - Extent.xMin;
-	fRealHeight = Extent.yMax - Extent.yMin;
-
-	CanvasExtent.Assign(OFFSET_X,
-						OFFSET_Y,
-						OFFSET_X + MAX_SUMMARY_LAYOUT_WIDTH,
-						OFFSET_Y + MAX_SUMMARY_LAYOUT_HEIGHT);
-
-	_Fit_Rectangle(CanvasExtent, fRealWidth / fRealHeight, true);
-
-	CanvasExtent.Deflate(GRATICULE_SEPARATION, false);
-
-	Draw_Shapes(CanvasExtent, pShapes);
-
-	CanvasExtent.Inflate(GRATICULE_SEPARATION, false);
-
-	/*CanvasExtent.xMin = OFFSET_X + (MAX_SUMMARY_LAYOUT_WIDTH - fWidth) / 2. - GRATICULE_SEPARATION;
-	CanvasExtent.xMax = CanvasExtent.xMin + fWidth + 2 * GRATICULE_SEPARATION;
-	CanvasExtent.yMin = OFFSET_Y + (MAX_SUMMARY_LAYOUT_HEIGHT - fHeight) / 2. - GRATICULE_SEPARATION;
-	CanvasExtent.yMax = CanvasExtent.yMin + fHeight + 2* GRATICULE_SEPARATION;*/
-
-	Draw_Graticule(CanvasExtent, Extent);
-
-	pClassTable = SG_Create_Table();
-	pClassTable->Add_Field(_TL("Field"), SG_DATATYPE_String );
-	pClassTable->Add_Field(_TL("Value"), SG_DATATYPE_Double);
-
-	for (i = 0; i < pTable->Get_Field_Count(); i++){
-		pRecord = pClassTable->Add_Record();
-		pRecord->Set_Value(0, pTable->Get_Field_Name(i));
-		pRecord->Set_Value(1, pTable->Get_Record(iClass)->asDouble(i));
-	}
-	fY = fPaperHeight - OFFSET_Y - SUMMARY_LAYOUT_HEADER;
-	fX = PDF_PAGE_HEIGHT_A3 - OFFSET_X - MAX_SUMMARY_TABLE_WIDTH;
-	TableExtent.Assign(fX, fY, fX + MAX_SUMMARY_TABLE_WIDTH, OFFSET_Y);
-
-	Draw_Table(TableExtent, pClassTable, SUMMARY_TABLE_CELL_HEIGHT, 0.0);
-	
-}//method
-
-void CShapes_Summary_PDF::AddSummaryStatisticsPage(CSG_Table* pTable){
-
-	int i,j;
-	double fX, fY;
-	double fPaperHeight;
-	CSG_Points Data;
-	CSG_String *pNames;
-	CSG_Rect r;
-
-	fPaperHeight = Get_Size_Page().Get_YRange();
-
-	pNames = new CSG_String [pTable->Get_Record_Count()];
-	for (i = 0; i < pTable->Get_Record_Count(); i++){
-		pNames[i] = pTable->Get_Record(i)->asString(0);
-	}//for
-
-	for (i = 1; i < pTable->Get_Field_Count(); i++){
-		if ((i-1)%3 == 0){
-			Add_Page();
-		}//if
-		Data.Clear();
-		for (j = 0; j < pTable->Get_Record_Count(); j++){
-			Data.Add(0.0, pTable->Get_Record(j)->asDouble(i)); 
-		}//for		
-		fY = OFFSET_Y + ((i-1)%3) * (SUMMARY_STATISTICS_GRAPH_HEIGHT + SUMMARY_STATISTICS_GRAPH_SEPARATION);
-		fY = fPaperHeight - fY;
-		fX = OFFSET_X;		
-		Draw_Text(fX, fY + 10, pTable->Get_Field_Name(i), 14);
-		r.Assign(fX, fY - 25 - SUMMARY_STATISTICS_GRAPH_HEIGHT, fX + SUMMARY_STATISTICS_GRAPH_WIDTH, fY - 25 );
-		AddBarGraphStatistics(Data, pNames, r);
-	}//for*/
-
-
-}//method
-
-void CShapes_Summary_PDF::AddBarGraphStatistics(CSG_Points &Data,
-										CSG_String *pNames,
-										const CSG_Rect &r){
-
-	int i;
-    int iMag;
-	int iNumLines;
-    double fMinLine = 0;
-	double fWidth;
-	double fMax, fMin;
-	double fStep;
-    double fX, fY;
-	double fPaperHeight;
-	double fAngle;
-	CSG_String sValue;
-	CSG_Points Points;
-
-	fPaperHeight = Get_Size_Page().Get_YRange();
-
-	fMin = fMax = Data[0].y;	
-
-	for (i = 0; i < Data.Get_Count(); i++){
-		if (Data[i].y > fMax){
-			fMax = Data[i].y;
-		}
-		if (Data[i].y < fMin){
-			fMin = Data[i].y;
-		}		
-		fMin = M_GET_MIN(0, fMin);		
-    }
-
-	if (fMin != fMax){
-		iMag = (int) (log(fMax - fMin) / log(10.0));
-		fStep =  (pow(10.0, (double) iMag));
-		if (fStep == 0){
-			fStep = 1.;
-		}
-		fMinLine= (long)(((long)(fMin/fStep)) *fStep);
-
-		iNumLines = (int) ((fMax - fMin) / fStep);
-
-		while (iNumLines < 8){
-			fStep = fStep / 2.0;
-			iNumLines = (int) ((fMax - fMin) / fStep);
-		}
-		iNumLines = (int) ((fMax - fMinLine) / fStep);
-	}
-	else{
-		fStep = fMin = 0;
-		iNumLines = 1;
-		fMinLine = fMax;
-	}
-
-
-	for (i = 0; i < iNumLines; i++) {
-        fY = r.Get_YMin() + ((fMinLine + fStep * i - fMin) / (fMax - fMin)) * r.Get_YRange();
-        if (fY <= r.Get_YMax() && fY >= r.Get_YMin()) {
-			Draw_Line(r.Get_XMin(), fY, r.Get_XMax(), fY);
-        }
-    }
-
-	fWidth = (double) r.Get_XRange() / (double) (Data.Get_Count());
-	for (i = 0; i < Data.Get_Count(); i++)
-	{
-	    fX = r.Get_XMin() + i * fWidth;
-		fY = r.Get_YMin();
-		//fY = fPaperHeight - fY;
-		Draw_Rectangle(fX, fY, fX + fWidth,
-				fY + r.Get_YRange() * ((Data[i].y - fMin) / (fMax - fMin)),
-				PDF_STYLE_POLYGON_FILLSTROKE, 0xaa0000);
-	}
-
-	fAngle = 3.14159/ 180 * 60;
-
-	for (i = 0; i < Data.Get_Count(); i++)
-	{
-	    fX = r.Get_XMin() + i * fWidth + fWidth / 2.;
-		Draw_Text(fX - 5, fY - 5, pNames[i], 9, PDF_STYLE_TEXT_ALIGN_V_TOP|PDF_STYLE_TEXT_ALIGN_H_RIGHT, fAngle);
-		Draw_Line(fX, fY, fX, fY - 5, 1);
-    }
-
-	Draw_Line(r.Get_XMin(), r.Get_YMin(), r.Get_XMin(), r.Get_YMax(), 4);
-	Draw_Line(r.Get_XMin(), r.Get_YMin(), r.Get_XMax(), r.Get_YMin(), 4);
-
-										
-}//method
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CShapes_Summary::CShapes_Summary(void){
-
-	CSG_Parameter *pNode;
-	CSG_String sName;
-
-	Parameters.Set_Name(_TL("Shapes Summary Report"));
-	Parameters.Set_Description(_TW("(c) 2004 by Victor Olaya. summary."));
-
-	pNode = Parameters.Add_Shapes(NULL,
-								"SHAPES",
-								_TL("Shapes"),
-								_TL(""),
-								PARAMETER_INPUT);
-
-	Parameters.Add_Table_Field(pNode,
-								"FIELD",
-								_TL("Field"),
-								_TL(""));
-
-	Parameters.Add_Table(NULL,
-						"TABLE",
-						_TL("Summary Table"),
-						_TL(""),
-						PARAMETER_OUTPUT);
-
-	pNode = Parameters.Add_Node(NULL,
-						"PDFNODE",
-						_TL("PDF Docs"),
-						_TL(""));
-
-	Parameters.Add_Value(pNode,
-						"PDF",
-						_TL("Create PDF Docs"),
-						_TL("Create PDF Docs"),
-						PARAMETER_TYPE_Bool,
-						true);
-
-	Parameters.Add_FilePath(pNode,
-							"OUTPUTPATH",
-							_TL("Folder"),
-							_TL("Folder"),
-							_TL(""),
-							_TL(""),
-							true,
-							true);
-
-	m_pExtraParameters	= Add_Parameters("EXTRA",
-										_TL("Field for Summary"),
-										_TL(""));
-
-}//constructor
-
-
-CShapes_Summary::~CShapes_Summary(void)
-{}
-
-bool CShapes_Summary::On_Execute(void){
-
-	int i,j;
-	CSG_Table *pShapesTable;
-	CSG_Parameter **pExtraParameter;
-	CSG_String sName, sFilePath;
-
-	m_iField = Parameters("FIELD")->asInt();
-	m_pShapes = Parameters("SHAPES")->asShapes();
-	m_pTable = Parameters("TABLE")->asTable();
-
-	pShapesTable = m_pShapes;
-	m_bIncludeParam = new bool [pShapesTable->Get_Field_Count() * 5];
-	pExtraParameter = new CSG_Parameter* [pShapesTable->Get_Field_Count() * 5];
-
-	for (i = 0; i < pShapesTable->Get_Field_Count(); i++){
-		for (j = 0; j < 5; j++){
-			if( SG_Data_Type_is_Numeric(pShapesTable->Get_Field_Type(i)) )
-			{ //is numeric field
-				sName = pShapesTable->Get_Field_Name(i);
-				sName.Append(sParam[j]);
-				pExtraParameter[i * 5 + j] = m_pExtraParameters->Add_Value(NULL,
-																			SG_Get_String(i * 5 + j,0).c_str(),
-																			sName.c_str(),
-																			_TL(""),
-																			PARAMETER_TYPE_Bool,
-																			false);
-				m_bIncludeParam[i * 5 + j] = true;
-			}//if
-			else{
-				m_bIncludeParam[i * 5 + j] = false;
-			}//else
-		}//for
-	}//for
-
-	if(Dlg_Parameters("EXTRA")){
-		for (i = 0; i < pShapesTable->Get_Field_Count() * 5; i++){
-			sName = SG_Get_String(i,0);
-			if (m_bIncludeParam[i]){
-				m_bIncludeParam[i] = Get_Parameters("EXTRA")->Get_Parameter(sName.c_str())->asBool();
-			}//if			
-		}//for
-
-		Summarize();
-
-		if (Parameters("PDF")->asBool()){
-			if (Parameters("OUTPUTPATH")->asString()){
-				sName = _TL("Summary_");
-				sName.Append(m_pShapes->Get_Name());
-				m_DocEngine.Open(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE, sName);
-				CreatePDFDocs();
-				sFilePath = SG_File_Make_Path(Parameters("OUTPUTPATH")->asString(), sName, SG_T("pdf"));
-				if (m_DocEngine.Save(sFilePath)){
-					if (!m_DocEngine.Close()){
-						Message_Add(_TL("\n\n ** Error : Could not close PDF engine ** \n\n"));
-					}
-				}//if
-				else{
-					Message_Add(_TL("\n\n ** Error : Could not save PDF file ** \n\n"));
-				}//else
-			}//if
-		}//if
-
-		m_pExtraParameters->Destroy();
-
-		delete [] m_bIncludeParam;
-
-		return true;
-
-	}//if
-
-	m_pExtraParameters->Destroy();
-
-	delete [] m_bIncludeParam;
-
-	return false;
-
-}//method
-
-void CShapes_Summary::CreatePDFDocs(){
-
-	CSG_Shapes *pShapes;
-	CSG_Shape *pShape;
-	CSG_Table *pShapesTable;
-	int i,j;
-	
-	m_DocEngine.Add_Page_Title (_TL("Summary"), PDF_TITLE_01, PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE);
-
-	pShapesTable = m_pShapes;
-	pShapes = new CSG_Shapes();
-	for (i = 0; i < (int)m_ClassesID.size(); i++){
-		Set_Progress(i,m_ClassesID.size());
-		pShapes->Create(m_pShapes->Get_Type());
-		for (j = 0; j < m_pShapes->Get_Count(); j++){
-			if (m_pClasses[j] == i){
-				pShape = pShapes->Add_Shape();
-				pShape->Assign(m_pShapes->Get_Shape(j));
-			}//if
-		}//for
-		m_DocEngine.AddClassSummaryPage(pShapes, m_pTable, i, m_ClassesID[i]);
-	}//for
-	
-	if (m_pTable->Get_Record_Count() > 1){
-		m_DocEngine.Add_Page_Title (_TL("Statistics"), PDF_TITLE_01, PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT);
-		m_DocEngine.AddSummaryStatisticsPage(m_pTable);
-	}//if
-
-	delete pShapes;
-
-}//method
-
-
-void CShapes_Summary::Summarize(){
-
-	int i,j;
-
-	CSG_Table *pShapesTable;
-	CSG_Table_Record *pRecord;
-	CSG_String sName;
-	float *pSum;
-	float *pMin;
-	float *pMax;
-	float *pVar;
-	float fValue;
-	float fMean;
-	int iLastField = -1;
-	int iField;
-	int iParam;
-
-	m_ClassesID.clear();
-
-	pShapesTable = m_pShapes;
-	m_pClasses = new int[pShapesTable->Get_Record_Count()];
-
-	for (i = 0; i < pShapesTable->Get_Record_Count(); i++){
-		pRecord = pShapesTable->Get_Record(i);
-		sName = pRecord->asString(m_iField);
-		for (j = 0; j < (int)m_ClassesID.size(); j++){
-			if (!m_ClassesID[j].CmpNoCase(sName)){
-				m_pClasses[i] = j;
-				break;
-			}//if
-		}//for
-		if (j == m_ClassesID.size()){
-			m_pClasses[i] = j;
-			m_ClassesID.push_back(sName);
-		}//if
-	}//for
-
-	m_pTable->Create((CSG_Table*)NULL);
-	m_pTable->Set_Name(_TL("Summary Table"));
-	m_pTable->Add_Field(_TL("Class"), SG_DATATYPE_String);
-	m_pTable->Add_Field(_TL("Count"), SG_DATATYPE_Int);
-
-	m_pCount = new int[m_ClassesID.size()];
-	pSum = new float[m_ClassesID.size()];
-	pMax = new float[m_ClassesID.size()];
-	pMin = new float[m_ClassesID.size()];
-	pVar = new float[m_ClassesID.size()];
-
-	for (i = 0; i < (int)m_ClassesID.size(); i++){
-		m_pCount[i] = 0;
-	}//for
-
-	for (i = 0; i < pShapesTable->Get_Record_Count(); i++){
-		m_pCount[m_pClasses[i]]++;
-	}//for
-
-	for (i = 0; i < (int)m_ClassesID.size(); i++){
-		pRecord = m_pTable->Add_Record();
-		sName = m_ClassesID[i];
-		pRecord->Set_Value(0,sName.c_str());
-		pRecord->Set_Value(1,m_pCount[i]);
-	}//for
-
-	for (i = 0; i < pShapesTable->Get_Field_Count() * 5; i++){
-		if (m_bIncludeParam[i]){
-			iField = (int) (i / 5);
-			iParam = i % 5;
-			sName = pShapesTable->Get_Field_Name(iField);
-			sName.Append(sParam[iParam]);
-			m_pTable->Add_Field(sName.c_str(), SG_DATATYPE_Double);
-			if (iField != iLastField){
-				for (j = 0; j < (int)m_ClassesID.size(); j++){
-					pSum[j] = 0;
-					pMax[j] = -(float)VERY_LARGE_NUMBER;
-					pMin[j] =  (float)VERY_LARGE_NUMBER;
-					pVar[j] = 0;
-				}//for
-				for (j = 0; j < pShapesTable->Get_Record_Count(); j++){
-					pRecord = pShapesTable->Get_Record(j);
-					fValue = pRecord->asFloat(iField);
-					pSum[m_pClasses[j]] += fValue;
-					pVar[m_pClasses[j]] += (fValue * fValue);
-					if (fValue > pMax[m_pClasses[j]]){
-						 pMax[m_pClasses[j]] = fValue;
-					}//if
-					if (fValue < pMin[m_pClasses[j]]){
-						 pMin[m_pClasses[j]] = fValue;
-					}//if
-				}//for
-			}//if
-			iField = m_pTable->Get_Field_Count() - 1;
-			for (j = 0; j < (int)m_ClassesID.size(); j++){
-				pRecord = m_pTable->Get_Record(j);
-				switch (iParam){
-				case 0: //sum
-					pRecord->Set_Value(iField, pSum[j]);
-					break;
-				case 1: //average
-					pRecord->Set_Value(iField, pSum[j] / (float) m_pCount[j]);
-					break;
-				case 2: //variance
-					fMean = pSum[j] / (float) m_pCount[j];
-					pRecord->Set_Value(iField, pVar[j] / (float) m_pCount[j] - fMean * fMean);
-					break;
-				case 3: //min
-					pRecord->Set_Value(iField, pMin[j]);
-					break;
-				case 4: //max
-					pRecord->Set_Value(iField, pMax[j]);
-					break;
-				default:
-					break;
-				}//switch
-			}//for
-
-		}//if
-
-	}//for
-
-
-}//method
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/docs/docs_pdf/Shapes_Summary.h b/src/modules_io/docs/docs_pdf/Shapes_Summary.h
deleted file mode 100644
index 090e804..0000000
--- a/src/modules_io/docs/docs_pdf/Shapes_Summary.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**********************************************************
- * Version $Id: Shapes_Summary.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Summarize.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "doc_pdf.h"
-
-#include <vector>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CShapes_Summary_PDF : public CSG_Doc_PDF 
-{
-public:
-
-	CShapes_Summary_PDF();
-	virtual ~CShapes_Summary_PDF();
-	void AddClassSummaryPage(CSG_Shapes*, CSG_Table*, int, CSG_String);
-	void AddSummaryStatisticsPage(CSG_Table* pTable);
-
-private:
-
-	void AddBarGraphStatistics(CSG_Points &, CSG_String*,	const CSG_Rect &);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CShapes_Summary : public CSG_Module  
-{
-public:
-	CShapes_Summary(void);
-	virtual ~CShapes_Summary(void);
-
-protected:
-
-	virtual bool			On_Execute(void);
-
-private:
-
-	int m_iField;
-	CSG_Shapes *m_pShapes;
-	CSG_Table *m_pTable;
-	bool *m_bIncludeParam;
-	std::vector<CSG_String> m_ClassesID;
-	int *m_pClasses;
-	int *m_pCount;
-	CSG_Parameters *m_pExtraParameters;
-	CShapes_Summary_PDF m_DocEngine;
-
-	void Summarize();
-	void CreatePDFDocs();
-
-};
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/esri_e00/Makefile.am b/src/modules_io/esri_e00/Makefile.am
deleted file mode 100644
index 8565fc2..0000000
--- a/src/modules_io/esri_e00/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = io_esri_e00
diff --git a/src/modules_io/esri_e00/Makefile.in b/src/modules_io/esri_e00/Makefile.in
deleted file mode 100644
index b5eb826..0000000
--- a/src/modules_io/esri_e00/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/esri_e00
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = io_esri_e00
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/esri_e00/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/esri_e00/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/esri_e00/io_esri_e00/Makefile.in b/src/modules_io/esri_e00/io_esri_e00/Makefile.in
deleted file mode 100644
index 9a9fd75..0000000
--- a/src/modules_io/esri_e00/io_esri_e00/Makefile.in
+++ /dev/null
@@ -1,650 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/esri_e00/io_esri_e00
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_esri_e00_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_esri_e00_la_OBJECTS = ESRI_E00_Import.lo MLB_Interface.lo \
-	cpl_conv.lo cpl_error.lo cpl_vsisimple.lo e00read.lo \
-	e00write.lo
-libio_esri_e00_la_OBJECTS = $(am_libio_esri_e00_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_esri_e00_la_SOURCES)
-DIST_SOURCES = $(libio_esri_e00_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libio_esri_e00.la
-libio_esri_e00_la_SOURCES = \
-ESRI_E00_Import.cpp\
-MLB_Interface.cpp\
-e00compr/cpl_conv.c\
-e00compr/cpl_error.c\
-e00compr/cpl_vsisimple.c\
-e00compr/e00read.c\
-e00compr/e00write.c\
-ESRI_E00_Import.h\
-MLB_Interface.h\
-e00compr/cpl_conv.h\
-e00compr/cpl_error.h\
-e00compr/cpl_port.h\
-e00compr/cpl_vsi.h\
-e00compr/e00compr.h
-
-libio_esri_e00_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/esri_e00/io_esri_e00/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/esri_e00/io_esri_e00/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_esri_e00.la: $(libio_esri_e00_la_OBJECTS) $(libio_esri_e00_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_esri_e00_la_OBJECTS) $(libio_esri_e00_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ESRI_E00_Import.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cpl_conv.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cpl_error.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cpl_vsisimple.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/e00read.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/e00write.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
-
-cpl_conv.lo: e00compr/cpl_conv.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_conv.lo -MD -MP -MF $(DEPDIR)/cpl_conv.Tpo -c -o cpl_conv.lo `test -f 'e00compr/cpl_conv.c' || echo '$(srcdir)/'`e00compr/cpl_conv.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cpl_conv.Tpo $(DEPDIR)/cpl_conv.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/cpl_conv.c' object='cpl_conv.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_conv.lo `test -f 'e00compr/cpl_conv.c' || echo '$(srcdir)/'`e00compr/cpl_conv.c
-
-cpl_error.lo: e00compr/cpl_error.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_error.lo -MD -MP -MF $(DEPDIR)/cpl_error.Tpo -c -o cpl_error.lo `test -f 'e00compr/cpl_error.c' || echo '$(srcdir)/'`e00compr/cpl_error.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cpl_error.Tpo $(DEPDIR)/cpl_error.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/cpl_error.c' object='cpl_error.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_error.lo `test -f 'e00compr/cpl_error.c' || echo '$(srcdir)/'`e00compr/cpl_error.c
-
-cpl_vsisimple.lo: e00compr/cpl_vsisimple.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_vsisimple.lo -MD -MP -MF $(DEPDIR)/cpl_vsisimple.Tpo -c -o cpl_vsisimple.lo `test -f 'e00compr/cpl_vsisimple.c' || echo '$(srcdir)/'`e00compr/cpl_vsisimple.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cpl_vsisimple.Tpo $(DEPDIR)/cpl_vsisimple.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/cpl_vsisimple.c' object='cpl_vsisimple.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_vsisimple.lo `test -f 'e00compr/cpl_vsisimple.c' || echo '$(srcdir)/'`e00compr/cpl_vsisimple.c
-
-e00read.lo: e00compr/e00read.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT e00read.lo -MD -MP -MF $(DEPDIR)/e00read.Tpo -c -o e00read.lo `test -f 'e00compr/e00read.c' || echo '$(srcdir)/'`e00compr/e00read.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/e00read.Tpo $(DEPDIR)/e00read.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/e00read.c' object='e00read.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o e00read.lo `test -f 'e00compr/e00read.c' || echo '$(srcdir)/'`e00compr/e00read.c
-
-e00write.lo: e00compr/e00write.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT e00write.lo -MD -MP -MF $(DEPDIR)/e00write.Tpo -c -o e00write.lo `test -f 'e00compr/e00write.c' || echo '$(srcdir)/'`e00compr/e00write.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/e00write.Tpo $(DEPDIR)/e00write.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='e00compr/e00write.c' object='e00write.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o e00write.lo `test -f 'e00compr/e00write.c' || echo '$(srcdir)/'`e00compr/e00write.c
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/gdal/Makefile.am b/src/modules_io/gdal/Makefile.am
deleted file mode 100644
index 7fdcf2e..0000000
--- a/src/modules_io/gdal/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = io_gdal
diff --git a/src/modules_io/gdal/Makefile.in b/src/modules_io/gdal/Makefile.in
deleted file mode 100644
index b8fde72..0000000
--- a/src/modules_io/gdal/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/gdal
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = io_gdal
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/gdal/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/gdal/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/gdal/io_gdal/Makefile.in b/src/modules_io/gdal/io_gdal/Makefile.in
deleted file mode 100644
index f3b5d05..0000000
--- a/src/modules_io/gdal/io_gdal/Makefile.in
+++ /dev/null
@@ -1,605 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/gdal/io_gdal
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_gdal_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_gdal_la_OBJECTS = gdal_driver.lo gdal_export.lo \
-	gdal_export_geotiff.lo gdal_import.lo gdal_import_netcdf.lo \
-	MLB_Interface.lo ogr_driver.lo ogr_export.lo ogr_export_kml.lo \
-	ogr_import.lo
-libio_gdal_la_OBJECTS = $(am_libio_gdal_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_gdal_la_SOURCES)
-DIST_SOURCES = $(libio_gdal_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1465 2012-08-23 09:20:00Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
-DEP_LIBS = `gdal-config --libs`
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core `gdal-config --cflags`
-AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS)
-pkglib_LTLIBRARIES = libio_gdal.la
-libio_gdal_la_SOURCES = \
-gdal_driver.cpp\
-gdal_export.cpp\
-gdal_export_geotiff.cpp\
-gdal_import.cpp\
-gdal_import_netcdf.cpp\
-MLB_Interface.cpp\
-ogr_driver.cpp\
-ogr_export.cpp\
-ogr_export_kml.cpp\
-ogr_import.cpp\
-gdal_driver.h\
-gdal_export.h\
-gdal_export_geotiff.h\
-gdal_import.h\
-gdal_import_netcdf.h\
-MLB_Interface.h\
-ogr_driver.h\
-ogr_export.h\
-ogr_export_kml.h\
-ogr_import.h
-
-libio_gdal_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/gdal/io_gdal/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/gdal/io_gdal/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_gdal.la: $(libio_gdal_la_OBJECTS) $(libio_gdal_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_gdal_la_OBJECTS) $(libio_gdal_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_driver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_export.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_export_geotiff.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_import.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gdal_import_netcdf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_driver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_export.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_export_kml.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ogr_import.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/gdal/io_gdal/ogr_driver.cpp b/src/modules_io/gdal/io_gdal/ogr_driver.cpp
deleted file mode 100644
index 04d9fcc..0000000
--- a/src/modules_io/gdal/io_gdal/ogr_driver.cpp
+++ /dev/null
@@ -1,818 +0,0 @@
-/**********************************************************
- * Version $Id: ogr_driver.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library                     //
-//                                                       //
-//                       io_gdal                         //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    ogr_driver.cpp                     //
-//                                                       //
-//            Copyright (C) 2008 by O. 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.de                    //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Bundesstr. 55                          //
-//                D-20146 Hamburg                        //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "ogr_driver.h"
-
-#include <gdal_priv.h>
-#include <ogrsf_frmts.h>
-#include <ogr_core.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_OGR_Drivers		gSG_OGR_Drivers;
-
-const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void)
-{
-	return( gSG_OGR_Drivers );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_OGR_Drivers::CSG_OGR_Drivers(void)
-{
-	OGRRegisterAll();
-
-	m_pDrivers	= OGRSFDriverRegistrar::GetRegistrar();
-}
-
-//---------------------------------------------------------
-CSG_OGR_Drivers::~CSG_OGR_Drivers(void)
-{
-//	OGRCleanupAll();	
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSG_OGR_Drivers::Get_Count(void) const
-{
-	return( m_pDrivers->GetDriverCount() );
-}
-
-//---------------------------------------------------------
-OGRSFDriver * CSG_OGR_Drivers::Get_Driver(int Index) const
-{
-	return( m_pDrivers->GetDriver(Index) );
-}
-
-//---------------------------------------------------------
-OGRSFDriver * CSG_OGR_Drivers::Get_Driver(const CSG_String &Name) const
-{
-	return( m_pDrivers ? m_pDrivers->GetDriverByName(Name) : NULL );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_OGR_Drivers::Get_Name(int Index) const
-{
-	return( m_pDrivers->GetDriver(Index)->GetName() );
-}
-
-//---------------------------------------------------------
-CSG_String CSG_OGR_Drivers::Get_Description(int Index) const
-{
-	OGRSFDriver	*pDriver	= m_pDrivers->GetDriver(Index);
-	CSG_String	s;
-
-	s	+= pDriver->TestCapability(ODrCCreateDataSource)	? SG_T("\n[x] ") : SG_T("\n[ ] ");
-	s	+= _TL("create data source");
-
-	s	+= pDriver->TestCapability(ODrCDeleteDataSource)	? SG_T("\n[x] ") : SG_T("\n[ ] ");
-	s	+= _TL("delete data source");
-
-/*	s	+= pDriver->TestCapability(ODsCCreateLayer)			? SG_T("\n[x]") : SG_T("\n[ ]");
-	s	+= _TL("create layer");
-
-	s	+= pDriver->TestCapability(ODsCDeleteLayer)			? SG_T("\n[x]") : SG_T("\n[ ]");
-	s	+= _TL("delete layer");
-
-	s	+= pDriver->TestCapability(OLCDeleteFeature)		? SG_T("\n[x]") : SG_T("\n[ ]");
-	s	+= _TL("delete feature");
-
-	s	+= pDriver->TestCapability(OLCRandomRead)			? SG_T("\n[x]") : SG_T("\n[ ]");
-	s	+= _TL("random read");
-
-	s	+= pDriver->TestCapability(OLCRandomWrite)			? SG_T("\n[x]") : SG_T("\n[ ]");
-	s	+= _TL("random write");
-
-	s	+= pDriver->TestCapability(OLCSequentialWrite)		? SG_T("\n[x]") : SG_T("\n[ ]");
-	s	+= _TL("sequential write");
-/**/
-
-	return( s );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_Drivers::Can_Read(int Index) const
-{
-	return( Get_Driver(Index) != NULL );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_Drivers::Can_Write(int Index) const
-{
-	return( Get_Driver(Index) != NULL );//&& Get_Driver(Index)->TestCapability(ODrCCreateDataSource) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-TSG_Vertex_Type CSG_OGR_Drivers::Get_Vertex_Type(int Type)
-{
-	switch( Type )
-	{
-	case wkbPoint25D:				// 2.5D extension as per 99-402
-	case wkbMultiPoint25D:			// 2.5D extension as per 99-402
-	case wkbLineString25D:			// 2.5D extension as per 99-402
-	case wkbMultiLineString25D:		// 2.5D extension as per 99-402
-	case wkbPolygon25D:				// 2.5D extension as per 99-402
-	case wkbMultiPolygon25D:		// 2.5D extension as per 99-402
-	case wkbGeometryCollection25D:	// 2.5D extension as per 99-402 
-		return( SG_VERTEX_TYPE_XYZ );
-
-	default:
-		return( SG_VERTEX_TYPE_XY );
-	}
-}
-
-//---------------------------------------------------------
-TSG_Shape_Type CSG_OGR_Drivers::Get_Shape_Type(int Type)
-{
-	switch( Type )
-	{
-	case wkbPoint:					// 0-dimensional geometric object, standard WKB
-	case wkbPoint25D:				// 2.5D extension as per 99-402
-		return( SHAPE_TYPE_Point );
-
-	case wkbMultiPoint:				// GeometryCollection of Points, standard WKB
-	case wkbMultiPoint25D:			// 2.5D extension as per 99-402
-		return( SHAPE_TYPE_Points );
-
-	case wkbLineString:				// 1-dimensional geometric object with linear interpolation between Points, standard WKB
-	case wkbMultiLineString:		// GeometryCollection of LineStrings, standard WKB
-	case wkbLineString25D:			// 2.5D extension as per 99-402
-	case wkbMultiLineString25D:		// 2.5D extension as per 99-402
-		return( SHAPE_TYPE_Line );
-
-	case wkbPolygon:				// planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB
-	case wkbMultiPolygon:			// GeometryCollection of Polygons, standard WKB
-	case wkbPolygon25D:				// 2.5D extension as per 99-402
-	case wkbMultiPolygon25D:		// 2.5D extension as per 99-402
-		return( SHAPE_TYPE_Polygon );
-
-	default:
-	case wkbUnknown:				// unknown type, non-standard
-	case wkbNone:					// non-standard, for pure attribute records
-	case wkbLinearRing:				// non-standard, just for createGeometry()
-	case wkbGeometryCollection:		// geometric object that is a collection of 1 or more geometric objects, standard WKB
-	case wkbGeometryCollection25D:	// 2.5D extension as per 99-402 
-		return( SHAPE_TYPE_Undefined );
-	}
-}
-
-//---------------------------------------------------------
-int CSG_OGR_Drivers::Get_Shape_Type(TSG_Shape_Type Type, bool bZ)
-{
-	switch( Type )
-	{
-	case SHAPE_TYPE_Point:	 	return( bZ ? wkbPoint25D           : wkbPoint           );	// point
-	case SHAPE_TYPE_Points: 	return( bZ ? wkbMultiPoint25D      : wkbMultiPoint      );	// points
-	case SHAPE_TYPE_Line: 		return( bZ ? wkbMultiLineString25D : wkbMultiLineString );	// line
-	case SHAPE_TYPE_Polygon:	return( bZ ? wkbMultiPolygon25D    : wkbMultiPolygon    );	// polygon
-
-	default:	return( wkbUnknown );
-	}
-}
-
-//---------------------------------------------------------
-TSG_Data_Type CSG_OGR_Drivers::Get_Data_Type(int Type)
-{
-	switch( Type )
-	{
-	case OFTInteger:		// Simple 32bit integer
-		return( SG_DATATYPE_Int );
-
-	case OFTReal:			// Double Precision floating point
-		return( SG_DATATYPE_Double );
-
-	case OFTString:			// String of ASCII chars
-		return( SG_DATATYPE_String );
-
-	case OFTDateTime:		// Date and Time 
-		return( SG_DATATYPE_Date );
-
-	default:
-	case OFTIntegerList:	// List of 32bit integers
-	case OFTRealList:		// List of doubles
-	case OFTStringList:		// Array of strings
-	case OFTWideString:		// deprecated
-	case OFTWideStringList:	// deprecated
-	case OFTBinary:			// Raw Binary data
-	case OFTDate:			// Date
-	case OFTTime:			// Time
-		return( SG_DATATYPE_Undefined );
-	}
-}
-
-//---------------------------------------------------------
-int CSG_OGR_Drivers::Get_Data_Type(TSG_Data_Type Type)
-{
-	switch( Type )
-	{
-	default:
-	case SG_DATATYPE_String:
-	case SG_DATATYPE_Date:
-		return( OFTString );
-
-	case SG_DATATYPE_Byte:
-	case SG_DATATYPE_Char:
-	case SG_DATATYPE_Word:
-	case SG_DATATYPE_Short:
-	case SG_DATATYPE_DWord:
-	case SG_DATATYPE_Int:
-	case SG_DATATYPE_ULong:
-	case SG_DATATYPE_Long:
-	case SG_DATATYPE_Color:
-		return( OFTInteger );
-
-	case SG_DATATYPE_Float:
-	case SG_DATATYPE_Double:
-		return( OFTReal );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_OGR_DataSource::CSG_OGR_DataSource(void)
-{
-	m_pDataSource	= NULL;
-}
-
-CSG_OGR_DataSource::CSG_OGR_DataSource(const CSG_String &File)
-{
-	m_pDataSource	= NULL;
-
-	Create(File);
-}
-
-//---------------------------------------------------------
-CSG_OGR_DataSource::~CSG_OGR_DataSource(void)
-{
-	Destroy();
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::Create(const CSG_String &File)
-{
-	Destroy();
-
-	m_pDataSource	= OGRSFDriverRegistrar::Open(File);
-
-	return( m_pDataSource != NULL );
-}
-
-bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &DriverName)
-{
-	OGRSFDriver	*pDriver;
-
-	Destroy();
-
-	if( (pDriver = gSG_OGR_Drivers.Get_Driver(DriverName)) != NULL )
-	{
-		m_pDataSource	= pDriver->CreateDataSource(File, NULL);
-	}
-
-	return( m_pDataSource != NULL );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::Destroy(void)
-{
-	if( m_pDataSource )
-	{
-		OGRDataSource::DestroyDataSource(m_pDataSource);
-
-		m_pDataSource	= NULL;
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSG_OGR_DataSource::Get_Count(void)
-{
-	if( m_pDataSource )
-	{
-		return( m_pDataSource->GetLayerCount() );
-	}
-
-	return( 0 );
-}
-
-//---------------------------------------------------------
-OGRLayer * CSG_OGR_DataSource::Get_Layer(int iLayer)
-{
-	if( m_pDataSource && iLayer >= 0 && iLayer < m_pDataSource->GetLayerCount() )
-	{
-		return( m_pDataSource->GetLayer(iLayer) );
-	}
-
-	return( NULL );
-}
-
-//---------------------------------------------------------
-TSG_Shape_Type CSG_OGR_DataSource::Get_Type(int iLayer)
-{
-	if( Get_Layer(iLayer) )
-	{
-		return( CSG_OGR_Drivers::Get_Shape_Type(Get_Layer(iLayer)->GetLayerDefn()->GetGeomType()) );
-	}
-
-	return( SHAPE_TYPE_Undefined );
-}
-
-//---------------------------------------------------------
-TSG_Vertex_Type CSG_OGR_DataSource::Get_Coordinate_Type(int iLayer)
-{
-	if( Get_Layer(iLayer) )
-	{
-		return( CSG_OGR_Drivers::Get_Vertex_Type(Get_Layer(iLayer)->GetLayerDefn()->GetGeomType()) );
-	}
-
-	return( SG_VERTEX_TYPE_XY );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Shapes * CSG_OGR_DataSource::Read(int iLayer, int iGeomTypeChoice)
-{
-	OGRLayer	*pLayer	= Get_Layer(iLayer);
-
-	if( iGeomTypeChoice != 0 )
-		pLayer->GetLayerDefn()->SetGeomType((OGRwkbGeometryType)_Get_GeomType_Choice(iGeomTypeChoice));
-
-	//-----------------------------------------------------
-	if( pLayer && Get_Type(iLayer) != SHAPE_TYPE_Undefined )
-	{
-		int				iField;
-		OGRFeature		*pFeature;
-		OGRFeatureDefn	*pDef		= pLayer->GetLayerDefn();
-		CSG_Shapes		*pShapes	= SG_Create_Shapes(Get_Type(iLayer), CSG_String(pDef->GetName()), NULL, Get_Coordinate_Type(iLayer));
-
-		for(iField=0; iField<pDef->GetFieldCount(); iField++)
-		{
-			OGRFieldDefn	*pDefField	= pDef->GetFieldDefn(iField);
-
-			pShapes->Add_Field(pDefField->GetNameRef(), CSG_OGR_Drivers::Get_Data_Type(pDefField->GetType()));
-		}
-
-		pLayer->ResetReading();
-
-		//-------------------------------------------------
-		while( (pFeature = pLayer->GetNextFeature()) != NULL && SG_UI_Process_Get_Okay(false) )
-		{
-			OGRGeometry	*pGeometry	= pFeature->GetGeometryRef();
-
-			if( pGeometry != NULL )
-			{
-				CSG_Shape	*pShape	= pShapes->Add_Shape();
-
-				for(iField=0; iField<pDef->GetFieldCount(); iField++)
-				{
-					OGRFieldDefn	*pDefField	= pDef->GetFieldDefn(iField);
-
-					switch( pDefField->GetType() )
-					{
-					default:			pShape->Set_Value(iField, pFeature->GetFieldAsString (iField));	break;
-					case OFTString:		pShape->Set_Value(iField, pFeature->GetFieldAsString (iField));	break;
-					case OFTInteger:	pShape->Set_Value(iField, pFeature->GetFieldAsInteger(iField));	break;
-					case OFTReal:		pShape->Set_Value(iField, pFeature->GetFieldAsDouble (iField));	break;
-					}
-				}
-
-				//-----------------------------------------
-				if( _Read_Geometry(pShape, pGeometry) == false )
-				{
-					pShapes->Del_Shape(pShape);
-				}
-			}
-
-			OGRFeature::DestroyFeature(pFeature);
-		}
-
-		return( pShapes );
-	}
-
-	//-----------------------------------------------------
-	return( NULL );
-}
-
-//---------------------------------------------------------
-int CSG_OGR_DataSource::_Get_GeomType_Choice(int iGeomTypeChoice)
-{
-	switch( iGeomTypeChoice )
-	{
-	default:
-	case AUTOMATIC:					return( wkbUnknown );
-	case WKBPOINT:					return( wkbPoint );
-	case WKBPOINT25D:				return( wkbPoint25D );
-	case WKBMULTIPOINT:				return( wkbMultiPoint );
-	case WKBMULTIPOINT25D:			return( wkbMultiPoint25D );
-	case WKBLINESTRING:				return( wkbLineString );
-	case WKBLINESTRING25D:			return( wkbLineString25D );
-	case WKBMULTILINESTRING:		return( wkbMultiLineString );
-	case WKBMULTILINESTRING25D:		return( wkbMultiLineString25D );
-	case WKBPOLYGON:				return( wkbPolygon );
-	case WKBPOLYGON25D:				return( wkbPolygon25D );
-	case WKBMULTIPOLYGON:			return( wkbMultiPolygon );
-	case WKBMULTIPOLYGON25D:		return( wkbMultiPolygon25D );
-	case WKBGEOMETRYCOLLECTION:		return( wkbGeometryCollection );
-	case WKBGEOMETRYCOLLECTION25D:	return( wkbGeometryCollection25D );
-	}
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::_Read_Geometry(CSG_Shape *pShape, OGRGeometry *pGeometry)
-{
-	if( pShape && pGeometry )
-	{
-		switch( pGeometry->getGeometryType() )
-		{
-		//-------------------------------------------------
-		case wkbPoint:				// 0-dimensional geometric object, standard WKB
-		case wkbPoint25D:			// 2.5D extension as per 99-402
-			pShape->Add_Point(((OGRPoint *)pGeometry)->getX(), ((OGRPoint *)pGeometry)->getY());
-			pShape->Set_Z(((OGRPoint *)pGeometry)->getZ(), 0);
-			return( true );
-
-		//-------------------------------------------------
-		case wkbLineString:			// 1-dimensional geometric object with linear interpolation between Points, standard WKB
-		case wkbLineString25D:		// 2.5D extension as per 99-402
-			return( _Read_Line(pShape, (OGRLineString *)pGeometry) );
-
-		//-------------------------------------------------
-		case wkbPolygon:			// planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB
-		case wkbPolygon25D:			// 2.5D extension as per 99-402
-			return( _Read_Polygon(pShape, (OGRPolygon *)pGeometry) );
-
-		//-------------------------------------------------
-		case wkbMultiPoint:			// GeometryCollection of Points, standard WKB
-		case wkbMultiPoint25D:		// 2.5D extension as per 99-402
-		case wkbMultiLineString:	// GeometryCollection of LineStrings, standard WKB
-		case wkbMultiLineString25D:	// 2.5D extension as per 99-402
-		case wkbMultiPolygon:		// GeometryCollection of Polygons, standard WKB
-		case wkbMultiPolygon25D:	// 2.5D extension as per 99-402
-			{
-				for(int i=0; i<((OGRGeometryCollection *)pGeometry)->getNumGeometries(); i++)
-				{
-					if( _Read_Geometry(pShape, ((OGRGeometryCollection *)pGeometry)->getGeometryRef(i)) == false )
-					{
-						return( false );
-					}
-				}
-			}
-
-			return( true );
-
-		//-------------------------------------------------
-		default:
-			break;
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::_Read_Line(CSG_Shape *pShape, OGRLineString *pLine)
-{
-	if( pShape && pLine && pLine->getNumPoints() > 0 )
-	{
-		int		iPart	= pShape->Get_Part_Count();
-
-		for(int iPoint=0; iPoint<pLine->getNumPoints(); iPoint++)
-		{
-			pShape->Add_Point(pLine->getX(iPoint), pLine->getY(iPoint), iPart);
-
-			pShape->Set_Z(pLine->getZ(iPoint), iPoint, iPart);
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::_Read_Polygon(CSG_Shape *pShape, OGRPolygon *pPolygon)
-{
-	if( pShape && pPolygon )
-	{
-		_Read_Line(pShape, pPolygon->getExteriorRing());
-
-		for(int i=0; i<pPolygon->getNumInteriorRings(); i++)
-		{
-			pPolygon->getInteriorRing(i);
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName)
-{
-	bool		bZ	= pShapes->Get_Vertex_Type() != SG_VERTEX_TYPE_XY;
-	OGRLayer	*pLayer;
-
-	//-----------------------------------------------------
-	if( m_pDataSource && pShapes && pShapes->is_Valid() && (pLayer = m_pDataSource->CreateLayer(CSG_String(pShapes->Get_Name()), NULL, (OGRwkbGeometryType)gSG_OGR_Drivers.Get_Shape_Type(pShapes->Get_Type(), bZ))) != NULL )
-	{
-		bool			bResult	= true;
-		int				iField;
-		
-		//-------------------------------------------------
-		if( SG_STR_CMP(DriverName, "DXF") )
-		// the dxf driver does not support arbitrary field creation and returns OGRERR_FAILURE;
-		// it seems like there is no method in OGR to check whether a driver supports field creation or not;
-		// another issue with the dxf driver: 3D polygon data is not supported (would require e.g. "3DFACE" entity implementation in GDAL/OGR),
-		// so we would need to treat them as polylines (not implemented, currently it is necessary to convert to a line shapefile a priori)
-		{
-			for(iField=0; iField<pShapes->Get_Field_Count() && bResult; iField++)
-			{
-				OGRFieldDefn	DefField(CSG_String(pShapes->Get_Field_Name(iField)), (OGRFieldType)gSG_OGR_Drivers.Get_Data_Type(pShapes->Get_Field_Type(iField)));
-
-				//	DefField.SetWidth(32);
-
-				if( pLayer->CreateField(&DefField) != OGRERR_NONE )
-				{
-					bResult	= false;
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		for(int iShape=0; iShape<pShapes->Get_Count() && bResult && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-		{
-			CSG_Shape	*pShape		= pShapes->Get_Shape(iShape);
-			OGRFeature	*pFeature	= OGRFeature::CreateFeature(pLayer->GetLayerDefn());
-
-			// no need for a special treatment of DXF here, as pFeature->SetField() just silently ignores iFields out of range
-			for(iField=0; iField<pShapes->Get_Field_Count(); iField++)
-			{
-				switch( pShapes->Get_Field_Type(iField) )
-				{
-				default:
-				case SG_DATATYPE_Char:
-				case SG_DATATYPE_String:
-				case SG_DATATYPE_Date:
-					pFeature->SetField(iField, CSG_String(pShape->asString(iField)));
-					break;
-
-				case SG_DATATYPE_Short:
-				case SG_DATATYPE_Int:
-				case SG_DATATYPE_Long:
-				case SG_DATATYPE_Color:
-					pFeature->SetField(iField, pShape->asInt(iField));
-					break;
-
-				case SG_DATATYPE_Float:
-				case SG_DATATYPE_Double:
-					pFeature->SetField(iField, pShape->asDouble(iField));
-					break;
-				}
-			}
-
-			if( !_Write_Geometry(pShape, pFeature, bZ) || pLayer->CreateFeature(pFeature) != OGRERR_NONE )
-			{
-				bResult	= false;
-			}
-
-			OGRFeature::DestroyFeature(pFeature);
-		}
-
-		//-------------------------------------------------
-		return( bResult );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::_Write_Geometry(CSG_Shape *pShape, OGRFeature *pFeature, bool bZ)
-{
-	if( pShape && pFeature )
-	{
-		int					iPoint, iPart;
-		TSG_Point			sgPoint;
-		OGRPoint			Point;
-		OGRMultiPoint		Points;
-		OGRLineString		Line;
-		OGRMultiLineString	Lines;
-		OGRLinearRing		Ring;
-		OGRPolygon			Polygon;
-
-		switch( pShape->Get_Type() )
-		{
-		//-------------------------------------------------
-		case SHAPE_TYPE_Point:
-			sgPoint	= pShape->Get_Point(0);
-			Point.setX(sgPoint.x);
-			Point.setY(sgPoint.y);
-
-			if( bZ )
-			{
-				Point.setZ(pShape->Get_Z(0));
-			}
-
-			return( pFeature->SetGeometry(&Point) == OGRERR_NONE );
-
-		//-------------------------------------------------
-		case SHAPE_TYPE_Points:
-			for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-			{
-				for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-				{
-					sgPoint	= pShape->Get_Point(iPoint, iPart);
-					Point.setX(sgPoint.x);
-					Point.setY(sgPoint.y);
-
-					if( bZ )
-					{
-						Point.setZ(pShape->Get_Z(0));
-					}
-
-					Points.addGeometry(&Point);
-				}
-			}
-
-			return( pFeature->SetGeometry(&Points) == OGRERR_NONE );
-
-		//-------------------------------------------------
-		case SHAPE_TYPE_Line:
-			if( pShape->Get_Part_Count() == 1 )
-			{
-				_Write_Line(pShape, &Line, 0, bZ);
-
-				return( pFeature->SetGeometry(&Line) == OGRERR_NONE );
-			}
-			else
-			{
-				for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-				{
-					if( _Write_Line(pShape, &Line, iPart, bZ) )
-					{
-						Lines.addGeometry(&Line);
-					}
-				}
-
-				return( pFeature->SetGeometry(&Lines) == OGRERR_NONE );
-			}
-
-		//-------------------------------------------------
-		case SHAPE_TYPE_Polygon:
-			for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-			{
-				if( _Write_Line(pShape, &Ring, iPart, bZ) )
-				{
-					Polygon.addRing(&Ring);
-				}
-			}
-
-			return( pFeature->SetGeometry(&Polygon) == OGRERR_NONE );
-
-		//-------------------------------------------------
-		default:
-			break;
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_OGR_DataSource::_Write_Line(CSG_Shape *pShape, OGRLineString *pLine, int iPart, bool bZ)
-{
-	if( pLine && pShape && iPart >= 0 && iPart < pShape->Get_Part_Count() )
-	{
-		pLine->empty();
-
-		for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-		{
-			TSG_Point	sgPoint	= pShape->Get_Point(iPoint, iPart);
-
-			if( !bZ )
-			{
-				pLine->addPoint(sgPoint.x, sgPoint.y);
-			}
-			else
-			{
-				pLine->addPoint(sgPoint.x, sgPoint.y, pShape->Get_Z(iPoint, iPart));
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/gdal/io_gdal/ogr_driver.h b/src/modules_io/gdal/io_gdal/ogr_driver.h
deleted file mode 100644
index 60985dc..0000000
--- a/src/modules_io/gdal/io_gdal/ogr_driver.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/**********************************************************
- * Version $Id: ogr_driver.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library                     //
-//                                                       //
-//                       io_gdal                         //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     ogr_driver.h                      //
-//                                                       //
-//            Copyright (C) 2008 O. 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.de                    //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Bundesstr. 55                          //
-//                D-20146 Hamburg                        //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__ogr_driver_H
-#define HEADER_INCLUDED__ogr_driver_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-//---------------------------------------------------------
-typedef enum ESG_Geom_Type_Choice_Key
-{
-	AUTOMATIC				= 0,
-	WKBPOINT,
-	WKBPOINT25D,
-	WKBMULTIPOINT,
-	WKBMULTIPOINT25D,
-	WKBLINESTRING,
-	WKBLINESTRING25D,
-	WKBMULTILINESTRING,
-	WKBMULTILINESTRING25D,
-	WKBPOLYGON,
-	WKBPOLYGON25D,
-	WKBMULTIPOLYGON,
-	WKBMULTIPOLYGON25D,
-	WKBGEOMETRYCOLLECTION,
-	WKBGEOMETRYCOLLECTION25D,
-	GEOM_TYPE_KEY_Count
-}
-TSG_Geom_Type_Choice_Key;
-
-
-//---------------------------------------------------------
-const SG_Char	gSG_Geom_Type_Choice_Key_Name[GEOM_TYPE_KEY_Count][32]	=
-{
-	SG_T("automatic"),
-	SG_T("wkbPoint"),
-	SG_T("wkbPoint25D"),
-	SG_T("wkbMultiPoint"),
-	SG_T("wkbMultiPoint25D"),
-	SG_T("wkbLineString"),
-	SG_T("wkbLineString25D"),
-	SG_T("wkbMultiLineString"),
-	SG_T("wkbMultiLineString25D"),
-	SG_T("wkbPolygon"),
-	SG_T("wkbPolygon25D"),
-	SG_T("wkbMultiPolygon"),
-	SG_T("wkbMultiPolygon25D"),
-	SG_T("wkbGeometryCollection"),
-	SG_T("wkbGeometryCollection25D")
-};
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_gdal_EXPORT CSG_OGR_Drivers
-{
-public:
-	CSG_OGR_Drivers(void);
-	virtual ~CSG_OGR_Drivers(void);
-
-	int							Get_Count			(void)						const;
-
-	class OGRSFDriver *			Get_Driver			(const CSG_String &Name)	const;
-	class OGRSFDriver *			Get_Driver			(int Index)					const;
-
-	CSG_String					Get_Name			(int Index)					const;
-	CSG_String					Get_Description		(int Index)					const;
-
-	bool						Can_Read			(int Index)					const;
-	bool						Can_Write			(int Index)					const;
-
-	static TSG_Vertex_Type		Get_Vertex_Type		(int Type);
-	static TSG_Shape_Type		Get_Shape_Type		(int Type);
-	static int					Get_Shape_Type		(TSG_Shape_Type Type, bool bZ);
-
-	static TSG_Data_Type		Get_Data_Type		(int            Type);
-	static int					Get_Data_Type		(TSG_Data_Type  Type);
-
-
-private:
-
-	class OGRSFDriverRegistrar	*m_pDrivers;
-
-};
-
-//---------------------------------------------------------
-io_gdal_EXPORT const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_gdal_EXPORT CSG_OGR_DataSource
-{
-public:
-	CSG_OGR_DataSource(void);
-	CSG_OGR_DataSource(const CSG_String &File);
-	CSG_OGR_DataSource(const CSG_String &File, const CSG_String &DriverName);
-	virtual ~CSG_OGR_DataSource(void);
-
-	bool						Create				(const CSG_String &File);
-	bool						Create				(const CSG_String &File, const CSG_String &DriverName);
-	bool						Destroy				(void);
-
-	int							Get_Count			(void);
-	class OGRLayer *			Get_Layer			(int iLayer);
-	TSG_Shape_Type				Get_Type			(int iLayer);
-	TSG_Vertex_Type				Get_Coordinate_Type	(int iLayer);
-
-	CSG_Shapes *				Read				(int iLayer, int iGeomTypeChoice);
-	bool						Write				(CSG_Shapes *pShapes, const CSG_String &DriverName);
-
-
-private:
-
-	class OGRDataSource			*m_pDataSource;
-
-
-	int							_Get_GeomType_Choice(int iGeomTypeChoice);
-
-	bool						_Read_Geometry		(CSG_Shape *pShape, class OGRGeometry *pGeometry);
-	bool						_Read_Line			(CSG_Shape *pShape, class OGRLineString *pLine);
-	bool						_Read_Polygon		(CSG_Shape *pShape, class OGRPolygon *pPolygon);
-
-	bool						_Write_Geometry		(CSG_Shape *pShape, class OGRFeature *pFeature, bool bZ);
-	bool						_Write_Line			(CSG_Shape *pShape, class OGRLineString *pLine, int iPart, bool bZ);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__ogr_driver_H
diff --git a/src/modules_io/gps/Makefile.am b/src/modules_io/gps/Makefile.am
deleted file mode 100644
index 113edd9..0000000
--- a/src/modules_io/gps/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = io_gps
diff --git a/src/modules_io/gps/Makefile.in b/src/modules_io/gps/Makefile.in
deleted file mode 100644
index a2aab3e..0000000
--- a/src/modules_io/gps/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/gps
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = io_gps
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/gps/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/gps/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/gps/io_gps/GPSBabel.cpp b/src/modules_io/gps/io_gps/GPSBabel.cpp
deleted file mode 100644
index 5c99c66..0000000
--- a/src/modules_io/gps/io_gps/GPSBabel.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/**********************************************************
- * Version $Id: GPSBabel.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    GPSBabel.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-#include "GPSBabel.h"
-
-CSG_String	sGPSBabelID[]	=
-{
-	"geo",
-	"gpsman",
-	"gpx",
-	"magellan",
-	"mapsend",
-	"pcx",
-	"mapsource",
-	"gpsutil",
-	"tiger",
-	"csv",
-	"xmap",
-	"dna",
-	"psp",
-	"cetus",
-	"gpspilot",
-	"magnav",
-	"garmin",
-	"mxf",
-	"holux",
-	"ozi",
-	"tpg",
-	"tmpro"
-};
-
-CGPSBabel::CGPSBabel(){
-
-	Parameters.Set_Name(_TL("GPSBabel"));
-
-	Parameters.Set_Description(_TW(
-		"An interface to the GPSBabel software"
-		"(c) 2005 by Victor Olaya\r\nemail: volaya at ya.com"));
-
-	Parameters.Add_FilePath(NULL,
-							"BASEPATH",
-							_TL("GPSBabel path"),
-							_TL("GPSBabel path"),
-							_TL(""),
-							_TL(""),
-							false,
-							true);
-
-	Parameters.Add_FilePath(NULL, 
-							"INPUT", 
-							_TL("Input file"),
-							_TL(""),
-							_TL("All Files|*.*|"));
-
-	Parameters.Add_Choice(NULL, 
-						"FORMATIN", 
-						_TL("Input format"), 
-						_TL(""), 
-						_TW("Geocaching.com .loc|"
-							"GPSman|"
-							"GPX XML|"
-							"Magellan protocol|"
-							"Magellan Mapsend|"
-							"Garmin PCX5|"
-							"Garmin Mapsource|"
-							"gpsutil|"
-							"U.S. Census Bureau Tiger Mapping Service|"
-							"Comma separated values|"
-							"Delorme Topo USA4/XMap Conduit|"
-							"Navitrak DNA marker format|"
-							"MS PocketStreets 2002 Pushpin|"
-							"Cetus for Palm/OS|"
-							"GPSPilot Tracker for Palm/OS|"
-							"Magellan NAV Companion for PalmOS|"
-							"Garmin serial protocol|"
-							"MapTech Exchange Format|"
-							"Holux (gm-100) .wpo Format|"
-							"OziExplorer Waypoint|"
-							"National Geographic Topo .tpg|"
-							"TopoMapPro Places File|"
-						),	0);
-
-	Parameters.Add_FilePath(NULL, 
-							"OUTPUT", 
-							_TL("Output file"),
-							_TL(""),
-							_TL("All Files|*.*|"),
-							_TL(""),
-							true,
-							false);
-
-	Parameters.Add_Choice(NULL, 
-						"FORMATOUT", 
-						_TL("Output format"), 
-						_TL(""), 
-					_TW("Geocaching.com .loc|"
-						"GPSman|"
-						"GPX XML|"
-						"Magellan protocol|"
-						"Magellan Mapsend|"
-						"Garmin PCX5|"
-						"Garmin Mapsource|"
-						"gpsutil|"
-						"U.S. Census Bureau Tiger Mapping Service|"
-						"Comma separated values|"
-						"Delorme Topo USA4/XMap Conduit|"
-						"Navitrak DNA marker format|"
-						"MS PocketStreets 2002 Pushpin|"
-						"Cetus for Palm/OS|"
-						"GPSPilot Tracker for Palm/OS|"
-						"Magellan NAV Companion for PalmOS|"
-						"Garmin serial protocol|"
-						"MapTech Exchange Format|"
-						"Holux (gm-100) .wpo Format|"
-						"OziExplorer Waypoint|"
-						"National Geographic Topo .tpg|"
-						"TopoMapPro Places File|"),
-						0);
-
-}//constructor
-
-CGPSBabel::~CGPSBabel(){
-
-}//destructor
-
-bool CGPSBabel::On_Execute(void){
-
-	CSG_String sCmd;
-	CSG_String sInputFile = Parameters("INPUT")->asString();
-	CSG_String sOutputFile = Parameters("OUTPUT")->asString();
-	CSG_String sBasePath = Parameters("BASEPATH")->asString();
-	int iInputFormat = Parameters("FORMATIN")->asInt();
-	int iOutputFormat = Parameters("FORMATOUT")->asInt();
-
-	sCmd = sBasePath + SG_T("\\") + SG_T("gpsbabel.exe ") 
-			+ SG_T("-i ") + sGPSBabelID[iInputFormat]	+ SG_T(" ")
-			+ SG_T("-f ") + sInputFile					+ SG_T(" ")
-			+ SG_T("-o ") + sGPSBabelID[iOutputFormat]	+ SG_T(" ")
-			+ SG_T("-F ") + sOutputFile					+ SG_T(" ");
-
-	system(sCmd.b_str());
-
-	return true;
-
-}//method
\ No newline at end of file
diff --git a/src/modules_io/gps/io_gps/GPSBabel.h b/src/modules_io/gps/io_gps/GPSBabel.h
deleted file mode 100644
index 1ada69e..0000000
--- a/src/modules_io/gps/io_gps/GPSBabel.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**********************************************************
- * Version $Id: GPSBabel.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    GPSBabel.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CGPSBabel : public CSG_Module {
-
-public:
-	CGPSBabel(void);
-	virtual ~CGPSBabel(void);
-
-protected:
-	virtual bool On_Execute(void);
-
-};
-
diff --git a/src/modules_io/gps/io_gps/Makefile.in b/src/modules_io/gps/io_gps/Makefile.in
deleted file mode 100644
index f736591..0000000
--- a/src/modules_io/gps/io_gps/Makefile.in
+++ /dev/null
@@ -1,580 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/gps/io_gps
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_gps_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_gps_la_OBJECTS = GPSBabel.lo gpx2shp.lo MLB_Interface.lo
-libio_gps_la_OBJECTS = $(am_libio_gps_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_gps_la_SOURCES)
-DIST_SOURCES = $(libio_gps_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libio_gps.la
-libio_gps_la_SOURCES = \
-GPSBabel.cpp\
-gpx2shp.cpp\
-MLB_Interface.cpp\
-GPSBabel.h\
-gpx2shp.h\
-MLB_Interface.h
-
-libio_gps_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/gps/io_gps/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/gps/io_gps/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_gps.la: $(libio_gps_la_OBJECTS) $(libio_gps_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_gps_la_OBJECTS) $(libio_gps_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GPSBabel.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gpx2shp.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/gps/io_gps/gpx2shp.cpp b/src/modules_io/gps/io_gps/gpx2shp.cpp
deleted file mode 100644
index dd5586c..0000000
--- a/src/modules_io/gps/io_gps/gpx2shp.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/**********************************************************
- * Version $Id: gpx2shp.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    GPX2SHP.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-#include "gpx2shp.h"
-
-CGPX2SHP::CGPX2SHP(){
-				   
-	Parameters.Set_Name(_TL("GPX to shapefile"));
-
-	Parameters.Set_Description(_TW(
-		"Converts a GPX file into a Shapefile (.shp)"
-		"(c) 2005 by Victor Olaya\r\nemail: volaya at ya.com")
-	);
-
-	Parameters.Add_FilePath(NULL,
-							"BASEPATH",
-							_TL("Gpx2shp path"),
-							_TL("Gpx2shp path"),
-							_TL(""),
-							_TL(""),
-							false,
-							true);
-
-	Parameters.Add_FilePath(NULL, 
-							"FILE", 
-							_TL("GPX file"),
-							_TL(""),
-							_TL("GPX files (*.gpx)|*.gpx|All Files|*.*")
-	);
-	
-	Parameters.Add_Value(NULL,
-						"TRACKPOINTS", 
-						_TL("Convert track points"),
-						_TL("Convert track points"),
-						PARAMETER_TYPE_Bool,
-						true);
-	
-	Parameters.Add_Value(NULL,
-						"WAYPOINTS", 
-						_TL("Convert way points"),
-						_TL("Convert way points"),
-						PARAMETER_TYPE_Bool,
-						true);
-
-	Parameters.Add_Value(NULL,
-						"ROUTES", 
-						_TL("Convert routes"),
-						_TL("Convert routes"),
-						PARAMETER_TYPE_Bool,
-						true);
-	
-	Parameters.Add_Value(NULL,
-						"ADD", 
-						_TL("Load shapefile"),
-						_TL("Load shapefile after conversion"),
-						PARAMETER_TYPE_Bool,
-						true);
-
-}//constructor
-
-CGPX2SHP::~CGPX2SHP(){
-
-}//destructor
-
-bool CGPX2SHP::On_Execute(void){
-
-	CSG_String sCmd;
-	CSG_String sFile = Parameters("FILE")->asString();
-	CSG_String sBasePath = Parameters("BASEPATH")->asString();
-	CSG_String sShapefile;
-	bool bWaypoints = Parameters("WAYPOINTS")->asBool();
-	bool bTrackpoints = Parameters("TRACKPOINTS")->asBool();
-	bool bRoutes = Parameters("ROUTES")->asBool();
-	bool bAdd = Parameters("ADD")->asBool();
-	CSG_Shapes *pShapes;
-
-	sCmd = sBasePath + SG_T("\\gpx2shp ");
-
-	if (bWaypoints){
-		sCmd += SG_T("-w ");
-	}//if
-	if (bTrackpoints){
-		sCmd += SG_T("-t ");
-	}//if
-	if (bRoutes){
-		sCmd += SG_T("-r ");
-	}//if
-	
-	sCmd += sFile;
-
-	system(sCmd.b_str());
-
-	if( bAdd )
-	{
-		CSG_String	sDir(SG_File_Get_Path(sFile)), sName(SG_File_Get_Name(sFile, false));
-
-		//-------------------------------------------------
-		sFile	= SG_File_Make_Path(sDir, sName + SG_T("_wpt"), SG_T("shp"));
-		pShapes	= SG_Create_Shapes(sFile);
-
-		if( pShapes->is_Valid() )
-			DataObject_Add(pShapes, false);
-		else
-			delete(pShapes);
-
-		//-------------------------------------------------
-		sFile	= SG_File_Make_Path(sDir, sName + SG_T("_trk"), SG_T("shp"));
-		pShapes	= SG_Create_Shapes(sFile);
-
-		if( pShapes->is_Valid() )
-			DataObject_Add(pShapes, false);
-		else
-			delete(pShapes);
-
-		//-------------------------------------------------
-		sFile	= SG_File_Make_Path(sDir, sName + SG_T("_rte"), SG_T("shp"));
-		pShapes	= SG_Create_Shapes(sFile);
-
-		if( pShapes->is_Valid() )
-			DataObject_Add(pShapes, false);
-		else
-			delete(pShapes);
-	}//if
-	
-	return true;
-
-}//method
\ No newline at end of file
diff --git a/src/modules_io/gps/io_gps/gpx2shp.h b/src/modules_io/gps/io_gps/gpx2shp.h
deleted file mode 100644
index c8adebd..0000000
--- a/src/modules_io/gps/io_gps/gpx2shp.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**********************************************************
- * Version $Id: gpx2shp.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    GPX2SHP.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CGPX2SHP : public CSG_Module {
-
-public:
-	CGPX2SHP(void);
-	virtual ~CGPX2SHP(void);
-
-protected:
-	virtual bool On_Execute(void);
-
-};
-
diff --git a/src/modules_io/grid/Makefile.am b/src/modules_io/grid/Makefile.am
deleted file mode 100644
index 4285266..0000000
--- a/src/modules_io/grid/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-if WITH_GUI
-SUBDIRS = io_grid_image io_grid io_grid_grib2
-else
-SUBDIRS = io_grid io_grid_grib2
-endif
diff --git a/src/modules_io/grid/Makefile.in b/src/modules_io/grid/Makefile.in
deleted file mode 100644
index c4631d7..0000000
--- a/src/modules_io/grid/Makefile.in
+++ /dev/null
@@ -1,590 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/grid
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = io_grid io_grid_grib2 io_grid_image
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at WITH_GUI_FALSE@SUBDIRS = io_grid io_grid_grib2
- at WITH_GUI_TRUE@SUBDIRS = io_grid_image io_grid io_grid_grib2
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/grid/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/grid/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/grid/io_grid/Makefile.in b/src/modules_io/grid/io_grid/Makefile.in
deleted file mode 100644
index 550b026..0000000
--- a/src/modules_io/grid/io_grid/Makefile.in
+++ /dev/null
@@ -1,609 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/grid/io_grid
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_grid_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_grid_la_OBJECTS = bmp_export.lo erdas_lan.lo esri_arcinfo.lo \
-	grid_table.lo MLB_Interface.lo mola.lo raw.lo srtm30.lo \
-	surfer.lo usgs_srtm.lo wrf.lo xyz.lo
-libio_grid_la_OBJECTS = $(am_libio_grid_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_grid_la_SOURCES)
-DIST_SOURCES = $(libio_grid_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libio_grid.la
-libio_grid_la_SOURCES = \
-bmp_export.cpp\
-erdas_lan.cpp\
-esri_arcinfo.cpp\
-grid_table.cpp\
-MLB_Interface.cpp\
-mola.cpp\
-raw.cpp\
-srtm30.cpp\
-surfer.cpp\
-usgs_srtm.cpp\
-wrf.cpp\
-xyz.cpp\
-bmp_export.h\
-erdas_lan.h\
-esri_arcinfo.h\
-grid_table.h\
-MLB_Interface.h\
-mola.h\
-raw.h\
-srtm30.h\
-surfer.h\
-usgs_srtm.h\
-wrf.h\
-xyz.h
-
-libio_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/grid/io_grid/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/grid/io_grid/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_grid.la: $(libio_grid_la_OBJECTS) $(libio_grid_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_grid_la_OBJECTS) $(libio_grid_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bmp_export.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/erdas_lan.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/esri_arcinfo.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_table.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mola.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/raw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/srtm30.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/surfer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/usgs_srtm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wrf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xyz.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/grid/io_grid/xyz.cpp b/src/modules_io/grid/io_grid/xyz.cpp
deleted file mode 100644
index 9b6dc3b..0000000
--- a/src/modules_io/grid/io_grid/xyz.cpp
+++ /dev/null
@@ -1,385 +0,0 @@
-/**********************************************************
- * Version $Id: xyz.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        Grid_IO                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                        XYZ.cpp                        //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "xyz.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CXYZ_Export::CXYZ_Export(void)
-{
-	//-----------------------------------------------------
-	// 1. Info...
-
-	Set_Name		(_TL("Export Grid to XYZ"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2003"));
-
-	Set_Description	(_TW(
-		"Export grid to a table (text format), that contains for each grid cell "
-		"the x/y-coordinates and additionally data from selected grids.\n"
-		"Optionally, it is possible to skip NoData cells from the output. In this "
-		"case, the first input grid will perform like a mask.\n\n")
-	);
-
-
-	//-----------------------------------------------------
-	// 2. Parameters...
-
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"		, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_FilePath(
-		NULL	, "FILENAME"	, _TL("File Name"),
-		_TL(""),
-		CSG_String::Format(
-			SG_T("%s|*.xyz|%s|*.txt|%s|*.*"),
-			_TL("XYZ files (*.xyz)"),
-			_TL("Text files (*.txt)"),
-			_TL("All Files")
-		), NULL, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CAPTION"		, _TL("Write Field Names"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "EX_NODATA"	, _TL("Exclude NoData Cells"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-//---------------------------------------------------------
-bool CXYZ_Export::On_Execute(void)
-{
-	bool					bExNoData;
-	int						x, y, i;
-	TSG_Point				p;
-	CSG_File				Stream;
-	CSG_String				FileName;
-	CSG_Parameter_Grid_List	*pGrids;
-
-	pGrids		= Parameters("GRIDS")	->asGridList();
-	FileName	= Parameters("FILENAME")->asString();
-	bExNoData	= Parameters("EX_NODATA")->asBool();
-
-	if( pGrids->Get_Count() > 0 && Stream.Open(FileName, SG_FILE_W, false) )
-	{
-		if( Parameters("CAPTION")->asBool() )
-		{
-			Stream.Printf(SG_T("\"X\"\t\"Y\""));
-
-			for(i=0; i<pGrids->Get_Count(); i++)
-			{
-				Stream.Printf(SG_T("\t\"%s\""), pGrids->asGrid(i)->Get_Name());
-			}
-
-			Stream.Printf(SG_T("\n"));
-		}
-
-		for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
-		{
-			for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
-			{
-				if( !bExNoData || (bExNoData && !pGrids->asGrid(0)->is_NoData(x, y)) )
-				{
-					Stream.Printf(SG_T("%f\t%f"), p.x,  p.y);
-
-					for(i=0; i<pGrids->Get_Count(); i++)
-					{
-						Stream.Printf(SG_T("\t%f"), pGrids->asGrid(i)->asDouble(x, y));
-					}
-
-					Stream.Printf(SG_T("\n"));
-				}
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CXYZ_Import::CXYZ_Import(void)
-{
-	//-----------------------------------------------------
-	// 1. Info...
-
-	Set_Name		(_TL("Import Grid from XYZ"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2009"));
-
-	Set_Description	(_TW(
-		"Import grid from a table (text format), that contains for each grid cell "
-		"the x/y/z-coordinates and additional data from selected grids.\n"
-	));
-
-
-	//-----------------------------------------------------
-	// 2. Parameters...
-
-	Parameters.Add_Grid_Output(
-		NULL	, "GRID"		, _TL("Grid"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "COUNT"		, _TL("Count"),
-		_TL("")
-	);
-
-	Parameters.Add_FilePath(
-		NULL	, "FILENAME"	, _TL("File Name"),
-		_TL(""),
-		CSG_String::Format(
-			SG_T("%s|*.xyz|%s|*.txt|%s|*.*"),
-			_TL("XYZ files (*.xyz)"),
-			_TL("Text files (*.txt)"),
-			_TL("All Files")
-		), NULL, false
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CAPTION"		, _TL("Has Field Names"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CELLSIZE"	, _TL("Target Cellsize"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "SEPARATOR"	, _TL("Separator"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|,|;|"),
-			_TL("space"),
-			_TL("tabulator")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-bool CXYZ_Import::On_Execute(void)
-{
-	int			nx, ny, nValues, fLength;
-	double		x, y, z, xMin, yMin, xMax, yMax, Cellsize;
-	CSG_File	Stream;
-	CSG_String	FileName, sLine;
-	CSG_Grid	*pGrid, *pCount;
-
-	FileName	= Parameters("FILENAME")->asString();
-	Cellsize	= Parameters("CELLSIZE")->asDouble();
-
-	switch( Parameters("SEPARATOR")->asInt() )
-	{
-	case 0:	m_Separator	= SG_T(' ');	break;
-	case 1:	m_Separator	= SG_T('\t');	break;
-	case 2:	m_Separator	= SG_T(',');	break;
-	case 3:	m_Separator	= SG_T(';');	break;
-	}
-
-	if( Cellsize > 0.0 && Stream.Open(FileName, SG_FILE_R, false) )
-	{
-		if( Parameters("CAPTION")->asBool() )
-		{
-			Stream.Read_Line(sLine);
-		}
-
-		fLength	= Stream.Length();
-		nValues	= 0;
-		xMin	= xMax	= 0;
-		yMin	= yMax	= 0;
-
-		while( Read_Values(Stream, x, y, z) && Set_Progress(Stream.Tell(), fLength) )
-		{
-			if( nValues == 0 )
-			{
-				xMin	= xMax	= x;
-				yMin	= yMax	= y;
-			}
-			else
-			{
-				if( xMin > x )	xMin	= x;	else if( xMax < x )	xMax	= x;
-				if( yMin > y )	yMin	= y;	else if( yMax < y )	yMax	= y;
-			}
-
-			nValues++;
-		}
-
-		//-------------------------------------------------
-		if( Process_Get_Okay() && xMin < xMax && yMin < yMax )
-		{
-			nx		= 1 + (int)((xMax - xMin) / Cellsize);
-			ny		= 1 + (int)((yMax - yMin) / Cellsize);
-
-			Parameters("GRID" )->Set_Value(pGrid  = SG_Create_Grid(SG_DATATYPE_Float, nx, ny, Cellsize, xMin, yMin));
-			Parameters("COUNT")->Set_Value(pCount = SG_Create_Grid(SG_DATATYPE_Byte , nx, ny, Cellsize, xMin, yMin));
-
-			if( pGrid && pCount )
-			{
-				pGrid	->Set_Name(FileName = SG_File_Get_Name(FileName, false));
-				pCount	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), FileName.c_str(), _TL("Count")));
-
-				Stream.Seek_Start();
-
-				if( Parameters("CAPTION")->asBool() )
-				{
-					Stream.Read_Line(sLine);
-				}
-
-				while( Read_Values(Stream, x, y, z) && Set_Progress(Stream.Tell(), fLength) )
-				{
-					if( pGrid->Get_System().Get_World_to_Grid(nx, ny, x, y) )
-					{
-						pGrid ->Add_Value(nx, ny, z);
-						pCount->Add_Value(nx, ny, 1.0);
-					}
-				}
-
-				for(ny=0; ny<pGrid->Get_NY() && Set_Progress(ny, pGrid->Get_NY()); ny++)
-				{
-					for(nx=0; nx<pGrid->Get_NX(); nx++)
-					{
-						nValues	= pCount->asInt(nx, ny);
-
-						if( nValues == 0 )
-						{
-							pGrid->Set_NoData(nx, ny);
-						}
-						else if( nValues > 1 )
-						{
-							pGrid->Mul_Value(nx, ny, 1.0 / nValues);
-						}
-					}
-				}
-
-				return( true );
-			}
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline bool CXYZ_Import::Read_Values(CSG_File &Stream, double &x, double &y, double &z)
-{
-	CSG_String	sLine;
-
-	if( Stream.Read_Line(sLine) )
-	{
-		sLine.Trim();
-
-		if( sLine.asDouble(x) )
-		{
-			sLine	= sLine.AfterFirst(m_Separator);
-
-			sLine.Trim();
-
-			if( sLine.asDouble(y) )
-			{
-				sLine	= sLine.AfterFirst(m_Separator);
-
-				if( sLine.asDouble(z) )
-				{
-					return( true );
-				}
-			}
-		}
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/grid/io_grid/xyz.h b/src/modules_io/grid/io_grid/xyz.h
deleted file mode 100644
index ffbd194..0000000
--- a/src/modules_io/grid/io_grid/xyz.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/**********************************************************
- * Version $Id: xyz.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                        Grid_IO                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                         XYZ.h                         //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__XYZ_H
-#define HEADER_INCLUDED__XYZ_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CXYZ_Export : public CSG_Module_Grid
-{
-public:
-	CXYZ_Export(void);
-
-	virtual CSG_String		Get_MenuPath	(void)			{	return( _TL("R:Export") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CXYZ_Import : public CSG_Module
-{
-public:
-	CXYZ_Import(void);
-
-	virtual CSG_String		Get_MenuPath	(void)			{	return( _TL("R:Import") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	SG_Char					m_Separator;
-
-
-	bool					Read_Values		(CSG_File &Stream, double &x, double &y, double &z);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__XYZ_H
diff --git a/src/modules_io/grid/io_grid_grib2/Makefile.in b/src/modules_io/grid/io_grid_grib2/Makefile.in
deleted file mode 100644
index d6a6010..0000000
--- a/src/modules_io/grid/io_grid_grib2/Makefile.in
+++ /dev/null
@@ -1,1009 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/grid/io_grid_grib2
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_grid_grib2_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_grid_grib2_la_OBJECTS = cmplxpack.lo compack.lo comunpack.lo \
-	dec_jpeg2000.lo dec_png.lo drstemplates.lo enc_jpeg2000.lo \
-	enc_png.lo g2_addfield.lo g2_addgrid.lo g2_addlocal.lo \
-	g2_create.lo g2_free.lo g2_getfld.lo g2_gribend.lo g2_info.lo \
-	g2_miss.lo g2_unpack1.lo g2_unpack2.lo g2_unpack3.lo \
-	g2_unpack4.lo g2_unpack5.lo g2_unpack6.lo g2_unpack7.lo \
-	gbits.lo getdim.lo getpoly.lo gridtemplates.lo int_power.lo \
-	jpcpack.lo jpcunpack.lo misspack.lo mkieee.lo pack_gp.lo \
-	pdstemplates.lo pngpack.lo pngunpack.lo rdieee.lo reduce.lo \
-	seekgb.lo simpack.lo simunpack.lo specpack.lo specunpack.lo \
-	grib2_import.lo MLB_Interface.lo
-libio_grid_grib2_la_OBJECTS = $(am_libio_grid_grib2_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_grid_grib2_la_SOURCES)
-DIST_SOURCES = $(libio_grid_grib2_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DUSE_JPEG2000 -DUSE_PNG
-CXX_INCS = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS)
-AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-#AM_LDFLAGS         = -fPIC -shared -avoid-version -lpq -ljasper
-AM_LDFLAGS = -fPIC -shared -avoid-version $(LOCAL_LIBS) -ljasper
-pkglib_LTLIBRARIES = libio_grid_grib2.la
-libio_grid_grib2_la_SOURCES = \
-./g2clib-1.0.4/cmplxpack.c\
-./g2clib-1.0.4/compack.c\
-./g2clib-1.0.4/comunpack.c\
-./g2clib-1.0.4/dec_jpeg2000.c\
-./g2clib-1.0.4/dec_png.c\
-./g2clib-1.0.4/drstemplates.c\
-./g2clib-1.0.4/enc_jpeg2000.c\
-./g2clib-1.0.4/enc_png.c\
-./g2clib-1.0.4/g2_addfield.c\
-./g2clib-1.0.4/g2_addgrid.c\
-./g2clib-1.0.4/g2_addlocal.c\
-./g2clib-1.0.4/g2_create.c\
-./g2clib-1.0.4/g2_free.c\
-./g2clib-1.0.4/g2_getfld.c\
-./g2clib-1.0.4/g2_gribend.c\
-./g2clib-1.0.4/g2_info.c\
-./g2clib-1.0.4/g2_miss.c\
-./g2clib-1.0.4/g2_unpack1.c\
-./g2clib-1.0.4/g2_unpack2.c\
-./g2clib-1.0.4/g2_unpack3.c\
-./g2clib-1.0.4/g2_unpack4.c\
-./g2clib-1.0.4/g2_unpack5.c\
-./g2clib-1.0.4/g2_unpack6.c\
-./g2clib-1.0.4/g2_unpack7.c\
-./g2clib-1.0.4/gbits.c\
-./g2clib-1.0.4/getdim.c\
-./g2clib-1.0.4/getpoly.c\
-./g2clib-1.0.4/gridtemplates.c\
-./g2clib-1.0.4/int_power.c\
-./g2clib-1.0.4/jpcpack.c\
-./g2clib-1.0.4/jpcunpack.c\
-./g2clib-1.0.4/misspack.c\
-./g2clib-1.0.4/mkieee.c\
-./g2clib-1.0.4/pack_gp.c\
-./g2clib-1.0.4/pdstemplates.c\
-./g2clib-1.0.4/pngpack.c\
-./g2clib-1.0.4/pngunpack.c\
-./g2clib-1.0.4/rdieee.c\
-./g2clib-1.0.4/reduce.c\
-./g2clib-1.0.4/seekgb.c\
-./g2clib-1.0.4/simpack.c\
-./g2clib-1.0.4/simunpack.c\
-./g2clib-1.0.4/specpack.c\
-./g2clib-1.0.4/specunpack.c\
-./g2clib-1.0.4/drstemplates.h\
-./g2clib-1.0.4/grib2.h\
-./g2clib-1.0.4/gridtemplates.h\
-./g2clib-1.0.4/pdstemplates.h\
-grib2_import.cpp\
-MLB_Interface.cpp\
-grib2_import.h\
-MLB_Interface.h
-
-libio_grid_grib2_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/grid/io_grid_grib2/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/grid/io_grid_grib2/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_grid_grib2.la: $(libio_grid_grib2_la_OBJECTS) $(libio_grid_grib2_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_grid_grib2_la_OBJECTS) $(libio_grid_grib2_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cmplxpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/compack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/comunpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dec_jpeg2000.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dec_png.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/drstemplates.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/enc_jpeg2000.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/enc_png.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_addfield.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_addgrid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_addlocal.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_create.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_free.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_getfld.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_gribend.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_info.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_miss.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack1.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack3.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack4.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack5.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack6.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/g2_unpack7.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gbits.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getdim.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getpoly.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grib2_import.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gridtemplates.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/int_power.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jpcpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jpcunpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/misspack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mkieee.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pack_gp.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pdstemplates.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pngpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pngunpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rdieee.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/reduce.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seekgb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/simpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/simunpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/specpack.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/specunpack.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
-
-cmplxpack.lo: ./g2clib-1.0.4/cmplxpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmplxpack.lo -MD -MP -MF $(DEPDIR)/cmplxpack.Tpo -c -o cmplxpack.lo `test -f './g2clib-1.0.4/cmplxpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/cmplxpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cmplxpack.Tpo $(DEPDIR)/cmplxpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/cmplxpack.c' object='cmplxpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cmplxpack.lo `test -f './g2clib-1.0.4/cmplxpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/cmplxpack.c
-
-compack.lo: ./g2clib-1.0.4/compack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compack.lo -MD -MP -MF $(DEPDIR)/compack.Tpo -c -o compack.lo `test -f './g2clib-1.0.4/compack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/compack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/compack.Tpo $(DEPDIR)/compack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/compack.c' object='compack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compack.lo `test -f './g2clib-1.0.4/compack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/compack.c
-
-comunpack.lo: ./g2clib-1.0.4/comunpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT comunpack.lo -MD -MP -MF $(DEPDIR)/comunpack.Tpo -c -o comunpack.lo `test -f './g2clib-1.0.4/comunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/comunpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/comunpack.Tpo $(DEPDIR)/comunpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/comunpack.c' object='comunpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o comunpack.lo `test -f './g2clib-1.0.4/comunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/comunpack.c
-
-dec_jpeg2000.lo: ./g2clib-1.0.4/dec_jpeg2000.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_jpeg2000.lo -MD -MP -MF $(DEPDIR)/dec_jpeg2000.Tpo -c -o dec_jpeg2000.lo `test -f './g2clib-1.0.4/dec_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_jpeg2000.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dec_jpeg2000.Tpo $(DEPDIR)/dec_jpeg2000.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/dec_jpeg2000.c' object='dec_jpeg2000.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_jpeg2000.lo `test -f './g2clib-1.0.4/dec_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_jpeg2000.c
-
-dec_png.lo: ./g2clib-1.0.4/dec_png.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_png.lo -MD -MP -MF $(DEPDIR)/dec_png.Tpo -c -o dec_png.lo `test -f './g2clib-1.0.4/dec_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_png.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dec_png.Tpo $(DEPDIR)/dec_png.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/dec_png.c' object='dec_png.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_png.lo `test -f './g2clib-1.0.4/dec_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_png.c
-
-drstemplates.lo: ./g2clib-1.0.4/drstemplates.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT drstemplates.lo -MD -MP -MF $(DEPDIR)/drstemplates.Tpo -c -o drstemplates.lo `test -f './g2clib-1.0.4/drstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/drstemplates.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/drstemplates.Tpo $(DEPDIR)/drstemplates.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/drstemplates.c' object='drstemplates.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drstemplates.lo `test -f './g2clib-1.0.4/drstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/drstemplates.c
-
-enc_jpeg2000.lo: ./g2clib-1.0.4/enc_jpeg2000.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_jpeg2000.lo -MD -MP -MF $(DEPDIR)/enc_jpeg2000.Tpo -c -o enc_jpeg2000.lo `test -f './g2clib-1.0.4/enc_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_jpeg2000.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/enc_jpeg2000.Tpo $(DEPDIR)/enc_jpeg2000.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/enc_jpeg2000.c' object='enc_jpeg2000.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_jpeg2000.lo `test -f './g2clib-1.0.4/enc_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_jpeg2000.c
-
-enc_png.lo: ./g2clib-1.0.4/enc_png.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_png.lo -MD -MP -MF $(DEPDIR)/enc_png.Tpo -c -o enc_png.lo `test -f './g2clib-1.0.4/enc_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_png.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/enc_png.Tpo $(DEPDIR)/enc_png.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/enc_png.c' object='enc_png.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_png.lo `test -f './g2clib-1.0.4/enc_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_png.c
-
-g2_addfield.lo: ./g2clib-1.0.4/g2_addfield.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addfield.lo -MD -MP -MF $(DEPDIR)/g2_addfield.Tpo -c -o g2_addfield.lo `test -f './g2clib-1.0.4/g2_addfield.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addfield.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_addfield.Tpo $(DEPDIR)/g2_addfield.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_addfield.c' object='g2_addfield.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addfield.lo `test -f './g2clib-1.0.4/g2_addfield.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addfield.c
-
-g2_addgrid.lo: ./g2clib-1.0.4/g2_addgrid.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addgrid.lo -MD -MP -MF $(DEPDIR)/g2_addgrid.Tpo -c -o g2_addgrid.lo `test -f './g2clib-1.0.4/g2_addgrid.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addgrid.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_addgrid.Tpo $(DEPDIR)/g2_addgrid.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_addgrid.c' object='g2_addgrid.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addgrid.lo `test -f './g2clib-1.0.4/g2_addgrid.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addgrid.c
-
-g2_addlocal.lo: ./g2clib-1.0.4/g2_addlocal.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addlocal.lo -MD -MP -MF $(DEPDIR)/g2_addlocal.Tpo -c -o g2_addlocal.lo `test -f './g2clib-1.0.4/g2_addlocal.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addlocal.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_addlocal.Tpo $(DEPDIR)/g2_addlocal.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_addlocal.c' object='g2_addlocal.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addlocal.lo `test -f './g2clib-1.0.4/g2_addlocal.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addlocal.c
-
-g2_create.lo: ./g2clib-1.0.4/g2_create.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_create.lo -MD -MP -MF $(DEPDIR)/g2_create.Tpo -c -o g2_create.lo `test -f './g2clib-1.0.4/g2_create.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_create.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_create.Tpo $(DEPDIR)/g2_create.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_create.c' object='g2_create.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_create.lo `test -f './g2clib-1.0.4/g2_create.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_create.c
-
-g2_free.lo: ./g2clib-1.0.4/g2_free.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_free.lo -MD -MP -MF $(DEPDIR)/g2_free.Tpo -c -o g2_free.lo `test -f './g2clib-1.0.4/g2_free.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_free.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_free.Tpo $(DEPDIR)/g2_free.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_free.c' object='g2_free.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_free.lo `test -f './g2clib-1.0.4/g2_free.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_free.c
-
-g2_getfld.lo: ./g2clib-1.0.4/g2_getfld.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_getfld.lo -MD -MP -MF $(DEPDIR)/g2_getfld.Tpo -c -o g2_getfld.lo `test -f './g2clib-1.0.4/g2_getfld.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_getfld.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_getfld.Tpo $(DEPDIR)/g2_getfld.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_getfld.c' object='g2_getfld.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_getfld.lo `test -f './g2clib-1.0.4/g2_getfld.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_getfld.c
-
-g2_gribend.lo: ./g2clib-1.0.4/g2_gribend.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_gribend.lo -MD -MP -MF $(DEPDIR)/g2_gribend.Tpo -c -o g2_gribend.lo `test -f './g2clib-1.0.4/g2_gribend.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_gribend.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_gribend.Tpo $(DEPDIR)/g2_gribend.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_gribend.c' object='g2_gribend.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_gribend.lo `test -f './g2clib-1.0.4/g2_gribend.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_gribend.c
-
-g2_info.lo: ./g2clib-1.0.4/g2_info.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_info.lo -MD -MP -MF $(DEPDIR)/g2_info.Tpo -c -o g2_info.lo `test -f './g2clib-1.0.4/g2_info.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_info.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_info.Tpo $(DEPDIR)/g2_info.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_info.c' object='g2_info.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_info.lo `test -f './g2clib-1.0.4/g2_info.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_info.c
-
-g2_miss.lo: ./g2clib-1.0.4/g2_miss.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_miss.lo -MD -MP -MF $(DEPDIR)/g2_miss.Tpo -c -o g2_miss.lo `test -f './g2clib-1.0.4/g2_miss.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_miss.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_miss.Tpo $(DEPDIR)/g2_miss.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_miss.c' object='g2_miss.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_miss.lo `test -f './g2clib-1.0.4/g2_miss.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_miss.c
-
-g2_unpack1.lo: ./g2clib-1.0.4/g2_unpack1.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack1.lo -MD -MP -MF $(DEPDIR)/g2_unpack1.Tpo -c -o g2_unpack1.lo `test -f './g2clib-1.0.4/g2_unpack1.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack1.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack1.Tpo $(DEPDIR)/g2_unpack1.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack1.c' object='g2_unpack1.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack1.lo `test -f './g2clib-1.0.4/g2_unpack1.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack1.c
-
-g2_unpack2.lo: ./g2clib-1.0.4/g2_unpack2.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack2.lo -MD -MP -MF $(DEPDIR)/g2_unpack2.Tpo -c -o g2_unpack2.lo `test -f './g2clib-1.0.4/g2_unpack2.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack2.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack2.Tpo $(DEPDIR)/g2_unpack2.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack2.c' object='g2_unpack2.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack2.lo `test -f './g2clib-1.0.4/g2_unpack2.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack2.c
-
-g2_unpack3.lo: ./g2clib-1.0.4/g2_unpack3.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack3.lo -MD -MP -MF $(DEPDIR)/g2_unpack3.Tpo -c -o g2_unpack3.lo `test -f './g2clib-1.0.4/g2_unpack3.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack3.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack3.Tpo $(DEPDIR)/g2_unpack3.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack3.c' object='g2_unpack3.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack3.lo `test -f './g2clib-1.0.4/g2_unpack3.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack3.c
-
-g2_unpack4.lo: ./g2clib-1.0.4/g2_unpack4.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack4.lo -MD -MP -MF $(DEPDIR)/g2_unpack4.Tpo -c -o g2_unpack4.lo `test -f './g2clib-1.0.4/g2_unpack4.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack4.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack4.Tpo $(DEPDIR)/g2_unpack4.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack4.c' object='g2_unpack4.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack4.lo `test -f './g2clib-1.0.4/g2_unpack4.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack4.c
-
-g2_unpack5.lo: ./g2clib-1.0.4/g2_unpack5.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack5.lo -MD -MP -MF $(DEPDIR)/g2_unpack5.Tpo -c -o g2_unpack5.lo `test -f './g2clib-1.0.4/g2_unpack5.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack5.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack5.Tpo $(DEPDIR)/g2_unpack5.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack5.c' object='g2_unpack5.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack5.lo `test -f './g2clib-1.0.4/g2_unpack5.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack5.c
-
-g2_unpack6.lo: ./g2clib-1.0.4/g2_unpack6.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack6.lo -MD -MP -MF $(DEPDIR)/g2_unpack6.Tpo -c -o g2_unpack6.lo `test -f './g2clib-1.0.4/g2_unpack6.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack6.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack6.Tpo $(DEPDIR)/g2_unpack6.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack6.c' object='g2_unpack6.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack6.lo `test -f './g2clib-1.0.4/g2_unpack6.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack6.c
-
-g2_unpack7.lo: ./g2clib-1.0.4/g2_unpack7.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack7.lo -MD -MP -MF $(DEPDIR)/g2_unpack7.Tpo -c -o g2_unpack7.lo `test -f './g2clib-1.0.4/g2_unpack7.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack7.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/g2_unpack7.Tpo $(DEPDIR)/g2_unpack7.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/g2_unpack7.c' object='g2_unpack7.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack7.lo `test -f './g2clib-1.0.4/g2_unpack7.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack7.c
-
-gbits.lo: ./g2clib-1.0.4/gbits.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gbits.lo -MD -MP -MF $(DEPDIR)/gbits.Tpo -c -o gbits.lo `test -f './g2clib-1.0.4/gbits.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gbits.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/gbits.Tpo $(DEPDIR)/gbits.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/gbits.c' object='gbits.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gbits.lo `test -f './g2clib-1.0.4/gbits.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gbits.c
-
-getdim.lo: ./g2clib-1.0.4/getdim.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getdim.lo -MD -MP -MF $(DEPDIR)/getdim.Tpo -c -o getdim.lo `test -f './g2clib-1.0.4/getdim.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getdim.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/getdim.Tpo $(DEPDIR)/getdim.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/getdim.c' object='getdim.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getdim.lo `test -f './g2clib-1.0.4/getdim.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getdim.c
-
-getpoly.lo: ./g2clib-1.0.4/getpoly.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getpoly.lo -MD -MP -MF $(DEPDIR)/getpoly.Tpo -c -o getpoly.lo `test -f './g2clib-1.0.4/getpoly.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getpoly.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/getpoly.Tpo $(DEPDIR)/getpoly.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/getpoly.c' object='getpoly.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getpoly.lo `test -f './g2clib-1.0.4/getpoly.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getpoly.c
-
-gridtemplates.lo: ./g2clib-1.0.4/gridtemplates.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gridtemplates.lo -MD -MP -MF $(DEPDIR)/gridtemplates.Tpo -c -o gridtemplates.lo `test -f './g2clib-1.0.4/gridtemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gridtemplates.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/gridtemplates.Tpo $(DEPDIR)/gridtemplates.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/gridtemplates.c' object='gridtemplates.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gridtemplates.lo `test -f './g2clib-1.0.4/gridtemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gridtemplates.c
-
-int_power.lo: ./g2clib-1.0.4/int_power.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT int_power.lo -MD -MP -MF $(DEPDIR)/int_power.Tpo -c -o int_power.lo `test -f './g2clib-1.0.4/int_power.c' || echo '$(srcdir)/'`./g2clib-1.0.4/int_power.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/int_power.Tpo $(DEPDIR)/int_power.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/int_power.c' object='int_power.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o int_power.lo `test -f './g2clib-1.0.4/int_power.c' || echo '$(srcdir)/'`./g2clib-1.0.4/int_power.c
-
-jpcpack.lo: ./g2clib-1.0.4/jpcpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT jpcpack.lo -MD -MP -MF $(DEPDIR)/jpcpack.Tpo -c -o jpcpack.lo `test -f './g2clib-1.0.4/jpcpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/jpcpack.Tpo $(DEPDIR)/jpcpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/jpcpack.c' object='jpcpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o jpcpack.lo `test -f './g2clib-1.0.4/jpcpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcpack.c
-
-jpcunpack.lo: ./g2clib-1.0.4/jpcunpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT jpcunpack.lo -MD -MP -MF $(DEPDIR)/jpcunpack.Tpo -c -o jpcunpack.lo `test -f './g2clib-1.0.4/jpcunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcunpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/jpcunpack.Tpo $(DEPDIR)/jpcunpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/jpcunpack.c' object='jpcunpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o jpcunpack.lo `test -f './g2clib-1.0.4/jpcunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcunpack.c
-
-misspack.lo: ./g2clib-1.0.4/misspack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misspack.lo -MD -MP -MF $(DEPDIR)/misspack.Tpo -c -o misspack.lo `test -f './g2clib-1.0.4/misspack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/misspack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/misspack.Tpo $(DEPDIR)/misspack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/misspack.c' object='misspack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misspack.lo `test -f './g2clib-1.0.4/misspack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/misspack.c
-
-mkieee.lo: ./g2clib-1.0.4/mkieee.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mkieee.lo -MD -MP -MF $(DEPDIR)/mkieee.Tpo -c -o mkieee.lo `test -f './g2clib-1.0.4/mkieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/mkieee.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mkieee.Tpo $(DEPDIR)/mkieee.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/mkieee.c' object='mkieee.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mkieee.lo `test -f './g2clib-1.0.4/mkieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/mkieee.c
-
-pack_gp.lo: ./g2clib-1.0.4/pack_gp.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_gp.lo -MD -MP -MF $(DEPDIR)/pack_gp.Tpo -c -o pack_gp.lo `test -f './g2clib-1.0.4/pack_gp.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pack_gp.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pack_gp.Tpo $(DEPDIR)/pack_gp.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pack_gp.c' object='pack_gp.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_gp.lo `test -f './g2clib-1.0.4/pack_gp.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pack_gp.c
-
-pdstemplates.lo: ./g2clib-1.0.4/pdstemplates.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pdstemplates.lo -MD -MP -MF $(DEPDIR)/pdstemplates.Tpo -c -o pdstemplates.lo `test -f './g2clib-1.0.4/pdstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pdstemplates.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pdstemplates.Tpo $(DEPDIR)/pdstemplates.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pdstemplates.c' object='pdstemplates.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pdstemplates.lo `test -f './g2clib-1.0.4/pdstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pdstemplates.c
-
-pngpack.lo: ./g2clib-1.0.4/pngpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngpack.lo -MD -MP -MF $(DEPDIR)/pngpack.Tpo -c -o pngpack.lo `test -f './g2clib-1.0.4/pngpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pngpack.Tpo $(DEPDIR)/pngpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pngpack.c' object='pngpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngpack.lo `test -f './g2clib-1.0.4/pngpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngpack.c
-
-pngunpack.lo: ./g2clib-1.0.4/pngunpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngunpack.lo -MD -MP -MF $(DEPDIR)/pngunpack.Tpo -c -o pngunpack.lo `test -f './g2clib-1.0.4/pngunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngunpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/pngunpack.Tpo $(DEPDIR)/pngunpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/pngunpack.c' object='pngunpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngunpack.lo `test -f './g2clib-1.0.4/pngunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngunpack.c
-
-rdieee.lo: ./g2clib-1.0.4/rdieee.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdieee.lo -MD -MP -MF $(DEPDIR)/rdieee.Tpo -c -o rdieee.lo `test -f './g2clib-1.0.4/rdieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/rdieee.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rdieee.Tpo $(DEPDIR)/rdieee.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/rdieee.c' object='rdieee.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdieee.lo `test -f './g2clib-1.0.4/rdieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/rdieee.c
-
-reduce.lo: ./g2clib-1.0.4/reduce.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reduce.lo -MD -MP -MF $(DEPDIR)/reduce.Tpo -c -o reduce.lo `test -f './g2clib-1.0.4/reduce.c' || echo '$(srcdir)/'`./g2clib-1.0.4/reduce.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/reduce.Tpo $(DEPDIR)/reduce.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/reduce.c' object='reduce.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reduce.lo `test -f './g2clib-1.0.4/reduce.c' || echo '$(srcdir)/'`./g2clib-1.0.4/reduce.c
-
-seekgb.lo: ./g2clib-1.0.4/seekgb.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seekgb.lo -MD -MP -MF $(DEPDIR)/seekgb.Tpo -c -o seekgb.lo `test -f './g2clib-1.0.4/seekgb.c' || echo '$(srcdir)/'`./g2clib-1.0.4/seekgb.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/seekgb.Tpo $(DEPDIR)/seekgb.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/seekgb.c' object='seekgb.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seekgb.lo `test -f './g2clib-1.0.4/seekgb.c' || echo '$(srcdir)/'`./g2clib-1.0.4/seekgb.c
-
-simpack.lo: ./g2clib-1.0.4/simpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT simpack.lo -MD -MP -MF $(DEPDIR)/simpack.Tpo -c -o simpack.lo `test -f './g2clib-1.0.4/simpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/simpack.Tpo $(DEPDIR)/simpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/simpack.c' object='simpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o simpack.lo `test -f './g2clib-1.0.4/simpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simpack.c
-
-simunpack.lo: ./g2clib-1.0.4/simunpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT simunpack.lo -MD -MP -MF $(DEPDIR)/simunpack.Tpo -c -o simunpack.lo `test -f './g2clib-1.0.4/simunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simunpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/simunpack.Tpo $(DEPDIR)/simunpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/simunpack.c' object='simunpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o simunpack.lo `test -f './g2clib-1.0.4/simunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simunpack.c
-
-specpack.lo: ./g2clib-1.0.4/specpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT specpack.lo -MD -MP -MF $(DEPDIR)/specpack.Tpo -c -o specpack.lo `test -f './g2clib-1.0.4/specpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/specpack.Tpo $(DEPDIR)/specpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/specpack.c' object='specpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o specpack.lo `test -f './g2clib-1.0.4/specpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specpack.c
-
-specunpack.lo: ./g2clib-1.0.4/specunpack.c
- at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT specunpack.lo -MD -MP -MF $(DEPDIR)/specunpack.Tpo -c -o specunpack.lo `test -f './g2clib-1.0.4/specunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specunpack.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/specunpack.Tpo $(DEPDIR)/specunpack.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='./g2clib-1.0.4/specunpack.c' object='specunpack.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o specunpack.lo `test -f './g2clib-1.0.4/specunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specunpack.c
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/grid/io_grid_image/MLB_Interface.cpp b/src/modules_io/grid/io_grid_image/MLB_Interface.cpp
deleted file mode 100644
index dfb03a7..0000000
--- a/src/modules_io/grid/io_grid_image/MLB_Interface.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z 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("Import/Export - Images") );
-
-	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 <wx/image.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 );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_io/grid/io_grid_image/MLB_Interface.h b/src/modules_io/grid/io_grid_image/MLB_Interface.h
deleted file mode 100644
index 6d98897..0000000
--- a/src/modules_io/grid/io_grid_image/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       image_io                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__io_grid_image_H
-#define HEADER_INCLUDED__io_grid_image_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef io_grid_image_EXPORTS
-	#define	io_grid_image_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	io_grid_image_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__io_grid_image_H
diff --git a/src/modules_io/grid/io_grid_image/Makefile.am b/src/modules_io/grid/io_grid_image/Makefile.am
deleted file mode 100644
index 16578fb..0000000
--- a/src/modules_io/grid/io_grid_image/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
-DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
-else
-DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
-DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
-endif
-DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS           = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS        = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libio_grid_image.la
-libio_grid_image_la_SOURCES =\
-grid_export.cpp\
-grid_import.cpp\
-MLB_Interface.cpp\
-grid_export.h\
-grid_import.h\
-MLB_Interface.h
- 
-libio_grid_image_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_io/grid/io_grid_image/Makefile.in b/src/modules_io/grid/io_grid_image/Makefile.in
deleted file mode 100644
index 93c77bf..0000000
--- a/src/modules_io/grid/io_grid_image/Makefile.in
+++ /dev/null
@@ -1,580 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/grid/io_grid_image
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_grid_image_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_grid_image_la_OBJECTS = grid_export.lo grid_import.lo \
-	MLB_Interface.lo
-libio_grid_image_la_OBJECTS = $(am_libio_grid_image_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_grid_image_la_SOURCES)
-DIST_SOURCES = $(libio_grid_image_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
- at DEBUG_TRUE@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`
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = $(DEP_LFLG) -avoid-version
-pkglib_LTLIBRARIES = libio_grid_image.la
-libio_grid_image_la_SOURCES = \
-grid_export.cpp\
-grid_import.cpp\
-MLB_Interface.cpp\
-grid_export.h\
-grid_import.h\
-MLB_Interface.h
-
-libio_grid_image_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/grid/io_grid_image/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/grid/io_grid_image/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_grid_image.la: $(libio_grid_image_la_OBJECTS) $(libio_grid_image_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_grid_image_la_OBJECTS) $(libio_grid_image_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_export.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_import.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/grid/io_grid_image/grid_export.cpp b/src/modules_io/grid/io_grid_image/grid_export.cpp
deleted file mode 100644
index 74d2d0f..0000000
--- a/src/modules_io/grid/io_grid_image/grid_export.cpp
+++ /dev/null
@@ -1,542 +0,0 @@
-/**********************************************************
- * Version $Id: grid_export.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       image_io                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    Grid_Export.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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <wx/filename.h>
-#include <wx/image.h>
-
-#include "grid_export.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Export::CGrid_Export(void)
-{
-	Set_Name		(_TL("Export Image (bmp, jpg, pcx, png, tif)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2005"));
-
-	Set_Description	(_TW(
-		"Saves a grid as image using display properties as used by the graphical user interface.\n\n"
-		"On the command line there are further parameters available: It is possible to either use one "
-		"of the default palettes, to use a Lookup Table for coloring or to interpret the grid as RGB coded. "
-		"In case a shade grid is specified, it's minimum and maximum brightness values can be specified in "
-		"percent (0 - 100 percent).\n")
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRID"		, _TL("Grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SHADE"		, _TL("Shade"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_FilePath(
-		NULL	, "FILE"		, _TL("Image File"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"),
-			_TL("Windows or OS/2 Bitmap (*.bmp)")				, SG_T("*.bmp"),
-			_TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)")	, SG_T("*.jpg;*.jif;*.jpeg"),
-			_TL("Zsoft Paintbrush (*.pcx)")						, SG_T("*.pcx"),
-			_TL("Portable Network Graphics (*.png)")			, SG_T("*.png"),
-			_TL("Tagged Image File Format (*.tif, *.tiff)")		, SG_T("*.tif;*.tiff")
-		), NULL, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "FILE_KML"	, _TL("Create KML File"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	if( SG_UI_Get_Window_Main() )
-	{
-		Parameters.Add_Choice(
-			NULL	, "COLOURING"	, _TL("Colouring"),
-			_TL(""),
-			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-				_TL("stretch to grid's standard deviation"),
-				_TL("stretch to grid's value range"),
-				_TL("stretch to specified value range"),
-				_TL("lookup table"),
-				_TL("rgb coded values"),
-				_TL("same as in graphical user interface")
-			), 5
-		);
-
-		Parameters.Add_Colors(
-			NULL	, "COL_PALETTE"	, _TL("Colours Palette"),
-			_TL("")
-		);
-	}
-	else
-	{
-		Parameters.Add_Choice(
-			NULL	, "COLOURING"	, _TL("Colouring"),
-			_TL(""),
-			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-				_TL("stretch to grid's standard deviation"),
-				_TL("stretch to grid's value range"),
-				_TL("stretch to specified value range"),
-				_TL("lookup table"),
-				_TL("rgb coded values")
-			), 0
-		);
-
-		Parameters.Add_Choice(
-			NULL	, "COL_PALETTE"	, _TL("Color Palette"),
-			_TL(""),
-			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
-				_TL("DEFAULT"),			_TL("DEFAULT_BRIGHT"),	_TL("BLACK_WHITE"),		_TL("BLACK_RED"),
-				_TL("BLACK_GREEN"),		_TL("BLACK_BLUE"),		_TL("WHITE_RED"),		_TL("WHITE_GREEN"),
-				_TL("WHITE_BLUE"),		_TL("YELLOW_RED"),		_TL("YELLOW_GREEN"),	_TL("YELLOW_BLUE"),
-				_TL("RED_GREEN"),		_TL("RED_BLUE"),		_TL("GREEN_BLUE"),		_TL("RED_GREY_BLUE"),
-				_TL("RED_GREY_GREEN"),	_TL("GREEN_GREY_BLUE"),	_TL("RED_GREEN_BLUE"),	_TL("RED_BLUE_GREEN"),
-				_TL("GREEN_RED_BLUE"),	_TL("RAINBOW"),			_TL("NEON"),			_TL("TOPOGRAPHY"),
-				_TL("ASPECT_1"),		_TL("ASPECT_2"),		_TL("ASPECT_3")
-			), 0
-		);
-
-		Parameters.Add_Value(
-			NULL	, "COL_COUNT"	, _TL("Number of Colors"),
-			_TL(""),
-			PARAMETER_TYPE_Int, 100
-		);
-
-		Parameters.Add_Value(
-			NULL	, "COL_REVERT"	, _TL("Revert Palette"),
-			_TL(""),
-			PARAMETER_TYPE_Bool, false
-		);
-	}
-
-	Parameters.Add_Value(
-		NULL	, "STDDEV"		, _TL("Standard Deviation"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 2.0, 0.0, true
-	);
-
-	Parameters.Add_Range(
-        NULL	, "STRETCH"		, _TL("Stretch to Value Range"),
-        _TL(""),
-        0.0, 100.0
-    );
-
-	Parameters.Add_Table(
-		NULL	, "LUT"			, _TL("Lookup Table"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Range(
-        NULL	, "SHADE_BRIGHT", _TL("Shade Brightness"),
-        _TL("Allows to scale shade brightness, [percent]"),
-        0.0, 100.0, 0.0, true, 100.0, true
-    );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CGrid_Export::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("COLOURING")) )
-	{
-		pParameters->Get_Parameter("COL_PALETTE")->Set_Enabled(pParameter->asInt() <= 2);
-		pParameters->Get_Parameter("STDDEV"     )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("STRETCH"    )->Set_Enabled(pParameter->asInt() == 2);
-		pParameters->Get_Parameter("LUT"        )->Set_Enabled(pParameter->asInt() == 3);
-	}
-
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SHADE")) )
-	{
-		pParameters->Get_Parameter("SHADE_BRIGHT")->Set_Enabled(pParameter->asGrid() != NULL);
-	}
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Export::On_Execute(void)
-{
-	//-----------------------------------------------------
-	int			y, iy, Method;
-	CSG_Grid	*pGrid, *pShade, Grid, Shade;
-
-	//-----------------------------------------------------
-	pGrid	= Parameters("GRID"     )->asGrid();
-	pShade	= Parameters("SHADE"    )->asGrid();
-	Method	= Parameters("COLOURING")->asInt ();
-
-	if( !pGrid )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	if( Method == 5 )	// same as in graphical user interface
-	{
-		if( !SG_UI_DataObject_asImage(pGrid, &Grid) )
-		{
-			Error_Set("could not retrieve colour coding from graphical user interface.");
-
-			return( false );
-		}
-	}
-	else
-	{
-		double		zMin, zScale;
-		CSG_Colors	Colors;
-		CSG_Table	*pLUT	= Parameters("LUT")->asTable();
-
-		if( SG_UI_Get_Window_Main() )
-		{
-			Colors.Assign(Parameters("COL_PALETTE")->asColors());
-		}
-		else
-		{
-			Colors.Set_Palette(
-				Parameters("COL_PALETTE")->asInt (),
-				Parameters("COL_REVERT" )->asBool(),
-				Parameters("COL_COUNT"  )->asInt ()
-			);
-		}
-
-		switch( Method )
-		{
-		case 0:	// stretch to grid's standard deviation
-			zMin	= pGrid->Get_ArithMean() -  Parameters("STDDEV")->asDouble() * pGrid->Get_StdDev();
-			zScale	= Colors.Get_Count() / (2 * Parameters("STDDEV")->asDouble() * pGrid->Get_StdDev());
-			break;
-
-		case 1:	// stretch to grid's value range
-			zMin	= pGrid->Get_ZMin();
-			zScale	= Colors.Get_Count() / pGrid->Get_ZRange();
-			break;
-
-		case 2:	// stretch to specified value range
-			zMin	= Parameters("STRETCH")->asRange()->Get_LoVal();
-			if( zMin >= (zScale = Parameters("STRETCH")->asRange()->Get_HiVal()) )
-			{
-				Error_Set(_TL("invalid user specified value range."));
-
-				return( false );
-			}
-			zScale	= Colors.Get_Count() / (zScale - zMin);
-			break;
-
-		case 3:	// lookup table
-			if( !pLUT || pLUT->Get_Field_Count() < 5 )
-			{
-				Error_Set(_TL("invalid lookup table."));
-
-				return( false );
-			}
-			break;
-
-		case 4:	// rgb coded values
-			break;
-		}
-
-		//-------------------------------------------------
-		Grid.Create(*Get_System(), SG_DATATYPE_Int);
-
-		for(y=0, iy=Get_NY()-1; y<Get_NY() && Set_Progress(y); y++, iy--)
-		{
-			#pragma omp parallel for
-			for(int x=0; x<Get_NX(); x++)
-			{
-				double	z	= pGrid->asDouble(x, y);
-
-				if( Method == 3 )	// lookup table
-				{
-					int		i, iColor;
-
-					for(i=0, iColor=-1; i<pLUT->Get_Record_Count() && iColor<0; i++)
-					{
-						if( z >= pLUT->Get_Record(i)->asDouble(3) && z < pLUT->Get_Record(i)->asDouble(4) )
-						{
-							Grid.Set_Value(x, iy, pLUT->Get_Record(iColor = i)->asInt(0));
-						}
-					}
-
-					if( iColor < 0 )
-					{
-						Grid.Set_NoData(x, iy);
-					}
-				}
-				else if( pGrid->is_NoData(x, y) )
-				{
-					Grid.Set_NoData(x, iy);
-				}
-				else if( Method == 4 )	// rgb coded values
-				{
-					Grid.Set_Value (x, iy, z);
-				}
-				else
-				{
-					int	i	= (int)(zScale * (z - zMin));
-
-					Grid.Set_Value (x, iy, Colors[i < 0 ? 0 : i >= Colors.Get_Count() ? Colors.Get_Count() - 1 : i]);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( !pShade || pShade->Get_ZRange() <= 0.0 )
-	{
-		pShade	= NULL;
-	}
-	else // if( !SG_UI_DataObject_asImage(pShade, &Shade) )
-	{
-		double	zMin, zScale;
-
-		zMin	= Parameters("SHADE_BRIGHT")->asRange()->Get_LoVal() / 100.0;
-		zScale	= Parameters("SHADE_BRIGHT")->asRange()->Get_HiVal() / 100.0;
-
-		if( zMin >= zScale )
-		{
-			SG_UI_Msg_Add_Error(_TL("Minimum shade brightness must be lower than maximum shade brightness!"));
-
-			return( false );
-		}
-
-		zScale	= (zScale - zMin) / pShade->Get_ZRange();
-
-	    //-------------------------------------------------
-		Shade.Create(*Get_System(), SG_DATATYPE_Float);
-
-		for(y=0, iy=Get_NY()-1; y<Get_NY() && Set_Progress(y); y++, iy--)
-		{
-			#pragma omp parallel for
-			for(int x=0; x<Get_NX(); x++)
-			{
-				if( pShade->is_NoData(x, y) )
-				{
-					Shade.Set_NoData(x, iy);
-				}
-				else
-				{
-					Shade.Set_Value (x, iy, zMin + zScale * (pShade->Get_ZMax() - pShade->asDouble(x, y)));
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	wxImage	Image(Get_NX(), Get_NY());
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			int	r, g, b, c	= Grid.asInt(x, y);
-
-			if( !pShade )
-			{
-				r	= SG_GET_R(c);
-				g	= SG_GET_G(c);
-				b	= SG_GET_B(c);
-			}
-			else
-			{
-				double	d	= Shade.asDouble(x, y);
-
-				r	= (int)(d * SG_GET_R(c));
-				g	= (int)(d * SG_GET_G(c));
-				b	= (int)(d * SG_GET_B(c));
-			}
-
-			Image.SetRGB(x, y, r, g, b);
-		}
-	}
-
-	//-------------------------------------------------
-	CSG_String	fName(Parameters("FILE")->asString());
-
-	if( !SG_File_Cmp_Extension(fName, SG_T("bmp"))
-	&&  !SG_File_Cmp_Extension(fName, SG_T("jpg"))
-	&&  !SG_File_Cmp_Extension(fName, SG_T("pcx"))
-	&&  !SG_File_Cmp_Extension(fName, SG_T("png"))
-	&&  !SG_File_Cmp_Extension(fName, SG_T("tif")) )
-	{
-		fName	= SG_File_Make_Path(NULL, fName, SG_T("png"));
-	}
-
-	//-----------------------------------------------------
-	wxImageHandler	*pImgHandler = NULL;
-
-	if( !SG_UI_Get_Window_Main() )
-	{
-		if( SG_File_Cmp_Extension(fName, SG_T("jpg")) )
-			pImgHandler = new wxJPEGHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) )
-			pImgHandler = new wxPCXHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("tif")) )
-			pImgHandler = new wxTIFFHandler;
-#ifdef _SAGA_MSW
-		else if( SG_File_Cmp_Extension(fName, SG_T("bmp")) )
-			pImgHandler = new wxBMPHandler;
-#endif
-		else // if( SG_File_Cmp_Extension(fName, SG_T("png")) )
-			pImgHandler = new wxPNGHandler;
-
-		wxImage::AddHandler(pImgHandler);
-	}
-
-	if( !Image.SaveFile(fName.c_str()) )
-	{
-		Error_Set(CSG_String::Format(SG_T("%s [%s]"), _TL("could not save image file"), fName.c_str()));
-
-		return( false );
-	}
-
-	pGrid->Get_Projection().Save(SG_File_Make_Path(NULL, fName, SG_T("prj")), SG_PROJ_FMT_WKT);
-
-	//-----------------------------------------------------
-	CSG_File	Stream;
-
-	if(      SG_File_Cmp_Extension(fName, SG_T("bmp")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("bpw")), SG_FILE_W, false);
-	else if( SG_File_Cmp_Extension(fName, SG_T("jpg")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("jgw")), SG_FILE_W, false);
-	else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("pxw")), SG_FILE_W, false);
-	else if( SG_File_Cmp_Extension(fName, SG_T("png")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("pgw")), SG_FILE_W, false);
-	else if( SG_File_Cmp_Extension(fName, SG_T("tif")) ) Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("tfw")), SG_FILE_W, false);
-
-	if( Stream.is_Open() )
-	{
-		Stream.Printf(SG_T("%.10f\n%f\n%f\n%.10f\n%.10f\n%.10f\n"),
-			 pGrid->Get_Cellsize(),
-			 0.0, 0.0,
-			-pGrid->Get_Cellsize(),
-			 pGrid->Get_XMin(),
-			 pGrid->Get_YMax()
-		);
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("FILE_KML")->asBool() && Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("kml")), SG_FILE_W, false) )
-	{
-		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"));
-	}
-
-	//-----------------------------------------------------
-	if( !SG_UI_Get_Window_Main() && pImgHandler != NULL)
-	{
-		wxImage::RemoveHandler(pImgHandler->GetName());
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/grid/io_grid_image/grid_export.h b/src/modules_io/grid/io_grid_image/grid_export.h
deleted file mode 100644
index bebe094..0000000
--- a/src/modules_io/grid/io_grid_image/grid_export.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************
- * Version $Id: grid_export.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       image_io                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     Grid_Export.h                     //
-//                                                       //
-//                 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Grid_Export_H
-#define HEADER_INCLUDED__Grid_Export_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_grid_image_EXPORT CGrid_Export : public CSG_Module_Grid
-{
-public:
-	CGrid_Export(void);
-
-	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("R:Export") );	}
-
-
-protected:
-
-	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool			On_Execute				(void);
-
-
-private:
-
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Grid_Export_H
diff --git a/src/modules_io/grid/io_grid_image/grid_import.cpp b/src/modules_io/grid/io_grid_image/grid_import.cpp
deleted file mode 100644
index ffe2bf2..0000000
--- a/src/modules_io/grid/io_grid_image/grid_import.cpp
+++ /dev/null
@@ -1,433 +0,0 @@
-/**********************************************************
- * Version $Id: grid_import.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       image_io                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    Grid_Import.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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <wx/filename.h>
-#include <wx/image.h>
-
-#include "grid_import.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CGrid_Import::CGrid_Import(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Import Image (bmp, jpg, png, tif, gif, pnm, xpm)"));
-
-	Set_Author		(SG_T("(c) 2005 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"Loads an image."
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_Output(
-		NULL	, "OUT_GRID"	, _TL("Image"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "OUT_RED"		, _TL("Image (Red Channel)"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "OUT_GREEN"	, _TL("Image (Green Channel)"),
-		_TL("")
-	);
-
-	Parameters.Add_Grid_Output(
-		NULL	, "OUT_BLUE"	, _TL("Image (Blue Channel)"),
-		_TL("")
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_FilePath(
-		NULL	, "FILE"		, _TL("Image File"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"),
-			_TL("All Recognized File Types")					, SG_T("*.bmp;*.ico;*.gif;*.jpg;*.jif;*.jpeg;*.pcx;*.png;*.pnm;*.tif;*.tiff;*.xpm"),
-			_TL("CompuServe Graphics Interchange (*.gif)")		, SG_T("*.gif"),
-			_TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)")	, SG_T("*.jpg;*.jif;*.jpeg"),
-			_TL("Portable Network Graphics (*.png)")			, SG_T("*.png"),
-			_TL("Tagged Image File Format (*.tif, *.tiff)")		, SG_T("*.tif;*.tiff"),
-			_TL("Windows or OS/2 Bitmap (*.bmp)")				, SG_T("*.bmp"),
-			_TL("Zsoft Paintbrush (*.pcx)")						, SG_T("*.pcx"),
-			_TL("All Files")									, SG_T("*.*")
-		)
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Options"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Standard"),
-			_TL("Split Channels"),
-			_TL("Enforce True Color")
-		), 2
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGrid_Import::On_Execute(void)
-{
-	bool				bTransform;
-	int					x, y, yy, Method;
-	double				ax, ay, dx, dy, rx, ry, xMin, yMin, Cellsize;
-	CSG_Colors			Colors;
-	CSG_String			fImage, fWorld, Name;
-	CSG_Grid			*pImage;
-	CSG_File			Stream;
-	wxImage				Image;
-	wxImageHistogram	Histogram;
-
-	//-----------------------------------------------------
-	fImage	= Parameters("FILE")	->asString();
-	Method	= Parameters("METHOD")	->asInt();
-
-	Name	= SG_File_Get_Name(fImage, false);
-
-	//-----------------------------------------------------
-	wxImageHandler	*pImgHandler = NULL;
-
-	if( !SG_UI_Get_Window_Main() )
-	{
-		CSG_String	fName = SG_File_Get_Name(fImage, true);
-
-		if( SG_File_Cmp_Extension(fName, SG_T("jpg")) )
-			pImgHandler = new wxJPEGHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) )
-			pImgHandler = new wxPCXHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("tif")) )
-			pImgHandler = new wxTIFFHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("gif")) )
-			pImgHandler = new wxGIFHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("pnm")) )
-			pImgHandler = new wxPNMHandler;
-		else if( SG_File_Cmp_Extension(fName, SG_T("xpm")) )
-			pImgHandler = new wxXPMHandler;
-#ifdef _SAGA_MSW
-		else if( SG_File_Cmp_Extension(fName, SG_T("bmp")) )
-			pImgHandler = new wxBMPHandler;
-#endif
-		else // if( SG_File_Cmp_Extension(fName, SG_T("png")) )
-			pImgHandler = new wxPNGHandler;
-
-		wxImage::AddHandler(pImgHandler);
-	}
-
-	if( !Image.LoadFile(fImage.c_str()) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	     if( SG_File_Cmp_Extension(fImage, SG_T("bmp")) )
-	{
-		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("bpw"));
-	}
-	else if( SG_File_Cmp_Extension(fImage, SG_T("jpg")) )
-	{
-		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("jgw"));
-	}
-	else if( SG_File_Cmp_Extension(fImage, SG_T("png")) )
-	{
-		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("pgw"));
-	}
-	else if( SG_File_Cmp_Extension(fImage, SG_T("tif")) )
-	{
-		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("tfw"));
-	}
-	else
-	{
-		fWorld	= SG_File_Make_Path(NULL, fImage, SG_T("world"));
-	}
-
-	bTransform	= false;
-	xMin		= 0.0;
-	yMin		= 0.0;
-	Cellsize	= 1.0;
-
-	if(	Stream.Open(fWorld, SG_FILE_R, false) && fscanf(Stream.Get_Stream(), "%lf %lf %lf %lf %lf %lf ", &dx, &ry, &rx, &dy, &ax, &ay) == 6 )
-	{
-		if( dx != -dy || rx != 0.0 || ry != 0.0 )
-		{
-			bTransform	= true;
-		}
-		else
-		{
-			xMin		= ax;
-			yMin		= ay + dy * (Image.GetHeight() - 1);
-			Cellsize	= dx;
-		}
-	}
-
-
-	//-----------------------------------------------------
-	// color look-up table...
-
-	if( Method == 0 && (yy = Image.ComputeHistogram(Histogram)) <= 256 )
-	{
-		Colors.Set_Count(yy);
-
-		for(wxImageHistogram::iterator i=Histogram.begin(); i!=Histogram.end(); ++i)
-		{
-			Colors.Set_Color(i->second.index, SG_GET_R(i->first), SG_GET_G(i->first), SG_GET_B(i->first));
-		}
-
-		pImage	= SG_Create_Grid(yy <= 2 ? SG_DATATYPE_Bit : SG_DATATYPE_Byte, Image.GetWidth(), Image.GetHeight(), Cellsize, xMin, yMin);
-
-		for(y=0; y<pImage->Get_NY() && Set_Progress(y, pImage->Get_NY()); y++)
-		{
-			yy	= bTransform ? y : pImage->Get_NY() - 1 - y;
-
-			for(x=0; x<pImage->Get_NX(); x++)
-			{
-				pImage->Set_Value(x, y, Histogram[SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy))].index);
-			}
-		}
-
-		if( bTransform )
-		{
-			Set_Transformation(&pImage, ax, ay, dx, dy, rx, ry);
-		}
-
-		pImage->Set_Name(Name);
-		pImage->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
-		Parameters("OUT_GRID")->Set_Value(pImage);
-		DataObject_Set_Colors(pImage, Colors);
-		DataObject_Update(pImage, 0, Colors.Get_Count() - 1);
-	}
-
-	//-----------------------------------------------------
-	else	// true color...
-	{
-		pImage	= SG_Create_Grid(SG_DATATYPE_Int, Image.GetWidth(), Image.GetHeight(), Cellsize, xMin, yMin);
-		pImage	->Set_Name(Name);
-
-		for(y=0; y<pImage->Get_NY() && Set_Progress(y, pImage->Get_NY()); y++)
-		{
-			yy	= bTransform ? y : pImage->Get_NY() - 1 - y;
-
-			for(x=0; x<pImage->Get_NX(); x++)
-			{
-				pImage->Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy)));
-			}
-		}
-
-		if( bTransform )
-		{
-			Set_Transformation(&pImage, ax, ay, dx, dy, rx, ry);
-		}
-
-		//-------------------------------------------------
-		if( Method != 1 )	// true color...
-		{
-			pImage->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
-			pImage->Set_Name(Name);
-			pImage->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
-			Parameters("OUT_GRID")->Set_Value(pImage);
-			DataObject_Set_Colors(pImage, 100, SG_COLORS_BLACK_WHITE);
-			DataObject_Set_Parameter(pImage, "COLORS_TYPE", 6);	// Color Classification Type: RGB
-		}
-
-		//-------------------------------------------------
-		else				// split channels...
-		{
-			CSG_Grid	*pR, *pG, *pB;
-
-			pR	= SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte);
-			pG	= SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte);
-			pB	= SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte);
-
-			for(y=0; y<pImage->Get_NY() && Set_Progress(y, pImage->Get_NY()); y++)
-			{
-				for(x=0; x<pImage->Get_NX(); x++)
-				{
-					pR->Set_Value(x, y, SG_GET_R(pImage->asInt(x, y)));
-					pG->Set_Value(x, y, SG_GET_G(pImage->asInt(x, y)));
-					pB->Set_Value(x, y, SG_GET_B(pImage->asInt(x, y)));
-				}
-			}
-
-			pR->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
-			pG->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
-			pB->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT);
-
-			pR->Set_Name(CSG_String::Format(SG_T("%s [R]"), Name.c_str()));
-			pG->Set_Name(CSG_String::Format(SG_T("%s [G]"), Name.c_str()));
-			pB->Set_Name(CSG_String::Format(SG_T("%s [B]"), Name.c_str()));
-
-			pR->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
-			pG->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
-			pB->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj")));
-
-			Parameters("OUT_RED")	->Set_Value(pR);
-			Parameters("OUT_GREEN")	->Set_Value(pG);
-			Parameters("OUT_BLUE")	->Set_Value(pB);
-
-			DataObject_Set_Colors(pR, 100, SG_COLORS_BLACK_RED);
-			DataObject_Set_Colors(pG, 100, SG_COLORS_BLACK_GREEN);
-			DataObject_Set_Colors(pB, 100, SG_COLORS_BLACK_BLUE);
-		}
-	}
-
-	//-----------------------------------------------------
-	if( !SG_UI_Get_Window_Main() && pImgHandler != NULL)
-	{
-		wxImage::RemoveHandler(pImgHandler->GetName());
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CGrid_Import::Set_Transformation(CSG_Grid **ppImage, double ax, double ay, double dx, double dy, double rx, double ry)
-{
-	int			x, y;
-	double		z;
-	TSG_Rect	r;
-	CSG_Vector	A(2), XSrc(2), XTgt(2);
-	CSG_Matrix	D(2, 2), DInv;
-	CSG_Grid	*pSource, *pTarget;
-
-	//-----------------------------------------------------
-	pSource		= *ppImage;
-
-	A[0]	= ax;	A[1]	= ay;
-	D[0][0]	= dx;	D[0][1]	= rx;
-	D[1][0]	= ry;	D[1][1]	= dy;
-	DInv	= D.Get_Inverse();
-
-	//-----------------------------------------------------
-	XSrc[0]	= pSource->Get_XMin();	XSrc[1]	= pSource->Get_YMin();	XTgt	= D * XSrc + A;
-	r.xMin	= r.xMax	= XTgt[0];
-	r.yMin	= r.yMax	= XTgt[1];
-
-	XSrc[0]	= pSource->Get_XMin();	XSrc[1]	= pSource->Get_YMax();	XTgt	= D * XSrc + A;
-	if( r.xMin > XTgt[0] )	r.xMin	= XTgt[0];	else if( r.xMax < XTgt[0] )	r.xMax	= XTgt[0];
-	if( r.yMin > XTgt[1] )	r.yMin	= XTgt[1];	else if( r.yMax < XTgt[1] )	r.yMax	= XTgt[1];
-
-	XSrc[0]	= pSource->Get_XMax();	XSrc[1]	= pSource->Get_YMax();	XTgt	= D * XSrc + A;
-	if( r.xMin > XTgt[0] )	r.xMin	= XTgt[0];	else if( r.xMax < XTgt[0] )	r.xMax	= XTgt[0];
-	if( r.yMin > XTgt[1] )	r.yMin	= XTgt[1];	else if( r.yMax < XTgt[1] )	r.yMax	= XTgt[1];
-
-	XSrc[0]	= pSource->Get_XMax();	XSrc[1]	= pSource->Get_YMin();	XTgt	= D * XSrc + A;
-	if( r.xMin > XTgt[0] )	r.xMin	= XTgt[0];	else if( r.xMax < XTgt[0] )	r.xMax	= XTgt[0];
-	if( r.yMin > XTgt[1] )	r.yMin	= XTgt[1];	else if( r.yMax < XTgt[1] )	r.yMax	= XTgt[1];
-
-	z	= fabs(dx) < fabs(dy) ? fabs(dx) : fabs(dy);	// guess a suitable cellsize; could be improved...
-	x	= 1 + (int)((r.xMax - r.xMin) / z);
-	y	= 1 + (int)((r.yMax - r.yMin) / z);
-
-	//-----------------------------------------------------
-	pTarget		= *ppImage	= SG_Create_Grid(pSource->Get_Type(), x, y, z, r.xMin, r.yMin);
-
-	for(y=0, XTgt[1]=pTarget->Get_YMin(); y<pTarget->Get_NY() && Set_Progress(y, pTarget->Get_NY()); y++, XTgt[1]+=pTarget->Get_Cellsize())
-	{
-		for(x=0, XTgt[0]=pTarget->Get_XMin(); x<pTarget->Get_NX(); x++, XTgt[0]+=pTarget->Get_Cellsize())
-		{
-			XSrc	= DInv * (XTgt - A);
-
-			if( pSource->Get_Value(XSrc[0], XSrc[1], z, GRID_INTERPOLATION_NearestNeighbour, false, true) )
-			{
-				pTarget->Set_Value(x, y, z);
-			}
-			else
-			{
-				pTarget->Set_NoData(x, y);
-			}
-		}
-	}
-
-	delete(pSource);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/grid/io_grid_image/grid_import.h b/src/modules_io/grid/io_grid_image/grid_import.h
deleted file mode 100644
index 80d2703..0000000
--- a/src/modules_io/grid/io_grid_image/grid_import.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************
- * Version $Id: grid_import.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       image_io                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     Grid_Import.h                     //
-//                                                       //
-//                 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                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Grid_Import_H
-#define HEADER_INCLUDED__Grid_Import_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class io_grid_image_EXPORT CGrid_Import : public CSG_Module
-{
-public:
-	CGrid_Import(void);
-
-	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Import") );	}
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	void					Set_Transformation	(CSG_Grid **ppImage, double ax, double ay, double dx, double dy, double rx, double ry);
-
-};
-
-#endif // #ifndef HEADER_INCLUDED__Grid_Import_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_io/shapes/Makefile.am b/src/modules_io/shapes/Makefile.am
deleted file mode 100644
index 128f4a4..0000000
--- a/src/modules_io/shapes/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = io_shapes io_shapes_dxf io_shapes_las
diff --git a/src/modules_io/shapes/Makefile.in b/src/modules_io/shapes/Makefile.in
deleted file mode 100644
index 3b64266..0000000
--- a/src/modules_io/shapes/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/shapes
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = io_shapes io_shapes_dxf io_shapes_las
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/shapes/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/shapes/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/shapes/io_shapes/Makefile.in b/src/modules_io/shapes/io_shapes/Makefile.in
deleted file mode 100644
index e6423d3..0000000
--- a/src/modules_io/shapes/io_shapes/Makefile.in
+++ /dev/null
@@ -1,620 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/shapes/io_shapes
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_shapes_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_shapes_la_OBJECTS = atlas_bna.lo generate.lo gpx.lo gstat.lo \
-	MLB_Interface.lo pointcloud_from_file.lo \
-	pointcloud_from_text_file.lo pointcloud_to_text_file.lo stl.lo \
-	surfer_bln.lo svg.lo wasp_map.lo wktb.lo xyz.lo
-libio_shapes_la_OBJECTS = $(am_libio_shapes_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_shapes_la_SOURCES)
-DIST_SOURCES = $(libio_shapes_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1373 2012-04-13 09:54:30Z oconrad $
-#
- at DEBUG_TRUE@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`
- at SAGA_UNICODE_TRUE@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 = libio_shapes.la
-libio_shapes_la_SOURCES = \
-atlas_bna.cpp\
-generate.cpp\
-gpx.cpp\
-gstat.cpp\
-MLB_Interface.cpp\
-pointcloud_from_file.cpp\
-pointcloud_from_text_file.cpp\
-pointcloud_to_text_file.cpp\
-stl.cpp\
-surfer_bln.cpp\
-svg.cpp\
-wasp_map.cpp\
-wktb.cpp\
-xyz.cpp\
-atlas_bna.h\
-generate.h\
-gpx.h\
-gstat.h\
-MLB_Interface.h\
-pointcloud_from_file.h\
-pointcloud_from_text_file.h\
-pointcloud_to_text_file.h\
-stl.h\
-surfer_bln.h\
-svg.h\
-wasp_map.h\
-wktb.h\
-xyz.h
-
-libio_shapes_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/shapes/io_shapes/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/shapes/io_shapes/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_shapes.la: $(libio_shapes_la_OBJECTS) $(libio_shapes_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_shapes_la_OBJECTS) $(libio_shapes_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/atlas_bna.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/generate.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gpx.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gstat.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pointcloud_from_file.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pointcloud_from_text_file.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pointcloud_to_text_file.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/surfer_bln.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svg.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wasp_map.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wktb.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xyz.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/shapes/io_shapes_dxf/Makefile.in b/src/modules_io/shapes/io_shapes_dxf/Makefile.in
deleted file mode 100644
index c0e25f3..0000000
--- a/src/modules_io/shapes/io_shapes_dxf/Makefile.in
+++ /dev/null
@@ -1,606 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/shapes/io_shapes_dxf
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_shapes_dxf_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_shapes_dxf_la_OBJECTS = dxf_import.lo MLB_Interface.lo \
-	dl_dxf.lo dl_writer_ascii.lo
-libio_shapes_dxf_la_OBJECTS = $(am_libio_shapes_dxf_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_shapes_dxf_la_SOURCES)
-DIST_SOURCES = $(libio_shapes_dxf_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libio_shapes_dxf.la
-libio_shapes_dxf_la_SOURCES = \
-dxf_import.cpp\
-MLB_Interface.cpp\
-./dxflib/dl_dxf.cpp\
-./dxflib/dl_writer_ascii.cpp\
-dxf_import.h\
-MLB_Interface.h\
-./dxflib/dl_attributes.h\
-./dxflib/dl_codes.h\
-./dxflib/dl_creationadapter.h\
-./dxflib/dl_creationinterface.h\
-./dxflib/dl_dxf.h\
-./dxflib/dl_entities.h\
-./dxflib/dl_exception.h\
-./dxflib/dl_extrusion.h\
-./dxflib/dl_writer.h\
-./dxflib/dl_writer_ascii.h
-
-libio_shapes_dxf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/shapes/io_shapes_dxf/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/shapes/io_shapes_dxf/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_shapes_dxf.la: $(libio_shapes_dxf_la_OBJECTS) $(libio_shapes_dxf_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_shapes_dxf_la_OBJECTS) $(libio_shapes_dxf_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dl_dxf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dl_writer_ascii.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dxf_import.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-dl_dxf.lo: ./dxflib/dl_dxf.cpp
- at am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dl_dxf.lo -MD -MP -MF $(DEPDIR)/dl_dxf.Tpo -c -o dl_dxf.lo `test -f './dxflib/dl_dxf.cpp' || echo '$(srcdir)/'`./dxflib/dl_dxf.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dl_dxf.Tpo $(DEPDIR)/dl_dxf.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./dxflib/dl_dxf.cpp' object='dl_dxf.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dl_dxf.lo `test -f './dxflib/dl_dxf.cpp' || echo '$(srcdir)/'`./dxflib/dl_dxf.cpp
-
-dl_writer_ascii.lo: ./dxflib/dl_writer_ascii.cpp
- at am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dl_writer_ascii.lo -MD -MP -MF $(DEPDIR)/dl_writer_ascii.Tpo -c -o dl_writer_ascii.lo `test -f './dxflib/dl_writer_ascii.cpp' || echo '$(srcdir)/'`./dxflib/dl_writer_ascii.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dl_writer_ascii.Tpo $(DEPDIR)/dl_writer_ascii.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='./dxflib/dl_writer_ascii.cpp' object='dl_writer_ascii.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dl_writer_ascii.lo `test -f './dxflib/dl_writer_ascii.cpp' || echo '$(srcdir)/'`./dxflib/dl_writer_ascii.cpp
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/shapes/io_shapes_las/Makefile.in b/src/modules_io/shapes/io_shapes_las/Makefile.in
deleted file mode 100644
index 26f54d1..0000000
--- a/src/modules_io/shapes/io_shapes_las/Makefile.in
+++ /dev/null
@@ -1,588 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/shapes/io_shapes_las
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
- at HAVE_LLAS_TRUE@libio_shapes_las_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am__libio_shapes_las_la_SOURCES_DIST = las_export.cpp las_import.cpp \
-	las_info.cpp MLB_Interface.cpp las_export.h las_import.h \
-	las_info.h MLB_Interface.h
- at HAVE_LLAS_TRUE@am_libio_shapes_las_la_OBJECTS = las_export.lo \
- at HAVE_LLAS_TRUE@	las_import.lo las_info.lo MLB_Interface.lo
-libio_shapes_las_la_OBJECTS = $(am_libio_shapes_las_la_OBJECTS)
- at HAVE_LLAS_TRUE@am_libio_shapes_las_la_rpath = -rpath $(pkglibdir)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_shapes_las_la_SOURCES)
-DIST_SOURCES = $(am__libio_shapes_las_la_SOURCES_DIST)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE
- at HAVE_LLAS_TRUE@DEP_LIBS = -llas
- at HAVE_LLAS_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
- at HAVE_LLAS_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core
- at HAVE_LLAS_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
- at HAVE_LLAS_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS)
- at HAVE_LLAS_TRUE@pkglib_LTLIBRARIES = libio_shapes_las.la
- at HAVE_LLAS_TRUE@libio_shapes_las_la_SOURCES = \
- at HAVE_LLAS_TRUE@las_export.cpp\
- at HAVE_LLAS_TRUE@las_import.cpp\
- at HAVE_LLAS_TRUE@las_info.cpp\
- at HAVE_LLAS_TRUE@MLB_Interface.cpp\
- at HAVE_LLAS_TRUE@las_export.h\
- at HAVE_LLAS_TRUE@las_import.h\
- at HAVE_LLAS_TRUE@las_info.h\
- at HAVE_LLAS_TRUE@MLB_Interface.h
-
- at HAVE_LLAS_TRUE@libio_shapes_las_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/shapes/io_shapes_las/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/shapes/io_shapes_las/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_shapes_las.la: $(libio_shapes_las_la_OBJECTS) $(libio_shapes_las_la_DEPENDENCIES) 
-	$(CXXLINK) $(am_libio_shapes_las_la_rpath) $(libio_shapes_las_la_OBJECTS) $(libio_shapes_las_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/las_export.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/las_import.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/las_info.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/table/Makefile.am b/src/modules_io/table/Makefile.am
deleted file mode 100644
index d672377..0000000
--- a/src/modules_io/table/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = io_table
diff --git a/src/modules_io/table/Makefile.in b/src/modules_io/table/Makefile.in
deleted file mode 100644
index d9a2d4c..0000000
--- a/src/modules_io/table/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/table
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = io_table
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/table/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/table/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_io/table/io_table/Makefile.in b/src/modules_io/table/io_table/Makefile.in
deleted file mode 100644
index fc62987..0000000
--- a/src/modules_io/table/io_table/Makefile.in
+++ /dev/null
@@ -1,577 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_io/table/io_table
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_table_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_table_la_OBJECTS = io_table_txt.lo MLB_Interface.lo
-libio_table_la_OBJECTS = $(am_libio_table_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libio_table_la_SOURCES)
-DIST_SOURCES = $(libio_table_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libio_table.la
-libio_table_la_SOURCES = \
-io_table_txt.cpp\
-MLB_Interface.cpp\
-io_table_txt.h\
-MLB_Interface.h
-
-libio_table_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_io/table/io_table/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_io/table/io_table/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libio_table.la: $(libio_table_la_OBJECTS) $(libio_table_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libio_table_la_OBJECTS) $(libio_table_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/io_table_txt.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_lectures/Makefile.am b/src/modules_lectures/Makefile.am
deleted file mode 100644
index 9b973f4..0000000
--- a/src/modules_lectures/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = lectures
diff --git a/src/modules_lectures/Makefile.in b/src/modules_lectures/Makefile.in
deleted file mode 100644
index 42eaa83..0000000
--- a/src/modules_lectures/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_lectures
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = lectures
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_lectures/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_lectures/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_lectures/lectures/Makefile.am b/src/modules_lectures/lectures/Makefile.am
deleted file mode 100644
index 7b7f00d..0000000
--- a/src/modules_lectures/lectures/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = lectures_introduction
diff --git a/src/modules_lectures/lectures/Makefile.in b/src/modules_lectures/lectures/Makefile.in
deleted file mode 100644
index a48a048..0000000
--- a/src/modules_lectures/lectures/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_lectures/lectures
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = lectures_introduction
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_lectures/lectures/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_lectures/lectures/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_04.cpp b/src/modules_lectures/lectures/lectures_introduction/Exercise_04.cpp
deleted file mode 100644
index 60ec908..0000000
--- a/src/modules_lectures/lectures/lectures_introduction/Exercise_04.cpp
+++ /dev/null
@@ -1,449 +0,0 @@
-/**********************************************************
- * Version $Id: Exercise_04.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       Lectures                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Exercise_04.cpp                     //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Exercise_04.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CExercise_04::CExercise_04(void)
-{
-	//-----------------------------------------------------
-	// Give some information about your module...
-
-	Set_Name	(_TL("04: Direct neighbours - more..."));
-
-	Set_Author	(_TL("Copyrights (c) 2003 by Olaf Conrad"));
-
-	Set_Description	(_TW(
-		"Simple neighbourhood analysis for grid cells.\n"
-		"(c) 2003 by Olaf Conrad, Goettingen\n"
-		"email: oconrad at gwdg.de")
-	);
-
-
-	//-----------------------------------------------------
-	// Define your parameters list...
-
-	Parameters.Add_Grid(
-		NULL, "INPUT"	, _TL("Input grid"),
-		_TL("This must be your input data of type grid."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "OUTPUT"	, _TL("Output"),
-		_TL("This will contain your output data of type grid."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL, "METHOD"	, _TL("Method"),
-		_TL("Choose a method"),
-
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-			_TL("Arithmetic mean (version 1)"),
-			_TL("Arithmetic mean (version 2)"),
-			_TL("Difference from all neighbour's mean"),
-			_TL("Variance (version 1)"),
-			_TL("Variance (version 2)"),
-			_TL("Standard deviation")
-		)
-	);
-}
-
-//---------------------------------------------------------
-CExercise_04::~CExercise_04(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CExercise_04::On_Execute(void)
-{
-	bool	bResult;
-	int		Method;
-
-	//-----------------------------------------------------
-	// Get parameter settings...
-
-	m_pInput	= Parameters("INPUT" )->asGrid();
-	m_pOutput	= Parameters("OUTPUT")->asGrid();
-
-	Method		= Parameters("METHOD")->asInt();
-
-
-	//-----------------------------------------------------
-	// Execute calculation...
-
-	switch( Method )
-	{
-	case 0:
-		bResult	= Method_01();
-		break;
-
-	case 1:
-		bResult	= Method_02();
-		break;
-
-	case 2:
-		bResult	= Method_03();
-		break;
-
-	case 3:
-		bResult	= Method_04();
-		break;
-
-	case 4:
-		bResult	= Method_05();
-		break;
-
-	case 5:
-		bResult	= Method_06();
-		break;
-
-	default:
-		bResult	= false;
-	}
-
-
-	//-----------------------------------------------------
-	// Return 'true' if everything went okay...
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CExercise_04::Method_01(void)
-{
-	int		x, y, ix, iy, n;
-	double	s;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			s	= 0.0;
-			n	= 0;
-
-			for(iy=y-1; iy<=y+1; iy++)
-			{
-				for(ix=x-1; ix<=x+1; ix++)
-				{
-					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
-					{
-						s	+= m_pInput->asDouble(ix, iy);
-						n++;
-					}
-				}
-			}
-
-			if( n > 0 )
-			{
-				m_pOutput->Set_Value(x, y, s / n);
-			}
-			else
-			{
-				m_pOutput->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CExercise_04::Method_02(void)
-{
-	int		x, y, i, ix, iy, n;
-	double	s;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pInput->is_NoData(x, y) )
-			{
-				m_pOutput->Set_NoData(x, y);
-			}
-			else
-			{
-				s	= m_pInput->asDouble(x, y);
-				n	= 1;
-
-				for(i=0; i<8; i++)
-				{
-					ix	= Get_xTo(i, x);
-					iy	= Get_yTo(i, y);
-
-					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
-					{
-						s	+= m_pInput->asDouble(ix, iy);
-						n++;
-					}
-				}
-
-				m_pOutput->Set_Value(x, y, s / n);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CExercise_04::Method_03(void)
-{
-	int		x, y, i, ix, iy, n;
-	double	s;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pInput->is_NoData(x, y) )
-			{
-				m_pOutput->Set_NoData(x, y);
-			}
-			else
-			{
-				s	= 0.0;
-				n	= 0;
-
-				for(i=0; i<8; i++)
-				{
-					ix	= Get_xTo(i, x);
-					iy	= Get_yTo(i, y);
-
-					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
-					{
-						s	+= m_pInput->asDouble(ix, iy);
-						n++;
-					}
-				}
-
-				if( n > 0 )
-				{
-					m_pOutput->Set_Value(x, y, m_pInput->asDouble(x, y) - s / n);
-				}
-				else
-				{
-					m_pOutput->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CExercise_04::Method_04(void)
-{
-	int		x, y, i, ix, iy, n;
-	double	m, v, z[9], dz;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0, ix=1; x<Get_NX(); x++, ix++)
-		{
-			for(n=0, iy=y-1; iy<=y+1; iy++)
-			{
-				for(ix=x-1; ix<=x+1; ix++)
-				{
-					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
-					{
-						z[n++]	= m_pInput->asDouble(ix, iy);
-					}
-				}
-			}
-
-			if( n > 0 )
-			{
-				for(m=0.0, i=0; i<n; i++)
-				{
-					m	+= z[i];
-				}
-
-				m	/= n;
-
-				for(v=0.0, i=0; i<n; i++)
-				{
-					dz	 = m - z[i];
-					v	+= dz * dz;
-				}
-
-				v	/= n;
-
-				m_pOutput->Set_Value(x, y, v);
-			}
-			else
-			{
-				m_pOutput->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CExercise_04::Method_05(void)
-{
-	int		x, y, ix, iy, n;
-	double	m, v, z;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			n	= 0;
-			m	= 0.0;
-			v	= 0.0;
-
-			for(iy=y-1; iy<=y+1; iy++)
-			{
-				for(ix=x-1; ix<=x+1; ix++)
-				{
-					if( is_InGrid(ix, iy) && !m_pInput->is_NoData(ix, iy) )
-					{
-						n++;
-
-						z	 = m_pInput->asDouble(ix, iy);
-
-						m	+= z;
-						v	+= z * z;
-					}
-				}
-			}
-
-			if( n > 0 )
-			{
-				m	= m / n;
-				v	= v / n - m * m;
-
-				m_pOutput->Set_Value(x, y, v);
-			}
-			else
-			{
-				m_pOutput->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CExercise_04::Method_06(void)
-{
-	long	n;
-	double	v;
-
-	//-----------------------------------------------------
-	if( Method_05() == false )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( m_pOutput->is_NoData(n) == false )
-		{
-			v	= m_pOutput->asDouble(n);
-
-			m_pOutput->Set_Value(n, sqrt(v));
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_08.cpp b/src/modules_lectures/lectures/lectures_introduction/Exercise_08.cpp
deleted file mode 100644
index ca5a8ea..0000000
--- a/src/modules_lectures/lectures/lectures_introduction/Exercise_08.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/**********************************************************
- * Version $Id: Exercise_08.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       Lectures                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Exercise_08.cpp                     //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Exercise_08.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CExercise_08::CExercise_08(void)
-{
-	//-----------------------------------------------------
-	// Give some information about your module...
-
-	Set_Name	(_TL("08: Extended neighbourhoods - catchment areas (parallel)"));
-
-	Set_Author	(_TL("Copyrights (c) 2003 by Olaf Conrad"));
-
-	Set_Description	(_TW(
-		"Extended Neighbourhoods - Catchment areas.\n"
-		"(c) 2003 by Olaf Conrad, Goettingen\n"
-		"email: oconrad at gwdg.de")
-	);
-
-
-	//-----------------------------------------------------
-	// Define your parameters list...
-
-	Parameters.Add_Grid(
-		NULL, "ELEVATION"	, _TL("Elevation grid"),
-		_TL("This must be your input data of type grid."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "AREA"		, _TL("Catchment area"),
-		_TL("This will contain your output data of type grid."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL, "METHOD"		, _TL("Method"),
-		_TL("Choose a method"),
-
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("D8"),
-			_TL("MFD")
-		)
-	);
-}
-
-//---------------------------------------------------------
-CExercise_08::~CExercise_08(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CExercise_08::On_Execute(void)
-{
-	bool	bResult;
-	int		Method;
-
-	//-----------------------------------------------------
-	// Get parameter settings...
-
-	m_pDTM		= Parameters("ELEVATION")->asGrid();
-
-	m_pArea		= Parameters("AREA"     )->asGrid();
-
-	Method		= Parameters("METHOD")->asInt();
-
-
-	m_pArea		->Assign(0.0);
-	m_pArea		->Set_Unit(SG_T("m\xc2\xb2"));
-	DataObject_Set_Colors(m_pArea, 100, SG_COLORS_WHITE_BLUE);
-
-
-	//-----------------------------------------------------
-	// Execute calculation...
-
-	switch( Method )
-	{
-	case 0:
-		bResult	= Method_01();
-		break;
-
-	case 1:
-		bResult	= Method_02();
-		break;
-
-	default:
-		bResult	= false;
-	}
-
-
-	//-----------------------------------------------------
-	// Return 'true' if everything went okay...
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CExercise_08::Method_01(void)
-{
-	int		x, y, i, ix, iy, iMax;
-	double	z, dz, dzMax,
-			Area_of_Cell	= Get_Cellsize() * Get_Cellsize();
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		m_pDTM->Get_Sorted(n, x, y, true, false);
-
-		if( m_pDTM->is_NoData(x, y) )
-		{
-			m_pArea->Set_NoData(x, y);
-		}
-		else
-		{
-			m_pArea->Add_Value(x, y, Area_of_Cell);
-
-			z		= m_pDTM->asDouble(x, y);
-			iMax	= -1;
-
-			for(i=0; i<8; i++)
-			{
-				ix		= Get_xTo(i, x);
-				iy		= Get_yTo(i, y);
-
-				if( is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) )
-				{
-					dz	= (z - m_pDTM->asDouble(ix, iy)) / Get_Length(i);
-
-					if( dz > 0.0 && (iMax < 0 || (iMax >= 0 && dzMax < dz)) )
-					{
-						iMax	= i;
-						dzMax	= dz;
-					}
-				}
-			}
-
-			if( iMax >= 0 )
-			{
-				ix		= Get_xTo(iMax, x);
-				iy		= Get_yTo(iMax, y);
-
-				m_pArea->Add_Value(ix, iy, m_pArea->asDouble(x, y));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CExercise_08::Method_02(void)
-{
-	int		x, y, i, ix, iy;
-	double	z, d, dz[8], dzSum,
-			Area_of_Cell	= Get_Cellsize() * Get_Cellsize(),
-			MFD_Converge	= 1.1;
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		m_pDTM->Get_Sorted(n, x, y, true, false);
-
-		if( m_pDTM->is_NoData(x, y) )
-		{
-			m_pArea->Set_NoData(x, y);
-		}
-		else
-		{
-			m_pArea->Add_Value(x, y, Area_of_Cell);
-
-			z		= m_pDTM->asDouble(x, y);
-			dzSum	= 0.0;
-
-			for(i=0; i<8; i++)
-			{
-				ix		= Get_xTo(i, x);
-				iy		= Get_yTo(i, y);
-
-				if( is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) && (d = z - m_pDTM->asDouble(ix, iy)) > 0.0 )
-				{
-					dz[i]	= pow(d / Get_Length(i), MFD_Converge);
-					dzSum	+= dz[i];
-				}
-				else
-				{
-					dz[i]	= 0.0;
-				}
-			}
-
-			if( dzSum > 0.0 )
-			{
-				d		= m_pArea->asDouble(x, y) / dzSum;
-
-				for(i=0; i<8; i++)
-				{
-					if( dz[i] > 0.0 )
-					{
-						ix		= Get_xTo(i, x);
-						iy		= Get_yTo(i, y);
-
-						m_pArea->Add_Value(ix, iy, dz[i] * d);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
diff --git a/src/modules_lectures/lectures/lectures_introduction/Exercise_14.cpp b/src/modules_lectures/lectures/lectures_introduction/Exercise_14.cpp
deleted file mode 100644
index 8580596..0000000
--- a/src/modules_lectures/lectures/lectures_introduction/Exercise_14.cpp
+++ /dev/null
@@ -1,376 +0,0 @@
-/**********************************************************
- * Version $Id: Exercise_14.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    Lectures_Shapes                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Exercise_14.cpp                     //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Exercise_14.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//						Defines							 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define NOCHANNEL	0
-#define SPRING		1
-#define CHANNEL		2
-#define MOUTH		3
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CExercise_14::CExercise_14(void)
-{
-	//-----------------------------------------------------
-	// Give some information about your module...
-
-	Set_Name	(_TL("14: Vectorising channel lines"));
-
-	Set_Author	(_TL("Copyrights (c) 2003 by Olaf Conrad"));
-
-	Set_Description	(_TW(
-		"Vectorising channel lines.\n"
-		"(c) 2003 by Olaf Conrad, Goettingen\n"
-		"email: oconrad at gwdg.de")
-	);
-
-
-	//-----------------------------------------------------
-	// Define your parameters list...
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation grid"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHANNELS"	, _TL("Channels (Raster)"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Channels (Vector)"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRESHOLD"	, _TL("Threshold"),
-		_TL(""),
-		PARAMETER_TYPE_Int	, 4, 0, true, 8, true
-	);
-}
-
-//---------------------------------------------------------
-CExercise_14::~CExercise_14(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CExercise_14::On_Execute(void)
-{
-	int		Threshold;
-
-	//-----------------------------------------------------
-	m_pDTM		= Parameters("ELEVATION")	->asGrid();
-	m_pChnl		= Parameters("CHANNELS")	->asGrid();
-	m_pShapes	= Parameters("SHAPES")		->asShapes();
-
-	Threshold	= Parameters("THRESHOLD")	->asInt();
-
-	//-----------------------------------------------------
-	m_pDir		= NULL;
-
-	if( Initialise(Threshold) )
-	{
-		Find_Channels();
-
-		Vectorise();
-	}
-
-	//-----------------------------------------------------
-	if( m_pDir )
-	{
-		delete(m_pDir);
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CExercise_14::Initialise(int Threshold)
-{
-	int		x, y, i, ix, iy, Dir;
-	double	z, dz, dzMax;
-	CSG_Colors	Colors;
-
-	//-----------------------------------------------------
-	m_pDir	= new CSG_Grid(m_pDTM, SG_DATATYPE_Char);
-
-	m_pChnl->Assign();
-
-	Colors.Set_Count(4);
-	Colors.Set_Color(0, 192, 192, 192);	// NOCHANNEL
-	Colors.Set_Color(1,   0, 255,   0);	// SPRING
-	Colors.Set_Color(2,   0,   0, 255);	// CHANNEL
-	Colors.Set_Color(3, 255,   0,   0);	// MOUTH
-	DataObject_Set_Colors(m_pChnl, Colors);
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			Dir		= -1;
-
-			if( is_InGrid(x, y) && !m_pDTM->is_NoData(x, y) )
-			{
-				z		= m_pDTM->asDouble(x, y);
-				dzMax	= 0.0;
-
-				for(i=0; i<8; i++)
-				{
-					ix		= Get_xTo(i, x);
-					iy		= Get_yTo(i, y);
-
-					if( is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) )
-					{
-						dz		= (z - m_pDTM->asDouble(ix, iy)) / Get_Length(i);
-
-						if( dz > dzMax )
-						{
-							dzMax	= dz;
-							Dir		= i;
-						}
-					}
-				}
-			}
-
-			//---------------------------------------------
-			m_pDir->Set_Value(x, y, Dir);
-
-			if( Dir >= 0 )
-			{
-				m_pChnl->Add_Value(Get_xTo(Dir, x), Get_yTo(Dir, y), 1);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			m_pChnl->Set_Value(x, y, m_pChnl->asInt(x, y) >= Threshold ? SPRING : NOCHANNEL);
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CExercise_14::Find_Channels(void)
-{
-	int		x, y;
-
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( m_pDTM->Get_Sorted(n, x, y, true) && m_pChnl->asInt(x, y) == SPRING )
-		{
-			m_pChnl	->Set_Value(x, y, SPRING);
-
-			Find_Channels(x, y);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CExercise_14::Find_Channels(int x, int y)
-{
-	int		Dir, ix, iy;
-
-	if( (Dir = m_pDir->asInt(x, y)) >= 0 )
-	{
-		ix	= Get_xTo(Dir, x);
-		iy	= Get_yTo(Dir, y);
-
-		switch( m_pChnl->asInt(ix, iy) )
-		{
-		case NOCHANNEL: case SPRING:
-			m_pChnl	->Set_Value(ix, iy, CHANNEL);
-			Find_Channels(ix, iy);	// recursive function call...
-			break;
-
-		case CHANNEL:
-			m_pChnl	->Set_Value(ix, iy, MOUTH);
-			break;
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CExercise_14::Vectorise(void)
-{
-	int			x, y, Segment_ID;
-	double		Length;
-	CSG_Shape	*pSegment;
-
-	m_pShapes->Create(SHAPE_TYPE_Line, _TL("Channels"));
-
-	m_pShapes->Add_Field("SEGMENT_ID"	, SG_DATATYPE_Int);
-	m_pShapes->Add_Field("LENGTH"		, SG_DATATYPE_Double);
-
-	//-----------------------------------------------------
-	for(y=0, Segment_ID=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			switch( m_pChnl->asInt(x, y) )
-			{
-			case SPRING: case MOUTH:
-				pSegment	= m_pShapes->Add_Shape();
-
-				Length		= Vectorise(x, y, pSegment);
-
-				if( Length > 0.0 )
-				{
-					pSegment->Set_Value(0, ++Segment_ID);
-					pSegment->Set_Value(1, Length);
-				}
-				else
-				{
-					m_pShapes->Del_Shape(pSegment);
-				}
-
-				break;
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-double CExercise_14::Vectorise(int x, int y, CSG_Shape *pSegment)
-{
-	int		Dir, ix, iy;
-	double	Length;
-
-	Length	= 0.0;
-
-	pSegment->Add_Point(Get_XMin() + x * Get_Cellsize(), Get_YMin() + y * Get_Cellsize());
-
-	if( (Dir = m_pDir->asInt(x, y)) >= 0 )
-	{
-		Length	= Get_Length(Dir);
-
-		ix		= Get_xTo(Dir, x);
-		iy		= Get_yTo(Dir, y);
-
-		switch( m_pChnl->asInt(ix, iy) )
-		{
-		case CHANNEL:
-			Length	+= Vectorise(ix, iy, pSegment);	// recursive function call...
-			break;
-
-		case MOUTH:
-			Length	+= Get_Length(Dir);
-			pSegment->Add_Point(Get_XMin() + ix * Get_Cellsize(), Get_YMin() + iy * Get_Cellsize());
-			break;
-		}
-	}
-
-	return( Length );
-}
diff --git a/src/modules_lectures/lectures/lectures_introduction/MLB_Interface.h b/src/modules_lectures/lectures/lectures_introduction/MLB_Interface.h
deleted file mode 100644
index fd41e02..0000000
--- a/src/modules_lectures/lectures/lectures_introduction/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       Lectures                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__lectures_H
-#define HEADER_INCLUDED__lectures_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef lectures_EXPORTS
-	#define	lectures_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	lectures_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__lectures_H
diff --git a/src/modules_lectures/lectures/lectures_introduction/Makefile.am b/src/modules_lectures/lectures/lectures_introduction/Makefile.am
deleted file mode 100644
index 3e78e5b..0000000
--- a/src/modules_lectures/lectures/lectures_introduction/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = liblectures_introduction.la
-liblectures_introduction_la_SOURCES =\
-Exercise_01.cpp\
-Exercise_02.cpp\
-Exercise_03.cpp\
-Exercise_04.cpp\
-Exercise_05.cpp\
-Exercise_06.cpp\
-Exercise_07.cpp\
-Exercise_08.cpp\
-Exercise_09.cpp\
-Exercise_10.cpp\
-Exercise_11.cpp\
-Exercise_12.cpp\
-Exercise_13.cpp\
-Exercise_14.cpp\
-MLB_Interface.cpp\
-Exercise_01.h\
-Exercise_02.h\
-Exercise_03.h\
-Exercise_04.h\
-Exercise_05.h\
-Exercise_06.h\
-Exercise_07.h\
-Exercise_08.h\
-Exercise_09.h\
-Exercise_10.h\
-Exercise_11.h\
-Exercise_12.h\
-Exercise_13.h\
-Exercise_14.h\
-MLB_Interface.h
-
-liblectures_introduction_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_lectures/lectures/lectures_introduction/Makefile.in b/src/modules_lectures/lectures/lectures_introduction/Makefile.in
deleted file mode 100644
index a1b717d..0000000
--- a/src/modules_lectures/lectures/lectures_introduction/Makefile.in
+++ /dev/null
@@ -1,621 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_lectures/lectures/lectures_introduction
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-liblectures_introduction_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_liblectures_introduction_la_OBJECTS = Exercise_01.lo Exercise_02.lo \
-	Exercise_03.lo Exercise_04.lo Exercise_05.lo Exercise_06.lo \
-	Exercise_07.lo Exercise_08.lo Exercise_09.lo Exercise_10.lo \
-	Exercise_11.lo Exercise_12.lo Exercise_13.lo Exercise_14.lo \
-	MLB_Interface.lo
-liblectures_introduction_la_OBJECTS =  \
-	$(am_liblectures_introduction_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(liblectures_introduction_la_SOURCES)
-DIST_SOURCES = $(liblectures_introduction_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = liblectures_introduction.la
-liblectures_introduction_la_SOURCES = \
-Exercise_01.cpp\
-Exercise_02.cpp\
-Exercise_03.cpp\
-Exercise_04.cpp\
-Exercise_05.cpp\
-Exercise_06.cpp\
-Exercise_07.cpp\
-Exercise_08.cpp\
-Exercise_09.cpp\
-Exercise_10.cpp\
-Exercise_11.cpp\
-Exercise_12.cpp\
-Exercise_13.cpp\
-Exercise_14.cpp\
-MLB_Interface.cpp\
-Exercise_01.h\
-Exercise_02.h\
-Exercise_03.h\
-Exercise_04.h\
-Exercise_05.h\
-Exercise_06.h\
-Exercise_07.h\
-Exercise_08.h\
-Exercise_09.h\
-Exercise_10.h\
-Exercise_11.h\
-Exercise_12.h\
-Exercise_13.h\
-Exercise_14.h\
-MLB_Interface.h
-
-liblectures_introduction_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_lectures/lectures/lectures_introduction/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_lectures/lectures/lectures_introduction/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-liblectures_introduction.la: $(liblectures_introduction_la_OBJECTS) $(liblectures_introduction_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(liblectures_introduction_la_OBJECTS) $(liblectures_introduction_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_01.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_02.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_03.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_04.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_05.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_06.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_07.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_08.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_09.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_10.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_11.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_12.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_13.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Exercise_14.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_projection/Makefile.am b/src/modules_projection/Makefile.am
deleted file mode 100644
index 41b34bc..0000000
--- a/src/modules_projection/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = pj_proj4 pj_georeference
diff --git a/src/modules_projection/Makefile.in b/src/modules_projection/Makefile.in
deleted file mode 100644
index b59db7e..0000000
--- a/src/modules_projection/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_projection
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = pj_proj4 pj_georeference
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_projection/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_projection/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_projection/pj_georeference/Makefile.am b/src/modules_projection/pj_georeference/Makefile.am
deleted file mode 100644
index f37fe1c..0000000
--- a/src/modules_projection/pj_georeference/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = pj_georeference
diff --git a/src/modules_projection/pj_georeference/Makefile.in b/src/modules_projection/pj_georeference/Makefile.in
deleted file mode 100644
index 23a78c2..0000000
--- a/src/modules_projection/pj_georeference/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_projection/pj_georeference
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = pj_georeference
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_projection/pj_georeference/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_projection/pj_georeference/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_projection/pj_georeference/pj_georeference/Makefile.in b/src/modules_projection/pj_georeference/pj_georeference/Makefile.in
deleted file mode 100644
index c8f8dca..0000000
--- a/src/modules_projection/pj_georeference/pj_georeference/Makefile.in
+++ /dev/null
@@ -1,598 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_projection/pj_georeference/pj_georeference
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libpj_georeference_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libpj_georeference_la_OBJECTS = Collect_Points.lo \
-	direct_georeferencing.lo Georef_Engine.lo Georef_Grid.lo \
-	georef_grid_move.lo Georef_Shapes.lo MLB_Interface.lo \
-	set_grid_georeference.lo
-libpj_georeference_la_OBJECTS = $(am_libpj_georeference_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libpj_georeference_la_SOURCES)
-DIST_SOURCES = $(libpj_georeference_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1843 2013-09-18 10:49:15Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@DEP_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) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libpj_georeference.la
-libpj_georeference_la_SOURCES = \
-Collect_Points.cpp\
-direct_georeferencing.cpp\
-Georef_Engine.cpp\
-Georef_Grid.cpp\
-georef_grid_move.cpp\
-Georef_Shapes.cpp\
-MLB_Interface.cpp\
-set_grid_georeference.cpp\
-Collect_Points.h\
-direct_georeferencing.h\
-Georef_Engine.h\
-Georef_Grid.h\
-georef_grid_move.h\
-Georef_Shapes.h\
-MLB_Interface.h\
-set_grid_georeference.h
-
-libpj_georeference_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_projection/pj_georeference/pj_georeference/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_projection/pj_georeference/pj_georeference/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libpj_georeference.la: $(libpj_georeference_la_OBJECTS) $(libpj_georeference_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libpj_georeference_la_OBJECTS) $(libpj_georeference_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Collect_Points.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Georef_Engine.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Georef_Grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Georef_Shapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/direct_georeferencing.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/georef_grid_move.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/set_grid_georeference.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_projection/pj_proj4/Makefile.am b/src/modules_projection/pj_proj4/Makefile.am
deleted file mode 100644
index e4ad97d..0000000
--- a/src/modules_projection/pj_proj4/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = pj_proj4
diff --git a/src/modules_projection/pj_proj4/Makefile.in b/src/modules_projection/pj_proj4/Makefile.in
deleted file mode 100644
index f910759..0000000
--- a/src/modules_projection/pj_proj4/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_projection/pj_proj4
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = pj_proj4
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_projection/pj_proj4/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_projection/pj_proj4/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.cpp b/src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.cpp
deleted file mode 100644
index 20a943d..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 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("Projection - Proj.4") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O. Conrad (c) 2004-8") );
-
-	case MLB_INFO_Description:
-		return( _TW(
-			"Coordinate transformation based on the "
-			"<a target=\"_blank\" href=\"http://trac.osgeo.org/proj/\">Proj.4</a> library."
-		));
-
-	case MLB_INFO_Version:
-		return( _TL("2.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Projection") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "crs_assign.h"
-#include "crs_transform_shapes.h"
-#include "crs_transform_grid.h"
-
-#include "PROJ4_Shapes.h"
-#include "PROJ4_Grid.h"
-
-#include "gcs_lon_range.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CCRS_Assign() );
-	case  1:	return( new CCRS_Transform_Shapes(true ) );
-	case  2:	return( new CCRS_Transform_Shapes(false) );
-	case  3:	return( new CCRS_Transform_Grid  (true ) );
-	case  4:	return( new CCRS_Transform_Grid  (false) );
-
-	case  5:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_SIMPLE, false) );
-	case  6:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_DIALOG, false) );
-	case  7:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_SIMPLE, false) );
-	case  8:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_DIALOG, false) );
-	case  9:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_SIMPLE, true) );
-	case 10:	return( new CPROJ4_Shapes	(PROJ4_INTERFACE_DIALOG, true) );
-	case 11:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_SIMPLE, true) );
-	case 12:	return( new CPROJ4_Grid		(PROJ4_INTERFACE_DIALOG, true) );
-
-	case 13:	return( new CGCS_Grid_Longitude_Range() );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_projection/pj_proj4/pj_proj4/Makefile.am b/src/modules_projection/pj_proj4/pj_proj4/Makefile.am
deleted file mode 100644
index 8be79bf..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# $Id: Makefile.am 1443 2012-07-10 10:29:32Z oconrad $
-#
-DEP_LIBS = -lproj
-if DEBUG
-DBGFLAGS = -g -DDEBUG
-endif
-if SAGA_UNICODE
-DEP_DEFS = -D_SAGA_UNICODE
-endif
-DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS           = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS)
-AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS         = -fPIC -shared -avoid-version $(DEP_LIBS) $(LOCAL_LIBS)
-pkglib_LTLIBRARIES = libpj_proj4.la
-libpj_proj4_la_SOURCES =\
-MLB_Interface.cpp\
-crs_assign.cpp\
-crs_base.cpp\
-crs_transform.cpp\
-crs_transform_grid.cpp\
-crs_transform_shapes.cpp\
-gcs_lon_range.cpp\
-PROJ4_Base.cpp\
-PROJ4_Grid.cpp\
-PROJ4_Shapes.cpp\
-MLB_Interface.h\
-crs_assign.h\
-crs_base.h\
-crs_transform.h\
-crs_transform_grid.h\
-crs_transform_shapes.h\
-gcs_lon_range.h\
-PROJ4_Base.h\
-PROJ4_Grid.h\
-PROJ4_Shapes.h
-
-libpj_proj4_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/modules_projection/pj_proj4/pj_proj4/Makefile.in b/src/modules_projection/pj_proj4/pj_proj4/Makefile.in
deleted file mode 100644
index 3dd8c80..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/Makefile.in
+++ /dev/null
@@ -1,604 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_projection/pj_proj4/pj_proj4
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libpj_proj4_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libpj_proj4_la_OBJECTS = MLB_Interface.lo crs_assign.lo crs_base.lo \
-	crs_transform.lo crs_transform_grid.lo crs_transform_shapes.lo \
-	gcs_lon_range.lo PROJ4_Base.lo PROJ4_Grid.lo PROJ4_Shapes.lo
-libpj_proj4_la_OBJECTS = $(am_libpj_proj4_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libpj_proj4_la_SOURCES)
-DIST_SOURCES = $(libpj_proj4_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1443 2012-07-10 10:29:32Z oconrad $
-#
-DEP_LIBS = -lproj
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@DEP_DEFS = -D_SAGA_UNICODE
-DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
-CXX_INCS = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS)
-AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS) $(LOCAL_LIBS)
-pkglib_LTLIBRARIES = libpj_proj4.la
-libpj_proj4_la_SOURCES = \
-MLB_Interface.cpp\
-crs_assign.cpp\
-crs_base.cpp\
-crs_transform.cpp\
-crs_transform_grid.cpp\
-crs_transform_shapes.cpp\
-gcs_lon_range.cpp\
-PROJ4_Base.cpp\
-PROJ4_Grid.cpp\
-PROJ4_Shapes.cpp\
-MLB_Interface.h\
-crs_assign.h\
-crs_base.h\
-crs_transform.h\
-crs_transform_grid.h\
-crs_transform_shapes.h\
-gcs_lon_range.h\
-PROJ4_Base.h\
-PROJ4_Grid.h\
-PROJ4_Shapes.h
-
-libpj_proj4_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_projection/pj_proj4/pj_proj4/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_projection/pj_proj4/pj_proj4/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libpj_proj4.la: $(libpj_proj4_la_OBJECTS) $(libpj_proj4_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libpj_proj4_la_OBJECTS) $(libpj_proj4_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PROJ4_Base.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PROJ4_Grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PROJ4_Shapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_assign.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_base.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_transform.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_transform_grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crs_transform_shapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gcs_lon_range.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_assign.cpp b/src/modules_projection/pj_proj4/pj_proj4/crs_assign.cpp
deleted file mode 100644
index fdc0f0f..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_assign.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/**********************************************************
- * Version $Id: crs_assign.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    crs_assign.cpp                     //
-//                                                       //
-//                 Copyright (C) 2010 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 "crs_assign.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCRS_Assign::CCRS_Assign(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Set Coordinate Reference System"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Define or change the Coordinate Reference System (CRS) "
-		"associated with the supplied data sets."
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_List(
-		NULL	, "GRIDS"	, _TL("Grids"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Shapes_List(
-		NULL	, "SHAPES"	, _TL("Shapes"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-//	Parameters.Add_TIN_List(
-//		NULL	, "TINS"	, _TL("TINs"),
-//		_TL(""),
-//		PARAMETER_INPUT_OPTIONAL
-//	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Assign::On_Execute(void)
-{
-	int	nTotal	= Parameters("GRIDS" )->asList()->Get_Count()
-				+ Parameters("SHAPES")->asList()->Get_Count();
-	//			+ Parameters("TINS"  )->asList()->Get_Count();
-
-	if( nTotal <= 0 )
-	{
-		Message_Dlg(_TL("nothing to do: no data in selection"));
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Projection	Projection;
-
-	if( !Get_Projection(Projection) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int	nProjected	= 0;
-
-	nProjected	+= Set_Projections(Projection, Parameters("GRIDS" )->asList());
-	nProjected	+= Set_Projections(Projection, Parameters("SHAPES")->asList());
-//	nProjected	+= Set_Projections(Projection, Parameters("TINS")  ->asList());
-
-	//-----------------------------------------------------
-	return( nProjected > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CCRS_Assign::Set_Projections(const CSG_Projection &Projection, CSG_Parameter_List *pList)
-{
-	int	nProjected	= 0;
-
-	for(int i=0; i<pList->Get_Count(); i++)
-	{
-		if( pList->asDataObject(i)->Get_Projection().Create(Projection) )
-		{
-			pList->asDataObject(i)->Set_Modified();
-
-			DataObject_Update(pList->asDataObject(i));
-
-			nProjected++;
-		}
-	}
-
-	return( nProjected );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp b/src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp
deleted file mode 100644
index c8d671d..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp
+++ /dev/null
@@ -1,908 +0,0 @@
-/**********************************************************
- * Version $Id: crs_base.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     crs_base.cpp                      //
-//                                                       //
-//                 Copyright (C) 2010 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 "crs_base.h"
-
-#include <projects.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCRS_Base::CCRS_Base(void)
-{
-	m_Projection.Create(4326);
-
-	CSG_Parameter	*pNode_0, *pNode_1;
-
-	//-----------------------------------------------------
-	if( SG_UI_Get_Window_Main() == NULL )
-	{
-		Parameters.Add_Choice(
-			NULL	, "CRS_METHOD"		, _TL("Get CRS Definition from..."),
-			_TL(""),
-			CSG_String::Format(SG_T("%s|%s|%s|"),
-				_TL("Proj4 Parameters"),
-				_TL("EPSG Code"),
-				_TL("Well Known Text File")
-			), 0
-		);
-	}
-
-	//-----------------------------------------------------
-	pNode_0	= Parameters.Add_String(
-		NULL	, "CRS_PROJ4"		, _TL("Proj4 Parameters"),
-		_TL(""),
-		m_Projection.Get_Proj4(), true
-	);
-
-	if( SG_UI_Get_Window_Main() )
-	{
-		Parameters.Add_Parameters(
-			pNode_0	, "CRS_DIALOG"		, _TL("User Defined"),
-			_TL("")
-		);
-
-		Set_User_Parameters(Parameters("CRS_DIALOG")->asParameters());
-	}
-
-	//-----------------------------------------------------
-	if( SG_UI_Get_Window_Main() )
-	{
-		pNode_1	= Parameters.Add_Parameters(pNode_0, "CRS_GRID"  , _TL("Loaded Grid")  , _TL(""));
-
-		pNode_1->asParameters()->Add_Grid(
-			NULL	, "PICK"	, _TL("Grid"),
-			_TL(""),
-			PARAMETER_INPUT_OPTIONAL, false
-		);
-
-		pNode_1	= Parameters.Add_Parameters(pNode_0, "CRS_SHAPES", _TL("Loaded Shapes"), _TL(""));
-
-		pNode_1->asParameters()->Add_Shapes(
-			NULL	, "PICK"	, _TL("Shapes"),
-			_TL(""),
-			PARAMETER_INPUT_OPTIONAL
-		);
-	}
-
-	//-----------------------------------------------------
-	Parameters.Add_FilePath(
-		pNode_0	, "CRS_FILE"		, _TL("Well Known Text File"),
-		_TL(""),
-		CSG_String::Format(
-			SG_T("%s|*.prj;*.wkt;*.txt|%s|*.prj|%s|*.wkt|%s|*.txt|%s|*.*"),
-			_TL("All Recognized Files"),
-			_TL("ESRI WKT Files (*.prj)"),
-			_TL("WKT Files (*.wkt)"),
-			_TL("Text Files (*.txt)"),
-			_TL("All Files")
-		)
-	);
-
-	//-----------------------------------------------------
-	pNode_1	= Parameters.Add_Value(
-		pNode_0	, "CRS_EPSG"	, _TL("EPSG Code"),
-		_TL(""),
-		PARAMETER_TYPE_Int, m_Projection.Get_EPSG(), -1, true, 99999, true
-	);
-
-	if( SG_UI_Get_Window_Main() )
-	{
-		Parameters.Add_Choice(
-			pNode_1	, "CRS_EPSG_GEOGCS"	, _TL("Geographic Coordinate Systems"),
-			_TL(""),
-			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Geographic)
-		);
-
-		Parameters.Add_Choice(
-			pNode_1	, "CRS_EPSG_PROJCS"	, _TL("Projected Coordinate Systems"),
-			_TL(""),
-			SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Projected)
-		);
-	}
-
-	//-----------------------------------------------------
-	Parameters.Add_Value(
-		NULL	, "PRECISE"		, _TL("Precise Datum Conversion"),
-		_TL("avoids precision problems when source and target crs use different geodedtic datums."),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CCRS_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CRS_DIALOG")) )
-	{
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PROJ_TYPE")) )
-		{
-			pParameters->Get_Parameter("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[pParameter->asInt()].id)));
-		}
-
-		return( 1 );
-	}
-
-	//-----------------------------------------------------
-	CSG_Projection	Projection;
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_DIALOG")) )
-	{
-		Projection.Create(Get_User_Definition(*pParameter->asParameters()), SG_PROJ_FMT_Proj4);
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_FILE")) )
-	{
-		Projection.Load(pParameter->asString());
-
-		pParameter->Set_Value("");	// clear
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_EPSG")) )
-	{
-		Projection.Create(pParameter->asInt());
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_EPSG_GEOGCS"))
-	||	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_EPSG_PROJCS")) )
-	{
-		int		EPSG;
-
-		if( pParameter->asChoice()->Get_Data(EPSG) )
-		{
-			Projection.Create(EPSG);
-		}
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_GRID"))
-	||	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_SHAPES")) )
-	{
-		CSG_Data_Object	*pPick	= pParameter->asParameters()->Get_Parameter("PICK")->asDataObject();
-
-		if( pPick && pPick->Get_Projection().is_Okay() )
-		{
-			Projection.Create(pPick->Get_Projection());
-		}
-	}
-
-	//-----------------------------------------------------
-	if( Projection.is_Okay() )
-	{
-		m_Projection	= Projection;
-
-		pParameters->Get_Parameter("CRS_PROJ4")->Set_Value(m_Projection.Get_Proj4());
-		pParameters->Get_Parameter("CRS_EPSG" )->Set_Value(m_Projection.Get_EPSG ());
-	}
-
-	//-----------------------------------------------------
-	return( 1 );
-}
-
-//---------------------------------------------------------
-int CCRS_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CRS_DIALOG")) )
-	{
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PROJ_TYPE")) )
-		{
-			pParameters->Get_Parameter("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[pParameter->asInt()].id)));
-
-			pParameters->Get_Parameter("OPTIONS")->Set_Enabled(pParameters->Get_Parameter("OPTIONS")->asParameters()->Get_Count() > 0);
-		}
-
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DATUM_DEF")) )
-		{
-			int		Value	= pParameter->asInt();
-
-			pParameters->Get_Parameter("DATUM"    )->Set_Enabled(Value == 0);
-			pParameters->Get_Parameter("ELLIPSOID")->Set_Enabled(Value == 1);
-		}
-
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("ELLIPSOID")) )
-		{
-			int		Value	= pParameter->asInt();
-
-			pParameters->Get_Parameter("ELLPS_DEF")->Set_Enabled(Value == 0);
-			pParameters->Get_Parameter("ELLPS_A"  )->Set_Enabled(Value != 0);
-			pParameters->Get_Parameter("ELLPS_B"  )->Set_Enabled(Value == 1);
-			pParameters->Get_Parameter("ELLPS_F"  )->Set_Enabled(Value == 2);
-			pParameters->Get_Parameter("ELLPS_RF" )->Set_Enabled(Value == 3);
-			pParameters->Get_Parameter("ELLPS_E"  )->Set_Enabled(Value == 4);
-			pParameters->Get_Parameter("ELLPS_ES" )->Set_Enabled(Value == 5);
-		}
-
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DATUM_SHIFT")) )
-		{
-			int		Value	= pParameter->asInt();
-
-			pParameters->Get_Parameter("DS_DX"     )->Set_Enabled(Value == 1 || Value == 2);
-			pParameters->Get_Parameter("DS_DY"     )->Set_Enabled(Value == 1 || Value == 2);
-			pParameters->Get_Parameter("DS_DZ"     )->Set_Enabled(Value == 1 || Value == 2);
-			pParameters->Get_Parameter("DS_RX"     )->Set_Enabled(Value == 2);
-			pParameters->Get_Parameter("DS_RY"     )->Set_Enabled(Value == 2);
-			pParameters->Get_Parameter("DS_RZ"     )->Set_Enabled(Value == 2);
-			pParameters->Get_Parameter("DS_SC"     )->Set_Enabled(Value == 2);
-			pParameters->Get_Parameter("DATUM_GRID")->Set_Enabled(Value == 3);
-		}
-	}
-
-	//-----------------------------------------------------
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Base::Get_Projection(CSG_Projection &Projection)
-{
-	if( Parameters("CRS_METHOD") )
-	{
-		switch( Parameters("CRS_METHOD")->asInt() )
-		{
-		case 0:	default:	// Proj4 Parameters
-			Projection.Create	(Parameters("CRS_PROJ4")->asString(), SG_PROJ_FMT_Proj4);
-			break;
-
-		case 1:				// EPSG Code
-			Projection.Create	(Parameters("CRS_EPSG")->asInt());
-			break;
-
-		case 2:				// Well Known Text File
-			Projection.Load		(Parameters("CRS_FILE")->asString());
-			break;
-		}
-	}
-	else
-	{
-		Projection	= m_Projection;
-	}
-
-	return( Projection.is_Okay() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define WGS84_ELLPS_A	6378137.000
-#define WGS84_ELLPS_B	6356752.314
-
-//---------------------------------------------------------
-bool CCRS_Base::Set_User_Parameters(CSG_Parameters *pParameters)
-{
-	CSG_Parameter	*pNode_0 = NULL, *pNode_1, *pNode_2;
-	CSG_String		sProjections, sName, sDescription, sArguments, sDatums, sEllipsoids, sUnits;
-
-	///////////////////////////////////////////////////////
-
-	// Projection -----------------------------------------
-	sDescription	= _TL("Available Projections:");
-
-	for(struct PJ_LIST *pProjection=pj_list; pProjection->id; ++pProjection)
-	{
-		sArguments		= *pProjection->descr;
-		sName			= sArguments.BeforeFirst('\n');
-		sArguments		= sArguments.AfterFirst ('\n').AfterFirst('\n').AfterFirst('\t');
-
-		sProjections	+= CSG_String::Format(SG_T("{%s}%s|")       , SG_STR_MBTOSG(pProjection->id), sName.c_str());
-		sDescription	+= CSG_String::Format(SG_T("\n[%s] %s (%s)"), SG_STR_MBTOSG(pProjection->id), sName.c_str(), sArguments.c_str());
-
-		Add_User_Projection(pProjection->id, sName, sArguments);
-	}
-
-	// Datums ---------------------------------------------
-	for(struct PJ_DATUMS *pDatum=pj_datums; pDatum->id; ++pDatum)
-	{
-		CSG_String	id      (pDatum->id);
-		CSG_String	comments(pDatum->comments);
-
-		sDatums	+= CSG_String::Format(SG_T("{%s}%s|"), id.c_str(), comments.Length() ? comments.c_str() : id.c_str());
-	}
-
-	// Ellipsoids -----------------------------------------
-	for(struct PJ_ELLPS *pEllipse=pj_ellps; pEllipse->id; ++pEllipse)
-	{
-		sEllipsoids	+= CSG_String::Format(SG_T("{%s}%s (%s, %s)|"), SG_STR_MBTOSG(pEllipse->id), SG_STR_MBTOSG(pEllipse->name), SG_STR_MBTOSG(pEllipse->major), SG_STR_MBTOSG(pEllipse->ell));
-	}
-
-	// Units ----------------------------------------------
-	for(struct PJ_UNITS *pUnit=pj_units; pUnit->id; ++pUnit)
-	{
-		sUnits	+= CSG_String::Format(SG_T("{%s}%s (%s)|"), SG_STR_MBTOSG(pUnit->id), SG_STR_MBTOSG(pUnit->name), SG_STR_MBTOSG(pUnit->to_meter));
-	}
-
-
-	///////////////////////////////////////////////////////
-
-	//-----------------------------------------------------
-	// Projection...
-
-	if( sProjections.Length() == 0 )
-	{
-		return( false );
-	}
-
-	pParameters->Add_Choice	(pNode_0, "PROJ_TYPE"	, _TL("Projection Type")			, sDescription, sProjections);
-
-
-	//-----------------------------------------------------
-	// Datum...
-
-	pNode_1	= pParameters->Add_Choice(
-		pNode_0, "DATUM_DEF"		, _TL("Datum Definition"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Predefined Datum"),
-			_TL("User Defined Datum")
-		)
-	);
-
-
-	//-----------------------------------------------------
-	// Predefined Datum...
-
-	pParameters->Add_Choice	(pNode_1, "DATUM"		, _TL("Predefined Datum")			, _TL(""), sDatums);
-
-
-	//-----------------------------------------------------
-	// Ellipsoid...
-
-	pNode_2	= pParameters->Add_Choice(
-		pNode_1, "ELLIPSOID"		, _TL("Ellipsoid Definition"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-			_TL("Predefined Ellipsoids"),
-			_TL("Semimajor Axis and Semiminor Axis"),
-			_TL("Semimajor Axis and Flattening"),
-			_TL("Semimajor Axis and Reciprocal Flattening"),
-			_TL("Semimajor Axis and Eccentricity"),
-			_TL("Semimajor Axis and Eccentricity Squared")
-		)
-	);
-
-	pParameters->Add_Choice	(pNode_2, "ELLPS_DEF"	, _TL("Predefined Ellipsoids")		, _TL(""), sEllipsoids);
-
-	pParameters->Add_Value	(pNode_2, "ELLPS_A"		, _TL("Semimajor Axis (a)")			, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_A);
-	pParameters->Add_Value	(pNode_2, "ELLPS_B"		, _TL("Semiminor Axis (b)")			, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_B);
-	pParameters->Add_Value	(pNode_2, "ELLPS_F"		, _TL("Flattening (f)")				, _TL(""), PARAMETER_TYPE_Double, (WGS84_ELLPS_A - WGS84_ELLPS_B) / WGS84_ELLPS_A);
-	pParameters->Add_Value	(pNode_2, "ELLPS_RF"	, _TL("Reciprocal Flattening (rf)")	, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_A / (WGS84_ELLPS_A - WGS84_ELLPS_B));
-	pParameters->Add_Value	(pNode_2, "ELLPS_E"		, _TL("Eccentricity (e)")			, _TL(""), PARAMETER_TYPE_Double, sqrt(WGS84_ELLPS_A*WGS84_ELLPS_A + WGS84_ELLPS_B*WGS84_ELLPS_B));
-	pParameters->Add_Value	(pNode_2, "ELLPS_ES"	, _TL("Squared Eccentricity (es)")	, _TL(""), PARAMETER_TYPE_Double, WGS84_ELLPS_A*WGS84_ELLPS_A + WGS84_ELLPS_B*WGS84_ELLPS_B);
-
-
-	//-----------------------------------------------------
-	// Datum Shift...
-
-	pNode_2	= pParameters->Add_Choice(
-		pNode_1, "DATUM_SHIFT"	, _TL("Datum Shift"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("none"),
-			_TL("3 parameters (translation only)"),
-			_TL("7 parameters"),
-			_TL("Datum Shift Grid")
-		)
-	);
-
-	pParameters->Add_Value	(pNode_2, "DS_DX"		, _TL("Translation X")				, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_2, "DS_DY"		, _TL("Translation Y")				, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_2, "DS_DZ"		, _TL("Translation Z")				, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_2, "DS_RX"		, _TL("Rotation X")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_2, "DS_RY"		, _TL("Rotation Y")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_2, "DS_RZ"		, _TL("Rotation Z")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_2, "DS_SC"		, _TL("Scaling")					, _TL(""), PARAMETER_TYPE_Double, 0.0);
-
-	pParameters->Add_FilePath(
-		pNode_2, "DATUM_GRID"	, _TL("Datum Shift Grid File"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s"),
-			_TL("NTv2 Grid Shift Binary (*.gsb)")	, SG_T("*.gsb"),
-			_TL("All Files")						, SG_T("*.*")
-		), NULL, false, false, false
-	);
-
-
-	//-----------------------------------------------------
-	// General Settings...
-
-	pNode_1	= pParameters->Add_Node(pNode_0, "NODE_GENERAL"	, _TL("General Settings"), _TL(""));
-
-	pParameters->Add_Value	(pNode_1, "LON_0"		, _TL("Central Meridian")		, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_1, "LAT_0"		, _TL("Central Parallel")		, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_1, "X_0"			, _TL("False Easting")			, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_1, "Y_0"			, _TL("False Northing")			, _TL(""), PARAMETER_TYPE_Double, 0.0);
-	pParameters->Add_Value	(pNode_1, "K_0"			, _TL("Scale Factor")			, _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true);
-
-	pParameters->Add_Choice	(pNode_1, "UNIT"		, _TL("Unit")					, _TL(""), sUnits, 1);
-
-	pParameters->Add_Value	(pNode_1, "NO_DEFS"		, _TL("Ignore Defaults")		, _TL(""), PARAMETER_TYPE_Bool, false);
-
-	pParameters->Add_Value	(pNode_1, "OVER"		, _TL("Allow longitudes outside -180 to 180 Range")	, _TL(""), PARAMETER_TYPE_Bool, false);
-
-	//-----------------------------------------------------
-	pParameters->Add_Parameters(
-		pNode_0, "OPTIONS"	, _TL("Projection Settings"),
-		_TL("")
-	);
-
-	pParameters->Get_Parameter("OPTIONS")->asParameters()->Assign(Get_Parameters(SG_STR_MBTOSG(pj_list[0].id)));
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-#define PRM_ADD_BOL(key, name, val)	pParms->Add_Value (NULL, key, name, _TL(""), PARAMETER_TYPE_Bool  , val);
-#define PRM_ADD_INT(key, name, val)	pParms->Add_Value (NULL, key, name, _TL(""), PARAMETER_TYPE_Int   , val);
-#define PRM_ADD_FLT(key, name, val)	pParms->Add_Value (NULL, key, name, _TL(""), PARAMETER_TYPE_Double, val);
-#define PRM_ADD_STR(key, name, val)	pParms->Add_String(NULL, key, name, _TL(""), val);
-#define PRM_ADD_CHO(key, name, val)	pParms->Add_Choice(NULL, key, name, _TL(""), val);
-
-//---------------------------------------------------------
-bool CCRS_Base::Add_User_Projection(const CSG_String &sID, const CSG_String &sName, const CSG_String &sArgs)
-{
-	if( sArgs.Length() == 0 )
-	{
-		return( false );
-	}
-
-	CSG_Parameters	*pParms	= Add_Parameters(sID, sName, sArgs);
-
-//	pParms->Add_Info_String(NULL, "DESC", _TL("Description"), _TL(""), sArgs.c_str(), true);
-
-	//-----------------------------------------------------
-	// Cylindrical Projections...
-
-	if(	!sID.CmpNoCase(SG_T("cea"))			// Equal Area Cylindrical
-	||	!sID.CmpNoCase(SG_T("eqc"))			// Equidistant Cylindrical (Plate Caree) 
-	||	!sID.CmpNoCase(SG_T("merc")) )		// Mercator 
-	{
-		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 0.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("utm")) )		// Universal Transverse Mercator (UTM)
-	{
-		PRM_ADD_INT("zone"		, _TL("Zone")					, 32);
-		PRM_ADD_BOL("south"		, _TL("South")					, false);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("omerc")) )		// Oblique Mercator 
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
-		PRM_ADD_FLT("lon_1"		, _TL("Longitude 1"	)			,-20.0);
-		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 50.0);
-		PRM_ADD_FLT("lon_2"		, _TL("Longitude 2"	)			, 20.0);
-	}
-
-	//-----------------------------------------------------
-	// Pseudocylindrical Projections...
-
-	if(	!sID.CmpNoCase(SG_T("gn_sinu")) )	// General Sinusoidal Series
-	{
-		PRM_ADD_FLT("m"			, SG_T("m")						, 0.5);
-		PRM_ADD_FLT("n"			, SG_T("n")						, 1.0 + M_PI_045);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("loxim")) )		// Loximuthal
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("urmfps")) )	// Urmaev Flat-Polar Sinusoidal
-	{
-		PRM_ADD_FLT("n"			, SG_T("n")						, 1.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("urm5")) )		// Urmaev V
-	{
-		PRM_ADD_FLT("n"			, SG_T("n")						, 1.0);
-		PRM_ADD_FLT("q"			, SG_T("q")						, 1.0);
-		PRM_ADD_FLT("alphi"		, SG_T("alphi")					, 45.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("wink1"))		// Winkel I
-	||	!sID.CmpNoCase(SG_T("wag3")) )		// Wagner III
-	{
-		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 45.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("wink2")) )		// Winkel II
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
-	}
-
-
-	//-----------------------------------------------------
-	// Conic Projections...
-
-	if(	!sID.CmpNoCase(SG_T("aea"))			// Albers Equal Area
-	||	!sID.CmpNoCase(SG_T("eqdc"))		// Equidistant Conic
-	||	!sID.CmpNoCase(SG_T("euler"))		// Euler 
-	||	!sID.CmpNoCase(SG_T("imw_p"))		// International Map of the World Polyconic 
-	||	!sID.CmpNoCase(SG_T("murd1"))		// Murdoch I 
-	||	!sID.CmpNoCase(SG_T("murd2"))		// Murdoch II 
-	||	!sID.CmpNoCase(SG_T("murd3"))		// Murdoch III 
-	||	!sID.CmpNoCase(SG_T("pconic"))		// Perspective Conic 
-	||	!sID.CmpNoCase(SG_T("tissot"))		// Tissot 
-	||	!sID.CmpNoCase(SG_T("vitk1")) )		// Vitkovsky I 
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 33.0);
-		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 45.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("lcc")) )		// Lambert Conformal Conic 
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 33.0);
-		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 45.0);
-	}
-
-	if( !sID.CmpNoCase(SG_T("leac")) )		// Lambert Equal Area Conic
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 45.0);
-		PRM_ADD_BOL("south"		, _TL("South")					, false);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("rpoly")) )		// Rectangular Polyconic
-	{
-		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 45.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("mpoly")) )		// Modified Polyconic
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 33.0);
-		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 45.0);
-		PRM_ADD_BOL("lotsa"		, _TL("Lotsa")					, true);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("bonne")) )		// Bonne
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 45.0);
-	}
-
-
-	//-----------------------------------------------------
-	// Azimuthal Projections...
-
-	if(	!sID.CmpNoCase(SG_T("stere")) )		// Stereographic
-	{
-		PRM_ADD_FLT("lat_ts"	, _TL("True Scale Latitude")	, 45.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("ups")) )		// Universal Polar Stereographic
-	{
-		PRM_ADD_BOL("south"		, _TL("South")					, true);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("airy")) )		// Airy
-	{
-		PRM_ADD_FLT("lat_b"		, _TL("Latitude B")				, 45.0);
-		PRM_ADD_BOL("no_cut"	, _TL("No Cut")					, true);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("nsper")) )		// Near-sided perspective
-	{
-		PRM_ADD_FLT("h"			, _TL("Height of view point")	, 1.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("aeqd")) )		// Azimuthal Equidistant
-	{
-		PRM_ADD_BOL("guam"		, _TL("guam")					, true);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("hammer")) )	// Hammer & Eckert-Greifendorff
-	{
-		PRM_ADD_FLT("W"			, _TL("W")						, 0.5);
-		PRM_ADD_FLT("M"			, _TL("M")						, 1.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("wintri")) )	// Winkel Tripel 
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
-	}
-
-
-	//-----------------------------------------------------
-	// Miscellaneous Projections...
-
-	if(	!sID.CmpNoCase(SG_T("ocea"))		// Oblique Cylindrical Equal Area
-	||	!sID.CmpNoCase(SG_T("tpeqd")) )		// Two Point Equidistant 
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 40.0);
-		PRM_ADD_FLT("lon_1"		, _TL("Longitude 1")			,-20.0);
-		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 50.0);
-		PRM_ADD_FLT("lon_2"		, _TL("Longitude 2"	)			, 20.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("geos")) )		// Geostationary Satellite View
-	{
-		PRM_ADD_FLT("h"			, _TL("Satellite Height [m]")	, 35785831.0);
-		PRM_ADD_CHO("sweep"		, _TL("Sweep Angle")			, "x|y|");
-	}
-
-	if(	!sID.CmpNoCase(SG_T("lsat")) )		// Space oblique for LANDSAT
-	{
-		PRM_ADD_INT("lsat"		, _TL("Landsat Satellite (1-5)"), 1.0);
-		PRM_ADD_INT("path"		, _TL("Path (1-255/233 1-3/4-5"), 1.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("labrd")) )		// Laborde
-	{
-		PRM_ADD_FLT("azi"		, _TL("Azimuth"	)				, 19.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("lagrng")) )	// Lagrange
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 0.0);
-		PRM_ADD_FLT("W"			, _TL("W")						, 2.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("chamb")) )		// Chamberlin Trimetric
-	{
-		PRM_ADD_FLT("lat_1"		, _TL("Latitude 1")				, 30.0);
-		PRM_ADD_FLT("lon_1"		, _TL("Longitude 1"	)			,-20.0);
-		PRM_ADD_FLT("lat_2"		, _TL("Latitude 2")				, 40.0);
-		PRM_ADD_FLT("lon_2"		, _TL("Longitude 2")			, 00.0);
-		PRM_ADD_FLT("lat_3"		, _TL("Latitude 3")				, 50.0);
-		PRM_ADD_FLT("lon_3"		, _TL("Longitude 3"	)			, 20.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("oea")) )		// Oblated Equal Area
-	{
-		PRM_ADD_FLT("m"			, _TL("m")						, 1.0);
-		PRM_ADD_FLT("n"			, _TL("n")						, 1.0);
-		PRM_ADD_FLT("theta"		, _TL("theta")					, 45.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("tpers")) )		// Tilted perspective
-	{
-		PRM_ADD_FLT("tilt"		, _TL("Tilt")					, 45.0);
-		PRM_ADD_FLT("azi"		, _TL("Azimuth")				, 45.0);
-		PRM_ADD_FLT("h"			, _TL("h")						, 1000.0);
-	}
-
-	if(	!sID.CmpNoCase(SG_T("ob_tran")) )	// General Oblique Transformation
-	{
-		PRM_ADD_FLT("o_lat_p"	, _TL("Latitude Pole")			, 40.0);
-		PRM_ADD_FLT("o_lon_p"	, _TL("Longitude Pole")			, 40.0);
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define STR_ADD_BOL(key, val)		(val ? CSG_String::Format(SG_T("+%s "), key) : SG_T(""))
-#define STR_ADD_INT(key, val)		CSG_String::Format(SG_T("+%s=%d "), key, val)
-#define STR_ADD_FLT(key, val)		CSG_String::Format(SG_T("+%s=%s "), key, SG_Get_String(val, -32).c_str())
-#define STR_ADD_STR(key, val)		CSG_String::Format(SG_T("+%s=%s "), key, val)
-
-//---------------------------------------------------------
-CSG_String CCRS_Base::Get_User_Definition(CSG_Parameters &P)
-{
-	CSG_String	Proj4;
-
-	//-----------------------------------------------------
-	Proj4	+= STR_ADD_STR(SG_T("proj")	, SG_STR_MBTOSG(pj_list[P("PROJ_TYPE")->asInt()].id));
-
-	if( P("LON_0")->asDouble() )	Proj4	+= STR_ADD_FLT(SG_T("lon_0")	, P("LON_0")->asDouble());
-	if( P("LAT_0")->asDouble() )	Proj4	+= STR_ADD_FLT(SG_T("lat_0")	, P("LAT_0")->asDouble());
-
-	if( P("X_0"  )->asDouble() )	Proj4	+= STR_ADD_FLT(SG_T("x_0")		, P("X_0"  )->asDouble());
-	if( P("Y_0"  )->asDouble() )	Proj4	+= STR_ADD_FLT(SG_T("y_0")		, P("Y_0"  )->asDouble());
-
-	if( P("K_0")->asDouble() != 1.0 && P("K_0")->asDouble() > 0.0 )
-	{
-		Proj4	+= STR_ADD_FLT(SG_T("k_0")	, P("K_0"  )->asDouble());
-	}
-
-	Proj4	+= STR_ADD_STR(SG_T("units")	, SG_STR_MBTOSG(pj_units[P("UNIT")->asInt()].id));
-
-	//-----------------------------------------------------
-	switch( P("DATUM_DEF")->asInt() )
-	{
-	case 0:	// predefined datum
-
-		Proj4	+= STR_ADD_STR(SG_T("datum")	, SG_STR_MBTOSG(pj_datums[P("DATUM")->asInt()].id));
-
-		break;
-
-	//-----------------------------------------------------
-	case 1:	// user defined datum
-
-		switch( P("ELLIPSOID")->asInt() )
-		{
-		case 0:	// Predefined Ellipsoid
-			Proj4	+= STR_ADD_STR(SG_T("ellps")	, SG_STR_MBTOSG(pj_ellps[P("ELLPS_DEF")->asInt()].id));
-			break;
-
-		case 1:	// Semiminor axis
-			Proj4	+= STR_ADD_FLT(SG_T("a")		, P("ELLPS_A" )->asDouble());
-			Proj4	+= STR_ADD_FLT(SG_T("b")		, P("ELLPS_B" )->asDouble());
-			break;
-
-		case 2:	// Flattening
-			Proj4	+= STR_ADD_FLT(SG_T("a")		, P("ELLPS_A" )->asDouble());
-			Proj4	+= STR_ADD_FLT(SG_T("f")		, P("ELLPS_F" )->asDouble());
-			break;
-
-		case 3:	// Reciprocal Flattening
-			Proj4	+= STR_ADD_FLT(SG_T("a")		, P("ELLPS_A" )->asDouble());
-			Proj4	+= STR_ADD_FLT(SG_T("rf")		, P("ELLPS_RF")->asDouble());
-			break;
-
-		case 4:	// Eccentricity
-			Proj4	+= STR_ADD_FLT(SG_T("a")		, P("ELLPS_A" )->asDouble());
-			Proj4	+= STR_ADD_FLT(SG_T("e")		, P("ELLPS_E" )->asDouble());
-			break;
-
-		case 5:	// Eccentricity Squared
-			Proj4	+= STR_ADD_FLT(SG_T("a")		, P("ELLPS_A" )->asDouble());
-			Proj4	+= STR_ADD_FLT(SG_T("es")		, P("ELLPS_ES")->asDouble());
-			break;
-		}
-
-		switch( P("DATUM_SHIFT")->asInt() )
-		{
-		case 1:	// 3 parameters
-			Proj4	+= CSG_String::Format(SG_T("+towgs84=%s,%s,%s "),
-				SG_Get_String(P("DS_DX")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_DY")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_DZ")->asDouble(), -32).c_str()
-			);
-			break;
-
-		case 2:	// 7 parameters
-			Proj4	+= CSG_String::Format(SG_T("+towgs84=%s,%s,%s,%s,%s,%s,%s "),
-				SG_Get_String(P("DS_DX")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_DY")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_DZ")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_RX")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_RY")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_RZ")->asDouble(), -32).c_str(),
-				SG_Get_String(P("DS_SC")->asDouble(), -32).c_str()
-			);
-			break;
-
-		case 3:	// datum shift grid...
-			if( SG_File_Exists(P("DATUM_GRID")->asString()) )
-			{
-				Proj4	+= STR_ADD_STR(SG_T("nadgrids"), P("DATUM_GRID")->asString());
-			}
-			break;
-		}
-
-		break;
-	}
-
-	//-----------------------------------------------------
-	for(int i=0; i<P("OPTIONS")->asParameters()->Get_Count(); i++)
-	{
-		CSG_Parameter	*p	= P("OPTIONS")->asParameters()->Get_Parameter(i);
-
-		switch( p->Get_Type() )
-		{
-		case PARAMETER_TYPE_Choice:
-		case PARAMETER_TYPE_String: Proj4	+= STR_ADD_STR(p->Get_Identifier(), p->asString());	break;
-		case PARAMETER_TYPE_Bool:   Proj4	+= STR_ADD_BOL(p->Get_Identifier(), p->asBool  ());	break;
-		case PARAMETER_TYPE_Int:    Proj4	+= STR_ADD_INT(p->Get_Identifier(), p->asInt   ());	break;
-		case PARAMETER_TYPE_Double: Proj4	+= STR_ADD_FLT(p->Get_Identifier(), p->asDouble());	break;
-		}
-	}
-
-	//-----------------------------------------------------
-	if( P("NO_DEFS")->asBool() )
-	{
-		Proj4	+= SG_T("+no_defs");
-	}
-
-	if( P("OVER")->asBool() )
-	{
-		Proj4	+= SG_T("+over");
-	}
-
-	return( Proj4 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Base::Set_User_Definition(CSG_Parameters &P, const CSG_String &Proj4)
-{
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_base.h b/src/modules_projection/pj_proj4/pj_proj4/crs_base.h
deleted file mode 100644
index d5b4997..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_base.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************
- * Version $Id: crs_base.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                      crs_base.h                       //
-//                                                       //
-//                 Copyright (C) 2010 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__crs_base_H
-#define HEADER_INCLUDED__crs_base_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class pj_proj4_EXPORT CCRS_Base : public CSG_Module
-{
-public:
-	CCRS_Base(void);
-
-	virtual bool			do_Sync_Projections		(void)	{	return( false  );	}
-
-
-protected:
-
-	virtual int				On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	bool					Get_Projection			(CSG_Projection &Projection);
-
-
-private:
-
-	CSG_Projection			m_Projection;
-
-
-	bool					Set_User_Parameters		(CSG_Parameters *pParameters);
-	bool					Add_User_Projection		(const CSG_String &sID, const CSG_String &sName, const CSG_String &sArgs);
-
-	CSG_String				Get_User_Definition		(CSG_Parameters &pParameters);
-	bool					Set_User_Definition		(CSG_Parameters &pParameters, const CSG_String &Proj4);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__crs_base_H
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp b/src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp
deleted file mode 100644
index 49c0a36..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/**********************************************************
- * Version $Id: crs_transform.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   crs_transform.cpp                   //
-//                                                       //
-//                 Copyright (C) 2010 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 "crs_transform.h"
-
-#include <projects.h>
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define PROJ4_FREE(p)	if( p )	{	pj_free((PJ *)p);	p	= NULL;	}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCRS_Transform::CCRS_Transform(void)
-{
-	m_Proj4_pSource	= NULL;
-	m_Proj4_pTarget	= NULL;
-	m_Proj4_pGCS	= NULL;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform::On_Execute(void)
-{
-	//-----------------------------------------------------
-	if( !Get_Projection(m_Target) )
-	{
-		return( false );
-	}
-
-	if(	!_Set_Projection(m_Target, &m_Proj4_pTarget, false) )
-	{
-		return( false );
-	}
-
-	Set_Precise_Mode(Parameters("PRECISE")->asBool());
-
-	Message_Add(CSG_String::Format(SG_T("\n%s: %s"), _TL("target"), m_Target.Get_Proj4().c_str()), false);
-
-	//-----------------------------------------------------
-	m_bInverse	= false;
-
-	bool	bResult	= On_Execute_Transformation();
-
-	//-------------------------------------------------
-	PROJ4_FREE(m_Proj4_pSource);
-	PROJ4_FREE(m_Proj4_pTarget);
-	PROJ4_FREE(m_Proj4_pGCS);
-
-	//-----------------------------------------------------
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform::_Set_Projection(const CSG_Projection &Projection, void **ppProj4, bool bInverse)
-{
-	PROJ4_FREE(*ppProj4);
-
-	//-------------------------------------------------
-	if( (*ppProj4 = pj_init_plus(Projection.Get_Proj4())) == NULL )
-	{
-		Error_Set(CSG_String::Format(SG_T("Proj4 [%s]: %s"), _TL("initialization"), SG_STR_MBTOSG(pj_strerrno(pj_errno))));
-
-		return( false );
-	}
-
-	//-------------------------------------------------
-	if( bInverse && ((PJ *)(*ppProj4))->inv == NULL )
-	{
-		Error_Set(CSG_String::Format(SG_T("Proj4 [%s]: %s"), _TL("initialization"), _TL("inverse transformation not available")));
-
-		return( false );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform::Set_Source(const CSG_Projection &Projection)
-{
-	Message_Add(CSG_String::Format(SG_T("\n%s: %s"), _TL("source"), Projection.Get_Proj4().c_str()), false);
-
-	return( _Set_Projection(Projection, &m_Proj4_pSource, true) );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform::Set_Inverse(bool bOn)
-{
-	if( m_bInverse == bOn )
-	{
-		return( true );
-	}
-
-	if( m_Proj4_pTarget && ((PJ *)m_Proj4_pTarget)->inv )
-	{
-		m_bInverse	= bOn;
-
-		void	*pTMP	= m_Proj4_pSource;
-		m_Proj4_pSource	= m_Proj4_pTarget;
-		m_Proj4_pTarget	= pTMP;
-
-		return( true );
-	}
-
-	Error_Set(CSG_String::Format(SG_T("Proj4 [%s]: %s"), _TL("initialization"), _TL("inverse transformation not available")));
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform::Set_Precise_Mode(bool bOn)
-{
-	if( bOn )
-	{
-		if( m_Proj4_pGCS == NULL )
-		{
-			return( (m_Proj4_pGCS = pj_init_plus("+proj=longlat +datum=WGS84")) != NULL );
-		}
-	}
-	else
-	{
-		PROJ4_FREE(m_Proj4_pGCS);
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform::Get_Transformation(double &x, double &y)
-{
-	if( !m_Proj4_pSource || !m_Proj4_pTarget )
-	{
-		return( false );
-	}
-
-	if( pj_is_latlong((PJ *)m_Proj4_pSource) )
-	{
-		x	*= DEG_TO_RAD;
-		y	*= DEG_TO_RAD;
-	}
-
-	if( m_Proj4_pGCS )	// precise datum conversion
-	{
-		if( pj_transform((PJ *)m_Proj4_pSource, (PJ *)m_Proj4_pGCS   , 1, 0, &x, &y, NULL) != 0
-		||  pj_transform((PJ *)m_Proj4_pGCS   , (PJ *)m_Proj4_pTarget, 1, 0, &x, &y, NULL) != 0 )
-		{
-			return( false );
-		}
-	}
-	else				// direct projection
-	{
-		if( pj_transform((PJ *)m_Proj4_pSource, (PJ *)m_Proj4_pTarget, 1, 0, &x, &y, NULL) != 0 )
-		{
-			return( false );
-		}
-	}
-
-	if( pj_is_latlong((PJ *)m_Proj4_pTarget) )
-	{
-		x	*= RAD_TO_DEG;
-		y	*= RAD_TO_DEG;
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_transform.h b/src/modules_projection/pj_proj4/pj_proj4/crs_transform.h
deleted file mode 100644
index 79e00d2..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_transform.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/**********************************************************
- * Version $Id: crs_transform.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    crs_transform.h                    //
-//                                                       //
-//                 Copyright (C) 2010 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__crs_transform_H
-#define HEADER_INCLUDED__crs_transform_H
-
-//---------------------------------------------------------
-#include "crs_base.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class pj_proj4_EXPORT CCRS_Transform : public CCRS_Base
-{
-public:
-	CCRS_Transform(void);
-
-
-protected:
-
-	virtual bool			On_Execute					(void);
-	virtual bool			On_Execute_Transformation	(void)	= 0;
-
-	const CSG_Projection &	Get_Target					(void)	const		{	return( m_Target );	}
-
-	bool					Set_Source					(const CSG_Projection &Projection);
-
-	bool					Set_Inverse					(bool bOn = true);
-
-	bool					Set_Precise_Mode			(bool bOn = true);
-	bool					Get_Precise_Mode			(void)	const		{	return( m_Proj4_pGCS != NULL );	}
-
-	bool					Get_Transformation			(double &x, double &y);
-	bool					Get_Transformation			(TSG_Point &Point)	{	return( Get_Transformation(Point.x, Point.y) );	}
-
-
-private:
-
-	bool					m_bInverse;
-
-	void					*m_Proj4_pSource, *m_Proj4_pTarget, *m_Proj4_pGCS;
-
-	CSG_Projection			m_Target;
-
-
-	bool					_Set_Projection			(const CSG_Projection &Projection, void **ppProj4, bool bInverse);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__crs_transform_H
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.cpp b/src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.cpp
deleted file mode 100644
index 848d46a..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.cpp
+++ /dev/null
@@ -1,792 +0,0 @@
-/**********************************************************
- * Version $Id: crs_transform_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 crs_transform_grid.cpp                //
-//                                                       //
-//                 Copyright (C) 2010 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 "crs_transform_grid.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCRS_Transform_Grid::CCRS_Transform_Grid(bool bList)
-{
-	CSG_Parameter	*pNode;
-
-	m_bList	= bList;
-
-	//-----------------------------------------------------
-	Set_Name		(m_bList
-		? _TL("Coordinate Transformation (Grid List)")
-		: _TL("Coordinate Transformation (Grid)")
-	);
-
-	Set_Author		(SG_T("O. Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Coordinate transformation for grids.\n"
-		"Based on the PROJ.4 Cartographic Projections library originally written by Gerald Evenden "
-		"and later continued by the United States Department of the Interior, Geological Survey (USGS).\n"
-		"<a target=\"_blank\" href=\"http://trac.osgeo.org/proj/\">Proj.4 Homepage</a>\n"
-	));
-
-	//-----------------------------------------------------
-	if( m_bList )
-	{
-		pNode	= Parameters.Add_Grid_List(
-			NULL	, "SOURCE"		, _TL("Source"),
-			_TL(""),
-			PARAMETER_INPUT
-		);
-
-		Parameters.Add_Grid_List(
-			NULL	, "TARGET"		, _TL("Target"),
-			_TL(""),
-			PARAMETER_OUTPUT_OPTIONAL
-		);
-
-		m_Grid_Target.Add_Parameters_User  (Add_Parameters("GET_USER"  , _TL("User Defined Grid System"), _TL("")), false);
-		m_Grid_Target.Add_Parameters_System(Add_Parameters("GET_SYSTEM", _TL("Select Grid System")      , _TL("")));
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		pNode	= Parameters.Add_Grid(
-			NULL	, "SOURCE"		, _TL("Source"),
-			_TL(""),
-			PARAMETER_INPUT
-		);
-
-		m_Grid_Target.Add_Parameters_User  (Add_Parameters("GET_USER"  , _TL("User Defined Grid"), _TL("")));
-		m_Grid_Target.Add_Parameters_Grid  (Add_Parameters("GET_GRID"  , _TL("Select Grid")      , _TL("")));
-	}
-
-	//-----------------------------------------------------
-	Parameters.Add_Value(
-		pNode	, "CREATE_XY"	, _TL("Create X/Y Grids"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Grid_Output(NULL, "OUT_X", _TL("X Coordinates"), _TL(""));
-	Parameters.Add_Grid_Output(NULL, "OUT_Y", _TL("Y Coordinates"), _TL(""));
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		pNode	, "INTERPOLATION"	, _TL("Interpolation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-			_TL("Nearest Neigbhor"),
-			_TL("Bilinear Interpolation"),
-			_TL("Inverse Distance Interpolation"),
-			_TL("Bicubic Spline Interpolation"),
-			_TL("B-Spline Interpolation")
-		), 4
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		pNode	, "TARGET_TYPE"	, _TL("Target"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("user defined grid system"),
-			_TL("existing grid system"),
-			_TL("points")
-		), 0
-	);
-
-	Parameters.Add_Value(
-		pNode	, "TARGET_AREA"	, _TL("Use Target Area Polygon"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	//-----------------------------------------------------
-	CSG_Parameters	*pParameters	= Add_Parameters("POINTS", _TL("Points"), _TL(""));
-
-	pParameters->Add_Shapes(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
-		PARAMETER_OUTPUT, SHAPE_TYPE_Point
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CCRS_Transform_Grid::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	CCRS_Transform::On_Parameter_Changed(pParameters, pParameter);
-
-	return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::On_Execute_Transformation(void)
-{
-	m_Interpolation	= Parameters("INTERPOLATION")->asInt();
-
-	//-----------------------------------------------------
-	if( m_bList )
-	{
-		int						i;
-		CSG_Parameters			Grids;
-		CSG_Parameter_Grid_List	*pSources, *pTargets, *pGrids;
-
-		pSources	= Parameters("SOURCE")->asGridList();
-		pTargets	= Parameters("TARGET")->asGridList();
-
-		pTargets->Del_Items();
-
-		pGrids		= Grids.Add_Grid_List(NULL, "GRD", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList();
-
-		for(i=0; i<pSources->Get_Count(); i++)
-		{
-			if( pSources->asGrid(i)->Get_Projection().is_Okay() )
-			{
-				pGrids->Add_Item(pSources->asGrid(i));
-			}
-			else
-			{
-				Error_Set(CSG_String::Format(SG_T("%s: %s\n"), _TL("unknown projection"), pSources->asGrid(i)->Get_Name()));
-			}
-		}
-
-		pSources	= Grids.Add_Grid_List(NULL, "SRC", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList();
-
-		while( pGrids->Get_Count() > 0 )
-		{
-			pSources->Add_Item(pGrids->asGrid(pGrids->Get_Count() - 1));
-			pGrids  ->Del_Item(pGrids->Get_Count() - 1);
-
-			for(i=pGrids->Get_Count()-1; i>=0; i--)
-			{
-				if( pGrids->asGrid(i)->Get_Projection() == pSources->asGrid(0)->Get_Projection() )
-				{
-					pSources->Add_Item(pGrids->asGrid(i));
-					pGrids  ->Del_Item(i);
-				}
-			}
-
-			Set_Inverse(false);
-
-			Transform(pSources);
-
-			pSources->Del_Items();
-		}
-
-		return( pTargets->Get_Count() > 0 );
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		return( Transform(Parameters("SOURCE")->asGrid()) );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid)
-{
-	if( pGrid->Get_Projection().is_Okay() && Set_Source(pGrid->Get_Projection()) )
-	{
-		TSG_Data_Type	Type	= m_Interpolation == 0 ? pGrid->Get_Type() : SG_DATATYPE_Float;
-
-		switch( Parameters("TARGET_TYPE")->asInt() )
-		{
-		case 0:	// create user defined grid...
-			if( Get_Target_System(pGrid->Get_System(), true) )
-			{
-				return( Transform(pGrid, m_Grid_Target.Get_User(Type)) );
-			}
-			break;
-
-		case 1:	// select existing grid system...
-			if( Dlg_Parameters("GET_GRID") )
-			{
-				return( Transform(pGrid, m_Grid_Target.Get_Grid(Type)) );
-			}
-			break;
-
-		case 2:	// points as target...
-			if( Dlg_Parameters("POINTS") )
-			{
-				CSG_Shapes	*pPoints	= Get_Parameters("POINTS")->Get_Parameter("POINTS")->asShapes();
-
-				if( pPoints == DATAOBJECT_NOTSET || pPoints == DATAOBJECT_CREATE )
-				{
-					Get_Parameters("POINTS")->Get_Parameter("POINTS")->Set_Value(pPoints = SG_Create_Shapes(SHAPE_TYPE_Point));
-				}
-
-				return( Transform(pGrid, pPoints) );
-			}
-			break;
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Transform(CSG_Parameter_Grid_List *pGrids)
-{
-	if( pGrids->Get_Count() > 0 && Set_Source(pGrids->asGrid(0)->Get_Projection()) )
-	{
-		CSG_Grid_System	System;
-
-		switch( Parameters("TARGET_TYPE")->asInt() )
-		{
-		case 0:	// create user defined grid system...
-			if( Get_Target_System(pGrids->asGrid(0)->Get_System(), true) && m_Grid_Target.Get_System_User(System) )
-			{
-				return( Transform(pGrids, Parameters("TARGET")->asGridList(), System) );
-			}
-			break;
-
-		case 1:	// select existing grid system...
-			if( Dlg_Parameters("GET_SYSTEM") && m_Grid_Target.Get_System(System) )
-			{
-				return( Transform(pGrids, Parameters("TARGET")->asGridList(), System) );
-			}
-			break;
-
-		case 2:	// points as target...
-			if( Dlg_Parameters("POINTS") )
-			{
-				CSG_Shapes	*pPoints	= Get_Parameters("POINTS")->Get_Parameter("POINTS")->asShapes();
-
-				if( pPoints == DATAOBJECT_NOTSET || pPoints == DATAOBJECT_CREATE )
-				{
-					Get_Parameters("POINTS")->Get_Parameter("POINTS")->Set_Value(pPoints = SG_Create_Shapes());
-				}
-
-				return( Transform(pGrids, pPoints) );
-			}
-			break;
-		}
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid, CSG_Grid *pTarget)
-{
-	if( !pTarget || !pGrid )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	bool			bGeogCS_Adjust	= pGrid->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Geographic && pGrid->Get_XMax() > 180.0;
-	int				x, y;
-	double			z;
-	TSG_Point		Pt_Source, Pt_Target;
-	CSG_Grid		*pX, *pY;
-
-	//-----------------------------------------------------
-	Set_Target_Area(pGrid->Get_System(), pGrid->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Geographic);
-
-	if( !Set_Inverse(true) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("CREATE_XY")->asBool() )
-	{
-		Parameters("OUT_X")->Set_Value(pX	= SG_Create_Grid(pTarget->Get_System(), SG_DATATYPE_Float));
-		pX->Assign_NoData();
-		pX->Set_Name(_TL("X-Coordinate"));
-		pX->Get_Projection().Create(Get_Target());
-
-		Parameters("OUT_Y")->Set_Value(pY	= SG_Create_Grid(pTarget->Get_System(), SG_DATATYPE_Float));
-		pY->Assign_NoData();
-		pY->Set_Name(_TL("Y-Coordinate"));
-		pY->Get_Projection().Create(Get_Target());
-	}
-	else
-	{
-		pX	= pY	= NULL;
-	}
-
-	//-------------------------------------------------
-	pTarget->Set_NoData_Value_Range	(pGrid->Get_NoData_Value(), pGrid->Get_NoData_hiValue());
-	pTarget->Set_ZFactor			(pGrid->Get_ZFactor());
-	pTarget->Set_Name				(CSG_String::Format(SG_T("%s"), pGrid->Get_Name()));
-	pTarget->Set_Unit				(pGrid->Get_Unit());
-	pTarget->Assign_NoData();
-	pTarget->Get_Projection().Create(Get_Target());
-
-	//-----------------------------------------------------
-	for(y=0, Pt_Target.y=pTarget->Get_YMin(); y<pTarget->Get_NY() && Set_Progress(y, pTarget->Get_NY()); y++, Pt_Target.y+=pTarget->Get_Cellsize())
-	{
-		for(x=0, Pt_Target.x=pTarget->Get_XMin(); x<pTarget->Get_NX(); x++, Pt_Target.x+=pTarget->Get_Cellsize())
-		{
-			if( is_In_Target_Area(Pt_Target) && Get_Transformation(Pt_Source = Pt_Target) )
-			{
-				if( pX )	pX->Set_Value(x, y, Pt_Source.x);
-				if( pY )	pY->Set_Value(x, y, Pt_Source.y);
-
-				if( bGeogCS_Adjust && Pt_Source.x < 0.0 )
-				{
-					Pt_Source.x	+= 360.0;
-				}
-
-				if( pGrid->Get_Value(Pt_Source, z, m_Interpolation) )
-				{
-					pTarget->Set_Value(x, y, z);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Target_Area.Destroy();
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Transform(CSG_Parameter_Grid_List *pSources, CSG_Parameter_Grid_List *pTargets, const CSG_Grid_System &Target_System)
-{
-	if( !pTargets || !pSources || pSources->Get_Count() < 1 )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	bool			bGeogCS_Adjust	= pSources->asGrid(0)->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Geographic && pSources->asGrid(0)->Get_XMax() > 180.0;
-	int				x, y, i, n;
-	double			z;
-	TSG_Point		Pt_Source, Pt_Target;
-	CSG_Grid		*pX, *pY;
-
-	//-----------------------------------------------------
-	Set_Target_Area(pSources->asGrid(0)->Get_System(), pSources->asGrid(0)->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Geographic);
-
-	if( !Set_Inverse(true) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	if( Parameters("CREATE_XY")->asBool() )
-	{
-		Parameters("OUT_X")->Set_Value(pX	= SG_Create_Grid(Target_System, SG_DATATYPE_Float));
-		pX->Assign_NoData();
-		pX->Set_Name(_TL("X-Coordinate"));
-		pX->Get_Projection().Create(Get_Target());
-
-		Parameters("OUT_Y")->Set_Value(pY	= SG_Create_Grid(Target_System, SG_DATATYPE_Float));
-		pY->Assign_NoData();
-		pY->Set_Name(_TL("Y-Coordinate"));
-		pY->Get_Projection().Create(Get_Target());
-	}
-	else
-	{
-		pX	= pY	= NULL;
-	}
-
-	//-----------------------------------------------------
-	n	= pTargets->Get_Count();
-
-	for(i=0; i<pSources->Get_Count(); i++)
-	{
-		CSG_Grid	*pSource	= pSources->asGrid(i);
-		CSG_Grid	*pTarget	= SG_Create_Grid(Target_System, m_Interpolation == 0 ? pSource->Get_Type() : SG_DATATYPE_Float);
-
-		pTarget->Set_NoData_Value_Range	(pSource->Get_NoData_Value(), pSource->Get_NoData_hiValue());
-		pTarget->Set_ZFactor			(pSource->Get_ZFactor());
-		pTarget->Set_Name				(CSG_String::Format(SG_T("%s"), pSource->Get_Name()));
-		pTarget->Set_Unit				(pSource->Get_Unit());
-		pTarget->Assign_NoData();
-		pTarget->Get_Projection().Create(Get_Target());
-
-		pTargets->Add_Item(pTarget);
-	}
-
-	//-------------------------------------------------
-	for(y=0, Pt_Target.y=Target_System.Get_YMin(); y<Target_System.Get_NY() && Set_Progress(y, Target_System.Get_NY()); y++, Pt_Target.y+=Target_System.Get_Cellsize())
-	{
-		for(x=0, Pt_Target.x=Target_System.Get_XMin(); x<Target_System.Get_NX(); x++, Pt_Target.x+=Target_System.Get_Cellsize())
-		{
-			if( is_In_Target_Area(Pt_Target) && Get_Transformation(Pt_Source = Pt_Target) )
-			{
-				if( pX )	pX->Set_Value(x, y, Pt_Source.x);
-				if( pY )	pY->Set_Value(x, y, Pt_Source.y);
-
-				if( bGeogCS_Adjust && Pt_Source.x < 0.0 )
-				{
-					Pt_Source.x	+= 360.0;
-				}
-
-				for(i=0; i<pSources->Get_Count(); i++)
-				{
-					if( pSources->asGrid(i)->Get_Value(Pt_Source, z, m_Interpolation) )
-					{
-						pTargets->asGrid(n + i)->Set_Value(x, y, z);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Target_Area.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid, CSG_Shapes *pPoints)
-{
-	if( !pPoints || !pGrid )
-	{
-		return( false );
-	}
-
-	if( !Set_Source(pGrid->Get_Projection()) )
-	{
-		return( false );
-	}
-
-	int			x, y;
-	TSG_Point	Point;
-
-	pPoints->Create(SHAPE_TYPE_Point, _TL("Points"));
-	pPoints->Get_Projection()	= Get_Target();
-	pPoints->Add_Field(pGrid->Get_Name(), pGrid->Get_Type());
-
-	for(y=0, Point.y=pGrid->Get_YMin(); y<pGrid->Get_NY() && Set_Progress(y, pGrid->Get_NY()); y++, Point.y+=pGrid->Get_Cellsize())
-	{
-		for(x=0, Point.x=pGrid->Get_XMin(); x<pGrid->Get_NX(); x++, Point.x+=pGrid->Get_Cellsize())
-		{
-			TSG_Point	Point_Transformed	= Point;
-
-			if( !pGrid->is_NoData(x, y) && Get_Transformation(Point_Transformed) )
-			{
-				CSG_Shape	*pPoint	= pPoints->Add_Shape();
-
-				pPoint->Add_Point(Point_Transformed);
-
-				pPoint->Set_Value(0, pGrid->asDouble(x, y));
-			}
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Transform(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pPoints)
-{
-	if( !pPoints || !pGrids || pGrids->Get_Count() < 1 )
-	{
-		return( false );
-	}
-
-	CSG_Grid	*pGrid	= pGrids->asGrid(0);
-
-	if( !Set_Source(pGrid->Get_Projection()) )
-	{
-		return( false );
-	}
-
-	int			x, y, i;
-	TSG_Point	Point;
-
-	pPoints->Create(SHAPE_TYPE_Point, _TL("Points"));
-	pPoints->Get_Projection()	= Get_Target();
-
-	for(i=0; i<pGrids->Get_Count(); i++)
-	{
-		pPoints->Add_Field(pGrids->asGrid(i)->Get_Name(), pGrids->asGrid(i)->Get_Type());
-	}
-
-	for(y=0, Point.y=pGrid->Get_YMin(); y<pGrid->Get_NY() && Set_Progress(y, pGrid->Get_NY()); y++, Point.y+=pGrid->Get_Cellsize())
-	{
-		for(x=0, Point.x=pGrid->Get_XMin(); x<pGrid->Get_NX(); x++, Point.x+=pGrid->Get_Cellsize())
-		{
-			TSG_Point	Point_Transformed	= Point;
-
-			if( Get_Transformation(Point_Transformed) )
-			{
-				CSG_Shape	*pPoint	= pPoints->Add_Shape();
-
-				pPoint->Add_Point(Point_Transformed);
-
-				for(i=0; i<pGrids->Get_Count(); i++)
-				{
-					if( !pGrids->asGrid(i)->is_NoData(x, y) )
-					{
-						pPoint->Set_Value(i, pGrids->asGrid(i)->asDouble(x, y));
-					}
-					else
-					{
-						pPoint->Set_NoData(i);
-					}
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void CCRS_Transform_Grid::Get_MinMax(TSG_Rect &r, double x, double y)
-{
-	if( Get_Transformation(x, y) )
-	{
-		if( r.xMin > r.xMax )
-		{
-			r.xMin	= r.xMax	= x;
-		}
-		else if( r.xMin > x )
-		{
-			r.xMin	= x;
-		}
-		else if( r.xMax < x )
-		{
-			r.xMax	= x;
-		}
-
-		if( r.yMin > r.yMax )
-		{
-			r.yMin	= r.yMax	= y;
-		}
-		else if( r.yMin > y )
-		{
-			r.yMin	= y;
-		}
-		else if( r.yMax < y )
-		{
-			r.yMax	= y;
-		}
-	}
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Get_Target_System(const CSG_Grid_System &System, bool bEdge)
-{
-	int			x, y, Resolution;
-	TSG_Rect	Extent;
-
-	Extent.xMin	= Extent.yMin	= 1.0;
-	Extent.xMax	= Extent.yMax	= 0.0;
-
-	Get_MinMax(Extent, System.Get_XMin(), System.Get_YMin());
-	Get_MinMax(Extent, System.Get_XMax(), System.Get_YMin());
-	Get_MinMax(Extent, System.Get_XMin(), System.Get_YMax());
-	Get_MinMax(Extent, System.Get_XMax(), System.Get_YMax());
-
-	Resolution	= 256;
-
-	switch( 1 )
-	{
-	case 1:	// edges
-		{
-			double	d;
-
-			int	yStep	= 1 + System.Get_NY() / Resolution;
-
-			for(y=0, d=System.Get_YMin(); y<System.Get_NY(); y+=yStep, d+=yStep*System.Get_Cellsize())
-			{
-				Get_MinMax(Extent, System.Get_XMin(), d);
-				Get_MinMax(Extent, System.Get_XMax(), d);
-			}
-
-			int	xStep	= 1 + System.Get_NX() / Resolution;
-
-			for(x=0, d=System.Get_XMin(); x<System.Get_NX(); x+=xStep, d+=xStep*System.Get_Cellsize())
-			{
-				Get_MinMax(Extent, d, System.Get_YMin());
-				Get_MinMax(Extent, d, System.Get_YMax());
-			}
-		}
-		break;
-
-	case 2:	// all cells
-		{
-			TSG_Point	p;
-
-			int	xStep	= 1 + System.Get_NX() / Resolution;
-			int	yStep	= 1 + System.Get_NY() / Resolution;
-
-			for(y=0, p.y=System.Get_YMin(); y<System.Get_NY() && Set_Progress(y, System.Get_NY()); y+=yStep, p.y+=yStep*System.Get_Cellsize())
-			{
-				for(x=0, p.x=System.Get_XMin(); x<System.Get_NX(); x+=xStep, p.x+=xStep*System.Get_Cellsize())
-				{
-					Get_MinMax(Extent, p.x, p.y);
-				}
-			}
-		}
-		break;
-	}
-
-	return(	is_Progress() && Extent.xMin < Extent.xMax && Extent.yMin < Extent.yMax
-		&&	m_Grid_Target.Init_User(Extent, System.Get_NY())
-		&&	Dlg_Parameters("GET_USER")
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::Set_Target_Area(const CSG_Grid_System &System, bool bGeogCS)
-{
-	if( Parameters("TARGET_AREA")->asBool() == false )
-	{
-		m_Target_Area.Destroy();
-
-		return( true );
-	}
-
-	m_Target_Area.Create(SHAPE_TYPE_Polygon);
-
-	CSG_Shape	*pArea	= m_Target_Area.Add_Shape();
-	CSG_Rect	r		= System.Get_Extent();
-	TSG_Point	p, q;
-
-	if( bGeogCS )
-	{
-		if( r.Get_XMax() > 180.0 )	r.Move(-180.0, 0.0);
-		if( r.Get_YMin() < -90.0 )	r.m_rect.yMin	= -90.0;
-		if( r.Get_YMax() <  90.0 )	r.m_rect.yMax	=  90.0;
-	}
-
-	for(p.x=r.Get_XMin(), p.y=r.Get_YMin(); p.y<r.Get_YMax(); p.y+=System.Get_Cellsize())
-	{
-		Get_Transformation(q = p);	pArea->Add_Point(q);
-	}
-
-	for(p.x=r.Get_XMin(), p.y=r.Get_YMax(); p.x<r.Get_XMax(); p.x+=System.Get_Cellsize())
-	{
-		Get_Transformation(q = p);	pArea->Add_Point(q);
-	}
-
-	for(p.x=r.Get_XMax(), p.y=r.Get_YMax(); p.y>r.Get_YMin(); p.y-=System.Get_Cellsize())
-	{
-		Get_Transformation(q = p);	pArea->Add_Point(q);
-	}
-
-	for(p.x=r.Get_XMax(), p.y=r.Get_YMin(); p.x>r.Get_XMin(); p.x-=System.Get_Cellsize())
-	{
-		Get_Transformation(q = p);	pArea->Add_Point(q);
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CCRS_Transform_Grid::is_In_Target_Area(const TSG_Point &Point)
-{
-	if( m_Target_Area.Get_Count() == 1 )
-	{
-		return( ((CSG_Shape_Polygon *)m_Target_Area.Get_Shape(0))->Contains(Point) );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.h b/src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.h
deleted file mode 100644
index 9473dc4..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/**********************************************************
- * Version $Id: crs_transform_grid.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  crs_transform_grid.h                 //
-//                                                       //
-//                 Copyright (C) 2010 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__crs_transform_grid_H
-#define HEADER_INCLUDED__crs_transform_grid_H
-
-//---------------------------------------------------------
-#include "crs_transform.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class pj_proj4_EXPORT CCRS_Transform_Grid : public CCRS_Transform
-{
-public:
-	CCRS_Transform_Grid(bool bList);
-
-
-protected:
-
-	virtual int					On_Parameter_Changed		(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
-
-	virtual bool				On_Execute_Transformation	(void);
-
-
-private:
-
-	bool						m_bList;
-
-	int							m_Interpolation;
-
-	CSG_Parameters_Grid_Target	m_Grid_Target;
-
-	CSG_Shapes					m_Target_Area;
-
-
-	bool						Transform					(CSG_Grid                *pGrid );
-	bool						Transform					(CSG_Parameter_Grid_List *pGrids);
-
-	bool						Transform					(CSG_Grid                *pGrid , CSG_Grid                *pTarget );
-	bool						Transform					(CSG_Parameter_Grid_List *pGrids, CSG_Parameter_Grid_List *pTargets, const CSG_Grid_System &Target_System);
-
-	bool						Transform					(CSG_Grid                *pGrid , CSG_Shapes *pPoints);
-	bool						Transform					(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pPoints);
-
-	void						Get_MinMax					(TSG_Rect &r, double x, double y);
-	bool						Get_Target_System			(const CSG_Grid_System &System, bool bEdge);
-
-	bool						Set_Target_Area				(const CSG_Grid_System &System, bool bGeogCS);
-	bool						is_In_Target_Area			(const TSG_Point &Point);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__crs_transform_grid_H
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.cpp b/src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.cpp
deleted file mode 100644
index b413ff1..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/**********************************************************
- * Version $Id: crs_transform_shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                crs_transform_shapes.cpp               //
-//                                                       //
-//                 Copyright (C) 2010 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 "crs_transform_shapes.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCRS_Transform_Shapes::CCRS_Transform_Shapes(bool bList)
-{
-	m_bList	= bList;
-
-	//-----------------------------------------------------
-	Set_Name		(m_bList
-		? _TL("Coordinate Transformation (Shapes List)")
-		: _TL("Coordinate Transformation (Shapes)")
-	);
-
-	Set_Author		(SG_T("O. Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Coordinate transformation for shapes.\n"
-		"Based on the PROJ.4 Cartographic Projections library originally written by Gerald Evenden "
-		"and later continued by the United States Department of the Interior, Geological Survey (USGS).\n"
-		"<a target=\"_blank\" href=\"http://trac.osgeo.org/proj/\">Proj.4 Homepage</a>\n"
-	));
-
-	//-----------------------------------------------------
-	if( m_bList )
-	{
-		Parameters.Add_Shapes_List(
-			NULL	, "SOURCE"	, _TL("Source"),
-			_TL(""),
-			PARAMETER_INPUT
-		);
-
-		Parameters.Add_Shapes_List(
-			NULL	, "TARGET"	, _TL("Target"),
-			_TL(""),
-			PARAMETER_OUTPUT_OPTIONAL
-		);
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		Parameters.Add_Shapes(
-			NULL	, "SOURCE"	, _TL("Source"),
-			_TL(""),
-			PARAMETER_INPUT
-		);
-
-		Parameters.Add_Shapes(
-			NULL	, "TARGET"	, _TL("Target"),
-			_TL(""),
-			PARAMETER_OUTPUT
-		);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Shapes::On_Execute_Transformation(void)
-{
-	if( m_bList )
-	{
-		CSG_Parameter_Shapes_List	*pSources, *pTargets;
-
-		pSources	= Parameters("SOURCE")->asShapesList();
-		pTargets	= Parameters("TARGET")->asShapesList();
-
-		pTargets->Del_Items();
-
-		for(int i=0; i<pSources->Get_Count() && Process_Get_Okay(false); i++)
-		{
-			CSG_Shapes	*pSource	= pSources->asShapes(i);
-			CSG_Shapes	*pTarget	= SG_Create_Shapes(pSource);
-
-			if( Transform(pSource, pTarget) )
-			{
-				pTargets->Add_Item(pTarget);
-			}
-			else
-			{
-				delete(pTarget);
-			}
-		}
-
-		return( pTargets->Get_Count() > 0 );
-	}
-	else
-	{
-		CSG_Shapes	*pSource	= Parameters("SOURCE")->asShapes();
-		CSG_Shapes	*pTarget	= Parameters("TARGET")->asShapes();
-
-		if( pSource == pTarget )
-		{
-			pTarget	= SG_Create_Shapes(pSource);
-
-			if( Transform(pSource, pTarget) )
-			{
-				pSource->Assign(pTarget);
-
-				return( true );
-			}
-			else
-			{
-				delete(pTarget);
-
-				return( false );
-			}
-		}
-		else
-		{
-			pTarget->Create(pSource->Get_Type(), pSource->Get_Name(), pSource, pSource->Get_Vertex_Type());
-		}
-
-		return( Transform(pSource, pTarget) );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCRS_Transform_Shapes::Transform(CSG_Shapes *pSource, CSG_Shapes *pTarget)
-{
-	if( !pTarget || !pSource || !pSource->is_Valid() )
-	{
-		return( false );
-	}
-
-	if( !Set_Source(pSource->Get_Projection()) )
-	{
-		return( false );
-	}
-
-	int		nDropped	= 0;
-
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s"), _TL("Processing"), pSource->Get_Name()));
-
-	for(int iShape=0; iShape<pSource->Get_Count() && Set_Progress(iShape, pSource->Get_Count()); iShape++)
-	{
-		CSG_Shape	*pShape_Source	= pSource->Get_Shape(iShape);
-		CSG_Shape	*pShape_Target	= pTarget->Add_Shape(pShape_Source, SHAPE_COPY_ATTR);
-
-		for(int iPart=0; iPart<pShape_Source->Get_Part_Count() && pShape_Target; iPart++)
-		{
-			for(int iPoint=0; iPoint<pShape_Source->Get_Point_Count(iPart) && pShape_Target; iPoint++)
-			{
-				TSG_Point	Point	= pShape_Source->Get_Point(iPoint, iPart);
-
-				if( Get_Transformation(Point.x, Point.y) )
-				{
-					pShape_Target->Add_Point(Point.x, Point.y, iPart);
-				}
-				else
-				{
-					nDropped++;
-
-					pTarget->Del_Shape(pShape_Target);
-
-					pShape_Target	= NULL;
-				}
-			}
-		}
-	}
-
-	if( nDropped > 0 )
-	{
-		Message_Add(CSG_String::Format(SG_T("%s: %d %s"), pTarget->Get_Name(), nDropped, _TL("shapes have been dropped")));
-	}
-
-	pTarget->Get_Projection() = Get_Target();
-
-	return( pTarget->Get_Count() > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.h b/src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.h
deleted file mode 100644
index 6ff0f98..0000000
--- a/src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/**********************************************************
- * Version $Id: crs_transform_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Projection_Proj4                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 crs_transform_shapes.h                //
-//                                                       //
-//                 Copyright (C) 2010 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__crs_transform_shapes_H
-#define HEADER_INCLUDED__crs_transform_shapes_H
-
-//---------------------------------------------------------
-#include "crs_transform.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class pj_proj4_EXPORT CCRS_Transform_Shapes : public CCRS_Transform
-{
-public:
-	CCRS_Transform_Shapes(bool bList);
-
-
-protected:
-
-	virtual bool			On_Execute_Transformation	(void);
-
-	bool					Transform					(CSG_Shapes *pSource, CSG_Shapes *pTarget);
-
-
-private:
-
-	bool					m_bList;
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__crs_transform_shapes_H
diff --git a/src/modules_recreations/Makefile.am b/src/modules_recreations/Makefile.am
deleted file mode 100644
index d7b24d3..0000000
--- a/src/modules_recreations/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = recreations
diff --git a/src/modules_recreations/Makefile.in b/src/modules_recreations/Makefile.in
deleted file mode 100644
index f555828..0000000
--- a/src/modules_recreations/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_recreations
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = recreations
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_recreations/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_recreations/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_recreations/recreations/Makefile.am b/src/modules_recreations/recreations/Makefile.am
deleted file mode 100644
index ad35d86..0000000
--- a/src/modules_recreations/recreations/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = recreations_games recreations_fractals
diff --git a/src/modules_recreations/recreations/Makefile.in b/src/modules_recreations/recreations/Makefile.in
deleted file mode 100644
index dd99dab..0000000
--- a/src/modules_recreations/recreations/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_recreations/recreations
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = recreations_games recreations_fractals
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_recreations/recreations/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_recreations/recreations/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_recreations/recreations/recreations_fractals/MLB_Interface.h b/src/modules_recreations/recreations/recreations_fractals/MLB_Interface.h
deleted file mode 100644
index 718b8e2..0000000
--- a/src/modules_recreations/recreations/recreations_fractals/MLB_Interface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       Fractals                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__fractals_H
-#define HEADER_INCLUDED__fractals_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef fractals_EXPORTS
-	#define	fractals_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	fractals_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__fractals_H
diff --git a/src/modules_recreations/recreations/recreations_fractals/Makefile.am b/src/modules_recreations/recreations/recreations_fractals/Makefile.am
deleted file mode 100644
index 2feeff7..0000000
--- a/src/modules_recreations/recreations/recreations_fractals/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = librecreations_fractals.la
-librecreations_fractals_la_SOURCES =\
-Bifurcation.cpp\
-Gaussian_Landscapes.cpp\
-Grid_FractalDimension.cpp\
-Mandelbrot.cpp\
-MLB_Interface.cpp\
-Newton.cpp\
-Pythagoras_Tree.cpp\
-Bifurcation.h\
-Gaussian_Landscapes.h\
-Grid_FractalDimension.h\
-Mandelbrot.h\
-MLB_Interface.h\
-Newton.h\
-Pythagoras_Tree.h
-
-librecreations_fractals_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_recreations/recreations/recreations_fractals/Makefile.in b/src/modules_recreations/recreations/recreations_fractals/Makefile.in
deleted file mode 100644
index f3c2ea5..0000000
--- a/src/modules_recreations/recreations/recreations_fractals/Makefile.in
+++ /dev/null
@@ -1,595 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_recreations/recreations/recreations_fractals
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-librecreations_fractals_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_librecreations_fractals_la_OBJECTS = Bifurcation.lo \
-	Gaussian_Landscapes.lo Grid_FractalDimension.lo Mandelbrot.lo \
-	MLB_Interface.lo Newton.lo Pythagoras_Tree.lo
-librecreations_fractals_la_OBJECTS =  \
-	$(am_librecreations_fractals_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(librecreations_fractals_la_SOURCES)
-DIST_SOURCES = $(librecreations_fractals_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = librecreations_fractals.la
-librecreations_fractals_la_SOURCES = \
-Bifurcation.cpp\
-Gaussian_Landscapes.cpp\
-Grid_FractalDimension.cpp\
-Mandelbrot.cpp\
-MLB_Interface.cpp\
-Newton.cpp\
-Pythagoras_Tree.cpp\
-Bifurcation.h\
-Gaussian_Landscapes.h\
-Grid_FractalDimension.h\
-Mandelbrot.h\
-MLB_Interface.h\
-Newton.h\
-Pythagoras_Tree.h
-
-librecreations_fractals_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_recreations/recreations/recreations_fractals/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_recreations/recreations/recreations_fractals/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-librecreations_fractals.la: $(librecreations_fractals_la_OBJECTS) $(librecreations_fractals_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(librecreations_fractals_la_OBJECTS) $(librecreations_fractals_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Bifurcation.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Gaussian_Landscapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_FractalDimension.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Mandelbrot.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Newton.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pythagoras_Tree.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_recreations/recreations/recreations_games/MLB_Interface.h b/src/modules_recreations/recreations/recreations_games/MLB_Interface.h
deleted file mode 100644
index 66e22ae..0000000
--- a/src/modules_recreations/recreations/recreations_games/MLB_Interface.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Library Template                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    MLB_Interface.h                    //
-//                                                       //
-//                 Copyright (C) 2003 by                 //
-//                        Author                         //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     author at email.de                        //
-//                                                       //
-//    contact:    Author                                 //
-//                Sesame Street. 7                       //
-//                12345 Metropolis                       //
-//                Nirwana                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Include the SAGA-API here				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__games_H
-#define HEADER_INCLUDED__games_H
-
-//---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-//---------------------------------------------------------
-#ifdef games_EXPORTS
-	#define	games_EXPORT	_SAGA_DLL_EXPORT
-#else
-	#define	games_EXPORT	_SAGA_DLL_IMPORT
-#endif
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__games_H
diff --git a/src/modules_recreations/recreations/recreations_games/Makefile.am b/src/modules_recreations/recreations/recreations_games/Makefile.am
deleted file mode 100644
index ded1bb4..0000000
--- a/src/modules_recreations/recreations/recreations_games/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z 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 = librecreations_games.la
-librecreations_games_la_SOURCES =\
-Mine_Sweeper.cpp\
-Mine_Sweeper_Res.cpp\
-MLB_Interface.cpp\
-Sudoku.cpp\
-Mine_Sweeper.h\
-MLB_Interface.h\
-Sudoku.h
-
-librecreations_games_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-
diff --git a/src/modules_recreations/recreations/recreations_games/Makefile.in b/src/modules_recreations/recreations/recreations_games/Makefile.in
deleted file mode 100644
index c2e4bd0..0000000
--- a/src/modules_recreations/recreations/recreations_games/Makefile.in
+++ /dev/null
@@ -1,584 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_recreations/recreations/recreations_games
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-librecreations_games_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_librecreations_games_la_OBJECTS = Mine_Sweeper.lo \
-	Mine_Sweeper_Res.lo MLB_Interface.lo Sudoku.lo
-librecreations_games_la_OBJECTS =  \
-	$(am_librecreations_games_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(librecreations_games_la_SOURCES)
-DIST_SOURCES = $(librecreations_games_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = librecreations_games.la
-librecreations_games_la_SOURCES = \
-Mine_Sweeper.cpp\
-Mine_Sweeper_Res.cpp\
-MLB_Interface.cpp\
-Sudoku.cpp\
-Mine_Sweeper.h\
-MLB_Interface.h\
-Sudoku.h
-
-librecreations_games_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_recreations/recreations/recreations_games/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_recreations/recreations/recreations_games/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-librecreations_games.la: $(librecreations_games_la_OBJECTS) $(librecreations_games_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(librecreations_games_la_OBJECTS) $(librecreations_games_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Mine_Sweeper.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Mine_Sweeper_Res.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Sudoku.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/Makefile.am b/src/modules_simulation/Makefile.am
deleted file mode 100644
index 431dee5..0000000
--- a/src/modules_simulation/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = hydrology fire ecosystems cellular_automata erosion
diff --git a/src/modules_simulation/Makefile.in b/src/modules_simulation/Makefile.in
deleted file mode 100644
index 329e668..0000000
--- a/src/modules_simulation/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = hydrology fire ecosystems cellular_automata erosion
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/cellular_automata/Makefile.am b/src/modules_simulation/cellular_automata/Makefile.am
deleted file mode 100644
index fb4f0c0..0000000
--- a/src/modules_simulation/cellular_automata/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = sim_cellular_automata
diff --git a/src/modules_simulation/cellular_automata/Makefile.in b/src/modules_simulation/cellular_automata/Makefile.in
deleted file mode 100644
index 57bc3a7..0000000
--- a/src/modules_simulation/cellular_automata/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/cellular_automata
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = sim_cellular_automata
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/cellular_automata/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/cellular_automata/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.in b/src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.in
deleted file mode 100644
index 189711e..0000000
--- a/src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.in
+++ /dev/null
@@ -1,582 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/cellular_automata/sim_cellular_automata
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libsim_cellular_automata_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libsim_cellular_automata_la_OBJECTS = Life.lo MLB_Interface.lo \
-	Wator.lo
-libsim_cellular_automata_la_OBJECTS =  \
-	$(am_libsim_cellular_automata_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libsim_cellular_automata_la_SOURCES)
-DIST_SOURCES = $(libsim_cellular_automata_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libsim_cellular_automata.la
-libsim_cellular_automata_la_SOURCES = \
-Life.cpp\
-MLB_Interface.cpp\
-Wator.cpp\
-Life.h\
-MLB_Interface.h\
-Wator.h
-
-libsim_cellular_automata_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libsim_cellular_automata.la: $(libsim_cellular_automata_la_OBJECTS) $(libsim_cellular_automata_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libsim_cellular_automata_la_OBJECTS) $(libsim_cellular_automata_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Life.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Wator.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.cpp b/src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.cpp
deleted file mode 100644
index a5f84fa..0000000
--- a/src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-/**********************************************************
- * Version $Id: Wator.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Cellular_Automata                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       Wator.cpp                       //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Wator.h"
-#include <time.h>
-
-//---------------------------------------------------------
-#define FISH	1
-#define SHARK	2
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CWator::CWator(void)
-{
-	CSG_Parameter	*pNode_0, *pNode_1;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Wa-Tor"));
-
-	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"Wa-Tor - an ecological simulation of predator-prey populations - "
-		"is based upon A. K. Dewdney's 'Computer Recreations' article "
-		"in the December 1984 issue of Scientific American."
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid_Output(
-		NULL	, "GRID"			, _TL("Grid"),
-		_TL("")
-	);
-
-	pNode_0	= Parameters.Add_Node(
-		NULL	, "NODE_GRID"		, _TL("New Grid Dimensions"),
-		_TL("If grid is not set, a new one will be created using chosen width and height.")
-	);
-
-	Parameters.Add_Value(
-		pNode_0	, "NX"				, _TL("Width (Cells)"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 100, 1, true
-	);
-
-	Parameters.Add_Value(
-		pNode_0	, "NY"				, _TL("Height (Cells)"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 100, 1, true
-	);
-
-	pNode_0	= Parameters.Add_Grid(
-		NULL	, "RESULT"			, _TL("Wa-Tor"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL	, true, SG_DATATYPE_Byte
-	);
-
-	pNode_1	= Parameters.Add_Value(
-		pNode_0	, "REFRESH"			, _TL("Refresh"),
-		_TL(""),
-		PARAMETER_TYPE_Bool			, true
-	);
-
-	pNode_1	= Parameters.Add_Value(
-		pNode_0	, "INIT_FISH"		, _TL("Initial Number of Fishes [%]"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 30.0, 0.0, true, 100.0, true
-	);
-
-	pNode_1	= Parameters.Add_Value(
-		pNode_0	, "INIT_SHARK"		, _TL("Initial Number of Sharks [%]"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 7.5, 0.0, true, 100.0, true
-	);
-
-	pNode_0	= Parameters.Add_Table(
-		NULL	, "TABLE"			, _TL("Cycles"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	pNode_0	= Parameters.Add_Value(
-		NULL	, "FISH_BIRTH"		, _TL("Birth Rate of Fishes"),
-		_TL(""),
-		PARAMETER_TYPE_Int			,  3.0, 0.0, true
-	);
-
-	pNode_0	= Parameters.Add_Value(
-		NULL	, "SHARK_BIRTH"		, _TL("Birth Rate of Sharks"),
-		_TL(""),
-		PARAMETER_TYPE_Int			, 12.0, 0.0, true
-	);
-
-	pNode_0	= Parameters.Add_Value(
-		NULL	, "SHARK_STARVE"	, _TL("Max. Starvation Time for Sharks"),
-		_TL(""),
-		PARAMETER_TYPE_Int			,  4.0, 0.0, true
-	);
-}
-
-//---------------------------------------------------------
-CWator::~CWator(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWator::On_Execute(void)
-{
-	bool			bRefresh;
-	int				x, y, i;
-	double			perc, Fish_perc, Shark_perc;
-	CSG_Colors			Colors;
-	CSG_Table			*pTable;
-	CSG_Table_Record	*pRecord;
-
-	//-----------------------------------------------------
-	if( (pWator = Parameters("RESULT")->asGrid()) == NULL )
-	{
-		bRefresh	= true;
-		pWator		= SG_Create_Grid(SG_DATATYPE_Byte, Parameters("NX")->asInt(), Parameters("NY")->asInt());
-		Parameters("GRID")->Set_Value(pWator);
-	}
-	else
-	{
-		bRefresh	= Parameters("REFRESH")->asBool();
-	}
-
-	pWator->Set_Name(_TL("Wa-Tor"));
-
-	Colors.Set_Count(3);
-	Colors.Set_Color(0, SG_GET_RGB(  0,   0,   0));
-	Colors.Set_Color(1, SG_GET_RGB(  0, 255,   0));
-	Colors.Set_Color(2, SG_GET_RGB(255,   0,   0));
-	DataObject_Set_Colors(pWator, Colors);
-	DataObject_Update(pWator, 0, 3, SG_UI_DATAOBJECT_SHOW);
-
-	//-----------------------------------------------------
-	Fish_Birth		= Parameters("FISH_BIRTH")	->asInt();
-	Shark_Birth		= Parameters("SHARK_BIRTH")	->asInt();
-	Shark_Starve	= Parameters("SHARK_STARVE")->asInt();
-
-	pTable			= Parameters("TABLE")		->asTable();
-	pTable->Destroy();
-	pTable->Set_Name(_TL("Wa-Tor"));
-	pTable->Add_Field("Cycle"	, SG_DATATYPE_Int);
-	pTable->Add_Field("Fishes"	, SG_DATATYPE_Int);
-	pTable->Add_Field("Sharks"	, SG_DATATYPE_Int);
-
-	pNext			= SG_Create_Grid(pWator, SG_DATATYPE_Byte);
-	pAge			= SG_Create_Grid(pWator, SG_DATATYPE_Byte);
-	pStarve			= SG_Create_Grid(pWator, SG_DATATYPE_Byte);
-
-	srand((unsigned)time(NULL));
-
-	//-----------------------------------------------------
-	if( bRefresh )
-	{
-		pWator->Assign(0.0);
-
-		Fish_perc		= Parameters("INIT_FISH" )->asDouble();
-		Shark_perc		= Parameters("INIT_SHARK")->asDouble() + Fish_perc;
-
-		for(y=0; y<pWator->Get_NY(); y++)
-		{
-			for(x=0; x<pWator->Get_NX(); x++)
-			{
-				perc	= 100.0 * (double)rand() / (double)RAND_MAX;
-
-				if( perc <= Fish_perc )
-				{
-					pWator	->Set_Value(x, y, FISH);
-				}
-				else if( perc <= Shark_perc )
-				{
-					pWator	->Set_Value(x, y, SHARK);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	pAge	->Assign();
-	pStarve	->Assign();
-
-	for(y=0; y<pWator->Get_NY(); y++)
-	{
-		for(x=0; x<pWator->Get_NX(); x++)
-		{
-			switch( pWator->asByte(x, y) )
-			{
-			case FISH:
-				pAge	->Set_Value(x, y, Fish_Birth	* (double)rand() / (double)RAND_MAX);
-				break;
-
-			case SHARK:
-				pAge	->Set_Value(x, y, Shark_Birth	* (double)rand() / (double)RAND_MAX);
-				pStarve	->Set_Value(x, y, Shark_Starve	* (double)rand() / (double)RAND_MAX);
-				break;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	SG_UI_Progress_Lock(true);
-
-	for(i=1; Process_Get_Okay(true) && Next_Cycle(); i++)
-	{
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %d"), _TL("Life Cycle"), i));
-
-		pRecord	= pTable->Add_Record();
-		pRecord->Set_Value(0, i);
-		pRecord->Set_Value(1, nFishes);
-		pRecord->Set_Value(2, nSharks);
-
-		DataObject_Update(pWator, 0, 3);
-		DataObject_Update(pTable);
-	}
-
-	SG_UI_Progress_Lock(false);
-
-	//-----------------------------------------------------
-	delete(pNext);
-	delete(pAge);
-	delete(pStarve);
-
-	if( is_Progress() )
-	{
-		Message_Add(CSG_String::Format(SG_T("%s %d %s"), _TL("Dead after"), i, _TL("Life Cycles")));
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define GET_NEIGHBOR			{	ix = pWator->Get_System().Get_xTo(i, x); if( ix < 0 ) ix = pWator->Get_NX() - 1; else if( ix >= pWator->Get_NX() ) ix = 0;\
-									iy = pWator->Get_System().Get_yTo(i, y); if( iy < 0 ) iy = pWator->Get_NY() - 1; else if( iy >= pWator->Get_NY() ) iy = 0;	}
-
-#define GET_NEIGHBOR_RANDOMLY	{	i = iNeighbor[(int)((double)rand() * nNeighbors / (double)RAND_MAX)];\
-									ix = pWator->Get_System().Get_xTo(i, x); if( ix < 0 ) ix = pWator->Get_NX() - 1; else if( ix >= pWator->Get_NX() ) ix = 0;\
-									iy = pWator->Get_System().Get_yTo(i, y); if( iy < 0 ) iy = pWator->Get_NY() - 1; else if( iy >= pWator->Get_NY() ) iy = 0;	}
-
-//---------------------------------------------------------
-bool CWator::Next_Cycle(void)
-{
-	static int	iDir	= 0;
-
-	int		x, y, i, ix, iy, xx, yy, ax, ay, dx, dy,
-			iNeighbor[8], nNeighbors,
-			Age, Starve;
-
-	//-----------------------------------------------------
-	nFishes	= 0;
-	nSharks	= 0;
-
-	pNext->Assign(0.0);
-
-	switch( iDir )
-	{
-	default:
-	case 3:	ay	= pWator->Get_NY() - 1;	dy	= -1;	ax	= pWator->Get_NX() - 1;	dx	= -1;	iDir=0;	break;
-	case 2:	ay	= 0;					dy	=  1;	ax	= pWator->Get_NX() - 1;	dx	= -1;	iDir++;	break;
-	case 1:	ay	= pWator->Get_NY() - 1;	dy	= -1;	ax	= 0;					dx	=  1;	iDir++;	break;
-	case 0:	ay	= 0;					dy	=  1;	ax	= 0;					dx	=  1;	iDir++;	break;
-	}
-
-	//-----------------------------------------------------
-	for(yy=0, y=ay; yy<pWator->Get_NY(); yy++, y+=dy)
-	{
-		for(xx=0, x=ax; xx<pWator->Get_NX(); xx++, x+=dx)
-		{
-			if( pWator->asByte(x, y) == FISH )
-			{
-				nFishes++;
-
-				Age		= pAge->asInt(x, y) + 1;
-				pAge->Set_Value(x, y, 0);
-
-				for(i=0, nNeighbors=0; i<8; i++)
-				{
-					GET_NEIGHBOR;
-
-					if( pWator->asByte(ix, iy) == 0 && pNext->asByte(ix, iy) == 0 )
-					{
-						iNeighbor[nNeighbors++]	= i;
-					}
-				}
-
-				if( nNeighbors > 0 )
-				{
-					GET_NEIGHBOR_RANDOMLY;
-
-					pNext	->Set_Value(ix, iy, FISH);
-					pAge	->Set_Value(ix, iy, Age >= Fish_Birth ? 0 : Age);
-
-					if( Age >= Fish_Birth )
-					{
-						pNext	->Set_Value( x,  y, FISH);
-						pAge	->Set_Value( x,  y, Fish_Birth * (double)rand() / (double)RAND_MAX);
-					}
-					else
-					{
-						pWator	->Set_Value( x,  y, 0);
-					}
-				}
-				else
-				{
-					pNext	->Set_Value( x,  y, FISH);
-					pAge	->Set_Value( x,  y, Age >= Fish_Birth ? 0 : Fish_Birth);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(yy=0, y=ay; yy<pWator->Get_NY(); yy++, y+=dy)
-	{
-		for(xx=0, x=ax; xx<pWator->Get_NX(); xx++, x+=dx)
-		{
-			if( pWator->asByte(x, y) == SHARK )
-			{
-				nSharks++;
-
-				Age		= pAge->asInt(x, y) + 1;
-				pAge->Set_Value(x, y, 0);
-
-				Starve	= pStarve->asInt(x, y) + 1;
-				pStarve->Set_Value(x, y, 0);
-
-				for(i=0, nNeighbors=0; i<8; i++)
-				{
-					GET_NEIGHBOR;
-
-					if( pNext->asByte(ix, iy) == FISH )
-					{
-						iNeighbor[nNeighbors++]	= i;
-					}
-				}
-
-				if( nNeighbors > 0 )
-				{
-					GET_NEIGHBOR_RANDOMLY;
-
-					nFishes--;
-					pWator	->Set_Value(ix, iy, 0);
-
-					pNext	->Set_Value(ix, iy, SHARK);
-					pAge	->Set_Value(ix, iy, Age >= Shark_Birth ? 0 : Age);
-					pStarve	->Set_Value(ix, iy, 0);
-
-					if( Age >= Shark_Birth )
-					{
-						pNext	->Set_Value( x,  y, SHARK);
-						pAge	->Set_Value( x,  y, Shark_Birth * (double)rand() / (double)RAND_MAX);
-						pStarve	->Set_Value( x,  y, 0);
-					}
-					else
-					{
-						pWator	->Set_Value( x,  y, 0);
-					}
-				}
-				else if( Starve <= Shark_Starve )
-				{
-					for(i=0, nNeighbors=0; i<8; i++)
-					{
-						GET_NEIGHBOR;
-
-						if( pWator->asByte(ix, iy) == 0 && pNext->asByte(ix, iy) == 0 )
-						{
-							iNeighbor[nNeighbors++]	= i;
-						}
-					}
-
-					if( nNeighbors > 0 )
-					{
-						GET_NEIGHBOR_RANDOMLY;
-
-						pNext	->Set_Value(ix, iy, SHARK);
-						pAge	->Set_Value(ix, iy, Age >= Shark_Birth ? 0 : Age);
-						pStarve	->Set_Value(ix, iy, Starve);
-
-						if( Age >= Shark_Birth )
-						{
-							pNext	->Set_Value( x,  y, SHARK);
-							pAge	->Set_Value( x,  y, Shark_Birth * (double)rand() / (double)RAND_MAX);
-							pStarve	->Set_Value( x,  y, Starve);
-						}
-						else
-						{
-							pWator	->Set_Value( x,  y, 0);
-						}
-					}
-					else
-					{
-						pNext	->Set_Value( x,  y, SHARK);
-						pAge	->Set_Value( x,  y, Age >= Shark_Birth ? 0 : Shark_Birth);
-						pStarve	->Set_Value( x,  y, Starve);
-					}
-				}
-				else
-				{
-					nSharks--;
-				}
-			}
-		}
-	}
-
-	pWator->Assign(pNext);
-
-	return( (nFishes > 0 && nFishes < pWator->Get_NCells()) || nSharks > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.h b/src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.h
deleted file mode 100644
index 9545a82..0000000
--- a/src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/**********************************************************
- * Version $Id: Wator.h 1922 2014-01-09 10:28:46Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   Cellular_Automata                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                        Wator.h                        //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Wator_H
-#define HEADER_INCLUDED__Wator_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CWator : public CSG_Module
-{
-public:
-	CWator(void);
-	virtual ~CWator(void);
-
-
-protected:
-
-	virtual bool			On_Execute(void);
-
-
-private:
-
-	int						Fish_Birth, Shark_Birth, Shark_Starve;
-	long					nFishes, nSharks;
-
-	CSG_Grid					*pWator, *pNext, *pAge, *pStarve;
-
-
-	bool					Next_Cycle(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Wator_H
diff --git a/src/modules_simulation/ecosystems/Makefile.am b/src/modules_simulation/ecosystems/Makefile.am
deleted file mode 100644
index 86a810a..0000000
--- a/src/modules_simulation/ecosystems/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = sim_ecosystems_hugget
diff --git a/src/modules_simulation/ecosystems/Makefile.in b/src/modules_simulation/ecosystems/Makefile.in
deleted file mode 100644
index 8608130..0000000
--- a/src/modules_simulation/ecosystems/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/ecosystems
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = sim_ecosystems_hugget
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/ecosystems/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/ecosystems/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.in b/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.in
deleted file mode 100644
index 1eceb5b..0000000
--- a/src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.in
+++ /dev/null
@@ -1,585 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/ecosystems/sim_ecosystems_hugget
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libsim_ecosystems_hugget_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libsim_ecosystems_hugget_la_OBJECTS = Hugget_01.lo Hugget_02.lo \
-	Hugget_03.lo MLB_Interface.lo
-libsim_ecosystems_hugget_la_OBJECTS =  \
-	$(am_libsim_ecosystems_hugget_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libsim_ecosystems_hugget_la_SOURCES)
-DIST_SOURCES = $(libsim_ecosystems_hugget_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libsim_ecosystems_hugget.la
-libsim_ecosystems_hugget_la_SOURCES = \
-Hugget_01.cpp\
-Hugget_02.cpp\
-Hugget_03.cpp\
-MLB_Interface.cpp\
-Hugget_01.h\
-Hugget_02.h\
-Hugget_03.h\
-MLB_Interface.h
-
-libsim_ecosystems_hugget_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libsim_ecosystems_hugget.la: $(libsim_ecosystems_hugget_la_OBJECTS) $(libsim_ecosystems_hugget_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libsim_ecosystems_hugget_la_OBJECTS) $(libsim_ecosystems_hugget_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hugget_01.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hugget_02.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hugget_03.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/erosion/Makefile.am b/src/modules_simulation/erosion/Makefile.am
deleted file mode 100644
index 7411425..0000000
--- a/src/modules_simulation/erosion/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = sim_erosion
diff --git a/src/modules_simulation/erosion/Makefile.in b/src/modules_simulation/erosion/Makefile.in
deleted file mode 100644
index be3c6a4..0000000
--- a/src/modules_simulation/erosion/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/erosion
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = sim_erosion
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/erosion/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/erosion/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/erosion/sim_erosion/MMF_SAGA.cpp b/src/modules_simulation/erosion/sim_erosion/MMF_SAGA.cpp
deleted file mode 100644
index f919037..0000000
--- a/src/modules_simulation/erosion/sim_erosion/MMF_SAGA.cpp
+++ /dev/null
@@ -1,1180 +0,0 @@
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      sim_erosion                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     MMF_SAGA.cpp                      //
-//                                                       //
-//                Copyright (C) 2009-12 by               //
-//                    Volker Wichmann                    //
-//                   Muhammad Setiawan                   //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     wichmann at laserdata                     //
-//                                                       //
-//    contact:    Volker Wichmann                        //
-//                LASERDATA GmbH                         //
-//                Management and analysis of             //
-//                laserscanning data                     //
-//                Innsbruck, Austria                     //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//  Implementation of the CMMF_SAGA class.               //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MMF_SAGA.h"
-
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Construction/Destruction				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CMMF_SAGA::CMMF_SAGA(void)
-{
-//	CSG_Parameter	*pNodeTerrain, *pNodeVegetation, *pNodeSoil, *pNodeClimate, *pNodeOptions, *pNodeOutput;
-
-	Set_Name	(_TL("MMF-SAGA Soil Erosion Model"));
-
-	Set_Author	(SG_T("(c) 2009-2012 V. Wichmann, M. Setiawan"));
-	
-	Set_Description(_TW("Soil erosion modelling with a modified MMF (Morgan-Morgan-Finney) model "
-						"(Morgan & Duzant 2008).<br/>"
-						"This module is called MMF-SAGA because some things have been implemented differently "
-						"compared to the original publication. The most important are:<br/><br/>"
-						"<ul>"
-						"<li>the extension of the model to support spatially distributed modelling</li>"
-						"<li>the introduction of a \"Channel Network\" layer</li>"
-						"<li>the introduction of a \"rainfall duration\" (time span) parameter</li>"
-						"<li>the exposure of the flow depth parameter</li>"
-						"</ul>"
-						"<br/><br/>"
-						"A more detailed description of the model, its modifications, and "
-						"model application is provided by Setiawan (2012), chapter 6.<br/>"
-						"Currently, a number of additional grid datasets are outputted to facilitate "
-						"model evaluation. This can be easily changed within the source code.<br/>"
-						"<br/><br/>"
-						"References:<br/>"
-						"<b>Morgan, R.P.C. (2001)</b>: A simple approach to soil loss prediction: a revised "
-						"Morgan-Morgan-Finney model. Catena 44: 305-322.<br/><br/>"
-						"<b>Morgan, R.P.C., Duzant, J.H. (2008)</b>: Modified MMF (Morgan-Morgan-Finney) model "
-						"for evaluating effects of crops and vegetation cover on soil erosion. Earth "
-						"Surf. Process. Landforms 32: 90-106.<br/><br/>"
-						"<a href=\"http://sourceforge.net/projects/saga-gis/files/SAGA%20-%20Documentation/Modules/MMF-SAGA_Setiawan.pdf\">"
-						"<b>Setiawan, M. A. (2012)</b>: Integrated Soil Erosion Management in the upper Serayu "
-						"Watershed, Wonosobo District, Central Java Province, Indonesia. Dissertation at "
-						"the Faculty of Geo- and Atmospheric Sciences of the University of Innsbruck, Austria.</a>"
-						"<br/><br/>"
-	));
-
-	// comments on equation numbers refer to Morgan & Duzant (2008)
-
-	
-	//pNodeTerrain = Parameters.Add_Node(NULL, "TERRAIN", _TL("Terrain"), _TL("Terrain parameters"));
-	Parameters.Add_Grid(
-		NULL, "DTM", _TL("Digital Terrain Model"), 
-		_TL("DTM, digital terrain model [m]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(
-		NULL, "S", _TL("Slope"), 
-		_TL("S, slope [rad]"), 
-		PARAMETER_INPUT
-	);
-    Parameters.Add_Grid(
-		NULL, "CHANNEL", _TL("Channel Network"), 
-		_TL("Channel network, all other cells NoData"), 
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	//pNodeVegetation = Parameters.Add_Node(NULL, "VEGETATION", _TL("Vegetation"), _TL("Vegetation parameters"));
-	Parameters.Add_Grid(	
-		NULL, "PI", _TL("Permament Interception"), 
-		_TL("PI, permanent interception expressed as the proportion [between 0-1] of rainfall"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "CC", _TL("Canopy Cover"), 
-		_TL("CC, canopy cover expressed as a portion [between 0-1] of the soil surface protected by vegetation or crop"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "PH", _TL("Plant Height"), 
-		_TL("PH, plant height [m], representing the effective height from which raindrops fall from the crop or vegetation"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "EtEo", _TL("Ratio Evapotranspiration"), 
-		_TL("Et/Eo, ratio of actual to potential evapotranspiration"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "GC", _TL("Ground cover"), 
-		_TL("GC, Ground cover expressed as a portion [between 0-1] of the soil surface protected by vegetation or crop cover on the ground"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "D", _TL("Diameter plant elements"), 
-		_TL("D, Average diameter [m] of the individual plants elements (stem, leaves) at the ground surface"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "NV", _TL("Number plant elements"), 
-		_TL("NV, Number of plant elements per unit area [number/unit area] at the ground surface"), 
-		PARAMETER_INPUT
-	);
-
-	//pNodeSoil = Parameters.Add_Node(NULL, "SOIL", _TL("Soil"), _TL("Soil parameters"));
-	Parameters.Add_Grid(	
-		NULL, "MS", _TL("Soil moisture (at FC)"), 
-		_TL("MS, Soil moisture at field capacity [% w/w]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "BD", _TL("Bulk density top layer"), 
-		_TL("BD, Bulk density of the top layer [Mg/m3]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "EHD", _TL("Effective hydrological depth"), 
-		_TL("EHD, Effective hydrological depth of the soil [m]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "LP", _TL("Sat. lateral permeability"), 
-		_TL("LP, Saturated lateral permeability of the soil [m/day]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "PER_C", _TL("Percentage clays"), 
-		_TL("c, Percentage clays [%]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "PER_Z", _TL("Percentage silt"), 
-		_TL("z, Percentage silt [%]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "PER_S", _TL("Percentage sand"), 
-		_TL("s, Percentage sand [%]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "ST", _TL("Percentage rock fragments"), 
-		_TL("ST, Percentage rock fragments on the soil surface [%]"), 
-		PARAMETER_INPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "RFR", _TL("Surface roughness"), 
-		_TL("RFR, Surface roughness [cm/m]"), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table(
-		NULL, "TAB_METEO", _TL("Meteorological data"),
-		_TL("Meteorological data for multiple timestep modelling [model step (day); temperature (Celsius); rainfall (mm), rainfall intensity (mm/h); rainfall duration (day); timespan (days)]"),
-		PARAMETER_INPUT_OPTIONAL
-	);
-	Parameters.Add_FilePath( 
-		Parameters("TAB_METEO"), "OUT_PATH", _TL("Output file path"), 
-		_TL("Full path to the directory for the output grids of each model step"), 
-		SG_T("\0*.*\0\0*.*\0"), _TL(""), true, true
-	);
-
-	//pNodeClimate = Parameters.Add_Node(NULL, "CLIMATE", _TL("Climate"), _TL("Climate parameters"));
-	Parameters.Add_Value(
-		NULL, "INTERFLOW", _TL("Simulate Interflow"),
-		_TL("Simulate interflow"),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value( 
-		Parameters("INTERFLOW"), "T", _TL("Mean temperature"), 
-		_TL("T, mean temperature [degree C]"), 
-		PARAMETER_TYPE_Double, 
-		18.0
-	);
-
-	Parameters.Add_Value( 
-		Parameters("INTERFLOW"), "TIMESPAN", _TL("Timespan (days)"), 
-		_TL("The number of days to model."), 
-		PARAMETER_TYPE_Int, 30.0,
-        1.0, true, 365, true
-	);
-
-	Parameters.Add_Grid(	
-		Parameters("INTERFLOW"), "IF", _TL("Interflow"), 
-		_TL("IF"), 
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-	Parameters.Add_Value( 
-		NULL, "R", _TL("Rainfall"), 
-		_TL("R, height of precipitation in timespan [mm]"), 
-		PARAMETER_TYPE_Double, 
-		200.0
-	);
-	Parameters.Add_Value( 
-		NULL, "I", _TL("Rainfall intensity"), 
-		_TL("I, rainfall intensity [mm/h]"), 
-		PARAMETER_TYPE_Double, 
-		20.0
-	);
-	Parameters.Add_Value( 
-		NULL, "Rn", _TL("Rainfall Duration"), 
-		_TL("Rn, number of rain days in timespan [-]"), 
-		PARAMETER_TYPE_Double, 
-		20.0
-	);
-
-	CSG_String	choices;
-
-	for (int i=0; i<MMF_KE_I_Count; i++)
-		choices += CSG_String::Format(SG_T("%s|"), gMMF_KE_I_Key_Name[i]);
-
-	Parameters.Add_Choice(
-		NULL, "KE_I_METHOD", _TL("Relationship KE - I"),
-		_TL("Relationship between kinetic energy (KE) and rainfall intensity (I)"),
-		choices,
-		0
-	);
-
-    //pNodeOptions = Parameters.Add_Node(NULL, "OPTIONS", _TL("Model Options"), _TL("Model parameters"));
-    Parameters.Add_Value( 
-		NULL, "FLOWD_VA", _TL("Flow Depth (actual flow velocity)"), 
-		_TL("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."), 
-		PARAMETER_TYPE_Double, 0.005,
-        0.00000001, true
-	);
-    Parameters.Add_Value(
-        NULL, "CHANNELTRANSPORT", _TL("Route Soil along Channel Network"),
-        _TL("Route soil loss along channel network to outlet"),
-        PARAMETER_TYPE_Bool, false
-    );
-
-
-	//pNodeOutput = Parameters.Add_Node(NULL, "OUTPUT", _TL("Output"), _TL("Output parameters"));
-	Parameters.Add_Grid(	
-		NULL, "Q", _TL("Mean runoff"), 
-		_TL("Q, estimation of mean runoff [mm]"), 
-		PARAMETER_OUTPUT
-	);
-	Parameters.Add_Grid(	
-		NULL, "SL", _TL("Mean soil loss"), 
-		_TL("SL, estimation of mean soil loss [kg]"), 
-		PARAMETER_OUTPUT
-	);
-
-	#ifdef _TMP_OUT			// define this preprocessor variable to get intermediate grids as output
-		Parameters.Add_Grid(	
-			NULL, "Rf", _TL("Effective Rainfall"), 
-			_TL("Rf"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "KE", _TL("Total Kinetic Energy"), 
-			_TL("KE"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-				NULL, "Rc", _TL("Soil moisture storage capacity"), 
-				_TL("Rc"), 
-				PARAMETER_OUTPUT
-			);
-		Parameters.Add_Grid(	
-			NULL, "TCc", _TL("Transport Capacity Clay"), 
-			_TL("TCc"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "TCz", _TL("Transport Capacity Silt"), 
-			_TL("TCz"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "TCs", _TL("Transport Capacity Sand"), 
-			_TL("SLs"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "Gc", _TL("Available Clay"), 
-			_TL("Gc"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "Gz", _TL("Available Silt"), 
-			_TL("Gz"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "Gs", _TL("Available Sand"), 
-			_TL("Gs"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "SLc", _TL("Sediment Balance Clay"), 
-			_TL("SLc"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "SLz", _TL("Sediment Balance Silt"), 
-			_TL("SLz"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "SLs", _TL("Sediment Balance Sand"), 
-			_TL("SLs"), 
-			PARAMETER_OUTPUT
-		);
-		Parameters.Add_Grid(	
-			NULL, "TCONDc", _TL("Transport Condition Clay"), 
-			CSG_String::Format(_TL("Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"), TCOND_SED_LIMITED, TCOND_TRANS_LIMITED_TC, TCONF_TRANS_LIMITED_G), 
-			PARAMETER_OUTPUT, true, SG_DATATYPE_Int
-		);
-		Parameters.Add_Grid(	
-			NULL, "TCONDz", _TL("Transport Condition Silt"), 
-			CSG_String::Format(_TL("Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"), TCOND_SED_LIMITED, TCOND_TRANS_LIMITED_TC, TCONF_TRANS_LIMITED_G), 
-			PARAMETER_OUTPUT, true, SG_DATATYPE_Int
-		);
-		Parameters.Add_Grid(	
-			NULL, "TCONDs", _TL("Transport Condition Sand"), 
-			CSG_String::Format(_TL("Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"), TCOND_SED_LIMITED, TCOND_TRANS_LIMITED_TC, TCONF_TRANS_LIMITED_G), 
-			PARAMETER_OUTPUT, true, SG_DATATYPE_Int
-		);
-		Parameters.Add_Grid(	
-			NULL, "W_up", _TL("Upslope Flow Width"), 
-			_TL("W_up"), 
-			PARAMETER_OUTPUT
-		);
-	#endif
-}
-
-//---------------------------------------------------------
-CMMF_SAGA::~CMMF_SAGA(void)
-{
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CMMF_SAGA::On_Execute(void)
-{
-	// input grids
-	CSG_Grid	*pDTM, *pS, *pChannel, *pPI, *pCC, *pPH, *pMS, *pBD, *pEHD, *pEtEo, *pLP, *pGC, *pPer_c, *pPer_z, *pPer_s, *pST, *pD, *pNV, *pRFR;
-	// temporary grids
-	CSG_Grid	*pRf, *pKE, *pRc, *pSLc, *pSLz, *pSLs, *pW_up;
-	#ifdef _TMP_OUT
-	CSG_Grid	*pTCc, *pTCz, *pTCs, *pGc, *pGz, *pGs, *pTCondc, *pTCondz, *pTConds;
-	#endif
-	// optional meteo table
-	CSG_Table	*pMeteoTab;
-	CSG_String	sOutPath;
-
-	// interflow
-	bool		bInterflow, bFreeIF = false;
-	CSG_Grid	*pIF = NULL;
-	double		T = 0.0;
-	double		Rmod = 0.0, IF = 0.0, Z = 0.0, E = 0.0, Rc = 0.0, d_IF = 0.0;
-	// output grids
-	CSG_Grid	 *pQ, *pSL;
-
-	// input parameters
-	double		R, I, Rn;
-	int			KE_I_method;
-	
-	// temporary variables
-	double		    LD, DT, KE_DT, KE_LD, L, Q, Ro;
-	double		    per_c, per_z, per_s, ST, KE, GC, sin_S;
-	double		    n_manning, d_flow, v_flow_a, v_flow_b, v_flow_v, v_flow_t, v_flow;
-	double		    DEPc, DEPz, DEPs, Gc, Gz, Gs, TCc, TCz, TCs, SLc, SLz, SLs;
-
-    // variables
-	//double			slopeDeg;
-	double			slopeFract;
-	double		    timespan, flowd_va;
-	int			    x, y, ix, iy;
-	double		    z, d, dz[8], dzSum, d_Q, d_SLc, d_SLz, d_SLs;
-	double		    W_up, W_down, f_w;
-	const double	Convergence	= 1.1;  // convergence factor MFD after FREEMAN (1991)
-	int			    steepestN;
-	CSG_String	    InvalidGrid;
-    bool            bChannelT;
-	int				iRuns, iMstep;
-
-    // change this to false to only calculate runoff
-	bool		    bCalcSoil = true;
-
-
-	// detachability of the soil by raindrop impact
-	double		Kc = 0.1;		// [g/J]
-	double		Kz = 0.5;		// [g/J]
-	double		Ks = 0.3;		// [g/J]
-	double		Fc, Fz, Fs, F;
-
-	// detachability of the soil by runoff
-	double		DRc = 1.0;		// [-]
-	double		DRz = 1.6;		// [-]
-	double		DRs = 1.5;		// [-]
-	double		Hc, Hz, Hs, H;
-
-	// particle fall number
-	double	vs_c = 0.000002;	// fall velocity [m/s] clay
-	double	vs_z = 0.002;		// fall velocity [m/s] silt
-	double	vs_s = 0.02;		// fall velocity [m/s] sand
-	double	Nf_c, Nf_z, Nf_s;
-	// recalculation of particle fall number for sediment balance
-	double	vs_c1 = 0.00002;	// fall velocity [m/s] clay
-	double	vs_z1 = 0.02;		// fall velocity [m/s] silt
-	double	vs_s1 = 0.2;		// fall velocity [m/s] sand
-
-
-
-	pDTM		= Parameters("DTM")->asGrid();
-	pS			= Parameters("S")->asGrid();
-    pChannel    = Parameters("CHANNEL")->asGrid();
-	pPI			= Parameters("PI")->asGrid();
-	pCC			= Parameters("CC")->asGrid();
-	pPH			= Parameters("PH")->asGrid();
-	pMS			= Parameters("MS")->asGrid();
-	pBD			= Parameters("BD")->asGrid();
-	pEHD		= Parameters("EHD")->asGrid();
-	pEtEo		= Parameters("EtEo")->asGrid();
-	pLP			= Parameters("LP")->asGrid();
-	pGC			= Parameters("GC")->asGrid();
-	pPer_c		= Parameters("PER_C")->asGrid();
-	pPer_z		= Parameters("PER_Z")->asGrid();
-	pPer_s		= Parameters("PER_S")->asGrid();
-	pST			= Parameters("ST")->asGrid();
-	pD			= Parameters("D")->asGrid();
-	pNV			= Parameters("NV")->asGrid();
-	pRFR		= Parameters("RFR")->asGrid();
-	
-	pMeteoTab	= Parameters("TAB_METEO")->asTable();
-	sOutPath	= Parameters("OUT_PATH")->asString();
-
-	if (pMeteoTab != NULL)
-	{
-		if (sOutPath.Length() == 0)
-		{
-			SG_UI_Msg_Add_Error(_TL("No path for output files specified!"));
-			SG_UI_Msg_Add(_TL("Please provide a path for the output files."), true);
-			return (false);
-		}
-
-		iRuns = pMeteoTab->Get_Count();
-	}
-	else
-		iRuns = 1;
-
-
-	// check if all input grids are valid within the bounds of the DTM
-	//----------------------------------------------------------------
-	for (y=0; y<Get_NY(); y++)
-	{
-		for (x=0; x<Get_NX(); x++)
-		{
-			if (!pDTM->is_NoData(x, y))
-			{
-				InvalidGrid = SG_T("");
-
-				if (pS->is_NoData(x, y))
-					InvalidGrid = SG_T("S");
-				if (pPI->is_NoData(x, y))
-					InvalidGrid = SG_T("PI");
-				if (pCC->is_NoData(x, y))
-					InvalidGrid = SG_T("CC");
-				if (pPH->is_NoData(x, y))
-					InvalidGrid = SG_T("PH");
-				if (pMS->is_NoData(x, y))
-					InvalidGrid = SG_T("MS");
-				if (pBD->is_NoData(x, y))
-					InvalidGrid = SG_T("BD");
-				if (pEHD->is_NoData(x, y))
-					InvalidGrid = SG_T("EHD");
-				if (pEtEo->is_NoData(x, y))
-					InvalidGrid = SG_T("EtEo");
-				if (pLP->is_NoData(x, y))
-					InvalidGrid = SG_T("LP");
-				if (pGC->is_NoData(x, y))
-					InvalidGrid = SG_T("GC");
-				if (pPer_c->is_NoData(x, y))
-					InvalidGrid = SG_T("PER_C");
-				if (pPer_z->is_NoData(x, y))
-					InvalidGrid = SG_T("PER_Z");
-				if (pPer_s->is_NoData(x, y))
-					InvalidGrid = SG_T("PER_S");
-				if (pST->is_NoData(x, y))
-					InvalidGrid = SG_T("ST");
-				if (pD->is_NoData(x, y))
-					InvalidGrid = SG_T("D");
-				if (pNV->is_NoData(x, y))
-					InvalidGrid = SG_T("NV");
-				if (pRFR->is_NoData(x, y))
-					InvalidGrid = SG_T("RFR");
-
-				if (InvalidGrid.Length() > 0)
-				{
-					Error_Set(CSG_String::Format(_TL("NoData encountered in input grid %s: x %d (%.2f), y %d (%.2f)"),
-						InvalidGrid.c_str(), x, pDTM->Get_System().Get_xGrid_to_World(x), y, pDTM->Get_System().Get_yGrid_to_World(y)));
-					return (false);
-				}
-			}
-		}
-	}
-	
-	#ifdef _TMP_OUT								
-		pRf		= Parameters("Rf")->asGrid();
-		pKE		= Parameters("KE")->asGrid();
-		pRc		= Parameters("Rc")->asGrid();
-		pSLc	= Parameters("SLc")->asGrid();
-		pSLz	= Parameters("SLz")->asGrid();
-		pSLs	= Parameters("SLs")->asGrid();
-		pW_up	= Parameters("W_up")->asGrid();
-
-		pTCc	= Parameters("TCc")->asGrid();
-		pTCz	= Parameters("TCz")->asGrid();
-		pTCs	= Parameters("TCs")->asGrid();
-		pGc		= Parameters("Gc")->asGrid();
-		pGz		= Parameters("Gz")->asGrid();
-		pGs		= Parameters("Gs")->asGrid();
-		pTCondc = Parameters("TCONDc")->asGrid();
-		pTCondz = Parameters("TCONDz")->asGrid();
-		pTConds = Parameters("TCONDs")->asGrid();
-		pTCc->Assign_NoData();
-		pTCz->Assign_NoData();
-		pTCs->Assign_NoData();
-		pGc->Assign_NoData();
-		pGz->Assign_NoData();
-		pGs->Assign_NoData();
-		pTCondc->Assign_NoData();
-		pTCondz->Assign_NoData();
-		pTConds->Assign_NoData();
-	#endif
-
-	pIF			= Parameters("IF")->asGrid();
-	pQ			= Parameters("Q")->asGrid();
-	pSL			= Parameters("SL")->asGrid();
-
-	R		    = Parameters("R")->asDouble();
-	I		    = Parameters("I")->asDouble();
-	Rn		    = Parameters("Rn")->asDouble();
-	KE_I_method	= Parameters("KE_I_METHOD")->asInt();
-    timespan    = Parameters("TIMESPAN")->asInt();
-    flowd_va    = Parameters("FLOWD_VA")->asDouble();
-    bChannelT   = Parameters("CHANNELTRANSPORT")->asBool();
-	bInterflow	= Parameters("INTERFLOW")->asBool();
-	T			= Parameters("T")->asDouble();
-
-	if (bInterflow && pIF == NULL)
-	{
-		pIF		= SG_Create_Grid(pDTM);
-		bFreeIF = true;
-	}
-
-
-	// create temporary grids
-	#ifndef _TMP_OUT
-		pRf		= SG_Create_Grid(pDTM->Get_System());
-		pKE		= SG_Create_Grid(pDTM->Get_System());
-		pRc		= SG_Create_Grid(pDTM->Get_System());
-		pSLc	= SG_Create_Grid(pDTM->Get_System());
-		pSLz	= SG_Create_Grid(pDTM->Get_System());
-		pSLs	= SG_Create_Grid(pDTM->Get_System());
-		pW_up	= SG_Create_Grid(pDTM->Get_System());
-	#endif
-
-
-	for (int iRun=0; iRun<iRuns; iRun++)
-	{
-		SG_UI_Process_Set_Text(CSG_String::Format(_TL("Model step %d/%d ..."), iRun + 1, iRuns));
-
-		if (pMeteoTab != NULL)
-		{
-			iMstep		= pMeteoTab->Get_Record(iRun)->asInt(0);
-			T			= pMeteoTab->Get_Record(iRun)->asDouble(1);
-			R			= pMeteoTab->Get_Record(iRun)->asDouble(2);
-			I			= pMeteoTab->Get_Record(iRun)->asDouble(3);
-			Rn			= pMeteoTab->Get_Record(iRun)->asDouble(4);
-			timespan	= pMeteoTab->Get_Record(iRun)->asInt(5);
-		}
-
-		if (bInterflow && Rn > timespan)
-		{
-			Error_Set(CSG_String::Format(_TL("Number of raindays is greater than model timespan!")));
-			return (false);
-		}
-
-		// Initialize Grids
-		pSLc->Assign(0.0);
-		pSLz->Assign(0.0);
-		pSLs->Assign(0.0);
-		pQ->Assign(0.0);
-		pW_up->Assign(0.0);
-		if (bInterflow)
-			pIF->Assign(0.0);
-
-
-		// Estimation of rainfall energy (effective rainfall, leaf drainage, direct throughfall, kinetic energy)
-		//------------------------------------------------------------------------------------------------------
-		for (y=0; y<Get_NY() && Set_Progress(y); y++)
-		{
-			for (x=0; x<Get_NX(); x++)
-			{
-				if (!pS->is_NoData(x, y) && !pPI->is_NoData(x, y) && !pCC->is_NoData(x, y) && !pPH->is_NoData(x, y))
-				{
-					pRf->Set_Value(x, y, (R * (1-pPI->asDouble(x, y))) / cos(pS->asDouble(x, y)));	// Equ. (1)
-					LD = pRf->asDouble(x, y) * pCC->asDouble(x, y);									// Equ. (2)
-					DT = pRf->asDouble(x, y) - LD;													// Equ. (3)
-				
-					switch (KE_I_method)		// Equ. (4), see Table 2 in Morgan (2001)
-					{
-					case MMF_KE_I_WISCHMEIER_SMITH_1978:
-					default:
-						KE_DT = DT * (11.87 + 8.73 * log10(I));				break;
-					case MMF_KE_I_MARSHALL_PALMER:
-						KE_DT = DT * (8.95 + 8.44 * log10(I));				break;
-					case MMF_KE_I_ZANCHI_TORRI_1980:
-						KE_DT = DT * (9.81 + 11.25 * log10(I));				break;
-					case MMF_KE_I_COUTINHO_TOMAS_1995:
-						KE_DT = DT * (35.9 * (1 - 0.56 * exp(-0.034 * I)));	break;
-					case MMF_KE_I_HUDSON_1965:
-						KE_DT = DT * (29.8 - (127.5 / I));					break;
-					case MMF_KE_I_ONEGA_ET_AL_1998:
-						KE_DT = DT * (9.81 + 10.6 * log10(I));				break;
-					case MMF_KE_I_ROSEWELL_1986:
-						KE_DT = DT * (29.0 * (1 - 0.6 * exp(-0.04 * I)));	break;
-					case MMF_KE_I_MCISAAC_1990:
-						KE_DT = DT * (26.8 * (1 - 0.29 * exp(-0.049 * I))); break;
-					}
-				
-					if (pPH->asDouble(x, y) < 0.15)
-						KE_LD = 0.0;																// Equ. (5)
-					else
-						KE_LD = LD * (15.8 * pow(pPH->asDouble(x, y), 0.5) - 5.87);					// Equ. (6)
-
-					pKE->Set_Value(x, y, KE_DT + KE_LD);											// Equ. (7)
-				}
-				else
-				{
-					pRf->Set_NoData(x, y);
-					pKE->Set_NoData(x, y);
-				}
-			}
-		}
-
-		// estimation of runoff
-		//-----------------------
-
-		if (bInterflow)
-		{
-			Z		= 300 + (25 * T) + (0.05 * T * T * T);		// Equ. (12)
-			Rmod	= R * (365/timespan);						// scale up from timespan to annual values
-			E		= Rmod / sqrt(0.9 + (Rmod*Rmod)/(Z*Z));		// Equ. (11)
-			E		= E / (365/timespan);                       // calculate E for timespan
-		}
-
-		Ro	= R / Rn;											// Equ. (9) mean rain per rain day
-
-
-		for (long n=0; n<Get_NCells() && Set_Progress(n); n++)
-		{
-			pDTM->Get_Sorted(n, x, y, true, false);
-
-			if (pDTM->is_NoData(x, y))	// pMS, pBD, pEHD, pEtEo, pRf, pLP, pS
-			{
-				pQ->Set_NoData(x, y);
-				pSL->Set_NoData(x, y);
-				pRc->Set_NoData(x, y);
-				if (bInterflow)
-					pIF->Set_NoData(x, y);
-			}
-			else
-			{
-				if (bInterflow)
-				{
-					Rc = (1000 * pMS->asDouble(x, y) * pBD->asDouble(x, y) * pEHD->asDouble(x, y) * pow(pEtEo->asDouble(x, y), 0.5)) - pIF->asDouble(x, y);	// Equ. (8)
-					if (Rc < 0.0)
-						Rc = 0.0;
-					pRc->Set_Value(x, y, Rc);
-				}
-				else
-					pRc->Set_Value(x, y, 1000 * pMS->asDouble(x, y) * pBD->asDouble(x, y) * pEHD->asDouble(x, y) * pow(pEtEo->asDouble(x, y), 0.5));		// Equ. (8), modified
-
-				L = Get_Cellsize() / cos(pS->asDouble(x, y));	// slope length, approx. from cellsize and slope
-
-				if (pChannel != NULL && !pChannel->is_NoData(x, y))
-					Q = pRf->asDouble(x, y) + pQ->asDouble(x, y);
-				else
-					Q = (pRf->asDouble(x, y) + pQ->asDouble(x, y)) * exp((-1.0 * pRc->asDouble(x, y)) / Ro) * pow(L/10,0.1);		// Equ. (9)
-            
-				//double Qe = pRf->asDouble(x, y) * exp((-1.0 * pRc->asDouble(x, y)) / Ro);
-			
-				if (bInterflow)
-				{
-					IF = ((R - E - Q) * pLP->asDouble(x, y) * sin(pS->asDouble(x, y))) / timespan;		// Equ. (13)
-					if (IF < 0)
-						IF = 0.0;
-				}
-
-
-				z		= pDTM->asDouble(x, y);
-				dzSum	= 0.0;
-				W_down	= 0.0;
-
-
-				// uncomment this to just route number of cells to verify flow routing
-				/*if (pChannel != NULL && !pChannel->is_NoData(x, y))
-					Q = 1.0 + pQ->asDouble(x, y);
-				else
-					Q = 0.0;
-				if (bInterflow)
-					IF = 0.0;
-				*/
-
-				if (pChannel != NULL && !pChannel->is_NoData(x, y))
-				{
-					steepestN   = pDTM->Get_Gradient_NeighborDir(x, y);
-					dzSum       = 1.0;
-				}
-				else	// MFD Freeman 1991
-				{
-					for (int i=0; i<8; i++)
-					{
-						ix	= Get_xTo(i, x);			
-						iy	= Get_yTo(i, y);			
-
-						if( pDTM->is_InGrid(ix, iy) )
-						{
-							d		= z - pDTM->asDouble(ix, iy);
-						}
-						else
-						{
-							ix		= Get_xTo(i + 4, x);
-							iy		= Get_yTo(i + 4, y);
-
-							if( pDTM->is_InGrid(ix, iy) )
-							{
-								d		= pDTM->asDouble(ix, iy) - z;
-							}
-							else
-							{
-								d		= 0.0;
-							}
-						}
-
-						if( d > 0.0 )
-						{
-							dzSum	+= (dz[i]	= pow(d / Get_Length(i), Convergence));
-						}
-						else
-						{
-							dz[i]	= 0.0;
-						}
-					}
-				}
-			
-				// flow routing
-				//-----------------------------------------------------
-				if (dzSum > 0.0)
-				{
-					if (pChannel != NULL && !pChannel->is_NoData(x, y))
-					{
-						if (steepestN != -1)
-						{
-							ix	= Get_xTo(steepestN, x);
-							iy	= Get_yTo(steepestN, y);
-
-							pQ->Add_Value(ix, iy, Q);								// distribute				
-							pW_up->Add_Value(ix, iy, Get_Length(steepestN));		// upslope CL of ix,iy
-							W_down = Get_Length(steepestN);							// downslope CL of x,y
-							if (bInterflow)
-								pIF->Add_Value(ix, iy, IF);
-						}
-					}
-					else
-					{
-						d_Q		=  Q / dzSum;
-						if (bInterflow)
-							d_IF =  IF / dzSum;
-
-						for (int i=0; i<8; i++)
-						{
-							if (dz[i] > 0.0)
-							{
-								ix	= Get_xTo(i, x);
-								iy	= Get_yTo(i, y);
-
-								if( pDTM->is_InGrid(ix, iy) )
-								{
-									pQ->Add_Value(ix, iy, d_Q * dz[i]);		// distribute
-									f_w = 0.5 * Get_Cellsize() / Get_System()->Get_UnitLength(i);
-									pW_up->Add_Value(ix, iy, f_w);			// upslope CL of ix,iy
-									W_down += f_w;							// downslope CL of x,y
-									if (bInterflow)
-										pIF->Add_Value(ix, iy, d_IF * dz[i]);
-								}
-							}
-						}
-					}
-				}
-
-				pQ->Set_Value(x, y, Q);		// write local values
-				if (bInterflow)
-					pIF->Set_Value(x, y, IF);
-
-				if (bCalcSoil)
-				{
-					// detachment of soil particles ...
-					per_c	= pPer_c->asDouble(x, y);
-					per_z	= pPer_z->asDouble(x, y);
-					per_s	= pPer_s->asDouble(x, y);
-					ST		= pST->asDouble(x, y);
-					KE		= pKE->asDouble(x, y);
-					GC		= pGC->asDouble(x, y);
-					sin_S	= sin(pS->asDouble(x, y));
-
-					// ... by raindrop impact
-					Fc	= Kc * (per_c / 100.0) * (1.0 - ST) * KE * 0.001;		// Equ. (14)
-					Fz	= Kz * (per_z / 100.0) * (1.0 - ST) * KE * 0.001;		// Equ.	(15)
-					Fs	= Ks * (per_s / 100.0) * (1.0 - ST) * KE * 0.001;		// Equ. (16)
-					F	= Fc + Fz + Fs;											// Equ. (17)
-					// ... by runoff
-					Hc	= DRc * (per_c / 100.0) * pow(Q, 1.5) * (1.0 - (GC + ST)) * pow(sin_S, 0.3) * 0.001;		// Equ. (18)
-					Hz	= DRz * (per_z / 100.0) * pow(Q, 1.5) * (1.0 - (GC + ST)) * pow(sin_S, 0.3) * 0.001;		// Equ. (19)
-					Hs	= DRs * (per_s / 100.0) * pow(Q, 1.5) * (1.0 - (GC + ST)) * pow(sin_S, 0.3) * 0.001;		// Equ. (20)
-					H	= Hc + Hz +Hs;																				// Equ. (21)
-
-					// flow velocity ...				/// input map with 3 classes
-					// ... for standard bare soil
-					n_manning = 0.015;
-					d_flow = 0.005;
-	
-					slopeFract = tan(pS->asDouble(x, y));
-					if (slopeFract == 0.0)
-						slopeFract = 0.001;	// workaround for velocity calculations, otherwise v_flow and thus TC may become NaN!
-
-					v_flow_b = 1.0 / n_manning * pow(d_flow, 0.67) * pow(slopeFract, 0.5);	// Equ. (22)
-				
-					// ... actual flow velocity
-					n_manning = 0.015;
-					// if ....		     // global method							
-					//d_flow = 0.005;	// unchannelled flow
-					//d_flow = 0.01;	// shallow rills
-					//d_flow = 0.25;	// deeper rills
-					d_flow = flowd_va;  // user supplied value
-					v_flow_a = 1.0 / n_manning * pow(d_flow, 0.67) * pow(slopeFract, 0.5) * pow(M_EULER, (-0.018*ST));	// Equ. (23)
-
-					// ... for vegetated conditions
-					if (pGC->asDouble(x, y) > 0.01)			// assuming bare soil as no ground cover
-						v_flow_v = pow(((2 * 9.81) / (pD->asDouble(x, y) * pNV->asDouble(x, y))), 0.5) * pow(slopeFract, 0.5);	// Equ. (24)
-					else
-						v_flow_v = 1.0;						// bare soil
-
-					// ... for the effect of tillage
-					d_flow = 0.005;
-					//n_manning = pow(M_EULER, log(-2.1132 + 0.0349 * pRFR->asDouble(x, y)));	// Equ. (27)
-					n_manning = pow(M_EULER, -2.1132 + 0.0349 * pRFR->asDouble(x, y));	// Equ. (27)
-					v_flow_t = 1.0 / n_manning * pow(d_flow, 0.67) * pow(slopeFract, 0.5);
-					// v_flow_t = 1.0 if not under arable cultivation and natural soil surface roughness is not accounted for
-
-					// particle fall number
-					//d_flow = 0.005;
-					d_flow = flowd_va;  // user supplied value
-
-					if (pGC->asDouble(x, y) > 0.01)						// assuming bare soil as no ground cover
-					{
-						Nf_c = (L * vs_c) / (v_flow_v * d_flow);		// Equ. (28)
-						Nf_z = (L * vs_z) / (v_flow_v * d_flow);		// Equ. (29)
-						Nf_s = (L * vs_s) / (v_flow_v * d_flow);		// Equ. (30)
-					}
-					else												// bare soil
-					{
-						Nf_c = (L * vs_c) / (v_flow_b * d_flow);		// Equ. (28)
-						Nf_z = (L * vs_z) / (v_flow_b * d_flow);		// Equ. (29)
-						Nf_s = (L * vs_s) / (v_flow_b * d_flow);		// Equ. (30)
-					}
-
-					// percentage of detached sediment deposited
-					DEPc = 44.1 * pow(Nf_c, 0.29);						// Equ. (31)
-					if (DEPc > 100.0)
-						DEPc = 100.0;
-					DEPz = 44.1 * pow(Nf_z, 0.29);						// Equ. (32)
-					if (DEPz > 100.0)
-						DEPz = 100.0;
-					DEPs = 44.1 * pow(Nf_s, 0.29);						// Equ. (33)
-					if (DEPs > 100.0)
-						DEPs = 100.0;
-
-					// delivery of detached particles to runoff
-
-					if (W_down <= 0.0)
-						W_down = 0.5 * Get_Cellsize();
-
-					if (pW_up->asDouble(x, y) == 0)
-						W_up = W_down;
-				
-
-					Gc	= (Fc + Hc) * (1.0 - DEPc / 100.0) + (pSLc->asDouble(x, y) * W_up/W_down);	// Equ. (35)
-					Gz	= (Fz + Hz) * (1.0 - DEPz / 100.0) + (pSLz->asDouble(x, y) * W_up/W_down);	// Equ. (36)
-					Gs	= (Fs + Hs) * (1.0 - DEPs / 100.0) + (pSLs->asDouble(x, y) * W_up/W_down);	// Equ. (37)
-					//G	= Gc + Gz + Gs;																		// Equ. (38)
-
-
-					// transport capacity of runoff
-					v_flow = (v_flow_a * v_flow_v * v_flow_t) / v_flow_b;
-					TCc = v_flow * (per_c / 100.0) * pow(Q, 2) * sin_S * 0.001;	// Equ. (39)
-					TCz = v_flow * (per_z / 100.0) * pow(Q, 2) * sin_S * 0.001;	// Equ. (40)
-					TCs = v_flow * (per_s / 100.0) * pow(Q, 2) * sin_S * 0.001;	// Equ. (41)
-
-					// sediment balance
-					if (TCc >= Gc)
-					{
-						SLc = Gc;
-						#ifdef _TMP_OUT
-						pTCondc->Set_Value(x, y, TCOND_SED_LIMITED);
-						#endif
-					}
-					else	// recalculation
-					{
-						if (pGC->asDouble(x, y) > 0.01)								// assuming bare soil as no ground cover
-							Nf_c = (L * vs_c1) / (v_flow_v * d_flow);				// Equ. (28)
-						else														// bare soil
-							Nf_c = (L * vs_c1) / (v_flow_b * d_flow);				// Equ. (28)
-
-						DEPc = 44.1 * pow(Nf_c, 0.29);								// Equ. (31)
-						if (DEPc > 100.0)
-							DEPc = 100.0;
-						Gc	= Gc * (1.0 - DEPc / 100.0);							// Equ. (45)
-						if (TCc >= Gc)
-						{
-							SLc = TCc;
-							#ifdef _TMP_OUT
-							pTCondc->Set_Value(x, y, TCOND_TRANS_LIMITED_TC);
-							#endif
-						}
-						else
-						{
-							SLc = Gc;
-							#ifdef _TMP_OUT
-							pTCondc->Set_Value(x, y, TCONF_TRANS_LIMITED_G);
-							#endif
-						}
-					}
-
-					if (TCz >= Gz)
-					{
-						SLz = Gz;
-						#ifdef _TMP_OUT
-						pTCondz->Set_Value(x, y, 0);
-						#endif
-					}
-					else	// recalculation
-					{
-						if (pGC->asDouble(x, y) > 0.01)								// assuming bare soil as no ground cover
-							Nf_z = (L * vs_z1) / (v_flow_v * d_flow);				// Equ. (28)
-						else														// bare soil
-							Nf_z = (L * vs_z1) / (v_flow_b * d_flow);				// Equ. (28)
-
-						DEPz = 44.1 * pow(Nf_z, 0.29);								// Equ. (31)
-						if (DEPz > 100.0)
-							DEPz = 100.0;
-						Gz	= Gz * (1.0 - DEPz / 100.0);							// Equ. (46)
-						if (TCz >= Gz)
-						{
-							SLz = TCz;
-							#ifdef _TMP_OUT
-							pTCondz->Set_Value(x, y, 1);
-							#endif
-						}
-						else
-						{
-							SLz = Gz;
-							#ifdef _TMP_OUT
-							pTCondz->Set_Value(x, y, 2);
-							#endif
-						}
-					}
-
-					if (TCs >= Gs)
-					{
-						SLs = Gs;
-						#ifdef _TMP_OUT
-						pTConds->Set_Value(x, y, 0);
-						#endif
-					}
-					else	// recalculation
-					{
-						if (pGC->asDouble(x, y) > 0.01)								// assuming bare soil as no ground cover
-							Nf_s = (L * vs_s1) / (v_flow_v * d_flow);				// Equ. (28)
-						else														// bare soil
-							Nf_s = (L * vs_s1) / (v_flow_b * d_flow);				// Equ. (28)
-
-						DEPs = 44.1 * pow(Nf_s, 0.29);								// Equ. (31)
-						if (DEPs > 100.0)
-							DEPs = 100.0;
-						Gs	= Gs * (1.0 - DEPs / 100.0);							// Equ. (47)
-						if (TCs >= Gs)
-						{
-							SLs = TCs;
-							#ifdef _TMP_OUT
-							pTConds->Set_Value(x, y, 1);
-							#endif
-						}
-						else
-						{
-							SLs = Gs;
-							#ifdef _TMP_OUT
-							pTConds->Set_Value(x, y, 2);
-							#endif
-						}
-					}
-
-					SLc *= pDTM->Get_Cellarea();
-					SLz *= pDTM->Get_Cellarea();
-					SLs *= pDTM->Get_Cellarea();
-
-					// sediment routing
-					//-----------------------------------------------------
-					if (dzSum > 0.0)
-					{
-						if (pChannel != NULL && !pChannel->is_NoData(x, y) && bChannelT)		// Transport along channel, ignore (new) sediment balance within channel
-						{
-							if (steepestN != -1)
-							{					
-								ix	= Get_xTo(steepestN, x);
-								iy	= Get_yTo(steepestN, y);
-
-								pSLc->Add_Value(ix, iy, pSLc->asDouble(x, y));
-								pSLz->Add_Value(ix, iy, pSLz->asDouble(x, y));
-								pSLs->Add_Value(ix, iy, pSLs->asDouble(x, y));
-							}
-						}
-						else if (pChannel == NULL || (pChannel != NULL && pChannel->is_NoData(x, y)))		// no channel grid used or no channel cell
-						{
-							d_SLc	=  SLc / dzSum;
-							d_SLz	=  SLz / dzSum;
-							d_SLs	=  SLs / dzSum;
-
-							for (int i=0; i<8; i++)
-							{
-								if (dz[i] > 0.0)
-								{
-									ix	= Get_xTo(i, x);
-									iy	= Get_yTo(i, y);
-
-									if( pDTM->is_InGrid(ix, iy) )
-									{
-										pSLc->Add_Value(ix, iy, d_SLc * dz[i]);		// distribute
-										pSLz->Add_Value(ix, iy, d_SLz * dz[i]);
-										pSLs->Add_Value(ix, iy, d_SLs * dz[i]);
-									}
-								}
-							}
-						}
-					}
-
-					if (pChannel != NULL && !pChannel->is_NoData(x, y))			// channel grid and channel cell: only write incoming material, ignore (new) sediment balance
-					{
-						pSL->Set_Value(x, y, pSLc->asDouble(x, y) + pSLz->asDouble(x, y) + pSLs->asDouble(x, y));
-						pSLc->Set_Value(x, y, pSLc->asDouble(x, y));
-						pSLz->Set_Value(x, y, pSLz->asDouble(x, y));
-						pSLs->Set_Value(x, y, pSLs->asDouble(x, y));
-					}
-					else  // calc mean annual soil loss
-					{
-						pSL->Set_Value(x, y, SLc + SLz + SLs);
-						pSLc->Set_Value(x, y, SLc);
-						pSLz->Set_Value(x, y, SLz);
-						pSLs->Set_Value(x, y, SLs);
-					}
-
-					#ifdef _TMP_OUT
-					pTCc->Set_Value(x, y, TCc * pDTM->Get_Cellarea());
-					pTCz->Set_Value(x, y, TCz * pDTM->Get_Cellarea());
-					pTCs->Set_Value(x, y, TCs * pDTM->Get_Cellarea());
-
-					pGc->Set_Value(x, y, Gc * pDTM->Get_Cellarea());
-					pGz->Set_Value(x, y, Gz * pDTM->Get_Cellarea());
-					pGs->Set_Value(x, y, Gs * pDTM->Get_Cellarea());
-					#endif
-				}// bCalcSoil
-			}// not NoData
-		}// for
-
-		if (pMeteoTab != NULL)
-		{
-			pQ->Save(CSG_String::Format(SG_T("%s\\%03d_Runoff"), sOutPath.c_str(), iRun + 1));
-			pSL->Save(CSG_String::Format(SG_T("%s\\%03d_SoilLoss"), sOutPath.c_str(), iRun + 1));
-		}
-	}// for model step
-
-	//-----------------------------------------------------
-	// delete temporary grids
-	#ifndef _TMP_OUT
-		delete(pRf);
-		delete(pKE);
-		delete(pRc);
-		delete(pSLc);
-		delete(pSLz);
-		delete(pSLs);
-		delete(pW_up);
-	#endif
-
-	if (bFreeIF)
-		delete(pIF);
-
-	return( true );
-}
-
-
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_simulation/erosion/sim_erosion/Makefile.in b/src/modules_simulation/erosion/sim_erosion/Makefile.in
deleted file mode 100644
index c676281..0000000
--- a/src/modules_simulation/erosion/sim_erosion/Makefile.in
+++ /dev/null
@@ -1,577 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/erosion/sim_erosion
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libsim_erosion_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libsim_erosion_la_OBJECTS = MMF_SAGA.lo MLB_Interface.lo
-libsim_erosion_la_OBJECTS = $(am_libsim_erosion_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libsim_erosion_la_SOURCES)
-DIST_SOURCES = $(libsim_erosion_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-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 $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libsim_erosion.la
-libsim_erosion_la_SOURCES = \
-MMF_SAGA.cpp\
-MLB_Interface.cpp\
-MMF_SAGA.h\
-MLB_Interface.h
-
-libsim_erosion_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/erosion/sim_erosion/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/erosion/sim_erosion/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libsim_erosion.la: $(libsim_erosion_la_OBJECTS) $(libsim_erosion_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libsim_erosion_la_OBJECTS) $(libsim_erosion_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MMF_SAGA.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/hydrology/Makefile.am b/src/modules_simulation/hydrology/Makefile.am
deleted file mode 100644
index 0f61571..0000000
--- a/src/modules_simulation/hydrology/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = sim_hydrology
diff --git a/src/modules_simulation/hydrology/Makefile.in b/src/modules_simulation/hydrology/Makefile.in
deleted file mode 100644
index 13b63e0..0000000
--- a/src/modules_simulation/hydrology/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/hydrology
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = sim_hydrology
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/hydrology/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/hydrology/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.cpp b/src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.cpp
deleted file mode 100644
index 4b581a2..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.cpp
+++ /dev/null
@@ -1,550 +0,0 @@
-/**********************************************************
- * Version $Id: KinWav_D8.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    Kinematic_Wave                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    KinWav_D8.cpp                      //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "KinWav_D8.h"
-
-//---------------------------------------------------------
-#define Beta_0		(3.0 / 5.0)
-#define Beta_1		(3.0 / 5.0 - 1.0)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CKinWav_D8::CKinWav_D8(void)
-{
-	CSG_Parameter	*pNode;
-
-	Set_Name		(_TL("Overland Flow - Kinematic Wave D8"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2003"));
-
-	Set_Description	(_TW(
-		"Overland Flow - Kinematic Wave D8"
-		"\n\n"
-		"Reference:\n"
-		"Johnson, D.L., Miller, A.C. (1997):"
-		" A spatially distributed hydrological model utilizing raster data structures,"
-		" Computers & Geosciences, Vol.23, No.3, pp.267-272"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "FLOW"		, _TL("Runoff"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "GAUGES"		, _TL("Gauges"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Table(
-		NULL	, "GAUGES_FLOW"	, _TL("Flow at Gauges"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Value(
-		NULL	, "TIME_SPAN"	, _TL("Simulation Time [h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 24.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "TIME_STEP"	, _TL("Simulation Time Step [h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double,  0.1, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "ROUGHNESS"	, _TL("Manning's Roughness"),
-		_TL(""),
-		PARAMETER_TYPE_Double,  0.03, 0.0, true
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Node(NULL, "NEWTON", _TL("Newton-Raphson"), _TL(""));
-
-	Parameters.Add_Value(
-		pNode	, "NEWTON_MAXITER"	, _TL("Max. Iterations"),
-		_TL(""),
-		PARAMETER_TYPE_Int		, 100		, 1		, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "NEWTON_EPSILON"	, _TL("Epsilon"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.0001	, 0.0	, true
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Choice(
-		NULL	, "PRECIP"		, _TL("Precipitation"),
-		_TL("Kind of initializing Precipitation Event"),
-
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Homogenous"),
-			_TL("Above Elevation"),
-			_TL("Left Half")
-		)
-	);
-
-	Parameters.Add_Value(
-		pNode	, "THRESHOLD"	, _TL("Threshold Elevation"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 0.0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CKinWav_D8::On_Execute(void)
-{
-	double	Roughness;
-
-	//-----------------------------------------------------
-	m_pDEM				= Parameters("DEM")				->asGrid();
-	m_pFlow				= Parameters("FLOW")			->asGrid();
-
-	m_pGauges			= Parameters("GAUGES")			->asShapes();
-	m_pGauges_Flow		= Parameters("GAUGES_FLOW")		->asTable();
-
-	Newton_MaxIter		= Parameters("NEWTON_MAXITER")	->asInt();
-	Newton_Epsilon		= Parameters("NEWTON_EPSILON")	->asDouble();
-
-	Roughness			= Parameters("ROUGHNESS")		->asDouble();
-
-	//-----------------------------------------------------
-	if( Initialize(Roughness) )
-	{
-		int		x, y;
-		double	Time, Time_Span;
-
-		Gauges_Initialise();
-
-		Time_Span		= Parameters("TIME_SPAN")		->asDouble();
-		m_dTime			= Parameters("TIME_STEP")		->asDouble();
-
-		for(Time=0.0; Time<=Time_Span && Process_Get_Okay(false); Time+=m_dTime)
-		{
-			Process_Set_Text(CSG_String::Format(SG_T("%s [h]: %f (%f)"), _TL("Simulation Time"), Time, Time_Span));
-
-			Get_Precipitation(Time);
-
-			m_Flow_Last.Assign(m_pFlow);
-
-			m_pFlow->Assign(0.0);
-
-			for(long n=0; n<m_pDEM->Get_NCells() && Process_Get_Okay(false); n++)
-			{
-				if( m_pDEM->Get_Sorted(n, x, y) )
-				{
-					Get_Runoff(x, y);
-				}
-				else
-				{
-					m_pFlow->Set_NoData(x, y);
-				}
-			}
-
-			DataObject_Update(m_pFlow, 0.0, 100.0);
-
-			Gauges_Set_Flow(Time);
-		}
-
-		//-------------------------------------------------
-		Finalize();
-
-		return( true );
-	}
-
-	//-----------------------------------------------------
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CKinWav_D8::Get_Runoff(int x, int y)
-{
-	int		Direction	= m_Direction.asChar(x, y);
-
-	if( Direction >= 0 )
-	{
-		m_pFlow->Set_Value(x, y, 
-			Get_Runoff(
-				m_pFlow		->asDouble(x, y),
-				m_Flow_Last	 .asDouble(x, y),
-				m_Alpha		 .asDouble(x, y),
-				Get_UnitLength(Direction), 0.0, 0.0
-			)
-		);
-
-		m_pFlow->Add_Value(Get_xTo(Direction, x), Get_yTo(Direction, y), m_Flow_Last.asDouble(x, y));
-	}
-}
-
-//---------------------------------------------------------
-double CKinWav_D8::Get_Runoff(double q_Up, double q_Last, double alpha, double dL, double r, double r_Last)
-{
-	double	dTdL, d, c, q, Res, dRes, dR;
-
-	//-----------------------------------------------------
-	dTdL	= m_dTime / dL;
-	dR		= m_dTime / 2.0 * (r + r_Last);
-
-
-	//-----------------------------------------------------
-	// 1. Initial estimation of q...
-
-	if( q_Last + q_Up != 0.0 )
-	{
-		d	= alpha * Beta_0 * pow((q_Last + q_Up) / 2.0, Beta_1);
-		q	= ( dTdL * q_Up + q_Last * d + dR ) / ( dTdL + d );
-	}
-	else
-	{
-		q	= dR;
-	}
-
-
-	//-----------------------------------------------------
-	// 2. Newton-Raphson...
-
-	c	= dTdL * q_Up + alpha * pow(q_Last, Beta_0) + dR;
-
-	for(int i=0; i<Newton_MaxIter; i++)
-	{
-		if( q <= 0 )
-		{
-			return( dR );
-		}
-
-		Res		= dTdL * q + alpha		    * pow(q, Beta_0) - c;
-		dRes	= dTdL     + alpha * Beta_0 * pow(q, Beta_1);
-//		if( dRes == 0.0 )	{	return( 0.0 );	}
-
-		d		= Res / dRes;
-		q		-= d;
-
-		if( fabs(d) < Newton_Epsilon )
-		{
-			break;
-		}
-	}
-
-	return( q < 0.0 ? 0.0 : q );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CKinWav_D8::Initialize(double Roughness)
-{
-	m_Flow_Last	.Create(*Get_System(), SG_DATATYPE_Float);
-	m_Alpha		.Create(*Get_System(), SG_DATATYPE_Float);
-	m_Direction	.Create(*Get_System(), SG_DATATYPE_Char);
-	m_Direction	.Set_NoData_Value(-1);
-
-	m_pFlow->Assign(0.0);
-	DataObject_Set_Colors(m_pFlow, 100, SG_COLORS_WHITE_BLUE);
-	DataObject_Update(m_pFlow, 0.0, 100.0, SG_UI_DATAOBJECT_SHOW);
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !m_pDEM->is_NoData(x, y) )
-			{
-				int		i, ix, iy, iMax;
-				double	z, d, dMax;
-
-				for(i=0, iMax=-1, dMax=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
-				{
-					ix	= Get_xTo(i, x);
-					iy	= Get_yTo(i, y);
-
-					if( is_InGrid(ix, iy) && (d = (z - m_pDEM->asDouble(ix, iy)) / Get_Length(i)) > dMax )
-					{
-						dMax	= d;
-						iMax	= i;
-					}
-				}
-
-				if( iMax < 0 )
-				{
-					m_Direction	 .Set_NoData(x, y);
-				}
-				else
-				{
-					m_Direction	.Set_Value(x, y, iMax);
-
-					m_Alpha		.Set_Value(x, y, pow(Roughness / sqrt(dMax), Beta_0));
-
-					if( m_Alpha.asDouble(x, y) > 10 )
-						m_Alpha.Set_Value(x, y, 10);
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CKinWav_D8::Finalize(void)
-{
-	m_Direction	.Destroy();
-	m_Alpha		.Destroy();
-	m_Flow_Last	.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CKinWav_D8::Gauges_Initialise(void)
-{
-	if( m_pGauges_Flow != NULL )
-	{
-		if( m_pGauges == NULL )
-		{
-			DataObject_Add(m_pGauges = SG_Create_Shapes(SHAPE_TYPE_Point, _TL("Gauges")));
-
-			Parameters("GAUGES")->Set_Value(m_pGauges);
-
-			m_pGauges->Add_Field(_TL("ID"), SG_DATATYPE_Int);
-
-			for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-			{
-				for(int x=0; x<Get_NX(); x++)
-				{
-					bool	bBorder	= false;
-					bool	bLowest	= true;
-
-					for(int i=0; i<8; i++)
-					{
-						int	ix	= Get_xTo(i, x);
-						int	iy	= Get_yTo(i, y);
-
-						if( !m_pDEM->is_InGrid(ix, iy) )
-						{
-							bBorder	= true;
-						}
-						else if( m_pDEM->asDouble(ix, iy) < m_pDEM->asDouble(x, y) )
-						{
-							bLowest	= false;
-						}
-					}
-
-					if( bLowest && bBorder )
-					{
-						CSG_Shape	*pGauge	= m_pGauges->Add_Shape();
-
-						pGauge->Add_Point(Get_System()->Get_Grid_to_World(x, y));
-						pGauge->Set_Value(0, m_pGauges->Get_Count() + 1);
-					}
-				}
-			}
-		}
-
-		m_pGauges_Flow->Destroy();
-		m_pGauges_Flow->Set_Name(_TL("Outlet Hydrographs"));
-		m_pGauges_Flow->Add_Field("TIME", SG_DATATYPE_Double);
-
-		for(int i=0; i<m_pGauges->Get_Count(); i++)
-		{
-			m_pGauges_Flow->Add_Field(CSG_String::Format(SG_T("GAUGE_%02d"), i + 1), SG_DATATYPE_Double);
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CKinWav_D8::Gauges_Set_Flow(double Time)
-{
-	if( m_pGauges_Flow && m_pGauges_Flow->Get_Field_Count() == m_pGauges->Get_Count() + 1 )
-	{
-		CSG_Table_Record	*pRecord	= m_pGauges_Flow->Add_Record();
-
-		pRecord->Set_Value(0, Time);
-
-		for(int i=0; i<m_pGauges->Get_Count(); i++)
-		{
-			double	Flow;
-
-			if( m_pFlow->Get_Value(m_pGauges->Get_Shape(i)->Get_Point(0), Flow) )
-			{
-				pRecord->Set_Value(i + 1, Flow);
-			}
-		}
-
-		DataObject_Update(m_pGauges_Flow);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CKinWav_D8::Get_Precipitation(double Time)
-{
-	if( Time == 0.0 )
-	{
-		int		x, y;
-		double	t;
-
-		switch( Parameters("PRECIP")->asInt() )
-		{
-		case 0:
-			(*m_pFlow)	+= 100.0;
-			break;
-
-		case 1:
-			t	= Parameters("THRESHOLD")->asDouble();
-
-			for(y=0; y<m_pDEM->Get_NY(); y++)
-			{
-				for(x=0; x<m_pDEM->Get_NX(); x++)
-				{
-					if( !m_pDEM->is_NoData(x, y) && m_pDEM->asDouble(x, y) > t )
-					{
-						m_pFlow->Add_Value(x, y, 100.0);
-					}
-				}
-			}
-			break;
-
-		case 2:
-			for(y=0; y<m_pDEM->Get_NY(); y++)
-			{
-				for(x=0; x<m_pDEM->Get_NX() / 2; x++)
-				{
-					if( !m_pDEM->is_NoData(x, y) )
-					{
-						m_pFlow->Add_Value(x, y, 100.0);
-					}
-				}
-			}
-			break;
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_simulation/hydrology/sim_hydrology/Makefile.in b/src/modules_simulation/hydrology/sim_hydrology/Makefile.in
deleted file mode 100644
index bf02867..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/Makefile.in
+++ /dev/null
@@ -1,594 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_simulation/hydrology/sim_hydrology
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libsim_hydrology_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libsim_hydrology_la_OBJECTS = DVWK_SoilMoisture.lo idw.lo \
-	KinWav_D8.lo MLB_Interface.lo topmodel.lo topmodel_values.lo \
-	WaterRetentionCapacity.lo
-libsim_hydrology_la_OBJECTS = $(am_libsim_hydrology_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libsim_hydrology_la_SOURCES)
-DIST_SOURCES = $(libsim_hydrology_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libsim_hydrology.la
-libsim_hydrology_la_SOURCES = \
-DVWK_SoilMoisture.cpp\
-idw.cpp\
-KinWav_D8.cpp\
-MLB_Interface.cpp\
-topmodel.cpp\
-topmodel_values.cpp\
-WaterRetentionCapacity.cpp\
-DVWK_SoilMoisture.h\
-idw.h\
-KinWav_D8.h\
-MLB_Interface.h\
-topmodel.h\
-topmodel_values.h\
-WaterRetentionCapacity.h
-
-libsim_hydrology_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_simulation/hydrology/sim_hydrology/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_simulation/hydrology/sim_hydrology/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libsim_hydrology.la: $(libsim_hydrology_la_OBJECTS) $(libsim_hydrology_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libsim_hydrology_la_OBJECTS) $(libsim_hydrology_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/DVWK_SoilMoisture.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/KinWav_D8.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/WaterRetentionCapacity.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/idw.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topmodel.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topmodel_values.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.cpp b/src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.cpp
deleted file mode 100644
index a9a5737..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/**********************************************************
- * Version $Id: WaterRetentionCapacity.cpp 966 2011-03-25 00:40:53Z johanvdw $
- *********************************************************/
-/*******************************************************************************
-    WaterRetentionCapacity.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-#include "idw.h"
-#include "WaterRetentionCapacity.h"
-
-CWaterRetentionCapacity::CWaterRetentionCapacity(void){
-
-	Parameters.Set_Name(_TL("Water Retention Capacity"));
-	Parameters.Set_Description(_TW(
-		"(c) 2004 Victor Olaya. Water Retention Capacity (Gandullo, 1994)"));
-
-	Parameters.Add_Shapes(NULL,
-						"SHAPES",
-						_TL("Plot Holes"),
-						_TL(""),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Shapes(NULL,
-						"OUTPUT",
-						_TL("Final Parameters"),
-						_TL(""),
-						PARAMETER_OUTPUT);
-	
-	Parameters.Add_Grid(NULL,
-						"DEM",
-						_TL("DEM"),
-						_TL("DEM"),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL,
-						"RETENTION",
-						_TL("Water Retention Capacity"),
-						_TL(""),
-						PARAMETER_OUTPUT);
-
-}//constructor
-
-CWaterRetentionCapacity::~CWaterRetentionCapacity(void)
-{}
-
-bool CWaterRetentionCapacity::On_Execute(void){
-
-	int i,j;
-	int x,y;
-	int iField;
-	int iShape;
-	int iRows;
-	float fValue = 0;
-	float **pData;
-	int iX, iY;
-	float fC;
-	double dSlope,dAspect;	
-	CSG_Shape* pShape;
-	CSG_Shapes* pShapes = Parameters("SHAPES")->asShapes();
-	CSG_Grid* pDEM = Parameters("DEM")->asGrid();
-	
-	m_pRetention = Parameters("RETENTION")->asGrid();
-	m_pSlope = SG_Create_Grid(pDEM);
-	m_pOutput = Parameters("OUTPUT")->asShapes();
-
-	m_pOutput->Assign(pShapes);
-	m_pOutput->Add_Field("CCC", SG_DATATYPE_Double);
-	m_pOutput->Add_Field("CIL", SG_DATATYPE_Double);
-	m_pOutput->Add_Field(_TL("Permeability"), SG_DATATYPE_Double);
-	m_pOutput->Add_Field(_TL("Equivalent Moisture"), SG_DATATYPE_Double);
-	m_pOutput->Add_Field(_TL("Water Retention Capacity"), SG_DATATYPE_Double);
-
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(x=0; x<Get_NX(); x++){
-			if( pDEM->Get_Gradient(x, y, dSlope, dAspect) ){
-				m_pSlope->Set_Value(x, y, dSlope);				
-			}
-			else{
-				m_pSlope->Set_NoData(x, y);				
-			}
-		}
-	}
-
-	iRows = pShapes->Get_Field_Count() / 5;
-	pData = new float*[iRows];
-
-	for (iShape = 0; iShape < pShapes->Get_Count(); iShape++){
-		pShape = pShapes->Get_Shape(iShape);
-		for (i = 0; i< iRows; i++){
-			pData[i] = new float[5];
-			for (j = 0; j < 5; j++){
-				pData[i][j] = 0;
-				try{
-					pData[i][j] = pShape->asFloat(j+i*5);
-				}//try
-				catch(...){}
-			}//for
-		}//for
-		iX = (int)((pShape->Get_Point(0).x - pDEM->Get_XMin())/pDEM->Get_Cellsize());
-		iY = (int)((pShape->Get_Point(0).y - pDEM->Get_YMin())/pDEM->Get_Cellsize());
-		fC = (float)(1. - tan(m_pSlope->asFloat(iX,iY,false)));
-		pShape = m_pOutput->Get_Shape(iShape);
-		CalculateWaterRetention(pData, iRows, fC, pShape);
-	}//for
-
-	iField = m_pOutput->Get_Field_Count()-1;
-
-	CIDW IDW;
-
-	IDW.setParameters(m_pRetention, m_pOutput, iField);
-	IDW.Interpolate();
-
-	CorrectWithSlope();
-
-	return true;
-
-}//method
-
-void CWaterRetentionCapacity::CalculateWaterRetention(float **pData, 
-													   int iNumHorizons, 
-													   float fC,
-													   CSG_Table_Record *pRecord){
-
-	int i;
-	int iField;
-	float *pCCC = new float[iNumHorizons];
-	float *pCIL = new float[iNumHorizons];
-	float *pK = new float[iNumHorizons];
-	int *pPerm = new int[iNumHorizons];
-	float *pHe = new float[iNumHorizons];
-	float *pCRA = new float[iNumHorizons];
-	float fTotalDepth = 0;
-	float fWaterRetention = 0;
-	float fPerm = 0;
-	float fHe = 0;
-	float fK = 0;
-	float fCCC = 0;
-	float fCIL = 0;
-
-	pK[0] = 0;
-	for (i = 0; i < iNumHorizons; i++){
-		pCCC[i] = CalculateCCC(pData[i]);
-		pCIL[i] = CalculateCIL(pData[i]);
-		pPerm[i] = CalculatePermeability(pCCC[i], pCIL[i]);
-		pHe[i] = CalculateHe(pData[i]);
-		if (i){
-			pK[i] = CalculateK(pPerm[i-1], pPerm[i], fC);
-		}//if
-		pCRA[i] = (float)((12.5 * pHe[i] + 12.5 * (50. - pHe[i]) * pK[i] / 2.) * pData[i][1] / 100.);
-		fTotalDepth += pData[i][0];
-	}//for
-	for (i = 0; i < iNumHorizons; i++){
-		fWaterRetention += pData[i][0] / fTotalDepth * pCRA[i];
-		fCCC += pData[i][0] / fTotalDepth * pCCC[i];
-		fCIL += pData[i][0] / fTotalDepth * pCIL[i];
-		fPerm += pData[i][0] / fTotalDepth * pPerm[i];
-		fHe += pData[i][0] / fTotalDepth * pHe[i];
-		fK += pData[i][0] / fTotalDepth * pK[i];
-	}//for
-
-	iField = pRecord->Get_Table()->Get_Field_Count() - 1;
-
-	pRecord->Set_Value(iField - 4, fCCC);
-	pRecord->Set_Value(iField - 3, fCIL);
-	pRecord->Set_Value(iField - 2, fPerm);
-	pRecord->Set_Value(iField - 1, fHe);
-	pRecord->Set_Value(iField, fWaterRetention);
-
-	delete[]pCRA;
-}//method
-
-void CWaterRetentionCapacity::CorrectWithSlope(){
-
-	int x,y;
-	float fC;
-
-	for (x = 0; x < m_pRetention->Get_NX(); x++) {
-		for (y = 0; y < m_pRetention->Get_NY(); y++) {
-			fC = (float)(1. - tan(m_pSlope->asFloat(x,y,false)));
-			if (fC < 0.){
-				fC = 0.;
-			}//if
-			m_pRetention->Set_Value(x,y,m_pRetention->asFloat(x,y) * fC);
-		}//for
-	}//for
-
-}//method
-
-float CWaterRetentionCapacity::CalculateHe(float* pHorizon){
-
-	float fL = pHorizon[2];
-	float fTF = pHorizon[1];
-	float fAr = pHorizon[3];
-	float fMO = pHorizon[4];
-
-	float fHe = (float)(4.6 + 0.43 * fAr + 0.25 * fL + 1.22 * fMO);
-	return fHe;
-
-}//method
-
-
-float CWaterRetentionCapacity::CalculateCIL(float* pHorizon){
-
-	float fL = pHorizon[2];
-	float fTF = pHorizon[1];
-
-	float fCIL = (float)((fL * fTF) /10000.);
-	return fCIL;
-
-}//method
-
-float CWaterRetentionCapacity::CalculateCCC(float* pHorizon){
-
-	float fL = pHorizon[2];
-	float fTF = pHorizon[1];
-	float fAr = pHorizon[3];
-	float fMO = pHorizon[4];
-
-	float fCCC = (float)((fAr - 4.*fMO) / fTF);
-	return fCCC;
-
-}//method
-
-float CWaterRetentionCapacity::CalculateK(int iPermI, int iPermS, float fC){
-
-	float fAi = (float)((iPermI - 1) * .2);
-	float fAs = (float)((iPermS - 1) * .2);
-
-	return (float)((1. - fAi - (1 + fAs) * (1. - fC)));
-
-}//method
-
-
-int CWaterRetentionCapacity::CalculatePermeability(float fCCC, float fCIL){
-
-	int iPerm;
-	if (fCCC < 0.15){
-		iPerm = 5 - (int)((fCIL-0.1) / 0.15);
-	}//if
-	else if (fCIL < 0.2){
-		iPerm = 5 - (int)(fCCC / 0.15);
-	}//else if
-	else{
-		iPerm = (int)(5 - (fCCC + fCIL - 0.1) / 0.15);
-	}//else
-
-	if (iPerm < 1){
-		iPerm = 1;
-	}//if
-
-	return iPerm;
-
-}//method
diff --git a/src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.h b/src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.h
deleted file mode 100644
index 00c50d7..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**********************************************************
- * Version $Id: WaterRetentionCapacity.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    WaterRetentionCapacity.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CWaterRetentionCapacity : public CSG_Module_Grid {
-
-public:
-	CWaterRetentionCapacity(void);
-	virtual ~CWaterRetentionCapacity(void);
-
-private:
-	
-	CSG_Grid *m_pSlope;
-	CSG_Grid *m_pRetention;
-	CSG_Shapes *m_pOutput;
-	
-	void CalculateWaterRetention(float**,int, float, CSG_Table_Record*);
-	void CorrectWithSlope();
-	float CalculateCCC(float*);
-	float CalculateCIL(float*);
-	int CalculatePermeability(float, float);
-	float CalculateHe(float*);
-	float CalculateK(int,int,float);
-
-protected:
-	virtual bool On_Execute(void);
-
-};
diff --git a/src/modules_simulation/hydrology/sim_hydrology/idw.cpp b/src/modules_simulation/hydrology/sim_hydrology/idw.cpp
deleted file mode 100644
index 18b18cd..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/idw.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/**********************************************************
- * Version $Id: idw.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    IDW.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "idw.h"
-
-CIDW::CIDW()
-{
-
-}
-
-CIDW::~CIDW()
-{
-
-}
-
-void CIDW::setParameters(CSG_Grid* pGrid, CSG_Shapes *pPoints, int iField){
-
-	m_pGrid = pGrid;
-	m_pPoints = pPoints;
-	m_iField = iField;
-
-}//method
-
-void CIDW::Interpolate(){
-
-	int x,y;
-
-	for(y=0; y<m_pGrid->Get_NY(); y++){		
-		for(x=0; x<m_pGrid->Get_NX(); x++){
-			Get_Grid_Value(x,y);
-        }// for
-    }// for
-
-}//method
-
-//---------------------------------------------------------
-bool CIDW::Get_Grid_Value(int x, int y)
-{
-	int			iPoint, nPoints;
-	double		zSum, dSum, d, dx, xPos, yPos;
-	TSG_Point	Point;
-	CSG_Shape		*pPoint;
-
-	nPoints = m_pPoints->Get_Count();
-
-	xPos	= m_pGrid->Get_XMin() + x * m_pGrid->Get_Cellsize();
-	yPos	= m_pGrid->Get_YMin() + y * m_pGrid->Get_Cellsize();
-
-	for(iPoint=0, zSum=0.0, dSum=0.0; iPoint<nPoints; iPoint++){
-		
-		pPoint = m_pPoints->Get_Shape(iPoint);
-		Point = pPoint->Get_Point(0);
-
-		dx		= Point.x - xPos;
-		d		= Point.y - yPos;
-		d		= sqrt(dx*dx + d*d);
-
-		if( d <= 0.0 ){
-			m_pGrid->Set_Value(x, y, pPoint->asDouble(m_iField) );
-			return( true );
-		}//if
-
-		d		= pow(d, -2);
-
-		zSum	+= d * pPoint->asDouble(m_iField);
-		dSum	+= d;
-	}//for
-
-	if( dSum > 0.0 ){
-		m_pGrid->Set_Value(x, y, zSum / dSum );
-		return( true );
-	}//if
-
-	m_pGrid->Set_NoData(x, y);
-
-	return( false );
-
-}//method
\ No newline at end of file
diff --git a/src/modules_simulation/hydrology/sim_hydrology/idw.h b/src/modules_simulation/hydrology/sim_hydrology/idw.h
deleted file mode 100644
index 6315561..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/idw.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**********************************************************
- * Version $Id: idw.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Isochrones.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include <saga_api/saga_api.h>
-
-class CIDW  
-{
-public:
-	
-	CIDW();
-	virtual ~CIDW();
-	void setParameters(CSG_Grid*,CSG_Shapes*,int);
-	void Interpolate();
-
-private:
-
-	CSG_Grid* m_pGrid;
-	CSG_Shapes *m_pPoints;
-	int m_iField;
-
-	bool Get_Grid_Value(int,int);
-
-};
-
diff --git a/src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp b/src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp
deleted file mode 100644
index 9fdcfd4..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp
+++ /dev/null
@@ -1,712 +0,0 @@
-/**********************************************************
- * Version $Id: topmodel.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     sim_hydrology                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     topmodel.cpp                      //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "topmodel.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTOPMODEL::CTOPMODEL(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	// Place information about your module here...
-
-	Set_Name		(_TL("TOPMODEL"));
-
-	Set_Author		(SG_T("(c) 2003 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"Simple Subcatchment Version of TOPMODEL\n\n"
-
-		"Based on the 'TOPMODEL demonstration program v95.02' by Keith Beven "
-		"(Centre for Research on Environmental Systems and Statistics, "
-		"Institute of Environmental and Biological Sciences, "
-		"Lancaster University, Lancaster LA1 4YQ, UK) "
-		"and the C translation of the Fortran source codes implementated in GRASS.\n\n"
-
-		"This program allows single or multiple subcatchment calculations "
-		"but with single average rainfall and potential evapotranspiration "
-		"inputs to the whole catchment.  Subcatchment discharges are routed "
-		"to the catchment outlet using a linear routing algorithm with "
-		"constant main channel velocity and internal subcatchment "
-		"routing velocity.  The program requires ln(a/tanB) distributions "
-		"for each subcatchment.  These may be calculated using the "
-		"GRIDATB program which requires raster elevation data as input. "
-		"It is recommended that those data should be 50 m resolution or "
-		"better.\n\n"
-
-		"NOTE that TOPMODEL is not intended to be a traditional model "
-		"package but is more a collection of concepts that can be used "
-		"**** where appropriate ****. It is up to the user to verify that "
-		"the assumptions are appropriate (see discussion in "
-		"Beven et al.(1994).   This version of the model  will be "
-		"best suited to catchments with shallow soils and moderate "
-		"topography which do not suffer from excessively long dry "
-		"periods.  Ideally predicted contributing areas should be "
-		"checked against what actually happens in the catchment.\n\n"
-
-		"It includes infiltration excess calculations and parameters "
-		"based on the exponential conductivity Green-Ampt model of "
-		"Beven (HSJ, 1984) but if infiltration excess does occur it "
-		"does so over whole area of a subcatchment.  Spatial variability "
-		"in conductivities can however be handled by specifying "
-		"Ko parameter values for different subcatchments, even if they "
-		"have the same ln(a/tanB) and routing parameters, ie. to "
-		"represent different parts of the area.\n\n"
-
-		"Note that time step calculations are explicit ie. SBAR "
-		"at start of time step is used to determine contributing area. "
-		"Thus with long (daily) time steps contributing area depends on "
-		"initial value together with any volume filling effect of daily "
-		"inputs.  Also baseflow at start of time step is used to update "
-		"SBAR at end of time step."
-
-		"\n\nReferences\n"
-		"- Beven, K., Kirkby, M.J., Schofield, N., Tagg, A.F. (1984): "
-		"  Testing a physically-based flood forecasting model (TOPMODEL) for threee U.K. catchments, "
-		"  Journal of Hydrology, H.69, S.119-143.\n"
-		"\n"
-		"- Beven, K. (1997): "
-		"  TOPMODEL - a critique, "
-		"  Hydrological Processes, Vol.11, pp.1069-1085.\n"
-	));
-
-
-	//-----------------------------------------------------
-
-	Parameters.Add_Grid(
-		NULL	, "ATANB"		, _TL("Topographic Wetness Index"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "MOIST"		, _TL("Soil Moisture Deficit"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	pNode	= Parameters.Add_Table(
-		NULL	, "WEATHER"		, _TL("Weather Records"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "RECORD_P"	, _TL("Precipitation [m / dt]"),
-		_TL("")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "RECORD_ET"	, _TL("Evapotranspiration [m / dt]"),
-		_TL("")
-	);
-
-	Parameters.Add_Table_Field(
-		pNode	, "RECORD_DATE"	, _TL("Date/Time"),
-		_TL(""),
-		true
-	);
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Simulation Output"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DTIME"		, _TL("Time Step [h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 1.0
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NCLASSES"	, _TL("Number of Classes"),
-		_TL(""),
-		PARAMETER_TYPE_Int		, 30	, 1	, true
-	);
-
-	pNode	= NULL;	// = Parameters("MOIST");
-
-	Parameters.Add_Value(
-		pNode, "P_QS0"			, _TL("Initial subsurface flow per unit area [m/h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 3.28e-05
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_LNTE"			, _TL("Areal average of ln(T0) = ln(Te) [ln(m^2/h)]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 5.0
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_MODEL"		, _TL("Model parameter [m]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.032
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_SR0"			, _TL("Initial root zone storage deficit [m]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.002
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_SRZMAX"		, _TL("Maximum root zone storage deficit [m]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.05
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_SUZ_TD"		, _TL("Unsaturated zone time delay per unit storage deficit [h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 50.0
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_VCH"			, _TL("Main channel routing velocity [m/h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 3600.0
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_VR"			, _TL("Internal subcatchment routing velocity [m/h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 3600.0
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_K0"			, _TL("Surface hydraulic conductivity [m/h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 1.0
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_PSI"			, _TL("Wetting front suction [m]"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.02
-	);
-
-	Parameters.Add_Value(
-		pNode, "P_DTHETA"		, _TL("Water content change across the wetting front"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.1
-	);
-
-	Parameters.Add_Value(
-		pNode, "BINF"			, _TL("Green-Ampt Infiltration"),
-		_TL(""),
-		PARAMETER_TYPE_Bool		, true
-	);
-}
-
-//---------------------------------------------------------
-CTOPMODEL::~CTOPMODEL(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTOPMODEL::On_Execute(void)
-{
-	bool				bInfiltration;
-	long				n;
-	int					iClass, nClasses, iTime, nTimeSteps, k;
-	double				Precipitation, Evaporation, Infiltration, Infiltration_Excess;
-	CSG_String			Time;
-	CSG_Grid			*pAtanB, *pMoist, gClass;
-	CSG_Table_Record	*pRecord;
-	CSG_Table			*pTable;
-
-
-	//-----------------------------------------------------
-	// Get user inputs from the 'Parameters' object...
-
-	pAtanB			= Parameters("ATANB")		->asGrid();
-	m_pWeather		= Parameters("WEATHER")		->asTable();
-	m_fP			= Parameters("RECORD_P")	->asInt();
-	m_fET			= Parameters("RECORD_ET")	->asInt();
-	m_fTime			= Parameters("RECORD_DATE")	->asInt();
-	dTime			= Parameters("DTIME")		->asDouble();
-	nClasses		= Parameters("NCLASSES")	->asInt();
-	bInfiltration	= Parameters("BINF")		->asBool();
-
-	nTimeSteps		= m_pWeather->Get_Record_Count();
-
-	if( (pMoist = Parameters("MOIST")->asGrid()) != NULL )
-	{
-		pMoist->Set_Name(_TL("Soil Moisture Deficit"));
-		DataObject_Set_Colors(pMoist, 100, SG_COLORS_RED_GREY_BLUE, true);
-	}
-
-
-	//-----------------------------------------------------
-	pTable			= Parameters("TABLE")->asTable();
-	pTable->Destroy();
-	pTable->Set_Name(_TL("TOPMODEL - Simulation Output"));
-
-	pTable->Add_Field(_TL("Time")										, SG_DATATYPE_String);
-	pTable->Add_Field(_TL("Total flow (in watershed) [m^3/dt]")			, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Total flow [m/dt]")							, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Saturation overland flow [m/dt]")			, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Subsurface flow [m/dt]")						, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Vertical (drainage) flux [m/dt]")			, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Mean saturation deficit (in watershed) [m]")	, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Infiltration rate [m/dt]")					, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Infiltration excess runoff [m/dt]")			, SG_DATATYPE_Double);
-
-	//-----------------------------------------------------
-	Vals.Create(dTime, nTimeSteps, &Parameters, pAtanB, nClasses, &gClass);
-
-	//-----------------------------------------------------
-	inf_bPonding	= false;
-	inf_cumf		= 0.0;
-
-	for(iTime=0; iTime<nTimeSteps && Set_Progress(iTime, nTimeSteps); iTime++)
-	{
-		Get_Weather(iTime, Precipitation, Evaporation, Time);
-
-		if( bInfiltration && Precipitation > 0.0 )
-		{
-			Infiltration		= dTime * Get_Infiltration((iTime + 1) * dTime, Precipitation / dTime);
-			Infiltration_Excess	= Precipitation - Infiltration;
-			Precipitation		= Infiltration;
-		}
-		else
-		{
-			Infiltration		= 0.0;
-			Infiltration_Excess	= 0.0;
-		}
-
-		Run(Evaporation, Precipitation, Infiltration_Excess);
-
-		for(iClass=0; iClass<Vals.nreach_; iClass++)
-		{
-			k		= iTime + iClass + Vals.ndelay_;
-			if( k > nTimeSteps - 1 )
-				break;
-
-			Vals.Qt_[k]	+= Vals.qt_Total * Vals.Add[iClass];
-		}
-
-		if( pMoist )
-		{
-			for(n=0; n<gClass.Get_NCells(); n++)
-			{
-				iClass	= gClass.asInt(n);
-
-				if( iClass >= 0 && iClass < nClasses )
-				{
-					pMoist->Set_Value(n, Vals.Get_Class(iClass)->S_);
-				}
-				else
-				{
-					pMoist->Set_NoData(n);
-				}
-			}
-
-		//	DataObject_Update(pMoist);
-			DataObject_Update(pMoist, 0, 0.35, true);
-		}
-
-		pRecord	= pTable->Add_Record();
-		pRecord->Set_Value(0, Time);				// Time
-		pRecord->Set_Value(1, Vals.Qt_[iTime]);		// QT
-		pRecord->Set_Value(2, Vals.qt_Total);		// qt
-		pRecord->Set_Value(3, Vals.qo_Total);		// q0
-		pRecord->Set_Value(4, Vals.qs_Total);		// qs
-		pRecord->Set_Value(5, Vals.qv_Total);		// qv
-		pRecord->Set_Value(6, Vals.Sbar_);			// SBar
-		pRecord->Set_Value(7, Infiltration);		// Infiltration
-		pRecord->Set_Value(8, Infiltration_Excess);	// Infiltration Excess
-		DataObject_Update(pTable);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CTOPMODEL::Run(double Evaporation, double Precipitation, double Infiltration_Excess)
-{
-	int				iClass;
-	double			d, Excess;
-	CTOPMODEL_Class	*pClass;
-
-	Vals.qo_Total	= 0.0;
-	Vals.qv_Total	= 0.0;
-	Vals.qs_Total	= Vals._qs_ * exp(-Vals.Sbar_ / Vals.p_Model);
-
-	for(iClass=0; iClass<Vals.Get_Count(); iClass++)
-	{
-		pClass			= Vals.Get_Class(iClass);
-
-
-		//-------------------------------------------------
-		//  CALCULATE LOCAL STORAGE DEFICIT
-
-		pClass->S_		= Vals.Sbar_ + Vals.p_Model * (Vals.Get_Lambda() - pClass->AtanB);
-
-		if( pClass->S_ < 0.0 )
-		{
-			pClass->S_		= 0.0;
-		}
-
-
-		//-------------------------------------------------
-		//  ROOT ZONE CALCULATIONS
-
-		pClass->Srz_	-= Precipitation;
-
-		if( pClass->Srz_ < 0.0 )
-		{
-			pClass->Suz_	-= pClass->Srz_;
-			pClass->Srz_	= 0.0;
-		}
-
-
-		//-------------------------------------------------
-		//  UNSATURATED ZONE CALCULATIONS
-
-		if( pClass->Suz_ > pClass->S_ )
-		{
-			Excess			= pClass->Suz_ - pClass->S_;
-			pClass->Suz_	= pClass->S_;
-		}
-		else
-		{
-			Excess			= 0.0;
-		}
-
-
-		//-------------------------------------------------
-		//  CALCULATE DRAINAGE FROM SUZ (Vertical Soil Water Flux (qv))...
-
-		if( pClass->S_ > 0.0 )
-		{
-			if( Vals.p_Suz_TimeDelay > 0.0 )
-			{	// Methode 1...
-				d			= pClass->Suz_ / (pClass->S_ * Vals.p_Suz_TimeDelay) * dTime;	// GRASS
-			}
-			else
-			{	// Methode 2...
-				d			= -Vals.p_Suz_TimeDelay * Vals.p_K0 * exp(-pClass->S_ / Vals.p_Model);
-			}
-
-			if( d > pClass->Suz_ )
-			{
-				d			= pClass->Suz_;
-			}
-
-			pClass->Suz_	-= d;
-
-			if( pClass->Suz_ < 0.0000001 )
-			{
-				pClass->Suz_	= 0.0;
-			}
-
-			pClass->qv_		= d * pClass->Area_Rel;
-			Vals.qv_Total	+= pClass->qv_;
-		}
-		else
-		{
-			pClass->qv_		= 0.0;
-		}
-
-
-		//-------------------------------------------------
-		//  CALCULATE EVAPOTRANSPIRATION FROM ROOT ZONE DEFICIT
-
-		if( Evaporation > 0.0 )
-		{
-			d		= Evaporation * (1.0 - pClass->Srz_ / Vals.p_Srz_Max);
-
-			if( d > Vals.p_Srz_Max - pClass->Srz_ )
-			{
-				d		= Vals.p_Srz_Max - pClass->Srz_;
-			}
-
-			pClass->Srz_	+= d;
-		}
-
-
-		//-------------------------------------------------
-		pClass->qo_		= Excess * pClass->Area_Rel;
-		Vals.qo_Total	+= pClass->qo_;
-
-		pClass->qt_		= pClass->qo_ + Vals.qs_Total;
-	}
-
-	Vals.qo_Total	+= Infiltration_Excess;
-
-	Vals.qt_Total	= Vals.qo_Total + Vals.qs_Total;
-
-	Vals.Sbar_		+= Vals.qs_Total - Vals.qv_Total;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTOPMODEL::Get_Weather(int iTimeStep, double &Precipitation, double &Evaporation, CSG_String &Time)
-{
-	CSG_Table_Record	*pRecord;
-
-	if( m_pWeather && (pRecord = m_pWeather->Get_Record(iTimeStep)) != NULL )
-	{
-		Precipitation	= pRecord->asDouble(m_fP);
-		Evaporation		= pRecord->asDouble(m_fET);
-
-		if( m_fTime >= 0 )
-		{
-			Time		= pRecord->asString(m_fTime);
-		}
-		else
-		{
-			Time.Printf(SG_T("%d"), iTimeStep);
-		}
-
-		return( true );
-	}
-
-	Precipitation	= 0.0;
-	Evaporation		= 0.0;
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define NEWTON_EPSILON		0.001
-#define NEWTON_MAXITER		100
-#define	NEWTON_NTERMS		10
-
-//---------------------------------------------------------
-double CTOPMODEL::Get_Infiltration(double t, double R)
-{
-	int		i, j, factorial;
-
-	double	f, f_, f1, f2, fc, R2, cnst, pt, psi_dtheta, sum;
-
-
-	if( R <= 0.0 )
-	{
-		inf_cumf		= 0.0;
-		inf_bPonding	= 0;
-
-		return( 0.0 );
-	}
-
-	psi_dtheta	= Vals.p_Psi * Vals.p_dTheta;
-
-	if( !inf_bPonding )
-	{
-		if( inf_cumf )
-		{
-			f1				= inf_cumf;
-			R2				= -Vals.p_K0 / Vals.p_Model * (psi_dtheta + f1) / (1 - exp(f1 / Vals.p_Model));
-
-			if( R2 < R )
-			{
-				f_				= inf_cumf;
-				pt				= t - dTime;
-				inf_bPonding	= 1;
-
-				goto cont1;
-			}
-		}
-
-		f2				= inf_cumf + R * dTime;
-		R2				= -Vals.p_K0 / Vals.p_Model * (psi_dtheta + f2) / (1 - exp(f2 / Vals.p_Model));
-
-		if( f2 == 0.0 || R2 > R )
-		{
-			f				= R;
-			inf_cumf		+= f * dTime;
-			inf_bPonding	= 0;
-
-			return( f );
-		}
-
-		f_				= inf_cumf + R2 * dTime;
-
-		for(i=0; i<NEWTON_MAXITER; i++)
-		{
-			R2				= -Vals.p_K0 / Vals.p_Model * (psi_dtheta + f_) / (1 - exp(f_ / Vals.p_Model));
-
-			if( R2 > R )
-			{
-				f1				= f_;
-				f_				= (f_ + f2) / 2.0;
-				f				= f_ - f1;
-			}
-			else
-			{
-				f2				= f_;
-				f_				= (f_ + f1) / 2.0;
-				f				= f_ - f2;
-			}
-
-			if( fabs(f) < NEWTON_EPSILON )
-				break;
-		}
-
-		if( i == NEWTON_MAXITER )
-		{
-			// G_set_d_null_value(&f, 1);
-			return( 0.0 );
-		}
-
-		pt				= t - dTime + (f_ - inf_cumf) / R;
-
-		if( pt > t )
-		{
-			f				= R;
-			inf_cumf		+= f * dTime;
-			inf_bPonding	= 0;
-
-			return( f );
-		}
-
-cont1:
-		cnst			= 0.0;
-		factorial		= 1;
-		fc				= (f_ + psi_dtheta);
-
-		for(j=1; j<=NEWTON_NTERMS; j++)
-		{
-			factorial		*= j;
-			cnst			+= pow(fc / Vals.p_Model, (double) j) / (double) (j * factorial);
-		}
-
-		cnst			= log(fc) - (log(fc) + cnst) / exp(psi_dtheta / Vals.p_Model);
-		f_				+= R * (t - pt) / 2.0;
-		inf_bPonding	= 1;
-	}
-
-	for(i=0; i<NEWTON_MAXITER; i++)
-	{
-		fc				= f_ + psi_dtheta;
-		sum				= 0.0;
-		factorial		= 1;
-
-		for(j=1; j<=NEWTON_NTERMS; j++)
-		{
-			factorial		*= j;
-			sum				+= pow(fc / Vals.p_Model, (double) j) / (double) (j * factorial);
-		}
-
-		f1				= - (log(fc) - (log(fc) + sum) / exp(psi_dtheta / Vals.p_Model) - cnst) / (Vals.p_K0 / Vals.p_Model) - (t - pt);
-		f2				= (exp(f_ / Vals.p_Model) - 1.0) / (fc * Vals.p_K0 / Vals.p_Model);
-		f				= - f1 / f2;
-		f_				+= f;
-
-		if( fabs(f) < NEWTON_EPSILON )
-			break;
-	}
-
-	if( i == NEWTON_MAXITER )
-	{
-		// G_set_d_null_value(&f, 1);
-		return( 0.0 );
-	}
-
-	if( f_ < inf_cumf + R )
-	{
-		f				= (f_ - inf_cumf) / dTime;
-		inf_cumf		= f_;
-		f_				+= f * dTime;
-	}
-
-	return( f );
-}
diff --git a/src/modules_simulation/hydrology/sim_hydrology/topmodel_values.cpp b/src/modules_simulation/hydrology/sim_hydrology/topmodel_values.cpp
deleted file mode 100644
index cd1ed50..0000000
--- a/src/modules_simulation/hydrology/sim_hydrology/topmodel_values.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-/**********************************************************
- * Version $Id: topmodel_values.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     sim_hydrology                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  topmodel_values.cpp                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "topmodel_values.h"
-
-//---------------------------------------------------------
-#define RESET_ARRAY(a)		if( a ) { free(a); a = NULL; }
-#define RESET_MATRIX(n, m)	if( n > 0 && m ) { for(int i=0; i<n; i++) { if( m[i] ) { free(m[i]); } } free(m); m = NULL; }
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTOPMODEL_Class::CTOPMODEL_Class(double Srz_Init)
-{
-	Srz_		= Srz_Init;
-	Suz_		= 0.0;
-	S_			= 0.0;
-
-	qt_			= 0.0;
-	qo_			= 0.0;
-	qv_			= 0.0;
-
-	AtanB		= 0.0;
-	Area_Rel	= 0.0;
-}
-
-//---------------------------------------------------------
-CTOPMODEL_Class::~CTOPMODEL_Class(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTOPMODEL_Values::CTOPMODEL_Values(void)
-{
-	nClasses	= 0;
-	Lambda		= 0;
-
-	Add			= NULL;
-	Qt_			= NULL;
-
-	//-----------------------------------------------------
-	Channel_Count			= 3;
-
-	Channel_Distance		= (double *)malloc(Channel_Count * sizeof(double));
-	Channel_AreaRatio		= (double *)malloc(Channel_Count * sizeof(double));
-
-	Channel_Distance[0]		= 500;
-	Channel_AreaRatio[0]	= 0.0;
-
-	Channel_Distance[1]		= 1000;
-	Channel_AreaRatio[1]	= 0.5;
-
-	Channel_Distance[2]		= 1500;
-	Channel_AreaRatio[2]	= 1.0;
-}
-
-//---------------------------------------------------------
-CTOPMODEL_Values::~CTOPMODEL_Values(void)
-{
-	Destroy();
-
-	free(Channel_Distance);
-	free(Channel_AreaRatio);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CTOPMODEL_Values::Destroy(void)
-{
-	int		iClass;
-
-	if( nClasses > 0 )
-	{
-		for(iClass=0; iClass<nClasses; iClass++)
-		{
-			delete( Classes[iClass] );
-		}
-
-		free(Classes);
-
-		nClasses	= 0;
-	}
-
-	qt_Total	= 0.0;
-	qo_Total	= 0.0;
-	qv_Total	= 0.0;
-
-	RESET_ARRAY(Add);
-	RESET_ARRAY(Qt_);
-}
-
-//---------------------------------------------------------
-void CTOPMODEL_Values::Create(double dTime, int anTimeSteps, CSG_Parameters *pParameters, CSG_Grid *pAtanB, int anClasses, CSG_Grid *pClass)
-{
-	long	n, iClass, nCells;
-
-	double	zMin, zRange, dz;
-
-	Destroy();
-
-	if( pAtanB && anClasses > 0 )
-	{
-		//-------------------------------------------------
-		// 1. Topographic Index Classification etc...
-
-		nClasses	= anClasses;
-
-		Classes		= (CTOPMODEL_Class **)calloc(nClasses, sizeof(CTOPMODEL_Class *));
-
-		for(iClass=0; iClass<nClasses; iClass++)
-		{
-			Classes[iClass]	= new CTOPMODEL_Class(pParameters->Get_Parameter("P_SR0")->asDouble());
-		}
-
-		zMin		= pAtanB->Get_ZMin();
-		zRange		= pAtanB->Get_ZMax() - zMin;
-		dz			= zRange / (nClasses + 1);
-		nCells		= 0;
-
-		pClass->Create(pAtanB, SG_DATATYPE_Short);
-		pClass->Set_NoData_Value(-9999);
-
-		for(n=0; n<pAtanB->Get_NCells(); n++)
-		{
-			if( !pAtanB->is_NoData(n) )
-			{
-				nCells++;
-
-				iClass			= (int)((nClasses - 1.0) * (pAtanB->asDouble(n) - zMin) / zRange);
-
-				Classes[iClass]->Area_Rel++;
-
-				pClass->Set_Value(n, iClass);
-			}
-			else
-			{
-				pClass->Set_NoData(n);
-			}
-		}
-
-		Area_Total	= (double)nCells * pAtanB->Get_Cellsize() * pAtanB->Get_Cellsize();
-
-		for(iClass=0; iClass<nClasses; iClass++)
-		{
-			Classes[iClass]->AtanB		= zMin + dz * (iClass + 0.5);	// mid of class -> + 0.5...
-			Classes[iClass]->Area_Rel	/= (double)nCells;
-		}
-
-
-		//-------------------------------------------------
-		// 2. Calculate Lambda, the catchment average topographic index...
-
-		for(iClass=0, Lambda=0.0; iClass<nClasses; iClass++)
-		{
-			Lambda	+= Classes[iClass]->Area_Rel * Classes[iClass]->AtanB;
-		}
-
-
-		//-------------------------------------------------
-		// 3. Parameter Initialisation...
-
-		//-------------------------------------------------
-		p_Srz_Max		= pParameters->Get_Parameter("P_SRZMAX")->asDouble();
-		p_Model			= pParameters->Get_Parameter("P_MODEL")->asDouble();
-		p_Suz_TimeDelay	= pParameters->Get_Parameter("P_SUZ_TD")->asDouble();
-		p_K0			= pParameters->Get_Parameter("P_K0")->asDouble();
-		p_Psi			= pParameters->Get_Parameter("P_PSI")->asDouble();
-		p_dTheta		= pParameters->Get_Parameter("P_DTHETA")->asDouble();
-
-
-		//-------------------------------------------------
-		int		i, j, t;
-
-		double	A1, A2,
-				qs0_,	// Initial subsurface flow per unit area [m/h], "The first streamflow input is assumed to represent only the subsurface flow contribution in the watershed."
-				vch_,	// Main channel routing velocity [m/h]
-				vr_,	// Internal subcatchment routing velocity [m/h]
-				*tch_;	// params.nch's
-
-		//-------------------------------------------------
-		lnTe_		= log(dTime)	+ pParameters->Get_Parameter("P_LNTE")->asDouble();
-		vch_		= dTime			* pParameters->Get_Parameter("P_VCH")->asDouble();
-		vr_			= dTime			* pParameters->Get_Parameter("P_VR")->asDouble();
-		qs0_		= dTime			* pParameters->Get_Parameter("P_QS0")->asDouble();
-		_qs_		= exp(lnTe_ - Lambda);
-
-		//-------------------------------------------------
-		tch_		= (double *)malloc(Channel_Count * sizeof(double));
-		tch_[0]		= Channel_Distance[0] / vch_;
-
-		for(i=1; i<Channel_Count; i++)
-		{
-			tch_[i]		= tch_[0] + (Channel_Distance[i] - Channel_Distance[0]) / vr_;
-		}
-
-		//-------------------------------------------------
-		nreach_		= (int)tch_[Channel_Count - 1];
-		if( (double)nreach_ < tch_[Channel_Count - 1] )
-		{
-			nreach_++;
-		}
-
-		ndelay_		= (int)tch_[0];
-		nreach_		-= ndelay_;
-
-		//-------------------------------------------------
-		Add			= (double *)malloc(nreach_ * sizeof(double));
-
-		for(i=0; i<nreach_; i++)
-		{
-			t			= ndelay_ + i + 1;
-			if( t > tch_[Channel_Count - 1])
-			{
-				Add[i]		= 1.0;
-			}
-			else
-			{
-				for(j=1; j<Channel_Count; j++)
-				{
-					if( t <= tch_[j] )
-					{
-						Add[i]		= Channel_AreaRatio[j - 1]
-									+ (Channel_AreaRatio[j] - Channel_AreaRatio[j - 1])
-									* (t - tch_[j - 1]) / (tch_[j] - tch_[j - 1]);
-						break;
-					}
-				}
-			}
-		}
-
-		A1			= Add[0];
-		Add[0]		*= Area_Total;
-
-		for(i=1; i<nreach_; i++)
-		{
-			A2			= Add[i];
-			Add[i]		= A2 - A1;
-			A1			= A2;
-			Add[i]		*= Area_Total;
-		}
-
-		//-------------------------------------------------
-		Sbar_		= -p_Model * log(qs0_ / _qs_);
-
-		//-------------------------------------------------
-		Qt_			= (double *)calloc(anTimeSteps, sizeof(double));
-		for(i=0; i<anTimeSteps; i++)
-		{
-			Qt_[i]		= 0.0;
-		}
-
-		for(i=0; i<ndelay_; i++)
-		{
-			Qt_[i] = qs0_ * Area_Total;
-		}
-
-		A1			= 0.0;
-
-		for(i=0; i<nreach_; i++)
-		{
-			A1					+= Add[i];
-			Qt_[ndelay_ + i]	= qs0_ * (Area_Total - A1);
-		}
-
-		//-------------------------------------------------
-		RESET_ARRAY(tch_);
-	}
-}
diff --git a/src/modules_terrain_analysis/Makefile.am b/src/modules_terrain_analysis/Makefile.am
deleted file mode 100644
index b58fc1d..0000000
--- a/src/modules_terrain_analysis/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = terrain_analysis
diff --git a/src/modules_terrain_analysis/Makefile.in b/src/modules_terrain_analysis/Makefile.in
deleted file mode 100644
index 780b3ce..0000000
--- a/src/modules_terrain_analysis/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = terrain_analysis
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/Makefile.am b/src/modules_terrain_analysis/terrain_analysis/Makefile.am
deleted file mode 100644
index ba5cf83..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = ta_profiles ta_preprocessor ta_morphometry ta_lighting ta_hydrology ta_compound ta_channels
diff --git a/src/modules_terrain_analysis/terrain_analysis/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/Makefile.in
deleted file mode 100644
index 682012d..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/Makefile.in
+++ /dev/null
@@ -1,589 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUBDIRS = ta_profiles ta_preprocessor ta_morphometry ta_lighting ta_hydrology ta_compound ta_channels
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.cpp
deleted file mode 100644
index 9ffc396..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.cpp
+++ /dev/null
@@ -1,805 +0,0 @@
-/**********************************************************
- * Version $Id: ChannelNetwork.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_channels                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  ChannelNetwork.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "ChannelNetwork.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CChannelNetwork::CChannelNetwork(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name(_TL("Channel Network"));
-
-	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"This module derives a channel network based on gridded digital elevation data.\n"
-		"Use the initiation options to determine under which conditions channels shall start.\n"
-		"\n")
-	);
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL("A grid that contains elevation data."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SINKROUTE"	, _TL("Flow Direction"),
-		_TW(
-		"An optional grid that provides information about flow directions. \n"
-		"Values between 1 to 8 force the flow of a cell to be given to one its adjacent neighbor cells "
-		"(1->NE, 2->E, 3->SE, 4->S, 5->SW, 6->W, 7->NW, 8->N). "
-		"In case of other values the algorithm will use its own routing scheme. \n"
-		"This option is in particular useful to supply the algorithm with routes that lead the flow through closed depression. "),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL	, "CHNLNTWRK"	, _TL("Channel Network"),
-		_TW("If a cell is part of a channel its value equals the channel order. "
-		"Otherwise the cell is marked as no-data."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHNLROUTE"	, _TL("Channel Direction"),
-		_TW("If a cell is part of a channel then its value shows the flow direction of the channel "
-		"(1->NE, 2->E, 3->SE, 4->S, 5->SW, 6->W, 7->NW, 8->N). "
-		"Otherwise the cell is marked as no-data."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Channel Network"),
-		_TL("This shapes layer will contain the resulting channel network in vector format (lines)."),
-		PARAMETER_OUTPUT		, SHAPE_TYPE_Line
-	);
-
-
-	//-----------------------------------------------------
-	// Initiation...
-
-	pNode	= Parameters.Add_Grid(
-		NULL	, "INIT_GRID"	, _TL("Initiation Grid"),
-		_TW("Dependent on the chosen 'Initiation Type' and 'Initiation Threshold' "
-		"the values of this grid control where a channel is initiated."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "INIT_METHOD"	, _TL("Initiation Type"),
-		_TL("Options:\n - Less than\n - Equals\n - Greater than\nControls under which condition a channel is initiated."),
-
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Less than"),
-			_TL("Equals"),
-			_TL("Greater than")
-		), 2
-	);
-
-	Parameters.Add_Value(
-		pNode	, "INIT_VALUE"	, _TL("Initiation Threshold"),
-		_TL("Dependent on the chosen 'Initiation Grid' and 'Initiation Type' this value controls under which condition a channel is initiated."),
-		PARAMETER_TYPE_Double	, 0.0
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Grid(
-		NULL	, "DIV_GRID"	, _TL("Divergence"),
-		_TL("Tracing: Convergence"),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		pNode	, "DIV_CELLS"	, _TL("Tracing: Max. Divergence"),
-		_TL("Tracing: Stop after x cells with divergent flow"),
-		PARAMETER_TYPE_Int		, 5, 1, true
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "TRACE_WEIGHT", _TL("Tracing: Weight"),
-		_TL("Tracing: Weight"),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL	, "MINLEN"		, _TL("Min. Segment Length"),
-		_TL("Minimum Segment Length (Cells)"),
-		PARAMETER_TYPE_Int		, 10
-	);
-}
-
-//---------------------------------------------------------
-CChannelNetwork::~CChannelNetwork(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CChannelNetwork::On_Execute(void)
-{
-	int		x, y, ID, Trace_Method, Init_Method;
-	long	n;
-	double	Init_Threshold;
-	CSG_Grid	*Trace_pRoute, *Trace_pWeight, *Init_pGrid;
-
-
-	//-----------------------------------------------------
-	pDTM				= Parameters("ELEVATION")	->asGrid();
-	pConvergence		= Parameters("DIV_GRID")	->asGrid();
-
-	pChannels			= Parameters("CHNLNTWRK")	->asGrid();
-	pChannelRoute		= Parameters("CHNLROUTE")	->asGrid();
-	pShapes				= Parameters("SHAPES")		->asShapes();
-
-	minLength			= Parameters("MINLEN")		->asInt();
-
-	maxDivCells			= Parameters("DIV_GRID")->asGrid() ? Parameters("DIV_CELLS")->asInt() : -1;
-
-
-	//-----------------------------------------------------
-	// 1. Flow Direction...
-
-	Process_Set_Text(_TL("Channel Network: Pass 1"));
-
-	pChannels->Assign();
-
-	Trace_pRoute		= Parameters("SINKROUTE")	->asGrid();
-	Trace_pWeight		= Parameters("TRACE_WEIGHT")->asGrid();
-	Trace_Method		= Trace_pWeight ? 1 : 0;
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( Trace_pRoute && (ID = Trace_pRoute->asChar(x, y)) >= 1 && ID <= 8 )
-			{
-				pChannels->Set_Value(x, y, ID);
-			}
-			else
-			{
-				switch( Trace_Method )
-				{
-				default:
-					Set_Route_Standard(x, y);
-					break;
-
-				case 1:
-					Set_Route_Weighted(x, y, Trace_pWeight, 0.0);
-					break;
-				}
-			}
-		}
-	}
-
-
-	//-----------------------------------------------------
-	// 2. Initiation...
-
-	Process_Set_Text(_TL("Channel Network: Pass 2"));
-
-	pStart				= SG_Create_Grid(pDTM, SG_DATATYPE_Char);
-	Init_pGrid			= Parameters("INIT_GRID")	->asGrid();
-	Init_Method			= Parameters("INIT_METHOD")	->asInt();
-	Init_Threshold		= Parameters("INIT_VALUE")	->asDouble();
-
-	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		switch( Init_Method )
-		{
-		case 0:
-			if( Init_pGrid->asDouble(n) <= Init_Threshold )
-				pStart->Set_Value(n, 1);
-			break;
-
-		case 1:
-			if( Init_pGrid->asDouble(n) == Init_Threshold )
-				pStart->Set_Value(n, 1);
-			break;
-
-		case 2:
-			if( Init_pGrid->asDouble(n) >= Init_Threshold )
-				pStart->Set_Value(n, 1);
-			break;
-		}
-	}
-
-
-	//-----------------------------------------------------
-	// 3. Trace Channel Routes...
-
-	Process_Set_Text(_TL("Channel Network: Pass 3"));
-
-	pChannelRoute->Assign();
-
-	Direction			= NULL;
-	Direction_Buffer	= 0;
-
-	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( pDTM->Get_Sorted(n,x,y) )
-		{
-			Set_Channel_Route(x,y);
-		}
-	}
-
-	if( Direction )
-	{
-		SG_Free( Direction );
-	}
-
-	pChannels->Assign();
-
-	delete(pStart);
-
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Channel Network: Pass 4"));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			Set_Channel_Order(x,y);
-		}
-	}
-
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Channel Network: Pass 5"));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			Set_Channel_Mouth(x,y);
-		}
-	}
-
-
-	//-----------------------------------------------------
-	if( pShapes )
-	{
-		Process_Set_Text(_TL("Channel Network: Pass 6"));
-
-		pShapes->Create(SHAPE_TYPE_Line, _TL("Channel Network"));
-
-		pShapes->Add_Field("SegmentID"	,SG_DATATYPE_Int);
-		pShapes->Add_Field("Order"		,SG_DATATYPE_Int);
-		pShapes->Add_Field("Length"		,SG_DATATYPE_Double);
-
-		Lock_Create();
-
-		for(y=0, ID=1; y<Get_NY() && Set_Progress(y); y++)
-		{
-			for(x=0; x<Get_NX(); x++)
-			{
-				Set_Vector(x, y, ID++);
-			}
-		}
-
-		Lock_Destroy();
-	}
-
-
-	//-----------------------------------------------------
-	for(n=0; n<Get_NCells(); n++)
-	{
-		if( pChannels->asInt(n) == 0 )
-		{
-			pChannels->Set_NoData(n);
-			pChannelRoute->Set_NoData(n);
-		}
-	}
-
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork::Set_Route_Standard(int x, int y)
-{
-	int		i, ix, iy, iMin;
-
-	double	z, dz, dzMin;
-
-	z		= pDTM->asDouble(x,y);
-	iMin	= 0;
-
-	for(i=1; i<=8; i++)
-	{
-		ix		= Get_xTo(i,x);
-		iy		= Get_yTo(i,y);
-
-		if( !pDTM->is_InGrid(ix,iy) )
-		{
-			iMin	= i;
-			break;
-		}
-		else
-		{
-			dz		= (z - pDTM->asDouble(ix,iy)) / Get_Length(i);
-
-			if( iMin <= 0 || dzMin < dz )
-			{
-				iMin	= i;
-				dzMin	= dz;
-			}
-		}
-	}
-
-	pChannels->Set_Value(x,y, iMin );
-}
-
-//---------------------------------------------------------
-void CChannelNetwork::Set_Route_Weighted(int x, int y, CSG_Grid *pWeight, double Weight_Threshold)
-{
-	bool	bMin;
-
-	int		i, ix, iy, iMin;
-
-	double	z, dz, dzMin, w, wMin;
-
-	z		= pDTM->asDouble(x,y);
-	iMin	= 0;
-
-	for(i=1; i<=8; i++)
-	{
-		ix		= Get_xTo(i,x);
-		iy		= Get_yTo(i,y);
-
-		if( !pDTM->is_InGrid(ix, iy) )
-		{
-			iMin	= i;
-			break;
-		}
-		else
-		{
-			dz		= (z - pDTM->asDouble(ix,iy)) / Get_Length(i);
-
-			if( dz > 0 )
-			{
-				bMin	= false;
-				w		= pWeight->asDouble(ix,iy);
-
-				if(	iMin <= 0 )
-				{
-					bMin	= true;
-				}
-				else if( Weight_Threshold > 0 )
-				{
-					if( w > Weight_Threshold && wMin > Weight_Threshold )
-					{
-						if( dzMin < dz )
-						{
-							bMin	= true;
-						}
-					}
-					else if( wMin < w )
-					{
-						bMin	= true;
-					}
-				}
-				else if( wMin < w )
-				{
-					bMin	= true;
-				}
-
-				if( bMin )
-				{
-					iMin	= i;
-					wMin	= w;
-					dzMin	= dz;
-				}
-			}
-		}
-	}
-
-	pChannels->Set_Value(x,y, iMin );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork::Set_Channel_Route(int x, int y)
-{
-	const int	BUFFER_GROWSIZE	= 256;
-
-	int		xStart, yStart, i, ix, iy, goDir, m, n, nDiv;
-
-	double	z, dz, dzMin, Length;
-
-	//-----------------------------------------------------
-	if( pStart->asChar(x,y) && !pChannelRoute->asChar(x,y) )
-	{
-		Lock_Create();
-
-		n		= 0;
-		nDiv	= 0;
-		Length	= 0;
-		xStart	= x;
-		yStart	= y;
-
-		do
-		{
-			//---------------------------------------------
-			// 1. Divergence ?!...
-
-			if( pConvergence )
-			{
-				if( pConvergence->asDouble(x,y) > -1.0 )
-				{
-					nDiv++;
-				}
-				else
-				{
-					nDiv	= 0;
-				}
-			}
-
-			if( pConvergence && nDiv > maxDivCells )
-			{
-				goDir	= -1;
-			}
-			else
-			{
-				//-----------------------------------------
-				// 2. Is there any channel around ?!...
-
-				goDir	= 0;
-				z		= pDTM->asDouble(x,y);
-
-				for(i=1; i<=8; i++)
-				{
-					ix		= Get_xTo(i,x);
-					iy		= Get_yTo(i,y);
-
-					if( pDTM->is_InGrid(ix,iy) && !is_Locked(ix,iy) && pChannelRoute->asChar(ix,iy) )
-					{
-						dz		= (z - pDTM->asDouble(ix,iy)) / Get_Length(i);
-
-						if( goDir <= 0 || dzMin < dz )
-						{
-							goDir	= i;
-							dzMin	= dz;
-						}
-					}
-				}
-
-				if( goDir <= 0 )	// ...if not then go as usual...
-				{
-					goDir	= pChannels->asInt(x,y);
-				}
-
-
-				//-----------------------------------------
-				// 3. Go to Drainage Direction !...
-
-				if(	goDir > 0 )
-				{
-					Lock_Set(x,y);
-
-					x		= Get_xTo(goDir,x);
-					y		= Get_yTo(goDir,y);
-
-					Length	+= Get_UnitLength(goDir);
-
-					if( n >= Direction_Buffer )
-					{
-						Direction_Buffer	+= BUFFER_GROWSIZE;
-						Direction			= (int *)SG_Realloc(Direction, Direction_Buffer * sizeof(int));
-					}
-
-					Direction[n++]	= goDir;
-				}
-			}
-		}
-		while( goDir > 0 && pDTM->is_InGrid(x,y) && !is_Locked(x,y) && !pChannelRoute->asChar(x,y) );
-
-
-		//-------------------------------------------------
-		if( Length >= minLength )
-		{
-			x	= xStart;
-			y	= yStart;
-
-			if( goDir < 0 )
-			{
-				n	-= nDiv;
-			}
-
-			for(m=0; m<n; m++)
-			{
-				goDir	= Direction[m];
-
-				pChannelRoute->Set_Value(x,y,goDir);
-
-				for(i=0; i<8; i++)	// Don't start new channels beside existing ones...
-				{
-					ix		= Get_xTo(i,x);
-					iy		= Get_yTo(i,y);
-
-					if( pDTM->is_InGrid(ix,iy) )
-					{
-						pStart->Set_Value(ix,iy,0);
-					}
-				}
-
-				x	= Get_xTo(goDir,x);
-				y	= Get_yTo(goDir,y);
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork::Set_Channel_Order(int x, int y)
-{
-	int		i, ix, iy, j, n;
-
-	//-----------------------------------------------------
-	if( pChannelRoute->asChar(x,y) > 0 )
-	{
-		for(i=n=0, j=4; i<8; i++, j=(j+1)%8)
-		{
-			ix	= Get_xTo(i,x);
-			iy	= Get_yTo(i,y);
-
-			if( pDTM->is_InGrid(ix,iy) && pChannelRoute->asChar(ix,iy) && j == pChannelRoute->asChar(ix,iy) % 8 )
-			{
-				n++;
-			}
-		}
-
-		//-----------------------------------------------------
-		if( n == 0 )
-		{
-			Lock_Create();
-
-			do
-			{
-				Lock_Set(x,y);
-
-				pChannels->Add_Value(x,y, 1 );
-
-				i	= pChannelRoute->asChar(x,y);
-
-				if( i > 0 )
-				{
-					x	= Get_xTo(i,x);
-					y	= Get_yTo(i,y);
-				}
-			}
-			while( pDTM->is_InGrid(x,y) && i > 0 && !is_Locked(x,y) );
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CChannelNetwork::Set_Channel_Mouth(int x, int y)
-{
-	int		Order, goDir, ix, iy;
-
-	Order	= pChannels->asInt(x,y);
-
-	if( Order > 0 )
-	{
-		goDir	= pChannelRoute->asChar(x,y);
-
-		if( goDir > 0 )
-		{
-			ix	= Get_xTo(goDir,x);
-			iy	= Get_yTo(goDir,y);
-
-			if( !pDTM->is_InGrid(ix,iy) || (pChannels->asInt(ix,iy) > 0 && Order != pChannels->asInt(ix,iy)) )
-			{
-				pChannels->Set_Value(x,y, -1 );
-			}
-		}
-		else
-		{
-			pChannels->Set_Value(x,y, -1 );
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork::Set_Vector(int x, int y, int ID)
-{
-	bool	bContinue;
-
-	int		i, ix, iy, j, Order;
-
-	double	xMin, yMin, Length;
-
-	CSG_Shape	*pShape;
-
-	//-----------------------------------------------------
-	if( (Order = pChannels->asInt(x,y)) > 0 )
-	{
-		bContinue	= true;
-
-		for(i=0, j=4; i<8 && bContinue; i++, j=(j+1)%8)
-		{
-			ix	= Get_xTo(i,x);
-			iy	= Get_yTo(i,y);
-
-			if(	pDTM->is_InGrid(ix,iy)
-			&&	pChannels->asInt(ix,iy) == Order
-			&&	pChannelRoute->asChar(ix,iy) && j == pChannelRoute->asChar(ix,iy) % 8 )
-			{
-				bContinue	= false;
-			}
-		}
-
-		//-------------------------------------------------
-		if( bContinue )	// Startpunkt gefunden...
-		{
-			xMin	= pDTM->Get_XMin(),
-			yMin	= pDTM->Get_YMin();
-			ID		= 1;
-
-			pShape	= pShapes->Add_Shape();
-
-			do
-			{
-				bContinue	= false;
-				Length		= 0;
-
-				Lock_Set(x,y);
-
-				pShape->Add_Point(xMin + x * Get_Cellsize(), yMin + y * Get_Cellsize());
-
-				i	= pChannelRoute->asChar(x,y);
-
-				if( i > 0 )
-				{
-					ix		= Get_xTo(i,x);
-					iy		= Get_yTo(i,y);
-
-					Length	+= Get_Length(i);
-
-					if( pDTM->is_InGrid(ix,iy) )
-					{
-						if(	!is_Locked(ix,iy)
-						&&	(	pChannels->asInt(ix,iy) == Order
-							||	pChannels->asInt(ix,iy) < 0) )
-						{
-							x			= ix;
-							y			= iy;
-							bContinue	= true;
-						}
-						else
-						{
-							pShape->Add_Point(xMin + ix * Get_Cellsize(), yMin + iy * Get_Cellsize());
-						}
-					}
-				}
-			}
-			while( bContinue );
-
-			pShape->Set_Value(0, ID );
-			pShape->Set_Value(1, Order );
-			pShape->Set_Value(2, Length );
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
deleted file mode 100644
index 293e664..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
+++ /dev/null
@@ -1,474 +0,0 @@
-/**********************************************************
- * Version $Id: ChannelNetwork_Altitude.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_channels                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              ChannelNetwork_Altitude.cpp              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "ChannelNetwork_Altitude.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CChannelNetwork_Altitude::CChannelNetwork_Altitude(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Vertical Distance to Channel Network"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2002"));
-
-	Set_Description	(_TW(
-		"This module calculates the vertical distance to a channel network base level. "
-		"The algorithm consists of two major steps:\n"
-		" 1. Interpolation of a channel network base level elevation\n"
-		" 2. Subtraction of this base level from the original elevations\n"
-	));
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL, "ELEVATION"	, _TL("Elevation"),
-		_TL("A grid that contains elevation data."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "CHANNELS"	, _TL("Channel Network"),
-		_TW("A grid providing information about the channel network. It is assumed that no-data cells are not part "
-		"of the channel network. Vice versa all others cells are recognised as channel network members."),
-		PARAMETER_INPUT
-	);
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL, "DISTANCE"	, _TL("Vertical Distance to Channel Network"),
-		_TL("The resulting grid gives the altitude above the channel network in the same units as the elevation data."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "BASELEVEL"	, _TL("Channel Network Base Level"),
-		_TL("This optional grid output contains the interpolated channel network base level elevations."),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL, "THRESHOLD"	, _TL("Tension Threshold [Percentage of Cell Size]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL, "NOUNDERGROUND", _TL("Keep Base Level below Surface"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CChannelNetwork_Altitude::On_Execute(void)
-{
-	int			nCells, nCells_Start, iStep, nSteps;
-	double		Threshold;
-
-	//-----------------------------------------------------
-	m_pDTM				= Parameters("ELEVATION")		->asGrid();
-	m_pChannels			= Parameters("CHANNELS")		->asGrid();
-	m_pDistance			= Parameters("DISTANCE")		->asGrid();
-	m_bNoUnderground	= Parameters("NOUNDERGROUND")	->asBool();
-	Threshold			= Parameters("THRESHOLD")		->asDouble() * Get_Cellsize();
-
-	DataObject_Set_Colors(m_pDistance, 10, SG_COLORS_YELLOW_BLUE, true);
-
-	//-----------------------------------------------------
-	nCells			= Get_NX() > Get_NY() ? Get_NX() : Get_NY();
-	for(nSteps=0; pow(2.0, nSteps + 1) < nCells; nSteps++);
-	nCells_Start	= (int)pow(2.0, nSteps);
-
-	//-----------------------------------------------------
-	m_pDistance->Assign_NoData();
-
-	m_Mask.Create(*Get_System(), SG_DATATYPE_Byte);
-	m_Dist.Create(*Get_System());
-	m_Dist.Set_NoData_Value_Range(m_pDTM->Get_NoData_Value(), m_pDTM->Get_NoData_hiValue());
-
-	for(nCells=nCells_Start, iStep=1; nCells>0 && Process_Get_Okay(); nCells/=2, iStep++)
-	{
-		Process_Set_Text(CSG_String::Format(SG_T("%d [%d]"), iStep, nSteps + 1));
-
-		Set_Surface(nCells);
-
-		while( Threshold < Get_Change(nCells) && Process_Get_Okay() );
-	}
-
-	m_Mask.Destroy();
-	m_Dist.Destroy();
-
-	//-----------------------------------------------------
-	CSG_Grid	*pBase	= Parameters("BASELEVEL")->asGrid();
-
-	for(long n=0; n<Get_NCells(); n++)
-	{
-		if( m_pDistance->is_NoData(n) || m_pDTM->is_NoData(n) )
-		{
-			m_pDistance->Set_NoData(n);
-
-			if( pBase )	{	pBase->Set_NoData(n);	}
-		}
-		else
-		{
-			double	z	= m_pDistance->asDouble(n);
-
-			m_pDistance->Set_Value(n, m_pDTM->asDouble(n) - z);
-
-			if( pBase )	{	pBase->Set_Value(n, z);	}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork_Altitude::Set_Surface(int nCells)
-{
-	m_Dist.Assign_NoData();
-	m_Mask.Assign(0.0);
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY(); y+=nCells)
-	{
-		int	ny	= y + nCells < Get_NY() ? y + nCells : Get_NY();
-
-		for(int x=0; x<Get_NX(); x+=nCells)
-		{
-			int		nx	= x + nCells < Get_NX() ? x + nCells : Get_NX();
-
-			int		i, ix, iy, nz;
-			double	z;
-
-			for(iy=y, nz=0, z=0.0; iy<ny; iy++)
-			{
-				for(ix=x; ix<nx; ix++)
-				{
-					if( m_pChannels->is_InGrid(ix, iy) && !m_pDTM->is_NoData(ix, iy) )
-					{
-						z	+= m_pDTM->asDouble(ix, iy);
-						nz	++;
-					}
-				}
-			}
-
-			//---------------------------------------------
-			if( nz > 0 )
-			{
-				m_Mask.Set_Value(x, y, true);
-				m_Dist.Set_Value(x, y, z / nz);
-			}
-			else
-			{
-				m_Mask.Set_Value(x, y, false);
-
-				if( m_pDistance->is_NoData(x, y) )
-				{
-					for(i=0; i<8; i++)
-					{
-						ix	= x + nCells * Get_xTo(i);
-						iy	= y + nCells * Get_yTo(i);
-
-						if( m_pDistance->is_InGrid(ix, iy) )
-						{
-							z	+= m_pDistance->asDouble(ix, iy);
-							nz	++;
-						}
-					}
-
-					m_Dist.Set_Value(x, y, nz > 0 ? z / nz : m_pDTM->asDouble(x, y));
-				}
-				else
-				{
-					m_Dist.Set_Value(x, y, m_pDistance->asDouble(x, y));
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_pDistance->Assign(&m_Dist);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CChannelNetwork_Altitude::Get_Change(int nCells)
-{
-	int		x, y;
-	double	d, dMax;
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY(); y+=nCells)
-	{
-		for(x=0; x<Get_NX(); x+=nCells)
-		{
-			if( !m_Mask.asByte(x, y) )
-			{
-				m_Dist.Set_Value(x, y, Get_Change(nCells, x, y));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(y=0, dMax=0.0; y<Get_NY(); y+=nCells)
-	{
-		for(x=0; x<Get_NX(); x+=nCells)
-		{
-			if( !m_Mask.asByte(x, y) )
-			{
-				if( dMax < (d = fabs(m_Dist.asDouble(x, y) - m_pDistance->asDouble(x, y))) )
-				{
-					dMax	= d;
-				}
-
-				m_pDistance->Set_Value(x, y, m_Dist.asDouble(x, y));
-			}
-		}
-	}
-
-	return( dMax );
-}
-
-
-//---------------------------------------------------------
-double CChannelNetwork_Altitude::Get_Change(int nCells, int x, int y)
-{
-	int		i, ix, iy;
-	double	n, d, dz;
-
-	for(i=0, d=0.0, n=0.0; i<8; i++)
-	{
-		ix	= x + nCells * Get_xTo(i);
-		iy	= y + nCells * Get_yTo(i);
-
-		if( m_pDistance->is_InGrid(ix, iy) )
-		{
-			dz	= 1.0 / Get_UnitLength(i);
-			d	+= dz * m_pDistance->asDouble(ix, iy);
-			n	+= dz;
-		}
-	}
-
-	if( n > 0.0 )
-	{
-		d	/= n;
-
-		return( m_bNoUnderground && !m_pDTM->is_NoData(x, y) && d > m_pDTM->asDouble(x, y) ? m_pDTM->asDouble(x, y) : d );
-	}
-
-	return( m_pDistance->asDouble(x, y) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CValley_Depth::CValley_Depth(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Valley Depth"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
-
-	Set_Description	(_TW(
-		"Valley depth is calculated here  vertical distance to a channel network base level. "
-		"The algorithm consists of two major steps:\n"
-		" 1. Interpolation of a channel network base level elevation\n"
-		" 2. Subtraction of this base level from the original elevations\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"		, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "VALLEY_DEPTH"	, _TL("Valley Depth"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "RIDGE_LEVEL"		, _TL("Ridge Level"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRESHOLD"		, _TL("Tension Threshold [Percentage of Cell Size]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NOUNDERGROUND"	, _TL("Keep Ridge Level above Surface"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "ORDER"			, _TL("Ridge Detection Threshold"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 4, 1, true, 7, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
-	bool	bResult;\
-	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
-	if( !bResult ) return( false );\
-}
-
-#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
-
-//---------------------------------------------------------
-bool CValley_Depth::On_Execute(void)
-{
-	CSG_Grid	Inverse(*Get_System(), SG_DATATYPE_Float);
-	CSG_Grid	Ridges (*Get_System(), SG_DATATYPE_Int);
-
-	//-----------------------------------------------------
-	RUN_MODULE("grid_tools"					, 19,	// grid orientation
-			SET_PARAMETER("INPUT"			, Parameters("ELEVATION"))
-		&&	SET_PARAMETER("RESULT"			, &Inverse)
-		&&	SET_PARAMETER("METHOD"			, 3)	// invert
-	)
-
-	RUN_MODULE("ta_channels"				, 6,	// strahler order
-			SET_PARAMETER("DEM"				, &Inverse)
-		&&	SET_PARAMETER("STRAHLER"		, &Ridges)
-	)
-
-	Ridges.Set_NoData_Value_Range(0, Parameters("ORDER")->asInt());
-
-	RUN_MODULE("ta_channels"				, 3,	// vertical channel network distance
-			SET_PARAMETER("ELEVATION"		, &Inverse)
-		&&	SET_PARAMETER("CHANNELS"		, &Ridges)
-		&&	SET_PARAMETER("DISTANCE"		, Parameters("VALLEY_DEPTH"))
-		&&	SET_PARAMETER("BASELEVEL"		, Parameters("RIDGE_LEVEL"))
-		&&	SET_PARAMETER("THRESHOLD"		, Parameters("THRESHOLD"))
-		&&	SET_PARAMETER("NOUNDERGROUND"	, Parameters("NOUNDERGROUND"))
-	)
-
-	//-----------------------------------------------------
-	if( Parameters("RIDGE_LEVEL")->asGrid() )
-	{
-		Parameters("RIDGE_LEVEL")->asGrid()->Invert();
-	}
-
-	DataObject_Set_Colors(Parameters("VALLEY_DEPTH")->asGrid(), 10, SG_COLORS_YELLOW_BLUE, false);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
deleted file mode 100644
index 4d97cd7..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
+++ /dev/null
@@ -1,389 +0,0 @@
-/**********************************************************
- * Version $Id: ChannelNetwork_Distance.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_channels                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              ChannelNetwork_Distance.cpp              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "ChannelNetwork_Distance.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CChannelNetwork_Distance::CChannelNetwork_Distance(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Overland Flow Distance to Channel Network"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001-11"));
-
-	Set_Description	(_TW(
-		"This module calculates overland flow distances to a channel network "
-		"based on gridded digital elevation data and channel network information.\n"
-		"The flow algorithm may be either Deterministic 8 (O'Callaghan & Mark 1984) or Multiple Flow Direction (Freeman 1991)\n"
-		"\n\nReferences:\n"
-		"- Freeman, G.T., 1991: 'Calculating catchment area with divergent flow based on a regular grid', Computers and Geosciences, 17:413-22\n"
-		"- O'Callaghan, J.F., Mark, D.M., 1984: 'The extraction of drainage networks from digital elevation data', Computer Vision, Graphics and Image Processing, 28:323-344\n"
-		"- Nobre, A.D., Cuartas, L.A., Hodnett, M., Renno, C.D., Rodrigues, G., Silveira, A., Waterloo, M., Saleska S. (2011): Height Above the Nearest Drainage - a hydrologically relevant new terrain model. "
-		"Journal of Hydrology, Vol. 404, Issues 1-2, pp. 13-29, ISSN 0022-1694, 10.1016/j.jhydrol.2011.03.051. "
-		"<a target=\"_blank\" href=\"http://www.sciencedirect.com/science/article/pii/S0022169411002599\">online</a>\n"
-	));
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL("A grid that contains elevation data."),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHANNELS"	, _TL("Channel Network"),
-		_TW("A grid providing information about the channel network. It is assumed that no-data cells are not part "
-		"of the channel network. Vice versa all others cells are recognised as channel network members."),
-		PARAMETER_INPUT
-	);
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL	, "DISTANCE"	, _TL("Overland Flow Distance"),
-		_TW("The overland flow distance in map units. "
-		"It is assumed that the (vertical) elevation data use the same units as the (horizontal) grid coordinates."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "DISTVERT"	, _TL("Vertical Overland Flow Distance"),
-		_TL("This is the vertical component of the overland flow"),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "DISTHORZ"	, _TL("Horizontal Overland Flow Distance"),
-		_TL("This is the horizontal component of the overland flow"),
-		PARAMETER_OUTPUT
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Flow Algorithm"),
-		_TL("Choose a flow routing algorithm that shall be used for the overland flow distance calculation:\n- D8\n- MFD"),
-
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("D8"),
-			_TL("MFD")
-		), 1
-	);
-}
-
-//---------------------------------------------------------
-CChannelNetwork_Distance::~CChannelNetwork_Distance(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CChannelNetwork_Distance::On_Execute(void)
-{
-	int			x, y, Method;
-	CSG_Grid	*pChannels;
-
-	//-----------------------------------------------------
-	m_pDTM		= Parameters("ELEVATION")->asGrid();
-	pChannels	= Parameters("CHANNELS")->asGrid();
-
-	m_pDistance	= Parameters("DISTANCE")->asGrid();
-	m_pDistVert	= Parameters("DISTVERT")->asGrid();
-	m_pDistHorz	= Parameters("DISTHORZ")->asGrid();
-
-	Method		= Parameters("METHOD")->asInt();
-
-	//-----------------------------------------------------
-	switch( Method )
-	{
-	case 0:	default:	Initialize_D8();	break;
-	case 1:				Initialize_MFD();	break;
-	}
-
-	m_pDistance	->Assign_NoData();
-	m_pDistVert	->Assign_NoData();
-	m_pDistHorz	->Assign_NoData();
-
-	m_pDTM		->Set_Index(true);
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		m_pDTM->Get_Sorted(n, x, y, false, false);
-
-		if( !m_pDTM->is_NoData(x, y) && !(pChannels->is_NoData(x, y) && m_pDistance->is_NoData(x, y)) )
-		{
-			if( !pChannels->is_NoData(x, y) )
-			{
-				m_pDistance->Set_Value(x, y, 0.0);
-				m_pDistVert->Set_Value(x, y, 0.0);
-				m_pDistHorz->Set_Value(x, y, 0.0);
-			}
-
-			switch( Method )
-			{
-			case 0:	default:	Execute_D8(x, y);	break;
-			case 1:				Execute_MFD(x, y);	break;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Dir	.Destroy();
-
-	for(int i=0; i<=8; i++)
-	{
-		m_Flow[i].Destroy();
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork_Distance::Initialize_D8(void)
-{
-	m_Dir.Create(*Get_System(), SG_DATATYPE_Char);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			m_Dir.Set_Value(x, y, m_pDTM->Get_Gradient_NeighborDir(x, y));
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CChannelNetwork_Distance::Execute_D8(int x, int y)
-{
-	double	zDist, zVert, zHorz, dVert, dHorz;
-
-	zDist	= m_pDistance->asDouble(x, y);
-	zVert	= m_pDistVert->asDouble(x, y);
-	zHorz	= m_pDistHorz->asDouble(x, y);
-
-	for(int i=0; i<8; i++)
-	{
-		int	ix	= Get_xFrom(i, x);
-		int	iy	= Get_yFrom(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy) && m_Dir.asInt(ix, iy) == i )
-		{
-			dVert	= m_pDTM->asDouble(ix, iy) - m_pDTM->asDouble(x, y);
-			dHorz	= Get_Length(i);
-
-			m_pDistVert->Set_Value(ix, iy, zVert + dVert);
-			m_pDistHorz->Set_Value(ix, iy, zHorz + dHorz);
-			m_pDistance->Set_Value(ix, iy, zDist + sqrt(dVert*dVert + dHorz*dHorz));
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CChannelNetwork_Distance::Initialize_MFD(void)
-{
-	const double	MFD_Convergence	= 1.1;
-
-	int		i;
-
-	for(i=0; i<=8; i++)
-	{
-		m_Flow[i].Create(*Get_System(), SG_DATATYPE_Float);
-	}
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !m_pDTM->is_NoData(x, y) )
-			{
-				double	z, dz, zSum, Flow[8];
-
-				z		= m_pDTM->asDouble(x, y);
-				zSum	= 0.0;
-
-				for(i=0; i<8; i++)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( m_pDTM->is_InGrid(ix, iy) && z > (dz = m_pDTM->asDouble(ix, iy)) )
-					{
-						zSum	+= (Flow[i]	= pow((z - dz) / Get_Length(i), MFD_Convergence));
-					}
-					else
-					{
-						Flow[i]	= 0.0;
-					}
-				}
-
-				if( zSum > 0.0 )
-				{
-					m_Flow[8].Set_Value(x, y, zSum);
-
-					for(i=0; i<8; i++)
-					{
-						if( Flow[i] > 0.0 )
-						{
-							m_Flow[i].Set_Value(x, y, Flow[i] / zSum);
-						}
-					}
-				}
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CChannelNetwork_Distance::Execute_MFD(int x, int y)
-{
-	double	zDist, zVert, zHorz, dDist, dVert, dHorz, dFlow;
-
-	dDist	= m_Flow[8].asDouble(x, y);
-
-	if( dDist > 0.0 )
-	{
-		dDist	= 1.0 / dDist;
-		m_pDistance->Mul_Value(x, y, dDist);
-		m_pDistVert->Mul_Value(x, y, dDist);
-		m_pDistHorz->Mul_Value(x, y, dDist);
-	}
-
-	zDist	= m_pDistance->asDouble(x, y);
-	zVert	= m_pDistVert->asDouble(x, y);
-	zHorz	= m_pDistHorz->asDouble(x, y);
-
-	for(int i=0; i<8; i++)
-	{
-		int	ix	= Get_xTo(i, x);
-		int	iy	= Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy) && (dFlow = m_Flow[(i + 4) % 8].asDouble(ix, iy)) > 0.0 )
-		{
-			dVert	= m_pDTM->asDouble(ix, iy) - m_pDTM->asDouble(x, y);
-			dHorz	= Get_Length(i);
-
-			dDist	= dFlow * (zDist + sqrt(dVert*dVert + dHorz*dHorz));
-			dVert	= dFlow * (zVert + dVert);
-			dHorz	= dFlow * (zHorz + dHorz);
-
-			if( m_pDistance->is_NoData(ix, iy) )
-			{
-				m_pDistVert->Set_Value(ix, iy, dVert);
-				m_pDistHorz->Set_Value(ix, iy, dHorz);
-				m_pDistance->Set_Value(ix, iy, dDist);
-				m_Flow[8].Set_Value(ix, iy, dFlow);
-			}
-			else
-			{
-				m_pDistVert->Add_Value(ix, iy, dVert);
-				m_pDistHorz->Add_Value(ix, iy, dHorz);
-				m_pDistance->Add_Value(ix, iy, dDist);
-				m_Flow[8].Add_Value(ix, iy, dFlow);
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.h b/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
deleted file mode 100644
index 5b88dac..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/**********************************************************
- * Version $Id: ChannelNetwork_Distance.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_channels                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               ChannelNetwork_Distance.h               //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__ChannelNetwork_Distance_H
-#define HEADER_INCLUDED__ChannelNetwork_Distance_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class ta_channels_EXPORT CChannelNetwork_Distance : public CSG_Module_Grid  
-{
-public:
-	CChannelNetwork_Distance(void);
-	virtual ~CChannelNetwork_Distance(void);
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	CSG_Grid				*m_pDTM, *m_pDistance, *m_pDistVert, *m_pDistHorz, m_Dir, m_Flow[9];
-
-
-	void					Initialize_D8	(void);
-	void					Execute_D8		(int x, int y);
-
-	void					Initialize_MFD	(void);
-	void					Execute_MFD		(int x, int y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__ChannelNetwork_Distance_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.in
deleted file mode 100644
index b928586..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.in
+++ /dev/null
@@ -1,598 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis/ta_channels
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_channels_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_channels_la_OBJECTS = ChannelNetwork.lo \
-	ChannelNetwork_Altitude.lo ChannelNetwork_Distance.lo \
-	D8_Flow_Analysis.lo MLB_Interface.lo Strahler.lo Watersheds.lo \
-	Watersheds_ext.lo
-libta_channels_la_OBJECTS = $(am_libta_channels_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_channels_la_SOURCES)
-DIST_SOURCES = $(libta_channels_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 911 2011-02-14 16:38:15Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libta_channels.la
-libta_channels_la_SOURCES = \
-ChannelNetwork.cpp\
-ChannelNetwork_Altitude.cpp\
-ChannelNetwork_Distance.cpp\
-D8_Flow_Analysis.cpp\
-MLB_Interface.cpp\
-Strahler.cpp\
-Watersheds.cpp\
-Watersheds_ext.cpp\
-ChannelNetwork.h\
-ChannelNetwork_Altitude.h\
-ChannelNetwork_Distance.h\
-D8_Flow_Analysis.h\
-MLB_Interface.h\
-Strahler.h\
-Watersheds.h\
-Watersheds_ext.h
-
-libta_channels_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_channels.la: $(libta_channels_la_OBJECTS) $(libta_channels_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_channels_la_OBJECTS) $(libta_channels_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChannelNetwork.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChannelNetwork_Altitude.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChannelNetwork_Distance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/D8_Flow_Analysis.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Strahler.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Watersheds.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Watersheds_ext.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.cpp
deleted file mode 100644
index 5443d21..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/**********************************************************
- * Version $Id: Strahler.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Strahler.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-//---------------------------------------------------------
-#include "Strahler.h"
-
-//---------------------------------------------------------
-CStrahler::CStrahler(void){
-
-	Set_Name		(_TL("Strahler Order"));
-	Set_Author		(_TL("Copyrights (c) 2004 by Victor Olaya"));
-	Set_Description	(_TW(
-		"(c) 2004 by Victor Olaya. Strahler Order Calculation"
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"), 
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "STRAHLER"	, _TL("Strahler Order"), 
-		_TL(""), 
-		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
-	);
-}
-
-//---------------------------------------------------------
-CStrahler::~CStrahler(void)
-{}
-
-//---------------------------------------------------------
-int CStrahler::getStrahlerOrder(int x, int y)
-{
-	int		Order	= m_pStrahler->asInt(x, y);
-
-	if( Order == 0 )
-	{
-		int		i, ix, iy, n;
-
-		for(i=0, n=0, Order=1; i<8; i++)
-		{
-			if( Get_System()->Get_Neighbor_Pos(i + 4, x, y, ix, iy) && m_pDEM->Get_Gradient_NeighborDir(ix, iy) == i )
-			{
-				int		iOrder	= getStrahlerOrder(ix, iy);
-
-				if( Order < iOrder )
-				{
-					Order	= iOrder;
-					n		= 1;
-				}
-				else if( Order == iOrder )
-				{
-					n++;
-				}
-			}
-		}
-
-		if( n > 1 )
-		{
-			Order++;
-		}
-
-		m_pStrahler->Set_Value(x, y, Order);
-	}
-
-	return( Order );
-}
-
-//---------------------------------------------------------
-bool CStrahler::On_Execute(void)
-{
-	m_pDEM		= Parameters("DEM")			->asGrid();
-	m_pStrahler	= Parameters("STRAHLER")	->asGrid();
-
-	m_pStrahler	->Set_NoData_Value(0.0);
-	m_pStrahler	->Assign(0.0);
-
-	DataObject_Set_Colors(m_pStrahler, 10, SG_COLORS_WHITE_BLUE);
-
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !m_pDEM->is_NoData(x, y) )
-			{
-				getStrahlerOrder(x, y);
-			}
-        }
-    }
-
-	return( true );
-}
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.h b/src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.h
deleted file mode 100644
index c7b8bda..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**********************************************************
- * Version $Id: Strahler.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Strahler.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__RGB_Composite_H
-#define HEADER_INCLUDED__RGB_Composite_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-//---------------------------------------------------------
-class CStrahler : public CSG_Module_Grid {
-
-private:
-	CSG_Grid *m_pDEM;
-	CSG_Grid *m_pStrahler;
-	int getStrahlerOrder(int, int);
-
-public:
-	CStrahler(void);
-	virtual ~CStrahler(void);
-
-protected:
-	virtual bool		On_Execute(void);
-
-};
-
-#endif // #ifndef HEADER_INCLUDED__Strahler_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.cpp
deleted file mode 100644
index 0b8b690..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/**********************************************************
- * Version $Id: Watersheds.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_channels                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    Watersheds.cpp                     //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Watersheds.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CWatersheds::CWatersheds(void)
-{
-	Set_Name(_TL("Watershed Basins"));
-
-	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
-
-	Set_Description(_TL(""));
-
-	Parameters.Add_Grid(
-		NULL, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "CHANNELS"	, _TL("Channel Network"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "SINKROUTE"	, _TL("Sink Route"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL, "BASINS"		, _TL("Watershed Basins"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL, "MINSIZE"		, _TL("Min. Size"),
-		_TL("Minimum size of basin (cells)"),
-		PARAMETER_TYPE_Int
-	);
-}
-
-//---------------------------------------------------------
-CWatersheds::~CWatersheds(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define	NO_BASIN	-1
-
-//---------------------------------------------------------
-bool CWatersheds::On_Execute(void)
-{
-	int		x, y, nCells, nCells_Min, nBasins;
-	long	n;
-	CSG_Grid	*pDTM, *pSeed, *pRoute;
-
-	//-----------------------------------------------------
-	pDTM		= Parameters("ELEVATION")	->asGrid();
-	pSeed		= Parameters("CHANNELS")	->asGrid();
-	pRoute		= Parameters("SINKROUTE")	->asGrid();
-	nCells_Min	= Parameters("MINSIZE")		->asInt();
-	m_pBasins	= Parameters("BASINS")		->asGrid();
-
-	m_pBasins->Set_NoData_Value(NO_BASIN);
-	m_pBasins->Assign_NoData();
-
-	m_Direction.Create(m_pBasins, SG_DATATYPE_Char);
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pDTM->is_NoData(x, y) )
-			{
-				m_Direction.Set_NoData(x, y);
-			}
-			else
-			{
-				if( !pRoute || (n = pRoute->asChar(x, y)) <= 0 )
-				{
-					n	= pDTM->Get_Gradient_NeighborDir(x, y);
-				}
-
-				m_Direction.Set_Value(x, y, n < 0 ? -1 : (n + 4) % 8);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(n=0, m_nBasins=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		pDTM->Get_Sorted(n, x, y, true, false);
-
-		if( !pSeed->is_NoData(x, y) && pSeed->asInt(x, y) < 0 )
-		{
-			m_nBasins++;
-
-			if( (nCells = Get_Basin(x, y)) < nCells_Min )
-			{
-				nBasins		= m_nBasins - 1;
-				m_nBasins	= NO_BASIN;
-				Get_Basin(x, y);
-				m_nBasins	= nBasins;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Direction.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CWatersheds::Get_Basin(int x, int y)
-{
-	int		i, ix, iy, nCells;
-
-	if( m_pBasins->is_NoData(x, y) && !m_Direction.is_NoData(x, y) )
-	{
-		m_pBasins->Set_Value(x, y, m_nBasins);
-
-		for(i=0, nCells=1; i<8; i++)
-		{
-			ix	= Get_xTo(i, x);
-			iy	= Get_yTo(i, y);
-
-			if( is_InGrid(ix,iy) && m_Direction.asInt(ix, iy) == i )
-			{
-				nCells	+= Get_Basin(ix, iy);
-			}
-		}
-
-		return( nCells );
-	}
-
-	return( -1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp
deleted file mode 100644
index 59e0623..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp
+++ /dev/null
@@ -1,739 +0,0 @@
-/**********************************************************
- * Version $Id: Watersheds_ext.cpp 947 2011-03-03 11:56:34Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Watersheds.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Watersheds_ext.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	FIELD_ID		= 0,
-	FIELD_ID_MAIN,
-	FIELD_MOUTH_X,
-	FIELD_MOUTH_Y,
-	FIELD_PERIMETER,
-	FIELD_AREA,
-	FIELD_CENTROID_X,
-	FIELD_CENTROID_Y,
-	FIELD_Z_MEAN,
-	FIELD_Z_RANGE,
-	FIELD_DIST_MEAN,
-	FIELD_DIST_MAX,
-	FIELD_CONCTIME,
-	FIELD_BASINS_UP,
-	FIELD_BASINS_DOWN,
-	FIELD_BASIN_TYPE,
-	FIELD_EQVRECT_A,
-	FIELD_EQVRECT_B,
-	FIELD_OROG_IDX,
-	FIELD_MASS_IDX
-};
-
-//---------------------------------------------------------
-#define BASIN_ADD_FIELDS(pBasins)	{\
-	pBasins->Add_Field(_TL("ID")						, SG_DATATYPE_Int);\
-	pBasins->Add_Field(_TL("Main Basin ID")				, SG_DATATYPE_Int);\
-	pBasins->Add_Field(_TL("Outlet X")					, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Outlet Y")					, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Perimeter")					, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Area")						, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Centroid X")				, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Centroid Y")				, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Mean Elevation")			, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Elevation Range")			, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Mean Flow Distance")		, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Maximum Flow Distance")		, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Concentration time (h)")	, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Upslope Basins")			, SG_DATATYPE_String);\
-	pBasins->Add_Field(_TL("Downslope Basins")			, SG_DATATYPE_Int);\
-	pBasins->Add_Field(_TL("Basin Type (Gravelius)")	, SG_DATATYPE_String);\
-	pBasins->Add_Field(_TL("Equivalent Rectangle (A)")	, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Equivalent Rectangle (B)")	, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Orographic Coefficient")	, SG_DATATYPE_Double);\
-	pBasins->Add_Field(_TL("Massivity Coefficient")		, SG_DATATYPE_Double);\
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CWatersheds_ext::CWatersheds_ext(void)
-{
-	Set_Name		(_TL("Watershed Basins (Extended)"));
-
-	Set_Author		(SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Extended watershed basin analysis. "
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("DEM"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHANNELS"	, _TL("Drainage Network"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "BASINS"		, _TL("Basins"), 
-		_TL(""), 
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SUBBASINS"	, _TL("Subbasins"), 
-		_TL(""), 
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "V_BASINS"	, _TL("Basins"),
-		_TL(""), 
-		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "V_SUBBASINS"	, _TL("Subbasins"),
-		_TL(""), 
-		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "HEADS"		, _TL("River Heads"),
-		_TL(""), 
-		PARAMETER_OUTPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "MOUTHS"		, _TL("River Mouths"),
-		_TL(""), 
-		PARAMETER_OUTPUT, SHAPE_TYPE_Point
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DISTANCE"	, _TL("Flow Distances"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatersheds_ext::On_Execute(void)
-{
-	int			x, y;
-	CSG_Grid	*pBasins, *pSubBasins, Inflows;
-	CSG_Shapes	*pHeads, *pMouths, *pVBasins, *pVSubBasins;
-
-	m_pDEM		= Parameters("DEM")			->asGrid(); 
-	m_pChannels	= Parameters("CHANNELS")	->asGrid();
-	pBasins		= Parameters("BASINS")		->asGrid();
-	pSubBasins	= Parameters("SUBBASINS")	->asGrid();
-	pVBasins	= Parameters("V_BASINS")	->asShapes();
-	pVSubBasins	= Parameters("V_SUBBASINS")	->asShapes();
-	pHeads		= Parameters("HEADS")		->asShapes();
-	pMouths		= Parameters("MOUTHS")		->asShapes();
-
-	//-----------------------------------------------------
-	Inflows		.Create(*Get_System(), SG_DATATYPE_Char);
-
-	m_Direction	.Create(*Get_System(), SG_DATATYPE_Char);
-	m_Direction	.Set_NoData_Value(-1);
-
-	m_Distance	.Create(*Get_System(), SG_DATATYPE_Float);
-	m_Distance	.Set_NoData_Value(-1);
-	m_Distance	.Assign_NoData();
-
-	pBasins		->Assign(0.0);
-	pBasins		->Set_NoData_Value(0.0);
-
-	pSubBasins	->Assign(0.0);
-	pSubBasins	->Set_NoData_Value(0.0);
-
-	pHeads		->Create(SHAPE_TYPE_Point	, _TL("Heads"));
-	pHeads		->Add_Field("ID"			, SG_DATATYPE_Int);
-	pHeads		->Add_Field("MAIN_ID"		, SG_DATATYPE_Int);
-	pHeads		->Add_Field("ELEVATION"		, SG_DATATYPE_Double);
-	pHeads		->Add_Field("DISTANCE"		, SG_DATATYPE_Double);
-
-	pMouths		->Create(SHAPE_TYPE_Point	, _TL("Mouths"));
-	pMouths		->Add_Field("ID"			, SG_DATATYPE_Int);
-	pMouths		->Add_Field("MAIN_ID"		, SG_DATATYPE_Int);
-	pMouths		->Add_Field("ELEVATION"		, SG_DATATYPE_Double);
-
-	pVBasins	->Create(SHAPE_TYPE_Polygon	, _TL("Basins"));
-	BASIN_ADD_FIELDS(pVBasins);
-
-	pVSubBasins	->Create(SHAPE_TYPE_Polygon	, _TL("Subbasins"));
-	BASIN_ADD_FIELDS(pVSubBasins);
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("flow directions..."));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			int	Direction	= -1;
-
-			if( m_pDEM->is_InGrid(x, y) )
-			{
-				double	dMax		= 0.0;
-
-				for(int i=0; i<8; i++)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( m_pDEM->is_InGrid(ix, iy) && !m_pChannels->is_NoData(ix, iy) )
-					{
-						double	dz	= (m_pDEM->asDouble(x, y) - m_pDEM->asDouble(ix, iy)) / Get_Length(i);
-
-						if( dMax < dz )
-						{
-							dMax		= dz;
-							Direction	= i;
-						}
-					}
-				}
-
-				if( !m_pChannels->is_NoData(x, y) )
-				{
-					if( Direction >= 0 )
-					{
-						int	ix	= Get_xTo(Direction, x);
-						int	iy	= Get_yTo(Direction, y);
-
-						if( m_pDEM->is_InGrid(ix, iy) )
-						{
-							Inflows.Add_Value(ix, iy, 1);
-						}
-					}
-				}
-				else if( Direction < 0 )
-				{
-					Direction	= m_pDEM->Get_Gradient_NeighborDir(x, y);
-				}
-			}
-
-			m_Direction.Set_Value(x, y, Direction);
-		}
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("main basins..."));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pChannels->is_InGrid(x, y) && is_Outlet(x, y) )
-			{
-				Get_Basin(pBasins, pVBasins, x, y, -1);
-
-				CSG_Shape	*pMouth	= pMouths->Add_Shape();
-
-				pMouth->Add_Point(Get_System()->Get_Grid_to_World(x, y));
-
-				pMouth->Set_Value(0, pVBasins->Get_Count());	// ID
-				pMouth->Set_Value(1, pVBasins->Get_Count());	// MAIN_ID
-				pMouth->Set_Value(2, m_pDEM->asDouble(x, y));	// ELEVATION
-			}
-		}
-	}
-
-	if( Parameters("DISTANCE")->asBool() )
-	{
-		m_Distance.Set_Name(_TL("Flow Distance"));
-
-		DataObject_Add(SG_Create_Grid(m_Distance));
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("heads and mouths..."));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pChannels->is_InGrid(x, y) )
-			{
-				//-----------------------------------------
-				if( Inflows.asInt(x, y) > 1 )		// mouth, linking channels of subcatchments
-				{
-					CSG_Shape	*pMouth	= pMouths->Add_Shape();
-
-					pMouth->Add_Point(Get_System()->Get_Grid_to_World(x, y));
-
-					pMouth->Set_Value(0, pMouths->Get_Count());		// ID
-					pMouth->Set_Value(1, pBasins->asDouble(x, y));	// MAIN_ID
-					pMouth->Set_Value(2, m_pDEM->asDouble(x, y));	// ELEVATION
-				}
-
-				//-----------------------------------------
-				else if( Inflows.asInt(x, y) == 0 )	// head
-				{
-					CSG_Shape	*pHead	= pHeads->Add_Shape();
-
-					pHead->Add_Point(Get_System()->Get_Grid_to_World(x, y));
-
-					pHead->Set_Value(0, pHeads->Get_Count() + 1);
-					pHead->Set_Value(1, m_Distance.asDouble(x, y));
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("subbasins..."));
-
-	pMouths->Set_Index(1, TABLE_INDEX_Ascending, 2, TABLE_INDEX_Descending);
-
-	for(int iMouth=0; iMouth<pMouths->Get_Count() && Set_Progress(iMouth, pMouths->Get_Count()); iMouth++)
-	{
-		CSG_Shape	*pMouth	= pMouths->Get_Shape_byIndex(iMouth);
-
-		if( Get_System()->Get_World_to_Grid(x, y, pMouth->Get_Point(0)) )
-		{
-			if( pMouth->asInt(0) == pMouth->asInt(1) )
-			{
-				Get_Basin(pSubBasins, pVSubBasins, x, y, pMouth->asInt(1));
-			}
-			else
-			{
-				for(int i=0; i<8; i++)
-				{
-					int	ix	= Get_xFrom(i, x);
-					int	iy	= Get_yFrom(i, y);
-
-					if( m_pChannels->is_InGrid(ix, iy) && m_Direction.asInt(ix, iy) == i )
-					{
-						Get_Basin(pSubBasins, pVSubBasins, ix, iy, pMouth->asInt(1));
-					}
-				}
-			}
-		}
-	}
-
-	if( Parameters("DISTANCE")->asBool() )
-	{
-		m_Distance.Set_Name(_TL("Subbasin Flow Distance"));
-
-		DataObject_Add(SG_Create_Grid(m_Distance));
-	}
-
-	//-----------------------------------------------------
-	m_Distance	.Destroy();
-	m_Direction	.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline bool CWatersheds_ext::is_Outlet(int x, int y)
-{
-	int	Direction	= m_Direction.asInt(x, y);
-
-	if( Direction >= 0 )
-	{
-		int	ix	= Get_xTo(Direction, x);
-		int	iy	= Get_yTo(Direction, y);
-
-		if( m_pDEM->is_InGrid(ix, iy) )
-		{
-			return( false );
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWatersheds_ext::Get_Basin(CSG_Grid *pBasins, CSG_Shapes *pPolygons, int xMouth, int yMouth, int Main_ID)
-{
-	int						x, y, Basin_ID	= 1 + pPolygons->Get_Count();
-	CSG_Shape				*pPolygon;
-	CSG_Grid_Stack			Stack;
-	CSG_Simple_Statistics	s_Height, s_Distance;
-
-	//-----------------------------------------------------
-	Stack.Push(x = xMouth, y = yMouth);
-
-	pBasins		->Set_Value(x, y, Basin_ID);
-	m_Distance	 .Set_Value(x, y, 0.0);
-
-	s_Height	+= m_pDEM->asDouble(x, y);
-	s_Distance	+= 0.0;
-
-	//-----------------------------------------------------
-	while( Stack.Get_Size() > 0 && Process_Get_Okay() )
-	{
-		Stack.Pop(x, y);
-
-		double	d	= m_Distance.asDouble(x, y);
-
-		//-------------------------------------------------
-		for(int i=0; i<8; i++)
-		{
-			int	ix	= Get_xFrom(i, x);
-			int	iy	= Get_yFrom(i, y);
-
-			if( is_InGrid(ix, iy) && pBasins->is_NoData(ix, iy) && i == m_Direction.asInt(ix, iy) )
-			{
-				Stack.Push(ix, iy);
-
-				pBasins		->Set_Value(ix, iy, Basin_ID);
-				m_Distance	 .Set_Value(ix, iy, d + Get_Length(i));
-
-				s_Height	+= m_pDEM->asDouble(ix, iy);
-				s_Distance	+= d + Get_Length(i);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( s_Height.Get_Count() > 1 && (pPolygon = Get_Basin(pBasins, pPolygons)) != NULL )
-	{
-		double		d, Area, Perimeter, Side_A, Side_B;
-		CSG_String	Gravelius;
-
-	//	Area		= s_Height.Get_Count() * Get_System()->Get_Cellarea();
-		Area		= ((CSG_Shape_Polygon*)pPolygon)->Get_Area();
-		Perimeter	= ((CSG_Shape_Polygon*)pPolygon)->Get_Perimeter();
-
-		d			= 0.28 * Perimeter / sqrt(Area);
-		Gravelius	= d > 1.75 ? _TL("rectangular")
-					: d > 1.5  ? _TL("ovalooblonga-rectangularoblonga")
-					: d > 1.25 ? _TL("ovaloredonda-ovalooblonga")
-					:            _TL("redonda-ovaloredonda");
-
-		d			= pow(Perimeter, 2.0) - 8.0 * Area;
-		Side_A		= d > 0.0 ? (Perimeter + sqrt(d))      / 4.0 : -1.0;
-		Side_B		= d > 0.0 ? (Perimeter - 2.0 * Side_A) / 2.0 : -1.0;
-
-		pPolygon->Set_Value(FIELD_ID			, Basin_ID);
-		pPolygon->Set_Value(FIELD_ID_MAIN		, Main_ID);
-
-		pPolygon->Set_Value(FIELD_MOUTH_X		, Get_System()->Get_xGrid_to_World(xMouth));
-		pPolygon->Set_Value(FIELD_MOUTH_Y		, Get_System()->Get_yGrid_to_World(yMouth));
-
-		pPolygon->Set_Value(FIELD_PERIMETER		, Perimeter);
-		pPolygon->Set_Value(FIELD_AREA			, Area);
-
-		pPolygon->Set_Value(FIELD_CENTROID_X	, ((CSG_Shape_Polygon*)pPolygon)->Get_Centroid().x);
-		pPolygon->Set_Value(FIELD_CENTROID_Y	, ((CSG_Shape_Polygon*)pPolygon)->Get_Centroid().y);
-
-		pPolygon->Set_Value(FIELD_Z_MEAN		, s_Height  .Get_Mean());
-		pPolygon->Set_Value(FIELD_Z_RANGE		, s_Height  .Get_Range());
-
-		pPolygon->Set_Value(FIELD_DIST_MEAN		, s_Distance.Get_Mean());
-		pPolygon->Set_Value(FIELD_DIST_MAX		, s_Distance.Get_Maximum());
-
-		pPolygon->Set_Value(FIELD_CONCTIME		, s_Height.Get_Range() <= 0.0 ? -1.0 :
-			pow(0.87 * pow(s_Distance.Get_Maximum() / 1000.0, 3.0) / s_Height.Get_Range(),  0.385)
-		);
-
-		pPolygon->Set_Value(FIELD_BASIN_TYPE	, Gravelius);
-
-		pPolygon->Set_Value(FIELD_EQVRECT_A		, Side_A);
-		pPolygon->Set_Value(FIELD_EQVRECT_B		, Side_B);
-
-		pPolygon->Set_Value(FIELD_OROG_IDX		, SG_Get_Square(s_Height.Get_Mean()) / (0.0001 * Area));	// Orographic index, defined as the mean catchment altitude times the ratio of the mean catchment altitude to the orthogonal projection of drainage area (Alc�zar, Palau (2010): Establishing environmental flow regimes in a Mediterranean watershed based on a regional classification. Journal of Hydrology, V. 388
-		pPolygon->Set_Value(FIELD_MASS_IDX		, Perimeter / (0.0001 * Area));								// Perimeter / (0.0001 * Area) ??!!
-
-		pPolygon->Set_Value(FIELD_BASINS_UP		, 0.0);	// Upslope Basins
-		pPolygon->Set_Value(FIELD_BASINS_DOWN	, 0.0);	// Downslope Basins
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Shape * CWatersheds_ext::Get_Basin(CSG_Grid *pBasins, CSG_Shapes *pPolygons)
-{
-	int			x, y, nEdges, Basin_ID;
-	CSG_Grid	Edge;
-	CSG_Shape	*pPolygon	= NULL;
-
-	Basin_ID	= 1 + pPolygons->Get_Count();
-
-	//-----------------------------------------------------
-	Edge.Create(SG_DATATYPE_Char, 2 * Get_NX() + 1, 2 * Get_NY() + 1, 0.5 * Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize());
-	Edge.Set_NoData_Value(0);
-
-	for(y=0, nEdges=0; y<Get_NY() && Process_Get_Okay(); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pBasins->asInt(x, y) == Basin_ID )
-			{
-				for(int i=0; i<8; i+=2)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( !is_InGrid(ix, iy) || pBasins->asInt(ix, iy) != Basin_ID )
-					{
-						ix	= 1 + 2 * x;
-						iy	= 1 + 2 * y;
-
-						Edge.Set_Value(               ix,                 iy ,  1);
-						Edge.Set_Value(Get_xTo(i    , ix), Get_yTo(i    , iy), -1);
-						Edge.Set_Value(Get_xTo(i - 1, ix), Get_yTo(i - 1, iy), -1);
-
-						nEdges++;
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( nEdges > 0 )
-	{
-		for(int yEdge=0; yEdge<Edge.Get_NY(); yEdge++)	for(int xEdge=0; xEdge<Edge.Get_NX(); xEdge++)
-		{
-			int	i	= 4;
-
-			if( Edge.asInt(xEdge, yEdge) == 1 && Edge.asInt(Get_xTo(i, xEdge), Get_yTo(i, yEdge)) == -1 )
-			{
-				if( pPolygon == NULL )
-				{
-					pPolygon	= pPolygons->Add_Shape();
-				}
-
-				int	iPart	= pPolygon->Get_Part_Count();
-				int	xFirst	= x	= Get_xTo(i, xEdge);
-				int	yFirst	= y	= Get_yTo(i, yEdge);
-				i	= i + 2;
-
-				pPolygon	->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
-
-				do
-				{
-					int	ix	= Get_xTo(i + 2, x);
-					int	iy	= Get_yTo(i + 2, y);
-
-					if( Edge.is_InGrid(ix, iy) && Edge.asInt(ix, iy) == -1 )			// go right ?
-					{
-						pPolygon->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
-
-						i	= (i + 2) % 8;
-					}
-					else
-					{
-						if( Edge.asInt(ix, iy) == 1 )
-						{
-							Edge.Set_NoData(ix, iy);	// erase class id in right cells
-						}
-
-						ix	= Get_xTo(i, x);
-						iy	= Get_yTo(i, y);
-
-						if( Edge.is_InGrid(ix, iy) && Edge.asInt(ix, iy) == -1 )		// go ahead ?
-						{
-							// nop
-						}
-						else
-						{
-							ix	= Get_xTo(i + 6, x);
-							iy	= Get_yTo(i + 6, y);
-
-							if( Edge.is_InGrid(ix, iy) && Edge.asInt(ix, iy) == -1 )	// go left ?
-							{
-								pPolygon->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
-
-								i	= (i + 6) % 8;
-							}
-							else
-							{
-								return( false );
-							}
-						}
-					}
-
-					x	= ix;
-					y	= iy;
-				}
-				while( x != xFirst || y != yFirst );
-
-				pPolygon->Add_Point(Edge.Get_System().Get_Grid_to_World(x, y), iPart);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( pPolygon );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-/*/---------------------------------------------------------
-void CWatersheds_ext::CreateShapesLayer(void)
-{ //first shape (0) is the whole basin. 
-	CSG_Table_Record *pRecord, *pRecord2;
-	CSG_Shape *pSubbasin;
-	TSG_Point	Point;	
-	double fArea=0, fPerim=0;
-	double fSide1, fSide2;
-	double fConcTime;
-	double fMinHeight;
-	int i,j,k;	
-	int x,y;
-	int iNextX, iNextY;
-	int iX, iY;
-	int iXOrig, iYOrig;
-	int iIndex;
-	int iUpstreamBasin;
-	int iDownstreamBasin;
-	int iCode;
-	CSG_String sSubbasins;
-		
-	CSG_Points_Int		m_Heads;
-
-	
-	//-----------------------------------------------------
-	//upstream and downstream basins
-
-	CSG_Shapes	*pBasins	= Parameters("V_BASINS")->asShapes();
-
-	//-----------------------------------------------------
-	TSG_Point_Int	m_Closing;
-
-	for(i=0; i<m_Heads.Get_Count(); i++)
-	{
-		TSG_Point_Int	Point, Next	= m_Heads[i];
-
-		do
-		{
-		//	Get_Next(m_pDEM, m_pChannels, Point = Next, Next);
-
-			iDownstreamBasin	= m_pBasins->asInt(Next .x, Next .y);
-			iUpstreamBasin		= m_pBasins->asInt(Point.x, Point.y);
-
-			if( iUpstreamBasin != iDownstreamBasin && iDownstreamBasin != 0 && iUpstreamBasin != 0 )
-			{
-				for(j=0; j<pBasins->Get_Count(); j++)
-				{
-					pRecord	= pBasins->Get_Record(j);
-
-					iCode	= pRecord->asInt(0);
-
-					if( iCode == iUpstreamBasin )
-					{
-						pRecord->Set_Value(9, iDownstreamBasin);
-						pRecord->Set_Value(1, Point.x * m_pDEM->Get_Cellsize() + m_pDEM->Get_XMin());						
-						pRecord->Set_Value(2, Point.y * m_pDEM->Get_Cellsize() + m_pDEM->Get_YMin());
-					}
-				}
-			}
-		}
-		while( !(Point.x == m_Closing.x && Point.y == m_Closing.y) && (Point.x != Next.x || Point.y != Next.y) );
-	}// for
-
-	//-----------------------------------------------------
-	for (i = 1; i<pBasins->Get_Count(); i++)
-	{
-		pBasins->Get_Record(i)->Set_Value(8,SG_T(" --- "));
-		iCode = pBasins->Get_Record(i)->asInt(0);
-
-		for (j = 0; j<pBasins->Get_Count(); j++)
-		{
-			iDownstreamBasin = pBasins->Get_Record(j)->asInt(9);
-
-			if (iDownstreamBasin == iCode)
-			{
-				sSubbasins = CSG_String(pBasins->Get_Record(i)->asString(8)) + SG_T(" ")
-							+ SG_Get_String(pBasins->Get_Record(j)->asInt(0));
-
-				pBasins->Get_Record(i)->Set_Value(8, sSubbasins.c_str());
-			}//if
-		}//for
-	}//for
-
-	//-----------------------------------------------------
-}//*/
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.h b/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.h
deleted file mode 100644
index e039c62..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**********************************************************
- * Version $Id: Watersheds_ext.h 946 2011-03-02 15:32:39Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Watersheds.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CWatersheds_ext : public CSG_Module_Grid
-{
-public:
-	CWatersheds_ext(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-	CSG_Grid			*m_pDEM, *m_pChannels, m_Distance, m_Direction;
-
-
-	bool				Get_Basin		(CSG_Grid *pBasins, CSG_Shapes *pPolygons, int xMouth, int yMouth, int Main_ID);
-	CSG_Shape *			Get_Basin		(CSG_Grid *pBasins, CSG_Shapes *pPolygons);
-
-	bool				is_Outlet		(int x, int y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.in
deleted file mode 100644
index 0ce0755..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.in
+++ /dev/null
@@ -1,577 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis/ta_compound
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_compound_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_compound_la_OBJECTS = MLB_Interface.lo TA_Standard.lo
-libta_compound_la_OBJECTS = $(am_libta_compound_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_compound_la_SOURCES)
-DIST_SOURCES = $(libta_compound_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libta_compound.la
-libta_compound_la_SOURCES = \
-MLB_Interface.cpp\
-TA_Standard.cpp\
-MLB_Interface.h\
-TA_Standard.h
-
-libta_compound_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_compound.la: $(libta_compound_la_OBJECTS) $(libta_compound_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_compound_la_OBJECTS) $(libta_compound_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/TA_Standard.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp
deleted file mode 100644
index 95048cb..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-/**********************************************************
- * Version $Id: TA_Standard.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_compound                       //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    TA_Standard.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:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "TA_Standard.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTA_Standard::CTA_Standard(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Basic Terrain Analysis"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2005"));
-
-	Set_Description	(_TW(
-		"A selection of basic parameters and objects to be derived from a Digital Terrain Model using standard settings."
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SHADE"		, _TL("Analytical Hillshading"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SLOPE"		, _TL("Slope"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "ASPECT"		, _TL("Aspect"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "HCURV"		, _TL("Plan Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "VCURV"		, _TL("Profile Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CONVERGENCE"	, _TL("Convergence Index"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SINKS"		, _TL("Closed Depressions"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CAREA"		, _TL("Catchment Area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "WETNESS"		, _TL("Wetness Index"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "LSFACTOR"	, _TL("LS-Factor"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "CHANNELS"	, _TL("Channel Network"),
-		_TL(""),
-		PARAMETER_OUTPUT		, SHAPE_TYPE_Line
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "BASINS"		, _TL("Drainage Basins"),
-		_TL(""),
-		PARAMETER_OUTPUT		, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHNL_BASE"	, _TL("Channel Network Base Level"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHNL_ALTI"	, _TL("Vertical Distance to Channel Network"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "VALL_DEPTH"	, _TL("Valley Depth"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "RSP"			, _TL("Relative Slope Position"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRESHOLD"	, _TL("Channel Density"), 
-		_TL("Strahler order to begin a channel."), 
-		PARAMETER_TYPE_Int, 5, 1, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define RUN_MODULE(LIBRARY, MODULE, CONDITION)	{\
-	bool	bResult;\
-	SG_RUN_MODULE(bResult, LIBRARY, MODULE, CONDITION)\
-	if( !bResult ) return( false );\
-}
-
-#define SET_PARAMETER(IDENTIFIER, VALUE)	pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE)
-
-//---------------------------------------------------------
-bool CTA_Standard::On_Execute(void)
-{
-	CSG_Grid	DEMP(*Get_System(), SG_DATATYPE_Float);
-	CSG_Grid	TMP1(*Get_System(), SG_DATATYPE_Float);
-	CSG_Grid	TMP2(*Get_System(), SG_DATATYPE_Float);
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_preprocessor"		, 2,
-			SET_PARAMETER("DEM"			, Parameters("ELEVATION"))
-		&&	SET_PARAMETER("DEM_PREPROC"	, &DEMP)	// >> preprocessed DEM
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_lighting"			, 0,
-			SET_PARAMETER("ELEVATION"	, &DEMP)
-		&&	SET_PARAMETER("SHADE"		, Parameters("SHADE"))
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_morphometry"			, 0,
-			SET_PARAMETER("ELEVATION"	, &DEMP)
-		&&	SET_PARAMETER("SLOPE"		, Parameters("SLOPE"))
-		&&	SET_PARAMETER("ASPECT"		, Parameters("ASPECT"))
-		&&	SET_PARAMETER("C_CROS"		, (CSG_Grid *)NULL)
-		&&	SET_PARAMETER("C_LONG"		, (CSG_Grid *)NULL)
-	)
-
-	RUN_MODULE("grid_filter"			, 0,
-			SET_PARAMETER("INPUT"		, &DEMP)
-		&&	SET_PARAMETER("RESULT"		, &TMP1)
-		&&	SET_PARAMETER("RADIUS"		, 3)
-	)
-
-	RUN_MODULE("ta_morphometry"			, 0,
-			SET_PARAMETER("ELEVATION"	, &TMP1)
-		&&	SET_PARAMETER("SLOPE"		, &TMP2)
-		&&	SET_PARAMETER("ASPECT"		, &TMP2)
-		&&	SET_PARAMETER("C_CROS"		, Parameters("HCURV"))
-		&&	SET_PARAMETER("C_LONG"		, Parameters("VCURV"))
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_morphometry"			, 1,
-			SET_PARAMETER("ELEVATION"	, &TMP1)
-		&&	SET_PARAMETER("RESULT"		, Parameters("CONVERGENCE"))
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_hydrology"			, 0,
-			SET_PARAMETER("ELEVATION"	, &DEMP)	// << preprocessed DEM
-		&&	SET_PARAMETER("CAREA"		, Parameters("CAREA"))
-		&&	SET_PARAMETER("Method"		, 4)		// MFD
-	)
-
-	Parameters("SINKS")->asGrid()->Assign(&(TMP2 = DEMP - *Parameters("ELEVATION")->asGrid()));
-	Parameters("SINKS")->asGrid()->Set_NoData_Value(0.0);
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_hydrology"			, 19,
-			SET_PARAMETER("DEM"			, &DEMP)
-		&&	SET_PARAMETER("TCA"			, Parameters("CAREA"))
-		&&	SET_PARAMETER("WIDTH"		, &TMP2)
-		&&	SET_PARAMETER("SCA"			, &TMP1)	// >> specific catchment area
-		&&	SET_PARAMETER("METHOD"		, 1)
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_hydrology"			, 20,
-			SET_PARAMETER("SLOPE"		, Parameters("SLOPE"))
-		&&	SET_PARAMETER("AREA"		, &TMP1)	// << specific catchment area
-		&&	SET_PARAMETER("TWI"			, Parameters("WETNESS"))
-		&&	SET_PARAMETER("CONV"		, 0)
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_hydrology"			, 22,
-			SET_PARAMETER("SLOPE"		, Parameters("SLOPE"))
-		&&	SET_PARAMETER("AREA"		, &TMP1)	// << specific catchment area
-		&&	SET_PARAMETER("LS"			, Parameters("LSFACTOR"))
-		&&	SET_PARAMETER("CONV"		, 0)
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_channels"			, 5,
-			SET_PARAMETER("DEM"			, &DEMP)	// << preprocessed DEM
-		&&	SET_PARAMETER("SEGMENTS"	, Parameters("CHANNELS"))
-		&&	SET_PARAMETER("BASINS"		, Parameters("BASINS"))
-		&&	SET_PARAMETER("ORDER"		, &TMP1)
-		&&	SET_PARAMETER("THRESHOLD"	, Parameters("THRESHOLD"))
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("ta_channels"			, 3,
-			SET_PARAMETER("ELEVATION"	, &DEMP)
-		&&	SET_PARAMETER("CHANNELS"	, &TMP1)
-		&&	SET_PARAMETER("DISTANCE"	, Parameters("CHNL_ALTI"))
-		&&	SET_PARAMETER("BASELEVEL"	, Parameters("CHNL_BASE"))
-	)
-
-	//-----------------------------------------------------
-	RUN_MODULE("grid_tools"				, 19,	// grid orientation
-			SET_PARAMETER("INPUT"		, &DEMP)
-		&&	SET_PARAMETER("RESULT"		, &TMP1)
-		&&	SET_PARAMETER("METHOD"		, 3)	// invert
-	)
-
-	RUN_MODULE("ta_channels"			, 6,	// strahler order
-			SET_PARAMETER("DEM"			, &TMP1)
-		&&	SET_PARAMETER("STRAHLER"	, &TMP2)
-	)
-
-	TMP2.Set_NoData_Value_Range(0, 4);
-
-	RUN_MODULE("ta_channels"			, 3,	// vertical channel network distance
-			SET_PARAMETER("ELEVATION"	, &TMP1)
-		&&	SET_PARAMETER("CHANNELS"	, &TMP2)
-		&&	SET_PARAMETER("DISTANCE"	, Parameters("VALL_DEPTH"))
-	)
-
-	Parameters("RSP")->asGrid()->Assign(&(TMP1 =
-		*Parameters("CHNL_ALTI")->asGrid() / (*Parameters("CHNL_ALTI")->asGrid() + *Parameters("VALL_DEPTH")->asGrid())
-	));
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.cpp
deleted file mode 100644
index 771d4a8..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/**********************************************************
- * Version $Id: CellBalance.cpp 1616 2013-02-27 16:23:56Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    CellBalance.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "CellBalance.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCellBalance::CCellBalance(void)
-{
-	Set_Name		(_TL("Cell Balance"));
-
-	Set_Author		(SG_T("(c) 2004 by V.Olaya, (c) 2006 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"(c) 2004 by Victor Olaya. Cell Balance Calculation\r\n"
-		"References:\r\n 1. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"
-	));
-
-	Parameters.Add_Grid(
-		NULL, "DEM"		, _TL("Elevation"),
-		_TL(""), 
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid_or_Const(
-		NULL, "WEIGHTS"	, _TL("Weights"),
-		_TL(""),
-		1.0, 0.0, true
-	);
-
-	Parameters.Add_Grid(
-		NULL, "BALANCE"	, _TL("Cell Balance"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL, "METHOD"	, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Deterministic 8"),
-			_TL("Multiple Flow Direction")
-		)
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCellBalance::On_Execute(void)
-{
-	int			Method;
-	double		Weight;
-	CSG_Grid	*pWeights;
-
-	m_pDEM		= Parameters("DEM"    )->asGrid();
-	pWeights	= Parameters("WEIGHTS")->asGrid();
-	Weight		= Parameters("WEIGHTS")->asDouble();
-	m_pBalance	= Parameters("BALANCE")->asGrid();
-	Method		= Parameters("METHOD" )->asInt();
-
-	m_pBalance->Assign(0.0);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( m_pDEM->is_NoData(x, y) )
-			{
-				m_pBalance->Set_NoData(x, y);
-			}
-			else
-			{
-				if( pWeights )
-				{
-					Weight	= pWeights->is_NoData(x, y) ? 0.0 : pWeights->asDouble(x, y);
-				}
-
-				if( Weight )
-				{
-					m_pBalance->Add_Value(x, y, -Weight);
-
-					switch( Method )
-					{
-					case 0:	Set_D8	(x, y, Weight);	break;
-					case 1:	Set_MFD	(x, y, Weight);	break;
-					}
-				}
-			}
-        }
-    }
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CCellBalance::Set_D8(int x, int y, double Weight)
-{
-	int		Dir;
-
-	if( (Dir = m_pDEM->Get_Gradient_NeighborDir(x, y)) >= 0 )
-	{
-		x	+= Get_xTo(Dir);
-		y	+= Get_yTo(Dir);
-
-		if( is_InGrid(x, y) )
-		{
-			m_pBalance->Add_Value(x, y, Weight);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CCellBalance::Set_MFD(int x, int y, double Weight)
-{
-	const double	MFD_Converge	= 1.1;
-
-	int		i, ix, iy;
-	double	z, d, dzSum, dz[8];
-
-	z		= m_pDEM->asDouble(x, y);
-	dzSum	= 0.0;
-
-	for(i=0; i<8; i++)
-	{
-		ix		= Get_xTo(i, x);
-		iy		= Get_yTo(i, y);
-
-		if( m_pDEM->is_InGrid(ix, iy) && (d = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
-		{
-			dz[i]	= pow(d / Get_Length(i), MFD_Converge);
-			dzSum	+= dz[i];
-		}
-		else
-		{
-			dz[i]	= 0.0;
-		}
-	}
-
-	if( dzSum > 0.0 )
-	{
-		d		= Weight / dzSum;
-
-		for(i=0; i<8; i++)
-		{
-			if( dz[i] > 0.0 )
-			{
-				ix		= Get_xTo(i, x);
-				iy		= Get_yTo(i, y);
-
-				m_pBalance->Add_Value(ix, iy, dz[i] * d);
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-/*/---------------------------------------------------------
-#include "Helper.h"
-
-double CCellBalance::getCellBalance(int iX, int iY)
-{		
-	int iNextX, iNextY;
-	double dIn=0, dOut=0, dBalance;
-
-	for (int i = -1; i<2; i++){
-		for (int j = -1; j<2; j++){
-			if (!(i == 0) || !(j == 0)) {
-				getNextCell(m_pDEM, iX + i, iY + j, iNextX, iNextY);
-                if (iNextY == iY && iNextX == iX) {
-                    dIn+=m_pWeight->asDouble(iX+i,iY+j);                                        
-				}// if				
-			}//if				
-		}//for
-	}//for
-	
-	dOut = m_pWeight->asDouble(iX,iY);
-	dBalance = dIn-dOut;
-	
-	return dBalance;
-	
-}//function
-
-bool CCellBalance::On_Execute(void)
-{
-	m_pDEM = Parameters("DEM")->asGrid(); 
-	m_pWeight = Parameters("WEIGHT")->asGrid(); 
-	m_pBalance = Parameters("BALANCE")->asGrid();
-	m_pBalance->Assign((double)0);
-
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(int x=0; x<Get_NX(); x++){			
-            m_pBalance->Set_Value(x,y,getCellBalance(x,y));
-        }// for
-    }// for
-
-	return( true );
-
-}//method /**/
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h
deleted file mode 100644
index 9207506..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/**********************************************************
- * Version $Id: CellBalance.h 1616 2013-02-27 16:23:56Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    CellBalance.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CCellBalance : public CSG_Module_Grid
-{
-public:
-	CCellBalance(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Miscellaneous") );	}
-
-
-protected:
-
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	CSG_Grid				*m_pDEM, *m_pBalance;
-
-
-	void					Set_D8			(int x, int y, double Weight);
-	void					Set_MFD			(int x, int y, double Weight);
-
-};
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.cpp
deleted file mode 100644
index 0fb41ba..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-/**********************************************************
- * Version $Id: EdgeContamination.cpp 1016 2011-04-27 18:40:36Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    EdgeContamination.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "EdgeContamination.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define NOT_VISITED -1
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CEdgeContamination::CEdgeContamination(void)
-{
-	Set_Name		(_TL("Edge Contamination"));
-
-	Set_Author		(SG_T("V.Olaya (c) 2004"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	Parameters.Add_Grid(
-		NULL	,  "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CONTAMINATION"	, _TL("Edge Contamination"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CEdgeContamination::On_Execute(void)
-{
-	int		x, y;
-
-	//-----------------------------------------------------
-	m_pDEM				= Parameters("DEM")				->asGrid(); 
-	m_pContamination	= Parameters("CONTAMINATION")	->asGrid();
-
-	//-----------------------------------------------------
-	m_pContamination->Set_NoData_Value(-2);
-
-	m_Edge.Create(*Get_System(), SG_DATATYPE_Byte);
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pDEM->is_InGrid(x, y) )
-			{
-				for(int i=0; i<8; i++)
-				{
-					if( !m_pDEM->is_InGrid(Get_xTo(i, x), Get_yTo(i, y)) )
-					{
-						m_Edge.Set_Value(x, y, 1);
-
-						break;
-					}
-				}
-
-				m_pContamination->Set_Value(x, y, -1);
-			}
-			else
-			{
-				m_pContamination->Set_NoData(x, y);
-			}
-		}
-	}
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pDEM->is_InGrid(x, y) && !m_Edge.asInt(x, y) )
-			{
-				for(int i=0; i<8; i++)
-				{
-					if( m_Edge.asInt(Get_xTo(i, x), Get_yTo(i, y)) == 1 )
-					{
-						m_Edge.Set_Value(x, y, 2);
-
-						break;
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( !m_pDEM->is_NoData(x, y) )
-			{
-				Get_Contamination(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Edge.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CEdgeContamination::Get_Contamination(int x, int y)
-{
-	if( m_pDEM->is_NoData(x, y) )
-	{
-		return( 0 );
-	}
-
-	if( m_pContamination->asInt(x, y) >= 0 )
-	{
-		return( m_pContamination->asInt(x, y) );
-	}
-
-	//-----------------------------------------------------
-	int	Contamination	= m_Edge.asInt(x, y) ? 1 : 0;
-
-	for(int i=0; i<8; i++)
-	{
-		int	ix	= Get_xFrom(i, x);
-		int	iy	= Get_yFrom(i, y);
-
-		if( m_pDEM->Get_Gradient_NeighborDir(ix, iy) == i )
-		{
-			Contamination	+= Get_Contamination(ix, iy);
-		}
-	}
-
-	m_pContamination->Set_Value(x, y, Contamination);
-
-	return( Contamination );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h
deleted file mode 100644
index c26c687..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**********************************************************
- * Version $Id: EdgeContamination.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    EdgeContamination.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CEdgeContamination : public CSG_Module_Grid
-{
-public:
-	CEdgeContamination(void);
-
-	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("R:Catchment Area" ));	}
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	CSG_Grid				*m_pDEM, *m_pContamination, m_Edge;
-
-
-	int						Get_Contamination	(int x, int y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Erosion_LS_Fields.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Erosion_LS_Fields.cpp
deleted file mode 100644
index 6dd1487..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Erosion_LS_Fields.cpp
+++ /dev/null
@@ -1,806 +0,0 @@
-/**********************************************************
- * Version $Id: Erosion_LS_Fields.cpp 1637 2013-03-23 11:52:10Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 Erosion_LS_Fields.cpp                 //
-//                                                       //
-//                 Copyright (C) 2013 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 "Erosion_LS_Fields.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CErosion_LS_Fields::CErosion_LS_Fields(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		("LS-Factor, Field Based");
-
-	Set_Author		("O.Conrad (c) 2013");
-
-	Set_Description	(_TW(
-		"Calculation of slope length (LS) factor as used for the Universal Soil Loss Equation (USLE), "
-		"based on slope and (specific) catchment area, latter as substitute for slope length. "
-		"This tool takes only a Digital Elevation Model (DEM) as input and derives catchment areas "
-		"according to Freeman (1991). "
-		"Optionally field polygons can be supplied. Is this the case, calculations will be performed "
-		"field by field, i.e. catchment area calculation is restricted to each field's area. "
-		"\n"
-		"References:\n"
-		"\n"
-		"Boehner, J., Selige, T. (2006): "
-		"Spatial Prediction of Soil Attributes Using Terrain Analysis and Climate Regionalisation. "
-		"In: Boehner, J., McCloy, K.R., Strobl, J.: 'SAGA - Analysis and Modelling Applications', "
-		"Goettinger Geographische Abhandlungen, 115, 13-27.\n"
-		"\n"
-		"Desmet, P.J.J., Govers, G. (1996): "
-		"A GIS Procedure for Automatically Calculating the USLE LS Factor on Topographically Complex Landscape Units. "
-		"Journal of Soil and Water Conservation, 51(5), 427-433.\n"
-		"\n"
-		"Freeman, G.T. (1991): "
-		"Calculating catchment area with divergent flow based on a regular grid. "
-		"Computers and Geosciences, 17:413-22\n"
-		"\n"
-		"Kinnell, P.I.A. (2005): "
-		"Alternative Approaches for Determining the USLE-M Slope Length Factor for Grid Cells. "
-		"<a href=\"online\">https://www.soils.org/publications/sssaj/abstracts/69/3/0674</a>\n"
-		"\n"
-		"Moore, I.D., Grayson, R.B., Ladson, A.R. (1991): "
-		"Digital terrain modelling: a review of hydrogical, geomorphological, and biological applications. "
-		"Hydrological Processes, 5(1).\n"
-		"\n"
-		"Moore, I.D., Nieber, J.L. (1991): "
-		"Landscape assessment of soil erosion and nonpoint source pollution. "
-		"J. Minnesota Acad. Sci., 55, 18-25.\n"
-		"\n"
-		"Wischmeier, W.H., Smith, D.D. (1978): "
-		"Predicting rainfall erosion losses - A guide to conservation planning. "
-		"Agriculture Handbook No. 537: US Department of Agriculture, Washington DC.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"				, "Elevation",
-		"",
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "FIELDS"			, "Fields",
-		"",
-		PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Shapes(
-		NULL	, "STATISTICS"		, "Field Statistics",
-		"",
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "UPSLOPE_AREA"	, _TL("Upslope Length Factor"),
-		"",
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "UPSLOPE_LENGTH"	, _TL("Effective Flow Length"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "UPSLOPE_SLOPE"	, _TL("Upslope Slope"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "LS_FACTOR"		, _TL("LS Factor"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "BALANCE"			, _TL("Sediment Balance"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		NULL	, "METHOD"			, _TL("LS Calculation"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Moore & Nieber 1989"),
-			_TL("Desmet & Govers 1996"),
-			_TL("Wischmeier & Smith 1978")
-		), 0
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD_SLOPE"	, _TL("Type of Slope"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local slope"),
-			_TL("distance weighted average catchment slope")
-		), 0
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD_AREA"		, _TL("Specific Catchment Area"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("specific catchment area (contour length simply as cell size)"),
-			_TL("specific catchment area (contour length dependent on aspect)"),
-			_TL("catchment length (square root of catchment area)"),
-			_TL("effective flow length"),
-			_TL("total catchment area")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "STOP_AT_EDGE"	, _TL("Stop at Edge"),
-		"",
-		PARAMETER_TYPE_Bool, true
-	);
-
-	//-----------------------------------------------------
-	pNode	= Parameters.Add_Node(
-		NULL	, "DESMET_GOVERS"	, _TL("Desmet & Govers"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode	, "EROSIVITY"	, _TL("Rill/Interrill Erosivity"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "STABILITY"	, _TL("Stability"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("stable"),
-			_TL("instable (thawing)")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CErosion_LS_Fields::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), "METHOD") )
-	{
-		pParameters->Get_Parameter("DESMET_GOVERS")->Set_Enabled(pParameter->asInt() == 1);
-	}
-
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FIELDS") )
-	{
-		pParameters->Get_Parameter("STATISTICS")->Set_Enabled(pParameter->asShapes() != NULL);
-	}
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CErosion_LS_Fields::On_Execute(void)
-{
-	//-----------------------------------------------------
-	m_Method		= Parameters("METHOD"        )->asInt();
-	m_Method_Slope	= Parameters("METHOD_SLOPE"  )->asInt();
-	m_Method_Area	= Parameters("METHOD_AREA"   )->asInt();
-
-	m_bStopAtEdge	= Parameters("STOP_AT_EDGE"  )->asBool();
-
-	m_Erosivity		= Parameters("EROSIVITY"     )->asDouble();
-	m_Stability		= Parameters("STABILITY"     )->asInt();
-
-	m_pDEM			= Parameters("DEM"           )->asGrid();
-	m_pUp_Area		= Parameters("UPSLOPE_AREA"  )->asGrid();
-	m_pUp_Length	= Parameters("UPSLOPE_LENGTH")->asGrid();
-	m_pUp_Slope		= Parameters("UPSLOPE_SLOPE" )->asGrid();
-	m_pLS			= Parameters("LS_FACTOR"     )->asGrid();
-
-	DataObject_Set_Colors(m_pUp_Area  , 11, SG_COLORS_WHITE_BLUE    , false);
-	DataObject_Set_Colors(m_pUp_Length, 11, SG_COLORS_YELLOW_RED    , false);
-	DataObject_Set_Colors(m_pUp_Slope , 11, SG_COLORS_YELLOW_RED    , false);
-	DataObject_Set_Colors(m_pLS       , 11, SG_COLORS_RED_GREY_GREEN, true );
-
-	if( m_pUp_Area   == NULL )	m_pUp_Area   = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float);
-	if( m_pUp_Length == NULL )	m_pUp_Length = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float);
-	if( m_pUp_Slope  == NULL )	m_pUp_Slope  = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float);
-
-	//-----------------------------------------------------
-	bool	bResult	= Set_Fields() && Get_Flow() && Get_LS();
-
-	if( bResult )
-	{
-		Get_Statistics();
-
-		Get_Balance();
-	}
-
-	//-----------------------------------------------------
-	if( m_pUp_Area   && Parameters("UPSLOPE_AREA"  )->asGrid() == NULL ) delete(m_pUp_Area  );
-	if( m_pUp_Length && Parameters("UPSLOPE_LENGTH")->asGrid() == NULL ) delete(m_pUp_Length);
-	if( m_pUp_Slope  && Parameters("UPSLOPE_SLOPE" )->asGrid() == NULL ) delete(m_pUp_Slope );
-
-	m_Fields.Destroy();
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CErosion_LS_Fields::Get_Flow(void)
-{
-	int		n, x, y;
-
-	//-----------------------------------------------------
-	m_pDEM->Get_Sorted(0, x, y);	// create index ...
-
-	Process_Set_Text(_TL("Flow Accumulation"));
-
-	m_pUp_Area  ->Assign(0.0);
-	m_pUp_Length->Assign(0.0);
-	m_pUp_Slope ->Assign(0.0);
-
-	for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		double	dzSum, dz[8], Slope, Aspect;
-
-		if( m_pDEM->Get_Sorted(n, x, y) && !m_Fields.is_NoData(x, y) && m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
-		{
-			double	Up_Area		= m_pUp_Area  ->asDouble(x, y) + Get_Cellarea();
-			double	Up_Length	= m_pUp_Length->asDouble(x, y) + log(Up_Area);
-			double	Up_Slope	= m_pUp_Slope ->asDouble(x, y) + log(Up_Area) * Slope;
-
-			//---------------------------------------------
-			if( (dzSum = Get_Flow(x, y, dz)) > 0.0 )
-			{
-				for(int i=0; i<8; i++)
-				{
-					if( dz[i] > 0.0 )
-					{
-						int	ix	= Get_xTo(i, x);
-						int	iy	= Get_yTo(i, y);
-
-						m_pUp_Area  ->Add_Value(ix, iy, Up_Area   * dz[i] / dzSum);
-						m_pUp_Length->Add_Value(ix, iy, Up_Length * dz[i] / dzSum);
-						m_pUp_Slope ->Add_Value(ix, iy, Up_Slope  * dz[i] / dzSum);
-					}
-				}
-			}
-
-			//---------------------------------------------
-			switch( m_Method_Area )
-			{
-			case 0:	// specific catchment area (contour length simply as cell size)
-				m_pUp_Area->Set_Value(x, y, Up_Area / (Get_Cellsize()));
-				break;
-
-			case 1:	// specific catchment area (contour length dependent on aspect)
-				m_pUp_Area->Set_Value(x, y,	Up_Area / (Get_Cellsize() * (fabs(sin(Aspect)) + fabs(cos(Aspect)))));
-				break;
-
-			case 2:	// catchment length (square root of catchment area)
-				m_pUp_Area->Set_Value(x, y, sqrt(Up_Area));
-				break;
-
-			case 3:	// effective flow length
-				m_pUp_Area->Set_Value(x, y, Up_Length);
-				break;
-
-			case 4:	// total catchment area
-				m_pUp_Area->Set_Value(x, y, Up_Area);
-				break;
-			}
-
-			m_pUp_Length->Set_Value(x, y, Up_Length);
-			m_pUp_Slope ->Set_Value(x, y, Up_Slope / (Up_Length > M_ALMOST_ZERO ? Up_Length : M_ALMOST_ZERO));
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-double CErosion_LS_Fields::Get_Flow(int x, int y, double dz[8])
-{
-	if( m_Fields.is_NoData(x, y) )
-	{
-		return( 0.0 );
-	}
-
-	double	d, z = m_pDEM->asDouble(x, y), dzSum = 0.0;
-
-	int		ID	= m_Fields.asInt(x, y);
-
-	for(int i=0; i<8; i++)
-	{
-		dz[i]	= 0.0;
-
-		int	ix	= Get_xTo(i, x);
-		int	iy	= Get_yTo(i, y);
-
-		if(	m_pDEM->is_InGrid(ix, iy) && (d = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
-		{
-			if( ID == m_Fields.asInt(ix, iy) )
-			{
-				dzSum	+= (dz[i] = pow(d / Get_Length(i), 1.1));
-			}
-			else if( m_bStopAtEdge )
-			{
-				dzSum	+= pow(d / Get_Length(i), 1.1);
-			}
-		}
-	}
-
-	return( dzSum );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CErosion_LS_Fields::Get_LS(void)
-{
-	Process_Set_Text(_TL("LS Factor"));
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	LS	= Get_LS(x, y);
-
-			if( LS >= 0.0 )
-			{
-				m_pLS->Set_Value(x, y, LS);
-			}
-			else
-			{
-				m_pLS->Set_NoData(x, y);
-
-				m_pUp_Area  ->Set_NoData(x, y);
-				m_pUp_Length->Set_NoData(x, y);
-				m_pUp_Slope ->Set_NoData(x, y);
-			}
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-double CErosion_LS_Fields::Get_LS(int x, int y)
-{
-	double	LS, Slope, Aspect, Area, sin_Slope;
-
-	//-----------------------------------------------------
-	if( m_Fields.is_NoData(x, y) )
-	{
-		return( -1.0 );
-	}
-
-	if( !m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
-	{
-		return( -1.0 );
-	}
-
-	if( m_Method_Slope == 1 )	// distance weighted average up-slope slope
-	{
-		Slope	= m_pUp_Slope->asDouble(x, y);
-	}
-
-	if( Slope <= 0.0 )	Slope	= 0.000001;
-	if( Aspect < 0.0 )	Aspect	= 0.0;
-
-	sin_Slope	= sin(Slope);
-
-	Area		= m_pUp_Area->asDouble(x, y);
-
-	//-----------------------------------------------------
-	switch( m_Method )
-	{
-	//-----------------------------------------------------
-	default:	// Moore and Nieber
-		{
-			LS		= (0.4 + 1) * pow(Area / 22.13, 0.4) * pow(sin_Slope / 0.0896, 1.3);
-		}
-		break;
-
-	//-----------------------------------------------------
-	case 1:		// Desmet and Govers
-		{
-			double	L, S, m, x;
-
-			m		= m_Erosivity * (sin_Slope / 0.0896) / (3.0 * pow(sin_Slope, 0.8) + 0.56);
-			m		= m / (1.0 + m);
-
-			x		= fabs(sin(Aspect)) + fabs(cos(Aspect));
-
-			// x: coefficient that adjusts for width of flow at the center of the cell.
-			// It has a value of 1.0 when the flow is toward a side and sqrt(2.0) when
-			// the flow is toward a corner (Kinnel 2005).
-
-			L		= (pow(Area + Get_Cellarea(), m + 1.0) - pow(Area, m + 1.0))
-				/ (pow(Get_Cellsize(), m + 2.0) * pow(22.13, m) * pow(x, m));
-
-			//-----------------------------------------------------
-			if( Slope < 0.08975817419 )		// <  9% (= atan(0.09)), ca. 5 Degree
-			{
-				S	= 10.8 * sin_Slope + 0.03;	
-			}
-			else if( m_Stability == 0 )		// >= 9%, stable
-			{
-				S	= 16.8 * sin_Slope - 0.5;
-			}
-			else							// >= 9%, thawing, unstable
-			{
-				S	= pow(sin_Slope / 0.896, 0.6);
-			}
-
-			LS		= L * S;
-		}
-		break;
-
-	//-----------------------------------------------------
-	case 2:		// Wischmeier and Smith
-		{
-			if( Slope > 0.0505 )	// >  ca. 3�
-			{
-				LS	= sqrt(Area / 22.13)
-					* (65.41 * sin_Slope * sin_Slope + 4.56 * sin_Slope + 0.065);
-			}
-			else					// <= ca. 3�
-			{
-				LS	= pow (Area / 22.13, 3.0 * pow(Slope, 0.6))
-					* (65.41 * sin_Slope * sin_Slope + 4.56 * sin_Slope + 0.065);
-			}
-		}
-		break;
-	}
-
-	return( LS );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CErosion_LS_Fields::Get_Balance(void)
-{
-	CSG_Grid	*pBalance	= Parameters("BALANCE")->asGrid();
-
-	if( pBalance == NULL )
-	{
-		return( false );
-	}
-
-	DataObject_Set_Colors(pBalance, 11, SG_COLORS_RED_GREY_BLUE , false);
-
-	//-----------------------------------------------------
-	int		y;
-
-	CSG_Grid	dzSum(*Get_System(), SG_DATATYPE_Float);
-
-	//-----------------------------------------------------
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s 1"), _TL("Sediment Balance"), _TL("Pass")));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !m_Fields.is_NoData(x, y) )
-			{
-				int		ID	= m_Fields.asInt  (x, y);
-				double	z	= m_pDEM->asDouble(x, y), iz;
-				double	Sum	= 0.0;
-
-				for(int i=0; i<8; i++)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( is_InGrid(ix, iy) && ID == m_Fields.asInt(ix, iy) && (iz = m_pDEM->asDouble(ix, iy)) < z )
-					{
-						Sum	+= atan((z - iz) / Get_Length(i));	// als Winkel !!!?
-					}
-				}
-
-				dzSum.Set_Value(x, y, Sum);
-			}
-		}
-	}
-
-
-	//-----------------------------------------------------
-	Process_Set_Text(CSG_String::Format(SG_T("%s: %s 2"), _TL("Sediment Balance"), _TL("Pass")));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !m_Fields.is_NoData(x, y) )
-			{
-				int		ID	= m_Fields.asInt  (x, y);
-				double	z	= m_pDEM->asDouble(x, y), iz;
-				double	Sum	= -m_pLS->asDouble(x, y);
-
-				for(int i=0; i<8; i++)
-				{
-					int	ix	= Get_xTo(i, x);
-					int	iy	= Get_yTo(i, y);
-
-					if( is_InGrid(ix, iy) && ID == m_Fields.asInt(ix, iy) && dzSum.asDouble(ix, iy) > 0.0 && (iz = m_pDEM->asDouble(ix, iy)) > z )
-					{
-						iz	 = atan((z - iz) / Get_Length(i));	// als Winkel !!!?
-						Sum	+= (-iz / dzSum.asDouble(ix, iy)) * m_pLS->asDouble(ix, iy);
-					}
-				}
-
-				if( Sum > 0.0 )
-				{
-					z	=  log(1.0 + Sum);
-
-					pBalance->Set_Value (x, y, z >  5.0 ?  5.0 : z);
-				}
-				else if( Sum < 0.0 )
-				{
-					z	= -log(1.0 - Sum);
-
-					pBalance->Set_Value (x, y, z < -5.0 ? -5.0 : z);
-				}
-				else
-				{
-					pBalance->Set_NoData(x, y);
-				}
-			}
-			else
-			{
-				pBalance->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CErosion_LS_Fields::Get_Statistics(void)
-{
-	CSG_Shapes	*pFields		= Parameters("FIELDS"    )->asShapes();
-	CSG_Shapes	*pStatistics	= Parameters("STATISTICS")->asShapes();
-
-	//-----------------------------------------------------
-	if( !pStatistics || !pFields || m_nFields <= 0 || pFields->Get_Count() != m_nFields )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	int		i;
-
-	CSG_Simple_Statistics	*Statistics	= new CSG_Simple_Statistics[m_nFields];
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !m_pLS->is_NoData(x, y) && (i = m_Fields.asInt(x, y)) >= 0 && i < m_nFields )
-			{
-				Statistics[i]	+= m_pLS->asDouble(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	pStatistics->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pFields->Get_Name(), _TL("LS")));
-
-	pStatistics->Add_Field("NCELLS", SG_DATATYPE_Int   );
-	pStatistics->Add_Field("MEAN"  , SG_DATATYPE_Double);
-	pStatistics->Add_Field("MIN"   , SG_DATATYPE_Double);
-	pStatistics->Add_Field("MAX"   , SG_DATATYPE_Double);
-	pStatistics->Add_Field("STDDEV", SG_DATATYPE_Double);
-
-	for(i=0; i<pFields->Get_Count() && Set_Progress(i, pFields->Get_Count()); i++)
-	{
-		CSG_Shape	*pField	= pStatistics->Add_Shape(pFields->Get_Shape(i));
-
-		if( Statistics[i].Get_Count() > 0 )
-		{
-			pField->Set_Value(0, Statistics[i].Get_Count  ());
-			pField->Set_Value(1, Statistics[i].Get_Mean   ());
-			pField->Set_Value(2, Statistics[i].Get_Minimum());
-			pField->Set_Value(3, Statistics[i].Get_Maximum());
-			pField->Set_Value(4, Statistics[i].Get_StdDev ());
-		}
-		else for(int j=0; j<pFields->Get_Field_Count(); j++)
-		{
-			pField->Set_NoData(j);
-		}
-	}
-
-	//-------------------------------------------------
-	delete[](Statistics);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CErosion_LS_Fields::Set_Fields(void)
-{
-	CSG_Shapes	*pFields	= Parameters("FIELDS")->asShapes();
-
-	//-----------------------------------------------------
-	if( !pFields || pFields->Get_Count() <= 0 )
-	{
-		m_Fields.Create(*Get_System(), SG_DATATYPE_Char);
-	//	m_Fields.Set_NoData_Value(1.0);
-	//	m_Fields.Assign(0.0);
-
-		#pragma omp parallel for
-		for(int y=0; y<Get_NY(); y++)
-		{
-			for(int x=0; x<Get_NX(); x++)
-			{
-				if( !m_pDEM->is_InGrid(x, y) )
-				{
-					m_Fields.Set_NoData(x, y);
-				}
-			}
-		}
-
-		return( true );
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Initializing Fields"));
-
-	m_nFields	= pFields->Get_Count();
-
-	m_Fields.Create(*Get_System(), m_nFields < pow(2.0, 16.0) - 1.0 ? SG_DATATYPE_Word : SG_DATATYPE_DWord);
-	m_Fields.Set_NoData_Value(m_nFields);
-	m_Fields.Assign_NoData();
-
-	//-----------------------------------------------------
-	for(int iField=0; iField<pFields->Get_Count() && Set_Progress(iField, pFields->Get_Count()); iField++)
-	{
-		CSG_Shape_Polygon	*pField	= (CSG_Shape_Polygon *)pFields->Get_Shape(iField);
-
-		int	xMin	= Get_System()->Get_xWorld_to_Grid(pField->Get_Extent().Get_XMin()) - 1; if( xMin <  0        ) xMin = 0;
-		int	xMax	= Get_System()->Get_xWorld_to_Grid(pField->Get_Extent().Get_XMax()) + 1; if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
-		int	yMin	= Get_System()->Get_yWorld_to_Grid(pField->Get_Extent().Get_YMin()) - 1; if( yMin <  0        ) yMin = 0;
-		int	yMax	= Get_System()->Get_yWorld_to_Grid(pField->Get_Extent().Get_YMax()) + 1; if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
-
-		for(int y=yMin; y<=yMax; y++)
-		{
-			for(int x=xMin; x<=xMax; x++)
-			{
-				if( m_pDEM->is_InGrid(x, y) && pField->Contains(Get_System()->Get_Grid_to_World(x, y)) )
-				{
-					m_Fields.Set_Value(x, y, iField);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.cpp
deleted file mode 100644
index 9f344d7..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.cpp
+++ /dev/null
@@ -1,866 +0,0 @@
-/**********************************************************
- * Version $Id: Flow.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                       Flow.cpp                        //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow::CFlow(void)
-{
-	pCatch_AspectY	= NULL;
-	bPoint			= false;
-
-	//-----------------------------------------------------
-	Set_Description (_TW(
-		""
-	));
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SINKROUTE"	, _TL("Sink Routes"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "WEIGHT"		, _TL("Weight"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "MATERIAL"	, _TL("Material"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "TARGET"		, _TL("Target"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);	
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL	, "CAREA"		, _TL("Catchment Area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHEIGHT"		, _TL("Catchment Height"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CSLOPE"		, _TL("Catchment Slope"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "ACCU_TOT"	, _TL("Total accumulated Material"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);	
-
-	Parameters.Add_Grid(
-		NULL	, "ACCU_LEFT"	, _TL("Accumulated Material from _left_ side"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);		
-
-	Parameters.Add_Grid(
-		NULL	, "ACCU_RIGHT"	, _TL("Accumulated Material from _right_ side"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);		
-	
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL	, "STEP"		, _TL("Step"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
-	);
-}
-
-//---------------------------------------------------------
-CFlow::~CFlow(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow::Set_Point(int x, int y)
-{
-	bPoint	= true;
-	xPoint	= x;
-	yPoint	= y;
-}
-
-//---------------------------------------------------------
-bool CFlow::On_Execute(void)
-{
-	bool	bResult	= false;
-	long	n;
-	double	d;
-
-	//-------------------------------------------------
-	pDTM			= Parameters("ELEVATION")	->asGrid();
-	pRoute			= Parameters("SINKROUTE")	->asGrid();
-	pWeight			= Parameters("WEIGHT")		->asGrid();
-	pMaterial		= Parameters("MATERIAL")	->asGrid();
-	pTarget			= Parameters("TARGET")		->asGrid();
-
-	pCatch			= Parameters("CAREA")		->asGrid();
-	DataObject_Set_Colors(pCatch, 100, SG_COLORS_WHITE_BLUE);
-	pCatch_Height	= NULL;
-	pCatch_Slope	= NULL;
-	pCatch_Aspect	= NULL;
-	pFlowPath		= NULL;
-	pAccu_Tot		= NULL;
-	pAccu_Left		= NULL;
-	pAccu_Right		= NULL;
-
-	Step			= Parameters("STEP")		->asInt();
-
-	//-------------------------------------------------
-	On_Initialize();
-
-	//-------------------------------------------------
-	if( pCatch )
-	{
-		pCatch			->Assign(0.0);
-	}
-
-	if( pCatch_Height )
-	{
-		pCatch_Height	->Assign(0.0);
-	}
-
-	if( pCatch_Slope )
-	{
-		pCatch_Slope	->Assign(0.0);
-	}
-
-	if( pCatch_Aspect )
-	{
-		pCatch_Aspect	->Assign(0.0);
-		pCatch_AspectY	 = SG_Create_Grid(pCatch_Aspect);
-	}
-
-	if( pFlowPath )
-	{
-		pFlowPath		->Assign(0.0);
-	}
-
-	if( pAccu_Tot )
-	{
-		pAccu_Tot		->Assign(1.0);
-	}	
-
-	if( pAccu_Left )
-	{
-		pAccu_Left		->Assign(1.0);
-	}	
-
-	if( pAccu_Right )
-	{
-		pAccu_Right		->Assign(1.0);
-	}	
-	
-	//-------------------------------------------------
-	if( bPoint )
-	{
-		bPoint	= false;
-
-		if( is_InGrid(xPoint, yPoint) )
-		{
-			Calculate(xPoint, yPoint);
-
-			On_Finalize();
-
-			for(n=0; n<Get_NCells(); n++)
-			{
-				d	= pCatch->asDouble(n);
-				pCatch->Set_Value(n, 100.0 * d);
-			}
-
-			bResult		= true;
-		}
-	}
-	else
-	{
-		pCatch_Height	= Parameters("CHEIGHT")	->asGrid();
-		pCatch_Slope	= Parameters("CSLOPE")	->asGrid();
-		
-		pAccu_Tot		= Parameters("ACCU_TOT")	->asGrid();
-		pAccu_Left		= Parameters("ACCU_LEFT")	->asGrid();
-		pAccu_Right		= Parameters("ACCU_RIGHT")	->asGrid();
-		
-		Calculate();
-
-		On_Finalize();
-		Finalize();
-
-		bResult			= true;
-	}
-
-	//-------------------------------------------------
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow::Init_Cell(int x, int y)
-{
-	double	Weight, Material, Slope, Aspect;
-
-	Weight		= pWeight   ? pWeight  ->asDouble(x, y) : 1.0;
-	Material	= pMaterial ? pMaterial->asDouble(x, y) : 1.0;
-
-	if( pCatch )
-	{
-		pCatch			->Add_Value(x, y, Weight);
-	}
-
-	if( pCatch_Height )
-	{
-		pCatch_Height	->Add_Value(x, y, Weight * pDTM->asDouble(x, y));
-	}
-
-	if( pCatch_Slope )
-	{
-		Get_Gradient(x, y, Slope, Aspect);
-
-		pCatch_Slope	->Add_Value(x, y, Weight * Slope);
-	}
-
-	if( pCatch_Aspect && pCatch_AspectY )
-	{
-		Get_Gradient(x, y, Slope, Aspect);
-
-		pCatch_Aspect	->Add_Value(x, y, Weight * sin(Aspect));
-		pCatch_AspectY	->Add_Value(x, y, Weight * cos(Aspect));
-	}
-	
-	if( pAccu_Tot )
-	{
-		pAccu_Tot		->Set_Value(x, y, Weight * Material);
-	}	
-
-	if( pAccu_Left )
-	{
-		pAccu_Left		->Set_Value(x, y, Weight * Material);
-	}	
-
-	if( pAccu_Right )
-	{
-		pAccu_Right		->Set_Value(x, y, Weight * Material);
-	}	
-	
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow::Finalize(void)
-{
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( pDTM->is_NoData(n) )
-		{
-			if( pCatch )		{	pCatch			->Set_NoData(n);	}
-			if( pCatch_Height )	{	pCatch_Height	->Set_NoData(n);	}
-			if( pCatch_Slope )	{	pCatch_Slope	->Set_NoData(n);	}
-			if( pCatch_Aspect )	{	pCatch_Aspect	->Set_NoData(n);	}
-			if( pFlowPath )		{	pFlowPath		->Set_NoData(n);	}
-			if( pAccu_Tot )		{	pAccu_Tot		->Set_NoData(n);	}
-			if( pAccu_Left )	{	pAccu_Left		->Set_NoData(n);	}
-			if( pAccu_Right )	{	pAccu_Right		->Set_NoData(n);	}
-		}
-		else
-		{
-			//---------------------------------------------
-			double	Catch	= pCatch->asDouble(n);
-
-			if( pCatch )
-			{
-				pCatch	->Set_Value(n, Catch * Get_System()->Get_Cellarea());
-			}
-
-			if( Catch > 0.0 )
-			{
-				if( pCatch_Height )	{	pCatch_Height	->Set_Value(n, pCatch_Height->asDouble(n) / Catch - pDTM->asDouble(n));	}
-				if( pCatch_Slope )	{	pCatch_Slope	->Mul_Value(n, 1.0 / Catch);	}
-				if( pFlowPath )		{	pFlowPath		->Mul_Value(n, 1.0 / Catch);	}
-			}
-			else
-			{
-				if( pCatch_Height )	{	pCatch_Height	->Set_Value(n, pDTM->asDouble(n));	}
-				if( pCatch_Slope )	{	pCatch_Slope	->Set_Value(n, 0.0);	}
-				if( pFlowPath )		{	pFlowPath		->Set_Value(n, 0.0);	}
-			}
-
-			//---------------------------------------------
-			if( pCatch_Aspect && pCatch_AspectY )
-			{
-				double	G	= pCatch_Aspect	->asDouble(n);
-				double	H	= pCatch_AspectY->asDouble(n);
-
-				pCatch_Aspect	->Set_Value(n, G ? fmod(M_PI_270 + atan2(H, G), M_PI_360) : (H > 0 ? M_PI_270 : (H < 0 ? M_PI_090 : -1)));
-			}
-			
-			//---------------------------------------------
-			double	Material	= pMaterial ? pMaterial->asDouble(n) : 1.0;
-			double	Weight		= pWeight   ? pWeight  ->asDouble(n) : 1.0;
-
-			if( pAccu_Left && pTarget )
-			{
-				if( pTarget->is_NoData(n) )
-				{
-					pAccu_Left	->Set_NoData(n);
-				}
-				else
-				{
-					pAccu_Left	->Add_Value(n, - 0.5 * Weight * Material);
-				}
-			}
-			
-			if( pAccu_Right && pTarget )
-			{
-				if( pTarget->is_NoData(n) )
-				{	
-					pAccu_Right	->Set_NoData(n);
-				}
-				else
-				{
-					pAccu_Right	->Add_Value(n, - 0.5 * Weight * Material);
-				}
-			}			
-		}
-	}
-
-	//-----------------------------------------------------
-	if( pCatch_AspectY )
-	{
-		delete(pCatch_AspectY);
-
-		pCatch_AspectY	= NULL;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow::Get_Gradient(int x, int y, double &Slope, double &Aspect)
-{
-	pDTM->Get_Gradient(x, y, Slope, Aspect);
-}
-
-//---------------------------------------------------------
-
-///////////////////////////////////////////////////////////
-//		            SIDE-Algorithm                       //
-//					                                     //
-//              Copyright (c) 2010 by					 //
-//														 //
-//                  Thomas J. Grabs                      //
-//					                                     //
-//                                                       //
-//  website:       www.thomasgrabs.com                   //
-//					                                     //
-//            Updates and compiled versions of           //
-//           this algorithm can be found on the          //
-//                    author's website                   //
-//					                                     //
-//  Purpose:				                             //
-//	========				                             //
-//  Determine the side of a flow line relative to the    //
-//  (stream) flow direction in an adjacent grid cell     //
-//					                                     //
-//-------------------------------------------------------//
-//           !!!    PLEASE CITE    !!!                   //
-// the associated scientific article when redistributing //
-// and/or using and/or modifying this source code or     //
-// parts of it:                                          // 
-//                                                       //
-// "Calculating terrain indices along streams - a new    //
-//  method for separating stream sides,                  //
-//  Grabs, T. J. et al., published in Water Resources    //
-//  Research (WRR), please search the complete reference //
-// on the internet or on "http://www.agu.org/journals/wr"//
-//-------------------------------------------------------//
-//                                                       //
-// This source code is part of 'SAGA - System for        //
-// Automated Geoscientific Analyses'. You can            //
-// redistribute this source code 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.                                       //
-//                                                       //
-// The source code 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.                                                  //
-//														 //
-///////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////
-//														 //
-// List of variables:                                    //
-//														 //
-// x,y         : Coordinates of the grid cell containing //
-//			     the flow line.							 //
-// Direction   : Direction of the flow line				 //
-// left        : TRUE/FALSE depending on the location of //
-//			     the flow line.							 //
-// right       : TRUE/FALSE depending on the location of //
-//			     the flow line.							 //
-// FL_Dir      :  Direction of the flow line             //
-// stream1_Dir :  Streamflow direction                   //
-// stream2_Dir :  Streamflow direction (upstream)        //
-// stream1_X   :  X-coord. of stream grid cell           //
-// stream1_Y   :  Y-coord. of stream grid cell           //
-// stream2_X   :  X-coord. of (upstr.) stream grid cell  //
-// stream2_X   :  Y-coord. of (upstr.) stream grid cell  //
-// FL_Vec      :  Direction of flow line (as vector)     //
-// stream1_Vec :  Streamflow direction (as vector)       //
-// stream2_Vec :  Streamflow direction (as vector, upstr)//
-// SP          : Scalar product of 2 vectors             //
-// CP_A        : Cross product "A" of 2 vectors          //
-// CP_B        : Cross product "B" of 2 vectors          //
-// CP_C        : Cross product "C" of 2 vectors          //
-// Zcp_a       : Z component of the cross product "A"    //
-// Zcp_b       : Z component of the cross product "B"    //
-// Zcp_c       : Z component of the cross product "C"    //
-// a-z         : auxiliary variables                     //
-// NTributaries: Number of tributaries to a junction     //
-// prev_right  : auxiliary variable (true/false)         //
-// prev_left   : auxiliary variable (true/false)         //
-// is_upstream : auxiliary variable (true/false)         //
-//-------------------------------------------------------//
-//														 //
-// Conventions                                  		 //
-//-------------------------------------------------------//
-// left==true & right==false: Flow line is on the left   //
-// left==false & right==true: Flow line is on the right  //
-// left==true & right==true: The side of the flow line is//
-//                          not determined (channel head)//
-//                           or lies between             //
-//                           tributaries to a junction   //
-///////////////////////////////////////////////////////////
-
-void CFlow::Find_Sides(int x, int y, int Direction, bool &left, bool &right)
-{
-	int			FL_Dir, stream1_Dir, stream2_Dir;
-	int			stream1_X, stream1_Y;
-	int			stream2_X, stream2_Y;
-	CSG_Vector	FL_Vec(3), stream1_Vec(3), stream2_Vec(3);
-	CSG_Vector  CP_A(3), CP_B(3), CP_C(3); 
-	double		SP;
-	double		Zcp_a, Zcp_b, Zcp_c;
-
-	// Initialize the stream side variables to their default. 
-	// Default: The side of the flow line is not determined.
-	left = right = true;
-				
-    // Determine the coordinates and stream direction the adjacent
-	// grid cell, to which the flow line points.
-	FL_Dir		        = Direction;
-	stream1_X			= Get_xTo( FL_Dir, x );
-	stream1_Y			= Get_yTo( FL_Dir, y );
-	stream1_Dir			= pTarget->asInt(stream1_X, stream1_Y);
-
-	/*--Note: At this point it is already assumed that FL_Dir points to 
-	    a grid cell that belongs to the stream network. Thus, stream1_X,
-		stream1_Y and stream1_Dir have all non-missing values. If the code
-		is to be used elsewhere, one should verify that FL_Dir points to
-		a grid cell that belongs to the stream network.--*/
-	
-	// Write the direction of the flow line as vector:
-	FL_Vec[0]	= Get_xTo( FL_Dir );
-	FL_Vec[1]	= Get_yTo( FL_Dir );
-	FL_Vec[2]	= 0.0; //z-component is normally 0
-	
-	// Write the streamflow directon as vector:
-	stream1_Vec[0]		= Get_xTo( stream1_Dir );
-	stream1_Vec[1]		= Get_yTo( stream1_Dir );
-	stream1_Vec[2]		= 0.0;//z-component is normally 0
-
-	// Initialize the upstream streamflow direction vector
-	// and set all components to zero 
-	stream2_Vec[0]		= 0.0;
-	stream2_Vec[1]		= 0.0;
-	stream2_Vec[2]		= 0.0;
-	
-	// Calculate the scalar product
-	SP					= FL_Vec[0] * stream1_Vec[0] + FL_Vec[1] * stream1_Vec[1];
-	
-	// Adjust the scalar product by dividing it by the lengths of FL_Vec and stream1_Vec
-	SP = SP /sqrt( FL_Vec[0]*FL_Vec[0] + FL_Vec[1]*FL_Vec[1])
-			/sqrt(stream1_Vec[0]*stream1_Vec[0] + stream1_Vec[1]*stream1_Vec[1]);
-
-
-	if( fabs(SP - (-1)) < 0.00001)
-	{
-		// SP is (approximately) equal to -1! 
-		// The flow line is hence oriented opposite to the streamflow direction.
-		// Further calculations are skipped: The side of the flow line remains the default.
-		// This can occur if an endpoint of the streamflow direction map does *not*
-		// point to a missing value. In other words, the stream outlet lies 'inside' the 
-		// DEM and not right on the border of the DEM.
-		// Since this can be intentional, a user notification is only optional.
-
-		/*-- (optional) Notification of the user  --*/
-	}
-	else
-	{
-		/*--  Core of the SIDE-Algorithm  --*/
-
-		int		NTributaries;
-		bool	prev_right, prev_left;
-		bool	is_upstream;
-		
-		// Initialize the number of tributaries and other auxiliary variables
-		NTributaries = 0; //default: channel head
-		prev_right = prev_left = true;
-		is_upstream= false;
-					
-		// The full vector-cross-product of the streamflow direction and the flow line direction
-		// CP_A				= FL_Vec * stream1_Vec;
-		// is not calculated because it is more efficient to calculate only the z-component 
-		// of the cross-product:
-		
-		Zcp_a	= FL_Vec[0]*stream1_Vec[1] - FL_Vec[1]*stream1_Vec[0];
-
-		// Look for upstream tributaries / stream grid cells
-		for(int i=0; i<8; i++)
-		{
-			// find adjacent grid cell coordinates
-			stream2_X =  Get_xTo(i, stream1_X);
-			stream2_Y =  Get_yTo(i, stream1_Y);
-			
-			// Make sure it is within the map domain
-			if( is_InGrid(stream2_X, stream2_Y)	)
-			{
-				// Make sure it is not a missing-value
-				if ( ! pTarget->is_NoData( stream2_X, stream2_Y ) )
-				{
-					// Is the stream cell an upstream tributary?
-					stream2_Dir = pTarget->asInt(stream2_X, stream2_Y);
-					is_upstream = stream1_X == Get_xTo(stream2_Dir, stream2_X) && 
-									stream1_Y == Get_yTo(stream2_Dir, stream2_Y);
-								
-					if( is_upstream )
-					{
-						// The stream cell is an upstream tributary!
-						NTributaries++;
-						
-						// Convert the upstream streamflow direction to a vector
-						stream2_Vec[0]	= Get_xTo( stream2_Dir );
-						stream2_Vec[1]	= Get_yTo( stream2_Dir );
-						stream2_Vec[2]	= 0.0;
-						
-						//Calculate only z-component of the vector-cross-product
-						Zcp_b			= FL_Vec[0]*stream2_Vec[1] - FL_Vec[1]*stream2_Vec[0];
-						
-						//store the previous position of the flow line
-						prev_right		= right;
-						prev_left		= left;
-
-						// Test if Z components have the same sign
-						// Note that posing the condition "( Zcp_a * Zcp_b >= 0 && Zcp_b != 0)"
-						// and evaluating the sign of *only* Zcp_b
-						// is *equivalent* but presumably a tiny bit more efficient
-						// than  testing "( Zcp_a * Zcp_b > 0)"
-						// and evaluating the sign of Zcp_a *or* Zcp_b
-						// If you prefer to follow exactly the description in the WRR-article, simply
-						// replace "( Zcp_a * Zcp_b >= 0 && Zcp_b != 0)" by "(Zcp_a * Zcp_b > 0)"
-						// and it'll still work.
-						if ( Zcp_a * Zcp_b >= 0 && Zcp_b != 0)
-						{
-							//Case1: Zcp_a and Zcp_b have the same sign, thus the position of the flow  
-							//line is the same for both stream grid cells
-							//Case2: Zcp_a is zero but Zcp_b is not zero, the position of the flow line
-							//can simply be determined from the sign of Zcp_b
-							right = (Zcp_b < 0);
-							left  = !right;
-						}
-						else
-						{
-							//Since Zcp_a and Zcp_b have opposite signs (or Zcp_b is zero), the flow line
-							//is located at a sharp bend. 
-
-							//Calculate only z-component of the vector-cross-product
-							Zcp_c	= stream1_Vec[0]*stream2_Vec[1] - stream1_Vec[1]*stream2_Vec[0];
-							
-
-							right = (Zcp_c < 0);
-							left  = !right;
-						}													
-						if ( NTributaries > 1 && (right != prev_right) )
-						{
-							//It is a junction (NTributaries > 1) and the flow line lies between
-							//two tributaries
-							left = right = true;
-							//Set i to 9 in order to exit the loop (there is no use in checking
-							//for more potential tributaries since the flow line will always lie 
-							//between two tributaries
-							i = 9;
-						}
-					}
-				}
-			}		
-		}
-	}	
-}
-
-
-//---------------------------------------------------------
-void CFlow::Add_Fraction(int x, int y, int Direction, double Fraction)
-{
-	int		ix, iy;
-
-	if( is_InGrid(x, y) )
-	{
-		ix	= Get_xTo(Direction, x);
-		iy	= Get_yTo(Direction, y);
-		
-		if( is_InGrid(ix, iy) )
-		{
-			if( pCatch )
-			{
-				pCatch			->Add_Value(ix, iy, Fraction * pCatch			->asDouble(x, y));
-			}
-
-			if( pCatch_Height )
-			{
-				pCatch_Height	->Add_Value(ix, iy, Fraction * pCatch_Height	->asDouble(x, y));
-			}
-
-			if( pCatch_Slope )
-			{
-				pCatch_Slope	->Add_Value(ix, iy, Fraction * pCatch_Slope		->asDouble(x, y));
-			}
-
-			if( pFlowPath )
-			{
-				pFlowPath		->Add_Value(ix, iy, Fraction * (pFlowPath		->asDouble(x, y) + Get_Length(Direction)));
-			}
-
-			if( pCatch_Aspect && pCatch_AspectY )
-			{
-				pCatch_Aspect	->Add_Value(ix, iy, Fraction * pCatch_Aspect	->asDouble(x, y));
-				pCatch_AspectY	->Add_Value(ix, iy, Fraction * pCatch_AspectY	->asDouble(x, y));
-			}
-			
-			if( !pTarget )
-			{
-				if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, Fraction * pAccu_Tot ->asDouble(x, y));
-				if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, Fraction * pAccu_Left ->asDouble(x, y));
-				if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, Fraction * pAccu_Right ->asDouble(x, y));				
-			}
-			
-			if( pTarget ) if( pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y) )
-			{
-				if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, Fraction * pAccu_Tot ->asDouble(x, y));
-				if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, Fraction * pAccu_Left ->asDouble(x, y));
-				if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, Fraction * pAccu_Right ->asDouble(x, y));				
-			}
-			
-
-			if( pTarget ) if( !pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y))
-			{
-				
-				bool left, right;
-
-				Find_Sides(x, y, Direction, left, right);
-			
-				if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, Fraction * pAccu_Tot ->asDouble(x, y));
-				
-				if( right && !left && pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, Fraction * pAccu_Right ->asDouble(x, y));
-				
-				if( left && !right && pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, Fraction * pAccu_Left ->asDouble(x, y));
-				
-				if( left && right )
-				{
-					if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, 0.5 * Fraction * pAccu_Right ->asDouble(x, y));
-
-					if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, 0.5 * Fraction * pAccu_Left ->asDouble(x, y));			
-				}				
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFlow::Add_Portion(int x, int y, int ix, int iy, int Direction)
-{
-	if( is_InGrid(x, y) && is_InGrid(ix, iy) )
-	{
-		
-		if( pCatch )
-		{
-			pCatch			->Add_Value(ix, iy, pCatch			->asDouble(x, y));
-		}
-
-		if( pCatch_Height )
-		{
-			pCatch_Height	->Add_Value(ix, iy, pCatch_Height	->asDouble(x, y));
-		}
-
-		if( pCatch_Slope )
-		{
-			pCatch_Slope	->Add_Value(ix, iy, pCatch_Slope	->asDouble(x, y));
-		}
-
-		if( pFlowPath )
-		{
-			pFlowPath		->Add_Value(ix, iy, pFlowPath		->asDouble(x, y));
-		}
-
-		if( pCatch_Aspect && pCatch_AspectY )
-		{
-			pCatch_Aspect	->Add_Value(ix, iy, pCatch_Aspect	->asDouble(x, y));
-			pCatch_AspectY	->Add_Value(ix, iy, pCatch_AspectY	->asDouble(x, y));
-		}
-		
-		if( pTarget ) if( pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y) )
-		{
-			if( pAccu_Tot ) pAccu_Tot -> Add_Value(ix, iy, pAccu_Tot ->asDouble(x, y));
-			if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, pAccu_Left ->asDouble(x, y));
-			if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, pAccu_Right ->asDouble(x, y));				
-		}
-		if( pTarget ) if( !pTarget->is_NoData(ix, iy) && pTarget->is_NoData(x, y))
-			{
-				
-				bool left, right;
-
-				Find_Sides(x, y, Direction, left, right);
-					
-				if( pAccu_Tot )pAccu_Tot -> Add_Value(ix, iy, pAccu_Tot->asDouble(x, y));
-				
-				if( right && !left && pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, pAccu_Right->asDouble(x, y));
-				
-				if( left && !right && pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, pAccu_Left->asDouble(x, y));
-				
-				if( left && right )
-				{
-					if( pAccu_Right ) pAccu_Right -> Add_Value(ix, iy, 0.5 * pAccu_Right->asDouble(x, y));
-					if( pAccu_Left ) pAccu_Left -> Add_Value(ix, iy, 0.5 * pAccu_Left->asDouble(x, y));			
-				}
-				
-			}		
-		
-	}
-}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.cpp
deleted file mode 100644
index 56acd1e..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-/**********************************************************
- * Version $Id: FlowDepth.cpp 1016 2011-04-27 18:40:36Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    FlowDepth.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "FlowDepth.h"
-#include "Helper.h"
-
-#define NO_DEPTH -1
-
-CFlowDepth::CFlowDepth(void){
-
-	Parameters.Set_Name(_TL("Flow Depth"));
-	Parameters.Set_Description(_TW(
-		"(c) 2004 by Victor Olaya. Flow Depth Calculation \r\n"
-		"References:\r\n 1. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"));
-
-	Parameters.Add_Grid(NULL, 
-						"DEM", 
-						_TL("Elevation Grid"), 
-						_TL(""), 
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL, 
-						"FLOWDEPTH", 
-						_TL("Flow Depth Grid (m)"), 
-						_TL(""), 
-						PARAMETER_OUTPUT, 
-						true, 
-						SG_DATATYPE_Float);
-
-	Parameters.Add_Value(NULL,
-						"THRESHOLD",
-						_TL("Channel definition threshold"),
-						_TL("Channel definition threshold"),
-						PARAMETER_TYPE_Double,
-						10000.);
-
-	Parameters.Add_Value(NULL,
-						"FLOW",
-						_TL("Peak Flow (m3/s)"),
-						_TL("Peak Flow (m3/s) at selected outlet cell"),
-						PARAMETER_TYPE_Double,
-						100.);
-
-}//constructor
-
-
-CFlowDepth::~CFlowDepth(void){
-}
-
-bool CFlowDepth::On_Execute(void){
-		
-	m_pDEM			= Parameters("DEM")			->asGrid(); 
-	m_pFlowDepth	= Parameters("FLOWDEPTH")	->asGrid();
-	m_dThreshold	= Parameters("THRESHOLD")	->asDouble();
-	m_dFlow			= Parameters("FLOW")		->asDouble();
-
-	m_pCatchArea	= SG_Create_Grid(m_pDEM, SG_DATATYPE_Float);
-	m_pBasinGrid	= SG_Create_Grid(m_pDEM, SG_DATATYPE_Int);
-	m_pSlope		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Float);
-	m_pAspect		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Float);
-
-	m_pFlowDepth->Set_NoData_Value(0.);
-
-	Process_Set_Text(_TL("Calculating Catchment Area..."));
-	CalculateFlowAccGrid(m_pCatchArea, m_pDEM);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{		
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	slope, aspect;
-
-			if( m_pDEM->Get_Gradient(x, y, slope, aspect) )
-			{
-				m_pSlope	->Set_Value(x, y, slope);
-				m_pAspect	->Set_Value(x, y, aspect);
-			}
-			else
-			{
-				m_pSlope	->Set_NoData(x, y);
-				m_pAspect	->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	DataObject_Update(m_pFlowDepth, true);
-
-	return true;
-
-}//method
-
-bool CFlowDepth::On_Execute_Finish(){
-
-	delete m_pSlope;
-	delete m_pAspect;
-	delete m_pBasinGrid;
-	delete m_pCatchArea;
-
-	return true;
-
-}//method
-
-bool CFlowDepth::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode){	
-
-	int iX, iY;	
-	int iNextX, iNextY;
-	int x,y;
-	int iOutletX, iOutletY;
-	double fArea;
-	double fDepth, fPreviousDepth = 0;
-
-	if(	Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iOutletX, iOutletY) )
-	{
-		return( false );
-	}
-
-	m_pFlowDepth->Assign((double)0);
-
-	fArea = m_pCatchArea->asFloat(iOutletX, iOutletY);
-	
-	if (fArea < m_dThreshold * 2.){ //check outlet point
-		iNextX = iOutletX;
-		iNextY = iOutletY;
-		do{
-			iOutletX = iNextX;
-			iOutletY = iNextY;
-			getNextCell(m_pDEM, iOutletX, iOutletY, iNextX, iNextY);
-		}while (m_pCatchArea->asFloat(iOutletX, iOutletY) < m_dThreshold * 2. &&
-				(iOutletX != iNextX || iOutletY != iNextY));
-			
-		if (m_pCatchArea->asFloat(iOutletX, iOutletY) < m_dThreshold * 2.){
-			Message_Add(_TL("** Error : Wrong outlet point selected **"));
-			return false;
-		}//if
-		Message_Add(_TL("** Warning : Outlet point was modified **"));
-    }//if
-
-	CalculateBasinGrid(m_pBasinGrid, m_pDEM, iOutletX, iOutletY);
-
-	m_fMaxFlowAcc = m_pCatchArea->asFloat(iOutletX, iOutletY);		
-    
-    for(y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(x=0; x<Get_NX(); x++){
-			if (m_pCatchArea->asFloat(x,y) > m_dThreshold){
-				if (isHeader(x,y)){					
-					iNextX = x;
-					iNextY = y;
-					do {
-						iX = iNextX;
-						iY = iNextY;
-						if (m_pFlowDepth->asFloat(iX,iY) == 0. && m_pBasinGrid->asInt(iX, iY) != 0){
-							getNextCell(m_pDEM, iX, iY, iNextX, iNextY);
-							fDepth = CalculateFlowDepth(iX,iY);
-							if (fDepth == NO_DEPTH){
-								m_pFlowDepth->Set_Value(iX,iY, fPreviousDepth);
-							}//if
-							else{
-								fPreviousDepth = fDepth;
-							}//else
-						}//if
-					}while ((iX != iOutletX || iY != iOutletY)
-							&& (iX != iNextX || iY != iNextY));
-				}//if
-			}//if
-		}//for
-	}// for
-
-	DataObject_Update(m_pFlowDepth);
-
-	return true;
-
-}//method
-
-bool CFlowDepth::isHeader(int iX, int iY){
-
-    int iNextX, iNextY;
-	
-    for (int i = -1; i < 2; i++) {
-        for (int j = -1; j < 2; j++) {
-			if (m_pCatchArea->is_InGrid(iX+i,iY+j)){
-				if (m_pCatchArea->asFloat(iX+i,iY+j) > m_dThreshold && (i!=0 || j!=0)){
-					getNextCell(m_pDEM, iX + i, iY + j, iNextX, iNextY);
-					if (iNextX == iX && iNextY == iY) {
-						return false;
-					}//if
-				}// if
-			}//if
-        }// for
-    }// for
-
-    return true;
-		
-}// method
-
-double CFlowDepth::CalculateFlowDepth(int iX, int iY){
-
-	int iIter=0;
-	double fSup, fInf;
-	double fH;
-	double fDif;
-	double fArea;
-	double fPerim;
-	double fFlow = m_dFlow / m_fMaxFlowAcc * m_pCatchArea->asFloat(iX,iY);
-	double fSlope = tan(m_pSlope->asFloat(iX,iY));
-	bool bReturn = false;
-		
-	fSup = 100;
-	fInf = 0;
-	fH = 1;
-	
-	while (!bReturn  && fH >= 0.00001){
-		bReturn = getWetAreaAndPerimeter(iX, iY, fH, fArea, fPerim);
-		fH /= 2.0;
-	}		
-	
-	if (bReturn){
-		fDif = (sqrt(fSlope) * pow(fArea, 5.0 / 3.0)
-				/ pow(fPerim, 2.0 / 3.0) / 0.035) - fFlow;
-		do {
-			iIter++;
-			if (fDif > 0) {
-				fSup = fH;
-				fH = (fInf + fH) / 2.0;
-			}// if
-			else if (fDif < 0) {
-				fInf = fH;
-				fH = (fSup + fH) / 2.0;
-			}// else if
-			bReturn = getWetAreaAndPerimeter(iX, iY, fH, fArea, fPerim);		
-			if (!bReturn){
-				return NO_DEPTH;
-			}//if
-			if (iIter>20){
-				return NO_DEPTH;
-			}//if
-			fDif = (sqrt(fSlope) * pow(fArea, 5.0 / 3.0)
-				/ pow(fPerim, 2.0 / 3.0) / 0.035) - fFlow;
-		}while (fabs(fDif) > 0.1); 
-	}//if
-	else{
-		return NO_DEPTH;
-	}//else
-	
-	m_pFlowDepth->Set_Value(iX,iY,fH);
-
-	return fH;
-
-}//method
-
-bool CFlowDepth::getWetAreaAndPerimeter(int iX, 
-									 int iY, 
-									 double fH, 
-									 double &fArea, 
-									 double &fPerim){
-
-	int iWidth = 0;
-	int iX2, iY2;
-	int iX3, iY3;
-	int i = 0;	
-	int iStepX, iStepY;
-	int pStepX[4] = {1,1,0,1};
-	int pStepY[4] = {0,-1,1,1};
-	int iDir = (m_pAspect->asInt(iX, iY,true) / 45) % 4;
-	double fDist;
-	double fLocalDist;
-	double fBaseHeight = m_pDEM->asFloat(iX, iY);	
-	double fPerimLeft = 0;
-	double fAreaLeft = 0;
-	double fPerimRight = 0;
-	double fAreaRight = 0;
-	double fHeightDif;
-	double fLocalHeightDif;
-	
-	iStepY = pStepX[iDir]; 
-	iStepX = pStepY[iDir]; 
-	
-	fDist = M_GET_LENGTH(iStepX, iStepY) * m_pDEM->Get_Cellsize();
-	
-	do{
-		iX2 = iX + iStepX * i;
-		iY2 = iY + iStepY * i;
-		iX3 = iX + iStepX * (i+1);
-		iY3 = iY + iStepY * (i+1);	
-		if (m_pDEM->is_InGrid(iX2,iY2) && m_pDEM->is_InGrid(iX3,iY3)){
-			fHeightDif = m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX,iY);
-			if (fHeightDif >= fH){
-				fLocalHeightDif = fabs(m_pDEM->asFloat(iX,iY) + fH - m_pDEM->asFloat(iX2,iY2));
-				fLocalDist = fabs(fDist * fLocalHeightDif 
-							/ (m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2)));
-			}//if
-			else{
-				fLocalHeightDif = fabs(m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2));
-				fLocalDist = fDist;
-			}//else
-			fPerimLeft += sqrt(fLocalDist * fLocalDist + fLocalHeightDif * fLocalHeightDif);
-			fAreaLeft += (i * fLocalHeightDif + fLocalHeightDif * fLocalDist / 2.);
-		}//if
-		else{
-			return false;
-		}//else
-		i++;
-	}while(fHeightDif < fH);
-	
-	i = 0;
-	do{
-		iX2 = iX - iStepX * i;
-		iY2 = iY - iStepY * i;
-		iX3 = iX - iStepX * (i+1);
-		iY3 = iY - iStepY * (i+1);	
-		if (m_pDEM->is_InGrid(iX2,iY2) && m_pDEM->is_InGrid(iX3,iY3)){
-			fHeightDif = m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX,iY);
-			if (fHeightDif >= fH){
-				fLocalHeightDif = fabs(m_pDEM->asFloat(iX,iY) + fH - m_pDEM->asFloat(iX2,iY2));
-				fLocalDist = fabs(fDist * fLocalHeightDif 
-							/ (m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2)));
-			}//if
-			else{
-				fLocalHeightDif = fabs(m_pDEM->asFloat(iX3,iY3) - m_pDEM->asFloat(iX2,iY2));
-				fLocalDist = fDist;
-			}//else
-			fPerimLeft += sqrt(fLocalDist * fLocalDist + fLocalHeightDif * fLocalHeightDif);
-			fAreaLeft += (i * fLocalHeightDif + fLocalHeightDif * fLocalDist / 2.);
-		}//if
-		else{
-			return false;
-		}//else
-		i++;
-	}while(fHeightDif < fH);
-	
-	fArea = fAreaLeft + fAreaRight;
-	fPerim = fPerimLeft +fPerimRight; 
-
-	return true;
-
-}//method
-
-
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h
deleted file mode 100644
index d816651..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**********************************************************
- * Version $Id: FlowDepth.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    IsochronesConst.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CFlowDepth : public CSG_Module_Grid_Interactive
-{
-public:
-	CFlowDepth(void);
-	virtual ~CFlowDepth(void);	
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
-
-	bool isHeader(int,int);
-	double CalculateFlowDepth(int,int);
-	//void MarkBuffer(int,int,double);
-	bool getWetAreaAndPerimeter(int,int,double,double&,double&);
-
-
-protected:
-	virtual bool On_Execute(void);
-	virtual bool On_Execute_Finish();
-	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
-
-
-private:
-	CSG_Grid *m_pDEM;
-	CSG_Grid *m_pFlowDepth;
-	CSG_Grid *m_pCatchArea;	
-	CSG_Grid *m_pSlope;
-	CSG_Grid *m_pAspect;
-	CSG_Grid *m_pBasinGrid;
-	double m_fMaxFlowAcc;
-	double m_dThreshold;
-	double m_dFlow;
-
-};
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp
deleted file mode 100644
index 6f145a2..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp
+++ /dev/null
@@ -1,602 +0,0 @@
-/**********************************************************
- * Version $Id: Flow_AreaUpslope.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 Flow_AreaUpslope.cpp                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow_AreaUpslope.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_AreaUpslope::CFlow_AreaUpslope(void)
-{
-	m_pDTM		= NULL;
-	m_pRoute	= NULL;
-	m_pFlow		= NULL;
-}
-
-//---------------------------------------------------------
-CFlow_AreaUpslope::~CFlow_AreaUpslope(void)
-{
-	Finalise();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CFlow_AreaUpslope::Get_Description(void)
-{
-	return(
-		_TW(
-			"This module allows you to specify target cells, "
-			"for which the upslope contributing area shall be identified. "
-			"The result will give "
-			"for each cell the percentage of its flow that reaches the target cell(s).\n\n"
-
-			"References:\n\n"
-
-			"Deterministic 8\n"
-			"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
-			"    'The extraction of drainage networks from digital elevation data',\n"
-			"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
-
-			"Deterministic Infinity:\n"
-			"- Tarboton, D.G. (1997):\n"
-			"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
-			"    Water Resources Research, Vol.33, No.2, p.309-319\n\n"
-
-			"Multiple Flow Direction:\n"
-			"- Freeman, G.T. (1991):\n"
-			"    'Calculating catchment area with divergent flow based on a regular grid',\n"
-			"    Computers and Geosciences, 17:413-22\n\n"
-
-			"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
-			"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
-			"    Hydrological Processes, 5:59-79\n\n"
-		)
-	);
-}
-
-//---------------------------------------------------------
-CSG_String CFlow_AreaUpslope::Get_Methods(void)
-{
-	return( CSG_String::Format(SG_T("%s|%s|%s|"),
-		_TL("Deterministic 8"),
-		_TL("Deterministic Infinity"),
-		_TL("Multiple Flow Direction")
-	));
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope::Initialise(int Method, CSG_Grid *pDTM, CSG_Grid *pRoute, CSG_Grid *pFlow, double MFD_Converge)
-{
-	Finalise();
-
-	if( pDTM && pDTM->is_Valid() && pFlow && pFlow->is_Valid() && pFlow->Get_System() == pDTM->Get_System() )
-	{
-		m_Method		= Method;
-		m_pDTM			= pDTM;
-		m_pFlow			= pFlow;
-		m_MFD_Converge	= MFD_Converge;
-
-		if( pRoute && pRoute->is_Valid() && pRoute->Get_System() == pDTM->Get_System() )
-		{
-			m_pRoute	= pRoute;
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope::Finalise(void)
-{
-	m_pDTM		= NULL;
-	m_pRoute	= NULL;
-	m_pFlow		= NULL;
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope::Add_Target(int x, int y)
-{
-	if( m_pFlow && m_pFlow->is_InGrid(x, y, false) )
-	{
-		m_pFlow->Set_Value(x, y, 100.0);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope::Clr_Target(void)
-{
-	if( m_pFlow )
-	{
-		m_pFlow->Assign(0.0);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope::Get_Area(int x, int y)
-{
-	return( Clr_Target() && Add_Target(x, y) && Get_Area() );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope::Get_Area(void)
-{
-	long	i;
-	int		x, y;
-
-	if( m_pDTM && m_pFlow )
-	{
-		for(i=0; i<m_pDTM->Get_NCells() && SG_UI_Process_Set_Progress(i, m_pDTM->Get_NCells()); i++)
-		{
-			m_pDTM->Get_Sorted(i, x, y, false, false);
-
-			if( m_pFlow->asDouble(x, y) > 0.0 )
-			{
-				break;
-			}
-		}
-
-		for(i++; i<m_pDTM->Get_NCells() && SG_UI_Process_Set_Progress(i, m_pDTM->Get_NCells()); i++)
-		{
-			m_pDTM->Get_Sorted(i, x, y, false, false);
-
-			Set_Value(x, y);
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_AreaUpslope::Set_Value(int x, int y)
-{
-	int		i;
-
-	if( m_pRoute && (i = m_pRoute->asChar(x, y)) >= 0 )
-	{
-		int		ix, iy;
-		double	Flow;
-
-		ix	= m_pDTM->Get_System().Get_xTo(i, x);
-		iy	= m_pDTM->Get_System().Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy, true) && (Flow = m_pFlow->asDouble(ix, iy)) > 0.0 )
-		{
-			m_pFlow->Set_Value(x, y, Flow);
-		}
-	}
-	else if( !m_pDTM->is_NoData(x, y) )
-	{
-		switch( m_Method )
-		{
-		case 0:	Set_D8		(x, y);	break;
-		case 1:	Set_DInf	(x, y);	break;
-		case 2:	Set_MFD		(x, y);	break;
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_AreaUpslope::Set_D8(int x, int y)
-{
-	int		i;
-
-	if( (i = m_pDTM->Get_Gradient_NeighborDir(x, y, true)) >= 0 )
-	{
-		int		ix, iy;
-		double	Flow;
-
-		ix	= m_pDTM->Get_System().Get_xTo(i, x);
-		iy	= m_pDTM->Get_System().Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy, true) && (Flow = m_pFlow->asDouble(ix, iy)) > 0.0 )
-		{
-			m_pFlow->Set_Value(x, y, Flow);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_AreaUpslope::Set_DInf(int x, int y)
-{
-	double	Slope, Aspect;
-
-	if( m_pDTM->Get_Gradient(x, y, Slope, Aspect) )	// && Aspect >= 0.0 )
-	{
-		int		i, ix, iy, jx, jy;
-		double	Flow;
-
-		i		= (int)(Aspect / M_PI_045);
-		ix		= m_pDTM->Get_System().Get_xTo(i, x);
-		iy		= m_pDTM->Get_System().Get_yTo(i, y);
-
-		i++;
-		jx		= m_pDTM->Get_System().Get_xTo(i, x);
-		jy		= m_pDTM->Get_System().Get_yTo(i, y);
-
-		if(	m_pDTM->is_InGrid(ix, iy) && m_pDTM->asDouble(ix, iy) < m_pDTM->asDouble(x, y)
-		&&	m_pDTM->is_InGrid(jx, jy) && m_pDTM->asDouble(jx, jy) < m_pDTM->asDouble(x, y) )
-		{
-			Aspect	= fmod(Aspect,  M_PI_045) / M_PI_045;
-
-			Flow	= m_pFlow->asDouble(ix, iy) * (1.0 - Aspect)
-					+ m_pFlow->asDouble(jx, jy) * (      Aspect);
-
-			if( Flow > 0.0 )
-			{
-				m_pFlow->Set_Value(x, y, Flow);
-			}
-
-			return;
-		}
-	}
-
-	Set_D8(x, y);
-}
-
-//---------------------------------------------------------
-void CFlow_AreaUpslope::Set_MFD(int x, int y)
-{
-	int		i, ix, iy;
-	double	z, d, f, dzSum, dz[8];
-
-	for(i=0, dzSum=0.0, z=m_pDTM->asDouble(x, y); i<8; i++)
-	{
-		dz[i]	= 0.0;
-
-		ix		= m_pDTM->Get_System().Get_xTo(i, x);
-		iy		= m_pDTM->Get_System().Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy) && (d = z - m_pDTM->asDouble(ix, iy)) > 0.0 )
-		{
-			dzSum	+= (d = pow(d / m_pDTM->Get_System().Get_Length(i), m_MFD_Converge));
-
-			if( (f = m_pFlow->asDouble(ix, iy)) > 0.0 )
-			{
-				dz[i]	= d * f;
-			}
-		}
-	}
-
-	if( dzSum > 0.0 )
-	{
-		for(i=0, d=0.0; i<8; i++)
-		{
-			if( dz[i] > 0.0 )
-			{
-				d	+= dz[i] / dzSum;
-			}
-		}
-
-		m_pFlow->Set_Value(x, y, d);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_AreaUpslope_Interactive::CFlow_AreaUpslope_Interactive(void)
-{
-	Set_Name		(_TL("Upslope Area"));
-	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
-
-	Set_Description	(CSG_String::Format(SG_T("%s_______\n%s"), m_Calculator.Get_Description().c_str(),
-		_TL("Interactive version (left mouse clicks will trigger the calculation for the selected cell).")
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SINKROUTE"	, _TL("Sink Routes"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "AREA"		, _TL("Upslope Area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		m_Calculator.Get_Methods(), 2
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CONVERGE"	, _TL("Convergence"),
-		_TL("Convergence factor for Multiple Flow Direction algorithm"),
-		PARAMETER_TYPE_Double	, 1.1, 0.001, true
-	);
-}
-
-//---------------------------------------------------------
-CFlow_AreaUpslope_Interactive::~CFlow_AreaUpslope_Interactive(void)
-{}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope_Interactive::On_Execute(void)
-{
-	if( m_Calculator.Initialise(
-		Parameters("METHOD")	->asInt(),
-		Parameters("ELEVATION")	->asGrid(),
-		Parameters("SINKROUTE")	->asGrid(),
-		Parameters("AREA")		->asGrid(),
-		Parameters("CONVERGE")	->asDouble()	) )
-	{
-		DataObject_Set_Colors(Parameters("AREA")->asGrid(), 100, SG_COLORS_WHITE_BLUE);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope_Interactive::On_Execute_Finish(void)
-{
-	return( m_Calculator.Finalise() );
-}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
-{
-	if(	Mode == MODULE_INTERACTIVE_LDOWN && m_Calculator.Get_Area(Get_xGrid(), Get_yGrid()) )
-	{
-		DataObject_Update(Parameters("AREA")->asGrid(), 0.0, 100.0, true);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_AreaUpslope_Area::CFlow_AreaUpslope_Area(void)
-{
-	Set_Name		(_TL("Upslope Area"));
-	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
-
-	Set_Description	(CSG_String::Format(SG_T("%s_______\n\n%s"), m_Calculator.Get_Description().c_str(),
-		_TW("This version uses all valid cells (not \'no data\' values) of a given target grid to determine the contributing area. "
-			"In case no target grid is provided as input, the specified x/y coordinates are used as target point.")
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "TARGET"		, _TL("Target Area"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL	, "TARGET_PT_X"	, _TL("Target X coordinate"),
-		_TL("The x-coordinate of the target point in world coordinates [map units]"),
-		PARAMETER_TYPE_Double, 0.0
-	);
-
-	Parameters.Add_Value(
-		NULL	, "TARGET_PT_Y"	, _TL("Target Y coordinate"),
-		_TL("The y-coordinate of the target point in world coordinates [map units]"),
-		PARAMETER_TYPE_Double, 0.0
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SINKROUTE"	, _TL("Sink Routes"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "AREA"		, _TL("Upslope Area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		m_Calculator.Get_Methods(), 2
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CONVERGE"	, _TL("Convergence"),
-		_TL("Convergence factor for Multiple Flow Direction algorithm"),
-		PARAMETER_TYPE_Double	, 1.1, 0.001, true
-	);
-}
-
-//---------------------------------------------------------
-CFlow_AreaUpslope_Area::~CFlow_AreaUpslope_Area(void)
-{}
-
-//---------------------------------------------------------
-bool CFlow_AreaUpslope_Area::On_Execute(void)
-{
-	bool	bResult	= false;
-
-	//-----------------------------------------------------
-	if( m_Calculator.Initialise(
-		Parameters("METHOD")	->asInt(),
-		Parameters("ELEVATION")	->asGrid(),
-		Parameters("SINKROUTE")	->asGrid(),
-		Parameters("AREA")		->asGrid(),
-		Parameters("CONVERGE")	->asDouble()	) )
-	{
-		if( m_Calculator.Clr_Target() )
-		{
-			int		x, y;
-			CSG_Grid	*pTarget	= Parameters("TARGET")->asGrid();
-
-			if( pTarget != NULL )
-			{
-				for(y=0; y<Get_NY() && Set_Progress(y); y++)
-				{
-					for(x=0; x<Get_NX(); x++)
-					{
-						if( !pTarget->is_NoData(x, y) && m_Calculator.Add_Target(x, y) )
-						{
-							bResult	= true;
-						}
-					}
-				}
-			}
-			else
-			{
-				Parameters("ELEVATION")->asGrid()->Get_System().Get_World_to_Grid(x, y, Parameters("TARGET_PT_X")->asDouble(), Parameters("TARGET_PT_Y")->asDouble());
-
-				if( m_Calculator.Add_Target(x, y) )
-				{
-					bResult	= true;
-				}
-				else
-				{
-					SG_UI_Msg_Add_Error(_TL("Coordinates of target point outside of DEM!"));
-				}
-			}
-
-			if( bResult )
-			{
-				m_Calculator.Get_Area();
-
-				DataObject_Set_Colors(Parameters("AREA")->asGrid(), 100, SG_COLORS_WHITE_BLUE);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Calculator.Finalise();
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.cpp
deleted file mode 100644
index d7ab67c..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/**********************************************************
- * Version $Id: Flow_Distance.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Flow_Distance.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:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow_Distance.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_Distance::CFlow_Distance(void)
-{
-	//-----------------------------------------------------
-	Set_Name(_TL("Flow Path Length"));
-
-	Set_Author		(SG_T("(c) 2005 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"This module calculates the average flow path length starting from the seeds, "
-		"that are given by the optional \'Seeds\' grid and optionally from cells without upslope contributing areas "
-		"(i.e. summits, ridges). Seeds will be all grid cells, that "
-		"are not \'no data\' values. If seeds are not given, only summits and ridges as given by the flow routing will be taken into account. "
-		"Available flow routing methods are based on the "
-		"\'Deterministic 8 (D8)\' (Callaghan and Mark 1984) and the \'Multiple Flow Direction (FD8)\' "
-		"(Freeman 1991, Quinn et al. 1991) algorithms.\n\n"
-
-		"References:\n\n"
-
-		"Deterministic 8\n"
-		"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
-		"    'The extraction of drainage networks from digital elevation data',\n"
-		"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
-
-		"- Freeman, G.T. (1991):\n"
-		"    'Calculating catchment area with divergent flow based on a regular grid',\n"
-		"    Computers and Geosciences, 17:413-22\n\n"
-
-		"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
-		"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
-		"    Hydrological Processes, 5:59-79\n\n")
-	);
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SEED"		, _TL("Seeds"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL	, "LENGTH"		, _TL("Flow Path Length"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL	, "SEEDS_ONLY"	, _TL("Seeds Only"),
-		_TL("Use only seed cells as starting points."),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Flow Routing Algorithm"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("Deterministic 8 (D8)"),
-			_TL("Multiple Flow Direction (FD8)")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CONVERGENCE"	, _TL("Convergence (FD8)"),
-		_TL("Convergence factor for the \'Multiple Flow Direction\' algorithm (after Freeman 1991)"),
-		PARAMETER_TYPE_Double	, 1.1, 0.0, true
-	);
-}
-
-//---------------------------------------------------------
-CFlow_Distance::~CFlow_Distance(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFlow_Distance::On_Execute(void)
-{
-	bool		bSeeds;
-	int			x, y, Method;
-	CSG_Grid	*pSeed;
-
-	//-------------------------------------------------
-	m_pDTM		= Parameters("ELEVATION")	->asGrid();
-	pSeed		= Parameters("SEED")		->asGrid();
-	m_pLength	= Parameters("LENGTH")		->asGrid();
-
-	m_Converge	= Parameters("CONVERGENCE")	->asDouble();
-	bSeeds		= Parameters("SEEDS_ONLY")	->asBool();
-	Method		= Parameters("METHOD")		->asInt();
-
-	m_pWeight	= SG_Create_Grid(m_pLength, SG_DATATYPE_Float);
-	m_pWeight	->Assign(0.0);
-	m_pLength	->Assign(0.0);
-
-	//-------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		m_pDTM->Get_Sorted(n, x, y, true, false);
-
-		if( pSeed && !pSeed->is_NoData(x, y) )
-		{
-			m_pLength->Set_Value(x, y, 0.0);
-			m_pWeight->Set_Value(x, y, 0.0);
-		}
-		else if( m_pWeight->asDouble(x, y) > 0.0 )
-		{
-			m_pLength->Set_Value(x, y, m_pLength->asDouble(x, y) / m_pWeight->asDouble(x, y));
-		}
-		else if( bSeeds )
-		{
-			m_pLength->Set_NoData(x, y);
-
-			continue;
-		}
-
-		switch( Method )
-		{
-		case 0:	Set_Length_D8	(x, y);	break;
-		case 1:	Set_Length_MFD	(x, y);	break;
-		}
-	}
-
-	//-------------------------------------------------
-	delete(m_pWeight);
-
-	DataObject_Set_Colors(m_pLength, 100, SG_COLORS_WHITE_BLUE);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Distance::Set_Length_D8(int x, int y)
-{
-	int		i, ix, iy;
-
-	if( m_pDTM->is_InGrid(x, y) && (i = m_pDTM->Get_Gradient_NeighborDir(x, y, true)) >= 0 )
-	{
-		ix	= Get_xTo(i, x);
-		iy	= Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy) )
-		{
-			m_pLength->Add_Value(ix, iy, m_pLength->asDouble(x, y) + Get_Length(i));
-			m_pWeight->Add_Value(ix, iy, 1.0);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_Distance::Set_Length_MFD(int x, int y)
-{
-	int		i, ix, iy;
-	double	z, d, dzSum, dz[8];
-
-	if( m_pDTM->is_InGrid(x, y) )
-	{
-		z		= m_pDTM->asDouble(x, y);
-		dzSum	= 0.0;
-
-		for(i=0; i<8; i++)
-		{
-			ix		= Get_xTo(i, x);
-			iy		= Get_yTo(i, y);
-
-			if( m_pDTM->is_InGrid(ix, iy) && (d = z - m_pDTM->asDouble(ix, iy)) > 0.0 )
-			{
-				dz[i]	= pow(d / Get_Length(i), m_Converge);
-				dzSum	+= dz[i];
-			}
-			else
-			{
-				dz[i]	= 0.0;
-			}
-		}
-
-		if( dzSum > 0.0 )
-		{
-			d	 = m_pLength->asDouble(x, y);
-
-			for(i=0; i<8; i++)
-			{
-				if( dz[i] > 0.0 )
-				{
-					ix		= Get_xTo(i, x);
-					iy		= Get_yTo(i, y);
-
-					dz[i]	/= dzSum;
-
-					m_pLength->Add_Value(ix, iy, dz[i] * (d + Get_Length(i)));
-					m_pWeight->Add_Value(ix, iy, dz[i]);
-				}
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp
deleted file mode 100644
index 78a959b..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp
+++ /dev/null
@@ -1,1175 +0,0 @@
-/**********************************************************
- * Version $Id: Flow_Parallel.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   Flow_Parallel.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow_Parallel.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_Parallel::CFlow_Parallel(void)
-{
-	Set_Name		(_TL("Catchment Area (Parallel)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001-2010, T.Grabs portions (c) 2010"));
-
-	Set_Description	(_TW(
-		"Parallel processing of cells for calculation of flow accumulation and related parameters. "
-		"This set of algorithms processes a DEM downwards from the highest to the lowest cell.\n\n"
-
-		"References:\n\n"
-
-		"Deterministic 8\n"
-		"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
-		"    'The extraction of drainage networks from digital elevation data',\n"
-		"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
-
-		"Rho 8:\n"
-		"- Fairfield, J. / Leymarie, P. (1991):\n"
-		"    'Drainage networks from grid digital elevation models',\n"
-		"    Water Resources Research, 27:709-717\n\n"
-
-		"Braunschweiger Reliefmodell:\n"
-		"- Bauer, J. / Rohdenburg, H. / Bork, H.-R. (1985):\n"
-		"    'Ein Digitales Reliefmodell als Vorraussetzung fuer ein deterministisches Modell der Wasser- und Stoff-Fluesse',\n"
-		"    Landschaftsgenese und Landschaftsoekologie, H.10, Parameteraufbereitung fuer deterministische Gebiets-Wassermodelle,\n"
-		"    Grundlagenarbeiten zu Analyse von Agrar-Oekosystemen, (Eds.: Bork, H.-R. / Rohdenburg, H.), p.1-15\n\n"
-
-		"Deterministic Infinity:\n"
-		"- Tarboton, D.G. (1997):\n"
-		"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
-		"    Water Resources Research, Vol.33, No.2, p.309-319\n\n"
-
-		"Multiple Flow Direction:\n"
-		"- Freeman, G.T. (1991):\n"
-		"    'Calculating catchment area with divergent flow based on a regular grid',\n"
-		"    Computers and Geosciences, 17:413-22\n\n"
-
-		"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
-		"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
-		"    Hydrological Processes, 5:59-79\n\n"
-		
-		"Triangular Multiple Flow Direction\n"
-		"- Seibert, J. / McGlynn, B. (2007):\n"
-		"    'A new triangular multiple flow direction algorithm for computing upslope areas from gridded digital elevation models',\n"
-		"    Water Resources Research, Vol. 43, W04501\n"
-		"    C++ Implementation into SAGA by Thomas Grabs, Copyrights (c) 2007\n"
-		"    Contact: thomas.grabs at natgeo.su.se, jan.seibert at natgeo.su.se \n"
-	));
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL	, "CASPECT"		, _TL("Catchment Aspect"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "FLWPATH"		, _TL("Flow Path Length"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-
-	//-----------------------------------------------------
-	// Method...
-
-	Parameters.Add_Choice(
-		NULL	, "Method"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-			_TL("Deterministic 8"),
-			_TL("Rho 8"),
-			_TL("Braunschweiger Reliefmodell"),
-			_TL("Deterministic Infinity"),
-			_TL("Multiple Flow Direction"),
-			_TL("Multiple Triangular Flow Directon")
-		), 4
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL	, "DOLINEAR"	, _TL("Linear Flow"),
-		_TL("Use D8 if catchment area becomes higher than specified threshold."),
-		PARAMETER_TYPE_Bool
-	);
-
-	Parameters.Add_Value(
-		NULL	, "LINEARTHRS"	, _TL("Linear Flow Threshold"),
-		_TL("Use D8 if catchment area becomes higher than specified threshold (Cells)."),
-		PARAMETER_TYPE_Double	,	500
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "LINEARTHRS_GRID"		, _TL("Linear Flow Threshold Grid"),
-		_TL("(optional) Linear Flow Threshold Grid"),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CHDIR_GRID"			, _TL("Channel Direction"),
-		_TW("(optional) Channel Direction Grid. Must contain direction values. "
-			"For all non-missing grid cells all flow will be routed to the prescribed direction."),
-		PARAMETER_INPUT_OPTIONAL
-	);
-	
-	Parameters.Add_Value(
-		NULL	, "CONVERGENCE"	, _TL("Convergence"),
-		_TL("Convergence factor for Multiple Flow Direction Algorithm (Freeman 1991).\nApplies also to the Multiple Triangular Flow Directon Algorithm."),
-		PARAMETER_TYPE_Double, 1.1, 0.0, true
-	);
-}
-
-//---------------------------------------------------------
-CFlow_Parallel::~CFlow_Parallel(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Parallel::On_Initialize(void)
-{
-	pCatch_Aspect	= Parameters("CASPECT")->asGrid();
-	pFlowPath		= Parameters("FLWPATH")->asGrid();
-
-	TH_LinearFlow	= Parameters("DOLINEAR")->asBool() && pDTM
-					? Parameters("LINEARTHRS")->asDouble() // (pDTM->Get_NX() * pDTM->Get_NY())
-					: -1.0;
-
-	pTH_LinearFlow  = Parameters("LINEARTHRS_GRID")		->asGrid();
-
-	pD8_Direction   = Parameters("CHDIR_GRID")		    ->asGrid();
-
-	MFD_Converge	= Parameters("CONVERGENCE")->asDouble();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFlow_Parallel::Calculate(void)
-{
-	int		x, y;
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y+=Step)
-	{
-		for(x=0; x<Get_NX(); x+=Step)
-		{
-			Init_Cell(x, y);
-		}
-	}
-
-	return( Set_Flow() );
-}
-
-//---------------------------------------------------------
-bool CFlow_Parallel::Calculate(int x, int y)
-{
-	Init_Cell(x, y);
-
-	return( Set_Flow() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFlow_Parallel::Set_Flow(void)
-{
-	int		x, y;
-
-
-	double  THRS = 0.0;
-	
-	int		DIR  = -1;
-	
-	//-----------------------------------------------------
-	if( !pDTM->Get_Sorted(0, x, y, true, false) )
-	{
-		return( false );
-	}
-
-
-	//-----------------------------------------------------
-	int Method	= Parameters("Method")->asInt();
-
-	if( Method == 2 )
-	{
-		BRM_Init();
-	}
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		pDTM->Get_Sorted(n,x,y);
-
-		//if( !(n%(4*Get_NX())) )DataObject_Update(pFlow);
-
-		if( pTH_LinearFlow && TH_LinearFlow > 0.0)
-		{
-			if( pTH_LinearFlow->is_NoData(x, y) )
-			{
-				THRS = 0.0;
-			}
-			else
-			{
-				THRS = pTH_LinearFlow->asDouble(x, y);
-			}
-		}
-		else
-		{
-			THRS = pCatch->asDouble(x, y);
-		}
-
-		if( pD8_Direction )
-		{
-			if( pD8_Direction->is_NoData(x, y) )
-			{
-				DIR = -1;
-			}
-			else
-			{
-				DIR = pD8_Direction->asInt(x, y);
-			}
-		}
-
-		if( TH_LinearFlow > 0.0 && THRS >= TH_LinearFlow || DIR > 0)
-		{
-			Set_D8(x, y, DIR);
-		}
-		else
-		{
-			switch( Method )
-			{
-			case 0:
-				Set_D8(x, y);
-				break;
-
-			case 1:
-				Set_Rho8(x, y);
-				break;
-
-			case 3:
-				Set_DInf(x, y);
-				break;
-
-			case 4:
-				Set_MFD(x, y);
-				break;
-
-			case 5:
-				Set_MDInf(x, y);
-				break;				
-
-			case 2:
-				Set_BRM(x, y);
-				break;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( pRoute )
-	{
-		for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-		{
-			pDTM->Get_Sorted(n, x, y, false);
-
-			Check_Route(x, y);
-		}
-	}
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-void CFlow_Parallel::Check_Route(int x, int y)
-{
-	bool	bSink;
-	int		i, ix, iy;
-	double	z;
-
-	if( pRoute->asChar(x, y) > 0 )
-	{
-		z	= pDTM->asDouble(x, y);
-
-		for(i=0, bSink=true; i<8 && bSink; i++)
-		{
-			ix	= Get_xTo(i, x);
-			iy	= Get_yTo(i, y);
-
-			if( !is_InGrid(ix, iy) || z > pDTM->asDouble(ix, iy) )
-			{
-				bSink	= false;
-			}
-		}
-
-		//-------------------------------------------------
-		if( bSink )
-		{
-			i	= pRoute->asChar(x, y);
-
-			ix	= Get_xTo(i, ix);
-			iy	= Get_yTo(i, iy);
-
-			//---------------------------------------------
-			while( is_InGrid(ix, iy) )
-			{
-				Add_Portion(x, y, ix, iy, i);
-
-				i	= pRoute->asChar(ix, iy);
-
-				if( i > 0 )
-				{
-					ix	= Get_xTo(i, ix);
-					iy	= Get_yTo(i, iy);
-				}
-				else
-				{
-					i	= pDTM->Get_Gradient_NeighborDir(ix, iy);
-
-					if( i >= 0 )
-					{
-						ix	= Get_xTo(i, ix);
-						iy	= Get_yTo(i, iy);
-					}
-					else
-					{
-						ix	= -1;
-					}
-				}
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//					Deterministic 8						 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Parallel::Set_D8(		int x, int y, int dir)
-{
-	int		Direction;
-
-	if( dir > 0.0)
-	{
-		Direction	= dir;
-	}
-	else
-	{
-		Direction = pDTM->Get_Gradient_NeighborDir(x, y);
-	}
-
-	if( Direction >= 0 )
-	{
-		Add_Fraction(x, y, Direction);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//						Rho 8							 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Parallel::Set_Rho8(	int x, int y )
-{
-	int		i, ix, iy, iMax;
-
-	double	z, d, dMax;
-
-	z		= pDTM->asDouble(x, y);
-	iMax	= -1;
-
-	for(i=0; i<8; i++)
-	{
-		ix		= Get_xTo(i, x);
-		iy		= Get_yTo(i, y);
-
-		if( !pDTM->is_InGrid(ix, iy) )
-		{
-			return;
-		}
-		else
-		{
-			d		= z - pDTM->asDouble(ix, iy);
-
-			if( i % 2 == 1 )
-			{
-				d		/= 1.0 + rand() / (double)RAND_MAX;
-			}
-
-			if( iMax < 0 || (iMax >= 0 && d > dMax) )
-			{
-				iMax	= i;
-				dMax	= d;
-			}
-		}
-	}
-
-	if( iMax >= 0 )
-	{
-		Add_Fraction(x, y, iMax);
-	}
-}
-
-/*void CFlow_Parallel::Set_Rho8(	int x, int y )
-{
-	int		Direction, ix, iy;
-
-	double 	Slope, Aspect;
-
-	Get_Gradient(x, y, Slope, Aspect);
-
-	if( Aspect >= 0 )
-	{
-		Direction	= (int)(Aspect / M_PI_045);
-
-		if( fmod(Aspect, M_PI_045) / M_PI_045 > rand() / (double)RAND_MAX )
-		{
-			Direction++;
-		}
-
-		Direction	%= 8;
-
-		ix			= Get_xTo(Direction, x);
-		iy			= Get_yTo(Direction, y);
-
-		if( is_InGrid(ix, iy) && pDTM->asDouble(ix, iy) >= pDTM->asDouble(x, y) )
-		{
-			Direction	= Get_Direction_Lowest(pDTM, x, y);
-		}
-
-		Add_Fraction(x, y, Direction);
-	}
-}/**/
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Deterministic Infinity					 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Parallel::Set_DInf(	int x, int y )
-{
-	int		i, ix, iy;
-	double	s, a;
-
-	if( pDTM->Get_Gradient(x, y, s, a) && a >= 0.0 )
-	{
-		i	= (int)(a / M_PI_045);
-		a	= fmod (a , M_PI_045) / M_PI_045;
-		s	= pDTM->asDouble(x, y);
-
-		if( pDTM->is_InGrid(ix = Get_xTo(i + 0, x), iy = Get_yTo(i + 0, y)) && pDTM->asDouble(ix, iy) < s
-		&&  pDTM->is_InGrid(ix = Get_xTo(i + 1, x), iy = Get_yTo(i + 1, y)) && pDTM->asDouble(ix, iy) < s )
-		{
-			Add_Fraction(x, y,  i         , 1.0 - a);
-			Add_Fraction(x, y, (i + 1) % 8,       a);
-
-			return;
-		}
-	}
-
-	if( (i = pDTM->Get_Gradient_NeighborDir(x, y)) >= 0 )
-	{
-		Add_Fraction(x, y, i);
-	}
-}
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Multiple Triangular Flow Directon		 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Parallel::Set_MDInf(	int x, int y )
-{
-	int		i, ii, ix, iy;
-
-	double	z, dzSum, dz[8];
-	double	hs, hr, s_facet[8], r_facet[8];
-	double	valley[8], portion[8];
-	double  cellsize, cellarea;
-	double	nx, ny, nz, n_norm;
-	bool	Dir_inGrid[8];
-
-	z			= pDTM->asDouble(x, y);
-	cellsize	= Get_Cellsize();
-	cellarea	= cellsize * cellsize;
-
-	for(i=0; i<8; i++)
-	{
-		ix		= Get_xTo(i, x);
-		iy		= Get_yTo(i, y);
-		
-		Dir_inGrid[i] = true;
-		if( x == 6 && y == 7 )
-		{
-			int k = 1;
-		}
-
-		s_facet[i] = r_facet[i] = -999.0;
-
-		if( pDTM->is_InGrid(ix, iy) )
-		{
-			dz[i]		= z - pDTM->asDouble(ix, iy);
-		}
-		else
-		{
-			dz[i]		= 0.0;
-			Dir_inGrid[i] = false;
-		}
-	}
-	for(i=0; i<8; i++)
-	{
-		hr = hs = -999.0;
-		
-		if( Dir_inGrid[i] )
-		{
-			ii = ( i < 7)? i+1 : 0;
-			
-			if( Dir_inGrid[ii] )
-			{
-				// vb-code:  nx = (z1 * yd(ii) - z2 * yd(i)) * gridsize
-				nx = ( dz[ii] * Get_yTo( i ) - dz[i] * Get_yTo( ii )) * cellsize;
-				//vb-code:  ny = (z1 * xd(ii) - z2 * xd(i)) * gridsize
-/*ERROR?*/		ny = ( dz[i] * Get_xTo( ii ) - dz[ii] * Get_xTo( i ) ) * cellsize;
-				//vb-code:  nz = (xd(ii) * yd(i) - xd(i) * yd(ii)) * gridsize ^ 2
-				nz = ( Get_xTo( i ) * Get_yTo( ii ) - Get_xTo( ii ) * Get_yTo( i )) * cellarea;
-				
-				n_norm = sqrt( nx*nx + ny*ny +nz*nz );
-				/*
-				if( nx == 0.0 )
-				{
-					hr = (ny >= 0.0)? 0.0 : M_PI;
-				} 
-				else if( nx > 0.0 )
-				{
-					hr = M_PI_090 - atan(ny / nx);
-
-				} 
-				else
-				{
-					hr = M_PI_270 - atan(ny / nx);
-				}
-				*/
-
-				if( nx == 0.0 )
-				{
-					hr = (ny >= 0.0)? 0.0 : M_PI;
-				} 
-				else if( nx < 0.0 )
-				{
-					hr = M_PI_270 - atan(ny / nx);
-				} 
-				else
-				{
-					hr = M_PI_090 - atan(ny / nx);
-				}
-				//vb-code:  hs = -Tan(arccos(nz / betrag_n))
-				hs = -tan( acos( nz/n_norm ) );
-				
-				// vb-code: If hr <= (i - 1) * PI / 4 Or hr >= i * PI / 4 Then
-				//SHOULD IT BE LIKE THIS: (( hr <= i * M_PI_045 || hr >= ii * M_PI_045 )  OR AS BELOW???
-				if( hr < i * M_PI_045 || hr > (i+1) * M_PI_045 )
-				{
-					if( dz[i] > dz[ii] )
-					{
-						hr = i * M_PI_045;
-						hs = dz[i] / Get_Length(i);
-					}
-					else
-					{
-						hr = ii * M_PI_045;
-						hs = dz[ii] / Get_Length(ii);						
-					}
-				}
-				
-			}
-			else if( dz[i] > 0.0 )
-			{
-				hr = i * M_PI_045;
-				hs = dz[i] / Get_Length(i);
-			}
-			
-			s_facet[i] = hs;
-			r_facet[i] = hr;
-		}
-	}
-	
-	dzSum		= 0.0;
-	
-	for(i=0; i<8; i++)
-	{		
-		valley[i]	= 0.0;
-		ii = (i < 7)? i+1 : 0;
-		
-		if( s_facet[i] > 0.0 )
-		{
-			if( r_facet[i] > i * M_PI_045 && r_facet[i] < (i+1) * M_PI_045 )
-			{
-				valley[i] = s_facet[i];
-			}
-			else if( r_facet[i] == r_facet[ii] )
-			{
-				valley[i] = s_facet[i];
-			}
-			else if( s_facet[ii] == -999.0 && r_facet[i] == (i+1) * M_PI_045)
-			{
-				valley[i] = s_facet[i];
-			}
-			else
-			{
-				ii = (i > 0)? i-1 : 7;
-				if( s_facet[ii] == -999.0 && r_facet[i] == i * M_PI_045 )
-				{
-					valley[i] = s_facet[i];
-				}
-			}
-			
-			valley[i] = pow(valley[i], MFD_Converge);
-			dzSum += valley[i];
-		} 
-		
-		portion[i] = 0.0;
-
-	}
-
-
-	if( dzSum )
-	{
-		for(i=0; i<8; i++)
-		{
-			if (i < 7)
-			{
-				ii = i+1;
-			}
-			else
-			{
-				ii = 0;
-				if( r_facet[i] == 0.0) r_facet[i] = M_PI_360;
-			}
-			if( valley[i] )
-			{
-				valley[i] /= dzSum;
-				//vb-code: portion(i) = portion(i) + valley(i) * (i * PI / 4 - r_facet(i)) / (PI / 4)
-				portion[i] += valley[i] * ((i+1) * M_PI_045 - r_facet[i]) / M_PI_045;
-				//vb-code: portion(ii) = portion(ii) + valley(i) * (r_facet(i) - (i - 1) * PI / 4) / (PI / 4)
-				portion[ii] += valley[i] * (r_facet[i] - i * M_PI_045) / M_PI_045;
-			}
-		}
-		for(i=0; i<8; i++)
-		{
-			Add_Fraction(x, y, i, portion[i] );
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Multiple Flow Direction					 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_Parallel::Set_MFD(	int x, int y )
-{
-	int		i, ix, iy;
-
-	double	z, d, dzSum, dz[8];
-
-	z		= pDTM->asDouble(x, y);
-	dzSum	= 0.0;
-
-	for(i=0; i<8; i++)
-	{
-		ix		= Get_xTo(i, x);
-		iy		= Get_yTo(i, y);
-
-		if( pDTM->is_InGrid(ix, iy) )
-		{
-			d		= z - pDTM->asDouble(ix, iy);
-		}
-		else
-		{
-			ix		= Get_xTo(i + 4, x);
-			iy		= Get_yTo(i + 4, y);
-
-			if( pDTM->is_InGrid(ix, iy) )
-			{
-				d		= pDTM->asDouble(ix, iy) - z;
-			}
-			else
-			{
-				d		= 0.0;
-			}
-		}
-
-		if( d > 0.0 )
-		{
-			//previously: dzSum	+= (dz[i]	= pow(d / Get_Length(i), MFD_Converge));
-			dz[i]	= pow(d / Get_Length(i), MFD_Converge);
-			dzSum	+= dz[i];
-		}
-		else
-		{
-			dz[i]	= 0.0;
-		}
-	}
-
-	if( dzSum )
-	{
-		for(i=0; i<8; i++)
-		{
-			if( dz[i] )
-			{
-				Add_Fraction(x, y, i, dz[i] / dzSum );
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Braunschweiger Reliefmodell				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow_BRM.h"
-
-#define BRM_nint(x)		((int)(x >= 0 ? x + 0.5 : x - 0.5))
-
-
-//---------------------------------------------------------
-void CFlow_Parallel::Set_BRM(	int x, int y )
-{
-	int		Dir, QBinaer,
-			ix[3], iy[3],
-			nexp[6];
-
-	double	QLinks, QMitte, QRecht,
-			nnei[6];
-
-	//-----------------------------------------------------
-	if( is_InGrid(x, y, 1) ) // Rand !!!
-	{
-		Dir	= BRM_InitRZ(x,y,ix,iy);
-
-		if( Dir >= 0 )
-		{
-			if( Dir % 2 )
-			{
-				BRM_GetDiago(Dir,x,y,ix,iy,nnei,nexp);
-				BRM_QStreuung(4,1,nnei,nexp,QBinaer,QLinks,QMitte,QRecht);
-			}
-			else
-			{
-				BRM_GetOrtho(Dir,x,y,ix,iy,nnei,nexp);
-				BRM_QStreuung(6,0,nnei,nexp,QBinaer,QLinks,QMitte,QRecht);
-			}
-
-			Add_Fraction(x,y,(Dir+1)%8,BRM_BitMtrx[0][QBinaer] ? QLinks : 0);
-			Add_Fraction(x,y,(Dir+0)%8,BRM_BitMtrx[1][QBinaer] ? QMitte : 0);
-			Add_Fraction(x,y,(Dir+7)%8,BRM_BitMtrx[2][QBinaer] ? QRecht : 0);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_Parallel::BRM_Init(void)
-{
-	int 	i;
-
-	double	DXT	= Get_Cellsize()/2,
-			DYT	= Get_Cellsize()/2;
-
-	//-----------------------------------------------------
-	BRM_kgexp[0]	= (int)(atan2(DXT     , Get_Cellsize()) * M_RAD_TO_DEG);
-	BRM_kgexp[1]	= (int)(atan2(Get_Cellsize(), DYT     ) * M_RAD_TO_DEG) + 1;
-	BRM_kgexp[2]	= (int)(atan2(Get_Cellsize(),-DYT     ) * M_RAD_TO_DEG);
-	BRM_kgexp[3]	= (int)(atan2(DXT     ,-Get_Cellsize()) * M_RAD_TO_DEG) + 1;
-
-	for(i=0; i<4; i++)
-		BRM_kgexp[i+4]	= BRM_kgexp[i] + 180;
-
-	//-----------------------------------------------------
-	for(i=0; i<=360; i++)
-	{
-		BRM_sinus[i]	= -sin(i * M_DEG_TO_RAD);
-		BRM_cosin[i]	= -cos(i * M_DEG_TO_RAD);
-	}
-
-	//---BRM_idreh---------------------------------------------
-	BRM_idreh[0]	= 180;
-	BRM_idreh[1]	= 180 -	BRM_nint(atan2(Get_Cellsize(), Get_Cellsize()) * M_RAD_TO_DEG);
-	BRM_idreh[2]	=  90;
-	BRM_idreh[3]	=		BRM_nint(atan2(Get_Cellsize(), Get_Cellsize()) * M_RAD_TO_DEG);
-	BRM_idreh[4]	=   0;
-
-	for(i=1; i<4; i++)
-		BRM_idreh[i+4]	= BRM_idreh[i] + 180;
-}
-
-//---------------------------------------------------------
-int CFlow_Parallel::BRM_InitRZ(int x, int y, int ix[3], int iy[3])
-{
-	int		i, j, Dir;
-
-	double	Slope, Aspect;
-
-	Get_Gradient(x, y, Slope, Aspect);
-
-	Aspect	*= M_RAD_TO_DEG;
-
-	if( Aspect < 0 )
-	{
-		return( -1 );
-	}
-
-	//---Kategorisierte-Exposition-------------------------
-	Dir	= 0;
-	while( Aspect > BRM_kgexp[Dir] && Dir < 8 )
-		Dir++;
-	Dir	%=8;
-
-    //---Finde-Die-3-ZielRasterZellen----------------------
-	for(i=0; i<3; i++)	// zxy[]: 0=Recht, 1=Mitte, 2=Links
-	{
-		j		= (Dir + 7 + i) % 8;
-		ix[2-i]	= Get_xTo(j,x);
-		iy[2-i]	= Get_yTo(j,y);
-	}
-
-	return(Dir);
-}
-
-//---------------------------------------------------------
-void CFlow_Parallel::BRM_GetOrtho(int Dir, int x, int y, int ix[3], int iy[3], double nnei[6], int nexp[6])
-{
-	int		jx, jy, i,
-			i0	= (Dir + 2) % 8,
-			i4	= (Dir + 6) % 8;
-
-	double	Slope, Aspect;
-
-	for(i=0; i<3; i++)
-	{
-		jx		= ix[i];
-		jy		= iy[i];
-
-		Get_Gradient(jx, jy, Slope, Aspect);
-
-		nnei[i]	= M_RAD_TO_DEG * Slope;
-		nexp[i]	= (int)(M_RAD_TO_DEG * Aspect);
-	}
-
-	jx		= Get_xTo(i0,x);
-	jy		= Get_yTo(i0,y);
-
-	Get_Gradient(jx, jy, Slope, Aspect);
-
-	nnei[3]	= M_RAD_TO_DEG * Slope;
-	nexp[3]	= (int)(M_RAD_TO_DEG * Aspect);
-
-	jx		= Get_xTo(i4,x);
-	jy		= Get_yTo(i4,y);
-
-	Get_Gradient(jx, jy, Slope, Aspect);
-
-	nnei[5]	= M_RAD_TO_DEG * Slope;
-	nexp[5]	= (int)(M_RAD_TO_DEG * Aspect);
-
-	Get_Gradient(x, y, Slope, Aspect);
-
-	nnei[4]	= M_RAD_TO_DEG * Slope;
-	nexp[4]	= (int)(M_RAD_TO_DEG * Aspect);	//[jy][jx]) ????!!!!...;
-
-	for(i=0; i<6; i++)
-		if(nexp[i]<0)
-			nexp[i]	= nexp[4];
-
-	for(i=0; i<6; i++)
-	{
-		nexp[i]	+= BRM_idreh[Dir];
-
-		if(nexp[i]>360)
-			nexp[i]	-= 360;
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_Parallel::BRM_GetDiago(int Dir, int x, int y, int ix[3], int iy[3], double nnei[6], int nexp[6])
-{
-	int		i;
-
-	double	Slope, Aspect;
-
-	Get_Gradient( x   ,  y   , Slope, Aspect);
-	nexp[0]	= (int)(M_RAD_TO_DEG * Aspect);
-	nnei[0]	= M_RAD_TO_DEG * Slope;
-
-	Get_Gradient(ix[0], iy[0], Slope, Aspect);
-	nexp[1]	= (int)(M_RAD_TO_DEG * Aspect);
-	nnei[1]	= M_RAD_TO_DEG * Slope;
-
-	Get_Gradient(ix[2], iy[2], Slope, Aspect);
-	nexp[2]	= (int)(M_RAD_TO_DEG * Aspect);
-	nnei[2]	= M_RAD_TO_DEG * Slope;
-
-	Get_Gradient(ix[1], iy[1], Slope, Aspect);
-	nexp[3]	= (int)(M_RAD_TO_DEG * Aspect);
-	nnei[3]	= M_RAD_TO_DEG * Slope;
-
-	for(i=1; i<4; i++)
-		if(nexp[i]<0)
-			nexp[i]	= nexp[0];
-
-	for(i=0; i<4; i++)
-	{
-		nexp[i]	+= BRM_idreh[Dir];
-
-		if(nexp[i]>360)
-			nexp[i]	-= 360;
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_Parallel::BRM_QStreuung(int i64, int g64, double nnei[6], int nexp[6], int &QBinaer, double &QLinks, double &QMitte, double &QRecht)
-{
-	int		i, j, ix, iy,
-			ALinks, AMitte=2, ARecht;
-
-	double	x=1, y=1, sg=0, a,
-			s[6], c[6];
-
-	ALinks	= ARecht	= 0;
-	QLinks	= QRecht	= 0.0;
-
-	for(i=0; i<i64; i++)
-		sg	+= nnei[i];
-
-	sg	= i64 / sg;
-
-	for(i=0; i<i64; i++)
-	{
-		a		= sg * nnei[i];
-		j		= nexp[i];
-		s[i]	= a * BRM_sinus[j];
-		c[i]	= a * BRM_cosin[j];
-	}
-
-    //---QLinks-ermitteln----------------------------------
-	for(i=0; i<100; i++)
-	{
-		ix	= BRM_nint(x) - 1;
-		iy	= BRM_nint(y) - 1;
-
-		for(j=0; j<i64; j++)
-		{
-			a		= BRM_g[g64][j][ix][iy];
-			x		+= s[j] * a;
-			y		+= c[j] * a;
-		}	 
-
-		if(x<1)
-		{
-			ALinks	= 0;
-			QLinks	= 0;
-			break;
-		}
-
-		if( x>8.99 || y<1 )
-		{
-			ALinks	= 4;
-			QLinks	= 1;			
-			break;
-		}
-
-		if(y>8.95)
-		{
-			if(x<1.02)
-			{
-				ALinks	= 0;
-				QLinks	= 0;
-			}
-			else
-			{
-				ALinks	= 4;
-				QLinks	= (x - 1) / 8;
-
-				if(i64==4)
-				{
-					if(QLinks<0.5)
-						QLinks	= QLinks * (1.67 - QLinks * 1.078);
-					else
-						QLinks	= QLinks * 0.869 + 0.131;
-				}
-			}
-			break;
-		}
-	}
-
-
-    //---QRechts-ermitteln---------------------------------
-	x	= 9;
-	y	= 1;
-
-	for(i=0; i<100; i++)
-	{
-		ix	= BRM_nint(x) - 1;
-		iy	= BRM_nint(y) - 1;
-
-		for(j=0; j<i64; j++)
-		{
-			a	= BRM_g[g64][j][ix][iy];
-			x	+= s[j] * a;
-			y	+= c[j] * a;
-		}
-
-		if(x>9)
-		{
-			ARecht	= 0;
-			QRecht	= 0;
-			break;
-		}
-
-		if( x<1.01 || y<1 )
-		{
-			ARecht	= 1;
-			QRecht	= 1;
-			break;
-		}
-
-		if(y>8.95)
-		{
-			if(x>8.98)
-			{
-				ARecht	= 0;
-				QRecht	= 0;
-			}
-			else
-			{
-				ARecht	= 1;
-				QRecht	= 1 - (x - 1) / 8;
-
-				if(i64==4)					
-				{
-					if(QRecht<0.5)
-						QRecht	= QRecht * (1.67 - QRecht * 1.078);
-					else
-						QRecht	= QRecht * 0.869 + 0.131;
-				}
-			}
-			break;
-		}
-	}
-
-	//---QMitte-ist-Rest-/-QBinaer'Bits-setzen-------------
-	QMitte	= 1 - QLinks - QRecht;
-	QBinaer	= ALinks + AMitte + ARecht;
-
-	if(QMitte<=0.01)
-	{
-		a		= QLinks + QRecht;
-		QLinks	/= a;
-		QRecht	/= a;
-		QMitte	= 0;
-		QBinaer	-= 2;
-	}
-}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp
deleted file mode 100644
index e906956..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp
+++ /dev/null
@@ -1,737 +0,0 @@
-/**********************************************************
- * Version $Id: Flow_RecursiveDown.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                Flow_RecursiveDown.cpp                 //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow_RecursiveDown.h"
-
-//---------------------------------------------------------
-#define GET_OUTLET_DIAG__1(in, angle)		(1.0 - (1.0 - in) * tan(M_PI_090 - angle))
-#define GET_OUTLET_CROSS_1(in, angle)		(in + tan(angle))
-
-#define GET_OUTLET_DIAG__2(in, angle)		(in * tan(angle))
-#define GET_OUTLET_CROSS_2(in, angle)		(in - tan(M_PI_090 - angle))
-
-#define GET_LENGTH(a, b)					(sqrt((a)*(a) + (b)*(b)))
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_RecursiveDown::CFlow_RecursiveDown(void)
-{
-	Set_Name		(_TL("Catchment Area (Flow Tracing)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001"));
-
-	Set_Description	(_TW(
-		"Flow tracing algorithms for calculations of flow accumulation and related parameters. "
-		"These algorithms trace the flow of each cell in a DEM separately until it finally leaves the DEM or ends in a sink.\n\n"
-
-		"References:\n\n"
-
-		"Rho 8 (this implementation adopted the original algorithm only for the flow routing and will give quite different results):\n"
-		"- Fairfield, J. / Leymarie, P. (1991):\n"
-		"    'Drainage networks from grid digital elevation models',\n"
-		"    Water Resources Research, 27:709-717\n\n"
-
-		"Kinematic Routing Algorithm:\n"
-		"- Lea, N.L. (1992):\n"
-		"    'An aspect driven kinematic routing algorithm',\n"
-		"    in: Parsons, A.J., Abrahams, A.D. (Eds.), 'Overland Flow: hydraulics and erosion mechanics', London, 147-175\n\n"
-
-		"DEMON:\n"
-		"- Costa-Cabral, M. / Burges, S.J. (1994):\n"
-		"    'Digital Elevation Model Networks (DEMON): a model of flow over hillslopes for computation of contributing and dispersal areas',\n"
-		"    Water Resources Research, 30:1681-1692\n\n")
-	);
-
-
-	//-----------------------------------------------------
-	// Method...
-
-	Parameters.Add_Choice(
-		NULL	, "Method"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Rho 8"),
-			_TL("Kinematic Routing Algorithm"),
-			_TL("DEMON")
-		), 1
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL	, "MINDQV"		, _TL("DEMON - Min. DQV"),
-		_TL("DEMON - Minium Drainage Quota Volume (DQV) for traced flow tubes"),
-		PARAMETER_TYPE_Double	,	0.0, 0.0, true, 1.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "CORRECT"		, _TL("Flow Correction"),
-		_TL(""),
-		PARAMETER_TYPE_Bool
-	);
-}
-
-//---------------------------------------------------------
-CFlow_RecursiveDown::~CFlow_RecursiveDown(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::On_Initialize(void)
-{
-	int		x, y;
-	double	Slope, Aspect;
-
-	//-----------------------------------------------------
-	Method			= Parameters("Method"	)->asInt();
-	DEMON_minDQV	= Parameters("MINDQV"	)->asDouble();
-	bFlowPathWeight	= Parameters("CORRECT"	)->asBool();
-
-	pLinear			= 1 ? SG_Create_Grid(pDTM, SG_DATATYPE_Float) : NULL;
-
-	//-----------------------------------------------------
-	Lock_Create();
-
-	//-----------------------------------------------------
-	switch( Method )
-	{
-	case 0: default:	// Rho 8...
-
-		pDir		= NULL;
-		pDif		= NULL;
-
-		break;
-
-	//-----------------------------------------------------
-	case 1:	case 2:		// KRA, DEMON...
-
-		pDir		= SG_Create_Grid(pDTM, SG_DATATYPE_Char);
-		pDif		= SG_Create_Grid(pDTM, SG_DATATYPE_Float);
-
-		for(y=0; y<Get_NY() && Set_Progress(y); y++)
-		{
-			for(x=0; x<Get_NX(); x++)
-			{
-				if( !pDTM->is_NoData(x, y) )
-				{
-					Get_Gradient(x, y, Slope, Aspect);
-
-					if( Aspect >= 0.0 )
-					{
-						pDir->Set_Value(x, y, 2 * (((int)(Aspect / M_PI_090)) % 4));
-						pDif->Set_Value(x, y, fmod(Aspect, M_PI_090));
-					}
-				}
-			}
-		}
-
-		break;
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::On_Finalize(void)
-{
-	int		x, y, dir;
-	long	n;
-	double	qFlow;
-
-	//-----------------------------------------------------
-	if( pDir )
-	{
-		delete(pDir);
-	}
-
-	if( pDif )
-	{
-		delete(pDif);
-	}
-
-	Lock_Destroy();
-
-	//-----------------------------------------------------
-	if( pLinear )
-	{
-		for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-		{
-			;
-
-			if( pDTM->Get_Sorted(n, x, y) && (qFlow = pLinear->asDouble(x, y)) > 0.0 )
-			{
-				Add_Flow(x, y, qFlow);
-
-				if( (dir = pDTM->Get_Gradient_NeighborDir(x, y)) >= 0 )
-				{
-					x	= Get_xTo(dir, x);
-					y	= Get_yTo(dir, y);
-
-					if( pDTM->is_InGrid(x, y) )
-					{
-						pLinear->Add_Value(x, y, qFlow);
-					}
-				}
-			}
-		}
-
-		delete(pLinear);
-
-		pLinear	= NULL;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFlow_RecursiveDown::Calculate(void)
-{
-	for(int y=0; y<Get_NY() && Set_Progress(y); y+=Step)
-	{	//if( !(y%2) )DataObject_Update(pFlow);
-		for(int x=0; x<Get_NX(); x+=Step)
-		{
-			Calculate(x, y);
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CFlow_RecursiveDown::Calculate(int x, int y)
-{
-	double 	Slope, Aspect, qFlow;
-
-	if( !pDTM->is_NoData(x, y) && (qFlow = pWeight ? pWeight->asDouble(x, y) : 1.0) > 0.0 )
-	{
-		Get_Gradient(x, y, Slope, Aspect);
-
-		Src_Height	= pDTM->asDouble(x,y);
-		Src_Slope	= Slope;
-
-		Add_Flow(x, y, qFlow);
-		Lock_Set(x, y, 1);
-
-		//-------------------------------------------------
-		switch( Method )
-		{
-		case 0:
-			Rho8_Start(		x, y, qFlow );
-			break;
-
-		case 1:
-			KRA_Start(		x, y, qFlow );
-			break;
-
-		case 2:
-			DEMON_Start(	x, y, qFlow );
-			break;
-		}
-
-		Lock_Set(x, y, 0);
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::Add_Flow(int x, int y, double Fraction)
-{
-	if( pCatch )
-	{
-		pCatch			->Add_Value(x, y, Fraction );
-	}
-
-	if( pCatch_Height )
-	{
-		pCatch_Height	->Add_Value(x, y, Fraction * Src_Height );
-	}
-
-	if( pCatch_Slope )
-	{
-		pCatch_Slope	->Add_Value(x, y, Fraction * Src_Slope );
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::Rho8_Start(int x, int y, double qFlow)
-{
-	int		dir, ix, iy;
-	double 	Slope, Aspect;
-
-	//-----------------------------------------------------
-	Get_Gradient(x, y, Slope, Aspect);
-
-	if( Aspect >= 0.0 )
-	{
-		dir		= (int)(Aspect / M_PI_045);
-
-		if( fmod(Aspect, M_PI_045) / M_PI_045 > rand() / (double)RAND_MAX )
-		{
-			dir++;
-		}
-
-		dir	%= 8;
-
-		ix		= Get_xTo(dir, x);
-		iy		= Get_yTo(dir, y);
-
-		//-------------------------------------------------
-		if( is_InGrid(ix, iy) )
-		{
-			if( is_Locked(ix, iy) )
-			{
-				if( pLinear )
-				{
-					pLinear->Add_Value(x, y, qFlow);
-				}
-			}
-			else
-			{
-				Lock_Set( x,  y, 1);
-				Add_Flow(ix, iy, qFlow);
-				Rho8_Start(ix, iy, qFlow);
-				Lock_Set( x,  y, 0);
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::KRA_Start(int x, int y, double qFlow)
-{
-	int		dir;
-	double	dif;
-
-	if( (dif = pDif->asDouble(x, y)) > M_PI_045 )	// to the right...
-	{
-		dir		= pDir->asInt(x, y) + 2;
-		dif		= 0.5 - tan(M_PI_090 - dif) / 2.0;
-	}
-	else											// to the top...
-	{
-		dir		= pDir->asInt(x, y) + 0;
-		dif		= 0.5 + tan(dif) / 2.0;
-	}
-
-	KRA_Trace(x, y, qFlow, dir, dif);
-}
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::KRA_Trace(int x, int y, double qFlow, int Direction, double from)
-{
-	bool	bLinear;
-	int		dir;
-	double	dif, to, weight;
-
-	Direction	%= 8;
-
-	x	= Get_xTo(Direction, x);
-	y	= Get_yTo(Direction, y);
-
-	//-----------------------------------------------------
-	if( pDTM->is_InGrid(x, y) && !is_Locked(x, y) )
-	{
-		Lock_Set(x, y, 1);
-
-		bLinear	= false;
-		weight	= 1.0;
-
-		dir		= pDir->asInt(x, y);
-		dif		= pDif->asDouble(x, y);
-
-		//-------------------------------------------------
-		if( Direction == dir )						// entering from the bottom...
-		{
-			if( from > 1.0 - tan(dif) )				// 1. to the right...
-			{
-				to		= GET_OUTLET_DIAG__1(from, dif);
-
-				KRA_Trace(x, y, qFlow, dir + 2, to);
-
-				if( bFlowPathWeight )
-				{
-					weight	= GET_LENGTH(1.0 - from, 1.0 - to);
-				}
-			}
-			else									// 2. to the top...
-			{
-				to		= GET_OUTLET_CROSS_1(from, dif);
-
-				KRA_Trace(x, y, qFlow, dir + 0, to);
-
-				if( bFlowPathWeight )
-				{
-					weight	= GET_LENGTH(1.0, to - from);
-				}
-			}
-		}
-		else if( (8 + Direction - dir) % 8 == 2 )	// entering from the left...
-		{
-			if( from < tan(M_PI_090 - dif) )		// 1. to the top...
-			{
-				to		= GET_OUTLET_DIAG__2(from, dif);
-
-				KRA_Trace(x, y, qFlow, dir + 0, to);
-
-				if( bFlowPathWeight )
-				{
-					weight	= GET_LENGTH(from, to);
-				}
-			}
-			else									// 2. to the right...
-			{
-				to		= GET_OUTLET_CROSS_2(from, dif);
-
-				KRA_Trace(x, y, qFlow, dir + 2, to);
-
-				if( bFlowPathWeight )
-				{
-					weight	= GET_LENGTH(1.0, from - to);
-				}
-			}
-		}
-		else										// go linear...
-		{
-			bLinear	= true;
-		}
-
-		//-------------------------------------------------
-		if( bLinear && pLinear )
-		{
-			pLinear->Add_Value(x, y, qFlow);
-		}
-		else
-		{
-			Add_Flow(x, y, weight * qFlow);
-		}
-
-		Lock_Set(x, y, 0);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//		DEMON - Digital Elevation MOdel Network			 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::DEMON_Start(int x, int y, double qFlow)
-{
-	double	dif, flow_A, flow_B;
-
-	if( (dif = pDif->asDouble(x, y)) < M_PI_045 )	// mostly to the top...
-	{
-		flow_B	= tan(dif) / 2.0;
-		flow_A	= 1.0 - flow_B;
-	}
-	else											// mostly to the right...
-	{
-		flow_A	= tan(M_PI_090 - dif) / 2.0;
-		flow_B	= 1.0 - flow_A;
-	}
-
-	flow_A	*= qFlow;
-	flow_B	*= qFlow;
-
-	if( flow_A <= DEMON_minDQV )
-	{
-		DEMON_Trace(x, y, qFlow , pDir->asInt(x, y) + 2, 0.0, 1.0);	// all to the right...
-	}
-	else if( flow_B <= DEMON_minDQV )
-	{
-		DEMON_Trace(x, y, qFlow , pDir->asInt(x, y) + 0, 0.0, 1.0);	// all to the top...
-	}
-	else
-	{
-		DEMON_Trace(x, y, flow_A, pDir->asInt(x, y) + 0, 0.0, 1.0);	// to the top...
-		DEMON_Trace(x, y, flow_B, pDir->asInt(x, y) + 2, 0.0, 1.0);	// to the right...
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_RecursiveDown::DEMON_Trace(int x, int y, double qFlow, int Direction, double from_A, double from_B)
-{
-	bool	bLinear;
-	int		dir;
-	double	dif, to_A, to_B, flow_A, flow_B, weight;
-
-	Direction	%= 8;
-
-	x	= Get_xTo(Direction, x);
-	y	= Get_yTo(Direction, y);
-
-	//-----------------------------------------------------
-	if( pDTM->is_InGrid(x, y) && !is_Locked(x, y) )
-	{
-		Lock_Set(x, y, 1);
-
-		bLinear	= false;
-		weight	= 1.0;
-
-		dir		= pDir->asInt(x, y);
-		dif		= pDif->asDouble(x, y);
-
-		//-------------------------------------------------
-		if( Direction == dir )						// entering from the bottom...
-		{
-			if( from_A >= 1.0 - tan(dif) )			// 1. completely to the right...
-			{
-				to_A	= GET_OUTLET_DIAG__1(from_A, dif);
-				to_B	= GET_OUTLET_DIAG__1(from_B, dif);
-
-				DEMON_Trace(x, y, qFlow, dir + 2, to_A, to_B);
-
-				if( bFlowPathWeight )
-				{
-					//weight	= ((1.0 - from_A) * (1.0 - to_A) - (1.0 - from_B) * (1.0 - to_B)) / 2.0;	// area...
-					weight	= GET_LENGTH(1.0 - (from_B + from_A) / 2.0, 1.0 - (to_B + to_A) / 2.0);
-				}
-			}
-			else if( from_B < 1.0 - tan(dif) )		// 2. completely to the top...
-			{
-				to_A	= GET_OUTLET_CROSS_1(from_A, dif);
-				to_B	= GET_OUTLET_CROSS_1(from_B, dif);
-
-				DEMON_Trace(x, y, qFlow, dir + 0, to_A, to_B);
-
-				if( bFlowPathWeight )
-				{
-					//weight	= from_B - from_A;	// area...
-					weight	= GET_LENGTH(1.0, to_A - from_A);
-				}
-			}
-			else									// 3. partly to the right, partly to the top...
-			{
-				to_A	= GET_OUTLET_CROSS_1(from_A, dif);
-				to_B	= GET_OUTLET_DIAG__1(from_B, dif);
-
-				dif		= 1.0 - tan(dif);
-
-				flow_A	= dif - from_A;
-				flow_B	= from_B - dif;
-				flow_A	= qFlow * flow_A / (flow_A + flow_B);
-				flow_B	= qFlow - flow_A;
-
-				if( bFlowPathWeight )
-				{
-					//weight	= (dif - from_A) + ((1.0 - dif) - (1.0 - from_B) * (1.0 - to_B)) / 2.0;	// area...
-					if( (weight = (from_A + from_B) / 2.0) < dif )	// to the top...
-					{
-						weight	= GET_LENGTH(1.0, to_A - from_A);
-					}
-					else											// to the right...
-					{
-						weight	= (1.0 - weight) / (1.0 - dif) * GET_LENGTH(1.0, to_A - from_A);
-					}
-				}
-
-				if( flow_A <= DEMON_minDQV )
-				{
-					DEMON_Trace(x, y, qFlow, dir + 2, 0.0, to_B);
-				}
-				else if( flow_B <= DEMON_minDQV )
-				{
-					DEMON_Trace(x, y, qFlow, dir + 0, to_A, 1.0);
-				}
-				else
-				{
-					DEMON_Trace(x, y, flow_A, dir + 0, to_A, 1.0);
-					DEMON_Trace(x, y, flow_B, dir + 2, 0.0, to_B);
-				}
-			}
-		}
-		else if( (8 + Direction - dir) % 8 == 2 )	// entering from the left...
-		{
-			if( from_B <= tan(M_PI_090 - dif) )		// 1. completely to the top...
-			{
-				to_A	= GET_OUTLET_DIAG__2(from_A, dif);
-				to_B	= GET_OUTLET_DIAG__2(from_B, dif);
-
-				DEMON_Trace(x, y, qFlow, dir + 0, to_A, to_B);
-
-				if( bFlowPathWeight )
-				{
-					//weight	= (from_B * to_B - from_A * to_A) / 2.0;	// area...
-					weight	= GET_LENGTH((from_A + from_B) / 2.0, (to_A + to_B) / 2.0);
-				}
-			}
-			else if( from_A > tan(M_PI_090 - dif) )	// 2. completely to the right...
-			{
-				to_A	= GET_OUTLET_CROSS_2(from_A, dif);
-				to_B	= GET_OUTLET_CROSS_2(from_B, dif);
-
-				DEMON_Trace(x, y, qFlow, dir + 2, to_A, to_B);
-
-				if( bFlowPathWeight )
-				{
-					//weight	= from_B - from_A;	// area...
-					weight	= GET_LENGTH(1.0, from_A - to_A);
-				}
-			}
-			else									// 3. partly to the top, partly to the right...
-			{
-				to_A	= GET_OUTLET_DIAG__2(from_A, dif);
-				to_B	= GET_OUTLET_CROSS_2(from_B, dif);
-
-				dif		= tan(M_PI_090 - dif);
-
-				flow_A	= dif - from_A;
-				flow_B	= from_B - dif;
-				flow_A	= qFlow * flow_A / (flow_A + flow_B);
-				flow_B	= qFlow - flow_A;
-
-				if( bFlowPathWeight )
-				{
-					//weight	= (from_B - dif) + (dif - (from_A * to_A)) / 2.0;	// area...
-					if( (weight = (from_A + from_B) / 2.0) > dif )
-					{
-						weight	= GET_LENGTH(1.0, from_B - to_B);
-					}
-					else
-					{
-						weight	= weight / dif * GET_LENGTH(1.0, from_B - to_B);
-					}
-				}
-
-				if( flow_A <= DEMON_minDQV )
-				{
-					DEMON_Trace(x, y, qFlow, dir + 2, 0.0, to_B);
-				}
-				else if( flow_B <= DEMON_minDQV )
-				{
-					DEMON_Trace(x, y, qFlow, dir + 0, to_A, 1.0);
-				}
-				else
-				{
-					DEMON_Trace(x, y, flow_A, dir + 0, to_A, 1.0);
-					DEMON_Trace(x, y, flow_B, dir + 2, 0.0, to_B);
-				}
-			}
-		}
-		else
-		{
-			bLinear	= true;
-		}
-
-		//-------------------------------------------------
-		if( bLinear && pLinear )
-		{
-			pLinear->Add_Value(x, y, qFlow);
-		}
-		else
-		{
-			if( bFlowPathWeight )
-			{
-				Add_Flow(x, y, weight * qFlow);
-				//Add_Flow(x, y, weight >= qFlow ? qFlow : weight * qFlow);
-			}
-			else
-			{
-				Add_Flow(x, y, qFlow);
-			}
-		}
-
-		Lock_Set(x, y, 0);
-	}
-}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp
deleted file mode 100644
index 1f12734..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/**********************************************************
- * Version $Id: Flow_RecursiveUp.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 Flow_RecursiveUp.cpp                  //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Flow_RecursiveUp.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CFlow_RecursiveUp::CFlow_RecursiveUp(void)
-{
-	Set_Name		(_TL("Catchment Area (Recursive)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001"));
-
-	Set_Description	(_TW(
-		"Recursive upward processing of cells for calculation of flow accumulation and related parameters. "
-		"This set of algorithms processes recursively all upwards connected cells until each cell of the DEM has been processed.\n\n"
-
-		"References:\n\n"
-
-		"Deterministic 8\n"
-		"- O'Callaghan, J.F. / Mark, D.M. (1984):\n"
-		"    'The extraction of drainage networks from digital elevation data',\n"
-		"    Computer Vision, Graphics and Image Processing, 28:323-344\n\n"
-
-		"Rho 8:\n"
-		"- Fairfield, J. / Leymarie, P. (1991):\n"
-		"    'Drainage networks from grid digital elevation models',\n"
-		"    Water Resources Research, 27:709-717\n\n"
-
-		"Deterministic Infinity:\n"
-		"- Tarboton, D.G. (1997):\n"
-		"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
-		"    Water Resources Research, Vol.33, No.2, p.309-319\n\n"
-
-		"Multiple Flow Direction:\n"
-		"- Freeman, G.T. (1991):\n"
-		"    'Calculating catchment area with divergent flow based on a regular grid',\n"
-		"    Computers and Geosciences, 17:413-22\n\n"
-
-		"- Quinn, P.F. / Beven, K.J. / Chevallier, P. / Planchon, O. (1991):\n"
-		"    'The prediction of hillslope flow paths for distributed hydrological modelling using digital terrain models',\n"
-		"    Hydrological Processes, 5:59-79\n\n")
-	);
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL	, "TARGETS"		, _TL("Target Areas"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Grid(
-		NULL	, "FLOWLEN"		, _TL("Flow Path Length"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-
-	//-----------------------------------------------------
-	// Method...
-
-	Parameters.Add_Choice(
-		NULL	, "Method"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("Deterministic 8"),
-			_TL("Rho 8"),
-			_TL("Deterministic Infinity"),
-			_TL("Multiple Flow Direction")
-		), 3
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL	, "CONVERGENCE"	, _TL("Convergence"),
-		_TL("Convergence factor for Multiple Flow Direction Algorithm (Freeman 1991)"),
-		PARAMETER_TYPE_Double	, 1.1
-	);
-
-	
-	//-----------------------------------------------------
-	// Initialisations...
-
-	Flow	= NULL;
-}
-
-//---------------------------------------------------------
-CFlow_RecursiveUp::~CFlow_RecursiveUp(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::On_Create(void)
-{
-	int		x, y, Method;
-
-	double	*p;
-
-	//-----------------------------------------------------
-	On_Destroy();
-
-	Flow	= (double ***)SG_Malloc(    Get_NY()  * sizeof(double **));
-	p		= (double   *)SG_Malloc((long) 8 * Get_NCells() * sizeof(double   ));
-
-	for(y=0; y<Get_NY(); y++)
-	{
-		Flow[y]	= (double **)SG_Malloc( Get_NX()  * sizeof(double  *));
-
-		for(x=0; x<Get_NX(); x++, p+=8)
-		{
-			Flow[y][x]	= p;
-		}
-	}
-
-	//-----------------------------------------------------
-	Lock_Create();
-
-	Method	= Parameters("Method")->asInt();
-
-	memset(Flow[0][0], 0, (long) 8 * Get_NCells() * sizeof(double) );
-
-	for(y=0; y<Get_NY(); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pRoute && pRoute->asChar(x,y) > 0 )
-			{
-				Flow[y][x][pRoute->asChar(x,y) % 8]	= 1.0;
-			}
-			else
-			{
-				switch( Method )
-				{
-					case 0:
-						Set_D8(x,y);
-						break;
-
-					case 1:
-						Set_Rho8(x,y);
-						break;
-
-					case 2:
-						Set_DInf(x,y);
-						break;
-
-					case 3:
-						Set_MFD(x,y);
-						break;
-				}
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::On_Destroy(void)
-{
-	int		y;
-
-	if( Flow )
-	{
-		SG_Free(Flow[0][0]);
-
-		for(y=0; y<Get_NY(); y++)
-		{
-			SG_Free(Flow[y]);
-		}
-
-		SG_Free(Flow);
-
-		Flow	= NULL;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::On_Initialize(void)
-{
-	pFlowPath			= Parameters("FLOWLEN")->asGrid();
-
-	MFD_Converge		= Parameters("CONVERGENCE")->asDouble();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CFlow_RecursiveUp::Calculate(void)
-{
-	CSG_Grid	*pTargets	= Parameters("TARGETS")->asGrid();
-
-	On_Create();
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !pTargets || !pTargets->is_NoData(x, y) )
-			{
-				Get_Flow(x, y);
-			}
-		}
-	}
-
-	On_Destroy();
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CFlow_RecursiveUp::Calculate(int x, int y)
-{
-	On_Create();
-
-	Get_Flow(x,y);
-
-	On_Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::Get_Flow(int x, int y)
-{
-	int		i, ix, iy, j;
-
-	double	jFlow;
-
-	if( !is_Locked(x,y) )
-	{
-		Lock_Set(x,y);
-
-		Init_Cell(x,y);
-
-		for(i=0, j=4; i<8; i++, j=(j+1)%8)
-		{
-			ix	= Get_xTo(i,x);
-			iy	= Get_yTo(i,y);
-
-			if( is_InGrid(ix,iy) )
-			{
-				jFlow	= Flow[iy][ix][j];
-
-				if( jFlow > 0 )
-				{
-					Get_Flow(ix,iy);
-
-					Add_Fraction(ix,iy,j,jFlow);
-				}
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::Set_D8(int x, int y)
-{
-	int		Direction;
-
-	Direction	= pDTM->Get_Gradient_NeighborDir(x,y);
-
-	if( Direction >= 0 )
-	{
-		Flow[y][x][Direction % 8]	= 1.0;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::Set_Rho8(int x, int y)
-{
-	int		Direction;
-
-	double 	Slope, Aspect;
-
-	Get_Gradient(x, y, Slope, Aspect);
-
-	Aspect	*= M_RAD_TO_DEG;
-
-	if( Aspect >= 0 )
-	{
-		Direction	= (int)(Aspect / 45.0);
-
-		if( fmod(Aspect,45) / 45.0 > rand() / (double)RAND_MAX )
-			Direction++;
-
-		Direction	%= 8;
-
-		Flow[y][x][Direction]	= 1.0;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::Set_DInf(int x, int y)
-{
-	int		Direction;
-
-	double 	Slope, Aspect;
-
-	Get_Gradient(x, y, Slope, Aspect);
-
-	Aspect	*= M_RAD_TO_DEG;
-
-	if( Aspect >= 0 )
-	{
-		Direction	= (int)(Aspect / 45.0);
-		Aspect		= fmod(Aspect,45) / 45.0;
-
-		Flow[y][x][(Direction    ) % 8]	= 1 - Aspect;
-		Flow[y][x][(Direction + 1) % 8]	=     Aspect;
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CFlow_RecursiveUp::Set_MFD(int x, int y)
-{
-	int		i, ix, iy;
-
-	double	z, d, *dz, dzSum;
-
-	z		= pDTM->asDouble(x,y);
-	dz		= Flow[y][x];
-	dzSum	= 0;
-
-	for(i=0; i<8; i++)
-	{
-		ix	= Get_xTo(i,x);
-		iy	= Get_yTo(i,y);
-
-		if( is_InGrid(ix,iy) )
-		{
-			d	= z - pDTM->asDouble(ix,iy);
-
-			if( d > 0 )
-				dzSum	+= dz[i]	= pow(d / Get_Length(i), MFD_Converge);
-		}
-	}
-
-	if( dzSum )
-	{
-		for(i=0; i<8; i++)
-			if( dz[i] > 0 )
-				dz[i]	/= dzSum;
-	}
-}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.cpp
deleted file mode 100644
index b717d82..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-/**********************************************************
- * Version $Id: Helper.cpp 1016 2011-04-27 18:40:36Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Helper.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "Helper.h"
-
-void getNextCell(
-		CSG_Grid *g,
-		int iX,
-        int iY,
-		int &iNextX,
-		int &iNextY) {
-
-    float fDist;
-    float fMaxSlope;
-    float fSlope;
-
-    fMaxSlope = 0;
-    fSlope = 0;
-
-    if (iX < 1 || iX >= g->Get_NX() - 1 || iY < 1 || iY >= g->Get_NY() - 1
-            || g->is_NoData(iX,iY)) {
-        iNextX = iX;
-		iNextY = iY;
-		return;
-    }// if
-
-    for (int i = -1; i < 2; i++) {
-        for (int j = -1; j < 2; j++) {                	
-            if (!g->is_NoData(iX + i, iY + i)){
-                if (i == 0 || j == 0) {
-                    fDist = 1.0f;
-                }// if
-                else {
-                    fDist = 1.414f;
-                }// else
-                fSlope = (g->asFloat(iX+i,iY+j)
-                         - g->asFloat(iX,iY)) / fDist;                                				
-                if (fSlope <= fMaxSlope) {
-                    iNextX = iX+i;
-					iNextY = iY+j;                        
-                    fMaxSlope = fSlope;
-                }// if
-            }//if                    
-        }// for
-    }// for
-
-}// method
-
-void getNextCell(
-		CSG_Grid *g,
-		CSG_Grid *g2,
-		int iX,
-        int iY,
-		int &iNextX,
-		int &iNextY) {
-	
-	double fDist;
-    double fMaxSlope;
-    double fSlope;
-
-    fMaxSlope = 0.0000001;
-    fSlope = 0;
-
-    if (iX < 1 || iX >= g->Get_NX() - 1 || iY < 1 || iY >= g->Get_NY() - 1
-            || g->is_NoData(iX,iY)) {
-        iNextX = iX;
-		iNextY = iY;
-		return;
-    }// if
-
-    for (int i = -1; i < 2; i++) {
-        for (int j = -1; j < 2; j++) {                	
-            if (!g->is_NoData(iX+i,iY+j) &&
-				!g2->is_NoData(iX+i,iY+j)){ 
-                if (i == 0 || j == 0) {
-                    fDist = 1.0f;
-                }// if
-                else {
-                    fDist = 1.414f;
-                }// else
-                fSlope = (g->asFloat(iX+i,iY+j)
-                         - g->asFloat(iX,iY)) / fDist;                                				
-                if (fSlope < fMaxSlope) {
-                    iNextX = iX+i;
-					iNextY = iY+j;                        
-                    fMaxSlope = fSlope;
-                }// if
-            }//if                    
-        }// for
-    }// for
-
-}// method
-
-double FlowDistance(CSG_Grid *pDEM,
-					CSG_Grid *pBasinGrid,
-					int iBasin,
-				    int iX,
-				    int iY,
-				    int iX2,
-				    int iY2){// result in m, coords in grid coords. Returns 0 if no distance is calculated.
-            
-    bool bIsInBasin;
-	double dDist = 1;
-	int iNextX = iX;
-	int iNextY = iY;      
-
-    if (iX2 <= 0 || iX2 >= pDEM->Get_NX() || iY2 <= 0 || iY2 >= pDEM->Get_NY() || 
-            iX <= 0 || iX >= pDEM->Get_NX() || iY <= 0 || iY >= pDEM->Get_NY() ) {
-        return 0;
-    }// if
-    do {
-        iX = iNextX;
-		iY = iNextY;
-        getNextCell(pDEM,iX,iY,iNextX,iNextY);            
-        if (fabs((double)(iX - iNextX + iY - iNextY)) == 1.0) {
-            dDist = dDist + pDEM->Get_Cellsize();
-        }// if
-        else {
-            dDist = dDist + 1.414 * pDEM->Get_Cellsize();
-        }// else
-        if (iX == iX2 && iY == iY2) {
-            return dDist;
-        }// if
-		if (iBasin == GLOBAL_BASIN){
-			bIsInBasin = !pBasinGrid->is_NoData(iX,iY);
-		}//if
-		else{
-			bIsInBasin = (pBasinGrid->asInt(iX,iY) == iBasin);
-		}//else
-    }while (bIsInBasin
-		&&(iX!=iNextX || iY!=iNextY));
-
-    return 0;
-
-}// method
-
-
-double AccFlow(CSG_Grid *pGrid, CSG_Grid *pDEM, int iX, int iY){
-	
-    int iNextX, iNextY;
-	double dAccFlow = pGrid->Get_Cellsize()*pGrid->Get_Cellsize();
-			
-	for (int i = -1; i<2; i++){
-		for (int j = -1; j<2; j++){
-			if (!(i == 0) || !(j == 0)) {
-				getNextCell(pDEM, iX + i, iY + j, iNextX, iNextY);
-				if (iNextY == iY && iNextX == iX) {
-					if (pGrid->asDouble(iX+i,iY+j)!=0){
-						dAccFlow += pGrid->asDouble(iX+i,iY+j);
-					}//if
-					else{
-						dAccFlow += AccFlow (pGrid,pDEM,iX+i,iY+j);
-					}//else
-				}// if				
-			}//if				
-		}//for
-	}//for
-
-	pGrid->Set_Value(iX,iY,dAccFlow);
-
-	return dAccFlow;
-
-}// function
-
-double CalculateBasinGrid(CSG_Grid *pBasinGrid, 
-						CSG_Grid *pDEM, 			
-						int iOutletX, 
-						int iOutletY){
-
-	pBasinGrid->Assign((double)0);
-	double dAccFlow = AccFlow(pBasinGrid,pDEM,iOutletX,iOutletY);
-
-	return dAccFlow;
-
-}//function
-
-void CalculateFlowAccGrid(CSG_Grid *pFlowAccGrid, 
-						CSG_Grid *pDEM){
-
-	int x,y;
-	
-	pFlowAccGrid->Assign((double)0);
-	for(y=0; y<pDEM->Get_NY(); y++){
-		for(x=0; x<pDEM->Get_NX(); x++){
-			AccFlow(pFlowAccGrid,pDEM,x,y);
-		}//for
-	}//for
-
-	pFlowAccGrid->Set_Description(_TL("Acc. Area"));
-	pFlowAccGrid->Set_Unit(_TL("m2"));
-	
-}//function
-
-
-/*
-#include <vector>
-
-TSG_Point ** RiverProfile(int iX, 
-				  int iY, 
-				  CSG_Grid* pDEM, 
-				  CSG_Grid* pBasinGrid,
-				  CSG_Grid* pExtGrid,
-				  int &iProfileLength){
-
-    int i;
-	float fLength = 0;        	
-	int iNextX, iNextY;
-	CSG_Points	Profile;
-	CSG_Points	Ext;
-	TSG_Point		P;
-	TSG_Point		**pProfile;
-	iProfileLength = 0;
-	
-	if (!pBasinGrid->is_NoData(iX,iY)) {
-        iNextX = iX;
-		iNextY = iY;
-		do {
-			iX = iNextX;
-			iY = iNextY;
-			getNextCell(pDEM, iX, iY, iNextX, iNextY);
-		
-			if (fabs(iX - iNextX + iY - iNextY) == 1) {
-	            fLength += pDEM->Get_DX();
-            }//if
-            else {
-				fLength += (1.414f * pDEM->Get_DX());
-            }//else			
-			P.x = fLength;
-			P.y = pDEM->asFloat(iNextX, iNextY);
-			Profile.push_back(P);
-			P.y = pExtGrid->asFloat(iNextX, iNextY);
-			Ext.push_back(P);
-		}while (!pBasinGrid->is_NoData(iX, iY)
-			&& (iX != iNextX || iY != iNextY));
-
-		pProfile = new Pt*[2];
-		for (i = 0; i<2; i++){
-			pProfile[i] = new Pt [Profile.size()];
-		}//for
-		for (i = 0; i<Profile.size(); i++){			
-			pProfile[0][i]=Profile.at(i);		
-			pProfile[1][i]=Ext.at(i);		
-		}//for
-		iProfileLength = Profile.size();
-	
-	}// if
-
-	return pProfile;
-
-}//method
-
-Pt* RiverCoords(int iX,  //the resulting coords are grid coords, 
-				  int iY, 
-				  CSG_Grid* pDEM, 
-				  CSG_Grid* pBasinGrid, 				   
-				  int &iProfileLength){
-
-    float fLength = 0;        	
-	int iNextX, iNextY;
-	CSG_Points	Profile;
-	TSG_Point		P;
-	TSG_Point		*pProfile;
-	iProfileLength = 0;
-	
-	if (!pBasinGrid->is_NoData(iX,iY)) {
-        iNextX = iX;
-		iNextY = iY;
-		do {
-			iX = iNextX;
-			iY = iNextY;
-			getNextCell(pDEM, iX, iY, iNextX, iNextY);				
-			P.x = iX;
-			P.y = iY;
-			Profile.push_back(P);
-		}while (!pBasinGrid->is_NoData(iX, iY)
-			&& (iX != iNextX || iY != iNextY));
-
-		pProfile = new Pt [Profile.size()];
-		for (int i = 0; i<Profile.size(); i++){
-			pProfile[i]=Profile.at(i);
-		}//for
-		iProfileLength = Profile.size();
-	
-	}// if
-
-	return pProfile;
-
-}//method
-
-float DrainageDensity(CSG_Shapes *pHeaders,
-					  CSG_Shapes *pBasins,
-					  CSG_Grid *pBasinGrid,
-					  CSG_Grid *pDEM){
-
-	CSG_Grid * pChannelsGrid;	
-	float fLength = 0;        
-	int iX, iY;
-	int iNextX, iNextY;
-
-	pChannelsGrid = new CSG_Grid(pDEM, SG_DATATYPE_Byte);
-	pChannelsGrid->Assign(0);
-		
-	for (int i = 0; i < pHeaders->Get_Count(); i++) {
-
-        iX = (pHeaders->Get_Shape(i)->Get_Point(0).x - pBasinGrid->Get_XMin())/pBasinGrid->Get_DX();
-		iY = (pHeaders->Get_Shape(i)->Get_Point(0).y - pBasinGrid->Get_YMin())/pBasinGrid->Get_DX();  
-
-        if (!pBasinGrid->is_NoData(iX,iY)) {
-                iNextX = iX;
-				iNextY = iY;
-			do {
-				iX = iNextX;
-				iY = iNextY;
-				getNextCell(pDEM, iX, iY, iNextX, iNextY);
-			
-				if (fabs(iX - iNextX + iY - iNextY) == 1) {
-	                fLength += pChannelsGrid->Get_DX();
-                }//if
-                else {
-					fLength += (1.414f * pChannelsGrid->Get_DX());
-                }//else
-                if (pChannelsGrid->asFloat(iX,iY) == 0) {
-				    pChannelsGrid->Set_Value(iX, iY, 1);
-                }// if
-                else {
-					break;
-                }// else								
-			}while (!pBasinGrid->is_NoData(iX, iY)
-				&& (iX != iNextX || iY != iNextY));
-
-		}// if
-	}// for	
-
-	float fArea = pBasins->Get_Shape(0)->asFloat(4);
-		
-	return fLength / fArea / 10000.0;
-
-}//method
-
-void ClosingPoint(CSG_Grid* pDEM, 
-				  CSG_Grid* pBasinGrid, 
-				  int &iClosingX,
-				  int &iClosingY){
-
-    int x,y;
-	int iX,iY;
-	int iNextX, iNextY;
-
-	for (x = 0; x<pBasinGrid->Get_NX(); x++){
-		for (y = 0; y<pBasinGrid->Get_NY(); y++){
-			if (!pBasinGrid->is_NoData(x,y)){
-				iX = x;
-				iY = y;
-				goto out;
-			}//if
-		}//for
-	}//for
-	return;
-out:
-
-    iNextX = iX;
-	iNextY = iY;
-	do {
-		iX = iNextX;
-		iY = iNextY;
-		getNextCell(pDEM, iX, iY, iNextX, iNextY);
-	}while (!pBasinGrid->is_NoData(iX, iY)
-		&& (iX != iNextX || iY != iNextY));
-
-	iClosingX = iX;
-	iClosingY = iY;
-
-}//method*/
\ No newline at end of file
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.h
deleted file mode 100644
index 0087286..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**********************************************************
- * Version $Id: Helper.h 1016 2011-04-27 18:40:36Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Helper.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include <saga_api/saga_api.h>
-
-#define GLOBAL_BASIN -1
-
-void getNextCell(CSG_Grid*,int,int,int &,int &);
-void getNextCell(CSG_Grid*,CSG_Grid*,int,int,int&,int&);
-double FlowDistance(CSG_Grid*,CSG_Grid*,int,int,int,int,int);
-
-double CalculateBasinGrid(CSG_Grid*, CSG_Grid*, int, int);
-void CalculateFlowAccGrid(CSG_Grid*, CSG_Grid*);
-
-//TSG_Point ** RiverProfile(int, int, CSG_Grid*, CSG_Grid*, CSG_Grid*, int &);
-//TSG_Point  * RiverCoords (int, int, CSG_Grid*, CSG_Grid*, int &);
-//float DrainageDensity(CSG_Shapes*, CSG_Shapes*, CSG_Grid*, CSG_Grid*);
-//void ClosingPoint(CSG_Grid*, CSG_Grid*, int &, int &);
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.cpp
deleted file mode 100644
index 228f8c5..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/**********************************************************
- * Version $Id: IsochronesConst.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    IsochronesConst.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "Helper.h"
-#include "IsochronesConst.h"
-
-CIsochronesConst::CIsochronesConst(void){
-
-	Set_Name(_TL("Isochrones Constant Speed"));
-	Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya"));
-	Set_Description	(_TW(
-		"(c) 2004 by Victor Olaya. Isochrones calculation with constant speed"));
-
-	Parameters.Add_Grid(NULL, 
-						"DEM", 
-						_TL("Elevation Grid"), 
-						_TL(""), 
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL, 
-						"TIME", 
-						_TL("Time Out (h)"), 
-						_TL(""), 
-						PARAMETER_OUTPUT, 
-						true, 
-						SG_DATATYPE_Double);
-
-}//constructor
-
-
-CIsochronesConst::~CIsochronesConst(void){
-	On_Execute_Finish();
-}
-
-
-void CIsochronesConst::writeTimeOut(
-        int iX1,
-        int iY1,
-        int iX2,
-        int iY2) {
-	
-    int iNextX, iNextY;
-	double dDist = 1;
-	
-	if (iX1 < 0 || iX1 >= m_pDEM->Get_NX() || iY1 < 0 || iY1 >= m_pDEM->Get_NY()
-            || m_pDEM->is_NoData(iX1,iY1)) {        
-    }// if
-	else {				
-		if (abs(iX1 - iX2 + iY1 - iY2) == 1) {
-            dDist = m_pDEM->Get_Cellsize();
-        }// if
-        else {
-            dDist = 1.414 * m_pDEM->Get_Cellsize();
-        }// else
-		m_pTime->Set_Value(iX1,iY1,m_pTime->asDouble(iX2,iY2) + dDist);        
-
-		for (int i = -1; i<2; i++){
-			for (int j = -1; j<2; j++){
-				if (!(i == 0) || !(j == 0)) {
-					getNextCell(m_pDEM, iX1 + i, iY1 + j, iNextX, iNextY);
-					if (iNextY == iY1 && iNextX == iX1) {
-						writeTimeOut(iX1 + i, iY1 + j, iX1, iY1);
-					}// if				
-				}//if				
-			}//for
-		}//for
-    }// else
-
-}// method
-
-bool CIsochronesConst::On_Execute(void){
-	
-	m_pDEM = Parameters("DEM")->asGrid(); 
-	m_pTime = Parameters("TIME")->asGrid();
-	m_pTime->Assign(0.0);
-
-	return true;
-
-}//method
-
-bool CIsochronesConst::On_Execute_Finish(void)
-{
-	return( true );
-}
-
-bool CIsochronesConst::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
-{	
-	int x,y;
-	int iX, iY;		
-	int iHighX, iHighY;
-
-	if(	Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iX, iY) )
-	{
-		return( false );
-	}
-
-	m_pTime->Assign(0.0);
-	
-	writeTimeOut(iX, iY, iX, iY);
-    
-	double dMax = m_pTime->Get_ZMax();
-
-    for(y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(x=0; x<Get_NX(); x++){
-			double dValue = m_pTime->asDouble(x,y);
-            if (dValue == dMax){
-				iHighX = x;
-				iHighY = y;				
-			}//if
-        }// for
-    }// for
-	
-	double dMaxDist = m_pTime->Get_ZMax();
-	double dH1 = m_pDEM->asDouble(iX,iY);
-	double dH2 = m_pDEM->asDouble(iHighX,iHighY);
-	double dConcTime = pow(0.87 * pow(dMaxDist / 1000, 3)
-                / (dH2 - dH1),
-                0.385);
-	double dSpeed = dMaxDist / dConcTime;
-	
-	for(y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(x=0; x<Get_NX(); x++){
-			if (m_pTime->asDouble(x,y)){
-				m_pTime->Set_Value(x,y, m_pTime->asDouble(x,y)/dSpeed);
-			}//if
-		}//for
-	}//for
-
-	m_pTime->Set_NoData_Value(0.0);
-
-	DataObject_Update(m_pTime, true);
-
-	return (true);
-
-}//method
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h
deleted file mode 100644
index 8a118b7..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**********************************************************
- * Version $Id: IsochronesConst.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    IsochronesConst.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#ifndef HEADER_INCLUDED__IsochronesConst_H
-#define HEADER_INCLUDED__IsochronesConst_H
-
-#include "MLB_Interface.h"
-
-class CIsochronesConst : public CSG_Module_Grid_Interactive
-{
-public:
-	CIsochronesConst(void);
-	virtual ~CIsochronesConst(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
-
-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);
-
-private:
-	CSG_Grid *m_pDEM;
-	CSG_Grid *m_pTime;	
-	void writeTimeOut(int,int,int,int);
-
-};
-
-#endif // #ifndef HEADER_INCLUDED__IsochronesConst_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.cpp
deleted file mode 100644
index f72b375..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-/**********************************************************
- * Version $Id: IsochronesVar.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    IsochronesVar.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-#include "IsochronesVar.h"
-#include "Helper.h"
-
-#ifndef max
-#define max(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-
-CIsochronesVar::CIsochronesVar(void){
-
-	Parameters.Set_Name(_TL("Isochrones Variable Speed"));
-	Parameters.Set_Description(_TW(
-		"(c) 2004 by Victor Olaya. C�lculo del tiempo de salida con velocidad variable.\r\n"
-		"References:\r\n"
-		"1. Al-Smadi, Mohammad: Incorporating spatial and temporal variation of "
-		"watershed response in a gis-based hydrologic model. Faculty of the Virginia Polythecnic"
-		"Insitute and State University. MsC Thesis. 1998 \r\n"
-		"Available at scholar.lib.vt.edu/theses/available/ etd-121698-112858/unrestricted/smadi.pdf"
-		"2. Mart�nez �lvarez, V.; Dal-R� Tenreiro, R.; Garc�a Garc�a, A. I.; Ayuga T�llez, F. "
-		"Modelaci�n distribuida de la escorrent�a superficial en peque�as cuencas mediante SIG. Evaluaci�n experimental.\r\n "
-		"3. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"));
-
-	Parameters.Add_Grid(NULL,
-						"DEM",
-						_TL("Elevation"),
-						_TL(""),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL,
-						"SLOPE",
-						_TL("Slope"),
-						_TL(""),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL,
-						"FLOWACC",
-						_TL("Catchment Area"),
-						_TL(""),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL,
-						"CN",
-						_TL("Curve Number"),
-						_TL(""),
-						PARAMETER_INPUT_OPTIONAL);
-
-	Parameters.Add_Grid(NULL,
-						"MANNING",
-						_TL("Manning's N"),
-						_TL(""),
-						PARAMETER_INPUT_OPTIONAL);
-
-	Parameters.Add_Value(NULL,
-						"AVGMANNING",
-						_TL("Avg. Manning's N"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						0.15);
-
-	Parameters.Add_Value(NULL,
-						"AVGCN",
-						_TL("Avg. Curve Number"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						75);
-
-	Parameters.Add_Value(NULL,
-						"THRSMIXED",
-						_TL("Mixed Flow Threshold (ha)"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						18);
-
-	Parameters.Add_Value(NULL,
-						"THRSCHANNEL",
-						_TL("Channel Definition Threshold (ha)"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						360);
-
-	Parameters.Add_Value(NULL,
-						"AVGRAINFALL",
-						_TL("Avg. Rainfall Intensity (mm/h)"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						1);
-
-
-	Parameters.Add_Value(NULL,
-						"CHANSLOPE",
-						_TL("Channel side slope(m/m)"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						0.5);
-
-	Parameters.Add_Value(NULL,
-						"MINSPEED",
-						_TL("Min. Flow Speed (m/s)"),
-						_TL(""),
-						PARAMETER_TYPE_Double,
-						0.05);
-
-	Parameters.Add_Grid(NULL,
-						"TIME",
-						_TL("Time Out(h)"),
-						_TL(""),
-						PARAMETER_OUTPUT,
-						true,
-						SG_DATATYPE_Double);
-
-	Parameters.Add_Grid(NULL,
-						"SPEED",
-						_TL("Speed (m/s)"),
-						_TL(""),
-						PARAMETER_OUTPUT,
-						true,
-						SG_DATATYPE_Double);
-
-}//constructor
-
-
-CIsochronesVar::~CIsochronesVar(void){
-	Execute_Finish();
-}
-
-
-void CIsochronesVar::writeTimeOut(
-        int iX1,
-        int iY1,
-        int iX2,
-        int iY2) {
-
-    double dDist = 1;
-    double dD = 0;
-    double dSlope;
-    double dSpeed;
-    double dQ = 0;
-    double dH;
-    double dSup;
-    double dInf;
-    double dAcc;
-    double dArea = 0;
-    double dPerim;
-    double dDif;
-    double dManning;
-	double dCN;
-    double dI = 0;
-	int iIter;
-	int iNextX, iNextY;
-
-	if (iX1 < 0 || iX1 >= m_pDEM->Get_NX() || iY1 < 0 || iY1 >= m_pDEM->Get_NY()
-            || m_pDEM->asFloat(iX1,iY1) == m_pDEM->Get_NoData_Value()) {
-    }// if
-	else {
-
-		if (m_pCN!=NULL){
-			dCN = m_pCN->asDouble(iX1, iY1);
-			if (dCN == m_pCN->Get_NoData_Value()) {
-                dCN = m_dCN;
-			}// if
-		}//if
-		else{
-			dCN = m_dCN;
-		}//else
-		dI = Runoff(m_dRainfall, dCN);
-		dI /= 3600.0;// in mm/s
-        dI /= 1000.0;// m/s of runoff;
-
-		if (abs(iX1 - iX2 + iY1 - iY2) == 1) {
-            dDist = m_pDEM->Get_Cellsize();
-        }// if
-        else {
-            dDist = 1.44 * m_pDEM->Get_Cellsize();
-        }// else
-		dSlope = m_pSlope->asDouble(iX1,iY1);
-		dSlope = fabs(tan(dSlope));
-		dSlope = max(0.001, dSlope);
-		dAcc = m_pCatchArea->asDouble(iX1,iY1);
-        if (dAcc < m_dMixedThresh) {
-            dD = sqrt(2.0 * dAcc / 3.14159);
-			if (m_pManning!=NULL){
-				dManning = m_pManning->asDouble(iX1, iY1);
-				if (dManning == m_pManning->Get_NoData_Value()) {
-	                dManning = m_dManning;
-		        }// if
-			}//id
-			else{
-				dManning = m_dManning;
-			}//else
-            dSpeed = max(m_dMinSpeed, pow(dI * dD, 0.4)
-                    * pow(dSlope, 0.3) / pow(dManning, 0.6));
-        }// if
-        else{
-			if (dAcc < m_dChannelThresh) {
-				dManning = 0.06;
-			}//if
-			else{
-				dManning= 0.05;
-			}//if
-            dQ = dI * dAcc; // Q m3/s
-            dSup = 60;
-            dInf = 0;
-            dH = 2;
-            dArea = dH * dH / m_dChannelSlope;
-            dPerim = 2.0 * (dH / m_dChannelSlope + sqrt(dH * dH
-					+ pow(dH / m_dChannelSlope, 2.0)));
-            dDif = (sqrt(dSlope)
-                    * pow(dArea, 5.0 / 3.0)
-                    / pow(dPerim, 2.0 / 3.0) / dManning)
-                    - dQ;
-            iIter = 0;
-			do {
-                if (dDif > 0) {
-                    dSup = dH;
-                    dH = (dInf + dH) / 2.0;
-                }// if
-                else if (dDif < 0) {
-                    dInf = dH;
-                    dH = (dSup + dH) / 2.0;
-                }// else if
-                dArea = dH * dH / m_dChannelSlope;
-                dPerim = 2.0 * (dH / m_dChannelSlope + sqrt(dH * dH
-						+ pow(dH / m_dChannelSlope, 2.0)));
-                dDif = (sqrt(dSlope)
-                        * pow(dArea, 5.0 / 3.0)
-                        / pow(dPerim, 2.0 / 3.0) / dManning)
-                        - dQ;
-				iIter++;
-            }while (fabs(dDif) > 0.1);
-            dSpeed = max(m_dMinSpeed, dQ / dArea);
-        }// else
-
-		m_pTime->Set_Value(iX1,iY1,m_pTime->asDouble(iX2,iY2) + dDist / dSpeed);
-		m_pSpeed->Set_Value(iX1,iY1, dSpeed);
-
-		for (int i = -1; i<2; i++){
-			for (int j = -1; j<2; j++){
-				if (!(i == 0) || !(j == 0)) {
-					getNextCell(m_pDEM, iX1 + i, iY1 + j, iNextX, iNextY);
-					if (iNextY == iY1 && iNextX == iX1) {
-						writeTimeOut(iX1 + i, iY1 + j, iX1, iY1);
-					}// if
-				}//if
-			}//for
-		}//for
-
-    }// else
-
-}// method
-
-double CIsochronesVar::Runoff(
-        double dRainfall,
-        double dCN) {
-
-    double dS;
-    double dRunoff;
-
-    dS = (25400.0 / dCN) - 254;
-
-    if (dRainfall < (0.2 * dS)) {
-        return 0.1; //can�t be 0, because that would mean speed = 0
-    }// if
-
-    dRunoff = pow(dRainfall - 0.2 * dS, 2)
-            / (dRainfall + 0.8 * dS);
-
-    return dRunoff;
-
-}// method
-
-void CIsochronesVar::ZeroToNoData(void){
-
-
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++){
-		for(int x=0; x<Get_NX(); x++){
-            if (m_pTime->asDouble(x,y) == 0){
-				m_pTime->Set_Value(x,y,m_pTime->Get_NoData_Value());
-			}//if
-            if (m_pSpeed->asDouble(x,y) == 0){
-				m_pSpeed->Set_Value(x,y,m_pSpeed->Get_NoData_Value());
-			}//if
-        }// for
-    }// for
-
-}//method
-
-bool CIsochronesVar::On_Execute(void){
-
-	m_pDEM = Parameters("DEM")->asGrid();
-	m_pTime = Parameters("TIME")->asGrid();
-	m_pSpeed = Parameters("SPEED")->asGrid();
-	m_pManning = Parameters("MANNING")->asGrid();
-	m_pSlope = Parameters("SLOPE")->asGrid();
-	m_pCatchArea = Parameters("FLOWACC")->asGrid();
-	m_pCN = Parameters("CN")->asGrid();
-	m_dMixedThresh = Parameters("THRSMIXED")->asDouble() * 10000;
-	m_dChannelThresh = Parameters("THRSCHANNEL")->asDouble() * 10000;
-	m_dCN = Parameters("AVGCN")->asDouble();
-	m_dManning = Parameters("AVGMANNING")->asDouble();
-	m_dRainfall = Parameters("AVGRAINFALL")->asDouble();
-	m_dChannelSlope = Parameters("CHANSLOPE")->asDouble();
-	m_dMinSpeed = Parameters("MINSPEED")->asDouble();
-
-	m_pTime->Assign((double)0);
-
-	return true;
-
-}//method
-
-bool CIsochronesVar::On_Execute_Finish()
-{
-	return( true );
-}
-
-bool CIsochronesVar::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 );
-	}
-	
-	m_pTime->Assign((double)0);
-
-	writeTimeOut(iX, iY, iX, iY);
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++){
-		for(int x=0; x<Get_NX(); x++){
-			m_pTime->Set_Value(x,y,m_pTime->asDouble(x,y)/3600.);
-        }// for
-    }// for
-
-	ZeroToNoData();
-
-	DataObject_Update(m_pTime, true);
-
-	return (true);
-
-}//method
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h
deleted file mode 100644
index 0cb6c83..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/**********************************************************
- * Version $Id: IsochronesVar.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    IsochronesVar.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CIsochronesVar : public CSG_Module_Grid_Interactive
-{
-public:
-	CIsochronesVar(void);
-	virtual ~CIsochronesVar(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
-
-protected:
-	virtual bool On_Execute(void);
-	virtual bool On_Execute_Finish();
-	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
-
-private:
-	CSG_Grid *m_pDEM;
-	CSG_Grid *m_pTime;
-	CSG_Grid *m_pSpeed;
-	CSG_Grid *m_pManning;
-	CSG_Grid *m_pCN;
-	CSG_Grid *m_pCatchArea;
-	CSG_Grid *m_pSlope;
-	double m_dManning;
-	double m_dCN;
-	double m_dRainfall;
-	double m_dMixedThresh;
-	double m_dChannelThresh;
-	double m_dChannelSlope;
-	double m_dMinSpeed;
-	void writeTimeOut(int,int,int,int);
-	void ZeroToNoData(void);
-	double Runoff(double, double);
-
-};
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp
deleted file mode 100644
index dc6a69f..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//			The Module Link Library Interface			 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-//---------------------------------------------------------
-CSG_String Get_Info(int i)
-{
-	switch( i )
-	{
-	case MLB_INFO_Name:	default:
-		return( _TL("Terrain Analysis - Hydrology") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O. Conrad, V. Olaya (c) 2001-4") );
-
-	case MLB_INFO_Description:
-		return( _TL("Tools for digital terrain analysis.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("Terrain Analysis|Hydrology") );
-	}
-}
-
-
-//---------------------------------------------------------
-#include "Flow_Parallel.h"
-#include "Flow_RecursiveUp.h"
-#include "Flow_RecursiveDown.h"
-#include "Flow_AreaUpslope.h"
-#include "Flow_AreaDownslope.h"
-
-#include "Flow_Distance.h"
-#include "SlopeLength.h"
-
-#include "EdgeContamination.h"
-
-#include "IsochronesConst.h"
-#include "IsochronesVar.h"
-
-#include "CellBalance.h"
-#include "Sinuosity.h"
-
-#include "FlowDepth.h"
-
-#include "TopographicIndices.h"
-#include "SAGA_Wetness_Index.h"
-
-#include "LakeFlood.h"
-
-#include "flow_massflux.h"
-#include "flow_width.h"
-
-#include "melton_ruggedness.h"
-
-#include "Erosion_LS_Fields.h"
-
-
-//---------------------------------------------------------
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case  0:	return( new CFlow_Parallel );
-	case  1:	return( new CFlow_RecursiveUp );
-	case  2:	return( new CFlow_RecursiveDown );
-	case  3:	return( new CFlow_AreaUpslope_Interactive );
-	case  4:	return( new CFlow_AreaUpslope_Area );
-	case  5:	return( new CFlow_AreaDownslope );
-	case  6:	return( new CFlow_Distance );
-	case  7:	return( new CSlopeLength );
-	case  8:	return( new CIsochronesConst );
-	case  9:	return( new CIsochronesVar );
-	case 10:	return( new CCellBalance );
-	case 11:	return( new CSinuosity );
-	case 12:	return( new CFlowDepth );
-	case 13:	return( new CEdgeContamination );
-	case 14:	return( MLB_INTERFACE_SKIP_MODULE );	// removed: CTopographicIndices
-	case 15:	return( new CSAGA_Wetness_Index );
-	case 16:	return( new CLakeFlood );
-	case 17:	return( new CLakeFloodInteractive );
-	case 18:	return( new CFlow_MassFlux );
-	case 19:	return( new CFlow_Width );
-	case 20:	return( new CTWI );
-	case 21:	return( new CStream_Power );
-	case 22:	return( new CLS_Factor );
-	case 23:	return( new CMelton_Ruggedness );
-	case 24:	return( new CTCI_Low );
-	case 25:	return( new CErosion_LS_Fields );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.am b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.am
deleted file mode 100644
index c018e79..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# $Id: Makefile.am 1824 2013-09-05 08:48:21Z oconrad $
-#
-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 = libta_hydrology.la
-libta_hydrology_la_SOURCES =\
-CellBalance.cpp\
-EdgeContamination.cpp\
-Erosion_LS_Fields.cpp\
-Flow.cpp\
-Flow_AreaDownslope.cpp\
-Flow_AreaUpslope.cpp\
-Flow_Distance.cpp\
-Flow_Parallel.cpp\
-Flow_RecursiveDown.cpp\
-Flow_RecursiveUp.cpp\
-flow_massflux.cpp\
-flow_width.cpp\
-FlowDepth.cpp\
-Helper.cpp\
-IsochronesConst.cpp\
-IsochronesVar.cpp\
-LakeFlood.cpp\
-LakeFloodInteractive.cpp\
-MLB_Interface.cpp\
-melton_ruggedness.cpp\
-SAGA_Wetness_Index.cpp\
-Sinuosity.cpp\
-SlopeLength.cpp\
-TopographicIndices.cpp\
-CellBalance.h\
-EdgeContamination.h\
-Erosion_LS_Fields.h\
-Flow.h\
-Flow_AreaDownslope.h\
-Flow_AreaUpslope.h\
-Flow_BRM.h\
-Flow_Distance.h\
-Flow_Parallel.h\
-Flow_RecursiveDown.h\
-Flow_RecursiveUp.h\
-flow_massflux.h\
-flow_width.h\
-FlowDepth.h\
-Helper.h\
-IsochronesConst.h\
-IsochronesVar.h\
-LakeFlood.h\
-MLB_Interface.h\
-melton_ruggedness.h\
-SAGA_Wetness_Index.h\
-Sinuosity.h\
-SlopeLength.h\
-TopographicIndices.h
-
-libta_hydrology_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.in
deleted file mode 100644
index 6134518..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.in
+++ /dev/null
@@ -1,650 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis/ta_hydrology
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_hydrology_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_hydrology_la_OBJECTS = CellBalance.lo EdgeContamination.lo \
-	Erosion_LS_Fields.lo Flow.lo Flow_AreaDownslope.lo \
-	Flow_AreaUpslope.lo Flow_Distance.lo Flow_Parallel.lo \
-	Flow_RecursiveDown.lo Flow_RecursiveUp.lo flow_massflux.lo \
-	flow_width.lo FlowDepth.lo Helper.lo IsochronesConst.lo \
-	IsochronesVar.lo LakeFlood.lo LakeFloodInteractive.lo \
-	MLB_Interface.lo melton_ruggedness.lo SAGA_Wetness_Index.lo \
-	Sinuosity.lo SlopeLength.lo TopographicIndices.lo
-libta_hydrology_la_OBJECTS = $(am_libta_hydrology_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_hydrology_la_SOURCES)
-DIST_SOURCES = $(libta_hydrology_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1824 2013-09-05 08:48:21Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libta_hydrology.la
-libta_hydrology_la_SOURCES = \
-CellBalance.cpp\
-EdgeContamination.cpp\
-Erosion_LS_Fields.cpp\
-Flow.cpp\
-Flow_AreaDownslope.cpp\
-Flow_AreaUpslope.cpp\
-Flow_Distance.cpp\
-Flow_Parallel.cpp\
-Flow_RecursiveDown.cpp\
-Flow_RecursiveUp.cpp\
-flow_massflux.cpp\
-flow_width.cpp\
-FlowDepth.cpp\
-Helper.cpp\
-IsochronesConst.cpp\
-IsochronesVar.cpp\
-LakeFlood.cpp\
-LakeFloodInteractive.cpp\
-MLB_Interface.cpp\
-melton_ruggedness.cpp\
-SAGA_Wetness_Index.cpp\
-Sinuosity.cpp\
-SlopeLength.cpp\
-TopographicIndices.cpp\
-CellBalance.h\
-EdgeContamination.h\
-Erosion_LS_Fields.h\
-Flow.h\
-Flow_AreaDownslope.h\
-Flow_AreaUpslope.h\
-Flow_BRM.h\
-Flow_Distance.h\
-Flow_Parallel.h\
-Flow_RecursiveDown.h\
-Flow_RecursiveUp.h\
-flow_massflux.h\
-flow_width.h\
-FlowDepth.h\
-Helper.h\
-IsochronesConst.h\
-IsochronesVar.h\
-LakeFlood.h\
-MLB_Interface.h\
-melton_ruggedness.h\
-SAGA_Wetness_Index.h\
-Sinuosity.h\
-SlopeLength.h\
-TopographicIndices.h
-
-libta_hydrology_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_hydrology.la: $(libta_hydrology_la_OBJECTS) $(libta_hydrology_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_hydrology_la_OBJECTS) $(libta_hydrology_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/CellBalance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/EdgeContamination.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Erosion_LS_Fields.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FlowDepth.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_AreaDownslope.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_AreaUpslope.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Distance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Parallel.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_RecursiveDown.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_RecursiveUp.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Helper.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/IsochronesConst.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/IsochronesVar.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LakeFlood.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LakeFloodInteractive.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SAGA_Wetness_Index.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Sinuosity.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SlopeLength.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/TopographicIndices.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flow_massflux.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flow_width.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/melton_ruggedness.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp
deleted file mode 100644
index 48649e3..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp
+++ /dev/null
@@ -1,975 +0,0 @@
-/**********************************************************
- * Version $Id: SAGA_Wetness_Index.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 SAGA_Wetness_Index.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.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "SAGA_Wetness_Index.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSAGA_Wetness_Index::CSAGA_Wetness_Index(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("SAGA Wetness Index"));
-
-	Set_Author		(SG_T("(c) 2001 by J.Boehner, O.Conrad"));
-
-	Set_Description	(_TW(
-		"The 'SAGA Wetness Index' is, as the name says, similar to the "
-		"'Topographic Wetness Index' (TWI), but it is based on a modified "
-		"catchment area calculation ('Modified Catchment Area'), which does "
-		"not think of the flow as very thin film. As result it predicts for "
-		"cells situated in valley floors with a small vertical distance to "
-		"a channel a more realistic, higher potential soil moisture compared "
-		"to the standard TWI calculation.\n\n"
-
-		"References\n"
-
-		"- Boehner, J., Koethe, R. Conrad, O., Gross, J., Ringeler, A., Selige, T. (2002): "
-		"Soil Regionalisation by Means of Terrain Analysis and Process Parameterisation. "
-		"In: Micheli, E., Nachtergaele, F., Montanarella, L. [Ed.]: Soil Classification 2001. "
-		"European Soil Bureau, Research Report No. 7, EUR 20398 EN, Luxembourg. pp.213-222."
-	));
-
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "AREA"		, _TL("Catchment area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SLOPE"		, _TL("Catchment slope"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "AREA_MOD"	, _TL("Modified Catchment Area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "TWI"			, _TL("Topographic Wetness Index"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "SUCTION"		, _TL("Suction"),
-		_TL("the lower this value is the stronger is the suction effect"),
-		PARAMETER_TYPE_Double	, 10.0, 0.0, true
-	);
-
-	CSG_Parameter	*pNode	= Parameters.Add_Node(
-		NULL	, "TWI_NODE"	, _TL("Topograpic Wetness Index Calculation"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "AREA_TYPE"	, _TL("Type of Area"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("absolute catchment area"),
-			_TL("square root of catchment area"),
-			_TL("specific catchment area")
-		), 1
-	);
-
-	Parameters.Add_Choice(
-		pNode	, "SLOPE_TYPE"	, _TL("Type of Slope"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("local slope"),
-			_TL("catchment slope")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "SLOPE_MIN"	, _TL("Minimum Slope"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "SLOPE_OFF"	, _TL("Offset Slope"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.1, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "SLOPE_WEIGHT", _TL("Slope Weighting"),
-		_TL("weighting factor for slope in index calculation"),
-		PARAMETER_TYPE_Double	, 1.0, 0.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSAGA_Wetness_Index::On_Execute(void)
-{
-	//-----------------------------------------------------
-	m_pDEM		= Parameters("DEM")		->asGrid();
-	m_pSlope	= Parameters("SLOPE")	->asGrid();
-	m_pArea		= Parameters("AREA")	->asGrid();
-	m_pAreaMod	= Parameters("AREA_MOD")->asGrid();
-	m_pTWI		= Parameters("TWI")		->asGrid();
-
-	DataObject_Set_Colors(m_pArea   , 100, SG_COLORS_WHITE_BLUE);
-	DataObject_Set_Colors(m_pAreaMod, 100, SG_COLORS_WHITE_BLUE);
-	DataObject_Set_Colors(m_pSlope  , 100, SG_COLORS_YELLOW_RED);
-	DataObject_Set_Colors(m_pTWI    , 100, SG_COLORS_RED_GREY_BLUE);
-
-	m_pSlope->Set_ZFactor	(M_RAD_TO_DEG);
-	m_pSlope->Set_Unit		(_TL("Degree"));
-
-	//-----------------------------------------------------
-	Get_Area();
-
-	Get_Modified();
-
-	Get_TWI();
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CSAGA_Wetness_Index::Get_Local_Maximum(CSG_Grid *pGrid, int x, int y)
-{
-	double	z	= pGrid->asDouble(x, y);
-
-	for(int i=0, ix, iy; i<8; i++)
-	{
-		if( pGrid->Get_System().Get_Neighbor_Pos(i, x, y, ix, iy) && !pGrid->is_NoData(ix, iy) && pGrid->asDouble(ix, iy) > z )
-		{
-			z	= pGrid->asDouble(ix, iy);
-		}
-	}
-
-	return( z );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Im Unterschied zu Freeman's urspruenglichen Verfahren
-// wird der Winkel (atan(dz / dx)) und nicht das Gefaelle
-// (dz / dx) fuer die Gewichtung der Abfluszanteile benutzt!
-
-//---------------------------------------------------------
-bool CSAGA_Wetness_Index::Get_Area(void)
-{
-	const double	MFD_Converge	= 1.1;
-
-	int		x, y, i, ix, iy;
-	double	z, d, dz[8], dzSum, Area, Slope;
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("catchment area and slope..."));
-
-	m_pArea ->Assign(0.0);
-	m_pSlope->Assign(0.0);
-
-	m_Suction.Create(*Get_System());
-	m_Suction.Assign(0.0);
-
-	double	Suction			= Parameters("SUCTION"     )->asDouble();
-	double	Slope_Weight	= Parameters("SLOPE_WEIGHT")->asDouble();
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		m_pDEM->Get_Sorted(n, x, y, true, false);
-
-		if( m_pDEM->is_NoData(x, y) )
-		{
-			m_pArea ->Set_NoData(x, y);
-			m_pSlope->Set_NoData(x, y);
-			m_Suction.Set_NoData(x, y);
-		}
-		else
-		{
-			m_pDEM->Get_Gradient(x, y, Slope, d);
-
-			d	= pow(Suction, Slope_Weight * Slope);
-			m_Suction.Set_Value(x, y, pow(1.0 / d, exp(d)));
-
-			Area	= 1.0   + m_pArea ->asDouble(x, y);
-			Slope	= Slope + m_pSlope->asDouble(x, y);
-
-			m_pArea ->Set_Value(x, y, Area);
-			m_pSlope->Set_Value(x, y, Slope / Area);
-
-			for(i=0, dzSum=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
-			{
-				if( Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) && !m_pDEM->is_NoData(ix, iy) && (d = z - m_pDEM->asDouble(ix, iy)) > 0.0 )
-				{
-					dzSum	+= (dz[i] = pow(atan(d / Get_Length(i)), MFD_Converge));
-				}
-				else
-				{
-					dz[i]	= 0.0;
-				}
-			}
-
-			if( dzSum > 0.0 )
-			{
-				for(i=0; i<8; i++)
-				{
-					if( dz[i] > 0.0 )
-					{
-						ix		= Get_xTo(i, x);
-						iy		= Get_yTo(i, y);
-
-						d		= dz[i] / dzSum;
-
-						m_pArea ->Add_Value(ix, iy, d * Area);
-						m_pSlope->Add_Value(ix, iy, d * Slope);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	*m_pArea	*= m_pArea->Get_Cellarea();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// in den folgenden drei Schritten wird die gesaugte
-// Einzugsgebietsgroe�e CS ermittelt, wobei der t-Parameter
-// die Staerke der Saugung steuert. Werte unter 10 (z.B.  5)
-// fuehren zu einer starken Saugung, Werte ueber 10 (z.B. 15)
-// zu einer schwachen Saugung. Die gesaugte
-// Einzugsgebietsgroe�e selbst stellt bereits einen Parameter
-// dar, der die raeumliche Relief-bedingte Feuchteverteilung
-// in guter Weise annaehert
-
-//---------------------------------------------------------
-bool CSAGA_Wetness_Index::Get_Modified(void)
-{
-	int			y;
-
-	CSG_Grid	Area(*m_pArea);
-
-	m_pAreaMod->Assign(m_pArea);
-
-	//-----------------------------------------------------
-	int		nChanges	= 1;
-
-	for(int Iteration=1; nChanges && Process_Get_Okay(); Iteration++)
-	{
-		nChanges	= 0;
-
-		#pragma omp parallel for private(y) reduction(+:nChanges)
-		for(y=0; y<Get_NY(); y++)
-		{
-			Process_Get_Okay();
-
-			for(int x=0; x<Get_NX(); x++)
-			{
-				if( !m_Suction.is_NoData(x, y) )
-				{
-					double z	= m_Suction.asDouble(x, y) * Get_Local_Maximum(&Area, x, y);
-
-					if( z > Area.asDouble(x, y) )
-					{
-						nChanges++;
-
-						Area.Set_Value(x, y, z);
-					}
-				}
-			}
-		}
-
-		if( nChanges > 0 )
-		{
-			nChanges	= 0;
-
-			#pragma omp parallel for private(y)
-			for(y=0; y<Get_NY(); y++)
-			{
-				Process_Get_Okay();
-
-				for(int x=0; x<Get_NX(); x++)
-				{
-					if( Area.asDouble(x, y) != m_pAreaMod->asDouble(x, y) )
-					{
-						nChanges++;
-
-						m_pAreaMod->Set_Value(x, y, Area.asDouble(x, y));
-					}
-				}
-			}
-		}
-
-		Process_Set_Text(CSG_String::Format(SG_T("pass %d (%d > 0)"), Iteration, nChanges));
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("post-processing..."));
-
-	#pragma omp parallel for private(y)
-	for(y=0; y<Get_NY(); y++)
-	{
-		Process_Get_Okay();
-
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( !Area.is_NoData(x, y) )
-			{
-				bool	bModify	= false;
-				int		n		= 0;
-				double	z		= 0.0;
-
-				for(int iy=y-1; iy<=y+1; iy++)
-				{
-					for(int ix=x-1; ix<=x+1; ix++)
-					{
-						if( Area.is_InGrid(ix, iy) )
-						{
-							if( Area.asDouble(ix, iy) > m_pArea->asDouble(ix, iy) )
-							{
-								bModify	= true;
-							}
-
-							n	++;
-							z	+= Area.asDouble(ix, iy);
-						}
-					}
-				}
-
-				m_pAreaMod->Set_Value(x, y, bModify ? z / n : Area.asDouble(x, y));
-			}
-			else
-			{
-				m_pAreaMod->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSAGA_Wetness_Index::Get_TWI(void)
-{
-	int		Area_Type	= Parameters("AREA_TYPE" )->asInt();
-	int		Slope_Type	= Parameters("SLOPE_TYPE")->asInt();
-	double	Slope_Min	= Parameters("SLOPE_MIN" )->asDouble() * M_DEG_TO_RAD;
-	double	Slope_Off	= Parameters("SLOPE_OFF" )->asDouble() * M_DEG_TO_RAD;
-
-	Process_Set_Text(_TL("topographic wetness index..."));
-
-	#pragma omp parallel
-	for(int y=0; y<Get_NY(); y++)
-	{
-		Process_Get_Okay();
-
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( m_pAreaMod->is_NoData(x, y) || m_pSlope->is_NoData(x, y) )
-			{
-				m_pTWI->Set_NoData(x, y);
-			}
-			else
-			{
-				double	s, a;
-
-				if( Slope_Type == 1 )
-				{
-					s	= m_pSlope->asDouble(x, y);
-				}
-				else
-				{
-					m_pDEM->Get_Gradient(x, y, s, a);
-				}
-
-				s	= s + Slope_Off;
-				s	= 6 * tan(Slope_Min < s ? s : Slope_Min);
-
-				a	= m_pAreaMod->asDouble(x, y);
-
-				switch( Area_Type )
-				{
-				case 1:	a	= sqrt(a);				break;	// square root of catchment area
-				case 2:	a	= a / Get_Cellsize();	break;	// specific catchment area
-				}
-
-				m_pTWI->Set_Value(x, y, log(a / s));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//        The original BSL script by J.Boehner
-//---------------------------------------------------------
-
-/*
-Matrix Loop, O("sch-hoe.grd"), N("sch-nei.grd"), M, R, UL, LL, OL, OO, OR, RR, UR, UU, X, Y, Z, C, CS, SB;
-Point ploop, p, pul, pu, pur, pl, pr, pol, po, por;
-Float a, wul, wll, wol, woo, wor, wrr, wur, wuu;
-Integer t, h, i, j, gefunden;
-
-a = 0.0174532;
-t = 10; 
-pul.x = -1;	pul.y = -1; 
-pu.x = 0;	pu.y = -1;
-pur.x = 1;	pur.y = -1;
-pl.x = -1;	pl.y = 0;
-pr.x = 1;	pr.y = 0;
-pol.x = -1;	pol.y = 1;
-po.x = 0;	po.y = 1;
-por.x = 1;	por.y = 1;
-
-M = O;
-R = O;
-UL = O;
-LL = O;
-OL = O;
-OO = O;
-OR = O;
-RR = O;
-UR = O;
-UU = O;
-X = O;
-Y = O;
-Z = O;
-C = O;
-CS = O;
-SB = O;
-
-Loop.xanz = 100000;
-Loop.yanz = 1;
-h = 0;
-i = 0;
-j = 0;
-
-// hier wird eine Hilfsmatrix X erzeugt, die in der folgenden Schleife fafuer sorgt, dass noch nicht attributisierte Rasterzellen in Ihrer Position identifiziert werden koennen //
-foreach p in X do
-{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
-	{X[p] = -10000;}
-	else
-	{X[p] = M[p];}
-}
-// hier wird eine Matrix R erzeugt, die ausgehend von lokalen Maxima fortlaufend Rangplatzziffernerzeugt //
-foreach ploop in Loop do
-{	ploop.x = 1;
-	h = h +1;
-	gefunden = 0;
-	foreach p in X do
-	{
-	if (X[p] == max9(p, X) && X[p] > -10000)
-	{X[p] = -10000; R[p] = h; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(R);
-// hier wird eine Hilfsmatrix R erzeugt, die Rangplatzziffern am Rand duch 0 ersetzt //
-foreach p in R do
-{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
-	{R[p] = 0;}
-	else
-	{R[p] = R[p];}
-}
-// hier wird eine Matrix Z erzeugt, die die positiven Winkel zu den 8 Nachbarzellen aufsummiert //
-foreach p in Z do
-{
-if(p.x == 0 && p.y == 0)
-	{
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((woo + wor + wrr) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = woo + wor + wrr;}
-	}
-else
-{
-if(p.x == 0 && p.y == (M.yanz - 1))
-	{
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wrr + wur + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1 && p.y == M.yanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1 && p.y == 0)
-	{
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((wll + wol + woo) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wll + wol + woo;}
-	}
-else	
-{
-if(p.x == 0)
-	{
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((woo + wor + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = woo + wor + wrr + wur + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wol + woo + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wol + woo + wuu;}
-	}
-else	
-{
-if(p.y == 0)
-	{
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((wll + wol + woo + wor + wrr) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wll + wol + woo + wor + wrr;}
-	}
-else	
-{
-if(p.y == M.yanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wrr + wur + wuu;}
-	}
-else	
-{	
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wol + woo + wor + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wol + woo + wor + wrr + wur + wuu;}
-	}
-}}}}}}}}
-// hier werden Grids UL bis UU (im Uhrzeigersinn) erzeugt, die angeben, welchen Anteil des Inhalts einer benachbarten Rasterzelle in die Zielrasterzelle (zentrale Rasterzelle im 9er Feld) uebergen wird //
-foreach p in UL do
-{	if (p.x == 0 || p.y == 0)
-	{UL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pul]) < 0 && Z[p+pul] > 0) 
-		{UL[p] = (atan((M[p+pul] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pul];}
-		else
-		{UL[p] = 0;}
-		}
-}
-foreach p in LL do
-{	if (p.x == 0)
-	{LL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pl]) < 0 && Z[p+pl] > 0) 
-		{LL[p] = (atan((M[p+pl] - M[p])/M.dxy))/Z[p+pl];}
-		else
-		{LL[p] = 0;}
-		}
-}
-foreach p in OL do
-{	if (p.x == 0 || p.y == M.yanz - 1)
-	{OL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pol]) < 0 && Z[p+pol] > 0) 
-		{OL[p] = (atan((M[p+pol] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pol];}
-		else
-		{OL[p] = 0;}
-		}
-}
-foreach p in OO do
-{	if (p.y == M.yanz - 1)
-	{OO[p] = 0;}
-	else	{
-		if((M[p] - M[p+po]) < 0 && Z[p+po] > 0) 
-		{OO[p] = (atan((M[p+po] - M[p])/M.dxy))/Z[p+po];}
-		else
-		{OO[p] = 0;}
-		}
-}
-foreach p in OR do
-{	if (p.x == M.xanz - 1 || p.y == M.yanz - 1)
-	{OR[p] = 0;}
-	else	{
-		if((M[p] - M[p+por]) < 0 && Z[p+por] > 0) 
-		{OR[p] = (atan((M[p+por] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+por];}
-		else
-		{OR[p] = 0;}
-		}
-}
-foreach p in RR do
-{	if (p.x == M.xanz - 1)
-	{RR[p] = 0;}
-	else	{
-		if((M[p] - M[p+pr]) < 0 && Z[p+pr] > 0) 
-		{RR[p] = (atan((M[p+pr] - M[p])/M.dxy))/Z[p+pr];}
-		else
-		{RR[p] = 0;}
-		}
-}
-foreach p in UR do
-{	if (p.x == M.xanz - 1 || p.y == 0)
-	{UR[p] = 0;}
-	else	{
-		if((M[p] - M[p+pur]) < 0 && Z[p+pur] > 0) 
-		{UR[p] = (atan((M[p+pur] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pur];}
-		else
-		{UR[p] = 0;}
-		}
-}
-foreach p in UU do
-{	if (p.y == 0)
-	{UU[p] = 0;}
-	else	{
-		if((M[p] - M[p+pu]) < 0 && Z[p+pu] > 0) 
-		{UU[p] = (atan((M[p+pu] - M[p])/M.dxy))/Z[p+pu];}
-		else
-		{UU[p] = 0;}
-		}
-}
-// in den folgenden drei Schritten wird nach der "multiple flow methode" die Einzugsgebietsgroe�e C ermittelt //
-foreach p in Z do
-{Z[p] = 1;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	i = i +1;
-	gefunden = 0;
-	foreach p in Z do
-	{	if (R[p] == i)
-		{Z[p] = 1 + Z[p+pul] * UL[p] + Z[p+pl] * LL[p] + Z[p+pol] * OL[p] + Z[p+po] * OO[p] + Z[p+por] * OR[p] + Z[p+pr] * RR[p] + Z[p+pur] * UR[p] + Z[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(Z);
-foreach p in C do
-{C[p] = Z[p] * O.dxy^2;}
-// in den folgenden drei Schritten wird die gesaugte Einzugsgebietsgroe�e CS ermittelt, wobei der t-Parameter die Staerke der Saugung steuert. Werte unter 10 (z.B.: 5) fuehren zu einer starken Saugung, Werte ueber 10 (z.B. 15) zu einer schwachen Saugung. Die gesaugte Einzugsgebietsgroe�e selbst stellt bereits einen Parameter Dar, der die raeumliche Relief-bedingte Feuchteverteilung in guter Weise annaehert //
-foreach p in X do
-{X[p] = C[p];}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	j = j +1;
-	gefunden = 0;
-	foreach p in X do
-	{
-	if ((((1/t^N[p])^exp(t^N[p])) * max9(p, X)) > X[p])
-	{X[p] = (((1/t^N[p])^exp(t^N[p])) * max9(p, X)); gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-foreach p in CS do
-{	if (isRand(p, M) == 0)
-	{
-	if(X[p] > C[p] || X[p+pul] > C[p+pul] || X[p+pl] > X[p+pl] || X[p+pol] > C[p+pol] || X[p+po] > C[p+po] || X[p+por] > C[p+por] || X[p+pr] > C[p+pr] || X[p+pur] > C[p+pur] || X[p+pu] > C[p+pu])
-	{CS[p] = ln((X[p] + X[p+pul] + X[p+pu] + X[p+pur] + X[p+pl] + X[p+pr] + X[p+pol] + X[p+po] + X[p+por])/9);}
-	else	
-	{CS[p] = ln(X[p]);}
-	}
-}
-setRandN (CS);	
-showMatrix(CS);
-// in den folgenden zwei Schritten wird der SAGA Bodenfeuchteindex SB ermittelt. Der a-Parameter muss bei den Settings definiert werden und sorgt dafuer, das nicht durch 0 dividiert wird //
-foreach p in SB do
-{SB[p] = exp(CS[p])/tan(N[p] + a);}
-foreach p in SB do
-{SB[p] = ln(SB[p]);}	
-showMatrix(SB);
-/**/
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.cpp
deleted file mode 100644
index 3caab42..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/**********************************************************
- * Version $Id: Sinuosity.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    Sinuosity.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "Sinuosity.h"
-#include "Helper.h"
-
-CSinuosity::CSinuosity(void){
-
-	Parameters.Set_Name(_TL("Flow Sinuosity"));
-	Parameters.Set_Description(_TW(
-		"(c) 2004 by Victor Olaya. Flow sinuosity calculation\r\n"
-		"References:\r\n 1. Olaya, V. Hidrologia computacional y modelos digitales del terreno. Alqua. 536 pp. 2004"));
-
-
-	Parameters.Add_Grid(NULL, 
-						"DEM", 
-						_TL("Elevation Grid"), 
-						_TL(""), 
-						PARAMETER_INPUT);
-	
-	Parameters.Add_Grid(NULL, 
-						"SINUOS", 
-						_TL("Sinuosity"), 
-						_TL(""), 
-						PARAMETER_OUTPUT, 
-						true, 
-						SG_DATATYPE_Double);
-
-}//constructor
-
-
-CSinuosity::~CSinuosity(void)
-{}
-
-void CSinuosity::writeDistOut(
-        int iX1,
-        int iY1,
-        int iX2,
-        int iY2) {
-	
-    int iNextX, iNextY;
-	double dDist = 1;
-	
-	if (iX1 < 0 || iX1 >= m_pDEM->Get_NX() || iY1 < 0 || iY1 >= m_pDEM->Get_NY()
-            || m_pDEM->asFloat(iX1,iY1) == m_pDEM->Get_NoData_Value()) {        
-    }// if
-	else {				
-
-		dDist = sqrt(pow((double)iX1-iX2,2)+pow((double)iY1-iY2,2))*m_pSinuosity->Get_Cellsize();
-		m_pSinuosity->Set_Value(iX1,iY1,m_pSinuosity->asDouble(iX2,iY2) + dDist);        
-
-		for (int i = -1; i<2; i++){
-			for (int j = -1; j<2; j++){
-				if (!(i == 0) || !(j == 0)) {
-					getNextCell(m_pDEM, iX1 + i, iY1 + j, iNextX, iNextY);
-					if (iNextY == iY1 && iNextX == iX1) {
-						writeDistOut(iX1 + i, iY1 + j, iX1, iY1);
-					}// if				
-				}//if				
-			}//for
-		}//for
-
-    }// else
-
-}// method
-
-void CSinuosity::ZeroToNoData(void){
-		
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(int x=0; x<Get_NX(); x++){			
-            if (m_pSinuosity->asDouble(x,y) == 0){
-				m_pSinuosity->Set_Value(x,y,m_pSinuosity->Get_NoData_Value());
-			}//if
-        }// for
-    }// for
-
-}//method
-
-
-void CSinuosity::calculateSinuosity(void){
-	
-	double dDist;
-    
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
-		for(int x=0; x<Get_NX(); x++){
-            if (m_pSinuosity->asDouble(x,y) != m_pSinuosity->Get_NoData_Value()){				
-				dDist = sqrt(pow((double)x-m_iX,2)+pow((double)y-m_iY,2))*m_pSinuosity->Get_Cellsize();
-				if (dDist!=0){
-					m_pSinuosity->Set_Value(x,y,m_pSinuosity->asDouble(x,y)/dDist);
-				}//if
-			}//if
-        }// for
-    }// for
-
-}//method
-
-bool CSinuosity::On_Execute(void){
-
-	m_pDEM			= Parameters("DEM")->asGrid(); 
-	m_pSinuosity	= Parameters("SINUOS")->asGrid();
-
-	DataObject_Update(m_pSinuosity, true);
-
-	return true;
-
-}//method
-
-bool CSinuosity::On_Execute_Finish(){
-
-	return( true );
-}
-
-bool CSinuosity::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 );
-	}
-
-//	if( !m_pDEM->is_InGrid_byPos(ptWorld.Get_X(), ptWorld.Get_Y()) ){
-//		return false;
-//	}//if
-
-//	iX	= (int) ((ptWorld.Get_X() - m_pDEM->Get_XMin()) / m_pDEM->Get_Cellsize());
-//	iY	= (int) ((ptWorld.Get_Y() - m_pDEM->Get_YMin()) / m_pDEM->Get_Cellsize());
-
-	m_iX = iX;
-	m_iY = iY;
-
-	m_pSinuosity->Assign((double)0);
-	
-	writeDistOut(iX, iY, iX, iY);
-	ZeroToNoData();
-	calculateSinuosity();
-
-	DataObject_Update(m_pSinuosity);
-    
-	return true;
-
-}//method
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h
deleted file mode 100644
index 4c4d6c9..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/**********************************************************
- * Version $Id: Sinuosity.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    Sinuosity.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CSinuosity : public CSG_Module_Grid_Interactive
-{
-public:
-	CSinuosity(void);
-	virtual ~CSinuosity(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Dynamics" ));	}
-
-protected:
-	virtual bool On_Execute(void);
-	virtual bool On_Execute_Finish();
-	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
-
-private:
-	CSG_Grid *m_pDEM;
-	CSG_Grid *m_pSinuosity;
-	void writeDistOut(int,int,int,int);
-	void ZeroToNoData(void);
-	void calculateSinuosity(void);
-	int m_iX, m_iY;	
-
-};
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp
deleted file mode 100644
index 64f8cff..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/**********************************************************
- * Version $Id: SlopeLength.cpp 1081 2011-06-08 08:05:26Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    SlopeLength.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "SlopeLength.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSlopeLength::CSlopeLength(void)
-{
-	Set_Name		(_TL("Slope Length"));
-
-	Set_Author		(SG_T("V.Olaya (c) 2004"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "DEM"		, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "LENGTH"	, _TL("Slope Length"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSlopeLength::On_Execute(void)
-{
-	int		x, y;
-
-	//-----------------------------------------------------
-	m_pDEM		= Parameters("DEM")		->asGrid();
-	m_pLength	= Parameters("LENGTH")	->asGrid();
-
-	//-----------------------------------------------------
-	m_Slope.Create(*Get_System());
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			double	Slope, Aspect;
-
-			if( m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
-			{
-				m_Slope   .Set_Value(x, y, Slope);
-				m_pLength->Set_Value(x, y, 0.0);
-			}
-			else
-			{
-				m_Slope   .Set_NoData(x, y);
-				m_pLength->Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( m_pDEM->Get_Sorted(n, x, y) )
-		{
-			Get_Length(x, y);
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Slope.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSlopeLength::Get_Length(int x, int y)
-{
-	int		i, ix, iy;
-
-	if( m_Slope.is_InGrid(x, y) && (i = m_pDEM->Get_Gradient_NeighborDir(x, y)) >= 0 )
-	{
-		ix	= Get_xTo(i, x);
-		iy	= Get_yTo(i, y);
-
-		if( m_Slope.is_InGrid(ix, iy) )
-		{
-			if( m_Slope.asDouble(ix, iy) > 0.5 * m_Slope.asDouble(x, y) )	// ???
-			{
-				double	Length	= m_pLength->asDouble(x, y) + CSG_Module_Grid::Get_Length(i);
-			
-				if( Length > m_pLength->asDouble(ix, iy) )
-				{
-					m_pLength->Set_Value(ix, iy, Length);
-				}
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h
deleted file mode 100644
index 0f9d6d4..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**********************************************************
- * Version $Id: SlopeLength.h 1246 2011-11-25 13:42:38Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    SlopeLength.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CSlopeLength : public CSG_Module_Grid
-{
-public:
-	CSlopeLength(void);
-
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Miscellaneous") );	}
-
-
-protected:
-	
-	virtual bool			On_Execute		(void);
-
-
-private:
-
-	CSG_Grid				*m_pDEM, *m_pLength, m_Slope;
-
-
-	void					Get_Length		(int x, int y);	
-
-};
-
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                                                       //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/melton_ruggedness.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/melton_ruggedness.cpp
deleted file mode 100644
index 5d60c49..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_hydrology/melton_ruggedness.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/**********************************************************
- * Version $Id: melton_ruggedness.cpp 1091 2011-06-16 15:50:52Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     ta_hydrology                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                 melton_ruggedness.cpp                 //
-//                                                       //
-//                 Copyright (C) 2012 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "melton_ruggedness.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CMelton_Ruggedness::CMelton_Ruggedness(void)
-{
-	Set_Name		(_TL("Melton Ruggedness Number"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2012"));
-
-	Set_Description	(_TW(
-		"Melton ruggedness number (MNR) is a simple flow accumulation related index, "
-		"calculated as difference between maximum and minimum elevation "
-		"in catchment area divided by square root of catchment area size. "
-		"The calculation is performed for each grid cell, therefore minimum elevation "
-		"is same as elevation at cell's position. "
-		"Due to the discrete character of a single maximum elevation, flow calculation "
-		"is simply done with Deterministic 8. "
-		"\n\n"
-		"References:\n"
-		"Marchi, L. &  Fontana, G.D. (2005): "
-		"GIS morphometric indicators for the analysis of sediment dynamics in mountain basins. "
-		"Environ. Geol. 48:218-228, DOI 10.1007/s00254-005-1292-4.\n"
-		"\n"
-		"Melton M.A. (1965): "
-		"The geomorphic and paleoclimatic significance of alluvial deposits in Southern Arizona. "
-		"J. Geol. 73:1-38.\n"
-		"\n"
-		"O'Callaghan, J.F. / Mark, D.M. (1984): "
-		"The extraction of drainage networks from digital elevation data. "
-		"Computer Vision, Graphics and Image Processing 28:323-344.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"		, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "AREA"	, _TL("Catchment Area"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "ZMAX"	, _TL("Maximum Height"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "MRN"		, _TL("Melton Ruggedness Number"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CMelton_Ruggedness::On_Execute(void)
-{
-	CSG_Grid	*pDEM, *pArea, *pMRN, *pZMax;
-
-	//-----------------------------------------------------
-	pDEM		= Parameters("DEM" )->asGrid();
-	pArea		= Parameters("AREA")->asGrid();
-	pZMax		= Parameters("ZMAX")->asGrid();
-	pMRN		= Parameters("MRN" )->asGrid();
-
-	pArea->Set_NoData_Value(0.0);
-	pArea->Assign_NoData();
-	pZMax->Assign_NoData();
-	pMRN ->Assign_NoData();
-
-	//-------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		int		x, y, i, ix, iy;
-
-		if( pDEM->Get_Sorted(n, x, y, true, true) )
-		{
-			pArea->Add_Value(x, y, Get_Cellsize());
-
-			if( pZMax->is_NoData(x, y) )
-			{
-				pZMax->Set_Value(x, y, pDEM->asDouble(x, y));
-			}
-
-			if( (i = pDEM->Get_Gradient_NeighborDir(x, y, true)) >= 0 && Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) )
-			{
-				pArea->Add_Value(ix, iy, pArea->asDouble(x, y));
-
-				if( pZMax->is_NoData(ix, iy) || pZMax->asDouble(ix, iy) < pZMax->asDouble(x, y) )
-				{
-					pZMax->Set_Value(ix, iy, pZMax->asDouble(x, y));
-				}
-			}
-
-			pMRN->Set_Value(x, y, (pZMax->asDouble(x, y) - pDEM->asDouble(x, y)) / sqrt(pArea->asDouble(x, y)));
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.in
deleted file mode 100644
index d42b259..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.in
+++ /dev/null
@@ -1,601 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis/ta_lighting
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_lighting_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_lighting_la_OBJECTS = HillShade.lo MLB_Interface.lo \
-	SolarRadiation.lo topographic_correction.lo \
-	topographic_openness.lo view_shed.lo Visibility_BASE.lo \
-	Visibility_Point.lo Visibility_Points.lo
-libta_lighting_la_OBJECTS = $(am_libta_lighting_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_lighting_la_SOURCES)
-DIST_SOURCES = $(libta_lighting_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1613 2013-02-22 11:20:39Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libta_lighting.la
-libta_lighting_la_SOURCES = \
-HillShade.cpp\
-MLB_Interface.cpp\
-SolarRadiation.cpp\
-topographic_correction.cpp\
-topographic_openness.cpp\
-view_shed.cpp\
-Visibility_BASE.cpp\
-Visibility_Point.cpp\
-Visibility_Points.cpp\
-HillShade.h\
-MLB_Interface.h\
-SolarRadiation.h\
-topographic_correction.h\
-topographic_openness.h\
-view_shed.h\
-Visibility_BASE.h\
-Visibility_Point.h\
-Visibility_Points.h
-
-libta_lighting_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_lighting.la: $(libta_lighting_la_OBJECTS) $(libta_lighting_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_lighting_la_OBJECTS) $(libta_lighting_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/HillShade.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SolarRadiation.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Visibility_BASE.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Visibility_Point.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Visibility_Points.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topographic_correction.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/topographic_openness.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/view_shed.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp
deleted file mode 100644
index 34bcf15..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp
+++ /dev/null
@@ -1,1437 +0,0 @@
-/**********************************************************
- * Version $Id: SolarRadiation.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_lighting                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  SolarRadiation.cpp                   //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "SolarRadiation.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSolarRadiation::CSolarRadiation(void)
-{
-	CSG_Parameter	*pNode_1, *pNode_2;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Potential Incoming Solar Radiation"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
-
-	Set_Description	(_TW(
-		"Calculation of potential incoming solar radiation (insolation).\n"
-		"\n"
-		"References:\n<ul>"
-		"<li>Boehner, J., Antonic, O. (2009): Land Surface Parameters Specific to Topo-Climatology. in Hengl, T. & Reuter, H.I. [Eds.]: Geomorphometry - Concepts, Software, Applications.</li>"
-		"<li>Oke, T.R. (1988): Boundary Layer Climates. London, Taylor & Francis.</li>"
-		"<li>Wilson, J.P., Gallant, J.C. [Eds.] (2000): Terrain Analysis - Principles and Applications. New York, John Wiley & Sons, Inc.</li>"
-		"</ul>\n"
-
-		"\n*) Most options should do well, but TAPES-G based diffuse irradiance calculation ('Atmospheric Effects' methods 2 and 3) needs further revision!"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "GRD_DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_SVF"			, _TL("Sky View Factor"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_VAPOUR"		, _TL("Water Vapour Pressure [mbar]"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_LAT"			, _TL("Latitude [degree]"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_LON"			, _TL("Longitude [degree]"),
-		_TL(""),
-		PARAMETER_INPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_DIRECT"		, _TL("Direct Insolation"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_DIFFUS"		, _TL("Diffuse Insolation"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_TOTAL"		, _TL("Total Insolation"),
-		_TL("Total insolation, the sum of direct and diffuse incoming solar radiation."),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "GRD_RATIO"		, _TL("Direct to Diffuse Ratio"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "DURATION"		, _TL("Duration of Insolation"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SUNRISE"			, _TL("Sunrise"),
-		_TL("time of sunrise/sunset is only calculated if time span is set to single day"),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SUNSET"			, _TL("Sunset"),
-		_TL("time of sunrise/sunset is only calculated if time span is set to single day"),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Value(
-		NULL	, "SOLARCONST"		, _TL("Solar Constant [W / m\xb2]"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 1367.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "LOCALSVF"		, _TL("Local Sky View Factor"),
-		_TL("Use sky view factor based on local slope (after Oke 1988), if no sky viev factor grid is given."),
-		PARAMETER_TYPE_Bool			, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "UNITS"			, _TL("Units"),
-		_TL("Units for output radiation values."),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			SG_T("kWh / m\xb2"),
-			SG_T("kJ / m\xb2"),
-			SG_T("J / cm\xb2")
-		), 0
-	);
-
-	//-----------------------------------------------------
-	pNode_1	= Parameters.Add_Node(
-		NULL	, "NODE_LOCATION"	, _TL("Location"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode_1	, "LATITUDE"		, _TL("Latitude"),
-		_TL(""),
-		PARAMETER_TYPE_Degree		, 53.0, -90.0, true, 90.0, true
-	);
-
-	CSG_Parameters	*pParameters	= Parameters.Add_Parameters(
-		pNode_1	, "BENDING"			, _TL("Planetary Bending"),
-		_TL("")
-	)->asParameters();
-
-	pParameters->Add_Value(
-		NULL	, "BENDING"			, _TL("Include Planetery Bending"),
-		_TL(""),
-		PARAMETER_TYPE_Bool			, false
-	);
-
-	pParameters->Add_Value(
-		NULL	, "RADIUS"			, _TL("Planetary Radius"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 6366737.96, 0.0, true
-	);
-
-	pNode_1	= pParameters->Add_Choice(
-		NULL	, "LAT_OFFSET"		, _TL("Latitude relates to grid's..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("bottom"),
-			_TL("center"),
-			_TL("top"),
-			_TL("user defined reference")
-		), 3
-	);
-
-	pParameters->Add_Value(
-		pNode_1	, "LAT_REF_USER"	, _TL("Latitude (user defined reference)"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 0.0
-	);
-
-	pNode_1	= pParameters->Add_Choice(
-		NULL	, "LON_OFFSET"		, _TL("Local time relates to grid's..."),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("left"),
-			_TL("center"),
-			_TL("right"),
-			_TL("user defined reference")
-		), 1
-	);
-
-	pParameters->Add_Value(
-		pNode_1	, "LON_REF_USER"	, _TL("Local Time (user defined reference)"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 0.0
-	);
-
-	//-----------------------------------------------------
-	pNode_1	= Parameters.Add_Node(
-		NULL	, "NODE_TIME"		, _TL("Time"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		pNode_1	, "PERIOD"			, _TL("Time Period"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("moment"),
-			_TL("day"),
-			_TL("range of days")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		pNode_1	, "MOMENT"			, _TL("Moment [h]"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 12.0, 0.0, true, 24.0, true
-	);
-
-	Parameters.Add_Range(
-		pNode_1	, "HOUR_RANGE"		, _TL("Time Span [h]"),
-		_TL("Time span used for the calculation of daily radiation sums."),
-		 0.0, 24.0, 0.0	, true, 24.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode_1	, "DHOUR"			, _TL("Time Resolution [h]: Day"),
-		_TL("Time step size for a day's calculation given in hours."),
-		PARAMETER_TYPE_Double		, 0.5, 0.0, true, 24.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode_1	, "DDAYS"			, _TL("Time Resolution [d]: Range of Days"),
-		_TL("Time step size for a range of days calculation given in days."),
-		PARAMETER_TYPE_Int			, 5, 1, true
-	);
-
-	Parameters.Add_Choice(
-		pNode_1	, "UPDATE"			, _TL("Update"),
-		_TL("show direct insolation for each time step."),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("do not update"),
-			_TL("update, colour stretch for each time step"),
-			_TL("update, fixed colour stretch")
-		), 0
-	);
-
-	//-----------------------------------------------------
-	pNode_2	= Parameters.Add_Node(
-		pNode_1	, "NODE_DAY_A"		, _TL("Day of Year"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		pNode_2	, "DAY_A"			, _TL("Day of Month"),
-		_TL(""),
-		SG_T("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|"), 20
-	);
-
-	Parameters.Add_Choice(
-		pNode_2	, "MON_A"			, _TL("Month"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("January")	, _TL("February")	, _TL("March")		, _TL("April")	, _TL("May")		, _TL("June"),
-			_TL("July")		, _TL("August")		, _TL("September")	, _TL("October"), _TL("November")	, _TL("December")
-		), 2
-	);
-
-	pNode_2	= Parameters.Add_Node(
-		pNode_1	, "NODE_DAY_B"		, _TL("Day of Year (End of Range)"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		pNode_2	, "DAY_B"			, _TL("Day of Month"),
-		_TL(""),
-		SG_T("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|"), 20
-	);
-
-	Parameters.Add_Choice(
-		pNode_2	, "MON_B"			, _TL("Month"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("January")	, _TL("February")	, _TL("March")		, _TL("April")	, _TL("May")		, _TL("June"),
-			_TL("July")		, _TL("August")		, _TL("September")	, _TL("October"), _TL("November")	, _TL("December")
-		), 3
-	);
-
-	//-----------------------------------------------------
-	pNode_1	= Parameters.Add_Node(
-		NULL	, "NODE_METHOD"		, _TL("Atmospheric Effects"),
-		_TL("")
-	);
-
-	Parameters.Add_Choice(
-		pNode_1	, "METHOD"			, _TL("Atmospheric Effects"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("Height of Atmosphere and Vapour Pressure"),
-			_TL("Air Pressure, Water and Dust Content"),
-			_TL("Lumped Atmospheric Transmittance")
-		), 0
-	);
-
-	//-----------------------------------------------------
-	pNode_2	= Parameters.Add_Node(
-		pNode_1	, "NODE_SADO"		, _TL("Height of Atmosphere and Vapour Pressure"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode_2	, "ATMOSPHERE"		, _TL("Height of Atmosphere [m]"),
-		_TL(""),
-		PARAMETER_TYPE_Double		, 12000.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode_2	, "VAPOUR"			, _TL("Water Vapour Pressure [mbar]"),
-		_TL("This value is used as constant if no vapour pressure grid is given."),
-		PARAMETER_TYPE_Double		, 10, 0.0, true
-	);
-
-	//-----------------------------------------------------
-	pNode_2	= Parameters.Add_Node(
-		pNode_1	, "NODE_COMPONENTS"	, _TL("Air Pressure, Water and Dust Content"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode_2	, "PRESSURE"		, _TL("Atmospheric Pressure [mbar]"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1013, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode_2	, "WATER"			, _TL("Water Content [cm]"),
-		_TL("Water content of a vertical slice of atmosphere in cm: 1.5 to 1.7, average=1.68"),
-		PARAMETER_TYPE_Double, 1.68, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode_2	, "DUST"			, _TL("Dust [ppm]"),
-		_TL("Dust factor: 100 ppm (standard)"),
-		PARAMETER_TYPE_Double, 100, 0.0, true
-	);
-
-	//-----------------------------------------------------
-	pNode_2	= Parameters.Add_Node(
-		pNode_1	, "NODE_LUMPED"		, _TL("Lumped Atmospheric Transmittance"),
-		_TL("")
-	);
-
-	Parameters.Add_Value(
-		pNode_2	, "LUMPED"			, _TL("Lumped Atmospheric Transmittance [Percent]"),
-		_TL("The transmittance of the atmosphere, usually between 60 and 80 percent."),
-		PARAMETER_TYPE_Double, 70, 0.0, true, 100.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CSolarRadiation::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GRD_LAT")) )
-	{
-		pParameters->Get_Parameter("NODE_LOCATION")->Set_Enabled(pParameter->asGrid() == NULL);
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GRD_VAPOUR")) )
-	{
-		pParameters->Get_Parameter("VAPOUR")->Set_Enabled(pParameter->asGrid() == NULL);
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PERIOD")) )
-	{
-		int		Value	= pParameter->asInt();
-
-		pParameters->Get_Parameter("MOMENT"    )->Set_Enabled(Value == 0);
-		pParameters->Get_Parameter("UPDATE"    )->Set_Enabled(Value >= 1);
-		pParameters->Get_Parameter("HOUR_RANGE")->Set_Enabled(Value >= 1);
-		pParameters->Get_Parameter("DHOUR"     )->Set_Enabled(Value >= 1);
-		pParameters->Get_Parameter("NODE_DAY_A")->Set_Enabled(Value >= 1);
-		pParameters->Get_Parameter("DDAYS"     )->Set_Enabled(Value == 2);
-		pParameters->Get_Parameter("NODE_DAY_B")->Set_Enabled(Value == 2);
-	}
-
-	//-----------------------------------------------------
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
-	{
-		int		Value	= pParameter->asInt();
-
-		pParameters->Get_Parameter("GRD_VAPOUR"     )->Set_Enabled(Value == 0);
-		pParameters->Get_Parameter("NODE_SADO"      )->Set_Enabled(Value == 0);
-		pParameters->Get_Parameter("NODE_COMPONENTS")->Set_Enabled(Value == 1);
-		pParameters->Get_Parameter("NODE_LUMPED"    )->Set_Enabled(Value == 2);
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::On_Execute(void)
-{
-	int		x, y;
-
-	//-----------------------------------------------------
-	m_pDEM			= Parameters("GRD_DEM")		->asGrid();
-	m_pVapour		= Parameters("GRD_VAPOUR")	->asGrid();
-	m_pSVF			= Parameters("GRD_SVF")		->asGrid();
-
-	m_pDirect		= Parameters("GRD_DIRECT")	->asGrid();
-	m_pDiffus		= Parameters("GRD_DIFFUS")	->asGrid();
-	m_pTotal		= Parameters("GRD_TOTAL")	->asGrid();
-	m_pRatio		= Parameters("GRD_RATIO")	->asGrid();
-	m_pDuration		= Parameters("DURATION")	->asGrid();
-	m_pSunrise		= Parameters("SUNRISE")		->asGrid();
-	m_pSunset		= Parameters("SUNSET")		->asGrid();
-
-	m_bUpdate		= Parameters("UPDATE")		->asInt();
-
-	m_Solar_Const	= Parameters("SOLARCONST")	->asDouble() / 1000.0;	// >> [kW / m�]
-	m_bLocalSVF		= Parameters("LOCALSVF")	->asBool();
-
-	m_Method		= Parameters("METHOD")		->asInt();
-	m_Atmosphere	= Parameters("ATMOSPHERE")	->asDouble();
-	m_Vapour		= Parameters("VAPOUR")		->asDouble();
-	m_Transmittance	= Parameters("LUMPED")		->asDouble() / 100.0;	// percent to ratio
-	m_Pressure		= Parameters("PRESSURE")	->asDouble();
-	m_Water			= Parameters("WATER")		->asDouble();
-	m_Dust			= Parameters("DUST")		->asDouble();
-
-	m_Time			= Parameters("PERIOD")		->asInt();
-	m_dHour			= Parameters("DHOUR")		->asDouble();
-	m_dDays			= Parameters("DDAYS")		->asInt();
-
-	m_Latitude		= Parameters("LATITUDE")	->asDouble() * M_DEG_TO_RAD;
-
-	m_bBending		= Parameters("BENDING")->asParameters()->Get_Parameter("BENDING")->asBool() || Parameters("GRD_LAT")->asGrid() || Parameters("GRD_LON")->asGrid();
-
-	//-----------------------------------------------------
-	switch( m_Time )
-	{
-	case 0:	// moment
-		m_Hour_A		= Parameters("MOMENT")->asDouble();
-		m_Day_A			= Parameters("DAY_A")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_A")->asInt());
-		break;
-
-	case 1:	// day
-		m_Hour_A		= Parameters("HOUR_RANGE")->asRange()->Get_LoVal();
-		m_Hour_B		= Parameters("HOUR_RANGE")->asRange()->Get_HiVal();
-		m_Day_A			= Parameters("DAY_A")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_A")->asInt());
-		m_Day_B			= m_Day_A;
-		break;
-
-	case 2:	// range of days
-		m_Hour_A		= Parameters("HOUR_RANGE")->asRange()->Get_LoVal();
-		m_Hour_B		= Parameters("HOUR_RANGE")->asRange()->Get_HiVal();
-		m_Day_A			= Parameters("DAY_A")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_A")->asInt());
-		m_Day_B			= Parameters("DAY_B")->asInt() + 1 + Get_Day_of_Year(Parameters("MON_B")->asInt());
-
-		if( m_Day_B < m_Day_A )
-		{
-			m_Day_B	+= 365;
-		}
-		break;
-	}
-
-	//-----------------------------------------------------
-	CSG_Colors	Colors(100, SG_COLORS_YELLOW_RED, true);
-
-	Colors.Set_Ramp(SG_GET_RGB(  0,   0,  64), SG_GET_RGB(255, 159,   0),  0, 50);
-	Colors.Set_Ramp(SG_GET_RGB(255, 159,   0), SG_GET_RGB(255, 255, 255), 50, 99);
-
-	DataObject_Set_Colors(m_pDirect  , Colors);
-	DataObject_Set_Colors(m_pDiffus  , Colors);
-	DataObject_Set_Colors(m_pTotal   , Colors);
-	DataObject_Set_Colors(m_pRatio   , 100, SG_COLORS_RED_GREY_BLUE	, true);
-	DataObject_Set_Colors(m_pDuration, 100, SG_COLORS_YELLOW_RED	, true);
-	DataObject_Set_Colors(m_pSunrise , 100, SG_COLORS_YELLOW_RED	, false);
-	DataObject_Set_Colors(m_pSunset  , 100, SG_COLORS_YELLOW_RED	, true);
-
-	//-----------------------------------------------------
-	if( m_pDuration )	m_pDuration->Assign_NoData();
-	if( m_pSunrise  )	m_pSunrise ->Assign_NoData();
-	if( m_pSunset   )	m_pSunset  ->Assign_NoData();
-
-	if( m_pDuration )	m_pDuration->Set_Unit(_TL("h"));
-	if( m_pSunrise  )	m_pSunrise ->Set_Unit(_TL("h"));
-	if( m_pSunset   )	m_pSunset  ->Set_Unit(_TL("h"));
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("initialising gradient..."));
-
-	m_Shade .Create(*Get_System(), SG_DATATYPE_Byte);
-	m_Slope .Create(*Get_System(), SG_DATATYPE_Float);
-	m_Aspect.Create(*Get_System(), SG_DATATYPE_Float);
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			double	s, a;
-
-			if( m_pDEM->Get_Gradient(x, y, s, a) )
-			{
-				m_Slope .Set_Value(x, y, s);
-				m_Aspect.Set_Value(x, y, a);
-			}
-			else
-			{
-				m_Slope .Set_NoData(x, y);
-				m_Aspect.Set_NoData(x, y);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( m_bBending )
-	{
-		Process_Set_Text(_TL("initialising planetary bending..."));
-
-		m_Lat			.Create(*Get_System(), SG_DATATYPE_Float);
-		m_Lon			.Create(*Get_System(), SG_DATATYPE_Float);
-		m_Sol_Height	.Create(*Get_System(), SG_DATATYPE_Float);
-		m_Sol_Azimuth	.Create(*Get_System(), SG_DATATYPE_Float);
-
-		//-------------------------------------------------
-		if( Parameters("GRD_LAT")->asGrid() || Parameters("GRD_LON")->asGrid() )
-		{
-			if( Parameters("GRD_LAT")->asGrid() )
-			{
-				m_Lat	= *Parameters("GRD_LAT")->asGrid();
-				m_Lat	*= M_DEG_TO_RAD;
-			}
-
-			if( Parameters("GRD_LON")->asGrid() )
-			{
-				m_Lon	= *Parameters("GRD_LON")->asGrid();
-				m_Lon	*= M_DEG_TO_RAD;
-			}
-		}
-
-		//-------------------------------------------------
-		else
-		{
-			int		Offset;
-			double	d, dx, dy, dxA, dyA, Radius, Reference;
-
-			Offset		= Parameters("BENDING")->asParameters()->Get_Parameter("LON_OFFSET")  ->asInt();
-			Reference	= Parameters("BENDING")->asParameters()->Get_Parameter("LON_REF_USER")->asDouble();
-			Radius		= Parameters("BENDING")->asParameters()->Get_Parameter("RADIUS")      ->asDouble();
-			d			= 1.0 / Radius;
-
-			switch( Offset )
-			{
-			case 0:	dxA	= Get_System()->Get_Extent().Get_XMin();	break;	// left
-			case 1:	dxA	= Get_System()->Get_Extent().Get_XCenter();	break;	// center
-			case 2:	dxA	= Get_System()->Get_Extent().Get_XMax();	break;	// right
-			case 3:	dxA	= Reference;								break;	// user defined coordinate
-			}
-
-			Offset		= Parameters("BENDING")->asParameters()->Get_Parameter("LAT_OFFSET")  ->asInt();
-			Reference	= Parameters("BENDING")->asParameters()->Get_Parameter("LAT_REF_USER")->asDouble();
-
-			switch( Offset )
-			{
-			case 0:	dyA	= Get_System()->Get_Extent().Get_YMin();	break;	// bottom
-			case 1:	dyA	= Get_System()->Get_Extent().Get_YCenter();	break;	// center
-			case 2:	dyA	= Get_System()->Get_Extent().Get_YMax();	break;	// top
-			case 3:	dyA	= Reference;								break;	// user defined coordinate
-			}
-
-			dxA	 = d * (Get_XMin() - dxA);
-			dyA	 = d * (Get_YMin() - dyA) + m_Latitude;
-			d	*= Get_Cellsize();
-
-			for(y=0, dy=dyA; y<Get_NY() && Set_Progress(y); y++, dy+=d)
-			{
-				for(x=0, dx=dxA; x<Get_NX(); x++, dx+=d)
-				{
-					m_Lat.Set_Value(x, y, dy);
-					m_Lon.Set_Value(x, y, dx);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	if( Get_Insolation() )
-	{
-		Finalise();
-
-		return( true );
-	}
-
-	Finalise();
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::Finalise(void)
-{
-	double		dUnit;
-	CSG_String	Unit;
-
-	//-----------------------------------------------------
-	if( m_Time == 0 )	// moment
-	{
-		Unit	= SG_T("W / m\xb2");
-		dUnit	= 1000.0;
-	}
-	else switch( Parameters("UNITS")->asInt() )
-	{
-	case 0: default:	// [kWh / m2]
-		Unit	= SG_T("kWh / m\xb2");
-		dUnit	= 1.0;
-		break;
-
-	case 1:				// [kJ / m2]
-		Unit	= SG_T("kJ / m\xb2");
-		dUnit	= 3600.0;
-		break;
-
-	case 2:				// [Ws / cm2] = [J / cm2]
-		Unit	= SG_T("J / cm\xb2");
-		dUnit	= 360.0;
-		break;
-	}
-
-	//-----------------------------------------------------
-	m_pDirect->Set_Unit(Unit);
-	m_pDirect->Multiply(dUnit);
-
-	m_pDiffus->Set_Unit(Unit);
-	m_pDiffus->Multiply(dUnit);
-
-	if( m_pTotal )
-	{
-		m_pTotal->Assign(m_pDirect);
-		m_pTotal->Add  (*m_pDiffus);
-
-		m_pTotal->Set_Unit(Unit);
-	}
-
-	if( m_pRatio )
-	{
-		for(long i=0; i<Get_NCells(); i++)
-		{
-			if( m_pDEM->is_NoData(i) )
-			{
-				m_pRatio->Set_NoData(i);
-			}
-			else
-			{
-				if( m_pDiffus->asDouble(i) > 0.0 )
-				{
-					m_pRatio->Set_Value(i, m_pDirect->asDouble(i) / m_pDiffus->asDouble(i));
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Shade			.Destroy();
-	m_Slope			.Destroy();
-	m_Aspect		.Destroy();
-
-	m_Lat			.Destroy();
-	m_Lon			.Destroy();
-	m_Sol_Height	.Destroy();
-	m_Sol_Azimuth	.Destroy();
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::Get_Insolation(void)
-{
-	//-----------------------------------------------------
-	if( m_Time == 0 )						// Moment
-	{
-		m_pDirect->Assign(0.0);
-		m_pDiffus->Assign(0.0);
-
-		Get_Insolation(m_Day_A, m_Hour_A);
-	}
-
-	//-----------------------------------------------------
-	else if( m_Time == 1 )					// One Day
-	{
-		Get_Insolation(m_Day_A);
-	}
-
-	//-----------------------------------------------------
-	else if( m_Day_B - m_Day_A <= m_dDays )	// Range of Days (one representative calculation)
-	{
-		Get_Insolation(m_Day_A + m_dDays / 2);
-
-		m_pDirect->Multiply(m_Day_B - m_Day_A);
-		m_pDiffus->Multiply(m_Day_B - m_Day_A);
-	}
-
-	//-----------------------------------------------------
-	else									// Range of Days (more than one time step)
-	{
-		CSG_Grid	Direct, Diffus;
-
-		Direct.Create(*Get_System(), SG_DATATYPE_Float);
-		Diffus.Create(*Get_System(), SG_DATATYPE_Float);
-
-		Direct.Assign(0.0);
-		Diffus.Assign(0.0);
-
-		for(int Day=m_Day_A+m_dDays/2; Day<=m_Day_B && Process_Get_Okay(false); Day+=m_dDays)
-		{
-			Get_Insolation(Day);
-
-			SG_UI_Progress_Lock(true);
-
-			Direct.Add(*m_pDirect);
-			Diffus.Add(*m_pDiffus);
-
-			SG_UI_Progress_Lock(false);
-		}
-
-		m_pDirect->Assign(&Direct);
-		m_pDiffus->Assign(&Diffus);
-
-		m_pDirect->Multiply(m_dDays);
-		m_pDiffus->Multiply(m_dDays);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::Get_Insolation(int Day)
-{
-	//-----------------------------------------------------
-	double		Range	= 0.000001 + cos(M_DEG_TO_RAD * fabs(m_Latitude)) * sin(M_PI * ((80 + Day) % 365) / 365.0);
-	CSG_Grid	Direct;
-
-	if( m_bUpdate )
-	{
-		if( m_bUpdate == 2 )
-		{
-			DataObject_Update(m_pDirect, 0.0, Range, SG_UI_DATAOBJECT_SHOW);
-		}
-		else
-		{
-			DataObject_Update(m_pDirect, SG_UI_DATAOBJECT_SHOW);
-		}
-
-		Direct.Create(*Get_System(), SG_DATATYPE_Float);
-	}
-
-	//-----------------------------------------------------
-	bool		bDay, bWasDay	= false;
-
-	m_pDirect->Assign(0.0);
-	m_pDiffus->Assign(0.0);
-
-	for(double Hour=m_Hour_A; Hour<=m_Hour_B && Set_Progress(Hour - m_Hour_A, m_Hour_B - m_Hour_A); Hour+=m_dHour)
-	{
-		Process_Set_Text(CSG_String::Format(SG_T("%s %d(%d-%d), %s %02d:%02d"), _TL("day"), Day, m_Day_A, m_Day_B, _TL("local time"), (int)Hour, (int)(60.0 * fmod(Hour, 1.0))));
-
-		SG_UI_Progress_Lock(true);
-
-		bDay	= Get_Insolation(Day, Hour);
-
-		if( m_bUpdate && (bDay || bWasDay) )
-		{
-			bWasDay	= bDay;
-
-			if( m_bUpdate == 2 )
-			{
-				DataObject_Update(m_pDirect, 0.0, Range, SG_UI_DATAOBJECT_SHOW);
-			}
-			else
-			{
-				DataObject_Update(m_pDirect, SG_UI_DATAOBJECT_SHOW);
-			}
-
-			if( bDay )
-			{
-				Direct	+= *m_pDirect;
-
-				m_pDirect->Assign(0.0);
-			}
-		}
-
-		SG_UI_Progress_Lock(false);
-	}
-
-	//-----------------------------------------------------
-	if( m_bUpdate )
-	{
-		m_pDirect->Assign(&Direct);
-	}
-
-	m_pDirect->Multiply(m_dHour);
-	m_pDiffus->Multiply(m_dHour);
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::Get_Insolation(int Day, double Hour)
-{
-	//-----------------------------------------------------
-	if( m_bBending )
-	{
-		bool	bDayLight	= false;
-
-		#pragma omp parallel for
-		for(int y=0; y<Get_NY(); y++)
-		{
-			for(int x=0; x<Get_NX() && Process_Get_Okay(); x++)
-			{
-				double	Sol_Height	= -1.0, Sol_Azimuth	= -1.0;
-
-				if( Get_Solar_Position(Day, Hour, m_Lat.asDouble(x, y), m_Lon.asDouble(x, y), Sol_Height, Sol_Azimuth) )
-				{
-					bDayLight	= true;
-				}
-
-				m_Sol_Height .Set_Value(x, y, Sol_Height);
-				m_Sol_Azimuth.Set_Value(x, y, Sol_Azimuth);
-			}
-		}
-
-		if( bDayLight )
-		{
-			return( Get_Insolation(0.0, 0.0, Hour) );
-		}
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		double	Sol_Height, Sol_Azimuth;
-
-		if( Get_Solar_Position(Day, Hour, m_Latitude, 0.0, Sol_Height, Sol_Azimuth) )
-		{
-			return( Get_Insolation(Sol_Height, Sol_Azimuth, Hour) );
-		}
-	}
-
-	//-----------------------------------------------------
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::Get_Insolation(double Sol_Height, double Sol_Azimuth, double Hour)
-{
-	Get_Shade(Sol_Height, Sol_Azimuth);
-
-	#pragma omp parallel for
-	for(int y=0; y<Get_NY(); y++)
-	{
-		for(int x=0; x<Get_NX() && Process_Get_Okay(); x++)
-		{
-			if( m_pDEM->is_NoData(x, y) )
-			{
-				m_pDirect->Set_NoData(x, y);
-				m_pDiffus->Set_NoData(x, y);
-			}
-			else
-			{
-				double	Direct, Diffus;
-
-				if( Get_Irradiance(x, y,
-						m_bBending ? m_Sol_Height .asDouble(x, y) : Sol_Height,
-						m_bBending ? m_Sol_Azimuth.asDouble(x, y) : Sol_Azimuth,
-						Direct, Diffus) )
-				{
-					m_pDirect->Add_Value(x, y, Direct);
-					m_pDiffus->Add_Value(x, y, Diffus);
-
-					if( Direct > 0.0 )
-					{
-						if( m_pDuration )
-						{
-							if( m_pDuration->is_NoData(x, y) )
-							{
-								m_pDuration	->Set_Value(x, y, m_dHour);
-							}
-							else
-							{
-								m_pDuration	->Add_Value(x, y, m_dHour);
-							}
-						}
-
-						if( m_pSunrise && (m_pSunrise->is_NoData(x, y) || m_pSunrise->asDouble(x, y) > Hour) )
-						{
-							m_pSunrise	->Set_Value(x, y, Hour);
-						}
-
-						if( m_pSunset )
-						{
-							m_pSunset	->Set_Value(x, y, Hour);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline double CSolarRadiation::Get_Air_Mass(double Sol_Height)
-{
-	static const double	Air_Mass[32]	=	// Optical air mass in 1 degree increments for zenith angles >=60 [after LIST, 1968; p. 422]
-	{
-		2.00,  2.06,  2.12,  2.19,  2.27,  2.36,  2.45,  2.55, 2.65,  2.77,  2.90,  3.05,  3.21,  3.39,  3.59,  3.82,
-		4.07,  4.37,  4.72,  5.12,  5.60,  6.18,  6.88,  7.77, 8.90, 10.39, 12.44, 15.36, 19.79, 26.96, 26.96, 26.96
-	};
-
-	//-------------------------------------------------
-	double	Zenith	= M_PI_090 - Sol_Height;
-
-	if( Zenith <= 60.0 * M_DEG_TO_RAD )
-	{
-		return( 1.0 / cos(Zenith) );
-	}
-	else
-	{
-		double	z	= M_RAD_TO_DEG * Zenith - 60.0;
-		int		i	= (int)z;
-
-		return( Air_Mass[i] + (z - i) * (Air_Mass[i + 1] - Air_Mass[i]) );
-	}
-}
-
-//---------------------------------------------------------
-inline bool CSolarRadiation::Get_Irradiance(int x, int y, double Sol_Height, double Sol_Azimuth, double &Direct, double &Diffus)
-{
-	if( Sol_Height <= 0.0 )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	double	Elevation, Slope, Solar_Angle;
-
-	Elevation	= m_pDEM->asDouble(x, y);
-	Slope		= m_Slope.asDouble(x, y);
-	Solar_Angle	= m_Shade.asInt(x, y) ? 0.0 : cos(Slope) * cos(Sol_Height - M_PI_090) + sin(Slope) * sin(M_PI_090 - Sol_Height) * cos(Sol_Azimuth - m_Aspect.asDouble(x, y));
-
-	//-----------------------------------------------------
-	if( m_Method == 0 )	// Boehner
-	{
-		double	A, E, Vapour;
-
-		Vapour	= m_pVapour && !m_pVapour->is_NoData(x, y) ? m_pVapour->asDouble(x, y) : m_Vapour;
-		Vapour	= Vapour > 0.0 ? sqrt(Vapour) : 0.0;
-		E		= 0.9160 - 0.05125 * Vapour;
-		A		= 0.4158 + 0.03990 * Vapour;
-
-		Direct	= pow(E, (1.0 - Elevation / m_Atmosphere) / sin(Sol_Height));
-
-		Diffus	= m_Atmosphere / (m_Atmosphere - Elevation) * (0.0001165 * SG_Get_Square(M_RAD_TO_DEG * Sol_Height) - 0.0152 * M_RAD_TO_DEG * Sol_Height + A);
-		Diffus	= Direct * sin(Sol_Height) * (1.0 / (1.0 - Diffus) - 1.0);
-	}
-
-	//-----------------------------------------------------
-	else				// TAPES
-	{
-		double	Air_Mass	= Get_Air_Mass(Sol_Height) * (m_Pressure / pow(10.0, Elevation * 5.4667E-05)) / 1013.0;
-
-		//-------------------------------------------------
-		if( m_Method == 1 )	// Air Pressure, Water and Dust Content
-		{
-			double	AW, TW, TD, TDC;
-
-			AW		= 1.0 - 0.077 * pow(m_Water * Air_Mass, 0.3);		// absorption by water vapour
-			TW		= pow(0.975, m_Water * Air_Mass);					// scattering by water vapour	| problem (?!): fortran source differs from paper
-			TD		= pow(0.950, m_Water * m_Dust / 100.0);				// scattering by dust			| problem (?!): 100ppm := 1, 300ppm := 2
-			TDC		= pow(0.900, Air_Mass) + 0.026 * (Air_Mass - 1.0);	// scattering by a dust free atmosphere
-
-			Direct	= AW * TW * TD * TDC;
-			Diffus	= 0.5 * (AW - Direct);
-		}
-
-		//-------------------------------------------------
-		else				// Lumped Atmospheric Transmittance
-		{
-			Direct	= pow(m_Transmittance, Air_Mass);
-			Diffus	= 0.271 - 0.294 * Direct;
-		}
-	}
-
-	//-----------------------------------------------------
-	Direct	= Solar_Angle <= 0.0 ? 0.0 : Solar_Angle * Direct * m_Solar_Const;
-
-	double	SVF	= m_pSVF && !m_pSVF->is_NoData(x, y) ? m_pSVF->asDouble(x, y) : m_bLocalSVF ? (1.0 + cos(Slope)) / 2.0 : 1.0;
-
-	Diffus	= m_Solar_Const * Diffus * SVF;
-
-	if( Direct < 0.0 )	{	Direct	= 0.0;	}	else if( Direct > m_Solar_Const )	{	Direct	= m_Solar_Const;	}
-	if( Diffus < 0.0 )	{	Diffus	= 0.0;	}	else if( Diffus > m_Solar_Const )	{	Diffus	= m_Solar_Const;	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-/* The original TAPES-G source code for the optical air mass computation
-C ==================================================================
-      SUBROUTINE SOLAR(ZA,RDIRN,RDIFN,ITEST)
-      COMMON/SOL1/U,D,P,TRANSM
-      PARAMETER (PI=3.14159265358979323846)
-      PARAMETER (DTOR=PI/180.)
-      DIMENSION AM(32)
-      DATA AM/2.0,2.06,2.12,2.19,2.27,2.36,2.45,2.55,2.65,2.77,2.9,
-     *  3.05,3.21,3.39,3.59,3.82,4.07,4.37,4.72,5.12,5.6,6.18,6.88,
-     *  7.77,8.9,10.39,12.44,15.36,19.79,26.96,26.96,26.96/
-      DATA PO/1013./
-C     ***************************************************************
-C     AM    Optical air mass in 1 degree increments for zenith angles
-C           >=60 [LIST, 1968; p. 422]
-C     U     Water content of a vertical slice of atmosphere in cm: 
-C           1.5 to 1.7, average=1.68
-C     D     Dust factor: 1=100 ppm (standard); 2=300 ppm
-C     P     Barometric pressure in mb
-C     PO    Standard atmospheric pressure = 1013 mb
-C     TRANSM  Transmittance of the atmosphere (0.6-0.8)
-C     AW    Accounts for absorption by water vapour
-C     TW    Accounts for scattering by water vapour
-C     TD    Accounts for scattering by dust
-C     TDC   Accounts for scattering by a dust free atmosphere
-C     **************************************************************
-C     Compute optical air mass
-C
-      IF(ZA.LE.60.) THEN
-         AMASS=1./COS(ZA*DTOR)
-      ELSE
-         Y=ZA-59.
-         I=INT(Y)
-         AMASS=AM(I)+(Y-FLOAT(I))*(AM(I+1)-AM(I))
-      ENDIF
-      AMASS2=AMASS*P/PO
-C     --------------------------------------------------------------
-C     Account for atmospheric effects using either a lumped atmos-
-C     pheric transmittance approach (ITEST=1) or by calculating the
-C     components (ITEST=2)
-C
-      IF(ITEST.EQ.1) THEN
-         RDIRN=TRANSM**AMASS2
-         RDIFN=0.271-0.294*RDIRN
-      ELSE
-         AW=1.0-0.077*(U*AMASS2)**0.3
-         TW=0.975**(U*AMASS)
-         TD=0.95**(U*D)
-         TDC=0.9**AMASS2+0.026*(AMASS2-1.0)
-         RDIRN=AW*TW*TD*TDC
-         RDIFN=0.5*(AW-RDIRN)
-      ENDIF
-      RETURN
-      END
-C ====================================================================*/
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSolarRadiation::Get_Shade(double Sol_Height, double Sol_Azimuth)
-{
-	m_Shade.Assign(0.0);
-
-	if( !m_bBending )
-	{
-		int		x, y;
-		double	dx, dy, dz;
-
-		Get_Shade_Params(Sol_Height, Sol_Azimuth, dx, dy, dz);
-
-		for(long i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
-		{
-			if( m_pDEM->Get_Sorted(i, x, y) && !Get_Shade_Complete(x, y) )
-			{
-				Set_Shade(x, y, dx, dy, dz);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	else
-	{
-		int		x, y, iLock;
-		long	i;
-
-		for(i=0, iLock=1; i<Get_NCells() && Set_Progress_NCells(i); i++, iLock++)
-		{
-			if( m_pDEM->Get_Sorted(i, x, y) && !Get_Shade_Complete(x, y) )
-			{
-				if( iLock >= 255 )
-					iLock	= 1;
-
-				if( iLock == 1 )
-					Lock_Create();
-
-				Set_Shade_Bended(x, y, iLock);
-			}
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-void CSolarRadiation::Set_Shade(int x, int y, double dx, double dy, double dz)
-{
-	for(double ix=x+0.5, iy=y+0.5, iz=m_pDEM->asDouble(x, y); ; )
-	{
-		x	= (int)(ix	+= dx);
-		y	= (int)(iy	+= dy);
-					iz	-= dz;
-
-		if( !is_InGrid(x, y) || m_pDEM->asDouble(x, y) > iz )
-		{
-			return;
-		}
-
-		m_Shade.Set_Value(x, y, 1);
-	}
-}
-
-//---------------------------------------------------------
-void CSolarRadiation::Set_Shade_Bended(int x, int y, char iLock)
-{
-	double	dx, dy, dz;
-
-	Get_Shade_Params(m_Sol_Height.asDouble(x, y), m_Sol_Azimuth.asDouble(x, y), dx, dy, dz);
-
-	for(double ix=x+0.5, iy=y+0.5, iz=m_pDEM->asDouble(x, y); ; )
-	{
-		x	= (int)(ix	+= dx);
-		y	= (int)(iy	+= dy);
-					iz	-= dz;
-
-		if( !is_InGrid(x, y) || m_pDEM->asDouble(x, y) > iz || Lock_Get(x, y) == iLock )
-		{
-			return;
-		}
-
-		m_Shade.Set_Value(x, y, 1);
-
-		//---------------------------------------------
-		Lock_Set(x, y, iLock);
-
-		Get_Shade_Params(m_Sol_Height.asDouble(x, y), m_Sol_Azimuth.asDouble(x, y), dx, dy, dz);
-	}
-}
-
-//---------------------------------------------------------
-inline bool CSolarRadiation::Get_Shade_Complete(int x, int y)
-{
-	if( m_Shade.asInt(x, y) == 1 )
-	{
-		for(int iy=y-1; iy<=y+1; iy++)
-		{
-			for(int ix=x-1; ix<x+1; ix++)
-			{
-				if( is_InGrid(ix, iy) && m_Shade.asInt(ix, iy) == 0 )
-				{
-					return( false );
-				}
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-inline void CSolarRadiation::Get_Shade_Params(double Sol_Height, double Sol_Azimuth, double &dx, double &dy, double &dz)
-{
-	dz	= Sol_Azimuth + M_PI_180;
-	dx	= sin(dz);
-	dy	= cos(dz);
-
-	if( fabs(dx) > fabs(dy) )
-	{
-		dy	/= fabs(dx);
-		dx	= dx < 0 ? -1 : 1;
-	}
-	else if( fabs(dy) > fabs(dx) )
-	{
-		dx	/= fabs(dy);
-		dy	= dy < 0 ? -1 : 1;
-	}
-	else
-	{
-		dx	= dx < 0 ? -1 : 1;
-		dy	= dy < 0 ? -1 : 1;
-	}
-
-	dz	= tan(Sol_Height) * sqrt(dx*dx + dy*dy) * Get_Cellsize();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline int CSolarRadiation::Get_Day_of_Year(int Month)
-{
-	static const int	Day[13]	= {	0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
-
-	return( Month < 0 ? 0 : Month > 12 ? Day[12] : Day[Month] );
-}
-
-//---------------------------------------------------------
-inline bool CSolarRadiation::Get_Solar_Position(int Day, double Hour, double LAT, double LON, double &Sol_Height, double &Sol_Azimuth)
-{
-	static const double	ECLIPTIC_OBL	= M_DEG_TO_RAD * 23.43999;	// obliquity of ecliptic
-
-	int		i;
-
-	double	JD, T, M, L, X, Y, Z, R, UTime,
-			DEC, RA, theta, tau,
-			Month, Year		= 2000;
-
-	//-----------------------------------------------------
-	Day	%= 365;
-
-	for(Month=1, i=0; i<=12; i++)
-	{
-		if( Day < Get_Day_of_Year(i) )
-		{
-			Month	= i;
-			Day		-= Get_Day_of_Year(i - 1);
-			break;
-		}
-	}
-
-	if( Month < 1 || Month > 12 )	// nur Tag (1 - 365) zaehlt...
-	{
-		Month		= 1;
-	}
-
-	if( Month <= 2 )
-	{
-		Month		+= 12;
-		Year		-= 1;
-	}
-
-
-	//-----------------------------------------------------
-
-//	UTime		= Hour - LON * 12.0 / M_PI;
-	UTime		= Hour;
-
-
-	//-----------------------------------------------------
-	// 1. Julian Date...
-
-	JD			= (int)(365.25 * Year) + (int)(30.6001 * (Month + 1)) - 15 + 1720996.5 + Day + UTime / 24.0;
-	T			= (JD - 2451545.0 ) / 36525.0;	// number of Julian centuries since 2000/01/01 at 12 UT (JD = 2451545.0)
-
-
-	//-----------------------------------------------------
-	// 2. Solar Coordinates (according to: Jean Meeus: Astronomical Algorithms), accuracy of 0.01 degree
-
-	M			= M_DEG_TO_RAD * (357.52910 + 35999.05030 * T - 0.0001559 * T * T - 0.00000048 * T * T * T);	// mean anomaly
-	L			= M_DEG_TO_RAD * (	(280.46645 + 36000.76983 * T + 0.0003032 * T * T)							// mean longitude
-							+	(	(1.914600 - 0.004817 * T - 0.000014  * T * T) * sin(M)
-								+	(0.019993 - 0.000101 * T) * sin(2 * M) + 0.000290 * sin(3 * M)				// true longitude
-								)
-							);
-
-
-	//-----------------------------------------------------
-	// 3. convert ecliptic longitude to right ascension RA and declination delta
-
-	X			= cos(L);
-	Y			= cos(ECLIPTIC_OBL) * sin(L);
-	Z			= sin(ECLIPTIC_OBL) * sin(L);
-	R			= sqrt(1.0 - Z*Z); 
-
-	DEC			= atan2(Z, R);
-	RA			= 2.0 * atan2(Y, (X + R));
-
-
-	//-----------------------------------------------------
-	// 4. compute sidereal time (degree) at Greenwich local sidereal time at longitude (Degree)
-
-	theta		= LON + M_DEG_TO_RAD * (280.46061837 + 360.98564736629 * (JD - 2451545.0) + T*T * (0.000387933 - T / 38710000.0));
-
-
-	//-----------------------------------------------------
-	// 5. compute local hour angle (degree)
-
-	tau			= theta - RA;
-
-
-	//-----------------------------------------------------
-	// 6. convert (tau, delta) to horizon coordinates (h, az) of the observer
-
-	Sol_Height	= asin ( sin(LAT) * sin(DEC) + cos(LAT) * cos(DEC) * cos(tau) );
-
-	Sol_Azimuth	= atan2( -sin(tau) * cos(DEC), cos(LAT) * sin(DEC) - sin(LAT) * cos(DEC) * cos(tau) );
-//	Sol_Azimuth	= atan2( -sin(Tau), cos(LAT) * tan(DEC) - sin(LAT) * cos(Tau) );	// previous formula gives same result but is better because of division by zero effects...
-
-	return( Sol_Height > 0.0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp
deleted file mode 100644
index 1d35168..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp
+++ /dev/null
@@ -1,417 +0,0 @@
-/**********************************************************
- * Version $Id: topographic_correction.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_lighting                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               topographic_correction.cpp              //
-//                                                       //
-//                 Copyright (C) 2008 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "topographic_correction.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTopographic_Correction::CTopographic_Correction(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	Set_Name		(_TL("Topographic Correction"));
-
-	Set_Author		(_TL("Copyrights (c) 2008 by Olaf Conrad"));
-
-	Set_Description	(_TW(
-		"\n"
-		"References:\n"
-		"Civco, D. L. (1989): "
-		"'Topographic Normalization of Landsat Thematic Mapper Digital Imagery', "
-		"Photogrammetric Engineering and Remote Sensing, 55(9), pp.1303-1309.\n"
-		"\n"
-		"Law, K.H., Nichol, J. (2004): "
-		"'Topographic Correction for Differential Illumination Effects on Ikonos Satellite Imagery', "
-		"ISPRS 2004 International Society for Photogrammetry and Remote Sensing, "
-		"<a href=\"http://www.cartesia.org/geodoc/isprs2004/comm3/papers/347.pdf\">pdf</a>.\n"
-		"\n"
-		"Phua, M.-H., Saito, H. (2003): "
-		"'Estimation of biomass of a mountainous tropical forest using Landsat TM data', "
-		"Canadian Journal of Remote Sensing, 29(4), pp.429-440.\n"
-		"\n"
-		"Riano, D., Chuvieco, E. Salas, J., Aguado, I. (2003): "
-		"'Assessment of Different Topographic Corrections in Landsat-TM Data for Mapping Vegetation Types', "
-		"IEEE Transactions on Geoscience and Remote Sensing, 41(5), pp.1056-1061, "
-		"<a href=\"http://www.geogra.uah.es/~emilio/pdf/Riano2003b.pdf\">pdf</a>.\n"
-		"\n"
-		"Teillet, P.M., Guindon, B., Goodenough, D.G. (1982): "
-		"'On the slope-aspect correction of multispectral scanner data', "
-		"Canadian Journal of Remote Sensing, 8(2), pp.1537-1540.\n"
-		"\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT, false
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "ORIGINAL"	, _TL("Original Image"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "CORRECTED"	, _TL("Corrected Image"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	pNode	= Parameters.Add_Node(NULL, "NODE_SOLAR", _TL("Solar Position"), _TL(""));
-
-	Parameters.Add_Value(
-		pNode	, "AZI"			, _TL("Azimuth"),
-		_TL("direction of sun (degree, clockwise from North)"),
-		PARAMETER_TYPE_Double	, 180.0, 0.0, true, 360.0, true
-	);
-
-	Parameters.Add_Value(
-		pNode	, "HGT"			, _TL("Height"),
-		_TL("height of sun above horizon (degree)"),
-		PARAMETER_TYPE_Double	,  45.0, 0.0, true,  90.0, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("Cosine Correction (Teillet et al. 1982)"),
-			_TL("Cosine Correction (Civco 1989)"),
-			_TL("Minnaert Correction"),
-			_TL("Minnaert Correction with Slope (Riano et al. 2003)"),
-			_TL("Minnaert Correction with Slope (Law & Nichol 2004)"),
-			_TL("C Correction"),
-			_TL("Normalization (after Civco, modified by Law & Nichol)")
-		), 4
-	);
-
-	Parameters.Add_Value(
-		NULL	, "MINNAERT"	, _TL("Minnaert Correction"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 0.5, 0.0, true, 1.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "MAXCELLS"	, _TL("Maximum Cells (C Correction Analysis)"),
-		_TL("Maximum number of grid cells used for trend analysis as required by C correction."),
-		PARAMETER_TYPE_Int		, 1000.0, 10.0, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "MAXVALUE"	, _TL("Value Range"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("1 byte (0-255)"),
-			_TL("2 byte (0-65535)")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTopographic_Correction::On_Execute(void)
-{
-	//-----------------------------------------------------
-	if( !Get_Illumination() )
-	{
-		m_Slope			.Destroy();
-		m_Illumination	.Destroy();
-
-		return( false );
-	}
-
-	if( !Get_Model() )
-	{
-		m_Slope			.Destroy();
-		m_Illumination	.Destroy();
-
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Topographic Correction"));
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( m_pOriginal->is_NoData(x, y) )
-			{
-				m_pCorrected->Set_NoData(x, y);
-			}
-			else
-			{
-				m_pCorrected->Set_Value(x, y, Get_Correction(
-					m_Slope       .asDouble(x, y),
-					m_Illumination.asDouble(x, y),
-					m_pOriginal  ->asDouble(x, y)
-				));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Slope			.Destroy();
-	m_Illumination	.Destroy();
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CTopographic_Correction::Get_Correction(double Slope, double Illumination, double Value)
-{
-	switch( m_Method )
-	{
-	case 0:	// Cosine Correction (Teillet et al. 1982)
-		if( Illumination > 0.0 )
-		{
-			Value	= Value * m_cosTz / Illumination;
-		}
-		break;
-
-	case 1:	// Cosine Correction (Civco 1989)
-		Value	= Value + (Value * ((m_Illumination.Get_ArithMean() - Illumination) / m_Illumination.Get_ArithMean()));
-		break;
-
-	case 2:	// Minnaert Correction
-		if( Illumination > 0.0 )
-		{
-			Value	= Value * pow(m_cosTz / Illumination, m_Minnaert);
-		}
-		break;
-
-	case 3:	// Minnaert Correction with Slope (Riano et al. 2003)
-		if( Illumination > 0.0 )
-		{
-			Value	= Value * cos(Slope) * pow(m_cosTz / (Illumination * cos(Slope)), m_Minnaert);
-		}
-		break;
-
-	case 4:	// Minnaert Correction with Slope (Law & Nichol 2004)
-		if( Illumination > 0.0 )
-		{
-			Value	= Value * cos(Slope) / pow(Illumination * cos(Slope), m_Minnaert);
-		}
-		break;
-
-	case 5:	// C Correction
-		Value	= Value * (m_cosTz + m_C) / (Illumination + m_C);
-		break;
-
-	case 6:	// Normalization
-		Value	= Value + ((Value * ((m_Illumination.Get_ArithMean() - Illumination) / m_Illumination.Get_ArithMean())) * m_C);
-		break;
-	}
-
-	return( Value < 0 ? 0 : Value > m_maxValue ? m_maxValue : Value );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTopographic_Correction::Get_Model(void)
-{
-	//-----------------------------------------------------
-	m_pOriginal		= Parameters("ORIGINAL")	->asGrid();
-	m_pCorrected	= Parameters("CORRECTED")	->asGrid();
-
-	m_pCorrected	->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pOriginal->Get_Name(), _TL("Topographic Correction")));
-
-	m_Method		= Parameters("METHOD")		->asInt();
-
-	m_Minnaert		= Parameters("MINNAERT")	->asDouble();
-
-	switch( Parameters("MAXVALUE")->asInt() )
-	{
-	default:	m_maxValue	=   255;	break;
-	case  1:	m_maxValue	= 65535;	break;
-	}
-
-	switch( m_Method )
-	{
-	//-----------------------------------------------------
-	case 5:	// C Correction
-		{
-			Process_Set_Text(_TL("Regression Analysis"));
-
-			CSG_Regression	R;
-
-			long n		= Parameters("MAXCELLS")->asInt();
-			int	nStep	= Get_NCells() < n ? 1 : (int)(Get_NCells() / n);
-
-			for(n=0; n<Get_NCells() && Set_Progress_NCells(n); n+=nStep)
-			{
-				R.Add_Values(m_pOriginal->asDouble(n), m_Illumination.asDouble(n));
-			}
-
-			if( !R.Calculate() || !R.Get_Constant() )
-			{
-				return( false );
-			}
-
-			m_C	= R.Get_Coefficient() / R.Get_Constant();
-
-			Message_Add(R.asString());
-		}
-		break;
-
-	//-----------------------------------------------------
-	case 6:	// Normalization (after Civco, modified by Law & Nichol)
-		{
-			m_C	= 1.0;
-		}
-		break;
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTopographic_Correction::Get_Illumination(void)
-{
-	Process_Set_Text(_TL("Illumination calculation"));
-
-	//-----------------------------------------------------
-	CSG_Grid	DEM, *pDEM	= Parameters("DEM")->asGrid();
-
-	if( !pDEM->Get_System().is_Equal(*Get_System()) )
-	{
-		DEM.Create(*Get_System());
-		DEM.Assign(pDEM, pDEM->Get_Cellsize() > Get_Cellsize() ? GRID_INTERPOLATION_BSpline : GRID_INTERPOLATION_Mean_Cells);
-		pDEM	= &DEM;
-	}
-
-	//-----------------------------------------------------
-	double	Azi	= Parameters("AZI")->asDouble() * M_DEG_TO_RAD;
-	double	Hgt	= Parameters("HGT")->asDouble() * M_DEG_TO_RAD;
-
-	m_cosTz	= cos(M_PI_090 - Hgt);
-	m_sinTz	= sin(M_PI_090 - Hgt);
-
-	m_Slope			.Create(*Get_System());
-	m_Illumination	.Create(*Get_System());
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	Slope, Aspect;
-
-			if( pDEM->Get_Gradient(x, y, Slope, Aspect) )
-			{
-				m_Slope			.Set_Value(x, y, Slope);
-				m_Illumination	.Set_Value(x, y, cos(Slope) * m_cosTz + sin(Slope) * m_sinTz * cos(Azi - Aspect));
-			}
-			else
-			{
-				m_Slope			.Set_Value(x, y, 0.0);
-				m_Illumination	.Set_Value(x, y, m_cosTz);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.cpp
deleted file mode 100644
index 8709703..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.cpp
+++ /dev/null
@@ -1,433 +0,0 @@
-/**********************************************************
- * Version $Id: view_shed.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                      ta_lighting                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     View_Shed.cpp                     //
-//                                                       //
-//                 Copyright (C) 2008 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                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "view_shed.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CView_Shed::CView_Shed(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Sky View Factor"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		"Calculation of visible sky, sky view factor (SVF) and related parameters.\n"
-		"\n"
-		"References:\n"
-		"Boehner, J., Antonic, O. (2008): "
-		"'Land-suface parameters specific to topo-climatology'. "
-		"in: Hengl, T., Reuter, H. (Eds.): 'Geomorphometry - Concepts, Software, Applications', in press\n"
-		"\n"
-		"Hantzschel, J., Goldberg, V., Bernhofer, C. (2005): "
-		"'GIS-based regionalisation of radiation, temperature and coupling measures in complex terrain for low mountain ranges'. "
-		"Meteorological Applications, V.12:01, p.33�42, doi:10.1017/S1350482705001489\n"
-		"\n"
-		"Oke, T.R. (2000): "
-		"'Boundary Layer Climates'. "
-		"Taylor & Francis, New York. 435pp.\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "VISIBLE"		, _TL("Visible Sky"),
-		_TL("The unobstructed hemisphere given as percentage."),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SVF"			, _TL("Sky View Factor"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SIMPLE"		, _TL("Sky View Factor (Simplified)"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "TERRAIN"		, _TL("Terrain View Factor"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "DISTANCE"	, _TL("View Distance"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Maximum Search Radius"),
-		_TL("This value is ignored if set to zero."),
-		PARAMETER_TYPE_Double	, 10000.0, 0.0, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("multi scale"),
-			_TL("sectors")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "DLEVEL"		, _TL("Multi Scale Factor"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 3.0, 1.25, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "NDIRS"		, _TL("Number of Sectors"),
-		_TL(""),
-		PARAMETER_TYPE_Int	, 8.0, 3, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CView_Shed::On_Execute(void)
-{
-	CSG_Grid	*pVisible, *pSVF, *pSimple, *pTerrain, *pDistance;
-
-	m_pDEM		= Parameters("DEM"     )->asGrid();
-
-	pVisible	= Parameters("VISIBLE" )->asGrid();
-	pSVF		= Parameters("SVF"     )->asGrid();
-	pSimple		= Parameters("SIMPLE"  )->asGrid();
-	pTerrain	= Parameters("TERRAIN" )->asGrid();
-	pDistance	= Parameters("DISTANCE")->asGrid();
-
-	m_Radius	= Parameters("RADIUS"  )->asDouble();
-	m_Method	= Parameters("METHOD"  )->asInt();
-
-	DataObject_Set_Colors(pVisible	, 100, SG_COLORS_BLACK_WHITE);
-	DataObject_Set_Colors(pSVF		, 100, SG_COLORS_BLACK_WHITE);
-	DataObject_Set_Colors(pSimple	, 100, SG_COLORS_BLACK_WHITE);
-	DataObject_Set_Colors(pTerrain	, 100, SG_COLORS_BLACK_WHITE, true);
-	DataObject_Set_Colors(pDistance	, 100, SG_COLORS_RED_GREY_GREEN, true);
-
-	//-----------------------------------------------------
-	if( m_Method == 0 )	// multi scale
-	{
-		if( !m_Pyramid.Create(m_pDEM, Parameters("DLEVEL")->asDouble(), GRID_PYRAMID_Mean) )
-		{
-			return( false );
-		}
-
-		m_nLevels	= m_Pyramid.Get_Count();
-
-		if( m_Radius > 0.0 )
-		{
-			while( m_nLevels > 0 && m_Pyramid.Get_Grid(m_nLevels - 1)->Get_Cellsize() > m_Radius )
-			{
-				m_nLevels--;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	bool	bResult	= Initialise(Parameters("NDIRS")->asInt());
-
-	if( bResult )
-	{
-		if( m_Method != 0 && m_Radius <= 0.0 )
-		{
-			m_Radius	= Get_Cellsize() * M_GET_LENGTH(Get_NX(), Get_NY());
-		}
-
-		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-		{
-			#pragma omp parallel for
-			for(int x=0; x<Get_NX(); x++)
-			{
-				double	Visible, SVF, Simple, Terrain, Distance;
-
-				if( Get_View_Shed(x, y, Visible, SVF, Simple, Terrain, Distance) )
-				{
-					if( pVisible  )	pVisible ->Set_Value (x, y, Visible);
-					if( pSVF      )	pSVF	 ->Set_Value (x, y, SVF);
-					if( pSimple   )	pSimple	 ->Set_Value (x, y, Simple);
-					if( pTerrain  )	pTerrain ->Set_Value (x, y, Terrain);
-					if( pDistance )	pDistance->Set_Value (x, y, Distance);
-				}
-				else
-				{
-					if( pVisible  )	pVisible ->Set_NoData(x, y);
-					if( pSVF      )	pSVF	 ->Set_NoData(x, y);
-					if( pSimple   )	pSimple	 ->Set_NoData(x, y);
-					if( pTerrain  )	pTerrain ->Set_NoData(x, y);
-					if( pDistance )	pDistance->Set_NoData(x, y);
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Pyramid	.Destroy();
-	m_Direction	.Clear();
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CView_Shed::Initialise(int nDirections)
-{
-	m_Direction.Set_Count(nDirections);
-
-	for(int i=0; i<nDirections; i++)
-	{
-		m_Direction[i].z	= (M_PI_360 * i) / nDirections;
-		m_Direction[i].x	= sin(m_Direction[i].z);
-		m_Direction[i].y	= cos(m_Direction[i].z);
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CView_Shed::Get_View_Shed(int x, int y, double &Sky_Visible, double &Sky_Factor, double &Sky_Simple, double &Sky_Terrain, double &Distance)
-{
-	if( m_pDEM->is_NoData(x, y) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	CSG_Vector	Angles(m_Direction.Get_Count()), Distances(m_Direction.Get_Count());
-
-	switch( m_Method )
-	{
-	case 0:	if( !Get_Angles_Multi_Scale(x, y, Angles, Distances) )	return( false );	break;
-	case 1:	if( !Get_Angles_Sectoral   (x, y, Angles, Distances) )	return( false );	break;
-	}
-
-	//-----------------------------------------------------
-	double	Slope, Aspect, sinSlope, cosSlope, Phi, sinPhi, cosPhi;
-
-	if( !m_pDEM->Get_Gradient(x, y, Slope, Aspect) )
-	{
-		Slope	= Aspect	= 0.0;
-	}
-
-	sinSlope	= sin(Slope);
-	cosSlope	= cos(Slope);
-
-	Sky_Visible	= 0.0;
-	Sky_Factor	= 0.0;
-	Distance	= 0.0;
-
-	//-----------------------------------------------------
-	for(int i=0; i<m_Direction.Get_Count(); i++)
-	{
-		Phi			= atan(Angles[i]);
-		cosPhi		= cos(Phi);
-		sinPhi		= sin(Phi);
-
-		Sky_Visible	+= (M_PI_090 - Phi) * 100.0 / M_PI_090;
-		Sky_Factor	+= cosSlope * cosPhi*cosPhi + sinSlope * cos(m_Direction[i].z - Aspect) * ((M_PI_090 - Phi) - sinPhi * cosPhi);
-		Distance	+= Distances[i];
-	}
-
-	Sky_Visible	/= m_Direction.Get_Count();
-	Sky_Factor	/= m_Direction.Get_Count();
-	Distance	/= m_Direction.Get_Count();
-
-	Sky_Simple	= (1.0 + cosSlope) / 2.0;
-	Sky_Terrain	= Sky_Simple - Sky_Factor;
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CView_Shed::Get_Angles_Multi_Scale(int x, int y, CSG_Vector &Angles, CSG_Vector &Distances)
-{
-	if( !m_pDEM->is_NoData(x, y) )
-	{
-		double		z, d;
-		TSG_Point	p, q;
-
-		z	= m_pDEM->asDouble(x, y);
-		p	= Get_System()->Get_Grid_to_World(x, y);
-
-		//-------------------------------------------------
-		for(int iGrid=-1; iGrid<m_nLevels; iGrid++)
-		{
-			CSG_Grid	*pGrid	= m_Pyramid.Get_Grid(iGrid);
-
-			for(int i=0; i<m_Direction.Get_Count(); i++)
-			{
-				q.x	= p.x + pGrid->Get_Cellsize() * m_Direction[i].x;
-				q.y	= p.y + pGrid->Get_Cellsize() * m_Direction[i].y;
-
-				if( pGrid->Get_Value(q, d) && (d = (d - z) / pGrid->Get_Cellsize()) > Angles[i] )
-				{
-					Angles   [i]	= d;
-					Distances[i]	= pGrid->Get_Cellsize();
-				}
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CView_Shed::Get_Angles_Sectoral(int x, int y, CSG_Vector &Angles, CSG_Vector &Distances)
-{
-	if( !m_pDEM->is_NoData(x, y) )
-	{
-		//-------------------------------------------------
-		for(int i=0; i<m_Direction.Get_Count(); i++)
-		{
-			Get_Angle_Sectoral(x, y, i, Angles[i], Distances[i]);
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-void CView_Shed::Get_Angle_Sectoral(int x, int y, int i, double &Angle, double &Distance)
-{
-	double	iDistance, dDistance, dx, dy, ix, iy, d, z;
-
-	z			= m_pDEM->asDouble(x, y);
-	dx			= m_Direction[i].x;
-	dy			= m_Direction[i].y;
-	ix			= x;
-	iy			= y;
-	Angle		= 0.0;
-	Distance	= 0.0;
-	iDistance	= 0.0;
-	dDistance	= Get_Cellsize() * M_GET_LENGTH(dx, dy);
-
-	while( is_InGrid(x, y) && Distance <= m_Radius )
-	{
-		ix	+= dx;	x	= (int)(0.5 + ix);
-		iy	+= dy;	y	= (int)(0.5 + iy);
-		iDistance	+= dDistance;
-
-		if( m_pDEM->is_InGrid(x, y) && (d = (m_pDEM->asDouble(x, y) - z) / iDistance) > Angle )
-		{
-			Angle		= d;
-			Distance	= iDistance;
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.cpp
deleted file mode 100644
index 0c1075c..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/**********************************************************
- * Version $Id: Curvature_Classification.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//             Curvature_Classification.cpp              //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Curvature_Classification.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CCurvature_Classification::CCurvature_Classification(void)
-{
-	Set_Name		(_TL("Curvature Classification"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001"));
-
-	Set_Description	(_TW(
-		"Surface curvature based terrain classification.\n"
-		"Reference:\n"
-		"Dikau, R. (1988):\n'Entwurf einer geomorphographisch-analytischen Systematik von Reliefeinheiten',\n"
-		"Heidelberger Geographische Bausteine, Heft 5\n\n"
-		"0 - V  / V\n"
-		"1 - GE / V\n"
-		"2 - X  / V\n"
-		"3 - V  / GR\n"
-		"4 - GE / GR\n"
-		"5 - X  / GR\n"
-		"6 - V  / X\n"
-		"7 - GE / X\n"
-		"8 - X  / X\n"
-	));
-
-	Parameters.Add_Grid (NULL, "CPLAN"		, _TL("Plan Curvature")				, _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid (NULL, "CPROF"		, _TL("Profile Curvature")			, _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Value(NULL, "THRESHOLD"	, _TL("Threshold for plane")		, _TL(""), PARAMETER_TYPE_Double, 0.001, 0.0, true);
-	Parameters.Add_Grid (NULL, "CLASS"		, _TL("Curvature Classification")	, _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Char);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CCurvature_Classification::On_Execute(void)
-{
-	int			x, y, Class;
-	double		Threshold, dPlan, dProf;
-	CSG_Grid	*pPlan, *pProf, *pClasses;
-
-	//-----------------------------------------------------
-	pPlan		= Parameters("CPLAN")		->asGrid();
-	pProf		= Parameters("CPROF")		->asGrid();
-	Threshold	= Parameters("THRESHOLD")	->asDouble();
-	pClasses	= Parameters("CLASS")		->asGrid();
-
-	pClasses->Set_NoData_Value(-1);
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pPlan->is_NoData(x, y) || pProf->is_NoData(x, y) )
-			{
-				pClasses->Set_NoData(x, y);
-			}
-			else
-			{
-				dPlan	= pPlan->asDouble(x, y);
-				dProf	= pProf->asDouble(x, y);
-
-				Class	 = dPlan < -Threshold ? 0 : (dPlan <= Threshold ? 3 : 6);
-				Class	+= dProf < -Threshold ? 0 : (dProf <= Threshold ? 1 : 2);
-
-				pClasses->Set_Value(x, y, Class);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameters	P;
-
-	if( DataObject_Get_Parameters(pClasses, P) && P("COLORS_TYPE") && P("LUT") )
-	{
-		int Color[9]	=
-		{
-			SG_GET_RGB(  0,   0, 127),	// V  / V
-			SG_GET_RGB(  0,  63, 200),	// GE / V
-			SG_GET_RGB(  0, 127, 255),	// X  / V
-			SG_GET_RGB(127, 200, 255),	// V  / GR
-			SG_GET_RGB(255, 255, 255),	// GE / GR
-			SG_GET_RGB(255, 200, 127),	// X  / GR
-			SG_GET_RGB(255, 127,   0),	// V  / X
-			SG_GET_RGB(200,  63,   0),	// GE / X
-			SG_GET_RGB(127,   0,   0),	// X  / X
-		};
-
-		//-------------------------------------------------
-		CSG_Strings	Name, Desc;
-
-		Name	+= _TL( "V / V" );	Desc	+= _TL( "V / V" );
-		Name	+= _TL("GE / V" );	Desc	+= _TL("GE / V" );
-		Name	+= _TL( "X / V" );	Desc	+= _TL( "X / V" );
-		Name	+= _TL( "V / GR");	Desc	+= _TL( "V / GR");
-		Name	+= _TL("GE / GR");	Desc	+= _TL("GE / GR");
-		Name	+= _TL( "X / GR");	Desc	+= _TL( "X / GR");
-		Name	+= _TL( "V / X" );	Desc	+= _TL( "V / X" );
-		Name	+= _TL("GE / X" );	Desc	+= _TL("GE / X" );
-		Name	+= _TL( "X / X" );	Desc	+= _TL( "X / X" );
-
-		//-------------------------------------------------
-		CSG_Table	*pTable	= P("LUT")->asTable();
-
-		pTable->Del_Records();
-
-		for(int i=0; i<9; i++)
-		{
-			CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-			pRecord->Set_Value(0, Color[i]);
-			pRecord->Set_Value(1, Name [i].c_str());
-			pRecord->Set_Value(2, Desc [i].c_str());
-			pRecord->Set_Value(3, i);
-			pRecord->Set_Value(4, i);
-		}
-
-		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
-
-		DataObject_Set_Parameters(pClasses, P);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.h b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.h
deleted file mode 100644
index 338336d..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**********************************************************
- * Version $Id: Curvature_Classification.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//              Curvature_Classification.h               //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Curvature_Classification_H
-#define HEADER_INCLUDED__Curvature_Classification_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class ta_morphometry_EXPORT CCurvature_Classification : public CSG_Module_Grid
-{
-public:
-	CCurvature_Classification(void);
-
-	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("A:Terrain Analysis|Terrain Classification" ));	}
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Curvature_Classification_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.cpp
deleted file mode 100644
index a680265..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.cpp
+++ /dev/null
@@ -1,374 +0,0 @@
-/**********************************************************
- * Version $Id: Hypsometry.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    Hypsometry.cpp                     //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Hypsometry.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CHypsometry::CHypsometry(void)
-{
-	//-----------------------------------------------------
-	Set_Name(_TL("Hypsometry"));
-
-	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"Calculates the hypsometric curve for a given DEM.\n\n"
-		"References:\n"
-		"- Harlin, J.M (1978):\n"
-		"    'Statistical moments of the hypsometric curve and its density function',\n"
-		"    J. Int. Assoc. Math. Geol., Vol.10, p.59-72\n\n"
-		"- Luo, W. (2000):\n"
-		"    'Quantifying groundwater-sapping landforms with a hypsometric technique',\n"
-		"    J. of Geophysical Research, Vol.105, No.E1, p.1685-1694\n\n")
-	);
-
-
-	//-----------------------------------------------------
-	// Input...
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-
-	//-----------------------------------------------------
-	// Output...
-
-	Parameters.Add_Table(
-		NULL	, "TABLE"		, _TL("Hypsometry"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-
-	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL	, "COUNT"		, _TL("Number of Classes"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 100, 1, true
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "SORTING"		, _TL("Sort"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("up"),
-			_TL("down")
-		), 1
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Classification Constant"),
-		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("height"),
-			_TL("area")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		NULL	, "BZRANGE"		, _TL("Use Z-Range"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Range(
-		NULL	, "ZRANGE"		, _TL("Z-Range"),
-		_TL(""),
-		0.0, 1000.0
-	);
-}
-
-//---------------------------------------------------------
-CHypsometry::~CHypsometry(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CHypsometry::On_Execute(void)
-{
-	bool	bDown;
-	int		nClasses;
-	double	zMin, zMax;
-	CSG_Grid	*pDEM;
-	CSG_Table	*pTable;
-
-	pDEM		= Parameters("ELEVATION")	->asGrid();
-	pTable		= Parameters("TABLE")		->asTable();
-	bDown		= Parameters("SORTING")		->asInt() == 1;
-	nClasses	= Parameters("COUNT")		->asInt();
-	zMin		= Parameters("BZRANGE")		->asBool() ? Parameters("ZRANGE")->asRange()->Get_LoVal() : 0.0;
-	zMax		= Parameters("BZRANGE")		->asBool() ? Parameters("ZRANGE")->asRange()->Get_HiVal() : 0.0;
-	
-	pTable->Destroy();
-	pTable->Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Hypsometric Curve"), pDEM->Get_Name()));
-	pTable->Add_Field(_TL("Relative Height"), SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Relative Area")	, SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Absolute Height"), SG_DATATYPE_Double);
-	pTable->Add_Field(_TL("Absolute Area")	, SG_DATATYPE_Double);
-
-	switch( Parameters("METHOD")->asInt() )
-	{
-	case 0:				return( Calculate_A(pDEM, pTable, bDown, nClasses) );
-	case 1:	default:	return( Calculate_B(pDEM, pTable, bDown, nClasses, zMin, zMax) );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CHypsometry::Calculate_A(CSG_Grid *pDEM, CSG_Table *pTable, bool bDown, int nClasses)
-{
-	int		i;
-	long	n, *Cells_Count;
-	double	z, dz, A, a, Min, Max, za, zb;
-
-	CSG_Table_Record	*pRecord;
-
-	//-----------------------------------------------------
-	// 1. Min, Max, Area...
-
-	A	= 0;
-
-	for(n=0; n<pDEM->Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( !pDEM->is_NoData(n) )
-		{
-			if( A <= 0 )
-			{
-				Min	= Max	= pDEM->asDouble(n);
-			}
-			else
-			{
-				z	= pDEM->asDouble(n);
-
-				if( Min > z )
-				{
-					Min	= z;
-				}
-				else if( Max < z )
-				{
-					Max	= z;
-				}
-			}
-
-			A++;
-		}
-	}
-
-
-	//-----------------------------------------------------
-	// 2. Hypsometric Curve...
-
-	if( A > 0 && Min < Max )
-	{
-		Cells_Count	= (long *)SG_Calloc(nClasses + 1, sizeof(long));
-
-		for(n=0; n<pDEM->Get_NCells() && Set_Progress_NCells(n); n++)
-		{
-			if( !pDEM->is_NoData(n) )
-			{
-				i	= (int)(nClasses * (Max - pDEM->asDouble(n)) / (Max - Min));
-
-				Cells_Count[i]++;
-			}
-		}
-
-		dz	= (Max - Min) / nClasses;
-		a	= A;
-
-		for(i=nClasses; i>=0; i--)
-		{
-			za	= a / A;
-			a	-= Cells_Count[bDown ? i : nClasses - i];
-			zb	= a / A;
-
-			pRecord	= pTable->Add_Record();
-			pRecord->Set_Value(0, 100.0 * i * dz / (Max - Min));	// Relative Height
-			pRecord->Set_Value(1, 100.0 * za);						// Relative Area
-			pRecord->Set_Value(2, Min +   i * dz);					// Absolute Height
-			pRecord->Set_Value(3, a * pDEM->Get_Cellarea());		// Absolute Area
-		}
-
-		SG_Free(Cells_Count);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CHypsometry::Calculate_B(CSG_Grid *pDEM, CSG_Table *pTable, bool bDown, int nClasses, double zMin, double zMax)
-{
-	int		x, y, i;
-	long	n, nMin, nMax, nStep, nRange;
-	double	z, zRange;
-
-	//-----------------------------------------------------
-	if( zMin < zMax && zMin < pDEM->Get_ZMax() && zMax > pDEM->Get_ZMin() )
-	{
-		for(nMin=0; nMin<pDEM->Get_NCells() && Set_Progress_NCells(nMin); nMin++)
-		{
-			if( pDEM->Get_Sorted(nMin, x, y, !bDown) && zMin <= pDEM->asDouble(x, y) )
-			{
-				zMin	= pDEM->asDouble(x, y);
-				break;
-			}
-		}
-
-		for(nMax=pDEM->Get_NCells() - 1; nMax > nMin && Set_Progress_NCells(nMax); nMax--)
-		{
-			if( pDEM->Get_Sorted(nMax, x, y, !bDown) && zMax >= pDEM->asDouble(x, y) )
-			{
-				zMax	= pDEM->asDouble(x, y);
-				break;
-			}
-		}
-	}
-	else
-	{
-		zMin	= pDEM->Get_ZMin();
-		zMax	= pDEM->Get_ZMax();
-		nMin	= 0;
-		nMax	= pDEM->Get_NCells() - 1;
-	}
-
-	//-----------------------------------------------------
-	if( (nRange = nMax - nMin) > 0 && (zRange = zMax - zMin) > 0 )
-	{
-		CSG_Table_Record	*pRecord;
-
-		pTable->Destroy();
-
-		pTable->Add_Field(_TL("Relative Height"), SG_DATATYPE_Double);
-		pTable->Add_Field(_TL("Relative Area")	, SG_DATATYPE_Double);
-		pTable->Add_Field(_TL("Absolute Height"), SG_DATATYPE_Double);
-		pTable->Add_Field(_TL("Absolute Area")	, SG_DATATYPE_Double);
-
-		pTable->Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Hypsometric Curve"), pDEM->Get_Name()));
-
-		//-------------------------------------------------
-		nStep	= nRange / nClasses;
-
-		for(i=0, n=nMax; i<=nClasses; i++, n-=nStep)
-		{
-			if( pDEM->Get_Sorted(n, x, y, !bDown) )
-			{
-				z	= pDEM->asDouble(x, y);
-
-				pRecord	= pTable->Add_Record();
-				pRecord->Set_Value(0, 100.0 * i / nClasses);				// Relative Area
-				pRecord->Set_Value(1, 100.0 * (z - zMin) / zRange);			// Relative Height
-				pRecord->Set_Value(2, z);									// Absolute Height
-				pRecord->Set_Value(3, i * nStep * pDEM->Get_Cellarea());	// Absolute Area
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.h b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.h
deleted file mode 100644
index bd6e25e..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/**********************************************************
- * Version $Id: Hypsometry.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     Hypsometry.h                      //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Hypsometry_H
-#define HEADER_INCLUDED__Hypsometry_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class ta_morphometry_EXPORT CHypsometry : public CSG_Module_Grid  
-{
-public:
-	CHypsometry(void);
-	virtual ~CHypsometry(void);
-
-
-protected:
-
-	virtual bool		On_Execute		(void);
-
-
-private:
-
-	bool				Calculate_A		(CSG_Grid *pDGM, CSG_Table *pTable, bool bDown, int nClasses);
-	bool				Calculate_B		(CSG_Grid *pDEM, CSG_Table *pTable, bool bDown, int nClasses, double zMin, double zMax);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Hypsometry_H
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.in
deleted file mode 100644
index fc4d801..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.in
+++ /dev/null
@@ -1,648 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis/ta_morphometry
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_morphometry_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_morphometry_la_OBJECTS = Convergence.lo Convergence_Radius.lo \
-	Curvature_Classification.lo Hypsometry.lo MLB_Interface.lo \
-	Morphometry.lo ProtectionIndex.lo RealArea.lo \
-	SurfaceSpecificPoints.lo air_flow_height.lo \
-	anisotropic_heating.lo distance_gradient.lo \
-	fuzzy_landform_elements.lo land_surface_temperature.lo \
-	mass_balance_index.lo mrvbf.lo param_scale.lo \
-	relative_heights.lo ruggedness.lo tc_iwahashi_pike.lo \
-	top_hat.lo tpi.lo wind_effect.lo
-libta_morphometry_la_OBJECTS = $(am_libta_morphometry_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_morphometry_la_SOURCES)
-DIST_SOURCES = $(libta_morphometry_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1619 2013-03-05 16:07:00Z oconrad $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libta_morphometry.la
-libta_morphometry_la_SOURCES = \
-Convergence.cpp\
-Convergence_Radius.cpp\
-Curvature_Classification.cpp\
-Hypsometry.cpp\
-MLB_Interface.cpp\
-Morphometry.cpp\
-ProtectionIndex.cpp\
-RealArea.cpp\
-SurfaceSpecificPoints.cpp\
-air_flow_height.cpp\
-anisotropic_heating.cpp\
-distance_gradient.cpp\
-fuzzy_landform_elements.cpp\
-land_surface_temperature.cpp\
-mass_balance_index.cpp\
-mrvbf.cpp\
-param_scale.cpp\
-relative_heights.cpp\
-ruggedness.cpp\
-tc_iwahashi_pike.cpp\
-top_hat.cpp\
-tpi.cpp\
-wind_effect.cpp\
-Convergence.h\
-Convergence_Radius.h\
-Curvature_Classification.h\
-Hypsometry.h\
-MLB_Interface.h\
-Morphometry.h\
-ProtectionIndex.h\
-RealArea.h\
-SurfaceSpecificPoints.h\
-air_flow_height.h\
-anisotropic_heating.h\
-distance_gradient.h\
-fuzzy_landform_elements.h\
-land_surface_temperature.h\
-mass_balance_index.h\
-mrvbf.h\
-param_scale.h\
-relative_heights.h\
-ruggedness.h\
-tc_iwahashi_pike.h\
-top_hat.h\
-tpi.h\
-wind_effect.h
-
-libta_morphometry_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_morphometry.la: $(libta_morphometry_la_OBJECTS) $(libta_morphometry_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_morphometry_la_OBJECTS) $(libta_morphometry_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Convergence.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Convergence_Radius.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Curvature_Classification.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Hypsometry.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Morphometry.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ProtectionIndex.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RealArea.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SurfaceSpecificPoints.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/air_flow_height.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/anisotropic_heating.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/distance_gradient.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fuzzy_landform_elements.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/land_surface_temperature.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mass_balance_index.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mrvbf.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/param_scale.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/relative_heights.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ruggedness.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tc_iwahashi_pike.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/top_hat.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tpi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wind_effect.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.cpp
deleted file mode 100644
index d9b8707..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.cpp
+++ /dev/null
@@ -1,944 +0,0 @@
-/**********************************************************
- * Version $Id: Morphometry.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    Morphometry.cpp                    //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Morphometry.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CMorphometry::CMorphometry(void)
-{
-	Set_Name		(_TL("Slope, Aspect, Curvature"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2001"));
-
-	Set_Description	(_TW(
-		"Calculates the local morphometric terrain parameters slope, aspect and if supported "
-		"by the chosen method also the curvature. Besides tangential curvature also its "
-		"horizontal and vertical components (i.e. plan and profile curvature) can be calculated.\n"
-
-		"\nReferences:\n\n"
-
-		"Maximum Slope\n"
-		"- Travis, M.R., Elsner, G.H., Iverson, W.D., Johnson, C.G. (1975):\n"
-		"    'VIEWIT: computation of seen areas, slope, and aspect for land-use planning',\n"
-		"    USDA F.S. Gen. Tech. Rep. PSW-11/1975, 70p. Berkeley, California, U.S.A.\n\n"
-
-		"Maximum Triangle Slope\n"
-		"- Tarboton, D.G. (1997):\n"
-		"    'A new method for the determination of flow directions and upslope areas in grid digital elevation models',\n"
-		"    Water Ressources Research, Vol.33, No.2, p.309-319\n\n"
-
-		"Least Squares or Best Fitted Plane\n"
-		"- Horn, B. K. (1981):\n"
-		"    'Hill shading and the relectance map',\n"
-		"    Proceedings of the IEEE, v. 69, no. 1, p. 14-47.\n\n"
-
-		"- Beasley, D.B., Huggins, L.F. (1982):\n"
-		"    'ANSWERS: User's manual',\n"
-		"    U.S. EPA-905/9-82-001, Chicago, IL. 54pp.\n\n"
-
-		"- Costa-Cabral, M., Burges, S.J., (1994):\n"
-		"    'Digital Elevation Model Networks (DEMON): a model of flow over hillslopes for computation of contributing and dispersal areas',\n"
-		"    Water Resources Research, v. 30, no. 6, p. 1681-1692.\n\n"
-
-		"Fit 2.Degree Polynom\n"
-		"- Evans, I.S. (1979):\n"
-		"    'An integrated system of terrain analysis and slope mapping',\n"
-		"    Final report on grant DA-ERO-591-73-G0040. University of Durham, England.\n\n"
-
-		"- Bauer, J., Rohdenburg, H., Bork, H.-R. (1985):\n"
-		"    'Ein Digitales Reliefmodell als Vorraussetzung fuer ein deterministisches Modell der Wasser- und Stoff-Fluesse',\n"
-		"    Landschaftsgenese und Landschaftsoekologie, H.10, Parameteraufbereitung fuer deterministische Gebiets-Wassermodelle,\n"
-		"    Grundlagenarbeiten zu Analyse von Agrar-Oekosystemen, (Eds.: Bork, H.-R. / Rohdenburg, H.), p.1-15\n\n"
-
-		"- Heerdegen, R.G., Beran, M.A. (1982):\n"
-		"    'Quantifying source areas through land surface curvature',\n"
-		"    Journal of Hydrology, Vol.57\n\n"
-
-		"- Olaya, V. (2006):\n"
-		"    'Basic Land-Surface Parameters',\n"
-		"     in: Hengl, T., Reuter, H.I. [Eds.]: Geomorphometry: Concepts, Software, Applications. "
-		"     Developments in Soil Science, Elsevier, Vol.33, 141-169.\n\n"
-
-		"- Zevenbergen, L.W., Thorne, C.R. (1987):\n"
-		"    'Quantitative analysis of land surface topography',\n"
-		"    Earth Surface Processes and Landforms, 12: 47-56.\n\n"
-
-		"Fit 3.Degree Polynom\n"
-		"- R.M. Haralick (1983):\n"
-		"    'Ridge and valley detection on digital images',\n"
-		"    Computer Vision, Graphics and Image Processing, Vol.22, No.1, p.28-38\n\n"
-	));
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "SLOPE"		, _TL("Slope"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "ASPECT"		, _TL("Aspect"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_GENE"		, _TL("General Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_PROF"		, _TL("Profile Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_PLAN"		, _TL("Plan Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_TANG"		, _TL("Tangential Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_LONG"		, _TL("Longitudinal Curvature"),
-		_TL("Zevenbergen & Thorne (1987) refer to this as profile curvature"),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_CROS"		, _TL("Cross-Sectional Curvature"),
-		_TL("Zevenbergen & Thorne (1987) refer to this as plan curvature"),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_MINI"		, _TL("Minimal Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_MAXI"		, _TL("Maximal Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_TOTA"		, _TL("Total Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "C_ROTO"		, _TL("Flow Line Curvature"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
-	//-----------------------------------------------------
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("maximum slope (Travis et al. 1975)"),
-			_TL("maximum triangle slope (Tarboton 1997)"),
-			_TL("least squares fitted plane (Horn 1981, Costa-Cabral & Burgess 1996)"),
-			_TL("6 parameter 2nd order polynom (Evans 1979)"),
-			_TL("6 parameter 2nd order polynom (Heerdegen & Beran 1982)"),
-			_TL("6 parameter 2nd order polynom (Bauer, Rohdenburg, Bork 1985)"),
-			_TL("9 parameter 2nd order polynom (Zevenbergen & Thorne 1987)"),
-			_TL("10 parameter 3rd order polynom (Haralick 1983)")
-		), 6
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "UNIT_SLOPE"	, _TL("Slope Units"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("radians"),
-			_TL("degree"),
-			_TL("percent")
-		), 0
-	);
-
-	Parameters.Add_Choice(
-		NULL	, "UNIT_ASPECT"	, _TL("Aspect Units"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("radians"),
-			_TL("degree")
-		), 0
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CMorphometry::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) )
-	{
-		bool	bOn;
-		
-		bOn	= pParameter->asInt() >= 3 || pParameter->asInt() == 0;
-		pParameters->Get_Parameter("C_GENE")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_PROF")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_PLAN")->Set_Enabled(bOn);
-
-		bOn	= pParameter->asInt() >= 3;
-		pParameters->Get_Parameter("C_TANG")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_LONG")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_CROS")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_MINI")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_MAXI")->Set_Enabled(bOn);
-		pParameters->Get_Parameter("C_TOTA")->Set_Enabled(bOn);
-	}
-
-	return( 1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CMorphometry::On_Execute(void)
-{
-	//-----------------------------------------------------
-	int	Method	= Parameters("METHOD"   )->asInt ();
-
-	m_pDTM		= Parameters("ELEVATION")->asGrid();
-
-	m_pSlope	= Parameters("SLOPE"    )->asGrid();
-	m_pAspect	= Parameters("ASPECT"   )->asGrid();
-
-	m_pC_Gene	= Parameters("C_GENE"   )->asGrid();
-	m_pC_Prof	= Parameters("C_PROF"   )->asGrid();
-	m_pC_Plan	= Parameters("C_PLAN"   )->asGrid();
-	m_pC_Tang	= Parameters("C_TANG"   )->asGrid();
-	m_pC_Long	= Parameters("C_LONG"   )->asGrid();
-	m_pC_Cros	= Parameters("C_CROS"   )->asGrid();
-	m_pC_Mini	= Parameters("C_MINI"   )->asGrid();
-	m_pC_Maxi	= Parameters("C_MAXI"   )->asGrid();
-	m_pC_Tota	= Parameters("C_TOTA"   )->asGrid();
-	m_pC_Roto	= Parameters("C_ROTO"   )->asGrid();
-
-	if( Method == 0 )
-	{
-		m_pC_Tang = m_pC_Long = m_pC_Cros = m_pC_Mini = m_pC_Maxi = m_pC_Tota = m_pC_Roto = NULL;
-	}
-	else if( Method < 3 )
-	{
-		m_pC_Gene = m_pC_Prof = m_pC_Plan =
-		m_pC_Tang = m_pC_Long = m_pC_Cros = m_pC_Mini = m_pC_Maxi = m_pC_Tota = m_pC_Roto = NULL;
-	}
-
-	//-----------------------------------------------------
-	DataObject_Set_Colors(m_pSlope , 11, SG_COLORS_YELLOW_RED   , false);
-	DataObject_Set_Colors(m_pAspect, 11, SG_COLORS_ASPECT_3     , false);
-	DataObject_Set_Colors(m_pC_Gene, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Prof, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Plan, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Tang, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Long, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Cros, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Mini, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Maxi, 11, SG_COLORS_RED_GREY_BLUE, true);
-	DataObject_Set_Colors(m_pC_Tota, 11, SG_COLORS_YELLOW_RED   , false);
-	DataObject_Set_Colors(m_pC_Roto, 11, SG_COLORS_RED_GREY_BLUE, true);
-
-	//-----------------------------------------------------
-	m_Unit_Slope	= Parameters("UNIT_SLOPE" )->asInt();
-
-	if( m_Unit_Slope == 0 )
-	{
-		m_pSlope->Set_Unit(_TL("Radians"));
-	}
-	else if( m_Unit_Slope == 1 )
-	{
-		m_pSlope->Set_Unit(_TL("Degree"));
-	}
-	else // if( m_Unit_Slope == 2 )
-	{
-		m_pSlope->Set_Unit(_TL("Percent"));
-	}
-
-	//-----------------------------------------------------
-	m_Unit_Aspect	= Parameters("UNIT_ASPECT")->asInt();
-
-	if( m_Unit_Aspect == 0 )
-	{
-		m_pAspect->Set_Unit(_TL("Radians"));
-	}
-	else // if( m_Unit_Aspect == 1 )
-	{
-		m_pAspect->Set_Unit(_TL("Degree"));
-	}
-
-	//-----------------------------------------------------
-	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_pDTM->is_NoData(x, y) )
-			{
-				Set_NoData(x, y);
-			}
-			else switch( Method )
-			{
-			case 0:	Set_MaximumSlope (x, y);	break;
-			case 1:	Set_Tarboton     (x, y);	break;
-			case 2:	Set_LeastSquare  (x, y);	break;
-			case 3:	Set_Evans        (x, y);	break;
-			case 4:	Set_Heerdegen    (x, y);	break;
-			case 5:	Set_BRM          (x, y);	break;
-			case 6:	Set_Zevenbergen  (x, y);	break;
-			case 7:	Set_Haralick     (x, y);	break;
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Indexing of the Submatrix:
-//
-//  +-------+    +-------+    +-------+
-//  | 7 0 1 |    | 2 5 8 |    | 8 5 2 |
-//  | 6 * 2 | => | 1 4 7 | or | 7 4 1 |
-//  | 5 4 3 |    | 0 3 6 |    | 6 3 0 |
-//  +-------+    +-------+    +-------+
-//
-//---------------------------------------------------------
-inline void CMorphometry::Get_SubMatrix3x3(int x, int y, double Z[9], int Orientation)
-{
-	static const int	Indexes[][8]	=
-	{
-		{ 5, 8, 7, 6, 3, 0, 1, 2 },
-		{ 5, 2, 1, 0, 3, 6, 7, 8 }
-	};
-
-	int	*Index	= (int *)Indexes[Orientation];
-
-	double	z	= m_pDTM->asDouble(x, y);
-
-	Z[4]		= 0.0;
-
-	for(int i=0; i<8; i++)
-	{
-		int ix	= Get_xTo(i, x);
-		int iy	= Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy) )
-		{
-			Z[Index[i]]	= m_pDTM->asDouble(ix, iy) - z;
-		}
-		else
-		{
-			ix	= Get_xTo(i + 4, x);
-			iy	= Get_yTo(i + 4, y);
-
-			if( m_pDTM->is_InGrid(ix, iy) )
-			{
-				Z[Index[i]]	= z - m_pDTM->asDouble(ix, iy);
-			}
-			else
-			{
-				Z[Index[i]]	= 0.0;
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------
-inline void CMorphometry::Get_SubMatrix5x5(int x, int y, double Z[25])
-{
-	double	z	= m_pDTM->asDouble(x,y);
-
-	for(int i=0, iy=y-2; iy<=y+2; iy++)
-	{
-		int	jy	= iy < 0 ? 0 : (iy >= Get_NY() ? Get_NY() - 1 : iy);
-
-		for(int ix=x-2; ix<=x+2; ix++, i++)
-		{
-			int	jx	= ix < 0 ? 0 : (ix >= Get_NX() ? Get_NX() - 1 : ix);
-
-			Z[i]	= m_pDTM->is_InGrid(jx, jy) ? m_pDTM->asDouble(jx, jy) - z : 0.0;
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define SET_NODATA(grid)		if( grid ) grid->Set_NoData(x, y);
-#define SET_VALUE(grid, value)	if( grid ) grid->Set_Value(x, y, value);
-
-//---------------------------------------------------------
-inline void CMorphometry::Set_NoData(int x, int y)
-{
-	SET_NODATA(m_pSlope )
-	SET_NODATA(m_pAspect)
-	SET_NODATA(m_pC_Gene)
-	SET_NODATA(m_pC_Prof)
-	SET_NODATA(m_pC_Plan)
-	SET_NODATA(m_pC_Tang)
-	SET_NODATA(m_pC_Long)
-	SET_NODATA(m_pC_Cros)
-	SET_NODATA(m_pC_Mini)
-	SET_NODATA(m_pC_Maxi)
-	SET_NODATA(m_pC_Tota)
-	SET_NODATA(m_pC_Roto)
-}
-
-//---------------------------------------------------------
-inline void CMorphometry::Set_Gradient(int x, int y, double Slope, double Aspect)
-{
-	//-----------------------------------------------------
-	if( m_Unit_Slope == 1 )
-	{
-		SET_VALUE(m_pSlope, Slope * M_RAD_TO_DEG);
-	}
-	else if( m_Unit_Slope == 2 )
-	{
-		SET_VALUE(m_pSlope, 100.0 * tan(Slope));
-	}
-	else
-	{
-		SET_VALUE(m_pSlope, Slope);
-	}
-
-	//-----------------------------------------------------
-	if( m_Unit_Aspect == 1 && Aspect >= 0.0 )
-	{
-		SET_VALUE(m_pAspect, Aspect * M_RAD_TO_DEG);
-	}
-	else
-	{
-		SET_VALUE(m_pAspect, Aspect);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void CMorphometry::Set_From_Polynom(int x, int y, double r, double t, double s, double p, double q)
-{
-	//-----------------------------------------------------
-	double	p2_q2	= p*p + q*q;
-
-	Set_Gradient(x, y, atan(sqrt(p2_q2)),
-		  p != 0.0 ? M_PI_180 + atan2(q, p)
-		: q >  0.0 ? M_PI_270
-		: q <  0.0 ? M_PI_090
-		: m_pAspect ? m_pAspect->Get_NoData_Value() : -1
-	);
-
-	//-----------------------------------------------------
-	if( p2_q2 )
-	{
-		double	spq = s * p * q, p2 = p*p, q2 = q*q;	r	*= 2;	t	*= 2;
-
-		SET_VALUE(m_pC_Gene, -2 * (r + t));
-		SET_VALUE(m_pC_Prof, -(r * p2 + t * q2 + 2 * spq) / (p2_q2 * pow(1 + p2_q2, 1.5)));
-		SET_VALUE(m_pC_Plan, -(t * p2 + r * q2 - 2 * spq) / (        pow(    p2_q2, 1.5)));
-		SET_VALUE(m_pC_Tang, -(t * p2 + r * q2 - 2 * spq) / (p2_q2 * pow(1 + p2_q2, 0.5)));
-		SET_VALUE(m_pC_Long, -2 * (r * p2 + t * q2 + spq) / (p2_q2                      ));
-		SET_VALUE(m_pC_Cros, -2 * (t * p2 + r * q2 - spq) / (p2_q2                      ));
-		SET_VALUE(m_pC_Mini, -r/2 - t/2 - sqrt(0.5 * (r - t)*(r - t) + s*s));
-		SET_VALUE(m_pC_Maxi, -r/2 - t/2 + sqrt(0.5 * (r - t)*(r - t) + s*s));
-		SET_VALUE(m_pC_Tota, r*r + 2 * s*s + t*t);
-		SET_VALUE(m_pC_Roto, (p2 - q2) * s - p * q * (r - t));	// rotor
-	//	SET_VALUE(m_pC_Gaus, (r * t - 2 * s*s) / (1 + p2_q2));	// total gaussian
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//					The Methods							 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Maximum Slope (Travis et al., 1975, Peucker & Douglas, 1975))
-//
-// Travis, M.R., Elsner, G.H., Iverson, W.D., and Johnson, C.G. 1975:
-//		VIEWIT: computation of seen areas, slope, and aspect for land-use planning.
-//		USDA F.S. Gen. Tech. Rep. PSW-11/1975, 70p. Berkeley, California, U.S.A.
-//
-//---------------------------------------------------------
-void CMorphometry::Set_MaximumSlope(int x, int y)
-{
-	int		i, ix, iy, j, Aspect;
-
-	double	z, Z[8], Slope, Curv, hCurv, a, b;
-
-	//-----------------------------------------------------
-	z		= m_pDTM->asDouble(x, y);
-    Slope	= Curv	= 0.0;
-
-	for(Aspect=-1, i=0; i<8; i++)
-	{
-		ix		= Get_xTo(i, x);
-		iy		= Get_yTo(i, y);
-
-		if( !m_pDTM->is_InGrid(ix, iy) )
-		{
-			Z[i]	= 0.0;
-		}
-		else
-		{
-			Z[i]	= atan((z - m_pDTM->asDouble(ix, iy)) / Get_Length(i));
-			Curv	+= Z[i];
-
-			if( Z[i] > Slope )
-			{
-				Aspect	= i;
-				Slope	= Z[i];
-			}
-		}
-	}
-
-	//-------------------------------------------------
-	if( Aspect < 0.0 )
-	{
-		Set_NoData(x, y);
-	}
-	else
-	{
-		//---------------------------------------------
-		// Let's now estimate the plan curvature...
-
-		for(i=Aspect+1, j=0, a=0.0; i<Aspect+8; i++, j++)
-		{
-			if( Z[i % 8] < 0.0 )
-			{
-				a	= j + Z[(i - 1) % 8] / (Z[(i - 1) % 8] - Z[i % 8]);
-				break;
-			}
-		}
-
-		if( a != 0.0 )
-		{
-			for(i=Aspect+7, j=0, b=0.0; i>Aspect; i--, j++)
-			{
-				if( Z[i % 8] < 0.0 )
-				{
-					b	= j + Z[(i + 1) % 8] / (Z[(i + 1) % 8] - Z[i % 8]);
-					break;
-				}
-			}
-
-			hCurv	=  45.0 * (a + b) - 180.0;
-		}
-		else
-		{
-			hCurv	=  180.0;
-		}
-
-		//---------------------------------------------
-		Set_Gradient(x, y, Slope, Aspect * M_PI_045);
-
-		SET_VALUE(m_pC_Gene, Curv);
-		SET_VALUE(m_pC_Prof, Z[Aspect] + Z[(Aspect + 4) % 8]);
-		SET_VALUE(m_pC_Gene, hCurv);
-	}
-}
-
-//---------------------------------------------------------
-// Maximum Triangle Slope
-//
-// Tarboton, D.G. (1997):
-//		'A new method for the determination of flow directions and upslope areas in grid digital elevation models',
-//		Water Ressources Research, Vol.33, No.2, p.309-319
-//
-//---------------------------------------------------------
-void CMorphometry::Set_Tarboton(int x, int y)
-{
-	int		i, ix, iy, j;
-	double	z, Z[8], iSlope, iAspect, Slope, Aspect, G, H;
-
-	//-----------------------------------------------------
-	z		= m_pDTM->asDouble(x, y);
-
-	for(i=0; i<8; i++)
-	{
-		ix		= Get_xTo(i, x);
-		iy		= Get_yTo(i, y);
-
-		if( m_pDTM->is_InGrid(ix, iy) )
-		{
-			Z[i]	=  m_pDTM->asDouble(ix, iy);
-		}
-		else
-		{
-			ix		= Get_xTo(i + 4, x);
-			iy		= Get_yTo(i + 4, y);
-
-			if( m_pDTM->is_InGrid(ix, iy) )
-			{
-				Z[i]	=  z - (m_pDTM->asDouble(ix, iy) - z);
-			}
-			else
-			{
-				Z[i]	=  z;
-			}
-		}
-	}
-
-	//---------------------------------------------
-    Slope	=  0.0;
-	Aspect	= -1.0;
-
-	for(i=0, j=1; i<8; i++, j=(j+1)%8)
-	{
-		if( i % 2 )	// i => diagonal
-		{
-			G		= (z    - Z[j]) / Get_Cellsize();
-			H		= (Z[j]	- Z[i]) / Get_Cellsize();
-		}
-		else		// i => orthogonal
-		{
-			G		= (z    - Z[i]) / Get_Cellsize();
-			H		= (Z[i]	- Z[j]) / Get_Cellsize();
-		}
-
-		if( H < 0.0 )
-		{
-			iAspect	= 0.0;
-			iSlope	= G;
-		}
-		else if( H > G )
-		{
-			iAspect	= M_PI_045;
-			iSlope	= (z - Z[i % 2 ? i : j]) / (sqrt(2.0) * Get_Cellsize());
-		}
-		else
-		{
-			iAspect	= atan(H / G);
-			iSlope	= sqrt(G*G + H*H);
-		}
-
-		if( iSlope > Slope )
-		{
-			Aspect	= i * M_PI_045 + (i % 2 ? M_PI_045 - iAspect : iAspect);
-			Slope	= iSlope;
-		}
-	}
-
-	//---------------------------------------------
-	if( Aspect < 0.0 )
-	{
-		Set_NoData(x, y);
-	}
-	else
-	{
-		Set_Gradient(x, y, atan(Slope), Aspect);
-	}
-}
-
-//---------------------------------------------------------
-// Least Squares or Best Fit Plane (Horn 1981, Beasley & Huggins 1982, Costa-Cabral & Burgess 1994)
-//
-// Horn, B. K. (1981):
-//      Hill shading and the relectance map.
-//      Proceedings of the IEEE, v. 69, no. 1, p 14-47.
-//
-// Beasley, D.B. and Huggins, L.F. 1982:
-//		ANSWERS: User�s manual.
-//		U.S. EPA-905/9-82-001, Chicago, IL. 54pp.
-//
-// Costa-Cabral, M., and Burges, S.J., 1994:
-//		Digital Elevation Model Networks (DEMON): a model of flow over hillslopes for computation of contributing and dispersal areas
-//		Water Resources Research, v. 30, no. 6, p. 1681-1692.
-//
-//---------------------------------------------------------
-void CMorphometry::Set_LeastSquare(int x, int y)
-{
-	double	Z[9], a, b;
-
-	Get_SubMatrix3x3(x, y, Z);
-
-	a		= ((Z[2] + 2 * Z[5] + Z[8]) - (Z[0] + 2 * Z[3] + Z[6])) / (8 * Get_Cellsize());
-	b		= ((Z[6] + 2 * Z[7] + Z[8]) - (Z[0] + 2 * Z[1] + Z[2])) / (8 * Get_Cellsize());
-
-	Set_Gradient(x, y, atan(sqrt(a*a + b*b)),
-		  a != 0.0 ? M_PI_180 + atan2(b, a)
-		: b >  0.0 ? M_PI_270
-		: b <  0.0 ? M_PI_090
-		: m_pAspect ? m_pAspect->Get_NoData_Value() : -1
-	);
-}
-
-//---------------------------------------------------------
-// Quadratic Function Approximation (Heerdegen & Beran, 1984)
-//
-// Evans, I.S. (1979):
-//		An integrated system of terrain analysis and slope mapping.
-//		Final report on grant DA-ERO-591-73-G0040. University of Durham, England.
-//
-//---------------------------------------------------------
-// f(z) = Ax^2 + By^2 + Cxy + Dx + Ey + F
-//
-//---------------------------------------------------------
-void CMorphometry::Set_Evans(int x, int y)
-{
-	double	Z[9], A, B, C, D, E;
-
-	Get_SubMatrix3x3(x, y, Z, 1);
-
-	A	= (Z[0] + Z[2] + Z[3] + Z[5] + Z[6] + Z[8] - 2 * (Z[1] + Z[4] + Z[7])) / (6 * Get_Cellarea());
-	B	= (Z[0] + Z[1] + Z[2] + Z[6] + Z[7] + Z[8] - 2 * (Z[3] + Z[4] + Z[5])) / (6 * Get_Cellarea());
-	C	= (Z[2] + Z[6] - Z[0] - Z[8])                                          / (4 * Get_Cellarea());
-	D	= (Z[2] + Z[5] + Z[8] - Z[0] - Z[3] - Z[6])                            / (6 * Get_Cellsize());
-    E	= (Z[0] + Z[1] + Z[2] - Z[6] - Z[7] - Z[8])                            / (6 * Get_Cellsize());
-
-	Set_From_Polynom(x, y, A, B, C, D, E);
-}
-
-//---------------------------------------------------------
-// Quadratic Function Approximation (Heerdegen & Beran, 1984)
-//
-// Heerdegen, R.G. / Beran, M.A. (1982):
-//		Quantifying source areas through land surface curvature.
-//		Journal of Hydrology, Vol.57
-//
-//---------------------------------------------------------
-// f(z) = Ax^2 + By^2 + Cxy + Dx + Ey + F
-//
-//---------------------------------------------------------
-void CMorphometry::Set_Heerdegen(int x, int y)
-{
-	double	Z[9], A, B, C, D, E, a, b;
-
-	Get_SubMatrix3x3(x, y, Z);
-
-	a	=   Z[0] + Z[2] + Z[3] + Z[5] + Z[6] + Z[8];
-	b	=   Z[0] + Z[1] + Z[2] + Z[6] + Z[7] + Z[8];
-
-	A	= (0.3 * a - 0.2 * b)                        / (    Get_Cellarea());
-	B	= (0.3 * b - 0.2 * a)                        / (    Get_Cellarea());
-	C	= ( Z[0] - Z[2]               - Z[6] + Z[8]) / (4 * Get_Cellarea());
-	D	= (-Z[0] + Z[2] - Z[3] + Z[5] - Z[6] + Z[8]) / (6 * Get_Cellsize());
-    E	= (-Z[0] - Z[1] - Z[2] + Z[6] + Z[7] + Z[8]) / (6 * Get_Cellsize());
-
-	Set_From_Polynom(x, y, A, B, C, D, E);
-}
-
-//---------------------------------------------------------
-// Quadratic Function Approximation (Bauer, Rohdenburg & Bork, 1985)
-//
-// Bauer, J. / Rohdenburg, H. / Bork, H.-R., (1985):
-//		'Ein Digitales Reliefmodell als Vorraussetzung fuer ein deterministisches Modell der Wasser- und Stoff-Fluesse',
-//		Landschaftsgenese und Landschaftsoekologie, H.10, Parameteraufbereitung fuer deterministische Gebiets-Wassermodelle,
-//		Grundlagenarbeiten zu Analyse von Agrar-Oekosystemen, (Eds.: Bork, H.-R. / Rohdenburg, H.), p.1-15
-//
-//---------------------------------------------------------
-// f(z) = Ax^2 + By^2 + Cxy + Dx + Ey + F
-//
-//---------------------------------------------------------
-void CMorphometry::Set_BRM(int x, int y)
-{
-	double	Z[9], A, B, C, D, E;
-
-	Get_SubMatrix3x3(x, y, Z);
-
-	A	= ( (Z[0] + Z[2] + Z[3] + Z[5] + Z[6] + Z[8]) - 2 * (Z[1] + Z[4] + Z[7]) ) / (    Get_Cellarea());
-	B	= ( (Z[0] + Z[6] + Z[1] + Z[7] + Z[2] + Z[8]) - 2 * (Z[3] + Z[4] + Z[5]) ) / (    Get_Cellarea());
-    C	= (  Z[8] + Z[0] - Z[7] )                                                  / (4 * Get_Cellarea());
-	D	= ( (Z[2] - Z[0]) + (Z[5] - Z[3]) + (Z[8]-Z[6]) )                          / (6 * Get_Cellsize());
-	E	= ( (Z[6] - Z[0]) + (Z[7] - Z[1]) + (Z[8]-Z[2]) )                          / (6 * Get_Cellsize());
-
-	Set_From_Polynom(x, y, A, B, C, D, E);
-}
-
-//---------------------------------------------------------
-// Quadratic Function Approximation (Zevenbergen und Thorne, 1986)
-//
-// Zevenbergen, L.W. and C.R. Thorne. 1987:
-//		Quantitative analysis of land surface topography
-//		Earth Surface Processes and Landforms, 12: 47-56.
-//
-//---------------------------------------------------------
-// f(z) = Ax^2y^2 + Bx^2y + Cxy^2 + Dx^2 + Ey^2 + Fxy + Gx + Hy + I
-//
-//---------------------------------------------------------
-void CMorphometry::Set_Zevenbergen(int x, int y)
-{
-	double	Z[9], D, E, F, G, H;
-
-	Get_SubMatrix3x3(x, y, Z);
-
-	D	= ((Z[3] + Z[5]) / 2.0 - Z[4]) / (    Get_Cellarea());
-	E	= ((Z[1] + Z[7]) / 2.0 - Z[4]) / (    Get_Cellarea());
-	F	=  (Z[0] - Z[2] - Z[6] + Z[8]) / (4 * Get_Cellarea());
-	G	=  (Z[5] - Z[3])               / (2 * Get_Cellsize());
-    H	=  (Z[7] - Z[1])               / (2 * Get_Cellsize());
-
-	Set_From_Polynom(x, y, D, E, F, G, H);
-}
-
-//---------------------------------------------------------
-// Cubic Function Approximation (Haralick, 1991)
-//
-// R.M. Haralick (1983):
-//		'Ridge and Valley Detection on digital images',
-//		Computer Vision, Graphics and Image Processing, Vol.22, No.1, p.28-38
-//
-//---------------------------------------------------------
-// f(z) = Ax^3 + By^3 + Cx^2y + Dxy^2 + Ex^2 + Fy^2 + Gxy + Hx + Iy + J
-//
-//---------------------------------------------------------
-void CMorphometry::Set_Haralick(int x, int y)
-{
-	//-----------------------------------------------------
-	// Matrices for Finite Difference solution...
-
-	const int 	Mtrx[][5][5]	= {
-	{	{ 31,- 5,-17,- 5, 31}, {-44,-62,-68,-62,-44}, {  0,  0,  0,  0,  0}, { 44, 62, 68, 62, 44}, {-31,  5, 17,  5,-31}	},
-	{	{ 31,-44,  0, 44,-31}, {- 5,-62,  0, 62,  5}, {-17,-68,  0, 68, 17}, {- 5,-62,  0, 62,  5}, { 31,-44,  0, 44,-31}	},
-	{	{  2,  2,  2,  2,  2}, {- 1,- 1,- 1,- 1,- 1}, {- 2,- 2,- 2,- 2,- 2}, {- 1,- 1,- 1,- 1,- 1}, {  2,  2,  2,  2,  2}	},
-	{	{  4,  2,  0,- 2,- 4}, {  2,  1,  0,- 1,- 2}, {  0,  0,  0,  0,  0}, {- 2,- 1,  0,  1,  2}, {- 4,- 2,  0,  2,  4}	},
-	{	{  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}, {  2,- 1,- 2,- 1,  2}	},	};
-
-	const int	QMtrx[]			= { 4200, 4200, 700, 1000, 700 };
-
-	//-----------------------------------------------------
-	int		i, ix, iy, n;
-	double	Sum, Z[25], k[5];
-
-	Get_SubMatrix5x5(x, y, Z);
-
-	for(i=0; i<5; i++)
-	{
-		for(n=0, Sum=0.0, iy=0; iy<5; iy++)
-		{
-			for(ix=0; ix<5; ix++, n++)
-			{
-				Sum	+= Z[n] * Mtrx[i][ix][iy];
-			}
-		}
-
-		k[i]	= Sum / QMtrx[i];
-	}
-
-	Set_From_Polynom(x, y, k[4], k[2], k[3], k[1], k[0]);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
deleted file mode 100644
index 5194491..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/**********************************************************
- * Version $Id: ProtectionIndex.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "ProtectionIndex.h"
-
-#define NO_DATA -1
-
-CProtectionIndex::CProtectionIndex(void){
-
-	Set_Name(_TL("Morphometric Protection Index"));
-    Set_Author(SG_T("(c) 2005 by Victor Olaya"));
-	Set_Description(_TW(
-        "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, 
-						"DEM",
-						_TL("Elevation"), 						
-						_TL(""), 
-						PARAMETER_INPUT);
-
-	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, 
-						true);
-
-}//constructor
-
-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(); 
-
-    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){
-				pProtectionIndex->Set_NoData(x,y);
-			}//if
-			else{
-				pProtectionIndex->Set_Value(x,y, dProtectionIndex);
-			}//else
-		}//for
-	}//for	
-	
-	return true;
-
-}//method
-
-double CProtectionIndex::getProtectionIndex(int x, int y){
-
-	int i,j;
-	int iDifX[] = {0,1,1,1,0,-1,-1,-1};
-	int iDifY[] = {1,1,0,-1,-1,-1,0,1};
-	double dDifHeight;
-	double dDist;
-	double dAngle;
-	double dProtectionIndex = 0;
-	double aAngle[8];
-
-	for (i = 0; i < 8; i++){
-		j = 1;
-		aAngle[i] = 0;
-		dDist = M_GET_LENGTH(iDifX[i], iDifY[i]) * j * m_pDEM->Get_Cellsize();
-		while (dDist < m_dRadius){
-			if (m_pDEM->is_InGrid(x + iDifX[i] * j, y + iDifY[i] * j)){
-				dDifHeight = m_pDEM->asDouble(x,y);
-			}//if
-			else{
-				return NO_DATA;
-			}
-			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]){
-				aAngle[i] = dAngle;
-			}//if
-			j++;
-			dDist = M_GET_LENGTH(iDifX[i], iDifY[i]) * j * m_pDEM->Get_Cellsize();
-		}//while
-		dProtectionIndex+=aAngle[i];
-	}//while
-
-	return (dProtectionIndex / 8.);
-
-}//method
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.h b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.h
deleted file mode 100644
index f6fe7ab..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**********************************************************
- * Version $Id: ProtectionIndex.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    ProtectionIndex.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-#include "MLB_Interface.h"
-
-class CProtectionIndex : public CSG_Module_Grid
-{
-public:
-	CProtectionIndex(void);
-	virtual ~CProtectionIndex(void);
-
-protected:
-
-	bool On_Execute(void);
-
-private:
-
-	double getProtectionIndex(int x, int y);
-
-	CSG_Grid *m_pDEM;
-	double m_dRadius;
-
-};
\ No newline at end of file
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp
deleted file mode 100644
index 721f987..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/**********************************************************
- * Version $Id: RealArea.cpp 1348 2012-03-12 16:17:14Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    RealArea.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "RealArea.h"
-
-CRealArea::CRealArea(void)
-{
-	Set_Name		(_TL("Real Surface Area"));
-	Set_Author		(SG_T("V. Olaya (c) 2004"));
-	Set_Description	(_TW(
-		"Calculates real (not projected) cell area"
-	));
-
-	Parameters.Add_Grid(NULL, "DEM" , _TL("Elevation"   ), _TL(""), PARAMETER_INPUT);
-	Parameters.Add_Grid(NULL, "AREA", _TL("Surface Area"), _TL(""), PARAMETER_OUTPUT);
-}
-
-bool CRealArea::On_Execute(void)
-{
-	CSG_Grid	*pDEM	= Parameters("DEM" )->asGrid(); 
-	CSG_Grid	*pArea	= Parameters("AREA")->asGrid();
-
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	s, a;
-
-			if( pDEM->Get_Gradient(x, y, s, a) )
-			{
-				pArea->Set_Value(x, y, Get_System()->Get_Cellarea() / cos(s));
-			}
-			else
-			{
-				pArea->Set_NoData(x,y);
-			}
-		}
-	}
-	
-	return( true );
-}
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.h b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.h
deleted file mode 100644
index d3d3abe..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/**********************************************************
- * Version $Id: RealArea.h 1348 2012-03-12 16:17:14Z oconrad $
- *********************************************************/
-/*******************************************************************************
-    RealArea.h
-    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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "MLB_Interface.h"
-
-class CRealArea : public CSG_Module_Grid
-{
-public:
-	CRealArea(void);
-
-
-protected:
-
-	bool	On_Execute	(void);
-
-};
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp
deleted file mode 100644
index bace244..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-/**********************************************************
- * Version $Id: SurfaceSpecificPoints.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//               SurfaceSpecificPoints.cpp               //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "SurfaceSpecificPoints.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSurfaceSpecificPoints::CSurfaceSpecificPoints(void)
-{
-	CSG_Parameter	*pNode;
-
-	Set_Name		(_TL("Surface Specific Points"));
-
-	Set_Author		(SG_T("(c) 2001 by O.Conrad"));
-
-	Set_Description	(_TW(
-		"References:\n"
-		"Peucker, T.K. and Douglas, D.H., 1975:\n"
-		"'Detection of surface-specific points by local parallel processing of discrete terrain elevation data',\n"
-		"Computer Graphics and Image Processing, 4, 375-387\n"
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "RESULT"		, _TL("Result"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	pNode	= Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
-		_TL("Algorithm for the detection of Surface Specific Points"),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
-			_TL("Mark Highest Neighbour"),
-			_TL("Opposite Neighbours"),
-			_TL("Flow Direction"),
-			_TL("Flow Direction (up and down)"),
-			_TL("Peucker & Douglas")
-		), 1
-	);
-
-	Parameters.Add_Value(
-		pNode	, "THRESHOLD"	, _TL("Threshold"),
-		_TL("Threshold for Peucker & Douglas Algorithm"),
-		PARAMETER_TYPE_Double	, 2
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSurfaceSpecificPoints::On_Execute(void)
-{
-	CSG_Grid	*pGrid, *pResult;
-
-	pGrid		= Parameters("ELEVATION")	->asGrid();
-	pResult		= Parameters("RESULT")		->asGrid();
-
-	switch( Parameters("METHOD")->asInt() )
-	{
-	case 0:
-		Do_MarkHighestNB	(pGrid, pResult);
-		break;
-
-	case 1:
-		Do_OppositeNB		(pGrid, pResult);
-		break;
-
-	case 2:
-		Do_FlowDirection	(pGrid, pResult);
-		break;
-
-	case 3:
-		Do_FlowDirection2	(pGrid, pResult);
-		break;
-
-	case 4:
-		Do_PeuckerDouglas	(pGrid, pResult, Parameters("THRESHOLD")->asDouble());
-		break;
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSurfaceSpecificPoints::Do_MarkHighestNB(CSG_Grid *pGrid, CSG_Grid *pResult)	// Band & Lammers...
-{
-	int		i, x, y, ix, iy, xlo, ylo, xhi, yhi;
-
-	double	lo, hi, z;
-
-	CSG_Grid	*clo, *chi;
-
-	clo		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
-	chi		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
-
-	// Pass 1: Auszaehlen...
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-        {
-			lo	= hi	= pGrid->asDouble(x,y);
-			xhi	= xlo	= x;
-			yhi	= ylo	= y;
-
-			for(i=0; i<4; i++)
-			{
-				ix	= Get_xTo(i,x);
-				iy	= Get_yTo(i,y);
-  
-				if( is_InGrid(ix,iy) )
-				{
-					z	= pGrid->asDouble(ix,iy);
-
-					if( z > hi )
-					{
-						hi	= z;
-						xhi	= ix;
-						yhi	= iy;
-					}
-					else if( z < lo )
-					{
-						lo	= z;
-						xlo	= ix;
-						ylo	= iy;
-					}
-				}
-			}
-
-			clo->Add_Value(xlo,ylo,1);
-			chi->Add_Value(xhi,yhi,1);
-		}
-	}
-
-	// Pass 2: Setzen...
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( !chi->asChar(x,y) )
-			{
-				if( !clo->asChar(x,y) )
-					pResult->Set_Value(x,y, 2);	// Sattel
-				else
-					pResult->Set_Value(x,y, 1);	// Tiefenlinie
-			}
-			else if( !clo->asChar(x,y) )
-				pResult->Set_Value(x,y, -1);	// Wasserscheide
-			else
-				pResult->Set_Value(x,y,  0);	// Nichts...
-		}
-	}
-
-	delete(clo);
-	delete(chi);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSurfaceSpecificPoints::Do_OppositeNB(CSG_Grid *pGrid, CSG_Grid *pResult)
-{
-	int		i, x, y, ix, iy, jx, jy;
-
-	double	z, iz, jz;
-
-	CSG_Grid	*clo, *chi;
-
-	clo		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
-	chi		= SG_Create_Grid(pGrid, SG_DATATYPE_Char);
-
-	// Pass 1: Auszaehlen...
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-        {
-			z	= pGrid->asDouble(x,y);
-
-			for(i=0; i<4; i++)
-			{
-				ix	= Get_xTo(i,x);
-				iy	= Get_yTo(i,y);
-
-				if( is_InGrid(ix,iy) )
-				{
-					jx	= Get_xFrom(i,x);
-					jy	= Get_yFrom(i,y);
-  
-					if( is_InGrid(jx,jy) )
-					{
-						iz	= pGrid->asDouble(ix,iy);
-						jz	= pGrid->asDouble(jx,jy);
-
-						if( iz>z && jz>z )
-							chi->Add_Value(x,y,1);
-
-						else if( iz<z && jz<z )
-							clo->Add_Value(x,y,1);
-					}
-				}
-			}
-		}
-	}
-
-	// Pass 2: Setzen...
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( chi->asChar(x,y) )
-			{
-				if( clo->asChar(x,y) )
-					pResult->Set_Value(x,y, 5);					// Sattel
-				else
-					pResult->Set_Value(x,y, chi->asChar(x,y) );	// Tiefenlinie
-			}
-			else if( clo->asChar(x,y) )
-				pResult->Set_Value(x,y, - clo->asChar(x,y) );	// Wasserscheide
-			else
-				pResult->Set_Value(x,y, 0);						// Nichts...
-		}
-	}
-
-	delete(clo);
-	delete(chi);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSurfaceSpecificPoints::Do_FlowDirection(CSG_Grid *pGrid, CSG_Grid *pResult)
-{
-	bool	bLower;
-
-	int		x, y, i, ix, iy, xLow, yLow;
-
-	double	z, iz, zLow;
-
-	pResult->Assign();
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-        {
-			z		= pGrid->asDouble(x,y);
-			bLower	= false;
-
-			for(i=0; i<8; i++)
-			{
-				ix	= Get_xTo(i,x);
-				iy	= Get_yTo(i,y);
-  
-				if( is_InGrid(ix,iy) )
-				{
-					iz	= pGrid->asDouble(ix,iy);
-
-					if(iz<z)
-					{
-						if(!bLower)
-						{
-							bLower	= true;
-							zLow	= iz;
-							xLow	= ix;
-							yLow	= iy;
-						}
-						else if(iz<zLow)
-						{
-							zLow	= iz;
-							xLow	= ix;
-							yLow	= iy;
-						}
-					}
-				}
-			}
-
-			if(bLower)
-			{
-				pResult->Add_Value(xLow, yLow, 1);
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSurfaceSpecificPoints::Do_FlowDirection2(CSG_Grid *pGrid, CSG_Grid *pResult)
-{
-	CSG_Grid	Grid(*pGrid), Result(*pResult);
-
-	Do_FlowDirection(&Grid, &Result);
-
-	Grid.Invert();
-
-	Do_FlowDirection(&Grid, pResult);
-
-	for(long n=0; n<Get_NCells(); n++)
-	{
-		pResult->Add_Value(n, -Result.asInt(n));
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CSurfaceSpecificPoints::Do_PeuckerDouglas(CSG_Grid *pGrid, CSG_Grid *pResult, double Threshold)
-{
-	bool	wasPlus;
-
-	int		x, y, i, ix, iy, nSgn;
-
-	double	d, dPlus, dMinus, z, alt[8];
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			z	= pGrid->asDouble(x,y);
-
-			for(i=0; i<8; i++)
-			{
-				ix	= Get_xTo(i,x);
-				iy	= Get_yTo(i,y);
-
-				if( is_InGrid(ix,iy) )
-					alt[i]	= pGrid->asDouble(ix,iy);
-				else
-					alt[i]	= z;
-			}
-
-			dPlus	= dMinus	= 0;
-			nSgn	= 0;
-			wasPlus	= (alt[7] - z > 0) ? true : false;
-			
-			for(i=0; i<8; i++)
-			{
-				d	= alt[i] - z;
-
-				if(d>0)
-				{
-					dPlus	+= d;
-					if(!wasPlus)
-					{
-						nSgn++;
-						wasPlus	= true;
-					}
-				}
-				else if(d<0)
-				{
-					dMinus	-= d;
-					if(wasPlus)
-					{
-						nSgn++;
-						wasPlus	= false;
-					}
-				}
-			}
-
-			i	= 0;
-			if(!dPlus)									// Peak...
-				i	=  9;
-			else if(!dMinus)							// Pit
-				i	= -9;
-			else if(nSgn==4)							// Pass
-				i	= 1;
-			else if(nSgn==2)
-			{
-				i	= nSgn	= 0;
-
-				if(alt[7]>z)
-				{
-					while(alt[i++]>z);
-					do	nSgn++;	while(alt[i++]<z);
-				}
-				else
-				{
-					while(alt[i++]<z);
-					do	nSgn++;	while(alt[i++]>z);
-				}
-
-				i	= 0;
-
-				if(nSgn==4)
-				{
-					if(dMinus-dPlus > Threshold)		// convex break...
-						i	=  2;
-					else if(dPlus-dMinus > Threshold)	// concave break...
-						i	= -2;
-				}
-				else	// lines:
-				{
-					if(dMinus-dPlus>0)					// Ridge
-						i	=  7;
-					else								// Channel
-						i	= -7;
-				}
-			}
-
-			pResult->Set_Value(x,y,i);
-		}
-    }
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp
deleted file mode 100644
index 41c8dee..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp
+++ /dev/null
@@ -1,1479 +0,0 @@
-/**********************************************************
- * Version $Id: relative_heights.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                  Relative_Heights.cpp                 //
-//                                                       //
-//                 Copyright (C) 2008 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:     conrad at geowiss.uni-hamburg.de          //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Bundesstr. 55                          //
-//                20146 Hamburg                          //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "relative_heights.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CRelative_Heights::CRelative_Heights(void)
-{
-	//-----------------------------------------------------
-	Set_Name		(_TL("Relative Heights and Slope Positions"));
-
-	Set_Author		(SG_T("J.Boehner, O.Conrad (c) 2008"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "HO"			, _TL("Slope Height"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "HU"			, _TL("Valley Depth"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "NH"			, _TL("Normalized Height"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SH"			, _TL("Standardized Height"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "MS"			, _TL("Mid-Slope Positon"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "W"			, _TL("w"),
-		_TL(""),
-		PARAMETER_TYPE_Double	,  0.5, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "T"			, _TL("t"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 10.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "E"			, _TL("e"),
-		_TL(""),
-		PARAMETER_TYPE_Double	,  2.0, 0.0, true
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CRelative_Heights::On_Execute(void)
-{
-	double		w, t, e;
-
-	CSG_Grid	*pDEM, *pHO, *pHU;
-
-	//-----------------------------------------------------
-	pDEM	= Parameters("DEM")	->asGrid();
-
-	pHO		= Parameters("HO")	->asGrid();
-	pHU		= Parameters("HU")	->asGrid();
-
-	w		= Parameters("W")	->asDouble();
-	t		= Parameters("T")	->asDouble();
-	e		= Parameters("E")	->asDouble();
-
-	//-----------------------------------------------------
-	Message_Add(_TL("Pass 1"));
-	Get_Heights(pDEM, pHO, true , w, t, e);
-
-	Message_Add(_TL("Pass 2"));
-	Get_Heights(pDEM, pHU, false, w, t, e);
-
-	Get_Results(pDEM, pHO, pHU);
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CRelative_Heights::Get_Heights(CSG_Grid *pDEM, CSG_Grid *pH, bool bInverse, double w, double t, double e)
-{
-	CSG_Grid	Inverse;
-
-	if( bInverse )
-	{
-		Inverse.Create(*pDEM);
-		Inverse.Invert();
-		pDEM	= &Inverse;
-	}
-
-	//-----------------------------------------------------
-	return(	Get_Heights_Catchment(pDEM, pH, w)
-		&&	Get_Heights_Modified (pDEM, pH, t, e)
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CRelative_Heights::Get_Heights_Catchment(CSG_Grid *pDEM, CSG_Grid *pH, double Weight)
-{
-	const double	MFD_Converge	= 1.1;
-
-	int			x, y, i, ix, iy;
-	double		z, d, dz[8], dzSum, c, w, h;
-	CSG_Grid	C, W;
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Relative heights calculation..."));
-
-	C  .Create(*Get_System());
-	W  .Create(*Get_System());
-
-	C  .Assign(Get_System()->Get_Cellarea());
-	W  .Assign(0.0);
-	pH->Assign(0.0);
-
-	//-----------------------------------------------------
-	for(long n=0; n<Get_NCells() && Set_Progress_NCells(n); n++)
-	{
-		if( !pDEM->Get_Sorted(n, x, y, true, false) || pDEM->is_NoData(x, y) )
-		{
-			pH->Set_NoData(x, y);
-		}
-		else
-		{
-			z		= pDEM->asDouble(x, y);
-			c		= C    .asDouble(x, y);
-			w		= W    .asDouble(x, y) + pow(1.0 / c, Weight);		//{W[p] = (1/C[p])^w;}
-			h		= pH  ->asDouble(x, y) + pow(1.0 / c, Weight) * z;	//{H[p] = (1/C[p])^w * M[p];}
-
-			pH->Set_Value(x, y, h / w - z);	//{H[p] = -1 * (M[p] - H[p]/W[p]);}
-
-			for(i=0, dzSum=0.0; i<8; i++)
-			{
-				ix		= Get_xTo(i, x);
-				iy		= Get_yTo(i, y);
-
-				if( pDEM->is_InGrid(ix, iy) && (d = z - pDEM->asDouble(ix, iy)) > 0.0 )
-				{
-					dzSum	+= (dz[i] = pow(atan(d / Get_Length(i)), MFD_Converge));
-				}
-				else
-				{
-					dz[i]	= 0.0;
-				}
-			}
-
-			if( dzSum > 0.0 )
-			{
-				for(i=0; i<8; i++)
-				{
-					if( dz[i] > 0.0 )
-					{
-						ix		= Get_xTo(i, x);
-						iy		= Get_yTo(i, y);
-
-						d		= dz[i] / dzSum;
-
-						C  .Add_Value(ix, iy, d * c);
-						W  .Add_Value(ix, iy, d * w);	//{W[p] = W[p] + W[p+pul] * UL[p] + W[p+pl] * LL[p] + W[p+pol] * OL[p] + W[p+po] * OO[p] + W[p+por] * OR[p] + W[p+pr] * RR[p] + W[p+pur] * UR[p] + W[p+pu] * UU[p]; gefunden = 1;}
-						pH->Add_Value(ix, iy, d * h);	//{H[p] = H[p] + H[p+pul] * UL[p] + H[p+pl] * LL[p] + H[p+pol] * OL[p] + H[p+po] * OO[p] + H[p+por] * OR[p] + H[p+pr] * RR[p] + H[p+pur] * UR[p] + H[p+pu] * UU[p]; gefunden = 1;}
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// in den folgenden drei Schritten werden Maxima der
-// relativen H�he H in Abh�ngigkeit der Neigung gesaugt.
-// Der e-Parameter steuert die st�rke der Maximum-Streckung
-
-//---------------------------------------------------------
-bool CRelative_Heights::Get_Heights_Modified(CSG_Grid *pDEM, CSG_Grid *pH, double t, double e)
-{
-	int			y;
-
-	CSG_Grid	H, H_Last, T;
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Modify: pre-processing..."));
-
-	T.Create(pH);
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	z, d;
-
-			if( !pH->is_NoData(x, y) && !pDEM->is_NoData(x, y) && pDEM->Get_Gradient(x, y, z, d) )
-			{
-				pH->Set_Value(x, y, d = pow(pH->asDouble(x, y), e));	// {X[p] = H[p]^e;}
-				z	= pow(t, z);
-				z	= pow(1.0 / z, exp(z));
-				T.Set_Value(x, y, z);
-			}
-			else
-			{
-				T.Set_NoData(x, y);
-			}
-		}
-	}
-
-	H     .Create(*pH);
-	H_Last.Create(*pH);
-
-	//-----------------------------------------------------
-	int		nChanges	= 1;
-
-	for(int Iteration=1; nChanges && Process_Get_Okay(); Iteration++)
-	{
-		nChanges	= 0;
-
-		#pragma omp parallel for private(y) reduction(+:nChanges)
-		for(y=0; y<Get_NY(); y++)
-		{
-			Process_Get_Okay();
-
-			for(int x=0; x<Get_NX(); x++)
-			{
-				if( !T.is_NoData(x, y) )
-				{
-					double	z	= T.asDouble(x, y) * Get_Local_Maximum(&H, x, y);
-
-					if( z  > H.asDouble(x, y) )
-					{
-						nChanges++;
-
-						H.Set_Value(x, y, z);
-					}
-				}
-			}
-		}
-
-		if( nChanges > 0 )
-		{
-			nChanges	= 0;
-
-			#pragma omp parallel for private(y) reduction(+:nChanges)
-			for(y=0; y<Get_NY(); y++)
-			{
-				Process_Get_Okay();
-
-				for(int x=0; x<Get_NX(); x++)
-				{
-					if( H.asDouble(x, y) != H_Last.asDouble(x, y) )
-					{
-						nChanges++;
-
-						H_Last.Set_Value(x, y, H.asDouble(x, y));
-					}
-				}
-			}
-		}
-
-		Process_Set_Text(CSG_String::Format(SG_T("pass %d (%d > 0)"), Iteration, nChanges));
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Modify: post-processing..."));
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			bool	bRecalculate;
-			int		ix, iy, n;
-			double	z;
-
-			if( H.is_NoData(x, y) )
-			{
-				pH->Set_NoData(x, y);
-			}
-			else
-			{
-				for(iy=y-1, bRecalculate=false; iy<=y+1 && !bRecalculate; iy++)
-				{
-					for(ix=x-1; ix<=x+1 && !bRecalculate; ix++)
-					{
-						if( H.is_InGrid(ix, iy) && pH->is_InGrid(ix, iy) && H.asDouble(ix, iy) > pH->asDouble(ix, iy) )
-						{
-							bRecalculate	= true;
-						}
-					}
-				}
-
-				if( bRecalculate )
-				{
-					for(iy=y-1, z=0.0, n=0; iy<=y+1; iy++)
-					{
-						for(ix=x-1; ix<=x+1; ix++)
-						{
-							if( H.is_InGrid(ix, iy) )
-							{
-								n++;
-								z	+= H.asDouble(ix, iy);
-							}
-						}
-					}
-
-					z	= z / (double)n;
-				}
-				else	
-				{
-					z	= H.asDouble(x, y);
-				}
-
-				pH->Set_Value(x, y, pow(z, 1.0 / e));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-//---------------------------------------------------------
-double CRelative_Heights::Get_Local_Maximum(CSG_Grid *pGrid, int x, int y)
-{
-	if( pGrid->is_InGrid(x, y) )
-	{
-		double	z	= pGrid->asDouble(x, y);
-
-		for(int i=0; i<8; i++)
-		{
-			int	ix	= Get_xTo(i, x);
-			int	iy	= Get_yTo(i, y);
-
-			if( pGrid->is_InGrid(ix, iy) && pGrid->asDouble(ix, iy) > z )
-			{
-				z	= pGrid->asDouble(ix, iy);
-			}
-		}
-
-		return( z );
-	}
-
-	return( 0.0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// auf Grundlage von HO und HU wird die Normierte H�he
-// (NH) mit H�henwerten zwischen minimal 0 (=unten) und
-// maximal 1 (= oben) wie beim NDVI bestimmt. Die
-// Standardisierte H�he SH streckt das Relief auf ein
-// H�henspektrum zwischen theoretisch 0 (=unten) und
-// dem Maximum der jeweiligen Scheitelbereiche, so dass
-// die urspr�ngliche Reliefenergie erhalten bleibt.
-// Selbstverst�ndlich muss f�r Anwendungen �berpr�ft
-// werden, ob und welche relativen H�hen (HU, HO, SH)
-// logarithmiert dargestellt werden. Als Beispiel ist
-// die Standardisierte H�he logarithmiert berechnet (SHL)
-
-//---------------------------------------------------------
-bool CRelative_Heights::Get_Results(CSG_Grid *pDEM, CSG_Grid *pHO, CSG_Grid *pHU)
-{
-	Process_Set_Text(_TL("Final processing..."));
-
-	CSG_Grid	*pNH	= Parameters("NH")	->asGrid();
-	CSG_Grid	*pSH	= Parameters("SH")	->asGrid();
-	CSG_Grid	*pMS	= Parameters("MS")	->asGrid();
-
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			double	ho, hu, nh;
-
-			if( pDEM->is_NoData(x, y) || pHO->is_NoData(x, y) || pHU->is_NoData(x, y)
-			||  ((ho = pHO->asDouble(x, y)) + (hu = pHU->asDouble(x, y))) == 0.0 )
-			{
-				pNH->Set_NoData(x, y);
-				pSH->Set_NoData(x, y);
-				pMS->Set_NoData(x, y);
-			}
-			else
-			{
-				nh	= 0.5 * (1.0 + (ho - hu) / (ho + hu));
-
-				pNH->Set_Value(x, y, nh);
-				pSH->Set_Value(x, y, nh * (pDEM->asDouble(x, y) - pDEM->Get_ZMin()) + pDEM->Get_ZMin());	//, nh * pDEM->asDouble(x, y));
-				pMS->Set_Value(x, y, fabs(2.0 * nh - 1.0));
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//        The original BSL script by J.B�hner
-//---------------------------------------------------------
-
-/*
-Matrix Loop, O("sch-hoe.grd"), N("sch-nei.grd"), M, R, UL, LL, OL, OO, OR, RR, UR, UU, X, Y, Z, C, W, H, HO, HU, NH, SH, SHL;
-Point ploop, p, pul, pu, pur, pl, pr, pol, po, por;
-Float w, e, wul, wll, wol, woo, wor, wrr, wur, wuu;
-Integer t, h, i, j, k, l, m, n, o, gefunden;
-
-w = 0.5;
-e = 2; 
-t = 10; 
-pul.x = -1;	pul.y = -1; 
-pu.x = 0;	pu.y = -1;
-pur.x = 1;	pur.y = -1;
-pl.x = -1;	pl.y = 0;
-pr.x = 1;	pr.y = 0;
-pol.x = -1;	pol.y = 1;
-po.x = 0;	po.y = 1;
-por.x = 1;	por.y = 1;
-
-M = O;
-R = O;
-UL = O;
-LL = O;
-OL = O;
-OO = O;
-OR = O;
-RR = O;
-UR = O;
-UU = O;
-X = O;
-Y = O;
-Z = O;
-C = O;
-W = O;
-H = O;
-HO = O;
-HU = O;
-NH = O;
-SH = O;
-SHL = O;
-
-Loop.xanz = 100000;
-Loop.yanz = 1;
-h = 0;
-i = 0;
-j = 0;
-k = 0;
-l = 0;
-m = 0;
-n = 0;
-o = 0;
-
-// Das gesamte Verfahren besteht aus zwei identischen Schritten zur Bestimmung von H�he �ber Kulmination (HO) und H�he unter Kulmination (HU). F�r HO wird das DGM zun�chst umgedreht //
-foreach p in M do 
-{M[p] = -1 * O[p];}
-// hier wird eine Hilfsmatrix X erzeugt, die in der folgenden Schleife faf�r sorgt, dass noch nicht attributisierte Rasterzellen in Ihrer Position identifiziert werden k�nnen //
-foreach p in X do
-{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
-	{X[p] = -10000;}
-	else
-	{X[p] = M[p];}
-}
-// hier wird eine Matrix R erzeugt, die ausgehend von lokalen Maxima fortlaufend Rangplatzziffernerzeugt //
-foreach ploop in Loop do
-{	ploop.x = 1;
-	h = h +1;
-	gefunden = 0;
-	foreach p in X do
-	{
-	if (X[p] == max9(p, X) && X[p] > -10000)
-	{X[p] = -10000; R[p] = h; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(R);
-// hier wird eine Hilfsmatrix R erzeugt, die Rangplatzziffern am Rand duch 0 ersetzt //
-foreach p in R do
-{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
-	{R[p] = 0;}
-	else
-	{R[p] = R[p];}
-}
-// hier wird eine Matrix Z erzeugt, die die positiven Winkel zu den 8 Nachbarzellen aufsummiert //
-foreach p in Z do
-{
-if(p.x == 0 && p.y == 0)
-	{
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((woo + wor + wrr) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = woo + wor + wrr;}
-	}
-else
-{
-if(p.x == 0 && p.y == (M.yanz - 1))
-	{
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wrr + wur + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1 && p.y == M.yanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1 && p.y == 0)
-	{
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((wll + wol + woo) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wll + wol + woo;}
-	}
-else	
-{
-if(p.x == 0)
-	{
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((woo + wor + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = woo + wor + wrr + wur + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wol + woo + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wol + woo + wuu;}
-	}
-else	
-{
-if(p.y == 0)
-	{
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((wll + wol + woo + wor + wrr) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wll + wol + woo + wor + wrr;}
-	}
-else	
-{
-if(p.y == M.yanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wrr + wur + wuu;}
-	}
-else	
-{	
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wol + woo + wor + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wol + woo + wor + wrr + wur + wuu;}
-	}
-}}}}}}}}
-// hier werden Grids UL bis UU (im Uhrzeigersinn) erzeugt, die angeben, welchen Anteil des Inhalts einer benachbarten Rasterzelle in die Zielrasterzelle (zentrale Rasterzelle im 9er Feld) �bergen wird //
-foreach p in UL do
-{	if (p.x == 0 || p.y == 0)
-	{UL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pul]) < 0 && Z[p+pul] > 0) 
-		{UL[p] = (atan((M[p+pul] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pul];}
-		else
-		{UL[p] = 0;}
-		}
-}
-foreach p in LL do
-{	if (p.x == 0)
-	{LL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pl]) < 0 && Z[p+pl] > 0) 
-		{LL[p] = (atan((M[p+pl] - M[p])/M.dxy))/Z[p+pl];}
-		else
-		{LL[p] = 0;}
-		}
-}
-foreach p in OL do
-{	if (p.x == 0 || p.y == M.yanz - 1)
-	{OL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pol]) < 0 && Z[p+pol] > 0) 
-		{OL[p] = (atan((M[p+pol] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pol];}
-		else
-		{OL[p] = 0;}
-		}
-}
-foreach p in OO do
-{	if (p.y == M.yanz - 1)
-	{OO[p] = 0;}
-	else	{
-		if((M[p] - M[p+po]) < 0 && Z[p+po] > 0) 
-		{OO[p] = (atan((M[p+po] - M[p])/M.dxy))/Z[p+po];}
-		else
-		{OO[p] = 0;}
-		}
-}
-foreach p in OR do
-{	if (p.x == M.xanz - 1 || p.y == M.yanz - 1)
-	{OR[p] = 0;}
-	else	{
-		if((M[p] - M[p+por]) < 0 && Z[p+por] > 0) 
-		{OR[p] = (atan((M[p+por] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+por];}
-		else
-		{OR[p] = 0;}
-		}
-}
-foreach p in RR do
-{	if (p.x == M.xanz - 1)
-	{RR[p] = 0;}
-	else	{
-		if((M[p] - M[p+pr]) < 0 && Z[p+pr] > 0) 
-		{RR[p] = (atan((M[p+pr] - M[p])/M.dxy))/Z[p+pr];}
-		else
-		{RR[p] = 0;}
-		}
-}
-foreach p in UR do
-{	if (p.x == M.xanz - 1 || p.y == 0)
-	{UR[p] = 0;}
-	else	{
-		if((M[p] - M[p+pur]) < 0 && Z[p+pur] > 0) 
-		{UR[p] = (atan((M[p+pur] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pur];}
-		else
-		{UR[p] = 0;}
-		}
-}
-foreach p in UU do
-{	if (p.y == 0)
-	{UU[p] = 0;}
-	else	{
-		if((M[p] - M[p+pu]) < 0 && Z[p+pu] > 0) 
-		{UU[p] = (atan((M[p+pu] - M[p])/M.dxy))/Z[p+pu];}
-		else
-		{UU[p] = 0;}
-		}
-}
-// in den folgenden drei Schritten wird nach der "multiple flow methode" die Einzugsgebietsgr��e C ermittelt //
-foreach p in Z do
-{Z[p] = 1;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	i = i +1;
-	gefunden = 0;
-	foreach p in Z do
-	{	if (R[p] == i)
-		{Z[p] = 1 + Z[p+pul] * UL[p] + Z[p+pl] * LL[p] + Z[p+pol] * OL[p] + Z[p+po] * OO[p] + Z[p+por] * OR[p] + Z[p+pr] * RR[p] + Z[p+pur] * UR[p] + Z[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(Z);
-foreach p in C do
-{C[p] = Z[p] * M.dxy^2;}
-// in den folgenden zwei Schritten werden Gewichte umgekehrt-proportional zur Einzugsgebietsgr��e nach der multiple flow methode aufsummiert. Der w-parameter steuert die st�rke der Gewichtung //
-foreach p in W do
-{W[p] = (1/C[p])^w;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	k = k +1;
-	gefunden = 0;
-	foreach p in W do
-	{	if (R[p] == k)
-		{W[p] = W[p] + W[p+pul] * UL[p] + W[p+pl] * LL[p] + W[p+pol] * OL[p] + W[p+po] * OO[p] + W[p+por] * OR[p] + W[p+pr] * RR[p] + W[p+pur] * UR[p] + W[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(W);
-// in den folgenden zwei Schritten werden H�henwerte und Gewichte nach der multiple flow methode in der Matrix H aufsummiert, wobei lokale Maxima im Einzugsgebiet am st�rksten in H eingehen. Der w-Parameter steuert die St�rke der Maximumgewichtung //
-foreach p in H do
-{H[p] = M[p] * (1/C[p])^w;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	l = l +1;
-	gefunden = 0;
-	foreach p in H do
-	{	if (R[p] == l)
-		{H[p] = H[p] + H[p+pul] * UL[p] + H[p+pl] * LL[p] + H[p+pol] * OL[p] + H[p+po] * OO[p] + H[p+por] * OR[p] + H[p+pr] * RR[p] + H[p+pur] * UR[p] + H[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(H);
-// im folgenden Schritt wird eine relative H�he H �ber dem gewichteten arithmetischen Mittel der Einzugsgebietsgr��e bestimmt //
-foreach p in H do
-{	if (isRand(p, M) == 0)
-	{H[p] = -1 * (M[p] - H[p]/W[p]);}
-}
-setRandN(H);
-// in den folgenden drei Schritten werden Maxima der relativen H�he H in Abh�ngigkeit der Neigung gesaugt. Der e-Parameter steuert die st�rke der Maximum-Streckung //
-foreach p in X do
-{X[p] = H[p]^e;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	m = m +1;
-	gefunden = 0;
-	foreach p in X do
-	{
-	if ((((1/t^N[p])^exp(t^N[p])) * max9(p, X)) > X[p])
-	{X[p] = (((1/t^N[p])^exp(t^N[p])) * max9(p, X)); gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-foreach p in HO do
-{	if (isRand(p, M) == 0)
-	{
-	if(H[p]^e < X[p] || H[p+pul]^e < X[p+pul] || H[p+pl]^e < X[p+pl] || H[p+pol]^e < X[p+pol] || H[p+po]^e < X[p+po] || H[p+por]^e < X[p+por] || H[p+pr]^e < X[p+pr] || H[p+pur]^e < X[p+pur] || H[p+pu]^e < X[p+pu])
-	{HO[p] = ((X[p] + X[p+pul] + X[p+pu] + X[p+pur] + X[p+pl] + X[p+pr] + X[p+pol] + X[p+po] + X[p+por])/9)^(1/e);}
-	else	
-	{HO[p] = X[p]^(1/e);}
-	}
-}
-setRandN(HO);	
-foreach p in Z do
-{
-h = 0;
-i = 0;
-j = 0;
-k = 0;
-l = 0;
-m = 0;
-}
-// hier wird das DGM nicht umgedreht //
-foreach p in M do 
-{M[p] = O[p];}
-// hier wird eine Hilfsmatrix X erzeugt, die in der folgenden Schleife faf�r sorgt, dass noch nicht attributisierte Rasterzellen in Ihrer Position identifiziert werden k�nnen //
-foreach p in X do
-{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
-	{X[p] = -10000;}
-	else
-	{X[p] = M[p];}
-}
-// hier wird eine Matrix R erzeugt, die ausgehend von lokalen Maxima fortlaufend Rangplatzziffernerzeugt //
-foreach ploop in Loop do
-{	ploop.x = 1;
-	h = h +1;
-	gefunden = 0;
-	foreach p in X do
-	{
-	if (X[p] == max9(p, X) && X[p] > -10000)
-	{X[p] = -10000; R[p] = h; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(R);
-// hier wird eine Hilfsmatrix R erzeugt, die Rangplatzziffern am Rand duch 0 ersetzt //
-foreach p in R do
-{	if (p.x == 0 || p.x == M.xanz - 1 || p.y == 0 || p.y == M.yanz - 1)
-	{R[p] = 0;}
-	else
-	{R[p] = R[p];}
-}
-// hier wird eine Matrix Z erzeugt, die die positiven Winkel zu den 8 Nachbarzellen aufsummiert //
-foreach p in Z do
-{
-if(p.x == 0 && p.y == 0)
-	{
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((woo + wor + wrr) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = woo + wor + wrr;}
-	}
-else
-{
-if(p.x == 0 && p.y == (M.yanz - 1))
-	{
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wrr + wur + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1 && p.y == M.yanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1 && p.y == 0)
-	{
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((wll + wol + woo) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wll + wol + woo;}
-	}
-else	
-{
-if(p.x == 0)
-	{
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((woo + wor + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = woo + wor + wrr + wur + wuu;}
-	}
-else	
-{
-if(p.x == M.xanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wol + woo + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wol + woo + wuu;}
-	}
-else	
-{
-if(p.y == 0)
-	{
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((wll + wol + woo + wor + wrr) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wll + wol + woo + wor + wrr;}
-	}
-else	
-{
-if(p.y == M.yanz - 1)
-	{
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wrr + wur + wuu;}
-	}
-else	
-{	
-	if((M[p] - M[p+pul]) > 0) 
-	{wul = atan	((M[p] - M[p+pul])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wul = 0;}
-	if((M[p] - M[p+pl]) > 0) 
-	{wll = atan	((M[p] - M[p+pl])	/	M.dxy);}
-	else
-	{wll = 0;}
-	if((M[p] - M[p+pol]) > 0) 
-	{wol = atan	((M[p] - M[p+pol])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wol = 0;}
-	if((M[p] - M[p+po]) > 0) 
-	{woo = atan	((M[p] - M[p+po])	/	M.dxy);}
-	else
-	{woo = 0;}
-	if((M[p] - M[p+por]) > 0) 
-	{wor = atan	((M[p] - M[p+por])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wor = 0;}
-	if((M[p] - M[p+pr]) > 0) 
-	{wrr = atan	((M[p] - M[p+pr])	/	M.dxy);}
-	else
-	{wrr = 0;}
-	if((M[p] - M[p+pur]) > 0) 
-	{wur = atan	((M[p] - M[p+pur])	/	(2 * M.dxy^2)^0.5);}
-	else
-	{wur = 0;}
-	if((M[p] - M[p+pu]) > 0) 
-	{wuu = atan	((M[p] - M[p+pu])	/	M.dxy);}
-	else
-	{wuu = 0;}
-	if((wul + wll + wol + woo + wor + wrr + wur + wuu) == 0)
-	{Z[p] = 0;}
-	else
-	{Z[p] = wul + wll + wol + woo + wor + wrr + wur + wuu;}
-	}
-}}}}}}}}
-// hier werden Grids UL bis UU (im Uhrzeigersinn) erzeugt, die angeben, welchen Anteil des Inhalts einer benachbarten Rasterzelle in die Zielrasterzelle (zentrale Rasterzelle im 9er Feld) �bergen wird //
-foreach p in UL do
-{	if (p.x == 0 || p.y == 0)
-	{UL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pul]) < 0 && Z[p+pul] > 0) 
-		{UL[p] = (atan((M[p+pul] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pul];}
-		else
-		{UL[p] = 0;}
-		}
-}
-foreach p in LL do
-{	if (p.x == 0)
-	{LL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pl]) < 0 && Z[p+pl] > 0) 
-		{LL[p] = (atan((M[p+pl] - M[p])/M.dxy))/Z[p+pl];}
-		else
-		{LL[p] = 0;}
-		}
-}
-foreach p in OL do
-{	if (p.x == 0 || p.y == M.yanz - 1)
-	{OL[p] = 0;}
-	else	{
-		if((M[p] - M[p+pol]) < 0 && Z[p+pol] > 0) 
-		{OL[p] = (atan((M[p+pol] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pol];}
-		else
-		{OL[p] = 0;}
-		}
-}
-foreach p in OO do
-{	if (p.y == M.yanz - 1)
-	{OO[p] = 0;}
-	else	{
-		if((M[p] - M[p+po]) < 0 && Z[p+po] > 0) 
-		{OO[p] = (atan((M[p+po] - M[p])/M.dxy))/Z[p+po];}
-		else
-		{OO[p] = 0;}
-		}
-}
-foreach p in OR do
-{	if (p.x == M.xanz - 1 || p.y == M.yanz - 1)
-	{OR[p] = 0;}
-	else	{
-		if((M[p] - M[p+por]) < 0 && Z[p+por] > 0) 
-		{OR[p] = (atan((M[p+por] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+por];}
-		else
-		{OR[p] = 0;}
-		}
-}
-foreach p in RR do
-{	if (p.x == M.xanz - 1)
-	{RR[p] = 0;}
-	else	{
-		if((M[p] - M[p+pr]) < 0 && Z[p+pr] > 0) 
-		{RR[p] = (atan((M[p+pr] - M[p])/M.dxy))/Z[p+pr];}
-		else
-		{RR[p] = 0;}
-		}
-}
-foreach p in UR do
-{	if (p.x == M.xanz - 1 || p.y == 0)
-	{UR[p] = 0;}
-	else	{
-		if((M[p] - M[p+pur]) < 0 && Z[p+pur] > 0) 
-		{UR[p] = (atan((M[p+pur] - M[p])/(2 * M.dxy^2)^0.5))/Z[p+pur];}
-		else
-		{UR[p] = 0;}
-		}
-}
-foreach p in UU do
-{	if (p.y == 0)
-	{UU[p] = 0;}
-	else	{
-		if((M[p] - M[p+pu]) < 0 && Z[p+pu] > 0) 
-		{UU[p] = (atan((M[p+pu] - M[p])/M.dxy))/Z[p+pu];}
-		else
-		{UU[p] = 0;}
-		}
-}
-// in den folgenden drei Schritten wird nach der "multiple flow methode" die Einzugsgebietsgr��e C ermittelt //
-foreach p in Z do
-{Z[p] = 1;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	i = i +1;
-	gefunden = 0;
-	foreach p in Z do
-	{	if (R[p] == i)
-		{Z[p] = 1 + Z[p+pul] * UL[p] + Z[p+pl] * LL[p] + Z[p+pol] * OL[p] + Z[p+po] * OO[p] + Z[p+por] * OR[p] + Z[p+pr] * RR[p] + Z[p+pur] * UR[p] + Z[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(Z);
-foreach p in C do
-{C[p] = Z[p] * M.dxy^2;}
-// in den folgenden zwei Schritten werden Gewichte umgekehrt-proportional zur Einzugsgebietsgr��e nach der multiple flow methode aufsummiert. Der w-parameter steuert die st�rke der Gewichtung //
-foreach p in W do
-{W[p] = (1/C[p])^w;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	k = k +1;
-	gefunden = 0;
-	foreach p in W do
-	{	if (R[p] == k)
-		{W[p] = W[p] + W[p+pul] * UL[p] + W[p+pl] * LL[p] + W[p+pol] * OL[p] + W[p+po] * OO[p] + W[p+por] * OR[p] + W[p+pr] * RR[p] + W[p+pur] * UR[p] + W[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(W);
-// in den folgenden zwei Schritten werden H�henwerte und Gewichte nach der multiple flow methode in der Matrix H aufsummiert, wobei lokale Maxima im Einzugsgebiet am st�rksten in H eingehen. Der w-Parameter steuert die St�rke der Maximumgewichtung //
-foreach p in H do
-{H[p] = M[p] * (1/C[p])^w;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	l = l +1;
-	gefunden = 0;
-	foreach p in H do
-	{	if (R[p] == l)
-		{H[p] = H[p] + H[p+pul] * UL[p] + H[p+pl] * LL[p] + H[p+pol] * OL[p] + H[p+po] * OO[p] + H[p+por] * OR[p] + H[p+pr] * RR[p] + H[p+pur] * UR[p] + H[p+pu] * UU[p]; gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-setRandN(H);
-// im folgenden Schritt wird eine relative H�he H �ber dem gewichteten arithmetischen Mittel der Einzugsgebietsgr��e bestimmt //
-foreach p in H do
-{	if (isRand(p, M) == 0)
-	{H[p] = -1 * (M[p] - H[p]/W[p]);}
-}
-setRandN(H);
-// in den folgenden drei Schritten werden Maxima der relativen H�he H in Abh�ngigkeit der Neigung gesaugt. Der e-Parameter steuert die st�rke der Maximum-Streckung //
-foreach p in X do
-{X[p] = H[p]^e;}
-foreach ploop in Loop do
-{	ploop.x = 1;
-	m = m +1;
-	gefunden = 0;
-	foreach p in X do
-	{
-	if ((((1/t^N[p])^exp(t^N[p])) * max9(p, X)) > X[p])
-	{X[p] = (((1/t^N[p])^exp(t^N[p])) * max9(p, X)); gefunden = 1;}
-	}
-	if (gefunden == 0)
-	{ploop.x = 100000;}
-}
-foreach p in HU do
-{	if (isRand(p, M) == 0)
-	{
-	if(H[p]^e < X[p] || H[p+pul]^e < X[p+pul] || H[p+pl]^e < X[p+pl] || H[p+pol]^e < X[p+pol] || H[p+po]^e < X[p+po] || H[p+por]^e < X[p+por] || H[p+pr]^e < X[p+pr] || H[p+pur]^e < X[p+pur] || H[p+pu]^e < X[p+pu])
-	{HU[p] = (((X[p] + X[p+pul] + X[p+pu] + X[p+pur] + X[p+pl] + X[p+pr] + X[p+pol] + X[p+po] + X[p+por])/9)^(1/e));}
-	else	
-	{HU[p] = (X[p]^(1/e));}
-	}
-}
-setRandN (HU);
-showMatrix(HO);
-showMatrix(HU);
-// auf Grundlage von HO und HU wird die Normierte H�he (NH) mit H�henwerten zwischen minimal 0 (=unten) und maximal 1 (= oben) wie beim NDVI bestimmt. Die Standardisierte H�he SH streckt das Relief auf ein H�henspektrum zwischen theoretisch 0 (=unten) und dem Maximum der jeweiligen Scheitelbereiche, so dass die urspr�ngliche Reliefenergie erhalten bleibt. Selbstverst�ndlich muss f�r Anwendungen �berpr�ft werden, ob und welche relativen H�hen (HU, HO, SH) logarithmiert dargestellt werden. [...]
-foreach p in NH do
-{NH[p] = 0.5 * (1 + ((HO[p] - HU[p])/(HO[p] + HU[p])));}
-showMatrix(NH);
-foreach p in SH do
-{SH[p] = NH[p] * O[p];}
-showMatrix(SH);
-foreach p in SHL do
-{SHL[p] = ln(SH[p]);}
-showMatrix(SHL);
-/**/
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.cpp
deleted file mode 100644
index 139d0ce..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.cpp
+++ /dev/null
@@ -1,476 +0,0 @@
-/**********************************************************
- * Version $Id: tpi.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_morphometry                     //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                        tpi.cpp                        //
-//                                                       //
-//                 Copyright (C) 2011 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 "tpi.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTPI::CTPI(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	// 1. Info...
-
-	Set_Name		(_TL("Topographic Position Index (TPI)"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Topographic Position Index (TPI) calculation as proposed by Guisan et al. (1999). "
-		"This is literally the same as the difference to the mean calculation (residual analysis) "
-		"proposed by Wilson & Gallant (2000).\n"
-		"\n"
-		"References:\n"
-		"- Guisan, A., Weiss, S.B., Weiss, A.D. (1999): GLM versus CCA spatial modeling of plant species distribution. Plant Ecology 143: 107-122.\n"
-		"- Weiss, A.D. (2000): Topographic Position and Landforms Analysis. <a target=\"_blank\" href=\"http://www.jennessent.com/downloads/tpi-poster-tnc_18x22.pdf\">poster</a>.\n"
-		"- Wilson, J.P. & Gallant, J.C. (2000): Terrain Analysis - Principles and Applications.\n"
-	));
-
-
-	//-----------------------------------------------------
-	// 2. Parameters...
-
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	pNode	= Parameters.Add_Grid(
-		NULL	, "TPI"			, _TL("Topographic Position Index"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "STANDARD"	, _TL("Standardize"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, false
-	);
-
-	Parameters.Add_Range(
-		NULL	, "RADIUS"		, _TL("Radius"),
-		_TL("radius in map units"),
-		0.0, 100.0, 0.0, true
-	);
-
-	m_Cells.Get_Weighting().Set_BandWidth(75.0);	// 75%
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("bandwidth has to be given as percentage of the (outer) radius")
-	)->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTPI::On_Execute(void)
-{
-	m_pDEM		= Parameters("DEM")	->asGrid();
-	m_pTPI		= Parameters("TPI")	->asGrid();
-
-	DataObject_Set_Colors(m_pTPI, 100, SG_COLORS_RED_GREY_BLUE, true);
-
-	//-----------------------------------------------------
-	double	r_inner	= Parameters("RADIUS")->asRange()->Get_LoVal() / Get_Cellsize();
-	double	r_outer	= Parameters("RADIUS")->asRange()->Get_HiVal() / Get_Cellsize();
-
-	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());
-	m_Cells.Get_Weighting().Set_BandWidth(r_outer * m_Cells.Get_Weighting().Get_BandWidth() / 100.0);
-
-	if( !m_Cells.Set_Annulus(r_inner, r_outer) )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			Get_Statistics(x, y);
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Cells.Destroy();
-
-	if( Parameters("STANDARD")->asBool() )
-	{
-		m_pTPI->Standardise();
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTPI::Get_Statistics(int x, int y)
-{
-	if( m_pDEM->is_InGrid(x, y) )
-	{
-		int		i, ix, iy;
-		double	z, id, iw;
-
-		CSG_Simple_Statistics	Statistics;
-
-		for(i=0, z=m_pDEM->asDouble(x, y); i<m_Cells.Get_Count(); i++)
-		{
-			if( m_Cells.Get_Values(i, ix = x, iy = y, id, iw, true) && id >= 0.0 && m_pDEM->is_InGrid(ix, iy) )
-			{
-				Statistics.Add_Value(m_pDEM->asDouble(ix, iy), iw);
-			}
-		}
-
-		//-------------------------------------------------
-		if( Statistics.Get_Weights() > 0.0 )
-		{
-			m_pTPI->Set_Value(x, y, z - Statistics.Get_Mean());
-
-			return( true );
-		}
-	}
-
-	//-----------------------------------------------------
-	m_pTPI->Set_NoData(x, y);
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CTPI_Classification::CTPI_Classification(void)
-{
-	CSG_Parameter	*pNode;
-
-	//-----------------------------------------------------
-	// 1. Info...
-
-	Set_Name		(_TL("TPI Based Landform Classification"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
-
-	Set_Description	(_TW(
-		"Topographic Position Index (TPI) calculation as proposed by Guisan et al. (1999). "
-		"This is literally the same as the difference to the mean calculation (residual analysis) "
-		"proposed by Wilson & Gallant (2000).\n"
-		"\n"
-		"References:\n"
-		"- Guisan, A., Weiss, S.B., Weiss, A.D. (1999): GLM versus CCA spatial modeling of plant species distribution. Plant Ecology 143: 107-122.\n"
-		"- Weiss, A.D. (2000): Topographic Position and Landforms Analysis. <a target=\"_blank\" href=\"http://www.jennessent.com/downloads/tpi-poster-tnc_18x22.pdf\">poster</a>.\n"
-		"- Wilson, J.P. & Gallant, J.C. (2000): Terrain Analysis - Principles and Applications.\n"
-	));
-
-
-	//-----------------------------------------------------
-	// 2. Parameters...
-
-	Parameters.Add_Grid(
-		NULL	, "DEM"			, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	pNode	= Parameters.Add_Grid(
-		NULL	, "LANDFORMS"	, _TL("Landforms"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Range(
-		NULL	, "RADIUS_A"	, _TL("Radius"),
-		_TL("radius in map units"),
-		0.0, 100.0, 0.0, true
-	);
-
-	Parameters.Add_Range(
-		NULL	, "RADIUS_B"	, _TL("Radius"),
-		_TL("radius in map units"),
-		0.0, 1000.0, 0.0, true
-	);
-
-	m_Weighting.Set_BandWidth(75.0);	// 75%
-	Parameters.Add_Parameters(
-		NULL	, "WEIGHTING"	, _TL("Weighting"),
-		_TL("bandwidth has to be given as percentage of the (outer) radius")
-	)->asParameters()->Assign(m_Weighting.Get_Parameters());
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	LF_CANYON		= 0,
-	LF_MID_SLOPE,
-	LF_UPLAND,
-	LF_VALLEY,
-	LF_PLAIN,
-	LF_OPEN_SLOPE,
-	LF_UPPER_SLOPE,
-	LF_LOCAL_RIDGE,
-	LF_MIDSLOPE_RIDGE,
-	LF_HIGH_RIDGE,
-	LF_COUNT
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CTPI_Classification::On_Execute(void)
-{
-	double		Slope, Aspect;
-	CSG_Grid	*pDEM, *pLandforms, TPI_A, TPI_B;
-	CTPI		TPI;
-
-	//-----------------------------------------------------
-	pDEM		= Parameters("DEM")			->asGrid();
-	pLandforms	= Parameters("LANDFORMS")	->asGrid();
-
-	TPI.Get_Parameters()->Set_Parameter(SG_T("DEM")      , Parameters("DEM"));
-	TPI.Get_Parameters()->Set_Parameter(SG_T("WEIGHTING"), Parameters("WEIGHTING"));
-	TPI.Get_Parameters()->Get_Parameter("STANDARD")->Set_Value(true);
-
-	//-----------------------------------------------------
-	TPI_A.Create(*Get_System());
-	TPI.Get_Parameters()->Get_Parameter("TPI")->Set_Value(&TPI_A);
-	TPI.Get_Parameters()->Set_Parameter(SG_T("RADIUS"), Parameters("RADIUS_A"));
-
-	if( !TPI.Execute() )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	TPI_B.Create(*Get_System());
-	TPI.Get_Parameters()->Get_Parameter("TPI")->Set_Value(&TPI_B);
-	TPI.Get_Parameters()->Set_Parameter(SG_T("RADIUS"), Parameters("RADIUS_B"));
-
-	if( !TPI.Execute() )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( pDEM->is_NoData(x, y) )
-			{
-				pLandforms->Set_Value(x, y, -1.0);
-			}
-			else
-			{
-				double	A	= TPI_A.asDouble(x, y);
-				double	B	= TPI_B.asDouble(x, y);
-
-				if( A <= -1.0 )
-				{
-					if( B <= -1.0 )
-					{	// Canyons, Deeply Incised Streams
-						pLandforms->Set_Value(x, y, LF_CANYON);
-					}
-					else if( B < 1.0 )
-					{	// Midslope Drainages, Shallow Valleys
-						pLandforms->Set_Value(x, y, LF_MID_SLOPE);
-					}
-					else // if( B >= 1.0 )
-					{	// Upland Drainages, Headwaters
-						pLandforms->Set_Value(x, y, LF_UPLAND);
-					}
-				}
-				else if( A < 1.0 )
-				{
-					if( B <= -1.0 )
-					{	// U-shaped Valleys
-						pLandforms->Set_Value(x, y, LF_VALLEY);
-					}
-					else if( B < 1.0 )
-					{
-						pDEM->Get_Gradient(x, y, Slope, Aspect);
-
-						if( Slope <= 5.0 * M_DEG_TO_RAD )
-						{	// Plains
-							pLandforms->Set_Value(x, y, LF_PLAIN);
-						}
-						else
-						{	// Open Slopes
-							pLandforms->Set_Value(x, y, LF_OPEN_SLOPE);
-						}
-					}
-					else // if( B >= 1.0 )
-					{	// Upper Slopes, Mesas
-						pLandforms->Set_Value(x, y, LF_UPPER_SLOPE);
-					}
-				}
-				else // if( A >= 1.0 )
-				{
-					if( B <= -1.0 )
-					{	// Local Ridges, Hills in Valleys
-						pLandforms->Set_Value(x, y, LF_LOCAL_RIDGE);
-					}
-					else if( B < 1.0 )
-					{	// Midslope Ridges, Small Hills in Plains
-						pLandforms->Set_Value(x, y, LF_MIDSLOPE_RIDGE);
-					}
-					else // if( B >= 1.0 )
-					{	// Mountain Tops, High Ridges
-						pLandforms->Set_Value(x, y, LF_HIGH_RIDGE);
-					}
-				}
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	CSG_Parameters	P;
-
-	if( DataObject_Get_Parameters(pLandforms, P) && P("COLORS_TYPE") && P("LUT") )
-	{
-		int LF_Colors[LF_COUNT]	=
-		{
-			SG_GET_RGB(  0,   0, 127),	// LF_CANYON
-			SG_GET_RGB(200, 200, 255),	// LF_MID_SLOPE
-			SG_GET_RGB(  0, 200, 255),	// LF_UPLAND
-			SG_GET_RGB(127, 127, 255),	// LF_VALLEY
-			SG_GET_RGB(255, 255, 128),	// LF_PLAIN
-			SG_GET_RGB(128, 255,   0),	// LF_OPEN_SLOPE
-			SG_GET_RGB(  0, 255,   0),	// LF_UPPER_SLOPE
-			SG_GET_RGB(255, 200, 127),	// LF_LOCAL_RIDGE
-			SG_GET_RGB(255, 127,   0),	// LF_MIDSLOPE_RIDGE
-			SG_GET_RGB(255,   0,   0)	// LF_HIGH_RIDGE
-		};
-
-		//-------------------------------------------------
-		CSG_Strings	Name, Desc;
-
-		Name	+= _TL("Streams");				Desc	+= _TL("Canyons, Deeply Incised Streams");
-		Name	+= _TL("Midslope Drainages");	Desc	+= _TL("Midslope Drainages, Shallow Valleys");
-		Name	+= _TL("Upland Drainages");		Desc	+= _TL("Upland Drainages, Headwaters");
-		Name	+= _TL("Valleys");				Desc	+= _TL("U-shaped Valleys");
-		Name	+= _TL("Plains");				Desc	+= _TL("Plains");
-		Name	+= _TL("Open Slopes");			Desc	+= _TL("Open Slopes");
-		Name	+= _TL("Upper Slopes");			Desc	+= _TL("Upper Slopes, Mesas");
-		Name	+= _TL("Local Ridges");			Desc	+= _TL("Local Ridges, Hills in Valleys");
-		Name	+= _TL("Midslope Ridges");		Desc	+= _TL("Midslope Ridges, Small Hills in Plains");
-		Name	+= _TL("High Ridges");			Desc	+= _TL("Mountain Tops, High Ridges");
-
-		//-------------------------------------------------
-		CSG_Table	*pTable	= P("LUT")->asTable();
-
-		pTable->Del_Records();
-
-		for(int i=0; i<LF_COUNT; i++)
-		{
-			CSG_Table_Record	*pRecord	= pTable->Add_Record();
-
-			pRecord->Set_Value(0, LF_Colors[i]);
-			pRecord->Set_Value(1, Name[i].c_str());
-			pRecord->Set_Value(2, Desc[i].c_str());
-			pRecord->Set_Value(3, i);
-			pRecord->Set_Value(4, i);
-		}
-
-		P("COLORS_TYPE")->Set_Value(1);	// Color Classification Type: Lookup Table
-
-		DataObject_Set_Parameters(pLandforms, P);
-	}
-
-	//-----------------------------------------------------
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp
deleted file mode 100644
index 9ca50ae..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/**********************************************************
- * Version $Id: FillSinks_WL.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_preprocessor                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    FillSinks_WL.cpp                   //
-//                                                       //
-//                 Copyright (C) 2007 by                 //
-//                    Volker Wichmann                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     reklovw at web.de					     //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "FillSinks_WL.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Construction/Destruction				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-CFillSinks_WL::CFillSinks_WL(void)
-{
-
-	Set_Name		(_TL("Fill Sinks (Wang & Liu)"));
-	Set_Author		(_TL("Copyrights (c) 2007 by Volker Wichmann"));
-	Set_Description	(_TW(
-		"This module uses an algorithm proposed by Wang & Liu to identify and fill surface depressions in "
-		"digital elevation models.\n"
-		"The method was enhanced to allow the creation of hydrologic sound elevation models, i.e. not only to "
-		"fill the depression(s) but also to preserve a downward slope along the flow path. If desired, this is accomplished "
-		"by preserving a minimum slope gradient (and thus elevation difference) between cells.\n"
-		"This is the fully featured version of the module creating a depression less DEM, a flow path grid and "
-		"a grid with watershed basins. If you encounter problems processing large data sets "
-		"(e.g. LIDAR data) with this module try the basic version (Fill Sinks XXL).\n\n\n"
-		"References:\n"
-		"Wang, L. & H. Liu (2006): An efficient method for identifying and filling surface depressions in "
-		"digital elevation models for hydrologic analysis and modelling. International Journal of Geographical "
-		"Information Science, Vol. 20, No. 2: 193-213.\n"
-	));
-
-
-	Parameters.Add_Grid(	
-		NULL, "ELEV", _TL("DEM"), 
-		_TL("Digital elevation model"),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(	
-		NULL, "FILLED", _TL("Filled DEM"), 
-		_TL("Depression-free digital elevation model"),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "FDIR", _TL("Flow Directions"),
-		_TL("Computed flow directions, 0=N, 1=NE, 2=E, ... 7=NW"),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL, "WSHED", _TL("Watershed Basins"),
-		_TL("Delineated watershed basins"),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL, "MINSLOPE", _TL("Minimum Slope [Degree]"),
-		_TL("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]"),
-		PARAMETER_TYPE_Double, 0.1, 0.0, true
-	);
-
-}
-
-//---------------------------------------------------------
-CFillSinks_WL::~CFillSinks_WL(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-
-
-bool CFillSinks_WL::On_Execute(void)		
-{
-	CSG_Grid	*pElev, *pSeed, *pFdir, *pWshed;
-	PriorityQ	theQueue;
-	CFillSinks_WL_Node		tempNode;
-
-	int			x, y, ix, iy, i;
-	int			inverse[8] = { 4, 5, 6, 7, 0, 1, 2, 3 };
-	double		z, iz, progress;
-	double		minslope, mindiff[8];
-	bool		preserve;
-	long		id;
-
-	pElev		= Parameters("ELEV")->asGrid();
-	pFilled		= Parameters("FILLED")->asGrid();
-	pFdir		= Parameters("FDIR")->asGrid();
-	pWshed		= Parameters("WSHED")->asGrid();
-	minslope	= Parameters("MINSLOPE")->asDouble();
-
-	pFilled->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pElev->Get_Name(), _TL("no sinks")));
-
-
-	if( minslope > 0.0 )
-	{
-		minslope = tan(minslope * M_DEG_TO_RAD);
-		for(i=0; i<8; i++)
-			mindiff[i] = minslope * Get_Length(i);
-		preserve = true;
-	}
-	else
-		preserve = false;
-
-
-	pSeed	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Bit, pElev->Get_NX(), pElev->Get_NY(), pElev->Get_Cellsize(), pElev->Get_XMin(), pElev->Get_YMin());
-	
-	pFilled->Assign_NoData();
-	pWshed->Assign_NoData();
-	pFdir->Assign_NoData();
-	pSeed->Assign(0.0);
-
-
-	
-	// fill priority queue with boundary, i.e. seed cells
-	id = 0;
-	for(y=0; y<Get_NY(); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( !pElev->is_NoData(x, y) )
-			{
-				for(i=0; i<8; i++)
-				{
-					ix = Get_xTo(i, x);
-					iy = Get_yTo(i, y);
-					if( !is_InGrid(ix, iy) || pElev->is_NoData(ix, iy) )
-					{
-						z = pElev->asDouble(x, y);
-						pFilled->Set_Value(x, y, z);
-						pSeed->Set_Value(x, y, 1.0);
-						pWshed->Set_Value(x, y, id);
-						id += 1;
-
-						tempNode.x		= x;
-						tempNode.y		= y;
-						tempNode.spill	= z;
-						theQueue.push( tempNode );
-						break;
-					}
-				}
-			}
-		}
-	}
-
-	// work through least cost path
-	progress = 0.0;
-
-	while( !theQueue.empty() )
-	{
-		PriorityQ::value_type tempNode = theQueue.top();
-
-		x = tempNode.x;
-		y = tempNode.y;
-		theQueue.pop();
-
-		id	= (long) pWshed->asDouble(x, y);
-		z	= pFilled->asDouble(x, y);
-
-		for(i=0; i<8; i++)
-		{
-			ix = Get_xTo(i, x);
-			iy = Get_yTo(i, y);
-			if( is_InGrid(ix, iy) && !pElev->is_NoData(ix, iy) )
-			{
-				if( pFilled->is_NoData(ix, iy) )
-				{
-					iz = pElev->asDouble(ix, iy);
-
-					if( preserve )
-					{
-						if( iz < (z + mindiff[i]) )
-							iz = z + mindiff[i];
-					}
-					else if( iz <= z )
-					{
-						iz = z;
-						pFdir->Set_Value(ix, iy, inverse[i]);
-					}
-
-					tempNode.x		= ix;
-					tempNode.y		= iy;
-					tempNode.spill	= iz;
-					theQueue.push( tempNode );
-
-					pFilled->Set_Value(ix, iy, iz);
-					pWshed->Set_Value(ix, iy, id);
-				}
-				else if( pSeed->asInt(ix, iy) == 1 )
-					pWshed->Set_Value(ix, iy, id);
-			}
-		}
-
-		if( pFdir->is_NoData(x, y) )
-			pFdir->Set_Value(x, y, Get_Dir(x, y, z));
-
-
-		progress += 1.0;
-		if( ((int)progress) % 10000 == 0 )
-			Set_Progress(progress, pElev->Get_NCells());
-			//DataObject_Update(pFilled, pElev->Get_ZMin(), pElev->Get_ZMax(), true);
-		
-	}
-
-
-	delete (pSeed);
-	return (true);
-}
-
-
-int CFillSinks_WL::Get_Dir(int x, int y, double z)
-{
-	int		ix, iy, i, steepestn;
-	double	iz, max, gradient;
-
-	max = 0.0;
-	steepestn = -1;
-
-	for(i=0; i<8; i++)
-	{
-		ix = Get_xTo(i, x);
-		iy = Get_yTo(i, y);
-
-		if(	is_InGrid(ix, iy) && !pFilled->is_NoData(ix, iy) && (iz = pFilled->asDouble(ix, iy)) < z)
-		{
-			gradient = (z - iz) / Get_Length(i);
-			if( max < gradient )
-			{
-				max = gradient;
-				steepestn = i;
-			}
-		}
-	}
-
-	return (steepestn);
-}
\ No newline at end of file
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp
deleted file mode 100644
index 34acde9..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/**********************************************************
- * Version $Id: FillSinks_WL_XXL.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_preprocessor                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    FillSinks_WL.cpp                   //
-//                                                       //
-//                 Copyright (C) 2007 by                 //
-//                    Volker Wichmann                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// 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:     reklovw at web.de					     //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "FillSinks_WL.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Construction/Destruction				 //
-//														 //
-///////////////////////////////////////////////////////////
-
-CFillSinks_WL_XXL::CFillSinks_WL_XXL(void)
-{
-
-	Set_Name		(_TL("Fill Sinks XXL (Wang & Liu)"));
-	Set_Author		(_TL("Copyrights (c) 2007 by Volker Wichmann"));
-	Set_Description	(_TW(
-		"This module uses an algorithm proposed by Wang & Liu to identify and fill surface depressions in "
-		"digital elevation models.\n"
-		"The method was enhanced to allow the creation of hydrologic sound elevation models, i.e. not only to "
-		"fill the depression(s) but also to preserve a downward slope along the flow path. If desired, this is accomplished "
-		"by preserving a minimum slope gradient (and thus elevation difference) between cells.\n"
-		"This version of the module is designed to work on large data sets (e.g. LIDAR data), with smaller "
-		"datasets you might like to check out the fully featured standard version of the module.\n\n\n"
-		"References:\n"
-		"Wang, L. & H. Liu (2006): An efficient method for identifying and filling surface depressions in "
-		"digital elevation models for hydrologic analysis and modelling. International Journal of Geographical "
-		"Information Science, Vol. 20, No. 2: 193-213.\n"
-	));
-
-
-	Parameters.Add_Grid(	
-		NULL, "ELEV", _TL("DEM"), 
-		_TL("Digital elevation model"),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(	
-		NULL, "FILLED", _TL("Filled DEM"), 
-		_TL("Depression-free digital elevation model"),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL, "MINSLOPE", _TL("Minimum Slope [Degree]"),
-		_TL("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]"),
-		PARAMETER_TYPE_Double, 0.1, 0.0, true
-	);
-
-}
-
-//---------------------------------------------------------
-CFillSinks_WL_XXL::~CFillSinks_WL_XXL(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-
-
-bool CFillSinks_WL_XXL::On_Execute(void)		
-{
-	CSG_Grid	*pElev, *pFilled;
-	PriorityQ	theQueue;
-	CFillSinks_WL_Node		tempNode;
-
-	int			x, y, ix, iy, i;
-	double		z, iz, progress;
-	double		minslope, mindiff[8];
-	bool		preserve;
-
-
-	pElev		= Parameters("ELEV")->asGrid();
-	pFilled		= Parameters("FILLED")->asGrid();
-	minslope	= Parameters("MINSLOPE")->asDouble();		
-
-	pFilled->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pElev->Get_Name(), _TL("no sinks")));
-
-
-	if( minslope > 0.0 )
-	{
-		minslope = tan(minslope * M_DEG_TO_RAD);
-		for(i=0; i<8; i++)
-			mindiff[i] = minslope * Get_Length(i);
-		preserve = true;
-	}
-	else
-		preserve = false;
-
-	
-	pFilled->Assign_NoData();
-	
-
-	// fill priority queue with boundary cells, i.e. seed cells
-	for(y=0; y<Get_NY(); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( !pElev->is_NoData(x, y) )
-			{
-				for(i=0; i<8; i++)
-				{
-					ix = Get_xTo(i, x);
-					iy = Get_yTo(i, y);
-					if( !is_InGrid(ix, iy) || pElev->is_NoData(ix, iy) )
-					{
-						z = pElev->asDouble(x, y);
-
-						tempNode.x		= x;
-						tempNode.y		= y;
-						tempNode.spill	= z;
-						theQueue.push( tempNode );
-
-						pFilled->Set_Value(x, y, z);
-						break;
-					}
-				}
-			}
-		}
-	}
-
-
-	// process queue
-	progress = 0.0;
-
-	while( !theQueue.empty() )
-	{
-		PriorityQ::value_type tempNode = theQueue.top();
-
-		x = tempNode.x;
-		y = tempNode.y;
-		theQueue.pop();
-
-		z = pFilled->asDouble(x, y);
-
-		for(i=0; i<8; i++)
-		{
-			ix = Get_xTo(i, x);
-			iy = Get_yTo(i, y);
-			if( is_InGrid(ix, iy) && !pElev->is_NoData(ix, iy) && pFilled->is_NoData(ix, iy) )
-			{
-				iz = pElev->asDouble(ix, iy);
-
-				if( preserve )
-				{
-					if( iz < (z + mindiff[i]) )
-						iz = z + mindiff[i];
-				}
-				else if( iz < z )
-					iz = z;
-
-				tempNode.x		= ix;
-				tempNode.y		= iy;
-				tempNode.spill	= iz;
-				theQueue.push( tempNode );
-
-				pFilled->Set_Value(ix, iy, iz);
-			}
-		}
-
-		progress += 1.0;
-		if( ((int)progress) % 10000 == 0 )
-			Set_Progress(progress, pElev->Get_NCells());
-			//DataObject_Update(pFilled, pElev->Get_ZMin(), pElev->Get_ZMax(), true);
-		
-	}
-
-	return (true);
-}
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.in
deleted file mode 100644
index 859701a..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.in
+++ /dev/null
@@ -1,597 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir =  \
-	src/modules_terrain_analysis/terrain_analysis/ta_preprocessor
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_preprocessor_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_preprocessor_la_OBJECTS = burn_in_streams.lo FillSinks.lo \
-	FillSinks_WL.lo FillSinks_WL_XXL.lo MLB_Interface.lo \
-	Flat_Detection.lo Pit_Eliminator.lo Pit_Router.lo
-libta_preprocessor_la_OBJECTS = $(am_libta_preprocessor_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_preprocessor_la_SOURCES)
-DIST_SOURCES = $(libta_preprocessor_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
-pkglib_LTLIBRARIES = libta_preprocessor.la
-libta_preprocessor_la_SOURCES = \
-burn_in_streams.cpp\
-FillSinks.cpp\
-FillSinks_WL.cpp\
-FillSinks_WL_XXL.cpp\
-MLB_Interface.cpp\
-Flat_Detection.cpp\
-Pit_Eliminator.cpp\
-Pit_Router.cpp\
-burn_in_streams.h\
-FillSinks.h\
-FillSinks_WL.h\
-MLB_Interface.h\
-Flat_Detection.h\
-Pit_Eliminator.h\
-Pit_Router.h
-
-libta_preprocessor_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_preprocessor.la: $(libta_preprocessor_la_OBJECTS) $(libta_preprocessor_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_preprocessor_la_OBJECTS) $(libta_preprocessor_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FillSinks.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FillSinks_WL.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FillSinks_WL_XXL.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flat_Detection.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pit_Eliminator.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pit_Router.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/burn_in_streams.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.cpp
deleted file mode 100644
index a20facc..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.cpp
+++ /dev/null
@@ -1,1134 +0,0 @@
-/**********************************************************
- * Version $Id: Pit_Router.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                    ta_preprocessor                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    Pit_Router.cpp                     //
-//                                                       //
-//                 Copyright (C) 2003 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "Pit_Router.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define	IS_Flat(a,b)		(a==b)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CPit_Router::CPit_Router(void)
-{
-	Set_Name		(_TL("Sink Drainage Route Detection"));
-
-	Set_Author		(SG_T("O. Conrad (c) 2001"));
-
-	Set_Description	(_TW(
-		""
-	));
-
-	Parameters.Add_Grid(
-		NULL	, "ELEVATION"	, _TL("Elevation"),
-		_TL(""),
-		PARAMETER_INPUT
-	);
-
-	Parameters.Add_Grid(
-		NULL	, "SINKROUTE"	, _TL("Sink Route"),
-		_TL(""),
-		PARAMETER_OUTPUT
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRESHOLD"	, _TL("Threshold"),
-		_TL(""),
-		PARAMETER_TYPE_Bool
-	);
-
-	Parameters.Add_Value(
-		NULL	, "THRSHEIGHT"	, _TL("Threshold Height"),
-		_TL(""),
-		PARAMETER_TYPE_Double	, 100
-	);
-}
-
-//---------------------------------------------------------
-CPit_Router::~CPit_Router(void)
-{}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPit_Router::On_Execute(void)
-{
-	return( Get_Routes(
-		Parameters("ELEVATION")->asGrid(),
-		Parameters("SINKROUTE")->asGrid(),
-		Parameters("THRESHOLD")->asBool() ? Parameters("THRSHEIGHT")->asDouble() : -1.0
-	) >= 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CPit_Router::Get_Routes(CSG_Grid *pDEM, CSG_Grid *pRoute, double Threshold)
-{
-	int			iPit, nPits, n;
-	TPit_Outlet	*pOutlet, *pNext;
-
-	//-----------------------------------------------------
-	m_pDEM		= pDEM;
-	m_pRoute	= pRoute;
-	m_Threshold	= Threshold;
-
-	//-----------------------------------------------------
-	m_pPits		= NULL;
-	m_Pit		= NULL;
-
-	m_pFlats	= NULL;
-	m_Flat		= NULL;
-
-	m_Outlets	= NULL;
-
-	//-----------------------------------------------------
-	Get_System()->Assign(m_pDEM->Get_System());
-
-	//-----------------------------------------------------
-	if( Initialize() )
-	{
-		//-------------------------------------------------
-		// 1. Pits/Flats finden...
-
-		SG_UI_Process_Set_Text(_TL("Find Pits"));
-
-		nPits	= Find_Pits();
-
-		if( nPits > 0 )
-		{
-			//---------------------------------------------
-			// 2. Pit/Flat-Zugehoerigkeiten u. pot. m_Outlets finden...
-
-			SG_UI_Process_Set_Text(_TL("Find Outlets"));
-
-			Find_Outlets(nPits);
-
-
-			//---------------------------------------------
-			// 3. Routing vornehmen...
-
-			SG_UI_Process_Set_Text(_TL("Routing"));
-
-			iPit	= 0;
-
-			do
-			{
-				pOutlet	= m_Outlets;
-
-				while( pOutlet && SG_UI_Process_Get_Okay(false) )
-				{
-					pNext	= pOutlet->Next;
-					n		= Find_Route(pOutlet);
-
-					if( n > 0 )
-					{
-						pOutlet	= m_Outlets;
-						iPit	+= n;
-						SG_UI_Process_Set_Progress(iPit, nPits);
-					}
-					else
-					{
-						pOutlet	= pNext;
-					}
-				}
-
-				if( iPit < nPits )	// Thresholding may have prevented total removal of pits...
-				{
-					for(n=0; n<nPits; n++)
-					{
-						if( !m_Pit[n].bDrained )
-						{
-							m_Pit[n].bDrained	= true;
-							iPit++;
-							break;
-						}
-					}
-				}
-			}
-			while( iPit < nPits && SG_UI_Process_Set_Progress(iPit, nPits) );
-		}
-
-
-		//-------------------------------------------------
-		// 4. Threshold
-
-		if( m_Threshold > 0.0 )
-		{
-			nPits	-= Process_Threshold();
-		}
-	}
-
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("Finalize"));
-
-	Finalize();
-
-	if( Process_Get_Okay(false) )
-	{
-		if( nPits > 0 )
-		{
-			Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of processed sinks"), nPits));
-
-			return( nPits );
-		}
-		else
-		{
-			Message_Add(_TL("No sinks have been detected."));
-		}
-	}
-
-	return( 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CPit_Router::Initialize(void)
-{
-	if(	m_pDEM && m_pDEM->is_Valid()
-	&&	m_pRoute && m_pRoute->is_Valid()
-	&&	m_pDEM->Get_System() == m_pRoute->Get_System()	)
-//	&&	m_pDEM->is_Compatible(m_pRoute->Get_System())	)
-	{
-		m_pRoute->Assign();
-
-		m_pPits		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Int);
-		m_pPits->Assign();
-
-		m_Pit		= NULL;
-
-		m_pFlats	= NULL;
-		m_Flat		= NULL;
-
-		m_Outlets	= NULL;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-void CPit_Router::Finalize(void)
-{
-	TPit_Outlet	*pOutlet;
-
-	if( m_pPits )
-	{
-		delete( m_pPits );
-		m_pPits		= NULL;
-	}
-
-	if( m_Pit )
-	{
-		SG_Free(m_Pit);
-		m_Pit		= NULL;
-	}
-
-	if( m_pFlats )
-	{
-		delete( m_pFlats );
-		m_pFlats	= NULL;
-	}
-
-	if( m_Flat )
-	{
-		SG_Free(m_Flat);
-		m_Flat		= NULL;
-	}
-
-	while( m_Outlets )
-	{
-		pOutlet		= m_Outlets->Next;
-		SG_Free(m_Outlets);
-		m_Outlets	= pOutlet;
-	}
-
-	m_Outlets	= NULL;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CPit_Router::Find_Pits(void)
-{
-	bool	bLower, bFlat;
-	int		x, y, i, ix, iy, nFlats, nPits;
-	long	n;
-	double	z;
-	TPit	*pPit;
-
-	//-----------------------------------------------------
-	nFlats		= 0;
-	nPits		= 0;
-
-	for(n=0; n<Get_NCells() && SG_UI_Process_Set_Progress(n, Get_NCells()); n++)
-	{
-		m_pDEM->Get_Sorted(n,x,y,false);	// von tief nach hoch...
-
-		if(	x > 0 && x < Get_NX() - 1 && y > 0 && y < Get_NY() - 1	// Randzellen und Missing Values sind
-		&&	!m_pDEM->is_NoData(x, y)								// per Definition drainiert (:= 0)...
-		&&	m_pPits->asInt(x, y) == 0	)	// ...oder schon als m_Flat markiert sein...
-		{
-			z		= m_pDEM->asDouble(x,y);
-			bLower	= false;
-			bFlat	= false;
-
-			for(i=0; i<8 && !bLower; i++)
-			{
-				ix	= Get_xTo(i,x);
-				iy	= Get_yTo(i,y);
-
-				if( !m_pDEM->is_InGrid(ix, iy) || z > m_pDEM->asDouble(ix, iy) )
-				{
-					bLower	= true;
-				}
-				else if( IS_Flat(z, m_pDEM->asDouble(ix,iy)) )
-				{
-					bFlat	= true;
-				}
-			}
-
-			//-----------------------------------------
-			if( !bLower )	// Pit or Flat...
-			{
-				nPits++;
-
-				m_pPits->Set_Value(x,y, nPits);
-
-				m_Pit				= (TPit *)SG_Realloc(m_Pit, nPits * sizeof(TPit));
-				pPit			= m_Pit + nPits - 1;
-				pPit->bDrained	= false;
-				pPit->z			= z;
-
-				if( bFlat )
-				{
-					nFlats++;
-
-					m_Flat			= (TGEO_iRect *)SG_Realloc(m_Flat, nFlats * sizeof(TGEO_iRect));
-
-					Mark_Flat(x, y, m_Flat + nFlats - 1, nFlats, nPits);
-				}
-			}
-		}
-	}
-
-	return( nPits );
-}
-
-//---------------------------------------------------------
-int CPit_Router::Find_Outlets(int nPits)
-{
-	bool	bOutlet, bExArea, bGoExArea;
-
-	int		x, y, i, ix, iy, iMin,
-			iID, j, jID, Pit_ID[8];
-
-	long	n;
-
-	double	z, dz, dzMin;
-
-	TPit_Outlet	*pOutlet;
-
-	//-----------------------------------------------------
-	if( nPits > 0 && SG_UI_Process_Get_Okay(false) )
-	{
-		pOutlet		= NULL;
-
-		m_nJunctions	= (int  *)SG_Calloc(nPits, sizeof(int  ));
-		m_Junction	= (int **)SG_Calloc(nPits, sizeof(int *));
-
-		//-------------------------------------------------
-		for(n=0; n<Get_NCells() && SG_UI_Process_Set_Progress(n, Get_NCells()); n++)
-		{
-			if(	m_pDEM->Get_Sorted(n, x, y, false) && m_pPits->asInt(x,y) == 0 )
-			{
-				z			= m_pDEM->asDouble(x,y);
-				iMin		= -1;
-
-				bOutlet		= false;
-				bGoExArea	= false;
-
-				//-----------------------------------------
-				for(i=0; i<8; i++)
-				{
-					ix		= Get_xTo(i,x);
-					iy		= Get_yTo(i,y);
-
-					bExArea	= !m_pDEM->is_InGrid(ix, iy);
-
-					if( bExArea || z > m_pDEM->asDouble(ix,iy) )
-					{
-						Pit_ID[i]	= iID	= bExArea ? 0 : m_pPits->asInt(ix,iy);
-
-						if( iID >= 0 )
-						{
-							for(j=0; j<i && !bOutlet; j++)
-							{
-								jID		= Pit_ID[j];
-
-								if(	jID >= 0 && !Get_Junction(iID, jID) )
-								{
-									bOutlet		= true;
-								}
-							}
-						}
-
-						//---------------------------------
-						if( !bGoExArea )
-						{
-							if( bExArea )
-							{
-								bGoExArea	= true;
-								iMin		= i;
-							}
-							else
-							{
-								dz			= (z - m_pDEM->asDouble(ix,iy)) / Get_Length(i);
-
-								if( iMin < 0 || dzMin < dz )
-								{
-									iMin	= i;
-									dzMin	= dz;
-								}
-							}
-						}
-					}
-					else
-					{
-						Pit_ID[i]	= -1;
-					}
-				}
-
-				//-----------------------------------------
-				if( bOutlet )
-				{
-					if( pOutlet )
-					{
-						pOutlet->Next		= (TPit_Outlet *)SG_Malloc(sizeof(TPit_Outlet));
-						pOutlet->Next->Prev	= pOutlet;
-						pOutlet				= pOutlet->Next;
-					}
-					else
-					{
-						m_Outlets	= pOutlet	= (TPit_Outlet *)SG_Malloc(sizeof(TPit_Outlet));
-						m_Outlets->Prev		= NULL;
-					}
-
-					pOutlet->Next	= NULL;
-					pOutlet->x		= x;
-					pOutlet->y		= y;
-					memcpy(pOutlet->Pit_ID, Pit_ID, 8 * sizeof(int));
-
-					//-------------------------------------
-					for(i=1; i<8; i++)
-					{
-						iID	= Pit_ID[i];
-
-						if( iID >= 0 )
-						{
-							for(j=0; j<i; j++)
-							{
-								jID	= Pit_ID[j];
-
-								if( jID >= 0 && !Get_Junction(iID, jID) )
-								{
-									Add_Junction(iID, jID);
-								}
-							}
-						}
-					}
-				}
-
-				//-----------------------------------------
-				if( iMin >= 0 )
-				{
-					m_pPits->Set_Value(x,y, Pit_ID[iMin] );
-				}
-			}
-		}
-
-		//-------------------------------------------------
-		for(i=0; i<nPits; i++)
-		{
-			if( m_Junction[i] )
-			{
-				SG_Free(m_Junction[i]);
-			}
-		}
-
-		SG_Free(m_Junction);
-
-		SG_Free(m_nJunctions);
-	}
-
-	return( 0 );
-}
-
-//---------------------------------------------------------
-int CPit_Router::Find_Route(TPit_Outlet *pOutlet)
-{
-	bool	bDrained, bNotDrained;
-
-	int		x, y, i, ix, iy, iMin,
-			Pit_ID, nPitsDrained;
-
-	double	z, dz, dzMin;
-
-
-	//-----------------------------------------------------
-	// 1. Ist Outlets Verbindung zw. Drained und Not Drained ???...
-
-	bDrained		= false;
-	bNotDrained		= false;
-
-	for(i=0; i<8; i++)
-	{
-		Pit_ID	= pOutlet->Pit_ID[i];
-
-		if( Pit_ID == 0 )
-		{
-			bDrained	= true;
-		}
-		else if( Pit_ID > 0 )
-		{
-			if( m_Pit[Pit_ID - 1].bDrained )
-			{
-				bDrained	= true;
-			}
-			else
-			{
-				bNotDrained	= true;
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	nPitsDrained	= 0;
-
-	if( bDrained )
-	{
-		if( bNotDrained )
-		{
-			x		= pOutlet->x;
-			y		= pOutlet->y;
-			z		= m_pDEM->asDouble(x,y);
-
-
-			//---------------------------------------------
-			// 2. Threshold ??!!...
-
-		/*	if( m_Threshold > 0.0 )
-			{
-				for(i=0; i<8; i++)
-				{
-					Pit_ID	= pOutlet->Pit_ID[i];
-
-					if( Pit_ID > 0 && !m_Pit[Pit_ID - 1].bDrained && m_Threshold < z - m_Pit[Pit_ID - 1].z )
-					{
-						pOutlet->Pit_ID[i]	= -1;
-					}
-				}
-			}/**/
-
-
-			//---------------------------------------------
-			// 3.a) nach au�en entwaessern...
-
-			if( !m_pRoute->asChar(x,y) )
-			{
-				iMin	= -1;
-
-				for(i=0; i<8; i++)
-				{
-					ix	= Get_xTo(i,x);
-					iy	= Get_yTo(i,y);
-
-					if( !m_pDEM->is_InGrid(ix, iy) || m_pRoute->asChar(ix, iy) > 0 )
-					{
-						iMin	= i;
-						break;
-					}
-					else
-					{
-						Pit_ID	= pOutlet->Pit_ID[i];
-
-						if(	Pit_ID == 0 || (Pit_ID > 0 && m_Pit[Pit_ID - 1].bDrained) )
-						{
-							dz		= (z - m_pDEM->asDouble(ix,iy)) / Get_Length(i);
-
-							if( iMin < 0 || dzMin < dz )
-							{
-								iMin	= i;
-								dzMin	= dz;
-							}
-						}
-					}
-				}
-
-				if( iMin >= 0 )
-				{
-					m_pRoute->Set_Value(x,y, iMin > 0 ? iMin : 8 );
-				}
-				else
-				{
-					SG_UI_Msg_Add_Error(_TL("Routing Error"));
-				}
-			}
-
-
-			//---------------------------------------------
-			// 3.b) Pit(s)/Flat(s) drainieren...
-
-			for(i=0; i<8; i++)
-			{
-				Pit_ID	= pOutlet->Pit_ID[i];
-
-				if( Pit_ID > 0 && !m_Pit[Pit_ID - 1].bDrained )
-				{
-					m_Pit[Pit_ID - 1].bDrained	= true;
-
-					Drain_Pit(x,y,Pit_ID);
-
-					nPitsDrained++;
-				}
-			}
-		}
-
-
-		//-------------------------------------------------
-		// 4. pOutlet entfernen...
-
-		if( pOutlet->Prev )
-		{
-			pOutlet->Prev->Next	= pOutlet->Next;
-		}
-		else
-		{
-			m_Outlets			= pOutlet->Next;
-		}
-
-		if( pOutlet->Next )
-		{
-			pOutlet->Next->Prev	= pOutlet->Prev;
-		}
-
-		SG_Free(pOutlet);
-	}
-
-	return( nPitsDrained );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CPit_Router::Add_Junction(int iID, int jID)
-{
-	int		i;
-
-	if( iID != jID )
-	{
-		if( iID > jID )
-		{
-			i	= iID;
-			iID	= jID;
-			jID	= i;
-		}
-
-		m_nJunctions[iID]++;
-
-		i	= m_nJunctions[iID];
-
-		m_Junction[iID]			= (int *)SG_Realloc(m_Junction[iID], i * sizeof(int));
-		m_Junction[iID][i-1]	= jID;
-	}
-}
-
-//---------------------------------------------------------
-bool CPit_Router::Get_Junction(int iID, int jID)
-{
-	int		i;
-
-	if(	iID == jID )
-	{
-		return( true );
-	}
-	else
-	{
-		if( iID > jID )
-		{
-			i	= iID;
-			iID	= jID;
-			jID	= i;
-		}
-
-		for(i=0; i<m_nJunctions[iID]; i++)
-		{
-			if( m_Junction[iID][i] == jID )
-			{
-				return( true );
-			}
-		}
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CPit_Router::Drain_Pit(int x, int y, int Pit_ID)
-{
-	int		i, ix, iy, iMin;
-
-	double	z, dz, dzMin;
-
-	do
-	{
-		iMin	= -1;
-
-		if( m_pFlats && m_pFlats->asInt(x,y) > 0 )
-		{
-			Drain_Flat(x,y);
-		}
-		else
-		{
-			z		= m_pDEM->asDouble(x,y);
-			dzMin	= 0;
-
-			for(i=0; i<8; i++)
-			{
-				ix	= Get_xTo(i,x);
-				iy	= Get_yTo(i,y);
-
-				if( m_pDEM->is_InGrid(ix,iy) && m_pPits->asInt(ix,iy) == Pit_ID && !m_pRoute->asChar(ix,iy) )
-				{
-					dz		= (z - m_pDEM->asDouble(ix,iy)) / Get_Length(i);
-
-					if( dzMin < dz )
-					{
-						iMin	= i;
-						dzMin	= dz;
-					}
-				}
-			}
-
-			if( iMin >= 0 )
-			{
-				x	+= Get_xTo(iMin);
-				y	+= Get_yTo(iMin);
-
-				i	= (iMin + 4) % 8;
-
-				m_pRoute->Set_Value(x,y, i > 0 ? i : 8 );
-			}
-		}
-	}
-	while( iMin >= 0 );
-}
-
-//---------------------------------------------------------
-void CPit_Router::Drain_Flat(int x, int y)
-{
-	bool		bContinue;
-
-	int			i, ix, iy, j,
-				n, nPlus,
-				Flat_ID;
-
-	TGEO_iRect	*pFlat;
-
-	//-----------------------------------------------------
-	Flat_ID	= m_pFlats->asInt(x,y);
-
-	if( Flat_ID > 0 )
-	{
-		pFlat	= m_Flat + Flat_ID - 1;
-
-		nPlus	= -1;
-
-		m_pFlats->Set_Value(x,y, nPlus );
-
-		//-------------------------------------------------
-		do
-		{
-			bContinue	= false;
-			n			= nPlus--;
-
-			for(y=pFlat->yMin; y<=pFlat->yMax; y++)
-			{
-				for(x=pFlat->xMin; x<=pFlat->xMax; x++)
-				{
-					if( m_pFlats->asInt(x,y) == n )
-					{
-						for(i=0; i<8; i++)
-						{
-							ix	= Get_xTo(i,x);
-							iy	= Get_yTo(i,y);
-
-							if(	m_pDEM->is_InGrid(ix, iy) && Flat_ID == m_pFlats->asInt(ix, iy) )
-							{
-								bContinue	= true;
-
-								j			= (i + 4) % 8;
-
-								m_pRoute->Set_Value(ix,iy, j ? j : 8 );
-								m_pFlats->Set_Value(ix,iy, nPlus );
-							}
-						}
-					}
-				}
-			}
-		}
-		while( bContinue );
-
-		//-------------------------------------------------
-		for(y=pFlat->yMin; y<=pFlat->yMax; y++)
-		{
-			for(x=pFlat->xMin; x<=pFlat->xMax; x++)
-			{
-				if( m_pFlats->asInt(x,y) < 0 )
-				{
-					m_pFlats->Set_Value(x,y, 0 );
-				}
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CPit_Router::Mark_Flat(int x, int y, TGEO_iRect *pFlat, int Flat_ID, int Pit_ID)
-{
-	bool	goStackDown;
-
-	int		i, ix, iy,
-			iStart, iStack, nStack,
-			*xMem, *yMem, *iMem;
-
-	double	z;
-
-	//-----------------------------------------------------
-	if( !m_pFlats )
-	{
-		m_pFlats		= SG_Create_Grid(m_pDEM, SG_DATATYPE_Int);
-		//m_pFlats->Set_Cache(false);
-	}
-
-	z			= m_pDEM->asDouble(x,y);
-
-	xMem		= NULL;
-	yMem		= NULL;
-	iMem		= NULL;
-
-	iStart		= 0;
-	iStack		= 0;
-	nStack		= 0;
-
-	pFlat->xMin	= pFlat->xMax	= x;
-	pFlat->yMin	= pFlat->yMax	= y;
-
-	m_pPits->Set_Value(	x, y, Pit_ID );
-	m_pFlats->Set_Value(	x, y, Flat_ID );
-
-
-	//-----------------------------------------------------
-	do
-	{
-		goStackDown	= true;
-
-		for(i=iStart; i<8 && goStackDown; i++)
-		{
-			ix	= Get_xTo(i,x);
-			iy	= Get_yTo(i,y);
-
-			if(	m_pDEM->is_InGrid(ix, iy) && !m_pPits->asInt(ix, iy) && IS_Flat(z, m_pDEM->asDouble(ix, iy)) )
-			{
-				goStackDown		= false;
-				m_pPits->Set_Value(	ix, iy, Pit_ID );
-				m_pFlats->Set_Value(	ix, iy, Flat_ID );
-			}
-		}
-
-		//-------------------------------------------------
-		if( goStackDown )
-		{
-			iStack--;
-
-			if( iStack >= 0 )
-			{
-				x		= xMem[iStack];
-				y		= yMem[iStack];
-				iStart	= iMem[iStack];
-			}
-		}
-		else
-		{
-			if( nStack <= iStack )
-			{
-				nStack	= iStack + 32;
-				xMem	= (int  *)SG_Realloc(xMem, nStack * sizeof(int ));
-				yMem	= (int  *)SG_Realloc(yMem, nStack * sizeof(int ));
-				iMem	= (int  *)SG_Realloc(iMem, nStack * sizeof(int ));
-			}
-
-			xMem[iStack]	= x;
-			yMem[iStack]	= y;
-			iMem[iStack]	= i + 1;
-
-			x				= ix;
-			y				= iy;
-			iStart			= 0;
-
-			if( x < pFlat->xMin )
-				pFlat->xMin	= x;
-			else if( x > pFlat->xMax )
-				pFlat->xMax	= x;
-
-			if( y < pFlat->yMin )
-				pFlat->yMin	= y;
-			else if( y > pFlat->yMax )
-				pFlat->yMax	= y;
-
-			iStack++;
-		}
-	}
-	while( iStack >= 0 );
-
-	//-----------------------------------------------------
-	if( nStack > 0 )
-	{
-		SG_Free(xMem);
-		SG_Free(yMem);
-		SG_Free(iMem);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-int CPit_Router::Process_Threshold(void)
-{
-	int		x, y, n;
-	long	i;
-
-	m_Route.Create(*Get_System(), SG_DATATYPE_Char);
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( m_pDEM->is_NoData(x, y) )
-			{
-				m_Route.Set_Value(x, y, -1);
-			}
-			else if( (i = m_pRoute->asInt(x, y)) > 0 )
-			{
-				m_Route.Set_Value(x, y, i % 8);
-			}
-			else
-			{
-				m_Route.Set_Value(x, y, m_pDEM->Get_Gradient_NeighborDir(x, y));
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Lock_Create();
-
-	for(i=0, n=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
-	{
-		if( m_pDEM->Get_Sorted(i, x, y, false) && m_pPits->asInt(x, y) )
-		{
-			m_zThr	= m_pDEM->asDouble(x, y) + m_Threshold;
-			m_zMax	= m_pDEM->asDouble(x, y);
-
-			Check_Threshold(x, y);
-
-			if( m_zMax > m_zThr )
-				n++;
-		}
-	}
-
-	Lock_Destroy();
-
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			i	= m_Route.asInt(x, y);
-
-			if( i < 0 || i == m_pDEM->Get_Gradient_NeighborDir(x, y) )
-			{
-				m_pRoute->Set_Value(x, y, 0);
-			}
-			else
-			{
-				m_pRoute->Set_Value(x, y, i == 0 ? 8 : i);
-			}
-		}
-	}
-
-	//-----------------------------------------------------
-	Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of pits above threshold level"), n));
-
-	m_Route.Destroy();
-
-	return( n );
-}
-
-//---------------------------------------------------------
-void CPit_Router::Check_Threshold(int x, int y)
-{
-	if( Lock_Get(x, y) )
-		return;
-
-	Lock_Set(x, y);
-
-	if( m_pDEM->asDouble(x, y) > m_zMax )
-	{
-		m_zMax	= m_pDEM->asDouble(x, y);
-	}
-
-	int		i	= m_Route.asInt(x, y);
-	int		ix	= Get_xTo(i, x);
-	int		iy	= Get_yTo(i, y);
-
-	if( m_pDEM->is_InGrid(ix, iy) )
-	{
-		if( m_pDEM->asDouble(x, y) < m_pDEM->asDouble(ix, iy) || m_zMax < m_zThr )
-		{
-			Check_Threshold(ix, iy);
-		}
-	}
-
-	if( m_zMax > m_zThr )
-	{
-		m_Route.Set_Value(x, y, (i + 4) % 8);
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp b/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp
deleted file mode 100644
index 5d62a25..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/**********************************************************
- * Version $Id: Grid_ProfileFromPoints.cpp 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    ProfileFromPoints.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#include "Grid_ProfileFromPoints.h"
-
-CProfileFromPoints::CProfileFromPoints(void){
-
-	CSG_Parameter	*pNode_0, *pNode_1;
-
-	Parameters.Set_Name(_TL("Profile from points"));
-	Parameters.Set_Description(_TW("(c) 2004 by Victor Olaya. Creates a profile from coordinates stored in a table"));
-
-	Parameters.Add_Grid(NULL, 
-						"GRID",
-						_TL("Grid"), 						
-						_TL(""), 
-						PARAMETER_INPUT);
-
-	pNode_0 = Parameters.Add_Table(NULL,
-								"TABLE", 
-								_TL("Input"),
-								_TL(""),	
-								PARAMETER_INPUT);
-	
-	pNode_1	= Parameters.Add_Table_Field(pNode_0,
-									"X",
-									_TL("X"),
-									_TL(""));
-
-	pNode_1	= Parameters.Add_Table_Field(pNode_0,
-									"Y",
-									_TL("Y"),
-									_TL(""));
-
-	Parameters.Add_Table(NULL, 
-						"RESULT", 
-						_TL("Result"), 
-						_TL(""), 
-						PARAMETER_OUTPUT);
-
-}//constructor
-
-
-CProfileFromPoints::~CProfileFromPoints(void)
-{}
-
-bool CProfileFromPoints::On_Execute(void){
-	
-	CSG_Table* pTable;	
-	CSG_Table* pProfileTable;
-	CSG_Table_Record* pRecord;
-	CSG_Grid* pGrid;	
-	int iXField, iYField;	
-	int i;
-	int x1,x2,y1,y2;
-	float fPartialDist;
-	float fDist = 0;
-
-
-	pGrid = Parameters("GRID")->asGrid();
-	pTable = Parameters("TABLE")->asTable();
-	pProfileTable = Parameters("RESULT")->asTable();
-	iXField = Parameters("X")->asInt();
-	iYField = Parameters("Y")->asInt();	
-	
-	pProfileTable->Create((CSG_Table*)NULL);
-	pProfileTable->Set_Name(_TL("Profile"));
-	pProfileTable->Add_Field(_TL("Distance"), SG_DATATYPE_Double);
-	pProfileTable->Add_Field("Z", SG_DATATYPE_Double);
-
-	for (i = 0; i < pTable->Get_Record_Count()-1; i++){
-		
-		x1=(int)(0.5 + (pTable->Get_Record(i  )->asDouble(iXField) - pGrid->Get_XMin()) / pGrid->Get_Cellsize());
-		x2=(int)(0.5 + (pTable->Get_Record(i+1)->asDouble(iXField) - pGrid->Get_XMin()) / pGrid->Get_Cellsize());
-		y1=(int)(0.5 + (pTable->Get_Record(i  )->asDouble(iYField) - pGrid->Get_YMin()) / pGrid->Get_Cellsize());			
-		y2=(int)(0.5 + (pTable->Get_Record(i+1)->asDouble(iYField) - pGrid->Get_YMin()) / pGrid->Get_Cellsize());			
-
-        int x = x1, y = y1, D = 0, HX = x2 - x1, HY = y2 - y1,
-                c, M, xInc = 1, yInc = 1, iLastX = x1, iLastY = y1;
-
-        if (HX < 0) {
-            xInc = -1;
-            HX = -HX;
-        }//if
-        if (HY < 0) {
-            yInc = -1;
-            HY = -HY;
-        }//if
-        if (HY <= HX) {
-            c = 2 * HX;
-            M = 2 * HY;
-            for (;;) {                
-                fPartialDist = (float)(M_GET_LENGTH(x-iLastX, y-iLastY) * pGrid->Get_Cellsize());
-                if (pGrid->is_InGrid(x,y) && fPartialDist){
-					fDist+=fPartialDist;
-                	pRecord = pProfileTable->Add_Record();
-					pRecord->Set_Value(0, fDist);
-					pRecord->Set_Value(1, pGrid->asFloat(x,y));
-                }//if
-                iLastX = x;
-                iLastY = y;
-                if (x == x2) {
-                    break;
-                }// if
-                x += xInc;
-                D += M;
-                if (D > HX) {
-                    y += yInc;
-                    D -= c;
-                }// if
-            }// for
-        }// if
-        else {
-            c = 2 * HY;
-            M = 2 * HX;
-            for (;;) {
-                fPartialDist = (float)(M_GET_LENGTH(x-iLastX, y-iLastY) * pGrid->Get_Cellsize());
-                if (pGrid->is_InGrid(x,y) && fPartialDist){
-					fDist+=fPartialDist;
-                	pRecord = pProfileTable->Add_Record();
-					pRecord->Set_Value(0, fDist);
-					pRecord->Set_Value(1, pGrid->asFloat(x,y));
-                }//if
-                iLastX = x;
-                iLastY = y;
-                if (y == y2) {
-                    break;
-                }// if
-                y += yInc;
-                D += M;
-                if (D > HY) {
-                    x += xInc;
-                    D -= c;
-                }// if
-            }// for
-        }// else        
-     
-	}//for
-
-	return true;
-
-}// method
-
-
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h b/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h
deleted file mode 100644
index 8fbadb3..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/**********************************************************
- * Version $Id: Grid_ProfileFromPoints.h 911 2011-02-14 16:38:15Z reklov_w $
- *********************************************************/
-/*******************************************************************************
-    ProfileFromPoints.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
-    (at your option) any later version.
-
-    This program 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
-*******************************************************************************/ 
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "MLB_Interface.h"
-
-class CProfileFromPoints : public CSG_Module_Grid {
-
-public:
-	CProfileFromPoints(void);
-	virtual ~CProfileFromPoints(void);
-
-protected:
-	virtual bool On_Execute(void);
-
-};
diff --git a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.in b/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.in
deleted file mode 100644
index a7fa0ef..0000000
--- a/src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.in
+++ /dev/null
@@ -1,595 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src/modules_terrain_analysis/terrain_analysis/ta_profiles
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
-	$(top_srcdir)/m4/ax_pkg_swig.m4 \
-	$(top_srcdir)/m4/ax_python_devel.m4 \
-	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
-	$(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libta_profiles_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libta_profiles_la_OBJECTS = Grid_Cross_Profiles.lo \
-	Grid_Flow_Profile.lo Grid_Profile.lo Grid_ProfileFromPoints.lo \
-	Grid_Profile_From_Lines.lo Grid_Swath_Profile.lo \
-	MLB_Interface.lo
-libta_profiles_la_OBJECTS = $(am_libta_profiles_la_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libta_profiles_la_SOURCES)
-DIST_SOURCES = $(libta_profiles_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@
-AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISABLELIBHARU = @DISABLELIBHARU@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GOMPFLAGS = @GOMPFLAGS@
-GREP = @GREP@
-HARU_LIB = @HARU_LIB@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LOCAL_INCS = @LOCAL_INCS@
-LOCAL_LIBS = @LOCAL_LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PG_CONFIG = @PG_CONFIG@
-POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
-POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
-POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
-POW_LIB = @POW_LIB@
-PYTHON = @PYTHON@
-PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
-PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
-PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-SWIG = @SWIG@
-SWIG_LIB = @SWIG_LIB@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-#
-# $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $
-#
- at DEBUG_TRUE@DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_TRUE@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) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version
-pkglib_LTLIBRARIES = libta_profiles.la
-libta_profiles_la_SOURCES = \
-Grid_Cross_Profiles.cpp\
-Grid_Flow_Profile.cpp\
-Grid_Profile.cpp\
-Grid_ProfileFromPoints.cpp\
-Grid_Profile_From_Lines.cpp\
-Grid_Swath_Profile.cpp\
-MLB_Interface.cpp\
-Grid_Cross_Profiles.h\
-Grid_Flow_Profile.h\
-Grid_Profile.h\
-Grid_ProfileFromPoints.h\
-Grid_Profile_From_Lines.h\
-Grid_Swath_Profile.h\
-MLB_Interface.h
-
-libta_profiles_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libta_profiles.la: $(libta_profiles_la_OBJECTS) $(libta_profiles_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(pkglibdir) $(libta_profiles_la_OBJECTS) $(libta_profiles_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Cross_Profiles.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Flow_Profile.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Profile.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_ProfileFromPoints.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Profile_From_Lines.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Swath_Profile.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/saga_core/Makefile.in b/src/saga_core/Makefile.in
index 75359b6..5e4fa47 100644
--- a/src/saga_core/Makefile.in
+++ b/src/saga_core/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +75,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -114,6 +135,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -141,6 +163,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -153,6 +176,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -182,6 +206,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -215,7 +240,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -280,11 +304,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -348,6 +372,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -411,6 +439,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -446,13 +488,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -487,10 +526,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -568,22 +612,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/saga_core/saga_api/Makefile.am b/src/saga_core/saga_api/Makefile.am
index dcec95b..8df2f15 100644
--- a/src/saga_core/saga_api/Makefile.am
+++ b/src/saga_core/saga_api/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1648 2013-04-11 08:55:01Z oconrad $
+# $Id: Makefile.am 2034 2014-03-03 15:35:14Z manfred-e $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -18,6 +18,27 @@ libsaga_api_la_LDFLAGS =$(AM_LDFLAGS) -release $(VERSION)
 
 lib_LTLIBRARIES = libsaga_api.la
 
+otherincludedir = $(pkgincludedir)/saga_core/saga_api
+otherinclude_HEADERS = api_core.h \
+compatibility.h \
+data_manager.h \
+dataobject.h \
+geo_tools.h \
+grid.h \
+grid_pyramid.h \
+mat_tools.h \
+metadata.h \
+module.h \
+module_library.h \
+parameters.h \
+pointcloud.h \
+saga_api.h \
+shapes.h \
+table_dbase.h \
+table.h \
+table_value.h \
+tin.h
+
 libsaga_api_la_SOURCES =\
 api_callback.cpp\
 api_colors.cpp\
diff --git a/src/saga_core/saga_api/Makefile.in b/src/saga_core/saga_api/Makefile.in
index 7f72549..8fc0335 100644
--- a/src/saga_core/saga_api/Makefile.in
+++ b/src/saga_core/saga_api/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,7 +14,25 @@
 
 @SET_MAKE@
 
+
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core/saga_api
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(otherinclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/py-compile
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,8 +91,14 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pyexecdir)" \
-	"$(DESTDIR)$(pyexecdir)"
+	"$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(otherincludedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES) $(pyexec_LTLIBRARIES)
 @SAGA_PYTHON_TRUE at _saga_api_la_DEPENDENCIES = libsaga_api.la
 @SAGA_PYTHON_TRUE at nodist__saga_api_la_OBJECTS =  \
@@ -130,7 +155,14 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(nodist__saga_api_la_SOURCES) $(libsaga_api_la_SOURCES)
 DIST_SOURCES = $(libsaga_api_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
 py_compile = $(top_srcdir)/py-compile
+HEADERS = $(otherinclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -156,6 +188,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -183,6 +216,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -195,6 +229,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -224,6 +259,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -257,7 +293,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -279,7 +314,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1648 2013-04-11 08:55:01Z oconrad $
+# $Id: Makefile.am 2034 2014-03-03 15:35:14Z manfred-e $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_PYTHON_TRUE at SAGAPYTHONFLAGS = -D_SAGA_PYTHON
@@ -289,6 +324,27 @@ top_srcdir = @top_srcdir@
 @SAGA_UNICODE_TRUE at AM_LDFLAGS = -fPIC -shared -Wall `wx-config --unicode=yes --libs` $(HARU_LIB) $(SAGAPYTHONFLAGS)
 libsaga_api_la_LDFLAGS = $(AM_LDFLAGS) -release $(VERSION)
 lib_LTLIBRARIES = libsaga_api.la
+otherincludedir = $(pkgincludedir)/saga_core/saga_api
+otherinclude_HEADERS = api_core.h \
+compatibility.h \
+data_manager.h \
+dataobject.h \
+geo_tools.h \
+grid.h \
+grid_pyramid.h \
+mat_tools.h \
+metadata.h \
+module.h \
+module_library.h \
+parameters.h \
+pointcloud.h \
+saga_api.h \
+shapes.h \
+table_dbase.h \
+table.h \
+table_value.h \
+tin.h
+
 libsaga_api_la_SOURCES = \
 api_callback.cpp\
 api_colors.cpp\
@@ -416,7 +472,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -424,6 +479,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
 	}
@@ -439,15 +496,16 @@ uninstall-libLTLIBRARIES:
 
 clean-libLTLIBRARIES:
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
 install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(pyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pyexecdir)"
 	@list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -455,6 +513,8 @@ install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \
 	}
@@ -470,15 +530,17 @@ uninstall-pyexecLTLIBRARIES:
 
 clean-pyexecLTLIBRARIES:
 	-test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES)
-	@list='$(pyexec_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-_saga_api.la: $(_saga_api_la_OBJECTS) $(_saga_api_la_DEPENDENCIES) 
+	@list='$(pyexec_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+_saga_api.la: $(_saga_api_la_OBJECTS) $(_saga_api_la_DEPENDENCIES) $(EXTRA__saga_api_la_DEPENDENCIES) 
 	$(_saga_api_la_LINK) $(am__saga_api_la_rpath) $(_saga_api_la_OBJECTS) $(_saga_api_la_LIBADD) $(LIBS)
-libsaga_api.la: $(libsaga_api_la_OBJECTS) $(libsaga_api_la_DEPENDENCIES) 
+libsaga_api.la: $(libsaga_api_la_OBJECTS) $(libsaga_api_la_DEPENDENCIES) $(EXTRA_libsaga_api_la_DEPENDENCIES) 
 	$(libsaga_api_la_LINK) -rpath $(libdir) $(libsaga_api_la_OBJECTS) $(libsaga_api_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -607,8 +669,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-nodist_pyexecPYTHON: $(nodist_pyexec_PYTHON)
 	@$(NORMAL_INSTALL)
-	test -z "$(pyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pyexecdir)"
 	@list='$(nodist_pyexec_PYTHON)'; dlist=; list2=; test -n "$(pyexecdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
 	  if test -f $$b$$p; then \
@@ -623,11 +688,8 @@ install-nodist_pyexecPYTHON: $(nodist_pyexec_PYTHON)
 	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pyexecdir)" || exit $$?; \
 	done || exit $$?; \
 	if test -n "$$dlist"; then \
-	  if test -z "$(DESTDIR)"; then \
-	    PYTHON=$(PYTHON) $(py_compile) --basedir "$(pyexecdir)" $$dlist; \
-	  else \
-	    PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pyexecdir)" $$dlist; \
-	  fi; \
+	  $(am__py_compile) --destdir "$(DESTDIR)" \
+	                    --basedir "$(pyexecdir)" $$dlist; \
 	else :; fi
 
 uninstall-nodist_pyexecPYTHON:
@@ -635,14 +697,35 @@ uninstall-nodist_pyexecPYTHON:
 	@list='$(nodist_pyexec_PYTHON)'; test -n "$(pyexecdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	test -n "$$files" || exit 0; \
+	dir='$(DESTDIR)$(pyexecdir)'; \
 	filesc=`echo "$$files" | sed 's|$$|c|'`; \
 	fileso=`echo "$$files" | sed 's|$$|o|'`; \
-	echo " ( cd '$(DESTDIR)$(pyexecdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pyexecdir)" && rm -f $$files || exit $$?; \
-	echo " ( cd '$(DESTDIR)$(pyexecdir)' && rm -f" $$filesc ")"; \
-	cd "$(DESTDIR)$(pyexecdir)" && rm -f $$filesc || exit $$?; \
-	echo " ( cd '$(DESTDIR)$(pyexecdir)' && rm -f" $$fileso ")"; \
-	cd "$(DESTDIR)$(pyexecdir)" && rm -f $$fileso
+	st=0; \
+	for files in "$$files" "$$filesc" "$$fileso"; do \
+	  $(am__uninstall_files_from_dir) || st=$$?; \
+	done; \
+	exit $$st
+install-otherincludeHEADERS: $(otherinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(otherinclude_HEADERS)'; test -n "$(otherincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(otherincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(otherincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(otherincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(otherincludedir)" || exit $$?; \
+	done
+
+uninstall-otherincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(otherinclude_HEADERS)'; test -n "$(otherincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(otherincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -693,6 +776,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -728,9 +825,9 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pyexecdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(otherincludedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -743,10 +840,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -782,7 +884,7 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-otherincludeHEADERS
 
 install-dvi: install-dvi-am
 
@@ -831,26 +933,27 @@ ps: ps-am
 ps-am:
 
 uninstall-am: uninstall-libLTLIBRARIES uninstall-nodist_pyexecPYTHON \
-	uninstall-pyexecLTLIBRARIES
+	uninstall-otherincludeHEADERS uninstall-pyexecLTLIBRARIES
 
 .MAKE: install-am install-exec-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 	clean-libLTLIBRARIES clean-libtool clean-pyexecLTLIBRARIES \
-	ctags distclean distclean-compile distclean-generic \
+	cscopelist ctags distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
 	install-data-am install-dvi install-dvi-am install-exec \
 	install-exec-am install-exec-hook install-html install-html-am \
 	install-info install-info-am install-libLTLIBRARIES \
-	install-man install-nodist_pyexecPYTHON install-pdf \
-	install-pdf-am install-ps install-ps-am \
-	install-pyexecLTLIBRARIES install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-libLTLIBRARIES \
-	uninstall-nodist_pyexecPYTHON uninstall-pyexecLTLIBRARIES
+	install-man install-nodist_pyexecPYTHON \
+	install-otherincludeHEADERS install-pdf install-pdf-am \
+	install-ps install-ps-am install-pyexecLTLIBRARIES \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-libLTLIBRARIES uninstall-nodist_pyexecPYTHON \
+	uninstall-otherincludeHEADERS uninstall-pyexecLTLIBRARIES
 
 
 install-exec-hook:
diff --git a/src/saga_core/saga_api/api_core.h b/src/saga_core/saga_api/api_core.h
index d242ed8..705809d 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: api_core.h 2112 2014-05-07 09:59:40Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -116,33 +116,31 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-// this is defined by configure, but will not be on a normal
-// application build
-//
+// 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
+		#define SIZEOF_LONG		8
 	#else
-		#define SIZEOF_LONG        4
+		#define SIZEOF_LONG		4
 	#endif
 #endif
 
 //---------------------------------------------------------
 #ifdef _TYPEDEF_BOOL
-	typedef unsigned int	bool;
-	#define true			((bool)1)
-	#define false			((bool)0)
+	typedef unsigned int		bool;
+	#define true				((bool)1)
+	#define false				((bool)0)
 #endif	// _TYPEDEF_BOOL
 
 //---------------------------------------------------------
 #ifdef _TYPEDEF_BYTE
-	typedef unsigned char	BYTE;
+	typedef unsigned char		BYTE;
 #endif	// _TYPEDEF_BYTE
 
 //---------------------------------------------------------
 #ifdef _TYPEDEF_WORD
-	typedef unsigned short	WORD;
-	#if (SIZEOF_LONG == 4)
+	typedef unsigned short		WORD;
+	#if SIZEOF_LONG == 4
 		typedef unsigned long	DWORD;
 	#else
 		typedef unsigned int	DWORD;
@@ -150,13 +148,22 @@
 #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)
 	#include <float.h>
-	#define SG_is_NaN	_isnan
+	#define SG_is_NaN			_isnan
 #elif defined(isnan)
-	#define SG_is_NaN	isnan
+	#define SG_is_NaN			isnan
 #else
-	#define SG_is_NaN(x)	(x != x)
+	#define SG_is_NaN(x)		(x != x)
 #endif
 
 
@@ -831,8 +838,8 @@ inline size_t	SG_Data_Type_Get_Size	(TSG_Data_Type Type)
 	case SG_DATATYPE_Short:		return( sizeof(short int) );
 	case SG_DATATYPE_DWord:		return( sizeof(unsigned int) );
 	case SG_DATATYPE_Int:		return( sizeof(int) );
-	case SG_DATATYPE_ULong:		return( sizeof(unsigned long) );
-	case SG_DATATYPE_Long:		return( sizeof(long) );
+	case SG_DATATYPE_ULong:		return( sizeof(uLong) );
+	case SG_DATATYPE_Long:		return( sizeof(sLong) );
 	case SG_DATATYPE_Float:		return( sizeof(float) );
 	case SG_DATATYPE_Double:	return( sizeof(double) );
 	case SG_DATATYPE_String:	return( 0 );
@@ -956,6 +963,7 @@ SAGA_API_DLL_EXPORT CSG_String		SG_File_Get_TmpName			(const SG_Char *Prefix, co
 SAGA_API_DLL_EXPORT CSG_String		SG_File_Get_Name			(const SG_Char *full_Path, bool bExtension);
 SAGA_API_DLL_EXPORT CSG_String		SG_File_Get_Path			(const SG_Char *full_Path);
 SAGA_API_DLL_EXPORT CSG_String		SG_File_Get_Path_Absolute	(const SG_Char *full_Path);
+SAGA_API_DLL_EXPORT CSG_String		SG_File_Get_Path_Relative	(const SG_Char *Directory, const SG_Char *full_Path);
 SAGA_API_DLL_EXPORT CSG_String		SG_File_Make_Path			(const SG_Char *Directory, const SG_Char *Name, const SG_Char *Extension = NULL);
 SAGA_API_DLL_EXPORT bool			SG_File_Cmp_Extension		(const SG_Char *File_Name, const SG_Char *Extension);
 SAGA_API_DLL_EXPORT CSG_String		SG_File_Get_Extension		(const SG_Char *File_Name);
@@ -1111,11 +1119,26 @@ public:
 	bool							Set_Blue			(int Index, int Value);
 	bool							Set_Brightness		(int Index, int Value);
 
-	long							Get_Color			(int Index) const	{	return( Index >= 0 && Index < m_nColors ? m_Colors[Index] : 0 );	}
-	long							Get_Red				(int Index) const	{	return( SG_GET_R(Get_Color(Index)) );	}
-	long							Get_Green			(int Index) const	{	return( SG_GET_G(Get_Color(Index)) );	}
-	long							Get_Blue			(int Index) const	{	return( SG_GET_B(Get_Color(Index)) );	}
-	long							Get_Brightness		(int Index) const	{	return( (Get_Red(Index) + Get_Green(Index) + Get_Blue(Index)) / 3 );	}
+	long							Get_Color			(int Index)	const	{	return( m_nColors > 0 ? m_Colors[Index < 0 ? 0 : Index >= m_nColors ? m_nColors - 1 : Index] : 0 );	}
+	long							Get_Red				(int Index)	const	{	return( SG_GET_R(Get_Color(Index)) );	}
+	long							Get_Green			(int Index)	const	{	return( SG_GET_G(Get_Color(Index)) );	}
+	long							Get_Blue			(int Index)	const	{	return( SG_GET_B(Get_Color(Index)) );	}
+	long							Get_Brightness		(int Index)	const	{	return( (Get_Red(Index) + Get_Green(Index) + Get_Blue(Index)) / 3 );	}
+
+	long							Get_Interpolated	(double Index)	const
+	{
+		if( m_nColors <= 0             )	return( 0 );
+		if( Index     <= 0             )	return( m_Colors[0] );
+		if( Index     >= m_nColors - 1 )	return( m_Colors[m_nColors - 1] );
+
+		int	i	= (int)Index;	Index	-= i;
+
+		return( SG_GET_RGB(
+			SG_GET_R(m_Colors[i]) + Index * (SG_GET_R(m_Colors[i + 1]) - SG_GET_R(m_Colors[i])),
+			SG_GET_G(m_Colors[i]) + Index * (SG_GET_G(m_Colors[i + 1]) - SG_GET_G(m_Colors[i])),
+			SG_GET_B(m_Colors[i]) + Index * (SG_GET_B(m_Colors[i + 1]) - SG_GET_B(m_Colors[i])))
+		);
+	}
 
 	bool							Set_Default			(int nColors = 11);
 	bool							Set_Palette			(int Index, bool bRevert = false, int nColors = 11);
@@ -1219,6 +1242,9 @@ SAGA_API_DLL_EXPORT const SG_Char *		SG_Translate		(const CSG_String &Text);
 #define _TL(s)	SG_Translate(L ## s)
 #define _TW(s)	SG_Translate(CSG_String(s))
 
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT bool SG_Set_OldStyle_Naming(void);
+
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_api/api_file.cpp b/src/saga_core/saga_api/api_file.cpp
index c4675e6..7b24054 100644
--- a/src/saga_core/saga_api/api_file.cpp
+++ b/src/saga_core/saga_api/api_file.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_file.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: api_file.cpp 1975 2014-02-09 14:59:42Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -517,6 +517,16 @@ CSG_String		SG_File_Get_Path_Absolute	(const SG_Char *full_Path)
 }
 
 //---------------------------------------------------------
+CSG_String		SG_File_Get_Path_Relative	(const SG_Char *Directory, const SG_Char *full_Path)
+{
+	wxFileName	fn(full_Path);
+
+	fn.MakeRelativeTo(Directory);
+
+	return( CSG_String(fn.GetFullPath().wc_str()) );
+}
+
+//---------------------------------------------------------
 CSG_String		SG_File_Make_Path(const SG_Char *Directory, const SG_Char *Name, const SG_Char *Extension)
 {
 	wxFileName	fn;
diff --git a/src/saga_core/saga_api/api_string.cpp b/src/saga_core/saga_api/api_string.cpp
index 4aaa3f7..89299fe 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: api_string.cpp 1967 2014-02-05 10:15:53Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -955,7 +955,7 @@ CSG_String		SG_Double_To_Degree(double Value)
 	Value	= 60.0 * (Value - h);
 	s		= Value;
 
-	String.Printf(SG_T("%c%03d\xb0%02d'%02f''"), c, d, h, s);
+	String.Printf(SG_T("%c%03d\xb0%02d'%02.*f''"), c, d, h, SG_Get_Significant_Decimals(s), s);
 
 	return( String );
 }
@@ -1101,10 +1101,25 @@ CSG_String		SG_Get_String(double Value, int Precision, bool bScientific)
 	}
 	else // if( Precision == -2 )
 	{
+		Precision	= SG_Get_Significant_Decimals(Value, abs(Precision));
+
 		s.Printf(SG_T("%.*f"), SG_Get_Significant_Decimals(Value, abs(Precision)), Value);
+
+		if( Precision > 0 )
+		{
+			while( s.Length() > 1 && s[s.Length() - 1] == '0' )
+			{
+				s	= s.Left(s.Length() - 1);
+			}
+
+			if( s.Length() > 1 && (s[s.Length() - 1] == '.' || s[s.Length() - 1] == ',') )
+			{
+				s	= s.Left(s.Length() - 1);
+			}
+		}
 	}
 
-	s.Replace(SG_T(","), SG_T("."));
+	s.Replace(",", ".");
 
 	return( s );
 }
diff --git a/src/saga_core/saga_api/api_translator.cpp b/src/saga_core/saga_api/api_translator.cpp
index 750edba..57dceab 100644
--- a/src/saga_core/saga_api/api_translator.cpp
+++ b/src/saga_core/saga_api/api_translator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_translator.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: api_translator.cpp 2005 2014-02-20 13:49:51Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -376,3 +376,75 @@ bool CSG_Translator::Get_Translation(const SG_Char *Text, CSG_String &Translatio
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+bool SG_Set_OldStyle_Naming(void)
+{
+	//-----------------------------------------------------
+	if( SG_Get_Translator().Get_Count() > 0 )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	const char	translation[][2][256]	=
+	{
+		{	"Geoprocessing",	"Modules"	},
+		{	"Available Tools",	"Available Modules"	},
+		{	"Can't execute a tool while another runs",		"Can't execute a module while another runs"	},
+		{	"Create Tool Description Files",		"Create Module Description Files"	},
+		{	"Execute Tool",		"Execute Module"	},
+		{	"Executing tool",		"Executing module"	},
+		{	"Find and Run Tool",		"Find and Run Module"	},
+		{	"Interactive tool execution failed",		"Interactive module execution failed"	},
+		{	"Interactive tool execution has been started",		"Interactive module execution has been started"	},
+		{	"Interactive tool execution has been stopped",		"Interactive module execution has been stopped"	},
+		{	"Load Tool Library",		"Load Module Library"	},
+		{	"Please stop tool execution before exiting SAGA.",		"Please stop module execution before exiting SAGA."	},
+		{	"Run Tool",		"Run Module"	},
+		{	"SAGA Tool Libraries",		"SAGA Module Libraries"	},
+		{	"Tool",		"Module"	},
+		{	"Tool Description Source",		"Module Description Source"	},
+		{	"Tool Execution",		"Module Execution"	},
+		{	"Tool Libraries",		"Module Libraries"	},
+		{	"Tool Library",		"Module Library"	},
+		{	"Tool Manager",		"Module Manager"	},
+		{	"Tool execution failed",		"Module execution failed"	},
+		{	"Tool execution succeeded",		"Module execution succeeded"	},
+		{	"Tools",		"Modules"	},
+		{	"cannot execute interactive tool",		"cannot execute interactive module"	},
+		{	"could not execute tool",		"could not execute module"	},
+		{	"could not find tool",		"could not find module"	},
+		{	"could not initialize tool",		"could not initialize module"	},
+		{	"creating tool documentation files",		"creating module documentation files"	},
+		{	"executing tool",		"executing module"	},
+		{	"loaded tool libraries",		"loaded module libraries"	},
+		{	"tool",		"module"	},
+		{	"tool name   ",		"module name   "	},
+		{	"tools",	"modules"	},
+		{	"",	""	}
+	};
+
+	//-----------------------------------------------------
+	CSG_Table	t;
+
+	t.Add_Field("NEW", SG_DATATYPE_String);
+	t.Add_Field("OLD", SG_DATATYPE_String);
+
+	for(int i=0; *translation[i][0]; i++)
+	{
+		CSG_Table_Record	*pR	= t.Add_Record();
+
+		pR->Set_Value(0, translation[i][0]);
+		pR->Set_Value(1, translation[i][1]);
+	}
+
+	return( SG_Get_Translator().Create(&t) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_api/clipper.cpp b/src/saga_core/saga_api/clipper.cpp
index 393b479..76522ac 100644
--- a/src/saga_core/saga_api/clipper.cpp
+++ b/src/saga_core/saga_api/clipper.cpp
@@ -1,10 +1,10 @@
 /*******************************************************************************
 *                                                                              *
 * Author    :  Angus Johnson                                                   *
-* Version   :  6.0.0                                                           *
-* Date      :  30 October 2013                                                 *
+* Version   :  6.1.3a                                                          *
+* Date      :  22 January 2014                                                 *
 * Website   :  http://www.angusj.com                                           *
-* Copyright :  Angus Johnson 2010-2013                                         *
+* Copyright :  Angus Johnson 2010-2014                                         *
 *                                                                              *
 * License:                                                                     *
 * Use, modification & distribution is subject to Boost Software License Ver 1. *
@@ -60,6 +60,9 @@ namespace ClipperLib {
 #endif
 
 static double const pi = 3.141592653589793238;
+static double const two_pi = pi *2;
+static double const def_arc_tolerance = 0.25;
+
 enum Direction { dRightToLeft, dLeftToRight };
 
 static int const Unassigned = -1;  //edge not currently 'owning' a solution
@@ -94,7 +97,6 @@ struct IntersectNode {
   TEdge          *Edge1;
   TEdge          *Edge2;
   IntPoint        Pt;
-  IntersectNode  *Next;
 };
 
 struct LocalMinima {
@@ -168,7 +170,7 @@ PolyNode* PolyTree::GetFirst() const
 
 int PolyTree::Total() const
 {
-  return AllNodes.size();
+  return (int)AllNodes.size();
 }
 
 //------------------------------------------------------------------------------
@@ -182,13 +184,13 @@ PolyNode::PolyNode(): Childs(), Parent(0), Index(0), m_IsOpen(false)
 
 int PolyNode::ChildCount() const
 {
-  return Childs.size();
+  return (int)Childs.size();
 }
 //------------------------------------------------------------------------------
 
 void PolyNode::AddChild(PolyNode& child)
 {
-  unsigned cnt = Childs.size();
+  unsigned cnt = (unsigned)Childs.size();
   Childs.push_back(&child);
   child.Parent = this;
   child.Index = cnt;
@@ -390,7 +392,7 @@ class Int128
           return result;
       }
       else if (rhs.hi == this->hi && rhs.lo == this->lo)
-          return Int128(1);
+          return Int128(negate ? -1: 1);
       else
           return Int128(0);
     }
@@ -400,8 +402,9 @@ class Int128
       const double shift64 = 18446744073709551616.0; //2^64
       if (hi < 0)
       {
-        if (lo == 0) return (double)hi * shift64;
-        else return -(double)(~lo + ~hi * shift64);
+        cUInt lo_ = ~lo + 1;
+        if (lo_ == 0) return (double)hi * shift64;
+        else return -(double)(lo_ + ~hi * shift64);
       }
       else
         return (double)(lo + hi * shift64);
@@ -449,14 +452,16 @@ bool Orientation(const Path &poly)
 
 double Area(const Path &poly)
 {
-  int highI = (int)poly.size() -1;
-  if (highI < 2) return 0;
+  int size = (int)poly.size();
+  if (size < 3) return 0;
 
-  double a;
-  a = ((double)poly[highI].X + poly[0].X) * ((double)poly[0].Y - poly[highI].Y);
-  for (int i = 1; i <= highI; ++i)
-    a += ((double)poly[i - 1].X + poly[i].X) * ((double)poly[i].Y - poly[i - 1].Y);
-  return a / 2;
+  double a = 0;
+  for (int i = 0, j = size -1; i < size; ++i)
+  {
+    a += ((double)poly[j].X + poly[i].X) * ((double)poly[j].Y - poly[i].Y);
+    j = i;
+  }
+  return -a * 0.5;
 }
 //------------------------------------------------------------------------------
 
@@ -466,10 +471,10 @@ double Area(const OutRec &outRec)
   if (!op) return 0;
   double a = 0;
   do {
-    a = a + (double)(op->Pt.X + op->Prev->Pt.X) * (double)(op->Prev->Pt.Y - op->Pt.Y);
+    a +=  (double)(op->Prev->Pt.X + op->Pt.X) * (double)(op->Prev->Pt.Y - op->Pt.Y);
     op = op->Next;
   } while (op != outRec.Pts);
-  return a / 2;
+  return a * 0.5;
 }
 //------------------------------------------------------------------------------
 
@@ -486,72 +491,107 @@ bool PointIsVertex(const IntPoint &Pt, OutPt *pp)
 }
 //------------------------------------------------------------------------------
 
-bool PointOnLineSegment(const IntPoint Pt, 
-  const IntPoint linePt1, const IntPoint linePt2, bool UseFullInt64Range)
+int PointInPolygon (const IntPoint &pt, const Path &path)
 {
-#ifndef use_int32
-  if (UseFullInt64Range)
-    return ((Pt.X == linePt1.X) && (Pt.Y == linePt1.Y)) ||
-      ((Pt.X == linePt2.X) && (Pt.Y == linePt2.Y)) ||
-      (((Pt.X > linePt1.X) == (Pt.X < linePt2.X)) &&
-      ((Pt.Y > linePt1.Y) == (Pt.Y < linePt2.Y)) &&
-      ((Int128Mul((Pt.X - linePt1.X), (linePt2.Y - linePt1.Y)) ==
-      Int128Mul((linePt2.X - linePt1.X), (Pt.Y - linePt1.Y)))));
-  else
-#endif
-    return ((Pt.X == linePt1.X) && (Pt.Y == linePt1.Y)) ||
-      ((Pt.X == linePt2.X) && (Pt.Y == linePt2.Y)) ||
-      (((Pt.X > linePt1.X) == (Pt.X < linePt2.X)) &&
-      ((Pt.Y > linePt1.Y) == (Pt.Y < linePt2.Y)) &&
-      ((Pt.X - linePt1.X) * (linePt2.Y - linePt1.Y) ==
-        (linePt2.X - linePt1.X) * (Pt.Y - linePt1.Y)));
+  //returns 0 if false, +1 if true, -1 if pt ON polygon boundary
+  //http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.5498&rep=rep1&type=pdf
+  int result = 0;
+  size_t cnt = path.size();
+  if (cnt < 3) return 0;
+  IntPoint ip = path[0];
+  for(size_t i = 1; i <= cnt; ++i)
+  {
+    IntPoint ipNext = (i == cnt ? path[0] : path[i]);
+    if (ipNext.Y == pt.Y)
+    {
+        if ((ipNext.X == pt.X) || (ip.Y == pt.Y && 
+          ((ipNext.X > pt.X) == (ip.X < pt.X)))) return -1;
+    }
+    if ((ip.Y < pt.Y) != (ipNext.Y < pt.Y))
+    {
+      if (ip.X >= pt.X)
+      {
+        if (ipNext.X > pt.X) result = 1 - result;
+        else
+        {
+          double d = (double)(ip.X - pt.X) * (ipNext.Y - pt.Y) - 
+            (double)(ipNext.X - pt.X) * (ip.Y - pt.Y);
+          if (!d) return -1;
+          if ((d > 0) == (ipNext.Y > ip.Y)) result = 1 - result;
+        }
+      } else
+      {
+        if (ipNext.X > pt.X)
+        {
+          double d = (double)(ip.X - pt.X) * (ipNext.Y - pt.Y) - 
+            (double)(ipNext.X - pt.X) * (ip.Y - pt.Y);
+          if (!d) return -1;
+          if ((d > 0) == (ipNext.Y > ip.Y)) result = 1 - result;
+        }
+      }
+    }
+    ip = ipNext;
+  } 
+  return result;
 }
 //------------------------------------------------------------------------------
 
-bool PointOnPolygon(const IntPoint Pt, OutPt *pp, bool UseFullInt64Range)
+int PointInPolygon (const IntPoint &pt, OutPt *op)
 {
-  OutPt *pp2 = pp;
-  while (true)
+  //returns 0 if false, +1 if true, -1 if pt ON polygon boundary
+  //http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.5498&rep=rep1&type=pdf
+  int result = 0;
+  OutPt* startOp = op;
+  for(;;)
   {
-    if (PointOnLineSegment(Pt, pp2->Pt, pp2->Next->Pt, UseFullInt64Range))
-      return true;
-    pp2 = pp2->Next;
-    if (pp2 == pp) break;
+    if (op->Next->Pt.Y == pt.Y)
+    {
+        if ((op->Next->Pt.X == pt.X) || (op->Pt.Y == pt.Y && 
+          ((op->Next->Pt.X > pt.X) == (op->Pt.X < pt.X)))) return -1;
+    }
+    if ((op->Pt.Y < pt.Y) != (op->Next->Pt.Y < pt.Y))
+    {
+      if (op->Pt.X >= pt.X)
+      {
+        if (op->Next->Pt.X > pt.X) result = 1 - result;
+        else
+        {
+          double d = (double)(op->Pt.X - pt.X) * (op->Next->Pt.Y - pt.Y) - 
+            (double)(op->Next->Pt.X - pt.X) * (op->Pt.Y - pt.Y);
+          if (!d) return -1;
+          if ((d > 0) == (op->Next->Pt.Y > op->Pt.Y)) result = 1 - result;
+        }
+      } else
+      {
+        if (op->Next->Pt.X > pt.X)
+        {
+          double d = (double)(op->Pt.X - pt.X) * (op->Next->Pt.Y - pt.Y) - 
+            (double)(op->Next->Pt.X - pt.X) * (op->Pt.Y - pt.Y);
+          if (!d) return -1;
+          if ((d > 0) == (op->Next->Pt.Y > op->Pt.Y)) result = 1 - result;
+        }
+      }
+    } 
+    op = op->Next;
+    if (startOp == op) break;
   } 
-  return false;
+  return result;
 }
 //------------------------------------------------------------------------------
 
-bool PointInPolygon(const IntPoint &Pt, OutPt *pp, bool UseFullInt64Range)
+bool Poly2ContainsPoly1(OutPt *OutPt1, OutPt *OutPt2)
 {
-  OutPt *pp2 = pp;
-  bool result = false;
-#ifndef use_int32
-  if (UseFullInt64Range) {
-    do
-    {
-      if (((pp2->Pt.Y > Pt.Y) != (pp2->Prev->Pt.Y > Pt.Y)) &&                     
-        (Int128(Pt.X - pp2->Pt.X) < 
-        Int128Mul(pp2->Prev->Pt.X - pp2->Pt.X, Pt.Y - pp2->Pt.Y) / 
-        Int128(pp2->Prev->Pt.Y - pp2->Pt.Y))) result = !result;
-      pp2 = pp2->Next;
-    }
-    while (pp2 != pp);
-    return result;
-  }
-#endif
+  OutPt* op = OutPt1;
   do
   {
-    //http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
-    if (((pp2->Pt.Y > Pt.Y) != (pp2->Prev->Pt.Y > Pt.Y)) &&                     
-      ((Pt.X - pp2->Pt.X) < (pp2->Prev->Pt.X - pp2->Pt.X) * (Pt.Y - pp2->Pt.Y) / 
-      (pp2->Prev->Pt.Y - pp2->Pt.Y))) result = !result;
-    pp2 = pp2->Next;
+    int res = PointInPolygon(op->Pt, OutPt2);
+    if (res >= 0) return res != 0;
+    op = op->Next; 
   }
-  while (pp2 != pp);
-  return result;
+  while (op != OutPt1);
+  return true; 
 }
-//------------------------------------------------------------------------------
+//----------------------------------------------------------------------
 
 bool SlopesEqual(const TEdge &e1, const TEdge &e2, bool UseFullInt64Range)
 {
@@ -645,8 +685,8 @@ bool IntersectPoint(TEdge &Edge1, TEdge &Edge2,
   //return false but for the edge.Dx value be equal due to double precision rounding.
   if (SlopesEqual(Edge1, Edge2, UseFullInt64Range) || Edge1.Dx == Edge2.Dx)
   {
-    if (Edge2.Bot.Y > Edge1.Bot.Y) ip.Y = Edge2.Bot.Y;
-    else ip.Y = Edge1.Bot.Y;
+    if (Edge2.Bot.Y > Edge1.Bot.Y) ip = Edge2.Bot;
+    else ip = Edge1.Bot;
     return false;
   }
   else if (Edge1.Delta.X == 0)
@@ -686,20 +726,15 @@ bool IntersectPoint(TEdge &Edge1, TEdge &Edge2,
   if (ip.Y < Edge1.Top.Y || ip.Y < Edge2.Top.Y) 
   {
     if (Edge1.Top.Y > Edge2.Top.Y)
-    {
       ip.Y = Edge1.Top.Y;
-      ip.X = TopX(Edge2, Edge1.Top.Y);
-      return ip.X < Edge1.Top.X;
-    } 
     else
-    {
       ip.Y = Edge2.Top.Y;
-      ip.X = TopX(Edge1, Edge2.Top.Y);
-      return ip.X > Edge2.Top.X;
-    }
+    if (std::fabs(Edge1.Dx) < std::fabs(Edge2.Dx))
+      ip.X = TopX(Edge1, ip.Y);
+    else
+      ip.X = TopX(Edge2, ip.Y);
   } 
-  else 
-    return true;
+  return true;
 }
 //------------------------------------------------------------------------------
 
@@ -767,129 +802,6 @@ TEdge* RemoveEdge(TEdge* e)
 }
 //------------------------------------------------------------------------------
 
-TEdge* GetLastHorz(TEdge* Edge)
-{
-  TEdge* result = Edge;
-  while (result->OutIdx != Skip && result->Next != Edge && IsHorizontal(*result->Next))
-    result = result->Next;
-  return result;
-}
-//------------------------------------------------------------------------------
-
-bool SharedVertWithPrevAtTop(TEdge* Edge)
-{
-  TEdge* E = Edge;
-  bool result = true;
-  while (E->Prev != Edge)
-  {
-    if (E->Top == E->Prev->Top)
-    {
-      if (E->Bot == E->Prev->Bot)
-      {E = E->Prev; continue;}
-      else result = true;
-    } 
-    else result = false;
-    break;
-  }
-  while (E != Edge) 
-  {
-    result = !result;
-    E = E->Next;
-  }
-  return result;
-}
-//------------------------------------------------------------------------------
-
-bool SharedVertWithNextIsBot(TEdge* Edge)
-{
-  bool result = true;
-  TEdge* E = Edge;
-  while (E->Prev != Edge)
-  {
-    bool A = (E->Next->Bot == E->Bot);
-    bool B = (E->Prev->Bot == E->Bot);
-    if (A != B) 
-    {
-      result = A;
-      break;
-    }
-    A = (E->Next->Top == E->Top);
-    B = (E->Prev->Top == E->Top);
-    if (A != B) 
-    {
-      result = B;
-      break;
-    }
-    E = E->Prev;
-  }
-  while (E != Edge)
-  {
-    result = !result;
-    E = E->Next;
-  }
-  return result;
-}
-//------------------------------------------------------------------------------
-
-bool MoreBelow(TEdge* Edge) 
-{
-  //Edge is Skip heading down.
-  TEdge* E = Edge;
-  if (IsHorizontal(*E)) 
-  {
-    while (IsHorizontal(*E->Next)) E = E->Next;
-    return E->Next->Bot.Y > E->Bot.Y;
-  } else if (IsHorizontal(*E->Next))
-  {
-    while (IsHorizontal(*E->Next)) E = E->Next;
-    return E->Next->Bot.Y > E->Bot.Y;
-  } 
-  else return (E->Bot == E->Next->Top);
-}
-//------------------------------------------------------------------------------
-
-bool JustBeforeLocMin(TEdge* Edge)
-{
-  //Edge is Skip and was heading down.
-  TEdge*E = Edge;
-  if (IsHorizontal(*E))
-  {
-    while (IsHorizontal(*E->Next)) E = E->Next;
-    return E->Next->Top.Y < E->Bot.Y;
-  }
-  else return SharedVertWithNextIsBot(E);
-}
-//------------------------------------------------------------------------------
-
-bool MoreAbove(TEdge* Edge)
-{
-  if (IsHorizontal(*Edge)) 
-  {
-    Edge = GetLastHorz(Edge);
-    return (Edge->Next->Top.Y < Edge->Top.Y);
-  } else if (IsHorizontal(*Edge->Next)) 
-  {
-    Edge = GetLastHorz(Edge->Next);
-    return (Edge->Next->Top.Y < Edge->Top.Y);
-  } 
-  else
-    return (Edge->Next->Top.Y < Edge->Top.Y);
-}
-//------------------------------------------------------------------------------
-
-bool AllHorizontal(TEdge* Edge)
-{  
-  if (!IsHorizontal(*Edge)) return false;
-  TEdge* E = Edge->Next;
-  while (E != Edge)
-  {
-    if (!IsHorizontal(*E)) return false;
-    else E = E->Next;
-  }
-  return true;
-}
-//------------------------------------------------------------------------------
-
 inline void ReverseHorizontal(TEdge &e)
 {
   //swap horizontal edges' Top and Bottom x's so they follow the natural
@@ -1094,6 +1006,135 @@ void RangeTest(const IntPoint& Pt, bool& useFullRange)
 }
 //------------------------------------------------------------------------------
 
+TEdge* FindNextLocMin(TEdge* E)
+{
+  for (;;)
+  {
+    while (E->Bot != E->Prev->Bot || E->Curr == E->Top) E = E->Next;
+    if (!IsHorizontal(*E) && !IsHorizontal(*E->Prev)) break;
+    while (IsHorizontal(*E->Prev)) E = E->Prev;
+    TEdge* E2 = E;
+    while (IsHorizontal(*E)) E = E->Next;
+    if (E->Top.Y == E->Prev->Bot.Y) continue; //ie just an intermediate horz.
+    if (E2->Prev->Bot.X < E->Bot.X) E = E2;
+    break;
+  }
+  return E;
+}
+//------------------------------------------------------------------------------
+
+TEdge* ClipperBase::ProcessBound(TEdge* E, bool IsClockwise)
+{
+  TEdge *EStart = E, *Result = E;
+  TEdge *Horz = 0;
+  cInt StartX;
+  if (IsHorizontal(*E))
+  {
+    //it's possible for adjacent overlapping horz edges to start heading left
+    //before finishing right, so ...
+    if (IsClockwise) StartX = E->Prev->Bot.X;
+    else StartX = E->Next->Bot.X;
+    if (E->Bot.X != StartX) ReverseHorizontal(*E);
+  }
+  
+  if (Result->OutIdx != Skip)
+  {
+    if (IsClockwise)
+    {
+      while (Result->Top.Y == Result->Next->Bot.Y && Result->Next->OutIdx != Skip)
+        Result = Result->Next;
+      if (IsHorizontal(*Result) && Result->Next->OutIdx != Skip)
+      {
+        //nb: at the top of a bound, horizontals are added to the bound
+        //only when the preceding edge attaches to the horizontal's left vertex
+        //unless a Skip edge is encountered when that becomes the top divide
+        Horz = Result;
+        while (IsHorizontal(*Horz->Prev)) Horz = Horz->Prev;
+        if (Horz->Prev->Top.X == Result->Next->Top.X) 
+        {
+          if (!IsClockwise) Result = Horz->Prev;
+        }
+        else if (Horz->Prev->Top.X > Result->Next->Top.X) Result = Horz->Prev;
+      }
+      while (E != Result) 
+      {
+        E->NextInLML = E->Next;
+        if (IsHorizontal(*E) && E != EStart &&
+          E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
+        E = E->Next;
+      }
+      if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Prev->Top.X) 
+        ReverseHorizontal(*E);
+      Result = Result->Next; //move to the edge just beyond current bound
+    } else
+    {
+      while (Result->Top.Y == Result->Prev->Bot.Y && Result->Prev->OutIdx != Skip) 
+        Result = Result->Prev;
+      if (IsHorizontal(*Result) && Result->Prev->OutIdx != Skip)
+      {
+        Horz = Result;
+        while (IsHorizontal(*Horz->Next)) Horz = Horz->Next;
+        if (Horz->Next->Top.X == Result->Prev->Top.X) 
+        {
+          if (!IsClockwise) Result = Horz->Next;
+        }
+        else if (Horz->Next->Top.X > Result->Prev->Top.X) Result = Horz->Next;
+      }
+
+      while (E != Result)
+      {
+        E->NextInLML = E->Prev;
+        if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) 
+          ReverseHorizontal(*E);
+        E = E->Prev;
+      }
+      if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) 
+        ReverseHorizontal(*E);
+      Result = Result->Prev; //move to the edge just beyond current bound
+    }
+  }
+
+  if (Result->OutIdx == Skip) 
+  {
+    //if edges still remain in the current bound beyond the skip edge then
+    //create another LocMin and call ProcessBound once more
+    E = Result;
+    if (IsClockwise)
+    {
+      while (E->Top.Y == E->Next->Bot.Y) E = E->Next;
+      //don't include top horizontals when parsing a bound a second time,
+      //they will be contained in the opposite bound ...
+      while (E != Result && IsHorizontal(*E)) E = E->Prev;
+    } else
+    {
+      while (E->Top.Y == E->Prev->Bot.Y) E = E->Prev;
+      while (E != Result && IsHorizontal(*E)) E = E->Next;
+    }
+    if (E == Result)
+    {
+      if (IsClockwise) Result = E->Next;
+      else Result = E->Prev;
+    } else
+    {
+      //there are more edges in the bound beyond result starting with E
+      if (IsClockwise)
+        E = Result->Next; 
+      else
+        E = Result->Prev;
+      LocalMinima* locMin = new LocalMinima;
+      locMin->Next = 0;
+      locMin->Y = E->Bot.Y;
+      locMin->LeftBound = 0;
+      locMin->RightBound = E;
+      locMin->RightBound->WindDelta = 0;
+      Result = ProcessBound(locMin->RightBound, IsClockwise);
+      InsertLocalMinima(locMin);
+    }
+  }
+  return Result;
+}
+//------------------------------------------------------------------------------
+
 bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
 {
 #ifdef use_lines
@@ -1105,15 +1146,15 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
 #endif
 
   int highI = (int)pg.size() -1;
-  bool ClosedOrSemiClosed = (highI > 0) && (Closed || (pg[0] == pg[highI]));
-  while (highI > 0 && (pg[highI] == pg[0])) --highI;
+  if (Closed) while (highI > 0 && (pg[highI] == pg[0])) --highI;
   while (highI > 0 && (pg[highI] == pg[highI -1])) --highI;
   if ((Closed && highI < 2) || (!Closed && highI < 1)) return false;
 
   //create a new edge array ...
   TEdge *edges = new TEdge [highI +1];
 
-  //1. Basic initialization of Edges ...
+  bool IsFlat = true;
+  //1. Basic (first) edge initialization ...
   try
   {
     edges[1].Curr = pg[1];
@@ -1130,18 +1171,17 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
   catch(...)
   {
     delete [] edges;
-    return false; //almost certainly a vertex has exceeded range
+    throw; //range test fails
   }
-
   TEdge *eStart = &edges[0];
-  if (!ClosedOrSemiClosed) eStart->Prev->OutIdx = Skip;
 
-  //2. Remove duplicate vertices, and collinear edges (when closed) ...
+  //2. Remove duplicate vertices, and (when closed) collinear edges ...
   TEdge *E = eStart, *eLoopStop = eStart;
   for (;;)
   {
     if ((E->Curr == E->Next->Curr))
     {
+      if (E == E->Next) break;
       if (E == eStart) eStart = E->Next;
       E = RemoveEdge(E);
       eLoopStop = E;
@@ -1149,24 +1189,20 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
     }
     if (E->Prev == E->Next) 
       break; //only two vertices
-    else if ((ClosedOrSemiClosed ||
-      (E->Prev->OutIdx != Skip && E->OutIdx != Skip &&
-      E->Next->OutIdx != Skip)) &&
-      SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange)) 
+    else if (Closed &&
+      SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange) && 
+      (!m_PreserveCollinear ||
+      !Pt2IsBetweenPt1AndPt3(E->Prev->Curr, E->Curr, E->Next->Curr)))
     {
-      //All collinear edges are allowed for open paths but in closed paths
-      //inner vertices of adjacent collinear edges are removed. However if the
-      //PreserveCollinear property has been enabled, only overlapping collinear
-      //edges (ie spikes) are removed from closed paths.
-      if (Closed && (!m_PreserveCollinear ||
-        !Pt2IsBetweenPt1AndPt3(E->Prev->Curr, E->Curr, E->Next->Curr))) 
-      {
-        if (E == eStart) eStart = E->Next;
-        E = RemoveEdge(E);
-        E = E->Prev;
-        eLoopStop = E;
-        continue;
-      }
+      //Collinear edges are allowed for open paths but in closed paths
+      //the default is to merge adjacent collinear edges into a single edge.
+      //However, if the PreserveCollinear property is enabled, only overlapping
+      //collinear edges (ie spikes) will be removed from closed paths.
+      if (E == eStart) eStart = E->Next;
+      E = RemoveEdge(E);
+      E = E->Prev;
+      eLoopStop = E;
+      continue;
     }
     E = E->Next;
     if (E == eLoopStop) break;
@@ -1177,67 +1213,98 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
     delete [] edges;
     return false;
   }
-  m_edges.push_back(edges);
 
   if (!Closed)
+  { 
     m_HasOpenPaths = true;
+    eStart->Prev->OutIdx = Skip;
+  }
 
-  //3. Do final Init and also find the 'highest' Edge. (nb: since I'm much
-  //more familiar with positive downwards Y axes, 'highest' here will be
-  //the Edge with the *smallest* Top.Y.)
-  TEdge *eHighest = eStart;
+  //3. Do second stage of edge initialization ...
   E = eStart;
   do
   {
     InitEdge2(*E, PolyTyp);
-    if (E->Top.Y < eHighest->Top.Y) eHighest = E;
     E = E->Next;
+    if (IsFlat && E->Curr.Y != eStart->Curr.Y) IsFlat = false;
   }
   while (E != eStart);
 
-  //4. build the local minima list ...
-  if (AllHorizontal(E))
+  //4. Finally, add edge bounds to LocalMinima list ...
+
+  //Totally flat paths must be handled differently when adding them
+  //to LocalMinima list to avoid endless loops etc ...
+  if (IsFlat) 
   {
-    if (ClosedOrSemiClosed)
-      E->Prev->OutIdx = Skip;
-    AscendToMax(E, false, false);
-    return true;
+    if (Closed) 
+    {
+      delete [] edges;
+      return false;
+    }
+    E->Prev->OutIdx = Skip;
+    if (E->Prev->Bot.X < E->Prev->Top.X) ReverseHorizontal(*E->Prev);
+    LocalMinima* locMin = new LocalMinima();
+    locMin->Next = 0;
+    locMin->Y = E->Bot.Y;
+    locMin->LeftBound = 0;
+    locMin->RightBound = E;
+    locMin->RightBound->Side = esRight;
+    locMin->RightBound->WindDelta = 0;
+    while (E->Next->OutIdx != Skip)
+    {
+      E->NextInLML = E->Next;
+      if (E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
+      E = E->Next;
+    }
+    InsertLocalMinima(locMin);
+    m_edges.push_back(edges);
+	  return true;
   }
 
-  //if eHighest is also the Skip then it's a natural break, otherwise
-  //make sure eHighest is positioned so we're either at a top horizontal or
-  //just starting to head down one edge of the polygon
-  E = eStart->Prev; //EStart.Prev == Skip edge
-  if (E->Prev == E->Next)
-    eHighest = E->Next;
-  else if (!ClosedOrSemiClosed && E->Top.Y == eHighest->Top.Y)
-  {
-    if ((IsHorizontal(*E) || IsHorizontal(*E->Next)) && 
-      E->Next->Bot.Y == eHighest->Top.Y)
-        eHighest = E->Next;
-    else if (SharedVertWithPrevAtTop(E)) eHighest = E;
-    else if (E->Top == E->Prev->Top) eHighest = E->Prev;
-    else eHighest = E->Next;
-  } else
+  m_edges.push_back(edges);
+  bool clockwise;
+  TEdge* EMin = 0;
+  for (;;)
   {
-    E = eHighest;
-    while (IsHorizontal(*eHighest) ||
-      (eHighest->Top == eHighest->Next->Top) ||
-      (eHighest->Top == eHighest->Next->Bot)) //next is high horizontal
+    E = FindNextLocMin(E);
+    if (E == EMin) break;
+    else if (!EMin) EMin = E;
+
+    //E and E.Prev now share a local minima (left aligned if horizontal).
+    //Compare their slopes to find which starts which bound ...
+    LocalMinima* locMin = new LocalMinima;
+    locMin->Next = 0;
+    locMin->Y = E->Bot.Y;
+    if (E->Dx < E->Prev->Dx) 
     {
-      eHighest = eHighest->Next;
-      if (eHighest == E) 
-      {
-        while (IsHorizontal(*eHighest) || !SharedVertWithPrevAtTop(eHighest))
-            eHighest = eHighest->Next;
-        break; //avoids potential endless loop
-      }
+      locMin->LeftBound = E->Prev;
+      locMin->RightBound = E;
+      clockwise = false; //Q.nextInLML = Q.prev
+    } else
+    {
+      locMin->LeftBound = E;
+      locMin->RightBound = E->Prev;
+      clockwise = true; //Q.nextInLML = Q.next
     }
+    locMin->LeftBound->Side = esLeft;
+    locMin->RightBound->Side = esRight;
+
+    if (!Closed) locMin->LeftBound->WindDelta = 0;
+    else if (locMin->LeftBound->Next == locMin->RightBound)
+      locMin->LeftBound->WindDelta = -1;
+    else locMin->LeftBound->WindDelta = 1;
+    locMin->RightBound->WindDelta = -locMin->LeftBound->WindDelta;
+
+    E = ProcessBound(locMin->LeftBound, clockwise);
+    TEdge* E2 = ProcessBound(locMin->RightBound, !clockwise);
+
+    if (locMin->LeftBound->OutIdx == Skip)
+      locMin->LeftBound = 0;
+    else if (locMin->RightBound->OutIdx == Skip)
+      locMin->RightBound = 0;
+    InsertLocalMinima(locMin);
+    if (!clockwise) E = E2;
   }
-  E = eHighest;
-  do
-    E = AddBoundsToLML(E, Closed);
-  while (E != eHighest);
   return true;
 }
 //------------------------------------------------------------------------------
@@ -1272,242 +1339,58 @@ void ClipperBase::InsertLocalMinima(LocalMinima *newLm)
 }
 //------------------------------------------------------------------------------
 
-void ClipperBase::DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed)
+void ClipperBase::Clear()
 {
-  if (!E1)
+  DisposeLocalMinimaList();
+  for (EdgeList::size_type i = 0; i < m_edges.size(); ++i)
   {
-    if (!E2) return;
-    LocalMinima* NewLm = new LocalMinima;
-    NewLm->Next = 0;
-    NewLm->Y = E2->Bot.Y;
-    NewLm->LeftBound = 0;
-    E2->WindDelta = 0;
-    NewLm->RightBound = E2;
-    InsertLocalMinima(NewLm);
-  } else
+    //for each edge array in turn, find the first used edge and 
+    //check for and remove any hiddenPts in each edge in the array.
+    TEdge* edges = m_edges[i];
+    delete [] edges;
+  }
+  m_edges.clear();
+  m_UseFullRange = false;
+  m_HasOpenPaths = false;
+}
+//------------------------------------------------------------------------------
+
+void ClipperBase::Reset()
+{
+  m_CurrentLM = m_MinimaList;
+  if( !m_CurrentLM ) return; //ie nothing to process
+
+  //reset all edges ...
+  LocalMinima* lm = m_MinimaList;
+  while( lm )
   {
-    //E and E.Prev are now at a local minima ...
-    LocalMinima* NewLm = new LocalMinima;
-    NewLm->Y = E1->Bot.Y;
-    NewLm->Next = 0;
-    if (IsHorizontal(*E2)) //Horz. edges never start a Left bound
-    {
-      if (E2->Bot.X != E1->Bot.X) ReverseHorizontal(*E2);
-      NewLm->LeftBound = E1;
-      NewLm->RightBound = E2;
-    } else if (E2->Dx < E1->Dx)
+    TEdge* e = lm->LeftBound;
+    if (e)
     {
-      NewLm->LeftBound = E1;
-      NewLm->RightBound = E2;
-    } else
+      e->Curr = e->Bot;
+      e->Side = esLeft;
+      e->OutIdx = Unassigned;
+    }
+
+    e = lm->RightBound;
+    if (e)
     {
-      NewLm->LeftBound = E2;
-      NewLm->RightBound = E1;
+      e->Curr = e->Bot;
+      e->Side = esRight;
+      e->OutIdx = Unassigned;
     }
-    NewLm->LeftBound->Side = esLeft;
-    NewLm->RightBound->Side = esRight;
-    //set the winding state of the first edge in each bound
-    //(it'll be copied to subsequent edges in the bound) ...
-    if (!IsClosed) NewLm->LeftBound->WindDelta = 0;
-    else if (NewLm->LeftBound->Next == NewLm->RightBound) NewLm->LeftBound->WindDelta = -1;
-    else NewLm->LeftBound->WindDelta = 1;
-    NewLm->RightBound->WindDelta = -NewLm->LeftBound->WindDelta;
-    InsertLocalMinima(NewLm);
+    lm = lm->Next;
   }
 }
-//----------------------------------------------------------------------
+//------------------------------------------------------------------------------
 
-TEdge* ClipperBase::DescendToMin(TEdge *&E)
+void ClipperBase::DisposeLocalMinimaList()
 {
-  //PRECONDITION: STARTING EDGE IS A VALID DESCENDING EDGE.
-  //Starting at the top of one bound we progress to the bottom where there's
-  //A local minima. We  go to the top of the Next bound. These two bounds
-  //form the left and right (or right and left) bounds of the local minima.
-  TEdge* EHorz;
-  E->NextInLML = 0;
-  if (IsHorizontal(*E)) 
+  while( m_MinimaList )
   {
-    EHorz = E;
-    while (IsHorizontal(*EHorz->Next)) EHorz = EHorz->Next;
-    if (EHorz->Bot != EHorz->Next->Top)
-      ReverseHorizontal(*E);
-  }
-  for (;;)
-  {
-    E = E->Next;
-    if (E->OutIdx == Skip) break;
-    else if (IsHorizontal(*E))
-    {
-      //nb: proceed through horizontals when approaching from their right,
-      //    but break on horizontal minima if approaching from their left.
-      //    This ensures 'local minima' are always on the left of horizontals.
-
-      //look ahead is required in case of multiple consec. horizontals
-      EHorz = GetLastHorz(E);
-      if(EHorz == E->Prev ||                    //horizontal line
-        (EHorz->Next->Top.Y < E->Top.Y &&      //bottom horizontal
-        EHorz->Next->Bot.X > E->Prev->Bot.X))  //approaching from the left
-          break;
-      if (E->Top.X != E->Prev->Bot.X)  ReverseHorizontal(*E);
-      if (EHorz->OutIdx == Skip) EHorz = EHorz->Prev;
-      while (E != EHorz)
-      {
-        E->NextInLML = E->Prev;
-        E = E->Next;
-        if (E->Top.X != E->Prev->Bot.X) ReverseHorizontal(*E);
-      }
-    }
-    else if (E->Bot.Y == E->Prev->Bot.Y)  break;
-    E->NextInLML = E->Prev;
-  }
-  return E->Prev;
-}
-//----------------------------------------------------------------------
-
-void ClipperBase::AscendToMax(TEdge *&E, bool Appending, bool IsClosed)
-{
-  if (E->OutIdx == Skip)
-  {
-    E = E->Next;
-    if (!MoreAbove(E->Prev)) return;
-  }
-
-  if (IsHorizontal(*E) && Appending && (E->Bot != E->Prev->Bot))
-      ReverseHorizontal(*E);
-  //now process the ascending bound ....
-  TEdge *EStart = E;
-  for (;;)
-  {
-    if (E->Next->OutIdx == Skip ||
-      ((E->Next->Top.Y == E->Top.Y) && !IsHorizontal(*E->Next))) break;
-    E->NextInLML = E->Next;
-    E = E->Next;
-    if (IsHorizontal(*E) && (E->Bot.X != E->Prev->Top.X))
-      ReverseHorizontal(*E);
-  }
-
-  if (!Appending)
-  {
-    if (EStart->OutIdx == Skip) EStart = EStart->Next;
-    if (EStart != E->Next)
-      DoMinimaLML(0, EStart, IsClosed);
-  }
-  E = E->Next;
-}
-//----------------------------------------------------------------------
-
-TEdge* ClipperBase::AddBoundsToLML(TEdge* E, bool IsClosed)
-{
-  //Starting at the top of one bound we progress to the bottom where there's
-  //A local minima. We then go to the top of the Next bound. These two bounds
-  //form the left and right (or right and left) bounds of the local minima.
-
-  TEdge* B;
-  bool AppendMaxima;
-  //do minima ...
-  if (E->OutIdx == Skip)
-  {
-    if (MoreBelow(E))
-    {
-      E = E->Next;
-      B = DescendToMin(E);
-    } else
-      B = 0;
-  } else
-    B = DescendToMin(E);
-
-  if (E->OutIdx == Skip)    //nb: may be BEFORE, AT or just THRU LM
-  {
-    //do minima before Skip...
-    DoMinimaLML(0, B, IsClosed);      //store what we've got so far (if anything)
-    AppendMaxima = false;
-    //finish off any minima ...
-    if ((E->Bot != E->Prev->Bot) && MoreBelow(E)) 
-    {
-      E = E->Next;
-      B = DescendToMin(E);
-      DoMinimaLML(B, E, IsClosed);
-      AppendMaxima = true;
-    }
-    else if (JustBeforeLocMin(E))
-      E = E->Next;
-  } else
-  {
-    DoMinimaLML(B, E, IsClosed);
-    AppendMaxima = true;
-  }
-
-  //now do maxima ...
-  AscendToMax(E, AppendMaxima, IsClosed);
-
-  if (E->OutIdx == Skip && (E->Top != E->Prev->Top))     
-  {
-    //may be BEFORE, AT or just AFTER maxima
-    //finish off any maxima ...
-    if (MoreAbove(E)) 
-    {
-      E = E->Next;
-      AscendToMax(E, false, IsClosed);
-    }
-    else if ((E->Top == E->Next->Top) ||
-      (IsHorizontal(*E->Next) && (E->Top == E->Next->Bot))) 
-      E = E->Next; //ie just before Maxima
-  }
-  return E;
-}
-//----------------------------------------------------------------------
-
-void ClipperBase::Clear()
-{
-  DisposeLocalMinimaList();
-  for (EdgeList::size_type i = 0; i < m_edges.size(); ++i)
-  {
-    //for each edge array in turn, find the first used edge and 
-    //check for and remove any hiddenPts in each edge in the array.
-    TEdge* edges = m_edges[i];
-    delete [] edges;
-  }
-  m_edges.clear();
-  m_UseFullRange = false;
-  m_HasOpenPaths = false;
-}
-//------------------------------------------------------------------------------
-
-void ClipperBase::Reset()
-{
-  m_CurrentLM = m_MinimaList;
-  if( !m_CurrentLM ) return; //ie nothing to process
-
-  //reset all edges ...
-  LocalMinima* lm = m_MinimaList;
-  while( lm )
-  {
-    TEdge* e = lm->LeftBound;
-    if (e)
-    {
-      e->Curr = e->Bot;
-      e->Side = esLeft;
-      if (e->OutIdx != Skip)
-        e->OutIdx = Unassigned;
-    }
-    e = lm->RightBound;
-    e->Curr = e->Bot;
-    e->Side = esRight;
-    if (e->OutIdx != Skip)
-      e->OutIdx = Unassigned;
-
-    lm = lm->Next;
-  }
-}
-//------------------------------------------------------------------------------
-
-void ClipperBase::DisposeLocalMinimaList()
-{
-  while( m_MinimaList )
-  {
-    LocalMinima* tmpLm = m_MinimaList->Next;
-    delete m_MinimaList;
-    m_MinimaList = tmpLm;
+    LocalMinima* tmpLm = m_MinimaList->Next;
+    delete m_MinimaList;
+    m_MinimaList = tmpLm;
   }
   m_CurrentLM = 0;
 }
@@ -1568,7 +1451,6 @@ Clipper::Clipper(int initOptions) : ClipperBase() //constructor
 {
   m_ActiveEdges = 0;
   m_SortedEdges = 0;
-  m_IntersectNodes = 0;
   m_ExecuteLocked = false;
   m_UseFullRange = false;
   m_ReverseOutput = ((initOptions & ioReverseSolution) != 0);
@@ -1596,21 +1478,12 @@ void Clipper::ZFillFunction(TZFillCallback zFillFunc)
 //------------------------------------------------------------------------------
 #endif
 
-void Clipper::Clear()
-{
-  if (m_edges.empty()) return; //avoids problems with ClipperBase destructor
-  DisposeAllOutRecs();
-  ClipperBase::Clear();
-}
-//------------------------------------------------------------------------------
-
 void Clipper::Reset()
 {
   ClipperBase::Reset();
   m_Scanbeam.clear();
   m_ActiveEdges = 0;
   m_SortedEdges = 0;
-  DisposeAllOutRecs();
   LocalMinima* lm = m_MinimaList;
   while (lm)
   {
@@ -1634,6 +1507,7 @@ bool Clipper::Execute(ClipType clipType, Paths &solution,
   m_UsingPolyTree = false;
   bool succeeded = ExecuteInternal();
   if (succeeded) BuildResult(solution);
+  DisposeAllOutRecs();
   m_ExecuteLocked = false;
   return succeeded;
 }
@@ -1650,6 +1524,7 @@ bool Clipper::Execute(ClipType clipType, PolyTree& polytree,
   m_UsingPolyTree = true;
   bool succeeded = ExecuteInternal();
   if (succeeded) BuildResult2(polytree);
+  DisposeAllOutRecs();
   m_ExecuteLocked = false;
   return succeeded;
 }
@@ -2008,6 +1883,7 @@ OutPt* Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt)
 void Clipper::AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt)
 {
   AddOutPt( e1, Pt );
+  if (e2->WindDelta == 0) AddOutPt(e2, Pt);
   if( e1->OutIdx == e2->OutIdx )
   {
     e1->OutIdx = Unassigned;
@@ -2105,6 +1981,14 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
       if (IsContributing(*rb))
         Op1 = AddOutPt(rb, rb->Bot); 
     } 
+    else if (!rb)
+    {
+      InsertEdgeIntoAEL(lb, 0);
+      SetWindingCount(*lb);
+      if (IsContributing(*lb))
+        Op1 = AddOutPt(lb, lb->Bot);
+      InsertScanbeam(lb->Top.Y);
+    }
     else
     {
       InsertEdgeIntoAEL(lb, 0);
@@ -2117,12 +2001,13 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
       InsertScanbeam(lb->Top.Y);
     }
 
-    if(IsHorizontal(*rb))
-      AddEdgeToSEL(rb);
-    else
-      InsertScanbeam( rb->Top.Y );
+     if (rb)
+     {
+       if(IsHorizontal(*rb)) AddEdgeToSEL(rb);
+       else InsertScanbeam( rb->Top.Y );
+     }
 
-    if (!lb) continue;
+    if (!lb || !rb) continue;
 
     //if any output polygons share an edge, they'll need joining later ...
     if (Op1 && IsHorizontal(*rb) && 
@@ -2829,21 +2714,24 @@ void Clipper::PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam)
   //First, match up overlapping horizontal edges (eg when one polygon's
   //intermediate horz edge overlaps an intermediate horz edge of another, or
   //when one polygon sits on top of another) ...
-  for (JoinList::size_type i = 0; i < m_GhostJoins.size(); ++i)
-  {
-    Join* j = m_GhostJoins[i];
-    if (HorzSegmentsOverlap(j->OutPt1->Pt, j->OffPt, horzEdge->Bot, horzEdge->Top))
-        AddJoin(j->OutPt1, outPt, j->OffPt);
-  }
+  //for (JoinList::size_type i = 0; i < m_GhostJoins.size(); ++i)
+  //{
+  //  Join* j = m_GhostJoins[i];
+  //  if (HorzSegmentsOverlap(j->OutPt1->Pt, j->OffPt, horzEdge->Bot, horzEdge->Top))
+  //      AddJoin(j->OutPt1, outPt, j->OffPt);
+  //}
+
   //Also, since horizontal edges at the top of one SB are often removed from
   //the AEL before we process the horizontal edges at the bottom of the next,
   //we need to create 'ghost' Join records of 'contrubuting' horizontals that
   //we can compare with horizontals at the bottom of the next SB.
   if (isTopOfScanbeam) 
+  {
     if (outPt->Pt == horzEdge->Top)
       AddGhostJoin(outPt, horzEdge->Bot); 
     else
       AddGhostJoin(outPt, horzEdge->Top);
+  }
 }
 //------------------------------------------------------------------------------
 
@@ -2886,12 +2774,12 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam)
       if ((dir == dLeftToRight && e->Curr.X <= horzRight) ||
         (dir == dRightToLeft && e->Curr.X >= horzLeft))
       {
+        if (horzEdge->OutIdx >= 0 && horzEdge->WindDelta != 0) 
+          PrepareHorzJoins(horzEdge, isTopOfScanbeam);
         //so far we're still in range of the horizontal Edge  but make sure
         //we're at the last of consec. horizontals when matching with eMaxPair
         if(e == eMaxPair && IsLastHorz)
         {
-          if (horzEdge->OutIdx >= 0 && horzEdge->WindDelta != 0) 
-            PrepareHorzJoins(horzEdge, isTopOfScanbeam);
           if (dir == dLeftToRight)
             IntersectEdges(horzEdge, e, e->Top);
           else
@@ -3009,8 +2897,9 @@ bool Clipper::ProcessIntersections(const cInt botY, const cInt topY)
   if( !m_ActiveEdges ) return true;
   try {
     BuildIntersectList(botY, topY);
-    if (!m_IntersectNodes) return true;
-    if (!m_IntersectNodes->Next || FixupIntersectionOrder()) ProcessIntersectList();
+    size_t IlSize = m_IntersectList.size();
+    if (IlSize == 0) return true;
+    if (IlSize == 1 || FixupIntersectionOrder()) ProcessIntersectList();
     else return false;
   }
   catch(...) 
@@ -3026,12 +2915,9 @@ bool Clipper::ProcessIntersections(const cInt botY, const cInt topY)
 
 void Clipper::DisposeIntersectNodes()
 {
-  while ( m_IntersectNodes )
-  {
-    IntersectNode* iNode = m_IntersectNodes->Next;
-    delete m_IntersectNodes;
-    m_IntersectNodes = iNode;
-  }
+  for (size_t i = 0; i < m_IntersectList.size(); ++i )
+    delete m_IntersectList[i];
+  m_IntersectList.clear();
 }
 //------------------------------------------------------------------------------
 
@@ -3071,7 +2957,13 @@ void Clipper::BuildIntersectList(const cInt botY, const cInt topY)
               Pt.X = TopX(*eNext, botY); else
               Pt.X = TopX(*e, botY);
         }
-        InsertIntersectNode( e, eNext, Pt );
+
+        IntersectNode * newNode = new IntersectNode;
+        newNode->Edge1 = e;
+        newNode->Edge2 = eNext;
+        newNode->Pt = Pt;
+        m_IntersectList.push_back(newNode);
+
         SwapPositionsInSEL(e, eNext);
         isModified = true;
       }
@@ -3086,43 +2978,55 @@ void Clipper::BuildIntersectList(const cInt botY, const cInt topY)
 }
 //------------------------------------------------------------------------------
 
-void Clipper::InsertIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &Pt)
+
+void Clipper::ProcessIntersectList()
 {
-  IntersectNode* newNode = new IntersectNode;
-  newNode->Edge1 = e1;
-  newNode->Edge2 = e2;
-  newNode->Pt = Pt;
-  newNode->Next = 0;
-  if( !m_IntersectNodes ) m_IntersectNodes = newNode;
-  else if(newNode->Pt.Y > m_IntersectNodes->Pt.Y )
-  {
-    newNode->Next = m_IntersectNodes;
-    m_IntersectNodes = newNode;
-  }
-  else
+  for (size_t i = 0; i < m_IntersectList.size(); ++i)
   {
-    IntersectNode* iNode = m_IntersectNodes;
-    while(iNode->Next  && newNode->Pt.Y <= iNode->Next->Pt.Y)
-      iNode = iNode->Next;
-    newNode->Next = iNode->Next;
-    iNode->Next = newNode;
+    IntersectNode* iNode = m_IntersectList[i];
+    {
+      IntersectEdges( iNode->Edge1, iNode->Edge2, iNode->Pt, true);
+      SwapPositionsInAEL( iNode->Edge1 , iNode->Edge2 );
+    }
+    delete iNode;
   }
+  m_IntersectList.clear();
 }
 //------------------------------------------------------------------------------
 
-void Clipper::ProcessIntersectList()
+bool IntersectListSort(IntersectNode* node1, IntersectNode* node2)
+{
+  return node2->Pt.Y < node1->Pt.Y;
+}
+//------------------------------------------------------------------------------
+
+inline bool EdgesAdjacent(const IntersectNode &inode)
+{
+  return (inode.Edge1->NextInSEL == inode.Edge2) ||
+    (inode.Edge1->PrevInSEL == inode.Edge2);
+}
+//------------------------------------------------------------------------------
+
+bool Clipper::FixupIntersectionOrder()
 {
-  while( m_IntersectNodes )
+  //pre-condition: intersections are sorted Bottom-most first.
+  //Now it's crucial that intersections are made only between adjacent edges,
+  //so to ensure this the order of intersections may need adjusting ...
+  CopyAELToSEL();
+  std::sort(m_IntersectList.begin(), m_IntersectList.end(), IntersectListSort);
+  size_t cnt = m_IntersectList.size();
+  for (size_t i = 0; i < cnt; ++i) 
   {
-    IntersectNode* iNode = m_IntersectNodes->Next;
+    if (!EdgesAdjacent(*m_IntersectList[i]))
     {
-      IntersectEdges( m_IntersectNodes->Edge1 ,
-        m_IntersectNodes->Edge2 , m_IntersectNodes->Pt, true);
-      SwapPositionsInAEL( m_IntersectNodes->Edge1 , m_IntersectNodes->Edge2 );
+      size_t j = i + 1;
+      while (j < cnt && !EdgesAdjacent(*m_IntersectList[j])) j++;
+      if (j == cnt)  return false;
+      std::swap(m_IntersectList[i], m_IntersectList[j]);
     }
-    delete m_IntersectNodes;
-    m_IntersectNodes = iNode;
+    SwapPositionsInSEL(m_IntersectList[i]->Edge1, m_IntersectList[i]->Edge2);
   }
+  return true;
 }
 //------------------------------------------------------------------------------
 
@@ -3385,7 +3289,7 @@ void Clipper::BuildResult2(PolyTree& polytree)
           outRec->PolyNd->m_IsOpen = true;
           polytree.AddChild(*outRec->PolyNd);
         }
-        else if (outRec->FirstLeft) 
+        else if (outRec->FirstLeft && outRec->FirstLeft->PolyNd) 
           outRec->FirstLeft->PolyNd->AddChild(*outRec->PolyNd);
         else
           polytree.AddChild(*outRec->PolyNd);
@@ -3406,38 +3310,6 @@ void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2)
 }
 //------------------------------------------------------------------------------
 
-inline bool EdgesAdjacent(const IntersectNode &inode)
-{
-  return (inode.Edge1->NextInSEL == inode.Edge2) ||
-    (inode.Edge1->PrevInSEL == inode.Edge2);
-}
-//------------------------------------------------------------------------------
-
-bool Clipper::FixupIntersectionOrder()
-{
-  //pre-condition: intersections are sorted Bottom-most (then Left-most) first.
-  //Now it's crucial that intersections are made only between adjacent edges,
-  //so to ensure this the order of intersections may need adjusting ...
-  IntersectNode *inode = m_IntersectNodes;  
-  CopyAELToSEL();
-  while (inode) 
-  {
-    if (!EdgesAdjacent(*inode))
-    {
-      IntersectNode *nextNode = inode->Next;
-      while (nextNode && !EdgesAdjacent(*nextNode))
-        nextNode = nextNode->Next;
-      if (!nextNode) 
-        return false;
-      SwapIntersectNodes(*inode, *nextNode);
-    }
-    SwapPositionsInSEL(inode->Edge1, inode->Edge2);
-    inode = inode->Next;
-  }
-  return true;
-}
-//------------------------------------------------------------------------------
-
 inline bool E2InsertsBeforeE1(TEdge &e1, TEdge &e2)
 {
   if (e2.Curr.X == e1.Curr.X) 
@@ -3618,10 +3490,8 @@ bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b,
 }
 //------------------------------------------------------------------------------
 
-bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2)
+bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
 {
-  OutRec* outRec1 = GetOutRec(j->OutPt1->Idx);
-  OutRec* outRec2 = GetOutRec(j->OutPt2->Idx);
   OutPt *op1 = j->OutPt1, *op1b;
   OutPt *op2 = j->OutPt2, *op2b;
 
@@ -3655,8 +3525,8 @@ bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2)
       op2->Next = op1;
       op1b->Next = op2b;
       op2b->Prev = op1b;
-      p1 = op1;
-      p2 = op1b;
+      j->OutPt1 = op1;
+      j->OutPt2 = op1b;
       return true;
     } else
     {
@@ -3666,8 +3536,8 @@ bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2)
       op2->Prev = op1;
       op1b->Prev = op2b;
       op2b->Next = op1b;
-      p1 = op1;
-      p2 = op1b;
+      j->OutPt1 = op1;
+      j->OutPt2 = op1b;
       return true;
     }
   } 
@@ -3716,7 +3586,7 @@ bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2)
     {
       Pt = op2b->Pt; DiscardLeftSide = (op2b->Pt.X > op2->Pt.X);
     }
-    p1 = op1; p2 = op2;
+    j->OutPt1 = op1; j->OutPt2 = op2;
     return JoinHorz(op1, op1b, op2, op2b, Pt, DiscardLeftSide);
   } else
   {
@@ -3759,8 +3629,8 @@ bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2)
       op2->Next = op1;
       op1b->Next = op2b;
       op2b->Prev = op1b;
-      p1 = op1;
-      p2 = op1b;
+      j->OutPt1 = op1;
+      j->OutPt2 = op1b;
       return true;
     } else
     {
@@ -3770,30 +3640,14 @@ bool Clipper::JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2)
       op2->Prev = op1;
       op1b->Prev = op2b;
       op2b->Next = op1b;
-      p1 = op1;
-      p2 = op1b;
+      j->OutPt1 = op1;
+      j->OutPt2 = op1b;
       return true;
     }
   }
 }
 //----------------------------------------------------------------------
 
-bool Poly2ContainsPoly1(OutPt* OutPt1, OutPt* OutPt2, bool UseFullInt64Range)
-{
-  OutPt* Pt = OutPt1;
-  //Because the polygons may be touching, we need to find a vertex that
-  //isn't touching the other polygon ...
-  if (PointOnPolygon(Pt->Pt, OutPt2, UseFullInt64Range))
-  {
-    Pt = Pt->Next;
-    while (Pt != OutPt1 && PointOnPolygon(Pt->Pt, OutPt2, UseFullInt64Range))
-        Pt = Pt->Next;
-    if (Pt == OutPt1) return true;
-  }
-  return PointInPolygon(Pt->Pt, OutPt2, UseFullInt64Range);
-}
-//----------------------------------------------------------------------
-
 void Clipper::FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec)
 { 
   
@@ -3802,7 +3656,7 @@ void Clipper::FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec)
     OutRec* outRec = m_PolyOuts[i];
     if (outRec->Pts && outRec->FirstLeft == OldOutRec) 
     {
-      if (Poly2ContainsPoly1(outRec->Pts, NewOutRec->Pts, m_UseFullRange))
+      if (Poly2ContainsPoly1(outRec->Pts, NewOutRec->Pts))
         outRec->FirstLeft = NewOutRec;
     }
   }
@@ -3819,14 +3673,22 @@ void Clipper::FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec)
 }
 //----------------------------------------------------------------------
 
+static OutRec* ParseFirstLeft(OutRec* FirstLeft)
+{
+  while (FirstLeft && !FirstLeft->Pts) 
+    FirstLeft = FirstLeft->FirstLeft;
+  return FirstLeft;
+}
+//------------------------------------------------------------------------------
+
 void Clipper::JoinCommonEdges()
 {
   for (JoinList::size_type i = 0; i < m_Joins.size(); i++)
   {
-    Join* j = m_Joins[i];
+    Join* join = m_Joins[i];
 
-    OutRec *outRec1 = GetOutRec(j->OutPt1->Idx);
-    OutRec *outRec2 = GetOutRec(j->OutPt2->Idx);
+    OutRec *outRec1 = GetOutRec(join->OutPt1->Idx);
+    OutRec *outRec2 = GetOutRec(join->OutPt2->Idx);
 
     if (!outRec1->Pts || !outRec2->Pts) continue;
 
@@ -3838,22 +3700,33 @@ void Clipper::JoinCommonEdges()
     else if (Param1RightOfParam2(outRec2, outRec1)) holeStateRec = outRec1;
     else holeStateRec = GetLowermostRec(outRec1, outRec2);
 
-    OutPt *p1, *p2;
-    if (!JoinPoints(j, p1, p2)) continue;
+    if (!JoinPoints(join, outRec1, outRec2)) continue;
 
     if (outRec1 == outRec2)
     {
       //instead of joining two polygons, we've just created a new one by
       //splitting one polygon into two.
-      outRec1->Pts = p1;
+      outRec1->Pts = join->OutPt1;
       outRec1->BottomPt = 0;
       outRec2 = CreateOutRec();
-      outRec2->Pts = p2;
+      outRec2->Pts = join->OutPt2;
 
       //update all OutRec2.Pts Idx's ...
       UpdateOutPtIdxs(*outRec2);
 
-      if (Poly2ContainsPoly1(outRec2->Pts, outRec1->Pts, m_UseFullRange))
+      //We now need to check every OutRec.FirstLeft pointer. If it points
+      //to OutRec1 it may need to point to OutRec2 instead ...
+      if (m_UsingPolyTree)
+        for (PolyOutList::size_type j = 0; j < m_PolyOuts.size() - 1; j++)
+        {
+          OutRec* oRec = m_PolyOuts[j];
+          if (!oRec->Pts || ParseFirstLeft(oRec->FirstLeft) != outRec1 ||
+            oRec->IsHole == outRec1->IsHole) continue;
+          if (Poly2ContainsPoly1(oRec->Pts, join->OutPt2))
+            oRec->FirstLeft = outRec2;
+        }
+
+      if (Poly2ContainsPoly1(outRec2->Pts, outRec1->Pts))
       {
         //outRec2 is contained by outRec1 ...
         outRec2->IsHole = !outRec1->IsHole;
@@ -3865,7 +3738,7 @@ void Clipper::JoinCommonEdges()
         if ((outRec2->IsHole ^ m_ReverseOutput) == (Area(*outRec2) > 0))
           ReversePolyPtLinks(outRec2->Pts);
             
-      } else if (Poly2ContainsPoly1(outRec1->Pts, outRec2->Pts, m_UseFullRange))
+      } else if (Poly2ContainsPoly1(outRec1->Pts, outRec2->Pts))
       {
         //outRec1 is contained by outRec2 ...
         outRec2->IsHole = outRec1->IsHole;
@@ -3907,483 +3780,528 @@ void Clipper::JoinCommonEdges()
     }
   }
 }
+
+//------------------------------------------------------------------------------
+// ClipperOffset support functions ...
 //------------------------------------------------------------------------------
 
-void Clipper::DoSimplePolygons()
+DoublePoint GetUnitNormal(const IntPoint &pt1, const IntPoint &pt2)
 {
-  PolyOutList::size_type i = 0;
-  while (i < m_PolyOuts.size()) 
-  {
-    OutRec* outrec = m_PolyOuts[i++];
-    OutPt* op = outrec->Pts;
-    if (!op) continue;
-    do //for each Pt in Polygon until duplicate found do ...
-    {
-      OutPt* op2 = op->Next;
-      while (op2 != outrec->Pts) 
-      {
-        if ((op->Pt == op2->Pt) && op2->Next != op && op2->Prev != op) 
-        {
-          //split the polygon into two ...
-          OutPt* op3 = op->Prev;
-          OutPt* op4 = op2->Prev;
-          op->Prev = op4;
-          op4->Next = op;
-          op2->Prev = op3;
-          op3->Next = op2;
+  if(pt2.X == pt1.X && pt2.Y == pt1.Y) 
+    return DoublePoint(0, 0);
 
-          outrec->Pts = op;
-          OutRec* outrec2 = CreateOutRec();
-          outrec2->Pts = op2;
-          UpdateOutPtIdxs(*outrec2);
-          if (Poly2ContainsPoly1(outrec2->Pts, outrec->Pts, m_UseFullRange))
-          {
-            //OutRec2 is contained by OutRec1 ...
-            outrec2->IsHole = !outrec->IsHole;
-            outrec2->FirstLeft = outrec;
-          }
-          else
-            if (Poly2ContainsPoly1(outrec->Pts, outrec2->Pts, m_UseFullRange))
-          {
-            //OutRec1 is contained by OutRec2 ...
-            outrec2->IsHole = outrec->IsHole;
-            outrec->IsHole = !outrec2->IsHole;
-            outrec2->FirstLeft = outrec->FirstLeft;
-            outrec->FirstLeft = outrec2;
-          } else
-          {
-            //the 2 polygons are separate ...
-            outrec2->IsHole = outrec->IsHole;
-            outrec2->FirstLeft = outrec->FirstLeft;
-          }
-          op2 = op; //ie get ready for the Next iteration
-        }
-        op2 = op2->Next;
-      }
-      op = op->Next;
-    }
-    while (op != outrec->Pts);
-  }
+  double Dx = (double)(pt2.X - pt1.X);
+  double dy = (double)(pt2.Y - pt1.Y);
+  double f = 1 *1.0/ std::sqrt( Dx*Dx + dy*dy );
+  Dx *= f;
+  dy *= f;
+  return DoublePoint(dy, -Dx);
 }
+
+//------------------------------------------------------------------------------
+// ClipperOffset class
 //------------------------------------------------------------------------------
 
-void ReversePath(Path& p)
+ClipperOffset::ClipperOffset(double miterLimit, double arcTolerance)
 {
-  std::reverse(p.begin(), p.end());
+  this->MiterLimit = miterLimit;
+  this->ArcTolerance = arcTolerance;
+  m_lowest.X = -1;
 }
 //------------------------------------------------------------------------------
 
-void ReversePaths(Paths& p)
+ClipperOffset::~ClipperOffset()
 {
-  for (Paths::size_type i = 0; i < p.size(); ++i)
-    ReversePath(p[i]);
+  Clear();
 }
-
 //------------------------------------------------------------------------------
-// OffsetPolygon functions ...
+
+void ClipperOffset::Clear()
+{
+  for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
+    delete m_polyNodes.Childs[i];
+  m_polyNodes.Childs.clear();
+  m_lowest.X = -1;
+}
 //------------------------------------------------------------------------------
 
-DoublePoint GetUnitNormal(const IntPoint &pt1, const IntPoint &pt2)
+void ClipperOffset::AddPath(const Path& path, JoinType joinType, EndType endType)
 {
-  if(pt2.X == pt1.X && pt2.Y == pt1.Y) 
-    return DoublePoint(0, 0);
+  int highI = (int)path.size() - 1;
+  if (highI < 0) return;
+  PolyNode* newNode = new PolyNode();
+  newNode->m_jointype = joinType;
+  newNode->m_endtype = endType;
 
-  double Dx = (double)(pt2.X - pt1.X);
-  double dy = (double)(pt2.Y - pt1.Y);
-  double f = 1 *1.0/ std::sqrt( Dx*Dx + dy*dy );
-  Dx *= f;
-  dy *= f;
-  return DoublePoint(dy, -Dx);
-}
+  //strip duplicate points from path and also get index to the lowest point ...
+  if (endType == etClosedLine || endType == etClosedPolygon)
+    while (highI > 0 && path[0] == path[highI]) highI--;
+  newNode->Contour.reserve(highI + 1);
+  newNode->Contour.push_back(path[0]);
+  int j = 0, k = 0;
+  for (int i = 1; i <= highI; i++)
+    if (newNode->Contour[j] != path[i])
+    {
+      j++;
+      newNode->Contour.push_back(path[i]);
+      if (path[i].Y > newNode->Contour[k].Y ||
+        (path[i].Y == newNode->Contour[k].Y &&
+        path[i].X < newNode->Contour[k].X)) k = j;
+    }
+  if ((endType == etClosedPolygon && j < 2) || 
+    (endType != etClosedPolygon && j < 0))
+  {
+    delete newNode;
+    return;
+  }
+  m_polyNodes.AddChild(*newNode);
 
+  //if this path's lowest pt is lower than all the others then update m_lowest
+  if (endType != etClosedPolygon) return;
+  if (m_lowest.X < 0)
+    m_lowest = IntPoint(0, k);
+  else
+  {
+    IntPoint ip = m_polyNodes.Childs[(int)m_lowest.X]->Contour[(int)m_lowest.Y];
+    if (newNode->Contour[k].Y > ip.Y ||
+      (newNode->Contour[k].Y == ip.Y &&
+      newNode->Contour[k].X < ip.X))
+      m_lowest = IntPoint(m_polyNodes.ChildCount() - 1, k);
+  }
+}
 //------------------------------------------------------------------------------
+
+void ClipperOffset::AddPaths(const Paths& paths, JoinType joinType, EndType endType)
+{
+  for (Paths::size_type i = 0; i < paths.size(); ++i)
+    AddPath(paths[i], joinType, endType);
+}
 //------------------------------------------------------------------------------
 
-class OffsetBuilder
+void ClipperOffset::FixOrientations()
 {
-private:
-  const Paths& m_p;
-  Path* m_curr_poly;
-  std::vector<DoublePoint> normals;
-// SAGA >>>  double m_delta, m_sinA, m_sin, m_cos;
-// SAGA >>>  double m_miterLim, m_Steps360;
-  double m_delta, m_sinA;		// <<< SAGA
-  double m_miterLim, m_Limit;	// <<< SAGA
-  size_t m_i, m_j, m_k;
-  static const int buffLength = 128;
- 
-public:
+  //fixup orientations of all closed paths if the orientation of the
+  //closed path with the lowermost vertex is wrong ...
+  if (m_lowest.X >= 0 && 
+    !Orientation(m_polyNodes.Childs[(int)m_lowest.X]->Contour))
+  {
+    for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
+    {
+      PolyNode& node = *m_polyNodes.Childs[i];
+      if (node.m_endtype == etClosedPolygon ||
+        (node.m_endtype == etClosedLine && Orientation(node.Contour)))
+          ReversePath(node.Contour);
+    }
+  } else
+  {
+    for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
+    {
+      PolyNode& node = *m_polyNodes.Childs[i];
+      if (node.m_endtype == etClosedLine && !Orientation(node.Contour))
+        ReversePath(node.Contour);
+    }
+  }
+}
+//------------------------------------------------------------------------------
 
-OffsetBuilder(const Paths& in_polys, Paths& out_polys,
-  double Delta, JoinType jointype, EndType endtype, double limit): m_p(in_polys)
+void ClipperOffset::Execute(Paths& solution, double delta)
 {
-    //precondition: &out_polys != &in_polys
+  solution.clear();
+  FixOrientations();
+  DoOffset(delta);
+  
+  //now clean up 'corners' ...
+  Clipper clpr;
+  clpr.AddPaths(m_destPolys, ptSubject, true);
+  if (delta > 0)
+  {
+    clpr.Execute(ctUnion, solution, pftPositive, pftPositive);
+  }
+  else
+  {
+    IntRect r = clpr.GetBounds();
+    Path outer(4);
+    outer[0] = IntPoint(r.left - 10, r.bottom + 10);
+    outer[1] = IntPoint(r.right + 10, r.bottom + 10);
+    outer[2] = IntPoint(r.right + 10, r.top - 10);
+    outer[3] = IntPoint(r.left - 10, r.top - 10);
+
+    clpr.AddPath(outer, ptSubject, true);
+    clpr.ReverseSolution(true);
+    clpr.Execute(ctUnion, solution, pftNegative, pftNegative);
+    if (solution.size() > 0) solution.erase(solution.begin());
+  }
+}
+//------------------------------------------------------------------------------
 
-    if (NEAR_ZERO(Delta)) {out_polys = in_polys; return;}
-    //we can't shrink a polyline so ...
-    if (endtype != etClosed && Delta < 0) Delta = -Delta;
-    m_delta = Delta;
+void ClipperOffset::Execute(PolyTree& solution, double delta)
+{
+  solution.Clear();
+  FixOrientations();
+  DoOffset(delta);
 
-  if (jointype == jtMiter) 
+  //now clean up 'corners' ...
+  Clipper clpr;
+  clpr.AddPaths(m_destPolys, ptSubject, true);
+  if (delta > 0)
   {
-    //m_miterLim: see offset_triginometry.svg in the documentation folder ...
-    if (limit > 2) m_miterLim = 2/(limit*limit);
-    else m_miterLim = 0.5;
-    if (endtype == etRound) limit = 0.25;
+    clpr.Execute(ctUnion, solution, pftPositive, pftPositive);
   }
-
-  if (jointype == jtRound || endtype == etRound)
-  {
-// SAGA >>>    if (limit <= 0) limit = 0.25;
-// SAGA >>>    else if (limit > std::fabs(Delta)*0.25) limit = std::fabs(Delta)*0.25;
-// SAGA >>>    //m_Steps360: see offset_triginometry2.svg in the documentation folder ...
-// SAGA >>>    m_Steps360 = pi / acos(1 - limit / std::fabs(Delta));
-// SAGA >>>    m_sin = std::sin(2 * pi / m_Steps360);
-// SAGA >>>    m_cos = std::cos(2 * pi / m_Steps360);
-// SAGA >>>    m_Steps360 /= pi * 2;
-// SAGA >>>    if (Delta < 0) m_sin = -m_sin;
-	m_Limit	= limit <= 0.0 ? 0.1 : limit;
+  else
+  {
+    IntRect r = clpr.GetBounds();
+    Path outer(4);
+    outer[0] = IntPoint(r.left - 10, r.bottom + 10);
+    outer[1] = IntPoint(r.right + 10, r.bottom + 10);
+    outer[2] = IntPoint(r.right + 10, r.top - 10);
+    outer[3] = IntPoint(r.left - 10, r.top - 10);
+
+    clpr.AddPath(outer, ptSubject, true);
+    clpr.ReverseSolution(true);
+    clpr.Execute(ctUnion, solution, pftNegative, pftNegative);
+    //remove the outer PolyNode rectangle ...
+    if (solution.ChildCount() == 1 && solution.Childs[0]->ChildCount() > 0)
+    {
+      PolyNode* outerNode = solution.Childs[0];
+      solution.Childs.reserve(outerNode->ChildCount());
+      solution.Childs[0] = outerNode->Childs[0];
+      for (int i = 1; i < outerNode->ChildCount(); ++i)
+        solution.AddChild(*outerNode->Childs[i]);
+    }
+    else
+      solution.Clear();
   }
+}
+//------------------------------------------------------------------------------
+
+void ClipperOffset::DoOffset(double delta)
+{
+  m_destPolys.clear();
+  m_delta = delta;
 
-  out_polys.clear();
-  out_polys.resize(m_p.size());
-  for (m_i = 0; m_i < m_p.size(); m_i++)
+  //if Zero offset, just copy any CLOSED polygons to m_p and return ...
+  if (NEAR_ZERO(delta)) 
   {
-      size_t len = m_p[m_i].size();
+    m_destPolys.reserve(m_polyNodes.ChildCount());
+    for (int i = 0; i < m_polyNodes.ChildCount(); i++)
+    {
+      PolyNode& node = *m_polyNodes.Childs[i];
+      if (node.m_endtype == etClosedPolygon)
+        m_destPolys.push_back(node.Contour);
+    }
+    return;
+  }
 
-      if (len == 0 || (len < 3 && Delta <= 0)) continue;
-      
-      if (len == 1)
-      {
-        if (jointype == jtRound)
-        {
-// SAGA >>>          double X = 1.0, Y = 0.0;
-// SAGA >>>          for (cInt j = 1; j <= Round(m_Steps360 * 2 * pi); j++)
-// SAGA >>>          {
-// SAGA >>>            AddPoint(IntPoint(
-// SAGA >>>              Round(m_p[m_i][0].X + X * Delta),
-// SAGA >>>              Round(m_p[m_i][0].Y + Y * Delta)));
-// SAGA >>>            double X2 = X;
-// SAGA >>>            X = X * m_cos - m_sin * Y;
-// SAGA >>>            Y = X2 * m_sin + Y * m_cos;
-// SAGA >>>          }
-			 out_polys[m_i] = BuildArc(m_p[m_i][0], 0, 2*pi, Delta, m_Limit);	// <<< SAGA
-        } else
-        {
-          double X = -1.0, Y = -1.0;
-          for (int j = 0; j < 4; ++j)
-          {
-            AddPoint(IntPoint( Round(m_p[m_i][0].X + X * Delta),
-              Round(m_p[m_i][0].Y + Y * Delta)));
-            if (X < 0) X = 1;
-            else if (Y < 0) Y = 1;
-            else X = -1;
-          }
-        }
+  //see offset_triginometry3.svg in the documentation folder ...
+  if (MiterLimit > 2) m_miterLim = 2/(MiterLimit * MiterLimit);
+  else m_miterLim = 0.5;
+
+  double y;
+  if (ArcTolerance <= 0.0) y = def_arc_tolerance;
+  else if (ArcTolerance > std::fabs(delta) * def_arc_tolerance) 
+    y = std::fabs(delta) * def_arc_tolerance;
+  else y = ArcTolerance;
+  //see offset_triginometry2.svg in the documentation folder ...
+  double steps = pi / std::acos(1 - y / std::fabs(delta));
+  if (steps > std::fabs(delta) * pi) 
+    steps = std::fabs(delta) * pi;  //ie excessive precision check
+  m_sin = std::sin(two_pi / steps);
+  m_cos = std::cos(two_pi / steps);
+  m_StepsPerRad = steps / two_pi;
+  if (delta < 0.0) m_sin = -m_sin;
+
+  m_destPolys.reserve(m_polyNodes.ChildCount() * 2);
+  for (int i = 0; i < m_polyNodes.ChildCount(); i++)
+  {
+    PolyNode& node = *m_polyNodes.Childs[i];
+    m_srcPoly = node.Contour;
+
+    int len = (int)m_srcPoly.size();
+    if (len == 0 || (delta <= 0 && (len < 3 || node.m_endtype != etClosedPolygon)))
         continue;
-      }
 
-      //build normals ...
-      normals.clear();
-      normals.resize(len);
-      for (m_j = 0; m_j < len -1; ++m_j)
-          normals[m_j] = GetUnitNormal(m_p[m_i][m_j], m_p[m_i][m_j +1]);
-      if (endtype == etClosed) 
-        normals[len-1] = GetUnitNormal(m_p[m_i][len-1], m_p[m_i][0]);
-      else //is open polyline
-        normals[len-1] = normals[len-2];
-        
-      m_curr_poly = &out_polys[m_i];
-      m_curr_poly->reserve(len);
-
-      if (endtype == etClosed)
-      {
-        m_k = len -1;
-        for (m_j = 0; m_j < len; ++m_j)
-          OffsetPoint(jointype);
-      }
-      else //is open polyline
+    m_destPoly.clear();
+    if (len == 1)
+    {
+      if (node.m_jointype == jtRound)
       {
-        //offset the polyline going forward ...
-        m_k = 0;
-        for (m_j = 1; m_j < len -1; ++m_j)
-          OffsetPoint(jointype);
-
-        //handle the end (butt, round or square) ...
-        IntPoint pt1;
-        if (endtype == etButt)
-        {
-          m_j = len - 1;
-          pt1 = IntPoint(Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta), 
-            Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta));
-          AddPoint(pt1);
-          pt1 = IntPoint(Round(m_p[m_i][m_j].X - normals[m_j].X * m_delta), 
-            Round(m_p[m_i][m_j].Y - normals[m_j].Y * m_delta));
-          AddPoint(pt1);
-        } 
-        else
+        double X = 1.0, Y = 0.0;
+        for (cInt j = 1; j <= steps; j++)
         {
-          m_j = len - 1;
-          m_k = len - 2;
-          m_sinA = 0;
-          normals[m_j].X = -normals[m_j].X;
-          normals[m_j].Y = -normals[m_j].Y;
-          if (endtype == etSquare) 
-            DoSquare();
-          else 
-            DoRound();
+          m_destPoly.push_back(IntPoint(
+            Round(m_srcPoly[0].X + X * delta),
+            Round(m_srcPoly[0].Y + Y * delta)));
+          double X2 = X;
+          X = X * m_cos - m_sin * Y;
+          Y = X2 * m_sin + Y * m_cos;
         }
-
-        //re-build Normals ...
-        for (int j = len - 1; j > 0; --j)
-        {
-            normals[j].X = -normals[j - 1].X;
-            normals[j].Y = -normals[j - 1].Y;
-        }
-        normals[0].X = -normals[1].X;
-        normals[0].Y = -normals[1].Y;
-
-        //offset the polyline going backward ...
-        m_k = len -1;
-        for (m_j = m_k - 1; m_j > 0; --m_j)
-          OffsetPoint(jointype);
-
-        //finally handle the start (butt, round or square) ...
-        if (endtype == etButt) 
-        {
-          pt1 = IntPoint(Round(m_p[m_i][0].X - normals[0].X * m_delta), 
-            Round(m_p[m_i][0].Y - normals[0].Y * m_delta));
-          AddPoint(pt1);
-          pt1 = IntPoint(Round(m_p[m_i][0].X + normals[0].X * m_delta), 
-            Round(m_p[m_i][0].Y + normals[0].Y * m_delta));
-          AddPoint(pt1);
-        } else
+      }
+      else
+      {
+        double X = -1.0, Y = -1.0;
+        for (int j = 0; j < 4; ++j)
         {
-          m_sinA = 0;
-          m_k = 1;
-          if (endtype == etSquare) 
-            DoSquare(); 
-          else 
-            DoRound();
+          m_destPoly.push_back(IntPoint(
+            Round(m_srcPoly[0].X + X * delta),
+            Round(m_srcPoly[0].Y + Y * delta)));
+          if (X < 0) X = 1;
+          else if (Y < 0) Y = 1;
+          else X = -1;
         }
       }
+      m_destPolys.push_back(m_destPoly);
+      continue;
     }
+    //build m_normals ...
+    m_normals.clear();
+    m_normals.reserve(len);
+    for (int j = 0; j < len - 1; ++j)
+      m_normals.push_back(GetUnitNormal(m_srcPoly[j], m_srcPoly[j + 1]));
+    if (node.m_endtype == etClosedLine || node.m_endtype == etClosedPolygon)
+      m_normals.push_back(GetUnitNormal(m_srcPoly[len - 1], m_srcPoly[0]));
+    else
+      m_normals.push_back(DoublePoint(m_normals[len - 2]));
 
-    //and clean up untidy corners using Clipper ...
-    Clipper clpr;
-    clpr.AddPaths(out_polys, ptSubject, true);
-    if (Delta > 0)
+    if (node.m_endtype == etClosedPolygon)
+    {
+      int k = len - 1;
+      for (int j = 0; j < len; ++j)
+        OffsetPoint(j, k, node.m_jointype);
+      m_destPolys.push_back(m_destPoly);
+    }
+    else if (node.m_endtype == etClosedLine)
     {
-        if (!clpr.Execute(ctUnion, out_polys, pftPositive, pftPositive))
-            out_polys.clear();
+      int k = len - 1;
+      for (int j = 0; j < len; ++j)
+        OffsetPoint(j, k, node.m_jointype);
+      m_destPolys.push_back(m_destPoly);
+      m_destPoly.clear();
+      //re-build m_normals ...
+      DoublePoint n = m_normals[len -1];
+      for (int j = len - 1; j > 0; j--)
+        m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y);
+      m_normals[0] = DoublePoint(-n.X, -n.Y);
+      k = 0;
+      for (int j = len - 1; j >= 0; j--)
+        OffsetPoint(j, k, node.m_jointype);
+      m_destPolys.push_back(m_destPoly);
     }
     else
     {
-        IntRect r = clpr.GetBounds();
-        Path outer(4);
-        outer[0] = IntPoint(r.left - 10, r.bottom + 10);
-        outer[1] = IntPoint(r.right + 10, r.bottom + 10);
-        outer[2] = IntPoint(r.right + 10, r.top - 10);
-        outer[3] = IntPoint(r.left - 10, r.top - 10);
-
-        clpr.AddPath(outer, ptSubject, true);
-        clpr.ReverseSolution(true);
-        if (clpr.Execute(ctUnion, out_polys, pftNegative, pftNegative))
-            out_polys.erase(out_polys.begin());
+      int k = 0;
+      for (int j = 1; j < len - 1; ++j)
+        OffsetPoint(j, k, node.m_jointype);
+
+      IntPoint pt1;
+      if (node.m_endtype == etOpenButt)
+      {
+        int j = len - 1;
+        pt1 = IntPoint((cInt)Round(m_srcPoly[j].X + m_normals[j].X *
+          delta), (cInt)Round(m_srcPoly[j].Y + m_normals[j].Y * delta));
+        m_destPoly.push_back(pt1);
+        pt1 = IntPoint((cInt)Round(m_srcPoly[j].X - m_normals[j].X *
+          delta), (cInt)Round(m_srcPoly[j].Y - m_normals[j].Y * delta));
+        m_destPoly.push_back(pt1);
+      }
+      else
+      {
+        int j = len - 1;
+        k = len - 2;
+        m_sinA = 0;
+        m_normals[j] = DoublePoint(-m_normals[j].X, -m_normals[j].Y);
+        if (node.m_endtype == etOpenSquare)
+          DoSquare(j, k);
+        else
+          DoRound(j, k);
+      }
+
+      //re-build m_normals ...
+      for (int j = len - 1; j > 0; j--)
+        m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y);
+      m_normals[0] = DoublePoint(-m_normals[1].X, -m_normals[1].Y);
+
+      k = len - 1;
+      for (int j = k - 1; j > 0; --j) OffsetPoint(j, k, node.m_jointype);
+
+      if (node.m_endtype == etOpenButt)
+      {
+        pt1 = IntPoint((cInt)Round(m_srcPoly[0].X - m_normals[0].X * delta),
+          (cInt)Round(m_srcPoly[0].Y - m_normals[0].Y * delta));
+        m_destPoly.push_back(pt1);
+        pt1 = IntPoint((cInt)Round(m_srcPoly[0].X + m_normals[0].X * delta),
+          (cInt)Round(m_srcPoly[0].Y + m_normals[0].Y * delta));
+        m_destPoly.push_back(pt1);
+      }
+      else
+      {
+        k = 1;
+        m_sinA = 0;
+        if (node.m_endtype == etOpenSquare)
+          DoSquare(0, 1);
         else
-            out_polys.clear();
+          DoRound(0, 1);
+      }
+      m_destPolys.push_back(m_destPoly);
     }
+  }
 }
 //------------------------------------------------------------------------------
 
-private:
-
-void OffsetPoint(JoinType jointype)
+void ClipperOffset::OffsetPoint(int j, int& k, JoinType jointype)
 {
-  m_sinA = (normals[m_k].X * normals[m_j].Y - normals[m_j].X * normals[m_k].Y);
-  if (std::fabs(m_sinA) < 0.00005) return; //ie collinear
-  else if (m_sinA > 1.0) m_sinA = 1.0; 
+  m_sinA = (m_normals[k].X * m_normals[j].Y - m_normals[j].X * m_normals[k].Y);
+  if (m_sinA < 0.00005 && m_sinA > -0.00005) return;
+  else if (m_sinA > 1.0) m_sinA = 1.0;
   else if (m_sinA < -1.0) m_sinA = -1.0;
 
   if (m_sinA * m_delta < 0)
   {
-    AddPoint(IntPoint(Round(m_p[m_i][m_j].X + normals[m_k].X * m_delta),
-      Round(m_p[m_i][m_j].Y + normals[m_k].Y * m_delta)));
-    AddPoint(m_p[m_i][m_j]);
-    AddPoint(IntPoint(Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta),
-      Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta)));
+    m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta),
+      Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta)));
+    m_destPoly.push_back(m_srcPoly[j]);
+    m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[j].X * m_delta),
+      Round(m_srcPoly[j].Y + m_normals[j].Y * m_delta)));
   }
   else
     switch (jointype)
-      {
-        case jtMiter:
+    {
+      case jtMiter:
         {
-          double r = 1 + (normals[m_j].X*normals[m_k].X + 
-            normals[m_j].Y*normals[m_k].Y);
-          if (r >= m_miterLim) DoMiter(r); else DoSquare();
+          double r = 1 + (m_normals[j].X * m_normals[k].X +
+            m_normals[j].Y * m_normals[k].Y);
+          if (r >= m_miterLim) DoMiter(j, k, r); else DoSquare(j, k);
           break;
         }
-        case jtSquare: DoSquare(); break;
-        case jtRound: DoRound(); break;
-      }
-      m_k = m_j;
+      case jtSquare: DoSquare(j, k); break;
+      case jtRound: DoRound(j, k); break;
+    }
+  k = j;
 }
 //------------------------------------------------------------------------------
 
-void AddPoint(const IntPoint& Pt)
+void ClipperOffset::DoSquare(int j, int k)
 {
-    if (m_curr_poly->size() == m_curr_poly->capacity())
-        m_curr_poly->reserve(m_curr_poly->capacity() + buffLength);
-    m_curr_poly->push_back(Pt);
+  double dx = std::tan(std::atan2(m_sinA,
+      m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y) / 4);
+  m_destPoly.push_back(IntPoint(
+      Round(m_srcPoly[j].X + m_delta * (m_normals[k].X - m_normals[k].Y * dx)),
+      Round(m_srcPoly[j].Y + m_delta * (m_normals[k].Y + m_normals[k].X * dx))));
+  m_destPoly.push_back(IntPoint(
+      Round(m_srcPoly[j].X + m_delta * (m_normals[j].X + m_normals[j].Y * dx)),
+      Round(m_srcPoly[j].Y + m_delta * (m_normals[j].Y - m_normals[j].X * dx))));
 }
 //------------------------------------------------------------------------------
 
-void DoSquare()
+void ClipperOffset::DoMiter(int j, int k, double r)
 {
-  double Dx = std::tan(std::atan2(m_sinA, 
-    normals[m_k].X * normals[m_j].X + normals[m_k].Y * normals[m_j].Y)/4);
-  AddPoint(IntPoint(
-    Round(m_p[m_i][m_j].X + m_delta * (normals[m_k].X - normals[m_k].Y *Dx)),
-    Round(m_p[m_i][m_j].Y + m_delta * (normals[m_k].Y + normals[m_k].X *Dx))));
-  AddPoint(IntPoint(
-    Round(m_p[m_i][m_j].X + m_delta * (normals[m_j].X + normals[m_j].Y *Dx)),
-    Round(m_p[m_i][m_j].Y + m_delta * (normals[m_j].Y - normals[m_j].X *Dx))));
+  double q = m_delta / r;
+  m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + (m_normals[k].X + m_normals[j].X) * q),
+      Round(m_srcPoly[j].Y + (m_normals[k].Y + m_normals[j].Y) * q)));
 }
 //------------------------------------------------------------------------------
 
-void DoMiter(double r)
+void ClipperOffset::DoRound(int j, int k)
 {
-    double q = m_delta / r;
-    AddPoint(IntPoint(Round(m_p[m_i][m_j].X + (normals[m_k].X + normals[m_j].X) * q),
-        Round(m_p[m_i][m_j].Y + (normals[m_k].Y + normals[m_j].Y) * q)));
+  double a = std::atan2(m_sinA,
+  m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y);
+  int steps = (int)Round(m_StepsPerRad * std::fabs(a));
+
+  double X = m_normals[k].X, Y = m_normals[k].Y, X2;
+  for (int i = 0; i < steps; ++i)
+  {
+    m_destPoly.push_back(IntPoint(
+        Round(m_srcPoly[j].X + X * m_delta),
+        Round(m_srcPoly[j].Y + Y * m_delta)));
+    X2 = X;
+    X = X * m_cos - m_sin * Y;
+    Y = X2 * m_sin + Y * m_cos;
+  }
+  m_destPoly.push_back(IntPoint(
+  Round(m_srcPoly[j].X + m_normals[j].X * m_delta),
+  Round(m_srcPoly[j].Y + m_normals[j].Y * m_delta)));
 }
+
+//------------------------------------------------------------------------------
+// Miscellaneous public functions
 //------------------------------------------------------------------------------
 
-// SAGA >>> replaced with function from clipper 1.5.6; modification, buildarcs() adds vertices in constant angle steps
-void DoRound()
+void Clipper::DoSimplePolygons()
 {
-// SAGA >>>   double a = std::atan2(m_sinA, 
-// SAGA >>>     normals[m_k].X * normals[m_j].X + normals[m_k].Y * normals[m_j].Y);
-// SAGA >>>   int steps = (int)Round(m_Steps360 * std::fabs(a));
-// SAGA >>> 
-// SAGA >>>   double X = normals[m_k].X, Y = normals[m_k].Y, X2;
-// SAGA >>>   for (int i = 0; i < steps; ++i)
-// SAGA >>>   {
-// SAGA >>>     AddPoint(IntPoint(
-// SAGA >>>       Round(m_p[m_i][m_j].X + X * m_delta),
-// SAGA >>>       Round(m_p[m_i][m_j].Y + Y * m_delta)));
-// SAGA >>>     X2 = X;
-// SAGA >>>     X = X * m_cos - m_sin * Y;
-// SAGA >>>     Y = X2 * m_sin + Y * m_cos;
-// SAGA >>>   }
-// SAGA >>>   AddPoint(IntPoint(
-// SAGA >>>     Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta),
-// SAGA >>>     Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta)));
-
-	IntPoint pt1 = IntPoint(Round(m_p[m_i][m_j].X + normals[m_k].X * m_delta),
-        Round(m_p[m_i][m_j].Y + normals[m_k].Y * m_delta));
-    IntPoint pt2 = IntPoint(Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta),
-        Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta));
-    AddPoint(pt1);
-    //round off reflex angles (ie > 180 deg) unless almost flat (ie < ~10deg).
-    if ((normals[m_k].X*normals[m_j].Y - normals[m_j].X*normals[m_k].Y) * m_delta >= 0)
+  PolyOutList::size_type i = 0;
+  while (i < m_PolyOuts.size()) 
+  {
+    OutRec* outrec = m_PolyOuts[i++];
+    OutPt* op = outrec->Pts;
+    if (!op) continue;
+    do //for each Pt in Polygon until duplicate found do ...
     {
-      if (normals[m_j].X * normals[m_k].X + normals[m_j].Y * normals[m_k].Y < 0.985)
+      OutPt* op2 = op->Next;
+      while (op2 != outrec->Pts) 
       {
-        double a1 = std::atan2(normals[m_k].Y, normals[m_k].X);
-        double a2 = std::atan2(normals[m_j].Y, normals[m_j].X);
-        if (m_delta > 0 && a2 < a1) a2 += pi *2;
-        else if (m_delta < 0 && a2 > a1) a2 -= pi *2;
-        Path arc = BuildArc(m_p[m_i][m_j], a1, a2, m_delta, m_Limit);
-        for (Path::size_type m = 0; m < arc.size(); m++)
-          AddPoint(arc[m]);
+        if ((op->Pt == op2->Pt) && op2->Next != op && op2->Prev != op) 
+        {
+          //split the polygon into two ...
+          OutPt* op3 = op->Prev;
+          OutPt* op4 = op2->Prev;
+          op->Prev = op4;
+          op4->Next = op;
+          op2->Prev = op3;
+          op3->Next = op2;
+
+          outrec->Pts = op;
+          OutRec* outrec2 = CreateOutRec();
+          outrec2->Pts = op2;
+          UpdateOutPtIdxs(*outrec2);
+          if (Poly2ContainsPoly1(outrec2->Pts, outrec->Pts))
+          {
+            //OutRec2 is contained by OutRec1 ...
+            outrec2->IsHole = !outrec->IsHole;
+            outrec2->FirstLeft = outrec;
+          }
+          else
+            if (Poly2ContainsPoly1(outrec->Pts, outrec2->Pts))
+          {
+            //OutRec1 is contained by OutRec2 ...
+            outrec2->IsHole = outrec->IsHole;
+            outrec->IsHole = !outrec2->IsHole;
+            outrec2->FirstLeft = outrec->FirstLeft;
+            outrec->FirstLeft = outrec2;
+          } else
+          {
+            //the 2 polygons are separate ...
+            outrec2->IsHole = outrec->IsHole;
+            outrec2->FirstLeft = outrec->FirstLeft;
+          }
+          op2 = op; //ie get ready for the Next iteration
+        }
+        op2 = op2->Next;
       }
+      op = op->Next;
     }
-    else
-      AddPoint(m_p[m_i][m_j]);
-    AddPoint(pt2);
-}
-//--------------------------------------------------------------------------
-
-// SAGA >>> removed function from clipper 1.5.6; modification, adds vertices in constant angle steps
-Path BuildArc(const IntPoint &pt, const double a1, const double a2, const double r, double limit)
-{
-  int steps = std::max(2, int(std::fabs(a2 - a1) / limit));	// SAGA: number of steps fitted to step size 'limit' (radians)
-
-  double x = std::cos(a1); 
-  double y = std::sin(a1);
-  double c = std::cos((a2 - a1) / steps);
-  double s = std::sin((a2 - a1) / steps);
-  Path result(steps +1);
-  for (int i = 0; i <= steps; ++i)
-  {
-      result[i].X = pt.X + Round(x * r);
-      result[i].Y = pt.Y + Round(y * r);
-      double x2 = x;
-      x = x * c - s * y;  //cross product
-      y = x2 * s + y * c; //dot product
+    while (op != outrec->Pts);
   }
-  return result;
-}	// <<< SAGA
+}
 //------------------------------------------------------------------------------
 
-}; //end PolyOffsetBuilder
-
-//------------------------------------------------------------------------------
+void ReversePath(Path& p)
+{
+  std::reverse(p.begin(), p.end());
+}
 //------------------------------------------------------------------------------
 
-void StripDupsAndGetBotPt(Path& in_path, Path& out_path, bool closed, IntPoint* botPt)
+void ReversePaths(Paths& p)
 {
-  botPt = 0;
-  size_t len = in_path.size();
-  if (closed)    
-    while (len > 0 && (in_path[0] == in_path[len -1])) len--;
-  if (len == 0) return;
-  out_path.resize(len);
-  int j = 0;
-  out_path[0] = in_path[0];
-  botPt = &out_path[0];
-  for (size_t i = 1; i < len; ++i)
-    if (in_path[i] != out_path[j])
-    {
-      j++;
-      out_path[j] = in_path[i];
-      if (out_path[j].Y > botPt->Y)
-        botPt = &out_path[j];
-      else if ((out_path[j].Y == botPt->Y) && out_path[j].X < botPt->X) 
-        botPt = &out_path[j];
-    }
-  j++;
-  if (j < 2 || (closed && (j == 2))) j = 0;
-  out_path.resize(j);
+  for (Paths::size_type i = 0; i < p.size(); ++i)
+    ReversePath(p[i]);
 }
 //------------------------------------------------------------------------------
 
-void OffsetPaths(const Paths &in_polys, Paths &out_polys,
-  double delta, JoinType jointype, EndType endtype, double limit)
+void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType)
 {
-  //just in case in_polys == &out_polys ...
-  Paths inPolys = Paths(in_polys);
-  out_polys.clear();
-  out_polys.resize(inPolys.size());
-
-  IntPoint *botPt = 0, *pt = 0;
-  int botIdx = -1;
-  for (size_t i = 0; i < in_polys.size(); ++i)
-  {
-    StripDupsAndGetBotPt(inPolys[i], out_polys[i], endtype == etClosed, pt);
-    if (botPt) 
-      if (!botPt || pt->Y > botPt->Y || (pt->Y == botPt->Y && pt->X < botPt->X))
-      {
-        botPt = pt;
-        botIdx = i;
-      }
-
-  }
-  if (endtype == etClosed && botIdx >= 0 && !Orientation(inPolys[botIdx]))
-      ReversePaths(inPolys);
-
-  OffsetBuilder(inPolys, out_polys, delta, jointype, endtype, limit);
+  Clipper c;
+  c.StrictlySimple(true);
+  c.AddPath(in_poly, ptSubject, true);
+  c.Execute(ctUnion, out_polys, fillType, fillType);
 }
 //------------------------------------------------------------------------------
 
@@ -4410,27 +4328,27 @@ inline double DistanceSqrd(const IntPoint& pt1, const IntPoint& pt2)
 }
 //------------------------------------------------------------------------------
 
-DoublePoint ClosestPointOnLine(const IntPoint& Pt, const IntPoint& linePt1, const IntPoint& linePt2)
+double DistanceFromLineSqrd(
+  const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2)
 {
-  double Dx = ((double)linePt2.X - linePt1.X);
-  double dy = ((double)linePt2.Y - linePt1.Y);
-  if (Dx == 0 && dy == 0) 
-    return DoublePoint((double)linePt1.X, (double)linePt1.Y);
-  double q = ((Pt.X-linePt1.X)*Dx + (Pt.Y-linePt1.Y)*dy) / (Dx*Dx + dy*dy);
-  return DoublePoint(
-    (1-q)*linePt1.X + q*linePt2.X,
-    (1-q)*linePt1.Y + q*linePt2.Y);
+  //The equation of a line in general form (Ax + By + C = 0)
+  //given 2 points (x�,y�) & (x�,y�) is ...
+  //(y� - y�)x + (x� - x�)y + (y� - y�)x� - (x� - x�)y� = 0
+  //A = (y� - y�); B = (x� - x�); C = (y� - y�)x� - (x� - x�)y�
+  //perpendicular distance of point (x�,y�) = (Ax� + By� + C)/Sqrt(A� + B�)
+  //see http://en.wikipedia.org/wiki/Perpendicular_distance
+  double A = double(ln1.Y - ln2.Y);
+  double B = double(ln2.X - ln1.X);
+  double C = A * ln1.X  + B * ln1.Y;
+  C = A * pt.X + B * pt.Y - C;
+  return (C * C) / (A * A + B * B);
 }
-//------------------------------------------------------------------------------
+//---------------------------------------------------------------------------
 
 bool SlopesNearCollinear(const IntPoint& pt1, 
     const IntPoint& pt2, const IntPoint& pt3, double distSqrd)
 {
-  if (DistanceSqrd(pt1, pt2) > DistanceSqrd(pt1, pt3)) return false;
-  DoublePoint cpol = ClosestPointOnLine(pt2, pt1, pt3);
-  double Dx = pt2.X - cpol.X;
-  double dy = pt2.Y - cpol.Y;
-  return (Dx*Dx + dy*dy) < distSqrd;
+  return DistanceFromLineSqrd(pt2, pt1, pt3) < distSqrd;
 }
 //------------------------------------------------------------------------------
 
@@ -4442,35 +4360,73 @@ bool PointsAreClose(IntPoint pt1, IntPoint pt2, double distSqrd)
 }
 //------------------------------------------------------------------------------
 
+OutPt* ExcludeOp(OutPt* op)
+{
+  OutPt* result = op->Prev;
+  result->Next = op->Next;
+  op->Next->Prev = result;
+  result->Idx = 0;
+  return result;
+}
+//------------------------------------------------------------------------------
+
 void CleanPolygon(const Path& in_poly, Path& out_poly, double distance)
 {
   //distance = proximity in units/pixels below which vertices
   //will be stripped. Default ~= sqrt(2).
-  int highI = in_poly.size() -1;
-  double distSqrd = distance * distance;
-  while (highI > 0 && PointsAreClose(in_poly[highI], in_poly[0], distSqrd)) highI--;
-  if (highI < 2) { out_poly.clear(); return; }
   
-  if (&in_poly != &out_poly) 
-    out_poly.resize(highI + 1);
+  size_t size = in_poly.size();
+  
+  if (size == 0) 
+  {
+    out_poly.clear();
+    return;
+  }
 
-  IntPoint Pt = in_poly[highI];
-  int i = 0, k = 0;
-  for (;;)
+  OutPt* outPts = new OutPt[size];
+  for (size_t i = 0; i < size; ++i)
+  {
+    outPts[i].Pt = in_poly[i];
+    outPts[i].Next = &outPts[(i + 1) % size];
+    outPts[i].Next->Prev = &outPts[i];
+    outPts[i].Idx = 0;
+  }
+
+  double distSqrd = distance * distance;
+  OutPt* op = &outPts[0];
+  while (op->Idx == 0 && op->Next != op->Prev) 
+  {
+    if (PointsAreClose(op->Pt, op->Prev->Pt, distSqrd))
+    {
+      op = ExcludeOp(op);
+      size--;
+    } 
+    else if (PointsAreClose(op->Prev->Pt, op->Next->Pt, distSqrd))
+    {
+      ExcludeOp(op->Next);
+      op = ExcludeOp(op);
+      size -= 2;
+    }
+    else if (SlopesNearCollinear(op->Prev->Pt, op->Pt, op->Next->Pt, distSqrd))
+    {
+      op = ExcludeOp(op);
+      size--;
+    }
+    else
+    {
+      op->Idx = 1;
+      op = op->Next;
+    }
+  }
+
+  if (size < 3) size = 0;
+  out_poly.resize(size);
+  for (size_t i = 0; i < size; ++i)
   {
-    while (i < highI && PointsAreClose(Pt, in_poly[i+1], distSqrd)) i+=2;
-    int i2 = i;
-    while (i < highI && (PointsAreClose(in_poly[i], in_poly[i+1], distSqrd) ||
-      SlopesNearCollinear(Pt, in_poly[i], in_poly[i+1], distSqrd))) i++;
-    if (i >= highI) break;
-    else if (i != i2) continue;
-    Pt = in_poly[i++];
-    out_poly[k++] = Pt;
+    out_poly[i] = op->Pt;
+    op = op->Next;
   }
-  if (i <= highI) out_poly[k++] = in_poly[i];
-  if (k > 2 && SlopesNearCollinear(out_poly[k -2], out_poly[k -1], out_poly[0], distSqrd)) k--;    
-  if (k < 3) out_poly.clear();
-  else if (k <= highI) out_poly.resize(k);
+  delete [] outPts;
 }
 //------------------------------------------------------------------------------
 
@@ -4493,7 +4449,7 @@ void CleanPolygons(Paths& polys, double distance)
 }
 //------------------------------------------------------------------------------
 
-void Minkowki(const Path& poly, const Path& path, 
+void Minkowski(const Path& poly, const Path& path, 
   Paths& solution, bool isSum, bool isClosed)
 {
   int delta = (isClosed ? 1 : 0);
@@ -4522,8 +4478,8 @@ void Minkowki(const Path& poly, const Path& path,
 
   Paths quads; 
   quads.reserve((pathCnt + delta) * (polyCnt + 1));
-  for (size_t i = 0; i <= pathCnt - 2 + delta; ++i)
-    for (size_t j = 0; j <= polyCnt - 1; ++j)
+  for (size_t i = 0; i < pathCnt - 1 + delta; ++i)
+    for (size_t j = 0; j < polyCnt; ++j)
     {
       Path quad;
       quad.reserve(4);
@@ -4541,15 +4497,30 @@ void Minkowki(const Path& poly, const Path& path,
 }
 //------------------------------------------------------------------------------
 
-void MinkowkiSum(const Path& poly, const Path& path, Paths& solution, bool isClosed)
+void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed)
+{
+  Minkowski(pattern, path, solution, true, pathIsClosed);
+}
+//------------------------------------------------------------------------------
+
+void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, 
+    PolyFillType pathFillType, bool pathIsClosed)
 {
-  Minkowki(poly, path, solution, true, isClosed);
+  Clipper c;
+  for (size_t i = 0; i < paths.size(); ++i)
+  {
+    Paths tmp;
+    Minkowski(pattern, paths[i], tmp, true, pathIsClosed);
+    c.AddPaths(tmp, ptSubject, true);
+  }
+  if (pathIsClosed) c.AddPaths(paths, ptClip, true);
+  c.Execute(ctUnion, solution, pathFillType, pathFillType);
 }
 //------------------------------------------------------------------------------
 
-void MinkowkiDiff(const Path& poly, const Path& path, Paths& solution, bool isClosed)
+void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution)
 {
-  Minkowki(poly, path, solution, false, isClosed);
+  Minkowski(poly1, poly2, solution, false, true);
 }
 //------------------------------------------------------------------------------
 
@@ -4623,45 +4594,16 @@ std::ostream& operator <<(std::ostream &s, const Paths &p)
 //------------------------------------------------------------------------------
 
 #ifdef use_deprecated
-bool ClipperBase::AddPolygon(const Path &pg, PolyType PolyTyp)
-{
-  return AddPath(pg, PolyTyp, true);
-}
-//------------------------------------------------------------------------------
 
-bool ClipperBase::AddPolygons(const Paths &ppg, PolyType PolyTyp)
-{
-  bool result = false;
-  for (Paths::size_type i = 0; i < ppg.size(); ++i)
-    if (AddPath(ppg[i], PolyTyp, true)) result = true;
-  return result;
-}
-//------------------------------------------------------------------------------
-
-void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
-  double delta, JoinType jointype, double limit, bool autoFix)
-{
-  OffsetPaths(in_polys, out_polys, delta, jointype, etClosed, limit);
-}
-//------------------------------------------------------------------------------
-
-void PolyTreeToPolygons(const PolyTree& polytree, Paths& paths)
-{
-  PolyTreeToPaths(polytree, paths);
-}
-//------------------------------------------------------------------------------
-
-void ReversePolygon(Path& p)
+void OffsetPaths(const Paths &in_polys, Paths &out_polys,
+  double delta, JoinType jointype, EndType_ endtype, double limit)
 {
-  std::reverse(p.begin(), p.end());
+  ClipperOffset co(limit, limit);
+  co.AddPaths(in_polys, jointype, (EndType)endtype); 
+  co.Execute(out_polys, delta);
 }
 //------------------------------------------------------------------------------
 
-void ReversePolygons(Paths& p)
-{
-  for (Paths::size_type i = 0; i < p.size(); ++i)
-    ReversePolygon(p[i]);
-}
 #endif
 
 
diff --git a/src/saga_core/saga_api/clipper.hpp b/src/saga_core/saga_api/clipper.hpp
index e59e202..20791c7 100644
--- a/src/saga_core/saga_api/clipper.hpp
+++ b/src/saga_core/saga_api/clipper.hpp
@@ -1,10 +1,10 @@
 /*******************************************************************************
 *                                                                              *
 * Author    :  Angus Johnson                                                   *
-* Version   :  6.0.0                                                           *
-* Date      :  30 October 2013                                                 *
+* Version   :  6.1.3a                                                          *
+* Date      :  22 January 2014                                                 *
 * Website   :  http://www.angusj.com                                           *
-* Copyright :  Angus Johnson 2010-2013                                         *
+* Copyright :  Angus Johnson 2010-2014                                         *
 *                                                                              *
 * License:                                                                     *
 * Use, modification & distribution is subject to Boost Software License Ver 1. *
@@ -34,7 +34,7 @@
 #ifndef clipper_hpp
 #define clipper_hpp
 
-#define CLIPPER_VERSION "6.0.0"
+#define CLIPPER_VERSION "6.1.3"
 
 //use_int32: When enabled 32bit ints are used instead of 64bit ints. This
 //improve performance but coordinate values are limited to the range +/- 46340
@@ -46,10 +46,9 @@
 //use_lines: Enables line clipping. Adds a very minor cost to performance.
 #define use_lines
   
-//When enabled, code developed with earlier versions of Clipper 
-//(ie prior to ver 6) should compile without changes. 
-//In a future update, this compatability code will be removed.
-#define use_deprecated  
+//use_deprecated: Enables support for the obsolete OffsetPaths() function
+//which has been replace with the ClipperOffset class.
+//#define use_deprecated  
 
 #include <vector>
 #include <set>
@@ -108,12 +107,6 @@ std::ostream& operator <<(std::ostream &s, const IntPoint &p);
 std::ostream& operator <<(std::ostream &s, const Path &p);
 std::ostream& operator <<(std::ostream &s, const Paths &p);
 
-#ifdef use_deprecated
-typedef signed long long long64; //backward compatibility only
-typedef Path Polygon;
-typedef Paths Polygons;
-#endif
-
 struct DoublePoint
 {
   double X;
@@ -127,6 +120,13 @@ struct DoublePoint
 typedef void (*TZFillCallback)(IntPoint& z1, IntPoint& z2, IntPoint& pt);
 #endif
 
+enum InitOptions {ioReverseSolution = 1, ioStrictlySimple = 2, ioPreserveCollinear = 4};
+enum JoinType {jtSquare, jtRound, jtMiter};
+enum EndType {etClosedPolygon, etClosedLine, etOpenButt, etOpenSquare, etOpenRound};
+#ifdef use_deprecated
+  enum EndType_ {etClosed, etButt = 2, etSquare, etRound};
+#endif
+
 class PolyNode;
 typedef std::vector< PolyNode* > PolyNodes;
 
@@ -142,11 +142,14 @@ public:
     bool IsOpen() const;
     int ChildCount() const;
 private:
+    unsigned Index; //node index in Parent.Childs
     bool m_IsOpen;
+    JoinType m_jointype;
+    EndType m_endtype;
     PolyNode* GetNextSiblingUp() const;
-    unsigned Index; //node index in Parent.Childs
     void AddChild(PolyNode& child);
     friend class Clipper; //to access Index
+    friend class ClipperOffset; 
 };
 
 class PolyTree: public PolyNode
@@ -161,24 +164,15 @@ private:
     friend class Clipper; //to access AllNodes
 };
 
-enum InitOptions {ioReverseSolution = 1, ioStrictlySimple = 2, ioPreserveCollinear = 4};
-enum JoinType {jtSquare, jtRound, jtMiter};
-enum EndType {etClosed, etButt, etSquare, etRound};
-
 bool Orientation(const Path &poly);
 double Area(const Path &poly);
+int PointInPolygon(const IntPoint &pt, const Path &path);
 
 #ifdef use_deprecated
-  void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
-    double delta, JoinType jointype = jtSquare, double limit = 0, bool autoFix = true);
-  void PolyTreeToPolygons(const PolyTree& polytree, Paths& paths);
-  void ReversePolygon(Path& p);
-  void ReversePolygons(Paths& p);
+  void OffsetPaths(const Paths &in_polys, Paths &out_polys,
+    double delta, JoinType jointype, EndType_ endtype, double limit = 0);
 #endif
 
-void OffsetPaths(const Paths &in_polys, Paths &out_polys,
-  double delta, JoinType jointype, EndType endtype, double limit = 0);
-
 void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
 void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
 void SimplifyPolygons(Paths &polys, PolyFillType fillType = pftEvenOdd);
@@ -188,8 +182,10 @@ void CleanPolygon(Path& poly, double distance = 1.415);
 void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance = 1.415);
 void CleanPolygons(Paths& polys, double distance = 1.415);
 
-void MinkowkiSum(const Path& poly, const Path& path, Paths& solution, bool isClosed);
-void MinkowkiDiff(const Path& poly, const Path& path, Paths& solution, bool isClosed);
+void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed);
+void MinkowskiSum(const Path& pattern, const Paths& paths, 
+  Paths& solution, PolyFillType pathFillType, bool pathIsClosed);
+void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution);
 
 void PolyTreeToPaths(const PolyTree& polytree, Paths& paths);
 void ClosedPathsFromPolyTree(const PolyTree& polytree, Paths& paths);
@@ -215,6 +211,8 @@ struct Join;
 typedef std::vector < OutRec* > PolyOutList;
 typedef std::vector < TEdge* > EdgeList;
 typedef std::vector < Join* > JoinList;
+typedef std::vector < IntersectNode* > IntersectList;
+
 
 //------------------------------------------------------------------------------
 
@@ -228,12 +226,6 @@ public:
   virtual ~ClipperBase();
   bool AddPath(const Path &pg, PolyType PolyTyp, bool Closed);
   bool AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed);
-
-#ifdef use_deprecated
-  bool AddPolygon(const Path &pg, PolyType PolyTyp);
-  bool AddPolygons(const Paths &ppg, PolyType PolyTyp);
-#endif
-
   virtual void Clear();
   IntRect GetBounds();
   bool PreserveCollinear() {return m_PreserveCollinear;};
@@ -243,6 +235,7 @@ protected:
   TEdge* AddBoundsToLML(TEdge *e, bool IsClosed);
   void PopLocalMinima();
   virtual void Reset();
+  TEdge* ProcessBound(TEdge* E, bool IsClockwise);
   void InsertLocalMinima(LocalMinima *newLm);
   void DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed);
   TEdge* DescendToMin(TEdge *&E);
@@ -269,7 +262,6 @@ public:
     PolyTree &polytree,
     PolyFillType subjFillType = pftEvenOdd,
     PolyFillType clipFillType = pftEvenOdd);
-  void Clear();
   bool ReverseSolution() {return m_ReverseOutput;};
   void ReverseSolution(bool value) {m_ReverseOutput = value;};
   bool StrictlySimple() {return m_StrictSimple;};
@@ -285,11 +277,11 @@ private:
   PolyOutList       m_PolyOuts;
   JoinList          m_Joins;
   JoinList          m_GhostJoins;
+  IntersectList     m_IntersectList;
   ClipType          m_ClipType;
   std::set< cInt, std::greater<cInt> > m_Scanbeam;
   TEdge           *m_ActiveEdges;
   TEdge           *m_SortedEdges;
-  IntersectNode   *m_IntersectNodes;
   bool             m_ExecuteLocked;
   PolyFillType     m_ClipFillType;
   PolyFillType     m_SubjFillType;
@@ -330,7 +322,6 @@ private:
   void DisposeAllOutRecs();
   void DisposeOutRec(PolyOutList::size_type index);
   bool ProcessIntersections(const cInt botY, const cInt topY);
-  void InsertIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt);
   void BuildIntersectList(const cInt botY, const cInt topY);
   void ProcessIntersectList();
   void ProcessEdgesAtTopOfScanbeam(const cInt topY);
@@ -341,12 +332,13 @@ private:
   bool FixupIntersectionOrder();
   void FixupOutPolygon(OutRec &outrec);
   bool IsHole(TEdge *e);
+  bool FindOwnerFromSplitRecs(OutRec &outRec, OutRec *&currOrfl);
   void FixHoleLinkage(OutRec &outrec);
   void AddJoin(OutPt *op1, OutPt *op2, const IntPoint offPt);
   void ClearJoins();
   void ClearGhostJoins();
   void AddGhostJoin(OutPt *op, const IntPoint offPt);
-  bool JoinPoints(const Join *j, OutPt *&p1, OutPt *&p2);
+  bool JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2);
   void JoinCommonEdges();
   void DoSimplePolygons();
   void FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec);
@@ -357,6 +349,37 @@ private:
 };
 //------------------------------------------------------------------------------
 
+class ClipperOffset 
+{
+public:
+  ClipperOffset(double miterLimit = 2.0, double roundPrecision = 0.25);
+  ~ClipperOffset();
+  void AddPath(const Path& path, JoinType joinType, EndType endType);
+  void AddPaths(const Paths& paths, JoinType joinType, EndType endType);
+  void Execute(Paths& solution, double delta);
+  void Execute(PolyTree& solution, double delta);
+  void Clear();
+  double MiterLimit;
+  double ArcTolerance;
+private:
+  Paths m_destPolys;
+  Path m_srcPoly;
+  Path m_destPoly;
+  std::vector<DoublePoint> m_normals;
+  double m_delta, m_sinA, m_sin, m_cos;
+  double m_miterLim, m_StepsPerRad;
+  IntPoint m_lowest;
+  PolyNode m_polyNodes;
+
+  void FixOrientations();
+  void DoOffset(double delta);
+  void OffsetPoint(int j, int& k, JoinType jointype);
+  void DoSquare(int j, int k);
+  void DoMiter(int j, int k, double r);
+  void DoRound(int j, int k);
+};
+//------------------------------------------------------------------------------
+
 class clipperException : public std::exception
 {
   public:
diff --git a/src/saga_core/saga_api/compatibility.h b/src/saga_core/saga_api/compatibility.h
new file mode 100644
index 0000000..b4011cf
--- /dev/null
+++ b/src/saga_core/saga_api/compatibility.h
@@ -0,0 +1,382 @@
+/**********************************************************
+ * Version $Id: compatibility.h 1924 2014-01-09 12:12:17Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_API                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   compatibility.h                     //
+//                                                       //
+//          Copyright (C) 2006 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__SAGA_API__compatibility_H
+#define HEADER_INCLUDED__SAGA_API__compatibility_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//
+// This header provides some compatibility for SAGA modules
+// developed on older API versions. 100% compatibility is
+// not warranted, particularly not for 1.x version, but it
+// may work for a whole part of it. For usage just include:
+//
+//     #include <saga_api/compatibility.h>
+//
+// instead of the header:
+//
+//     #include <saga_api/saga_api.h>
+//
+// Anyway, it is recommended to change your source codes to
+// the current SAGA API conventions. I hope this file helps
+// you to bridge the time until you get this done. O.C.
+//
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				SAGA 1.2 Compatibility					 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#if !defined(_TYPEDEF_BYTE)
+	#define _TYPEDEF_BYTE
+#endif
+
+#if !defined(_TYPEDEF_WORD)
+	#define _TYPEDEF_WORD
+#endif
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+#include <memory.h>
+
+//---------------------------------------------------------
+typedef struct
+{
+	int		xMin, yMin, xMax, yMax;
+}
+TGEO_iRect;
+
+//---------------------------------------------------------
+#define Set_Callback(a)						//
+
+#define PI2GRAD								M_RAD_TO_DEG
+#define GRAD2PI								M_DEG_TO_RAD
+#define M_PI_2								M_PI_090
+#define M_PI_4								M_PI_045
+#define ALMOST_ZERO							0.0001
+
+#ifndef RGB
+#define RGB									SG_GET_RGB
+#endif
+
+#define SYS_Malloc							SG_Malloc
+#define SYS_Calloc							SG_Calloc
+#define SYS_Realloc							SG_Realloc
+#define SYS_Free							SG_Free
+
+#define Get_SafeNew_Grid					SG_Create_Grid
+#define Get_DX								Get_Cellsize
+#define Get_DY								Get_Cellsize
+#define Get_Direction_Lowest(g, x, y)		(g)->Get_Gradient_NeighborDir(x, y)
+#define _Get_Gradient(g, x, y, a, b)		(g)->Get_Gradient(x, y, a, b)
+#define is_InGrid_Coord						is_InGrid_byPos
+#define Get_Value_AtPosition				Get_Value
+
+#define Add_Select							Add_Choice
+
+#define Get_Default_Parameters				Get_Parameters
+
+#define Progress_Set_Text					Process_Set_Text
+#define Progress_Check						Set_Progress
+#define Progress_Check_NXY					Set_Progress_NCells
+#define Progress_Check_Blink()				Process_Get_Okay(true)
+
+#define Get_NXY								Get_NCells
+#define Get_xWorld							Get_xPosition_Last
+#define Get_yWorld							Get_yPosition_Last
+#define Set_Lock							Lock_Set
+#define Get_Lock							Lock_Get
+#define Set_Dimension(g)					Get_System()->Assign(g->Get_System())
+
+#define On_Set_Position						Execute_Position
+
+#define MODULE_INTERFACE_INFO_Name			MLB_INFO_Name
+#define MODULE_INTERFACE_INFO_Author		MLB_INFO_Author
+#define MODULE_INTERFACE_INFO_Description	MLB_INFO_Description
+#define MODULE_INTERFACE_INFO_Version		MLB_INFO_Version
+#define MODULE_INTERFACE_INFO_Menu_Path		MLB_INFO_Menu_Path
+
+#define MODULE_INTERFACE_DLL_MAIN			MLB_INTERFACE
+#define Get_Module_Info						Get_Info
+
+//---------------------------------------------------------
+// ::Get_Callback()							: dropped
+// ::SYS_Set_StringCopy						: dropped, use CSG_String instead
+// ::SYS_Add_StringCopy						: dropped, use CSG_String instead
+// CSG_Shapes::Get_Table()						: returns now reference instead of pointer
+// CSG_Table::Update_Statistics()				: dropped
+// CColors::Set_Ramp()						: incompatible
+// CSG_Module_Grid::Get_Gradient()				: dropped, use CSG_Grid::Get_Gradient() instead
+// CSG_Module_Interactive::Execute_Finish()	: function has no arguments anymore
+// CSG_Module_Interactive::On_Set_Position()	: function has no 'callback' argument anymore
+// CSG_Module::Execute()						: function has no arguments anymore
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				SAGA 2.0 Beta Compatibility				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define PFNC_Callback					TSG_PFNC_UI_Callback
+#define API_Set_Callback				SG_Set_UI_Callback
+#define API_Get_Callback				SG_Get_UI_Callback
+#define API_Create_Grid					SG_Create_Grid
+#define API_Create_Shapes				SG_Create_Shapes
+#define API_Create_Table				SG_Create_Table
+#define API_Create_TIN					SG_Create_TIN
+#define API_Malloc						SG_Malloc
+#define API_Calloc						SG_Calloc
+#define API_Realloc						SG_Realloc
+#define API_Free						SG_Free
+#define API_Swap_Bytes					SG_Swap_Bytes
+#define API_DegreeStr2Double			SG_Degree_To_Double
+#define API_Double2DegreeStr			SG_Double_To_Degree
+#define API_DateStr2Double				SG_Date_To_Double
+#define API_Double2DateStr				SG_Double_To_Date
+#define API_Remove_File					SG_File_Delete
+#define API_Extract_File_Name			SG_File_Get_Name
+#define API_Extract_File_Path			SG_File_Get_Path
+#define API_Make_File_Path				SG_File_Make_Path
+#define API_Cmp_File_Extension			SG_File_Cmp_Extension
+
+#define API_Callback_					SG_UI_Callback_
+#define API_Directory_isValid			SG_Dir_isValid
+#define API_Directory_Make				SG_Dir_Create
+#define API_Read_						SG_Read_
+#define API_Write_						SG_Write_
+#define API_Get_						SG_Get_
+#define SG_Dir_isValid					SG_Dir_Exists
+
+
+//---------------------------------------------------------
+#define CMAT_Spline						CSG_Spline
+#define TMAT_Regression_Type			TSG_Regression_Type
+#define CMAT_Regression					CSG_Regression
+#define CMAT_Regression_Multiple		CSG_Regression_Multiple
+#define CMAT_Grid_Radius				CSG_Grid_Radius
+#define CMAT_Formula					CSG_Formula
+#define CMAT_Trend						CSG_Trend
+
+#define CAPI_String						CSG_String
+#define CAPI_Strings					CSG_Strings
+#define CTranslator						CSG_Translator
+#define COLOR_GET_						SG_GET_
+#define COLOR_DEF_						SG_COLOR_
+#define COLOR_PALETTE_					SG_COLORS_
+#define CColors							CSG_Colors
+#define CHistory_Entry					CSG_History_Entry
+#define CHistory						CSG_History
+
+#define TGEO_Intersection				TSG_Intersection
+#define TGEO_Point						TSG_Point
+#define CGEO_Point						CSG_Point
+#define CGEO_Points						CSG_Points
+#define TAPI_dPoint						TSG_Point
+#define CAPI_dPoints					CSG_Points
+#define TAPI_iPoint						TSG_Point_Int
+#define CAPI_iPoint						CSG_Points_Int
+#define TAPI_3D_dPoint					TSG_Point_3D
+#define CAPI_3D_dPoints					CSG_Points_3D
+#define TGEO_Rect						TSG_Rect
+#define CGEO_Rect						CSG_Rect
+#define CGEO_Rects						CSG_Rects
+
+#define GEO_Get_Distance				SG_Get_Distance
+#define GEO_Get_Angle_Of_Direction		SG_Get_Angle_Of_Direction
+#define GEO_Get_Crossing				SG_Get_Crossing
+#define GEO_Get_Crossing_InRegion		SG_Get_Crossing_InRegion
+#define GEO_Get_Nearest_Point_On_Line	SG_Get_Nearest_Point_On_Line
+#define GEO_Get_Triangle_CircumCircle	SG_Get_Triangle_CircumCircle
+#define GEO_Get_Polygon_Area			SG_Get_Polygon_Area
+
+#define CPDF_Document					CSG_Doc_PDF
+#define CHTML_Document					CSG_Doc_HTML
+#define CSVG_Graph						CSG_Doc_SVG
+
+//---------------------------------------------------------
+#define CDataObject						CSG_Data_Object
+#define CGrid							CSG_Grid
+#define CGrid_System					CSG_Grid_System
+#define CModule							CSG_Module
+#define CModule_Grid_Interactive		CSG_Module_Grid_Interactive
+#define CModule_Interactive				CSG_Module_Interactive
+#define CModule_Interactive_Base		CSG_Module_Interactive_Base
+#define CModule_Library_Interface		CSG_Module_Library_Interface
+#define CShape							CSG_Shape
+#define CShape_Line						CSG_Shape_Line
+#define CShape_Point					CSG_Shape_Point
+#define CShape_Points					CSG_Shape_Points
+#define CShape_Polygon					CSG_Shape_Polygon
+#define CShapes							CSG_Shapes
+#define CShape_Search					CSG_Shape_Search
+#define CTable							CSG_Table
+#define CTable_DBase					CSG_Table_DBase
+#define CTable_Record					CSG_Table_Record
+#define CTable_Value					CSG_Table_Value
+#define CTable_Value_Date				CSG_Table_Value_Date
+#define CTable_Value_Double				CSG_Table_Value_Double
+#define CTable_Value_Int				CSG_Table_Value_Int
+#define CTable_Value_String				CSG_Table_Value_String
+#define CTIN							CSG_TIN
+#define CTIN_Edge						CSG_TIN_Edge
+#define CTIN_Point						CSG_TIN_Node
+#define CTIN_Triangle					CSG_TIN_Triangle
+#define CParameters						CSG_Parameters
+#define CParameter						CSG_Parameter
+#define CParameter_Bool					CSG_Parameter_Bool
+#define CParameter_Choice				CSG_Parameter_Choice
+#define CParameter_Color				CSG_Parameter_Color
+#define CParameter_Colors				CSG_Parameter_Colors
+#define CParameter_Data					CSG_Parameter_Data
+#define CParameter_DataObject			CSG_Parameter_Data_Object
+#define CParameter_DataObject_Output	CSG_Parameter_Data_Object_Output
+#define CParameter_Degree				CSG_Parameter_Degree
+#define CParameter_Double				CSG_Parameter_Double
+#define CParameter_FilePath				CSG_Parameter_File_Name
+#define CParameter_FixedTable			CSG_Parameter_Fixed_Table
+#define CParameter_Font					CSG_Parameter_Font
+#define CParameter_Grid					CSG_Parameter_Grid
+#define CParameter_Grid_List			CSG_Parameter_Grid_List
+#define CParameter_Grid_System			CSG_Parameter_Grid_System
+#define CParameter_Int					CSG_Parameter_Int
+#define CParameter_List					CSG_Parameter_List
+#define CParameter_Node					CSG_Parameter_Node
+#define CParameter_Parameters			CSG_Parameter_Parameters
+#define CParameter_Range				CSG_Parameter_Range
+#define CParameter_Shapes				CSG_Parameter_Shapes
+#define CParameter_Shapes_List			CSG_Parameter_Shapes_List
+#define CParameter_String				CSG_Parameter_String
+#define CParameter_Table				CSG_Parameter_Table
+#define CParameter_Table_Field			CSG_Parameter_Table_Field
+#define CParameter_Table_List			CSG_Parameter_Table_List
+#define CParameter_Text					CSG_Parameter_Text
+#define CParameter_TIN					CSG_Parameter_TIN
+#define CParameter_TIN_List				CSG_Parameter_TIN_List
+#define CParameter_Value				CSG_Parameter_Value
+
+#define TDataObject_Type				TSG_Data_Object_Type
+#define TGrid_Type						TSG_Data_Type
+#define TGrid_Memory_Type				TSG_Grid_Memory_Type
+#define TGrid_File_Format				TSG_Grid_File_Format
+#define TGrid_File_Key					TSG_Grid_File_Key
+#define TGrid_Interpolation				TSG_Grid_Interpolation
+#define TGrid_Operation					TSG_Grid_Operation
+#define TShape_Type						TSG_Shape_Type
+#define TSVG_Alignment					TSG_SVG_Alignment
+#define TTable_FieldType				TSG_Data_Type
+#define TTable_FileType					TSG_Table_File_Type
+#define TTable_Index_Order				TSG_Table_Index_Order
+#define TPDF_Font_Type					TSG_PDF_Font_Type
+#define TPDF_Page_Size					TSG_PDF_Page_Size
+#define TPDF_Title_Level				TSG_PDF_Title_Level
+#define TParameter_Type					TSG_Parameter_Type
+#define TModule_Type					TSG_Module_Type
+#define TModule_Interactive_Mode		TSG_Module_Interactive_Mode
+#define TModule_Interactive_DragMode	TSG_Module_Interactive_DragMode
+#define TModule_Error					TSG_Module_Error
+#define TMLB_Info						TSG_MLB_Info
+
+#define Add_Extra_Parameters			Add_Parameters
+#define Get_Extra_Parameters			Get_Parameters
+#define Dlg_Extra_Parameters			Dlg_Parameters
+
+#define TABLE_INDEX_Up					TABLE_INDEX_Ascending
+#define TABLE_INDEX_Down				TABLE_INDEX_Descending
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				SAGA 2.0.3 Compatibility				 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// CSG_Grid
+
+#define Sort_Discard					Set_Index
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__SAGA_API__compatibility_H
diff --git a/src/saga_core/saga_api/data_manager.cpp b/src/saga_core/saga_api/data_manager.cpp
index 7b7e817..3f8152a 100644
--- a/src/saga_core/saga_api/data_manager.cpp
+++ b/src/saga_core/saga_api/data_manager.cpp
@@ -726,21 +726,21 @@ CSG_String CSG_Data_Manager::Get_Summary(void)	const
 	//-----------------------------------------------------
 	CSG_String	s;
 
-/*	s	+= CSG_String::Format(SG_T("<b>%s</b>"), _TL("Module Libraries"));
+/*	s	+= CSG_String::Format(SG_T("<b>%s</b>"), _TL("Tool Libraries"));
 
 	s	+= SG_T("<table border=\"0\">");
 
 	SUMMARY_ADD_INT(_TL("Available Libraries"), Get_Count());
-	SUMMARY_ADD_INT(_TL("Available Modules"  ), nModules);
+	SUMMARY_ADD_INT(_TL("Available Tools"    ), nModules);
 
 	s	+= SG_T("</table>");
 
 	//-----------------------------------------------------
-	s	+= CSG_String::Format(SG_T("<hr><b>%s:</b><table border=\"1\">"), _TL("Module Libraries"));
+	s	+= CSG_String::Format(SG_T("<hr><b>%s:</b><table border=\"1\">"), _TL("Tool Libraries"));
 
 	s	+= CSG_String::Format(SG_T("<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>"),
 			_TL("Library"),
-			_TL("Modules"),
+			_TL("Tools"),
 			_TL("Name"),
 			_TL("Location")
 		);
diff --git a/src/saga_core/saga_api/geo_tools.h b/src/saga_core/saga_api/geo_tools.h
index 6a4cb99..a6bf743 100644
--- a/src/saga_core/saga_api/geo_tools.h
+++ b/src/saga_core/saga_api/geo_tools.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geo_tools.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: geo_tools.h 2037 2014-03-04 17:19:43Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -617,24 +617,55 @@ TSG_Projection_Format;
 //---------------------------------------------------------
 typedef enum ESG_Projection_Type
 {
-	SG_PROJ_TYPE_CS_Undefined	= 0,
 	SG_PROJ_TYPE_CS_Projected,
 	SG_PROJ_TYPE_CS_Geographic,
-	SG_PROJ_TYPE_CS_Geocentric
+	SG_PROJ_TYPE_CS_Geocentric,
+	SG_PROJ_TYPE_CS_Undefined
 }
 TSG_Projection_Type;
 
 //---------------------------------------------------------
-const SG_Char	gSG_Projection_Type_Identifier[][32]	=
+typedef enum ESG_Projection_Unit
 {
-	SG_T("Undefined"),
-	SG_T("PROJCS"),
-	SG_T("GEOGCS"),
-	SG_T("GEOCCS")
-};
+	SG_PROJ_UNIT_Kilometer,
+	SG_PROJ_UNIT_Meter,
+	SG_PROJ_UNIT_Decimeter,
+	SG_PROJ_UNIT_Centimeter,
+	SG_PROJ_UNIT_Millimeter,
+	SG_PROJ_UNIT_Int_Nautical_Mile,
+	SG_PROJ_UNIT_Int_Inch,
+	SG_PROJ_UNIT_Int_Foot,
+	SG_PROJ_UNIT_Int_Yard,
+	SG_PROJ_UNIT_Int_Statute_Mile,
+	SG_PROJ_UNIT_Int_Fathom,
+	SG_PROJ_UNIT_Int_Chain,
+	SG_PROJ_UNIT_Int_Link,
+	SG_PROJ_UNIT_US_Inch,
+	SG_PROJ_UNIT_US_Foot,
+	SG_PROJ_UNIT_US_Yard,
+	SG_PROJ_UNIT_US_Chain,
+	SG_PROJ_UNIT_US_Statute_Mile,
+	SG_PROJ_UNIT_Indian_Yard,
+	SG_PROJ_UNIT_Indian_Foot,
+	SG_PROJ_UNIT_Indian_Chain,
+	SG_PROJ_UNIT_Undefined
+}
+TSG_Projection_Unit;
 
 //---------------------------------------------------------
-SAGA_API_DLL_EXPORT CSG_String	SG_Get_Projection_Type_Name	(TSG_Projection_Type Type);
+SAGA_API_DLL_EXPORT TSG_Projection_Type	SG_Get_Projection_Type				(const CSG_String &Identifier);
+SAGA_API_DLL_EXPORT CSG_String			SG_Get_Projection_Type_Identifier	(TSG_Projection_Type Type);
+SAGA_API_DLL_EXPORT CSG_String			SG_Get_Projection_Type_Name			(TSG_Projection_Type Type);
+
+SAGA_API_DLL_EXPORT TSG_Projection_Unit	SG_Get_Projection_Unit				(const CSG_String &Identifier);
+SAGA_API_DLL_EXPORT CSG_String			SG_Get_Projection_Unit_Identifier	(TSG_Projection_Unit Unit);
+SAGA_API_DLL_EXPORT CSG_String			SG_Get_Projection_Unit_Name			(TSG_Projection_Unit Unit, bool bSimple = false);
+SAGA_API_DLL_EXPORT double				SG_Get_Projection_Unit_To_Meter		(TSG_Projection_Unit Unit);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
 class SAGA_API_DLL_EXPORT CSG_Projection
@@ -683,24 +714,38 @@ public:
 	CSG_String						Get_Description			(void)	const;
 
 	TSG_Projection_Type				Get_Type				(void)	const	{	return( m_Type  );	}
-	CSG_String						Get_Type_Name			(void)	const	{	return( gSG_Projection_Type_Identifier[m_Type] );	}
-	CSG_String						Get_Type_Identifier		(void)	const	{	return( SG_Get_Projection_Type_Name(m_Type) );		}
+	CSG_String						Get_Type_Identifier		(void)	const	{	return( SG_Get_Projection_Type_Identifier(m_Type) );	}
+	CSG_String						Get_Type_Name			(void)	const	{	return( SG_Get_Projection_Type_Name      (m_Type) );	}
+
+	TSG_Projection_Unit				Get_Unit				(void)	const	{	return( m_Unit  );	}
+	CSG_String						Get_Unit_Identifier		(void)	const	{	return( SG_Get_Projection_Unit_Identifier(m_Unit) );	}
+	CSG_String						Get_Unit_Name			(void)	const	{	return( m_Unit_Name     );	}
+	double							Get_Unit_To_Meter		(void)	const	{	return( m_Unit_To_Meter );	}
 
 
 private:
 
 	int								m_Authority_ID;
 
+	double							m_Unit_To_Meter;
+
 	TSG_Projection_Type				m_Type;
 
-	CSG_String						m_Name, m_WKT, m_Proj4, m_Authority;
+	TSG_Projection_Unit				m_Unit;
+
+	CSG_String						m_Name, m_WKT, m_Proj4, m_Authority, m_Unit_Name;
 
 
 };
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 /** CSG_Projections is a projections dictionary and translator
-  * for EPSG codes, OGc Well-Known-Text, and Proj.4.
+  * for EPSG codes, OGC Well-Known-Text, and Proj.4.
 */
 //---------------------------------------------------------
 class SAGA_API_DLL_EXPORT CSG_Projections
diff --git a/src/saga_core/saga_api/grid.cpp b/src/saga_core/saga_api/grid.cpp
index 307ee4f..053e4c6 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: grid.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -231,8 +231,8 @@ void CSG_Grid::_On_Construction(void)
 
 	m_Values			= NULL;
 
-	LineBuffer			= NULL;
-	LineBuffer_Count	= 5;
+	m_LineBuffer		= NULL;
+	m_LineBuffer_Count	= 5;
 
 	m_zFactor			= 1.0;
 
@@ -254,6 +254,9 @@ bool CSG_Grid::Create(const CSG_Grid &Grid)
 {
 	if( Create((CSG_Grid *)&Grid, ((CSG_Grid *)&Grid)->Get_Type()) )
 	{
+		Set_Name       (Grid.Get_Name       ());
+		Set_Description(Grid.Get_Description());
+
 		return( Assign((CSG_Data_Object *)&Grid) );
 	}
 
@@ -265,6 +268,8 @@ bool CSG_Grid::Create(CSG_Grid *pGrid, TSG_Data_Type Type, TSG_Grid_Memory_Type
 {
 	if( pGrid && Create(Type, pGrid->Get_NX(), pGrid->Get_NY(), pGrid->Get_Cellsize(), pGrid->Get_XMin(), pGrid->Get_YMin(), Memory_Type) )
 	{
+		Set_NoData_Value_Range(pGrid->Get_NoData_Value(), pGrid->Get_NoData_hiValue());
+
 		Get_Projection()	= pGrid->Get_Projection();
 
 		return( true );
@@ -415,7 +420,7 @@ bool CSG_Grid::is_Valid(void) const
 			return( m_Values != NULL );
 
 		case GRID_MEMORY_Cache:
-			return( Cache_Stream.is_Open() );
+			return( m_Cache_Stream.is_Open() );
 		}
 	}
 
@@ -575,7 +580,7 @@ inline double CSG_Grid::_Get_ValAtPos_BiLinear(int x, int y, double dx, double d
 	}
 	else
 	{
-		long	v;
+		sLong	v;
 		double	z[4], n = 0.0;
 
 		z[0] = z[1] = z[2] = z[3] = 0.0;
@@ -629,7 +634,7 @@ inline double CSG_Grid::_Get_ValAtPos_InverseDistance(int x, int y, double dx, d
 		}
 		else
 		{
-			long	v;
+			sLong	v;
 			double	z[4], n = 0.0, d;
 
 			z[0] = z[1] = z[2] = z[3] = 0.0;
@@ -1052,7 +1057,7 @@ double CSG_Grid::Get_Variance(void)
 	Update();	return( m_zStats.Get_Variance() );
 }
 
-long CSG_Grid::Get_NoData_Count(void)
+sLong CSG_Grid::Get_NoData_Count(void)
 {
 	Update();	return( Get_NCells() - m_zStats.Get_Count() );
 }
@@ -1093,7 +1098,7 @@ bool CSG_Grid::On_Update(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CSG_Grid::Set_Value_And_Sort(long n, double Value)
+void CSG_Grid::Set_Value_And_Sort(sLong n, double Value)
 {
 	if( !m_bIndexed )
 	{
@@ -1108,7 +1113,7 @@ void CSG_Grid::Set_Value_And_Sort(long n, double Value)
 	if( Value == asDouble(n) )
 		return;
 
-	long	i, j;
+	sLong	i, j;
 
 	for(i=0, j=-1; i<Get_NCells() && j<0; i++)	// find index, could be faster...
 	{
@@ -1218,9 +1223,9 @@ bool CSG_Grid::Set_Index(bool bOn)
 
 bool CSG_Grid::_Set_Index(void)
 {
-	const long	M	= 7;
+	const sLong	M	= 7;
 
-	long	i, j, k, l, ir, n, nCells, *istack, jstack, nstack, indxt, itemp;
+	sLong	i, j, k, l, ir, n, nCells, *istack, jstack, nstack, indxt, itemp;
 	double	a;
 
 	//-----------------------------------------------------
@@ -1228,7 +1233,7 @@ bool CSG_Grid::_Set_Index(void)
 
 	if( m_Index == NULL )
 	{
-		m_Index		= (long *)SG_Calloc(Get_NCells(), sizeof(long));
+		m_Index		= (sLong *)SG_Calloc(Get_NCells(), sizeof(sLong));
 
 		if( m_Index == NULL )
 		{
@@ -1271,14 +1276,14 @@ bool CSG_Grid::_Set_Index(void)
 	ir		= Get_NCells() - 1;
 
 	nstack	= 64;
-	istack	= (long *)SG_Malloc(nstack * sizeof(long));
+	istack	= (sLong *)SG_Malloc(nstack * sizeof(sLong));
 	jstack	= 0;
 
 	for(;;)
 	{
 		if( ir - l < M )
 		{
-			if( !SG_UI_Process_Set_Progress(n += M - 1, nCells) )
+			if( !SG_UI_Process_Set_Progress((double)(n += M - 1), (double)nCells) )
 			{
 				SG_Free(istack);
 
@@ -1353,7 +1358,7 @@ bool CSG_Grid::_Set_Index(void)
 			if( jstack >= nstack )
 			{
 				nstack	+= 64;
-				istack	= (long *)SG_Realloc(istack, nstack * sizeof(int));
+				istack	= (sLong *)SG_Realloc(istack, nstack * sizeof(int));
 			}
 
 			if( ir - i + 1 >= j - l )
diff --git a/src/saga_core/saga_api/grid.h b/src/saga_core/saga_api/grid.h
index 4bcac43..b51d205 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: grid.h 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -231,7 +231,7 @@ public:
 
 	int							Get_NX				(void)	const	{	return( m_NX );			}
 	int							Get_NY				(void)	const	{	return( m_NY );			}
-	long						Get_NCells			(void)	const	{	return( m_NCells );		}
+	sLong						Get_NCells			(void)	const	{	return( m_NCells );		}
 
 	const CSG_Rect &			Get_Extent			(bool bCells = false)	const	{	return( bCells ? m_Extent_Cells : m_Extent );	}
 
@@ -356,7 +356,8 @@ public:
 private:	///////////////////////////////////////////////
 
 	int							m_NX, m_NY;
-	long						m_NCells;
+
+	sLong						m_NCells;
 
 	double						m_Cellsize, m_Cellarea, m_Diagonal;
 
@@ -429,7 +430,7 @@ public:		///////////////////////////////////////////////
 
 	int							Get_NX			(void)	const	{	return( m_System.Get_NX() );		}
 	int							Get_NY			(void)	const	{	return( m_System.Get_NY() );		}
-	long						Get_NCells		(void)	const	{	return( m_System.Get_NCells() );	}
+	sLong						Get_NCells		(void)	const	{	return( m_System.Get_NCells() );	}
 
 	double						Get_Cellsize	(void)	const	{	return( m_System.Get_Cellsize() );	}
 	double						Get_Cellarea	(void)	const	{	return( m_System.Get_Cellarea() );	}
@@ -455,7 +456,7 @@ public:		///////////////////////////////////////////////
 	double						Get_StdDev		(bool bZFactor = false);
 	double						Get_Variance	(void);
 
-	long							Get_NoData_Count		(void);
+	sLong						Get_NoData_Count(void);
 
 	virtual bool				Save	(const CSG_String &File_Name, int Format = GRID_FILE_FORMAT_Binary);
 	virtual bool				Save	(const CSG_String &File_Name, int Format, int xA, int yA, int xN, int yN);
@@ -482,15 +483,18 @@ public:		///////////////////////////////////////////////
 	//-----------------------------------------------------
 	// Memory...
 
-	int							Get_Buffer_Size				(void)					{	return( LineBuffer_Count * Get_nLineBytes() );	}
-	bool						Set_Buffer_Size				(int Size);
+	sLong						Get_Memory_Size				(void)		const	{	return( Get_NCells() * Get_nValueBytes() );	}
+	double						Get_Memory_Size_MB			(void)		const	{	return( (double)Get_Memory_Size() / N_MEGABYTE_BYTES );	}
+
+	bool						Set_Buffer_Size				(sLong nBytes);
+	int							Get_Buffer_Size				(void)		const	{	return( m_LineBuffer_Count * Get_nLineBytes() );	}
 
 	bool						Set_Cache					(bool bOn);
-	bool						is_Cached					(void);
+	bool						is_Cached					(void)		const	{	return( m_Memory_Type == GRID_MEMORY_Cache );	}
 
 	bool						Set_Compression				(bool bOn);
-	bool						is_Compressed				(void);
-	double						Get_Compression_Ratio		(void);
+	bool						is_Compressed				(void)		const	{	return( m_Memory_Type == GRID_MEMORY_Compression );	};
+	double						Get_Compression_Ratio		(void)		const;
 
 
 	//-----------------------------------------------------
@@ -537,7 +541,7 @@ public:		///////////////////////////////////////////////
 
 	bool						Set_Index		(bool bOn = false);
 
-	long						Get_Sorted		(long Position, bool bDown = true, bool bCheckNoData = true)
+	sLong						Get_Sorted		(sLong Position, bool bDown = true, bool bCheckNoData = true)
 	{
 		if( Position >= 0 && Position < Get_NCells() && (m_bIndexed || Set_Index(true)) )
 		{
@@ -552,12 +556,12 @@ public:		///////////////////////////////////////////////
 		return( -1 );
 	}
 
-	bool						Get_Sorted		(long Position, long &n, bool bDown = true, bool bCheckNoData = true)
+	bool						Get_Sorted		(sLong Position, sLong &n, bool bDown = true, bool bCheckNoData = true)
 	{
 		return( (n = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 );
 	}
 
-	bool						Get_Sorted		(long Position, int &x, int &y, bool bDown = true, bool bCheckNoData = true)
+	bool						Get_Sorted		(sLong Position, int &x, int &y, bool bDown = true, bool bCheckNoData = true)
 	{
 		if( (Position = Get_Sorted(Position, bDown, bCheckNoData)) >= 0 )
 		{
@@ -577,10 +581,10 @@ public:		///////////////////////////////////////////////
 	// No Data Value...
 
 	virtual bool				is_NoData		(int x, int y)	const	{	return( is_NoData_Value(asDouble(x, y)) );	}
-	virtual bool				is_NoData		(long n)		const	{	return( is_NoData_Value(asDouble(   n)) );	}
+	virtual bool				is_NoData		(sLong n)		const	{	return( is_NoData_Value(asDouble(   n)) );	}
 
 	virtual void				Set_NoData		(int x, int y)	{	Set_Value(x, y, Get_NoData_Value() );	}
-	virtual void				Set_NoData		(long n)		{	Set_Value(   n, Get_NoData_Value() );	}
+	virtual void				Set_NoData		(sLong n)		{	Set_Value(   n, Get_NoData_Value() );	}
 
 
 	//-----------------------------------------------------
@@ -629,20 +633,22 @@ public:		///////////////////////////////////////////////
 	bool						Get_Value(TSG_Point Position      , double &Value, int Interpolation = GRID_INTERPOLATION_BSpline, bool bZFactor = false, bool bByteWise = false, bool bOnlyValidCells = false) const;
 
 	virtual BYTE				asByte	(int x, int y, bool bZFactor = false) const	{	return( (BYTE )asDouble(x, y, bZFactor) );	}
-	virtual BYTE				asByte	(      long n, bool bZFactor = false) const	{	return( (BYTE )asDouble(   n, bZFactor) );	}
+	virtual BYTE				asByte	(     sLong n, bool bZFactor = false) const	{	return( (BYTE )asDouble(   n, bZFactor) );	}
 	virtual char				asChar	(int x, int y, bool bZFactor = false) const	{	return( (char )asDouble(x, y, bZFactor) );	}
-	virtual char				asChar	(      long n, bool bZFactor = false) const	{	return( (char )asDouble(   n, bZFactor) );	}
+	virtual char				asChar	(     sLong n, bool bZFactor = false) const	{	return( (char )asDouble(   n, bZFactor) );	}
 	virtual short				asShort	(int x, int y, bool bZFactor = false) const	{	return( (short)asDouble(x, y, bZFactor) );	}
-	virtual short				asShort	(      long n, bool bZFactor = false) const	{	return( (short)asDouble(   n, bZFactor) );	}
+	virtual short				asShort	(     sLong n, bool bZFactor = false) const	{	return( (short)asDouble(   n, bZFactor) );	}
 	virtual int					asInt	(int x, int y, bool bZFactor = false) const	{	return( (int  )asDouble(x, y, bZFactor) );	}
-	virtual int					asInt	(      long n, bool bZFactor = false) const	{	return( (int  )asDouble(   n, bZFactor) );	}
+	virtual int					asInt	(     sLong n, bool bZFactor = false) const	{	return( (int  )asDouble(   n, bZFactor) );	}
+	virtual sLong				asLong	(int x, int y, bool bZFactor = false) const	{	return( (sLong)asDouble(x, y, bZFactor) );	}
+	virtual sLong				asLong	(     sLong n, bool bZFactor = false) const	{	return( (sLong)asDouble(   n, bZFactor) );	}
 	virtual float				asFloat	(int x, int y, bool bZFactor = false) const	{	return( (float)asDouble(x, y, bZFactor) );	}
-	virtual float				asFloat	(      long n, bool bZFactor = false) const	{	return( (float)asDouble(   n, bZFactor) );	}
+	virtual float				asFloat	(     sLong n, bool bZFactor = false) const	{	return( (float)asDouble(   n, bZFactor) );	}
 
 	//-----------------------------------------------------
-	virtual double				asDouble(      long n, bool bZFactor = false) const
+	virtual double				asDouble(     sLong n, bool bZFactor = false) const
 	{
-		return( asDouble(n % Get_NX(), n / Get_NX(), bZFactor) );
+		return( asDouble((int)(n % Get_NX()), (int)(n / Get_NX()), bZFactor) );
 	}
 
 	virtual double				asDouble(int x, int y, bool bZFactor = false) const
@@ -683,15 +689,15 @@ public:		///////////////////////////////////////////////
 	// Set Value...
 
 	virtual void				Add_Value(int x, int y, double Value)	{	Set_Value(x, y, asDouble(x, y) + Value );	}
-	virtual void				Add_Value(      long n, double Value)	{	Set_Value(   n, asDouble(   n) + Value );	}
+	virtual void				Add_Value(     sLong n, double Value)	{	Set_Value(   n, asDouble(   n) + Value );	}
 
 	virtual void				Mul_Value(int x, int y, double Value)	{	Set_Value(x, y, asDouble(x, y) * Value );	}
-	virtual void				Mul_Value(      long n, double Value)	{	Set_Value(   n, asDouble(   n) * Value );	}
+	virtual void				Mul_Value(     sLong n, double Value)	{	Set_Value(   n, asDouble(   n) * Value );	}
 
 	//-----------------------------------------------------
-	virtual void				Set_Value(      long n, double Value)
+	virtual void				Set_Value(     sLong n, double Value)
 	{
-		Set_Value(n % Get_NX(), n / Get_NX(), Value);
+		Set_Value((int)(n % Get_NX()), (int)(n / Get_NX()), Value);
 	}
 
 	virtual void				Set_Value(int x, int y, double Value)
@@ -723,7 +729,7 @@ public:		///////////////////////////////////////////////
 		Set_Modified();
 	}
 
-	virtual void				Set_Value_And_Sort(      long n, double Value);
+	virtual void				Set_Value_And_Sort(     sLong n, double Value);
 	virtual void				Set_Value_And_Sort(int x, int y, double Value);
 
 
@@ -739,17 +745,17 @@ private:	///////////////////////////////////////////////
 	void						**m_Values;
 
 	bool						m_bCreated, m_bIndexed, m_Memory_bLock,
-								Cache_bTemp, Cache_bSwap, Cache_bFlip;
+								m_Cache_bTemp, m_Cache_bSwap, m_Cache_bFlip;
 
-	int							LineBuffer_Count;
+	int							m_LineBuffer_Count;
 
-	long						*m_Index, Cache_Offset;
+	sLong						*m_Index, m_Cache_Offset;
 
 	double						m_zFactor;
 
 	CSG_Simple_Statistics		m_zStats;
 
-	CSG_File					Cache_Stream;
+	CSG_File					m_Cache_Stream;
 
 	TSG_Data_Type				m_Type;
 
@@ -757,7 +763,7 @@ private:	///////////////////////////////////////////////
 
 	CSG_Grid_System				m_System;
 
-	CSG_String					m_Unit, Cache_Path;
+	CSG_String					m_Unit, m_Cache_Path;
 
 
 	//-----------------------------------------------------
@@ -772,7 +778,7 @@ private:	///////////////////////////////////////////////
 	}
 	TSG_Grid_Line;
 
-	TSG_Grid_Line				*LineBuffer;
+	TSG_Grid_Line				*m_LineBuffer;
 
 
 	//-----------------------------------------------------
@@ -801,7 +807,7 @@ private:	///////////////////////////////////////////////
 	bool						_Array_Create			(void);
 	void						_Array_Destroy			(void);
 
-	bool						_Cache_Create			(const SG_Char *FilePath, TSG_Data_Type File_Type, long Offset, bool bSwap, bool bFlip);
+	bool						_Cache_Create			(const SG_Char *FilePath, TSG_Data_Type File_Type, sLong Offset, bool bSwap, bool bFlip);
 	bool						_Cache_Create			(void);
 	bool						_Cache_Destroy			(bool bMemory_Restore);
 	void						_Cache_LineBuffer_Save	(TSG_Grid_Line *pLine)			const;
@@ -897,7 +903,7 @@ SAGA_API_DLL_EXPORT int				SG_Grid_Cache_Get_Confirm		(void);
 
 SAGA_API_DLL_EXPORT void			SG_Grid_Cache_Set_Threshold		(int nBytes);
 SAGA_API_DLL_EXPORT void			SG_Grid_Cache_Set_Threshold_MB	(double nMegabytes);
-SAGA_API_DLL_EXPORT long			SG_Grid_Cache_Get_Threshold		(void);
+SAGA_API_DLL_EXPORT sLong			SG_Grid_Cache_Get_Threshold		(void);
 SAGA_API_DLL_EXPORT double			SG_Grid_Cache_Get_Threshold_MB	(void);
 
 
diff --git a/src/saga_core/saga_api/grid_io.cpp b/src/saga_core/saga_api/grid_io.cpp
index ed41b51..9ac1295 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: grid_io.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -547,9 +547,9 @@ bool CSG_Grid::_Save_ASCII(CSG_File &Stream, int xA, int yA, int xN, int yN, boo
 //---------------------------------------------------------
 #include "parameters.h"
 
-long SG_Grid_Cache_Check(CSG_Grid_System &m_System, int nValueBytes)
+sLong SG_Grid_Cache_Check(CSG_Grid_System &m_System, int nValueBytes)
 {
-	if(	SG_Grid_Cache_Get_Automatic() && ((long) m_System.Get_NCells() * nValueBytes) > SG_Grid_Cache_Get_Threshold() )
+	if(	SG_Grid_Cache_Get_Automatic() && (m_System.Get_NCells() * nValueBytes) > SG_Grid_Cache_Get_Threshold() )
 	{
 		switch( SG_Grid_Cache_Get_Confirm() )
 		{
@@ -564,7 +564,7 @@ long SG_Grid_Cache_Check(CSG_Grid_System &m_System, int nValueBytes)
 					_TL("Shall I activate file caching for new grid."),
 					m_System.Get_Name(),
 					_TL("Total memory size"),
-					((long) m_System.Get_NCells() * nValueBytes) / (double)N_MEGABYTE_BYTES
+					(m_System.Get_NCells() * nValueBytes) / (double)N_MEGABYTE_BYTES
 				);
 
 				if( SG_UI_Dlg_Continue(s, _TL("Activate Grid File Cache?")) )
@@ -590,9 +590,9 @@ long SG_Grid_Cache_Check(CSG_Grid_System &m_System, int nValueBytes)
 				{
 				//	Memory_Type	= GRID_MEMORY_Cache;
 
-				//	Set_Buffer_Size((int)(p(SG_T("BUFFERSIZE"))->asDouble() * N_MEGABYTE_BYTES));
+				//	Set_Buffer_Size((sLong)(p(SG_T("BUFFERSIZE"))->asDouble() * N_MEGABYTE_BYTES));
 
-					return( (long)(p(SG_T("BUFFERSIZE"))->asDouble() * N_MEGABYTE_BYTES) );
+					return( (sLong)(p(SG_T("BUFFERSIZE"))->asDouble() * N_MEGABYTE_BYTES) );
 				}
 			}
 			break;
@@ -606,7 +606,7 @@ long 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			bResult, hdr_bFlip, hdr_bSwapBytes;
-	long			hdr_Offset, iType, NX, NY;
+	sLong			hdr_Offset, iType, NX, NY;
 	double			Cellsize, xMin, yMin;
 	CSG_File		Stream;
 	TSG_Data_Type	hdr_Type;
@@ -696,7 +696,7 @@ bool CSG_Grid::_Load_Native(const CSG_String &File_Name, TSG_Grid_Memory_Type Me
 				||	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(hdr_Offset);
+					Stream.Seek((long)hdr_Offset);
 					bResult	= _Load_ASCII(Stream, Memory_Type, hdr_bFlip);
 				}
 			}
@@ -731,7 +731,7 @@ bool CSG_Grid::_Load_Native(const CSG_String &File_Name, TSG_Grid_Memory_Type Me
 					||	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(hdr_Offset);
+						Stream.Seek((long)hdr_Offset);
 						bResult	= _Load_Binary(Stream, hdr_Type, hdr_bFlip, hdr_bSwapBytes);
 					}
 				}
diff --git a/src/saga_core/saga_api/grid_memory.cpp b/src/saga_core/saga_api/grid_memory.cpp
index afeb770..c9a5771 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: grid_memory.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -105,7 +105,7 @@ bool				SG_Grid_Cache_Get_Automatic(void)
 }
 
 //---------------------------------------------------------
-static int			gSG_Grid_Cache_Confirm		= 1;
+static int			gSG_Grid_Cache_Confirm		= 2;
 
 void				SG_Grid_Cache_Set_Confirm(int Confirm)
 {
@@ -118,7 +118,7 @@ int					SG_Grid_Cache_Get_Confirm(void)
 }
 
 //---------------------------------------------------------
-static int			gSG_Grid_Cache_Threshold	= 40 * N_MEGABYTE_BYTES;
+static sLong		gSG_Grid_Cache_Threshold	= 250 * N_MEGABYTE_BYTES;
 
 void				SG_Grid_Cache_Set_Threshold(int nBytes)
 {
@@ -133,7 +133,7 @@ void				SG_Grid_Cache_Set_Threshold_MB(double nMegabytes)
 	SG_Grid_Cache_Set_Threshold((int)(nMegabytes * N_MEGABYTE_BYTES));
 }
 
-long				SG_Grid_Cache_Get_Threshold(void)
+sLong				SG_Grid_Cache_Get_Threshold(void)
 {
 	return( gSG_Grid_Cache_Threshold );
 }
@@ -159,7 +159,7 @@ bool CSG_Grid::_Memory_Create(TSG_Grid_Memory_Type Memory_Type)
 
 		Set_Buffer_Size(gSG_Grid_Cache_Threshold);
 
-		if(	Memory_Type != GRID_MEMORY_Cache && gSG_Grid_Cache_bAutomatic && ((long) Get_NCells() * Get_nValueBytes()) > gSG_Grid_Cache_Threshold )
+		if(	Memory_Type != GRID_MEMORY_Cache && gSG_Grid_Cache_bAutomatic && Get_Memory_Size() > gSG_Grid_Cache_Threshold )
 		{
 			switch( gSG_Grid_Cache_Confirm )
 			{
@@ -175,7 +175,7 @@ bool CSG_Grid::_Memory_Create(TSG_Grid_Memory_Type Memory_Type)
 						_TL("Shall I activate file caching for new grid."),
 						m_System.Get_Name(),
 						_TL("Total memory size"),
-						(long) (Get_NCells() * Get_nValueBytes()) / (double)N_MEGABYTE_BYTES
+						Get_Memory_Size_MB()
 					);
 
 					if( SG_UI_Dlg_Continue(s, _TL("Activate Grid File Cache?")) )
@@ -199,7 +199,7 @@ bool CSG_Grid::_Memory_Create(TSG_Grid_Memory_Type Memory_Type)
 					{
 						Memory_Type	= GRID_MEMORY_Cache;
 
-						Set_Buffer_Size((int)(p(SG_T("BUFFERSIZE"))->asDouble() * N_MEGABYTE_BYTES));
+						Set_Buffer_Size((sLong)(p(SG_T("BUFFERSIZE"))->asDouble() * N_MEGABYTE_BYTES));
 					}
 				}
 				break;
@@ -252,83 +252,79 @@ void CSG_Grid::_LineBuffer_Create(void)
 {
 	_LineBuffer_Destroy();
 
-	LineBuffer			= (TSG_Grid_Line *)SG_Malloc(LineBuffer_Count * sizeof(TSG_Grid_Line));
+	m_LineBuffer	= (TSG_Grid_Line *)SG_Malloc(m_LineBuffer_Count * sizeof(TSG_Grid_Line));
 
-	for(int i=0; i<LineBuffer_Count; i++)
+	for(int i=0; i<m_LineBuffer_Count; i++)
 	{
-		LineBuffer[i].Data		= (char *)SG_Malloc(Get_nLineBytes());
-		LineBuffer[i].y			= -1;
-		LineBuffer[i].bModified	= false;
+		m_LineBuffer[i].Data		= (char *)SG_Malloc(Get_nLineBytes());
+		m_LineBuffer[i].y			= -1;
+		m_LineBuffer[i].bModified	= false;
 	}
 }
 
 //---------------------------------------------------------
 void CSG_Grid::_LineBuffer_Destroy(void)
 {
-	if( LineBuffer )
+	if( m_LineBuffer )
 	{
-		for(int i=0; i<LineBuffer_Count; i++)
+		for(int i=0; i<m_LineBuffer_Count; i++)
 		{
-			if( LineBuffer[i].Data )
+			if( m_LineBuffer[i].Data )
 			{
-				SG_Free(LineBuffer[i].Data);
+				SG_Free(m_LineBuffer[i].Data);
 			}
 		}
 
-		SG_Free(LineBuffer);
-
-		LineBuffer	= NULL;
+		SG_FREE_SAFE(m_LineBuffer);
 	}
 }
 
 //---------------------------------------------------------
-bool CSG_Grid::Set_Buffer_Size(int Size)
+bool CSG_Grid::Set_Buffer_Size(sLong nBytes)
 {
-	int		i;
-
 	if( m_System.is_Valid() && m_Type != SG_DATATYPE_Undefined )
 	{
-		Size	/= Get_nLineBytes();
+		int	nLines	= (int)(nBytes / Get_nLineBytes());
 
-		if( Size < 1 )
+		if( nLines < 1 )
 		{
-			Size	= 1;
+			nLines	= 1;
 		}
-		else if( Size >= Get_NY() )
+		else if( nLines >= Get_NY() )
 		{
-			Size	= Get_NY() - 1;
+			nLines	= Get_NY() - 1;
 		}
 
-		if( Size != LineBuffer_Count )
+		if( nLines != m_LineBuffer_Count )
 		{
-			if( LineBuffer )
+			if( m_LineBuffer )
 			{
-				if( Size > LineBuffer_Count )
+				if( nLines > m_LineBuffer_Count )
 				{
-					LineBuffer			= (TSG_Grid_Line *)SG_Realloc(LineBuffer, Size * sizeof(TSG_Grid_Line));
+					m_LineBuffer	= (TSG_Grid_Line *)SG_Realloc(m_LineBuffer, nLines * sizeof(TSG_Grid_Line));
 
-					for(i=LineBuffer_Count; i<Size; i++)
+					for(int i=m_LineBuffer_Count; i<nLines; i++)
 					{
-						LineBuffer[i].Data		= (char *)SG_Malloc(Get_nLineBytes());
-						LineBuffer[i].y			= -1;
-						LineBuffer[i].bModified	= false;
+						m_LineBuffer[i].Data		= (char *)SG_Malloc(Get_nLineBytes());
+						m_LineBuffer[i].y			= -1;
+						m_LineBuffer[i].bModified	= false;
 					}
 				}
 				else
 				{
-					for(i=Size; i<LineBuffer_Count; i++)
+					for(int i=nLines; i<m_LineBuffer_Count; i++)
 					{
-						if( LineBuffer[i].Data )
+						if( m_LineBuffer[i].Data )
 						{
-							SG_Free(LineBuffer[i].Data);
+							SG_Free(m_LineBuffer[i].Data);
 						}
 					}
 
-					LineBuffer			= (TSG_Grid_Line *)SG_Realloc(LineBuffer, Size * sizeof(TSG_Grid_Line));
+					m_LineBuffer	= (TSG_Grid_Line *)SG_Realloc(m_LineBuffer, nLines * sizeof(TSG_Grid_Line));
 				}
 			}
 
-			LineBuffer_Count	= Size;
+			m_LineBuffer_Count	= nLines;
 		}
 
 		return( true );
@@ -340,9 +336,9 @@ bool CSG_Grid::Set_Buffer_Size(int Size)
 //---------------------------------------------------------
 void CSG_Grid::_LineBuffer_Flush(void)
 {
-	if( LineBuffer )
+	if( m_LineBuffer )
 	{
-		for(int i=0; i<LineBuffer_Count; i++)
+		for(int i=0; i<m_LineBuffer_Count; i++)
 		{
 			switch( m_Memory_Type )
 			{
@@ -350,11 +346,11 @@ void CSG_Grid::_LineBuffer_Flush(void)
 		        break;
 
 			case GRID_MEMORY_Cache:
-				_Cache_LineBuffer_Save(LineBuffer + i);
+				_Cache_LineBuffer_Save(m_LineBuffer + i);
 				break;
 
 			case GRID_MEMORY_Compression:
-				_Compr_LineBuffer_Save(LineBuffer + i);
+				_Compr_LineBuffer_Save(m_LineBuffer + i);
 				break;
 			}
 		}
@@ -367,14 +363,14 @@ CSG_Grid::TSG_Grid_Line * CSG_Grid::_LineBuffer_Get_Line(int y) const
 	int				i, iLine;
 	TSG_Grid_Line	tmp_Line;
 
-	if( LineBuffer && y >= 0 && y < Get_NY() )
+	if( m_LineBuffer && y >= 0 && y < Get_NY() )
 	{
 		//-------------------------------------------------
-		if( y != LineBuffer[0].y )
+		if( y != m_LineBuffer[0].y )
 		{
-			for(i=1, iLine=0; i<LineBuffer_Count && !iLine; i++)
+			for(i=1, iLine=0; i<m_LineBuffer_Count && !iLine; i++)
 			{
-				if( y == LineBuffer[i].y )
+				if( y == m_LineBuffer[i].y )
 				{
 					iLine	= i;
 				}
@@ -383,7 +379,7 @@ CSG_Grid::TSG_Grid_Line * CSG_Grid::_LineBuffer_Get_Line(int y) const
 			//---------------------------------------------
 			if( !iLine )
 			{
-				iLine	= LineBuffer_Count - 1;
+				iLine	= m_LineBuffer_Count - 1;
 
 				switch( m_Memory_Type )
 				{
@@ -391,30 +387,30 @@ CSG_Grid::TSG_Grid_Line * CSG_Grid::_LineBuffer_Get_Line(int y) const
 					break;
 
 				case GRID_MEMORY_Cache:
-					_Cache_LineBuffer_Save(LineBuffer + iLine);
-					_Cache_LineBuffer_Load(LineBuffer + iLine, y);
+					_Cache_LineBuffer_Save(m_LineBuffer + iLine);
+					_Cache_LineBuffer_Load(m_LineBuffer + iLine, y);
 					break;
 
 				case GRID_MEMORY_Compression:
-					_Compr_LineBuffer_Save(LineBuffer + iLine);
-					_Compr_LineBuffer_Load(LineBuffer + iLine, y);
+					_Compr_LineBuffer_Save(m_LineBuffer + iLine);
+					_Compr_LineBuffer_Load(m_LineBuffer + iLine, y);
 					break;
 				}
 			}
 
 			//---------------------------------------------
-			tmp_Line		= LineBuffer[iLine];
+			tmp_Line		= m_LineBuffer[iLine];
 
 			for(i=iLine; i>0; i--)
 			{
-				LineBuffer[i]	= LineBuffer[i - 1];
-			}	// memmove(LineBuffer + 1, LineBuffer, (iLine - 1) * sizeof(TSG_Grid_Line));
+				m_LineBuffer[i]	= m_LineBuffer[i - 1];
+			}	// memmove(m_LineBuffer + 1, m_LineBuffer, (iLine - 1) * sizeof(TSG_Grid_Line));
 
-			LineBuffer[0]	= tmp_Line;
+			m_LineBuffer[0]	= tmp_Line;
 		}
 
 		//-------------------------------------------------
-		return( LineBuffer );
+		return( m_LineBuffer );
 	}
 
 	return( NULL );
@@ -575,12 +571,6 @@ bool CSG_Grid::Set_Cache(bool bOn)
 	return( bOn ? _Cache_Create() : _Cache_Destroy(true) );
 }
 
-//---------------------------------------------------------
-bool CSG_Grid::is_Cached(void)
-{
-	return( m_Memory_Type == GRID_MEMORY_Cache );
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -589,23 +579,23 @@ bool CSG_Grid::is_Cached(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CSG_Grid::_Cache_Create(const SG_Char *FilePath, TSG_Data_Type File_Type, long Offset, bool bSwap, bool bFlip)
+bool CSG_Grid::_Cache_Create(const SG_Char *FilePath, TSG_Data_Type File_Type, sLong Offset, bool bSwap, bool bFlip)
 {
 	if( m_System.is_Valid() && m_Type != SG_DATATYPE_Undefined && m_Memory_Type == GRID_MEMORY_Normal )
 	{
-		Cache_Path	= FilePath;
+		m_Cache_Path	= FilePath;
 
 		if( m_Type == File_Type
-		&&	(	Cache_Stream.Open(Cache_Path, SG_FILE_RWA, true)
-			||	Cache_Stream.Open(Cache_Path, SG_FILE_R  , true)) )
+		&&	(	m_Cache_Stream.Open(m_Cache_Path, SG_FILE_RWA, true)
+			||	m_Cache_Stream.Open(m_Cache_Path, SG_FILE_R  , true)) )
 		{
 			m_Memory_bLock	= true;
 
-			Cache_bTemp		= false;
+			m_Cache_bTemp	= false;
 
-			Cache_Offset	= Offset;
-			Cache_bSwap		= bSwap;
-			Cache_bFlip		= bFlip;
+			m_Cache_Offset	= Offset;
+			m_Cache_bSwap	= bSwap;
+			m_Cache_bFlip	= bFlip;
 
 			_LineBuffer_Create();
 
@@ -626,17 +616,17 @@ bool CSG_Grid::_Cache_Create(void)
 
 	if( m_System.is_Valid() && m_Type != SG_DATATYPE_Undefined && m_Memory_Type == GRID_MEMORY_Normal )
 	{
-		Cache_Path	= SG_File_Get_TmpName(SG_T("sg_grd"), SG_Grid_Cache_Get_Directory());
+		m_Cache_Path	= SG_File_Get_TmpName(SG_T("sg_grd"), SG_Grid_Cache_Get_Directory());
 
-		if( Cache_Stream.Open(Cache_Path, SG_FILE_RW, true) )
+		if( m_Cache_Stream.Open(m_Cache_Path, SG_FILE_RW, true) )
 		{
 			m_Memory_bLock	= true;
 
-			Cache_bTemp		= true;
+			m_Cache_bTemp	= true;
 
-			Cache_Offset	= 0;
-			Cache_bSwap		= false;
-			Cache_bFlip		= false;
+			m_Cache_Offset	= 0;
+			m_Cache_bSwap	= false;
+			m_Cache_bFlip	= false;
 
 			_LineBuffer_Create();
 
@@ -676,7 +666,7 @@ bool CSG_Grid::_Cache_Destroy(bool bMemory_Restore)
 	{
 		m_Memory_bLock	= true;
 
-		if( !Cache_bTemp )
+		if( !m_Cache_bTemp )
 		{
 			_LineBuffer_Flush();
 		}
@@ -700,11 +690,11 @@ bool CSG_Grid::_Cache_Destroy(bool bMemory_Restore)
 		m_Memory_Type	= GRID_MEMORY_Normal;
 
 		//-------------------------------------------------
-		Cache_Stream.Close();
+		m_Cache_Stream.Close();
 
-		if( Cache_bTemp )
+		if( m_Cache_bTemp )
 		{
-			SG_File_Delete(Cache_Path);
+			SG_File_Delete(m_Cache_Path);
 		}
 
 		return( true );
@@ -723,36 +713,36 @@ bool CSG_Grid::_Cache_Destroy(bool bMemory_Restore)
 //---------------------------------------------------------
 void CSG_Grid::_Cache_LineBuffer_Save(TSG_Grid_Line *pLine) const
 {
-	int		x, y, Line_Pos, Line_Size;
-	char	*pValue;
-
 	if( pLine && pLine->bModified )
 	{
 		pLine->bModified	= false;
 
 		if( pLine->y >= 0 && pLine->y < Get_NY() )
 		{
-			y			= Cache_bFlip ? Get_NY() - 1 - pLine->y : pLine->y;
-
-			Line_Size	= Get_nLineBytes();
-			Line_Pos	= Cache_Offset + y * Line_Size;
+			sLong	Line_Y		= m_Cache_bFlip ? Get_NY() - 1 - pLine->y : pLine->y;
+			sLong	Line_Size	= Get_nLineBytes();
+			sLong	Line_Pos	= m_Cache_Offset + Line_Y * Line_Size;
 
 			//-------------------------------------------------
-			if( Cache_bSwap && m_Type != SG_DATATYPE_Bit )
+			if( m_Cache_bSwap && m_Type != SG_DATATYPE_Bit )
 			{
-				for(x=0, pValue=pLine->Data; x<Get_NX(); x++, pValue+=Get_nValueBytes())
+				char	*pValue	= pLine->Data;
+
+				for(int x=0; x<Get_NX(); x++, pValue+=Get_nValueBytes())
 				{
 					_Swap_Bytes(pValue, Get_nValueBytes());
 				}
 			}
 
-			Cache_Stream.Seek(Line_Pos);
-			Cache_Stream.Write(pLine->Data, sizeof(char), Line_Size);
-			Cache_Stream.Flush();
+			m_Cache_Stream.Seek(Line_Pos);
+			m_Cache_Stream.Write(pLine->Data, sizeof(char), Line_Size);
+			m_Cache_Stream.Flush();
 
-			if( Cache_bSwap && m_Type != SG_DATATYPE_Bit )
+			if( m_Cache_bSwap && m_Type != SG_DATATYPE_Bit )
 			{
-				for(x=0, pValue=pLine->Data; x<Get_NX(); x++, pValue+=Get_nValueBytes())
+				char	*pValue	= pLine->Data;
+
+				for(int x=0; x<Get_NX(); x++, pValue+=Get_nValueBytes())
 				{
 					_Swap_Bytes(pValue, Get_nValueBytes());
 				}
@@ -764,9 +754,6 @@ void CSG_Grid::_Cache_LineBuffer_Save(TSG_Grid_Line *pLine) const
 //---------------------------------------------------------
 void CSG_Grid::_Cache_LineBuffer_Load(TSG_Grid_Line *pLine, int y) const
 {
-	int		x, Line_Pos, Line_Size;
-	char	*pValue;
-
 	if( pLine )
 	{
 		pLine->bModified	= false;
@@ -774,18 +761,19 @@ void CSG_Grid::_Cache_LineBuffer_Load(TSG_Grid_Line *pLine, int y) const
 
 		if( pLine->y >= 0 && pLine->y < Get_NY() )
 		{
-			y			= Cache_bFlip ? Get_NY() - 1 - pLine->y : pLine->y;
-
-			Line_Size	= Get_nLineBytes();
-			Line_Pos	= Cache_Offset + y * Line_Size;
+			sLong	Line_Y		= m_Cache_bFlip ? Get_NY() - 1 - pLine->y : pLine->y;
+			sLong	Line_Size	= Get_nLineBytes();
+			sLong	Line_Pos	= m_Cache_Offset + Line_Y * Line_Size;
 
 			//-------------------------------------------------
-			Cache_Stream.Seek(Line_Pos);
-			Cache_Stream.Read(pLine->Data, sizeof(char), Line_Size);
+			m_Cache_Stream.Seek(Line_Pos);
+			m_Cache_Stream.Read(pLine->Data, sizeof(char), Line_Size);
 
-			if( Cache_bSwap && m_Type != SG_DATATYPE_Bit )
+			if( m_Cache_bSwap && m_Type != SG_DATATYPE_Bit )
 			{
-				for(x=0, pValue=pLine->Data; x<Get_NX(); x++, pValue+=Get_nValueBytes())
+				char	*pValue	= pLine->Data;
+
+				for(int x=0; x<Get_NX(); x++, pValue+=Get_nValueBytes())
 				{
 					_Swap_Bytes(pValue, Get_nValueBytes());
 				}
@@ -808,28 +796,18 @@ bool CSG_Grid::Set_Compression(bool bOn)
 }
 
 //---------------------------------------------------------
-bool CSG_Grid::is_Compressed(void)
-{
-	return( m_Memory_Type == GRID_MEMORY_Compression );
-}
-
-//---------------------------------------------------------
-double CSG_Grid::Get_Compression_Ratio(void)
+double CSG_Grid::Get_Compression_Ratio(void) const
 {
-	int		y;
-	long	nCompression, nNoCompression;
-
-	if( is_Compressed() )
+	if( is_Valid() && is_Compressed() )
 	{
-		for(y=0, nCompression=0; y<Get_NY(); y++)
-		{
-			nCompression	+= *((int *)m_Values[y]);
-		}
+		sLong	nCompressed	= 0;
 
-		if( (nNoCompression = (long) Get_NCells() * Get_nValueBytes()) > 0 )
+		for(int y=0; y<Get_NY(); y++)
 		{
-			return( (double)nCompression / (double)nNoCompression );
+			nCompressed	+= *((int *)m_Values[y]);
 		}
+
+		return( (double)nCompressed / (double)(Get_NCells() * Get_nValueBytes()) );
 	}
 
 	return( 1.0 );
diff --git a/src/saga_core/saga_api/grid_operation.cpp b/src/saga_core/saga_api/grid_operation.cpp
index 05c6d33..a901e7b 100644
--- a/src/saga_core/saga_api/grid_operation.cpp
+++ b/src/saga_core/saga_api/grid_operation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_operation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: grid_operation.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -94,7 +94,7 @@ bool CSG_Grid::Assign(double Value)
 		}
 		else
 		{
-			for(long n=0; n<Get_NCells(); n++)
+			for(sLong n=0; n<Get_NCells(); n++)
 			{
 				Set_Value(n, Value);
 			}
diff --git a/src/saga_core/saga_api/grid_system.cpp b/src/saga_core/saga_api/grid_system.cpp
index 00357c9..ca192cf 100644
--- a/src/saga_core/saga_api/grid_system.cpp
+++ b/src/saga_core/saga_api/grid_system.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_system.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: grid_system.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -223,7 +223,7 @@ bool CSG_Grid_System::Assign(double Cellsize, double xMin, double yMin, int NX,
 	{
 		m_NX		= NX;
 		m_NY		= NY;
-		m_NCells	= (long) NY * NX;
+		m_NCells	= (sLong)NY * NX;
 
 		m_Cellsize	= Cellsize;
 		m_Cellarea	= Cellsize * Cellsize;
diff --git a/src/saga_core/saga_api/mat_formula.cpp b/src/saga_core/saga_api/mat_formula.cpp
index 2e2c576..51bd0bb 100644
--- a/src/saga_core/saga_api/mat_formula.cpp
+++ b/src/saga_core/saga_api/mat_formula.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_formula.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: mat_formula.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -615,7 +615,7 @@ int CSG_Formula::Del_Function(SG_Char *name)
 
 	_Set_Error();
 
-	return( pFunction - gSG_Functions );
+	return( (int)(pFunction - gSG_Functions) );
 }
 
 //---------------------------------------------------------
@@ -726,7 +726,7 @@ int CSG_Formula::_Get_Function(SG_Char *name)
 
 	_Set_Error();
 
-	return( pFunction - gSG_Functions );
+	return( (int)(pFunction - gSG_Functions) );
 }
 
 
diff --git a/src/saga_core/saga_api/mat_matrix.cpp b/src/saga_core/saga_api/mat_matrix.cpp
index 4e87fb9..e810ecf 100644
--- a/src/saga_core/saga_api/mat_matrix.cpp
+++ b/src/saga_core/saga_api/mat_matrix.cpp
@@ -1,2117 +1,2054 @@
-/**********************************************************
- * Version $Id: mat_matrix.cpp 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//           Application Programming Interface           //
-//                                                       //
-//                  Library: SAGA_API                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                    mat_matrix.cpp                     //
-//                                                       //
-//          Copyright (C) 2005 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "mat_tools.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool		SG_Matrix_Triangular_Decomposition	(CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e);
-bool		SG_Matrix_Tridiagonal_QL			(CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Vector::CSG_Vector(void)
-{
-	_On_Construction();
-}
-
-//---------------------------------------------------------
-CSG_Vector::CSG_Vector(const CSG_Vector &Vector)
-{
-	_On_Construction();
-
-	Create(Vector);
-}
-
-bool CSG_Vector::Create(const CSG_Vector &Vector)
-{
-	return( Assign(Vector) );
-}
-
-//---------------------------------------------------------
-CSG_Vector::CSG_Vector(int n, double *Data)
-{
-	_On_Construction();
-
-	Create(n, Data);
-}
-
-bool CSG_Vector::Create(int n, double *Data)
-{
-	if( n > 0 )
-	{
-		if( n != m_n )
-		{
-			Destroy();
-
-			if( (m_z = (double *)SG_Malloc(n * sizeof(double))) != NULL )
-			{
-				m_n	= n;
-			}
-		}
-
-		if( m_z )
-		{
-			if( Data )
-			{
-				memcpy(m_z, Data, m_n * sizeof(double));
-			}
-			else
-			{
-				memset(m_z,    0, m_n * sizeof(double));
-			}
-
-			return( true );
-		}
-	}
-
-	Destroy();
-
-	return( false );
-}
-
-//---------------------------------------------------------
-CSG_Vector::~CSG_Vector(void)
-{
-	Destroy();
-}
-
-bool CSG_Vector::Destroy(void)
-{
-	if( m_z )
-	{
-		SG_Free(m_z);
-	}
-
-	m_z	= NULL;
-	m_n	= 0;
-
-	return( true );
-}
-
-//---------------------------------------------------------
-void CSG_Vector::_On_Construction(void)
-{
-	m_z	= NULL;
-	m_n	= 0;
-}
-
-//---------------------------------------------------------
-/**
-  * Sets the number of rows to nRows. Values will be preserved.
-  * Returns true if successful.
-*/
-bool CSG_Vector::Set_Rows(int nRows)
-{
-	if( nRows > m_n )
-	{
-		return( Add_Rows(nRows - m_n) );
-	}
-
-	if( nRows < m_n )
-	{
-		return( Del_Rows(m_n - nRows) );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Add_Rows(int nRows)
-{
-	if( nRows > 0 )
-	{
-		double	*z	= (double *)SG_Realloc(m_z, (m_n + nRows) * sizeof(double));
-
-		if( z )
-		{
-			for(int i=m_n; i<m_n+nRows; i++)
-			{
-				z[i]	= 0.0;
-			}
-
-			m_z	 = z;
-			m_n	+= nRows;
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-/**
-  * Deletes last nRows rows. Sets size to zero if nRows is greater
-  * than current number of rows
-  * Returns true if successful.
-*/
-bool CSG_Vector::Del_Rows(int nRows)
-{
-	if( nRows <= 0 )
-	{
-		return( true );
-	}
-
-	if( nRows >= m_n )
-	{
-		return( Destroy() );
-	}
-
-	double	*z	= (double *)SG_Realloc(m_z, (m_n - nRows) * sizeof(double));
-
-	if( z )
-	{
-		m_z	 = z;
-		m_n	-= nRows;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Add_Row(double Value)
-{
-	double	*z	= (double *)SG_Realloc(m_z, (m_n + 1) * sizeof(double));
-
-	if( z )
-	{
-		m_z			= z;
-		m_z[m_n++]	= Value;
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Del_Row(void)
-{
-	if( m_n == 1 )
-	{
-		return( Destroy() );
-	}
-	else if( m_n > 1 )
-	{
-		double	*z	= (double *)SG_Realloc(m_z, (m_n - 1) * sizeof(double));
-
-		if( z )
-		{
-			m_z	= z;
-			m_n	--;
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CSG_Vector::asString(void)
-{
-	CSG_String	s;
-
-	for(int i=0; i<m_n; i++)
-	{
-		s.Append(CSG_String::Format(SG_T("%f\n"), m_z[i]));
-	}
-
-	return( s );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Vector::is_Equal(const CSG_Vector &Vector) const
-{
-	if( m_n == Vector.m_n )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			if( m_z[i] != Vector.m_z[i] )
-			{
-				return( false );
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Assign(double Scalar)
-{
-	if( m_n > 0 )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			m_z[i]	= Scalar;
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Assign(const CSG_Vector &Vector)
-{
-	if( Create(Vector.m_n) )
-	{
-		memcpy(m_z, Vector.m_z, m_n * sizeof(double));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Add(double Scalar)
-{
-	if( m_n > 0 )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			m_z[i]	+= Scalar;
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Add(const CSG_Vector &Vector)
-{
-	if( m_n == Vector.m_n && m_n > 0 )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			m_z[i]	+= Vector.m_z[i];
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Subtract(const CSG_Vector &Vector)
-{
-	if( m_n == Vector.m_n && m_n > 0 )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			m_z[i]	-= Vector.m_z[i];
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Multiply(double Scalar)
-{
-	if( m_n > 0 )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			m_z[i]	*= Scalar;
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Multiply(const CSG_Vector &Vector)
-{
-	if( m_n == Vector.m_n && m_n == 3 )
-	{
-		CSG_Vector	v(*this);
-
-		m_z[0]	= v[1] * Vector.m_z[2] - v[2] * Vector.m_z[1];
-		m_z[1]	= v[2] * Vector.m_z[0] - v[0] * Vector.m_z[2];
-		m_z[2]	= v[0] * Vector.m_z[1] - v[1] * Vector.m_z[0];
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-double CSG_Vector::Multiply_Scalar(const CSG_Vector &Vector) const
-{
-	double	z	= 0.0;
-
-	if( m_n == Vector.m_n )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			z	+= m_z[i] * Vector.m_z[i];
-		}
-	}
-
-	return( z );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Multiply(const class CSG_Matrix &Matrix)
-{
-	return( Assign(Matrix.Multiply(*this)) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Vector::operator == (const CSG_Vector &Vector) const
-{
-	return( is_Equal(Vector) );
-}
-
-//---------------------------------------------------------
-CSG_Vector & CSG_Vector::operator = (double Scalar)
-{
-	Assign(Scalar);
-
-	return( *this );
-}
-
-CSG_Vector & CSG_Vector::operator = (const CSG_Vector &Vector)
-{
-	Assign(Vector);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Vector & CSG_Vector::operator += (double Scalar)
-{
-	Add(Scalar);
-
-	return( *this );
-}
-
-CSG_Vector & CSG_Vector::operator += (const CSG_Vector &Vector)
-{
-	Add(Vector);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Vector & CSG_Vector::operator -= (double Scalar)
-{
-	Add(-Scalar);
-
-	return( *this );
-}
-
-CSG_Vector & CSG_Vector::operator -= (const CSG_Vector &Vector)
-{
-	Subtract(Vector);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Vector & CSG_Vector::operator *= (double Scalar)
-{
-	Multiply(Scalar);
-
-	return( *this );
-}
-
-CSG_Vector & CSG_Vector::operator *= (const CSG_Vector &Vector)
-{
-	Multiply(Vector);
-
-	return( *this );
-}
-
-CSG_Vector & CSG_Vector::operator *= (const class CSG_Matrix &Matrix)
-{
-	Multiply(Matrix);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Vector CSG_Vector::operator + (double Scalar) const
-{
-	CSG_Vector	v(*this);
-
-	v.Add(Scalar);
-
-	return( v );
-}
-
-CSG_Vector CSG_Vector::operator + (const CSG_Vector &Vector) const
-{
-	CSG_Vector	v(*this);
-
-	v.Add(Vector);
-
-	return( v );
-}
-
-//---------------------------------------------------------
-CSG_Vector CSG_Vector::operator - (double Scalar) const
-{
-	CSG_Vector	v(*this);
-
-	v.Add(-Scalar);
-
-	return( v );
-}
-
-CSG_Vector CSG_Vector::operator - (const CSG_Vector &Vector) const
-{
-	CSG_Vector	v(*this);
-
-	v.Subtract(Vector);
-
-	return( v );
-}
-
-//---------------------------------------------------------
-CSG_Vector CSG_Vector::operator * (double Scalar) const
-{
-	CSG_Vector	v(*this);
-
-	v.Multiply(Scalar);
-
-	return( v );
-}
-
-double CSG_Vector::operator * (const CSG_Vector &Vector) const
-{
-	return( Multiply_Scalar(Vector) );
-}
-
-CSG_Vector operator * (double Scalar, const CSG_Vector &Vector)
-{
-	return( Vector * Scalar );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Vector::Set_Zero(void)
-{
-	return( Create(m_n) );
-}
-
-//---------------------------------------------------------
-bool CSG_Vector::Set_Unity(void)
-{
-	double	Length;
-
-	if( (Length = Get_Length()) > 0.0 )
-	{
-		for(int i=0; i<m_n; i++)
-		{
-			m_z[i]	/= Length;
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CSG_Vector::Get_Length(void) const
-{
-	if( m_n > 0 )
-	{
-		double	z	= 0.0;
-
-		for(int i=0; i<m_n; i++)
-		{
-			z	+= m_z[i] * m_z[i];
-		}
-
-		return( sqrt(z) );
-	}
-
-	return( 0.0 );
-}
-
-//---------------------------------------------------------
-double CSG_Vector::Get_Angle(const CSG_Vector &Vector) const
-{
-	if( m_n > Vector.m_n )
-	{
-		return( Vector.Get_Angle(*this) );
-	}
-
-	int		i;
-	double	A, B, z;
-
-	if( (A = Get_Length()) > 0.0 && (B = Vector.Get_Length()) > 0.0 )
-	{
-		for(i=0, z=0.0; i<m_n; i++)
-		{
-			z	+= Vector.m_z[i] * m_z[i];
-		}
-
-		for(i=m_n; i<Vector.m_n; i++)
-		{
-			z	+= Vector.m_z[i];
-		}
-
-		return( acos(z / (A * B)) );
-	}
-
-	return( 0.0 );
-}
-
-//---------------------------------------------------------
-CSG_Vector CSG_Vector::Get_Unity(void) const
-{
-	CSG_Vector	v(*this);
-
-	v.Set_Unity();
-
-	return( v );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_Matrix::CSG_Matrix(void)
-{
-	_On_Construction();
-}
-
-//---------------------------------------------------------
-CSG_Matrix::CSG_Matrix(const CSG_Matrix &Matrix)
-{
-	_On_Construction();
-
-	Create(Matrix);
-}
-
-bool CSG_Matrix::Create(const CSG_Matrix &Matrix)
-{
-	return( Assign(Matrix) );
-}
-
-//---------------------------------------------------------
-CSG_Matrix::CSG_Matrix(int nx, int ny, double *Data)
-{
-	_On_Construction();
-
-	Create(nx, ny, Data);
-}
-
-bool CSG_Matrix::Create(int nx, int ny, double *Data)
-{
-	if( nx > 0 && ny > 0 )
-	{
-		if( nx != m_nx || ny != m_ny )
-		{
-			Destroy();
-
-			if( (m_z    = (double **)SG_Malloc(ny      * sizeof(double *))) != NULL
-			&&  (m_z[0]	= (double  *)SG_Malloc(ny * nx * sizeof(double  ))) != NULL )
-			{
-				m_nx	= nx;
-				m_ny	= ny;
-
-				for(ny=1; ny<m_ny; ny++)
-				{
-					m_z[ny]	= m_z[ny - 1] + nx;
-				}
-			}
-			else
-			{
-				Destroy();
-
-				return( false );
-			}
-		}
-
-		if( m_z && m_z[0] )
-		{
-			if( Data )
-			{
-				memcpy(m_z[0], Data, m_ny * m_nx * sizeof(double));
-			}
-			else
-			{
-				memset(m_z[0],    0, m_ny * m_nx * sizeof(double));
-			}
-
-			return( true );
-		}
-	}
-
-	Destroy();
-
-	return( false );
-}
-
-//---------------------------------------------------------
-CSG_Matrix::~CSG_Matrix(void)
-{
-	Destroy();
-}
-
-bool CSG_Matrix::Destroy(void)
-{
-	if( m_z )
-	{
-		if( m_z[0] )
-		{
-			SG_Free(m_z[0]);
-		}
-
-		SG_Free(m_z);
-	}
-
-	m_z		= NULL;
-	m_nx	= 0;
-	m_ny	= 0;
-
-	return( true );
-}
-
-//---------------------------------------------------------
-void CSG_Matrix::_On_Construction(void)
-{
-	m_z		= NULL;
-	m_nx	= 0;
-	m_ny	= 0;
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Size(int nRows, int nCols)
-{
-	return( nRows > 0 && nCols > 0 && Set_Rows(nRows) && Set_Cols(nCols) );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Cols(int nCols)
-{
-	if( nCols > m_nx )
-	{
-		return( Add_Cols(nCols - m_nx) );
-	}
-
-	if( nCols < m_nx )
-	{
-		return( Del_Cols(m_nx - nCols) );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Rows(int nRows)
-{
-	if( nRows > m_ny )
-	{
-		return( Add_Rows(nRows - m_ny) );
-	}
-
-	if( nRows < m_ny )
-	{
-		return( Del_Rows(m_ny - nRows) );
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Add_Cols(int nCols)
-{
-	if( nCols > 0 && m_ny > 0 )
-	{
-		CSG_Matrix	Tmp(*this);
-
-		if( Create(Tmp.m_nx + nCols, Tmp.m_ny) )
-		{
-			for(int y=0; y<Tmp.m_ny; y++)
-			{
-				memcpy(m_z[y], Tmp.m_z[y], Tmp.m_nx * sizeof(double));
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Add_Rows(int nRows)
-{
-	if( nRows > 0 && m_nx > 0 )
-	{
-		m_ny	+= nRows;
-
-		m_z		= (double **)SG_Realloc(m_z   , m_ny        * sizeof(double *));
-		m_z[0]	= (double  *)SG_Realloc(m_z[0], m_ny * m_nx * sizeof(double  ));
-
-		for(int y=1; y<m_ny; y++)
-		{
-			m_z[y]	= m_z[y - 1] + m_nx;
-		}
-
-		memset(m_z[m_ny - nRows], 0, nRows * m_nx * sizeof(double));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-/**
-  * Deletes the last nCols columns.
-*/
-bool CSG_Matrix::Del_Cols(int nCols)
-{
-	if( nCols > 0 && m_ny > 0 && nCols < m_nx )
-	{
-		CSG_Matrix	Tmp(*this);
-
-		if( Create(Tmp.m_nx - nCols, Tmp.m_ny) )
-		{
-			for(int y=0; y<Tmp.m_ny; y++)
-			{
-				memcpy(m_z[y], Tmp.m_z[y], m_nx * sizeof(double));
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-/**
-  * Deletes the last nRows rows.
-*/
-bool CSG_Matrix::Del_Rows(int nRows)
-{
-	if( nRows > 0 && m_nx > 0 && nRows < m_ny )
-	{
-		m_ny	-= nRows;
-
-		m_z		= (double **)SG_Realloc(m_z   , m_ny        * sizeof(double *));
-		m_z[0]	= (double  *)SG_Realloc(m_z[0], m_ny * m_nx * sizeof(double  ));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Add_Col(double *Data)
-{
-	if( Add_Cols(1) )
-	{
-		Set_Col(m_nx - 1, Data);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-bool CSG_Matrix::Add_Col(const CSG_Vector &Data)
-{
-	return( m_nx == 0 ? Create(1, Data.Get_N(), Data.Get_Data()) : m_ny == Data.Get_N() ? Add_Col(Data.Get_Data()) : false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Add_Row(double *Data)
-{
-	if( Add_Rows(1) )
-	{
-		Set_Row(m_ny - 1, Data);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-bool CSG_Matrix::Add_Row(const CSG_Vector &Data)
-{
-	return( m_ny == 0 ? Create(Data.Get_N(), 1, Data.Get_Data()) : m_nx == Data.Get_N() ? Add_Row(Data.Get_Data()) : false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Ins_Col(int iCol, double *Data)
-{
-	if( iCol >= 0 && iCol <= m_nx )
-	{
-		CSG_Matrix	Tmp(*this);
-
-		if( Create(Tmp.m_nx + 1, Tmp.m_ny) )
-		{
-			for(int y=0; y<m_ny; y++)
-			{
-				double	*pz	= m_z[y], *pz_tmp	= Tmp.m_z[y];
-
-				for(int x=0; x<m_nx; x++, pz++)
-				{
-					if( x != iCol )
-					{
-						*pz	= *pz_tmp;	pz_tmp++;
-					}
-					else if( Data )
-					{
-						*pz	= Data[y];
-					}
-				}
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-bool CSG_Matrix::Ins_Col(int iCol, const CSG_Vector &Data)
-{
-	return( m_nx == 0 ? Add_Col(Data) : m_ny == Data.Get_N() ? Ins_Col(iCol, Data.Get_Data()) : false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Ins_Row(int iRow, double *Data)
-{
-	if( iRow >= 0 && iRow <= m_ny )
-	{
-		CSG_Matrix	Tmp(*this);
-
-		if( Create(Tmp.m_nx, Tmp.m_ny + 1) )
-		{
-			for(int y=0, y_tmp=0; y<m_ny; y++)
-			{
-				if( y != iRow )
-				{
-					memcpy(m_z[y], Tmp.m_z[y_tmp++], m_nx * sizeof(double));
-				}
-				else if( Data )
-				{
-					memcpy(m_z[y], Data, m_nx * sizeof(double));
-				}
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-bool CSG_Matrix::Ins_Row(int iRow, const CSG_Vector &Data)
-{
-	return( m_ny == 0 ? Add_Row(Data) : m_nx == Data.Get_N() ? Ins_Row(iRow, Data.Get_Data()) : false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Col(int iCol, double *Data)
-{
-	if( Data && iCol >= 0 && iCol < m_nx )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			m_z[y][iCol]	= Data[y];
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-bool CSG_Matrix::Set_Col(int iCol, const CSG_Vector &Data)
-{
-	return( m_ny == Data.Get_N() ? Set_Col(iCol, Data.Get_Data()) : false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Row(int iRow, double *Data)
-{
-	if( Data && iRow >= 0 && iRow < m_ny )
-	{
-		memcpy(m_z[iRow], Data, m_nx * sizeof(double));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-bool CSG_Matrix::Set_Row(int iRow, const CSG_Vector &Data)
-{
-	return( m_nx == Data.Get_N() ? Set_Row(iRow, Data.Get_Data()) : false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Del_Col(int iCol)
-{
-	if( m_nx == 1 )
-	{
-		return( Destroy() );
-	}
-
-	if( iCol >= 0 && iCol < m_nx )
-	{
-		CSG_Matrix	Tmp(*this);
-
-		if( Create(Tmp.m_nx - 1, Tmp.m_ny) )
-		{
-			for(int y=0; y<m_ny; y++)
-			{
-				double	*pz	= m_z[y], *pz_tmp	= Tmp.m_z[y];
-
-				for(int x_tmp=0; x_tmp<Tmp.m_nx; x_tmp++, pz_tmp++)
-				{
-					if( x_tmp != iCol )
-					{
-						*pz	= *pz_tmp;	pz++;
-					}
-				}
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Del_Row(int iRow)
-{
-	if( m_ny == 1 )
-	{
-		return( Destroy() );
-	}
-
-	if( iRow >= 0 && iRow < m_ny )
-	{
-		CSG_Matrix	Tmp(*this);
-
-		if( Create(Tmp.m_nx, Tmp.m_ny - 1) )
-		{
-			for(int y=0, y_tmp=0; y_tmp<Tmp.m_ny; y_tmp++)
-			{
-				if( y_tmp != iRow )
-				{
-					memcpy(m_z[y++], Tmp.m_z[y_tmp], m_nx * sizeof(double));
-				}
-			}
-
-			return( true );
-		}
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-CSG_Vector CSG_Matrix::Get_Col(int iCol)	const
-{
-	CSG_Vector	Col;
-	
-	if( iCol >= 0 && iCol < m_nx )
-	{
-		Col.Create(m_ny);
-
-		for(int y=0; y<m_ny; y++)
-		{
-			Col[y]	= m_z[y][iCol];
-		}
-	}
-
-	return( Col );
-}
-
-//---------------------------------------------------------
-CSG_Vector CSG_Matrix::Get_Row(int iRow)	const
-{
-	CSG_Vector	Row;
-	
-	if( iRow >= 0 && iRow < m_ny )
-	{
-		Row.Create(m_nx, m_z[iRow]);
-	}
-
-	return( Row );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CSG_String CSG_Matrix::asString(void)
-{
-	CSG_String	s;
-
-	for(int y=0; y<m_ny; y++)
-	{
-		s.Append(CSG_String::Format(SG_T("\n%d.\t"), y + 1));
-
-		for(int x=0; x<m_nx; x++)
-		{
-			s.Append(CSG_String::Format(SG_T("\t%f"), m_z[y][x]));
-		}
-	}
-
-	s.Append(SG_T("\n"));
-
-	return( s );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Matrix::is_Equal(const CSG_Matrix &Matrix) const
-{
-	if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				if( m_z[y][x] != Matrix.m_z[y][x] )
-				{
-					return( false );
-				}
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Assign(double Scalar)
-{
-	if( m_nx > 0 && m_ny > 0 )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	= Scalar;
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Assign(const CSG_Matrix &Matrix)
-{
-	if( Create(Matrix.m_nx, Matrix.m_ny) )
-	{
-		memcpy(m_z[0], Matrix.m_z[0], m_nx * m_ny * sizeof(double));
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Add(double Scalar)
-{
-	if( m_nx > 0 && m_ny > 0 )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	+= Scalar;
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Add(const CSG_Matrix &Matrix)
-{
-	if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	+= Matrix.m_z[y][x];
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Subtract(const CSG_Matrix &Matrix)
-{
-	if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	-= Matrix.m_z[y][x];
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Multiply(double Scalar)
-{
-	if( m_nx > 0 && m_ny > 0 )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	*= Scalar;
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-CSG_Vector CSG_Matrix::Multiply(const CSG_Vector &Vector) const
-{
-	CSG_Vector	v;
-
-	if( m_nx == Vector.Get_N() && v.Create(m_ny) )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			double	z	= 0.0;
-
-			for(int x=0; x<m_nx; x++)
-			{
-				z	+= m_z[y][x] * Vector(x);
-			}
-
-			v[y]	= z;
-		}
-	}
-
-	return( v );
-}
-
-CSG_Matrix CSG_Matrix::Multiply(const CSG_Matrix &Matrix) const
-{
-	CSG_Matrix	m;
-
-	if( m_nx == Matrix.m_ny && m.Create(Matrix.m_nx, m_ny) )
-	{
-		for(int y=0; y<m.m_ny; y++)
-		{
-			for(int x=0; x<m.m_nx; x++)
-			{
-				double	z	= 0.0;
-
-				for(int n=0; n<m_nx; n++)
-				{
-					z	+= m_z[y][n] * Matrix.m_z[n][x];
-				}
-
-				m.m_z[y][x]	= z;
-			}
-		}
-	}
-
-	return( m );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Matrix::operator == (const CSG_Matrix &Matrix) const
-{
-	return( is_Equal(Matrix) );
-}
-
-//---------------------------------------------------------
-CSG_Matrix & CSG_Matrix::operator = (double Scalar)
-{
-	Assign(Scalar);
-
-	return( *this );
-}
-
-CSG_Matrix & CSG_Matrix::operator = (const CSG_Matrix &Matrix)
-{
-	Assign(Matrix);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Matrix & CSG_Matrix::operator += (double Scalar)
-{
-	Add(Scalar);
-
-	return( *this );
-}
-
-CSG_Matrix & CSG_Matrix::operator += (const CSG_Matrix &Matrix)
-{
-	Add(Matrix);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Matrix & CSG_Matrix::operator -= (double Scalar)
-{
-	Add(-Scalar);
-
-	return( *this );
-}
-
-CSG_Matrix & CSG_Matrix::operator -= (const CSG_Matrix &Matrix)
-{
-	Subtract(Matrix);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Matrix & CSG_Matrix::operator *= (double Scalar)
-{
-	Multiply(Scalar);
-
-	return( *this );
-}
-
-CSG_Matrix & CSG_Matrix::operator *= (const CSG_Matrix &Matrix)
-{
-	Multiply(Matrix);
-
-	return( *this );
-}
-
-//---------------------------------------------------------
-CSG_Matrix CSG_Matrix::operator + (double Scalar) const
-{
-	CSG_Matrix	m(*this);
-
-	m.Add(Scalar);
-
-	return( m );
-}
-
-CSG_Matrix CSG_Matrix::operator + (const CSG_Matrix &Matrix) const
-{
-	CSG_Matrix	m(*this);
-
-	m.Add(Matrix);
-
-	return( m );
-}
-
-//---------------------------------------------------------
-CSG_Matrix CSG_Matrix::operator - (double Scalar) const
-{
-	CSG_Matrix	m(*this);
-
-	m.Add(-Scalar);
-
-	return( m );
-}
-
-CSG_Matrix CSG_Matrix::operator - (const CSG_Matrix &Matrix) const
-{
-	CSG_Matrix	m(*this);
-
-	m.Subtract(Matrix);
-
-	return( m );
-}
-
-//---------------------------------------------------------
-CSG_Matrix CSG_Matrix::operator * (double Scalar) const
-{
-	CSG_Matrix	m(*this);
-
-	m.Multiply(Scalar);
-
-	return( m );
-}
-
-CSG_Vector CSG_Matrix::operator * (const CSG_Vector &Vector) const
-{
-	return( Multiply(Vector) );
-}
-
-CSG_Matrix CSG_Matrix::operator * (const CSG_Matrix &Matrix) const
-{
-	return( Multiply(Matrix) );
-}
-
-CSG_Matrix	operator * (double Scalar, const CSG_Matrix &Matrix)
-{
-	return( Matrix * Scalar );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Zero(void)
-{
-	return( Create(m_nx, m_ny) );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Identity(void)
-{
-	if( m_nx > 0 && m_ny > 0 )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	= x == y ? 1.0 : 0.0;
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Transpose(void)
-{
-	CSG_Matrix	m;
-	
-	if( m.Create(*this) && Create(m_ny, m_nx) )
-	{
-		for(int y=0; y<m_ny; y++)
-		{
-			for(int x=0; x<m_nx; x++)
-			{
-				m_z[y][x]	= m.m_z[x][y];
-			}
-		}
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CSG_Matrix::Set_Inverse(bool bSilent, int nSubSquare)
-{
-	bool	bResult	= false;
-	int		n		= 0;
-
-	//-----------------------------------------------------
-	if( nSubSquare > 0 )
-	{
-		if( nSubSquare <= m_nx && nSubSquare <= m_ny )
-		{
-			n	= nSubSquare;
-		}
-	}
-	else if( is_Square() )
-	{
-		n	= m_nx;
-	}
-
-	//-----------------------------------------------------
-	if( n > 0 )
-	{
-		CSG_Matrix	m(*this);
-		int		*Permutation	= (int *)SG_Malloc(n * sizeof(int));
-
-		if( SG_Matrix_LU_Decomposition(n, Permutation, m.Get_Data(), bSilent) )
-		{
-			CSG_Vector	v(n);
-
-			for(int j=0; j<n && (bSilent || SG_UI_Process_Set_Progress(j, n)); j++)
-			{
-				v.Set_Zero();
-				v[j]	= 1.0;
-
-				SG_Matrix_LU_Solve(n, Permutation, m, v.Get_Data(), true);
-
-				for(int i=0; i<n; i++)
-				{
-					m_z[i][j]	= v[i];
-				}
-			}
-
-			bResult	= true;
-		}
-
-		SG_Free(Permutation);
-	}
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-double CSG_Matrix::Get_Determinant(void) const
-{
-	double	d	= 0.0;
-
-	for(int y=0; y<m_ny; y++)
-	{
-		for(int x=0; x<m_nx; x++)
-		{
-		}
-	}
-
-	return( d );
-}
-
-//---------------------------------------------------------
-CSG_Matrix CSG_Matrix::Get_Transpose(void) const
-{
-	CSG_Matrix	m(m_ny, m_nx);
-
-	for(int y=0; y<m_ny; y++)
-	{
-		for(int x=0; x<m_nx; x++)
-		{
-			m.m_z[x][y]	= m_z[y][x];
-		}
-	}
-
-	return( m );
-}
-
-//---------------------------------------------------------
-CSG_Matrix CSG_Matrix::Get_Inverse(bool bSilent, int nSubSquare) const
-{
-	CSG_Matrix	m(*this);
-
-	m.Set_Inverse(bSilent, nSubSquare);
-
-	return( m );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool		SG_Matrix_Solve(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent)
-{
-	bool	bResult	= false;
-	int		n		= Vector.Get_N();
-
-	if( n > 0 && n == Matrix.Get_NX() && n == Matrix.Get_NY() )
-	{
-		int	*Permutation	= (int *)SG_Malloc(n * sizeof(int));
-
-		if( SG_Matrix_LU_Decomposition(n, Permutation, Matrix.Get_Data(), bSilent) )
-		{
-			SG_Matrix_LU_Solve(n, Permutation, Matrix, Vector.Get_Data(), bSilent);
-
-			bResult	= true;
-		}
-
-		SG_Free(Permutation);
-	}
-
-	return( bResult );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool		SG_Matrix_Eigen_Reduction(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent)
-{
-	CSG_Vector	Intermediate;
-
-	Eigen_Vectors	= Matrix;
-
-	return(	SG_Matrix_Triangular_Decomposition	(Eigen_Vectors, Eigen_Values, Intermediate)	// Triangular decomposition (Householder's method)
-		&&	SG_Matrix_Tridiagonal_QL			(Eigen_Vectors, Eigen_Values, Intermediate)	// Reduction of symetric tridiagonal matrix
-	);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool		SG_Matrix_LU_Decomposition(int n, int *Permutation, double **Matrix, bool bSilent)
-{
-	int			i, j, k, iMax;
-	double		dMax, d, Sum;
-	CSG_Vector	Vector;
-	
-	Vector.Create(n);
-
-	for(i=0, iMax=0; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); i++)
-	{
-		dMax	= 0.0;
-
-		for(j=0; j<n; j++)
-		{
-			if( (d = fabs(Matrix[i][j])) > dMax )
-			{
-				dMax	= d;
-			}
-		}
-
-		if( dMax <= 0.0 )	// singular matrix !!!...
-		{
-			return( false );
-		}
-
-		Vector[i]	= 1.0 / dMax;
-	}
-
-	for(j=0; j<n && (bSilent || SG_UI_Process_Set_Progress(j, n)); j++)
-	{
-		for(i=0; i<j; i++)
-		{
-			Sum		= Matrix[i][j];
-
-			for(k=0; k<i; k++)
-			{
-				Sum		-= Matrix[i][k] * Matrix[k][j];
-			}
-
-			Matrix[i][j]	= Sum;
-		}
-
-		for(i=j, dMax=0.0; i<n; i++)
-		{
-			Sum		= Matrix[i][j];
-
-			for(k=0; k<j; k++)
-			{
-				Sum		-= Matrix[i][k] * Matrix[k][j];
-			}
-
-			Matrix[i][j]	= Sum;
-
-			if( (d = Vector[i] * fabs(Sum)) >= dMax )
-			{
-				dMax	= d;
-				iMax	= i;
-			}
-		}
-
-		if( j != iMax )
-		{
-			for(k=0; k<n; k++)
-			{
-				d				= Matrix[iMax][k];
-				Matrix[iMax][k]	= Matrix[j   ][k];
-				Matrix[j   ][k]	= d;
-			}
-
-			Vector[iMax]	= Vector[j];
-		}
-
-		Permutation[j]	= iMax;
-
-		if( Matrix[j][j] == 0.0 )
-		{
-			Matrix[j][j]	= M_TINY;
-		}
-
-		if( j != n )
-		{
-			d	= 1.0 / (Matrix[j][j]);
-
-			for(i=j+1; i<n; i++)
-			{
-				Matrix[i][j]	*= d;
-			}
-		}
-	}
-
-	return( bSilent || SG_UI_Process_Get_Okay(false) );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool		SG_Matrix_LU_Solve(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent)
-{
-	int		i, j, k;
-	double	Sum;
-
-	for(i=0, k=-1; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); i++)
-	{
-		Sum						= Vector[Permutation[i]];
-		Vector[Permutation[i]]	= Vector[i];
-
-		if( k >= 0 )
-		{
-			for(j=k; j<=i-1; j++)
-			{
-				Sum	-= Matrix[i][j] * Vector[j];
-			}
-		}
-		else if( Sum )
-		{
-			k		= i;
-		}
-
-		Vector[i]	= Sum;
-	}
-
-	for(i=n-1; i>=0 && (bSilent || SG_UI_Process_Set_Progress(n-i, n)); i--)
-	{
-		Sum			= Vector[i];
-
-		for(j=i+1; j<n; j++)
-		{
-			Sum		-= Matrix[i][j] * Vector[j];
-		}
-
-		Vector[i]	= Sum / Matrix[i][i];
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Householder reduction of matrix a to tridiagonal form.
-
-bool SG_Matrix_Triangular_Decomposition(CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e)
-{
-	if( A.Get_NX() != A.Get_NY() )
-	{
-		return( false );
-	}
-
-	int		l, k, j, i, n;
-	double	scale, hh, h, g, f;
-
-	n	= A.Get_NX();
-
-	d.Create(n);
-	e.Create(n);
-
-	for(i=n-1; i>=1; i--)
-	{
-		l	= i - 1;
-		h	= scale = 0.0;
-
-		if( l > 0 )
-		{
-			for(k=0; k<=l; k++)
-			{
-				scale	+= fabs(A[i][k]);
-			}
-
-			if( scale == 0.0 )
-			{
-				e[i]	= A[i][l];
-			}
-			else
-			{
-				for(k=0; k<=l; k++)
-				{
-					A[i][k]	/= scale;
-					h		+= A[i][k] * A[i][k];
-				}
-
-				f		= A[i][l];
-				g		= f > 0.0 ? -sqrt(h) : sqrt(h);
-				e[i]	= scale * g;
-				h		-= f * g;
-				A[i][l]	= f - g;
-				f		= 0.0;
-
-				for(j=0; j<=l; j++)
-				{
-					A[j][i]	= A[i][j]/h;
-					g		= 0.0;
-
-					for(k=0; k<=j; k++)
-					{
-						g	+= A[j][k] * A[i][k];
-					}
-
-					for(k=j+1; k<=l; k++)
-					{
-						g	+= A[k][j] * A[i][k];
-					}
-
-					e[j]	= g / h;
-					f		+= e[j] * A[i][j];
-				}
-
-				hh	= f / (h + h);
-
-				for(j=0; j<=l; j++)
-				{
-					f		= A[i][j];
-					e[j]	= g = e[j] - hh * f;
-
-					for(k=0; k<=j; k++)
-					{
-						A[j][k]	-= (f * e[k] + g * A[i][k]);
-					}
-				}
-			}
-		}
-		else
-		{
-			e[i]	= A[i][l];
-		}
-
-		d[i]	= h;
-	}
-
-	d[0]	= 0.0;
-	e[0]	= 0.0;
-
-	for(i=0; i<n; i++)
-	{
-		l	= i - 1;
-
-		if( d[i] )
-		{	
-			for(j=0; j<=l; j++)
-			{
-				g	= 0.0;
-
-				for(k=0; k<=l; k++)
-				{
-					g		+= A[i][k] * A[k][j];
-				}
-
-				for(k=0; k<=l; k++)
-				{
-					A[k][j]	-= g * A[k][i];
-				}
-			}
-		}
-
-		d[i]	= A[i][i];
-		A[i][i]	= 1.0;
-
-		for(j=0; j<=l; j++)
-		{
-			A[j][i]	= A[i][j] = 0.0;
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Tridiagonal QL algorithm -- Implicit
-
-bool SG_Matrix_Tridiagonal_QL(CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e)
-{
-	if( Q.Get_NX() != Q.Get_NY() || Q.Get_NX() != d.Get_N() || Q.Get_NX() != e.Get_N() )
-	{
-		return( false );
-	}
-
-	int		m, l, iter, i, k, n;
-	double	s, r, p, g, f, dd, c, b;
-
-	n	= d.Get_N();
-
-	for(i=1; i<n; i++)
-	{
-		e[i - 1]	= e[i];
-	}
-
-	e[n - 1]	= 0.0;
-
-	for(l=0; l<n; l++)
-	{
-		iter	= 0;
-
-		do
-		{
-			for(m=l; m<n-1; m++)
-			{
-				dd	= fabs(d[m]) + fabs(d[m + 1]);
-
-				if( fabs(e[m]) + dd == dd )
-				{
-					break;
-				}
-			}
-
-			if( m != l )
-			{
-				if( iter++ == 30 )
-				{
-					return( false );	// erhand("No convergence in TLQI.");
-				}
-
-				g	= (d[l+1] - d[l]) / (2.0 * e[l]);
-				r	= sqrt((g * g) + 1.0);
-				g	= d[m] - d[l] + e[l] / (g + M_SET_SIGN(r, g));
-				s	= c = 1.0;
-				p	= 0.0;
-
-				for(i = m-1; i >= l; i--)
-				{
-					f = s * e[i];
-					b = c * e[i];
-
-					if (fabs(f) >= fabs(g))
-					{
-						c = g / f;
-						r = sqrt((c * c) + 1.0);
-						e[i+1] = f * r;
-						c *= (s = 1.0/r);
-					}
-					else
-					{
-						s = f / g;
-						r = sqrt((s * s) + 1.0);
-						e[i+1] = g * r;
-						s *= (c = 1.0/r);
-					}
-
-					g		= d[i+1] - p;
-					r		= (d[i] - g) * s + 2.0 * c * b;
-					p		= s * r;
-					d[i+1]	= g + p;
-					g		= c * r - b;
-
-					for(k=0; k<n; k++)
-					{
-						f			= Q[k][i+1];
-						Q[k][i+1]	= s * Q[k][i] + c * f;
-						Q[k][i]		= c * Q[k][i] - s * f;
-					}
-				}
-
-				d[l] = d[l] - p;
-				e[l] = g;
-				e[m] = 0.0;
-			}
-		}
-		while( m != l );
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
+/**********************************************************
+ * Version $Id: mat_matrix.cpp 1953 2014-01-22 14:19:31Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_API                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    mat_matrix.cpp                     //
+//                                                       //
+//          Copyright (C) 2005 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "mat_tools.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool		SG_Matrix_Triangular_Decomposition	(CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e);
+bool		SG_Matrix_Tridiagonal_QL			(CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Vector::CSG_Vector(void)
+{
+	m_Array.Create(sizeof(double), 0, SG_ARRAY_GROWTH_2);
+}
+
+//---------------------------------------------------------
+CSG_Vector::CSG_Vector(const CSG_Vector &Vector)
+{
+	m_Array.Create(sizeof(double), 0, SG_ARRAY_GROWTH_2);
+
+	Create(Vector);
+}
+
+bool CSG_Vector::Create(const CSG_Vector &Vector)
+{
+	return( Assign(Vector) );
+}
+
+//---------------------------------------------------------
+CSG_Vector::CSG_Vector(int n, double *Data)
+{
+	m_Array.Create(sizeof(double), 0, SG_ARRAY_GROWTH_2);
+
+	Create(n, Data);
+}
+
+bool CSG_Vector::Create(int n, double *Data)
+{
+	if( n > 0 )
+	{
+		if( m_Array.Set_Array(n) )
+		{
+			if( Data )
+			{
+				memcpy(Get_Data(), Data, n * sizeof(double));
+			}
+			else
+			{
+				memset(Get_Data(),    0, n * sizeof(double));
+			}
+
+			return( true );
+		}
+	}
+
+	Destroy();
+
+	return( false );
+}
+
+//---------------------------------------------------------
+CSG_Vector::~CSG_Vector(void)
+{
+	Destroy();
+}
+
+bool CSG_Vector::Destroy(void)
+{
+	return( m_Array.Set_Array(0) );
+}
+
+//---------------------------------------------------------
+/**
+  * Sets the number of rows to nRows. Values will be preserved.
+  * Returns true if successful.
+*/
+bool CSG_Vector::Set_Rows(int nRows)
+{
+	if( nRows > Get_N() )
+	{
+		return( Add_Rows(nRows - Get_N()) );
+	}
+
+	if( nRows < Get_N() )
+	{
+		return( Del_Rows(Get_N() - nRows) );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Add_Rows(int nRows)
+{
+	if( nRows > 0 && m_Array.Set_Array(Get_N() + nRows) )
+	{
+		for(int i=Get_N()-nRows; i<Get_N(); i++)
+		{
+			Get_Data()[i]	= 0.0;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+/**
+  * Deletes last nRows rows. Sets size to zero if nRows is greater
+  * than current number of rows
+  * Returns true if successful.
+*/
+bool CSG_Vector::Del_Rows(int nRows)
+{
+	if( nRows <= 0 )
+	{
+		return( true );
+	}
+
+	if( nRows >= Get_N() )
+	{
+		return( Destroy() );
+	}
+
+	return( m_Array.Set_Array(Get_N() - nRows) );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Add_Row(double Value)
+{
+	if( m_Array.Inc_Array() )
+	{
+		Get_Data()[Get_N() - 1]	= Value;
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Del_Row(void)
+{
+	return( m_Array.Dec_Array() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_Vector::asString(int Width, int Precision, bool bScientific)	const
+{
+	CSG_String	s;
+
+	for(int i=0; i<Get_N(); i++)
+	{
+		s	+= SG_Get_Double_asString(Get_Data(i), Width, Precision, bScientific) + "\n";
+	}
+
+	return( s );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Vector::is_Equal(const CSG_Vector &Vector) const
+{
+	if( Get_N() == Vector.Get_N() )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			if( Get_Data(i) != Vector.Get_Data(i) )
+			{
+				return( false );
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Assign(double Scalar)
+{
+	if( Get_N() > 0 )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			Get_Data()[i]	= Scalar;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Assign(const CSG_Vector &Vector)
+{
+	if( Create(Vector.Get_N()) )
+	{
+		memcpy(Get_Data(), Vector.Get_Data(), Get_N() * sizeof(double));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Add(double Scalar)
+{
+	if( Get_N() > 0 )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			Get_Data()[i]	+= Scalar;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Add(const CSG_Vector &Vector)
+{
+	if( Get_N() == Vector.Get_N() && Get_N() > 0 )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			Get_Data()[i]	+= Vector.Get_Data()[i];
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Subtract(const CSG_Vector &Vector)
+{
+	if( Get_N() == Vector.Get_N() && Get_N() > 0 )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			Get_Data()[i]	-= Vector.Get_Data()[i];
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Multiply(double Scalar)
+{
+	if( Get_N() > 0 )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			Get_Data()[i]	*= Scalar;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Multiply(const CSG_Vector &Vector)
+{
+	if( Get_N() == Vector.Get_N() && Get_N() == 3 )
+	{
+		CSG_Vector	v(*this);
+
+		Get_Data()[0]	= v[1] * Vector[2] - v[2] * Vector[1];
+		Get_Data()[1]	= v[2] * Vector[0] - v[0] * Vector[2];
+		Get_Data()[2]	= v[0] * Vector[1] - v[1] * Vector[0];
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+double CSG_Vector::Multiply_Scalar(const CSG_Vector &Vector) const
+{
+	double	z	= 0.0;
+
+	if( Get_N() == Vector.Get_N() )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			z	+= Get_Data()[i] * Vector[i];
+		}
+	}
+
+	return( z );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Multiply(const class CSG_Matrix &Matrix)
+{
+	return( Assign(Matrix.Multiply(*this)) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Vector::operator == (const CSG_Vector &Vector) const
+{
+	return( is_Equal(Vector) );
+}
+
+//---------------------------------------------------------
+CSG_Vector & CSG_Vector::operator = (double Scalar)
+{
+	Assign(Scalar);
+
+	return( *this );
+}
+
+CSG_Vector & CSG_Vector::operator = (const CSG_Vector &Vector)
+{
+	Assign(Vector);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Vector & CSG_Vector::operator += (double Scalar)
+{
+	Add(Scalar);
+
+	return( *this );
+}
+
+CSG_Vector & CSG_Vector::operator += (const CSG_Vector &Vector)
+{
+	Add(Vector);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Vector & CSG_Vector::operator -= (double Scalar)
+{
+	Add(-Scalar);
+
+	return( *this );
+}
+
+CSG_Vector & CSG_Vector::operator -= (const CSG_Vector &Vector)
+{
+	Subtract(Vector);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Vector & CSG_Vector::operator *= (double Scalar)
+{
+	Multiply(Scalar);
+
+	return( *this );
+}
+
+CSG_Vector & CSG_Vector::operator *= (const CSG_Vector &Vector)
+{
+	Multiply(Vector);
+
+	return( *this );
+}
+
+CSG_Vector & CSG_Vector::operator *= (const class CSG_Matrix &Matrix)
+{
+	Multiply(Matrix);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Vector CSG_Vector::operator + (double Scalar) const
+{
+	CSG_Vector	v(*this);
+
+	v.Add(Scalar);
+
+	return( v );
+}
+
+CSG_Vector CSG_Vector::operator + (const CSG_Vector &Vector) const
+{
+	CSG_Vector	v(*this);
+
+	v.Add(Vector);
+
+	return( v );
+}
+
+//---------------------------------------------------------
+CSG_Vector CSG_Vector::operator - (double Scalar) const
+{
+	CSG_Vector	v(*this);
+
+	v.Add(-Scalar);
+
+	return( v );
+}
+
+CSG_Vector CSG_Vector::operator - (const CSG_Vector &Vector) const
+{
+	CSG_Vector	v(*this);
+
+	v.Subtract(Vector);
+
+	return( v );
+}
+
+//---------------------------------------------------------
+CSG_Vector CSG_Vector::operator * (double Scalar) const
+{
+	CSG_Vector	v(*this);
+
+	v.Multiply(Scalar);
+
+	return( v );
+}
+
+double CSG_Vector::operator * (const CSG_Vector &Vector) const
+{
+	return( Multiply_Scalar(Vector) );
+}
+
+CSG_Vector operator * (double Scalar, const CSG_Vector &Vector)
+{
+	return( Vector * Scalar );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Vector::Set_Zero(void)
+{
+	return( Create(Get_N()) );
+}
+
+//---------------------------------------------------------
+bool CSG_Vector::Set_Unity(void)
+{
+	double	Length;
+
+	if( (Length = Get_Length()) > 0.0 )
+	{
+		for(int i=0; i<Get_N(); i++)
+		{
+			Get_Data()[i]	/= Length;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CSG_Vector::Get_Length(void) const
+{
+	if( Get_N() > 0 )
+	{
+		double	z	= 0.0, *Z	= Get_Data();
+
+		for(int i=0; i<Get_N(); i++)
+		{
+			z	+= Z[i] * Z[i];
+		}
+
+		return( sqrt(z) );
+	}
+
+	return( 0.0 );
+}
+
+//---------------------------------------------------------
+double CSG_Vector::Get_Angle(const CSG_Vector &Vector) const
+{
+	if( Get_N() > Vector.Get_N() )
+	{
+		return( Vector.Get_Angle(*this) );
+	}
+
+	int		i;
+	double	A, B, z, *Z	= Get_Data();
+
+	if( (A = Get_Length()) > 0.0 && (B = Vector.Get_Length()) > 0.0 )
+	{
+		for(i=0, z=0.0; i<Get_N(); i++)
+		{
+			z	+= Vector[i] * Z[i];
+		}
+
+		for(i=Get_N(); i<Vector.Get_N(); i++)
+		{
+			z	+= Vector[i];
+		}
+
+		return( acos(z / (A * B)) );
+	}
+
+	return( 0.0 );
+}
+
+//---------------------------------------------------------
+CSG_Vector CSG_Vector::Get_Unity(void) const
+{
+	CSG_Vector	v(*this);
+
+	v.Set_Unity();
+
+	return( v );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_Matrix::CSG_Matrix(void)
+{
+	_On_Construction();
+}
+
+//---------------------------------------------------------
+CSG_Matrix::CSG_Matrix(const CSG_Matrix &Matrix)
+{
+	_On_Construction();
+
+	Create(Matrix);
+}
+
+bool CSG_Matrix::Create(const CSG_Matrix &Matrix)
+{
+	return( Assign(Matrix) );
+}
+
+//---------------------------------------------------------
+CSG_Matrix::CSG_Matrix(int nx, int ny, double *Data)
+{
+	_On_Construction();
+
+	Create(nx, ny, Data);
+}
+
+bool CSG_Matrix::Create(int nx, int ny, double *Data)
+{
+	if( nx > 0 && ny > 0 )
+	{
+		if( nx != m_nx || ny != m_ny )
+		{
+			Destroy();
+
+			if( (m_z    = (double **)SG_Malloc(ny      * sizeof(double *))) != NULL
+			&&  (m_z[0]	= (double  *)SG_Malloc(ny * nx * sizeof(double  ))) != NULL )
+			{
+				m_nx	= nx;
+				m_ny	= ny;
+
+				for(ny=1; ny<m_ny; ny++)
+				{
+					m_z[ny]	= m_z[ny - 1] + nx;
+				}
+			}
+			else
+			{
+				Destroy();
+
+				return( false );
+			}
+		}
+
+		if( m_z && m_z[0] )
+		{
+			if( Data )
+			{
+				memcpy(m_z[0], Data, m_ny * m_nx * sizeof(double));
+			}
+			else
+			{
+				memset(m_z[0],    0, m_ny * m_nx * sizeof(double));
+			}
+
+			return( true );
+		}
+	}
+
+	Destroy();
+
+	return( false );
+}
+
+//---------------------------------------------------------
+CSG_Matrix::~CSG_Matrix(void)
+{
+	Destroy();
+}
+
+bool CSG_Matrix::Destroy(void)
+{
+	if( m_z )
+	{
+		if( m_z[0] )
+		{
+			SG_Free(m_z[0]);
+		}
+
+		SG_Free(m_z);
+	}
+
+	m_z		= NULL;
+	m_nx	= 0;
+	m_ny	= 0;
+
+	return( true );
+}
+
+//---------------------------------------------------------
+void CSG_Matrix::_On_Construction(void)
+{
+	m_z		= NULL;
+	m_nx	= 0;
+	m_ny	= 0;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Size(int nRows, int nCols)
+{
+	return( nRows > 0 && nCols > 0 && Set_Rows(nRows) && Set_Cols(nCols) );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Cols(int nCols)
+{
+	if( nCols > m_nx )
+	{
+		return( Add_Cols(nCols - m_nx) );
+	}
+
+	if( nCols < m_nx )
+	{
+		return( Del_Cols(m_nx - nCols) );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Rows(int nRows)
+{
+	if( nRows > m_ny )
+	{
+		return( Add_Rows(nRows - m_ny) );
+	}
+
+	if( nRows < m_ny )
+	{
+		return( Del_Rows(m_ny - nRows) );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Add_Cols(int nCols)
+{
+	if( nCols > 0 && m_ny > 0 )
+	{
+		CSG_Matrix	Tmp(*this);
+
+		if( Create(Tmp.m_nx + nCols, Tmp.m_ny) )
+		{
+			for(int y=0; y<Tmp.m_ny; y++)
+			{
+				memcpy(m_z[y], Tmp.m_z[y], Tmp.m_nx * sizeof(double));
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Add_Rows(int nRows)
+{
+	if( nRows > 0 && m_nx > 0 )
+	{
+		m_ny	+= nRows;
+
+		m_z		= (double **)SG_Realloc(m_z   , m_ny        * sizeof(double *));
+		m_z[0]	= (double  *)SG_Realloc(m_z[0], m_ny * m_nx * sizeof(double  ));
+
+		for(int y=1; y<m_ny; y++)
+		{
+			m_z[y]	= m_z[y - 1] + m_nx;
+		}
+
+		memset(m_z[m_ny - nRows], 0, nRows * m_nx * sizeof(double));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+/**
+  * Deletes the last nCols columns.
+*/
+bool CSG_Matrix::Del_Cols(int nCols)
+{
+	if( nCols > 0 && m_ny > 0 && nCols < m_nx )
+	{
+		CSG_Matrix	Tmp(*this);
+
+		if( Create(Tmp.m_nx - nCols, Tmp.m_ny) )
+		{
+			for(int y=0; y<Tmp.m_ny; y++)
+			{
+				memcpy(m_z[y], Tmp.m_z[y], m_nx * sizeof(double));
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+/**
+  * Deletes the last nRows rows.
+*/
+bool CSG_Matrix::Del_Rows(int nRows)
+{
+	if( nRows > 0 && m_nx > 0 && nRows < m_ny )
+	{
+		m_ny	-= nRows;
+
+		m_z		= (double **)SG_Realloc(m_z   , m_ny        * sizeof(double *));
+		m_z[0]	= (double  *)SG_Realloc(m_z[0], m_ny * m_nx * sizeof(double  ));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Add_Col(double *Data)
+{
+	if( Add_Cols(1) )
+	{
+		Set_Col(m_nx - 1, Data);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+bool CSG_Matrix::Add_Col(const CSG_Vector &Data)
+{
+	return( m_nx == 0 ? Create(1, Data.Get_N(), Data.Get_Data()) : m_ny == Data.Get_N() ? Add_Col(Data.Get_Data()) : false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Add_Row(double *Data)
+{
+	if( Add_Rows(1) )
+	{
+		Set_Row(m_ny - 1, Data);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+bool CSG_Matrix::Add_Row(const CSG_Vector &Data)
+{
+	return( m_ny == 0 ? Create(Data.Get_N(), 1, Data.Get_Data()) : m_nx == Data.Get_N() ? Add_Row(Data.Get_Data()) : false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Ins_Col(int iCol, double *Data)
+{
+	if( iCol >= 0 && iCol <= m_nx )
+	{
+		CSG_Matrix	Tmp(*this);
+
+		if( Create(Tmp.m_nx + 1, Tmp.m_ny) )
+		{
+			for(int y=0; y<m_ny; y++)
+			{
+				double	*pz	= m_z[y], *pz_tmp	= Tmp.m_z[y];
+
+				for(int x=0; x<m_nx; x++, pz++)
+				{
+					if( x != iCol )
+					{
+						*pz	= *pz_tmp;	pz_tmp++;
+					}
+					else if( Data )
+					{
+						*pz	= Data[y];
+					}
+				}
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+bool CSG_Matrix::Ins_Col(int iCol, const CSG_Vector &Data)
+{
+	return( m_nx == 0 ? Add_Col(Data) : m_ny == Data.Get_N() ? Ins_Col(iCol, Data.Get_Data()) : false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Ins_Row(int iRow, double *Data)
+{
+	if( iRow >= 0 && iRow <= m_ny )
+	{
+		CSG_Matrix	Tmp(*this);
+
+		if( Create(Tmp.m_nx, Tmp.m_ny + 1) )
+		{
+			for(int y=0, y_tmp=0; y<m_ny; y++)
+			{
+				if( y != iRow )
+				{
+					memcpy(m_z[y], Tmp.m_z[y_tmp++], m_nx * sizeof(double));
+				}
+				else if( Data )
+				{
+					memcpy(m_z[y], Data, m_nx * sizeof(double));
+				}
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+bool CSG_Matrix::Ins_Row(int iRow, const CSG_Vector &Data)
+{
+	return( m_ny == 0 ? Add_Row(Data) : m_nx == Data.Get_N() ? Ins_Row(iRow, Data.Get_Data()) : false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Col(int iCol, double *Data)
+{
+	if( Data && iCol >= 0 && iCol < m_nx )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			m_z[y][iCol]	= Data[y];
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+bool CSG_Matrix::Set_Col(int iCol, const CSG_Vector &Data)
+{
+	return( m_ny == Data.Get_N() ? Set_Col(iCol, Data.Get_Data()) : false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Row(int iRow, double *Data)
+{
+	if( Data && iRow >= 0 && iRow < m_ny )
+	{
+		memcpy(m_z[iRow], Data, m_nx * sizeof(double));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+bool CSG_Matrix::Set_Row(int iRow, const CSG_Vector &Data)
+{
+	return( m_nx == Data.Get_N() ? Set_Row(iRow, Data.Get_Data()) : false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Del_Col(int iCol)
+{
+	if( m_nx == 1 )
+	{
+		return( Destroy() );
+	}
+
+	if( iCol >= 0 && iCol < m_nx )
+	{
+		CSG_Matrix	Tmp(*this);
+
+		if( Create(Tmp.m_nx - 1, Tmp.m_ny) )
+		{
+			for(int y=0; y<m_ny; y++)
+			{
+				double	*pz	= m_z[y], *pz_tmp	= Tmp.m_z[y];
+
+				for(int x_tmp=0; x_tmp<Tmp.m_nx; x_tmp++, pz_tmp++)
+				{
+					if( x_tmp != iCol )
+					{
+						*pz	= *pz_tmp;	pz++;
+					}
+				}
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Del_Row(int iRow)
+{
+	if( m_ny == 1 )
+	{
+		return( Destroy() );
+	}
+
+	if( iRow >= 0 && iRow < m_ny )
+	{
+		CSG_Matrix	Tmp(*this);
+
+		if( Create(Tmp.m_nx, Tmp.m_ny - 1) )
+		{
+			for(int y=0, y_tmp=0; y_tmp<Tmp.m_ny; y_tmp++)
+			{
+				if( y_tmp != iRow )
+				{
+					memcpy(m_z[y++], Tmp.m_z[y_tmp], m_nx * sizeof(double));
+				}
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+CSG_Vector CSG_Matrix::Get_Col(int iCol)	const
+{
+	CSG_Vector	Col;
+	
+	if( iCol >= 0 && iCol < m_nx )
+	{
+		Col.Create(m_ny);
+
+		for(int y=0; y<m_ny; y++)
+		{
+			Col[y]	= m_z[y][iCol];
+		}
+	}
+
+	return( Col );
+}
+
+//---------------------------------------------------------
+CSG_Vector CSG_Matrix::Get_Row(int iRow)	const
+{
+	CSG_Vector	Row;
+	
+	if( iRow >= 0 && iRow < m_ny )
+	{
+		Row.Create(m_nx, m_z[iRow]);
+	}
+
+	return( Row );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_Matrix::asString(int Width, int Precision, bool bScientific)	const
+{
+	CSG_String	s;
+
+	for(int y=0, n=SG_Get_Digit_Count(m_ny + 1); y<m_ny; y++)
+	{
+		s	+= CSG_String::Format(SG_T("%0*d:"), n, y + 1);
+
+		for(int x=0; x<m_nx; x++)
+		{
+			s	+= "\t" + SG_Get_Double_asString(m_z[y][x], Width, Precision, bScientific);
+		}
+
+		s	+= "\n";
+	}
+
+	return( s );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Matrix::is_Equal(const CSG_Matrix &Matrix) const
+{
+	if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				if( m_z[y][x] != Matrix.m_z[y][x] )
+				{
+					return( false );
+				}
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Assign(double Scalar)
+{
+	if( m_nx > 0 && m_ny > 0 )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	= Scalar;
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Assign(const CSG_Matrix &Matrix)
+{
+	if( Create(Matrix.m_nx, Matrix.m_ny) )
+	{
+		memcpy(m_z[0], Matrix.m_z[0], m_nx * m_ny * sizeof(double));
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Add(double Scalar)
+{
+	if( m_nx > 0 && m_ny > 0 )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	+= Scalar;
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Add(const CSG_Matrix &Matrix)
+{
+	if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	+= Matrix.m_z[y][x];
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Subtract(const CSG_Matrix &Matrix)
+{
+	if( m_nx == Matrix.m_nx && m_ny == Matrix.m_ny )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	-= Matrix.m_z[y][x];
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Multiply(double Scalar)
+{
+	if( m_nx > 0 && m_ny > 0 )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	*= Scalar;
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+CSG_Vector CSG_Matrix::Multiply(const CSG_Vector &Vector) const
+{
+	CSG_Vector	v;
+
+	if( m_nx == Vector.Get_N() && v.Create(m_ny) )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			double	z	= 0.0;
+
+			for(int x=0; x<m_nx; x++)
+			{
+				z	+= m_z[y][x] * Vector(x);
+			}
+
+			v[y]	= z;
+		}
+	}
+
+	return( v );
+}
+
+CSG_Matrix CSG_Matrix::Multiply(const CSG_Matrix &Matrix) const
+{
+	CSG_Matrix	m;
+
+	if( m_nx == Matrix.m_ny && m.Create(Matrix.m_nx, m_ny) )
+	{
+		for(int y=0; y<m.m_ny; y++)
+		{
+			for(int x=0; x<m.m_nx; x++)
+			{
+				double	z	= 0.0;
+
+				for(int n=0; n<m_nx; n++)
+				{
+					z	+= m_z[y][n] * Matrix.m_z[n][x];
+				}
+
+				m.m_z[y][x]	= z;
+			}
+		}
+	}
+
+	return( m );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Matrix::operator == (const CSG_Matrix &Matrix) const
+{
+	return( is_Equal(Matrix) );
+}
+
+//---------------------------------------------------------
+CSG_Matrix & CSG_Matrix::operator = (double Scalar)
+{
+	Assign(Scalar);
+
+	return( *this );
+}
+
+CSG_Matrix & CSG_Matrix::operator = (const CSG_Matrix &Matrix)
+{
+	Assign(Matrix);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Matrix & CSG_Matrix::operator += (double Scalar)
+{
+	Add(Scalar);
+
+	return( *this );
+}
+
+CSG_Matrix & CSG_Matrix::operator += (const CSG_Matrix &Matrix)
+{
+	Add(Matrix);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Matrix & CSG_Matrix::operator -= (double Scalar)
+{
+	Add(-Scalar);
+
+	return( *this );
+}
+
+CSG_Matrix & CSG_Matrix::operator -= (const CSG_Matrix &Matrix)
+{
+	Subtract(Matrix);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Matrix & CSG_Matrix::operator *= (double Scalar)
+{
+	Multiply(Scalar);
+
+	return( *this );
+}
+
+CSG_Matrix & CSG_Matrix::operator *= (const CSG_Matrix &Matrix)
+{
+	Multiply(Matrix);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_Matrix CSG_Matrix::operator + (double Scalar) const
+{
+	CSG_Matrix	m(*this);
+
+	m.Add(Scalar);
+
+	return( m );
+}
+
+CSG_Matrix CSG_Matrix::operator + (const CSG_Matrix &Matrix) const
+{
+	CSG_Matrix	m(*this);
+
+	m.Add(Matrix);
+
+	return( m );
+}
+
+//---------------------------------------------------------
+CSG_Matrix CSG_Matrix::operator - (double Scalar) const
+{
+	CSG_Matrix	m(*this);
+
+	m.Add(-Scalar);
+
+	return( m );
+}
+
+CSG_Matrix CSG_Matrix::operator - (const CSG_Matrix &Matrix) const
+{
+	CSG_Matrix	m(*this);
+
+	m.Subtract(Matrix);
+
+	return( m );
+}
+
+//---------------------------------------------------------
+CSG_Matrix CSG_Matrix::operator * (double Scalar) const
+{
+	CSG_Matrix	m(*this);
+
+	m.Multiply(Scalar);
+
+	return( m );
+}
+
+CSG_Vector CSG_Matrix::operator * (const CSG_Vector &Vector) const
+{
+	return( Multiply(Vector) );
+}
+
+CSG_Matrix CSG_Matrix::operator * (const CSG_Matrix &Matrix) const
+{
+	return( Multiply(Matrix) );
+}
+
+CSG_Matrix	operator * (double Scalar, const CSG_Matrix &Matrix)
+{
+	return( Matrix * Scalar );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Zero(void)
+{
+	return( Create(m_nx, m_ny) );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Identity(void)
+{
+	if( m_nx > 0 && m_ny > 0 )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	= x == y ? 1.0 : 0.0;
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Transpose(void)
+{
+	CSG_Matrix	m;
+	
+	if( m.Create(*this) && Create(m_ny, m_nx) )
+	{
+		for(int y=0; y<m_ny; y++)
+		{
+			for(int x=0; x<m_nx; x++)
+			{
+				m_z[y][x]	= m.m_z[x][y];
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Matrix::Set_Inverse(bool bSilent, int nSubSquare)
+{
+	bool	bResult	= false;
+	int		n		= 0;
+
+	//-----------------------------------------------------
+	if( nSubSquare > 0 )
+	{
+		if( nSubSquare <= m_nx && nSubSquare <= m_ny )
+		{
+			n	= nSubSquare;
+		}
+	}
+	else if( is_Square() )
+	{
+		n	= m_nx;
+	}
+
+	//-----------------------------------------------------
+	if( n > 0 )
+	{
+		CSG_Matrix	m(*this);
+		int		*Permutation	= (int *)SG_Malloc(n * sizeof(int));
+
+		if( SG_Matrix_LU_Decomposition(n, Permutation, m.Get_Data(), bSilent) )
+		{
+			CSG_Vector	v(n);
+
+			for(int j=0; j<n && (bSilent || SG_UI_Process_Set_Progress(j, n)); j++)
+			{
+				v.Set_Zero();
+				v[j]	= 1.0;
+
+				SG_Matrix_LU_Solve(n, Permutation, m, v.Get_Data(), true);
+
+				for(int i=0; i<n; i++)
+				{
+					m_z[i][j]	= v[i];
+				}
+			}
+
+			bResult	= true;
+		}
+
+		SG_Free(Permutation);
+	}
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double CSG_Matrix::Get_Determinant(void) const
+{
+	double	d	= 0.0;
+
+	for(int y=0; y<m_ny; y++)
+	{
+		for(int x=0; x<m_nx; x++)
+		{
+		}
+	}
+
+	return( d );
+}
+
+//---------------------------------------------------------
+CSG_Matrix CSG_Matrix::Get_Transpose(void) const
+{
+	CSG_Matrix	m(m_ny, m_nx);
+
+	for(int y=0; y<m_ny; y++)
+	{
+		for(int x=0; x<m_nx; x++)
+		{
+			m.m_z[x][y]	= m_z[y][x];
+		}
+	}
+
+	return( m );
+}
+
+//---------------------------------------------------------
+CSG_Matrix CSG_Matrix::Get_Inverse(bool bSilent, int nSubSquare) const
+{
+	CSG_Matrix	m(*this);
+
+	m.Set_Inverse(bSilent, nSubSquare);
+
+	return( m );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool		SG_Matrix_Solve(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent)
+{
+	bool	bResult	= false;
+	int		n		= Vector.Get_N();
+
+	if( n > 0 && n == Matrix.Get_NX() && n == Matrix.Get_NY() )
+	{
+		int	*Permutation	= (int *)SG_Malloc(n * sizeof(int));
+
+		if( SG_Matrix_LU_Decomposition(n, Permutation, Matrix.Get_Data(), bSilent) )
+		{
+			SG_Matrix_LU_Solve(n, Permutation, Matrix, Vector.Get_Data(), bSilent);
+
+			bResult	= true;
+		}
+
+		SG_Free(Permutation);
+	}
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool		SG_Matrix_Eigen_Reduction(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent)
+{
+	CSG_Vector	Intermediate;
+
+	Eigen_Vectors	= Matrix;
+
+	return(	SG_Matrix_Triangular_Decomposition	(Eigen_Vectors, Eigen_Values, Intermediate)	// Triangular decomposition (Householder's method)
+		&&	SG_Matrix_Tridiagonal_QL			(Eigen_Vectors, Eigen_Values, Intermediate)	// Reduction of symetric tridiagonal matrix
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool		SG_Matrix_LU_Decomposition(int n, int *Permutation, double **Matrix, bool bSilent)
+{
+	int			i, j, k, iMax;
+	double		dMax, d, Sum;
+	CSG_Vector	Vector;
+	
+	Vector.Create(n);
+
+	for(i=0, iMax=0; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); i++)
+	{
+		dMax	= 0.0;
+
+		for(j=0; j<n; j++)
+		{
+			if( (d = fabs(Matrix[i][j])) > dMax )
+			{
+				dMax	= d;
+			}
+		}
+
+		if( dMax <= 0.0 )	// singular matrix !!!...
+		{
+			return( false );
+		}
+
+		Vector[i]	= 1.0 / dMax;
+	}
+
+	for(j=0; j<n && (bSilent || SG_UI_Process_Set_Progress(j, n)); j++)
+	{
+		for(i=0; i<j; i++)
+		{
+			Sum		= Matrix[i][j];
+
+			for(k=0; k<i; k++)
+			{
+				Sum		-= Matrix[i][k] * Matrix[k][j];
+			}
+
+			Matrix[i][j]	= Sum;
+		}
+
+		for(i=j, dMax=0.0; i<n; i++)
+		{
+			Sum		= Matrix[i][j];
+
+			for(k=0; k<j; k++)
+			{
+				Sum		-= Matrix[i][k] * Matrix[k][j];
+			}
+
+			Matrix[i][j]	= Sum;
+
+			if( (d = Vector[i] * fabs(Sum)) >= dMax )
+			{
+				dMax	= d;
+				iMax	= i;
+			}
+		}
+
+		if( j != iMax )
+		{
+			for(k=0; k<n; k++)
+			{
+				d				= Matrix[iMax][k];
+				Matrix[iMax][k]	= Matrix[j   ][k];
+				Matrix[j   ][k]	= d;
+			}
+
+			Vector[iMax]	= Vector[j];
+		}
+
+		Permutation[j]	= iMax;
+
+		if( Matrix[j][j] == 0.0 )
+		{
+			Matrix[j][j]	= M_TINY;
+		}
+
+		if( j != n )
+		{
+			d	= 1.0 / (Matrix[j][j]);
+
+			for(i=j+1; i<n; i++)
+			{
+				Matrix[i][j]	*= d;
+			}
+		}
+	}
+
+	return( bSilent || SG_UI_Process_Get_Okay(false) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool		SG_Matrix_LU_Solve(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent)
+{
+	int		i, j, k;
+	double	Sum;
+
+	for(i=0, k=-1; i<n && (bSilent || SG_UI_Process_Set_Progress(i, n)); i++)
+	{
+		Sum						= Vector[Permutation[i]];
+		Vector[Permutation[i]]	= Vector[i];
+
+		if( k >= 0 )
+		{
+			for(j=k; j<=i-1; j++)
+			{
+				Sum	-= Matrix[i][j] * Vector[j];
+			}
+		}
+		else if( Sum )
+		{
+			k		= i;
+		}
+
+		Vector[i]	= Sum;
+	}
+
+	for(i=n-1; i>=0 && (bSilent || SG_UI_Process_Set_Progress(n-i, n)); i--)
+	{
+		Sum			= Vector[i];
+
+		for(j=i+1; j<n; j++)
+		{
+			Sum		-= Matrix[i][j] * Vector[j];
+		}
+
+		Vector[i]	= Sum / Matrix[i][i];
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Householder reduction of matrix a to tridiagonal form.
+
+bool SG_Matrix_Triangular_Decomposition(CSG_Matrix &A, CSG_Vector &d, CSG_Vector &e)
+{
+	if( A.Get_NX() != A.Get_NY() )
+	{
+		return( false );
+	}
+
+	int		l, k, j, i, n;
+	double	scale, hh, h, g, f;
+
+	n	= A.Get_NX();
+
+	d.Create(n);
+	e.Create(n);
+
+	for(i=n-1; i>=1; i--)
+	{
+		l	= i - 1;
+		h	= scale = 0.0;
+
+		if( l > 0 )
+		{
+			for(k=0; k<=l; k++)
+			{
+				scale	+= fabs(A[i][k]);
+			}
+
+			if( scale == 0.0 )
+			{
+				e[i]	= A[i][l];
+			}
+			else
+			{
+				for(k=0; k<=l; k++)
+				{
+					A[i][k]	/= scale;
+					h		+= A[i][k] * A[i][k];
+				}
+
+				f		= A[i][l];
+				g		= f > 0.0 ? -sqrt(h) : sqrt(h);
+				e[i]	= scale * g;
+				h		-= f * g;
+				A[i][l]	= f - g;
+				f		= 0.0;
+
+				for(j=0; j<=l; j++)
+				{
+					A[j][i]	= A[i][j]/h;
+					g		= 0.0;
+
+					for(k=0; k<=j; k++)
+					{
+						g	+= A[j][k] * A[i][k];
+					}
+
+					for(k=j+1; k<=l; k++)
+					{
+						g	+= A[k][j] * A[i][k];
+					}
+
+					e[j]	= g / h;
+					f		+= e[j] * A[i][j];
+				}
+
+				hh	= f / (h + h);
+
+				for(j=0; j<=l; j++)
+				{
+					f		= A[i][j];
+					e[j]	= g = e[j] - hh * f;
+
+					for(k=0; k<=j; k++)
+					{
+						A[j][k]	-= (f * e[k] + g * A[i][k]);
+					}
+				}
+			}
+		}
+		else
+		{
+			e[i]	= A[i][l];
+		}
+
+		d[i]	= h;
+	}
+
+	d[0]	= 0.0;
+	e[0]	= 0.0;
+
+	for(i=0; i<n; i++)
+	{
+		l	= i - 1;
+
+		if( d[i] )
+		{	
+			for(j=0; j<=l; j++)
+			{
+				g	= 0.0;
+
+				for(k=0; k<=l; k++)
+				{
+					g		+= A[i][k] * A[k][j];
+				}
+
+				for(k=0; k<=l; k++)
+				{
+					A[k][j]	-= g * A[k][i];
+				}
+			}
+		}
+
+		d[i]	= A[i][i];
+		A[i][i]	= 1.0;
+
+		for(j=0; j<=l; j++)
+		{
+			A[j][i]	= A[i][j] = 0.0;
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Tridiagonal QL algorithm -- Implicit
+
+bool SG_Matrix_Tridiagonal_QL(CSG_Matrix &Q, CSG_Vector &d, CSG_Vector &e)
+{
+	if( Q.Get_NX() != Q.Get_NY() || Q.Get_NX() != d.Get_N() || Q.Get_NX() != e.Get_N() )
+	{
+		return( false );
+	}
+
+	int		m, l, iter, i, k, n;
+	double	s, r, p, g, f, dd, c, b;
+
+	n	= d.Get_N();
+
+	for(i=1; i<n; i++)
+	{
+		e[i - 1]	= e[i];
+	}
+
+	e[n - 1]	= 0.0;
+
+	for(l=0; l<n; l++)
+	{
+		iter	= 0;
+
+		do
+		{
+			for(m=l; m<n-1; m++)
+			{
+				dd	= fabs(d[m]) + fabs(d[m + 1]);
+
+				if( fabs(e[m]) + dd == dd )
+				{
+					break;
+				}
+			}
+
+			if( m != l )
+			{
+				if( iter++ == 30 )
+				{
+					return( false );	// erhand("No convergence in TLQI.");
+				}
+
+				g	= (d[l+1] - d[l]) / (2.0 * e[l]);
+				r	= sqrt((g * g) + 1.0);
+				g	= d[m] - d[l] + e[l] / (g + M_SET_SIGN(r, g));
+				s	= c = 1.0;
+				p	= 0.0;
+
+				for(i = m-1; i >= l; i--)
+				{
+					f = s * e[i];
+					b = c * e[i];
+
+					if (fabs(f) >= fabs(g))
+					{
+						c = g / f;
+						r = sqrt((c * c) + 1.0);
+						e[i+1] = f * r;
+						c *= (s = 1.0/r);
+					}
+					else
+					{
+						s = f / g;
+						r = sqrt((s * s) + 1.0);
+						e[i+1] = g * r;
+						s *= (c = 1.0/r);
+					}
+
+					g		= d[i+1] - p;
+					r		= (d[i] - g) * s + 2.0 * c * b;
+					p		= s * r;
+					d[i+1]	= g + p;
+					g		= c * r - b;
+
+					for(k=0; k<n; k++)
+					{
+						f			= Q[k][i+1];
+						Q[k][i+1]	= s * Q[k][i] + c * f;
+						Q[k][i]		= c * Q[k][i] - s * f;
+					}
+				}
+
+				d[l] = d[l] - p;
+				e[l] = g;
+				e[m] = 0.0;
+			}
+		}
+		while( m != l );
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_api/mat_tools.cpp b/src/saga_core/saga_api/mat_tools.cpp
index b54f92e..d3720ed 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: mat_tools.cpp 2117 2014-05-09 09:05:41Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,9 +76,29 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-double			SG_Get_Square(double x)
+double			SG_Get_Square(double Value)
 {
-	return( x * x );
+	return( Value * Value );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+double			SG_Get_Rounded(double Value, int Decimals)
+{
+	if( Decimals <= 0 )
+	{
+		return( (int)(0.5 + Value) );
+	}
+
+	double	d	= pow(10.0, Decimals);
+
+	return( ((int)(0.5 + d * Value)) / d );
 }
 
 
@@ -104,6 +124,34 @@ int				SG_Get_Digit_Count(int Number)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+CSG_String		SG_Get_Double_asString(double Number, int Width, int Precision, bool bScientific)
+{
+	if( bScientific )
+	{
+		if( Width > 0 && Precision >= 0 )	return( CSG_String::Format(SG_T("%*.*e"), Width, Precision, Number) );
+		if( Width > 0                   )	return( CSG_String::Format(SG_T("%*e"  ), Width           , Number) );
+		if(              Precision >= 0 )	return( CSG_String::Format(SG_T("%.*e" ),        Precision, Number) );
+
+		return( CSG_String::Format(SG_T("%e"), Number) );
+	}
+	else
+	{
+		if( Width > 0 && Precision >= 0 )	return( CSG_String::Format(SG_T("%*.*f"), Width, Precision, Number) );
+		if( Width > 0                   )	return( CSG_String::Format(SG_T("%*f"  ), Width           , Number) );
+		if(              Precision >= 0 )	return( CSG_String::Format(SG_T("%.*f" ),        Precision, Number) );
+
+		return( CSG_String::Format(SG_T("%f"), Number) );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 CSG_Random::CSG_Random(void)
 {
 	Initialize();
@@ -189,7 +237,7 @@ CSG_Simple_Statistics::CSG_Simple_Statistics(const CSG_Simple_Statistics &Statis
 	Create(Statistics);
 }
 
-CSG_Simple_Statistics::CSG_Simple_Statistics(double Mean, double StdDev, int Count)
+CSG_Simple_Statistics::CSG_Simple_Statistics(double Mean, double StdDev, sLong Count)
 {
 	Create(Mean, StdDev, Count);
 }
@@ -225,7 +273,7 @@ bool CSG_Simple_Statistics::Create(const CSG_Simple_Statistics &Statistics)
 	return( true );
 }
 
-bool CSG_Simple_Statistics::Create(double Mean, double StdDev, int Count)
+bool CSG_Simple_Statistics::Create(double Mean, double StdDev, sLong Count)
 {
 	m_bEvaluated	= true;
 
@@ -233,7 +281,7 @@ bool CSG_Simple_Statistics::Create(double Mean, double StdDev, int Count)
 	m_StdDev		= StdDev;
 	m_Variance		= StdDev*StdDev;
 	m_nValues		= Count;
-	m_Weights		= Count;
+	m_Weights		= (double)Count;
 
 	m_Sum			= m_Weights *  m_Mean;
 	m_Sum2			= m_Weights * (m_Mean*m_Mean + m_Variance);
@@ -285,7 +333,7 @@ void CSG_Simple_Statistics::Add(const CSG_Simple_Statistics &Statistics)
 	//--------------------------------------------------------
 	if( m_Values.Get_Size() == m_nValues && Statistics.m_Values.Get_Size() == Statistics.m_nValues && m_Values.Set_Array(m_nValues + Statistics.m_nValues) )
 	{
-		for(int i=0, j=m_nValues; i<Statistics.m_nValues; i++, j++)
+		for(sLong i=0, j=m_nValues; i<Statistics.m_nValues; i++, j++)
 		{
 			((double *)m_Values.Get_Array())[j]	= Statistics.Get_Value(i);
 		}
@@ -434,7 +482,7 @@ bool CSG_Class_Statistics::Get_Majority(double &Value)
 
 bool CSG_Class_Statistics::Get_Majority(double &Value, int &Count)
 {
-	return( Get_Class(Get_Majority(), Value, Count) );
+	return( Get_Class(Get_Majority(), Value, Count) && Count > 0 );
 }
 
 //---------------------------------------------------------
@@ -1152,7 +1200,7 @@ void CSG_Classifier_Supervised::_Get_Parallel_Epiped(const CSG_Vector &Features,
 		for(int iFeature=0; bMember && iFeature<Get_Feature_Count(); iFeature++)
 		{
 			double	d	= Features(iFeature);
-			
+
 			if(	d < m_Statistics[iClass][iFeature].Get_Minimum()
 			||	d > m_Statistics[iClass][iFeature].Get_Maximum() )
 			{
@@ -1246,7 +1294,7 @@ void CSG_Classifier_Supervised::_Get_Maximum_Likelihood(const CSG_Vector &Featur
 			d	+= SG_Get_Square((Features(iFeature) - m_Statistics[iClass][iFeature].Get_Mean()) / m_Statistics[iClass][iFeature].Get_StdDev());
 		}
 
-		dSum	+= (d	= m_ML_s[iClass] * exp(-0.5 * d));	
+		dSum	+= (d	= m_ML_s[iClass] * exp(-0.5 * d));
 		*/
 
 		if( Quality < d )
@@ -1342,14 +1390,14 @@ double CSG_Test_Distribution::Get_T_Tail(double T, int df, TSG_Test_Distribution
 	{
 		return( -1.0 );
 	}
-	
+
 	return( _Change_Tail_Type(Get_T_P(T, df), TESTDIST_TYPE_TwoTail, Type, T < 0.0) );
 }
 
 //---------------------------------------------------------
 double CSG_Test_Distribution::Get_T_Inverse(double p, int df, TSG_Test_Distribution_Type Type)
 {	// Keith Dear & Robert Brennan.
-	// Returns an accurate t to tol sig. fig.'s given p & df.  
+	// Returns an accurate t to tol sig. fig.'s given p & df.
 
 	if( p <= 0.0 || p >= 1.0 || df < 1 )
 	{
@@ -1408,7 +1456,7 @@ double CSG_Test_Distribution::Get_Norm_P(double z)
 	double	p;
 
 	z	= fabs(z);
-	
+
 	p	= (((((a1 * z + a2) * z + a3) * z + a4) * z + a5) * z + a6) * z + 1.0;
 
 	return( pow(p, -16) );
@@ -1515,10 +1563,10 @@ double CSG_Test_Distribution::Get_T_Inv(double p, int df)
 		{
 			y	= 0.5 * y*y + y;
 		}
-	}            
+	}
 	else
 	{
-		y	= ((1.0 / (((df + 6.0) / (df * y) - 0.089 * d - 0.822) * (df + 2.0) * 3.0) 
+		y	= ((1.0 / (((df + 6.0) / (df * y) - 0.089 * d - 0.822) * (df + 2.0) * 3.0)
 			+ 0.5 / (df + 4.0)) * y - 1.0) * (df + 1.0) / (df + 2.0) + 1.0 / y;
 	}
 
@@ -1588,12 +1636,12 @@ double CSG_Test_Distribution::Get_F_Inverse(double alpha, int dfn, int dfd, TSG_
 	{
 		lo	= 0.5;
 		hi	= lo;
-		
+
 		for(i=0; i<ITERMAX; i++)
 		{
 			hi	*= 2.0;
 			p	= Get_F_Tail(hi, dfn, dfd);
-	
+
 			if( p > alpha )
 			{
 				lo	= hi;
diff --git a/src/saga_core/saga_api/mat_tools.h b/src/saga_core/saga_api/mat_tools.h
index a12fc32..7890b7c 100644
--- a/src/saga_core/saga_api/mat_tools.h
+++ b/src/saga_core/saga_api/mat_tools.h
@@ -1,1441 +1,1451 @@
-/**********************************************************
- * Version $Id: mat_tools.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//           Application Programming Interface           //
-//                                                       //
-//                  Library: SAGA_API                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                     mat_tools.h                       //
-//                                                       //
-//          Copyright (C) 2005 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 Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__SAGA_API__mat_tools_H
-#define HEADER_INCLUDED__SAGA_API__mat_tools_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "geo_tools.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef M_PI
-#define M_PI						3.141592653589793
-#endif
-
-#define M_PI_045					(M_PI / 4.0)
-#define M_PI_090					(M_PI / 2.0)
-#define M_PI_135					(M_PI * 3.0 / 4.0)
-#define M_PI_180					(M_PI)
-#define M_PI_225					(M_PI * 5.0 / 4.0)
-#define M_PI_270					(M_PI * 3.0 / 2.0)
-#define M_PI_315					(M_PI * 7.0 / 4.0)
-#define M_PI_360					(M_PI * 2.0)
-
-#define M_RAD_TO_DEG				(180.0 / M_PI)
-#define M_DEG_TO_RAD				(M_PI / 180.0)
-
-//---------------------------------------------------------
-#define M_EULER						2.718281828459045
-
-//---------------------------------------------------------
-#define N_MEGABYTE_BYTES			0x100000
-
-//---------------------------------------------------------
-#define M_ALMOST_ZERO				0.001l
-#define M_TINY						(1.0e-20)
-
-//---------------------------------------------------------
-#define M_SQR(x)					((x) * (x))
-#define M_SQRT(x)					sqrt((double)(x))
-#define M_GET_LENGTH(x, y)			sqrt((double)((x)*(x) + (y)*(y)))
-
-#define M_GET_MIN(a, b)				(((a) < (b)) ? (a) : (b))
-#define M_GET_MAX(a, b)				(((a) > (b)) ? (a) : (b))
-#define M_SET_MINMAX(min, max, x)	if( min > x ) { min = x; } else if( max < x ) { max = x; }
-
-#define M_SET_SIGN(x, sign)			((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x))
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-SAGA_API_DLL_EXPORT double		SG_Get_Square		(double x);
-
-//---------------------------------------------------------
-SAGA_API_DLL_EXPORT int			SG_Get_Digit_Count	(int Number);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-typedef int (* TSG_PFNC_Compare) (const int iElement_1, const int iElement_2);
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Index
-{
-public:
-	CSG_Index(void);
-	virtual ~CSG_Index(void);
-
-								CSG_Index			(int nValues, int    *Values, bool bAscending = true);
-	bool						Create				(int nValues, int    *Values, bool bAscending = true);
-
-								CSG_Index			(int nValues, double *Values, bool bAscending = true);
-	bool						Create				(int nValues, double *Values, bool bAscending = true);
-
-								CSG_Index			(int nValues, TSG_PFNC_Compare fCompare, bool bAscending = true);
-	bool						Create				(int nValues, TSG_PFNC_Compare fCompare, bool bAscending = true);
-
-	bool						Destroy				(void);
-
-	bool						is_Okay				(void)						const	{	return( m_nValues > 0 );	}
-	int							Get_Count			(void)						const	{	return( m_nValues );		}
-	int							Get_Index			(int i, bool bInv = false)	const	{	return( i >= 0 && i < m_nValues ? m_Index[bInv ? m_nValues-1-i : i] : -1 );	}
-	int							operator []			(int i)						const	{	return( i >= 0 && i < m_nValues ? m_Index[i] : -1 );	}
-
-
-private:
-
-	void						*m_Values;
-
-	int							m_nValues, *m_Index, m_iCompare;
-
-	TSG_PFNC_Compare			m_fCompare;
-
-
-	void						_On_Construction	(void);
-
-	bool						_Set_Array			(int nValues);
-	bool						_Set_Index			(bool bAscending);
-
-	int							_Compare			(const int iElement_1, const int iElement_2);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Vector
-{
-public:
-	CSG_Vector(void);
-	virtual ~CSG_Vector(void);
-
-								CSG_Vector			(const CSG_Vector &Vector);
-	bool						Create				(const CSG_Vector &Vector);
-
-								CSG_Vector			(int n, double *Data = NULL);
-	bool						Create				(int n, double *Data = NULL);
-
-	bool						Destroy				(void);
-
-	bool						Set_Rows			(int nRows);
-	bool						Add_Rows			(int nRows);
-	bool						Del_Rows			(int nRows);
-	bool						Add_Row				(double Value = 0.0);
-	bool						Del_Row				(void);
-
-	int							Get_N				(void)	const	{	return( m_n );		}
-	operator const double *							(void)	const	{	return( m_z );		}
-	double *					Get_Data			(void)	const	{	return( m_z );		}
-	double						operator ()			(int x)	const	{	return( m_z[x] );	}
-	double &					operator []			(int x)			{	return( m_z[x] );	}
-
-	CSG_String					asString			(void);
-
-	bool						is_Equal			(const CSG_Vector &Vector)	const;
-
-	bool						Assign				(double Scalar);
-	bool						Assign				(const CSG_Vector &Vector);
-	bool						Add					(double Scalar);
-	bool						Add					(const CSG_Vector &Vector);
-	bool						Subtract			(const CSG_Vector &Vector);
-	bool						Multiply			(double Scalar);
-	bool						Multiply			(const CSG_Vector &Vector);
-	double						Multiply_Scalar		(const CSG_Vector &Vector)	const;
-	bool						Multiply			(const class CSG_Matrix &Matrix);
-
-	bool						operator ==			(const CSG_Vector &Vector)	const;
-	CSG_Vector &				operator =			(double Scalar);
-	CSG_Vector &				operator =			(const CSG_Vector &Vector);
-	CSG_Vector &				operator +=			(double Scalar);
-	CSG_Vector &				operator +=			(const CSG_Vector &Vector);
-	CSG_Vector &				operator -=			(double Scalar);
-	CSG_Vector &				operator -=			(const CSG_Vector &Vector);
-	CSG_Vector &				operator *=			(double Scalar);
-	CSG_Vector &				operator *=			(const CSG_Vector &Vector);
-	CSG_Vector &				operator *=			(const class CSG_Matrix &Matrix);
-	CSG_Vector					operator +			(double Scalar)				const;
-	CSG_Vector					operator +			(const CSG_Vector &Vector)	const;
-	CSG_Vector					operator -			(double Scalar)				const;
-	CSG_Vector					operator -			(const CSG_Vector &Vector)	const;
-	CSG_Vector					operator *			(double Scalar)				const;
-	double						operator *			(const CSG_Vector &Vector)	const;
-
-	bool						Set_Zero			(void);
-	bool						Set_Unity			(void);
-
-	double						Get_Length			(void)						const;
-	double						Get_Angle			(const CSG_Vector &Vector)	const;
-	CSG_Vector					Get_Unity			(void)						const;
-
-
-private:
-
-	int							m_n;
-
-	double						*m_z;
-
-
-	void						_On_Construction	(void);
-
-};
-
-//---------------------------------------------------------
-SAGA_API_DLL_EXPORT CSG_Vector	operator *			(double Scalar, const CSG_Vector &Vector);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Matrix
-{
-public:
-	CSG_Matrix(void);
-	virtual ~CSG_Matrix(void);
-
-								CSG_Matrix			(const CSG_Matrix &Matrix);
-	bool						Create				(const CSG_Matrix &Matrix);
-
-								CSG_Matrix			(int nx, int ny, double *Data = NULL);
-	bool						Create				(int nx, int ny, double *Data = NULL);
-
-	bool						Destroy				(void);
-
-	bool						Set_Size			(int nRows, int nCols);
-	bool						Set_Cols			(int nCols);
-	bool						Set_Rows			(int nRows);
-	bool						Add_Cols			(int nCols);
-	bool						Add_Rows			(int nRows);
-	bool						Del_Cols			(int nCols);
-	bool						Del_Rows			(int nRows);
-	bool						Add_Col				(          double *Data = NULL);
-	bool						Add_Col				(          const CSG_Vector &Data);
-	bool						Add_Row				(          double *Data = NULL);
-	bool						Add_Row				(          const CSG_Vector &Data);
-	bool						Ins_Col				(int iCol, double *Data = NULL);
-	bool						Ins_Col				(int iCol, const CSG_Vector &Data);
-	bool						Ins_Row				(int iRow, double *Data = NULL);
-	bool						Ins_Row				(int iRow, const CSG_Vector &Data);
-	bool						Set_Col				(int iCol, double *Data);
-	bool						Set_Col				(int iCol, const CSG_Vector &Data);
-	bool						Set_Row				(int iRow, double *Data);
-	bool						Set_Row				(int iRow, const CSG_Vector &Data);
-	bool						Del_Col				(int iCol);
-	bool						Del_Row				(int iRow);
-	CSG_Vector					Get_Col				(int iCol)		const;
-	CSG_Vector					Get_Row				(int iRow)		const;
-
-	int							Get_NX				(void)			const	{	return( m_nx );			}
-	int							Get_NCols			(void)			const	{	return( m_nx );			}
-	int							Get_NY				(void)			const	{	return( m_ny );			}
-	int							Get_NRows			(void)			const	{	return( m_ny );			}
-
-	operator const double **						(void)			const	{	return( (const double **)m_z );	}
-	double **					Get_Data			(void)			const	{	return( m_z );			}
-	double						operator ()			(int y, int x)	const	{	return( m_z[y][x] );	}
-	double *					operator []			(int y)			const	{	return( m_z[y] );		}
-
-	CSG_String					asString			(void);
-
-	bool						is_Square			(void)	const	{	return( m_nx > 0 && m_nx == m_ny );	}
-	bool						is_Equal			(const CSG_Matrix &Matrix)	const;
-
-	bool						Assign				(double Scalar);
-	bool						Assign				(const CSG_Matrix &Matrix);
-	bool						Add					(double Scalar);
-	bool						Add					(const CSG_Matrix &Matrix);
-	bool						Subtract			(const CSG_Matrix &Matrix);
-	bool						Multiply			(double Scalar);
-	CSG_Vector					Multiply			(const CSG_Vector &Vector)	const;
-	CSG_Matrix					Multiply			(const CSG_Matrix &Matrix)	const;
-
-	bool						operator ==			(const CSG_Matrix &Matrix)	const;
-	CSG_Matrix &				operator =			(double Scalar);
-	CSG_Matrix &				operator =			(const CSG_Matrix &Matrix);
-	CSG_Matrix &				operator +=			(double Scalar);
-	CSG_Matrix &				operator +=			(const CSG_Matrix &Matrix);
-	CSG_Matrix &				operator -=			(double Scalar);
-	CSG_Matrix &				operator -=			(const CSG_Matrix &Matrix);
-	CSG_Matrix &				operator *=			(double Scalar);
-	CSG_Matrix &				operator *=			(const CSG_Matrix &Matrix);
-	CSG_Matrix					operator +			(double Scalar)				const;
-	CSG_Matrix					operator +			(const CSG_Matrix &Matrix)	const;
-	CSG_Matrix					operator -			(double Scalar)				const;
-	CSG_Matrix					operator -			(const CSG_Matrix &Matrix)	const;
-	CSG_Matrix					operator *			(double Scalar)				const;
-	CSG_Vector					operator *			(const CSG_Vector &Vector)	const;
-	CSG_Matrix					operator *			(const CSG_Matrix &Matrix)	const;
-
-	bool						Set_Zero			(void);
-	bool						Set_Identity		(void);
-	bool						Set_Transpose		(void);
-	bool						Set_Inverse			(bool bSilent = true, int nSubSquare = 0);
-
-	double						Get_Determinant		(void)						const;
-	CSG_Matrix					Get_Transpose		(void)						const;
-	CSG_Matrix					Get_Inverse			(bool bSilent = true, int nSubSquare = 0)	const;
-
-
-private:
-
-	int							m_nx, m_ny;
-
-	double						**m_z;
-
-
-	void						_On_Construction	(void);
-
-};
-
-//---------------------------------------------------------
-SAGA_API_DLL_EXPORT CSG_Matrix	operator *			(double Scalar, const CSG_Matrix &Matrix);
-
-//---------------------------------------------------------
-SAGA_API_DLL_EXPORT bool		SG_Matrix_LU_Decomposition	(int n,       int *Permutation,       double **Matrix                , bool bSilent = true);
-SAGA_API_DLL_EXPORT bool		SG_Matrix_LU_Solve			(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent = true);
-
-SAGA_API_DLL_EXPORT bool		SG_Matrix_Solve				(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent = true);
-SAGA_API_DLL_EXPORT bool		SG_Matrix_Eigen_Reduction	(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent = true);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Grid_Radius
-{
-public:
-	CSG_Grid_Radius(int maxRadius = 0);
-	~CSG_Grid_Radius(void);
-
-	bool						Create				(int maxRadius);
-	void						Destroy				(void);
-
-	int							Get_Maximum			(void)			{	return( m_maxRadius );	}
-
-	int							Get_nPoints			(void)			{	return( m_nPoints );	}
-	int							Get_nPoints			(int iRadius)	{	return( iRadius >= 0 && iRadius < m_maxRadius ? m_nPoints_R[iRadius] : 0 );	}
-
-	double						Get_Point			(int iPoint, int &x, int &y)
-	{
-		if( iPoint >= 0 && iPoint < m_nPoints )
-		{
-			x	= m_Points[iPoint].x;
-			y	= m_Points[iPoint].y;
-
-			return( m_Points[iPoint].d );				// Distance...
-		}
-
-		return( -1.0 );
-	}
-
-	double						Get_Point			(int iPoint, int xOffset, int yOffset, int &x, int &y)
-	{
-		double	d;
-
-		if( (d = Get_Point(iPoint, x, y)) >= 0.0 )
-		{
-			x	+= xOffset;
-			y	+= yOffset;
-		}
-
-		return( d );
-	}
-
-	double						Get_Point			(int iRadius, int iPoint, int &x, int &y)
-	{
-		if( iRadius >= 0 && iRadius <= m_maxRadius && iPoint >= 0 && iPoint < m_nPoints_R[iRadius] )
-		{
-			x	= m_Points_R[iRadius][iPoint].x;
-			y	= m_Points_R[iRadius][iPoint].y;
-
-			return( m_Points_R[iRadius][iPoint].d );	// Distance...
-		}
-
-		return( -1.0 );
-	}
-
-	double						Get_Point			(int iRadius, int iPoint, int xOffset, int yOffset, int &x, int &y)
-	{
-		double	d;
-
-		if( (d = Get_Point(iRadius, iPoint, x, y)) >= 0.0 )
-		{
-			x	+= xOffset;
-			y	+= yOffset;
-		}
-
-		return( d );
-	}
-
-
-private:
-
-	int							m_maxRadius, m_nPoints, *m_nPoints_R;
-
-	typedef struct
-	{
-		int						x, y;
-
-		double					d;
-	}
-	TSG_Grid_Radius;
-
-	TSG_Grid_Radius				*m_Points, **m_Points_R;
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Random
-{
-public:
-	CSG_Random(void);
-
-	static void			Initialize		(void);
-	static void			Initialize		(unsigned int Value);
-
-	static double		Get_Uniform		(void);
-	static double		Get_Uniform		(double min, double max);
-
-	static double		Get_Gaussian	(double mean, double stddev);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Simple_Statistics
-{
-public:
-	CSG_Simple_Statistics(void);
-	CSG_Simple_Statistics(bool bHoldValues);
-	CSG_Simple_Statistics(const CSG_Simple_Statistics &Statistics);
-	CSG_Simple_Statistics(double Mean, double StdDev, int Count = 1000);
-
-	bool						Create				(bool bHoldValues = false);
-	bool						Create				(const CSG_Simple_Statistics &Statistics);
-	bool						Create				(double Mean, double StdDev, int Count = 1000);
-
-	void						Invalidate			(void);
-
-	bool						is_Evaluated		(void)	const	{	return( m_bEvaluated );	}
-
-	int							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	);	}
-
-	void						Add					(const CSG_Simple_Statistics &Statistics);
-
-	void						Add_Value			(double Value, double Weight = 1.0);
-
-	double						Get_Value			(int i)	const	{	return( i >= 0 && i < (int)m_Values.Get_Size() ? ((double *)m_Values.Get_Array())[i] : m_Mean );	}
-
-	CSG_Simple_Statistics &		operator  =			(const CSG_Simple_Statistics &Statistics)	{	Create(Statistics);	return( *this );	}
-	CSG_Simple_Statistics &		operator +=			(const CSG_Simple_Statistics &Statistics)	{	Add(Statistics);	return( *this );	}
-	CSG_Simple_Statistics &		operator +=			(double Value)								{	Add_Value(Value);	return( *this );	}
-
-
-protected:
-
-	bool						m_bEvaluated;
-
-	int							m_nValues;
-
-	double						m_Weights, m_Sum, m_Sum2, m_Minimum, m_Maximum, m_Range, m_Mean, m_Variance, m_StdDev;
-
-	CSG_Array					m_Values;
-
-
-	void						_Evaluate			(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Class_Statistics
-{
-private:
-
-	typedef struct SClass
-	{
-		int		Count;
-
-		double	Value;
-	}
-	TClass;
-
-
-public:
-	 CSG_Class_Statistics(void);
-	~CSG_Class_Statistics(void);
-
-	void			Create					(void);
-	void			Destroy					(void);
-
-	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 );	}
-
-	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);
-
-	int				Get_Majority			(void);
-	bool			Get_Majority			(double &Value);
-	bool			Get_Majority			(double &Value, int &Count);
-
-	int				Get_Minority			(void);
-	bool			Get_Minority			(double &Value);
-	bool			Get_Minority			(double &Value, int &Count);
-
-
-private:
-
-	CSG_Array		m_Array;
-
-	TClass			*m_Classes;
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum ESG_Cluster_Analysis_Method
-{
-	SG_CLUSTERANALYSIS_Minimum_Distance	= 0,
-	SG_CLUSTERANALYSIS_Hill_Climbing,
-	SG_CLUSTERANALYSIS_Combined
-};
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Cluster_Analysis
-{
-public:
-	CSG_Cluster_Analysis(void);
-	~CSG_Cluster_Analysis(void);
-	
-	bool					Create				(int nFeatures);
-	bool					Destroy				(void);
-
-	bool					Add_Element			(void);
-	bool					Set_Feature			(int iElement, int iFeature, double Value);
-
-	int						Get_Cluster			(int iElement)	const	{	return( iElement >= 0 && iElement < Get_nElements() ? m_Cluster[iElement] : -1 );	}
-
-	bool					Execute				(int Method, int nClusters);
-
-	int						Get_nElements		(void)	const	{	return( (int)m_Features.Get_Size() );	}
-	int						Get_nFeatures		(void)	const	{	return( m_nFeatures );	}
-	int						Get_nClusters		(void)	const	{	return( m_nClusters );	}
-
-	int						Get_Iteration		(void)	const	{	return( m_Iteration );	}
-
-	double					Get_SP				(void)	const	{	return( m_SP );			}
-
-	int						Get_nMembers		(int iCluster)					const	{	return( m_nMembers[iCluster] );	}
-	double					Get_Variance		(int iCluster)					const	{	return( m_Variance[iCluster] );	}
-	double					Get_Centroid		(int iCluster, int iFeature)	const	{	return( m_Centroid[iCluster][iFeature] );	}
-
-
-private:
-
-	int						*m_Cluster, m_Iteration, m_nFeatures, m_nClusters, *m_nMembers;
-
-	double					*m_Variance, **m_Centroid, m_SP;
-
-	CSG_Array				m_Features;
-
-
-	bool					Minimum_Distance	(bool bInitialize);
-	bool					Hill_Climbing		(bool bInitialize);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	SG_CLASSIFY_SUPERVISED_BinaryEncoding	= 0,
-	SG_CLASSIFY_SUPERVISED_ParallelEpiped,
-	SG_CLASSIFY_SUPERVISED_MinimumDistance,
-	SG_CLASSIFY_SUPERVISED_Mahalonobis,
-	SG_CLASSIFY_SUPERVISED_MaximumLikelihood,
-	SG_CLASSIFY_SUPERVISED_SAM,
-	SG_CLASSIFY_SUPERVISED_WTA,
-	SG_CLASSIFY_SUPERVISED_SID,
-	SG_CLASSIFY_SUPERVISED_SVM
-};
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Classifier_Supervised
-{
-public:
-	CSG_Classifier_Supervised(void);
-	virtual ~CSG_Classifier_Supervised(void);
-
-	void						Create						(int nFeatures);
-	void						Destroy						(void);
-
-	int							Get_Feature_Count			(void)			{	return( m_nFeatures );			}
-
-	int							Get_Element_Count			(int iClass)	{	return( m_nElements[iClass] );	}
-	void						Del_Element_Count			(void);
-
-	int							Get_Class_Count				(void)			{	return( m_IDs.Get_Count() );	}
-	const CSG_String &			Get_Class_ID				(int iClass)	{	return( m_IDs[iClass] );		}
-
-	int							Get_Class					(const CSG_String &Class_ID);
-
-	CSG_Simple_Statistics *		Get_Statistics				(const CSG_String &Class_ID);
-	CSG_Simple_Statistics *		Get_Statistics				(int iClass)	{	return( m_Statistics[iClass] );	}
-	CSG_Simple_Statistics *		operator []					(int iClass)	{	return( m_Statistics[iClass] );	}
-
-	bool						Get_Class					(const CSG_Vector &Features, int &Class, double &Quality, int Method);
-
-	void						Set_Distance_Threshold		(double Value)	{	m_Distance_Threshold	= Value;	}
-	double						Get_Distance_Threshold		(void)			{	return( m_Distance_Threshold );		}
-
-	void						Set_Probability_Threshold	(double Value)	{	m_Probability_Threshold	= Value;	}
-	double						Get_Probability_Threshold	(void)			{	return( m_Probability_Threshold );	}
-	void						Set_Probability_Relative	(bool   Value)	{	m_Probability_Relative	= Value;	}
-	bool						Get_Probability_Relative	(void)			{	return( m_Probability_Relative );	}
-
-	void						Set_Angle_Threshold			(double Value)	{	m_Angle_Threshold		= Value;	}
-	double						Get_Angle_Threshold			(void)			{	return( m_Angle_Threshold );		}
-
-	void						Set_WTA						(int Method, bool bOn)	{	if( Method >= 0 && Method < SG_CLASSIFY_SUPERVISED_WTA ) m_bWTA[Method]	= bOn;		}
-	bool						Get_WTA						(int Method)			{	return( Method >= 0 && Method < SG_CLASSIFY_SUPERVISED_WTA ? m_bWTA[Method] : false );	}
-
-	static CSG_String			Get_Name_of_Method			(int Method);
-	static CSG_String			Get_Name_of_Quality			(int Method);
-
-
-private:
-
-	bool						m_Probability_Relative, m_bWTA[SG_CLASSIFY_SUPERVISED_WTA];
-
-	int							m_nFeatures, *m_nElements;
-
-	double						m_Distance_Threshold, m_Probability_Threshold, m_Angle_Threshold;
-
-	CSG_Strings					m_IDs;
-
-	CSG_Simple_Statistics		**m_Statistics;
-
-	CSG_Vector					m_ML_s, m_SAM_l, m_BE_m;
-
-	CSG_Matrix					m_ML_a, m_ML_b, m_BE_s;
-
-
-	void						_Update						(void);
-
-	void						_Get_Binary_Encoding		(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Parallel_Epiped		(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Minimum_Distance		(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Mahalanobis_Distance	(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Maximum_Likelihood		(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Spectral_Angle_Mapping	(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Spectral_Divergence	(const CSG_Vector &Features, int &Class, double &Quality);
-	void						_Get_Winner_Takes_All		(const CSG_Vector &Features, int &Class, double &Quality);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Spline
-{
-public:
-	CSG_Spline(void);
-	virtual ~CSG_Spline(void);
-
-	void						Destroy				(void);
-
-	bool						Create				(double *xValues, double *yValues, int nValues, double yA = 1.0e30, double yB = 1.0e30);
-	bool						Create				(double yA = 1.0e30, double yB = 1.0e30);
-
-	void						Add					(double x, double y);
-
-	int							Get_Count			(void)	const	{	return( m_x.Get_N() );	}
-	double						Get_xMin			(void)	const	{	return( m_x.Get_N() > 0 ? m_x(0              ) : 0.0 );	}
-	double						Get_xMax			(void)	const	{	return( m_x.Get_N() > 0 ? m_x(m_x.Get_N() - 1) : 0.0 );	}
-	double						Get_x				(int i)	const	{	return( i >= 0 && i < m_x.Get_N() ? m_x(i) : 0.0 );	}
-	double						Get_y				(int i)	const	{	return( i >= 0 && i < m_y.Get_N() ? m_y(i) : 0.0 );	}
-
-	bool						Get_Value			(double x, double &y);
-	double						Get_Value			(double x);
-
-
-protected:
-
-	bool						m_bCreated;
-
-	CSG_Vector					m_x, m_y, m_z;
-
-
-	bool						_Create				(double yA, double yB);
-
-};
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Thin_Plate_Spline
-{
-public:
-	CSG_Thin_Plate_Spline(void);
-	virtual ~CSG_Thin_Plate_Spline(void);
-
-	bool					Destroy				(void);
-
-	bool					Set_Point_Count		(int Count)	{	return( m_Points.Set_Count(Count) );	}
-	int						Get_Point_Count		(void)		{	return( m_Points.Get_Count() );			}
-
-	CSG_Points_Z &			Get_Points			(void)		{	return( m_Points );	}
-
-	bool					Add_Point			(double x, double y, double z)	{	return( m_Points.Add(  x,   y, z) );	}
-	bool					Add_Point			(const TSG_Point &p, double z)	{	return( m_Points.Add(p.x, p.y, z) );	}
-
-	bool					Set_Point			(int Index, double x, double y, double z)
-	{
-		if( Index >= 0 && Index < m_Points.Get_Count() )
-		{
-			m_Points[Index].x	= x;
-			m_Points[Index].y	= y;
-			m_Points[Index].z	= z;
-
-			return( true );
-		}
-
-		return( false );
-	}
-
-	bool					Set_Point			(int Index, const TSG_Point &p, double z)	{	return( Set_Point(Index, p.x, p.y, z) );	}
-
-	bool					Create				(double Regularization = 0.0, bool bSilent = true);
-
-	bool					is_Okay				(void)	{	return( m_V.Get_N() > 0 );		}
-
-	double					Get_Value			(double x, double y);
-
-
-private:
-
-	CSG_Points_Z			m_Points;
-
-	CSG_Vector				m_V;
-
-
-	double					_Get_hDistance		(TSG_Point_Z A, TSG_Point_Z B);
-	double					_Get_Base_Funtion	(double x);
-	double					_Get_Base_Funtion	(TSG_Point_Z A, double x, double y);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-typedef enum ESG_Test_Distribution_Type
-{
-	TESTDIST_TYPE_Left	= 0,
-	TESTDIST_TYPE_Right,
-	TESTDIST_TYPE_Middle,
-	TESTDIST_TYPE_TwoTail
-}
-TSG_Test_Distribution_Type;
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Test_Distribution
-{
-public:
-
-	static double			Get_F_Tail_from_R2	(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
-
-	static double			Get_F_Tail			(double F    , int dfn, int dfd, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
-	static double			Get_F_Inverse		(double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
-
-	static double			Get_T_Tail			(double T    , int df, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
-	static double			Get_T_Inverse		(double alpha, int df, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
-
-	static double			Get_Norm_P			(double Z);
-	static double			Get_Norm_Z			(double P);
-
-
-private:
-
-	static double			Get_Gamma			(double F, double dfn, double dfd);
-	static double			Get_Log_Gamma		(double a);
-
-	static double			Get_T_P				(double T, int df);
-	static double			Get_T_Z				(double T, int df);
-	static double			Get_T_Inv			(double p, int df);
-
-	static double			_Change_Tail_Type	(double p, TSG_Test_Distribution_Type from, TSG_Test_Distribution_Type to, bool bNegative);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// Values: (matrix) array with number of variables = number of rows (x), number of samples = number of columns (y)
-SAGA_API_DLL_EXPORT CSG_Matrix	SG_Get_Correlation_Matrix		(const CSG_Matrix &Values, bool bCovariances = false);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-typedef enum ESG_Regression_Correction
-{
-	REGRESSION_CORR_None	= 0,
-	REGRESSION_CORR_Smith,
-	REGRESSION_CORR_Wherry_1,
-	REGRESSION_CORR_Wherry_2,
-	REGRESSION_CORR_Olkin_Pratt,
-	REGRESSION_CORR_Pratt,
-	REGRESSION_CORR_Claudy_3
-}
-TSG_Regression_Correction;
-
-//---------------------------------------------------------
-SAGA_API_DLL_EXPORT double		SG_Regression_Get_Adjusted_R2	(double R2, int nSamples, int nPredictors, TSG_Regression_Correction Correction = REGRESSION_CORR_Wherry_1);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-typedef enum ESG_Regression_Type
-{
-	REGRESSION_Linear	= 0,	// Y = a + b * X
-	REGRESSION_Rez_X,			// Y = a + b / X
-	REGRESSION_Rez_Y,			// Y = a / (b - X)
-	REGRESSION_Pow,				// Y = a * X^b
-	REGRESSION_Exp,				// Y = a * e^(b * X)
-	REGRESSION_Log				// Y = a + b * ln(X)
-}
-TSG_Regression_Type;
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Regression
-{
-public:
-	CSG_Regression(void);
-	virtual ~CSG_Regression(void);
-
-	void						Destroy				(void);
-
-	void						Set_Values			(int nValues, double *x, double *y);
-	void						Add_Values			(double x, double y);
-
-	int							Get_Count			(void)			const	{	return( m_nValues );	}
-
-	double						Get_xValue			(int iValue)	const	{	return( iValue >= 0 && iValue < m_nValues ? m_x[iValue] : 0.0 );	}
-	double						Get_yValue			(int iValue)	const	{	return( iValue >= 0 && iValue < m_nValues ? m_y[iValue] : 0.0 );	}
-	bool						Get_Values			(int iValue, double &x, double &y)	const
-	{
-		if( iValue >= 0 && iValue < m_nValues )
-		{
-			x	= m_x[iValue];
-			y	= m_y[iValue];
-
-			return( true );
-		}
-
-		return( false );
-	}
-
-	double						Get_xMin			(void)		const	{	return( m_xMin );	}
-	double						Get_xMax			(void)		const	{	return( m_xMax );	}
-	double						Get_xMean			(void)		const	{	return( m_xMean );	}
-	double						Get_xVariance		(void)		const	{	return( m_xVar );	}
-	double						Get_x				(double y)	const;	// returns INF on error, this can be checked using the _finite() function (libc, include <float.h>)...
-
-	double						Get_yMin			(void)		const	{	return( m_yMin );	}
-	double						Get_yMax			(void)		const	{	return( m_yMax );	}
-	double						Get_yMean			(void)		const	{	return( m_yMean );	}
-	double						Get_yVariance		(void)		const	{	return( m_yVar );	}
-	double						Get_y				(double x)	const;	// returns INF on error, this can be checked using the _finite() function (libc, include <float.h>)...
-
-	double						Get_Constant		(void)		const	{	return( m_RConst );	}
-	double						Get_Coefficient		(void)		const	{	return( m_RCoeff );	}
-	double						Get_R				(void)		const	{	return( m_R );		}
-	double						Get_R2				(void)		const	{	return( m_R*m_R );	}
-
-	const SG_Char *				asString			(void);
-
-	TSG_Regression_Type			Get_Type			(void)		const	{	return( m_Type );	}
-
-	bool						Calculate			(TSG_Regression_Type Type = REGRESSION_Linear);
-	bool						Calculate			(int nValues, double *x, double *y, TSG_Regression_Type Type = REGRESSION_Linear);
-
-
-protected:
-
-	int							m_nValues, m_nBuffer;
-
-	double						m_RConst, m_RCoeff, m_R,
-								m_xMin, m_xMax, m_xMean, m_xVar, *m_x,
-								m_yMin, m_yMax, m_yMean, m_yVar, *m_y;
-
-	TSG_Regression_Type			m_Type;
-
-
-	bool						_Get_MinMeanMax		(double &xMin, double &xMean, double &xMax, double &yMin, double &yMean, double &yMax);
-
-	double						_Y_Transform		(double x);
-	double						_X_Transform		(double y);
-
-	bool						_Linear				(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum ESG_Multiple_Regression_Info_Vars
-{
-	MLR_VAR_ID	= 0,
-	MLR_VAR_NAME,
-	MLR_VAR_RCOEFF,
-	MLR_VAR_R,
-	MLR_VAR_R2,
-	MLR_VAR_R2_ADJ,
-	MLR_VAR_SE,
-	MLR_VAR_T,
-	MLR_VAR_SIG,
-	MLR_VAR_P
-};
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Regression_Multiple
-{
-public:
-	CSG_Regression_Multiple(bool bIntercept = true);
-	virtual ~CSG_Regression_Multiple(void);
-
-	void						Destroy				(void);
-
-	bool						Set_Data			(const CSG_Matrix &Samples, CSG_Strings *pNames = NULL);
-
-	void						Set_With_Intercept	(bool bOn = true)		{	m_bIntercept	= bOn;	}
-	bool						Get_With_Intercept	(void)			const	{	return( m_bIntercept );	}
-
-	bool						Get_Model			(const CSG_Matrix &Samples                           , CSG_Strings *pNames = NULL);
-	bool						Get_Model_Forward	(const CSG_Matrix &Samples, double P_in              , CSG_Strings *pNames = NULL);
-	bool						Get_Model_Backward	(const CSG_Matrix &Samples, double P_out             , CSG_Strings *pNames = NULL);
-	bool						Get_Model_Stepwise	(const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames = NULL);
-
-	bool						Get_Model			(void);
-	bool						Get_Model_Forward	(double P_in);
-	bool						Get_Model_Backward	(double P_out);
-	bool						Get_Model_Stepwise	(double P_in, double P_out);
-
-	bool						Get_CrossValidation	(int nSubSamples = 0);
-
-	CSG_String					Get_Info			(void)			const;
-	class CSG_Table *			Get_Info_Regression	(void)			const	{	return( m_pRegression );	}
-	class CSG_Table *			Get_Info_Model		(void)			const	{	return( m_pModel );			}
-	class CSG_Table *			Get_Info_Steps		(void)			const	{	return( m_pSteps );			}
-
-	double						Get_R2				(void)			const;
-	double						Get_R2_Adj			(void)			const;
-	double						Get_StdError		(void)			const;
-	double						Get_F				(void)			const;
-	double						Get_P				(void)			const;
-	double						Get_CV_RMSE			(void)			const;
-	double						Get_CV_NRMSE		(void)			const;
-	double						Get_CV_R2			(void)			const;
-	int							Get_CV_nSamples		(void)			const;
-	int							Get_DegFreedom		(void)			const;
-	int							Get_nSamples		(void)			const;
-	int							Get_nPredictors		(void)			const;
-	int							Get_Predictor		(int i)			const	{	return( i >= 0 && i < Get_nPredictors() ? m_Predictor[i] : -1 );	}
-
-	double						Get_RConst			(void)			const;
-	const SG_Char *				Get_Name			(int iVariable)	const;
-	double						Get_ID				(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_ID    ) );	}
-	double						Get_RCoeff			(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_RCOEFF) );	}
-	double						Get_R2_Partial		(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_R2    ) );	}
-	double						Get_R2_Partial_Adj	(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_R2_ADJ) );	}
-	double						Get_StdError		(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_SE    ) );	}
-	double						Get_T				(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_T     ) );	}
-	double						Get_P				(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_SIG   ) );	}
-
-	double						Get_Parameter		(int iVariable, int Parameter)	const;
-
-	double						Get_Value			(const CSG_Vector &Predictors)					const;
-	bool						Get_Value			(const CSG_Vector &Predictors, double &Value)	const;
-
-	double						Get_Residual		(int iSample)					const;
-	bool						Get_Residual		(int iSample, double &Residual)	const;
-
-	bool						Get_Residuals		(CSG_Vector &Residuals)			const;
-
-
-protected:
-
-	bool						m_bIntercept;
-
-	int							*m_bIncluded, *m_Predictor, m_nPredictors;
-
-	CSG_Strings					m_Names;
-
-	CSG_Matrix					m_Samples, m_Samples_Model;
-
-	class CSG_Table				*m_pRegression, *m_pModel, *m_pSteps;
-
-
-	bool						_Initialize			(bool bInclude);
-
-	double						_Get_F				(int nPredictors, int nSamples, double r2_full, double r2_reduced);
-	double						_Get_P				(int nPredictors, int nSamples, double r2_full, double r2_reduced);
-
-	bool						_Get_Regression		(const class CSG_Matrix &Samples);
-
-	int							_Get_Step_In		(CSG_Matrix &X, double P_in , double &R2, const CSG_Matrix &Samples);
-	int							_Get_Step_Out		(CSG_Matrix &X, double P_out, double &R2);
-
-	bool						_Set_Step_Info		(const CSG_Matrix &X);
-	bool						_Set_Step_Info		(const CSG_Matrix &X, double R2_prev, int iVariable, bool bIn);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//				Formula Parser (A. Ringeler)			 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-typedef double (*TSG_PFNC_Formula_0)(void);
-typedef double (*TSG_PFNC_Formula_1)(double);
-typedef double (*TSG_PFNC_Formula_2)(double, double);
-typedef double (*TSG_PFNC_Formula_3)(double, double, double);
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Formula
-{
-public:
-	CSG_Formula(void);
-	virtual ~CSG_Formula(void);
-
-	bool						Destroy				(void);
-
-	static CSG_String			Get_Help_Operators	(void);
-
-	bool						Get_Error			(CSG_String &Message);
-
-	int							Add_Function		(const SG_Char *Name, TSG_PFNC_Formula_1 f, int N_of_Pars, int Varying);
-	int							Del_Function		(SG_Char *Name);
-
-	bool						Set_Formula			(const CSG_String &Formula);
-	CSG_String					Get_Formula			(void)	const	{	return( m_sFormula );	}
-
-	void						Set_Variable		(SG_Char Variable, double Value);
-
-	double						Get_Value			(void)							const;
-	double						Get_Value			(double x)						const;
-	double						Get_Value			(const CSG_Vector &Values)		const;
-	double						Get_Value			(double *Values, int nValues)	const;
-	double						Get_Value			(SG_Char *Arguments, ...)		const;
-
-	const SG_Char *				Get_Used_Variables	(void);
-
-
-	//-----------------------------------------------------
-	typedef struct 
-	{
-		SG_Char					*name;
-		TSG_PFNC_Formula_1		f;			
-		int						n_pars;		
-		int						varying;	// Does the result of the function vary even when the parameters stay the same? varying = 1 for e.g. random - number generators.
-	}
-	TSG_Formula_Item;
-
-
-private:
-
-	//-----------------------------------------------------
-	typedef struct 
-	{
-		SG_Char					*code;
-		double					*ctable;
-	}
-	TMAT_Formula;
-
-
-	//-----------------------------------------------------
-	bool						m_bError, m_Vars_Used[256];
-
-	int							m_Error_Position, m_Length;
-
-	TMAT_Formula				m_Formula;
-
-	CSG_String					m_sFormula, m_sError;
-
-	const SG_Char				*i_error;
-
-	int							i_pctable;			// number of items in a table of constants - used only by the translating functions
-
-	double						m_Parameters[32],
-								*i_ctable;			// current table of constants - used only by the translating functions
-
-
-	void						_Set_Error			(const SG_Char *Error = NULL);
-
-	double						_Get_Value			(const double *Parameters, TMAT_Formula Function)	const;
-
-	int							_is_Operand			(SG_Char c);
-	int							_is_Operand_Code	(SG_Char c);
-	int							_is_Number			(SG_Char c);
-
-	int							_Get_Function		(int i, SG_Char *name, int *n_pars, int *varying);
-	int							_Get_Function		(SG_Char *name);
-
-	TMAT_Formula				_Translate			(const SG_Char *source, const SG_Char *args, int *length, int *error);
-
-	int							max_size(const SG_Char *source);
-	SG_Char *					my_strtok(SG_Char *s);
-	SG_Char *					i_trans(SG_Char *function, SG_Char *begin, SG_Char *end);
-	SG_Char *					comp_time(SG_Char *function, SG_Char *fend, int npars);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum ESG_Trend_String
-{
-	SG_TREND_STRING_Formula	= 0,
-	SG_TREND_STRING_Function,
-	SG_TREND_STRING_Formula_Parameters,
-	SG_TREND_STRING_Complete
-};
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Trend
-{
-public:
-	CSG_Trend(void);
-	virtual ~CSG_Trend(void);
-
-	bool						Set_Formula			(const SG_Char *Formula = NULL);
-	CSG_String					Get_Formula			(int Type = SG_TREND_STRING_Complete);
-
-	int							Get_Parameter_Count	(void) const	{	return( m_Params.m_Count );		}
-	double *					Get_Parameters		(void) const	{	return( m_Params.m_A );			}
-
-	void						Clr_Data			(void);
-	void						Set_Data			(double *xData, double *yData, int nData, bool bAdd = false);
-	void						Set_Data			(const CSG_Points &Data, bool bAdd = false);
-	void						Add_Data			(double x, double y);
-	int							Get_Data_Count		(void) const	{	return( m_Data.Get_Count() );	}
-	double						Get_Data_X			(int Index)		{	return( m_Data.Get_X(Index) );	}
-	double						Get_Data_Y			(int Index)		{	return( m_Data.Get_Y(Index) );	}
-	double						Get_Data_XMin		(void)			{	return( m_xMin );	}
-	double						Get_Data_XMax		(void)			{	return( m_xMax );	}
-	double						Get_Data_YMin		(void)			{	return( m_yMin );	}
-	double						Get_Data_YMax		(void)			{	return( m_yMax );	}
-
-	bool						Set_Max_Iterations	(int Iterations);
-	int							Get_Max_Iterations	(void)			{	return( m_Iter_Max);	}
-	bool						Set_Max_Lambda		(double Lambda);
-	double						Get_Max_Lambda		(void)			{	return( m_Lambda_Max);	}
-
-	bool						Get_Trend			(double *xData, double *yData, int nData, const SG_Char *Formula = NULL);
-	bool						Get_Trend			(const CSG_Points &Data, const SG_Char *Formula = NULL);
-	bool						Get_Trend			(void);
-
-	bool						is_Okay				(void)			{	return( m_bOkay );		}
-
-	CSG_String					Get_Error			(void);
-
-	double						Get_ChiSquare		(void);
-	double						Get_R2				(void);
-
-	double						Get_Value			(double x);
-
-
-private:
-
-	//-----------------------------------------------------
-	class SAGA_API_DLL_EXPORT CFncParams
-	{
-	public:
-		CFncParams(void);
-		virtual ~CFncParams(void);
-
-		bool					Create				(const SG_Char *Variables, int nVariables);
-		bool					Destroy				(void);
-
-		int						m_Count;
-
-		SG_Char					*m_Variables;
-
-		double					*m_A, *m_Atry, *m_dA, *m_dA2, *m_Beta, **m_Alpha, **m_Covar;
-
-	};
-
-
-	//-----------------------------------------------------
-	bool						m_bOkay;
-
-	int							m_Iter_Max;
-
-	double						m_ChiSqr, m_ChiSqr_o, m_Lambda, m_Lambda_Max, m_xMin, m_xMax, m_yMin, m_yMax;
-
-	CSG_Points					m_Data;
-
-	CFncParams					m_Params;
-
-	CSG_Formula					m_Formula;
-
-
-	bool						_Fit_Function		(void);
-	bool						_Get_Gaussj			(void);
-	bool						_Get_mrqcof			(double *Parameters, double **Alpha, double *Beta);
-
-	void						_Get_Function		(double x, double *Parameters, double &y, double *dy_da);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class SAGA_API_DLL_EXPORT CSG_Trend_Polynom
-{
-public:
-	CSG_Trend_Polynom(void);
-
-	bool						Destroy				(void);
-
-	bool						Set_Order			(int Order = 1);
-
-	bool						Clr_Data			(void);
-	bool						Set_Data			(double *x, double *y, int n, bool bAdd = false);
-	bool						Add_Data			(double  x, double  y);
-	int							Get_Data_Count		(void)		const	{	return( m_x.Get_N() );	}
-	double						Get_Data_X			(int i)		const	{	return( m_x(i) );	}
-	double						Get_Data_Y			(int i)		const	{	return( m_y(i) );	}
-
-	bool						Get_Trend			(void);
-
-	int							Get_Order			(void)		const	{	return( m_Order     );	}
-	int							Get_nCoefficients	(void)		const	{	return( m_Order + 1 );	}
-	double						Get_Coefficient		(int i)		const	{	return( m_a(i)      );	}
-	double						Get_R2				(void)		const	{	return( m_r2        );	}
-
-	double						Get_Value			(double x)	const;
-
-
-private:
-
-	double						m_r2;
-
-	int							m_Order;
-
-	CSG_Vector					m_x, m_y, m_a;
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__SAGA_API__mat_tools_H
+/**********************************************************
+ * Version $Id: mat_tools.h 2117 2014-05-09 09:05:41Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_API                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     mat_tools.h                       //
+//                                                       //
+//          Copyright (C) 2005 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 Goettingen               //
+//                Goldschmidtstr. 5                      //
+//                37077 Goettingen                       //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__SAGA_API__mat_tools_H
+#define HEADER_INCLUDED__SAGA_API__mat_tools_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "geo_tools.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef M_PI
+#define M_PI						3.141592653589793
+#endif
+
+#define M_PI_045					(M_PI / 4.0)
+#define M_PI_090					(M_PI / 2.0)
+#define M_PI_135					(M_PI * 3.0 / 4.0)
+#define M_PI_180					(M_PI)
+#define M_PI_225					(M_PI * 5.0 / 4.0)
+#define M_PI_270					(M_PI * 3.0 / 2.0)
+#define M_PI_315					(M_PI * 7.0 / 4.0)
+#define M_PI_360					(M_PI * 2.0)
+
+#define M_RAD_TO_DEG				(180.0 / M_PI)
+#define M_DEG_TO_RAD				(M_PI / 180.0)
+
+//---------------------------------------------------------
+#define M_EULER						2.718281828459045
+
+//---------------------------------------------------------
+#define N_MEGABYTE_BYTES			0x100000
+
+//---------------------------------------------------------
+#define M_ALMOST_ZERO				0.001l
+#define M_TINY						(1.0e-20)
+
+//---------------------------------------------------------
+#define M_SQR(x)					((x) * (x))
+#define M_SQRT(x)					sqrt((double)(x))
+#define M_GET_LENGTH(x, y)			sqrt((double)((x)*(x) + (y)*(y)))
+
+#define M_GET_MIN(a, b)				(((a) < (b)) ? (a) : (b))
+#define M_GET_MAX(a, b)				(((a) > (b)) ? (a) : (b))
+#define M_SET_MINMAX(min, max, x)	if( min > x ) { min = x; } else if( max < x ) { max = x; }
+
+#define M_SET_SIGN(x, sign)			((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x))
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT double		SG_Get_Square			(double Value);
+
+SAGA_API_DLL_EXPORT double		SG_Get_Rounded			(double Value, int Decimals = 0);
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT int			SG_Get_Digit_Count		(int Number);
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT	CSG_String	SG_Get_Double_asString	(double Number, int Width = -1, int Precision = -1, bool bScientific = false);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef int (* TSG_PFNC_Compare) (const int iElement_1, const int iElement_2);
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Index
+{
+public:
+	CSG_Index(void);
+	virtual ~CSG_Index(void);
+
+								CSG_Index			(int nValues, int    *Values, bool bAscending = true);
+	bool						Create				(int nValues, int    *Values, bool bAscending = true);
+
+								CSG_Index			(int nValues, double *Values, bool bAscending = true);
+	bool						Create				(int nValues, double *Values, bool bAscending = true);
+
+								CSG_Index			(int nValues, TSG_PFNC_Compare fCompare, bool bAscending = true);
+	bool						Create				(int nValues, TSG_PFNC_Compare fCompare, bool bAscending = true);
+
+	bool						Destroy				(void);
+
+	bool						is_Okay				(void)						const	{	return( m_nValues > 0 );	}
+	int							Get_Count			(void)						const	{	return( m_nValues );		}
+	int							Get_Index			(int i, bool bInv = false)	const	{	return( i >= 0 && i < m_nValues ? m_Index[bInv ? m_nValues-1-i : i] : -1 );	}
+	int							operator []			(int i)						const	{	return( i >= 0 && i < m_nValues ? m_Index[i] : -1 );	}
+
+
+private:
+
+	void						*m_Values;
+
+	int							m_nValues, *m_Index, m_iCompare;
+
+	TSG_PFNC_Compare			m_fCompare;
+
+
+	void						_On_Construction	(void);
+
+	bool						_Set_Array			(int nValues);
+	bool						_Set_Index			(bool bAscending);
+
+	int							_Compare			(const int iElement_1, const int iElement_2);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Vector
+{
+public:
+	CSG_Vector(void);
+	virtual ~CSG_Vector(void);
+
+								CSG_Vector			(const CSG_Vector &Vector);
+	bool						Create				(const CSG_Vector &Vector);
+
+								CSG_Vector			(int n, double *Data = NULL);
+	bool						Create				(int n, double *Data = NULL);
+
+	bool						Destroy				(void);
+
+	bool						Set_Rows			(int nRows);
+	bool						Add_Rows			(int nRows);
+	bool						Del_Rows			(int nRows);
+	bool						Add_Row				(double Value = 0.0);
+	bool						Del_Row				(void);
+
+	int							Get_N				(void)	const	{	return( (int)Get_Size() );					}
+	size_t						Get_Size			(void)	const	{	return( m_Array.Get_Size() );				}
+	double *					Get_Data			(void)	const	{	return( (double *)m_Array.Get_Array() );	}
+	double						Get_Data			(int x)	const	{	return( Get_Data()[x] );	}
+	double						operator ()			(int x)	const	{	return( Get_Data()[x] );	}
+	double &					operator []			(int x)			{	return( Get_Data()[x] );	}
+	operator const double *							(void)	const	{	return( Get_Data() );		}
+
+	CSG_String					asString			(int Width = -1, int Precision = -1, bool bScientific = false)	const;
+
+	bool						is_Equal			(const CSG_Vector &Vector)	const;
+
+	bool						Assign				(double Scalar);
+	bool						Assign				(const CSG_Vector &Vector);
+	bool						Add					(double Scalar);
+	bool						Add					(const CSG_Vector &Vector);
+	bool						Subtract			(const CSG_Vector &Vector);
+	bool						Multiply			(double Scalar);
+	bool						Multiply			(const CSG_Vector &Vector);
+	double						Multiply_Scalar		(const CSG_Vector &Vector)	const;
+	bool						Multiply			(const class CSG_Matrix &Matrix);
+
+	bool						operator ==			(const CSG_Vector &Vector)	const;
+	CSG_Vector &				operator =			(double Scalar);
+	CSG_Vector &				operator =			(const CSG_Vector &Vector);
+	CSG_Vector &				operator +=			(double Scalar);
+	CSG_Vector &				operator +=			(const CSG_Vector &Vector);
+	CSG_Vector &				operator -=			(double Scalar);
+	CSG_Vector &				operator -=			(const CSG_Vector &Vector);
+	CSG_Vector &				operator *=			(double Scalar);
+	CSG_Vector &				operator *=			(const CSG_Vector &Vector);
+	CSG_Vector &				operator *=			(const class CSG_Matrix &Matrix);
+	CSG_Vector					operator +			(double Scalar)				const;
+	CSG_Vector					operator +			(const CSG_Vector &Vector)	const;
+	CSG_Vector					operator -			(double Scalar)				const;
+	CSG_Vector					operator -			(const CSG_Vector &Vector)	const;
+	CSG_Vector					operator *			(double Scalar)				const;
+	double						operator *			(const CSG_Vector &Vector)	const;
+
+	bool						Set_Zero			(void);
+	bool						Set_Unity			(void);
+
+	double						Get_Length			(void)						const;
+	double						Get_Angle			(const CSG_Vector &Vector)	const;
+	CSG_Vector					Get_Unity			(void)						const;
+
+	typedef double const *		const_iterator;
+
+	const_iterator				begin				(void)	const	{	return( Get_Data()              );	}
+	const_iterator				end					(void)	const	{	return( Get_Data() + Get_Size() );	}
+	const_iterator				cbegin				(void)	const	{	return( Get_Data()              );	}
+	const_iterator				cend				(void)	const	{	return( Get_Data() + Get_Size() );	}
+
+
+private:
+
+	CSG_Array					m_Array;
+
+
+};
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT CSG_Vector	operator *			(double Scalar, const CSG_Vector &Vector);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Matrix
+{
+public:
+	CSG_Matrix(void);
+	virtual ~CSG_Matrix(void);
+
+								CSG_Matrix			(const CSG_Matrix &Matrix);
+	bool						Create				(const CSG_Matrix &Matrix);
+
+								CSG_Matrix			(int nx, int ny, double *Data = NULL);
+	bool						Create				(int nx, int ny, double *Data = NULL);
+
+	bool						Destroy				(void);
+
+	bool						Set_Size			(int nRows, int nCols);
+	bool						Set_Cols			(int nCols);
+	bool						Set_Rows			(int nRows);
+	bool						Add_Cols			(int nCols);
+	bool						Add_Rows			(int nRows);
+	bool						Del_Cols			(int nCols);
+	bool						Del_Rows			(int nRows);
+	bool						Add_Col				(          double *Data = NULL);
+	bool						Add_Col				(          const CSG_Vector &Data);
+	bool						Add_Row				(          double *Data = NULL);
+	bool						Add_Row				(          const CSG_Vector &Data);
+	bool						Ins_Col				(int iCol, double *Data = NULL);
+	bool						Ins_Col				(int iCol, const CSG_Vector &Data);
+	bool						Ins_Row				(int iRow, double *Data = NULL);
+	bool						Ins_Row				(int iRow, const CSG_Vector &Data);
+	bool						Set_Col				(int iCol, double *Data);
+	bool						Set_Col				(int iCol, const CSG_Vector &Data);
+	bool						Set_Row				(int iRow, double *Data);
+	bool						Set_Row				(int iRow, const CSG_Vector &Data);
+	bool						Del_Col				(int iCol);
+	bool						Del_Row				(int iRow);
+	CSG_Vector					Get_Col				(int iCol)		const;
+	CSG_Vector					Get_Row				(int iRow)		const;
+
+	int							Get_NX				(void)			const	{	return( m_nx );			}
+	int							Get_NCols			(void)			const	{	return( m_nx );			}
+	int							Get_NY				(void)			const	{	return( m_ny );			}
+	int							Get_NRows			(void)			const	{	return( m_ny );			}
+
+	operator const double **						(void)			const	{	return( (const double **)m_z );	}
+	double **					Get_Data			(void)			const	{	return( m_z );			}
+	double						operator ()			(int y, int x)	const	{	return( m_z[y][x] );	}
+	double *					operator []			(int y)			const	{	return( m_z[y] );		}
+
+	CSG_String					asString			(int Width = -1, int Precision = -1, bool bScientific = false)	const;
+
+	bool						is_Square			(void)	const	{	return( m_nx > 0 && m_nx == m_ny );	}
+	bool						is_Equal			(const CSG_Matrix &Matrix)	const;
+
+	bool						Assign				(double Scalar);
+	bool						Assign				(const CSG_Matrix &Matrix);
+	bool						Add					(double Scalar);
+	bool						Add					(const CSG_Matrix &Matrix);
+	bool						Subtract			(const CSG_Matrix &Matrix);
+	bool						Multiply			(double Scalar);
+	CSG_Vector					Multiply			(const CSG_Vector &Vector)	const;
+	CSG_Matrix					Multiply			(const CSG_Matrix &Matrix)	const;
+
+	bool						operator ==			(const CSG_Matrix &Matrix)	const;
+	CSG_Matrix &				operator =			(double Scalar);
+	CSG_Matrix &				operator =			(const CSG_Matrix &Matrix);
+	CSG_Matrix &				operator +=			(double Scalar);
+	CSG_Matrix &				operator +=			(const CSG_Matrix &Matrix);
+	CSG_Matrix &				operator -=			(double Scalar);
+	CSG_Matrix &				operator -=			(const CSG_Matrix &Matrix);
+	CSG_Matrix &				operator *=			(double Scalar);
+	CSG_Matrix &				operator *=			(const CSG_Matrix &Matrix);
+	CSG_Matrix					operator +			(double Scalar)				const;
+	CSG_Matrix					operator +			(const CSG_Matrix &Matrix)	const;
+	CSG_Matrix					operator -			(double Scalar)				const;
+	CSG_Matrix					operator -			(const CSG_Matrix &Matrix)	const;
+	CSG_Matrix					operator *			(double Scalar)				const;
+	CSG_Vector					operator *			(const CSG_Vector &Vector)	const;
+	CSG_Matrix					operator *			(const CSG_Matrix &Matrix)	const;
+
+	bool						Set_Zero			(void);
+	bool						Set_Identity		(void);
+	bool						Set_Transpose		(void);
+	bool						Set_Inverse			(bool bSilent = true, int nSubSquare = 0);
+
+	double						Get_Determinant		(void)						const;
+	CSG_Matrix					Get_Transpose		(void)						const;
+	CSG_Matrix					Get_Inverse			(bool bSilent = true, int nSubSquare = 0)	const;
+
+
+private:
+
+	int							m_nx, m_ny;
+
+	double						**m_z;
+
+
+	void						_On_Construction	(void);
+
+};
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT CSG_Matrix	operator *			(double Scalar, const CSG_Matrix &Matrix);
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT bool		SG_Matrix_LU_Decomposition	(int n,       int *Permutation,       double **Matrix                , bool bSilent = true);
+SAGA_API_DLL_EXPORT bool		SG_Matrix_LU_Solve			(int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent = true);
+
+SAGA_API_DLL_EXPORT bool		SG_Matrix_Solve				(CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent = true);
+SAGA_API_DLL_EXPORT bool		SG_Matrix_Eigen_Reduction	(const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent = true);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Grid_Radius
+{
+public:
+	CSG_Grid_Radius(int maxRadius = 0);
+	~CSG_Grid_Radius(void);
+
+	bool						Create				(int maxRadius);
+	void						Destroy				(void);
+
+	int							Get_Maximum			(void)			{	return( m_maxRadius );	}
+
+	int							Get_nPoints			(void)			{	return( m_nPoints );	}
+	int							Get_nPoints			(int iRadius)	{	return( iRadius >= 0 && iRadius < m_maxRadius ? m_nPoints_R[iRadius] : 0 );	}
+
+	double						Get_Point			(int iPoint, int &x, int &y)
+	{
+		if( iPoint >= 0 && iPoint < m_nPoints )
+		{
+			x	= m_Points[iPoint].x;
+			y	= m_Points[iPoint].y;
+
+			return( m_Points[iPoint].d );				// Distance...
+		}
+
+		return( -1.0 );
+	}
+
+	double						Get_Point			(int iPoint, int xOffset, int yOffset, int &x, int &y)
+	{
+		double	d;
+
+		if( (d = Get_Point(iPoint, x, y)) >= 0.0 )
+		{
+			x	+= xOffset;
+			y	+= yOffset;
+		}
+
+		return( d );
+	}
+
+	double						Get_Point			(int iRadius, int iPoint, int &x, int &y)
+	{
+		if( iRadius >= 0 && iRadius <= m_maxRadius && iPoint >= 0 && iPoint < m_nPoints_R[iRadius] )
+		{
+			x	= m_Points_R[iRadius][iPoint].x;
+			y	= m_Points_R[iRadius][iPoint].y;
+
+			return( m_Points_R[iRadius][iPoint].d );	// Distance...
+		}
+
+		return( -1.0 );
+	}
+
+	double						Get_Point			(int iRadius, int iPoint, int xOffset, int yOffset, int &x, int &y)
+	{
+		double	d;
+
+		if( (d = Get_Point(iRadius, iPoint, x, y)) >= 0.0 )
+		{
+			x	+= xOffset;
+			y	+= yOffset;
+		}
+
+		return( d );
+	}
+
+
+private:
+
+	int							m_maxRadius, m_nPoints, *m_nPoints_R;
+
+	typedef struct
+	{
+		int						x, y;
+
+		double					d;
+	}
+	TSG_Grid_Radius;
+
+	TSG_Grid_Radius				*m_Points, **m_Points_R;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Random
+{
+public:
+	CSG_Random(void);
+
+	static void			Initialize		(void);
+	static void			Initialize		(unsigned int Value);
+
+	static double		Get_Uniform		(void);
+	static double		Get_Uniform		(double min, double max);
+
+	static double		Get_Gaussian	(double mean, double stddev);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Simple_Statistics
+{
+public:
+	CSG_Simple_Statistics(void);
+	CSG_Simple_Statistics(bool bHoldValues);
+	CSG_Simple_Statistics(const CSG_Simple_Statistics &Statistics);
+	CSG_Simple_Statistics(double Mean, double StdDev, sLong Count = 1000);
+
+	bool						Create				(bool bHoldValues = false);
+	bool						Create				(const CSG_Simple_Statistics &Statistics);
+	bool						Create				(double Mean, double StdDev, sLong Count = 1000);
+
+	void						Invalidate			(void);
+
+	bool						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	);	}
+
+	void						Add					(const CSG_Simple_Statistics &Statistics);
+
+	void						Add_Value			(double Value, double Weight = 1.0);
+
+	double						Get_Value			(sLong i)	const	{	return( i >= 0 && i < (sLong)m_Values.Get_Size() ? ((double *)m_Values.Get_Array())[i] : m_Mean );	}
+
+	CSG_Simple_Statistics &		operator  =			(const CSG_Simple_Statistics &Statistics)	{	Create(Statistics);	return( *this );	}
+	CSG_Simple_Statistics &		operator +=			(const CSG_Simple_Statistics &Statistics)	{	Add(Statistics);	return( *this );	}
+	CSG_Simple_Statistics &		operator +=			(double Value)								{	Add_Value(Value);	return( *this );	}
+
+
+protected:
+
+	bool						m_bEvaluated;
+
+	sLong						m_nValues;
+
+	double						m_Weights, m_Sum, m_Sum2, m_Minimum, m_Maximum, m_Range, m_Mean, m_Variance, m_StdDev;
+
+	CSG_Array					m_Values;
+
+
+	void						_Evaluate			(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Class_Statistics
+{
+private:
+
+	typedef struct SClass
+	{
+		int		Count;
+
+		double	Value;
+	}
+	TClass;
+
+
+public:
+	 CSG_Class_Statistics(void);
+	~CSG_Class_Statistics(void);
+
+	void			Create					(void);
+	void			Destroy					(void);
+
+	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 );	}
+
+	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);
+
+	int				Get_Majority			(void);
+	bool			Get_Majority			(double &Value);
+	bool			Get_Majority			(double &Value, int &Count);
+
+	int				Get_Minority			(void);
+	bool			Get_Minority			(double &Value);
+	bool			Get_Minority			(double &Value, int &Count);
+
+
+private:
+
+	CSG_Array		m_Array;
+
+	TClass			*m_Classes;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum ESG_Cluster_Analysis_Method
+{
+	SG_CLUSTERANALYSIS_Minimum_Distance	= 0,
+	SG_CLUSTERANALYSIS_Hill_Climbing,
+	SG_CLUSTERANALYSIS_Combined
+};
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Cluster_Analysis
+{
+public:
+	CSG_Cluster_Analysis(void);
+	~CSG_Cluster_Analysis(void);
+	
+	bool					Create				(int nFeatures);
+	bool					Destroy				(void);
+
+	bool					Add_Element			(void);
+	bool					Set_Feature			(int iElement, int iFeature, double Value);
+
+	int						Get_Cluster			(int iElement)	const	{	return( iElement >= 0 && iElement < Get_nElements() ? m_Cluster[iElement] : -1 );	}
+
+	bool					Execute				(int Method, int nClusters);
+
+	int						Get_nElements		(void)	const	{	return( (int)m_Features.Get_Size() );	}
+	int						Get_nFeatures		(void)	const	{	return( m_nFeatures );	}
+	int						Get_nClusters		(void)	const	{	return( m_nClusters );	}
+
+	int						Get_Iteration		(void)	const	{	return( m_Iteration );	}
+
+	double					Get_SP				(void)	const	{	return( m_SP );			}
+
+	int						Get_nMembers		(int iCluster)					const	{	return( m_nMembers[iCluster] );	}
+	double					Get_Variance		(int iCluster)					const	{	return( m_Variance[iCluster] );	}
+	double					Get_Centroid		(int iCluster, int iFeature)	const	{	return( m_Centroid[iCluster][iFeature] );	}
+
+
+private:
+
+	int						*m_Cluster, m_Iteration, m_nFeatures, m_nClusters, *m_nMembers;
+
+	double					*m_Variance, **m_Centroid, m_SP;
+
+	CSG_Array				m_Features;
+
+
+	bool					Minimum_Distance	(bool bInitialize);
+	bool					Hill_Climbing		(bool bInitialize);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	SG_CLASSIFY_SUPERVISED_BinaryEncoding	= 0,
+	SG_CLASSIFY_SUPERVISED_ParallelEpiped,
+	SG_CLASSIFY_SUPERVISED_MinimumDistance,
+	SG_CLASSIFY_SUPERVISED_Mahalonobis,
+	SG_CLASSIFY_SUPERVISED_MaximumLikelihood,
+	SG_CLASSIFY_SUPERVISED_SAM,
+	SG_CLASSIFY_SUPERVISED_WTA,
+	SG_CLASSIFY_SUPERVISED_SID,
+	SG_CLASSIFY_SUPERVISED_SVM
+};
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Classifier_Supervised
+{
+public:
+	CSG_Classifier_Supervised(void);
+	virtual ~CSG_Classifier_Supervised(void);
+
+	void						Create						(int nFeatures);
+	void						Destroy						(void);
+
+	int							Get_Feature_Count			(void)			{	return( m_nFeatures );			}
+
+	int							Get_Element_Count			(int iClass)	{	return( m_nElements[iClass] );	}
+	void						Del_Element_Count			(void);
+
+	int							Get_Class_Count				(void)			{	return( m_IDs.Get_Count() );	}
+	const CSG_String &			Get_Class_ID				(int iClass)	{	return( m_IDs[iClass] );		}
+
+	int							Get_Class					(const CSG_String &Class_ID);
+
+	CSG_Simple_Statistics *		Get_Statistics				(const CSG_String &Class_ID);
+	CSG_Simple_Statistics *		Get_Statistics				(int iClass)	{	return( m_Statistics[iClass] );	}
+	CSG_Simple_Statistics *		operator []					(int iClass)	{	return( m_Statistics[iClass] );	}
+
+	bool						Get_Class					(const CSG_Vector &Features, int &Class, double &Quality, int Method);
+
+	void						Set_Distance_Threshold		(double Value)	{	m_Distance_Threshold	= Value;	}
+	double						Get_Distance_Threshold		(void)			{	return( m_Distance_Threshold );		}
+
+	void						Set_Probability_Threshold	(double Value)	{	m_Probability_Threshold	= Value;	}
+	double						Get_Probability_Threshold	(void)			{	return( m_Probability_Threshold );	}
+	void						Set_Probability_Relative	(bool   Value)	{	m_Probability_Relative	= Value;	}
+	bool						Get_Probability_Relative	(void)			{	return( m_Probability_Relative );	}
+
+	void						Set_Angle_Threshold			(double Value)	{	m_Angle_Threshold		= Value;	}
+	double						Get_Angle_Threshold			(void)			{	return( m_Angle_Threshold );		}
+
+	void						Set_WTA						(int Method, bool bOn)	{	if( Method >= 0 && Method < SG_CLASSIFY_SUPERVISED_WTA ) m_bWTA[Method]	= bOn;		}
+	bool						Get_WTA						(int Method)			{	return( Method >= 0 && Method < SG_CLASSIFY_SUPERVISED_WTA ? m_bWTA[Method] : false );	}
+
+	static CSG_String			Get_Name_of_Method			(int Method);
+	static CSG_String			Get_Name_of_Quality			(int Method);
+
+
+private:
+
+	bool						m_Probability_Relative, m_bWTA[SG_CLASSIFY_SUPERVISED_WTA];
+
+	int							m_nFeatures, *m_nElements;
+
+	double						m_Distance_Threshold, m_Probability_Threshold, m_Angle_Threshold;
+
+	CSG_Strings					m_IDs;
+
+	CSG_Simple_Statistics		**m_Statistics;
+
+	CSG_Vector					m_ML_s, m_SAM_l, m_BE_m;
+
+	CSG_Matrix					m_ML_a, m_ML_b, m_BE_s;
+
+
+	void						_Update						(void);
+
+	void						_Get_Binary_Encoding		(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Parallel_Epiped		(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Minimum_Distance		(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Mahalanobis_Distance	(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Maximum_Likelihood		(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Spectral_Angle_Mapping	(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Spectral_Divergence	(const CSG_Vector &Features, int &Class, double &Quality);
+	void						_Get_Winner_Takes_All		(const CSG_Vector &Features, int &Class, double &Quality);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Spline
+{
+public:
+	CSG_Spline(void);
+	virtual ~CSG_Spline(void);
+
+	void						Destroy				(void);
+
+	bool						Create				(double *xValues, double *yValues, int nValues, double yA = 1.0e30, double yB = 1.0e30);
+	bool						Create				(double yA = 1.0e30, double yB = 1.0e30);
+
+	void						Add					(double x, double y);
+
+	int							Get_Count			(void)	const	{	return( m_x.Get_N() );	}
+	double						Get_xMin			(void)	const	{	return( m_x.Get_N() > 0 ? m_x(0              ) : 0.0 );	}
+	double						Get_xMax			(void)	const	{	return( m_x.Get_N() > 0 ? m_x(m_x.Get_N() - 1) : 0.0 );	}
+	double						Get_x				(int i)	const	{	return( i >= 0 && i < m_x.Get_N() ? m_x(i) : 0.0 );	}
+	double						Get_y				(int i)	const	{	return( i >= 0 && i < m_y.Get_N() ? m_y(i) : 0.0 );	}
+
+	bool						Get_Value			(double x, double &y);
+	double						Get_Value			(double x);
+
+
+protected:
+
+	bool						m_bCreated;
+
+	CSG_Vector					m_x, m_y, m_z;
+
+
+	bool						_Create				(double yA, double yB);
+
+};
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Thin_Plate_Spline
+{
+public:
+	CSG_Thin_Plate_Spline(void);
+	virtual ~CSG_Thin_Plate_Spline(void);
+
+	bool					Destroy				(void);
+
+	bool					Set_Point_Count		(int Count)	{	return( m_Points.Set_Count(Count) );	}
+	int						Get_Point_Count		(void)		{	return( m_Points.Get_Count() );			}
+
+	CSG_Points_Z &			Get_Points			(void)		{	return( m_Points );	}
+
+	bool					Add_Point			(double x, double y, double z)	{	return( m_Points.Add(  x,   y, z) );	}
+	bool					Add_Point			(const TSG_Point &p, double z)	{	return( m_Points.Add(p.x, p.y, z) );	}
+
+	bool					Set_Point			(int Index, double x, double y, double z)
+	{
+		if( Index >= 0 && Index < m_Points.Get_Count() )
+		{
+			m_Points[Index].x	= x;
+			m_Points[Index].y	= y;
+			m_Points[Index].z	= z;
+
+			return( true );
+		}
+
+		return( false );
+	}
+
+	bool					Set_Point			(int Index, const TSG_Point &p, double z)	{	return( Set_Point(Index, p.x, p.y, z) );	}
+
+	bool					Create				(double Regularization = 0.0, bool bSilent = true);
+
+	bool					is_Okay				(void)	{	return( m_V.Get_N() > 0 );		}
+
+	double					Get_Value			(double x, double y);
+
+
+private:
+
+	CSG_Points_Z			m_Points;
+
+	CSG_Vector				m_V;
+
+
+	double					_Get_hDistance		(TSG_Point_Z A, TSG_Point_Z B);
+	double					_Get_Base_Funtion	(double x);
+	double					_Get_Base_Funtion	(TSG_Point_Z A, double x, double y);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef enum ESG_Test_Distribution_Type
+{
+	TESTDIST_TYPE_Left	= 0,
+	TESTDIST_TYPE_Right,
+	TESTDIST_TYPE_Middle,
+	TESTDIST_TYPE_TwoTail
+}
+TSG_Test_Distribution_Type;
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Test_Distribution
+{
+public:
+
+	static double			Get_F_Tail_from_R2	(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
+
+	static double			Get_F_Tail			(double F    , int dfn, int dfd, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
+	static double			Get_F_Inverse		(double alpha, int dfn, int dfd, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
+
+	static double			Get_T_Tail			(double T    , int df, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
+	static double			Get_T_Inverse		(double alpha, int df, TSG_Test_Distribution_Type Type = TESTDIST_TYPE_Right);
+
+	static double			Get_Norm_P			(double Z);
+	static double			Get_Norm_Z			(double P);
+
+
+private:
+
+	static double			Get_Gamma			(double F, double dfn, double dfd);
+	static double			Get_Log_Gamma		(double a);
+
+	static double			Get_T_P				(double T, int df);
+	static double			Get_T_Z				(double T, int df);
+	static double			Get_T_Inv			(double p, int df);
+
+	static double			_Change_Tail_Type	(double p, TSG_Test_Distribution_Type from, TSG_Test_Distribution_Type to, bool bNegative);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// Values: (matrix) array with number of variables = number of rows (x), number of samples = number of columns (y)
+SAGA_API_DLL_EXPORT CSG_Matrix	SG_Get_Correlation_Matrix		(const CSG_Matrix &Values, bool bCovariances = false);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef enum ESG_Regression_Correction
+{
+	REGRESSION_CORR_None	= 0,
+	REGRESSION_CORR_Smith,
+	REGRESSION_CORR_Wherry_1,
+	REGRESSION_CORR_Wherry_2,
+	REGRESSION_CORR_Olkin_Pratt,
+	REGRESSION_CORR_Pratt,
+	REGRESSION_CORR_Claudy_3
+}
+TSG_Regression_Correction;
+
+//---------------------------------------------------------
+SAGA_API_DLL_EXPORT double		SG_Regression_Get_Adjusted_R2	(double R2, int nSamples, int nPredictors, TSG_Regression_Correction Correction = REGRESSION_CORR_Wherry_1);
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef enum ESG_Regression_Type
+{
+	REGRESSION_Linear	= 0,	// Y = a + b * X
+	REGRESSION_Rez_X,			// Y = a + b / X
+	REGRESSION_Rez_Y,			// Y = a / (b - X)
+	REGRESSION_Pow,				// Y = a * X^b
+	REGRESSION_Exp,				// Y = a * e^(b * X)
+	REGRESSION_Log				// Y = a + b * ln(X)
+}
+TSG_Regression_Type;
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Regression
+{
+public:
+	CSG_Regression(void);
+	virtual ~CSG_Regression(void);
+
+	void						Destroy				(void);
+
+	void						Set_Values			(int nValues, double *x, double *y);
+	void						Add_Values			(double x, double y);
+
+	int							Get_Count			(void)			const	{	return( m_nValues );	}
+
+	double						Get_xValue			(int iValue)	const	{	return( iValue >= 0 && iValue < m_nValues ? m_x[iValue] : 0.0 );	}
+	double						Get_yValue			(int iValue)	const	{	return( iValue >= 0 && iValue < m_nValues ? m_y[iValue] : 0.0 );	}
+	bool						Get_Values			(int iValue, double &x, double &y)	const
+	{
+		if( iValue >= 0 && iValue < m_nValues )
+		{
+			x	= m_x[iValue];
+			y	= m_y[iValue];
+
+			return( true );
+		}
+
+		return( false );
+	}
+
+	double						Get_xMin			(void)		const	{	return( m_xMin );	}
+	double						Get_xMax			(void)		const	{	return( m_xMax );	}
+	double						Get_xMean			(void)		const	{	return( m_xMean );	}
+	double						Get_xVariance		(void)		const	{	return( m_xVar );	}
+	double						Get_x				(double y)	const;	// returns INF on error, this can be checked using the _finite() function (libc, include <float.h>)...
+
+	double						Get_yMin			(void)		const	{	return( m_yMin );	}
+	double						Get_yMax			(void)		const	{	return( m_yMax );	}
+	double						Get_yMean			(void)		const	{	return( m_yMean );	}
+	double						Get_yVariance		(void)		const	{	return( m_yVar );	}
+	double						Get_y				(double x)	const;	// returns INF on error, this can be checked using the _finite() function (libc, include <float.h>)...
+
+	double						Get_Constant		(void)		const	{	return( m_RConst );	}
+	double						Get_Coefficient		(void)		const	{	return( m_RCoeff );	}
+	double						Get_R				(void)		const	{	return( m_R );		}
+	double						Get_R2				(void)		const	{	return( m_R*m_R );	}
+
+	const SG_Char *				asString			(void);
+
+	TSG_Regression_Type			Get_Type			(void)		const	{	return( m_Type );	}
+
+	bool						Calculate			(TSG_Regression_Type Type = REGRESSION_Linear);
+	bool						Calculate			(int nValues, double *x, double *y, TSG_Regression_Type Type = REGRESSION_Linear);
+
+
+protected:
+
+	int							m_nValues, m_nBuffer;
+
+	double						m_RConst, m_RCoeff, m_R,
+								m_xMin, m_xMax, m_xMean, m_xVar, *m_x,
+								m_yMin, m_yMax, m_yMean, m_yVar, *m_y;
+
+	TSG_Regression_Type			m_Type;
+
+
+	bool						_Get_MinMeanMax		(double &xMin, double &xMean, double &xMax, double &yMin, double &yMean, double &yMax);
+
+	double						_Y_Transform		(double x);
+	double						_X_Transform		(double y);
+
+	bool						_Linear				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum ESG_Multiple_Regression_Info_Vars
+{
+	MLR_VAR_ID	= 0,
+	MLR_VAR_NAME,
+	MLR_VAR_RCOEFF,
+	MLR_VAR_R,
+	MLR_VAR_R2,
+	MLR_VAR_R2_ADJ,
+	MLR_VAR_SE,
+	MLR_VAR_T,
+	MLR_VAR_SIG,
+	MLR_VAR_P
+};
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Regression_Multiple
+{
+public:
+	CSG_Regression_Multiple(bool bIntercept = true);
+	virtual ~CSG_Regression_Multiple(void);
+
+	void						Destroy				(void);
+
+	bool						Set_Data			(const CSG_Matrix &Samples, CSG_Strings *pNames = NULL);
+
+	void						Set_With_Intercept	(bool bOn = true)		{	m_bIntercept	= bOn;	}
+	bool						Get_With_Intercept	(void)			const	{	return( m_bIntercept );	}
+
+	bool						Get_Model			(const CSG_Matrix &Samples                           , CSG_Strings *pNames = NULL);
+	bool						Get_Model_Forward	(const CSG_Matrix &Samples, double P_in              , CSG_Strings *pNames = NULL);
+	bool						Get_Model_Backward	(const CSG_Matrix &Samples, double P_out             , CSG_Strings *pNames = NULL);
+	bool						Get_Model_Stepwise	(const CSG_Matrix &Samples, double P_in, double P_out, CSG_Strings *pNames = NULL);
+
+	bool						Get_Model			(void);
+	bool						Get_Model_Forward	(double P_in);
+	bool						Get_Model_Backward	(double P_out);
+	bool						Get_Model_Stepwise	(double P_in, double P_out);
+
+	bool						Get_CrossValidation	(int nSubSamples = 0);
+
+	CSG_String					Get_Info			(void)			const;
+	class CSG_Table *			Get_Info_Regression	(void)			const	{	return( m_pRegression );	}
+	class CSG_Table *			Get_Info_Model		(void)			const	{	return( m_pModel );			}
+	class CSG_Table *			Get_Info_Steps		(void)			const	{	return( m_pSteps );			}
+
+	double						Get_R2				(void)			const;
+	double						Get_R2_Adj			(void)			const;
+	double						Get_StdError		(void)			const;
+	double						Get_F				(void)			const;
+	double						Get_P				(void)			const;
+	double						Get_CV_RMSE			(void)			const;
+	double						Get_CV_NRMSE		(void)			const;
+	double						Get_CV_R2			(void)			const;
+	int							Get_CV_nSamples		(void)			const;
+	int							Get_DegFreedom		(void)			const;
+	int							Get_nSamples		(void)			const;
+	int							Get_nPredictors		(void)			const;
+	int							Get_Predictor		(int i)			const	{	return( i >= 0 && i < Get_nPredictors() ? m_Predictor[i] : -1 );	}
+
+	double						Get_RConst			(void)			const;
+	const SG_Char *				Get_Name			(int iVariable)	const;
+	double						Get_ID				(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_ID    ) );	}
+	double						Get_RCoeff			(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_RCOEFF) );	}
+	double						Get_R2_Partial		(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_R2    ) );	}
+	double						Get_R2_Partial_Adj	(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_R2_ADJ) );	}
+	double						Get_StdError		(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_SE    ) );	}
+	double						Get_T				(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_T     ) );	}
+	double						Get_P				(int iVariable)	const	{	return( Get_Parameter(iVariable, MLR_VAR_SIG   ) );	}
+
+	double						Get_Parameter		(int iVariable, int Parameter)	const;
+
+	double						Get_Value			(const CSG_Vector &Predictors)					const;
+	bool						Get_Value			(const CSG_Vector &Predictors, double &Value)	const;
+
+	double						Get_Residual		(int iSample)					const;
+	bool						Get_Residual		(int iSample, double &Residual)	const;
+
+	bool						Get_Residuals		(CSG_Vector &Residuals)			const;
+
+
+protected:
+
+	bool						m_bIntercept;
+
+	int							*m_bIncluded, *m_Predictor, m_nPredictors;
+
+	CSG_Strings					m_Names;
+
+	CSG_Matrix					m_Samples, m_Samples_Model;
+
+	class CSG_Table				*m_pRegression, *m_pModel, *m_pSteps;
+
+
+	bool						_Initialize			(bool bInclude);
+
+	double						_Get_F				(int nPredictors, int nSamples, double r2_full, double r2_reduced);
+	double						_Get_P				(int nPredictors, int nSamples, double r2_full, double r2_reduced);
+
+	bool						_Get_Regression		(const class CSG_Matrix &Samples);
+
+	int							_Get_Step_In		(CSG_Matrix &X, double P_in , double &R2, const CSG_Matrix &Samples);
+	int							_Get_Step_Out		(CSG_Matrix &X, double P_out, double &R2);
+
+	bool						_Set_Step_Info		(const CSG_Matrix &X);
+	bool						_Set_Step_Info		(const CSG_Matrix &X, double R2_prev, int iVariable, bool bIn);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//				Formula Parser (A. Ringeler)			 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+typedef double (*TSG_PFNC_Formula_0)(void);
+typedef double (*TSG_PFNC_Formula_1)(double);
+typedef double (*TSG_PFNC_Formula_2)(double, double);
+typedef double (*TSG_PFNC_Formula_3)(double, double, double);
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Formula
+{
+public:
+	CSG_Formula(void);
+	virtual ~CSG_Formula(void);
+
+	bool						Destroy				(void);
+
+	static CSG_String			Get_Help_Operators	(void);
+
+	bool						Get_Error			(CSG_String &Message);
+
+	int							Add_Function		(const SG_Char *Name, TSG_PFNC_Formula_1 f, int N_of_Pars, int Varying);
+	int							Del_Function		(SG_Char *Name);
+
+	bool						Set_Formula			(const CSG_String &Formula);
+	CSG_String					Get_Formula			(void)	const	{	return( m_sFormula );	}
+
+	void						Set_Variable		(SG_Char Variable, double Value);
+
+	double						Get_Value			(void)							const;
+	double						Get_Value			(double x)						const;
+	double						Get_Value			(const CSG_Vector &Values)		const;
+	double						Get_Value			(double *Values, int nValues)	const;
+	double						Get_Value			(SG_Char *Arguments, ...)		const;
+
+	const SG_Char *				Get_Used_Variables	(void);
+
+
+	//-----------------------------------------------------
+	typedef struct 
+	{
+		SG_Char					*name;
+		TSG_PFNC_Formula_1		f;			
+		int						n_pars;		
+		int						varying;	// Does the result of the function vary even when the parameters stay the same? varying = 1 for e.g. random - number generators.
+	}
+	TSG_Formula_Item;
+
+
+private:
+
+	//-----------------------------------------------------
+	typedef struct 
+	{
+		SG_Char					*code;
+		double					*ctable;
+	}
+	TMAT_Formula;
+
+
+	//-----------------------------------------------------
+	bool						m_bError, m_Vars_Used[256];
+
+	int							m_Error_Position, m_Length;
+
+	TMAT_Formula				m_Formula;
+
+	CSG_String					m_sFormula, m_sError;
+
+	const SG_Char				*i_error;
+
+	int							i_pctable;			// number of items in a table of constants - used only by the translating functions
+
+	double						m_Parameters[32],
+								*i_ctable;			// current table of constants - used only by the translating functions
+
+
+	void						_Set_Error			(const SG_Char *Error = NULL);
+
+	double						_Get_Value			(const double *Parameters, TMAT_Formula Function)	const;
+
+	int							_is_Operand			(SG_Char c);
+	int							_is_Operand_Code	(SG_Char c);
+	int							_is_Number			(SG_Char c);
+
+	int							_Get_Function		(int i, SG_Char *name, int *n_pars, int *varying);
+	int							_Get_Function		(SG_Char *name);
+
+	TMAT_Formula				_Translate			(const SG_Char *source, const SG_Char *args, int *length, int *error);
+
+	int							max_size(const SG_Char *source);
+	SG_Char *					my_strtok(SG_Char *s);
+	SG_Char *					i_trans(SG_Char *function, SG_Char *begin, SG_Char *end);
+	SG_Char *					comp_time(SG_Char *function, SG_Char *fend, int npars);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum ESG_Trend_String
+{
+	SG_TREND_STRING_Formula	= 0,
+	SG_TREND_STRING_Function,
+	SG_TREND_STRING_Formula_Parameters,
+	SG_TREND_STRING_Complete
+};
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Trend
+{
+public:
+	CSG_Trend(void);
+	virtual ~CSG_Trend(void);
+
+	bool						Set_Formula			(const SG_Char *Formula = NULL);
+	CSG_String					Get_Formula			(int Type = SG_TREND_STRING_Complete);
+
+	int							Get_Parameter_Count	(void) const	{	return( m_Params.m_Count );		}
+	double *					Get_Parameters		(void) const	{	return( m_Params.m_A );			}
+
+	void						Clr_Data			(void);
+	void						Set_Data			(double *xData, double *yData, int nData, bool bAdd = false);
+	void						Set_Data			(const CSG_Points &Data, bool bAdd = false);
+	void						Add_Data			(double x, double y);
+	int							Get_Data_Count		(void) const	{	return( m_Data.Get_Count() );	}
+	double						Get_Data_X			(int Index)		{	return( m_Data.Get_X(Index) );	}
+	double						Get_Data_Y			(int Index)		{	return( m_Data.Get_Y(Index) );	}
+	double						Get_Data_XMin		(void)			{	return( m_xMin );	}
+	double						Get_Data_XMax		(void)			{	return( m_xMax );	}
+	double						Get_Data_YMin		(void)			{	return( m_yMin );	}
+	double						Get_Data_YMax		(void)			{	return( m_yMax );	}
+
+	bool						Set_Max_Iterations	(int Iterations);
+	int							Get_Max_Iterations	(void)			{	return( m_Iter_Max);	}
+	bool						Set_Max_Lambda		(double Lambda);
+	double						Get_Max_Lambda		(void)			{	return( m_Lambda_Max);	}
+
+	bool						Get_Trend			(double *xData, double *yData, int nData, const SG_Char *Formula = NULL);
+	bool						Get_Trend			(const CSG_Points &Data, const SG_Char *Formula = NULL);
+	bool						Get_Trend			(void);
+
+	bool						is_Okay				(void)			{	return( m_bOkay );		}
+
+	CSG_String					Get_Error			(void);
+
+	double						Get_ChiSquare		(void);
+	double						Get_R2				(void);
+
+	double						Get_Value			(double x);
+
+
+private:
+
+	//-----------------------------------------------------
+	class SAGA_API_DLL_EXPORT CFncParams
+	{
+	public:
+		CFncParams(void);
+		virtual ~CFncParams(void);
+
+		bool					Create				(const SG_Char *Variables, int nVariables);
+		bool					Destroy				(void);
+
+		int						m_Count;
+
+		SG_Char					*m_Variables;
+
+		double					*m_A, *m_Atry, *m_dA, *m_dA2, *m_Beta, **m_Alpha, **m_Covar;
+
+	};
+
+
+	//-----------------------------------------------------
+	bool						m_bOkay;
+
+	int							m_Iter_Max;
+
+	double						m_ChiSqr, m_ChiSqr_o, m_Lambda, m_Lambda_Max, m_xMin, m_xMax, m_yMin, m_yMax;
+
+	CSG_Points					m_Data;
+
+	CFncParams					m_Params;
+
+	CSG_Formula					m_Formula;
+
+
+	bool						_Fit_Function		(void);
+	bool						_Get_Gaussj			(void);
+	bool						_Get_mrqcof			(double *Parameters, double **Alpha, double *Beta);
+
+	void						_Get_Function		(double x, double *Parameters, double &y, double *dy_da);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Trend_Polynom
+{
+public:
+	CSG_Trend_Polynom(void);
+
+	bool						Destroy				(void);
+
+	bool						Set_Order			(int Order = 1);
+
+	bool						Clr_Data			(void);
+	bool						Set_Data			(double *x, double *y, int n, bool bAdd = false);
+	bool						Add_Data			(double  x, double  y);
+	int							Get_Data_Count		(void)		const	{	return( m_x.Get_N() );	}
+	double						Get_Data_X			(int i)		const	{	return( m_x(i) );	}
+	double						Get_Data_Y			(int i)		const	{	return( m_y(i) );	}
+
+	bool						Get_Trend			(void);
+
+	int							Get_Order			(void)		const	{	return( m_Order     );	}
+	int							Get_nCoefficients	(void)		const	{	return( m_Order + 1 );	}
+	double						Get_Coefficient		(int i)		const	{	return( m_a(i)      );	}
+	double						Get_R2				(void)		const	{	return( m_r2        );	}
+
+	double						Get_Value			(double x)	const;
+
+
+private:
+
+	double						m_r2;
+
+	int							m_Order;
+
+	CSG_Vector					m_x, m_y, m_a;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__SAGA_API__mat_tools_H
diff --git a/src/saga_core/saga_api/module.cpp b/src/saga_core/saga_api/module.cpp
index e29615a..9cf603e 100644
--- a/src/saga_core/saga_api/module.cpp
+++ b/src/saga_core/saga_api/module.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -216,7 +216,7 @@ bool CSG_Module::Execute(void)
 		}	// try
 		__except(1)
 		{
-			Message_Dlg(SG_T("Module caused access violation!"));
+			Message_Dlg(SG_T("Tool caused access violation!"));
 		}	// except(1)
 #endif
 ///////////////////////////////////////////////////////////
@@ -460,9 +460,9 @@ void CSG_Module::Process_Set_Text(const CSG_String &Text)
 }
 
 //---------------------------------------------------------
-bool CSG_Module::Set_Progress(int Position)
+bool CSG_Module::Set_Progress(double Percent)
 {
-	return( Set_Progress(Position, 100.0) );
+	return( Set_Progress(Percent, 100.0) );
 }
 
 //---------------------------------------------------------
@@ -790,16 +790,19 @@ void CSG_Module::_Set_Output_History(void)
 		{
 			CSG_Parameter	*p	= pParameters->Get_Parameter(i);
 
-			if( p->is_Output() && p->is_DataObject() && p->asDataObject() )
+			if( p->is_Output() && p->is_Enabled() )
 			{
-				p->asDataObject()->Get_History().Assign(History);
-			}
+				if( p->is_DataObject() && p->asDataObject() )
+				{
+					p->asDataObject()->Get_History().Assign(History);
+				}
 
-			if( p->is_Output() && p->is_DataObject_List() )
-			{
-				for(int j=0; j<p->asList()->Get_Count(); j++)
+				if( p->is_DataObject_List() )
 				{
-					p->asList()->asDataObject(j)->Get_History().Assign(History);
+					for(int j=0; j<p->asList()->Get_Count(); j++)
+					{
+						p->asList()->asDataObject(j)->Get_History().Assign(History);
+					}
 				}
 			}
 		}
@@ -941,7 +944,7 @@ CSG_String CSG_Module::Get_Summary(bool bParameters, const CSG_String &Menu, con
 	//-----------------------------------------------------
 	else
 	{
-		s	+= CSG_String::Format(SG_T("<b>%s</b><table border=\"0\">"), _TL("Module"));
+		s	+= CSG_String::Format(SG_T("<b>%s</b><table border=\"0\">"), _TL("Tool"));
 
 		SUMMARY_ADD_STR(_TL("Name"  ), Get_Name  ().c_str());
 		SUMMARY_ADD_INT(_TL("ID"    ), Get_ID    ());
diff --git a/src/saga_core/saga_api/module.h b/src/saga_core/saga_api/module.h
index 4c90e7e..d62105e 100644
--- a/src/saga_core/saga_api/module.h
+++ b/src/saga_core/saga_api/module.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module.h 2111 2014-05-07 09:58:48Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -211,6 +211,8 @@ public:
 
 	virtual bool				do_Sync_Projections			(void)	{	return( true  );	}
 
+	virtual bool				needs_GUI					(void)	{	return( false );	}
+
 	virtual bool				is_Grid						(void)	{	return( false );	}
 	virtual bool				is_Interactive				(void)	{	return( false );	}
 	bool						is_Progress					(void)	{	return( SG_UI_Process_Get_Okay(false) );	}
@@ -256,7 +258,7 @@ protected:
 	virtual bool				Process_Get_Okay			(bool bBlink = false);
 	virtual void				Process_Set_Text			(const CSG_String &Text);
 
-	virtual bool				Set_Progress				(int Position);
+	virtual bool				Set_Progress				(double Percent);
 	virtual bool				Set_Progress				(double Position, double Range);
 
 	bool						Stop_Execution				(bool bDialog = true);
@@ -342,14 +344,14 @@ public:
 
 protected:
 
-	virtual bool				Set_Progress			(int iRow);
+	virtual bool				Set_Progress_NCells		(sLong iCell);
+	virtual bool				Set_Progress			(int  iRow);
 	virtual bool				Set_Progress			(double Position, double Range);
-	virtual bool				Set_Progress_NCells		(int iCell);
 
 	//-----------------------------------------------------
 	int							Get_NX					(void)						{	return( Get_System()->Get_NX() );				}
 	int							Get_NY					(void)						{	return( Get_System()->Get_NY() );				}
-	long						Get_NCells				(void)						{	return( Get_System()->Get_NCells() );			}
+	sLong						Get_NCells				(void)						{	return( Get_System()->Get_NCells() );			}
 	double						Get_Cellsize			(void)						{	return( Get_System()->Get_Cellsize() );			}
 	double						Get_Cellarea			(void)						{	return( Get_System()->Get_Cellarea() );			}
 	double						Get_XMin				(void)						{	return( Get_System()->Get_XMin() );				}
@@ -504,6 +506,8 @@ public:
 
 	virtual TSG_Module_Type		Get_Type				(void)	{	return( MODULE_TYPE_Interactive );	}
 
+	virtual bool				needs_GUI				(void)	{	return( true );	}
+
 	virtual bool				is_Interactive			(void)	{	return( true );	}
 
 };
@@ -528,6 +532,8 @@ public:
 
 	virtual TSG_Module_Type		Get_Type				(void)	{	return( MODULE_TYPE_Grid_Interactive );	}
 
+	virtual bool				needs_GUI				(void)	{	return( true );	}
+
 	virtual bool				is_Interactive			(void)	{	return( true );	}
 
 
diff --git a/src/saga_core/saga_api/module_grid.cpp b/src/saga_core/saga_api/module_grid.cpp
index 5052064..24458ab 100644
--- a/src/saga_core/saga_api/module_grid.cpp
+++ b/src/saga_core/saga_api/module_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module_grid.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -95,26 +95,26 @@ CSG_Module_Grid::~CSG_Module_Grid(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CSG_Module_Grid::Set_Progress(int iRow)
+bool CSG_Module_Grid::Set_Progress_NCells(sLong iCell)
 {
-	return( CSG_Module::Set_Progress(iRow, Get_System()->Get_NY() - 1) );
+	if( Get_System()->is_Valid() && (Get_System()->Get_NCells() <= 100 || !(iCell % (Get_System()->Get_NCells() / 100))) )
+	{
+		return( CSG_Module::Set_Progress((double)iCell, (double)Get_System()->Get_NCells()) );
+	}
+
+	return( is_Progress() );
 }
 
 //---------------------------------------------------------
-bool CSG_Module_Grid::Set_Progress(double Position, double Range)
+bool CSG_Module_Grid::Set_Progress(int iRow)
 {
-	return( CSG_Module::Set_Progress(Position, Range) );
+	return( CSG_Module::Set_Progress(iRow, Get_System()->Get_NY() - 1) );
 }
 
 //---------------------------------------------------------
-bool CSG_Module_Grid::Set_Progress_NCells(int iCell)
+bool CSG_Module_Grid::Set_Progress(double Position, double Range)
 {
-	if( Get_System()->is_Valid() && (Get_System()->Get_NCells() <= 100 || !(iCell % (Get_System()->Get_NCells() / 100))) )
-	{
-		return( CSG_Module::Set_Progress(iCell, Get_System()->Get_NCells()) );
-	}
-
-	return( is_Progress() );
+	return( CSG_Module::Set_Progress(Position, Range) );
 }
 
 
diff --git a/src/saga_core/saga_api/module_library.cpp b/src/saga_core/saga_api/module_library.cpp
index 32a3794..2b1e20d 100644
--- a/src/saga_core/saga_api/module_library.cpp
+++ b/src/saga_core/saga_api/module_library.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module_library.cpp 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -167,7 +167,7 @@ CSG_String CSG_Module_Library::Get_Summary(int Format) const
 	{
 	//-----------------------------------------------------
 	case SG_SUMMARY_FMT_FLAT: case SG_SUMMARY_FMT_FLAT_NO_INTERACTIVE:
-		s	+= CSG_String::Format(SG_T("\n%s:\n"), _TL("modules"));
+		s	+= CSG_String::Format(SG_T("\n%s:\n"), _TL("tools"));
 
 		for(i=0; i<Get_Count(); i++)
 		{
@@ -182,14 +182,14 @@ CSG_String CSG_Module_Library::Get_Summary(int Format) const
 	//-----------------------------------------------------
 	case SG_SUMMARY_FMT_HTML: default:
 		s	+= CSG_String::Format(SG_T("%s: <b>%s</b><br>%s: <i>%s</i><br>%s: <i>%s</i><br>%s: <i>%s</i><hr>%s"),
-				_TL("Module Library"), Get_Info(MLB_INFO_Name),
-				_TL("Author"        ), Get_Info(MLB_INFO_Author),
-				_TL("Version"       ), Get_Info(MLB_INFO_Version),
-				_TL("File"          ), Get_File_Name().c_str(),
+				_TL("Tool Library"), Get_Info(MLB_INFO_Name),
+				_TL("Author"      ), Get_Info(MLB_INFO_Author),
+				_TL("Version"     ), Get_Info(MLB_INFO_Version),
+				_TL("File"        ), Get_File_Name().c_str(),
 				Get_Info(MLB_INFO_Description)
 			);
 
-		s	+= CSG_String::Format(SG_T("<hr><b>%s:<ul>"), _TL("Modules"));
+		s	+= CSG_String::Format(SG_T("<hr><b>%s:<ul>"), _TL("Tools"));
 
 		for(i=0; i<Get_Count(); i++)
 		{
@@ -612,7 +612,7 @@ CSG_String CSG_Module_Library_Manager::Get_Summary(int Format)	const
 	{
 	//-----------------------------------------------------
 	case SG_SUMMARY_FMT_FLAT: case SG_SUMMARY_FMT_FLAT_NO_INTERACTIVE:
-		s	+= CSG_String::Format(SG_T("\n%d %s (%d %s):\n"), Get_Count(), _TL("loaded module libraries"), nModules, _TL("modules"));
+		s	+= CSG_String::Format(SG_T("\n%d %s (%d %s):\n"), Get_Count(), _TL("loaded tool libraries"), nModules, _TL("tools"));
 
 		for(i=0; i<Get_Count(); i++)
 		{
@@ -623,18 +623,18 @@ CSG_String CSG_Module_Library_Manager::Get_Summary(int Format)	const
 
 	//-----------------------------------------------------
 	case SG_SUMMARY_FMT_HTML: default:
-		s	+= CSG_String::Format(SG_T("<b>%s</b>"), _TL("Module Libraries"));
+		s	+= CSG_String::Format(SG_T("<b>%s</b>"), _TL("Tool Libraries"));
 
 		s	+= SG_T("<table border=\"0\">");
 		SUMMARY_HTML_ADD_INT(_TL("Available Libraries"), Get_Count());
-		SUMMARY_HTML_ADD_INT(_TL("Available Modules"  ), nModules);
+		SUMMARY_HTML_ADD_INT(_TL("Available Tools"    ), nModules);
 		s	+= SG_T("</table>");
 
-		s	+= CSG_String::Format(SG_T("<hr><b>%s:</b><table border=\"1\">"), _TL("Module Libraries"));
+		s	+= CSG_String::Format(SG_T("<hr><b>%s:</b><table border=\"1\">"), _TL("Tool Libraries"));
 
 		s	+= CSG_String::Format(SG_T("<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>"),
 				_TL("Library"),
-				_TL("Modules"),
+				_TL("Tools"),
 				_TL("Name"),
 				_TL("Location")
 			);
diff --git a/src/saga_core/saga_api/module_library.h b/src/saga_core/saga_api/module_library.h
index d37053b..98e131b 100644
--- a/src/saga_core/saga_api/module_library.h
+++ b/src/saga_core/saga_api/module_library.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module_library.h 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -213,7 +213,7 @@ SAGA_API_DLL_EXPORT CSG_Module_Library_Manager &	SG_Get_Module_Library_Manager	(
 	\
 	if(	pModule == NULL )\
 	{\
-		Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("could not find module"), SG_T(LIBRARY)));\
+		Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("could not find tool"), SG_T(LIBRARY)));\
 	}\
 	else\
 	{\
@@ -225,11 +225,11 @@ SAGA_API_DLL_EXPORT CSG_Module_Library_Manager &	SG_Get_Module_Library_Manager	(
 		\
 		if( !(CONDITION) )\
 		{\
-			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not initialize module"), SG_T(LIBRARY), pModule->Get_Name().c_str()));\
+			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not initialize tool"), SG_T(LIBRARY), pModule->Get_Name().c_str()));\
 		}\
 		else if( !pModule->Execute() )\
 		{\
-			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not execute module")   , SG_T(LIBRARY), pModule->Get_Name().c_str()));\
+			Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not execute tool")   , SG_T(LIBRARY), pModule->Get_Name().c_str()));\
 		}\
 		else\
 		{\
diff --git a/src/saga_core/saga_api/parameter_data.cpp b/src/saga_core/saga_api/parameter_data.cpp
index acef45f..6647fb3 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameter_data.cpp 2082 2014-04-03 16:08:33Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -903,6 +903,30 @@ const SG_Char * CSG_Parameter_Choice::Get_Item(int Index)	const
 }
 
 //---------------------------------------------------------
+CSG_String CSG_Parameter_Choice::Get_Item_Data(int Index)	const
+{
+	CSG_String	Value;
+
+	if( Index >= 0 && Index < m_Items.Get_Count() )
+	{
+		const SG_Char	*Item	= m_Items[Index].c_str();
+
+		if( *Item == SG_T('{') )
+		{
+			Item++;
+
+			do
+			{
+				Value	+= *(Item++);
+			}
+			while( *Item && *Item != SG_T('}') );
+		}
+	}
+
+	return( Value );
+}
+
+//---------------------------------------------------------
 bool CSG_Parameter_Choice::Get_Data(int        &Value)	const
 {
 	CSG_String	sValue;
@@ -1342,23 +1366,25 @@ bool CSG_Parameter_Fixed_Table::On_Serialize(CSG_MetaData &Entry, bool bSave)
 
 	if( bSave )
 	{
-		pNode	= Entry.Add_Child(SG_T("FIELDS"));
+		pNode	= Entry.Add_Child("FIELDS");
 
 		for(iField=0; iField<m_Table.Get_Field_Count(); iField++)
 		{
-			pEntry	= pNode->Add_Child	(SG_T("FIELD")	, m_Table.Get_Field_Name(iField));
-			pEntry	->Set_Property		(SG_T("type")	, gSG_Data_Type_Identifier[m_Table.Get_Field_Type(iField)]);
+			pEntry	= pNode->Add_Child("FIELD", m_Table.Get_Field_Name(iField));
+			pEntry	->Set_Property("type" , gSG_Data_Type_Identifier[m_Table.Get_Field_Type(iField)]);
 		}
 
-		pNode	= Entry.Add_Child(SG_T("RECORDS"));
+		pNode	= Entry.Add_Child("RECORDS");
 
 		for(iRecord=0; iRecord<m_Table.Get_Count(); iRecord++)
 		{
-			pEntry	= pNode->Add_Child(SG_T("RECORD"));
+			pEntry	= pNode->Add_Child("RECORD");
+
+			CSG_Table_Record	*pRecord	= m_Table.Get_Record(iRecord);
 
 			for(iField=0; iField<m_Table.Get_Field_Count(); iField++)
 			{
-				pEntry->Add_Child(SG_T("FIELD"), m_Table[iRecord].asString(iField));
+				pEntry->Add_Child("FIELD", pRecord->asString(iField));
 			}
 		}
 	}
@@ -1366,7 +1392,7 @@ bool CSG_Parameter_Fixed_Table::On_Serialize(CSG_MetaData &Entry, bool bSave)
 	{
 		CSG_Table	t;
 
-		if( (pNode = Entry.Get_Child(SG_T("FIELDS"))) == NULL )
+		if( (pNode = Entry.Get_Child("FIELDS")) == NULL )
 		{
 			return( false );
 		}
@@ -1376,7 +1402,7 @@ bool CSG_Parameter_Fixed_Table::On_Serialize(CSG_MetaData &Entry, bool bSave)
 			CSG_String		s;
 			TSG_Data_Type	type	= SG_DATATYPE_String;
 
-			if( pNode->Get_Child(iField)->Get_Property(SG_T("type"), s) )
+			if( pNode->Get_Child(iField)->Get_Property("type", s) )
 			{
 				     if( !s.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Bit   ]) )	type	= SG_DATATYPE_Bit;
 				else if( !s.Cmp(gSG_Data_Type_Identifier[SG_DATATYPE_Byte  ]) )	type	= SG_DATATYPE_Byte;
@@ -1397,7 +1423,7 @@ bool CSG_Parameter_Fixed_Table::On_Serialize(CSG_MetaData &Entry, bool bSave)
 			t.Add_Field(pNode->Get_Child(iField)->Get_Content(), type);
 		}
 
-		if( (pNode = Entry.Get_Child(SG_T("RECORDS"))) == NULL )
+		if( (pNode = Entry.Get_Child("RECORDS")) == NULL )
 		{
 			return( false );
 		}
@@ -1406,11 +1432,11 @@ bool CSG_Parameter_Fixed_Table::On_Serialize(CSG_MetaData &Entry, bool bSave)
 		{
 			pEntry	= pNode->Get_Child(iRecord);
 
-			t.Add_Record();
+			CSG_Table_Record	*pRecord	= t.Add_Record();
 
 			for(iField=0; iField<pEntry->Get_Children_Count(); iField++)
 			{
-				t[iRecord].Set_Value(iField, pEntry->Get_Child(iField)->Get_Content());
+				pRecord->Set_Value(iField, pEntry->Get_Child(iField)->Get_Content());
 			}
 		}
 
@@ -1944,9 +1970,9 @@ bool CSG_Parameter_Data_Object_Output::Set_Value(void *Value)
 		if( m_pOwner->Get_Manager() )
 		{
 			m_pOwner->Get_Manager()->Add(m_pDataObject);
-		}
 
-		SG_UI_DataObject_Add(m_pDataObject, false);
+			SG_UI_DataObject_Add(m_pDataObject, false);
+		}
 	}
 
 	return( true );
diff --git a/src/saga_core/saga_api/parameters.cpp b/src/saga_core/saga_api/parameters.cpp
index 3a24132..005c9ea 100644
--- a/src/saga_core/saga_api/parameters.cpp
+++ b/src/saga_core/saga_api/parameters.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameters.cpp 2023 2014-02-27 12:37:23Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1175,6 +1175,14 @@ bool CSG_Parameters::DataObjects_Create(void)
 		}
 
 		//-------------------------------------------------
+		else if( p->is_DataObject() && p->is_Enabled() == false )
+		{
+			if( !m_pManager || !m_pManager->Exists(p->asDataObject()) )
+			{
+				p->Set_Value(DATAOBJECT_NOTSET);
+			}
+		}
+
 		else if( p->is_DataObject() )
 		{
 			CSG_Data_Object	*pDataObject	= p->asDataObject();
diff --git a/src/saga_core/saga_api/parameters.h b/src/saga_core/saga_api/parameters.h
index 6d72ab2..06fc3de 100644
--- a/src/saga_core/saga_api/parameters.h
+++ b/src/saga_core/saga_api/parameters.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameters.h 2037 2014-03-04 17:19:43Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -491,6 +491,7 @@ public:
 	void						Set_Items				(const SG_Char *String);
 
 	const SG_Char *				Get_Item				(int Index)	const;
+	CSG_String					Get_Item_Data			(int Index)	const;
 
 	bool						Get_Data				(int        &Value)	const;
 	bool						Get_Data				(double     &Value)	const;
@@ -1400,7 +1401,8 @@ public:
 	CSG_Parameter *				Get_Parameter			(int i)							{	return( i >= 0 && i < m_nParameters ? m_Parameters[i] : NULL );	}
 	CSG_Parameter *				Get_Parameter			(const CSG_String &Identifier);
 
-	CSG_Parameter *				Get						(const SG_Char    *Identifier)	{	return(  Get_Parameter(CSG_String(Identifier)) );	}
+	CSG_Parameter *				Get						(const char       *Identifier)	{	return(  Get_Parameter(CSG_String(Identifier)) );	}
+	CSG_Parameter *				Get						(const wchar_t    *Identifier)	{	return(  Get_Parameter(CSG_String(Identifier)) );	}
 
 	CSG_Parameter *				operator()				(int i)							{	return(  Get_Parameter(i         ) );	}
 	CSG_Parameter *				operator()				(const CSG_String &Identifier)	{	return(  Get_Parameter(Identifier) );	}
diff --git a/src/saga_core/saga_api/projections.cpp b/src/saga_core/saga_api/projections.cpp
index e5da27e..ead09bf 100644
--- a/src/saga_core/saga_api/projections.cpp
+++ b/src/saga_core/saga_api/projections.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: projections.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: projections.cpp 2059 2014-03-19 18:02:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -81,19 +81,163 @@ CSG_Projections &	SG_Get_Projections(void)
 	return( gSG_Projections );
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+TSG_Projection_Type	SG_Get_Projection_Type				(const CSG_String &Identifier)
+{
+	if( !Identifier.CmpNoCase("PROJCS") )	return( SG_PROJ_TYPE_CS_Projected  );
+	if( !Identifier.CmpNoCase("GEOGCS") )	return( SG_PROJ_TYPE_CS_Geographic );
+	if( !Identifier.CmpNoCase("GEOCCS") )	return( SG_PROJ_TYPE_CS_Geocentric );
+
+	return( SG_PROJ_TYPE_CS_Undefined );
+}
+
 //---------------------------------------------------------
-CSG_String			SG_Get_Projection_Type_Name(TSG_Projection_Type Type)
+CSG_String			SG_Get_Projection_Type_Identifier	(TSG_Projection_Type Type)
 {
 	switch( Type )
 	{
-	default:
-	case SG_PROJ_TYPE_CS_Undefined:		return( _TL("Undefined Coordinate System") );
-	case SG_PROJ_TYPE_CS_Projected:		return( _TL("Projected Coordinate System") );
+	case SG_PROJ_TYPE_CS_Projected :	return( "PROJCS"    );
+	case SG_PROJ_TYPE_CS_Geographic:	return( "GEOGCS"    );
+	case SG_PROJ_TYPE_CS_Geocentric:	return( "GEOCCS"    );
+	default                        :	return( "UNDEFINED" );
+	}
+}
+
+//---------------------------------------------------------
+CSG_String			SG_Get_Projection_Type_Name			(TSG_Projection_Type Type)
+{
+	switch( Type )
+	{
+	case SG_PROJ_TYPE_CS_Projected :	return( _TL("Projected Coordinate System" ) );
 	case SG_PROJ_TYPE_CS_Geographic:	return( _TL("Geographic Coordinate System") );
 	case SG_PROJ_TYPE_CS_Geocentric:	return( _TL("Geocentric Coordinate System") );
+	default                        :	return( _TL("Undefined Coordinate System" ) );
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+const char	SG_Projection_Units[SG_PROJ_UNIT_Undefined + 1][3][32]	=
+{
+	{	"km"    , "Kilometers" , "Kilometer"					},
+	{	"m"    	, "Meters"	   , "Meter"						},
+	{	"dm"    , "Decimeters" , "Decimeter"					},
+	{	"cm"    , "Centimeters", "Centimeter"					},
+	{	"mm"    , "Millimeters", "Millimeter"					},
+	{	"kmi"   , "Miles"      , "International Nautical Mile"	},
+	{	"in"    , "Inches"     , "International Inch"			},
+	{	"ft"    , "Feet"       , "International Foot"			},
+	{	"yd"    , "Yards"      , "International Yard"			},
+	{	"mi"    , "Miles"      , "International Statute Mile"	},
+	{	"fath"  , "Fathoms"    , "International Fathom"			},
+	{	"ch"    , "Chains"     , "International Chain"			},
+	{	"link"  , "Links"      , "International Link"			},
+	{	"us-in" , "Inches"     , "U.S. Surveyor's Inch"			},
+	{	"us-ft" , "Feet"       , "U.S. Surveyor's Foot"			},
+	{	"us-yd" , "Yards"      , "U.S. Surveyor's Yard"			},
+	{	"us-ch" , "Chains"     , "U.S. Surveyor's Chain"		},
+	{	"us-mi" , "Miles"      , "U.S. Surveyor's Statute Mile"	},
+	{	"ind-yd", "Yards"      , "Indian Yard"					},
+	{	"ind-ft", "Feet"       , "Indian Foot"					},
+	{	"ind-ch", "Chains"     , "Indian Chain"					},
+	{	""      , ""           , ""								}
+};
+
+//---------------------------------------------------------
+// same as proj4.
+TSG_Projection_Unit	SG_Get_Projection_Unit				(const CSG_String &Identifier)
+{
+	for(int i=0; i<SG_PROJ_UNIT_Undefined; i++)
+	{
+		if( !Identifier.CmpNoCase(SG_Projection_Units[i][0])
+		||  !Identifier.CmpNoCase(SG_Projection_Units[i][2]) )
+		{
+			return( (TSG_Projection_Unit)i );
+		}
+	}
+
+	return( !Identifier.CmpNoCase("metre") ? SG_PROJ_UNIT_Meter : SG_PROJ_UNIT_Undefined );
+}
+
+//---------------------------------------------------------
+// same as proj4.
+CSG_String			SG_Get_Projection_Unit_Identifier	(TSG_Projection_Unit Unit)
+{
+	if(	Unit < 0 || Unit > SG_PROJ_UNIT_Undefined )
+		Unit	= SG_PROJ_UNIT_Undefined;
+
+	return( SG_Projection_Units[Unit][0] );
+}
+
+//---------------------------------------------------------
+CSG_String			SG_Get_Projection_Unit_Name			(TSG_Projection_Unit Unit, bool bSimple)
+{
+	if(	Unit < 0 || Unit > SG_PROJ_UNIT_Undefined )
+		Unit	= SG_PROJ_UNIT_Undefined;
+
+	return( SG_Projection_Units[Unit][bSimple ? 1 : 2] );
+}
+
+//---------------------------------------------------------
+double				SG_Get_Projection_Unit_To_Meter		(TSG_Projection_Unit Unit)
+{
+	switch( Unit )
+	{
+	case SG_PROJ_UNIT_Kilometer        :	return( 1000.0 );
+	case SG_PROJ_UNIT_Meter            :	return( 1.0 );
+	case SG_PROJ_UNIT_Decimeter        :	return( 0.1 );
+	case SG_PROJ_UNIT_Centimeter       :	return( 0.01 );
+	case SG_PROJ_UNIT_Millimeter       :	return( 0.001 );
+	case SG_PROJ_UNIT_Int_Nautical_Mile:	return( 1852.0 );
+	case SG_PROJ_UNIT_Int_Inch         :	return( 0.0254 );
+	case SG_PROJ_UNIT_Int_Foot         :	return( 0.3048 );
+	case SG_PROJ_UNIT_Int_Yard         :	return( 0.9144 );
+	case SG_PROJ_UNIT_Int_Statute_Mile :	return( 1609.344 );
+	case SG_PROJ_UNIT_Int_Fathom       :	return( 1.8288 );
+	case SG_PROJ_UNIT_Int_Chain        :	return( 20.1168 );
+	case SG_PROJ_UNIT_Int_Link         :	return( 0.201168 );
+	case SG_PROJ_UNIT_US_Inch          :	return( 1.0 / 39.37 );
+	case SG_PROJ_UNIT_US_Foot          :	return( 0.304800609601219 );
+	case SG_PROJ_UNIT_US_Yard          :	return( 0.914401828803658 );
+	case SG_PROJ_UNIT_US_Chain         :	return( 20.11684023368047 );
+	case SG_PROJ_UNIT_US_Statute_Mile  :	return( 1609.347218694437 );
+	case SG_PROJ_UNIT_Indian_Yard      :	return( 0.91439523 );
+	case SG_PROJ_UNIT_Indian_Foot      :	return( 0.30479841 );
+	case SG_PROJ_UNIT_Indian_Chain     :	return( 20.11669506 );
+	default                            :	return( 1.0 );
 	}
 }
 
+//---------------------------------------------------------
+bool				SG_Set_Projection_Unit		(const CSG_MetaData &m, TSG_Projection_Unit &Unit, CSG_String &Name, double &To_Meter)
+{
+	if( m["UNIT"].is_Valid() )
+	{
+		if( m["UNIT"].Get_Property("name", Name) && (Unit = SG_Get_Projection_Unit(Name)) != SG_PROJ_UNIT_Undefined )
+		{
+			Name		= SG_Get_Projection_Unit_Name    (Unit);
+			To_Meter	= SG_Get_Projection_Unit_To_Meter(Unit);
+		}
+		else if( !m["UNIT"].Get_Content().asDouble(To_Meter) || To_Meter <= 0.0 )
+		{
+			To_Meter	=  1.0;
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -127,6 +271,9 @@ bool CSG_Projection::Assign(const CSG_Projection &Projection)
 {
 	m_Name			= Projection.m_Name;
 	m_Type			= Projection.m_Type;
+	m_Unit			= Projection.m_Unit;
+	m_Unit_To_Meter	= Projection.m_Unit_To_Meter;
+	m_Unit_Name		= Projection.m_Unit_Name;
 	m_WKT			= Projection.m_WKT;
 	m_Proj4			= Projection.m_Proj4;
 	m_Authority		= Projection.m_Authority;
@@ -174,6 +321,7 @@ bool CSG_Projection::Assign(const CSG_String &Projection, TSG_Projection_Format
 
 	Destroy();
 
+	//-----------------------------------------------------
 	switch( Format )
 	{
 	default:
@@ -216,10 +364,9 @@ bool CSG_Projection::Assign(const CSG_String &Projection, TSG_Projection_Format
 
 	//-----------------------------------------------------
 	m_Name	= m.Get_Property("name");
-	m_Type	= !m.Get_Name().Cmp(SG_T("GEOCCS")) ? SG_PROJ_TYPE_CS_Geocentric
-			: !m.Get_Name().Cmp(SG_T("GEOGCS")) ? SG_PROJ_TYPE_CS_Geographic
-			: !m.Get_Name().Cmp(SG_T("PROJCS")) ? SG_PROJ_TYPE_CS_Projected
-			: SG_PROJ_TYPE_CS_Undefined;
+	m_Type	= SG_Get_Projection_Type(m.Get_Name());
+
+	SG_Set_Projection_Unit(m, m_Unit, m_Unit_Name, m_Unit_To_Meter);
 
 	return( true );
 }
@@ -229,6 +376,9 @@ void CSG_Projection::Destroy(void)
 {
 	m_Name			= _TL("undefined");
 	m_Type			= SG_PROJ_TYPE_CS_Undefined;
+	m_Unit			= SG_PROJ_UNIT_Undefined;
+	m_Unit_To_Meter	= 1.0;
+	m_Unit_Name		.Clear();
 	m_WKT			.Clear();
 	m_Proj4			.Clear();
 	m_Authority		.Clear();
@@ -320,9 +470,9 @@ bool CSG_Projection::Save(CSG_MetaData &Projection) const
 {
 	Projection.Del_Children();
 
-	Projection.Add_Child(SG_T("OGC_WKT"), m_WKT  );
-	Projection.Add_Child(SG_T("PROJ4")  , m_Proj4);
-	Projection.Add_Child(SG_T("EPSG")   , Get_EPSG() );
+	Projection.Add_Child("OGC_WKT", m_WKT      );
+	Projection.Add_Child("PROJ4"  , m_Proj4    );
+	Projection.Add_Child("EPSG"   , Get_EPSG() );
 
 	return( true );
 }
@@ -417,11 +567,11 @@ void CSG_Projections::_On_Construction(void)
 {
 	m_pProjections	= new CSG_Table;
 
-	m_pProjections->Add_Field(SG_T("srid")		, SG_DATATYPE_Int);		// PRJ_FIELD_SRID
-	m_pProjections->Add_Field(SG_T("auth_name")	, SG_DATATYPE_String);	// PRJ_FIELD_AUTH_NAME
-	m_pProjections->Add_Field(SG_T("auth_srid")	, SG_DATATYPE_Int);		// PRJ_FIELD_AUTH_SRID
-	m_pProjections->Add_Field(SG_T("srtext")	, SG_DATATYPE_String);	// PRJ_FIELD_SRTEXT
-	m_pProjections->Add_Field(SG_T("proj4text")	, SG_DATATYPE_String);	// PRJ_FIELD_PROJ4TEXT
+	m_pProjections->Add_Field("srid"     , SG_DATATYPE_Int   );	// PRJ_FIELD_SRID
+	m_pProjections->Add_Field("auth_name", SG_DATATYPE_String);	// PRJ_FIELD_AUTH_NAME
+	m_pProjections->Add_Field("auth_srid", SG_DATATYPE_Int   );	// PRJ_FIELD_AUTH_SRID
+	m_pProjections->Add_Field("srtext"   , SG_DATATYPE_String);	// PRJ_FIELD_SRTEXT
+	m_pProjections->Add_Field("proj4text", SG_DATATYPE_String);	// PRJ_FIELD_PROJ4TEXT
 
 	Reset_Dictionary();
 }
@@ -589,6 +739,8 @@ CSG_Projection CSG_Projections::Get_Projection(int Index)	const
 							: !m.Get_Name().Cmp(SG_T("GEOGCS")) ? SG_PROJ_TYPE_CS_Geographic
 							: !m.Get_Name().Cmp(SG_T("PROJCS")) ? SG_PROJ_TYPE_CS_Projected
 							: SG_PROJ_TYPE_CS_Undefined;
+
+		SG_Set_Projection_Unit(m, Projection.m_Unit, Projection.m_Unit_Name, Projection.m_Unit_To_Meter);
 	}
 
 	return( Projection );
@@ -712,7 +864,7 @@ bool CSG_Projections::_WKT_to_MetaData(CSG_MetaData &MetaData, const CSG_String
 	CSG_Strings	Content;
 
 	//-----------------------------------------------------
-	Content.Add(SG_T(""));
+	Content.Add("");
 
 	for(i=0, l=-1; l!=0 && i<(int)WKT.Length(); i++)
 	{
@@ -752,52 +904,53 @@ bool CSG_Projections::_WKT_to_MetaData(CSG_MetaData &MetaData, const CSG_String
 	}
 
 	//-----------------------------------------------------
-	if( !Key.Cmp(SG_T("AUTHORITY")) && Content.Get_Count() == 2 )		// AUTHORITY  ["<name>", "<code>"]
+	if( !Key.Cmp("AUTHORITY" ) && Content.Get_Count() == 2 )	// AUTHORITY  ["<name>", "<code>"]
 	{
-		MetaData.Add_Property(SG_T("authority_name"), Content[0]);
-		MetaData.Add_Property(SG_T("authority_code"), Content[1]);
+		MetaData.Add_Property("authority_name", Content[0]);
+		MetaData.Add_Property("authority_code", Content[1]);
 
 		return( true );
 	}
 
 	CSG_MetaData	*pKey	= MetaData.Add_Child(Key);
 
-	if(	(!Key.Cmp(SG_T("GEOCCS"))		&& Content.Get_Count() >= 4)	// GEOCCS     ["<name>", <datum>, <prime meridian>, <linear unit> {,<axis>, <axis>, <axis>} {,<authority>}]
-	||	(!Key.Cmp(SG_T("GEOGCS"))		&& Content.Get_Count() >= 4)	// GEOGCS     ["<name>", <datum>, <prime meridian>, <angular unit> {,<twin axes>} {,<authority>}]
-	||	(!Key.Cmp(SG_T("PROJCS"))		&& Content.Get_Count() >= 3)	// PROJCS     ["<name>", <geographic cs>, <projection>, {<parameter>,}* <linear unit> {,<twin axes>}{,<authority>}]
-	||	(!Key.Cmp(SG_T("DATUM"))		&& Content.Get_Count() >= 2) )	// DATUM      ["<name>", <spheroid> {,<to wgs84>} {,<authority>}]
+	if(	(!Key.Cmp("GEOCCS"    ) && Content.Get_Count() >= 4)  	// GEOCCS     ["<name>", <datum>, <prime meridian>, <linear unit> {,<axis>, <axis>, <axis>} {,<authority>}]
+	||	(!Key.Cmp("GEOGCS"    ) && Content.Get_Count() >= 4)  	// GEOGCS     ["<name>", <datum>, <prime meridian>, <angular unit> {,<twin axes>} {,<authority>}]
+	||	(!Key.Cmp("PROJCS"    ) && Content.Get_Count() >= 3)  	// PROJCS     ["<name>", <geographic cs>, <projection>, {<parameter>,}* <linear unit> {,<twin axes>}{,<authority>}]
+	||	(!Key.Cmp("DATUM"     ) && Content.Get_Count() >= 2) )	// DATUM      ["<name>", <spheroid> {,<to wgs84>} {,<authority>}]
 	{
-		pKey->Add_Property(SG_T("name"), Content[0]);
+		pKey->Add_Property("name", Content[0]);
 	}
 
-	if(	(!Key.Cmp(SG_T("PRIMEM"))		&& Content.Get_Count() >= 2)	// PRIMEM     ["<name>", <longitude> {,<authority>}]
-	||	(!Key.Cmp(SG_T("UNIT"))			&& Content.Get_Count() >= 2)	// UNIT       ["<name>", <conversion factor> {,<authority>}]
-	||	(!Key.Cmp(SG_T("AXIS"))			&& Content.Get_Count() >= 2)	// AXIS       ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER]
-	||	(!Key.Cmp(SG_T("PARAMETER"))	&& Content.Get_Count() >= 2) )	// PARAMETER  ["<name>", <value>]
+	if(	(!Key.Cmp("PRIMEM"    ) && Content.Get_Count() >= 2)  	// PRIMEM     ["<name>", <longitude> {,<authority>}]
+	||	(!Key.Cmp("UNIT"      ) && Content.Get_Count() >= 2)  	// UNIT       ["<name>", <conversion factor> {,<authority>}]
+	||	(!Key.Cmp("AXIS"      ) && Content.Get_Count() >= 2)  	// AXIS       ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER]
+	||	(!Key.Cmp("PARAMETER" ) && Content.Get_Count() >= 2) )	// PARAMETER  ["<name>", <value>]
 	{
-		pKey->Add_Property(SG_T("name"), Content[0]);
+		pKey->Add_Property("name", Content[0]);
+
 		pKey->Set_Content(Content[1]);
 	}
 
-	if( (!Key.Cmp(SG_T("SPHEROID"))		&& Content.Get_Count() >= 3) )	// SPHEROID   ["<name>", <semi-major axis>, <inverse flattening> {,<authority>}]
+	if( (!Key.Cmp("SPHEROID"  ) && Content.Get_Count() >= 3) )	// SPHEROID   ["<name>", <semi-major axis>, <inverse flattening> {,<authority>}]
 	{
-		pKey->Add_Property(SG_T("name"), Content[0]);
-		pKey->Add_Child   (SG_T("a")   , Content[1]);
-		pKey->Add_Child   (SG_T("rf")  , Content[2]);
+		pKey->Add_Property("name", Content[0]);
+		pKey->Add_Child   ("a"   , Content[1]);
+		pKey->Add_Child   ("rf"  , Content[2]);
 	}
 
-	if( (!Key.Cmp(SG_T("TOWGS84"))		&& Content.Get_Count() >= 7) )	// TOWGS84    [<dx>, <dy>, <dz>, <ex>, <ey>, <ez>, <ppm>]
+	if( (!Key.Cmp("TOWGS84"   ) && Content.Get_Count() >= 7) )	// TOWGS84    [<dx>, <dy>, <dz>, <ex>, <ey>, <ez>, <ppm>]
 	{
-		pKey->Add_Child(SG_T("dx")     , Content[0]);
-		pKey->Add_Child(SG_T("dy")     , Content[1]);
-		pKey->Add_Child(SG_T("dz")     , Content[2]);
-		pKey->Add_Child(SG_T("ex")     , Content[3]);
-		pKey->Add_Child(SG_T("ey")     , Content[4]);
-		pKey->Add_Child(SG_T("ez")     , Content[5]);
-		pKey->Add_Child(SG_T("ppm")    , Content[6]);
+		pKey->Add_Child("dx"     , Content[0]);
+		pKey->Add_Child("dy"     , Content[1]);
+		pKey->Add_Child("dz"     , Content[2]);
+		pKey->Add_Child("ex"     , Content[3]);
+		pKey->Add_Child("ey"     , Content[4]);
+		pKey->Add_Child("ez"     , Content[5]);
+		pKey->Add_Child("ppm"    , Content[6]);
 	}
 
-	if( (!Key.Cmp(SG_T("PROJECTION"))	&& Content.Get_Count() >= 1) )	// PROJECTION ["<name>" {,<authority>}]
+	if( (!Key.Cmp("PROJECTION") && Content.Get_Count() >= 1) )	// PROJECTION ["<name>" {,<authority>}]
 	{
 		pKey->Set_Content(Content[0]);
 	}
@@ -851,9 +1004,9 @@ bool CSG_Projections::WKT_to_Proj4(CSG_String &Proj4, const CSG_String &WKT) con
 	int			Authority_Code;
 	CSG_String	Authority_Name;
 
-	if(	m.Get_Property("authority_name", Authority_Name) && Authority_Name.CmpNoCase(SG_T("EPSG")) == 0
+	if(	m.Get_Property("authority_name", Authority_Name) && Authority_Name.CmpNoCase("EPSG") == 0
 	&&	m.Get_Property("authority_code", Authority_Code) && EPSG_to_Proj4(Proj4, Authority_Code) )
-	{	//	Proj4.Printf(SG_T("+init=epsg:%d"), Authority_Code);
+	{	//	Proj4.Printf("+init=epsg:%d", Authority_Code);
 		return( true );
 	}
 
@@ -863,7 +1016,7 @@ bool CSG_Projections::WKT_to_Proj4(CSG_String &Proj4, const CSG_String &WKT) con
 	CSG_String	s;
 
 	//-----------------------------------------------------
-	if( !m.Get_Name().Cmp(SG_T("GEOCCS")) )
+	if( !m.Get_Name().Cmp("GEOCCS") )
 	{
 		return( false );
 	}
@@ -879,7 +1032,7 @@ bool CSG_Projections::WKT_to_Proj4(CSG_String &Proj4, const CSG_String &WKT) con
 	//   *AXIS   ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER],
 	//   *AXIS   ["<name>", NORTH|SOUTH|EAST|WEST|UP|DOWN|OTHER]
 	// ]
-	if( !m.Get_Name().Cmp(SG_T("GEOGCS")) )
+	if( !m.Get_Name().Cmp("GEOGCS") )
 	{
 		if(	!m["DATUM"].is_Valid()
 		||	!m["DATUM"]["SPHEROID"].is_Valid()
@@ -1267,43 +1420,14 @@ bool CSG_Projections::_Proj4_Get_Prime_Meridian(CSG_String &Value, const CSG_Str
 //---------------------------------------------------------
 bool CSG_Projections::_Proj4_Get_Unit(CSG_String &Value, const CSG_String &Proj4) const
 {
-	const char	unit[21][3][32]	=
-	{
-		{	"km"		,"1000.0"				, "Kilometer"						},
-		{	"m"			,"1.0"					, "Meter"							},
-		{	"dm"		,"0.1"					, "Decimeter"						},
-		{	"cm"		,"0.01"					, "Centimeter"						},
-		{	"mm"		,"0.001"				, "Millimeter"						},
-		{	"kmi"		,"1852.0"				, "International Nautical Mile"		},
-		{	"in"		,"0.0254"				, "International Inch"				},
-		{	"ft"		,"0.3048"				, "International Foot"				},
-		{	"yd"		,"0.9144"				, "International Yard"				},
-		{	"mi"		,"1609.344"				, "International Statute Mile"		},
-		{	"fath"		,"1.8288"				, "International Fathom"			},
-		{	"ch"		,"20.1168"				, "International Chain"				},
-		{	"link"		,"0.201168"				, "International Link"				},
-		{	"us-in"		,"1./39.37"				, "U.S. Surveyor's Inch"			},
-		{	"us-ft"		,"0.304800609601219"	, "U.S. Surveyor's Foot"			},
-		{	"us-yd"		,"0.914401828803658"	, "U.S. Surveyor's Yard"			},
-		{	"us-ch"		,"20.11684023368047"	, "U.S. Surveyor's Chain"			},
-		{	"us-mi"		,"1609.347218694437"	, "U.S. Surveyor's Statute Mile"	},
-		{	"ind-yd"	,"0.91439523"			, "Indian Yard"						},
-		{	"ind-ft"	,"0.30479841"			, "Indian Foot"						},
-		{	"ind-ch"	,"20.11669506"			, "Indian Chain"					}
-	};
-
 	//-----------------------------------------------------
-	if( _Proj4_Read_Parameter(Value, Proj4, "units") )
+	TSG_Projection_Unit	Unit	= _Proj4_Read_Parameter(Value, Proj4, "units") ? SG_Get_Projection_Unit(Value) : SG_PROJ_UNIT_Undefined;
+
+	if( Unit != SG_PROJ_UNIT_Undefined )
 	{
-		for(int i=0; i<21; i++)
-		{
-			if( !Value.CmpNoCase(unit[i][0]) )
-			{
-				Value.Printf(SG_T("UNIT[\"%s\",%s]"), SG_STR_MBTOSG(unit[i][2]), SG_STR_MBTOSG(unit[i][1]));
+		Value	= "UNIT[\"" + SG_Get_Projection_Unit_Name(Unit) + "\"," + SG_Get_String(SG_Get_Projection_Unit_To_Meter(Unit), -16) + "]";
 
-				return( true );
-			}
-		}
+		return( true );
 	}
 
 	//-----------------------------------------------------
diff --git a/src/saga_core/saga_api/saga_api.h b/src/saga_core/saga_api/saga_api.h
index 5a7e390..cabbc7b 100644
--- a/src/saga_core/saga_api/saga_api.h
+++ b/src/saga_core/saga_api/saga_api.h
@@ -136,7 +136,7 @@ SAGA_API_DLL_EXPORT const SG_Char *	SAGA_API_Get_Version(void);
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#define SAGA_VERSION			SG_T("2.1.1")
+#define SAGA_VERSION			SG_T("2.1.2")
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes.h b/src/saga_core/saga_api/shapes.h
index cecb286..0b9ecc1 100644
--- a/src/saga_core/saga_api/shapes.h
+++ b/src/saga_core/saga_api/shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: shapes.h 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
@@ -821,7 +821,7 @@ public:
 
 	virtual bool			has_Statistics	(void)	const	{	return( true );	}
 
-	int						Get_Count		(void)	{	return( s_z.Get_Count   () );	}
+	sLong					Get_Count		(void)	{	return( s_z.Get_Count   () );	}
 	double					Get_Value		(int i)	{	return( s_z.Get_Value  (i) );	}
 	double					Get_Minimum		(void)	{	return( s_z.Get_Minimum () );	}
 	double					Get_Maximum		(void)	{	return( s_z.Get_Maximum () );	}
diff --git a/src/saga_core/saga_api/shapes_polygons.cpp b/src/saga_core/saga_api/shapes_polygons.cpp
index cd59118..87f0990 100644
--- a/src/saga_core/saga_api/shapes_polygons.cpp
+++ b/src/saga_core/saga_api/shapes_polygons.cpp
@@ -471,15 +471,19 @@ bool	SG_Polygon_Offset		(CSG_Shape *pPolygon, double dSize, double dArc, CSG_Sha
 
 	if(	Converter.Convert(pPolygon, Paths) )
 	{
+		ClipperLib::ClipperOffset	Offset(2.0, dArc * Converter.Get_xScale());
+
 		if( pPolygon->Get_Type() == SHAPE_TYPE_Polygon )
 		{
-			ClipperLib::OffsetPaths(Paths, Result, dSize * Converter.Get_xScale(), ClipperLib::jtRound, ClipperLib::etClosed, dArc);
+			Offset.AddPaths(Paths, ClipperLib::jtRound, ClipperLib::etClosedPolygon);
 		}
 		else
 		{
-			ClipperLib::OffsetPaths(Paths, Result, dSize * Converter.Get_xScale(), ClipperLib::jtRound, ClipperLib::etRound , dArc);
+			Offset.AddPaths(Paths, ClipperLib::jtRound, ClipperLib::etOpenRound);
 		}
 
+		Offset.Execute(Result, dSize * Converter.Get_xScale());
+
 		return( Converter.Convert(Result, pResult ? pResult : pPolygon) );
 	}
 
diff --git a/src/saga_core/saga_api/table.h b/src/saga_core/saga_api/table.h
index 5b0ec45..400a5b2 100644
--- a/src/saga_core/saga_api/table.h
+++ b/src/saga_core/saga_api/table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: table.h 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -156,7 +156,8 @@ public:
 	short						asShort			(const CSG_String &Field)	const	{	return( (short  )asInt   ( Field) );	}
 	int							asInt			(int              iField)	const;
 	int							asInt			(const CSG_String &Field)	const;
-
+	sLong						asLong			(int              iField)	const	{	return( (sLong  )asDouble(iField) );	}
+	sLong						asLong			(const CSG_String &Field)	const	{	return( (sLong  )asDouble( Field) );	}
 	float						asFloat			(int              iField)	const	{	return( (float  )asDouble(iField) );	}
 	float						asFloat			(const CSG_String &Field)	const	{	return( (float  )asDouble( Field) );	}
 	double						asDouble		(int              iField)	const;
diff --git a/src/saga_core/saga_api/table_record.cpp b/src/saga_core/saga_api/table_record.cpp
index de30bbe..9aa4246 100644
--- a/src/saga_core/saga_api/table_record.cpp
+++ b/src/saga_core/saga_api/table_record.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_record.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: table_record.cpp 2054 2014-03-18 09:49:22Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -242,14 +242,17 @@ void CSG_Table_Record::Set_Modified(bool bOn)
 		if( bOn )
 		{
 			m_Flags	|=  SG_TABLE_REC_FLAG_Modified;
-
-			m_pTable->Set_Modified();
 		}
 		else
 		{
 			m_Flags	&= ~SG_TABLE_REC_FLAG_Modified;
 		}
 	}
+
+	if( bOn )
+	{
+		m_pTable->Set_Modified();
+	}
 }
 
 
@@ -520,6 +523,8 @@ bool CSG_Table_Record::Assign(CSG_Table_Record *pRecord)
 			*(m_Values[iField])	= *(pRecord->m_Values[iField]);
 		}
 
+		Set_Modified();
+
 		return( true );
 	}
 
diff --git a/src/saga_core/saga_cmd/Makefile.am b/src/saga_core/saga_cmd/Makefile.am
index 7c6faed..72323cb 100644
--- a/src/saga_core/saga_cmd/Makefile.am
+++ b/src/saga_core/saga_cmd/Makefile.am
@@ -1,12 +1,13 @@
 #
-# $Id: Makefile.am 1285 2012-01-03 10:59:55Z manfred-e $
+# $Id: Makefile.am 2048 2014-03-06 13:45:59Z manfred-e $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
 endif
 
 MLIBPATH = "MODULE_LIBRARY_PATH=\"$(libdir)/saga\""
-BASEFLAGS = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD $(DBGFLAGS) -I.. -D$(MLIBPATH)
+MSHAREPATH = "SHARE_PATH=\"$(prefix)/share/saga\""
+BASEFLAGS = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD $(DBGFLAGS) -I.. -D$(MLIBPATH) -D$(MSHAREPATH) 
 if SAGA_UNICODE
 AM_CXXFLAGS = -fPIC `wx-config --unicode=yes --cxxflags` $(BASEFLAGS) -D_SAGA_UNICODE $(GOMPFLAGS)
 AM_LDFLAGS = -fPIC `wx-config --unicode=yes --libs` -lm
diff --git a/src/saga_core/saga_cmd/Makefile.in b/src/saga_core/saga_cmd/Makefile.in
index f5beaba..ee0b10d 100644
--- a/src/saga_core/saga_cmd/Makefile.in
+++ b/src/saga_core/saga_cmd/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -36,7 +52,8 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = saga_cmd$(EXEEXT)
 subdir = src/saga_core/saga_cmd
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -89,6 +106,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -145,6 +167,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -172,6 +195,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -184,6 +208,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -213,6 +238,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -246,7 +272,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -268,11 +293,12 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1285 2012-01-03 10:59:55Z manfred-e $
+# $Id: Makefile.am 2048 2014-03-06 13:45:59Z manfred-e $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 MLIBPATH = "MODULE_LIBRARY_PATH=\"$(libdir)/saga\""
-BASEFLAGS = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD $(DBGFLAGS) -I.. -D$(MLIBPATH)
+MSHAREPATH = "SHARE_PATH=\"$(prefix)/share/saga\""
+BASEFLAGS = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD $(DBGFLAGS) -I.. -D$(MLIBPATH) -D$(MSHAREPATH) 
 @SAGA_UNICODE_FALSE at AM_CXXFLAGS = -fPIC `wx-config --unicode=no --cxxflags` $(BASEFLAGS) $(GOMPFLAGS)
 @SAGA_UNICODE_TRUE at AM_CXXFLAGS = -fPIC `wx-config --unicode=yes --cxxflags` $(BASEFLAGS) -D_SAGA_UNICODE $(GOMPFLAGS)
 @SAGA_UNICODE_FALSE at AM_LDFLAGS = -fPIC `wx-config --unicode=no --libs` -lm
@@ -322,8 +348,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p || test -f $$p1; \
@@ -363,7 +392,7 @@ clean-binPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-saga_cmd$(EXEEXT): $(saga_cmd_OBJECTS) $(saga_cmd_DEPENDENCIES) 
+saga_cmd$(EXEEXT): $(saga_cmd_OBJECTS) $(saga_cmd_DEPENDENCIES) $(EXTRA_saga_cmd_DEPENDENCIES) 
 	@rm -f saga_cmd$(EXEEXT)
 	$(CXXLINK) $(saga_cmd_OBJECTS) $(saga_cmd_LDADD) $(LIBS)
 
@@ -405,11 +434,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -473,6 +502,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -536,6 +569,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -571,13 +618,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -615,10 +659,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -700,24 +749,25 @@ ps-am:
 
 uninstall-am: uninstall-binPROGRAMS
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-libtool ctags ctags-recursive distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-binPROGRAMS install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am \
-	uninstall-binPROGRAMS
+	clean-generic clean-libtool cscopelist cscopelist-recursive \
+	ctags ctags-recursive distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-binPROGRAMS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/saga_core/saga_cmd/man/Makefile.in b/src/saga_core/saga_cmd/man/Makefile.in
index e999ee6..ccbe2e2 100644
--- a/src/saga_core/saga_cmd/man/Makefile.in
+++ b/src/saga_core/saga_cmd/man/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -53,6 +69,11 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -74,6 +95,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -101,6 +128,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -128,6 +156,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -140,6 +169,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -169,6 +199,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -202,7 +233,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -264,11 +294,18 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-man1: $(dist_man_MANS)
 	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
-	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
+	@list1=''; \
+	list2='$(dist_man_MANS)'; \
+	test -n "$(man1dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.1[a-z]*$$/p'; \
+	fi; \
 	} | while read p; do \
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; echo "$$p"; \
@@ -297,15 +334,15 @@ uninstall-man1:
 	  sed -n '/\.1[a-z]*$$/p'; \
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
 	@list='$(MANS)'; if test -n "$$list"; then \
@@ -314,10 +351,10 @@ distdir: $(DISTFILES)
 	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
 	  if test -n "$$list" && \
 	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
 	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
 	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    echo "       typically 'make maintainer-clean' will remove them" >&2; \
 	    exit 1; \
 	  else :; fi; \
 	else :; fi
@@ -367,10 +404,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/saga_core/saga_cmd/module_library.cpp b/src/saga_core/saga_cmd/module_library.cpp
index 9a49d6f..a7f7646 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module_library.cpp 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -136,7 +136,7 @@ void CCMD_Module::Destroy(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CCMD_Module::Execute(int argc, char *argv[])
+bool CCMD_Module::Execute(CSG_String sLibName, int argc, char *argv[])
 {
 	int		i;
 
@@ -148,7 +148,9 @@ bool CCMD_Module::Execute(int argc, char *argv[])
 
 	if( argc <= 1 )
 	{
-		SG_PRINTF(m_CMD.GetUsageString());
+		wxString sUsage = m_CMD.GetUsageString();
+		sUsage = wxString::Format(SG_T("Usage: saga_cmd %s %d %s"), sLibName.c_str(), m_pModule->Get_ID(), sUsage.AfterFirst(' ').AfterFirst(' '));
+		SG_PRINTF(sUsage);
 
 		return( false );
 	}
@@ -183,7 +185,9 @@ bool CCMD_Module::Execute(int argc, char *argv[])
 	{
 		CMD_Print("");
 
-		SG_PRINTF(m_CMD.GetUsageString());
+		wxString sUsage = m_CMD.GetUsageString();
+		sUsage = wxString::Format(SG_T("Usage: saga_cmd %s %d %s"), sLibName.c_str(), m_pModule->Get_ID(), sUsage.AfterFirst(' ').AfterFirst(' '));
+		SG_PRINTF(sUsage);
 	}
 
 	//-----------------------------------------------------
@@ -212,7 +216,7 @@ bool CCMD_Module::Execute(int argc, char *argv[])
 	}
 	else
 	{
-		CMD_Print_Error(_TL("executing module"), m_pModule->Get_Name());
+		CMD_Print_Error(_TL("executing tool"), m_pModule->Get_Name());
 	}
 
 	return( bResult );
diff --git a/src/saga_core/saga_cmd/module_library.h b/src/saga_core/saga_cmd/module_library.h
index 35fb1e0..2898afa 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: module_library.h 1966 2014-02-04 16:48:38Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -94,7 +94,7 @@ public:
 	bool						Create					(CSG_Module *pModule);
 	void						Destroy					(void);
 
-	bool						Execute					(int argc, char *argv[]);
+	bool						Execute					(CSG_String sLibName, int argc, char *argv[]);
 
 	bool						Get_Parameters			(CSG_Parameters *pParameters)	{	return( _Get_Parameters(pParameters) );	}
 
diff --git a/src/saga_core/saga_cmd/saga_cmd.cpp b/src/saga_core/saga_cmd/saga_cmd.cpp
index dd7b76b..d3f83e6 100644
--- a/src/saga_core/saga_cmd/saga_cmd.cpp
+++ b/src/saga_core/saga_cmd/saga_cmd.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_cmd.cpp 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id: saga_cmd.cpp 2111 2014-05-07 09:58:48Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -110,21 +110,21 @@ void		Create_Docs		(void);
 //---------------------------------------------------------
 int		main	(int argc, char *argv[])
 {
-#if wxCHECK_VERSION(2, 8, 11)
-	if( !wxInitialize(argc, argv) )
-#else
 	if( !wxInitialize() )
-#endif
 	{
 		CMD_Print_Error(SG_T("initialisation failed"));
 
 		return( 1 );
 	}
 
+#if !defined(_DEBUG)
+	wxSetAssertHandler(NULL);		// disable all wx asserts in SAGA release builds
+#endif
+
 //---------------------------------------------------------
 #if !defined(_DEBUG) && defined(_SAGA_VC)
 #define _MODULE_EXCEPTION
-_try 
+_try
 {
 #endif
 //---------------------------------------------------------
@@ -165,7 +165,7 @@ _except(1)
 bool		Run(int argc, char *argv[])
 {
 	setlocale(LC_NUMERIC, "C");
-	
+
 	SG_Set_UI_Callback(CMD_Get_Callback());
 
 	//-----------------------------------------------------
@@ -241,15 +241,15 @@ bool		Execute(int argc, char *argv[])
 	}
 
 	if( argc == 3 && CMD_Get_XML() )
-	{	// Just output module synopsis as XML-tagged text, then return.
+	{	// Just output tool synopsis as XML-tagged text, then return.
 		SG_PRINTF(pModule->Get_Summary(true, "", "", true).c_str());
 
 		return( true );
 	}
 
-	if( pModule->is_Interactive() )
+	if( pModule->needs_GUI() )
 	{
-		CMD_Print_Error(_TL("cannot execute interactive module"), pModule->Get_Name());
+		CMD_Print_Error(_TL("tool needs graphical user interface"), pModule->Get_Name());
 
 		return( false );
 	}
@@ -259,7 +259,7 @@ bool		Execute(int argc, char *argv[])
 
 	CCMD_Module	CMD_Module(pModule);
 
-	return( CMD_Module.Execute(argc - 2, argv + 2) );
+	return( CMD_Module.Execute(pLibrary->Get_Library_Name(), argc - 2, argv + 2) );
 }
 
 
@@ -427,7 +427,7 @@ bool		Load_Libraries(void)
 
 	if( SG_Get_Module_Library_Manager().Get_Count() <= 0 )
 	{
-		CMD_Print_Error(SG_T("could not load any module library"));
+		CMD_Print_Error(SG_T("could not load any tool library"));
 
 		return( false );
 	}
@@ -498,8 +498,19 @@ bool		Check_Flags		(const CSG_String &Argument)
 
 		if( s.Find('p') >= 0 )	// p: load projections dictionary
 		{
-			SG_Get_Projections().Create(SG_File_Make_Path(SG_File_Get_Path(SG_UI_Get_Application_Path()),
-				SG_T("saga_prj"), SG_T("srs")));
+#if defined(_SAGA_LINUX)
+		SG_Get_Projections().Create(SG_File_Make_Path(SG_File_Get_Path( CSG_String(SHARE_PATH)),
+			SG_T("saga_prj"), SG_T("srs")));
+#endif
+#if defined(_SAGA_MSW)
+		SG_Get_Projections().Create(SG_File_Make_Path(SG_File_Get_Path(SG_UI_Get_Application_Path()),
+			SG_T("saga_prj"), SG_T("srs")));
+#endif
+		}
+
+		if( s.Find('o') >= 0 )	// o: load old style naming, has no effect if l-flag is set.
+		{
+			SG_Set_OldStyle_Naming();
 		}
 
 		return( true );
@@ -554,7 +565,7 @@ void		Print_Libraries	(void)
 //---------------------------------------------------------
 void		Print_Modules	(CSG_Module_Library *pLibrary)
 {
-	CMD_Print_Error(_TL("module"));
+	CMD_Print_Error(_TL("tool"));
 
 	if( CMD_Get_Show_Messages() )
 	{
@@ -589,7 +600,7 @@ void		Print_Execution	(CSG_Module_Library *pLibrary, CSG_Module *pModule)
 			SG_PRINTF(SG_T("_____________________________________________\n"));
 			SG_PRINTF(SG_T("%s:\t%s\n"), _TL("library path"), pLibrary->Get_File_Name().c_str());
 			SG_PRINTF(SG_T("%s:\t%s\n"), _TL("library name"), pLibrary->Get_Name     ().c_str());
-			SG_PRINTF(SG_T("%s:\t%s\n"), _TL("module name "), pModule ->Get_Name     ().c_str());
+			SG_PRINTF(SG_T("%s:\t%s\n"), _TL("tool name   "), pModule ->Get_Name     ().c_str());
 			SG_PRINTF(SG_T("%s:\t%s\n"), _TL("author      "), pModule ->Get_Author   ().c_str());
 			SG_PRINTF(SG_T("_____________________________________________\n\n"));
 		}
@@ -640,7 +651,7 @@ void		Print_Get_Help	(void)
 	{
 		CMD_Print(_TL("type -h or --help for further information"));
 		CMD_Print("");
-	} 
+	}
 }
 
 //---------------------------------------------------------
@@ -661,21 +672,21 @@ void		Print_Help		(void)
 		"saga_cmd [-b, --batch]\n"
 		"saga_cmd [-d, --docs]\n"
 #ifdef _OPENMP
-		"saga_cmd [-f, --flags][=qrsilpx][-c, --cores][=#] <LIBRARY> <MODULE> <OPTIONS>\n"
-		"saga_cmd [-f, --flags][=qrsilpx][-c, --cores][=#] <SCRIPT>\n"
+		"saga_cmd [-f, --flags][=qrsilpxo][-c, --cores][=#] <LIBRARY> <MODULE> <OPTIONS>\n"
+		"saga_cmd [-f, --flags][=qrsilpxo][-c, --cores][=#] <SCRIPT>\n"
 #else
-		"saga_cmd [-f, --flags][=qrsilpx] <LIBRARY> <MODULE> <module specific options...>\n"
-		"saga_cmd [-f, --flags][=qrsilpx] <SCRIPT>\n"
+		"saga_cmd [-f, --flags][=qrsilpxo] <LIBRARY> <MODULE> <module specific options...>\n"
+		"saga_cmd [-f, --flags][=qrsilpxo] <SCRIPT>\n"
 #endif
 		"\n"
 		"[-h], [--help]   : help on usage\n"
 		"[-v], [--version]: print version information\n"
 		"[-b], [--batch]  : create a batch file example\n"
-		"[-d], [--docs]   : create module documentation in current working directory\n"
+		"[-d], [--docs]   : create tool documentation in current working directory\n"
 #ifdef _OPENMP
 		"[-c], [--cores]  : number of physical processors to use for computation\n"
 #endif
-		"[-f], [--flags]  : various flags for general usage [qrsilpx]\n"
+		"[-f], [--flags]  : various flags for general usage [qrsilpxo]\n"
 		"  q              : no progress report\n"
 		"  r              : no messages report\n"
 		"  s              : silent mode (no progress and no messages report)\n"
@@ -683,11 +694,12 @@ void		Print_Help		(void)
 		"  l              : load translation dictionary\n"
 		"  p              : load projections dictionary\n"
 		"  x              : use XML markups for synopses and messages\n"
+		"  o              : load old style naming\n"
 		"\n"
 		"<LIBRARY>        : name of the library\n"
-		"<MODULE>         : either name or index of the module\n"
-		"<OPTIONS>        : module specific options\n"
-		"<SCRIPT>         : saga cmd script file with one or more module calls\n"
+		"<MODULE>         : either name or index of the tool\n"
+		"<OPTIONS>        : tool specific options\n"
+		"<SCRIPT>         : saga cmd script file with one or more tool calls\n"
 		"\n"
 		"_____________________________________________\n"
 		"Example:\n"
@@ -695,13 +707,13 @@ void		Print_Help		(void)
 		"  saga_cmd -f=s ta_lighting 0 -ELEVATION=c:\\dem.sgrd -SHADE=c:\\shade.sgrd\n"
 		"\n"
 		"_____________________________________________\n"
-		"Module libraries in the \'modules\' subdirectory of the SAGA installation\n"
+		"Tool libraries in the \'modules\' subdirectory of the SAGA installation\n"
 		"will be loaded automatically. Additional directories can be specified\n"
 		"by adding the environment variable \'SAGA_MLB\' and let it point to one\n"
 		"or more directories, just the way it is done with the DOS \'PATH\' variable.\n"
 		"\n"
 		"The SAGA command line interpreter is particularly useful for the processing\n"
-		"of complex work flows by defining a series of subsequent module calls in a\n"
+		"of complex work flows by defining a series of subsequent tool calls in a\n"
 		"script file. Calling saga_cmd with the option \'-b\' or \'--batch\' will\n"
 		"create an example of a DOS batch script file, which might be a good starting\n"
 		"point for the implementation of your own specific work flows.\n"
@@ -823,7 +835,7 @@ void		Create_Docs		(void)
 
 	if( Load_Libraries() )
 	{
-		CMD_Print(_TL("creating module documentation files"));
+		CMD_Print(_TL("creating tool documentation files"));
 
 		CMD_Set_Show_Messages(false);
 
diff --git a/src/saga_core/saga_gdi/3d_view.h b/src/saga_core/saga_gdi/3d_view.h
new file mode 100644
index 0000000..65786ee
--- /dev/null
+++ b/src/saga_core/saga_gdi/3d_view.h
@@ -0,0 +1,260 @@
+/**********************************************************
+ * Version $Id: 3d_view_panel.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    3d_view_panel.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__3d_view_panel_H
+#define HEADER_INCLUDED__3d_view_panel_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/panel.h>
+#include <wx/image.h>
+#include <wx/menu.h>
+
+#include "saga_gdi.h"
+
+#include "3d_view_tools.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	SG_3DVIEW_PLAY_STOP	= 0,
+	SG_3DVIEW_PLAY_RUN_ONCE,
+	SG_3DVIEW_PLAY_RUN_LOOP,
+	SG_3DVIEW_PLAY_RUN_SAVE
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SGDI_API_DLL_EXPORT CSG_3DView_Panel : public wxPanel, public CSG_3DView_Canvas
+{
+public:
+	CSG_3DView_Panel(wxWindow *pParent, CSG_Grid *pDrape = NULL);
+
+	CSG_Parameters				m_Parameters;
+
+
+	virtual bool				Update_View				(bool bStatistics = false);
+
+	void						Play_Pos_Add			(void);
+	void						Play_Pos_Del			(void);
+	void						Play_Pos_Clr			(void);
+	CSG_Table &					Play_Pos_Table			(void)	{	return( *m_pPlay );	}
+
+	void						Play_Once				(void);
+	void						Play_Loop				(void);
+	void						Play_Save				(void);
+	void						Play_Stop				(void);
+	int							Play_Get_State			(void)	{	return( m_Play_State );	}
+
+
+protected:
+
+	int							m_Play_State;
+
+	TSG_Point					m_Down_Value;
+
+	CSG_Table					*m_pPlay;
+
+	wxPoint						m_Down_Screen;
+
+	wxImage						m_Image;
+
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual void				Update_Statistics		(void);
+	virtual void				Update_Parent			(void);
+
+	virtual void				On_Size					(wxSizeEvent  &event);
+	virtual void				On_Paint				(wxPaintEvent &event);
+	virtual void				On_Key_Down				(wxKeyEvent   &event);
+	virtual void				On_Mouse_LDown			(wxMouseEvent &event);
+	virtual void				On_Mouse_LUp			(wxMouseEvent &event);
+	virtual void				On_Mouse_RDown			(wxMouseEvent &event);
+	virtual void				On_Mouse_RUp			(wxMouseEvent &event);
+	virtual void				On_Mouse_MDown			(wxMouseEvent &event);
+	virtual void				On_Mouse_MUp			(wxMouseEvent &event);
+	virtual void				On_Mouse_Motion			(wxMouseEvent &event);
+	virtual void				On_Mouse_Wheel			(wxMouseEvent &event);
+
+	virtual bool				On_Before_Draw			(void)	{	return( true );	}
+	virtual bool				On_Draw					(void)	= 0;
+
+
+private:
+
+	static int					_On_Parameter_Changed	(CSG_Parameter *pParameter, int Flags);
+
+	bool						_Play					(void);
+
+
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	MENU_USER_FIRST	= 0,
+	MENU_USER_LAST	= 100
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define MENU_TOGGLE(id)			m_pPanel->m_Parameters(id)->Set_Value(m_pPanel->m_Parameters(id)->asBool() ? 0 : 1); Update_Controls(); m_pPanel->Update_View(true);
+#define MENU_VALUE_ADD(id, add)	m_pPanel->m_Parameters(id)->Set_Value(m_pPanel->m_Parameters(id)->asDouble() + add); Update_Controls(); m_pPanel->Update_View();
+
+//---------------------------------------------------------
+#define CHECKBOX_UPDATE(pControl, id)		if( event.GetEventObject() == pControl )\
+	{\
+		m_pPanel->m_Parameters(id)->Set_Value(pControl->GetValue() == 1 ? true : false);\
+		m_pPanel->Update_View();\
+		return;\
+	}\
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SGDI_API_DLL_EXPORT CSG_3DView_Dialog : public CSGDI_Dialog
+{
+public:
+	CSG_3DView_Dialog(const CSG_String &Caption);
+
+	virtual void				Update_Controls			(void);
+
+
+protected:
+
+	wxButton					*m_pCommands;
+
+	CSGDI_Slider				*m_pRotate_X, *m_pRotate_Z, *m_pCentral;
+
+	CSG_3DView_Panel			*m_pPanel;
+
+
+	bool						Create					(CSG_3DView_Panel *pPanel);
+
+	virtual void				On_Update_Control		(wxCommandEvent &event);
+	virtual void				On_Update_Choices		(wxCommandEvent &event);
+	virtual void				On_Button				(wxCommandEvent &event);
+
+	virtual void				Set_Menu				(wxMenu &Menu)	{}
+	virtual void				On_Menu					(wxCommandEvent &event);
+	virtual void				On_Menu_UI				(wxUpdateUIEvent &event);
+
+
+private:
+
+	DECLARE_EVENT_TABLE()
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_view_panel_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gdi/3d_view_canvas.cpp b/src/saga_core/saga_gdi/3d_view_canvas.cpp
new file mode 100644
index 0000000..13105fd
--- /dev/null
+++ b/src/saga_core/saga_gdi/3d_view_canvas.cpp
@@ -0,0 +1,702 @@
+/**********************************************************
+ * Version $Id: 3d_view_canvas.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   3d_view_canvas.cpp                  //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "3d_view_tools.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	COLOR_MODE_RGB,
+	COLOR_MODE_RED,
+	COLOR_MODE_GREEN,
+	COLOR_MODE_BLUE,
+	COLOR_MODE_CYAN
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_3DView_Canvas::CSG_3DView_Canvas(void)
+{
+	m_pDrape		= NULL;
+	m_Image_pRGB	= NULL;
+
+	m_bgColor		= SG_COLOR_WHITE;
+	m_bBox			= true;
+	m_bStereo		= false;
+	m_dStereo		= 2.0;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::Set_Image(BYTE *pRGB, int NX, int NY)
+{
+	m_Image_pRGB	= pRGB;
+
+	m_Image_NX		= NX;
+	m_Image_NY		= NY;
+
+	m_Image_zMax.Create(m_Image_NX, m_Image_NY);
+
+	m_Projector.Set_Screen(m_Image_NX, m_Image_NY);
+}
+
+//---------------------------------------------------------
+bool CSG_3DView_Canvas::Draw(void)
+{
+	if( !m_Image_pRGB || m_Image_NX < 1 || m_Image_NY < 1 )
+	{
+		return( false );
+	}
+
+	_Draw_Background();
+
+	//-------------------------------------------------
+	if( m_Data_Min.x >= m_Data_Max.x
+	||  m_Data_Min.y >= m_Data_Max.y
+	||  m_Data_Min.z >  m_Data_Max.z )
+	{
+		return( false );
+	}
+
+	//-------------------------------------------------
+	if( !On_Before_Draw() )
+	{
+		return( false );
+	}
+
+	//-------------------------------------------------
+	m_Projector.Set_Center(
+		m_Data_Min.x + 0.5 * (m_Data_Max.x - m_Data_Min.x),
+		m_Data_Min.y + 0.5 * (m_Data_Max.y - m_Data_Min.y),
+		m_Data_Min.z + 0.5 * (m_Data_Max.z - m_Data_Min.z)
+	);
+
+	m_Projector.Set_Scale(
+		 (m_Image_NX / (double)m_Image_NY) > ((m_Data_Max.x - m_Data_Min.x) / (m_Data_Max.y - m_Data_Min.y))
+		? m_Image_NX / (m_Data_Max.x - m_Data_Min.x)
+		: m_Image_NY / (m_Data_Max.y - m_Data_Min.y)
+	);
+
+	//-------------------------------------------------
+	if( m_bStereo == false )
+	{
+		m_Image_zMax.Assign(999999.0);
+
+		m_Color_Mode	= COLOR_MODE_RGB;
+
+		On_Draw();
+
+		_Draw_Box();
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		double	dRotate	= M_DEG_TO_RAD * 0.5 * m_dStereo;
+		double	yRotate	= m_Projector.Get_yRotation();
+		double	dShift	= -0.01 * m_Image_NX;
+		double	xShift	= m_Projector.Get_xShift();
+
+		//-------------------------------------------------
+		m_Image_zMax.Assign(999999.0);
+
+		m_Projector.Set_xShift   (xShift  - dShift );
+		m_Projector.Set_yRotation(yRotate - dRotate);
+
+		m_Color_Mode	= COLOR_MODE_RED;
+
+		On_Draw();
+
+		_Draw_Box();
+
+		//-------------------------------------------------
+		m_Image_zMax.Assign(999999.0);
+
+		m_Projector.Set_xShift   (xShift  + dShift );
+		m_Projector.Set_yRotation(yRotate + dRotate);
+
+		m_Color_Mode	= COLOR_MODE_CYAN;
+
+		On_Draw();
+
+		_Draw_Box();
+
+		//-------------------------------------------------
+		m_Projector.Set_xShift   (xShift );
+		m_Projector.Set_yRotation(yRotate);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::_Draw_Background(void)
+{
+	BYTE	r, g, b;
+
+	if( m_bStereo )	// greyscale
+	{
+		r	= g	= b	= (int)((SG_GET_R(m_bgColor) + SG_GET_G(m_bgColor) + SG_GET_B(m_bgColor)) / 3.0);
+	}
+	else
+	{
+		r	= SG_GET_R(m_bgColor);
+		g	= SG_GET_G(m_bgColor);
+		b	= SG_GET_B(m_bgColor);
+	}
+
+	#pragma omp parallel for
+	for(int y=0; y<m_Image_NY; y++)
+	{
+		BYTE	*pRGB	= m_Image_pRGB + y * 3 * m_Image_NX;
+
+		for(int x=0; x<m_Image_NX; x++)
+		{
+			*pRGB	= r;	pRGB++;
+			*pRGB	= g;	pRGB++;
+			*pRGB	= b;	pRGB++;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::_Draw_Box(void)
+{
+	if( !m_bBox )
+	{
+		return;
+	}
+
+	int	color	= SG_GET_RGB(SG_GET_R(m_bgColor) + 128, SG_GET_G(m_bgColor) + 128, SG_GET_B(m_bgColor) + 128);
+
+	TSG_Point_Z	p[2][4], Buffer;
+
+	Buffer.x	= 0.01 * (m_Data_Max.x - m_Data_Min.x);
+	Buffer.y	= 0.01 * (m_Data_Max.y - m_Data_Min.y);
+	Buffer.z	= 0.01 * (m_Data_Max.z - m_Data_Min.z);
+
+	for(int i=0; i<2; i++)
+	{
+		p[i][0].x	= m_Data_Min.x - Buffer.x;	p[i][0].y	= m_Data_Min.y - Buffer.y;
+		p[i][1].x	= m_Data_Max.x + Buffer.x;	p[i][1].y	= m_Data_Min.y - Buffer.y;
+		p[i][2].x	= m_Data_Max.x + Buffer.x;	p[i][2].y	= m_Data_Max.y + Buffer.y;
+		p[i][3].x	= m_Data_Min.x - Buffer.x;	p[i][3].y	= m_Data_Max.y + Buffer.y;
+		p[i][0].z	= p[i][1].z = p[i][2].z = p[i][3].z = i == 0
+			? m_Data_Min.z - Buffer.z
+			: m_Data_Max.z + Buffer.z;
+
+		for(int j=0; j<4; j++)
+		{
+			m_Projector.Get_Projection(p[i][j]);
+		}
+
+		Draw_Line(p[i][0], p[i][1], color);
+		Draw_Line(p[i][1], p[i][2], color);
+		Draw_Line(p[i][2], p[i][3], color);
+		Draw_Line(p[i][3], p[i][0], color);
+	}
+
+	Draw_Line(p[0][0], p[1][0], color);
+	Draw_Line(p[0][1], p[1][1], color);
+	Draw_Line(p[0][2], p[1][2], color);
+	Draw_Line(p[0][3], p[1][3], color);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_3DView_Canvas::Get_Color(double Value)
+{
+	return( (int)Value );
+}
+
+//---------------------------------------------------------
+int CSG_3DView_Canvas::Dim_Color(int Color, double dim)
+{
+	if( dim <= 0.0 )
+	{
+		return( m_bgColor );
+	}
+
+	if( dim != 1.0 )
+	{
+		int	r	= SG_GET_R(m_bgColor) + (int)(dim * (SG_GET_R(Color) - SG_GET_R(m_bgColor))); if( r > 255 ) r = 255;
+		int	g	= SG_GET_G(m_bgColor) + (int)(dim * (SG_GET_G(Color) - SG_GET_G(m_bgColor))); if( g > 255 ) g = 255;
+		int	b	= SG_GET_B(m_bgColor) + (int)(dim * (SG_GET_B(Color) - SG_GET_B(m_bgColor))); if( b > 255 ) b = 255;
+
+		Color	= SG_GET_RGB(r, g, b);
+	}
+
+	return( Color );
+}
+
+//---------------------------------------------------------
+int CSG_3DView_Canvas::_Dim_Color(int Color, double dim)
+{
+	if( dim <= 0.0 )
+	{
+		return( 0 );
+	}
+
+	if( dim != 1.0 )
+	{
+		int	r	= (int)(dim * SG_GET_R(Color)); if( r > 255 ) r = 255;
+		int	g	= (int)(dim * SG_GET_G(Color)); if( g > 255 ) g = 255;
+		int	b	= (int)(dim * SG_GET_B(Color)); if( b > 255 ) b = 255;
+
+		Color	= SG_GET_RGB(r, g, b);
+	}
+
+	return( Color );
+}
+
+//---------------------------------------------------------
+inline void CSG_3DView_Canvas::_Draw_Pixel(int x, int y, double z, int color)
+{
+	if( x >= 0 && x < m_Image_NX && y >= 0 && y < m_Image_NY && z < m_Image_zMax[y][x] )
+	{
+		BYTE	*RGB	= m_Image_pRGB + 3 * (y * m_Image_NX + x);
+
+		switch( m_Color_Mode )
+		{
+		case COLOR_MODE_RGB:
+			RGB[0]	= SG_GET_R(color);
+			RGB[1]	= SG_GET_G(color);
+			RGB[2]	= SG_GET_B(color);
+			break;
+
+		case COLOR_MODE_RED:
+			RGB[0]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
+			break;
+
+		case COLOR_MODE_GREEN:
+			RGB[1]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
+			break;
+
+		case COLOR_MODE_BLUE:
+			RGB[2]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
+			break;
+
+		case COLOR_MODE_CYAN:
+			RGB[1]	= 
+			RGB[2]	= (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3;
+			break;
+		}
+
+		m_Image_zMax[y][x]	= z;
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::Draw_Point(int x, int y, double z, int color, int size)
+{
+	if( z > 0.0 )
+	{
+		_Draw_Pixel(x, y, z, color);
+
+		if( size > 0 && size < 50 )
+		{
+			for(int iy=1; iy<=size; iy++)
+			{
+				for(int ix=0; ix<=size; ix++)
+				{
+					if( ix*ix + iy*iy <= size*size )
+					{
+						_Draw_Pixel(x + ix, y + iy, z, color);
+						_Draw_Pixel(x + iy, y - ix, z, color);
+						_Draw_Pixel(x - ix, y - iy, z, color);
+						_Draw_Pixel(x - iy, y + ix, z, color);
+					}
+				}
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::Draw_Line(double ax, double ay, double az, double bx, double by, double bz, int aColor, int bColor)
+{
+	if(	(ax < 0 && bx < 0) || (ax >= m_Image_NX && bx >= m_Image_NX)
+	||	(ay < 0 && by < 0) || (ay >= m_Image_NY && by >= m_Image_NY) )
+	{
+		return;
+	}
+
+	double	dx	= bx - ax;
+	double	dy	= by - ay;
+	double	dz	= bz - az;
+
+	if( bz < 0.0 || az < 0.0 )
+	{
+		return;
+	}
+
+	double	n;
+
+	if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 )
+	{
+		n	 = fabs(dx);
+		dx	 = dx < 0 ? -1 : 1;
+		dy	/= n;
+		dz	/= n;
+	}
+	else if( fabs(dy) > 0.0 )
+	{
+		n	 = fabs(dy);
+		dx	/= n;
+		dy	 = dy < 0 ? -1 : 1;
+		dz	/= n;
+	}
+	else
+	{
+		_Draw_Pixel((int)ax, (int)ay, az, aColor);
+		_Draw_Pixel((int)bx, (int)by, bz, bColor);
+
+		return;
+	}
+
+	//-----------------------------------------------------
+	CSG_Colors	Colors(2); Colors[0] = aColor; Colors[1] = bColor;
+
+	//-----------------------------------------------------
+	for(double i=0.0; i<=n; i++, ax+=dx, ay+=dy, az+=dz)
+	{
+		_Draw_Pixel((int)ax, (int)ay, az, Colors.Get_Interpolated(i / n));
+	}
+}
+
+void CSG_3DView_Canvas::Draw_Line(const TSG_Point_Z &a, const TSG_Point_Z &b, int aColor, int bColor)
+{
+	Draw_Line(a.x, a.y, a.z, b.x, b.y, b.z, aColor, bColor);
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::Draw_Line(double ax, double ay, double az, double bx, double by, double bz, int Color)
+{
+	if(	(ax < 0 && bx < 0) || (ax >= m_Image_NX && bx >= m_Image_NX)
+	||	(ay < 0 && by < 0) || (ay >= m_Image_NY && by >= m_Image_NY) )
+	{
+		return;
+	}
+
+	double	dx	= bx - ax;
+	double	dy	= by - ay;
+	double	dz	= bz - az;
+
+	if( bz < 0.0 || az < 0.0 )
+	{
+		return;
+	}
+
+	double	n;
+
+	if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 )
+	{
+		n	 = fabs(dx);
+		dx	 = dx < 0 ? -1 : 1;
+		dy	/= n;
+		dz	/= n;
+	}
+	else if( fabs(dy) > 0.0 )
+	{
+		n	 = fabs(dy);
+		dx	/= n;
+		dy	 = dy < 0 ? -1 : 1;
+		dz	/= n;
+	}
+	else
+	{
+		_Draw_Pixel((int)ax, (int)ay, az, Color);
+
+		return;
+	}
+
+	//-----------------------------------------------------
+	for(double i=0.0; i<=n; i++, ax+=dx, ay+=dy, az+=dz)
+	{
+		_Draw_Pixel((int)ax, (int)ay, az, Color);
+	}
+}
+
+void CSG_3DView_Canvas::Draw_Line(const TSG_Point_Z &a, const TSG_Point_Z &b, int Color)
+{
+	Draw_Line(a.x, a.y, a.z, b.x, b.y, b.z, Color);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::Draw_Triangle(TSG_Triangle_Node p[3], double Light_Dec, double Light_Azi)
+{
+	double	A	= p[0].z * (p[1].x - p[2].x) + p[1].z * (p[2].x - p[0].x) + p[2].z * (p[0].x - p[1].x);
+	double	B	= p[0].y * (p[1].z - p[2].z) + p[1].y * (p[2].z - p[0].z) + p[2].y * (p[0].z - p[1].z);
+	double	C	= p[0].x * (p[1].y - p[2].y) + p[1].x * (p[2].y - p[0].y) + p[2].x * (p[0].y - p[1].y);
+
+	double	s, a;
+
+	if( C != 0.0 )
+	{
+		A	= - A / C;
+		B	= - B / C;
+
+		s	= M_PI_090 - atan(sqrt(A*A + B*B));
+		a	= A != 0.0 ? M_PI_180 + atan2(B, A) : B > 0.0 ? M_PI_270 : (B < 0.0 ? M_PI_090 : -1.0);
+	}
+	else
+	{
+		s	= 0.0;
+		a	= 0.0;
+	}
+
+	Draw_Triangle(p, (acos(sin(s) * sin(Light_Dec) + cos(s) * cos(Light_Dec) * cos(a - Light_Azi))) / M_PI_090);
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Canvas::Draw_Triangle(TSG_Triangle_Node p[3], double dim)
+{
+	if( p[0].z < 0.0 || p[1].z < 0.0 || p[2].z < 0.0 )
+	{
+		return;
+	}
+
+	//-----------------------------------------------------
+	if( p[1].y < p[0].y ) {	TSG_Triangle_Node pp = p[1]; p[1] = p[0]; p[0] = pp;	}
+	if( p[2].y < p[0].y ) {	TSG_Triangle_Node pp = p[2]; p[2] = p[0]; p[0] = pp;	}
+	if( p[2].y < p[1].y ) {	TSG_Triangle_Node pp = p[2]; p[2] = p[1]; p[1] = pp;	}
+
+	//-----------------------------------------------------
+	TSG_Rect	r;
+
+	r.yMin	= p[0].y;
+	r.yMax	= p[2].y;
+	r.xMin	= p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x);
+	r.xMax	= p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x);
+
+	if( r.yMin >= r.yMax || r.xMin >= r.xMax )
+	{
+		return;	// no area
+	}
+
+	if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_Image_NY && r.yMax >= m_Image_NY)
+	||	(r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_Image_NX && r.xMax >= m_Image_NX) )
+	{
+		return;	// completely outside grid
+	}
+
+	//-----------------------------------------------------
+	TSG_Triangle_Node	q[3];
+
+	if( (q[0].y	= p[2].y - p[0].y) > 0.0 )
+	{
+		q[0].x	= (p[2].x - p[0].x) / q[0].y;
+		q[0].z	= (p[2].z - p[0].z) / q[0].y;
+		q[0].c	= (p[2].c - p[0].c) / q[0].y;
+		q[0].d	= (p[2].d - p[0].d) / q[0].y;
+	}
+
+	if( (q[1].y	= p[1].y - p[0].y) > 0.0 )
+	{
+		q[1].x	= (p[1].x - p[0].x) / q[1].y;
+		q[1].z	= (p[1].z - p[0].z) / q[1].y;
+		q[1].c	= (p[1].c - p[0].c) / q[1].y;
+		q[1].d	= (p[1].d - p[0].d) / q[1].y;
+	}
+
+	if( (q[2].y	= p[2].y - p[1].y) > 0.0 )
+	{
+		q[2].x	= (p[2].x - p[1].x) / q[2].y;
+		q[2].z	= (p[2].z - p[1].z) / q[2].y;
+		q[2].c	= (p[2].c - p[1].c) / q[2].y;
+		q[2].d	= (p[2].d - p[1].d) / q[2].y;
+	}
+
+	//-----------------------------------------------------
+	int	ay	= (int)r.yMin;	if( ay < 0 )	ay	= 0;	if( ay < r.yMin )	ay++;
+	int	by	= (int)r.yMax;	if( by >= m_Image_NY )	by	= m_Image_NY - 1;
+
+	for(int y=ay; y<=by; y++)
+	{
+		if( y <= p[1].y && q[1].y > 0.0 )
+		{
+			_Draw_Triangle_Line(y,
+				p[0].x + (y - p[0].y) * q[0].x,
+				p[0].x + (y - p[0].y) * q[1].x,
+				p[0].z + (y - p[0].y) * q[0].z,
+				p[0].z + (y - p[0].y) * q[1].z,
+				p[0].c + (y - p[0].y) * q[0].c,
+				p[0].c + (y - p[0].y) * q[1].c,
+				p[0].d + (y - p[0].y) * q[0].d,
+				p[0].d + (y - p[0].y) * q[1].d,
+				dim
+			);
+		}
+		else if( q[2].y > 0.0 )
+		{
+			_Draw_Triangle_Line(y,
+				p[0].x + (y - p[0].y) * q[0].x,
+				p[1].x + (y - p[1].y) * q[2].x,
+				p[0].z + (y - p[0].y) * q[0].z,
+				p[1].z + (y - p[1].y) * q[2].z,
+				p[0].c + (y - p[0].y) * q[0].c,
+				p[1].c + (y - p[1].y) * q[2].c,
+				p[0].d + (y - p[0].y) * q[0].d,
+				p[1].d + (y - p[1].y) * q[2].d,
+				dim
+			);
+		}
+	}
+}
+
+//---------------------------------------------------------
+inline void CSG_3DView_Canvas::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double da, double db, double dim)
+{
+	if( xb < xa )
+	{
+		double	d;
+
+		d	= xa;	xa	= xb;	xb	= d;
+		d	= za;	za	= zb;	zb	= d;
+		d	= ca;	ca	= cb;	cb	= d;
+		d	= da;	da	= db;	db	= d;
+	}
+
+	if( xb > xa )
+	{
+		double	dz	= (zb - za) / (xb - xa);
+		double	dc	= (cb - ca) / (xb - xa);
+		double	dd	= (db - da) / (xb - xa);
+
+		int		ax	= (int)xa;	if( ax < 0 )	ax	= 0;	if( ax < xa )	ax++;
+		int		bx	= (int)xb;	if( bx >= m_Image_NX )	bx	= m_Image_NX - 1;
+
+		for(int x=ax; x<=bx; x++)
+		{
+			double	z	= za + dz * (x - xa);
+			double	c	= ca + dc * (x - xa);
+			double	d	= da + dd * (x - xa);
+
+			if( m_pDrape )
+			{
+				if( m_pDrape->Get_Value(c, d, c, m_Drape_Mode, false, true) )
+				{
+					_Draw_Pixel(x, y, z, _Dim_Color((int)(0.5 + c), dim));
+				}
+			}
+			else
+			{
+				_Draw_Pixel(x, y, z, _Dim_Color(Get_Color(c), dim));
+			}
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gdi/3d_view_dialog.cpp b/src/saga_core/saga_gdi/3d_view_dialog.cpp
new file mode 100644
index 0000000..94ce06f
--- /dev/null
+++ b/src/saga_core/saga_gdi/3d_view_dialog.cpp
@@ -0,0 +1,331 @@
+/**********************************************************
+ * Version $Id: 3d_view_dialog.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   3d_view_dialog.cpp                  //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/menu.h>
+
+#include "3d_view.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	MENU_FIRST		= MENU_USER_FIRST,
+	MENU_PROPERTIES	= MENU_USER_LAST,
+	MENU_CLOSE,
+	MENU_BOX,
+	MENU_STEREO,
+	MENU_CENTRAL,
+	MENU_ROTATE_X_INC,
+	MENU_ROTATE_X_DEC,
+	MENU_ROTATE_Y_INC,
+	MENU_ROTATE_Y_DEC,
+	MENU_ROTATE_Z_INC,
+	MENU_ROTATE_Z_DEC,
+	MENU_SHIFT_X_INC,
+	MENU_SHIFT_X_DEC,
+	MENU_SHIFT_Y_INC,
+	MENU_SHIFT_Y_DEC,
+	MENU_SHIFT_Z_INC,
+	MENU_SHIFT_Z_DEC,
+	MENU_PLAY_POS_ADD,
+	MENU_PLAY_POS_DEL,
+	MENU_PLAY_POS_CLR,
+	MENU_PLAY_RUN_ONCE,
+	MENU_PLAY_RUN_LOOP,
+	MENU_PLAY_RUN_SAVE,
+	MENU_LAST
+};
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(CSG_3DView_Dialog, CSGDI_Dialog)
+	EVT_BUTTON		(wxID_ANY	, CSG_3DView_Dialog::On_Button)
+	EVT_CHECKBOX	(wxID_ANY	, CSG_3DView_Dialog::On_Update_Control)
+	EVT_TEXT_ENTER	(wxID_ANY	, CSG_3DView_Dialog::On_Update_Control)
+	EVT_SLIDER		(wxID_ANY	, CSG_3DView_Dialog::On_Update_Control)
+	EVT_CHOICE		(wxID_ANY	, CSG_3DView_Dialog::On_Update_Choices)
+
+	EVT_MENU_RANGE		(MENU_FIRST, MENU_LAST, CSG_3DView_Dialog::On_Menu)
+	EVT_UPDATE_UI_RANGE	(MENU_FIRST, MENU_LAST, CSG_3DView_Dialog::On_Menu_UI)
+END_EVENT_TABLE()
+
+//---------------------------------------------------------
+CSG_3DView_Dialog::CSG_3DView_Dialog(const CSG_String &Caption)
+	: CSGDI_Dialog(Caption.c_str(), SGDI_DLG_STYLE_START_MAXIMISED)
+{
+	SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE);
+}
+
+//---------------------------------------------------------
+bool CSG_3DView_Dialog::Create(CSG_3DView_Panel *pPanel)
+{
+	m_pPanel		= pPanel;
+
+	m_pCommands		= Add_Button  (_TL("Commands"    ), wxID_ANY);
+
+//	Add_Spacer();
+//	m_pBox			= Add_CheckBox(_TL("Bounding Box"), m_pPanel->m_Parameters("DRAW_BOX"  )->asBool());
+//	m_pStereo		= Add_CheckBox(_TL("Anaglyph"    ), m_pPanel->m_Parameters("STEREO"    )->asBool());
+
+	Add_Spacer();
+	m_pRotate_X		= Add_Slider  (_TL("X-Rotation"  ), m_pPanel->Get_Projector().Get_xRotation() * M_RAD_TO_DEG, -180.0, 180.0);
+	m_pRotate_Z		= Add_Slider  (_TL("Z-Rotation"  ), m_pPanel->Get_Projector().Get_zRotation() * M_RAD_TO_DEG, -180.0, 180.0);
+	m_pCentral		= Add_Slider  (_TL("Eye Distance"), m_pPanel->Get_Projector().Get_Central_Distance(), 1.0, 2000.0);
+
+	Add_Output(m_pPanel);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Dialog::On_Update_Control(wxCommandEvent &event)
+{
+//	CHECKBOX_UPDATE(m_pBox   , "DRAW_BOX");
+//	CHECKBOX_UPDATE(m_pStereo, "STEREO"  );
+
+	if( event.GetEventObject() == m_pRotate_X )
+	{
+		m_pPanel->Get_Projector().Set_xRotation(m_pRotate_X->Get_Value() * M_DEG_TO_RAD);
+		m_pPanel->Update_View();
+	}
+
+	if( event.GetEventObject() == m_pRotate_Z )
+	{	
+		m_pPanel->Get_Projector().Set_zRotation(m_pRotate_Z->Get_Value() * M_DEG_TO_RAD);
+		m_pPanel->Update_View();
+	}
+
+	if( event.GetEventObject() == m_pCentral )
+	{	
+		m_pPanel->m_Parameters("CENTRAL_DIST")->Set_Value(m_pCentral->Get_Value());
+		m_pPanel->Update_View();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Dialog::On_Update_Choices(wxCommandEvent &event)
+{
+//	if( event.GetEventObject() == m_pField_Z )
+//	{
+//		m_pPanel->m_zField	= m_pField_Z->GetSelection();
+//		m_pPanel->Update_View();
+//	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Dialog::On_Button(wxCommandEvent &event)
+{
+	if( event.GetEventObject() == m_pCommands )
+	{
+		wxMenu	Menu, *pMenu;
+
+		//-------------------------------------------------
+		Menu.Append(MENU_PROPERTIES, _TL("Properties"));
+
+		Menu.AppendSeparator();
+
+		//-------------------------------------------------
+		Menu.AppendSubMenu(pMenu = new wxMenu, _TL("Display"));
+
+		pMenu->AppendCheckItem(MENU_BOX          , _TL("Bounding Box [B]"));
+		pMenu->AppendCheckItem(MENU_STEREO       , _TL("Anaglyph [S]"));
+		pMenu->AppendCheckItem(MENU_CENTRAL      , _TL("Central"));
+
+		//-------------------------------------------------
+		Menu.AppendSubMenu(pMenu = new wxMenu, _TL("Rotation"));
+
+		pMenu->Append         (MENU_ROTATE_X_DEC , _TL("Up [-]"));
+		pMenu->Append         (MENU_ROTATE_X_INC , _TL("Down [+]"));
+		pMenu->AppendSeparator();
+		pMenu->Append         (MENU_ROTATE_Z_DEC , _TL("Left [/]"));
+		pMenu->Append         (MENU_ROTATE_Z_INC , _TL("Right [*]"));
+		pMenu->AppendSeparator();
+		pMenu->Append         (MENU_ROTATE_Y_DEC , _TL("Roll Left [F4]"));
+		pMenu->Append         (MENU_ROTATE_Y_INC , _TL("Roll Right[F3]"));
+
+		//-------------------------------------------------
+		Menu.AppendSubMenu(pMenu = new wxMenu, _TL("Shift"));
+
+		pMenu->Append         (MENU_SHIFT_X_DEC  , _TL("Left [Ins]"));
+		pMenu->Append         (MENU_SHIFT_X_INC  , _TL("Right [Del]"));
+		pMenu->AppendSeparator();
+		pMenu->Append         (MENU_SHIFT_Y_DEC  , _TL("Up [Home]"));
+		pMenu->Append         (MENU_SHIFT_Y_INC  , _TL("Down [End]"));
+		pMenu->AppendSeparator();
+		pMenu->Append         (MENU_SHIFT_Z_DEC  , _TL("Forward [Page Up]"));
+		pMenu->Append         (MENU_SHIFT_Z_INC  , _TL("Backward [Page Down]"));
+
+		//-------------------------------------------------
+		Menu.AppendSubMenu(pMenu = new wxMenu, _TL("Sequencer"));
+
+		pMenu->Append         (MENU_PLAY_POS_ADD , _TL("Add Position [Ctrl + A]"));
+		pMenu->Append         (MENU_PLAY_POS_DEL , _TL("Delete Last Position [Ctrl + D]"));
+		pMenu->Append         (MENU_PLAY_POS_CLR , _TL("Delete All Positions [Ctrl + X]"));
+		pMenu->AppendSeparator();
+		pMenu->Append         (MENU_PLAY_RUN_ONCE, _TL("Play Once [Ctrl + P]"));
+		pMenu->AppendCheckItem(MENU_PLAY_RUN_LOOP, _TL("Play Loop [Ctrl + L]"));
+		pMenu->Append         (MENU_PLAY_RUN_SAVE, _TL("Play and Save to Image"));
+
+		//-------------------------------------------------
+		Set_Menu(Menu);
+
+		Menu.AppendSeparator();
+		Menu.Append(MENU_CLOSE, _TL("Close"));
+
+		PopupMenu(&Menu, m_pCommands->GetRect().GetBottomLeft());
+
+		return;
+	}
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Dialog::On_Menu(wxCommandEvent &event)
+{
+	switch( event.GetId() )
+	{
+	default:	return;
+
+	case MENU_CLOSE        :	Close();	return;
+
+	case MENU_PROPERTIES   :
+		if( SG_UI_Dlg_Parameters(&m_pPanel->m_Parameters, m_pPanel->m_Parameters.Get_Name()) )
+		{
+			Update_Controls();
+
+			m_pPanel->Update_View(true);
+		}
+		return;
+
+	case MENU_BOX          :	MENU_TOGGLE("DRAW_BOX");	break;
+	case MENU_STEREO       :	MENU_TOGGLE("STEREO"  );	break;
+	case MENU_CENTRAL      :	MENU_TOGGLE("CENTRAL" );	break;
+
+	case MENU_ROTATE_X_DEC :	m_pPanel->Get_Projector().Set_xRotation(m_pPanel->Get_Projector().Get_xRotation() - 4.0 * M_DEG_TO_RAD);	break;
+	case MENU_ROTATE_X_INC :	m_pPanel->Get_Projector().Set_xRotation(m_pPanel->Get_Projector().Get_xRotation() + 4.0 * M_DEG_TO_RAD);	break;
+	case MENU_ROTATE_Y_DEC :	m_pPanel->Get_Projector().Set_yRotation(m_pPanel->Get_Projector().Get_yRotation() - 4.0 * M_DEG_TO_RAD);	break;
+	case MENU_ROTATE_Y_INC :	m_pPanel->Get_Projector().Set_yRotation(m_pPanel->Get_Projector().Get_yRotation() + 4.0 * M_DEG_TO_RAD);	break;
+	case MENU_ROTATE_Z_DEC :	m_pPanel->Get_Projector().Set_zRotation(m_pPanel->Get_Projector().Get_zRotation() - 4.0 * M_DEG_TO_RAD);	break;
+	case MENU_ROTATE_Z_INC :	m_pPanel->Get_Projector().Set_zRotation(m_pPanel->Get_Projector().Get_zRotation() + 4.0 * M_DEG_TO_RAD);	break;
+
+	case MENU_SHIFT_X_DEC  :	m_pPanel->Get_Projector().Set_xShift(m_pPanel->Get_Projector().Get_xShift() - 10.0);	break;
+	case MENU_SHIFT_X_INC  :	m_pPanel->Get_Projector().Set_xShift(m_pPanel->Get_Projector().Get_xShift() + 10.0);	break;
+	case MENU_SHIFT_Y_DEC  :	m_pPanel->Get_Projector().Set_yShift(m_pPanel->Get_Projector().Get_yShift() - 10.0);	break;
+	case MENU_SHIFT_Y_INC  :	m_pPanel->Get_Projector().Set_yShift(m_pPanel->Get_Projector().Get_yShift() + 10.0);	break;
+	case MENU_SHIFT_Z_DEC  :	m_pPanel->Get_Projector().Set_zShift(m_pPanel->Get_Projector().Get_zShift() - 10.0);	break;
+	case MENU_SHIFT_Z_INC  :	m_pPanel->Get_Projector().Set_zShift(m_pPanel->Get_Projector().Get_zShift() + 10.0);	break;
+
+	case MENU_PLAY_POS_ADD :	m_pPanel->Play_Pos_Add();	return;
+	case MENU_PLAY_POS_DEL :	m_pPanel->Play_Pos_Del();	return;
+	case MENU_PLAY_POS_CLR :	m_pPanel->Play_Pos_Clr();	return;
+	case MENU_PLAY_RUN_ONCE:	m_pPanel->Play_Once   ();	return;
+	case MENU_PLAY_RUN_LOOP:	m_pPanel->Play_Loop   ();	return;
+	case MENU_PLAY_RUN_SAVE:	m_pPanel->Play_Save   ();	return;
+	}
+
+	m_pPanel->Update_View();
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Dialog::On_Menu_UI(wxUpdateUIEvent &event)
+{
+	switch( event.GetId() )
+	{
+	case MENU_BOX          :	event.Check(m_pPanel->m_Parameters("DRAW_BOX")->asBool());	break;
+	case MENU_STEREO       :	event.Check(m_pPanel->m_Parameters("STEREO"  )->asBool());	break;
+	case MENU_CENTRAL      :	event.Check(m_pPanel->m_Parameters("CENTRAL" )->asBool());	break;
+
+	case MENU_PLAY_RUN_LOOP:	event.Check(m_pPanel->Play_Get_State() == SG_3DVIEW_PLAY_RUN_LOOP);	break;
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Dialog::Update_Controls(void)
+{
+	double	d;
+
+	d	= fmod(M_RAD_TO_DEG * m_pPanel->Get_Projector().Get_xRotation(), 360.0);
+	if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0;
+	m_pRotate_X->Set_Value(d);
+
+	d	= fmod(M_RAD_TO_DEG * m_pPanel->Get_Projector().Get_zRotation(), 360.0);
+	if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0;
+	m_pRotate_Z->Set_Value(d);
+
+//	m_pBox   ->SetValue(m_pPanel->m_Parameters("DRAW_BOX")->asBool());
+//	m_pStereo->SetValue(m_pPanel->m_Parameters("STEREO"  )->asBool());
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gdi/3d_view_panel.cpp b/src/saga_core/saga_gdi/3d_view_panel.cpp
new file mode 100644
index 0000000..b4ef925
--- /dev/null
+++ b/src/saga_core/saga_gdi/3d_view_panel.cpp
@@ -0,0 +1,787 @@
+/**********************************************************
+ * Version $Id: 3d_view_panel.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   3d_view_panel.cpp                   //
+//                                                       //
+//                 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                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/dcclient.h>
+
+#include "3d_view.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	PLAY_REC_ROTATE_X	= 0,
+	PLAY_REC_ROTATE_Y,
+	PLAY_REC_ROTATE_Z,
+	PLAY_REC_SHIFT_X,
+	PLAY_REC_SHIFT_Y,
+	PLAY_REC_SHIFT_Z,
+	PLAY_REC_SCALE_Z,
+	PLAY_REC_CENTRAL,
+	PLAY_REC_STEPS
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(CSG_3DView_Panel, wxPanel)
+	EVT_SIZE		(CSG_3DView_Panel::On_Size)
+	EVT_PAINT		(CSG_3DView_Panel::On_Paint)
+	EVT_KEY_DOWN	(CSG_3DView_Panel::On_Key_Down)
+	EVT_LEFT_DOWN	(CSG_3DView_Panel::On_Mouse_LDown)
+	EVT_LEFT_UP		(CSG_3DView_Panel::On_Mouse_LUp)
+	EVT_RIGHT_DOWN	(CSG_3DView_Panel::On_Mouse_RDown)
+	EVT_RIGHT_UP	(CSG_3DView_Panel::On_Mouse_RUp)
+	EVT_MIDDLE_DOWN	(CSG_3DView_Panel::On_Mouse_MDown)
+	EVT_MIDDLE_UP	(CSG_3DView_Panel::On_Mouse_MUp)
+	EVT_MOTION		(CSG_3DView_Panel::On_Mouse_Motion)
+	EVT_MOUSEWHEEL	(CSG_3DView_Panel::On_Mouse_Wheel)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_3DView_Panel::CSG_3DView_Panel(wxWindow *pParent, CSG_Grid *pDrape)
+	: wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE)
+{
+	CSG_Parameter	*pNode, *pNode_1;
+
+	m_Parameters.Create(this, _TL("Properties"), _TL(""));
+
+	m_Parameters.Set_Callback_On_Parameter_Changed(_On_Parameter_Changed);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_GENERAL"	, _TL("General"),
+		_TL("")
+	);
+
+	pNode_1	= m_Parameters.Add_Choice(
+		pNode	, "CENTRAL"			, _TL("Projection"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("parallel"),
+			_TL("central")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "CENTRAL_DIST"	, _TL("Central Projection Distance"),
+		_TL(""),
+		PARAMETER_TYPE_Double, m_Projector.Get_Central_Distance(), 1.0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "BGCOLOR"			, _TL("Background Color"),
+		_TL(""),
+		PARAMETER_TYPE_Color, SG_COLOR_WHITE
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "DRAW_BOX"		, _TL("Draw Box"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "STEREO"			, _TL("Stereo Anaglyph"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "STEREO_DIST"		, _TL("Stereo Eye Distance [Degree]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	m_pDrape	= pDrape;
+
+	if( m_pDrape )
+	{
+		pNode_1	= m_Parameters.Add_Value(
+			pNode	, "DO_DRAPE"	, _TL("Map Draping"),
+			_TL(""),
+			PARAMETER_TYPE_Bool, true
+		);
+
+		m_Parameters.Add_Choice(
+			pNode_1	, "DRAPE_MODE"	, _TL("Map Draping Interpolation"),
+			_TL(""),
+			CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"),
+				_TL("None"),
+				_TL("Bilinear"),
+				_TL("Inverse Distance"),
+				_TL("Bicubic Spline"),
+				_TL("B-Spline")
+			), 0
+		);
+	}
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(
+		NULL	, "NODE_PLAYER"		, _TL("Sequencer"),
+		_TL("")
+	);
+
+	m_Parameters.Add_FilePath(
+		pNode	, "PLAY_FILE"		, _TL("Image File"),
+		_TL("file path, name and type used to save frames to image files"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"),
+			_TL("Windows or OS/2 Bitmap (*.bmp)")				, SG_T("*.bmp"),
+			_TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)")	, SG_T("*.jpg;*.jif;*.jpeg"),
+			_TL("Zsoft Paintbrush (*.pcx)")						, SG_T("*.pcx"),
+			_TL("Portable Network Graphics (*.png)")			, SG_T("*.png"),
+			_TL("Tagged Image File Format (*.tif, *.tiff)")		, SG_T("*.tif;*.tiff")
+		), NULL, true
+	);
+
+	m_pPlay	= m_Parameters.Add_FixedTable(
+		pNode	, "PLAY"			, _TL("Sequencer Positions"),
+		_TL("")
+		)->asTable();
+
+	m_pPlay->Add_Field(_TL("Rotate X"        ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Rotate Y"        ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Rotate Z"        ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Shift X"         ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Shift Y"         ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Shift Z"         ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Exaggeration Z"  ), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Central Distance"), SG_DATATYPE_Double);
+	m_pPlay->Add_Field(_TL("Steps to Next"   ), SG_DATATYPE_Int);
+
+	m_Play_State	= SG_3DVIEW_PLAY_STOP;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CSG_3DView_Panel::_On_Parameter_Changed(CSG_Parameter *pParameter, int Flags)
+{
+	if( pParameter && pParameter->Get_Owner() && pParameter->Get_Owner()->Get_Owner() )
+	{
+		if( Flags & PARAMETER_CHECK_VALUES )
+		{
+			((CSG_3DView_Panel *)pParameter->Get_Owner()->Get_Owner())->
+				On_Parameter_Changed(pParameter->Get_Owner(), pParameter);
+		}
+
+		if( Flags & PARAMETER_CHECK_ENABLE )
+		{
+			((CSG_3DView_Panel *)pParameter->Get_Owner()->Get_Owner())->
+				On_Parameters_Enable(pParameter->Get_Owner(), pParameter);
+		}
+
+		return( 1 );
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+int CSG_3DView_Panel::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( 1 );
+}
+
+//---------------------------------------------------------
+int CSG_3DView_Panel::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "CENTRAL") )
+	{
+		pParameters->Get_Parameter("CENTRAL_DIST")->Set_Enabled(pParameter->asInt() == 1);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DO_DRAPE") )
+	{
+		pParameters->Get_Parameter("DRAPE_MODE")->Set_Enabled(pParameter->asBool());
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "STEREO") )
+	{
+		pParameters->Get_Parameter("STEREO_DIST")->Set_Enabled(pParameter->asBool());
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Update_Statistics(void)
+{}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Update_Parent(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Key_Down(wxKeyEvent &event)
+{
+	if( !event.ControlDown() )
+	{
+		switch( event.GetKeyCode() )
+		{
+		default:	event.Skip();	return;
+
+		case WXK_NUMPAD_ADD:
+		case WXK_ADD:		m_Projector.Set_xRotation(m_Projector.Get_xRotation() - 4.0 * M_DEG_TO_RAD);	break;
+		case WXK_NUMPAD_SUBTRACT:
+		case WXK_SUBTRACT:	m_Projector.Set_xRotation(m_Projector.Get_xRotation() + 4.0 * M_DEG_TO_RAD);	break;
+
+		case WXK_F3:		m_Projector.Set_yRotation(m_Projector.Get_yRotation() - 4.0 * M_DEG_TO_RAD);	break;
+		case WXK_F4:		m_Projector.Set_yRotation(m_Projector.Get_yRotation() + 4.0 * M_DEG_TO_RAD);	break;
+
+		case WXK_NUMPAD_MULTIPLY:
+		case WXK_MULTIPLY:	m_Projector.Set_zRotation(m_Projector.Get_zRotation() - 4.0 * M_DEG_TO_RAD);	break;
+		case WXK_NUMPAD_DIVIDE:
+		case WXK_DIVIDE:	m_Projector.Set_zRotation(m_Projector.Get_zRotation() + 4.0 * M_DEG_TO_RAD);	break;
+
+		case WXK_INSERT:	m_Projector.Set_xShift   (m_Projector.Get_xShift   () - 10.0);	break;
+		case WXK_DELETE:	m_Projector.Set_xShift   (m_Projector.Get_xShift   () + 10.0);	break;
+
+		case WXK_HOME:		m_Projector.Set_yShift   (m_Projector.Get_yShift   () - 10.0);	break;
+		case WXK_END:		m_Projector.Set_yShift   (m_Projector.Get_yShift   () + 10.0);	break;
+
+		case WXK_PAGEUP:	m_Projector.Set_zShift   (m_Projector.Get_zShift   () - 10.0);	break;
+		case WXK_PAGEDOWN:	m_Projector.Set_zShift   (m_Projector.Get_zShift   () + 10.0);	break;
+
+		case 'B':			m_Parameters("DRAW_BOX")->Set_Value(m_Parameters("DRAW_BOX")->asBool() == false);	break;
+		case 'S':			m_Parameters("STEREO"  )->Set_Value(m_Parameters("STEREO"  )->asBool() == false);	break;
+
+		case WXK_ESCAPE:	if( m_Play_State )	{ Play_Stop(); break; } else return;
+		}
+
+		Update_Parent();
+		Update_View();
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		switch( event.GetKeyCode() )
+		{
+		default:	event.Skip();	return;
+
+		case 'A':	Play_Pos_Add ();	break;
+		case 'D':	Play_Pos_Del ();	break;
+		case 'X':	Play_Pos_Clr ();	break;
+
+		case 'P':	Play_Once    ();	break;
+		case 'L':	Play_Loop    ();	break;
+		case 'S':	Play_Save    ();	break;
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define GET_MOUSE_X_RELDIFF	((double)(m_Down_Screen.x - event.GetX()) / (double)GetClientSize().x)
+#define GET_MOUSE_Y_RELDIFF	((double)(m_Down_Screen.y - event.GetY()) / (double)GetClientSize().y)
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Mouse_LDown(wxMouseEvent &event)
+{
+	SetFocus();
+
+	m_Down_Screen	= event.GetPosition();
+	m_Down_Value.x	= m_Projector.Get_zRotation();
+	m_Down_Value.y	= m_Projector.Get_xRotation();
+
+	CaptureMouse();
+}
+
+void CSG_3DView_Panel::On_Mouse_LUp(wxMouseEvent &event)
+{
+	if( HasCapture() )
+	{
+		ReleaseMouse();
+	}
+
+	if( m_Down_Screen.x != event.GetX() || m_Down_Screen.y != event.GetY() )
+	{
+		m_Projector.Set_zRotation(m_Down_Value.x + GET_MOUSE_X_RELDIFF * M_PI_180);
+		m_Projector.Set_xRotation(m_Down_Value.y + GET_MOUSE_Y_RELDIFF * M_PI_180);
+
+		Update_View();
+		Update_Parent();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Mouse_RDown(wxMouseEvent &event)
+{
+	SetFocus();
+
+	m_Down_Screen	= event.GetPosition();
+	m_Down_Value.x	= m_Projector.Get_xShift();
+	m_Down_Value.y	= m_Projector.Get_yShift();
+
+	CaptureMouse();
+}
+
+void CSG_3DView_Panel::On_Mouse_RUp(wxMouseEvent &event)
+{
+	if( HasCapture() )
+	{
+		ReleaseMouse();
+	}
+
+	if( m_Down_Screen.x != event.GetX() || m_Down_Screen.y != event.GetY() )
+	{
+		m_Projector.Set_xShift(m_Down_Value.x - GET_MOUSE_X_RELDIFF * 1000.0);
+		m_Projector.Set_yShift(m_Down_Value.y - GET_MOUSE_Y_RELDIFF * 1000.0);
+
+		Update_View();
+		Update_Parent();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Mouse_MDown(wxMouseEvent &event)
+{
+	SetFocus();
+
+	m_Down_Screen	= event.GetPosition();
+	m_Down_Value.x	= m_Projector.Get_yRotation();
+	m_Down_Value.y	= m_Projector.Get_zShift();
+
+	CaptureMouse();
+}
+
+void CSG_3DView_Panel::On_Mouse_MUp(wxMouseEvent &event)
+{
+	if( HasCapture() )
+	{
+		ReleaseMouse();
+	}
+
+	if( m_Down_Screen.x != event.GetX() || m_Down_Screen.y != event.GetY() )
+	{
+		m_Projector.Set_yRotation(m_Down_Value.x + GET_MOUSE_X_RELDIFF * M_PI_180);
+		m_Projector.Set_zShift   (m_Down_Value.y + GET_MOUSE_Y_RELDIFF * 1000.0);
+
+		Update_View();
+		Update_Parent();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Mouse_Motion(wxMouseEvent &event)
+{
+	if( HasCapture() && event.Dragging() )
+	{
+		if( event.LeftIsDown() )
+		{
+			m_Projector.Set_zRotation(m_Down_Value.x + GET_MOUSE_X_RELDIFF * M_PI_180);
+			m_Projector.Set_xRotation(m_Down_Value.y + GET_MOUSE_Y_RELDIFF * M_PI_180);
+		}
+		else if( event.RightIsDown() )
+		{
+			m_Projector.Set_xShift   (m_Down_Value.x - GET_MOUSE_X_RELDIFF * 1000.0);
+			m_Projector.Set_yShift   (m_Down_Value.y - GET_MOUSE_Y_RELDIFF * 1000.0);
+		}
+		else if( event.MiddleIsDown() )
+		{
+			m_Projector.Set_yRotation(m_Down_Value.x + GET_MOUSE_X_RELDIFF * M_PI_180);
+			m_Projector.Set_zShift   (m_Down_Value.y + GET_MOUSE_Y_RELDIFF * 1000.0);
+		}
+		else
+		{
+			return;
+		}
+
+		Update_View();
+		Update_Parent();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Mouse_Wheel(wxMouseEvent &event)
+{
+	if( event.GetWheelRotation() )
+	{
+		m_Projector.Set_zShift(m_Projector.Get_zShift()	+ 0.5 * event.GetWheelRotation());
+
+		Update_View();
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Size(wxSizeEvent &event)
+{
+	Update_View();
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::On_Paint(wxPaintEvent &WXUNUSED(event))
+{
+	if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 )
+	{
+		wxPaintDC	dc(this);
+
+		dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false);
+	}
+}
+
+//---------------------------------------------------------
+bool CSG_3DView_Panel::Update_View(bool bStatistics)
+{
+	if( bStatistics )
+	{
+		Update_Statistics();
+	}
+
+	//-----------------------------------------------------
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_bgColor		= m_Parameters("BGCOLOR"    )->asColor ();
+		m_bBox			= m_Parameters("DRAW_BOX"   )->asBool  ();
+		m_bStereo		= m_Parameters("STEREO"     )->asBool  ();
+		m_dStereo		= m_Parameters("STEREO_DIST")->asDouble();
+		m_Drape_Mode	= m_pDrape ? m_Parameters("DRAPE_MODE" )->asInt() : 0;
+
+		m_Projector.do_Central          (m_Parameters("CENTRAL")->asInt() == 1);
+		m_Projector.Set_Central_Distance(m_Parameters("CENTRAL_DIST")->asDouble());
+	}
+
+	//-----------------------------------------------------
+	wxSize	Size	= GetClientSize();
+
+	if( Size.x < 1 || Size.y < 1 )
+	{
+		return( false );
+	}
+
+	if( !m_Image.IsOk() || Size.x != m_Image.GetWidth() || Size.y != m_Image.GetHeight() )
+	{
+		if( !m_Image.Create(Size.x, Size.y) )
+		{
+			return( false );
+		}
+	}
+
+	Set_Image(m_Image.GetData(), m_Image.GetWidth(), m_Image.GetHeight() );
+
+	//-----------------------------------------------------
+	CSG_Grid	*pDrape	= m_pDrape;	if( m_pDrape && !m_Parameters("DO_DRAPE")->asBool() )	m_pDrape	= NULL;
+
+	if( Draw() )
+	{
+		wxClientDC	dc(this);
+
+		dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false);
+	}
+
+	m_pDrape	= pDrape;
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Pos_Add(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )	
+	{
+		CSG_Table_Record	*pRecord	= m_pPlay->Add_Record();
+
+		pRecord->Set_Value(PLAY_REC_ROTATE_X, m_Projector.Get_xRotation       ());
+		pRecord->Set_Value(PLAY_REC_ROTATE_Y, m_Projector.Get_yRotation       ());
+		pRecord->Set_Value(PLAY_REC_ROTATE_Z, m_Projector.Get_zRotation       ());
+		pRecord->Set_Value(PLAY_REC_SHIFT_X , m_Projector.Get_xShift          ());
+		pRecord->Set_Value(PLAY_REC_SHIFT_Y , m_Projector.Get_yShift          ());
+		pRecord->Set_Value(PLAY_REC_SHIFT_Z , m_Projector.Get_zShift          ());
+		pRecord->Set_Value(PLAY_REC_SCALE_Z , m_Projector.Get_zScaling        ());
+		pRecord->Set_Value(PLAY_REC_CENTRAL , m_Projector.Get_Central_Distance());
+		pRecord->Set_Value(PLAY_REC_STEPS   , 10);
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Pos_Del(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_pPlay->Del_Record(m_pPlay->Get_Count() - 1);
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Pos_Clr(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_pPlay->Del_Records();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Once(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Play_State	= SG_3DVIEW_PLAY_RUN_ONCE;
+
+		_Play();
+
+		m_Play_State	= SG_3DVIEW_PLAY_STOP;
+	}
+	else if( m_Play_State == SG_3DVIEW_PLAY_RUN_ONCE )
+	{
+		Play_Stop();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Loop(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Play_State	= SG_3DVIEW_PLAY_RUN_LOOP;
+
+		while( _Play() );
+	}
+	else if( m_Play_State == SG_3DVIEW_PLAY_RUN_LOOP )
+	{
+		Play_Stop();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Save(void)
+{
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		m_Play_State	= SG_3DVIEW_PLAY_RUN_SAVE;
+
+		_Play();
+
+		m_Play_State	= SG_3DVIEW_PLAY_STOP;
+	}
+	else if( m_Play_State == SG_3DVIEW_PLAY_RUN_SAVE )
+	{
+		Play_Stop();
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Panel::Play_Stop(void)
+{
+	if( m_Play_State != SG_3DVIEW_PLAY_STOP )
+	{
+		m_Play_State	= SG_3DVIEW_PLAY_STOP;
+	}
+}
+
+//---------------------------------------------------------
+#define PLAYER_READ(iRecord)	{	CSG_Table_Record *pRecord = m_pPlay->Get_Record(iRecord); if( pRecord ) {\
+	for(int i=0; i<=PLAY_REC_STEPS; i++)\
+	{\
+		Position[i][0]	= Position[i][1];\
+		Position[i][1]	= pRecord->asDouble(i);\
+	}\
+}}
+
+//---------------------------------------------------------
+double	SG_Get_Short_Angle	(double Angle)
+{
+	Angle	= fmod(Angle, M_PI_360);
+
+	if( fabs(Angle) > M_PI_180 )
+	{
+		Angle	+= Angle < 0.0 ? M_PI_360 : -M_PI_360;
+	}
+
+	return( Angle );
+}
+
+
+//---------------------------------------------------------
+#define PLAYER_GET_VAL(Value)	(Value[0] + d * (Value[1] - Value[0]))
+#define PLAYER_GET_ROT(Value)	(Value[0] + d * SG_Get_Short_Angle(Value[1] - Value[0]))
+
+//---------------------------------------------------------
+bool CSG_3DView_Panel::_Play(void)
+{
+	//-----------------------------------------------------
+	if( m_Play_State == SG_3DVIEW_PLAY_STOP )
+	{
+		return( false );
+	}
+
+	if( m_pPlay->Get_Count() < 2 )
+	{
+		m_Play_State	= SG_3DVIEW_PLAY_STOP;
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	if( m_Play_State == SG_3DVIEW_PLAY_RUN_SAVE && *m_Parameters("PLAY_FILE")->asString() == '\0' )
+	{
+		SG_UI_Dlg_Error(_TL("invalid image file path"), _TL("3D View Sequencer"));
+
+		m_Play_State	= SG_3DVIEW_PLAY_STOP;
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Matrix	Position(2, 9);
+
+	PLAYER_READ(0);
+
+	int	nPositions	= (int)m_pPlay->Get_Count() + (m_Play_State == SG_3DVIEW_PLAY_RUN_LOOP ? 1 : 0);
+
+	for(int iRecord=1, iFrame=0; iRecord<nPositions && m_Play_State!=SG_3DVIEW_PLAY_STOP; iRecord++)
+	{
+		PLAYER_READ(iRecord % m_pPlay->Get_Count());
+
+		for(int iStep=0; iStep<(int)Position[PLAY_REC_STEPS][0] && m_Play_State!=SG_3DVIEW_PLAY_STOP; iStep++, iFrame++)
+		{
+			double	d	= iStep / Position[PLAY_REC_STEPS][0];
+
+			m_Projector.Set_xRotation       (PLAYER_GET_ROT(Position[PLAY_REC_ROTATE_X]));
+			m_Projector.Set_yRotation       (PLAYER_GET_ROT(Position[PLAY_REC_ROTATE_Y]));
+			m_Projector.Set_zRotation       (PLAYER_GET_ROT(Position[PLAY_REC_ROTATE_Z]));
+			m_Projector.Set_xShift          (PLAYER_GET_VAL(Position[PLAY_REC_SHIFT_X ]));
+			m_Projector.Set_yShift          (PLAYER_GET_VAL(Position[PLAY_REC_SHIFT_Y ]));
+			m_Projector.Set_zShift          (PLAYER_GET_VAL(Position[PLAY_REC_SHIFT_Z ]));
+			m_Projector.Set_zScaling        (PLAYER_GET_VAL(Position[PLAY_REC_SCALE_Z ]));
+			m_Projector.Set_Central_Distance(PLAYER_GET_VAL(Position[PLAY_REC_CENTRAL ]));
+
+			Update_View();
+
+			if( m_Play_State == SG_3DVIEW_PLAY_RUN_SAVE )
+			{
+				m_Image.SaveFile(SG_File_Make_Path(
+					SG_File_Get_Path     (m_Parameters("PLAY_FILE")->asString()),
+					SG_File_Get_Name     (m_Parameters("PLAY_FILE")->asString(), false) + CSG_String::Format(SG_T("%03d"), iFrame),
+					SG_File_Get_Extension(m_Parameters("PLAY_FILE")->asString())
+				).c_str());
+			}
+
+			SG_UI_Process_Get_Okay();
+		}
+	}
+
+	if( m_Play_State != SG_3DVIEW_PLAY_RUN_LOOP )
+	{
+		m_Play_State	= SG_3DVIEW_PLAY_STOP;
+
+		Update_Parent();
+		Update_View();
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gdi/3d_view_projector.cpp b/src/saga_core/saga_gdi/3d_view_projector.cpp
new file mode 100644
index 0000000..9885ffc
--- /dev/null
+++ b/src/saga_core/saga_gdi/3d_view_projector.cpp
@@ -0,0 +1,229 @@
+/**********************************************************
+ * Version $Id: points_view_module.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 3d_view_projector.cpp                 //
+//                                                       //
+//                 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 for Geography                //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "3d_view_tools.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_3DView_Projector::CSG_3DView_Projector(void)
+{
+	Set_Center  (0.0, 0.0, 0.0);
+	Set_Scaling (1.0, 1.0, 1.0);
+	Set_Rotation(0.0, 0.0, 0.0);
+	Set_Shift   (0.0, 0.0, 1500.0);
+	Set_Screen  (100, 100);
+
+	m_Scale		= 1.0;
+	m_bCentral	= true;
+	m_dCentral	= 1000.0;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Set_Center(double x, double y, double z)
+{
+	m_Center.x	= x;
+	m_Center.y	= y;
+	m_Center.z	= z;
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Set_Scale(double Scale)
+{
+	if( Scale > 0.0 )
+	{
+		m_Scale	= Scale;
+	}
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Set_Scaling(double x, double y, double z)
+{
+	m_Scaling.x	= x;
+	m_Scaling.y	= y;
+	m_Scaling.z	= z;
+}
+
+void CSG_3DView_Projector::Set_xScaling(double x)
+{	m_Scaling.x = x;	}
+
+void CSG_3DView_Projector::Set_yScaling(double y)
+{	m_Scaling.y = y;	}
+
+void CSG_3DView_Projector::Set_zScaling(double z)
+{	m_Scaling.z = z;	}
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Set_Rotation(double x, double y, double z)
+{
+	Set_xRotation(x);
+	Set_yRotation(y);
+	Set_zRotation(z);
+}
+
+void CSG_3DView_Projector::Set_xRotation(double x)
+{	m_Rotate.x = x; m_Sin.x = sin(x - M_PI_180); m_Cos.x = cos(x - M_PI_180);	}
+
+void CSG_3DView_Projector::Set_yRotation(double y)
+{	m_Rotate.y = y; m_Sin.y = sin(y); m_Cos.y = cos(y);	}
+
+void CSG_3DView_Projector::Set_zRotation(double z)
+{	m_Rotate.z = z; m_Sin.z = sin(z); m_Cos.z = cos(z);	}
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Set_Shift(double x, double y, double z)
+{
+	Set_xShift(x);
+	Set_yShift(y);
+	Set_zShift(z);
+}
+
+void CSG_3DView_Projector::Set_xShift(double x)
+{	m_Shift.x = x;	}
+
+void CSG_3DView_Projector::Set_yShift(double y)
+{	m_Shift.y = y;	}
+
+void CSG_3DView_Projector::Set_zShift(double z)
+{	m_Shift.z = z;	}
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Set_Screen(int Width, int Height)
+{
+	m_Screen_NX	= Width;
+	m_Screen_NY	= Height;
+}
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::do_Central(bool bOn)
+{
+	m_bCentral	= bOn;
+}
+
+void CSG_3DView_Projector::Set_Central_Distance(double Distance)
+{
+	m_dCentral	= Distance;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_3DView_Projector::Get_Projection(double &x, double &y, double &z)
+{
+	double		a, b;
+	TSG_Point_Z	q;
+
+	x	= (x - m_Center.x) * m_Scale * m_Scaling.x;
+	y	= (y - m_Center.y) * m_Scale * m_Scaling.y;
+	z	= (z - m_Center.z) * m_Scale * m_Scaling.z;
+
+	a	= (m_Cos.y * z + m_Sin.y * (m_Sin.z * y + m_Cos.z * x));
+	b	= (m_Cos.z * y - m_Sin.z * x);
+
+	q.x	= m_Shift.x + (m_Cos.y * (m_Sin.z * y + m_Cos.z * x) - m_Sin.y * z);
+	q.y	= m_Shift.y + (m_Sin.x * a + m_Cos.x * b);
+	q.z	= m_Shift.z + (m_Cos.x * a - m_Sin.x * b);
+
+	if( m_bCentral )
+	{
+		q.x	*= m_dCentral / q.z;
+		q.y	*= m_dCentral / q.z;
+	}
+	else
+	{
+		double	z	= m_dCentral / m_Shift.z;
+		q.x	*= z;
+		q.y	*= z;
+	//	q.z	 = -q.z;
+	}
+
+	x	= q.x + 0.5 * m_Screen_NX;
+	y	= q.y + 0.5 * m_Screen_NY;
+	z	= q.z;
+}
+
+void CSG_3DView_Projector::Get_Projection(TSG_Point_Z &p)
+{
+	Get_Projection(p.x, p.y, p.z);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gdi/3d_view_tools.h b/src/saga_core/saga_gdi/3d_view_tools.h
new file mode 100644
index 0000000..02d16a8
--- /dev/null
+++ b/src/saga_core/saga_gdi/3d_view_tools.h
@@ -0,0 +1,227 @@
+/**********************************************************
+ * Version $Id: 3d_view_projector.h 911 2011-02-14 16:38:15Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  3d_view_projector.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__3d_view_projector_H
+#define HEADER_INCLUDED__3d_view_projector_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "sgdi_core.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SGDI_API_DLL_EXPORT CSG_3DView_Projector
+{
+public:
+	CSG_3DView_Projector(void);
+
+	void				Set_Center				(double x, double y, double z);
+	void				Set_Scale				(double Scale);
+
+	void				Set_Scaling				(double x, double y, double z);
+	void				Set_xScaling			(double x);
+	void				Set_yScaling			(double y);
+	void				Set_zScaling			(double z);
+	const TSG_Point_Z &	Get_Scaling				(void)	const	{	return( m_Scaling   );	}
+	double				Get_xScaling			(void)	const	{	return( m_Scaling.x );	}
+	double				Get_yScaling			(void)	const	{	return( m_Scaling.y );	}
+	double				Get_zScaling			(void)	const	{	return( m_Scaling.z );	}
+
+	void				Set_Rotation			(double x, double y, double z);
+	void				Set_xRotation			(double x);
+	void				Set_yRotation			(double y);
+	void				Set_zRotation			(double z);
+	const TSG_Point_Z &	Get_Rotation			(void)	const	{	return( m_Rotate   );	}
+	double				Get_xRotation			(void)	const	{	return( m_Rotate.x );	}
+	double				Get_yRotation			(void)	const	{	return( m_Rotate.y );	}
+	double				Get_zRotation			(void)	const	{	return( m_Rotate.z );	}
+
+	void				Set_Shift				(double x, double y, double z);
+	void				Set_xShift				(double x);
+	void				Set_yShift				(double y);
+	void				Set_zShift				(double z);
+	const TSG_Point_Z &	Get_Shift				(void)	const	{	return( m_Shift   );	}
+	double				Get_xShift				(void)	const	{	return( m_Shift.x );	}
+	double				Get_yShift				(void)	const	{	return( m_Shift.y );	}
+	double				Get_zShift				(void)	const	{	return( m_Shift.z );	}
+
+	void				Set_Screen				(int Width, int Height);
+
+	void				do_Central				(bool bOn = true);
+	bool				is_Central				(void)	const	{	return( m_bCentral );	}
+	void				Set_Central_Distance	(double Distance);
+	double				Get_Central_Distance	(void)	const	{	return( m_dCentral );	}
+
+	void				Get_Projection			(TSG_Point_Z &p);
+	void				Get_Projection			(double &x, double &y, double &z);
+
+
+private:
+
+	bool				m_bCentral;
+
+	int					m_Screen_NX, m_Screen_NY;
+
+	double				m_dCentral, m_Scale;
+
+	TSG_Point_Z			m_Center, m_Scaling, m_Rotate, m_Sin, m_Cos, m_Shift;
+
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SGDI_API_DLL_EXPORT CSG_3DView_Canvas
+{
+public:
+	CSG_3DView_Canvas(void);
+
+	CSG_3DView_Projector &		Get_Projector			(void)	{	return( m_Projector );	}
+
+	bool						Draw					(void);
+
+
+protected:
+
+	bool						m_bBox, m_bStereo;
+
+	int							m_bgColor, m_Drape_Mode;
+
+	double						m_dStereo;
+
+	TSG_Point_Z					m_Data_Min, m_Data_Max;
+
+	CSG_Grid					*m_pDrape;
+
+	CSG_3DView_Projector		m_Projector;
+
+
+	virtual bool				On_Before_Draw			(void)	{	return( true );	}
+	virtual bool				On_Draw					(void)	= 0;
+
+	virtual int					Get_Color				(double Value);
+	virtual int					Dim_Color				(int Color, double dim);
+
+	void						Set_Image				(BYTE *pRGB, int NX, int NY);
+
+	void						Draw_Point				(int x, int y, double z, int color, int Size);
+	void						Draw_Line				(double ax, double ay, double az, double bx, double by, double bz, int Color);
+	void						Draw_Line				(double ax, double ay, double az, double bx, double by, double bz, int aColor, int bColor);
+	void						Draw_Line				(const TSG_Point_Z &a, const TSG_Point_Z &b, int Color);
+	void						Draw_Line				(const TSG_Point_Z &a, const TSG_Point_Z &b, int aColor, int bColor);
+
+	typedef struct SSG_Triangle_Node
+	{
+		double	x, y, z, c, d;
+	}
+	TSG_Triangle_Node;
+
+	void						Draw_Triangle			(TSG_Triangle_Node p[3], double Light_Dec, double Light_Azi);
+	void						Draw_Triangle			(TSG_Triangle_Node p[3], double dim = 1.0);
+
+
+private:
+
+	int							m_Image_NX, m_Image_NY, m_Color_Mode;
+
+	BYTE						*m_Image_pRGB;
+
+	CSG_Matrix					m_Image_zMax;
+
+
+	void						_Draw_Background		(void);
+	void						_Draw_Box				(void);
+
+	void						_Draw_Pixel				(int x, int y, double z, int color);
+	void						_Draw_Triangle_Line		(int y, double xa, double xb, double za, double zb, double ca, double cb, double da, double db, double dim);
+
+	int							_Dim_Color				(int Color, double dim);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__3d_view_projector_H
diff --git a/src/saga_core/saga_gdi/Makefile.am b/src/saga_core/saga_gdi/Makefile.am
index 9ed5f6f..d9eb767 100644
--- a/src/saga_core/saga_gdi/Makefile.am
+++ b/src/saga_core/saga_gdi/Makefile.am
@@ -15,13 +15,29 @@ AM_LDFLAGS         = $(DEP_LFLG)
 lib_LTLIBRARIES    = libsaga_gdi.la
 libsaga_gdi_la_LDFLAGS=$(AM_LDFLAGS) -release $(VERSION)
 libsaga_gdi_la_SOURCES =\
+3d_view_canvas.cpp\
+3d_view_dialog.cpp\
+3d_view_panel.cpp\
+3d_view_projector.cpp\
 sgdi_diagram.cpp\
 sgdi_dialog.cpp\
 sgdi_helper.cpp\
 saga_gdi.cpp\
+3d_view.h\
+3d_view_tools.h\
+sgdi_core.h\
 sgdi_diagram.h\
 sgdi_dialog.h\
 sgdi_helper.h\
 saga_gdi.h
 
+otherincludedir = $(pkgincludedir)/saga_core/saga_gdi
+otherinclude_HEADERS = saga_gdi.h \
+3d_view.h\
+3d_view_tools.h\
+sgdi_core.h\
+sgdi_diagram.h\
+sgdi_dialog.h\
+sgdi_helper.h
+
 libsaga_gdi_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
diff --git a/src/saga_core/saga_gdi/Makefile.in b/src/saga_core/saga_gdi/Makefile.in
index 8b35cd8..26decaa 100644
--- a/src/saga_core/saga_gdi/Makefile.in
+++ b/src/saga_core/saga_gdi/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,7 +14,25 @@
 
 @SET_MAKE@
 
+
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core/saga_gdi
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(otherinclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -72,12 +90,19 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(libdir)"
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(otherincludedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libsaga_gdi_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libsaga_gdi_la_OBJECTS = sgdi_diagram.lo sgdi_dialog.lo \
-	sgdi_helper.lo saga_gdi.lo
+am_libsaga_gdi_la_OBJECTS = 3d_view_canvas.lo 3d_view_dialog.lo \
+	3d_view_panel.lo 3d_view_projector.lo sgdi_diagram.lo \
+	sgdi_dialog.lo sgdi_helper.lo saga_gdi.lo
 libsaga_gdi_la_OBJECTS = $(am_libsaga_gdi_la_OBJECTS)
 libsaga_gdi_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
@@ -106,6 +131,12 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libsaga_gdi_la_SOURCES)
 DIST_SOURCES = $(libsaga_gdi_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+HEADERS = $(otherinclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -131,6 +162,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -158,6 +190,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -170,6 +203,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -199,6 +233,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -232,7 +267,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -264,15 +298,31 @@ AM_LDFLAGS = $(DEP_LFLG)
 lib_LTLIBRARIES = libsaga_gdi.la
 libsaga_gdi_la_LDFLAGS = $(AM_LDFLAGS) -release $(VERSION)
 libsaga_gdi_la_SOURCES = \
+3d_view_canvas.cpp\
+3d_view_dialog.cpp\
+3d_view_panel.cpp\
+3d_view_projector.cpp\
 sgdi_diagram.cpp\
 sgdi_dialog.cpp\
 sgdi_helper.cpp\
 saga_gdi.cpp\
+3d_view.h\
+3d_view_tools.h\
+sgdi_core.h\
 sgdi_diagram.h\
 sgdi_dialog.h\
 sgdi_helper.h\
 saga_gdi.h
 
+otherincludedir = $(pkgincludedir)/saga_core/saga_gdi
+otherinclude_HEADERS = saga_gdi.h \
+3d_view.h\
+3d_view_tools.h\
+sgdi_core.h\
+sgdi_diagram.h\
+sgdi_dialog.h\
+sgdi_helper.h
+
 libsaga_gdi_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 all: all-am
 
@@ -310,7 +360,6 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -318,6 +367,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
 	}
@@ -333,13 +384,15 @@ uninstall-libLTLIBRARIES:
 
 clean-libLTLIBRARIES:
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libsaga_gdi.la: $(libsaga_gdi_la_OBJECTS) $(libsaga_gdi_la_DEPENDENCIES) 
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsaga_gdi.la: $(libsaga_gdi_la_OBJECTS) $(libsaga_gdi_la_DEPENDENCIES) $(EXTRA_libsaga_gdi_la_DEPENDENCIES) 
 	$(libsaga_gdi_la_LINK) -rpath $(libdir) $(libsaga_gdi_la_OBJECTS) $(libsaga_gdi_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -348,6 +401,10 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_view_canvas.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_view_dialog.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_view_panel.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3d_view_projector.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/saga_gdi.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sgdi_diagram.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sgdi_dialog.Plo at am__quote@
@@ -379,6 +436,27 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
+install-otherincludeHEADERS: $(otherinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(otherinclude_HEADERS)'; test -n "$(otherincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(otherincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(otherincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(otherincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(otherincludedir)" || exit $$?; \
+	done
+
+uninstall-otherincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(otherinclude_HEADERS)'; test -n "$(otherincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(otherincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -429,6 +507,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -464,9 +556,9 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(otherincludedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -479,10 +571,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -517,7 +614,7 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-otherincludeHEADERS
 
 install-dvi: install-dvi-am
 
@@ -563,23 +660,24 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-libLTLIBRARIES
+uninstall-am: uninstall-libLTLIBRARIES uninstall-otherincludeHEADERS
 
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool ctags distclean \
+	clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
 	distclean-compile distclean-generic distclean-libtool \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
 	install install-am install-data install-data-am install-dvi \
 	install-dvi-am install-exec install-exec-am install-html \
 	install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-libLTLIBRARIES
+	install-libLTLIBRARIES install-man install-otherincludeHEADERS \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-libLTLIBRARIES uninstall-otherincludeHEADERS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/saga_core/saga_gdi/sgdi_core.h b/src/saga_core/saga_gdi/sgdi_core.h
new file mode 100644
index 0000000..c21e356
--- /dev/null
+++ b/src/saga_core/saga_gdi/sgdi_core.h
@@ -0,0 +1,99 @@
+/**********************************************************
+ * Version $Id: sgdi_core.h 1922 2014-01-09 10:28:46Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_GDI                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     sgdi_core.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__SAGA_GDI_sgdi_core_H
+#define HEADER_INCLUDED__SAGA_GDI_sgdi_core_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+#ifdef _SAGA_GDI_EXPORTS
+	#define	SGDI_API_DLL_EXPORT		_SAGA_DLL_EXPORT
+#else
+ 	#define	SGDI_API_DLL_EXPORT		_SAGA_DLL_IMPORT
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__SAGA_GDI_sgdi_core_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gdi/sgdi_helper.h b/src/saga_core/saga_gdi/sgdi_helper.h
index 2d4adc3..7016eef 100644
--- a/src/saga_core/saga_gdi/sgdi_helper.h
+++ b/src/saga_core/saga_gdi/sgdi_helper.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_helper.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id: sgdi_helper.h 2114 2014-05-08 15:31:17Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -73,13 +73,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <saga_api/saga_api.h>
-
-#ifdef _SAGA_GDI_EXPORTS
-	#define	SGDI_API_DLL_EXPORT		_SAGA_DLL_EXPORT
-#else
- 	#define	SGDI_API_DLL_EXPORT		_SAGA_DLL_IMPORT
-#endif
+#include "sgdi_core.h"
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/Makefile.am b/src/saga_core/saga_gui/Makefile.am
index 814de8b..8aace54 100644
--- a/src/saga_core/saga_gui/Makefile.am
+++ b/src/saga_core/saga_gui/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1800 2013-08-28 10:40:10Z oconrad $
+# $Id: Makefile.am 2071 2014-03-31 08:10:22Z reklov_w $
 #
 INCS = -I.. -I.
 if DEBUG
@@ -95,6 +95,7 @@ wksp_map.cpp\
 wksp_map_buttons.cpp\
 wksp_map_control.cpp\
 wksp_map_dc.cpp\
+wksp_map_graticule.cpp\
 wksp_map_layer.cpp\
 wksp_map_manager.cpp\
 wksp_module.cpp\
@@ -191,6 +192,7 @@ wksp_map.h\
 wksp_map_buttons.h\
 wksp_map_control.h\
 wksp_map_dc.h\
+wksp_map_graticule.h\
 wksp_map_layer.h\
 wksp_map_manager.h\
 wksp_module.h\
@@ -214,8 +216,20 @@ wksp_tin_manager.h
 
 saga_gui_LDADD = ../saga_api/libsaga_api.la
 
+applicationsdir = $(datadir)/applications
+dist_applications_DATA = res/saga.desktop
+
+pixmapdir = $(datadir)/pixmaps
+dist_pixmap_DATA = res/saga.png
+
+dist_pkgdata_DATA = res/saga_tip.txt res/saga_dic.txt res/saga_srs.txt
+
+install-data-hook:
+	cd $(DESTDIR)/$(pkgdatadir); \
+	mv saga_srs.txt saga_prj.srs; \
+	mv saga_dic.txt saga_prj.dic;
+
 dist-hook:
-	 mkdir $(distdir)/res
 	 cp -Rp $(srcdir)/res/* $(distdir)/res/
 
 SUBDIRS=man 
diff --git a/src/saga_core/saga_gui/Makefile.in b/src/saga_core/saga_gui/Makefile.in
index 7da1f78..659f8fe 100644
--- a/src/saga_core/saga_gui/Makefile.in
+++ b/src/saga_core/saga_gui/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,7 +14,25 @@
 
 @SET_MAKE@
 
+
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -36,7 +53,9 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = saga_gui$(EXEEXT)
 subdir = src/saga_core/saga_gui
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(dist_applications_DATA) $(dist_pixmap_DATA) \
+	$(dist_pkgdata_DATA) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
@@ -52,7 +71,8 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(applicationsdir)" \
+	"$(DESTDIR)$(pixmapdir)" "$(DESTDIR)$(pkgdatadir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_saga_gui_OBJECTS = active.$(OBJEXT) active_attributes.$(OBJEXT) \
 	active_description.$(OBJEXT) active_history.$(OBJEXT) \
@@ -90,17 +110,18 @@ am_saga_gui_OBJECTS = active.$(OBJEXT) active_attributes.$(OBJEXT) \
 	wksp_layer.$(OBJEXT) wksp_layer_classify.$(OBJEXT) \
 	wksp_layer_legend.$(OBJEXT) wksp_map.$(OBJEXT) \
 	wksp_map_buttons.$(OBJEXT) wksp_map_control.$(OBJEXT) \
-	wksp_map_dc.$(OBJEXT) wksp_map_layer.$(OBJEXT) \
-	wksp_map_manager.$(OBJEXT) wksp_module.$(OBJEXT) \
-	wksp_module_control.$(OBJEXT) wksp_module_library.$(OBJEXT) \
-	wksp_module_manager.$(OBJEXT) wksp_module_menu.$(OBJEXT) \
-	wksp_pointcloud.$(OBJEXT) wksp_pointcloud_manager.$(OBJEXT) \
-	wksp_shapes.$(OBJEXT) wksp_shapes_edit.$(OBJEXT) \
-	wksp_shapes_line.$(OBJEXT) wksp_shapes_manager.$(OBJEXT) \
-	wksp_shapes_point.$(OBJEXT) wksp_shapes_points.$(OBJEXT) \
-	wksp_shapes_polygon.$(OBJEXT) wksp_shapes_type.$(OBJEXT) \
-	wksp_table.$(OBJEXT) wksp_table_manager.$(OBJEXT) \
-	wksp_tin.$(OBJEXT) wksp_tin_manager.$(OBJEXT)
+	wksp_map_dc.$(OBJEXT) wksp_map_graticule.$(OBJEXT) \
+	wksp_map_layer.$(OBJEXT) wksp_map_manager.$(OBJEXT) \
+	wksp_module.$(OBJEXT) wksp_module_control.$(OBJEXT) \
+	wksp_module_library.$(OBJEXT) wksp_module_manager.$(OBJEXT) \
+	wksp_module_menu.$(OBJEXT) wksp_pointcloud.$(OBJEXT) \
+	wksp_pointcloud_manager.$(OBJEXT) wksp_shapes.$(OBJEXT) \
+	wksp_shapes_edit.$(OBJEXT) wksp_shapes_line.$(OBJEXT) \
+	wksp_shapes_manager.$(OBJEXT) wksp_shapes_point.$(OBJEXT) \
+	wksp_shapes_points.$(OBJEXT) wksp_shapes_polygon.$(OBJEXT) \
+	wksp_shapes_type.$(OBJEXT) wksp_table.$(OBJEXT) \
+	wksp_table_manager.$(OBJEXT) wksp_tin.$(OBJEXT) \
+	wksp_tin_manager.$(OBJEXT)
 saga_gui_OBJECTS = $(am_saga_gui_OBJECTS)
 saga_gui_DEPENDENCIES = ../saga_api/libsaga_api.la
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
@@ -134,6 +155,40 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+DATA = $(dist_applications_DATA) $(dist_pixmap_DATA) \
+	$(dist_pkgdata_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -190,6 +245,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -217,6 +273,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -229,6 +286,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -258,6 +316,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -291,7 +350,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -313,7 +371,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1800 2013-08-28 10:40:10Z oconrad $
+# $Id: Makefile.am 2071 2014-03-31 08:10:22Z reklov_w $
 #
 INCS = -I.. -I.
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
@@ -400,6 +458,7 @@ wksp_map.cpp\
 wksp_map_buttons.cpp\
 wksp_map_control.cpp\
 wksp_map_dc.cpp\
+wksp_map_graticule.cpp\
 wksp_map_layer.cpp\
 wksp_map_manager.cpp\
 wksp_module.cpp\
@@ -496,6 +555,7 @@ wksp_map.h\
 wksp_map_buttons.h\
 wksp_map_control.h\
 wksp_map_dc.h\
+wksp_map_graticule.h\
 wksp_map_layer.h\
 wksp_map_manager.h\
 wksp_module.h\
@@ -518,6 +578,11 @@ wksp_tin.h\
 wksp_tin_manager.h
 
 saga_gui_LDADD = ../saga_api/libsaga_api.la
+applicationsdir = $(datadir)/applications
+dist_applications_DATA = res/saga.desktop
+pixmapdir = $(datadir)/pixmaps
+dist_pixmap_DATA = res/saga.png
+dist_pkgdata_DATA = res/saga_tip.txt res/saga_dic.txt res/saga_srs.txt
 SUBDIRS = man 
 all: all-recursive
 
@@ -555,8 +620,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p || test -f $$p1; \
@@ -596,7 +664,7 @@ clean-binPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-saga_gui$(EXEEXT): $(saga_gui_OBJECTS) $(saga_gui_DEPENDENCIES) 
+saga_gui$(EXEEXT): $(saga_gui_OBJECTS) $(saga_gui_DEPENDENCIES) $(EXTRA_saga_gui_DEPENDENCIES) 
 	@rm -f saga_gui$(EXEEXT)
 	$(CXXLINK) $(saga_gui_OBJECTS) $(saga_gui_LDADD) $(LIBS)
 
@@ -681,6 +749,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_map_buttons.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_map_control.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_map_dc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_map_graticule.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_map_layer.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_map_manager.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wksp_module.Po at am__quote@
@@ -729,13 +798,76 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
+install-dist_applicationsDATA: $(dist_applications_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_applications_DATA)'; test -n "$(applicationsdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(applicationsdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(applicationsdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(applicationsdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(applicationsdir)" || exit $$?; \
+	done
+
+uninstall-dist_applicationsDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_applications_DATA)'; test -n "$(applicationsdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(applicationsdir)'; $(am__uninstall_files_from_dir)
+install-dist_pixmapDATA: $(dist_pixmap_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_pixmap_DATA)'; test -n "$(pixmapdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pixmapdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pixmapdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pixmapdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pixmapdir)" || exit $$?; \
+	done
+
+uninstall-dist_pixmapDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_pixmap_DATA)'; test -n "$(pixmapdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pixmapdir)'; $(am__uninstall_files_from_dir)
+install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \
+	done
+
+uninstall-dist_pkgdataDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -799,6 +931,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -862,6 +998,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -897,13 +1047,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -928,10 +1075,10 @@ distdir: $(DISTFILES)
 	  dist-hook
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(PROGRAMS)
+all-am: Makefile $(PROGRAMS) $(DATA)
 installdirs: installdirs-recursive
 installdirs-am:
-	for dir in "$(DESTDIR)$(bindir)"; do \
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(pixmapdir)" "$(DESTDIR)$(pkgdatadir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
@@ -944,10 +1091,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -981,8 +1133,10 @@ info: info-recursive
 
 info-am:
 
-install-data-am:
-
+install-data-am: install-dist_applicationsDATA install-dist_pixmapDATA \
+	install-dist_pkgdataDATA
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
 install-dvi: install-dvi-recursive
 
 install-dvi-am:
@@ -1027,30 +1181,40 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_applicationsDATA \
+	uninstall-dist_pixmapDATA uninstall-dist_pkgdataDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am \
+	install-data-am install-strip tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-libtool ctags ctags-recursive dist-hook \
-	distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
-	uninstall-binPROGRAMS
-
+	clean-generic clean-libtool cscopelist cscopelist-recursive \
+	ctags ctags-recursive dist-hook distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am \
+	install-data-hook install-dist_applicationsDATA \
+	install-dist_pixmapDATA install-dist_pkgdataDATA install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-dist_applicationsDATA uninstall-dist_pixmapDATA \
+	uninstall-dist_pkgdataDATA
+
+
+install-data-hook:
+	cd $(DESTDIR)/$(pkgdatadir); \
+	mv saga_srs.txt saga_prj.srs; \
+	mv saga_dic.txt saga_prj.dic;
 
 dist-hook:
-	 mkdir $(distdir)/res
 	 cp -Rp $(srcdir)/res/* $(distdir)/res/
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/saga_core/saga_gui/active.cpp b/src/saga_core/saga_gui/active.cpp
index de12cfe..5414f52 100644
--- a/src/saga_core/saga_gui/active.cpp
+++ b/src/saga_core/saga_gui/active.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active.cpp 2016 2014-02-25 15:07:31Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -207,7 +207,7 @@ CACTIVE::~CACTIVE(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CWKSP_Layer * CACTIVE::Get_Active_Layer(void)
+CWKSP_Data_Item * CACTIVE::Get_Active_Data_Item(void)
 {
 	if( m_pItem && m_pItem->GetId().IsOk() )
 	{
@@ -219,11 +219,12 @@ CWKSP_Layer * CACTIVE::Get_Active_Layer(void)
 		case WKSP_ITEM_Map_Layer:
 			return( ((CWKSP_Map_Layer *)m_pItem)->Get_Layer() );
 
+		case WKSP_ITEM_Table:
 		case WKSP_ITEM_TIN:
 		case WKSP_ITEM_PointCloud:
 		case WKSP_ITEM_Shapes:
 		case WKSP_ITEM_Grid:
-			return( (CWKSP_Layer *)m_pItem );
+			return( (CWKSP_Data_Item *)m_pItem );
 		}
 	}
 
@@ -231,25 +232,13 @@ CWKSP_Layer * CACTIVE::Get_Active_Layer(void)
 }
 
 //---------------------------------------------------------
-CWKSP_Data_Item * CACTIVE::Get_Active_Data_Item(void)
+CWKSP_Layer * CACTIVE::Get_Active_Layer(void)
 {
-	if( m_pItem && m_pItem->GetId().IsOk() )
-	{
-		switch( m_pItem->Get_Type() )
-		{
-		default:
-			break;
-
-		case WKSP_ITEM_Map_Layer:
-			return( ((CWKSP_Map_Layer *)m_pItem)->Get_Layer() );
+	CWKSP_Data_Item	*pItem	= Get_Active_Data_Item();
 
-		case WKSP_ITEM_Table:
-		case WKSP_ITEM_TIN:
-		case WKSP_ITEM_PointCloud:
-		case WKSP_ITEM_Shapes:
-		case WKSP_ITEM_Grid:
-			return( (CWKSP_Data_Item *)m_pItem );
-		}
+	if( pItem && pItem->Get_Type() != WKSP_ITEM_Table )
+	{
+		return( (CWKSP_Layer *)pItem );
 	}
 
 	return( NULL );
@@ -258,16 +247,9 @@ CWKSP_Data_Item * CACTIVE::Get_Active_Data_Item(void)
 //---------------------------------------------------------
 CWKSP_Map * CACTIVE::Get_Active_Map(void)
 {
-	if( m_pItem && m_pItem->GetId().IsOk() )
+	if( m_pItem && m_pItem->GetId().IsOk() && m_pItem->Get_Type() == WKSP_ITEM_Map )
 	{
-		switch( m_pItem->Get_Type() )
-		{
-		default:
-			break;
-
-		case WKSP_ITEM_Map:
-			return( (CWKSP_Map *)m_pItem );
-		}
+		return( (CWKSP_Map *)m_pItem );
 	}
 
 	return( NULL );
@@ -288,11 +270,6 @@ bool CACTIVE::Set_Active(CWKSP_Base_Item *pItem)
 		return( true );
 	}
 
-	if( g_pData_Source )
-	{
-		g_pData_Source->Set_Data_Source(pItem);
-	}
-
 	//-----------------------------------------------------
 	m_pItem		= pItem;
 
@@ -304,63 +281,45 @@ bool CACTIVE::Set_Active(CWKSP_Base_Item *pItem)
 	STATUSBAR_Set_Text(SG_T(""), STATUSBAR_VIEW_Y);
 	STATUSBAR_Set_Text(SG_T(""), STATUSBAR_VIEW_Z);
 
+	//-----------------------------------------------------
 	if( m_pItem == NULL )
 	{
 		STATUSBAR_Set_Text(SG_T(""), STATUSBAR_ACTIVE);
 
-		if( g_pSAGA_Frame )	g_pSAGA_Frame->Set_Pane_Caption(this, _TL("Properties"));
+		if( g_pSAGA_Frame   )	g_pSAGA_Frame->Set_Pane_Caption(this, _TL("Properties"));
+
+		if( g_pData_Buttons )	g_pData_Buttons->Refresh();
+		if( g_pMap_Buttons  )	g_pMap_Buttons ->Refresh();
+
+		_Hide_Page(m_pHistory);
+		_Hide_Page(m_pLegend);
+		_Hide_Page(m_pAttributes);
+
+		SendSizeEvent();
 
 		return( true );
 	}
 
+	//-----------------------------------------------------
 	STATUSBAR_Set_Text(m_pItem->Get_Name(), STATUSBAR_ACTIVE);
 
 	if( g_pSAGA_Frame )	g_pSAGA_Frame->Set_Pane_Caption(this, wxString(_TL("Properties")) + ": " + m_pItem->Get_Name());
 
 	//-----------------------------------------------------
 	if( Get_Active_Data_Item() )
-	{
-		m_pHistory->Set_Item(m_pItem);
-
-		_Show_Page(m_pHistory);
-	}
-	else
-	{
-		_Hide_Page(m_pHistory);
-	}
+	{	_Show_Page(m_pHistory   );	}	else	{	_Hide_Page(m_pHistory   );	}
 
 	if( Get_Active_Layer() || Get_Active_Map() )
-	{
-		m_pLegend->Set_Item(m_pItem);
-
-		_Show_Page(m_pLegend);
-	}
-	else
-	{
-		_Hide_Page(m_pLegend);
-	}
+	{	_Show_Page(m_pLegend    );	}	else	{	_Hide_Page(m_pLegend    );	}
 
 	if( Get_Active_Layer() )
-	{
-		m_pAttributes->Set_Layer(Get_Active_Layer());
-
-		_Show_Page(m_pAttributes);
-	}
-	else
-	{
-		_Hide_Page(m_pAttributes);
-	}
+	{	_Show_Page(m_pAttributes);	}	else	{	_Hide_Page(m_pAttributes);	}
 
 	//-----------------------------------------------------
-	if( g_pData_Buttons )
-	{
-		g_pData_Buttons->Refresh(false);
-	}
+	if( g_pData_Buttons )	g_pData_Buttons->Refresh(false);
+	if( g_pMap_Buttons  )	g_pMap_Buttons ->Refresh(false);
 
-	if( g_pMap_Buttons )
-	{
-		g_pMap_Buttons->Refresh(false);
-	}
+	if( g_pData_Source  )	g_pData_Source->Set_Data_Source(m_pItem);
 
 	//-----------------------------------------------------
 	CSG_Data_Object	*pObject	= Get_Active_Data_Item() ? Get_Active_Data_Item()->Get_Object() : NULL;
@@ -392,11 +351,16 @@ bool CACTIVE::_Show_Page(wxWindow *pPage)
 	int		Image_ID	= -1;
 
 	//-----------------------------------------------------
-	if( pPage == m_pParameters )	Image_ID	= IMG_PARAMETERS;
+	if( pPage == m_pParameters  )	Image_ID	= IMG_PARAMETERS;
 	if( pPage == m_pDescription )	Image_ID	= IMG_DESCRIPTION;
-	if( pPage == m_pHistory )		Image_ID	= IMG_HISTORY;
-	if( pPage == m_pLegend )		Image_ID	= IMG_LEGEND;
-	if( pPage == m_pAttributes )	Image_ID	= IMG_ATTRIBUTES;
+	if( pPage == m_pHistory     )	Image_ID	= IMG_HISTORY;
+	if( pPage == m_pLegend      )	Image_ID	= IMG_LEGEND;
+	if( pPage == m_pAttributes  )	Image_ID	= IMG_ATTRIBUTES;
+
+	//-----------------------------------------------------
+	if( pPage == m_pHistory     )	m_pHistory   ->Set_Item(Get_Active_Data_Item());
+	if( pPage == m_pLegend      )	m_pLegend    ->Set_Item(Get_Active_Layer() ? Get_Active_Layer() : Get_Active_Map() ? m_pItem : NULL);
+	if( pPage == m_pAttributes  )	m_pAttributes->Set_Item(Get_Active_Layer());
 
 	//-----------------------------------------------------
 	if( pPage )
@@ -420,7 +384,16 @@ bool CACTIVE::_Show_Page(wxWindow *pPage)
 //---------------------------------------------------------
 bool CACTIVE::_Hide_Page(wxWindow *pPage)
 {
-#ifndef ACTIVE_SHOW_ALL_PAGES
+#ifdef ACTIVE_SHOW_ALL_PAGES
+	return( true );
+#endif
+
+	//-----------------------------------------------------
+	if( pPage == m_pHistory     )	m_pHistory   ->Set_Item(NULL);
+	if( pPage == m_pLegend      )	m_pLegend    ->Set_Item(NULL);
+	if( pPage == m_pAttributes  )	m_pAttributes->Set_Item(NULL);
+
+	//-----------------------------------------------------
 	for(int i=0; i<(int)GetPageCount(); i++)
 	{
 		if( GetPage(i) == pPage )
@@ -435,7 +408,6 @@ bool CACTIVE::_Hide_Page(wxWindow *pPage)
 			return( true );
 		}
 	}
-#endif
 
 	return( false );
 }
diff --git a/src/saga_core/saga_gui/active_attributes.cpp b/src/saga_core/saga_gui/active_attributes.cpp
index 8d4501e..68d1e7f 100644
--- a/src/saga_core/saga_gui/active_attributes.cpp
+++ b/src/saga_core/saga_gui/active_attributes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_attributes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active_attributes.cpp 2074 2014-03-31 10:32:12Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,12 +86,14 @@ IMPLEMENT_CLASS(CACTIVE_Attributes, wxPanel)
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CACTIVE_Attributes, wxPanel)
-	EVT_SIZE			(CACTIVE_Attributes::On_Size)
+	EVT_SIZE		(CACTIVE_Attributes::On_Size)
 
-	EVT_BUTTON			(ID_BTN_APPLY	, CACTIVE_Attributes::On_Apply)
-	EVT_UPDATE_UI		(ID_BTN_APPLY	, CACTIVE_Attributes::On_Apply_UI)
-	EVT_BUTTON			(ID_BTN_RESTORE	, CACTIVE_Attributes::On_Restore)
-	EVT_UPDATE_UI		(ID_BTN_RESTORE	, CACTIVE_Attributes::On_Restore_UI)
+	EVT_CHOICE		(ID_COMBOBOX_SELECT, CACTIVE_Attributes::On_Choice)
+
+	EVT_BUTTON		(ID_BTN_APPLY      , CACTIVE_Attributes::On_Apply)
+	EVT_UPDATE_UI	(ID_BTN_APPLY      , CACTIVE_Attributes::On_Apply_UI)
+	EVT_BUTTON		(ID_BTN_RESTORE    , CACTIVE_Attributes::On_Restore)
+	EVT_UPDATE_UI	(ID_BTN_RESTORE    , CACTIVE_Attributes::On_Restore_UI)
 END_EVENT_TABLE()
 
 
@@ -107,7 +109,8 @@ CACTIVE_Attributes::CACTIVE_Attributes(wxWindow *pParent)
 {
 	m_pAttributes	= new CSG_Table;
 	m_pControl		= new CVIEW_Table_Control(this, m_pAttributes, TABLE_CTRL_FIXED_TABLE|TABLE_CTRL_COL1ISLABEL);
-	m_pLayer		= NULL;
+
+	m_pItem			= NULL;
 
 	//-----------------------------------------------------
 	m_Btn_Apply		= new wxButton(this, ID_BTN_APPLY	, CTRL_Get_Name(ID_BTN_APPLY)	, wxPoint(0, 0));
@@ -115,6 +118,8 @@ CACTIVE_Attributes::CACTIVE_Attributes(wxWindow *pParent)
 
 	m_btn_height	= m_Btn_Apply->GetDefaultSize().y;
 
+	m_pSelections	= new wxChoice(this, ID_COMBOBOX_SELECT, wxDefaultPosition, wxDefaultSize, 0, NULL, 0);
+
 	//-----------------------------------------------------
 	m_pAttributes->Set_Modified(false);
 }
@@ -150,10 +155,21 @@ void CACTIVE_Attributes::_Set_Positions(void)
 	int		nButtons	= 2;
 	wxRect	r(wxPoint(0, 0), GetSize());
 
-	r.SetHeight(r.GetHeight() - m_btn_height);
+	if( m_pSelections->GetCount() > 0 )
+	{
+		m_pSelections->SetSize(0, 0, r.GetWidth(), m_btn_height - BUTTON_DIST);
+
+		r.SetTop(m_btn_height);
+		r.SetHeight(r.GetHeight() - m_btn_height * 2);
+	}
+	else
+	{
+		r.SetHeight(r.GetHeight() - m_btn_height);
+	}
+
 	m_pControl->SetSize(r);
 
-	r.SetTop(r.GetHeight() + BUTTON_DIST);
+	r.SetTop(r.GetBottom() + BUTTON_DIST2);
 	r.SetHeight(m_btn_height - BUTTON_DIST);
 	r.SetWidth(r.GetWidth() / nButtons - BUTTON_DIST2);
 	r.SetLeft(BUTTON_DIST);
@@ -172,7 +188,7 @@ void CACTIVE_Attributes::_Set_Positions(void)
 //---------------------------------------------------------
 void CACTIVE_Attributes::On_Apply(wxCommandEvent &event)
 {
-	_Save_Changes(false);
+	Save_Changes(false);
 }
 
 void CACTIVE_Attributes::On_Apply_UI(wxUpdateUIEvent &event)
@@ -199,13 +215,46 @@ void CACTIVE_Attributes::On_Restore_UI(wxUpdateUIEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CACTIVE_Attributes::Set_Layer(CWKSP_Layer *pLayer)
+void CACTIVE_Attributes::On_Choice(wxCommandEvent &event)
 {
-	if( m_pLayer != pLayer )
+	if( _Get_Table() && m_pSelections->GetSelection() < _Get_Table()->Get_Selection_Count() )
 	{
-		_Save_Changes(true);
+		Save_Changes(true);
 
-		m_pLayer	= pLayer;
+		m_pItem->Edit_Set_Index(m_pSelections->GetSelection());
+		m_pItem->Update_Views(false);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline CSG_Table * CACTIVE_Attributes::_Get_Table(void)
+{
+	switch( m_pItem ? m_pItem->Get_Type() : WKSP_ITEM_Undefined )
+	{
+	default:
+		return( NULL );
+
+	case WKSP_ITEM_Shapes:
+	case WKSP_ITEM_PointCloud:
+		return( (CSG_Table *)m_pItem->Get_Object() );
+	}
+}
+
+//---------------------------------------------------------
+void CACTIVE_Attributes::Set_Item(CWKSP_Layer *pItem)
+{
+	if( m_pItem != pItem )
+	{
+		Save_Changes(true);
+
+		m_pItem	= pItem;
 
 		Set_Attributes();
 	}
@@ -214,13 +263,24 @@ void CACTIVE_Attributes::Set_Layer(CWKSP_Layer *pLayer)
 //---------------------------------------------------------
 void CACTIVE_Attributes::Set_Attributes(void)
 {
-	if( m_pLayer && m_pLayer->Edit_Get_Attributes()->is_Valid() )
+	Freeze();
+
+	m_pSelections->Clear();
+
+	if( m_pItem && m_pItem->Edit_Get_Attributes()->is_Valid() )
 	{
-		_Save_Changes(true);
+		m_pAttributes->Assign(m_pItem->Edit_Get_Attributes());
+		m_pAttributes->Set_Modified(false);
 
-		m_pAttributes->Assign(m_pLayer->Edit_Get_Attributes());
+		if( _Get_Table() && _Get_Table()->Get_Selection_Count() > 1 )
+		{
+			for(int i=0; i<_Get_Table()->Get_Selection_Count(); i++)
+			{
+				m_pSelections->Append(wxString::Format("%d", i + 1));
+			}
 
-		m_pControl->Set_Labeling(m_pLayer->Get_Object()->Get_ObjectType() == DATAOBJECT_TYPE_Shapes);
+			m_pSelections->Select(m_pItem->Edit_Get_Index());
+		}
 	}
 	else
 	{
@@ -229,7 +289,15 @@ void CACTIVE_Attributes::Set_Attributes(void)
 
 	m_pAttributes->Set_Modified(false);
 
+	m_pControl->Set_Labeling(_Get_Table() != NULL);
+
 	m_pControl->Update_Table();
+
+	m_pSelections->Show(m_pSelections->GetCount() > 1);
+
+	_Set_Positions();
+
+	Thaw();
 }
 
 
@@ -240,14 +308,14 @@ void CACTIVE_Attributes::Set_Attributes(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CACTIVE_Attributes::_Save_Changes(bool bConfirm)
+void CACTIVE_Attributes::Save_Changes(bool bConfirm)
 {
-	if( m_pLayer && m_pAttributes->is_Modified() && (!bConfirm || DLG_Message_Confirm(_TL("Save changes?"), _TL("Attributes"))) )
+	if( m_pItem && m_pAttributes->is_Modified() && (!bConfirm || DLG_Message_Confirm(_TL("Save changes?"), _TL("Attributes"))) )
 	{
-		m_pLayer->Edit_Get_Attributes()->Assign_Values(m_pAttributes);
-		m_pLayer->Edit_Set_Attributes();
+		m_pItem->Edit_Get_Attributes()->Assign_Values(m_pAttributes);
+		m_pItem->Edit_Set_Attributes();
 
-		m_pAttributes->Set_Modified(false);
+		Set_Attributes();
 	}
 }
 
diff --git a/src/saga_core/saga_gui/active_attributes.h b/src/saga_core/saga_gui/active_attributes.h
index 246e050..7e8576b 100644
--- a/src/saga_core/saga_gui/active_attributes.h
+++ b/src/saga_core/saga_gui/active_attributes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_attributes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active_attributes.h 2014 2014-02-24 14:47:32Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,17 +90,21 @@ public:
 	CACTIVE_Attributes(wxWindow *pParent);
 	virtual ~CACTIVE_Attributes(void);
 
-	void						On_Size				(wxSizeEvent &event);
+	void						On_Size				(wxSizeEvent     &event);
 
-	void						On_Apply			(wxCommandEvent &event);
+	void						On_Choice			(wxCommandEvent  &event);
+
+	void						On_Apply			(wxCommandEvent  &event);
 	void						On_Apply_UI			(wxUpdateUIEvent &event);
-	void						On_Restore			(wxCommandEvent &event);
+	void						On_Restore			(wxCommandEvent  &event);
 	void						On_Restore_UI		(wxUpdateUIEvent &event);
 
-	void						Set_Layer			(class CWKSP_Layer *pLayer);
+	void						Set_Item			(class CWKSP_Layer *pItem);
 
 	void						Set_Attributes		(void);
 
+	void						Save_Changes		(bool bConfirm);
+
 
 protected:
 
@@ -108,16 +112,18 @@ protected:
 
 	class wxButton				*m_Btn_Restore, *m_Btn_Apply;
 
-	class CSG_Table				*m_pAttributes;
+	class wxChoice				*m_pSelections;
 
+	class CSG_Table				*m_pAttributes;
+	
 	class CVIEW_Table_Control	*m_pControl;
 
-	class CWKSP_Layer			*m_pLayer;
+	class CWKSP_Layer			*m_pItem;
 
 
 	void						_Set_Positions		(void);
 
-	void						_Save_Changes		(bool bConfirm);
+	class CSG_Table *			_Get_Table			(void);
 
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/active_history.cpp b/src/saga_core/saga_gui/active_history.cpp
index 5f3b817..fe9cec3 100644
--- a/src/saga_core/saga_gui/active_history.cpp
+++ b/src/saga_core/saga_gui/active_history.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_history.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active_history.cpp 2043 2014-03-05 17:17:20Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,6 +86,7 @@ enum
 {
 	IMG_ROOT	= 0,
 	IMG_NODE,
+	IMG_TOOL,
 	IMG_ENTRY,
 	IMG_GRID,
 	IMG_TABLE,
@@ -124,8 +125,9 @@ CACTIVE_History::CACTIVE_History(wxWindow *pParent)
 	: wxTreeCtrl(pParent, ID_WND_ACTIVE_HISTORY , wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS)
 {
 	AssignImageList(new wxImageList(IMG_SIZE_TREECTRL, IMG_SIZE_TREECTRL, true, 0));
-	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DATA_MANAGER);		// ROOT
+	IMG_ADD_TO_TREECTRL(ID_IMG_NB_ACTIVE_HISTORY);		// ROOT
 	IMG_ADD_TO_TREECTRL(ID_IMG_TB_MAP_ZOOM_NEXT);		// NODE
+	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_MODULE);			// TOOL
 	IMG_ADD_TO_TREECTRL(ID_IMG_TB_INFO);				// ENTRY
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_GRID);				// GRID
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_TABLE);				// TABLE
@@ -147,7 +149,7 @@ CACTIVE_History::CACTIVE_History(wxWindow *pParent)
 //---------------------------------------------------------
 void CACTIVE_History::On_Mouse_RDown(wxMouseEvent &event)
 {
-	wxMenu	Menu(_TL("Legend"));
+	wxMenu	Menu(_TL("History"));
 
 	CMD_Menu_Add_Item(&Menu, false, ID_CMD_DATA_HISTORY_CLEAR);
 
@@ -174,6 +176,7 @@ void CACTIVE_History::On_Clear(wxCommandEvent &event)
 	if( pObject && DLG_Get_Number(Depth, _TL("Delete History Entries"), _TL("Depth")) )
 	{
 		pObject->Get_History().Del_Children(Depth);
+		pObject->Set_Modified(true);
 
 		Set_Item(pItem);
 	}
@@ -260,7 +263,7 @@ bool CACTIVE_History::_Add_History(wxTreeItemId Parent, CSG_MetaData &History)
 	}
 
 	//-----------------------------------------------------
-	int					i;
+	int					i, n;
 	TSG_Parameter_Type	Type;
 	CSG_String			Name;
 	CSG_MetaData		*pEntry;
@@ -275,18 +278,15 @@ bool CACTIVE_History::_Add_History(wxTreeItemId Parent, CSG_MetaData &History)
 
 			if( pEntry->Get_Children_Count() > 0 )
 			{
-				_Add_History(AppendItem(Parent, wxString::Format(wxT("%s"), pEntry->Get_Name().c_str()), IMG_NODE), *pEntry);
+				_Add_History(AppendItem(Parent, wxString::Format("%s", pEntry->Get_Name().c_str()), IMG_NODE), *pEntry);
+			}
+			else if( !pEntry->Get_Name().Cmp(SG_T("FILE")) )
+			{
+				AppendItem(Parent, wxString::Format("%s", pEntry->Get_Content().c_str()), IMG_FILE);
 			}
 			else
 			{
-				if( !pEntry->Get_Name().Cmp(SG_T("FILE")) )
-				{
-					AppendItem(Parent, wxString::Format(wxT("%s"), pEntry->Get_Content().c_str()), IMG_FILE);
-				}
-				else
-				{
-					AppendItem(Parent, wxString::Format(wxT("[%s] %s"), pEntry->Get_Name().c_str(), pEntry->Get_Content().c_str()), IMG_ENTRY);
-				}
+				AppendItem(Parent, wxString::Format("[%s] %s", pEntry->Get_Name().c_str(), pEntry->Get_Content().c_str()), IMG_ENTRY);
 			}
 		}
 	}
@@ -294,23 +294,19 @@ bool CACTIVE_History::_Add_History(wxTreeItemId Parent, CSG_MetaData &History)
 	//-----------------------------------------------------
 	else
 	{
-		Node	= AppendItem(Parent, _TL("Module"), IMG_NODE);
-
-		AppendItem(Node, pEntry->Get_Content().c_str(), IMG_ENTRY);
-
-		Expand(Node);
+		Node	= AppendItem(Parent, pEntry->Get_Content().c_str(), IMG_TOOL);
 
 		//-------------------------------------------------
-		Node	= AppendItem(Parent, _TL("Options"), IMG_NODE);
-
-		for(i=0; i<History.Get_Children_Count(); i++)
+		for(i=0, n=0; i<History.Get_Children_Count(); i++)	// Options
 		{
 			pEntry	= History.Get_Child(i);
-			Name	= pEntry->Get_Property(SG_T("name"));
-			Type	= SG_Parameter_Type_Get_Type(pEntry->Get_Property(SG_T("type")));
+			Name	= pEntry->Get_Property("name");
+			Type	= SG_Parameter_Type_Get_Type(pEntry->Get_Property("type"));
 
-			if( !pEntry->Get_Name().Cmp(SG_T("OPTION")) )
+			if( !pEntry->Get_Name().Cmp("OPTION") )
 			{
+				n++;
+
 				switch( Type )
 				{
 				case PARAMETER_TYPE_Bool:
@@ -324,7 +320,7 @@ bool CACTIVE_History::_Add_History(wxTreeItemId Parent, CSG_MetaData &History)
 				case PARAMETER_TYPE_String:
 				case PARAMETER_TYPE_Text:
 				case PARAMETER_TYPE_FilePath:
-					AppendItem(Node, wxString::Format(wxT("%s [%s: %s]"),
+					AppendItem(Node, wxString::Format("%s [%s: %s]",
 						Name.c_str(), SG_Parameter_Type_Get_Name(Type).c_str(),
 						pEntry->Get_Content().c_str()),
 						IMG_ENTRY
@@ -332,6 +328,14 @@ bool CACTIVE_History::_Add_History(wxTreeItemId Parent, CSG_MetaData &History)
 					break;
 
 				case PARAMETER_TYPE_Grid_System:
+					if( pEntry->Get_Children_Count() == 0 )
+					{
+						AppendItem(Node, wxString::Format("%s [%s: %s]",
+							Name.c_str(), SG_Parameter_Type_Get_Name(Type).c_str(),
+							pEntry->Get_Content().c_str()),
+							IMG_ENTRY
+						);
+					}
 					break;
 
 				case PARAMETER_TYPE_FixedTable:
@@ -344,42 +348,36 @@ bool CACTIVE_History::_Add_History(wxTreeItemId Parent, CSG_MetaData &History)
 			}
 		}
 
-		if( GetChildrenCount(Node, false) == 0 )
+		if( n == 0 )
 		{
 			AppendItem(Node, _TL("no options"), IMG_ENTRY);
 		}
 
-		Expand(Node);
-
 		//-------------------------------------------------
-		Node	= AppendItem(Parent, _TL("Input Data"), IMG_NODE);
-
-		for(i=0; i<History.Get_Children_Count(); i++)
+		for(i=0; i<History.Get_Children_Count(); i++)	// Input Data
 		{
 			pEntry	= History.Get_Child(i);
-			Name	= pEntry->Get_Property(SG_T("name"));
-			Type	= SG_Parameter_Type_Get_Type(pEntry->Get_Property(SG_T("type")));
+			Name	= pEntry->Get_Property("name");
+			Type	= SG_Parameter_Type_Get_Type(pEntry->Get_Property("type"));
 
-			if( !pEntry->Get_Name().Cmp(SG_T("DATA")) )
+			if( !pEntry->Get_Name().Cmp("DATA") )
 			{
-				_Add_History(AppendItem(Node, wxString::Format(wxT("%s"), Name.c_str()), _Get_Image(Type)), *pEntry);
+				_Add_History(AppendItem(Node, wxString::Format("%s", Name.c_str()), _Get_Image(Type)), *pEntry);
 			}
-			else if( !pEntry->Get_Name().Cmp(SG_T("DATA_LIST")) )
+			else if( !pEntry->Get_Name().Cmp("DATA_LIST") )
 			{
-				wxTreeItemId	List	= AppendItem(Node, wxString::Format(wxT("%s %s"), Name.c_str(), _TL("List")), _Get_Image(Type));
-
-				for(int j=0; j<pEntry->Get_Children_Count(); j++)
+				if( pEntry->Get_Children_Count() > 0 )
 				{
-					_Add_History(AppendItem(List, wxString::Format(wxT("%d. %s"), j + 1, _TL("Item")), _Get_Image(Type)), *pEntry->Get_Child(j));
-				}
+					wxTreeItemId	List	= AppendItem(Node, wxString::Format("%s %s", Name.c_str(), _TL("List")), _Get_Image(Type));
 
-				Expand(List);
-			}
-		}
+					for(int j=0; j<pEntry->Get_Children_Count(); j++)
+					{
+						_Add_History(List, *pEntry->Get_Child(j));
+					}
 
-		if( GetChildrenCount(Node, false) == 0 )
-		{
-			AppendItem(Node, _TL("no input data"), IMG_ENTRY);
+					Expand(List);
+				}
+			}
 		}
 
 		Expand(Node);
diff --git a/src/saga_core/saga_gui/active_legend.cpp b/src/saga_core/saga_gui/active_legend.cpp
index 8fa16b2..d8ee8ec 100644
--- a/src/saga_core/saga_gui/active_legend.cpp
+++ b/src/saga_core/saga_gui/active_legend.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_legend.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active_legend.cpp 2042 2014-03-05 16:11:03Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -208,7 +208,7 @@ void CACTIVE_Legend::On_Copy(wxCommandEvent &event)
 	
 	((CWKSP_Layer *)m_pItem)->Get_Legend()->Draw(dc, m_Zoom, 1.0, p, &s);
 
-	BMP.Create(s.GetWidth() + p.x, s.GetHeight(), + p.y);
+	BMP.Create(s.GetWidth() + p.x, s.GetHeight() + p.y);
 	dc.SelectObject(BMP);
 	dc.SetBackground(*wxWHITE_BRUSH);
 	dc.Clear();
diff --git a/src/saga_core/saga_gui/active_parameters.cpp b/src/saga_core/saga_gui/active_parameters.cpp
index b576539..eb371b6 100644
--- a/src/saga_core/saga_gui/active_parameters.cpp
+++ b/src/saga_core/saga_gui/active_parameters.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_parameters.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active_parameters.cpp 2002 2014-02-19 17:06:08Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -87,6 +87,7 @@ IMPLEMENT_CLASS(CACTIVE_Parameters, wxPanel)
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CACTIVE_Parameters, wxPanel)
 	EVT_SIZE			(CACTIVE_Parameters::On_Size)
+	EVT_KEY_DOWN		(CACTIVE_Parameters::On_Key)
 
 	EVT_BUTTON			(ID_BTN_APPLY	, CACTIVE_Parameters::On_Apply)
 	EVT_UPDATE_UI		(ID_BTN_APPLY	, CACTIVE_Parameters::On_Apply_UI)
@@ -144,9 +145,22 @@ CACTIVE_Parameters::~CACTIVE_Parameters(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CACTIVE_Parameters::On_Size(wxSizeEvent &WXUNUSED(event))
+void CACTIVE_Parameters::On_Size(wxSizeEvent &event)
 {
 	_Set_Positions();
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
+void CACTIVE_Parameters::On_Key(wxKeyEvent &event)
+{
+	if( event.GetKeyCode() == WXK_RETURN && m_pItem )
+	{
+		Update_Parameters(m_pItem->Get_Parameters(), true);
+	}
+
+	event.Skip();
 }
 
 //---------------------------------------------------------
@@ -318,17 +332,21 @@ bool CACTIVE_Parameters::Update_Parameters(CSG_Parameters *pParameters, bool bSa
 {
 	if( pParameters && m_pItem && (m_pItem->Get_Parameters() == pParameters || m_pControl->Get_Parameters() == pParameters) )
 	{
+		CWKSP_Base_Item	*pItem	= m_pItem;	m_pItem	= NULL;
+
 		if( bSave )
 		{
 			m_pControl->Save_Changes(true);
 
-			m_pItem->Parameters_Changed();
+			pItem->Parameters_Changed();
 		}
 		else
 		{
 			m_pControl->Set_Parameters(pParameters);
 		}
 
+		m_pItem	= pItem;
+
 		return( true );
 	}
 
diff --git a/src/saga_core/saga_gui/active_parameters.h b/src/saga_core/saga_gui/active_parameters.h
index 5417644..50727a6 100644
--- a/src/saga_core/saga_gui/active_parameters.h
+++ b/src/saga_core/saga_gui/active_parameters.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_parameters.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: active_parameters.h 2002 2014-02-19 17:06:08Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -91,6 +91,7 @@ public:
 	virtual ~CACTIVE_Parameters(void);
 
 	void						On_Size				(wxSizeEvent     &event);
+	void						On_Key				(wxKeyEvent      &event);
 
 	void						On_Apply			(wxCommandEvent  &event);
 	void						On_Apply_UI			(wxUpdateUIEvent &event);
diff --git a/src/saga_core/saga_gui/data_source.cpp b/src/saga_core/saga_gui/data_source.cpp
index 8f69e36..dd35b30 100644
--- a/src/saga_core/saga_gui/data_source.cpp
+++ b/src/saga_core/saga_gui/data_source.cpp
@@ -159,11 +159,20 @@ void CData_Source::Add_Pages(void)
 	_Show_Page(m_pFiles);
 	_Show_Page(m_pODBC);
 	_Show_Page(m_pPgSQL);
+
+	long	lValue;
+
+	if( CONFIG_Read("/DATA/SOURCE", "TAB", lValue) )
+	{
+		SetSelection((size_t)lValue);
+	}
 }
 
 //---------------------------------------------------------
 CData_Source::~CData_Source(void)
 {
+	CONFIG_Write("/DATA/SOURCE", "TAB", (long)GetSelection());
+
 	g_pData_Source		= NULL;
 }
 
@@ -204,7 +213,7 @@ bool CData_Source::Set_Data_Source(CWKSP_Base_Item *pItem)
 		break;
 
 	case WKSP_ITEM_Module_Library:
-		m_pFiles->SetPath(((CWKSP_Module_Library *)pItem)->Get_File_Name());
+	//	m_pFiles->SetPath(((CWKSP_Module_Library *)pItem)->Get_File_Name());
 		break;
 
 	case WKSP_ITEM_Module:
diff --git a/src/saga_core/saga_gui/data_source_odbc.cpp b/src/saga_core/saga_gui/data_source_odbc.cpp
index 8506187..1363fda 100644
--- a/src/saga_core/saga_gui/data_source_odbc.cpp
+++ b/src/saga_core/saga_gui/data_source_odbc.cpp
@@ -291,7 +291,7 @@ void CData_Source_ODBC::On_Item_Menu(wxTreeEvent &event)
 	\
 	bRetVal	= false;\
 	\
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_odbc"), MODULE);\
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_odbc"), MODULE);\
 	\
 	if(	pModule )\
 	{\
@@ -459,7 +459,7 @@ void CData_Source_ODBC::Update_Source(const wxTreeItemId &Item)
 //---------------------------------------------------------
 void CData_Source_ODBC::Source_Close_All(void)
 {
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_odbc"), 11);
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_odbc"), 11);
 
 	if( pModule )
 	{
@@ -472,7 +472,7 @@ void CData_Source_ODBC::Source_Close(const wxTreeItemId &Item)
 {
 	CData_Source_ODBC_Data	*pData	= Item.IsOk() ? (CData_Source_ODBC_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;
 
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_odbc"), 1);
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_odbc"), 1);
 
 	if( pModule )
 	{
diff --git a/src/saga_core/saga_gui/data_source_pgsql.cpp b/src/saga_core/saga_gui/data_source_pgsql.cpp
index 5951a40..322da5c 100644
--- a/src/saga_core/saga_gui/data_source_pgsql.cpp
+++ b/src/saga_core/saga_gui/data_source_pgsql.cpp
@@ -107,28 +107,28 @@ enum
 //---------------------------------------------------------
 enum
 {
-	IO_PGSQL_Get_Connections	= 0,
-	IO_PGSQL_Get_Connection		= 1,
-	IO_PGSQL_Del_Connection		= 2,
-	IO_PGSQL_Del_Connections	= 3,
-	IO_PGSQL_Transaction_Start	= 4,
-	IO_PGSQL_Transaction_Stop	= 5,
-	IO_PGSQL_Execute_SQL		= 6,
-
-	IO_PGSQL_Table_List			= 10,
-	IO_PGSQL_Table_Info			= 11,
-	IO_PGSQL_Table_Load			= 12,
-	IO_PGSQL_Table_Save			= 13,
-	IO_PGSQL_Table_Drop			= 14,
-	IO_PGSQL_Table_Query		= 15,
-
-	IO_PGSQL_Shapes_Load		= 20,
-	IO_PGSQL_Shapes_Save		= 21,
-	IO_PGSQL_Shapes_SRID_Update	= 22,
-
-	IO_PGSQL_Raster_Load		= 30,
-	IO_PGSQL_Raster_Save		= 31,
-	IO_PGSQL_Raster_SRID_Update	= 32
+	DB_PGSQL_Get_Connections	= 0,
+	DB_PGSQL_Get_Connection		= 1,
+	DB_PGSQL_Del_Connection		= 2,
+	DB_PGSQL_Del_Connections	= 3,
+	DB_PGSQL_Transaction_Start	= 4,
+	DB_PGSQL_Transaction_Stop	= 5,
+	DB_PGSQL_Execute_SQL		= 6,
+
+	DB_PGSQL_Table_List			= 10,
+	DB_PGSQL_Table_Info			= 11,
+	DB_PGSQL_Table_Load			= 12,
+	DB_PGSQL_Table_Save			= 13,
+	DB_PGSQL_Table_Drop			= 14,
+	DB_PGSQL_Table_Query		= 15,
+
+	DB_PGSQL_Shapes_Load		= 20,
+	DB_PGSQL_Shapes_Save		= 21,
+	DB_PGSQL_Shapes_SRID_Update	= 22,
+
+	DB_PGSQL_Raster_Load		= 30,
+	DB_PGSQL_Raster_Save		= 31,
+	DB_PGSQL_Raster_SRID_Update	= 32
 };
 
 
@@ -143,7 +143,7 @@ enum
 	\
 	bRetVal	= false;\
 	\
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_pgsql"), MODULE);\
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_pgsql"), MODULE);\
 	\
 	if(	pModule )\
 	{\
@@ -179,7 +179,7 @@ bool	is_Connected	(const CSG_String &Server)
 	bool		bResult;
 	CSG_Table	Connections;
 
-	RUN_MODULE(IO_PGSQL_Get_Connections, bResult, SET_PARAMETER("CONNECTIONS", &Connections));	// CGet_Connections
+	RUN_MODULE(DB_PGSQL_Get_Connections, bResult, SET_PARAMETER("CONNECTIONS", &Connections));	// CGet_Connections
 
 	for(int i=0; bResult && i<Connections.Get_Count(); i++)
 	{
@@ -508,7 +508,7 @@ void CData_Source_PgSQL::Update_Sources(void)
 	bool		bResult;
 	CSG_Table	Connections;
 
-	RUN_MODULE(IO_PGSQL_Get_Connections, bResult, SET_PARAMETER("CONNECTIONS", &Connections));	// CGet_Connections
+	RUN_MODULE(DB_PGSQL_Get_Connections, bResult, SET_PARAMETER("CONNECTIONS", &Connections));	// CGet_Connections
 
 	for(int i=0; i<Connections.Get_Count(); i++)
 	{
@@ -575,7 +575,7 @@ void CData_Source_PgSQL::Update_Source(const wxTreeItemId &Item)
 		bool		bResult;
 		CSG_Table	Tables;
 
-		RUN_MODULE(IO_PGSQL_Table_List, bResult,	// CTable_List
+		RUN_MODULE(DB_PGSQL_Table_List, bResult,	// CTable_List
 				SET_PARAMETER("CONNECTION", pData->Get_Value())
 			&&	SET_PARAMETER("TABLES"    , &Tables)
 		);
@@ -631,7 +631,7 @@ void CData_Source_PgSQL::Source_Open(const wxTreeItemId &Item)
 
 	if( pData->Get_Type() == TYPE_ROOT )
 	{
-		CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_pgsql"), IO_PGSQL_Get_Connection);	// CGet_Connection
+		CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_pgsql"), DB_PGSQL_Get_Connection);	// CGet_Connection
 
 		if(	pModule && pModule->On_Before_Execution() && DLG_Parameters(pModule->Get_Parameters()) )
 		{
@@ -654,7 +654,7 @@ void CData_Source_PgSQL::Source_Open(const wxTreeItemId &Item)
 			CSG_String	Port	= pData->Get_Server().AfterLast (':').BeforeFirst(']');
 			CSG_String	Name	= pData->Get_Server().BeforeLast('['); Name.Trim(true);
 
-			RUN_MODULE(IO_PGSQL_Get_Connection, bResult,	// CGet_Connection
+			RUN_MODULE(DB_PGSQL_Get_Connection, bResult,	// CGet_Connection
 					SET_PARAMETER("PG_HOST", Host)
 				&&	SET_PARAMETER("PG_PORT", Port)
 				&&	SET_PARAMETER("PG_NAME", Name)
@@ -677,7 +677,7 @@ void CData_Source_PgSQL::Source_Close(const wxTreeItemId &Item, bool bDelete)
 
 	if( pData->is_Connected() )
 	{
-		CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_pgsql"), IO_PGSQL_Del_Connection);	// CDel_Connection
+		CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_pgsql"), DB_PGSQL_Del_Connection);	// CDel_Connection
 
 		if( pModule )
 		{
@@ -696,7 +696,7 @@ void CData_Source_PgSQL::Source_Close(const wxTreeItemId &Item, bool bDelete)
 //---------------------------------------------------------
 void CData_Source_PgSQL::Sources_Close(void)
 {
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_pgsql"), IO_PGSQL_Del_Connections);	// CDel_Connections
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_pgsql"), DB_PGSQL_Del_Connections);	// CDel_Connections
 
 	if( pModule )
 	{
@@ -723,7 +723,7 @@ void CData_Source_PgSQL::Table_Open(const wxTreeItemId &Item)
 
 		bool	bResult;
 
-		RUN_MODULE(IO_PGSQL_Table_Load, bResult,	// CTable_Load
+		RUN_MODULE(DB_PGSQL_Table_Load, bResult,	// CTable_Load
 				SET_PARAMETER("CONNECTION", pData->Get_Server())
 			&&	SET_PARAMETER("TABLES"    , pData->Get_Value())
 			&&	SET_PARAMETER("TABLE"     , pTable)
@@ -748,7 +748,7 @@ void CData_Source_PgSQL::Table_Open(const wxTreeItemId &Item)
 
 		bool	bResult;
 
-		RUN_MODULE(IO_PGSQL_Shapes_Load, bResult,	// CPGIS_Shapes_Load
+		RUN_MODULE(DB_PGSQL_Shapes_Load, bResult,	// CPGIS_Shapes_Load
 				SET_PARAMETER("CONNECTION", pData->Get_Server())
 			&&	SET_PARAMETER("TABLES"    , pData->Get_Value())
 			&&	SET_PARAMETER("SHAPES"    , pShapes)
@@ -769,7 +769,7 @@ void CData_Source_PgSQL::Table_Open(const wxTreeItemId &Item)
 	//-----------------------------------------------------
 	if( pData->Get_Type() == TYPE_GRID )
 	{
-		CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_pgsql"), IO_PGSQL_Raster_Load);	// CPGIS_Raster_Load
+		CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_pgsql"), DB_PGSQL_Raster_Load);	// CPGIS_Raster_Load
 
 		if( pModule )
 		{
@@ -794,7 +794,7 @@ void CData_Source_PgSQL::Table_Rename(const wxTreeItemId &Item)
 
 		bool	bResult;
 
-		RUN_MODULE(IO_PGSQL_Execute_SQL, bResult,
+		RUN_MODULE(DB_PGSQL_Execute_SQL, bResult,
 				SET_PARAMETER("CONNECTION", pData->Get_Server())
 			&&	SET_PARAMETER("SQL"       , SQL)
 		);
@@ -811,7 +811,7 @@ void CData_Source_PgSQL::Table_Info(const wxTreeItemId &Item)
 {
 	CData_Source_PgSQL_Data	*pData	= Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;
 
-	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("io_pgsql"), IO_PGSQL_Table_Info);
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("db_pgsql"), DB_PGSQL_Table_Info);
 
 	if( pModule )
 	{
@@ -838,7 +838,7 @@ void CData_Source_PgSQL::Table_Drop(const wxTreeItemId &Item)
 
 		bool	bResult;
 
-		RUN_MODULE(IO_PGSQL_Table_Drop, bResult,	// CTable_Drop
+		RUN_MODULE(DB_PGSQL_Table_Drop, bResult,	// CTable_Drop
 				SET_PARAMETER("CONNECTION", pData->Get_Server())
 			&&	SET_PARAMETER("TABLES"    , pData->Get_Value())
 		);
diff --git a/src/saga_core/saga_gui/dc_helper.cpp b/src/saga_core/saga_gui/dc_helper.cpp
index e538bbc..2e3b7ff 100644
--- a/src/saga_core/saga_gui/dc_helper.cpp
+++ b/src/saga_core/saga_gui/dc_helper.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dc_helper.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dc_helper.cpp 2039 2014-03-05 13:26:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -337,128 +337,175 @@ void			Draw_Text			(wxDC &dc, int Align, int x, int y, double Angle, const wxStr
 #define TEXTSPACE	6
 
 //---------------------------------------------------------
-void		Draw_Scale(wxDC &dc, wxRect r, double zMin, double zMax, bool bHorizontal, bool bAscendent, bool bTickAtTop, bool bLineConnector)
+void		Draw_Scale(wxDC &dc, const wxRect &r, double zMin, double zMax, int Orientation, int Tick, int Style, const wxString &Unit)
 {
-	int			xOff, yOff, Width, Height, Height_Tick, Decimals, zDC, yDC, Style, x, y, n;
-	double		z, dz, zToDC;
-	wxString	s;
-	wxFont		Font, oldFont;
-
 	//-----------------------------------------------------
-	Style	= bTickAtTop ? 1 : 2;
+	int	Width	= Orientation != SCALE_VERTICAL ? r.GetWidth() : r.GetHeight();
+	int	Height	= Orientation != SCALE_VERTICAL ? r.GetHeight() : r.GetWidth();
 
-	Width	= bHorizontal ? r.GetWidth() : r.GetHeight();
-	Height	= bHorizontal ? r.GetHeight() : r.GetWidth();
+	if( zMin >= zMax || Width < 5 || Height < 5 )
+	{
+		return;
+	}
 
-	if( zMin < zMax && Width > 0 && Height > 0 )
+	//-----------------------------------------------------
+	if( Style & SCALE_STYLE_GLOOMING )
 	{
-		xOff		= r.GetLeft();
-		yOff		= r.GetTop();
+		Style	^= SCALE_STYLE_GLOOMING;
 
-		oldFont		= dc.GetFont();
-		yDC			= (int)((Style == 0 ? 0.60 : 0.45) * (double)Height);
-		Font.Create(yDC, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-		dc.SetFont(Font);
+		wxRect	rTmp;
 
-		Height_Tick	= (int)((Style == 0 ? 1.00 : 0.30) * (double)Height);
+		dc.SetPen     (wxPen(*wxWHITE));
+		dc.SetTextForeground(*wxWHITE);
 
-		//-------------------------------------------------
-		zToDC		= (double)Width / (zMax - zMin);
+		rTmp	= r; rTmp.Offset( 0,  1); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset( 1,  1); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset( 1,  0); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset( 1, -1); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset( 0, -1); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset(-1, -1); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset(-1,  0); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
+		rTmp	= r; rTmp.Offset(-1,  1); Draw_Scale(dc, rTmp, zMin, zMax, Orientation, Tick, Style, Unit);
 
-		dz			= pow(10.0, floor(log10(zMax - zMin)) - 1.0);
-		Decimals	= dz >= 1.0 ? 0 : (int)floor(-log10(dz));
+		dc.SetPen     (wxPen(*wxBLACK));
+		dc.SetTextForeground(*wxBLACK);
+	}
 
-		s.Printf(wxT("%.*f"), Decimals, zMax);
-		dc.GetTextExtent(s, &zDC, &yDC);
-		while( zToDC * dz < zDC + TEXTSPACE )
-		{
-			dz	*= 2;
-		}
+	//-----------------------------------------------------
+	wxPen	oldPen  (dc.GetPen  ());
+	wxBrush	oldBrush(dc.GetBrush());
+	wxFont	oldFont (dc.GetFont ());
 
-		//-------------------------------------------------
-		z			= dz * floor(zMin / dz);
+	dc.SetFont(wxFont(
+		(int)((Tick == SCALE_TICK_NONE ? 0.60 : 0.45) * (double)Height),
+		wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL
+	));
 
-		if( Style != 0 && z < zMin )
-		{
-			z	+= dz;
-		}
+	//-----------------------------------------------------
+	double	zToDC		= (double)Width / (zMax - zMin);
+	double	dz			= pow(10.0, floor(log10(zMax - zMin)) - 1.0);
+	int		Decimals	= dz >= 1.0 ? 0 : (int)floor(-log10(dz));
 
-		if( z == z + dz )
-		{
-			return;
-		}
+	int		h	= dc.GetTextExtent(wxString::Format("%.*f", Decimals, zMax)).GetWidth();
 
-		//-------------------------------------------------
-		for(; z<=zMax; z+=dz)
-		{
-			s.Printf(wxT("%.*f"), Decimals, z);
+	while( zToDC * dz < h + TEXTSPACE )	{	dz	*= 2;	}
+
+	//-----------------------------------------------------
+	int		Align, x[2], y[2];	h	= 0;
 
-			zDC	= bAscendent ? (int)(zToDC * (z - zMin)) : Width - 1 - (int)(zToDC * (z - zMin));
+	switch( Tick )
+	{
+	default               :	Align = TEXTALIGN_TOPLEFT     ;	break;
+	case SCALE_TICK_TOP   :	Align = TEXTALIGN_TOPCENTER   ;	break;
+	case SCALE_TICK_BOTTOM:	Align = TEXTALIGN_BOTTOMCENTER;	break;
+	}
+
+	if( Orientation != SCALE_VERTICAL )
+	{
+		x[0]	= -1;	x[1]	= (int)((Tick == SCALE_TICK_NONE ? 1.00 : 0.30) * (double)Height);
+		y[0]	= r.GetTop () + (Tick != SCALE_TICK_BOTTOM ? 0    : Height);
+		y[1]	= r.GetTop () + (Tick != SCALE_TICK_BOTTOM ? x[1] : Height - x[1]);
+	}
+	else // if( Orientation == SCALE_VERTICAL )
+	{
+		y[0]	= -1;	y[1]	= (int)((Tick == SCALE_TICK_NONE ? 1.00 : 0.30) * (double)Height);
+		x[0]	= r.GetLeft() + (Tick != SCALE_TICK_BOTTOM ? 0    : Height);
+		x[1]	= r.GetLeft() + (Tick != SCALE_TICK_BOTTOM ? y[1] : Height - y[1]);
+	}
+
+	//-----------------------------------------------------
+	for(double z=dz*floor(zMin/dz); z<=zMax; z+=dz)
+	{
+		if( Tick == SCALE_TICK_NONE || z >= zMin )
+		{
+			int	zDC	= Style & SCALE_STYLE_DESCENDENT
+				? Width - 1 - (int)(zToDC * (z - zMin))
+				:             (int)(zToDC * (z - zMin));
 
-			if( bHorizontal )
+			if( Orientation != SCALE_VERTICAL )
 			{
-				x	= xOff + zDC;
-				y	= yOff;
-				n	= yOff + Height;
+				int	xLast	= x[0];	x[0] = x[1] = r.GetLeft() + zDC;
 
-				switch( Style )
+				if( Style & SCALE_STYLE_BLACKWHITE && xLast >= 0 )
 				{
-				case 0:	// ...
-					dc.DrawLine(x, y, x, y + Height_Tick);
-					Draw_Text(dc, TEXTALIGN_CENTERLEFT  , x + 2, y + Height / 2, s);
-					break;
-
-				case 1:	// tick at top...
-					dc.DrawLine(x, y, x, y + Height_Tick);
-					Draw_Text(dc, TEXTALIGN_TOPCENTER   , x, y + Height_Tick, s);
-					break;
-
-				case 2: // tick at bottom...
-					dc.DrawLine(x, n, x, n - Height_Tick);
-					Draw_Text(dc, TEXTALIGN_BOTTOMCENTER, x, n - Height_Tick, s);
-					break;
+					dc.SetBrush(h++ % 2 ? *wxWHITE : *wxBLACK);
+
+					dc.DrawRectangle(xLast, y[0], x[1] - xLast, y[1] - y[0]);
 				}
 			}
-			else
+			else // if( Orientation == SCALE_VERTICAL )
 			{
-				x	= xOff;
-				y	= yOff + zDC;
-				n	= xOff + Height;
+				int	yLast	= y[0]; y[0] = y[1] = r.GetTop () + zDC;
 
-				switch( Style )
+				if( Style & SCALE_STYLE_BLACKWHITE && yLast >= 0 )
 				{
-				case 0: // ...
-					dc.DrawLine(x, y, x + Height_Tick, y);
-					Draw_Text(dc, TEXTALIGN_CENTERLEFT  , x + Height / 2, y - 2, 90.0, s);
-					break;
-
-				case 1:	// tick at top...
-					dc.DrawLine(x, y, x + Height_Tick, y);
-					Draw_Text(dc, TEXTALIGN_TOPCENTER   , x + Height_Tick, y, 90.0, s);
-					break;
-
-				case 2: // tick at bottom...
-					dc.DrawLine(n, y, n - Height_Tick, y);
-					Draw_Text(dc, TEXTALIGN_BOTTOMCENTER, n - Height_Tick, y, 90.0, s);
-					break;
+					dc.SetBrush(h++ % 2 ? *wxWHITE : *wxBLACK);
+
+					dc.DrawRectangle(x[0], yLast, x[1] - x[0], y[1] - yLast);
 				}
 			}
+
+			if( !(Style & SCALE_STYLE_BLACKWHITE) )
+			{
+				dc.DrawLine(x[0], y[0], x[1], y[1]);
+			}
+
+			Draw_Text(dc, Align, x[1], y[1], Orientation != SCALE_VERTICAL ? 0 : 90,
+				wxString::Format("%.*f", Decimals, z)
+			);
 		}
+	}
 
-		if( bLineConnector )
+	//-----------------------------------------------------
+	if( Orientation != SCALE_VERTICAL )
+	{
+		if( Style & SCALE_STYLE_LINECONN )
+		{
+			dc.DrawLine(r.GetLeft(), y[0], x[1], y[0]);
+		}
+
+		if( !Unit.IsEmpty() )
 		{
-			if( bHorizontal )
+			if( Style & SCALE_STYLE_UNIT_BELOW )
 			{
-				dc.DrawLine(xOff, yOff, xOff + zDC, yOff);
+				Draw_Text(dc, TEXTALIGN_TOPCENTER   , r.GetLeft() + r.GetWidth() / 2, r.GetBottom(), Unit);
 			}
-			else
+			else // if( Style & SCALE_STYLE_UNIT_ABOVE )
 			{
+				Draw_Text(dc, TEXTALIGN_BOTTOMCENTER, r.GetLeft() + r.GetWidth() / 2, r.GetTop   (), Unit);
 			}
 		}
+	}
+	else
+	{
+		if( Style & SCALE_STYLE_LINECONN )
+		{
+			dc.DrawLine(x[0], r.GetTop(), x[0], y[1]);
+		}
 
-		//-------------------------------------------------
-		dc.SetFont(oldFont);
+		if( !Unit.IsEmpty() )
+		{
+			if( Style & SCALE_STYLE_UNIT_BELOW )
+			{
+				Draw_Text(dc, TEXTALIGN_TOPCENTER   , r.GetRight(), r.GetTop() + r.GetHeight() / 2, 90.0, Unit);
+			}
+			else // if( Style & SCALE_STYLE_UNIT_ABOVE )
+			{
+				Draw_Text(dc, TEXTALIGN_BOTTOMCENTER, r.GetLeft (), r.GetTop() + r.GetHeight() / 2, 90.0, Unit);
+			}
+		}
 	}
+
+	//-----------------------------------------------------
+	dc.SetPen  (oldPen  );
+	dc.SetBrush(oldBrush);
+	dc.SetFont (oldFont );
+}
+
+//---------------------------------------------------------
+void		Draw_Scale(wxDC &dc, const wxRect &r, double zMin, double zMax, bool bHorizontal, bool bAscendent, bool bTickAtTop)
+{
+	Draw_Scale(dc, r, zMin, zMax, bHorizontal ? SCALE_HORIZONTAL : SCALE_VERTICAL, bTickAtTop ? SCALE_TICK_TOP : SCALE_TICK_BOTTOM, bAscendent ? SCALE_STYLE_DEFAULT : SCALE_STYLE_DESCENDENT);
 }
 
 
diff --git a/src/saga_core/saga_gui/dc_helper.h b/src/saga_core/saga_gui/dc_helper.h
index 5f7fe22..f44fd3f 100644
--- a/src/saga_core/saga_gui/dc_helper.h
+++ b/src/saga_core/saga_gui/dc_helper.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dc_helper.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dc_helper.h 2039 2014-03-05 13:26:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -153,7 +153,27 @@ void			Draw_Text			(wxDC &dc, int Align, int x, int y, double Angle, const wxStr
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void			Draw_Scale			(wxDC &dc, wxRect r, double min_Value, double max_Value, bool bHorizontal, bool bAscendent, bool bTickAtTop, bool bLineConnector = false);
+#define SCALE_HORIZONTAL		0x00
+#define SCALE_VERTICAL			0x01
+
+//---------------------------------------------------------
+#define SCALE_TICK_NONE			0x00
+#define SCALE_TICK_TOP			0x01
+#define SCALE_TICK_BOTTOM		0x02
+
+//---------------------------------------------------------
+#define SCALE_STYLE_DEFAULT		0x00
+#define SCALE_STYLE_DESCENDENT	0x02
+#define SCALE_STYLE_LINECONN	0x04
+#define SCALE_STYLE_BLACKWHITE	0x08
+#define SCALE_STYLE_GLOOMING	0x10
+#define SCALE_STYLE_UNIT_ABOVE	0x20
+#define SCALE_STYLE_UNIT_BELOW	0x40
+
+//---------------------------------------------------------
+void			Draw_Scale			(wxDC &dc, const wxRect &r, double min_Value, double max_Value, int Orientation = SCALE_HORIZONTAL, int Tick = SCALE_TICK_NONE, int Style = SCALE_STYLE_DEFAULT, const wxString &Unit = "");
+
+void			Draw_Scale			(wxDC &dc, const wxRect &r, double min_Value, double max_Value, bool bHorizontal, bool bAscendent, bool bTickAtTop);
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_about.cpp b/src/saga_core/saga_gui/dlg_about.cpp
index 51aaec4..76de8e8 100644
--- a/src/saga_core/saga_gui/dlg_about.cpp
+++ b/src/saga_core/saga_gui/dlg_about.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_about.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_about.cpp 1978 2014-02-10 09:15:37Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -61,17 +61,10 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <wx/notebook.h>
-#include <wx/textctrl.h>
-
-#include <wx/scrolwin.h>
-#include <wx/toolbar.h>
-#include <wx/stattext.h>
-#include <wx/dcclient.h>
-#include <wx/button.h>
-#include <wx/propgrid/propgrid.h>
-
 #include <saga_api/saga_api.h>
+#include <saga_api/clipper.hpp>
+
+#include <wx/notebook.h>
 
 #include "helper.h"
 
@@ -146,8 +139,7 @@ CDLG_About::CDLG_About(void)
 
 //---------------------------------------------------------
 CDLG_About::~CDLG_About(void)
-{
-}
+{}
 
 
 ///////////////////////////////////////////////////////////
@@ -190,119 +182,111 @@ wxString CDLG_About::_Get_Version(void)
 {
 	wxString	s;
 
-	s.Append(
-		wxT("\nSAGA\n")
-		wxT("System for Automated Geoscientific Analyses\n")
-		wxT("http://www.saga-gis.org\n")
-	);
-
-	s.Append(
-		wxString::Format(wxT("\nVersion: %s\n"), SAGA_VERSION)
-	);
-
 	//-----------------------------------------------------
-	// Target
+	s	+= "\n";
+	s	+= "SAGA\n";
+	s	+= "System for Automated Geoscientific Analyses\n";
+	s	+= "http://www.saga-gis.org\n";
+	s	+= "\n";
+	s	+= "Version: " + wxString(SAGA_VERSION) + "\n";
 
 #ifdef _SAGA_MSW
 	#ifdef _WIN64
-		s	+= wxT("\n64 bit\n");
+		s	+= "\n64 bit\n";
 	#else
-		s	+= wxT("\n32 bit\n");
+		s	+= "\n32 bit\n";
 	#endif
 #endif
 
 	//-----------------------------------------------------
-	s.Append(wxT("_______________________\n\n"));
 
-	s.Append(
-		wxT("SAGA GUI\n")
-		wxT("SAGA Graphical User Interface\n")
-		wxT("\n")
-		wxT("Copyrights (c) 2005-2013 by Olaf Conrad\n")
-		wxT("Portions (c) 2008-2013 by Volker Wichmann\n")
-		wxT("\n")
-		wxT("GNU General Public License (GPL)\n")
-	);
+	s	+= "_______________________\n\n";
 
-	s.Append(wxT("_______________________\n\n"));
+	s	+= "SAGA GUI\n";
+	s	+= "SAGA Graphical User Interface\n";
+	s	+= "\n";
+	s	+= "Copyrights (c) 2005-2014 by Olaf Conrad\n";
+	s	+= "Portions (c) 2008-2014 by Volker Wichmann\n";
+	s	+= "\n";
+	s	+= "GNU General Public License (GPL)\n";
 
-	s.Append(
-		wxT("SAGA API\n")
-		wxT("SAGA Application Programming Interface\n")
-		wxT("\n")
-		wxT("Copyrights (c) 2002-2013 by Olaf Conrad\n")
-		wxT("Portions (c) 2008-2013 by Volker Wichmann\n")
-		wxT("Portions (c) 2005-2006 by Victor Olaya\n")
-		wxT("Portions (c) 2002 by Andre Ringeler\n")	// " (mat_formula.cpp)\n")
-		wxT("\n")
-		wxT("GNU Lesser General Public License (LGPL)\n")
-	);
+	s	+= "_______________________\n\n";
 
-	s.Append(wxT("_______________________\n\n"));
+	s	+= "SAGA API\n";
+	s	+= "SAGA Application Programming Interface\n";
+	s	+= "\n";
+	s	+= "Copyrights (c) 2002-2014 by Olaf Conrad\n";
+	s	+= "Portions (c) 2008-2014 by Volker Wichmann\n";
+	s	+= "Portions (c) 2005-2006 by Victor Olaya\n";
+	s	+= "Portions (c) 2002 by Andre Ringeler\n";	// " (mat_formula.cpp)\n";
+	s	+= "\n";
+	s	+= "GNU Lesser General Public License (LGPL)\n";
 
-	s.Append(
-		wxT("SAGA uses the portable C++ GUI toolkit\n")
-		wxVERSION_STRING	wxT("\n")
-		wxT("http://www.wxwidgets.org/\n")
-		wxT("\n")
-		wxT("SAGA API includes the polygon clipping and offsetting library\n")
-		wxT("Clipper 6.0.0\n")
-		wxT("http://sourceforge.net/projects/polyclipping/\n")
-	);
+	s	+= "_______________________\n\n";
 
-	s.Append(wxT("_______________________\n\n"));
+	s	+= "SAGA uses the portable C++ GUI toolkit\n";
+	s	+= wxVERSION_STRING	+ wxString("\n");
+	s	+= "http://www.wxwidgets.org/\n";
+	s	+= "\n";
+	s	+= "SAGA API includes the polygon clipping and offsetting library\n";
+	s	+= "Clipper " + wxString(CLIPPER_VERSION) + "\n";
+	s	+= "http://sourceforge.net/projects/polyclipping/\n";
 
-	s.Append(
-		wxT("Compiled with\n")
+	s	+= "_______________________\n\n";
+
+	s	+= "Compiled with\n"
 		#  if	defined(__BORLANDC__)
-			wxT("Borland C++")
+			"Borland C++"
 		#elif	defined(__DJGPP__)
-			wxT("DJGPP")
+			"DJGPP"
 		#elif	defined(__DIGITALMARS__)
-			wxT("Digital Mars")
+			"Digital Mars"
 		#elif	defined(__MINGW32__)
-			wxT("MinGW")
+			"MinGW"
 		#elif	defined(__GNUWIN32__)
-			wxT("Gnu-Win32 compiler")
+			"Gnu-Win32 compiler"
 		#elif	defined(__GNUG__)
-			wxT("Gnu C++")
+			"Gnu C++"
 		#elif	defined(__MWERKS__)
-			wxT("CodeWarrior MetroWerks compiler")
+			"CodeWarrior MetroWerks compiler"
 		#elif	defined(__SUNCC__)
-			wxT("Sun CC")
+			"Sun CC"
 		#elif	defined(__SYMANTECC__)
-			wxT("Symantec C++")
+			"Symantec C++"
 		#elif	defined(__VISAGECPP__)
-			wxT("IBM Visual Age (OS/2)")
+			"IBM Visual Age (OS/2)"
 		#elif	defined(__VISUALC__)	// The value of this macro corresponds to the compiler version: 1020 for 4.2 (the first supported version), 1100 for 5.0, 1200 for 6.0 and so on
 			#if   __VISUALC__ == 1020
-				wxT("Microsoft Visual C++ 4.2")
+				"Microsoft Visual C++ 4.2"
 			#elif __VISUALC__ >= 1100 && __VISUALC__ < 1200
-				wxT("Microsoft Visual C++ 5")
+				"Microsoft Visual C++ 5"
 			#elif __VISUALC__ >= 1200 && __VISUALC__ < 1300
-				wxT("Microsoft Visual C++ 6")
+				"Microsoft Visual C++ 6"
 			#elif __VISUALC__ >= 1300 && __VISUALC__ < 1400
-				wxT("Microsoft Visual C++ 7")
+				"Microsoft Visual C++ 7"
 			#elif __VISUALC__ >= 1400 && __VISUALC__ < 1500
-				wxT("Microsoft Visual C++ 8")
+				"Microsoft Visual C++ 8"
 			#elif __VISUALC__ >= 1500 && __VISUALC__ < 1600
-				wxT("Microsoft Visual C++ 9")
+				"Microsoft Visual C++ 9"
 			#elif __VISUALC__ >= 1600 && __VISUALC__ < 1700
-				wxT("Microsoft Visual C++ 10")
+				"Microsoft Visual C++ 2010"
+			#elif __VISUALC__ >= 1700 && __VISUALC__ < 1800
+				"Microsoft Visual C++ 2012"
+			#elif __VISUALC__ >= 1800 && __VISUALC__ < 1900
+				"Microsoft Visual C++ 2013"
 			#else
-				wxT("Microsoft Visual C++")
+				"Microsoft Visual C++"
 			#endif
 		#elif	defined(__XLC__)
-			wxT("AIX compiler")
+			"AIX compiler"
 		#elif	defined(__WATCOMC__)
-			wxT("Watcom C++")
+			"Watcom C++"
 		#elif	defined(_WIN32_WCE)
-			wxT("Windows CE version")
+			"Windows CE version"
 		#else
-			wxT("unknown compiler")
+			"unknown compiler"
 		#endif
-		wxT("\n")
-	);
+	"\n";
 
 	return( s );
 }
diff --git a/src/saga_core/saga_gui/dlg_base.cpp b/src/saga_core/saga_gui/dlg_base.cpp
index aecc02b..facaf14 100644
--- a/src/saga_core/saga_gui/dlg_base.cpp
+++ b/src/saga_core/saga_gui/dlg_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_base.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_base.cpp 2002 2014-02-19 17:06:08Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -89,6 +89,7 @@ IMPLEMENT_CLASS(CDLG_Base, wxDialog)
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CDLG_Base, wxDialog)
 	EVT_SIZE			(CDLG_Base::On_Size)
+	EVT_KEY_DOWN		(CDLG_Base::On_Key)
 
 	EVT_BUTTON			(wxID_OK		, CDLG_Base::On_Ok)
 	EVT_BUTTON			(wxID_CANCEL	, CDLG_Base::On_Cancel)
@@ -163,6 +164,19 @@ void CDLG_Base::On_Size(wxSizeEvent &event)
 }
 
 //---------------------------------------------------------
+void CDLG_Base::On_Key(wxKeyEvent &event)
+{
+	if( event.GetKeyCode() == WXK_RETURN )
+	{
+		_Exit(true);
+	}
+	else
+	{
+		event.Skip();
+	}
+}
+
+//---------------------------------------------------------
 void CDLG_Base::Set_Positions(void)
 {
 	int		xDivide, yTotal;
@@ -175,11 +189,6 @@ void CDLG_Base::Set_Positions(void)
 	Set_Position(wxRect(CONTROL_DIST, CONTROL_DIST, xDivide - 2 * CONTROL_DIST, yTotal));
 }
 
-//---------------------------------------------------------
-void CDLG_Base::Set_Position(wxRect r)
-{
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -214,11 +223,6 @@ void CDLG_Base::_Exit(bool bOk)
 	}
 }
 
-//---------------------------------------------------------
-void CDLG_Base::Save_Changes(void)
-{
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_gui/dlg_base.h b/src/saga_core/saga_gui/dlg_base.h
index ca218dc..dcff762 100644
--- a/src/saga_core/saga_gui/dlg_base.h
+++ b/src/saga_core/saga_gui/dlg_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_base.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_base.h 2002 2014-02-19 17:06:08Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,7 +90,8 @@ public:
 	CDLG_Base(int ID_WMD, wxString Caption, bool bCancelBtn = true);
 	virtual ~CDLG_Base(void);
 
-	void						On_Size			(wxSizeEvent &event);
+	void						On_Size			(wxSizeEvent    &event);
+	void						On_Key			(wxKeyEvent     &event);
 
 	void						On_Ok			(wxCommandEvent &event);
 	void						On_Cancel		(wxCommandEvent &event);
@@ -101,9 +102,9 @@ protected:
 	void						Add_Button		(int Button_ID);
 
 	void						Set_Positions	(void);
-	virtual void				Set_Position	(wxRect r);
+	virtual void				Set_Position	(wxRect r)	{}
 
-	virtual void				Save_Changes	(void);
+	virtual void				Save_Changes	(void)		{}
 
 
 private:
diff --git a/src/saga_core/saga_gui/dlg_list_base.cpp b/src/saga_core/saga_gui/dlg_list_base.cpp
index 5745933..ca7f98d 100644
--- a/src/saga_core/saga_gui/dlg_list_base.cpp
+++ b/src/saga_core/saga_gui/dlg_list_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_base.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_base.cpp 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -125,7 +125,13 @@ CDLG_List_Base::CDLG_List_Base(CSG_Parameter_List *pList, wxString Caption)
 	//-----------------------------------------------------
 	for(int i=m_pList->Get_Count()-1; i>=0; i--)
 	{
-		if( !SG_Get_Data_Manager().Exists(m_pList->asDataObject(i)) )
+		CWKSP_Data_Item	*pItem	= g_pData->Get(m_pList->asDataObject(i));
+
+		if( pItem && SG_Get_Data_Manager().Exists(m_pList->asDataObject(i)) )
+		{
+			m_pAdd->Insert(pItem->Get_Name(), 0, (void *)m_pList->asDataObject(i));
+		}
+		else
 		{
 			m_pList->Del_Item(i);
 		}
@@ -135,11 +141,6 @@ CDLG_List_Base::CDLG_List_Base(CSG_Parameter_List *pList, wxString Caption)
 	Set_Positions();
 }
 
-//---------------------------------------------------------
-CDLG_List_Base::~CDLG_List_Base(void)
-{
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -180,32 +181,49 @@ void CDLG_List_Base::Set_Position(wxRect r)
 	m_pBtn_Down->SetSize(r);
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-void CDLG_List_Base::Save_Changes(void)
+void CDLG_List_Base::Set_Data(CWKSP_Base_Manager *pManager)
 {
-	m_pList->Del_Items();
-
-	for(unsigned int i=0; i<m_pAdd->GetCount(); i++)
+	if( pManager )
 	{
-		switch( m_pList->Get_Type() )
+		for(int iItem=0; iItem<pManager->Get_Count(); iItem++)
 		{
-		case PARAMETER_TYPE_Grid_List:			m_pList->Add_Item(((CWKSP_Grid       *)m_pAdd->GetClientData(i))->Get_Grid      ());	break;
-		case PARAMETER_TYPE_Table_List:			m_pList->Add_Item(((CWKSP_Table      *)m_pAdd->GetClientData(i))->Get_Table     ());	break;
-		case PARAMETER_TYPE_TIN_List:			m_pList->Add_Item(((CWKSP_TIN        *)m_pAdd->GetClientData(i))->Get_TIN       ());	break;
-		case PARAMETER_TYPE_PointCloud_List:	m_pList->Add_Item(((CWKSP_PointCloud *)m_pAdd->GetClientData(i))->Get_PointCloud());	break;
-		case PARAMETER_TYPE_Shapes_List:
-			switch( ((CWKSP_Base_Item *)m_pAdd->GetClientData(i))->Get_Type() )
+			CWKSP_Data_Item	*pItem	= (CWKSP_Data_Item *)pManager->Get_Item(iItem);
+
+			for(size_t j=0; j<m_pAdd->GetCount() && pItem; j++)
 			{
-			case WKSP_ITEM_Shapes:				m_pList->Add_Item(((CWKSP_Shapes     *)m_pAdd->GetClientData(i))->Get_Shapes    ());	break;
-			case WKSP_ITEM_PointCloud:			m_pList->Add_Item(((CWKSP_PointCloud *)m_pAdd->GetClientData(i))->Get_PointCloud());	break;
-			default:	break;
+				if( pItem->Get_Object() == m_pAdd->GetClientData(j) )
+				{
+					pItem	= NULL;
+				}
+			}
+
+			if( pItem )
+			{
+				m_pSelect->Append(pItem->Get_Name(), (void *)pItem->Get_Object());
 			}
-			break;
-		default:	return;
 		}
 	}
 }
 
+//---------------------------------------------------------
+void CDLG_List_Base::Save_Changes(void)
+{
+	m_pList->Del_Items();
+
+	for(unsigned int i=0; i<m_pAdd->GetCount(); i++)
+	{
+		m_pList->Add_Item((CSG_Data_Object *)m_pAdd->GetClientData(i));
+	}
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -245,16 +263,15 @@ void CDLG_List_Base::On_Del(wxCommandEvent &event)
 
 void CDLG_List_Base::_Del(void)
 {
-	int			i, j, n;
 	wxArrayInt	Selections;
 
-	if( (n = m_pAdd->GetSelections(Selections)) > 0 )
+	if( m_pAdd->GetSelections(Selections) > 0 )
 	{
 		Selections.Sort(ArrayInt_CMP_Down);
 
-		for(i=0; i<n; i++)
+		for(size_t i=0; i<Selections.GetCount(); i++)
 		{
-			j	= Selections.Item(i);
+			size_t	j	= Selections.Item(i);
 
 			m_pSelect->Append(m_pAdd->GetString(j), m_pAdd->GetClientData(j));
 			m_pAdd->Delete(j);
@@ -285,18 +302,17 @@ void CDLG_List_Base::On_Add(wxCommandEvent &event)
 
 void CDLG_List_Base::_Add(void)
 {
-	int			i, j, n, m;
 	wxArrayInt	Selections;
 
-	if( (n = m_pSelect->GetSelections(Selections)) > 0 )
+	if( m_pSelect->GetSelections(Selections) > 0 )
 	{
 		Selections.Sort(ArrayInt_CMP_Down);
 
-		for(i=0, m=m_pAdd->GetCount(); i<n; i++)
+		for(size_t i=0, Position=m_pAdd->GetCount(); i<Selections.GetCount(); i++)
 		{
-			j	= Selections.Item(i);
+			size_t	j	= Selections.Item(i);
 
-			m_pAdd->Insert(m_pSelect->GetString(j), m, m_pSelect->GetClientData(j));
+			m_pAdd->Insert(m_pSelect->GetString(j), Position, m_pSelect->GetClientData(j));
 			m_pSelect->Delete(j);
 		}
 	}
@@ -322,31 +338,28 @@ void CDLG_List_Base::On_Add_All(wxCommandEvent &event)
 //---------------------------------------------------------
 void CDLG_List_Base::On_Up(wxCommandEvent &event)
 {
-	void			*pData;
-	unsigned int	i, j, n;
-	wxArrayInt		Selections;
-	wxString		String;
+	wxArrayInt	Selections;
 
-	if( (n = m_pAdd->GetSelections(Selections)) > 0 && n < m_pAdd->GetCount() )
+	if( m_pAdd->GetSelections(Selections) > 0 && Selections.GetCount() < m_pAdd->GetCount() )
 	{
 		Selections.Sort(ArrayInt_CMP_Up);
 
 		if( Selections.Item(0) > 0 )
 		{
-			for(i=0; i<n; i++)
+			for(size_t i=0; i<Selections.GetCount(); i++)
 			{
-				j		= Selections.Item(i);
+				size_t	j	= Selections.Item(i);
 
-				String	= m_pAdd->GetString(j);
-				m_pAdd->SetString(j, m_pAdd->GetString(j - 1));
-				m_pAdd->SetString(j - 1, String);
+				wxString	String	= m_pAdd->GetString    (j);
+				void		*pData	= m_pAdd->GetClientData(j);
 
-				pData	= m_pAdd->GetClientData(j);
-				m_pAdd->SetClientData(j, m_pAdd->GetClientData(j - 1));
-				m_pAdd->SetClientData(j - 1, pData);
+				m_pAdd->SetString    (j    , m_pAdd->GetString    (j - 1));
+				m_pAdd->SetClientData(j    , m_pAdd->GetClientData(j - 1));
+				m_pAdd->SetSelection (j    , m_pAdd->IsSelected   (j - 1));
 
-				m_pAdd->SetSelection(j - 1, true);
-				m_pAdd->SetSelection(j, false);
+				m_pAdd->SetString    (j - 1, String);
+				m_pAdd->SetClientData(j - 1, pData);
+				m_pAdd->SetSelection (j - 1, true);
 			}
 		}
 	}
@@ -355,31 +368,28 @@ void CDLG_List_Base::On_Up(wxCommandEvent &event)
 //---------------------------------------------------------
 void CDLG_List_Base::On_Down(wxCommandEvent &event)
 {
-	void		*pData;
-	int			i, j, n;
 	wxArrayInt	Selections;
-	wxString	String;
 
-	if( (n = m_pAdd->GetSelections(Selections)) > 0 && n < (int)m_pAdd->GetCount() )
+	if( m_pAdd->GetSelections(Selections) > 0 && Selections.GetCount() < m_pAdd->GetCount() )
 	{
 		Selections.Sort(ArrayInt_CMP_Down);
 
-		if( Selections.Item(0) < (int)m_pAdd->GetCount() - 1 )
+		if( Selections.Item(0) < m_pAdd->GetCount() - 1 )
 		{
-			for(i=0; i<(int)Selections.GetCount(); i++)
+			for(size_t i=0; i<Selections.GetCount(); i++)
 			{
-				j		= Selections.Item(i);
+				size_t	j	= Selections.Item(i);
 
-				String	= m_pAdd->GetString(j);
-				m_pAdd->SetString(j, m_pAdd->GetString(j + 1));
-				m_pAdd->SetString(j + 1, String);
+				wxString	String	= m_pAdd->GetString(j);
+				void		*pData	= m_pAdd->GetClientData(j);
 
-				pData	= m_pAdd->GetClientData(j);
-				m_pAdd->SetClientData(j, m_pAdd->GetClientData(j + 1));
-				m_pAdd->SetClientData(j + 1, pData);
+				m_pAdd->SetString    (j    , m_pAdd->GetString    (j + 1));
+				m_pAdd->SetClientData(j    , m_pAdd->GetClientData(j + 1));
+				m_pAdd->SetSelection (j    , m_pAdd->IsSelected   (j + 1));
 
-				m_pAdd->SetSelection(j + 1, true);
-				m_pAdd->SetSelection(j, false);
+				m_pAdd->SetString    (j + 1, String);
+				m_pAdd->SetClientData(j + 1, pData);
+				m_pAdd->SetSelection (j + 1, true);
 			}
 		}
 	}
diff --git a/src/saga_core/saga_gui/dlg_list_base.h b/src/saga_core/saga_gui/dlg_list_base.h
index 59b5dc0..7b750fe 100644
--- a/src/saga_core/saga_gui/dlg_list_base.h
+++ b/src/saga_core/saga_gui/dlg_list_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_base.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_base.h 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -102,7 +102,6 @@ class CDLG_List_Base : public CDLG_Base
 
 public:
 	CDLG_List_Base(class CSG_Parameter_List *pList, wxString Caption);
-	virtual ~CDLG_List_Base(void);
 
 	void						On_DClick_Add	(wxCommandEvent &event);
 	void						On_Add			(wxCommandEvent &event);
@@ -116,10 +115,6 @@ public:
 
 protected:
 
-	int							m_btn_height;
-
-	wxButton					*m_pBtn_Add, *m_pBtn_Add_All, *m_pBtn_Del, *m_pBtn_Del_All, *m_pBtn_Up, *m_pBtn_Down;
-
 	wxListBox					*m_pAdd, *m_pSelect;
 
 	class CSG_Parameter_List	*m_pList;
@@ -127,9 +122,17 @@ protected:
 
 	virtual void				Set_Position	(wxRect r);
 
-	virtual void				Save_Changes	(void);
+	void						Set_Data		(class CWKSP_Base_Manager *pManager);
+
+	void						Save_Changes	(void);
+
+
+private:
+
+	int							m_btn_height;
+
+	wxButton					*m_pBtn_Add, *m_pBtn_Add_All, *m_pBtn_Del, *m_pBtn_Del_All, *m_pBtn_Up, *m_pBtn_Down;
 
-	virtual void				_Set_Objects	(void)	= 0;
 
 	void						_Add			(void);
 	void						_Del			(void);
diff --git a/src/saga_core/saga_gui/dlg_list_grid.cpp b/src/saga_core/saga_gui/dlg_list_grid.cpp
index 5e9d24d..44e9a41 100644
--- a/src/saga_core/saga_gui/dlg_list_grid.cpp
+++ b/src/saga_core/saga_gui/dlg_list_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_grid.cpp 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -97,41 +97,33 @@ END_EVENT_TABLE()
 CDLG_List_Grid::CDLG_List_Grid(CSG_Parameter_Grid_List *pList, wxString Caption)
 	: CDLG_List_Base(pList, Caption)
 {
-	CWKSP_Grid_Manager	*pManager;
+	CWKSP_Grid_Manager	*pManager	= g_pData->Get_Grids();
 
-	if( (pManager = g_pData->Get_Grids()) != NULL )
+	if( pManager == NULL )
 	{
-		if( pList->Get_System() )
-		{
-			m_pSystem	= pManager->Get_System(*pList->Get_System());
-			m_pSystems	= NULL;
-		}
-		else
-		{
-			m_pSystem	= NULL;
-			m_pSystems	= new wxChoice(this, ID_COMBOBOX_SELECT, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
-
-			for(int i=0; i<pManager->Get_Count(); i++)
-			{
-				m_pSystems->Append(pManager->Get_System(i)->Get_Name());
-			}
-
-			m_pSystems->Append( _TL("<all grid systems>") );
-			m_pSystems->SetSelection(m_pSystems->GetCount() - 1);
-		}
-
-		_Set_Objects();
+		m_pSystem  = NULL;
+		m_pSystems = NULL;
+	}
+	else if( pList->Get_System() )
+	{
+		m_pSystem	= pManager->Get_System(*pList->Get_System());
+		m_pSystems	= NULL;
 	}
 	else
 	{
-		m_pSystem  = NULL;
-		m_pSystems = NULL;
+		m_pSystem	= NULL;
+		m_pSystems	= new wxChoice(this, ID_COMBOBOX_SELECT, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
+
+		for(int i=0; i<pManager->Get_Count(); i++)
+		{
+			m_pSystems->Append(pManager->Get_System(i)->Get_Name());
+		}
+
+		m_pSystems->Append( _TL("<all grid systems>") );
+		m_pSystems->SetSelection(m_pSystems->GetCount() - 1);
 	}
-}
 
-//---------------------------------------------------------
-CDLG_List_Grid::~CDLG_List_Grid(void)
-{
+	_Set_Data();
 }
 
 
@@ -168,7 +160,7 @@ void CDLG_List_Grid::Set_Position(wxRect r)
 //---------------------------------------------------------
 void CDLG_List_Grid::On_Select_System(wxCommandEvent &event)
 {
-	_Set_Grids();
+	_Set_Data();
 }
 
 
@@ -179,77 +171,33 @@ void CDLG_List_Grid::On_Select_System(wxCommandEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CDLG_List_Grid::_Set_Objects(void)
+void CDLG_List_Grid::_Set_Data(void)
 {
-	//-----------------------------------------------------
-	for(int i=0; i<m_pList->Get_Count(); i++)
-	{
-		CWKSP_Base_Item	*pItem	= g_pData->Get(m_pList->asDataObject(i)->asGrid());
-
-		if( pItem )
-		{
-			m_pAdd->Append(pItem->Get_Name(), (void *)pItem);
-		}
-	}
+	m_pSelect->Clear();
 
-	//-----------------------------------------------------
-	if( ((CSG_Parameter_Grid_List *)m_pList)->Get_System() )
+	if( m_pSystem )
 	{
-		_Set_Grids(m_pSystem);
+		Set_Data(m_pSystem);
 	}
-	else
+	else if( m_pSystems )
 	{
-		_Set_Grids();
-	}
-}
-
-//---------------------------------------------------------
-void CDLG_List_Grid::_Set_Grids(void)
-{
-	CWKSP_Grid_Manager	*pManager;
+		CWKSP_Grid_Manager	*pManager	= g_pData->Get_Grids();
 
-	m_pSelect->Clear();
-
-	if( (pManager = g_pData->Get_Grids()) != NULL )
-	{
-		int		i;
-
-		if( !m_pSystems || (i = m_pSystems->GetSelection()) >= pManager->Get_Count() || i < 0 )
+		if( pManager )
 		{
-			for(i=0; i<pManager->Get_Count(); i++)
+			int	iSystem	= m_pSystems->GetSelection();
+
+			if( 0 <= iSystem && iSystem < pManager->Get_Count() )
 			{
-				_Set_Grids(pManager->Get_System(i));
+				Set_Data(pManager->Get_System(iSystem));
 			}
-		}
-		else
-		{
-			_Set_Grids(pManager->Get_System(i));
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CDLG_List_Grid::_Set_Grids(CWKSP_Grid_System *pSystem)
-{
-	if( pSystem )
-	{
-		for(int i=0; i<pSystem->Get_Count(); i++)
-		{
-			bool		bList	= true;
-			CWKSP_Grid	*pGrid	= pSystem->Get_Data(i);
-
-			for(int j=0; j<(int)m_pAdd->GetCount() && bList; j++)
+			else
 			{
-				if( pGrid == m_pAdd->GetClientData(j) )
+				for(iSystem=0; iSystem<pManager->Get_Count(); iSystem++)
 				{
-					bList	= false;
+					Set_Data(pManager->Get_System(iSystem));
 				}
 			}
-
-			if( bList )
-			{
-				m_pSelect->Append(pGrid->Get_Name(), (void *)pGrid);
-			}
 		}
 	}
 }
diff --git a/src/saga_core/saga_gui/dlg_list_grid.h b/src/saga_core/saga_gui/dlg_list_grid.h
index a8eb2e9..927f5af 100644
--- a/src/saga_core/saga_gui/dlg_list_grid.h
+++ b/src/saga_core/saga_gui/dlg_list_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_grid.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_grid.h 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,7 +90,6 @@ class CDLG_List_Grid : public CDLG_List_Base
 
 public:
 	CDLG_List_Grid(CSG_Parameter_Grid_List *pList, wxString Caption);
-	virtual ~CDLG_List_Grid(void);
 
 	void						On_Select_System	(wxCommandEvent &event);
 
@@ -104,10 +103,7 @@ protected:
 
 	virtual void				Set_Position		(wxRect r);
 
-	virtual void				_Set_Objects		(void);
-
-	void						_Set_Grids			(void);
-	void						_Set_Grids			(class CWKSP_Grid_System *pSystem);
+	void						_Set_Data			(void);
 
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/dlg_list_pointcloud.cpp b/src/saga_core/saga_gui/dlg_list_pointcloud.cpp
index 153c035..5972fa9 100644
--- a/src/saga_core/saga_gui/dlg_list_pointcloud.cpp
+++ b/src/saga_core/saga_gui/dlg_list_pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_pointcloud.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_pointcloud.cpp 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -65,7 +65,6 @@
 
 #include "wksp_data_manager.h"
 #include "wksp_pointcloud_manager.h"
-#include "wksp_pointcloud.h"
 
 #include "dlg_list_pointcloud.h"
 
@@ -94,61 +93,7 @@ END_EVENT_TABLE()
 CDLG_List_PointCloud::CDLG_List_PointCloud(CSG_Parameter_PointCloud_List *pList, wxString Caption)
 	: CDLG_List_Base(pList, Caption)
 {
-	_Set_Objects();
-}
-
-//---------------------------------------------------------
-CDLG_List_PointCloud::~CDLG_List_PointCloud(void)
-{
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CDLG_List_PointCloud::_Set_Objects(void)
-{
-	bool						bList;
-	int							i, j;
-	CWKSP_PointCloud_Manager	*pPointClouds;
-	CWKSP_PointCloud			*pPointCloud;
-
-	//-----------------------------------------------------
-	if( (pPointClouds = g_pData->Get_PointClouds()) != NULL )
-	{
-		for(i=0; i<m_pList->Get_Count(); i++)
-		{
-			CWKSP_Base_Item	*pItem	= g_pData->Get(m_pList->asDataObject(i)->asPointCloud());
-
-			if( pItem )
-			{
-				m_pAdd->Append(pItem->Get_Name(), (void *)pItem);
-			}
-		}
-
-		//-------------------------------------------------
-		for(i=0; i<pPointClouds->Get_Count(); i++)
-		{
-			pPointCloud	= pPointClouds->Get_Data(i);
-
-			for(j=0, bList=true; j<(int)m_pAdd->GetCount() && bList; j++)
-			{
-				if( pPointCloud == m_pAdd->GetClientData(j) )
-				{
-					bList	= false;
-				}
-			}
-
-			if( bList )
-			{
-				m_pSelect->Append(pPointCloud->Get_Name(), (void *)pPointCloud);
-			}
-		}
-	}
+	Set_Data(g_pData->Get_PointClouds());
 }
 
 
diff --git a/src/saga_core/saga_gui/dlg_list_pointcloud.h b/src/saga_core/saga_gui/dlg_list_pointcloud.h
index ae24d5f..fedf5f4 100644
--- a/src/saga_core/saga_gui/dlg_list_pointcloud.h
+++ b/src/saga_core/saga_gui/dlg_list_pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_pointcloud.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_pointcloud.h 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -88,13 +88,10 @@ class CDLG_List_PointCloud : public CDLG_List_Base
 
 public:
 	CDLG_List_PointCloud(CSG_Parameter_PointCloud_List *pList, wxString Caption);
-	virtual ~CDLG_List_PointCloud(void);
 
 
 protected:
 
-	virtual void				_Set_Objects(void);
-
 
 //---------------------------------------------------------
 DECLARE_EVENT_TABLE()
diff --git a/src/saga_core/saga_gui/dlg_list_shapes.cpp b/src/saga_core/saga_gui/dlg_list_shapes.cpp
index c8af153..a83912a 100644
--- a/src/saga_core/saga_gui/dlg_list_shapes.cpp
+++ b/src/saga_core/saga_gui/dlg_list_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_shapes.cpp 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -99,12 +99,7 @@ CDLG_List_Shapes::CDLG_List_Shapes(CSG_Parameter_Shapes_List *pList, wxString Ca
 {
 	m_Shape_Type	= pList->Get_Shape_Type();
 
-	_Set_Objects();
-}
-
-//---------------------------------------------------------
-CDLG_List_Shapes::~CDLG_List_Shapes(void)
-{
+	_Set_Data();
 }
 
 
@@ -115,74 +110,32 @@ CDLG_List_Shapes::~CDLG_List_Shapes(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CDLG_List_Shapes::_Set_Objects(void)
+void CDLG_List_Shapes::_Set_Data(void)
 {
-	int					i;
-	CWKSP_Base_Item		*pItem;
-	CWKSP_Base_Manager	*pManager;
+	CWKSP_Shapes_Manager	*pManager	= g_pData->Get_Shapes();
 
-	//-----------------------------------------------------
-	for(i=0; i<m_pList->Get_Count(); i++)
-	{
-		if(	(pItem = g_pData->Get(m_pList->asDataObject(i)->asShapes    ())) != NULL
-		||	(pItem = g_pData->Get(m_pList->asDataObject(i)->asPointCloud())) != NULL )
-		{
-			m_pAdd->Append(pItem->Get_Name(), (void *)pItem);
-		}
-	}
-
-	//-----------------------------------------------------
 	if( m_Shape_Type == SHAPE_TYPE_Undefined )
 	{
-		if( (pManager = g_pData->Get_Shapes()) != NULL )
+		if( pManager )
 		{
-			for(i=0; i<pManager->Get_Count(); i++)
+			for(int i=0; i<pManager->Get_Count(); i++)
 			{
-				_Set_Shapes((CWKSP_Shapes_Type *)pManager->Get_Item(i));
+				Set_Data((CWKSP_Shapes_Type *)pManager->Get_Item(i));
 			}
 		}
 
-		if( (pManager = g_pData->Get_PointClouds()) != NULL )
-		{
-			_Set_Shapes(pManager);
-		}
+		Set_Data(g_pData->Get_PointClouds());
 	}
 	else
 	{
-		if( (pManager = g_pData->Get_Shapes()) != NULL )
+		if( pManager )
 		{
-			_Set_Shapes(((CWKSP_Shapes_Manager *)pManager)->Get_Shapes_Type(m_Shape_Type));
+			Set_Data(pManager->Get_Shapes_Type(m_Shape_Type));
 		}
 
-		if( m_Shape_Type == SHAPE_TYPE_Point && (pManager = g_pData->Get_PointClouds()) != NULL )
+		if( m_Shape_Type == SHAPE_TYPE_Point )
 		{
-			_Set_Shapes(pManager);
-		}
-	}
-}
-
-//---------------------------------------------------------
-void CDLG_List_Shapes::_Set_Shapes(CWKSP_Base_Manager *pType)
-{
-	if( pType )
-	{
-		for(int i=0; i<pType->Get_Count(); i++)
-		{
-			bool			bList		= true;
-			CWKSP_Base_Item	*pShapes	= pType->Get_Item(i);
-
-			for(int j=0; j<(int)m_pAdd->GetCount() && bList; j++)
-			{
-				if( pShapes == m_pAdd->GetClientData(j) )
-				{
-					bList	= false;
-				}
-			}
-
-			if( bList )
-			{
-				m_pSelect->Append(pShapes->Get_Name(), (void *)pShapes);
-			}
+			Set_Data(g_pData->Get_PointClouds());
 		}
 	}
 }
diff --git a/src/saga_core/saga_gui/dlg_list_shapes.h b/src/saga_core/saga_gui/dlg_list_shapes.h
index 974aaba..2a6aab1 100644
--- a/src/saga_core/saga_gui/dlg_list_shapes.h
+++ b/src/saga_core/saga_gui/dlg_list_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_shapes.h 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -88,7 +88,6 @@ class CDLG_List_Shapes : public CDLG_List_Base
 
 public:
 	CDLG_List_Shapes(CSG_Parameter_Shapes_List *pList, wxString Caption);
-	virtual ~CDLG_List_Shapes(void);
 
 
 protected:
@@ -96,9 +95,7 @@ protected:
 	int							m_Shape_Type;
 
 
-	virtual void				_Set_Objects(void);
-
-	void						_Set_Shapes(class CWKSP_Base_Manager *pType);
+	void						_Set_Data		(void);
 
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/dlg_list_table.cpp b/src/saga_core/saga_gui/dlg_list_table.cpp
index 2e7cd0e..59579da 100644
--- a/src/saga_core/saga_gui/dlg_list_table.cpp
+++ b/src/saga_core/saga_gui/dlg_list_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_table.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_table.cpp 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -65,7 +65,6 @@
 
 #include "wksp_data_manager.h"
 #include "wksp_table_manager.h"
-#include "wksp_table.h"
 
 #include "dlg_list_table.h"
 
@@ -94,61 +93,7 @@ END_EVENT_TABLE()
 CDLG_List_Table::CDLG_List_Table(CSG_Parameter_Table_List *pList, wxString Caption)
 	: CDLG_List_Base(pList, Caption)
 {
-	_Set_Objects();
-}
-
-//---------------------------------------------------------
-CDLG_List_Table::~CDLG_List_Table(void)
-{
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CDLG_List_Table::_Set_Objects(void)
-{
-	bool				bList;
-	int					i, j;
-	CWKSP_Table_Manager	*pTables;
-	CWKSP_Table			*pTable;
-
-	//-----------------------------------------------------
-	if( (pTables = g_pData->Get_Tables()) != NULL )
-	{
-		for(i=0; i<m_pList->Get_Count(); i++)
-		{
-			CWKSP_Base_Item	*pItem	= g_pData->Get(m_pList->asDataObject(i)->asTable());
-
-			if( pItem )
-			{
-				m_pAdd->Append(pItem->Get_Name(), (void *)pItem);
-			}
-		}
-
-		//-------------------------------------------------
-		for(i=0; i<pTables->Get_Count(); i++)
-		{
-			pTable	= pTables->Get_Data(i);
-
-			for(j=0, bList=true; j<(int)m_pAdd->GetCount() && bList; j++)
-			{
-				if( pTable == m_pAdd->GetClientData(j) )
-				{
-					bList	= false;
-				}
-			}
-
-			if( bList )
-			{
-				m_pSelect->Append(pTable->Get_Name(), (void *)pTable);
-			}
-		}
-	}
+	Set_Data(g_pData->Get_Tables());
 }
 
 
diff --git a/src/saga_core/saga_gui/dlg_list_table.h b/src/saga_core/saga_gui/dlg_list_table.h
index 284e10f..1ebb86b 100644
--- a/src/saga_core/saga_gui/dlg_list_table.h
+++ b/src/saga_core/saga_gui/dlg_list_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_table.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_table.h 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -88,13 +88,10 @@ class CDLG_List_Table : public CDLG_List_Base
 
 public:
 	CDLG_List_Table(CSG_Parameter_Table_List *pList, wxString Caption);
-	virtual ~CDLG_List_Table(void);
 
 
 protected:
 
-	virtual void				_Set_Objects(void);
-
 
 //---------------------------------------------------------
 DECLARE_EVENT_TABLE()
diff --git a/src/saga_core/saga_gui/dlg_list_tin.cpp b/src/saga_core/saga_gui/dlg_list_tin.cpp
index 1563d10..7bf5c34 100644
--- a/src/saga_core/saga_gui/dlg_list_tin.cpp
+++ b/src/saga_core/saga_gui/dlg_list_tin.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_tin.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_tin.cpp 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -65,7 +65,6 @@
 
 #include "wksp_data_manager.h"
 #include "wksp_tin_manager.h"
-#include "wksp_tin.h"
 
 #include "dlg_list_tin.h"
 
@@ -94,61 +93,7 @@ END_EVENT_TABLE()
 CDLG_List_TIN::CDLG_List_TIN(CSG_Parameter_TIN_List *pList, wxString Caption)
 	: CDLG_List_Base(pList, Caption)
 {
-	_Set_Objects();
-}
-
-//---------------------------------------------------------
-CDLG_List_TIN::~CDLG_List_TIN(void)
-{
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CDLG_List_TIN::_Set_Objects(void)
-{
-	bool				bList;
-	int					i, j;
-	CWKSP_TIN_Manager	*pTINs;
-	CWKSP_TIN			*pTIN;
-
-	//-----------------------------------------------------
-	if( (pTINs = g_pData->Get_TINs()) != NULL )
-	{
-		for(i=0; i<m_pList->Get_Count(); i++)
-		{
-			CWKSP_Base_Item	*pItem	= g_pData->Get(m_pList->asDataObject(i)->asTIN());
-
-			if( pItem )
-			{
-				m_pAdd->Append(pItem->Get_Name(), (void *)pItem);
-			}
-		}
-
-		//-------------------------------------------------
-		for(i=0; i<pTINs->Get_Count(); i++)
-		{
-			pTIN	= pTINs->Get_Data(i);
-
-			for(j=0, bList=true; j<(int)m_pAdd->GetCount() && bList; j++)
-			{
-				if( pTIN == m_pAdd->GetClientData(j) )
-				{
-					bList	= false;
-				}
-			}
-
-			if( bList )
-			{
-				m_pSelect->Append(pTIN->Get_Name(), (void *)pTIN);
-			}
-		}
-	}
+	Set_Data(g_pData->Get_TINs());
 }
 
 
diff --git a/src/saga_core/saga_gui/dlg_list_tin.h b/src/saga_core/saga_gui/dlg_list_tin.h
index 25e5fc7..effb50c 100644
--- a/src/saga_core/saga_gui/dlg_list_tin.h
+++ b/src/saga_core/saga_gui/dlg_list_tin.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_tin.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_list_tin.h 1964 2014-02-04 16:25:58Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -88,13 +88,10 @@ class CDLG_List_TIN : public CDLG_List_Base
 
 public:
 	CDLG_List_TIN(CSG_Parameter_TIN_List *pList, wxString Caption);
-	virtual ~CDLG_List_TIN(void);
 
 
 protected:
 
-	virtual void				_Set_Objects(void);
-
 
 //---------------------------------------------------------
 DECLARE_EVENT_TABLE()
diff --git a/src/saga_core/saga_gui/dlg_table.cpp b/src/saga_core/saga_gui/dlg_table.cpp
index 93d146f..660d056 100644
--- a/src/saga_core/saga_gui/dlg_table.cpp
+++ b/src/saga_core/saga_gui/dlg_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_table.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_table.cpp 2041 2014-03-05 15:08:03Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -83,6 +83,8 @@ IMPLEMENT_CLASS(CDLG_Table, CDLG_Base)
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CDLG_Table, CDLG_Base)
+	EVT_KEY_DOWN		(CDLG_Table::On_Key)
+
 	EVT_BUTTON			(ID_BTN_LOAD			, CDLG_Table::On_Load)
 	EVT_BUTTON			(ID_BTN_SAVE			, CDLG_Table::On_Save)
 	EVT_BUTTON			(ID_BTN_ADD				, CDLG_Table::On_Add)
@@ -138,6 +140,22 @@ CDLG_Table::~CDLG_Table(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CDLG_Table::On_Key(wxKeyEvent &event)
+{
+	if( event.GetKeyCode() == WXK_RETURN )
+	{
+		if( m_pControl->IsCellEditControlShown() )
+		{
+			m_pControl->SaveEditControlValue();
+
+			return;
+		}
+	}
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
 void CDLG_Table::Set_Position(wxRect r)
 {
 	m_pControl->SetSize(r);
diff --git a/src/saga_core/saga_gui/dlg_table.h b/src/saga_core/saga_gui/dlg_table.h
index d941f41..6d97cbd 100644
--- a/src/saga_core/saga_gui/dlg_table.h
+++ b/src/saga_core/saga_gui/dlg_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_table.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: dlg_table.h 2041 2014-03-05 15:08:03Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,6 +90,16 @@ public:
 	CDLG_Table(class CSG_Table *pTable, wxString Caption);
 	virtual ~CDLG_Table(void);
 
+
+protected:
+
+	class CSG_Table				*m_pTable, *m_pTable_Orig;
+
+	class CVIEW_Table_Control	*m_pControl;
+
+
+	void						On_Key			(wxKeyEvent     &event);
+
 	void						On_Load			(wxCommandEvent &event);
 	void						On_Save			(wxCommandEvent &event);
 
@@ -99,14 +109,6 @@ public:
 	void						On_Delete_All	(wxCommandEvent &event);
 	void						On_Colors		(wxCommandEvent &event);
 
-
-protected:
-
-	class CSG_Table				*m_pTable, *m_pTable_Orig;
-
-	class CVIEW_Table_Control	*m_pControl;
-
-
 	virtual void				Set_Position	(wxRect r);
 
 	virtual void				Save_Changes	(void);
diff --git a/src/saga_core/saga_gui/helper.cpp b/src/saga_core/saga_gui/helper.cpp
index 1a550be..d283418 100644
--- a/src/saga_core/saga_gui/helper.cpp
+++ b/src/saga_core/saga_gui/helper.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: helper.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: helper.cpp 2086 2014-04-04 09:07:51Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -145,11 +145,11 @@ void		Decimal_To_Degree(double Value, double &Deg, double &Min, double &Sec)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-wxString	Get_nBytes_asString(long nBytes, int Precision)
+wxString	Get_nBytes_asString(double nBytes, int Precision)
 {
 	if( nBytes < 1024 )
 	{
-		return( wxString::Format(wxT("%ld %s"), nBytes, wxT("bytes")) );
+		return( wxString::Format(wxT("%.0f %s"), nBytes, wxT("bytes")) );
 	}
 
 	double	dSize	= nBytes / 1024.0;
@@ -204,13 +204,14 @@ wxString	Get_FilePath_Relative(const wxString &Directory, const wxString &FileNa
 //---------------------------------------------------------
 wxString	Get_FilePath_Absolute(const wxString &Directory, const wxString &FileName)
 {
-	if( wxIsAbsolutePath(FileName) )
+	wxFileName	fn(FileName);
+
+	if( !fn.IsAbsolute() )
 	{
-		return( FileName );
+		fn.MakeAbsolute(Directory);
 	}
 
-	return( wxString::Format(wxT("%s%s"), Directory, FileName) );
-//	return( SG_File_Make_Path(Directory, FileName, NULL).c_str() );
+	return( fn.GetFullPath() );
 }
 
 //---------------------------------------------------------
@@ -531,6 +532,25 @@ void		MSG_Execution_Add(const wxString &Message, bool bNewLine, bool bTime, TSG_
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+bool		g_CONFIG_bSave	= true;
+
+//---------------------------------------------------------
+bool		CONFIG_Do_Save(bool bOn)
+{
+	if( g_CONFIG_bSave != bOn )
+	{
+		g_CONFIG_bSave	= bOn;
+
+		if( g_CONFIG_bSave )
+		{
+			wxConfigBase::Get()->Flush();
+		}
+	}
+
+	return( g_CONFIG_bSave );
+}
+
+//---------------------------------------------------------
 bool		CONFIG_Read(const wxString &Group, const wxString &Entry, wxString &Value)
 {
 	wxConfigBase	*pConfig	= wxConfigBase::Get();
@@ -573,11 +593,16 @@ bool		CONFIG_Read(const wxString &Group, const wxString &Entry, bool &Value)
 //---------------------------------------------------------
 bool		CONFIG_Write(const wxString &Group, const wxString &Entry, const wxString &Value)
 {
-	wxConfigBase	*pConfig	= wxConfigBase::Get();
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
 
-	pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
+		pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
 
-	return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+		return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+	}
+
+	return( true );
 }
 
 bool		CONFIG_Write(const wxString &Group, const wxString &Entry, const char *Value)
@@ -593,48 +618,197 @@ bool		CONFIG_Write(const wxString &Group, const wxString &Entry, const wchar_t *
 //---------------------------------------------------------
 bool		CONFIG_Write(const wxString &Group, const wxString &Entry, long Value)
 {
-	wxConfigBase	*pConfig	= wxConfigBase::Get();
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
 
-	pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
+		pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
 
-	return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+		return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+	}
+
+	return( true );
 }
 
 //---------------------------------------------------------
 bool		CONFIG_Write(const wxString &Group, const wxString &Entry, double Value)
 {
-	wxConfigBase	*pConfig	= wxConfigBase::Get();
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
 
-	pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
+		pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
 
-	return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+		return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+	}
+
+	return( true );
 }
 
 //---------------------------------------------------------
 bool		CONFIG_Write(const wxString &Group, const wxString &Entry, bool Value)
 {
-	wxConfigBase	*pConfig	= wxConfigBase::Get();
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
 
-	pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
+		pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
 
-	return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+		return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
+	}
+
+	return( true );
 }
 
 //---------------------------------------------------------
 bool		CONFIG_Delete(const wxString &Group)
 {
-	wxConfigBase	*pConfig	= wxConfigBase::Get();
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
+
+		return( pConfig->DeleteGroup(Group) ? pConfig->Flush() : false );
+	}
 
-	return( pConfig->DeleteGroup(Group) ? pConfig->Flush() : false );
+	return( true );
 }
 
 bool		CONFIG_Delete(const wxString &Group, const wxString &Entry)
 {
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
+
+		pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
+
+		return( pConfig->DeleteEntry(Entry) ? pConfig->Flush() : false );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool		CONFIG_Read(wxConfigBase *pConfig, CSG_Parameter *pParameter)
+{
+	long		l;
+	double		d;
+	wxString	s, Entry(pParameter->Get_Identifier());
+
+	switch( pParameter->Get_Type() )
+	{
+	default:	return( false );
+
+	case PARAMETER_TYPE_Bool    :
+	case PARAMETER_TYPE_Int     :
+	case PARAMETER_TYPE_Choice  :
+	case PARAMETER_TYPE_Color   :
+		return( pConfig->Read(Entry, &l) && pParameter->Set_Value((int)l) );
+
+	case PARAMETER_TYPE_Double  :
+	case PARAMETER_TYPE_Degree  :
+		return( pConfig->Read(Entry, &d) && pParameter->Set_Value(d) );
+
+	case PARAMETER_TYPE_String  :
+	case PARAMETER_TYPE_Text    :
+	case PARAMETER_TYPE_FilePath:
+		return( pConfig->Read(Entry, &s) && pParameter->Set_Value((const SG_Char *)s) );
+
+	case PARAMETER_TYPE_Range   :
+		return(
+			pConfig->Read(Entry + "_LO", &d) && pParameter->asRange()->Set_LoVal(d)
+		&&	pConfig->Read(Entry + "_HI", &d) && pParameter->asRange()->Set_HiVal(d)
+		);
+
+	case PARAMETER_TYPE_Font    :
+		return(
+			pConfig->Read(Entry + "_FONT" , &s) && pParameter->Set_Value((const SG_Char *)s)
+		&&	pConfig->Read(Entry + "_COLOR", &l) && pParameter->Set_Value((int)l)
+		);
+
+	case PARAMETER_TYPE_Parameters:
+		return( CONFIG_Read(Entry + "/" + pParameter->Get_Identifier(), pParameter->asParameters()) );
+	}
+}
+
+//---------------------------------------------------------
+bool		CONFIG_Read(const wxString &Group, CSG_Parameters *pParameters)
+{
 	wxConfigBase	*pConfig	= wxConfigBase::Get();
 
 	pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
 
-	return( pConfig->DeleteEntry(Entry) ? pConfig->Flush() : false );
+	for(int i=0; i<pParameters->Get_Count(); i++)
+	{
+		CONFIG_Read(pConfig, pParameters->Get_Parameter(i));
+	}
+
+	return( pConfig->Flush() );
+}
+
+//---------------------------------------------------------
+bool		CONFIG_Write(wxConfigBase *pConfig, CSG_Parameter *pParameter)
+{
+	if( g_CONFIG_bSave )
+	{
+		wxString	Entry(pParameter->Get_Identifier());
+
+		switch( pParameter->Get_Type() )
+		{
+		default:	return( false );
+
+		case PARAMETER_TYPE_Bool    :
+		case PARAMETER_TYPE_Int     :
+		case PARAMETER_TYPE_Choice  :
+		case PARAMETER_TYPE_Color   :
+			return( pConfig->Write(Entry, pParameter->asInt()) );
+
+		case PARAMETER_TYPE_Double  :
+		case PARAMETER_TYPE_Degree  :
+			return( pConfig->Write(Entry, pParameter->asDouble()) );
+
+		case PARAMETER_TYPE_String  :
+		case PARAMETER_TYPE_Text    :
+		case PARAMETER_TYPE_FilePath:
+			return( pConfig->Write(Entry, pParameter->asString()) );
+
+		case PARAMETER_TYPE_Range   :
+			return(
+				pConfig->Write(Entry + "_LO", pParameter->asRange()->Get_LoVal())
+			&&	pConfig->Write(Entry + "_HI", pParameter->asRange()->Get_HiVal())
+			);
+
+		case PARAMETER_TYPE_Font    :
+			return(
+				pConfig->Write(Entry + "_FONT" , (const SG_Char *)pParameter->asPointer())
+			&&	pConfig->Write(Entry + "_COLOR", pParameter->asInt())
+			);
+
+		case PARAMETER_TYPE_Parameters:
+			return( CONFIG_Write(Entry + "/" + pParameter->Get_Identifier(), pParameter->asParameters()) );
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool		CONFIG_Write(const wxString &Group, CSG_Parameters *pParameters)
+{
+	if( g_CONFIG_bSave )
+	{
+		wxConfigBase	*pConfig	= wxConfigBase::Get();
+
+		pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
+
+		for(int i=0; i<pParameters->Get_Count(); i++)
+		{
+			CONFIG_Write(pConfig, pParameters->Get_Parameter(i));
+		}
+
+		return( pConfig->Flush() );
+	}
+
+	return( true );
 }
 
 
diff --git a/src/saga_core/saga_gui/helper.h b/src/saga_core/saga_gui/helper.h
index 9a38fc5..d74681e 100644
--- a/src/saga_core/saga_gui/helper.h
+++ b/src/saga_core/saga_gui/helper.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: helper.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: helper.h 2086 2014-04-04 09:07:51Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -96,7 +96,7 @@ double				Degree_To_Decimal				(double Deg, double Min, double Sec);
 void				Decimal_To_Degree				(double Value, double &Deg, double &Min, double &Sec);
 
 //---------------------------------------------------------
-wxString			Get_nBytes_asString				(long nBytes, int Precision = -1);
+wxString			Get_nBytes_asString				(double nBytes, int Precision = -1);
 
 //---------------------------------------------------------
 double				Get_Random						(double loValue, double hiValue);
@@ -149,6 +149,8 @@ void				MSG_Execution_Add_Line			(void);
 void				MSG_Execution_Add				(const wxString &Message, bool bNewLine = true, bool bTime = false, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
 
 //---------------------------------------------------------
+bool				CONFIG_Do_Save					(bool bOn);
+
 bool				CONFIG_Read						(const wxString &Group, const wxString &Entry,       wxString &Value);
 bool				CONFIG_Read						(const wxString &Group, const wxString &Entry, long           &Value);
 bool				CONFIG_Read						(const wxString &Group, const wxString &Entry, double         &Value);
@@ -164,6 +166,9 @@ bool				CONFIG_Write					(const wxString &Group, const wxString &Entry, bool
 bool				CONFIG_Delete					(const wxString &Group);
 bool				CONFIG_Delete					(const wxString &Group, const wxString &Entry);
 
+bool				CONFIG_Read						(const wxString &Group, CSG_Parameters *pParameters);
+bool				CONFIG_Write					(const wxString &Group, CSG_Parameters *pParameters);
+
 //---------------------------------------------------------
 bool				PROCESS_is_Executing			(void);
 
@@ -199,7 +204,7 @@ void				STATUSBAR_Set_Text				(const wxString &Text, int iPane = 0);
 //---------------------------------------------------------
 #define DESC_ADD_STR(label, value)	s.Append(wxString::Format(wxT("<tr><td valign=\"top\">%s</td><td valign=\"top\">%s</td></tr>"), label, value))
 #define DESC_ADD_INT(label, value)	s.Append(wxString::Format(wxT("<tr><td valign=\"top\">%s</td><td valign=\"top\">%d</td></tr>"), label, value))
-#define DESC_ADD_LONG(label, value)	s.Append(wxString::Format(wxT("<tr><td valign=\"top\">%s</td><td valign=\"top\">%ld</td></tr>"), label, value))
+#define DESC_ADD_LONG(label, value)	s.Append(wxString::Format(wxT("<tr><td valign=\"top\">%s</td><td valign=\"top\">%lld</td></tr>"), label, value))
 #define DESC_ADD_FLT(label, value)	s.Append(wxString::Format(wxT("<tr><td valign=\"top\">%s</td><td valign=\"top\">%s</td></tr>"), label, SG_Get_String(value, -20).c_str()))
 
 
diff --git a/src/saga_core/saga_gui/info_messages.cpp b/src/saga_core/saga_gui/info_messages.cpp
index 6ddb4f9..d5706c2 100644
--- a/src/saga_core/saga_gui/info_messages.cpp
+++ b/src/saga_core/saga_gui/info_messages.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: info_messages.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: info_messages.cpp 2110 2014-05-05 12:45:44Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -176,10 +176,13 @@ void CINFO_Messages::_Add_Text(wxString Text)
 void CINFO_Messages::_Set_Style(TSG_UI_MSG_STYLE Style)
 {
 	int			i	= 0;
-	wxColour	c	= wxColour(  0,   0,   0);
-	wxFont		f	= wxFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
+	wxColour	c	= wxColour(0, 0, 0);
+	wxFont		f	= wxSystemSettings::GetFont(wxSYS_ANSI_VAR_FONT);//wxSYS_SYSTEM_FONT);
 	wxTextAttr	t;
 
+	f.SetPointSize((int)(0.5 + 0.9 * f.GetPointSize()));	// generally scale message window font to 90 percent
+
+
 	switch( Style )
 	{
 	default:
@@ -204,19 +207,18 @@ void CINFO_Messages::_Set_Style(TSG_UI_MSG_STYLE Style)
 
 	case SG_UI_MSG_STYLE_BIG:
 		f.SetWeight(wxFONTWEIGHT_BOLD);
-		f.SetPointSize(12);
+		f.SetPointSize((int)(0.5 + 1.1 * f.GetPointSize()));
 		break;
 
 	case SG_UI_MSG_STYLE_SMALL:
 		f.SetWeight(wxFONTWEIGHT_LIGHT);
-		f.SetPointSize(8);
+		f.SetPointSize((int)(0.5 + 0.9 * f.GetPointSize()));
 		break;
 
 	case SG_UI_MSG_STYLE_01:
 		i	= 50;
 		c	= wxColour(  0,   0, 127);
 		f.SetWeight(wxFONTWEIGHT_LIGHT);
-		f.SetPointSize(10);
 		break;
 
 	case SG_UI_MSG_STYLE_02:
@@ -228,7 +230,6 @@ void CINFO_Messages::_Set_Style(TSG_UI_MSG_STYLE Style)
 		break;
 	}
 
-	t.SetFlags(wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_FONT_WEIGHT|wxTEXT_ATTR_FONT_ITALIC|wxTEXT_ATTR_FONT_SIZE|wxTEXT_ATTR_LEFT_INDENT);
 
 	t.SetLeftIndent(i);
 	t.SetTextColour(c);
diff --git a/src/saga_core/saga_gui/man/Makefile.in b/src/saga_core/saga_gui/man/Makefile.in
index e4d7c66..ceacddc 100644
--- a/src/saga_core/saga_gui/man/Makefile.in
+++ b/src/saga_core/saga_gui/man/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,23 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -53,6 +69,11 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -74,6 +95,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -101,6 +128,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DISABLELIBHARU = @DISABLELIBHARU@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -128,6 +156,7 @@ LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -140,6 +169,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PG_CONFIG = @PG_CONFIG@
@@ -169,6 +199,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -202,7 +233,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -264,11 +294,18 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-man1: $(dist_man_MANS)
 	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
-	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
+	@list1=''; \
+	list2='$(dist_man_MANS)'; \
+	test -n "$(man1dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.1[a-z]*$$/p'; \
+	fi; \
 	} | while read p; do \
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; echo "$$p"; \
@@ -297,15 +334,15 @@ uninstall-man1:
 	  sed -n '/\.1[a-z]*$$/p'; \
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
 	@list='$(MANS)'; if test -n "$$list"; then \
@@ -314,10 +351,10 @@ distdir: $(DISTFILES)
 	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
 	  if test -n "$$list" && \
 	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
 	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
 	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    echo "       typically 'make maintainer-clean' will remove them" >&2; \
 	    exit 1; \
 	  else :; fi; \
 	else :; fi
@@ -367,10 +404,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/saga_core/saga_gui/parameters_control.cpp b/src/saga_core/saga_gui/parameters_control.cpp
index a2db110..68f8838 100644
--- a/src/saga_core/saga_gui/parameters_control.cpp
+++ b/src/saga_core/saga_gui/parameters_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameters_control.cpp 2078 2014-04-02 16:35:47Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -83,9 +83,74 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef _SAGA_LINUX
-	#define	PG_USE_MANAGER
-#endif
+class CParameters_Grid : public wxPropertyGrid
+{
+	DECLARE_CLASS(CParameters_Grid)
+
+public:
+	CParameters_Grid(void)
+	{}
+
+	CParameters_Grid(wxWindow *pParent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxPG_DEFAULT_STYLE, const wxString &name = wxPropertyGridNameStr)
+	:	wxPropertyGrid(pParent, id, pos, size, style, name)
+	{}
+
+	virtual wxStatusBar *		GetStatusBar		(void)	{	return( NULL );	}
+
+	void						On_Key				(wxKeyEvent &event)
+	{
+		event.Skip();
+
+		wxPostEvent(GetParent()->GetParent(), event);
+	}
+
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+};
+
+//---------------------------------------------------------
+IMPLEMENT_CLASS(CParameters_Grid, wxPropertyGrid)
+
+//---------------------------------------------------------
+BEGIN_EVENT_TABLE(CParameters_Grid, wxPropertyGrid)
+	EVT_KEY_DOWN		(CParameters_Grid::On_Key)
+END_EVENT_TABLE()
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CParameters_Grid_Manager : public wxPropertyGridManager
+{
+public:
+	CParameters_Grid_Manager(void)	{}
+
+	virtual wxPropertyGrid *	CreatePropertyGrid	(void) const
+	{
+		return( new CParameters_Grid() );
+	}
+
+	wxPropertyGrid *			Initialize			(wxWindow *pParent)
+	{
+		Create(pParent, ID_WND_PARM, wxDefaultPosition, wxDefaultSize,
+			 wxPG_BOLD_MODIFIED
+			|wxPG_SPLITTER_AUTO_CENTER
+		//	|wxPG_AUTO_SORT
+		//	|wxPG_HIDE_MARGIN
+		//	|wxPG_STATIC_SPLITTER
+		//	|wxPG_HIDE_CATEGORIES
+		//	|wxPG_LIMITED_EDITING
+			|wxPG_DESCRIPTION
+			|wxBORDER_NONE
+			|wxTAB_TRAVERSAL
+		);
+
+		return( GetGrid() );
+	}
+
+};
 
 
 ///////////////////////////////////////////////////////////
@@ -100,11 +165,10 @@ IMPLEMENT_CLASS(CParameters_Control, wxPanel)
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CParameters_Control, wxPanel)
 	EVT_SIZE			(CParameters_Control::On_Size)
+	EVT_KEY_DOWN		(CParameters_Control::On_Key)
 
-	EVT_PG_SELECTED		(ID_WND_PARM_PG_ACTIVE, CParameters_Control::On_PG_Selected)
-	EVT_PG_SELECTED		(ID_WND_PARM_PG_DIALOG, CParameters_Control::On_PG_Selected)
-	EVT_PG_CHANGED		(ID_WND_PARM_PG_ACTIVE, CParameters_Control::On_PG_Changed)
-	EVT_PG_CHANGED		(ID_WND_PARM_PG_DIALOG, CParameters_Control::On_PG_Changed)
+	EVT_PG_SELECTED		(ID_WND_PARM, CParameters_Control::On_PG_Selected)
+	EVT_PG_CHANGED		(ID_WND_PARM, CParameters_Control::On_PG_Changed)
 END_EVENT_TABLE()
 
 
@@ -118,49 +182,18 @@ END_EVENT_TABLE()
 CParameters_Control::CParameters_Control(wxWindow *pParent, bool bDialog)
 	: wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxCLIP_CHILDREN)
 {
-	m_pParameters	= new CSG_Parameters();
+	m_pParameters	= new CSG_Parameters;
 	m_pOriginal		= NULL;
 
-#ifdef PG_USE_MANAGER
-	m_pPGM	= new wxPropertyGridManager(this, bDialog ? ID_WND_PARM_PG_DIALOG : ID_WND_PARM_PG_ACTIVE, wxDefaultPosition, wxDefaultSize,
-		 wxPG_BOLD_MODIFIED
-		|wxPG_SPLITTER_AUTO_CENTER
-	//	|wxPG_AUTO_SORT
-	//	|wxPG_HIDE_MARGIN
-	//	|wxPG_STATIC_SPLITTER
-	//	|wxPG_HIDE_CATEGORIES
-	//	|wxPG_LIMITED_EDITING
-		|wxTAB_TRAVERSAL
-	//	|wxPG_TOOLBAR
-		|wxPG_DESCRIPTION
-	//	|wxPG_COMPACTOR
-	//	|wxBORDER_SUNKEN
-		|wxBORDER_NONE
-	);
-
-	m_pPG	= m_pPGM->GetGrid();
-
-	m_pPGM->SetDescBoxHeight(bDialog ? 100 : 50);
-#else
-	m_pPG	= new wxPropertyGrid(this, bDialog ? ID_WND_PARM_PG_DIALOG : ID_WND_PARM_PG_ACTIVE, wxDefaultPosition, wxDefaultSize,
-		 wxPG_BOLD_MODIFIED
-		|wxPG_SPLITTER_AUTO_CENTER
-	//	|wxPG_AUTO_SORT
-	//	|wxPG_HIDE_MARGIN
-	//	|wxPG_STATIC_SPLITTER
-	//	|wxPG_HIDE_CATEGORIES
-	//	|wxPG_LIMITED_EDITING
-		|wxTAB_TRAVERSAL
-	//	|wxPG_TOOLBAR
-		|wxPG_DESCRIPTION
-	//	|wxPG_COMPACTOR
-	//	|wxBORDER_SUNKEN
-		|wxBORDER_NONE
-	);
-
-	m_pPGM	= NULL;
-
-#endif
+	m_bFocus		= 0;
+
+	CParameters_Grid_Manager	*pPGM	= new CParameters_Grid_Manager;
+	
+	m_pPG	= pPGM->Initialize(this);
+
+//	pPGM->SetDescBoxHeight(bDialog ? 100 : 50);
+
+	m_pPG->AddActionTrigger(wxPG_ACTION_PRESS_BUTTON , WXK_SPACE);
 
 //	m_pPG->SetExtraStyle(wxPG_EX_HELP_AS_TOOLTIPS);
 //	m_pPG->SetCellDisabledTextColour(wxColour(200, 200, 200));
@@ -184,28 +217,49 @@ CParameters_Control::~CParameters_Control(void)
 //---------------------------------------------------------
 void CParameters_Control::On_Size(wxSizeEvent &event)
 {
-	if( m_pPGM )
+	if( m_pPG && event.GetSize().GetWidth() > 0 && event.GetSize().GetHeight() > 0 )
 	{
-		m_pPGM->SetSize(GetClientSize());
+		m_pPG->GetParent()->SetSize(event.GetSize());
+
+		m_pPG->CenterSplitter(true);
 	}
-	else
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
+void CParameters_Control::On_Key(wxKeyEvent &event)
+{
+	if( event.GetKeyCode() == WXK_RETURN )
 	{
-		m_pPG ->SetSize(GetClientSize());
+		wxPostEvent(GetParent(), event);
 	}
 
-	m_pPG->CenterSplitter(true);
-
 	event.Skip();
 }
 
 //---------------------------------------------------------
-void CParameters_Control::On_PG_Selected(wxPropertyGridEvent &WXUNUSED(event))
-{}
+void CParameters_Control::On_PG_Selected(wxPropertyGridEvent &event)
+{
+	if( m_bFocus == 0 && m_pParameters && m_pOriginal )
+	{
+		SetFocus();
+	}
+
+	event.Skip();
+}
 
 //---------------------------------------------------------
 void CParameters_Control::On_PG_Changed(wxPropertyGridEvent &event)
 {
 	_Set_Parameter(event.GetPropertyName());
+
+	if( event.GetProperty() )
+	{
+		m_pPG->SelectProperty(event.GetProperty());
+	}
+
+	event.Skip();
 }
 
 
@@ -225,6 +279,7 @@ bool CParameters_Control::Save_Changes(bool bSilent)
 		m_bModified	= false;
 
 		m_pPG->ClearModifiedStatus();
+		m_pPG->Refresh();
 
 		return( true );
 	}
@@ -319,6 +374,8 @@ bool CParameters_Control::Set_Parameters(CSG_Parameters *pParameters)
 {
 	if( pParameters != m_pParameters )
 	{
+		m_bFocus++;
+
 		m_pPG->Freeze();
 
 		m_bModified	= false;
@@ -356,6 +413,8 @@ bool CParameters_Control::Set_Parameters(CSG_Parameters *pParameters)
 		}
 
 		m_pPG->Thaw();
+
+		m_bFocus--;
 	}
 
 	//-----------------------------------------------------
diff --git a/src/saga_core/saga_gui/parameters_control.h b/src/saga_core/saga_gui/parameters_control.h
index 9b55480..71da819 100644
--- a/src/saga_core/saga_gui/parameters_control.h
+++ b/src/saga_core/saga_gui/parameters_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameters_control.h 2075 2014-03-31 10:34:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,12 +72,6 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <wx/panel.h>
-#include <wx/scrolwin.h>
-#include <wx/toolbar.h>
-#include <wx/stattext.h>
-#include <wx/dcclient.h>
-#include <wx/button.h>
 #include <wx/propgrid/propgrid.h>
 
 
@@ -96,7 +90,8 @@ public:
 	CParameters_Control(wxWindow *pParent, bool bDialog = false);
 	virtual ~CParameters_Control(void);
 
-	void						On_Size				(wxSizeEvent &event);
+	void						On_Size				(wxSizeEvent         &event);
+	void						On_Key				(wxKeyEvent          &event);
 	void						On_PG_Selected		(wxPropertyGridEvent &event);
 	void						On_PG_Changed		(wxPropertyGridEvent &event);
 
@@ -118,13 +113,13 @@ public:
 private:
 
 	bool						m_bModified;
+	
+	int							m_bFocus;
 
 	class CSG_Parameters		*m_pParameters, *m_pOriginal;
 
 	class wxPropertyGrid		*m_pPG;
 
-	class wxPropertyGridManager	*m_pPGM;
-
 
 	wxString					_Get_Identifier		(class CSG_Parameter *pParameter);
 	bool						_Get_Enabled		(class CSG_Parameter *pParameter);
diff --git a/src/saga_core/saga_gui/parameters_properties.cpp b/src/saga_core/saga_gui/parameters_properties.cpp
index 5498942..3810424 100644
--- a/src/saga_core/saga_gui/parameters_properties.cpp
+++ b/src/saga_core/saga_gui/parameters_properties.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_properties.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameters_properties.cpp 1947 2014-01-16 15:03:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -410,81 +410,125 @@ int CParameters_PG_Choice::_DataObject_Init(void)
 }
 
 //---------------------------------------------------------
-bool CParameters_PG_Choice::OnEvent(wxPropertyGrid *pPG, wxWindow *pPGCtrl, wxEvent &event)
+void CParameters_PG_Choice::_Set_Parameter_Value(int iChoice)
 {
-	if( event.GetEventType() == wxEVT_LEFT_DOWN )
+	if( iChoice != GetChoiceSelection() && iChoice >= 0 && iChoice < (int)m_choices.GetCount() && m_pParameter )
 	{
-	//	event.Skip();
+		switch( m_pParameter->Get_Type() )
+		{
+		default:	return;
 
-	//	GetEditorClass()->OnEvent(pPG, this, pPGCtrl, event);
+		case PARAMETER_TYPE_Choice:
+		case PARAMETER_TYPE_Table_Field:
+			m_pParameter->Set_Value(iChoice);
+			break;
+
+		case PARAMETER_TYPE_Grid_System:
+			m_pParameter->Set_Value((void *)m_choices_data.Item(m_choices.GetValue(iChoice)));
+
+			_Update_Grids();
+			break;
+
+		case PARAMETER_TYPE_Grid:
+			m_pParameter->Set_Value((void *)m_choices_data.Item(m_choices.GetValue(iChoice)));
+			break;
+
+		case PARAMETER_TYPE_Table:
+		case PARAMETER_TYPE_Shapes:
+		case PARAMETER_TYPE_TIN:
+		case PARAMETER_TYPE_PointCloud:
+			m_pParameter->Set_Value((void *)m_choices_data.Item(m_choices.GetValue(iChoice)));
+
+			_Update_TableFields();
+			break;
+		}
+
+		GetGrid()->EditorsValueWasModified();
 	}
+}
 
-	if( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED )
+//---------------------------------------------------------
+bool CParameters_PG_Choice::OnEvent(wxPropertyGrid *pPG, wxWindow *pPGCtrl, wxEvent &event)
+{
+	//-----------------------------------------------------
+	if( event.GetEventType() == wxEVT_SET_FOCUS )
 	{
-		int			iChoice;
-		wxVariant	vChoice;
+		wxPostEvent(pPG->GetEditorControl(), wxMouseEvent(wxEVT_LEFT_DOWN));
+	}
 
-		if( GetEditorClass()->GetValueFromControl(vChoice, this, pPGCtrl) && m_pParameter && m_choices.IsOk() && (iChoice = vChoice.GetInteger()) >= 0 && iChoice < (int)m_choices.GetCount() )
+	//-----------------------------------------------------
+	if( event.GetEventType() == wxEVT_RIGHT_DOWN && m_pParameter )
+	{
+		int	iChoice	= GetChoiceSelection();
+
+		if( m_pParameter->is_DataObject() )
 		{
-			switch( m_pParameter->Get_Type() )
+			if( m_pParameter->is_Input() )
 			{
-			default:
-				break;
-
-			case PARAMETER_TYPE_Choice:
-			case PARAMETER_TYPE_Table_Field:
-				m_pParameter->Set_Value(iChoice);
-				break;
-
-			case PARAMETER_TYPE_Grid_System:
-				m_pParameter->Set_Value((void *)m_choices_data.Item(m_choices.GetValue(iChoice)));
-				_Update_Grids(pPG);
-				break;
-
-			case PARAMETER_TYPE_Grid:
-				m_pParameter->Set_Value((void *)m_choices_data.Item(m_choices.GetValue(iChoice)));
-				break;
-
-			case PARAMETER_TYPE_Table:
-			case PARAMETER_TYPE_Shapes:
-			case PARAMETER_TYPE_TIN:
-			case PARAMETER_TYPE_PointCloud:
-				m_pParameter->Set_Value((void *)m_choices_data.Item(m_choices.GetValue(iChoice)));
-				_Update_TableFields(pPG);
-				break;
+				if( m_pParameter->is_Optional() )
+				{
+					iChoice	= m_choices.GetCount() - 1;
+				}
+			}
+			else // if( m_pParameter->is_Output() )
+			{
+				if( m_pParameter->is_Optional() )
+				{
+					iChoice	= m_choices.GetCount() - (iChoice == m_choices.GetCount() - 1 ? 2 : 1);
+				}
+				else if( m_pParameter->asDataObject() != DATAOBJECT_CREATE )
+				{
+					iChoice	= m_choices.GetCount() - 1;
+				}
 			}
+		}
+		else if( m_pParameter->Get_Type() == PARAMETER_TYPE_Table_Field && m_pParameter->is_Optional() )
+		{
+			iChoice	= m_choices.GetCount() - 1;
+		}
 
-			pPG->EditorsValueWasModified();
+		if( iChoice != GetChoiceSelection() )
+		{
+			_Set_Parameter_Value(iChoice);
 
-			return( true );
+			SetChoiceSelection(iChoice);
+
+			SetValueInEvent(iChoice);
+		}
+	}
+
+	//-----------------------------------------------------
+	if( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED )
+	{
+		int			iChoice;
+		wxVariant	vChoice;
+
+		if( GetEditorClass()->GetValueFromControl(vChoice, this, pPGCtrl) && m_choices.IsOk() && (iChoice = vChoice.GetInteger()) >= 0 && iChoice < (int)m_choices.GetCount() && m_pParameter )
+		{
+			_Set_Parameter_Value(iChoice);
 		}
 	}
 
+	//-----------------------------------------------------
 	event.Skip();
 
 	return( true );
 }
 
 //---------------------------------------------------------
-void CParameters_PG_Choice::_Update_Grids(wxPropertyGrid *pPG)
+void CParameters_PG_Choice::_Update_Grids(void)
 {
 	if( m_pParameter && m_pParameter->Get_Type() == PARAMETER_TYPE_Grid_System )
 	{
 		for(int i=0; i<m_pParameter->Get_Children_Count(); i++)
 		{
-			wxPGProperty	*pProperty;
 			CSG_Parameter	*pChild	= m_pParameter->Get_Child(i);
 
-			switch( pChild->Get_Type() )
+			if( pChild->Get_Type() == PARAMETER_TYPE_Grid )
 			{
-			default:
-				break;
-				
-			case PARAMETER_TYPE_Grid_List:
-				break;
-
-			case PARAMETER_TYPE_Grid:
-				if( (pProperty = pPG->GetProperty(wxString::Format(wxT("%s.%s"), m_pParameter->Get_Identifier(), pChild->Get_Identifier()))) != NULL )
+				wxPGProperty	*pProperty	= GetGrid()->GetProperty(wxString::Format(wxT("%s.%s"), m_pParameter->Get_Identifier(), pChild->Get_Identifier()));
+
+				if( pProperty )
 				{
 					((CParameters_PG_Choice *)pProperty)->Update();
 				}
@@ -494,7 +538,7 @@ void CParameters_PG_Choice::_Update_Grids(wxPropertyGrid *pPG)
 }
 
 //---------------------------------------------------------
-void CParameters_PG_Choice::_Update_TableFields(wxPropertyGrid *pPG)
+void CParameters_PG_Choice::_Update_TableFields(void)
 {
 	if( m_pParameter )
 	{
@@ -504,7 +548,7 @@ void CParameters_PG_Choice::_Update_TableFields(wxPropertyGrid *pPG)
 
 			if(	pChild->Get_Type() == PARAMETER_TYPE_Table_Field )
 			{
-				wxPGProperty	*pProperty	= pPG->GetProperty(wxString::Format(wxT("%s.%s"), m_pParameter->Get_Identifier(), pChild->Get_Identifier()));
+				wxPGProperty	*pProperty	= GetGrid()->GetProperty(wxString::Format(wxT("%s.%s"), m_pParameter->Get_Identifier(), pChild->Get_Identifier()));
 
 				if( pProperty )
 				{
diff --git a/src/saga_core/saga_gui/parameters_properties.h b/src/saga_core/saga_gui/parameters_properties.h
index 1b76d2a..f4b902a 100644
--- a/src/saga_core/saga_gui/parameters_properties.h
+++ b/src/saga_core/saga_gui/parameters_properties.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_properties.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: parameters_properties.h 1947 2014-01-16 15:03:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -122,8 +122,10 @@ protected:
 
 	int							_DataObject_Init	(void);
 
-	void						_Update_Grids		(wxPropertyGrid *pPG);
-	void						_Update_TableFields	(wxPropertyGrid *pPG);
+	void						_Set_Parameter_Value(int iChoice);
+
+	void						_Update_Grids		(void);
+	void						_Update_TableFields	(void);
 
 };
 
diff --git a/src/saga_core/saga_gui/project.cpp b/src/saga_core/saga_gui/project.cpp
index 1664536..5a9e61f 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: project.cpp 2032 2014-02-28 12:38:15Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -94,6 +94,7 @@
 #include "wksp_map_manager.h"
 #include "wksp_map.h"
 #include "wksp_map_layer.h"
+#include "wksp_map_graticule.h"
 #include "wksp_layer.h"
 
 #include "project.h"
@@ -214,7 +215,7 @@ bool CWKSP_Project::Save(const wxString &FileName, bool bSaveModified)
 //---------------------------------------------------------
 bool CWKSP_Project::_Load(const wxString &FileName, bool bAdd, bool bUpdateMenu)
 {
-	if( !bAdd && g_pData->Get_Count() > 0 )
+	if( wxFileExists(FileName) && !bAdd && g_pData->Get_Count() > 0 )
 	{
 		switch( DLG_Message_YesNoCancel(_TL("Close all data sets"), _TL("Load Project")) )
 		{
@@ -243,19 +244,19 @@ bool CWKSP_Project::_Load(const wxString &FileName, bool bAdd, bool bUpdateMenu)
 	}
 	else if( !wxFileExists(FileName) )
 	{
-		MSG_Error_Add(_TL("file does not exist.")				, true, true, SG_UI_MSG_STYLE_FAILURE);
+		MSG_Error_Add(_TL("file does not exist.")            , true, true, SG_UI_MSG_STYLE_FAILURE);
 	}
 	else if( !Project.Load(&FileName) )
 	{
-		MSG_Error_Add(_TL("could not read project file.")		, true, true, SG_UI_MSG_STYLE_FAILURE);
+		MSG_Error_Add(_TL("could not read project file.")    , true, true, SG_UI_MSG_STYLE_FAILURE);
 	}
 	else if( Project.Get_Name().Cmp(SG_T("SAGA_PROJECT")) )
 	{
-		MSG_Error_Add(_TL("invalid project file.")			, true, true, SG_UI_MSG_STYLE_FAILURE);
+		MSG_Error_Add(_TL("invalid project file.")           , true, true, SG_UI_MSG_STYLE_FAILURE);
 	}
 	else if( (pNode = Project.Get_Child(SG_T("DATA"))) == NULL || pNode->Get_Children_Count() <= 0 )
 	{
-		MSG_Error_Add(_TL("no data entries in project file.")	, true, true, SG_UI_MSG_STYLE_FAILURE);
+		MSG_Error_Add(_TL("no data entries in project file."), true, true, SG_UI_MSG_STYLE_FAILURE);
 	}
 	else
 	{
@@ -281,6 +282,8 @@ bool CWKSP_Project::_Load(const wxString &FileName, bool bAdd, bool bUpdateMenu)
 		g_pData->Get_Menu_Files()->Set_Update(true);
 
 		//-------------------------------------------------
+		g_pSAGA_Frame->Freeze();
+
 		if( (pNode = Project.Get_Child(SG_T("MAPS"))) != NULL && pNode->Get_Children_Count() > 0 )
 		{
 			for(int j=0; j<pNode->Get_Children_Count(); j++)
@@ -288,6 +291,8 @@ bool CWKSP_Project::_Load(const wxString &FileName, bool bAdd, bool bUpdateMenu)
 				_Load_Map(*pNode->Get_Child(j), SG_File_Get_Path(FileName).w_str());
 			}
 		}
+
+		g_pSAGA_Frame->Thaw();
 	}
 
 	//-----------------------------------------------------
@@ -332,7 +337,7 @@ bool CWKSP_Project::_Save(const wxString &FileName, bool bSaveModified, bool bUp
 	//-----------------------------------------------------
 	m_File_Name	= FileName;
 
-	if( bSaveModified && !Save_Modified(g_pData) )
+	if( bSaveModified && !g_pData->Save_Modified() )
 	{
 		m_File_Name	= oldFileName;
 
@@ -459,21 +464,18 @@ bool CWKSP_Project::_Save(const wxString &FileName, bool bSaveModified, bool bUp
 //---------------------------------------------------------
 bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir, bool bLoad, const CSG_String &Version)
 {
-	TSG_Data_Object_Type	Type;
-	wxString				File;
-	CWKSP_Base_Item			*pItem;
-
 	if( Entry.Get_Name().Cmp(SG_T("DATASET")) )
 	{
 		return( false );
 	}
 
-	Type	= Entry.Cmp_Property(SG_T("type"), SG_T("GRID"))	? DATAOBJECT_TYPE_Grid
-			: Entry.Cmp_Property(SG_T("type"), SG_T("TABLE"))	? DATAOBJECT_TYPE_Table
-			: Entry.Cmp_Property(SG_T("type"), SG_T("SHAPES"))	? DATAOBJECT_TYPE_Shapes
-			: Entry.Cmp_Property(SG_T("type"), SG_T("TIN"))		? DATAOBJECT_TYPE_TIN
-			: Entry.Cmp_Property(SG_T("type"), SG_T("POINTS"))	? DATAOBJECT_TYPE_PointCloud
-			: DATAOBJECT_TYPE_Undefined;
+	TSG_Data_Object_Type	Type	=
+		Entry.Cmp_Property("type", "GRID"  ) ? DATAOBJECT_TYPE_Grid
+	:	Entry.Cmp_Property("type", "TABLE" ) ? DATAOBJECT_TYPE_Table
+	:	Entry.Cmp_Property("type", "SHAPES") ? DATAOBJECT_TYPE_Shapes
+	:	Entry.Cmp_Property("type", "TIN"   ) ? DATAOBJECT_TYPE_TIN
+	:	Entry.Cmp_Property("type", "POINTS") ? DATAOBJECT_TYPE_PointCloud
+	:	DATAOBJECT_TYPE_Undefined;
 
 	if( Type == DATAOBJECT_TYPE_Undefined )
 	{
@@ -485,26 +487,22 @@ bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 		return( false );
 	}
 
-	File	= Get_FilePath_Absolute(ProjectDir, Entry.Get_Child(SG_T("FILE"))->Get_Content().c_str());
+	wxString	File(Get_FilePath_Absolute(ProjectDir, Entry.Get_Child(SG_T("FILE"))->Get_Content().c_str()));
 
 	if( !wxFileExists(File) )
 	{
 		return( false );
 	}
 
-	pItem	= bLoad ? g_pData->Open(File, Type) : _Get_byFileName(File);
+	CWKSP_Base_Item	*pItem	= bLoad ? g_pData->Open(File, Type) : _Get_byFileName(File);
 
-	if(	!pItem )
+	if( !pItem || !pItem->Get_Parameters() || !Entry.Get_Child("PARAMETERS") )
 	{
 		return( false );
 	}
 
-	if( pItem->Get_Parameters() && Entry.Get_Child(SG_T("PARAMETERS")) )
-	{
-		pItem->Get_Parameters()->Serialize(*Entry.Get_Child(SG_T("PARAMETERS")), false);
-		_Compatibility_Data((TSG_Data_Type)Type, pItem->Get_Parameters(), Version);
-		pItem->Parameters_Changed();
-	}
+	pItem->Get_Parameters()->Serialize(*Entry.Get_Child("PARAMETERS"), false);
+	pItem->Parameters_Changed();
 
 	return( true );
 }
@@ -551,60 +549,81 @@ bool CWKSP_Project::_Save_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 //---------------------------------------------------------
 bool CWKSP_Project::_Load_Map(CSG_MetaData &Entry, const wxString &ProjectDir)
 {
-	TSG_Rect		r;
-	CSG_MetaData	*pNode;
-	CWKSP_Base_Item	*pItem;
-	CWKSP_Map		*pMap;
+	TSG_Rect	Extent;
 
-	if( Entry.Get_Name().Cmp(SG_T("MAP")) )
+	if(  Entry.Get_Name().Cmp("MAP")
+	||	!Entry.Get_Child("XMIN") || !Entry.Get_Child("XMIN")->Get_Content().asDouble(Extent.xMin)
+	||	!Entry.Get_Child("XMAX") || !Entry.Get_Child("XMAX")->Get_Content().asDouble(Extent.xMax)
+	||	!Entry.Get_Child("YMIN") || !Entry.Get_Child("YMIN")->Get_Content().asDouble(Extent.yMin)
+	||	!Entry.Get_Child("YMAX") || !Entry.Get_Child("YMAX")->Get_Content().asDouble(Extent.yMax) )
 	{
 		return( false );
 	}
 
-	if(	!Entry.Get_Child(SG_T("XMIN")) || !Entry.Get_Child(SG_T("XMIN"))->Get_Content().asDouble(r.xMin)
-	||	!Entry.Get_Child(SG_T("XMAX")) || !Entry.Get_Child(SG_T("XMAX"))->Get_Content().asDouble(r.xMax)
-	||	!Entry.Get_Child(SG_T("YMIN")) || !Entry.Get_Child(SG_T("YMIN"))->Get_Content().asDouble(r.yMin)
-	||	!Entry.Get_Child(SG_T("YMAX")) || !Entry.Get_Child(SG_T("YMAX"))->Get_Content().asDouble(r.yMax) )
-	{
-		return( false );
-	}
+	//-----------------------------------------------------
+	CSG_MetaData	*pNode	= Entry.Get_Child("LAYERS");
 
-	if( (pNode = Entry.Get_Child(SG_T("LAYERS"))) == NULL || pNode->Get_Children_Count() <= 0 )
+	if( pNode == NULL || pNode->Get_Children_Count() <= 0 )
 	{
 		return( false );
 	}
 
-	pMap	= NULL;
+	//-----------------------------------------------------
+	int		i, n;
 
-	for(int i=0; i<pNode->Get_Children_Count(); i++)
+	for(i=0, n=0; i<pNode->Get_Children_Count(); i++)
 	{
-		if(	(pItem = _Get_byFileName(Get_FilePath_Absolute(ProjectDir, pNode->Get_Child(i)->Get_Content().w_str()))) != NULL
-		&&	(	pItem->Get_Type()	== WKSP_ITEM_Grid
-			||	pItem->Get_Type()	== WKSP_ITEM_TIN
-			||	pItem->Get_Type()	== WKSP_ITEM_PointCloud
-			||	pItem->Get_Type()	== WKSP_ITEM_Shapes) )
+		if( !pNode->Get_Child(i)->Get_Name().Cmp("FILE") )
 		{
-			if( pMap == NULL )
+			CWKSP_Base_Item	*pItem	= _Get_byFileName(Get_FilePath_Absolute(ProjectDir, pNode->Get_Child(i)->Get_Content().w_str()));
+
+			if(	pItem &&
+			(   pItem->Get_Type() == WKSP_ITEM_Grid
+			||  pItem->Get_Type() == WKSP_ITEM_TIN
+			||  pItem->Get_Type() == WKSP_ITEM_PointCloud
+			||  pItem->Get_Type() == WKSP_ITEM_Shapes) )
 			{
-				pMap	= new CWKSP_Map;
+				n++;
 			}
-
-			g_pMaps->Add((CWKSP_Layer *)pItem, pMap);
 		}
 	}
 
-	if( !pMap )
+	if( n == 0 )
 	{
 		return( false );
 	}
 
-	if( Entry.Get_Child(SG_T("NAME")) && Entry.Get_Child(SG_T("NAME"))->Get_Content().Length() > 0 )
+	//-----------------------------------------------------
+	CWKSP_Map	*pMap	= new CWKSP_Map;
+
+	for(int i=0; i<pNode->Get_Children_Count(); i++)
+	{
+		if( !pNode->Get_Child(i)->Get_Name().Cmp("FILE") )
+		{
+			CWKSP_Base_Item	*pItem	= _Get_byFileName(Get_FilePath_Absolute(ProjectDir, pNode->Get_Child(i)->Get_Content().w_str()));
+
+			if(	pItem &&
+			(   pItem->Get_Type() == WKSP_ITEM_Grid
+			||  pItem->Get_Type() == WKSP_ITEM_TIN
+			||  pItem->Get_Type() == WKSP_ITEM_PointCloud
+			||  pItem->Get_Type() == WKSP_ITEM_Shapes) )
+			{
+				g_pMaps->Add((CWKSP_Layer *)pItem, pMap);
+			}
+		}
+		else
+		{
+			pMap->Add_Graticule(pNode->Get_Child(i));
+		}
+	}
+
+	//-----------------------------------------------------
+	if( Entry.Get_Child("PARAMETERS") && pMap->Get_Parameters()->Serialize(*Entry.Get_Child("PARAMETERS"), false) )
 	{
-		pMap->Get_Parameter("NAME")->Set_Value(Entry.Get_Child(SG_T("NAME"))->Get_Content());
 		pMap->Parameters_Changed();
 	}
 
-	pMap->Set_Extent(r, true);
+	pMap->Set_Extent(Extent, true);
 	pMap->View_Show(true);
 
 	return( true );
@@ -621,19 +640,30 @@ bool CWKSP_Project::_Save_Map(CSG_MetaData &Entry, const wxString &ProjectDir, C
 
 	CSG_MetaData	*pEntry	= Entry.Add_Child(SG_T("MAP"));
 
-	pEntry->Add_Child(SG_T("NAME"), pMap->Get_Name().c_str());
-	pEntry->Add_Child(SG_T("XMIN"), pMap->Get_Extent().Get_XMin());
-	pEntry->Add_Child(SG_T("XMAX"), pMap->Get_Extent().Get_XMax());
-	pEntry->Add_Child(SG_T("YMIN"), pMap->Get_Extent().Get_YMin());
-	pEntry->Add_Child(SG_T("YMAX"), pMap->Get_Extent().Get_YMax());
+	pEntry->Add_Child("XMIN", pMap->Get_Extent().Get_XMin());
+	pEntry->Add_Child("XMAX", pMap->Get_Extent().Get_XMax());
+	pEntry->Add_Child("YMIN", pMap->Get_Extent().Get_YMin());
+	pEntry->Add_Child("YMAX", pMap->Get_Extent().Get_YMax());
+
+	pMap->Get_Parameters()->Serialize(*pEntry->Add_Child("PARAMETERS"), true);
 
-	pEntry	= pEntry->Add_Child(SG_T("LAYERS"));
+	pEntry	= pEntry->Add_Child("LAYERS");
 
 	for(int i=pMap->Get_Count()-1; i>=0; i--)
 	{
-		if( pMap->Get_Layer(i)->Get_Layer()->Get_Object()->Get_File_Name() != NULL )
+		if( pMap->Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer )
+		{
+			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()) )
+			{
+				pEntry->Add_Child("FILE", Get_FilePath_Relative(ProjectDir, pObject->Get_File_Name()).c_str());
+			}
+		}
+
+		else if( pMap->Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Graticule )
 		{
-			pEntry->Add_Child(SG_T("FILE"), Get_FilePath_Relative(ProjectDir, pMap->Get_Layer(i)->Get_Layer()->Get_Object()->Get_File_Name()).c_str());
+			((CWKSP_Map_Graticule *)pMap->Get_Item(i))->Save(*pEntry);
 		}
 	}
 
@@ -656,220 +686,6 @@ CWKSP_Base_Item * CWKSP_Project::_Get_byFileName(const wxString &FileName)
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CWKSP_Project::Save_Modified(CWKSP_Base_Item *pItem, bool bSelections)
-{
-	CSG_Parameters	Parameters;
-
-	Parameters.Create(this, _TL("Close and save modified data sets..."), _TL(""));
-	Parameters.Add_Value(NULL, "SAVE_ALL", _TL("Save all"), _TL(""), PARAMETER_TYPE_Bool, false);
-
-	_Modified_Get(&Parameters, pItem, bSelections);
-
-	if( Parameters.Get_Count() > 1 )
-	{
-		Parameters.Set_Callback_On_Parameter_Changed(&_Modified_Changed);
-
-		if( !DLG_Parameters(&Parameters) )
-		{
-			return( false );
-		}
-
-		_Modified_Save(&Parameters);
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-int CWKSP_Project::_Modified_Changed(CSG_Parameter *pParameter, int Flags)
-{
-	if( !pParameter || !pParameter->Get_Owner() || !pParameter->Get_Owner()->Get_Owner() )
-	{
-		return( 0 );
-	}
-
-	CSG_Parameters	*pParameters	= pParameter->Get_Owner();
-
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SAVE_ALL")) )
-	{
-		for(int i=0; i<pParameters->Get_Count(); i++)
-		{
-			CSG_Parameter	*pFile	= pParameters->Get_Parameter(i);
-
-			if( pFile->Get_Type() == PARAMETER_TYPE_Bool )
-			{
-				pFile->Set_Value(pParameter->asBool());
-
-				for(int j=0; j<pFile->Get_Children_Count(); j++)
-				{
-					pFile->Get_Child(j)->Set_Enabled(pParameter->asBool());
-				}
-			}
-		}
-	}
-
-	else if( pParameter->Get_Type() == PARAMETER_TYPE_Bool )
-	{
-		if( !pParameter->asBool() && pParameters->Get_Parameter("SAVE_ALL") )
-		{
-			pParameters->Get_Parameter("SAVE_ALL")->Set_Value(0);
-		}
-
-		for(int j=0; j<pParameter->Get_Children_Count(); j++)
-		{
-			pParameter->Get_Child(j)->Set_Enabled(pParameter->asBool());
-		}
-	}
-
-	return( 0 );
-}
-
-//---------------------------------------------------------
-bool CWKSP_Project::_Modified_Get(CSG_Parameters *pParameters, CWKSP_Base_Item *pItem, bool bSelections)
-{
-	int		i;
-
-	if( pItem && pParameters )
-	{
-		switch( pItem->Get_Type() )
-		{
-		default:
-			break;
-
-		//-------------------------------------------------
-		case WKSP_ITEM_Data_Manager:
-		case WKSP_ITEM_Table_Manager:
-		case WKSP_ITEM_Shapes_Manager:
-		case WKSP_ITEM_Shapes_Type:
-		case WKSP_ITEM_TIN_Manager:
-		case WKSP_ITEM_PointCloud_Manager:
-		case WKSP_ITEM_Grid_Manager:
-		case WKSP_ITEM_Grid_System:
-			for(i=0; i<((CWKSP_Base_Manager *)pItem)->Get_Count(); i++)
-			{
-				_Modified_Get(pParameters, ((CWKSP_Base_Manager *)pItem)->Get_Item(i), bSelections && !pItem->is_Selected());
-			}
-			break;
-
-		//-------------------------------------------------
-		case WKSP_ITEM_Table:
-			if( !bSelections || pItem->is_Selected() )
-			{
-				_Modified_Get(pParameters, pItem, ((CWKSP_Table *)pItem)->Get_Table() );
-			}
-			break;
-
-		case WKSP_ITEM_Shapes:
-		case WKSP_ITEM_TIN:
-		case WKSP_ITEM_PointCloud:
-		case WKSP_ITEM_Grid:
-			if( !bSelections || pItem->is_Selected() )
-			{
-				_Modified_Get(pParameters, pItem, ((CWKSP_Layer *)pItem)->Get_Object());
-			}
-			break;
-		}
-	}
-
-	return( true );
-}
-
-//---------------------------------------------------------
-bool CWKSP_Project::_Modified_Get(CSG_Parameters *pParameters, CWKSP_Base_Item *pItem, CSG_Data_Object *pObject)
-{
-	if( pObject->is_Modified() )
-	{
-		wxString		sFilter, sExtension, sPath;
-
-		switch( pItem->Get_Type() )
-		{
-		//-------------------------------------------------
-		default:	return( false );
-		case WKSP_ITEM_Table:		sExtension	= SG_T("txt" );	sFilter	= DLG_Get_FILE_Filter(ID_DLG_TABLES_SAVE);		break;
-		case WKSP_ITEM_Shapes:		sExtension	= SG_T("shp" );	sFilter	= DLG_Get_FILE_Filter(ID_DLG_SHAPES_SAVE);		break;
-		case WKSP_ITEM_TIN:			sExtension	= SG_T("shp" );	sFilter	= DLG_Get_FILE_Filter(ID_DLG_TIN_SAVE);			break;
-		case WKSP_ITEM_PointCloud:	sExtension	= SG_T("spc" );	sFilter	= DLG_Get_FILE_Filter(ID_DLG_POINTCLOUD_SAVE);	break;
-		case WKSP_ITEM_Grid:		sExtension	= SG_T("sgrd");	sFilter	= DLG_Get_FILE_Filter(ID_DLG_GRIDS_SAVE);		break;
-		}
-
-		sPath	= pObject->Get_File_Name();
-
-		if( sPath.Length() == 0 )
-		{
-			sPath	= pObject->Get_Name();
-			sPath	.Replace(".", "-");
-			sPath	.Replace(":", "-");
-
-			sPath	= SG_File_Make_Path(SG_File_Get_Path(Get_File_Name()), sPath, sExtension).w_str();
-		}
-
-		//-------------------------------------------------
-		CSG_Parameter	*pNode;
-
-		if( (pNode = pParameters->Get_Parameter(CSG_String::Format(SG_T("%d"), (long)pItem->Get_Manager()))) == NULL )
-		{
-			pNode	= pParameters->Add_Node(NULL, CSG_String::Format(SG_T("%d"), (long)pItem->Get_Manager()), pItem->Get_Manager()->Get_Name().wx_str(), SG_T(""));
-		}			
-
-		pNode	= pParameters->Add_Value(
-			pNode, CSG_String::Format(SG_T("%d")     , (long)pObject),
-			pItem->Get_Name().wx_str(), SG_T(""), PARAMETER_TYPE_Bool, false
-		);
-
-		pParameters->Add_FilePath(
-			pNode, CSG_String::Format(SG_T("%d FILE"), (long)pObject),
-			_TL("File"), SG_T(""), sFilter, sPath, true
-		);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CWKSP_Project::_Modified_Save(CSG_Parameters *pParameters)
-{
-	for(int i=0, j=0; i<pParameters->Get_Count(); i++)
-	{
-		long long		Pointer;
-		CSG_Parameter	*pParameter	= pParameters->Get_Parameter(i);
-
-		if(	pParameter->Get_Type() == PARAMETER_TYPE_Bool && pParameter->asBool()
-		&&	SG_SSCANF(pParameter->Get_Identifier(), SG_T("%lld"), (&Pointer)) == 1 )
-		{
-			CSG_Data_Object	*pObject	= (CSG_Data_Object *)Pointer;
-
-			if(	SG_Get_Data_Manager().Exists(pObject) )
-			{
-				CSG_String		fPath;
-				CSG_Parameter	*pPath	= pParameters->Get_Parameter(CSG_String::Format(SG_T("%d FILE"), (long)pObject));
-
-				if(	pPath && pPath->asString() && pPath->asString()[0] )
-				{
-					fPath	= pPath->asString();
-				}
-				else
-				{
-					fPath	= SG_File_Make_Path(SG_File_Get_Path(Get_File_Name()), CSG_String::Format(SG_T("%02d_%s"), ++j, pObject->Get_Name()), NULL);
-				}
-
-				pObject->Save(fPath);
-			}
-		}
-	}
-
-	return( true );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
 //					v2.1 Compatibility					 //
 //														 //
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/project.h b/src/saga_core/saga_gui/project.h
index 93a1b5e..dedf504 100644
--- a/src/saga_core/saga_gui/project.h
+++ b/src/saga_core/saga_gui/project.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: project.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: project.h 1955 2014-01-23 13:49:11Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -89,8 +89,6 @@ public:
 	bool					Save				(bool bSaveAsOnError);
 	bool					Save				(const wxString &FileName, bool bSaveModified);
 
-	bool					Save_Modified		(class CWKSP_Base_Item *pItem, bool bSelections = false);
-
 
 private:
 
@@ -109,16 +107,10 @@ private:
 
 	class CWKSP_Base_Item *	_Get_byFileName		(const wxString &FileName);
 
-	static int				_Modified_Changed	(class CSG_Parameter  *pParameter, int Flags);
-	bool					_Modified_Get		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem, bool bSelections);
-	bool					_Modified_Get		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem, class CSG_Data_Object *pObject);
-	bool					_Modified_Save		(class CSG_Parameters *pParameters);
-
 
 	//-----------------------------------------------------
-	bool					_Compatibility_Data	(TSG_Data_Type Type, class CSG_Parameters *pParameters, const CSG_String &Version);
+	bool	_Compatibility_Data			(TSG_Data_Type Type, class CSG_Parameters *pParameters, const CSG_String &Version);
 
-	//-----------------------------------------------------
 	bool	_Compatibility_Load_Data	(const wxString &FileName);
 	bool	_Compatibility_Load_Data	(CSG_File &Stream, const wxString &ProjectDir);
 	bool	_Compatibility_Load_Map		(CSG_File &Stream, const wxString &ProjectDir);
diff --git a/src/saga_core/saga_gui/res/saga.ger.txt b/src/saga_core/saga_gui/res/saga.ger.txt
index 1c17744..c33007a 100644
--- a/src/saga_core/saga_gui/res/saga.ger.txt
+++ b/src/saga_core/saga_gui/res/saga.ger.txt
@@ -46,10 +46,12 @@ TEXT	TRANSLATION
 "  Total Points:\t%ld"	""
 "  Total Pulses:\t%ld"	""
 "  Version:\t\t\t%d.%d"	""
+"%d points from %d dataset(s) written to output point cloud."	""
 "%d tiles created."	""
 "%d. %s"	""
 "%s_CORRPOINTS"	""
 "%s_DISP_VEC"	""
+"%s_colorised"	""
 "%s_merged"	""
 "(Tw) wetness decline time constant"	"(TW) Feuchtigkeitsr�ckgang zeitkonstant"
 "(Tw) wetness decline time constant [lower bound]"	"(Tw) Feuchtigkeitsr�ckgang zeitkonstant [untere Grenze]"
@@ -92,6 +94,7 @@ TEXT	TRANSLATION
 "0 - 1.0"	""
 "0 - 255"	""
 "0 is horizontal, 90 is vertical."	"0 ist horizontal, 90 ist vertikal"
+"0-50 mm/day"	""
 "0.1"	""
 "01: A Simple Litter System"	"01: Ein einfaches M�llsystem"
 "01: My first module"	"01: Mein erstes Modul"
@@ -120,6 +123,7 @@ TEXT	TRANSLATION
 "1. quadrant (upper right)"	"1. Quadrant (oben rechts)"
 "1.0"	""
 "10 parameter 3rd order polynom (Haralick 1983)"	""
+"100-200 mm/day"	""
 "10: Dynamic Simulation - Life"	"10: Dynamische Simulation - Lebensdauer"
 "11: Dynamic Simulation - Soil Nitrogen Dynamics"	"11: Dynamische Simulation - Stickstoffdynamik im Boden"
 "128x128"	""
@@ -146,7 +150,9 @@ TEXT	TRANSLATION
 "2. quadrant (lower right)"	"2. Quadrant (unten rechts)"
 "2.0"	""
 "20 seconds"	"20 Sekunden"
+"200-400 mm/day"	""
 "256x256"	""
+"2D Shapefile"	""
 "2nd Order Polynomial"	""
 "2nd Std. Parallel"	""
 "3"	""
@@ -164,8 +170,11 @@ TEXT	TRANSLATION
 "3D Image"	"3D Bild"
 "3D Image Height"	"3D Bild H�he"
 "3D Image Width"	"3D Bild Breite"
+"3D Shapefile"	""
 "3D Shapes Viewer"	"3D Vektorbetrachter"
 "3D View"	"3D Ansicht"
+"3D View Sequencer"	""
+"3D Viewer."	""
 "3D-View"	"3D-Blick"
 "3D-View: Player Sequence"	""
 "3rd Order Polynomial"	""
@@ -180,6 +189,7 @@ TEXT	TRANSLATION
 "4 byte unsigned integer"	"4 Byte Ganzzahl ohne Vorzeichen"
 "4. quadrant (upper left)"	"4. Quadrant (unten links)"
 "5 X 5"	""
+"50-100 mm/day"	""
 "6 parameter 2nd order polynom (Bauer, Rohdenburg, Bork 1985)"	""
 "6 parameter 2nd order polynom (Evans 1979)"	""
 "6 parameter 2nd order polynom (Heerdegen & Beran 1982)"	""
@@ -209,6 +219,7 @@ TEXT	TRANSLATION
 "<not set>"	""
 "="	""
 ">"	""
+">400 mm/day"	""
 ">="	""
 "?"	""
 "A"	"A"
@@ -221,8 +232,14 @@ TEXT	TRANSLATION
 "A3 Portrait"	"A3 Hochformat"
 "A4 Landscape"	"A4 Querformat"
 "A4 Portrait"	"A4 Hochformat"
-"A:Grid|Construction"	"A:Raster|Konstruktion"
+"A:Grid|Distances"	""
+"A:Grid|Filter"	""
+"A:Grid|Gaps"	""
+"A:Grid|Grid System"	""
+"A:Grid|Values"	""
 "A:Imagery|Classification"	"A:Bildverarbeitung|Klassifizierung"
+"A:Imagery|Fourier Analysis"	""
+"A:Imagery|Segmentation"	""
 "A:Imagery|Tools"	"A:Bildverarbeitung|Werkzeuge"
 "A:Shapes|Construction"	"A:Vektoren|Konstruktion"
 "A:Shapes|Conversion"	"A:Vektoren|Umwandlung"
@@ -231,13 +248,20 @@ TEXT	TRANSLATION
 "A:Shapes|Tools"	"A:Vektoren|Werkzeuge"
 "A:Spatial and Geostatistics|Points"	"A:Raum und Geostatistik|Punkte"
 "A:Table|Construction"	"A:Tabelle|Konstruktion"
-"A:Table|Selection"	""
+"A:Table|Selection"	"Tabelle|Auswahl"
+"A:Table|Tools"	"Tabelle|Werkzeuge"
 "A:Terrain Analysis|Climate and Weather"	"A:Reliefanalyse|Klima und Wetter"
 "A:Terrain Analysis|Terrain Classification"	"A:Reliefanalyse|Gel�ndeklassifikation"
 "ADDR"	""
 "AFAC("	""
 "AFAC()"	""
+"ANGMAP"	""
+"AOI"	""
+"AOI Input Settings"	""
 "AOI Shape"	"AOI Vektor (Automatische Optische Inspektion)"
+"AOI does not intersect bounding box of SPCVF, nothing to do!"	""
+"AOI does not intersect with any bounding box of the SPCVF datasets, nothing to do!"	""
+"AOI does not intersect with any point of the SPCVF datasets, nothing to do!"	""
 "AQ("	""
 "AREA"	"FL�CHE"
 "AS("	""
@@ -245,6 +269,7 @@ TEXT	TRANSLATION
 "ASCII Decimal Separator"	"ASCII Dezimaltrenner"
 "ASCII Grid Options"	"ASCII Rasteroptionen"
 "ASCII Precision"	"ASCII Genauigkeit"
+"ASCII file with columns degree, order, c_lm, s_lm (separated by space)"	""
 "ASPECT_1"	""
 "ASPECT_2"	""
 "ASPECT_3"	""
@@ -263,6 +288,7 @@ TEXT	TRANSLATION
 "Absolute Weighting"	""
 "Acc. Area"	"abgesch�tzte Fl�che"
 "Acceleration"	"Beschleunigung"
+"Acceptable Time Difference between Image and Laser Points"	""
 "Accessing PostgreSQL databases."	""
 "Accumulated Cost"	"Akkumulierte Kosten"
 "Accumulated Cost (Anisotropic)"	"Akkumulierte Kosten (Anisotropisch)"
@@ -289,31 +315,40 @@ TEXT	TRANSLATION
 "Add Coordinates to points"	"F�ge Koordinaten zu Punkten hinzu"
 "Add Field"	"Feld hinzuf�gen"
 "Add Frame"	"F�ge Rahmen hinzu"
+"Add Graticule"	""
 "Add Grid Name Field"	""
 "Add Grid Values to Points"	"Weise Rasterwerte Punkten zu"
 "Add Grid Values to Shapes"	"F�ge Rasterwerte in Vektor ein"
 "Add Identifier"	""
 "Add Link to Files"	"Erzeuge Verkn�pfung zu Dateien"
+"Add Location Info"	""
+"Add Overlap"	""
 "Add Part"	""
+"Add Point Attributes to Polygons"	""
+"Add Point Order"	""
 "Add Polygon Attributes to Points"	"F�ge Polygonattribute Punkten hinzu"
 "Add Position [A]"	""
+"Add Position [Ctrl + A]"	""
 "Add Project"	""
 "Add Record"	""
 "Add Shape"	""
+"Add Source Information"	""
 "Add Volumes Below Base Level"	"F�ge Volumnia unter Ausgangsniveau hinzu"
 "Add layer to selected map"	"F�ge Ebene zu ausgew�hlter Karte hinzu"
+"Add location information from points (x,y,(z,m))"	""
+"Add overlap to AOI"	""
+"Add point order as additional attribute."	""
 "Add to Map"	""
 "Add unique identifier attribute field to output, ID resembles processing order."	""
 "Addition"	"Addierung"
-"Additional Cuts"	"Zus�tzliche Schnitte"
 "Additional Grids"	"Zus�tzliche Raster"
-"Additional Layers"	"Zus�tzliche Ebenen"
 "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."	""
 "Additional values that shall be saved to the output table."	"Zus�tzliche Werte, die zu der Ausgabetabelle gesichert werden sollen."
 "Addition|"	"Addierung|"
+"Adds a field with the name of the original input data set."	""
 "Adjust"	"Einstellen"
 "Adjust to Grid"	"An Raster anpassen"
 "Adjustment"	""
@@ -333,6 +368,7 @@ TEXT	TRANSLATION
 "Albers Equal Area Conic"	"Albers fl�chentreue Kegelprojektion"
 "Alessandro Perego"	""
 "Algorithm for the detection of Surface Specific Points"	"Algorithmus f�r die Erfassung charakteristischer Oberfl�chenpunkte"
+"All"	""
 "All Files"	"Alle Dateien"
 "All Files|*.*|"	"Alle Dateien|*.*|"
 "All Levels"	""
@@ -346,6 +382,7 @@ TEXT	TRANSLATION
 "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 to scale shade brightness [percent]"	""
 "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"	""
@@ -373,15 +410,21 @@ TEXT	TRANSLATION
 "Angular Distance Weighted"	""
 "Annual"	""
 "Annual Course of Daily Insolation"	""
+"Appearance"	""
 "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?"	""
 "Apply Move"	"Wende Bewegung an"
+"Apply a filter (erosion - binary reconstruction) to the input image "	""
 "Apply changes?"	"�nderungen anwenden?"
 "Apply offset?"	"Versatz zuf�gen?"
 "Apply post-processing filter to remove small holes"	""
 "Approx. Terrain Slope"	"ungef�hre Gel�ndeneigung"
+"Approximate Coordinate"	""
+"Approximate Coordinates of Projection Center"	""
+"Approximate Coordinates of Target Point"	""
 "Approximate Terrain Slope [%]"	"ungef�hre Gel�ndeneigung [%]"
 "April"	"April"
 "Arc Vertex Distance [Degree]"	""
@@ -408,7 +451,9 @@ TEXT	TRANSLATION
 "Aspect-Slope"	""
 "Aspect-Slope Grid"	""
 "Assign"	"Zuweisen"
+"Assign ..."	""
 "Assign attributes to shapes..."	"Attribute Vektordaten zuweisen..."
+"Assume a given minimum slope for each cell."	""
 "At-Sensor Radiance"	""
 "At-Sensor Reflectance"	""
 "At-Sensor Temperature"	""
@@ -434,7 +479,6 @@ TEXT	TRANSLATION
 "Author"	"Autor"
 "Automated Cloud Cover Assessment"	""
 "Automatic"	""
-"Automatic mode"	"Automatisch"
 "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"
@@ -443,10 +487,10 @@ TEXT	TRANSLATION
 "Available Clay"	""
 "Available Connections"	"Verf�gbare Verbindungen"
 "Available Libraries"	""
-"Available Modules"	"Verf�gbare Module"
 "Available Projections:"	"Verf�gbare Projektionen:"
 "Available Sand"	""
 "Available Silt"	""
+"Available Tools"	"Verf�gbare Werkzeuge"
 "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 [...]
@@ -492,6 +536,7 @@ TEXT	TRANSLATION
 "Backpropagation parameters"	""
 "Backward"	"R�ckw�rts"
 "Backward Diagonal"	"R�ckw�rts diagonal"
+"Backward [Page Down]"	""
 "Backward diagonal hatch"	"Diagonal r�ckwarts schraffiert"
 "Band"	""
 "Band 1"	""
@@ -527,6 +572,9 @@ TEXT	TRANSLATION
 "Bilinear Interpolation"	"Bilineare Interpolation"
 "Binary Byte Order"	"Bin�rer Byte-Befehl"
 "Binary Encoding"	"bin�res Verschl�sseln"
+"Binary Erosion-Reconstruction"	""
+"Binary input image for the connectivity analysis"	""
+"Binary object mask"	""
 "Birth Rate of Fishes"	"Geburtsrate von Fischen"
 "Birth Rate of Sharks"	"Geburtsrate von Haien"
 "Blending Distance"	""
@@ -542,11 +590,14 @@ TEXT	TRANSLATION
 "Bonne"	""
 "Boolean"	""
 "Border"	"Grenze"
+"Border Color"	""
 "Borders"	"Grenzen"
 "Bottom"	"Basis"
 "Bottom to Top"	"Unten bis Oben"
 "Boundary Effect"	""
+"Boundary Effect Color"	""
 "Bounding Box"	"Rahmen"
+"Bounding Box [B]"	""
 "Branches"	"Fachgebiete"
 "Branches to Litter"	"Abfallgebiete"
 "Braunschweiger Reliefmodell"	"Braunschweiger Reliefmodell"
@@ -602,7 +653,7 @@ TEXT	TRANSLATION
 "Calibrated Digital Number"	""
 "Calibration Constants"	""
 "Camera"	"Kamera"
-"Can't execute a module while another runs"	""
+"Can't execute a tool while another runs"	"Werkzeugausf�hrung ist nicht m�glich, w�hrend bereits ein anderes l�uft."
 "Cancel"	"Abbrechen"
 "Canny"	"schlau"
 "Canopy Background Adjustment"	""
@@ -620,6 +671,7 @@ TEXT	TRANSLATION
 "Catchment Area (Mass-Flux Method)"	""
 "Catchment Area (Parallel)"	""
 "Catchment Area (Recursive)"	""
+"Catchment Area Calculation"	""
 "Catchment Aspect"	"Einzugsbereich Aussehen"
 "Catchment Height"	"Einzugsbereich H�he"
 "Catchment Slope"	"Einzugsbereich Gef�lle"
@@ -644,9 +696,12 @@ TEXT	TRANSLATION
 "Center Versus Neighbours"	"Mitte versus Nachbarn"
 "Center of Triangles"	"Mitte des Dreiecks"
 "Centered"	"Zentriert"
+"Central"	""
+"Central Distance"	""
 "Central Meridian"	"Zentralmeridian"
 "Central Parallel"	"Zentral Parallel"
 "Central Projection"	"Zentralprojektion"
+"Central Projection Distance"	""
 "Centre"	"Zentrum"
 "Centroid X"	"Schwerpunkt X"
 "Centroid Y"	"Schwerpunkt Y"
@@ -695,6 +750,7 @@ TEXT	TRANSLATION
 "Check the attributes to drop"	""
 "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 to create a new attribute with the reclassification result. If unchecked, the existing attribute is updated."	""
 "Chessboard"	"Schachbrett"
 "Children"	""
@@ -711,11 +767,17 @@ TEXT	TRANSLATION
 "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"
 "Choose case: Rook's case contiguity compares only cell wich share an edge. Queen's case contiguity compares also cells which share just corners."	"W�hle einen Prozess: Rock�s Prozess der N�he vergleicht nur Zellen die Kanten teilen. Queen�s Prozess der N�he vergleicht auch Zellen welche auch Ecken teilen,"
+"Choose how to apply the new value."	""
+"Choose how to handle file paths. With relative paths, you can package the *.spcvf and your point cloud tiles easily."	""
+"Choose how to handle the NoData value of the output grid."	""
+"Choose how to sort the elevation dataset before sampling"	""
 "Choose if you want to segmentate either on minima or on maxima."	"W�hle bei einer Aufteilung entweder minima oder maxima."
 "Choose method how to adjust input values."	"W�hle Methode wie die Eingabewerte anzupassen sind"
 "Choose the Point Data Record Format you like to use"	"W�hle das zu benutzende Punktdatenaufzeichnungsformat "
 "Choose the activation function used by the neronal network."	""
 "Choose the attributes to use for clustering:"	"W�hle die f�r das Clustern zu benutzenden Attribute"
+"Choose the classification constant to use"	""
+"Choose the format of the shapefile."	""
 "Choose the mode of operation"	""
 "Choose the training method used for the neronal network."	""
 "Choose the type of data used in this model."	""
@@ -739,7 +801,6 @@ TEXT	TRANSLATION
 "Classification Quality"	"Klassifizierungsqualit�t"
 "Classification Type"	"Klassifikationstyp"
 "Classification tools for grids."	"Klassifikationswerkzeug f�r Raster."
-"Classificaton"	""
 "Classified"	""
 "Classify"	"Klassifiziere"
 "Claudy 3"	""
@@ -751,6 +812,7 @@ TEXT	TRANSLATION
 "Clear History"	""
 "Clear RGA"	"L�sche RGA"
 "Clear Reference Points"	""
+"Clear Selection"	""
 "Climate"	"Klima"
 "Climate - Tools"	"Klima - Werkzeuge"
 "Climate Data"	"Klimadaten"
@@ -759,8 +821,11 @@ TEXT	TRANSLATION
 "Clip Features"	""
 "Clip Grid with Polygon"	"Schneide Rasterdaten mit Polygon zu"
 "Clip Grid with Rectangle"	""
+"Clip Grids"	""
 "Clip Points with Polygons"	"Schneide Punkte mit Polygon aus"
+"Clip to Extent"	""
 "Clipboard"	""
+"Clipped Grids"	""
 "Clipped Points"	"Ausgeschnittene Punkte"
 "Clipping Options"	"Ausschneide Optionen"
 "Close"	"Schlie�en"
@@ -770,7 +835,6 @@ TEXT	TRANSLATION
 "Close Gaps with Stepwise Resampling"	""
 "Close One Cell Gaps"	"Schlie�e Einzellenl�cken"
 "Close all data sets"	""
-"Close and save modified data sets..."	""
 "Closed Depressions"	""
 "Closed Gaps Grid"	"Raster mit geschlossenen L�cken"
 "Closest Point"	"n�chstgelegener Punkt (Pf.)"
@@ -797,13 +861,18 @@ TEXT	TRANSLATION
 "Color Triangle Composite"	"Farbe Dreiecksgemisch"
 "Color by Attribute"	"Farbe durch Attribut"
 "Coloring"	""
+"Colorisation (PC)"	""
+"Colorised Point Cloud"	""
 "Colors"	"Farben"
 "Colors Value Range"	"Farbwertebereich"
 "Colors file could not be exported."	"Farbdatei konnte nicht erstellt werden."
 "Colors file could not be imported."	"Farbdatei konnte nicht geladen werden."
+"Colour"	""
+"Colour Attribute"	""
 "Colour Normalized Brovey Sharpening"	""
 "Colour Normalized Spectral Sharpening"	""
 "Colouring"	""
+"Colours"	""
 "Colours Palette"	""
 "Cols"	"Spalten"
 "Columns"	"Spalten"
@@ -814,6 +883,7 @@ TEXT	TRANSLATION
 "Combined Shading"	"Kombinationsschummerung"
 "Comma Separated Values"	"durch Kommata getrennte Werte"
 "Command Line Arguments"	"Kommandozeilenargumente"
+"Commands"	""
 "Comment"	"Kommentar"
 "Commit"	"�bergeben"
 "Commit/Rollback Transaction"	""
@@ -821,7 +891,6 @@ TEXT	TRANSLATION
 "Common Edge Type of Face Neighbourhood"	""
 "Common Vertex"	""
 "Compare with..."	"Vergleiche mit.."
-"CompleteLinkage"	"Vervollst�ndige Verbindung"
 "Completed Grid"	"Vervollst�ndigtes Raster"
 "Component"	"Komponente"
 "Composite"	"Gemisch"
@@ -842,6 +911,7 @@ TEXT	TRANSLATION
 "Connected"	""
 "Connection to database failed"	""
 "Connections"	""
+"Connectivity Analysis"	""
 "Connectivity Index (Pff)."	"Konnektivit�t Index"
 "Connectivity Weighting"	"Konnektivit�t Gewichtung"
 "Connectivity [Percent]"	"Konnektivit�t [Prozent]"
@@ -855,9 +925,6 @@ TEXT	TRANSLATION
 "Constraints"	"Einschr�nkungen"
 "Contour Lines"	"Isolinien"
 "Contour Lines from Grid"	"Isolinien von Rasterdaten"
-"Contributions - T. Wutzler"	"Beitr�ge - T. Wutzler"
-"Contributions from Thomas Wutzler."	"Beitr�ge von Thomas Wutzler."
-"Contributions|T. Wutzler"	"Beitr�ge|T. Wutzler"
 "Control Points"	"Kontrollpunkte"
 "Convergence"	"Ann�herung"
 "Convergence (FD8)"	"Ann�herung (FD8)"
@@ -877,6 +944,7 @@ TEXT	TRANSLATION
 "Convert Polygons to Lines"	"Polygone zu Linien umwandeln"
 "Convert Table to Points"	"Tabelle in Punkte umwandeln"
 "Convert To Table"	""
+"Convert Vertex Type (2D/3D)"	""
 "Convert a shapes layer to a TIN\n\n"	"Wandelt eine Vektorebene in ein TIN um\n\n"
 "Convert routes"	"Wandle Strecken um"
 "Convert track points"	"Wandle Streckenpunkte um"
@@ -890,6 +958,8 @@ TEXT	TRANSLATION
 "Coordenada X del punto de ignici�n (s�lo si no se usa grid de puntos de ignici�n)"	"Koordinate X des Z�ndpunktes"
 "Coordenada Y"	"Koordinate Y"
 "Coordenada Y del punto de ignici�n (s�lo si no se usa grid de puntos de ignici�n)"	"Koordinate Y des Z�ndpunktes"
+"Coordinate Reference System Picker"	""
+"Coordinate System"	""
 "Coordinate Transformation (Grid List)"	"Koordinatentransformation (mehrere Rasterdatens�tze) "
 "Coordinate Transformation (Grid)"	"Koordinatentransformation (Rasterdatensatz)"
 "Coordinate Transformation (Shapes List)"	"Koordinatentransformation (mehrere Vektordatens�tze)"
@@ -912,9 +982,7 @@ TEXT	TRANSLATION
 "Copyrights (c) 2003 by Andre Ringeler"	""
 "Copyrights (c) 2003 by Olaf Conrad"	""
 "Copyrights (c) 2003 by Volker Wichmann"	""
-"Copyrights (c) 2004 by Thomas Wutzler"	""
 "Copyrights (c) 2004 by Victor Olaya"	"Copyrights (c) 2004 by Victor Olaya"
-"Copyrights (c) 2005 by Victor Olaya"	""
 "Copyrights (c) 2005 by Volker Wichmann"	""
 "Copyrights (c) 2006 by Victor Olaya"	""
 "Copyrights (c) 2006 by Volker Wichmann"	""
@@ -952,7 +1020,6 @@ TEXT	TRANSLATION
 "Create Grid System"	"Erzeuge Rastersystem"
 "Create KML File"	"Erzeuge KML Datei"
 "Create Lookup Table"	"Nachschlagetabelle erstellen"
-"Create Module Description Files"	""
 "Create New Shapes Layer"	"Erzeuge neue Vektorebene"
 "Create New Table"	"Erzeuge neue Tabelle"
 "Create Normalised Classification"	""
@@ -965,9 +1032,13 @@ TEXT	TRANSLATION
 "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"
+"Create a binary mask Yes/No"	""
 "Create borders between segments as new grid."	"Erzeuge Grenzen zwischen Segmenten als neues Raster."
 "Create index"	"Index erstellen"
 "Create new Attribute"	"Erzeuge neues Attribut"
@@ -1008,7 +1079,6 @@ TEXT	TRANSLATION
 "Cut"	"Schnitt"
 "Cut Shapes Layer"	"Schneide Vektorebene zu"
 "Cuts"	"Schnitte"
-"Cutting"	"Schneiden"
 "Cycles"	"Zyklen"
 "Cylindrical Equal Area"	"Zylindrisch Fl�chentreu"
 "D"	""
@@ -1101,6 +1171,8 @@ TEXT	TRANSLATION
 "Decrease Eye Distance"	""
 "Decrease Legend Size"	""
 "Decrease Perspectivic Distance [F5]"	""
+"Decrease Size Scaling Factor [F7]"	""
+"Decrease Size [F5]"	""
 "Decrease factor"	""
 "Decrease factor n_minus. Must be < 1."	""
 "Deepen Drainage Routes"	"Vertiefen der Entw�sserungsrouten"
@@ -1109,15 +1181,18 @@ TEXT	TRANSLATION
 "Default Rotation"	""
 "Default Size"	"Vorgegebene Gr��e"
 "Defaults"	"Vorgaben"
+"Defaults for New Maps"	""
 "Define AOI by ..."	"Definiere AOI durch.. "
 "Define Georeference for Grids"	""
 "Definition"	""
 "Degree"	"Grad"
 "Delete"	"Entfernen"
 "Delete All Positions"	""
+"Delete All Positions [Ctrl + X]"	""
 "Delete All Records"	""
 "Delete Fields"	"Felder l�schen"
 "Delete History Entries"	""
+"Delete Last Position [Ctrl + D]"	""
 "Delete Last Position [D]"	"Entferne letzten Punkt [D]"
 "Delete Selected Part"	"Entferne ausgew�hlten Teil"
 "Delete Selected Point"	"Entferne ausgew�hlte Punkte"
@@ -1173,9 +1248,10 @@ TEXT	TRANSLATION
 "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)"	"W�rterbuch f�r �bersetzungen f�r voreingestellte Sprachen (Englisch) zu anderen Sprachen (editierbare Texttabelle)"
+"Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply changes."	""
 "Difference"	"Differenz"
 "Difference (A - B)"	"Differenz (A-B)"
+"Difference Input - Reconstruction"	""
 "Difference Vegetation Index"	""
 "Difference from Arithmetic Mean"	"Differenz vom arithmetrischen Mittel"
 "Difference from Mean Value"	"Differenz vom Mittelwert"
@@ -1188,8 +1264,10 @@ TEXT	TRANSLATION
 "Digital Terrain Model"	"Digitales Gel�ndemodell"
 "Digital elevation model"	"Digitales H�henmodell"
 "Dilation"	"Streckung"
+"Dim"	""
 "Dim Colours"	""
 "Dim Range"	""
+"Dip slope"	""
 "Direcci�n del viento"	"Windrichtung"
 "Direcci�n del viento (grados desde el norte en sentido antihorario)"	"Windrichtung (Grad von Nord abweichend gegen den Uhrzeigersinn)"
 "Direcci�n del viento (grados desde el norte)"	"Windrichtung (Grad von Nord abweichend)"
@@ -1216,7 +1294,6 @@ TEXT	TRANSLATION
 "Displacement Vector"	""
 "Displacement vectors between correlated points"	""
 "Display"	"Anzeige"
-"Display Range"	"Anzeigebereich"
 "Display Resolution"	"Aufl�sung Anzeige"
 "Display Type"	"Anzeige Typ"
 "Dissolve Buffers"	"Aufgel�ste Puffer"
@@ -1227,15 +1304,16 @@ TEXT	TRANSLATION
 "Dissolved Polygons"	"Aufgel�ste Polygone"
 "Dist."	"Entfernung"
 "Distance"	"Entfernung"
+"Distance (ViGrA)"	""
 "Distance Grid"	"Distanzraster"
-"Distance Matrix"	"Entfernungsmatrix"
-"Distance Matrix Table"	"Distanzmatrixtabelle"
 "Distance Overland"	"Entfernung �ber Land"
+"Distance Range"	""
 "Distance Threshold"	"Entfernungsschwellenwert"
 "Distance Weighted (inverse distance)"	"Entfernung Gewichtet (Invers distance)"
 "Distance Weighting"	"Entfernungs Gewichtung"
 "Distance Weighting Exponent"	""
 "Distance between points (grid units)."	"Entfernung zwischen Punkten (in Rastereinheiten)"
+"Distances"	""
 "Distinct"	"Deutlich"
 "Diurnal Anisotropic Heating"	"T�gliche anisotrope Erw�rmung"
 "Divergence"	"Abweichung"
@@ -1249,21 +1327,30 @@ TEXT	TRANSLATION
 "Do you really want to delete the table"	"Wollen Sie die Tabelle wirklich l�schen"
 "Do you want to delete the selection?"	"Soll die Auswahl entfernt werden?"
 "Do you want to exit SAGA?"	"Wollen Sie SAGA beenden?"
+"Do you wish to estimate Principal Point Offsets?"	""
+"Do you wish to provide the Radial Distortion Parameters?"	""
+"Do you wish to provide the time stamp of Image?"	""
 "Dominance"	"Dominanz"
 "Dot And Dash"	""
 "Dot and dash style"	"Punkt-Strich-Stil"
 "Dotted"	""
 "Dotted style"	"Gepunktet"
 "Down"	"Ab"
-"Down sort"	"Sortiere abw�rts"
+"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."	""
 "Downslope Area"	"Hangfl�chengebiet"
 "Downslope Basins"	"Hangfl�chenbecken"
 "Downslope Distance Gradient"	"Hangfl�chendistanz Gradient"
 "Drainage Basins"	""
 "Drainage Network"	"Entw�sserungsnetzwerk"
 "Drape Map"	""
+"Draw Box"	""
+"Draw Faces"	""
+"Draw Nodes"	""
 "Draw Style"	"Zeichenstil"
+"Draw Wire"	""
 "Draw a section each n points"	"Zeichne einen Streckenanschnitt f�r jeden n-ten Punkt"
 "Driver"	""
 "Driver does not support file creation."	"Der Treiber unterst�tzt nicht die Dateierstellung."
@@ -1298,6 +1385,7 @@ TEXT	TRANSLATION
 "Eckert IV/VI"	""
 "Edge"	"Rahmen"
 "Edge Contamination"	"Flankenkontamination"
+"Edge Detection (ViGrA)"	""
 "Edge threshold for nonlinear smoothing"	"Grenzschwellenwert f�r nichtlineare Gl�ttung"
 "Edges"	"Kanten"
 "Edit"	"Bearbeiten"
@@ -1323,9 +1411,13 @@ TEXT	TRANSLATION
 "Elevation [m]"	"H�he [m]"
 "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!"	""
 "Ellipsoid Definition"	"Ellipsoid Definition"
 "Ellipsoid Height [m]"	"Ellipsoid H�he [m]"
 "Ellipsoids"	"Ellipsoide"
+"Encountered invalid path description in *.spcvf file!"	""
+"End Latitude"	""
+"End Longitude"	""
 "Enforce True Color"	"Erzwinge Echtfarben"
 "Enhanced Vegetation Index"	""
 "Entropy"	""
@@ -1352,6 +1444,7 @@ TEXT	TRANSLATION
 "Error parsing field type: can't convert to number"	""
 "Error: Continue anyway ?"	"Fehler: Trotzdem fortfahren?"
 "Errors"	"Fehler"
+"Estimate Principal Point Offsets?"	""
 "Estimated Noise (absolute)"	"abgesch�tztes Rauschen (absolut) "
 "Estimated Noise (relative)"	"abgesch�tztes Rauschen (relativ) "
 "Estimated noise in units of input data"	"abgesch�tztes Rauschen in Einheiten der Eingabedaten"
@@ -1360,19 +1453,23 @@ TEXT	TRANSLATION
 "Euclidean"	"Euklidisch"
 "Evapotranspiration"	""
 "Evapotranspiration [m / dt]"	""
+"Exact"	""
 "Exaggeration"	"�berh�hung"
 "Exaggeration Factor"	"�berh�hung"
+"Exaggeration Z"	""
 "Exclude No-Data Area"	""
 "Exclude NoData Cells"	"Zellen ohne Wert ausschlie�en"
 "Execute"	"Ausf�hren"
-"Execute Module"	"F�hre Modul aus"
 "Execute SQL"	""
-"Executing module"	"Moduleausf�hrung"
+"Execute Tool"	"Werkzeug ausf�hren"
+"Executing tool"	"Werkzeug wird ausgef�hrt"
 "Execution"	"Ausf�hrung"
 "Execution has been stopped by user!"	""
 "Exit"	"Beenden"
 "Exit SAGA"	"SAGA beenden"
 "Expand"	"Erweitern"
+"Expand and Shrink"	""
+"Expansion Degree"	""
 "Exponent"	"Exponent"
 "Exponent for distance weighting (0.0-4.0)"	"Exponent f�r Distanzgewichtung"
 "Exponential Model"	"Exponentialmodell"
@@ -1381,6 +1478,7 @@ TEXT	TRANSLATION
 "Export ESRI Arc/Info Grid"	"Export ESRI Arc/Info Rasterdaten"
 "Export GPX"	"Export GPX"
 "Export GStat Shapes"	"Export GStat Vektordaten"
+"Export Grid to KML"	""
 "Export Grid to XYZ"	"Export Raster zu XYZ"
 "Export Image (bmp, jpg, pcx, png, tif)"	"Export Bild (bmp, jpg, pcx, png, tif)"
 "Export LAS Files"	"Export LAS Dateien"
@@ -1401,6 +1499,7 @@ TEXT	TRANSLATION
 "Export WRF Geogrid Binary Format"	""
 "Export descriptions"	"Export Beschreibungen"
 "Export names"	"Export Namen"
+"Export to File"	""
 "Export z values"	"Export z-Werte"
 "Expression"	"Ausdruck"
 "Extended Neighourhood"	"erweiterte Nachbarschaft"
@@ -1408,6 +1507,7 @@ TEXT	TRANSLATION
 "Extent [Cut]"	"Umfang [Zuschneiden]"
 "Extent to CellSize"	"Abh�ngig von Zellgr��e"
 "Extents"	"Umfange"
+"Exterior Orientation Parameters"	""
 "Extraction of..."	"Extrahierung von..."
 "Extreme"	"Extrem"
 "Eye Distance"	"Augendistanz"
@@ -1416,9 +1516,16 @@ TEXT	TRANSLATION
 "FACE_A"	"SEITE_B"
 "FACE_B"	"SEITE_A"
 "FLOW"	"VERLAUF"
+"FS 1-1.5"	""
+"FS 1.5-3"	""
+"FS 3-6"	""
+"FS <1"	""
+"FS >6"	""
+"Faces"	""
 "Factor"	"Faktor"
 "Fade Color Count"	"Bleiche Farben Z�hler"
 "Fahrenheit to Celsius"	"Fahrenheit zu Celsius"
+"Failure"	""
 "False Easting"	"unechte Ostrichtung"
 "False Easting [m]"	"unechte Ostrichtung [m]"
 "False Northing"	"unechte Nordrichtung [m]"
@@ -1427,10 +1534,12 @@ TEXT	TRANSLATION
 "Fast Representativeness"	"Schneller repr�sentativer Charakter"
 "Feature"	""
 "Feature Aggregation"	"Merkmal Anh�ufung"
+"Feature Probabilities"	""
 "Feature Space Options"	"Merkmal L�ckenoptionen"
 "Features"	"Merkmale"
 "Features Grid"	"Merkmalsraster"
 "Features are all pixels different not representing no-data."	"Merkmal ist, dass alle unterschiedlichen Pixel keine No-Data-Werte repr�sentieren."
+"Features per Node"	""
 "February"	"Februar"
 "Feigenbaum's Bifurcation"	"Feigenbaum�s Verzweigung"
 "Ferhat Bing�l (c) 2009"	""
@@ -1450,22 +1559,30 @@ TEXT	TRANSLATION
 "Field data type"	"Feld Datentyp"
 "Field for Summary"	"Feld f�r Zusammenfassung"
 "Field with identifier."	"Feld mit Identifizierer"
+"Field with measure information."	""
 "Field with x-coordinate."	"Feld mit X-Koordinate"
 "Field with y-coordinate."	"Feld mit Y-Koordinate"
+"Field with z-coordinate information."	""
 "Field with z-coordinate."	"Felt mit X-Koordinate"
 "Fields"	"Felder"
+"Fields Visited"	""
 "Fields for diagram"	"Feld f�r Diagramm"
 "Figure"	"Bild"
 "File"	"Datei"
 "File Cache"	"Datei Speicher"
 "File Cache [MB]"	""
+"File Caching"	""
 "File Name"	"Dateiname"
+"File Paths"	""
 "File System"	"Dateisystem"
 "File contains headline"	"Datei enth�lt Kopfzeile"
 "File does not exist:"	"Datei existiert nicht:"
 "File error"	"Dateifehler"
 "File path"	"Dateipfad"
 "File signature is not 'LASF'!"	"Dateikennzeichnung ist nicht �LASF�!"
+"File with Coefficients"	""
+"Filename"	""
+"Filepath"	""
 "Files"	"Dateien"
 "File|ESRI E00"	"Datei|ESRI E00"
 "File|GDAL/OGR"	"Datei|GDAL/OGR"
@@ -1475,6 +1592,7 @@ TEXT	TRANSLATION
 "File|Shapes"	"Datei|Vektordaten"
 "File|Table"	"Datei|Tabelle"
 "File|Tables"	"Datei|Tabellen"
+"File|Virtual"	""
 "Fill Color"	"F�llfarbe"
 "Fill Gaps in Records"	""
 "Fill NoData"	"F�llen der NoData-Zellen"
@@ -1490,10 +1608,14 @@ TEXT	TRANSLATION
 "Filter Clumps"	"Filter Klumpen"
 "Filter Criterion"	"Filterkriterium"
 "Filter Matrix"	"Filter Matrix"
+"Filter Size (Radius)"	""
+"Filter size (radius in grid cells)"	""
 "Filtered"	"Gefiltert"
 "Filtered DTM"	"Gefiltertes DGM"
 "Filtered Grid"	"Gefiltertes Raster"
+"Filtered Image"	""
 "Filtered Points"	"Gefiterte Punkte"
+"Filtered mask will be created automatically ..."	""
 "Final Parameters"	"endg�ltige Parameter"
 "Final State"	"Endzustand"
 "Final aspect-slope grid."	""
@@ -1502,6 +1624,7 @@ TEXT	TRANSLATION
 "Find Field of Extreme Value"	"Finde Feld extremer Werte"
 "Find Outlets"	"Finde Abfluss"
 "Find Pits"	"Finde Gruben"
+"Find and Run Tool"	"Finde und starte Werkzeug"
 "Fire Length"	"Feuerl�nge"
 "Fire Length (min)"	"Feuerl�nge (min)"
 "Fire Risk Analysis"	"Feuer-Risikoanalyse"
@@ -1510,6 +1633,7 @@ TEXT	TRANSLATION
 "First input grid"	"Erstes Eingaberaster"
 "Fit"	"Passend"
 "Fit Color Palette to Grid Values"	"Passe Farbpalette an Rasterwerte an"
+"Fit Colors"	""
 "Fit Colours Dialog"	""
 "Fit Colours to Minimum/Maximum"	""
 "Fit Colours to Standard Deviation"	""
@@ -1525,6 +1649,7 @@ TEXT	TRANSLATION
 "Fit to Cells"	""
 "Fit to Standard Deviation"	""
 "Fitting range"	"Anpassungsbereich"
+"Fixed Interval (Degree)"	""
 "Fixed Maximum"	""
 "Fixed Minimum"	""
 "Fixed Time Span (minutes)"	""
@@ -1538,6 +1663,7 @@ TEXT	TRANSLATION
 "Flat Areas"	"Wohngebiete"
 "Flat Detection"	"Flacherkennung"
 "Flats"	"Wohnungen"
+"Flatten Polygon Layer"	""
 "Flattening"	"Abplattung"
 "Flattening (f)"	"Abplattung (f)"
 "Flip"	"Kippen"
@@ -1566,16 +1692,22 @@ TEXT	TRANSLATION
 "Flow Routing Algorithm"	"Str�mung Routingalgorithmus"
 "Flow Sinuosity"	"Str�mung Sinusit�t"
 "Flow Split Method"	"Str�mung Aufteilungsmethode"
+"Flow Threshold"	""
+"Flow Travel Time"	""
 "Flow Width"	"Str�mung Breite"
 "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."	""
 "Flux"	""
 "Flux out of each cell, i.e. everything accumulated so far."	""
 "Flying Height"	""
+"Focal Length (mm)"	""
 "Focal Length [mm]"	""
+"Focal Length in mm"	""
 "Folder"	"Ordner"
 "Folder for PDF Files"	"Ordner f�r PDF-Dateien"
 "Font"	""
+"Font size given as percentage of map size."	""
 "Foot Hollow"	""
 "Foot Slope"	""
 "Foot Spur"	""
@@ -1583,8 +1715,14 @@ TEXT	TRANSLATION
 "Formula"	"Formel"
 "Forward"	"Vorw�rts"
 "Forward Diagonal"	"Vorw�rts Digonal"
+"Forward [Page Up]"	""
 "Forward diagonal hatch"	"Diagonalschraffur vorw�rts"
+"Fourier Filter (ViGrA)"	""
+"Fourier Transform (Real, ViGrA)"	""
+"Fourier Transform (ViGrA)"	""
+"Fourier Transform Inverse (ViGrA)"	""
 "Fourier Transformation (Imaginary)"	"Fourier Transformation (Imagin�r)"
+"Fourier Transformation (OpenCV)"	""
 "Fourier Transformation (Real)"	"Fourier Transformation (Real)"
 "Fractal Dimension"	"Fractale Dimension"
 "Fractal Dimension of Grid Surface"	"Fractale Dimension der Rasteroberfl�che"
@@ -1596,6 +1734,7 @@ TEXT	TRANSLATION
 "Fragmentation Classes from Density and Connectivity"	"Fragmentierungsklassen aus Dichte und Konnektivit�t"
 "Fragmentation Index"	"Fragmentierungsindex"
 "Frame"	"Rahmen"
+"Frame Coordinates"	""
 "Frame Size"	""
 "Frame Width"	"Rahmenbreite"
 "Frame Width [Pixels]"	"Rahmenbreite [Pixel]"
@@ -1649,15 +1788,15 @@ TEXT	TRANSLATION
 "Game Level"	"Spielstufe"
 "Games"	"Spiele"
 "Gamma"	""
-"Garden - 3D Shapes Viewer"	"Testversionen - 3D Vektorenbetrachter"
+"Garden - 3D Viewer"	""
 "Garden - Fractals"	"Testversionen - Fraktale"
 "Garden - Games"	"Testversionen - Spiele"
 "Garden - Introducing Module Programming"	"Testversionen - Einf�hrung in die Modulprogrammierung"
 "Garden - Web Service Data Access"	"Testversionen - Web Service Datenzugriff"
+"Garden|3D Viewer"	""
 "Garden|Introducing Module Programming"	"Testversionen|Einf�hrung in die Modulprogrammierung"
 "Garden|Recreations|Fractals"	"Testversionen|Erholung|Fraktale"
 "Garden|Recreations|Games"	"Testversionen|Erholung|Spiele"
-"Garden|Visualisation"	"Testversionen|Visualisierung"
 "Garden|Web Service Data Access"	"Testversionen|Web Service Datenzugriff"
 "Gauges"	"Ma�e"
 "Gaussian"	"Gau�sche"
@@ -1679,6 +1818,7 @@ TEXT	TRANSLATION
 "GeoTrans (Grid)"	"GeoTRANS (Raster)"
 "GeoTrans (Shapes)"	"GeoTrans (Vektoren)"
 "Geocentric Coordinate System"	"Geozentrisches Koordinatensystem"
+"Geodesic Morphological Reconstruction"	""
 "Geodetic"	"Geod�tisch"
 "Geographic Coordinate System"	"Geographisches Koordinatensystem"
 "Geographic Coordinate Systems"	"Geographische Koordinatensysteme"
@@ -1688,16 +1828,20 @@ TEXT	TRANSLATION
 "Geographically Weighted Regression (Points/Grid)"	"Geografisch gewichtete Regression (Punkte/Raster)"
 "Geoid"	"Geoid"
 "Geometric Figures"	"Geometrische Figur"
+"Geometry Type"	""
+"Geoprocessing"	"Geoverarbeitung"
 "Get CRS Definition from..."	"Hole CRS-Definitionen von...."
 "Get Class Statistics from..."	""
 "Get Extent for ..."	""
 "Get Heights from ..."	""
 "Get Independent Variable from ..."	""
 "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"
 "Gradient"	"Gradient"
@@ -1710,7 +1854,9 @@ TEXT	TRANSLATION
 "Gradient Vectors from Directional Components"	""
 "Gradient Vectors from Surface"	""
 "Gradient threshold"	"Gradient Schwellenwert"
+"Graduated"	""
 "Graduated Colors"	""
+"Graduated Colours"	""
 "Graticule"	"Gitternetz"
 "Greater than"	"Gr��er als"
 "Green"	"Gr�n"
@@ -1731,10 +1877,9 @@ TEXT	TRANSLATION
 "Grid 2"	"Raster 2"
 "Grid Buffer"	"Rasterpuffer"
 "Grid Calculator"	"Raster Rechner"
+"Grid Cell Index"	""
 "Grid Difference"	"Raster Differenz"
-"Grid Display Defaults"	"Raster Darstellungsvoreinstellungen"
 "Grid Division"	""
-"Grid File Caching"	"Raster Dateizwischenspeicherung"
 "Grid Interpolation"	"Raster Interpolation"
 "Grid Manager"	"Rasterverwaltung"
 "Grid Masking"	"Raster Abdeckung"
@@ -1744,7 +1889,6 @@ TEXT	TRANSLATION
 "Grid Orientation"	"Raster Ausrichtung"
 "Grid Project"	"Raster Projekt"
 "Grid Proximity Buffer"	"Raster Nachbarschaftspuffer"
-"Grid Shrink/Expand"	""
 "Grid Size"	"Raster Gr��e"
 "Grid Skeletonization"	"Raster Ger�st"
 "Grid Spacing (Map Units)"	""
@@ -1763,6 +1907,7 @@ TEXT	TRANSLATION
 "Grid Volume"	"Raster Volumen"
 "Grid based or related calculations."	"Rasterbasiert oder �hnliche Berechnungen"
 "Grid defining the zones to analyse. This grid also acts as a mask. Coding: NoData / categorial values."	""
+"Grid describing the AOI."	""
 "Grid describing the state of each cell at timestep t + 1."	""
 "Grid describing the state of each cell at timestep t."	""
 "Grid file could not be opened."	"Rasterdatei konnte nicht ge�ffnet werden."
@@ -1773,6 +1918,7 @@ TEXT	TRANSLATION
 "Grid system"	"Rastersystem"
 "Grid to TIN"	"Raster zu TIN"
 "Grid to TIN (Surface Specific Points)"	"Raster zu TIN (Oberfl�chenspezifische Punkte)"
+"Grid to be filtered"	""
 "Grid to filter"	"zu filterndes Raster"
 "Grid to reclassify"	"neueinzuteilendes Raster"
 "Grid value equals low value"	"Rasterwert ist gleich zu niedrigem Wert"
@@ -1813,6 +1959,7 @@ TEXT	TRANSLATION
 "Height"	"H�he"
 "Height (Cells)"	"H�he (Zellen)"
 "Height Threshold"	"H�he Schwellenwert"
+"Height given as percentage of map size"	""
 "Height of Atmosphere [m]"	"H�he der Atmosph�re [m]"
 "Height of Atmosphere and Vapour Pressure"	"H�he der Atmosph�re und Dampfdruck"
 "Height of the light source above ground."	"H�he der Lichtquelle �ber der Oberfl�che."
@@ -1845,12 +1992,14 @@ TEXT	TRANSLATION
 "Horizontal"	""
 "Horizontal Align"	""
 "Horizontal Interpolation Method"	""
+"Horizontal Offset"	""
 "Horizontal Overland Flow Distance"	"Horizontale �ber Land Str�mungsdistanz"
 "Horizontal Range"	"Horizontaler Bereich"
 "Horizontal hatch"	"horizontale Schraffur"
 "Horizontally mirrored"	"horizontal gespiegelt"
 "Host"	""
 "Hourly Data"	"St�ndliche Daten"
+"How many trees to create?"	""
 "Html Extra Info"	""
 "Hull Construction"	"H�llenkonstruktion"
 "Humedad del combustible herb�ceo vivo"	""
@@ -1901,11 +2050,11 @@ TEXT	TRANSLATION
 "If grid is not set, a new one will be created using chosen width and height."	"Wenn kein Raster ausgew�hlt ist wird ein neues erzeugt mit der ausgew�hlten Breite und H�he."
 "If not set points will be removed from the input data set."	""
 "If not set property attributes will be added to the orignal layer."	""
+"If set, output is given about the number of fields a flow path visits downhill. For D8 only."	""
 "If table exists..."	"Wenn Tabelle existiert..."
 "Ignition Points"	"Z�ndungspunkte"
 "Ignore Defaults"	"�bergehe Vorgaben"
 "Ignore Lakes"	""
-"Ignores specified attribute ('Save Attribute') and saves all attributes."	"Ignoriert ausgew�hlte Attribute ('Speichere Attribute') und speichert alle Attribute."
 "Illumination calculation"	""
 "Image"	"Bild"
 "Image (Blue Channel)"	"Bild (Blauer Kanal)"
@@ -1926,12 +2075,14 @@ TEXT	TRANSLATION
 "Imagery - Classification"	"Bildverarbeitung - Klassifizierung"
 "Imagery - Fast Region Growing Algorithm"	"Symbolik - Schneller Regionswachstum Algorithmus"
 "Imagery - OpenCV"	"Bildverarbeitung - OpenCV"
+"Imagery - Photogrammetry"	""
 "Imagery - SVM"	""
 "Imagery - Segmentation"	"Bildverarbeitung - Segmentierung"
 "Imagery - Tools"	"Symbolik - Werkzeuge"
 "Imagery - ViGrA"	"Bildverarbeitung - ViGrA"
 "Imagery|Classification"	"Symbolik|Klassifikation"
 "Imagery|OpenCV"	"Bildverarbeitung|OpenCV"
+"Imagery|Photogrammetry"	""
 "Imagery|Segmentation"	"Bildverarbeitung|Segmentierung"
 "Imagery|Tools"	"Symbolik|Werkzeuge"
 "Imagery|ViGrA"	"Bildverarbeitung|ViGrA"
@@ -1980,6 +2131,7 @@ TEXT	TRANSLATION
 "Import WRF Geogrid Binary Format"	""
 "Import a Map via Web Map Service (WMS)"	"Importiere eine Karte mittels Web Map Service (WMS)"
 "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/Export - DXF"	"Import/Export - DXF"
 "Import/Export - ESRI E00"	"Import/Export - ESRI E00"
@@ -1993,10 +2145,12 @@ TEXT	TRANSLATION
 "Import/Export - Shapes"	"Import/Export - Vektoren"
 "Import/Export - Tables"	"Import/Export - Tabellen"
 "Import/Export - Tables using MySQL native driver"	"Import/Export - Tabellen die den urspr�nglichen MySql Treiber benutzen"
+"Import/Export - Virtual"	""
 "Importing"	"Einlesend"
 "Importing data ..."	"Daten einlesend..."
 "In this section you can define the topology of the neural network."	""
 "In/Out"	"Eingabe/Ausgabe"
+"Include Center Cell"	""
 "Include Planetery Bending"	""
 "Include X Coordinate"	""
 "Include Y Coordinate"	""
@@ -2007,12 +2161,15 @@ TEXT	TRANSLATION
 "Increase Eye Distance"	""
 "Increase Legend Size"	""
 "Increase Perspectivic Distance [F6]"	""
+"Increase Size Scaling Factor [F8]"	""
+"Increase Size [F6]"	""
 "Increase factor"	""
 "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"	""
 "Infiltration excess runoff [m/dt]"	"Versickerungs�berschuss Abfluss [m/dt]"
 "Infiltration rate [m/dt]"	"Versickerungsrate"
@@ -2041,7 +2198,7 @@ TEXT	TRANSLATION
 "Initiation Type"	"Anfangs Typ"
 "Inner Buffer"	""
 "Input"	"Eingabe"
-"Input Data"	"Eingabedaten"
+"Input Binary Grid"	""
 "Input Features"	""
 "Input File's NoData Value"	"Eingabedatei�s NoData-Wert"
 "Input Files"	"Eingabedatei"
@@ -2055,9 +2212,13 @@ TEXT	TRANSLATION
 "Input data to train the network."	""
 "Input file"	"Eingabedatei"
 "Input for module calculations."	"Eingabe f�r Modulberechnungen."
+"Input for the morphological reconstruction"	""
 "Input format"	"Eingabeformat"
 "Input grid"	"Eingaberaster"
 "Input grids to train the network."	""
+"Input point shapefile"	""
+"Input polygon shapefile"	""
+"Input shape is empty!"	""
 "Input table is empty!"	"Eingabetabelle ist leer!"
 "Insert"	"Einf�gen"
 "Insert Additional Points"	"Zus�tzliche Punkte einf�gen"
@@ -2073,15 +2234,17 @@ TEXT	TRANSLATION
 "Intensidad (Kcal/m)"	"Intensit�t (kcal/m)"
 "Intensity"	"Intensit�t"
 "Intensity (Kcal/m)"	"Intensit�t (Kcal/m)"
-"Interactive module execution failed"	""
-"Interactive module execution has been started"	""
-"Interactive module execution has been stopped"	""
+"Interactive tool execution failed"	"Ausf�hrung vom interaktivem Werkzeug schlug fehl"
+"Interactive tool execution has been started"	"Interaktives Werkzeug ist gestartet"
+"Interactive tool execution has been stopped"	"Interaktives Werkzeug wurde beendet"
 "Interactive version (left mouse clicks will trigger the calculation for the selected cell)."	"Interaktive Version (die linke Maustaste l�st die Berechnung f�r die ausgew�hlte Zelle aus)."
 "Intercept"	"Schnittpunkt"
 "Intercept of Soil Line"	""
 "Interface to Frank Warmerdam's Geospatial Data Abstraction Library (GDAL)."	""
 "Interflow"	""
 "Interior"	"Inneres"
+"Interior Orientation Parameters"	""
+"Internal Orientation Parameters"	""
 "Internal subcatchment routing velocity [m/h]"	"Routinggeschwindigkeit des Internen Teileinzuggebietes [m/h] "
 "Interpolated"	"Interpoliert"
 "Interpolated Colors"	"Interpolierte Farben"
@@ -2119,7 +2282,6 @@ TEXT	TRANSLATION
 "Is the subbasin upstream (no external inflow)"	"Ist der Teilbecken gegenstrom (kein externer Zustrom)"
 "Isochrones Constant Speed"	"Isochrone konstante Geschwindigkeit"
 "Isochrones Variable Speed"	"Isochrone variable Geschwindigkeit"
-"Item"	"Element"
 "Iteration"	"Iteration"
 "Iterationen"	"Iterationen"
 "Iterations"	"Iterationen"
@@ -2144,8 +2306,12 @@ TEXT	TRANSLATION
 "Junction"	""
 "Junctions"	"Verbindungen"
 "June"	"Juni"
+"K1"	""
+"K2"	""
+"K3"	""
 "KE"	""
 "KML files (*.kml)"	""
+"Kappa"	""
 "Kappa Offset [degree]"	""
 "Kappa [degree]"	""
 "Kartoffeln"	"Kartoffeln"
@@ -2170,13 +2336,13 @@ TEXT	TRANSLATION
 "LAS header exception: %s"	""
 "LAS reader exception: %s"	""
 "LFAC("	"LFAC("
-"LNG_FILE_DIC"	"SPRACHE_DATEI_W�RTERBUCH"
 "LP, Saturated lateral permeability of the soil [m/day]"	""
 "LS"	""
 "LS Calculation"	""
 "LS Factor"	""
 "LS-Factor"	"LS-Faktor"
 "Label"	""
+"Label Field"	""
 "Labels"	"Etiketten"
 "Lag Classes"	""
 "Lag Distance"	""
@@ -2216,6 +2382,7 @@ TEXT	TRANSLATION
 "Lat. of True Scale"	"Breitengrad des genauen Massstabs"
 "Latitude"	"Breitengrad"
 "Latitude (user defined reference)"	"Breitengrad (Nutzer definierte Referenz)"
+"Latitude / Longitude Increment"	""
 "Latitude 1"	"Breitengrad 1"
 "Latitude 2"	"Breitengrad 2"
 "Latitude 3"	"Breitengrad 3"
@@ -2225,12 +2392,12 @@ TEXT	TRANSLATION
 "Latitude [Degree]"	""
 "Latitude [degree]"	"Breitengrad [Grad]"
 "Latitude relates to grid's..."	"Breitengrad verkn�pft mit Rastern..."
+"Latitude/Longitude Graticule"	""
 "Latitudinal Statistics"	""
 "Layer A"	"Ebene A"
 "Layer B"	"Ebene B"
 "Layer of extreme value"	"Ebene extremer Werte"
 "Layers"	"Ebenen"
-"Layers to merge with main layer"	"Ebenen, die mit Hauptebene verbunden werden sollen"
 "Layout"	"Layout"
 "Leading zeros for data set numbering. Set to -1 for not using numbers at all."	"F�hrende Nullen f�r Nummerierung der Datens�tze. Setze auf -1 wenn keine Nummerierung gew�nscht ist."
 "Leaf Area Index"	"Blattfl�chenindex"
@@ -2250,12 +2417,11 @@ TEXT	TRANSLATION
 "Left"	"Links"
 "Left Border (X)"	"Linke Grenze (X)"
 "Left Half"	"Linke H�lfte"
+"Left [/]"	""
 "Left [F3]"	"Links [F3]"
+"Left [Ins]"	""
 "Left/Right"	"Links/Rechts"
 "Legend"	"Legende"
-"Legend Border Colour"	""
-"Legend Frame Width"	"Rahmenbreite Legende"
-"Legend Scale"	""
 "Legend: Save"	"Legende: Speichern"
 "Legend: Zoom"	"Legende: Vergr��erung"
 "Length"	"L�nge"
@@ -2275,6 +2441,8 @@ TEXT	TRANSLATION
 "Life Cycles"	"Lebenszyklen"
 "Light Source A"	"Lichtquelle A"
 "Light Source B"	"Lichtquelle B"
+"Light Source Direction"	""
+"Light Source Height"	""
 "Lighting and visibility calculations for digital terrain models."	"Beleuchtungs- und Sichtbarkeitsberechnungen f�r Digitale Gel�ndemodelle."
 "Line"	"Linie"
 "Line Color"	"Linienfarbe"
@@ -2297,7 +2465,7 @@ TEXT	TRANSLATION
 "Linear Flow Control Grid"	""
 "Linear Flow Threshold"	"Lineare Str�mung Schwellenwert"
 "Linear Flow Threshold Grid"	"Lineare Str�mung Schwellenwert Raster"
-"Linear Module"	"Lineare Module"
+"Linear Module"	"Lineares Modul"
 "Linear Regression"	"Lineare Regression"
 "Linear: a + b * x"	"Linear: a + b * x"
 "Lines"	"Linien"
@@ -2309,14 +2477,15 @@ TEXT	TRANSLATION
 "List Table Fields"	""
 "List Tables"	""
 "List of Grids"	"Rasterdatens�tze"
+"List of Measured Points as PC"	""
 "List of Shapes Layers"	"Vektordatens�tze"
+"Listing"	""
 "Litter to Humus"	"Abfall zu Humus"
 "Litterfall Rate [g/m\xb2/a]"	""
 "Little Endian (Intel)"	""
 "Load"	"Lade"
 "Load Colors"	"Lade Farben"
 "Load Grid"	"Lade Raster"
-"Load Module Library"	"Lade Modulbibliothek"
 "Load Parameters"	"Lade Parameter"
 "Load Point Cloud"	"Lade Punktwolke"
 "Load Project"	"Lade Projekt"
@@ -2325,6 +2494,7 @@ TEXT	TRANSLATION
 "Load TIN"	""
 "Load Table"	"Lade Tabelle"
 "Load Text"	"Lade Text"
+"Load Tool Library"	"Lade Werkzeugbibliothek"
 "Load all bands"	""
 "Load grid"	"Lade Raster"
 "Load library"	"Lade Bibliothek"
@@ -2382,11 +2552,13 @@ TEXT	TRANSLATION
 "Lookup table used in method \"table\""	"Nachschlagetabelle benutzt bei der Methode \"Tabelle\""
 "Lookup table used in method \"user supplied table\""	"Nachschlagetabelle benutzt bei der Methode \"durch Nutzer erstellte Tabelle\""
 "Lookup table."	"Nachschlagetabelle."
+"Loop"	""
 "Lotsa"	"Viele"
 "Low Pass"	"Tiefpass"
 "Low Pass Filter"	"Tiefpassfilter"
 "Low Resolution Grid System"	""
 "Low Value"	"Unterer Wert"
+"Low moisture (WI <= 0.1"	""
 "Low value < grid value < high value"	"Niedriger Wert < Rasterwert < hoher Wert"
 "Low value <= grid value < high value"	"Niedriger Wert <= Rasterwert < hoher Wert"
 "Low variation for low sizes"	"Wenige Variationen f�r kleine Gr��en"
@@ -2394,10 +2566,8 @@ TEXT	TRANSLATION
 "Low-pass 2"	"Tiefpass 2"
 "Lower"	""
 "Lower Border (Y)"	"Untere Grenze (Y)"
-"Lower Limit of real data"	"Unterer Grenzwert f�r reale Daten"
 "Lower Tolerance"	"Untere Toleranz"
 "Lower left corner"	"Untere linke Ecke"
-"LowerLimit"	"Untergrenze"
 "Lumped Atmospheric Transmittance"	"konzentrierte atmosph�rische Durchl�ssigkeit"
 "Lumped Atmospheric Transmittance [Percent]"	"konzentrierte atmosph�rische Durchl�ssigkeit [Prozent]"
 "Luv Factor"	"Luv Faktor"
@@ -2422,9 +2592,8 @@ TEXT	TRANSLATION
 "MSL Height [m]"	"MSL H�he [m]"
 "Maehweide"	"M�hweide"
 "Mahalanobis Distance"	"Mahalanobis Entfernung"
+"Main"	""
 "Main Basin ID"	"Hauptbecken ID"
-"Main Layer"	"Hauptebene"
-"Main Layer. Output layer will have the same field in the attributes table as this layer"	"Hauptebene. Auszugebende Ebene hat die gleichen Felder der Attributtabelle wie diese Ebene"
 "Main Point Cloud"	""
 "Main Radius"	"Haupt Radius"
 "Main channel routing velocity [m/h]"	"Hauptgew�sser Routinggeschwindigkeit [m/Std]"
@@ -2438,7 +2607,10 @@ TEXT	TRANSLATION
 "Manhattan"	"Manhattan"
 "Manning's N"	"Manning�s N"
 "Manning's Roughness"	"Manning�s Rauhigkeit"
+"Manning-Strickler Coefficient"	""
+"Manning-Strickler coefficient for flow travel time estimation (reciprocal of Manning's Roughness Coefficient)"	""
 "Map"	"Karte"
+"Map Draping"	""
 "Map Draping Interpolation"	""
 "Map Extent"	""
 "Map File"	"Karte Datei"
@@ -2461,6 +2633,8 @@ TEXT	TRANSLATION
 "Masked Grid"	"Abgedecktes Raster"
 "Mass Balance Index"	"Massenbalanceindex"
 "Massivity Coefficient"	"Massivit�tskoeffzient"
+"Match"	""
+"Match Fields by Name"	""
 "Material"	"Material"
 "Matrix signular\n"	"singulare Matrix\n"
 "Max"	"Max"
@@ -2496,6 +2670,7 @@ TEXT	TRANSLATION
 "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 Time Span (Seconds)"	""
@@ -2509,6 +2684,7 @@ TEXT	TRANSLATION
 "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."
 "Maximum number of iterations"	""
+"Maximum number of rows/columns in selection of grid cells."	""
 "Maximum resolution as percentage of the diameter of the DEM."	"Maximale Aufl�sung als Prozentsatz des Durchmesser des DGM."
 "Maximum root zone storage deficit [m]"	"Maximales Wurzelzonenspeicherdefizit [m]"
 "Maximum size"	"Maximalgr��e"
@@ -2534,6 +2710,7 @@ TEXT	TRANSLATION
 "Mean soil loss"	""
 "Mean temperature"	""
 "Measure Distance"	""
+"Measured Points (PC)"	""
 "Median"	"Medianwert"
 "Melton Ruggedness Number"	""
 "Membership Function Type"	"Zugeh�rigkeit Funktionstyp"
@@ -2543,10 +2720,14 @@ TEXT	TRANSLATION
 "Memory Size"	"Speichergr��e"
 "Menu"	"Men�"
 "Mercator"	"Merkator"
+"Merge Layers"	""
 "Merge Point Clouds"	""
-"Merge Shapes Layers"	"Verbinde Vektorebenen"
+"Merge Selection"	""
+"Merge Tables"	""
 "Merged Layer"	"Verbundene Ebene"
+"Merged Layers"	""
 "Merged Point Cloud"	""
+"Merged Table"	""
 "Meridional Grid Statistics"	""
 "Meridional Statistics"	""
 "Mesh Denoise"	""
@@ -2575,9 +2756,6 @@ TEXT	TRANSLATION
 "Min. Size"	"Minimale Gr��e"
 "Min. Size (Cells)"	"Minimale Gr��e (Zellen)"
 "Min./Max. Number of m_Points"	"Min./Max. Anzahl der m_Punkte"
-"MinDist"	"Minimale Entfernung"
-"MinDist Region"	"Minimale Entfernung Region"
-"MinDistDir"	""
 "Mine Sweeper"	"Mine Sweeper"
 "Minima"	"Minima"
 "Minimal Curvature"	""
@@ -2594,15 +2772,21 @@ TEXT	TRANSLATION
 "Minimum Height"	""
 "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 Resolution (Degree)"	""
 "Minimum Segment Length (Cells)"	"Minimale Segmentl�nge (Zellen)"
 "Minimum Size [%]"	"Minimale Gr��e [%]"
 "Minimum Slope"	""
 "Minimum Slope [Degree]"	"Minimale Neigung [Grad]"
 "Minimum Standard Deviation"	"Minimale Standardabweichung"
 "Minimum Temperature"	""
+"Minimum Threshold"	""
 "Minimum Value"	"minimaler Wert"
+"Minimum and maximum x-coordinate of AOI."	""
+"Minimum and maximum y-coordinate of AOI."	""
+"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 shade brightness must be lower than maximum shade brightness!"	""
@@ -2641,17 +2825,8 @@ TEXT	TRANSLATION
 "Modified Catchment Area"	""
 "Modify: post-processing..."	"�ndern: Nachbearbeitung..."
 "Modify: pre-processing..."	"�ndern: Vorbearbeitung..."
-"Module"	"Modul"
-"Module Description Source"	"Modulbeschreibungsquelle"
-"Module Execution"	"Modulausf�hrung"
-"Module Libraries"	"Modulbibliotheken"
-"Module Library"	"Modulbibliothek"
 "Module Library Template"	"Modulbibliothek Vorlage"
-"Module Manager"	"Module Verwaltung"
 "Module My_Module"	""
-"Module execution failed"	"Modulausf�hrung fehlgeschlagen"
-"Module execution succeeded"	""
-"Modules"	"Module"
 "Modules for GPS data handling."	"Module f�r GPS-Daten Handling. "
 "Mollweide"	""
 "Moment [h]"	""
@@ -2663,6 +2838,9 @@ TEXT	TRANSLATION
 "Moore et al. 1991"	""
 "Moran's I"	""
 "Morphological Filter"	"Morphologischer Filter"
+"Morphological Filter (OpenCV)"	""
+"Morphological Filter (ViGrA)"	""
+"Morphologically filtered binary mask"	""
 "Morphometric Features"	""
 "Morphometric Protection Index"	"Morphometrischer Sicherungsindex"
 "Mosaic"	""
@@ -2682,12 +2860,12 @@ TEXT	TRANSLATION
 "Multi Level to Surface Interpolation"	""
 "Multi Scale Factor"	"Multi Scale Faktor"
 "Multi-Band Variation"	"Multi-Band Variation"
-"Multi-Grid 3D Viewer"	""
 "Multilevel B-Spline Interpolation"	"Multilevel B-Spline Interpolation"
 "Multilevel B-Spline Interpolation (from Grid)"	"Multilevel B-Spline Interpolation (von Rastern)"
 "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)"
+"Multiple Grids Viewer"	""
 "Multiple Input Features"	""
 "Multiple Linear Regression Analysis"	""
 "Multiple Linear Regression Analysis (Shapes)"	""
@@ -2707,6 +2885,7 @@ TEXT	TRANSLATION
 "NCELLS"	"NZELLEN"
 "NEIGHBORS"	"NACHBARN"
 "NEON"	"NEON"
+"NO DATA"	""
 "NODATA_CELLS"	""
 "NODE_A"	"KNOTEN_A"
 "NODE_B"	"KNOTEN_B"
@@ -2726,6 +2905,7 @@ TEXT	TRANSLATION
 "Navaladi, Schoeller, Conrad (c) 2009"	""
 "Near Infrared (TM 4)"	""
 "Near Infrared Reflectance"	""
+"Near Points"	""
 "Nearest Neigbhor"	"N�chster Nachbar"
 "Nearest Neighbor"	"N�chster Nachbar"
 "Nearest Neighbour"	"N�chste Nachbarn-Methode"
@@ -2739,9 +2919,10 @@ TEXT	TRANSLATION
 "NetCDF Files (*.nc)"	""
 "Network topology"	""
 "Neumann"	""
+"Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	""
+"Neural Networks (OpenCV)"	""
 "New"	"Neu"
 "New Grid Dimensions"	"Neue Rasterdimensionen"
-"New Project"	"Neues Projekt"
 "New Shapes Layer"	"Neue Vektorebene"
 "New Table"	"Neue Tabelle"
 "New Value"	"Neuer Wert"
@@ -2764,13 +2945,15 @@ TEXT	TRANSLATION
 "No Data"	""
 "No Data Cells"	"Keine Datenzellen"
 "No Data Value"	"Keine Datenwerte"
+"No Failure"	""
 "No Flats"	"Keine Fl�chen"
 "No Height"	"Keine H�hen"
 "No INPUT vector normalization"	""
 "No ODBC connection available!"	"Keine ODBC Verbindung m�glich!"
 "No OUTPUT vector normalization"	""
 "No PostgreSQL connection available!"	""
-"No attributes in selection."	""
+"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."
@@ -2782,16 +2965,18 @@ TEXT	TRANSLATION
 "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 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)!"
-"NoDataValue"	"Keine Datenwerte"
 "Node"	"Knoten"
 "Nodes"	"Knoten"
 "Non-Linear Module"	"Nichtlineare Module"
 "None"	"Nichts"
 "Normal"	""
 "Normal Updating"	""
+"Normal escarpment"	""
 "Normalisation"	"Normalisation"
 "Normalise"	"Normalisieren"
 "Normalised"	"Normiert"
@@ -2802,17 +2987,21 @@ TEXT	TRANSLATION
 "Normalized Height"	"Normalisierte H�he"
 "Normalized Ratio Vegetation Index"	"Normalisiertes Anteil Vegetationsindex"
 "North"	"Norden"
+"North Arrow"	""
 "North []"	"Nord []"
 "North|South|"	"Nord|S�d|"
 "Not Null"	"Nicht null"
 "Not a valid PostGIS database!"	"Kein g�ltiger PostGIS Datenbestand!"
 "Nothing to do be done. Raster splitting is not supported."	""
+"Nothing to do! Merging needs more than one input data set."	""
 "Nothing to do. Raster is already within target range."	""
 "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]"
@@ -2833,6 +3022,7 @@ TEXT	TRANSLATION
 "Number of Fields"	"Anzahl der Felder"
 "Number of Grid Cells"	"Anzahl der Rasterzellen"
 "Number of Grids"	"Anzahl der Raster"
+"Number of Intervals"	""
 "Number of Iterations for Normal Updating"	""
 "Number of Iterations for Vertex Updating"	""
 "Number of No-Data Cells"	""
@@ -2858,6 +3048,9 @@ TEXT	TRANSLATION
 "Number of classes in the cloud temperature histogram"	""
 "Number of clusters"	"Anzahl der Cluster"
 "Number of decimals when writing floating point values in ASCII format."	"Anzahl der Dezimalstellen wenn Flie�kommawerte im Ascii-Format gespeichert werden."
+"Number of discrete intervals (bins) used for sampling"	""
+"Number of examples required for a node to be split. Choose 1 for complete growing."	""
+"Number of fields a flow path visits downhill starting at a cell. For D8 only."	""
 "Number of fields and precisions must be equal!"	""
 "Number of horizontal tiles"	"Anzahl horizontaler Kacheln"
 "Number of iterations, starts with search radius and increments with one cell by iteration."	"Anzahl Iterationen, starten mit Suchradius und Zunahme mit einer Zelle je Iteration"
@@ -2899,7 +3092,7 @@ TEXT	TRANSLATION
 "OUTPUT"	""
 "OUTPUT certainty"	""
 "OUTPUT classes"	""
-"Object Properties"	""
+"Object Grid"	""
 "Objective Function"	"Objektive Funktion"
 "Objects removed from input grid"	"Objekte die aus dem Eingaberaster entfernt wurden"
 "Oblique Mercator"	"schiefer Merkator"
@@ -2913,10 +3106,13 @@ TEXT	TRANSLATION
 "Offset Z"	"Verschiebung Z"
 "Offset and Range (X)"	"Verschiebung und Bereich (X)"
 "Offset and Range (Y)"	"Verschiebung und Bereich (Y)"
+"Offset given as percentage of map size"	""
 "Ok"	"OK"
 "Okay"	""
+"Old Style Namings"	""
 "Old Version"	"Alte version"
 "Olkin & Pratt"	""
+"Omega"	""
 "Omega [degree]"	""
 "One per x"	"Einer per x"
 "Online Help"	"Online Hilfe"
@@ -2929,10 +3125,6 @@ TEXT	TRANSLATION
 "Open"	"�ffnen"
 "Open Database Connection"	""
 "Open Slopes"	""
-"OpenCV - Basic Morphological Operations"	"OpenCV - Grundlegende Morphologische Operationen"
-"OpenCV - Fourier Transformation"	"OpenCV - Fourier Transformation"
-"OpenCV - Single Value Decomposition"	"OpenCV - Einzelwertaufl�sung"
-"OpenCV Neural Networks"	""
 "Opening"	"Er�ffnung"
 "Operation"	"Operation"
 "Operation Control"	""
@@ -2941,9 +3133,8 @@ TEXT	TRANSLATION
 "Opposite Neighbours"	"entgegengesetzte Nachbarn"
 "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"	""
 "Options"	"Optionen"
-"Options for Data Thumbnails"	"Optionen f�r Daten-Vorschaubilder"
-"Options for Map Thumbnails"	"Optionen f�r Karten-Vorschaubilder"
 "Options:\n - Less than\n - Equals\n - Greater than\nControls under which condition a channel is initiated."	"Optionen:\n -Weniger als\n- Gleich\n - Gr��er als\nKontroliiert unter welchen Bedingungen ein Gew�sser eingerichtet wird."
 "Order"	"Reihenfolge"
 "Order by"	"Sortiert nach"
@@ -2958,6 +3149,7 @@ TEXT	TRANSLATION
 "Original Channels"	""
 "Original Image"	"Original Bild"
 "Orographic Coefficient"	"Orografischer Koeffizient"
+"Orthoclinal slope"	""
 "Orthographic"	"Orthografisch"
 "Ouput"	"Ausgabe"
 "Outlet"	""
@@ -2965,9 +3157,8 @@ TEXT	TRANSLATION
 "Outlet X"	"Auslass X"
 "Outlet Y"	"Auslass Y"
 "Outline"	""
+"Outlines"	""
 "Output"	"Ausgabe"
-"Output (imaginary)"	"Ausgabe (imagin�r)"
-"Output (real)"	"Ausgabe (real)"
 "Output Directory"	"Ausgabeverzeichnis"
 "Output Features"	""
 "Output Field Name"	"Ausgabe Feldname"
@@ -2976,6 +3167,7 @@ TEXT	TRANSLATION
 "Output Grid"	"Ausgabe Raster"
 "Output Lod"	"Ausgabe Erfassungsgrenze"
 "Output Seeds"	"Ausgabe Samen"
+"Output Text File"	""
 "Output Type"	"Ausgabe Typ"
 "Output Unit"	"Ausgabe Einheit"
 "Output Values"	"Ausgabewert"
@@ -2990,9 +3182,13 @@ TEXT	TRANSLATION
 "Output of Regression Parameters"	"Ausgabe Regressionsparameter"
 "Output of module calculations."	"Ausgabe der Modulberechnungen."
 "Output parameters"	""
+"Output will inherit shape type and table structure from the first layer in this list."	""
+"Overdip slope"	""
 "Overland Flow - Kinematic Wave D8"	"�berland Str�mung - Kinematische Welle D8"
 "Overland Flow Distance"	"�berland Str�mung Entfernung"
 "Overland Flow Distance to Channel Network"	"�berland Str�mung Entfernung zu Gew�ssernetzwerk"
+"Overlap"	""
+"Overlap [map units]"	""
 "Overlapping Areas"	""
 "Overlapping Cells"	"�berlappende Zellen"
 "Overlay 1"	""
@@ -3022,6 +3218,7 @@ TEXT	TRANSLATION
 "PNG Files"	"PNG Dateien"
 "PRECISION"	""
 "PREDICTED"	""
+"PT_ID"	""
 "Page Setup"	""
 "Pairwise Comparisons Table "	"Paarweise Vergleichstabelle"
 "Pan"	""
@@ -3048,11 +3245,13 @@ TEXT	TRANSLATION
 "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."
 "Parsing %s ... "	""
 "Partial D."	""
+"Partially wet (WI = 0.1 - 1)"	""
 "Partition Coefficients"	"Abtrennungskoeffizient"
 "Parts"	"Teile"
 "Pass"	""
@@ -3095,7 +3294,11 @@ TEXT	TRANSLATION
 "Perspectivic Distance"	""
 "Peucker & Douglas"	""
 "Phi [degree]"	""
+"Photogrammetry tools."	"Photogrammetrie Werkzeuge"
 "Pit"	""
+"Pixel Centers?"	""
+"Pixel Width (um)"	""
+"Pixel Width in micro meters"	""
 "Plain"	""
 "Plains"	""
 "Plan Curvature"	"geplante Kurvatur"
@@ -3107,19 +3310,28 @@ TEXT	TRANSLATION
 "Plant Height"	""
 "Platform"	""
 "Play And Save As Images..."	""
+"Play Loop [Ctrl + L]"	""
 "Play Loop [L]"	""
+"Play Once [Ctrl + P]"	""
 "Play Once [P]"	""
+"Play and Save to Image"	""
 "Please choose a method of module operation."	"Bitte w�hle eine Methode der Moduloperation."
 "Please enter a numeric value:"	"Bitte einen numerischen Wert eingeben:"
 "Please enter a text:"	""
 "Please provide a path for the output files."	""
+"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 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 an attribute field with z-information!"	""
 "Please provide an output file name!"	""
 "Please provide at least one column to export!"	""
-"Please stop module execution before exiting SAGA."	"Um SAGA zu beenden, mu� erst das laufende Modul angehalten werden."
+"Please provide some input files!"	""
+"Please stop tool execution before exiting SAGA."	"Bitte beenden Sie die Werkzeugausf�hrung bevor Sie SAGA verlassen."
 "Plot Holes"	"Zeichnungsl�cher"
 "Point"	"Punkt"
 "Point Cloud"	"Punktwolken"
@@ -3140,6 +3352,7 @@ TEXT	TRANSLATION
 "Point Cloud with attribute dropped."	"Punktwolke mit zugewiesenen Attributen."
 "Point Clouds"	"Punktwolken"
 "Point Data Record Format"	"Punktdaten Datensatzformat"
+"Point Distances"	""
 "Point Grid"	"Punkt Raster"
 "Point Position"	"Punkt Position"
 "Point Size"	"Punktgr��e"
@@ -3148,7 +3361,6 @@ TEXT	TRANSLATION
 "Point Statistics for Polygons"	"Punkt Statistik f�r Polygone"
 "Point clouds viewer."	"Punktwolkenbetrachter."
 "Point shapefile with source point(s)"	"Punkt Vektordatei mit Ausgangspunkten"
-"Point shapes import from text formated XYZ-table."	"Punktvektoren Import von textformatierten XYZ-Tabellen."
 "Point summary contains no points!"	"Punktzusammenfassung enth�lt keine Punkte!"
 "Point to Keep"	""
 "Point(s)"	""
@@ -3158,6 +3370,7 @@ TEXT	TRANSLATION
 "Points Thinning"	"Punktausd�nnung"
 "Points per Cell"	"Punkte je Zelle"
 "Points per Square"	"Punkte pro Quadrat"
+"Points to be Colorised"	""
 "Polar Angle Units"	"Polarwinkel Einheiten"
 "Polar Coordinate System"	"Polarkoordinatensystem"
 "Polar Coordinates"	"Polarkoordinaten"
@@ -3173,6 +3386,8 @@ TEXT	TRANSLATION
 "Polygon Properties"	""
 "Polygon Self-Intersection"	""
 "Polygon Shape Indices"	"Polygon Vektor Indizes"
+"Polygon outlines of object regions"	""
+"Polygon shapefile describing the bounding boxes of spcvf tiles."	""
 "Polygon with less than 3 vertices encountered!"	""
 "Polygon(s)"	""
 "Polygon-Line Intersection"	"Polygonlinien Schnittpunkt"
@@ -3232,13 +3447,17 @@ TEXT	TRANSLATION
 "Predefined Standard Ellipsoids"	"Vordefinierte Standardellipsoide"
 "Predicted responses (probabilities) for corresponding samples."	""
 "Prediction INPUT"	""
+"Prediction Probability"	""
 "Predictor"	"Vorhersager"
 "Predictors"	"Vorhersager"
+"Preferred Routing"	""
 "Preferred Target Grid Type"	"Bevorzugter Zielrastertyp"
 "Preferred data storage type"	"Bevorzugter Datenspeichertyp"
 "Preliminary scene analysis:"	""
 "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"	""
+"Preserve 1px border Yes/No"	""
 "Preserve Data Type"	"Erhalte Datentyp"
 "Preset Selection"	""
 "Presets"	""
@@ -3247,6 +3466,11 @@ TEXT	TRANSLATION
 "Primary Name"	"Prim�rer Name"
 "Primary key)"	"Prim�rer Schl�ssel)"
 "Principal Components"	"Grunds�tzliche Komponenten"
+"Principal Point Offset in X"	""
+"Principal Point Offset in X (pixels)"	""
+"Principal Point Offset in X (pixles)"	""
+"Principal Point Offset in Y"	""
+"Principal Point Offset in Y (pixels)"	""
 "Principle Components"	"Grunds�tzliche Komponenten"
 "Principle Components Analysis"	"Grunds�tzliche Komponentenanalyse"
 "Principle Components Based Image Sharpening"	""
@@ -3256,6 +3480,7 @@ TEXT	TRANSLATION
 "Print Setup"	"Druckeinstellungen"
 "Print only information available in LAS header."	"Drucke nur Informationen aus der LAS Kopfzeile."
 "Priority Index"	"Vorrangiger Index"
+"Probability"	""
 "Probability Estimates"	""
 "Probability Reference"	"Wahrscheinlichkeit Referenz"
 "Probability Threshold (Percent)"	"Wahrscheinlichkeitsschwellenwert (Prozent)"
@@ -3282,6 +3507,7 @@ TEXT	TRANSLATION
 "Profiles"	"Profile"
 "Profiles from Lines"	"Profile aus Linien"
 "Proj.4"	"Proj.4"
+"Proj.4 Version is "	""
 "Proj4 Parameters"	"Proj4 Parameter"
 "Project"	"Projekt"
 "Project File"	"Projektdatei"
@@ -3295,9 +3521,14 @@ TEXT	TRANSLATION
 "Projection - GeoTRANS"	"Projektion - GeoTrans"
 "Projection - Georeferencing"	"Projektion - Georeferenzierung"
 "Projection - Proj.4"	"Projektion - Proj.4"
+"Projection Centre"	""
+"Projection Centre - X"	""
+"Projection Centre - Y"	""
+"Projection Centre - Z"	""
 "Projection Parameters"	"Projektion Parameter"
 "Projection Settings"	"Projektion Einstellungen"
 "Projection Type"	"Projektion Typ"
+"Projection routines make use of the Proj.4 Cartographic Projections library."	""
 "Projection_GeoTRANS_Datum_3.dat,\n"	"Projektion_GeoTRANS_Datum_3.dat,\n"
 "Projection_GeoTRANS_Datum_7.dat,\n\n"	"Projektion_GeoTRANS_Datum_7.dat,\n\n"
 "Projection_GeoTRANS_Ellipsoid.dat,\n"	"Projektion_GeoTRANS_Ellipsoid.dat,\n"
@@ -3306,6 +3537,8 @@ TEXT	TRANSLATION
 "Projection|Georeferencing"	"Projektion|Georeferenzierung"
 "Properties"	""
 "Protection Index"	"Schutz Index"
+"Provide Radial Distortion Parameters?"	""
+"Provide Time stamp of Image?"	""
 "Proximity"	"N�he"
 "Proximity Grid"	"N�he Raster"
 "Pythagoras' Tree"	"Pythagoras Baum"
@@ -3332,7 +3565,6 @@ TEXT	TRANSLATION
 "R,G,B value range"	"R,G,B Wertebereich"
 "R2"	"Bestimmtheitsma�"
 "R:Alternatives"	"R:Alternativen"
-"R:Buffers"	"R:Puffer"
 "R:Catchment Area"	"R:Einzugsgebietsgr��en"
 "R:Classification"	"R:Klassifizierung"
 "R:Conversion"	"R:Umwandlung"
@@ -3340,7 +3572,6 @@ TEXT	TRANSLATION
 "R:Cost Analysis"	"R:Kostenauswertung"
 "R:Dynamics"	""
 "R:Export"	"R:Export"
-"R:Fourier Analysis"	"R:Fourier Analyse"
 "R:Fragmentation Analysis"	"R:Fragmentierungsanalyse"
 "R:GWR"	""
 "R:Grid Generation"	"R:Raster Erstellung"
@@ -3352,6 +3583,7 @@ TEXT	TRANSLATION
 "R:Landsat"	""
 "R:Miscellaneous"	""
 "R:Overlay"	""
+"R:Point Cloud"	""
 "R:Principle Components"	""
 "R:Shapes"	"Vektoren"
 "R:Soil Analysis"	"R:Bodenauswertung"
@@ -3361,7 +3593,6 @@ TEXT	TRANSLATION
 "R:Terrain Analysis"	"R:Reliefanalyse"
 "R:Tools"	"R:Werkzeuge"
 "R:Topographic Indices"	""
-"R:Values"	"R:Werte"
 "R:Vectorization"	"Vektorisierung"
 "R:Without Variogram Fit"	"R:Ohne Variogrammanpassung"
 "RAINBOW"	"REGENBOGEN"
@@ -3377,10 +3608,11 @@ TEXT	TRANSLATION
 "RGA"	""
 "RGB"	""
 "RGB Composite"	"RGB Zusammensetzung"
+"RGB Image"	""
 "RGB Overlay"	""
+"RGB Values"	""
 "RGB coded data"	"RGB kodierte Daten"
 "RGB to IHS"	""
-"RGBOverlay"	"RGB Overlay"
 "RMSE"	""
 "ROI_N"	""
 "RPROP parameters"	""
@@ -3405,6 +3637,8 @@ TEXT	TRANSLATION
 "Rainfall intensity"	""
 "Random"	"Zufall"
 "Random Field"	"Zufallsfeld"
+"Random Forest (ViGrA)"	""
+"Random Forest Classification"	""
 "Random Terrain Generation"	"zuf�llige Gel�ndeerstellung"
 "Range"	"Bereich"
 "Range of R,G,B values in LAS file."	"Bereich der R,G,B Werte in LAS Datei."
@@ -3425,7 +3659,6 @@ TEXT	TRANSLATION
 "Rc"	""
 "Real"	""
 "Real Surface Area"	""
-"Recalculating all Regions Minimum Distances\n"	"Neuberechnung aller Bereiche minimaler Entfernungen\n"
 "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"
@@ -3435,6 +3668,7 @@ TEXT	TRANSLATION
 "Reclassify buffer distance to intervals of euqidistance ..."	"Wandle Pufferentfernungen in Intervalle von �quidistanzen ein... "
 "Reclassify|Extract Subset|"	"Reklassifizieren|Extrakt Teilmenge|"
 "Recognised Files"	""
+"Reconstruction result"	""
 "Records"	""
 "Rectangles"	""
 "Rectify Grid"	""
@@ -3452,8 +3686,6 @@ TEXT	TRANSLATION
 "Referencing"	""
 "Reflectance"	""
 "Refresh"	"aktualisieren"
-"Regions Count of No-DataValue-Pixels"	"Regionen Z�hlung der Nodata-Werte-Pixels"
-"Regions MinPixel"	"Regionen MinPixel"
 "Regression"	"Regression"
 "Regression Analysis"	"Regressionsanalyse"
 "Regression Analysis (Points/Grid)"	"Regression Analyse (Punkte/Raster)"
@@ -3475,8 +3707,10 @@ TEXT	TRANSLATION
 "Relative from cell value"	"Relativ vom Zellwert"
 "Relative heights calculation..."	"Relative H�hen Berechnung..."
 "Relaxation"	"Entspannung"
+"Remove Border Regions?"	""
 "Remove Duplicate Points"	"Entferne doppelte Punkte"
 "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"
 "Removing ambiguous pixels..."	""
 "Rename"	""
@@ -3499,6 +3733,7 @@ TEXT	TRANSLATION
 "Rescale to 0 - 1"	"Massstabs�nderung von 0 - 1"
 "Rescale to 0 - 1.0"	"Massstabs�nderung von 0 - 1.0"
 "Rescale to 0 - 255"	"Massstabs�nderung von 0 - 255"
+"Resection (Terrestrial)"	""
 "Residual Analysis (Grid)"	"R�ckstandsanalyse (Raster)"
 "Residual Correction"	""
 "Residual standard error"	""
@@ -3522,12 +3757,16 @@ TEXT	TRANSLATION
 "Ridge Detection Threshold"	""
 "Ridge Level"	""
 "Right"	"Rechts"
+"Right [*]"	""
+"Right [Del]"	""
 "Right [F4]"	"Rechts [F4]"
 "Rill/Interrill Erosivity"	"Rinnsal/Erosivit�t"
 "River Heads"	"Flussquellen"
 "River Mouths"	"Flussm�ndungen"
 "Rn, number of rain days in timespan [-]"	""
 "Road Width"	"Strassenbreite"
+"Roll Left [F4]"	""
+"Roll Right[F3]"	""
 "Rook"	"Saatkr�he"
 "Rook's case"	"Rook�s Fall"
 "Roots"	"Wurzeln"
@@ -3537,6 +3776,7 @@ TEXT	TRANSLATION
 "Rotate Y"	""
 "Rotate Z"	""
 "Rotation"	"Drehung"
+"Rotation Angle"	""
 "Rotation X"	"Drehung X"
 "Rotation Y"	"Drehung Y"
 "Rotation Z"	"Drehung Z"
@@ -3548,19 +3788,22 @@ TEXT	TRANSLATION
 "Routing"	"Routenplanung"
 "Routing Error"	"Routenplanung Fehler"
 "Rows"	"Reihen"
+"Run Tool"	"Werkzeug ausf�hren"
 "Running Average"	"gleitendes Mittel"
 "Running Script"	""
 "Runoff"	"Abfluss"
 "S, slope [rad]"	""
+"SAFETYFACTOR"	""
 "SAGA Colors"	"SAGA Farben"
 "SAGA Help"	"SAGA Hilfe"
-"SAGA Module Libraries"	"SAGA Modulbibliothek"
 "SAGA Parameter Files"	"SAGA Parameter-Datei"
+"SAGA Point Cloud Virtual Format (*.spcvf)"	""
 "SAGA Point Clouds"	"SAGA Punktwolken"
 "SAGA Projects"	"SAGA Projekte"
 "SAGA RGB"	""
 "SAGA RGB color"	"SAGA RGB Farbe"
 "SAGA RGB to R,G,B"	""
+"SAGA Tool Libraries"	"SAGA Werkzeugbibliotheken"
 "SAGA User Group Associaton (c) 2002"	""
 "SAGA User Group Associaton (c) 2002-2013"	""
 "SAGA User Group Associaton (c) 2008"	""
@@ -3568,11 +3811,13 @@ TEXT	TRANSLATION
 "SAGA: Print Map"	"SAGA: Karte drucken"
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	""
 "SECTIONS"	"ABSCHNITTE"
+"SHALSTAB"	""
 "SIZE"	""
 "SL, estimation of mean soil loss [kg]"	""
 "SLc"	""
 "SLs"	""
 "SLz"	""
+"SPCVF successfully created from %d dataset(s)."	""
 "SPECIFIC"	"SPEZIFISCH"
 "SQL Statement"	"SQL Anweisung"
 "SQL Statment"	"SQL Anweisung"
@@ -3595,9 +3840,12 @@ TEXT	TRANSLATION
 "SVR Epsilon"	""
 "Saddle"	""
 "Sample Variogram"	"Proben Variogramm"
+"Sample from training population with or without replacement?"	""
 "Sample weights"	""
+"Sample with Replacement"	""
 "Samples"	""
 "Samples in range"	"Proben im Bereich"
+"Samples per Tree"	""
 "Sand"	"Sand"
 "Sandy Clay"	"sandiger Ton"
 "Sandy Clay-Loam"	"sandiger Ton-Lehm"
@@ -3605,15 +3853,17 @@ TEXT	TRANSLATION
 "Sat. lateral permeability"	""
 "Satellite Height [m]"	""
 "Saturation overland flow [m/dt]"	"S�ttigung �berlandstr�mung [m/dt]"
+"Saturation zone (WI > 1)"	""
 "Save"	"Speichern"
 "Save 3D Image Options"	"Speichern der Optionen der 3D-Darstellung"
-"Save All Attributes"	"Speichere alle Attribute"
+"Save All"	""
 "Save As Image"	"Als Bild speichern"
 "Save As Image to Workspace"	""
 "Save As Image when changed"	""
 "Save As Image..."	"Als Bild speichern..."
 "Save As..."	"Speichern unter..."
 "Save Colors"	"Farben speichern"
+"Save Configuration"	""
 "Save Georeference"	"Georeferenzierung speichern"
 "Save Georeference (world file)"	""
 "Save Grid"	"Raster speichern"
@@ -3622,6 +3872,7 @@ TEXT	TRANSLATION
 "Save Headline"	"Speichere Kopfzeile"
 "Save KML file"	""
 "Save Map as Image..."	"Karte als Bild speichern..."
+"Save Modified Data"	""
 "Save Parameters"	"Parameter speichern"
 "Save Point"	""
 "Save Point Cloud"	"Punktwolke speichern"
@@ -3674,8 +3925,8 @@ TEXT	TRANSLATION
 "Search Options"	"Suchoptionen"
 "Search Radius"	"Suche Radius"
 "Search Range"	"Suche Bereich"
+"Search Result"	""
 "Search Shape"	"Vektoren suchen"
-"Search Text"	"Suche Text"
 "Search chip size set to %d"	""
 "Search for..."	"Suche nach..."
 "Search radius of kernel in cells."	"Suchradius des Kernels in Zellen"
@@ -3690,6 +3941,7 @@ TEXT	TRANSLATION
 "Sediment Balance Sand"	""
 "Sediment Balance Silt"	""
 "Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"	""
+"Sediment Yield Delivery Ratio"	""
 "Seed Generation"	"Keimgenerationen"
 "Seed Points"	"Saatpunkte"
 "Seed Value"	"Keimwert"
@@ -3755,6 +4007,7 @@ TEXT	TRANSLATION
 "Separator (other)"	"Trennzeichen (andere)"
 "September"	"September"
 "Sequencer"	""
+"Sequencer Positions"	""
 "Server"	"Server"
 "Server Connection"	""
 "Set Coordinate Reference System"	"Setze Koordinaten Referenz System (CRS)"
@@ -3775,6 +4028,7 @@ TEXT	TRANSLATION
 "Shadow"	""
 "Shall I activate file caching for new grid."	"Soll der Dateipuffer f�r die neuen Rasterdaten aktiviert werden?"
 "Shall execution be stopped?"	"Soll die Ausf�hrung gestoppt werden?"
+"Shape"	""
 "Shape Index"	"Vektor Index"
 "Shape Parameter for Elevation Percentile"	"Formparameter f�r H�henperzentil"
 "Shape Parameter for Slope"	"Formparameter f�r Neigung"
@@ -3784,6 +4038,7 @@ TEXT	TRANSLATION
 "Shape type to generate."	""
 "Shape(s)"	"Vektor(en)"
 "Shape(s) to fit extent to"	"Vektoren die anzugleichen sind an"
+"Shapefile describing the AOI."	""
 "Shapes"	"Vektoren"
 "Shapes - Grid"	"Vektoren - Raster"
 "Shapes - Lines"	"Vektoren - Linien"
@@ -3806,7 +4061,6 @@ TEXT	TRANSLATION
 "Shapes to TIN"	"Vektoren zu TIN"
 "Shapes to project"	"abzubildende Vektoren"
 "Shapes with Text Replacements"	""
-"Shapes_Merge"	"Verbundene Vektoren"
 "Shapes|Grid"	"Vektoren|Raster"
 "Shapes|Lines"	"Vektoren|Linien"
 "Shapes|Lines|Transects"	"Vektoren|Linien|Transekte"
@@ -3825,10 +4079,12 @@ TEXT	TRANSLATION
 "Shift X"	""
 "Shift Y"	""
 "Shift Z"	""
+"Shift value"	""
 "Short Dashed"	""
 "Short Field Names"	"kurze Feldnamen"
 "Short Wave Radiation [kW/m2]"	"Kurzwellenstrahlung [kW/m�]"
 "Short dashed style"	"gestrichelt (kurz)"
+"Should the output shapes contain the centers of the border pixels instead of the corners?"	""
 "Shoulder Hollow"	""
 "Shoulder Slope"	""
 "Shoulder Spur"	""
@@ -3861,9 +4117,12 @@ TEXT	TRANSLATION
 "Show Vertices"	""
 "Show at all scales"	"Zeige bei allen Massst�ben"
 "Shrink"	""
+"Shrink and Expand"	""
 "Shrinking"	""
 "Sibson"	""
 "Side Slope"	"Hangkante"
+"Sieved Classes"	""
+"Sieving Classes"	""
 "Sigmoid"	""
 "Sill"	"Schwelle"
 "Silt"	"Schluff"
@@ -3872,7 +4131,6 @@ TEXT	TRANSLATION
 "Silty Clay-Loam"	"schluffiger Ton-Lehm"
 "Similarity"	"�hnlichkeiten"
 "Simple"	"Einfach"
-"Simple 3D Shapes Viewer"	""
 "Simple Filter"	"Einfache Filter"
 "Simple Region Growing"	"Einfaches Region Growing"
 "Simple, flow path and swath profiles."	"Einfach, Fliessweg und Bahnprofile"
@@ -3901,9 +4159,11 @@ TEXT	TRANSLATION
 "Simulation|Hydrology"	"Simulation|Hydrologie"
 "Simulation|Hydrology|IHACRES"	"Simulation|Hydrologie|IHACRES"
 "Single Cell"	"Einzelzelle"
+"Single Colour"	""
 "Single Flow Direction"	"Einzelne Flie�richtung"
 "Single Storage"	"Einzelspeicherung"
 "Single Symbol"	""
+"Single Value Decomposition (OpenCV)"	""
 "Single value"	"Einzelner Wert"
 "Sink Drainage Route Detection"	"Senke Entw�sserungsroutendetektion"
 "Sink Removal"	"Senke Beseitigung"
@@ -3913,8 +4173,10 @@ TEXT	TRANSLATION
 "Sinusoidal"	"Sinusf�rmig"
 "Size"	"Gr��e"
 "Size Range"	""
+"Size Scaling"	""
 "Size by Attribute"	"Gr��e durch Attribut"
 "Size field"	"Feldgr�sse"
+"Size given as percentage of map size"	""
 "Size of Analysis Window"	"Gr��e des Auswertungsfensters"
 "Size of processing window (= 1 + 2 * radius) given as number of cells"	""
 "Size of smoothing filter"	"Gr��e des Gl�ttungsfilters"
@@ -3925,6 +4187,7 @@ TEXT	TRANSLATION
 "Skip cells (step value)."	"Zellen auslassen (Schrittwert)."
 "Skip first line"	"Lasse erste Zeile aus"
 "Skip first line as it contains column names."	"L�st erste Zeile aus wenn sie Spaltennamen enth�lt."
+"Skipping dataset %s because of incompatibility with the first input dataset!"	""
 "Sky View Factor"	"Himmelsblick Faktor"
 "Sky View Factor (Simplified)"	"Himmelsblick Faktor (vereinfacht)"
 "Slope"	"Neigung"
@@ -3932,6 +4195,9 @@ TEXT	TRANSLATION
 "Slope Height"	"Neigung H�he"
 "Slope Index"	""
 "Slope Length"	"Neigung L�nge"
+"Slope Limited Flow Accumulation"	""
+"Slope Minimum"	""
+"Slope Threshold"	""
 "Slope Thresholds [Degree]"	""
 "Slope Tolerance"	""
 "Slope Units"	""
@@ -3940,11 +4206,13 @@ TEXT	TRANSLATION
 "Slope gradient to left neighbour [Degree]"	"Neigungsgradient zum linken Nachbarn [Grad]"
 "Slope grid, in radians."	""
 "Slope of Soil Line"	""
+"Slope threshold, given as degree, above which flow transport is unlimited."	""
 "Slope tolerance that defines a 'flat' surface (degrees)"	""
 "Slope, Aspect, Curvature"	""
 "Smith"	""
 "Smooth"	"Gl�tten"
 "Smooth Rep"	""
+"Smoothing (ViGrA)"	""
 "Snap Distance"	""
 "Snap Features"	""
 "Snap Points to Grid"	""
@@ -3981,17 +4249,17 @@ TEXT	TRANSLATION
 "Solid"	""
 "Solid style"	"durchgezogen"
 "Some Grid Analysis Tools."	"Einige Rasterauswertungswerkzeuge"
+"Some OGR drivers are unable to determine the geometry type automatically, please choose the appropriate one in this case"	""
 "Sommergerste"	"Sommergerste"
 "Sort"	"Sortieren"
 "Sort Fields"	""
-"Sort Grid"	"Sortiere Raster"
 "Sort Selection to Top"	""
 "Sort Table"	"Tabelle sortieren"
 "Sort first by"	"Sortiere erst nach.."
 "Sort second by"	"Sortiere zweitens nach.."
 "Sort third by"	"Sortiere drittens nach.."
-"Sorted Grid"	"Sortiertes Raster"
 "Sorted Levels"	""
+"Sorting Order"	""
 "Source"	"Quelle"
 "Source Coordinate System Error"	"Ausgangskoordinate Systemfehler"
 "Source Coordinate System Type Error"	"Ausgangskoordinate Systemtypfehler"
@@ -4009,6 +4277,7 @@ TEXT	TRANSLATION
 "South-North"	"S�d-Nord"
 "Spacecraft Sensor"	""
 "Spatial Point Pattern Analysis"	"r�umliche Punktmusteranalyse"
+"Spatial Reference"	""
 "Spatial Reference System Files (*.srs)"	"r�umliche Referenzsystem Dateien (*.srs)"
 "Spatial and Geostatistics - Grids"	""
 "Spatial and Geostatistics - Kriging"	""
@@ -4025,21 +4294,28 @@ TEXT	TRANSLATION
 "Specific Catchment Area (SCA)"	"spezifisches Einzugsgebiet (SCA)"
 "Specification"	""
 "Specifie options used for the training and test data."	""
+"Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."	""
+"Specifies the fraction of the total number of samples used per tree for learning."	""
 "Specify a threshold value as minimum difference between neighboured segments."	"Benenne einen Schwellenwert als Minimaldifferenz zwischen benachbarten Segmenten."
 "Spectral"	""
 "Spectral Angle Mapping"	"Spektralwinkel-Kartierung"
 "Spectral Angle Threshold (Degree)"	"Spektralwinkel Schwellenwert (Grad)"
 "Spectral Information Divergence"	"Spektralinformation Abweichung"
 "Speed (m/s)"	"Geschwindigkeit (m/s)"
+"Spherical Harmonic Synthesis"	""
 "Spherical Model"	"sph�risches Modell"
 "Spline"	""
 "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 with Lines"	""
 "Split Parts"	"Trenne Teile"
 "Split Shapes Layer"	"Trenne Vektorebenen"
 "Split Shapes Layer Completely"	"Teile Vektorebenen komplett"
 "Split Shapes Layer Randomly"	"Vektorebene zuf�llig aufteilen"
 "Split Table/Shapes by Attribute"	"Teile Tabelle/Vektoren durch Attribut"
+"Split with Line"	""
+"Splitted"	""
 "Spring"	""
 "Spur"	""
 "Square"	"Rechteck"
@@ -4061,6 +4337,9 @@ TEXT	TRANSLATION
 "Standardised Grid"	"Standardisiertes Raster"
 "Standardize"	""
 "Standardized Height"	"Standarisierte H�he"
+"Start Degree"	""
+"Start Latitude"	""
+"Start Longitude"	""
 "Start Project"	"Starte Projekt"
 "Start Size"	""
 "Start Value"	"Startwert"
@@ -4074,6 +4353,7 @@ TEXT	TRANSLATION
 "Statistics for Grids"	"Statistik f�r Raster"
 "Std.Dev."	"Standardabweichung"
 "StdDev"	""
+"Steepened escarpment"	""
 "Steepest gradient (first version)"	"steilster Gradient (erste Version)"
 "Steepest gradient (second version)"	"steilster Gradient (zweite Version)"
 "Stems"	"Halme"
@@ -4085,6 +4365,7 @@ TEXT	TRANSLATION
 "Steps"	""
 "Steps to Next"	""
 "Stepwidth"	"Schrittweite"
+"Stereo Anaglyph"	""
 "Stereo Eye Distance [Degree]"	"Stereo Augendistanz [Grad]"
 "Stereographic"	"Stereographisch"
 "Stop [ka]"	""
@@ -4095,6 +4376,7 @@ TEXT	TRANSLATION
 "Store Model to File"	""
 "Strahler Order"	"Strahler Ordnung"
 "Strahler order to begin a channel."	""
+"Stratification"	""
 "Stream Order"	""
 "Stream Power Index"	"Str�mungsenergie Index"
 "Streamflow (obs.) Column"	"Str�mungsenergie (obs.) Spalte"
@@ -4111,6 +4393,7 @@ TEXT	TRANSLATION
 "Subbasin Flow Distance"	"Teilbecken Flie�entfernung"
 "Subbasin Inflow"	"Teilbecken Zufluss"
 "Subbasins"	"Teilbecken"
+"Subdued escarpment"	""
 "Subsurface flow [m/dt]"	"unterirdische Str�mung [m/dt]"
 "Subtitle"	"Untertitel"
 "Subtract Volumes Below Base Level"	"Ziehe Volumen unterhalb der Basislinie ab"
@@ -4125,7 +4408,6 @@ TEXT	TRANSLATION
 "Summary table."	"tabellarische Zusammenfassung."
 "Summary:\n"	"Zusammenfassung:\n"
 "Summary_"	"Zusammenfassung_"
-"Sum|Min|Max|"	"Sum|Min|Max"
 "Sun's height above horizon in degree"	""
 "Sunrise"	"Sonnenaufgang"
 "Suns's Height"	""
@@ -4150,9 +4432,12 @@ TEXT	TRANSLATION
 "Switch to Linear Flow"	""
 "Symbol Image"	""
 "Symbol Type"	""
+"Symbolic Image"	""
 "Symmetrical Difference"	""
 "Synchronise Map Extents"	""
+"Synchronize Map Extents"	""
 "Syntax error at position #%d: \n%s\n"	"Syntaxfehler an Position #%: \n%s\n"
+"Synthesized Grid"	""
 "System"	"System"
 "T Curvature"	"T Kurvatur"
 "T Slope"	"T Neigung"
@@ -4173,6 +4458,7 @@ TEXT	TRANSLATION
 "TIN Viewer"	"TIN Betrachter"
 "TIN Viewer Settings"	"TIN Betrachter Einstellungen"
 "TIN Voronoi"	"TIN Voronoi-Diagramm"
+"TIN creation failed"	""
 "TIN list"	""
 "TIN to Shapes"	"TIN zu Vektoren"
 "TIN viewer."	"TIN Betrachter."
@@ -4180,6 +4466,7 @@ TEXT	TRANSLATION
 "TINs"	"TINs"
 "TIN|Visualisation"	"TIN|Visualisierung"
 "TMP Column: Subbasin: "	"TMP Spalte: Teilbecken:"
+"TOBIA"	""
 "TOPMODEL"	"TOPMODEL"
 "TOPMODEL - Simulation Output"	"TOPMODEL - Simulation Ausgabe"
 "TOPOGRAPHY"	""
@@ -4267,6 +4554,7 @@ TEXT	TRANSLATION
 "Terrain Analysis - Morphometry"	"Reliefanalyse - Morphometrie"
 "Terrain Analysis - Preprocessing"	"Reliefanalyse - Vorbearbeitung"
 "Terrain Analysis - Profiles"	"Reliefanalyse - Profile"
+"Terrain Analysis - Slope Stability"	""
 "Terrain Analysis: Compound Analyses.\nThis library depends on the following SAGA module libraries:\n- ta_channels\n- ta_flow\n- ta_indices\n- ta_lighting\n- ta_morphometry\n- ta_preproc\n"	"Gel�ndeanalyse: Gel�ndeanalysen. \n Diese Bibliothek h�ngt von folgenden SAGA Modulbibliotheken ab:\n- ta_channels\n- ta_flow\n- ta_indices\n- ta_lighting\n- morphometry\n- ta_preproc\n  "
 "Terrain Analysis|Channels"	"Reliefanalyse|Gew�ssernetz"
 "Terrain Analysis|Hydrology"	"Reliefanalyse|Hydrologie"
@@ -4274,6 +4562,7 @@ TEXT	TRANSLATION
 "Terrain Analysis|Morphometry"	"Reliefanalyse|Morphometrie"
 "Terrain Analysis|Preprocessing"	"Reliefanalyse|Pr�prozessierung"
 "Terrain Analysis|Profiles"	"Reliefanalyse|Profile"
+"Terrain Analysis|Slope Stability"	""
 "Terrain Path Cross Sections"	"Relief Pfad Querprofile"
 "Terrain Ruggedness Index (TRI)"	"Relief Rauheitsindex (TRI)"
 "Terrain Surface Classification"	""
@@ -4305,6 +4594,7 @@ TEXT	TRANSLATION
 "The column holding the X-coordinate."	"Die Spalte, die die X-Koordinate enth�lt."
 "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 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."
@@ -4312,13 +4602,18 @@ TEXT	TRANSLATION
 "The field with G values (0-255)"	""
 "The field with R values (0-255)"	""
 "The field with SAGA RGB values"	""
+"The file to write the Calculation Results to."	""
 "The file to write the point cloud to."	""
+"The final symbolic image"	""
 "The first DTM used to assign height information to grid 1"	""
 "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 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 input point cloud files to use"	""
 "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 merged point cloud."	""
@@ -4329,15 +4624,19 @@ TEXT	TRANSLATION
 "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\""	""
 "The numbers (starting from 1) of the fields to use for clustering, separated by semicolon, e.g. \"4;5;7\""	"Die Nummern (beginnend bei 1) der Felder die f�r das Clustern verwendet werden, getrennt durch Semikolon, z.B. \"4;5;7\""
+"The output point cloud"	""
 "The output table"	""
 "The point cloud to export."	"Die zu exportierende Punktwolke."
 "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"	""
 "The second grid to correlate"	""
+"The shapefile to convert."	""
 "The shapefile to use for clipping."	""
 "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 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."
 "The values of the resultant grid can be either the seed value (e.g. the local maximum) or the enumerated segment id."	"Die Werte des resultierenden Rasters k�nnen entweder der Ausgangswert (z.B. lokales Maximum) oder die ausgez�hlte Segment ID sein."
 "The values of this grid are checked against the linear flow threshold to decide on the flow-routing algorithm."	""
@@ -4380,7 +4679,6 @@ 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"	""
-"Thomas Wutzler (c) 2004"	""
 "Threshold"	"Schwellenwert"
 "Threshold (Grid Units)"	"Schwellenwert (Rastereinheiten)"
 "Threshold (Init.)"	"Schwellenwert (Init.)"
@@ -4412,11 +4710,14 @@ TEXT	TRANSLATION
 "Tile Size Definition"	"Kachelgr��e Definition"
 "Tile Vertically"	""
 "Tiles"	"Kacheln"
+"Tileshape"	""
+"Tileshape_%s"	""
 "Tiling"	"Kacheln"
 "Tilt"	"Verkantet"
 "Time"	"Zeit"
 "Time Delay (Rain-Runoff)"	"Zeitverz�gerung (Regenabfluss)"
 "Time Delay after Start of Rainfall (INTEGER)"	"Zeitverz�gerung nach dem Start des Regenniederschlags (GANZZAHL)"
+"Time Difference between Image & Points"	""
 "Time Field"	""
 "Time Interval [a]"	"Zeitintervall [a]"
 "Time Out (h)"	"Unterbrechung (h)"
@@ -4434,23 +4735,35 @@ TEXT	TRANSLATION
 "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 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 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."
 "Timespan (days)"	""
 "Tip of the Day..."	"Tip des Tages.."
+"Tissot's Indicatrix"	""
 "Tolerance"	"Toleranz"
 "Tolerance (Degree)"	"Toleranz (Grad)"
 "Tolerance [Degree]"	"Toleranz [Grad]"
+"Tool"	"Werkzeug"
+"Tool Description Source"	"Quelle f�r Werkzeugbeschreibung"
+"Tool Execution"	"Werkzeugausf�hrung"
+"Tool Libraries"	"Werkzeugbibliotheken"
+"Tool Library"	"Werkzeugbibliothek"
+"Tool Manager"	"Werkzeugverwaltung"
+"Tool execution failed"	"Werkzeugausf�hrung schlug fehl"
+"Tool execution succeeded"	"Werkzeugausf�hrung war erfolgreich"
+"Tools"	"Werkzeuge"
 "Tools for (grid based) digital terrain analysis."	"Werkzeuge f�r (rasterbasierte) digitale Reliefanalysen."
 "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 point clouds."	"Werkzeuge f�r Punktwolken"
 "Tools for polygons."	"Werkzeuge f�r Polygone"
-"Tools for regression analyses."	""
-"Tools for spatial and geostatistical analyses."	""
-"Tools for the georeferencing of spatial data."	""
+"Tools for regression analyses."	"Werkzeuge f�r die Regressionsanalyse"
+"Tools for spatial and geostatistical analyses."	"Werkzeuge f�r raumbezogene und Geostatistik"
+"Tools for the georeferencing of spatial data."	"Werkzeuge f�r die Georeferenzierung"
 "Tools for the gridding of points and other vector data."	"Werkzeuge f�r das Rastern von Punkten und anderen Vektordaten"
+"Tools for the handling of virtual datasets."	"Werkzeuge f�r die Handhabung virtueller Datens�tze"
 "Tools for the import and export of ASPRS LAS files."	"Werkzeuge f�r den Import und Export von ASPRS LAS Dateien."
 "Tools for the import and export of DXF files."	"Werkzeuge f�r den Import und Export von DXF Dateien."
 "Tools for the import and export of gridded data."	"Werkzeuge f�r den Import und Export gerasterter Daten."
@@ -4479,6 +4792,7 @@ TEXT	TRANSLATION
 "Total Insolation"	"Gesamt Sonneneinstrahlung"
 "Total Kinetic Energy"	""
 "Total accumulated Material"	"Gesamt angesammeltes Material"
+"Total area is zero or minimum elevation is equal or lower than maximum elevation!"	""
 "Total flow (in watershed) [m^3/dt]"	""
 "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."
@@ -4526,6 +4840,7 @@ TEXT	TRANSLATION
 "Transverse Cylindrical Equal Area"	"Transvers Zylindrisch fl�chentreu"
 "Transverse Mercator"	"Transvers Merkator"
 "Tree"	"Baum"
+"Tree Count"	""
 "Trend"	"Trend"
 "Trend Analysis"	""
 "Trend Analysis (Shapes)"	""
@@ -4552,15 +4867,21 @@ TEXT	TRANSLATION
 "UNRECOGNISED COMMAND ID"	""
 "USGS SRTM Grids (*.hgt)|*.hgt|All Files|*.*"	"USGS SRTM Raster (*.hgt)|*.hgt|Alle Dateien|*.*"
 "Unable to connect to server."	"Keine Verbindung zum Server."
+"Unable to create filtered mask grid!"	""
+"Unable to create grid for the eroded image!"	""
 "Unable to get capabilities."	""
 "Unable to get map."	""
 "Unable to open LAS file!"	"LAS Datei kann nicht ge�ffnet werden!"
 "Unable to open input file!"	"Eingabedatei kann nicht ge�ffnet werden!"
 "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!"	""
 "Unclassified"	"Unklassifiziert"
+"Uncond. stable"	""
+"Uncond. unstable"	""
 "Undefined"	"Undefiniert"
 "Undefined Coordinate System"	"undefiniertes Koordinatensystem"
+"Underdip slope"	""
 "Undetermined"	"unbestimmt"
 "Uniform"	"einheitlich"
 "Union"	"Verbindung"
@@ -4579,6 +4900,8 @@ TEXT	TRANSLATION
 "Unreferenced Grids"	""
 "Unsaturated zone time delay per unit storage deficit [h]"	"Unges�ttigte Zone Zeitverz�gerung pro Einheit Speicherdefizit [h]"
 "Up"	""
+"Up [-]"	""
+"Up [Home]"	""
 "Up-Scaling"	"Heraufskalieren"
 "Up/Down"	"Auf/Ab"
 "Update"	"Aktualisiere"
@@ -4608,6 +4931,8 @@ TEXT	TRANSLATION
 "Use Confidence Interval"	"Nutze Vertrauensintervall"
 "Use D8 if catchment area becomes higher than specified threshold (Cells)."	"Benutze D8 wenn das Einzugsgebiet gr��er als der vorgegebene Schwellenwert wird (Zellen)"
 "Use D8 if catchment area becomes higher than specified threshold."	"Benutze D8 wenn das Einzugsgebiet gr��er als der vorgegebene Schwellenwert wird."
+"Use Flow Threshold"	""
+"Use Label as Identifier"	""
 "Use NoData"	""
 "Use Offset"	"Nutze Versatz"
 "Use Pyramids"	"Benutze Pyramiden"
@@ -4615,12 +4940,15 @@ TEXT	TRANSLATION
 "Use Surfer's No-Data Value"	"Benutze Surfers No-Data Werte"
 "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 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. "
 "Use the stipple bitmap"	"Benutze die verschattete Bitmap"
 "Use the user dashes"	"Benutze den benutzerdefinierten Strich"
 "Use this option to reclassify No-Data values independently of the method settings."	"Nutze diese Option um No-Data-Werte unabh�ngig von der Methodenauswahl neu zu berechnen."
 "Use this option to reclassify all other values that are not specified in the options above."	"Nutze diese Option um alle anderen Werte die nicht in den obengenannten Optionen ausgew�hlt wurden neu zu berechnen."
+"Use training area labels as identifier in classification result, assumes all label values are integer numbers!"	""
 "Use x -Values"	"Benutze x -Werte"
 "User"	"Benutzer"
 "User Defined"	"Benutzerdefiniert"
@@ -4636,12 +4964,14 @@ TEXT	TRANSLATION
 "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 specified elevation range"	""
 "Username"	"Benutzername"
 "Using temperature data?"	"Nutzung der Temperaturdaten?"
 "Using the snow-melt module?"	"Nutzung des Schneeschmelzmoduls?"
@@ -4670,8 +5000,8 @@ TEXT	TRANSLATION
 "Value Preparation"	"Wertaufbereitung"
 "Value Range"	"Wertebereich"
 "Value Type"	""
+"Value as RGB"	""
 "Value as RGB Code"	"Wert als RGB Code"
-"Value for 'no data'"	"Wert f�r �no Data�"
 "Value in Grid 1"	"Wert in Raster 1"
 "Value in Grid 2"	"Wert in Raster 2"
 "Value of Target Function"	"Wert der Zielfunktion"
@@ -4725,25 +5055,16 @@ TEXT	TRANSLATION
 "Vertical Distance"	"Vertikale Entfernung"
 "Vertical Distance to Channel Network"	"Vertikale Entfernung zum Gew�ssernetz"
 "Vertical Interpolation Method"	"Vertikale Interpolationsmethode"
+"Vertical Offset"	""
 "Vertical Overland Flow Distance"	"Vertikale �berlandflie�entfernung"
 "Vertical Range"	"Vertikaler Bereich"
 "Vertical Scaling"	""
 "Vertical hatch"	"vertikale Schraffur"
 "Vertical scaling factor"	""
 "Vertically mirrored"	"vertikal gespiegelt"
-"ViGrA - Basic Morphological Operations"	"ViGrA - grundlegende Morphologische Operationen "
-"ViGrA - Distance"	"ViGrA - Entfernung"
-"ViGrA - Edge Detection"	"ViGrA - Eckendetektion"
-"ViGrA - Fourier Filter"	"ViGrA - Fourier Filter"
-"ViGrA - Fourier Transform"	"ViGrA - Fourier Transformation"
-"ViGrA - Fourier Transform (Real)"	"ViGrA - Fourier Transformation (Real)"
-"ViGrA - Fourier Transform Inverse"	"ViGrA - invertierte Fourier Transformation"
-"ViGrA - Smoothing"	"ViGrA - Gl�ttung"
-"ViGrA - Watershed Segmentation"	"ViGrA - Wassereinzugsgebiet Aufteilung"
 "Victor Olaya (c) 2004"	""
 "Victor Olaya (c) 2005"	""
 "View Distance"	"Blickentfernung"
-"Viewer Settings"	"Einstellungen Betrachter"
 "Visibility"	"Sichtbarkeit"
 "Visibility (points)"	"Sichtbarkeit (Punkte)"
 "Visibility (single point)"	"Sichtbarkeit (einzelner Punkt)"
@@ -4751,16 +5072,22 @@ TEXT	TRANSLATION
 "Vol. +"	""
 "Vol. -"	""
 "Volker Wichmann (c) 2010, LASERDATA GmbH"	""
+"Volker Wichmann (c) 2010-213, LASERDATA GmbH"	""
 "Volker Wichmann (c) 2012, LASERDATA GmbH"	""
+"Volker Wichmann (c) 2013, LASERDATA GmbH"	""
 "Volume: %f"	"Volumen: %f"
 "Volumes"	"Volumina"
 "Votes"	""
 "W"	""
 "WARNING"	"WARNUNG"
+"WARNING: %d dataset(s) skipped because of incompatibilities!"	""
+"WARNING: %d dataset(s) skipped because they are empty!"	""
 "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."
 "WASP Map Files (*.map)"	"WASP Map Datei (*.map)"
+"WEDGEFAIL"	""
+"WETNESS"	""
 "WHITE_BLUE"	"WEISS_BLAU"
 "WHITE_GREEN"	"WEISS_GR�N"
 "WHITE_RED"	"WEISS_ROT"
@@ -4782,9 +5109,9 @@ TEXT	TRANSLATION
 "Watershed Basins"	"Wassereinzugsgebiete"
 "Watershed Basins (Extended)"	"Wassereinzugsgebiete (erweitert)"
 "Watershed Segmentation"	"Wassereinzugsgebietteile"
+"Watershed Segmentation (ViGrA)"	""
 "Weather Records"	"Wetterdaten"
 "Weight"	"Gewichtung"
-"Weight for Red Grid out of range (0..100) - Cannot execute module"	"Gewichtung des roten Rasters au�erhalb des zul�ssigen Bereichs (0..100) - Kann das Modul nicht ausf�hren"
 "Weight for grid "	"Gewichtung f�r Raster"
 "Weight gradient term"	""
 "Weighted"	"Gewichtet"
@@ -4806,6 +5133,7 @@ TEXT	TRANSLATION
 "Wherry 2"	""
 "Width"	"Breite"
 "Width (Cells)"	"Breite (Zellen)"
+"Width given as percentage of map size"	""
 "Width of gradient filter"	"Breite des Gradientenfilters"
 "Wind Direction"	"Windrichtung"
 "Wind Direction (degrees clockwise from north)"	"Windrichtung (Grad im Uhrzeigersinn aus Nord)"
@@ -4842,9 +5170,11 @@ TEXT	TRANSLATION
 "X Column"	"X Spalte"
 "X Component"	"X Komponente"
 "X Coordinates"	"X Koordinate"
+"X Grid 1"	""
 "X Position"	"X Position"
 "X Range"	"X Bereich"
 "X Values"	"X Werte"
+"X World"	""
 "X is Column ..."	"X ist Spalte ..."
 "X offset"	"X Versatz"
 "X, Y"	""
@@ -4856,7 +5186,6 @@ TEXT	TRANSLATION
 "X-Rotation"	"x-Rotation"
 "X11 Pixel Map"	"X11 Pixelkarte"
 "XYZ Files (*.xyz)"	"XYZ Dateien (*.xyz)"
-"XYZ export filter for shapes. "	"XYZ Exportfilter f�r Vektoren."
 "XYZ files (*.xyz)"	"XYZ Dateien (*.xyz)"
 "Y"	""
 "Y = a * X^b (power)"	""
@@ -4869,9 +5198,11 @@ TEXT	TRANSLATION
 "Y Column"	"Y Spalte"
 "Y Component"	"Y Komponente"
 "Y Coordinates"	"Y Koordinate"
+"Y Grid 1"	""
 "Y Position"	""
 "Y Range"	"Y Bereich"
 "Y Values"	"Y Werte"
+"Y World"	""
 "Y is Column ..."	"Y ist Spalte..."
 "Y offset"	"Y Versatz"
 "Y-Coordinate"	"Y-Koordinate"
@@ -4979,15 +5310,16 @@ TEXT	TRANSLATION
 "accufractionflux / state"	""
 "accuthresholdflux / state"	""
 "accutriggerflux / state"	""
+"add buffer (map units) to extent"	""
 "add to current selection"	"f�ge zu gegenw�rtiger Auswahl hinzu"
+"add value"	""
 "additive"	"zus�tzlich"
 "adjusted"	""
 "after"	"nach"
 "aggregated"	""
-"aggregating inside regions\n"	"aggregiere innerhalb der Regionen\n"
-"aggregating over all the grid\n"	"aggregiere �ber das gesamte Raster\n"
 "align grid to coordinate system"	""
 "align to grid system"	""
+"all"	""
 "all attributes"	"alle Attribute"
 "all classes"	"alle Klassen"
 "all directions"	"alle Richtungen"
@@ -4997,6 +5329,7 @@ TEXT	TRANSLATION
 "all quadrants"	"alle Quadranten"
 "all shapes"	"Alle Vektoren"
 "already in transaction"	""
+"alternating scale bar"	""
 "alternative"	""
 "analyzing known classes"	""
 "angle calculation is only available when exact two features are compared"	""
@@ -5058,13 +5391,12 @@ TEXT	TRANSLATION
 "calculate averages"	"berechne Durchschnitt"
 "calculate gradient magnitude"	"berechne Gradient der Magnitude"
 "calculate gradients"	"berechne Gradienten"
-"calculating initial distances\n"	"berechne anf�ngliche Entfernungen\n"
 "calculating splines..."	"Splines berechnend�"
-"cannot execute interactive module"	"interaktives Modul kann nicht ausgef�hrt werden"
 "cartesian"	"kartesisch"
 "catchment area and slope..."	""
 "catchment length (square root of catchment area)"	""
 "catchment slope"	""
+"catchment specific parameter for sediment delivery ratio calculation"	""
 "categorical"	""
 "cell"	"Zelle"
 "cell area"	"Zellfl�che"
@@ -5092,7 +5424,8 @@ TEXT	TRANSLATION
 "class identification"	"Klassen Identifikation"
 "classification"	"Klassifikation"
 "clay content given as percentage"	"Tongehalt gegeben in Prozentanteilen"
-"clean up temporary data structures\n"	"bereinige die tempor�ren Datenstrukturen\n"
+"clean inner rings"	""
+"clip extent does not match grid's extent"	""
 "clip features"	""
 "clipped"	""
 "clockwise"	"im Uhrzeigersinn"
@@ -5107,6 +5440,7 @@ TEXT	TRANSLATION
 "comma (,)"	"Komma (,)"
 "commit"	"�bergeben"
 "commit transaction command failed"	""
+"complete input times near points matrix"	""
 "completely contain"	"vollst�ndig enthalten"
 "completely contained"	"vollkommen umschlossen"
 "confirm"	"Best�tige"
@@ -5137,15 +5471,20 @@ TEXT	TRANSLATION
 "could not create weights grid"	""
 "could not disconnect ODBC source"	""
 "could not disconnect PostgreSQL source"	""
-"could not execute module"	"Modul konnte nicht ausgef�hrt werden"
-"could not find module"	"konnte Modul nicht finden"
+"could not execute module"	"Werkzeug konnte nicht ausgef�hrt werden"
+"could not execute tool"	"Werkzeug konnte nicht ausgef�hrt werden"
+"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 cluster engine"	""
 "could not initialize data objects"	""
-"could not initialize module"	""
+"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 open GetMap stream"	""
 "could not open data source"	"kann Datenquelle nicht �ffnen"
 "could not open file"	"datei konnte nicht ge�ffnet werden"
@@ -5164,7 +5503,7 @@ TEXT	TRANSLATION
 "create model from training areas"	""
 "creating batch file example"	"erzeuge Batch-Datei als Beispiel"
 "creating interpolator"	"erzeuge Interpolator"
-"creating module documentation files"	"erstelle Modul Dokumentationsdateien"
+"creating tool documentation files"	"Erstelle Dateien zur Werkzeugdokumentation"
 "cross"	"Kreuz"
 "cubic convolution"	""
 "cubic surface"	"kubische Oberfl�che"
@@ -5181,6 +5520,7 @@ TEXT	TRANSLATION
 "dark - bright"	"dunkel - hell"
 "data / no-data"	""
 "data file could not be openend"	"Datendatei konnte nicht ge�ffnet werden"
+"data set has no attributes"	""
 "database table does not exist"	"Datentabelle existiert nicht"
 "date"	"Datum"
 "date (dd.mm.yyyy)"	"Datum (dd.mm.yyyy)"
@@ -5213,6 +5553,8 @@ TEXT	TRANSLATION
 "direction of sun (degree, clockwise from North)"	"Richtung der Sonne (Grad, im Uhrzeigersinn von Nord)"
 "direction to the center cell"	"Richtung zur Mittelzelle"
 "directional1 average for Grids"	"gerichteter 1 Durchschnitt f�r Raster"
+"disabling might help to shut down faster, particularly if started from slow devices"	""
+"dissolved inner rings"	""
 "distance"	"Entfernung"
 "distance weighted average catchment slope"	""
 "do not confirm"	"nicht best�tigen"
@@ -5232,13 +5574,13 @@ TEXT	TRANSLATION
 "duplicates have been identified."	"Duplikate m�ssen erst identifiziert werden"
 "e"	""
 "each island as separated polygon"	"jede Insel als abgetrenntes Polygon"
+"each pair with a single record"	""
 "each shape"	"jeder Vektor"
 "each shape's part"	""
 "edge collection"	"Eckensammlung"
 "edge detection"	"Eckenerkennung"
 "edge of flight line flag"	"Ecken der Flugroute flag"
 "effective flow length"	""
-"eight points"	""
 "elevation"	"Erhebung"
 "elevation and roughness"	"Erhhebung und Rauheit"
 "elevation threshold used to identify hills/valleys"	""
@@ -5249,6 +5591,7 @@ TEXT	TRANSLATION
 "enumeration"	"Aufz�hlung"
 "epsilon in loss function of epsilon-SVR"	""
 "epsilon-SVR"	""
+"equal"	""
 "equal intervals"	"gleiche Intervalle"
 "erosion"	"Erosion"
 "error"	"Fehler"
@@ -5258,9 +5601,12 @@ TEXT	TRANSLATION
 "error saving data file"	"Fehler beim Speichern der Datendatei"
 "error saving index file"	"Fehler beim Speichern der Indexdatei"
 "exclude range"	"grenze Bereich aus"
-"executing module"	"Modulausf�hrung"
+"executing tool"	"Werkzeugausf�hrung"
 "existing grid or grid system"	"Existierendes Raster oder Rastersystem"
 "existing grid system"	"bestehendes Rastersystem"
+"expand"	""
+"expand and shrink"	""
+"expected"	""
 "expected to be the second of day"	""
 "explained cumulative variance"	"ausgef�hrte kumulative Streuung"
 "explained variance"	"Varianzaufkl�rung"
@@ -5274,6 +5620,7 @@ TEXT	TRANSLATION
 "failed"	"fehlgeschlagen"
 "failed to create index for grid"	"gescheitert beim Erstellen eines Index f�r Raster"
 "failed to create index for table"	"gescheitert beim Erstellen eines Index f�r Tabelle"
+"failed to create polygon clipping mask"	""
 "failed to create searche engine"	""
 "failed to initialise search engine"	"Initialisierung der Suchmaschine fehlgeschlagen"
 "failed: could not find a suitable import driver"	"fehlgeschlagen: konnte keinen passenden Importtreiber finden"
@@ -5285,26 +5632,30 @@ TEXT	TRANSLATION
 "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"	""
+"find inner rings"	""
 "find local minima"	"finde lokales Minimum"
 "first"	"zu Erst"
 "first point"	"Erster Punkt"
 "first value"	"erster Wert"
 "fit to each grid"	"passe an alle Raster an"
-"fit to overall 1.5 standard deviation"	"passe an gesamte 1.5 Standardabweichung an"
-"fit to overall 2.0 standard deviation"	"passe an gesamte 2.0 Standardabweichung an"
 "fit to overall range"	"passe an gesamten Bereich an"
+"fit to overall standard deviation"	""
 "fit to page"	"an Seite anpassen"
 "fit to value"	"passe an Wert an"
+"fitted interval"	""
 "fitting a polynom of ith order needs at least i + 1 samples"	""
 "fixed"	""
 "fixed cell height"	"feste Zellenh�he"
+"fixed interval"	""
 "fixed value"	"fester Wert"
 "floating"	""
 "floating point"	"Flie�komma"
+"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)"
 "forward"	"vorw�rts"
-"four points"	""
 "from list"	"von Liste"
 "full frame"	""
 "function fitting failed !"	"Funktionsanpassung fehlgeschlagen!"
@@ -5351,6 +5702,7 @@ TEXT	TRANSLATION
 "hhmmss, fix size"	"hhmmss, feste Gr��e"
 "high"	""
 "highest z"	"h�chster z"
+"histogram match"	""
 "horizontal"	"horizontal"
 "hours"	"Stunden"
 "how to request values if step size is more than one cell"	""
@@ -5359,6 +5711,7 @@ TEXT	TRANSLATION
 "if set, only values with level heights above DEM will be used"	""
 "ignore"	"�bergehen"
 "ignored if set to zero"	"ignorieren wenn auf null gesetzt"
+"ignored if set to zero (consider all pairs)"	""
 "image"	"Bild"
 "immediate"	"direkt"
 "improper function syntax"	"unsachgem��e Funktionssyntax"
@@ -5367,6 +5720,7 @@ TEXT	TRANSLATION
 "include all"	"alles einschlie�en"
 "include range"	"Schlie�e Bereich ein"
 "incompatible file."	"inkompatible Datei."
+"incompatible items have been removed from input list"	""
 "index"	""
 "index file could not be opened"	"Indexdatei konnte nicht ge�ffnet werden"
 "index number"	""
@@ -5380,8 +5734,10 @@ TEXT	TRANSLATION
 "input"	"Eingabe"
 "input file"	"Eingabedatei"
 "instable (thawing)"	"instabil (auftauend)"
+"insufficient training samples"	""
 "intensity"	"Intensit�t"
 "interactive"	"interaktiv"
+"interpolate values if projection is needed"	""
 "interpolating"	"interpolierend"
 "interpolation method to use if grid needs to be aligned to coordinate system"	""
 "intersect"	"�berkreuzen"
@@ -5399,14 +5755,18 @@ TEXT	TRANSLATION
 "invalid geographic coordinate system / datum"	"ung�ltiges geographisches Koordinatensystem / Datum"
 "invalid geogrid file name"	""
 "invalid grid system"	"ung�ltiges Rastersystem"
+"invalid image file path"	""
 "invalid input"	"unzul�ssige Eingabe"
+"invalid input data"	""
 "invalid input!"	"ung�ltige Eingabe!"
 "invalid lines layer"	"ung�ltiger Linienvektor"
 "invalid lookup table."	""
+"invalid number of features"	""
 "invalid number of parameters"	"unzul�ssige Zahl an Parametern"
 "invalid or empty polygons layer"	"ung�ltiger oder leerer Polygonvektor"
 "invalid or empty shapes layer"	"ung�ltige oder leere Volumenebene"
 "invalid or unsupported shape or vertex type"	""
+"invalid point cloud"	""
 "invalid points have been skipped"	"ung�ltige Punkte werden �bersprungen"
 "invalid points layer"	"ung�ltige Punktebene"
 "invalid production date"	""
@@ -5432,10 +5792,12 @@ TEXT	TRANSLATION
 "last point"	"letzter Punkt"
 "last value"	"letzter Wert"
 "layer uses undefined coordinate system, assuming geographic coordinates"	""
+"learning"	""
 "least significant first"	"der geringst-signifikante zu erst"
 "least squares fitted plane (Horn 1981, Costa-Cabral & Burgess 1996)"	""
 "leave one out"	""
 "left"	"links"
+"less than two polygons in layer, nothing to do!"	""
 "level"	"Level"
 "level 1"	"Level 1"
 "level 2"	"Level 2"
@@ -5451,7 +5813,7 @@ TEXT	TRANSLATION
 "list order"	""
 "listing of database tables failed"	""
 "listing of table columns failed"	""
-"loaded module libraries"	""
+"loaded tool libraries"	"Geladene Werkzeugbibliotheken"
 "loading"	"laden"
 "loading OSM data"	""
 "loading band"	""
@@ -5461,6 +5823,7 @@ TEXT	TRANSLATION
 "local time"	"Lokalzeit"
 "local water depth or absolute water level at the user specified cell"	"lokale Wassertiefe oder absolute Wassertiefe in der vom Benutzer spezifizierten Zelle"
 "localhost"	"localhost"
+"logarithmic"	""
 "lookup table"	""
 "low"	""
 "lower and upper thresholds for semantic import model, planar vs. sloped areas"	""
@@ -5474,10 +5837,12 @@ TEXT	TRANSLATION
 "m2/h"	""
 "magenta - white"	"magenta - wei�"
 "main basins..."	"Hauptbecken..."
+"majority"	""
 "map units"	""
 "mark breaks in first line"	"Markierung bricht in erster Zeile"
 "masking..."	"maskieren�"
 "match input data"	"�bereinstimmung Eingabedaten"
+"matching histogram"	""
 "mathematical"	"mathematisch"
 "matrix initialisation failed"	"Matrixinitialisierung fehlgeschlagen"
 "matrix inversion failed"	""
@@ -5524,16 +5889,11 @@ TEXT	TRANSLATION
 "missing operand"	"fehlender Operand"
 "model application"	""
 "model creation"	""
-"module"	"Modul"
-"module name "	"Modulname"
-"modules"	"Module"
 "moment"	"Moment"
 "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"
-"multi-grid viewer can only be run from graphical user interface"	""
-"multi-grid viewer will not be started"	""
 "multiplicative"	"vielfach"
 "n"	""
 "n-fold cross validation: n must > 1"	""
@@ -5560,7 +5920,6 @@ TEXT	TRANSLATION
 "no database connection"	"Keine Datenbankverbindung"
 "no distance weighting"	"keine Entfernungsgewichtung"
 "no edges found"	"keine Ecken gefunden"
-"no features have been selected"	""
 "no features in selection"	""
 "no features to buffer."	"keine Eigenschaften zum Puffern."
 "no fields in selection"	"Keine Felder in der Auswahl"
@@ -5572,9 +5931,9 @@ TEXT	TRANSLATION
 "no grids in selection"	"keine Raster in Auswahl"
 "no histogram for unclassified data"	"kein Histogramm f�r unbestimmte Werte"
 "no input"	"keine Eingabe"
-"no input data"	"keine Eingabedaten"
 "no intersection with mask grid."	"Keine Schnittmenge mit Maskierungsraster."
 "no layers in data source"	"Keine Ebenen in Datenquelle"
+"no lines for splitting"	""
 "no memory"	"kein Speicher"
 "no options"	"keine Optionen"
 "no output parameter in selection"	"kein Ausgabeparameter in der Auswahl"
@@ -5606,6 +5965,7 @@ TEXT	TRANSLATION
 "no training areas could be analysed."	""
 "no translation available"	"keine �bersetzung verf�gbar"
 "no valid data found in grid(s)"	"keine g�ltige Daten in Raster gefunden"
+"no valid grid in features list."	""
 "no valid grid in list."	""
 "no valid samples in data set"	""
 "no variation in point pattern"	"keine Unterschiede im Punktmuster"
@@ -5648,6 +6008,7 @@ TEXT	TRANSLATION
 "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 order"	"Nummer des Auftrages"
 "number of pits above threshold level"	"Anzahl der Gruben zwischen Schwellenwertpegel"
 "number of points"	"Anzahl der Punkte"
@@ -5692,6 +6053,7 @@ TEXT	TRANSLATION
 "original name + variable type"	""
 "other"	"andere"
 "other values"	"andere Werte"
+"out-of-bag error"	""
 "output"	"Ausgabe"
 "ovalooblonga-rectangularoblonga"	""
 "ovaloredonda-ovalooblonga"	""
@@ -5727,7 +6089,9 @@ TEXT	TRANSLATION
 "points read"	"Punkte gelesen"
 "points written"	"Punkte geschrieben"
 "polar coordinates given in degree"	""
+"polygon"	""
 "polygons"	"Polygone"
+"polylines"	""
 "polynomial"	""
 "polynomial trend"	""
 "polynomial trend (coefficient interpolation)"	""
@@ -5738,6 +6102,7 @@ TEXT	TRANSLATION
 "press any key"	"Dr�cke eine beliebige Taste"
 "processed DEM"	"berechnetes DGM"
 "projection initialization failure"	"Projektionsinitialisierungsfehler"
+"proportional"	""
 "quadrants"	"Quadrant"
 "quadratic surface"	"quadratische Oberfl�che"
 "quantiles"	"Quantile"
@@ -5776,14 +6141,13 @@ TEXT	TRANSLATION
 "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"	""
 "relative"	"relativ"
 "remove above percentile"	"entferne oberes Perzentil"
 "remove below percentile"	"entferne unteres Perzentil"
 "remove from current selection"	"entferne aus gegenw�rtiger Auswahl"
 "remove maxima (with tolerance)"	"entferne Maxima (mit Tolernz)"
 "remove minima (with tolerance)"	"entferne Minima (mit Toleranz)"
-"removing orphants\n"	"entferne Waisen\n"
-"renaming classes\n"	"benenne Klassen um\n"
 "replace existing table"	"ersetze bestehende Tabelle"
 "replacements"	"Austausch"
 "resampling"	"Neuberechnung"
@@ -5817,6 +6181,7 @@ TEXT	TRANSLATION
 "sand content given as percentage"	"Sandgehalt gegeben in Prozent"
 "save output to file instead of memory"	""
 "save point added"	""
+"scale line"	""
 "scale to size range"	""
 "scan angle"	"Scanwinkel"
 "search distance is less than half of grid cell size"	"Die Suchentfernung ist kleiner als die H�lfte einer Rasterzellengr��e"
@@ -5833,17 +6198,22 @@ TEXT	TRANSLATION
 "selected table does not have numeric attributes"	"ausgew�hlte Tabelle enth�lt keine numerischen Attribute"
 "self-intersection"	""
 "separate layer for each polygon"	"einzelne Ebene f�r jedes Polygon"
+"separate lines"	""
 "sequential write"	"sequentielles Schreiben"
+"set constant value"	""
 "shading"	"Schummerung"
 "shading (fixed light source)"	"Schummerung (feste Lichtquelle)"
 "shape file could not be opened."	"Vektordatei konnte nicht ge�ffnet werden."
 "shape in process"	"Vektor in Bearbeitung"
 "shape wise, supports overlapping polygons"	""
 "shapes"	"Vektoren"
+"shapes extent"	""
 "shapes have been dropped"	"Vektoren wurden zugewiesen"
 "shapes layer extent"	"Vektorebenen-Umfang"
 "show direct insolation for each time step."	"zeige direkte Sonneneinstrahlung f�r jeden Zeitschritt."
 "shows cell values when zoomed"	""
+"shrink"	""
+"shrink and expand"	""
 "sigmoid"	""
 "sigmoidal"	"sigmoidal"
 "signed 1 byte integer"	"1 byte Ganzzahl mit Vorzeichen"
@@ -5855,14 +6225,17 @@ TEXT	TRANSLATION
 "simple planar surface"	"einfache planare Oberfl�che"
 "simply decrease cell's value by epsilon"	""
 "sin(x*x + y*y)"	""
+"single class"	""
 "single|range|simple table|user supplied table|"	"einzeln|Bereich|einfache Tabelle|durch Nutzer bereitgestellte Tabelle|"
 "size range as percentage of step"	""
+"slope threshold must not be zero!"	""
 "slope value has to be greater than zero"	""
 "slower but memory saving"	"langsamer aber Speicher schonend"
 "smoothed surface"	"gegl�ttete Oberfl�che"
 "snap move"	""
 "snapped"	""
 "soil texture"	"Bodentextur"
+"solve inner rings"	""
 "source"	"Quelle"
 "space"	"Raum"
 "specific catchment area"	""
@@ -5873,6 +6246,7 @@ TEXT	TRANSLATION
 "splitting polygon parts"	"Polygonteile aufteilen"
 "sql excution error"	"SQL Ausf�hrungsfehler"
 "square"	"Quadrat"
+"square root"	""
 "square root (catchment length)"	"Quadratwurzel (Einzugsgebietsl�nge)"
 "square root of catchment area"	""
 "stable"	"stabil"
@@ -5890,7 +6264,9 @@ TEXT	TRANSLATION
 "stretch to specified value range"	""
 "string"	"Zeichenkette"
 "subbasins..."	"Teilbecken..."
+"subtract value"	""
 "success"	"Erfolgreich"
+"sum"	""
 "sums-of-squares-and-cross-products matrix"	"Summe von Quadrat und Kreuprodukten Matrix"
 "surface and result grids have to share the same grid system"	""
 "symmetric"	"symmetrisch"
@@ -5915,11 +6291,14 @@ TEXT	TRANSLATION
 "time of sunrise/sunset is only calculated if time span is set to single day"	"Die Zeit des Sonnenauf-/-untergangs kann nur berechnet werden wenn die Zeitspanne auf einzelnen Tag gesetzt ist."
 "tolerance as absolute values"	"Toleranz als absoluter Wert"
 "tolerance of termination criterion"	""
-"tomaschTool"	"tomaschWerkzeug"
 "too few parameters"	"Zu wenige Parameter"
 "too many constants"	"Zu wenige Konstanten"
 "too many input grids"	"zu viele Eingaberaster"
 "too many parameters"	"Zu viele Parameter"
+"tool"	"Werkzeug"
+"tool name   "	"Werkzeugname"
+"tool needs graphical user interface"	"Werkzeug ben�tigt graphische Benutzeroberfl�che"
+"tools"	"Werkzeuge"
 "top"	"Oben"
 "top / right"	"oben / rechts"
 "top hat"	""
@@ -5970,6 +6349,7 @@ TEXT	TRANSLATION
 "use old version (no acceleration option) with constant wind direction"	"benutze alte Version (keine Beschleunigungsoption) mit konstanter Windrichtung"
 "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"
diff --git a/src/saga_core/saga_gui/res/saga.lng.txt b/src/saga_core/saga_gui/res/saga.lng.txt
index c25f888..e2e2d08 100644
--- a/src/saga_core/saga_gui/res/saga.lng.txt
+++ b/src/saga_core/saga_gui/res/saga.lng.txt
@@ -46,10 +46,12 @@ TEXT	TRANSLATION
 "  Total Points:\t%ld"	""
 "  Total Pulses:\t%ld"	""
 "  Version:\t\t\t%d.%d"	""
+"%d points from %d dataset(s) written to output point cloud."	""
 "%d tiles created."	""
 "%d. %s"	""
 "%s_CORRPOINTS"	""
 "%s_DISP_VEC"	""
+"%s_colorised"	""
 "%s_merged"	""
 "(Tw) wetness decline time constant"	""
 "(Tw) wetness decline time constant [lower bound]"	""
@@ -92,6 +94,7 @@ TEXT	TRANSLATION
 "0 - 1.0"	""
 "0 - 255"	""
 "0 is horizontal, 90 is vertical."	""
+"0-50 mm/day"	""
 "0.1"	""
 "01: A Simple Litter System"	""
 "01: My first module"	""
@@ -120,6 +123,7 @@ TEXT	TRANSLATION
 "1. quadrant (upper right)"	""
 "1.0"	""
 "10 parameter 3rd order polynom (Haralick 1983)"	""
+"100-200 mm/day"	""
 "10: Dynamic Simulation - Life"	""
 "11: Dynamic Simulation - Soil Nitrogen Dynamics"	""
 "128x128"	""
@@ -146,7 +150,9 @@ TEXT	TRANSLATION
 "2. quadrant (lower right)"	""
 "2.0"	""
 "20 seconds"	""
+"200-400 mm/day"	""
 "256x256"	""
+"2D Shapefile"	""
 "2nd Order Polynomial"	""
 "2nd Std. Parallel"	""
 "3"	""
@@ -164,8 +170,11 @@ TEXT	TRANSLATION
 "3D Image"	""
 "3D Image Height"	""
 "3D Image Width"	""
+"3D Shapefile"	""
 "3D Shapes Viewer"	""
 "3D View"	""
+"3D View Sequencer"	""
+"3D Viewer."	""
 "3D-View"	""
 "3D-View: Player Sequence"	""
 "3rd Order Polynomial"	""
@@ -180,6 +189,7 @@ TEXT	TRANSLATION
 "4 byte unsigned integer"	""
 "4. quadrant (upper left)"	""
 "5 X 5"	""
+"50-100 mm/day"	""
 "6 parameter 2nd order polynom (Bauer, Rohdenburg, Bork 1985)"	""
 "6 parameter 2nd order polynom (Evans 1979)"	""
 "6 parameter 2nd order polynom (Heerdegen & Beran 1982)"	""
@@ -209,6 +219,7 @@ TEXT	TRANSLATION
 "<not set>"	""
 "="	""
 ">"	""
+">400 mm/day"	""
 ">="	""
 "?"	""
 "A"	""
@@ -221,8 +232,14 @@ TEXT	TRANSLATION
 "A3 Portrait"	""
 "A4 Landscape"	""
 "A4 Portrait"	""
-"A:Grid|Construction"	""
+"A:Grid|Distances"	""
+"A:Grid|Filter"	""
+"A:Grid|Gaps"	""
+"A:Grid|Grid System"	""
+"A:Grid|Values"	""
 "A:Imagery|Classification"	""
+"A:Imagery|Fourier Analysis"	""
+"A:Imagery|Segmentation"	""
 "A:Imagery|Tools"	""
 "A:Shapes|Construction"	""
 "A:Shapes|Conversion"	""
@@ -232,12 +249,19 @@ TEXT	TRANSLATION
 "A:Spatial and Geostatistics|Points"	""
 "A:Table|Construction"	""
 "A:Table|Selection"	""
+"A:Table|Tools"	""
 "A:Terrain Analysis|Climate and Weather"	""
 "A:Terrain Analysis|Terrain Classification"	""
 "ADDR"	""
 "AFAC("	""
 "AFAC()"	""
+"ANGMAP"	""
+"AOI"	""
+"AOI Input Settings"	""
 "AOI Shape"	""
+"AOI does not intersect bounding box of SPCVF, nothing to do!"	""
+"AOI does not intersect with any bounding box of the SPCVF datasets, nothing to do!"	""
+"AOI does not intersect with any point of the SPCVF datasets, nothing to do!"	""
 "AQ("	""
 "AREA"	""
 "AS("	""
@@ -245,6 +269,7 @@ TEXT	TRANSLATION
 "ASCII Decimal Separator"	""
 "ASCII Grid Options"	""
 "ASCII Precision"	""
+"ASCII file with columns degree, order, c_lm, s_lm (separated by space)"	""
 "ASPECT_1"	""
 "ASPECT_2"	""
 "ASPECT_3"	""
@@ -263,6 +288,7 @@ TEXT	TRANSLATION
 "Absolute Weighting"	""
 "Acc. Area"	""
 "Acceleration"	""
+"Acceptable Time Difference between Image and Laser Points"	""
 "Accessing PostgreSQL databases."	""
 "Accumulated Cost"	""
 "Accumulated Cost (Anisotropic)"	""
@@ -289,31 +315,40 @@ TEXT	TRANSLATION
 "Add Coordinates to points"	""
 "Add Field"	""
 "Add Frame"	""
+"Add Graticule"	""
 "Add Grid Name Field"	""
 "Add Grid Values to Points"	""
 "Add Grid Values to Shapes"	""
 "Add Identifier"	""
 "Add Link to Files"	""
+"Add Location Info"	""
+"Add Overlap"	""
 "Add Part"	""
+"Add Point Attributes to Polygons"	""
+"Add Point Order"	""
 "Add Polygon Attributes to Points"	""
 "Add Position [A]"	""
+"Add Position [Ctrl + A]"	""
 "Add Project"	""
 "Add Record"	""
 "Add Shape"	""
+"Add Source Information"	""
 "Add Volumes Below Base Level"	""
 "Add layer to selected map"	""
+"Add location information from points (x,y,(z,m))"	""
+"Add overlap to AOI"	""
+"Add point order as additional attribute."	""
 "Add to Map"	""
 "Add unique identifier attribute field to output, ID resembles processing order."	""
 "Addition"	""
-"Additional Cuts"	""
 "Additional Grids"	""
-"Additional Layers"	""
 "Additional Parameters"	""
 "Additional Point Clouds"	""
 "Additional Values"	""
 "Additional point clouds to merge with main point cloud."	""
 "Additional values that shall be saved to the output table."	""
 "Addition|"	""
+"Adds a field with the name of the original input data set."	""
 "Adjust"	""
 "Adjust to Grid"	""
 "Adjustment"	""
@@ -333,6 +368,7 @@ TEXT	TRANSLATION
 "Albers Equal Area Conic"	""
 "Alessandro Perego"	""
 "Algorithm for the detection of Surface Specific Points"	""
+"All"	""
 "All Files"	""
 "All Files|*.*|"	""
 "All Levels"	""
@@ -346,6 +382,7 @@ TEXT	TRANSLATION
 "Allow Edge Pixels to be Seeds"	""
 "Allow longitudes outside -180 to 180 Range"	""
 "Allow multiple observer positions."	""
+"Allows to scale shade brightness [percent]"	""
 "Allows to scale shade brightness, [percent]"	""
 "Allows to write cell values from additional grids to the output"	""
 "Alpha"	""
@@ -373,15 +410,21 @@ TEXT	TRANSLATION
 "Angular Distance Weighted"	""
 "Annual"	""
 "Annual Course of Daily Insolation"	""
+"Appearance"	""
 "Append Rows from ..."	""
 "Append Rows from Table"	""
 "Applies also to the binary format header file."	""
 "Apply"	""
+"Apply Filter?"	""
 "Apply Move"	""
+"Apply a filter (erosion - binary reconstruction) to the input image "	""
 "Apply changes?"	""
 "Apply offset?"	""
 "Apply post-processing filter to remove small holes"	""
 "Approx. Terrain Slope"	""
+"Approximate Coordinate"	""
+"Approximate Coordinates of Projection Center"	""
+"Approximate Coordinates of Target Point"	""
 "Approximate Terrain Slope [%]"	""
 "April"	""
 "Arc Vertex Distance [Degree]"	""
@@ -408,7 +451,9 @@ TEXT	TRANSLATION
 "Aspect-Slope"	""
 "Aspect-Slope Grid"	""
 "Assign"	""
+"Assign ..."	""
 "Assign attributes to shapes..."	""
+"Assume a given minimum slope for each cell."	""
 "At-Sensor Radiance"	""
 "At-Sensor Reflectance"	""
 "At-Sensor Temperature"	""
@@ -434,7 +479,6 @@ TEXT	TRANSLATION
 "Author"	""
 "Automated Cloud Cover Assessment"	""
 "Automatic"	""
-"Automatic mode"	""
 "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."	""
@@ -443,10 +487,10 @@ TEXT	TRANSLATION
 "Available Clay"	""
 "Available Connections"	""
 "Available Libraries"	""
-"Available Modules"	""
 "Available Projections:"	""
 "Available Sand"	""
 "Available Silt"	""
+"Available Tools"	""
 "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)."	""
@@ -492,6 +536,7 @@ TEXT	TRANSLATION
 "Backpropagation parameters"	""
 "Backward"	""
 "Backward Diagonal"	""
+"Backward [Page Down]"	""
 "Backward diagonal hatch"	""
 "Band"	""
 "Band 1"	""
@@ -527,6 +572,9 @@ TEXT	TRANSLATION
 "Bilinear Interpolation"	""
 "Binary Byte Order"	""
 "Binary Encoding"	""
+"Binary Erosion-Reconstruction"	""
+"Binary input image for the connectivity analysis"	""
+"Binary object mask"	""
 "Birth Rate of Fishes"	""
 "Birth Rate of Sharks"	""
 "Blending Distance"	""
@@ -542,11 +590,14 @@ TEXT	TRANSLATION
 "Bonne"	""
 "Boolean"	""
 "Border"	""
+"Border Color"	""
 "Borders"	""
 "Bottom"	""
 "Bottom to Top"	""
 "Boundary Effect"	""
+"Boundary Effect Color"	""
 "Bounding Box"	""
+"Bounding Box [B]"	""
 "Branches"	""
 "Branches to Litter"	""
 "Braunschweiger Reliefmodell"	""
@@ -602,7 +653,7 @@ TEXT	TRANSLATION
 "Calibrated Digital Number"	""
 "Calibration Constants"	""
 "Camera"	""
-"Can't execute a module while another runs"	""
+"Can't execute a tool while another runs"	""
 "Cancel"	""
 "Canny"	""
 "Canopy Background Adjustment"	""
@@ -620,6 +671,7 @@ TEXT	TRANSLATION
 "Catchment Area (Mass-Flux Method)"	""
 "Catchment Area (Parallel)"	""
 "Catchment Area (Recursive)"	""
+"Catchment Area Calculation"	""
 "Catchment Aspect"	""
 "Catchment Height"	""
 "Catchment Slope"	""
@@ -644,9 +696,12 @@ TEXT	TRANSLATION
 "Center Versus Neighbours"	""
 "Center of Triangles"	""
 "Centered"	""
+"Central"	""
+"Central Distance"	""
 "Central Meridian"	""
 "Central Parallel"	""
 "Central Projection"	""
+"Central Projection Distance"	""
 "Centre"	""
 "Centroid X"	""
 "Centroid Y"	""
@@ -695,6 +750,7 @@ TEXT	TRANSLATION
 "Check the attributes to drop"	""
 "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 to create a new attribute with the reclassification result. If unchecked, the existing attribute is updated."	""
 "Chessboard"	""
 "Children"	""
@@ -711,11 +767,17 @@ TEXT	TRANSLATION
 "Choose a flow routing algorithm that shall be used for the overland flow distance calculation:\n- D8\n- MFD"	""
 "Choose a method"	""
 "Choose case: Rook's case contiguity compares only cell wich share an edge. Queen's case contiguity compares also cells which share just corners."	""
+"Choose how to apply the new value."	""
+"Choose how to handle file paths. With relative paths, you can package the *.spcvf and your point cloud tiles easily."	""
+"Choose how to handle the NoData value of the output grid."	""
+"Choose how to sort the elevation dataset before sampling"	""
 "Choose if you want to segmentate either on minima or on maxima."	""
 "Choose method how to adjust input values."	""
 "Choose the Point Data Record Format you like to use"	""
 "Choose the activation function used by the neronal network."	""
 "Choose the attributes to use for clustering:"	""
+"Choose the classification constant to use"	""
+"Choose the format of the shapefile."	""
 "Choose the mode of operation"	""
 "Choose the training method used for the neronal network."	""
 "Choose the type of data used in this model."	""
@@ -739,7 +801,6 @@ TEXT	TRANSLATION
 "Classification Quality"	""
 "Classification Type"	""
 "Classification tools for grids."	""
-"Classificaton"	""
 "Classified"	""
 "Classify"	""
 "Claudy 3"	""
@@ -751,6 +812,7 @@ TEXT	TRANSLATION
 "Clear History"	""
 "Clear RGA"	""
 "Clear Reference Points"	""
+"Clear Selection"	""
 "Climate"	""
 "Climate - Tools"	""
 "Climate Data"	""
@@ -759,8 +821,11 @@ TEXT	TRANSLATION
 "Clip Features"	""
 "Clip Grid with Polygon"	""
 "Clip Grid with Rectangle"	""
+"Clip Grids"	""
 "Clip Points with Polygons"	""
+"Clip to Extent"	""
 "Clipboard"	""
+"Clipped Grids"	""
 "Clipped Points"	""
 "Clipping Options"	""
 "Close"	""
@@ -770,7 +835,6 @@ TEXT	TRANSLATION
 "Close Gaps with Stepwise Resampling"	""
 "Close One Cell Gaps"	""
 "Close all data sets"	""
-"Close and save modified data sets..."	""
 "Closed Depressions"	""
 "Closed Gaps Grid"	""
 "Closest Point"	""
@@ -797,13 +861,18 @@ TEXT	TRANSLATION
 "Color Triangle Composite"	""
 "Color by Attribute"	""
 "Coloring"	""
+"Colorisation (PC)"	""
+"Colorised Point Cloud"	""
 "Colors"	""
 "Colors Value Range"	""
 "Colors file could not be exported."	""
 "Colors file could not be imported."	""
+"Colour"	""
+"Colour Attribute"	""
 "Colour Normalized Brovey Sharpening"	""
 "Colour Normalized Spectral Sharpening"	""
 "Colouring"	""
+"Colours"	""
 "Colours Palette"	""
 "Cols"	""
 "Columns"	""
@@ -814,6 +883,7 @@ TEXT	TRANSLATION
 "Combined Shading"	""
 "Comma Separated Values"	""
 "Command Line Arguments"	""
+"Commands"	""
 "Comment"	""
 "Commit"	""
 "Commit/Rollback Transaction"	""
@@ -821,7 +891,6 @@ TEXT	TRANSLATION
 "Common Edge Type of Face Neighbourhood"	""
 "Common Vertex"	""
 "Compare with..."	""
-"CompleteLinkage"	""
 "Completed Grid"	""
 "Component"	""
 "Composite"	""
@@ -842,6 +911,7 @@ TEXT	TRANSLATION
 "Connected"	""
 "Connection to database failed"	""
 "Connections"	""
+"Connectivity Analysis"	""
 "Connectivity Index (Pff)."	""
 "Connectivity Weighting"	""
 "Connectivity [Percent]"	""
@@ -855,9 +925,6 @@ TEXT	TRANSLATION
 "Constraints"	""
 "Contour Lines"	""
 "Contour Lines from Grid"	""
-"Contributions - T. Wutzler"	""
-"Contributions from Thomas Wutzler."	""
-"Contributions|T. Wutzler"	""
 "Control Points"	""
 "Convergence"	""
 "Convergence (FD8)"	""
@@ -877,6 +944,7 @@ TEXT	TRANSLATION
 "Convert Polygons to Lines"	""
 "Convert Table to Points"	""
 "Convert To Table"	""
+"Convert Vertex Type (2D/3D)"	""
 "Convert a shapes layer to a TIN\n\n"	""
 "Convert routes"	""
 "Convert track points"	""
@@ -890,6 +958,8 @@ TEXT	TRANSLATION
 "Coordenada X del punto de ignici�n (s�lo si no se usa grid de puntos de ignici�n)"	""
 "Coordenada Y"	""
 "Coordenada Y del punto de ignici�n (s�lo si no se usa grid de puntos de ignici�n)"	""
+"Coordinate Reference System Picker"	""
+"Coordinate System"	""
 "Coordinate Transformation (Grid List)"	""
 "Coordinate Transformation (Grid)"	""
 "Coordinate Transformation (Shapes List)"	""
@@ -912,9 +982,7 @@ TEXT	TRANSLATION
 "Copyrights (c) 2003 by Andre Ringeler"	""
 "Copyrights (c) 2003 by Olaf Conrad"	""
 "Copyrights (c) 2003 by Volker Wichmann"	""
-"Copyrights (c) 2004 by Thomas Wutzler"	""
 "Copyrights (c) 2004 by Victor Olaya"	""
-"Copyrights (c) 2005 by Victor Olaya"	""
 "Copyrights (c) 2005 by Volker Wichmann"	""
 "Copyrights (c) 2006 by Victor Olaya"	""
 "Copyrights (c) 2006 by Volker Wichmann"	""
@@ -952,7 +1020,6 @@ TEXT	TRANSLATION
 "Create Grid System"	""
 "Create KML File"	""
 "Create Lookup Table"	""
-"Create Module Description Files"	""
 "Create New Shapes Layer"	""
 "Create New Table"	""
 "Create Normalised Classification"	""
@@ -965,9 +1032,13 @@ TEXT	TRANSLATION
 "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"	""
+"Create a binary mask Yes/No"	""
 "Create borders between segments as new grid."	""
 "Create index"	""
 "Create new Attribute"	""
@@ -1008,7 +1079,6 @@ TEXT	TRANSLATION
 "Cut"	""
 "Cut Shapes Layer"	""
 "Cuts"	""
-"Cutting"	""
 "Cycles"	""
 "Cylindrical Equal Area"	""
 "D"	""
@@ -1101,6 +1171,8 @@ TEXT	TRANSLATION
 "Decrease Eye Distance"	""
 "Decrease Legend Size"	""
 "Decrease Perspectivic Distance [F5]"	""
+"Decrease Size Scaling Factor [F7]"	""
+"Decrease Size [F5]"	""
 "Decrease factor"	""
 "Decrease factor n_minus. Must be < 1."	""
 "Deepen Drainage Routes"	""
@@ -1109,15 +1181,18 @@ TEXT	TRANSLATION
 "Default Rotation"	""
 "Default Size"	""
 "Defaults"	""
+"Defaults for New Maps"	""
 "Define AOI by ..."	""
 "Define Georeference for Grids"	""
 "Definition"	""
 "Degree"	""
 "Delete"	""
 "Delete All Positions"	""
+"Delete All Positions [Ctrl + X]"	""
 "Delete All Records"	""
 "Delete Fields"	""
 "Delete History Entries"	""
+"Delete Last Position [Ctrl + D]"	""
 "Delete Last Position [D]"	""
 "Delete Selected Part"	""
 "Delete Selected Point"	""
@@ -1173,9 +1248,10 @@ TEXT	TRANSLATION
 "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)"	""
+"Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply changes."	""
 "Difference"	""
 "Difference (A - B)"	""
+"Difference Input - Reconstruction"	""
 "Difference Vegetation Index"	""
 "Difference from Arithmetic Mean"	""
 "Difference from Mean Value"	""
@@ -1188,8 +1264,10 @@ TEXT	TRANSLATION
 "Digital Terrain Model"	""
 "Digital elevation model"	""
 "Dilation"	""
+"Dim"	""
 "Dim Colours"	""
 "Dim Range"	""
+"Dip slope"	""
 "Direcci�n del viento"	""
 "Direcci�n del viento (grados desde el norte en sentido antihorario)"	""
 "Direcci�n del viento (grados desde el norte)"	""
@@ -1216,7 +1294,6 @@ TEXT	TRANSLATION
 "Displacement Vector"	""
 "Displacement vectors between correlated points"	""
 "Display"	""
-"Display Range"	""
 "Display Resolution"	""
 "Display Type"	""
 "Dissolve Buffers"	""
@@ -1227,15 +1304,16 @@ TEXT	TRANSLATION
 "Dissolved Polygons"	""
 "Dist."	""
 "Distance"	""
+"Distance (ViGrA)"	""
 "Distance Grid"	""
-"Distance Matrix"	""
-"Distance Matrix Table"	""
 "Distance Overland"	""
+"Distance Range"	""
 "Distance Threshold"	""
 "Distance Weighted (inverse distance)"	""
 "Distance Weighting"	""
 "Distance Weighting Exponent"	""
 "Distance between points (grid units)."	""
+"Distances"	""
 "Distinct"	""
 "Diurnal Anisotropic Heating"	""
 "Divergence"	""
@@ -1249,21 +1327,30 @@ TEXT	TRANSLATION
 "Do you really want to delete the table"	""
 "Do you want to delete the selection?"	""
 "Do you want to exit SAGA?"	""
+"Do you wish to estimate Principal Point Offsets?"	""
+"Do you wish to provide the Radial Distortion Parameters?"	""
+"Do you wish to provide the time stamp of Image?"	""
 "Dominance"	""
 "Dot And Dash"	""
 "Dot and dash style"	""
 "Dotted"	""
 "Dotted style"	""
 "Down"	""
-"Down sort"	""
+"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."	""
 "Downslope Area"	""
 "Downslope Basins"	""
 "Downslope Distance Gradient"	""
 "Drainage Basins"	""
 "Drainage Network"	""
 "Drape Map"	""
+"Draw Box"	""
+"Draw Faces"	""
+"Draw Nodes"	""
 "Draw Style"	""
+"Draw Wire"	""
 "Draw a section each n points"	""
 "Driver"	""
 "Driver does not support file creation."	""
@@ -1298,6 +1385,7 @@ TEXT	TRANSLATION
 "Eckert IV/VI"	""
 "Edge"	""
 "Edge Contamination"	""
+"Edge Detection (ViGrA)"	""
 "Edge threshold for nonlinear smoothing"	""
 "Edges"	""
 "Edit"	""
@@ -1323,9 +1411,13 @@ TEXT	TRANSLATION
 "Elevation [m]"	""
 "Elevation at Reference Station [m]"	""
 "Elevation grid"	""
+"Elevation range (zMax (%.2f) - zMin (%.2f)) is equal or lower than zero!"	""
 "Ellipsoid Definition"	""
 "Ellipsoid Height [m]"	""
 "Ellipsoids"	""
+"Encountered invalid path description in *.spcvf file!"	""
+"End Latitude"	""
+"End Longitude"	""
 "Enforce True Color"	""
 "Enhanced Vegetation Index"	""
 "Entropy"	""
@@ -1352,6 +1444,7 @@ TEXT	TRANSLATION
 "Error parsing field type: can't convert to number"	""
 "Error: Continue anyway ?"	""
 "Errors"	""
+"Estimate Principal Point Offsets?"	""
 "Estimated Noise (absolute)"	""
 "Estimated Noise (relative)"	""
 "Estimated noise in units of input data"	""
@@ -1360,19 +1453,23 @@ TEXT	TRANSLATION
 "Euclidean"	""
 "Evapotranspiration"	""
 "Evapotranspiration [m / dt]"	""
+"Exact"	""
 "Exaggeration"	""
 "Exaggeration Factor"	""
+"Exaggeration Z"	""
 "Exclude No-Data Area"	""
 "Exclude NoData Cells"	""
 "Execute"	""
-"Execute Module"	""
 "Execute SQL"	""
-"Executing module"	""
+"Execute Tool"	""
+"Executing tool"	""
 "Execution"	""
 "Execution has been stopped by user!"	""
 "Exit"	""
 "Exit SAGA"	""
 "Expand"	""
+"Expand and Shrink"	""
+"Expansion Degree"	""
 "Exponent"	""
 "Exponent for distance weighting (0.0-4.0)"	""
 "Exponential Model"	""
@@ -1381,6 +1478,7 @@ TEXT	TRANSLATION
 "Export ESRI Arc/Info Grid"	""
 "Export GPX"	""
 "Export GStat Shapes"	""
+"Export Grid to KML"	""
 "Export Grid to XYZ"	""
 "Export Image (bmp, jpg, pcx, png, tif)"	""
 "Export LAS Files"	""
@@ -1401,6 +1499,7 @@ TEXT	TRANSLATION
 "Export WRF Geogrid Binary Format"	""
 "Export descriptions"	""
 "Export names"	""
+"Export to File"	""
 "Export z values"	""
 "Expression"	""
 "Extended Neighourhood"	""
@@ -1408,6 +1507,7 @@ TEXT	TRANSLATION
 "Extent [Cut]"	""
 "Extent to CellSize"	""
 "Extents"	""
+"Exterior Orientation Parameters"	""
 "Extraction of..."	""
 "Extreme"	""
 "Eye Distance"	""
@@ -1416,9 +1516,16 @@ TEXT	TRANSLATION
 "FACE_A"	""
 "FACE_B"	""
 "FLOW"	""
+"FS 1-1.5"	""
+"FS 1.5-3"	""
+"FS 3-6"	""
+"FS <1"	""
+"FS >6"	""
+"Faces"	""
 "Factor"	""
 "Fade Color Count"	""
 "Fahrenheit to Celsius"	""
+"Failure"	""
 "False Easting"	""
 "False Easting [m]"	""
 "False Northing"	""
@@ -1427,10 +1534,12 @@ TEXT	TRANSLATION
 "Fast Representativeness"	""
 "Feature"	""
 "Feature Aggregation"	""
+"Feature Probabilities"	""
 "Feature Space Options"	""
 "Features"	""
 "Features Grid"	""
 "Features are all pixels different not representing no-data."	""
+"Features per Node"	""
 "February"	""
 "Feigenbaum's Bifurcation"	""
 "Ferhat Bing�l (c) 2009"	""
@@ -1450,22 +1559,30 @@ TEXT	TRANSLATION
 "Field data type"	""
 "Field for Summary"	""
 "Field with identifier."	""
+"Field with measure information."	""
 "Field with x-coordinate."	""
 "Field with y-coordinate."	""
+"Field with z-coordinate information."	""
 "Field with z-coordinate."	""
 "Fields"	""
+"Fields Visited"	""
 "Fields for diagram"	""
 "Figure"	""
 "File"	""
 "File Cache"	""
 "File Cache [MB]"	""
+"File Caching"	""
 "File Name"	""
+"File Paths"	""
 "File System"	""
 "File contains headline"	""
 "File does not exist:"	""
 "File error"	""
 "File path"	""
 "File signature is not 'LASF'!"	""
+"File with Coefficients"	""
+"Filename"	""
+"Filepath"	""
 "Files"	""
 "File|ESRI E00"	""
 "File|GDAL/OGR"	""
@@ -1475,6 +1592,7 @@ TEXT	TRANSLATION
 "File|Shapes"	""
 "File|Table"	""
 "File|Tables"	""
+"File|Virtual"	""
 "Fill Color"	""
 "Fill Gaps in Records"	""
 "Fill NoData"	""
@@ -1490,10 +1608,14 @@ TEXT	TRANSLATION
 "Filter Clumps"	""
 "Filter Criterion"	""
 "Filter Matrix"	""
+"Filter Size (Radius)"	""
+"Filter size (radius in grid cells)"	""
 "Filtered"	""
 "Filtered DTM"	""
 "Filtered Grid"	""
+"Filtered Image"	""
 "Filtered Points"	""
+"Filtered mask will be created automatically ..."	""
 "Final Parameters"	""
 "Final State"	""
 "Final aspect-slope grid."	""
@@ -1502,6 +1624,7 @@ TEXT	TRANSLATION
 "Find Field of Extreme Value"	""
 "Find Outlets"	""
 "Find Pits"	""
+"Find and Run Tool"	""
 "Fire Length"	""
 "Fire Length (min)"	""
 "Fire Risk Analysis"	""
@@ -1510,6 +1633,7 @@ TEXT	TRANSLATION
 "First input grid"	""
 "Fit"	""
 "Fit Color Palette to Grid Values"	""
+"Fit Colors"	""
 "Fit Colours Dialog"	""
 "Fit Colours to Minimum/Maximum"	""
 "Fit Colours to Standard Deviation"	""
@@ -1525,6 +1649,7 @@ TEXT	TRANSLATION
 "Fit to Cells"	""
 "Fit to Standard Deviation"	""
 "Fitting range"	""
+"Fixed Interval (Degree)"	""
 "Fixed Maximum"	""
 "Fixed Minimum"	""
 "Fixed Time Span (minutes)"	""
@@ -1538,6 +1663,7 @@ TEXT	TRANSLATION
 "Flat Areas"	""
 "Flat Detection"	""
 "Flats"	""
+"Flatten Polygon Layer"	""
 "Flattening"	""
 "Flattening (f)"	""
 "Flip"	""
@@ -1566,16 +1692,22 @@ TEXT	TRANSLATION
 "Flow Routing Algorithm"	""
 "Flow Sinuosity"	""
 "Flow Split Method"	""
+"Flow Threshold"	""
+"Flow Travel Time"	""
 "Flow Width"	""
 "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."	""
 "Flux"	""
 "Flux out of each cell, i.e. everything accumulated so far."	""
 "Flying Height"	""
+"Focal Length (mm)"	""
 "Focal Length [mm]"	""
+"Focal Length in mm"	""
 "Folder"	""
 "Folder for PDF Files"	""
 "Font"	""
+"Font size given as percentage of map size."	""
 "Foot Hollow"	""
 "Foot Slope"	""
 "Foot Spur"	""
@@ -1583,8 +1715,14 @@ TEXT	TRANSLATION
 "Formula"	""
 "Forward"	""
 "Forward Diagonal"	""
+"Forward [Page Up]"	""
 "Forward diagonal hatch"	""
+"Fourier Filter (ViGrA)"	""
+"Fourier Transform (Real, ViGrA)"	""
+"Fourier Transform (ViGrA)"	""
+"Fourier Transform Inverse (ViGrA)"	""
 "Fourier Transformation (Imaginary)"	""
+"Fourier Transformation (OpenCV)"	""
 "Fourier Transformation (Real)"	""
 "Fractal Dimension"	""
 "Fractal Dimension of Grid Surface"	""
@@ -1596,6 +1734,7 @@ TEXT	TRANSLATION
 "Fragmentation Classes from Density and Connectivity"	""
 "Fragmentation Index"	""
 "Frame"	""
+"Frame Coordinates"	""
 "Frame Size"	""
 "Frame Width"	""
 "Frame Width [Pixels]"	""
@@ -1649,15 +1788,15 @@ TEXT	TRANSLATION
 "Game Level"	""
 "Games"	""
 "Gamma"	""
-"Garden - 3D Shapes Viewer"	""
+"Garden - 3D Viewer"	""
 "Garden - Fractals"	""
 "Garden - Games"	""
 "Garden - Introducing Module Programming"	""
 "Garden - Web Service Data Access"	""
+"Garden|3D Viewer"	""
 "Garden|Introducing Module Programming"	""
 "Garden|Recreations|Fractals"	""
 "Garden|Recreations|Games"	""
-"Garden|Visualisation"	""
 "Garden|Web Service Data Access"	""
 "Gauges"	""
 "Gaussian"	""
@@ -1679,6 +1818,7 @@ TEXT	TRANSLATION
 "GeoTrans (Grid)"	""
 "GeoTrans (Shapes)"	""
 "Geocentric Coordinate System"	""
+"Geodesic Morphological Reconstruction"	""
 "Geodetic"	""
 "Geographic Coordinate System"	""
 "Geographic Coordinate Systems"	""
@@ -1688,16 +1828,20 @@ TEXT	TRANSLATION
 "Geographically Weighted Regression (Points/Grid)"	""
 "Geoid"	""
 "Geometric Figures"	""
+"Geometry Type"	""
+"Geoprocessing"	""
 "Get CRS Definition from..."	""
 "Get Class Statistics from..."	""
 "Get Extent for ..."	""
 "Get Heights from ..."	""
 "Get Independent Variable from ..."	""
 "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"	""
 "Gradient"	""
@@ -1710,7 +1854,9 @@ TEXT	TRANSLATION
 "Gradient Vectors from Directional Components"	""
 "Gradient Vectors from Surface"	""
 "Gradient threshold"	""
+"Graduated"	""
 "Graduated Colors"	""
+"Graduated Colours"	""
 "Graticule"	""
 "Greater than"	""
 "Green"	""
@@ -1731,10 +1877,9 @@ TEXT	TRANSLATION
 "Grid 2"	""
 "Grid Buffer"	""
 "Grid Calculator"	""
+"Grid Cell Index"	""
 "Grid Difference"	""
-"Grid Display Defaults"	""
 "Grid Division"	""
-"Grid File Caching"	""
 "Grid Interpolation"	""
 "Grid Manager"	""
 "Grid Masking"	""
@@ -1744,7 +1889,6 @@ TEXT	TRANSLATION
 "Grid Orientation"	""
 "Grid Project"	""
 "Grid Proximity Buffer"	""
-"Grid Shrink/Expand"	""
 "Grid Size"	""
 "Grid Skeletonization"	""
 "Grid Spacing (Map Units)"	""
@@ -1763,6 +1907,7 @@ TEXT	TRANSLATION
 "Grid Volume"	""
 "Grid based or related calculations."	""
 "Grid defining the zones to analyse. This grid also acts as a mask. Coding: NoData / categorial values."	""
+"Grid describing the AOI."	""
 "Grid describing the state of each cell at timestep t + 1."	""
 "Grid describing the state of each cell at timestep t."	""
 "Grid file could not be opened."	""
@@ -1773,6 +1918,7 @@ TEXT	TRANSLATION
 "Grid system"	""
 "Grid to TIN"	""
 "Grid to TIN (Surface Specific Points)"	""
+"Grid to be filtered"	""
 "Grid to filter"	""
 "Grid to reclassify"	""
 "Grid value equals low value"	""
@@ -1813,6 +1959,7 @@ TEXT	TRANSLATION
 "Height"	""
 "Height (Cells)"	""
 "Height Threshold"	""
+"Height given as percentage of map size"	""
 "Height of Atmosphere [m]"	""
 "Height of Atmosphere and Vapour Pressure"	""
 "Height of the light source above ground."	""
@@ -1845,12 +1992,14 @@ TEXT	TRANSLATION
 "Horizontal"	""
 "Horizontal Align"	""
 "Horizontal Interpolation Method"	""
+"Horizontal Offset"	""
 "Horizontal Overland Flow Distance"	""
 "Horizontal Range"	""
 "Horizontal hatch"	""
 "Horizontally mirrored"	""
 "Host"	""
 "Hourly Data"	""
+"How many trees to create?"	""
 "Html Extra Info"	""
 "Hull Construction"	""
 "Humedad del combustible herb�ceo vivo"	""
@@ -1901,11 +2050,11 @@ TEXT	TRANSLATION
 "If grid is not set, a new one will be created using chosen width and height."	""
 "If not set points will be removed from the input data set."	""
 "If not set property attributes will be added to the orignal layer."	""
+"If set, output is given about the number of fields a flow path visits downhill. For D8 only."	""
 "If table exists..."	""
 "Ignition Points"	""
 "Ignore Defaults"	""
 "Ignore Lakes"	""
-"Ignores specified attribute ('Save Attribute') and saves all attributes."	""
 "Illumination calculation"	""
 "Image"	""
 "Image (Blue Channel)"	""
@@ -1926,12 +2075,14 @@ TEXT	TRANSLATION
 "Imagery - Classification"	""
 "Imagery - Fast Region Growing Algorithm"	""
 "Imagery - OpenCV"	""
+"Imagery - Photogrammetry"	""
 "Imagery - SVM"	""
 "Imagery - Segmentation"	""
 "Imagery - Tools"	""
 "Imagery - ViGrA"	""
 "Imagery|Classification"	""
 "Imagery|OpenCV"	""
+"Imagery|Photogrammetry"	""
 "Imagery|Segmentation"	""
 "Imagery|Tools"	""
 "Imagery|ViGrA"	""
@@ -1980,6 +2131,7 @@ TEXT	TRANSLATION
 "Import WRF Geogrid Binary Format"	""
 "Import a Map via Web Map Service (WMS)"	""
 "Import and export filter for ESRI's E00 file exchange format."	""
+"Import from File"	""
 "Import from Open Street Map"	""
 "Import/Export - DXF"	""
 "Import/Export - ESRI E00"	""
@@ -1993,10 +2145,12 @@ TEXT	TRANSLATION
 "Import/Export - Shapes"	""
 "Import/Export - Tables"	""
 "Import/Export - Tables using MySQL native driver"	""
+"Import/Export - Virtual"	""
 "Importing"	""
 "Importing data ..."	""
 "In this section you can define the topology of the neural network."	""
 "In/Out"	""
+"Include Center Cell"	""
 "Include Planetery Bending"	""
 "Include X Coordinate"	""
 "Include Y Coordinate"	""
@@ -2007,12 +2161,15 @@ TEXT	TRANSLATION
 "Increase Eye Distance"	""
 "Increase Legend Size"	""
 "Increase Perspectivic Distance [F6]"	""
+"Increase Size Scaling Factor [F8]"	""
+"Increase Size [F6]"	""
 "Increase factor"	""
 "Increase factor n_plus. Must be > 1."	""
 "Independent Variable (per Grid and Cell)"	""
 "Independent Variable (per Grid)"	""
 "Independent Variables"	""
 "Index"	""
+"Indicatrix"	""
 "Indices"	""
 "Infiltration excess runoff [m/dt]"	""
 "Infiltration rate [m/dt]"	""
@@ -2041,7 +2198,7 @@ TEXT	TRANSLATION
 "Initiation Type"	""
 "Inner Buffer"	""
 "Input"	""
-"Input Data"	""
+"Input Binary Grid"	""
 "Input Features"	""
 "Input File's NoData Value"	""
 "Input Files"	""
@@ -2055,9 +2212,13 @@ TEXT	TRANSLATION
 "Input data to train the network."	""
 "Input file"	""
 "Input for module calculations."	""
+"Input for the morphological reconstruction"	""
 "Input format"	""
 "Input grid"	""
 "Input grids to train the network."	""
+"Input point shapefile"	""
+"Input polygon shapefile"	""
+"Input shape is empty!"	""
 "Input table is empty!"	""
 "Insert"	""
 "Insert Additional Points"	""
@@ -2073,15 +2234,17 @@ TEXT	TRANSLATION
 "Intensidad (Kcal/m)"	""
 "Intensity"	""
 "Intensity (Kcal/m)"	""
-"Interactive module execution failed"	""
-"Interactive module execution has been started"	""
-"Interactive module execution has been stopped"	""
+"Interactive tool execution failed"	""
+"Interactive tool execution has been started"	""
+"Interactive tool execution has been stopped"	""
 "Interactive version (left mouse clicks will trigger the calculation for the selected cell)."	""
 "Intercept"	""
 "Intercept of Soil Line"	""
 "Interface to Frank Warmerdam's Geospatial Data Abstraction Library (GDAL)."	""
 "Interflow"	""
 "Interior"	""
+"Interior Orientation Parameters"	""
+"Internal Orientation Parameters"	""
 "Internal subcatchment routing velocity [m/h]"	""
 "Interpolated"	""
 "Interpolated Colors"	""
@@ -2119,7 +2282,6 @@ TEXT	TRANSLATION
 "Is the subbasin upstream (no external inflow)"	""
 "Isochrones Constant Speed"	""
 "Isochrones Variable Speed"	""
-"Item"	""
 "Iteration"	""
 "Iterationen"	""
 "Iterations"	""
@@ -2144,8 +2306,12 @@ TEXT	TRANSLATION
 "Junction"	""
 "Junctions"	""
 "June"	""
+"K1"	""
+"K2"	""
+"K3"	""
 "KE"	""
 "KML files (*.kml)"	""
+"Kappa"	""
 "Kappa Offset [degree]"	""
 "Kappa [degree]"	""
 "Kartoffeln"	""
@@ -2170,13 +2336,13 @@ TEXT	TRANSLATION
 "LAS header exception: %s"	""
 "LAS reader exception: %s"	""
 "LFAC("	""
-"LNG_FILE_DIC"	""
 "LP, Saturated lateral permeability of the soil [m/day]"	""
 "LS"	""
 "LS Calculation"	""
 "LS Factor"	""
 "LS-Factor"	""
 "Label"	""
+"Label Field"	""
 "Labels"	""
 "Lag Classes"	""
 "Lag Distance"	""
@@ -2216,6 +2382,7 @@ TEXT	TRANSLATION
 "Lat. of True Scale"	""
 "Latitude"	""
 "Latitude (user defined reference)"	""
+"Latitude / Longitude Increment"	""
 "Latitude 1"	""
 "Latitude 2"	""
 "Latitude 3"	""
@@ -2225,12 +2392,12 @@ TEXT	TRANSLATION
 "Latitude [Degree]"	""
 "Latitude [degree]"	""
 "Latitude relates to grid's..."	""
+"Latitude/Longitude Graticule"	""
 "Latitudinal Statistics"	""
 "Layer A"	""
 "Layer B"	""
 "Layer of extreme value"	""
 "Layers"	""
-"Layers to merge with main layer"	""
 "Layout"	""
 "Leading zeros for data set numbering. Set to -1 for not using numbers at all."	""
 "Leaf Area Index"	""
@@ -2250,12 +2417,11 @@ TEXT	TRANSLATION
 "Left"	""
 "Left Border (X)"	""
 "Left Half"	""
+"Left [/]"	""
 "Left [F3]"	""
+"Left [Ins]"	""
 "Left/Right"	""
 "Legend"	""
-"Legend Border Colour"	""
-"Legend Frame Width"	""
-"Legend Scale"	""
 "Legend: Save"	""
 "Legend: Zoom"	""
 "Length"	""
@@ -2275,6 +2441,8 @@ TEXT	TRANSLATION
 "Life Cycles"	""
 "Light Source A"	""
 "Light Source B"	""
+"Light Source Direction"	""
+"Light Source Height"	""
 "Lighting and visibility calculations for digital terrain models."	""
 "Line"	""
 "Line Color"	""
@@ -2309,14 +2477,15 @@ TEXT	TRANSLATION
 "List Table Fields"	""
 "List Tables"	""
 "List of Grids"	""
+"List of Measured Points as PC"	""
 "List of Shapes Layers"	""
+"Listing"	""
 "Litter to Humus"	""
 "Litterfall Rate [g/m\xb2/a]"	""
 "Little Endian (Intel)"	""
 "Load"	""
 "Load Colors"	""
 "Load Grid"	""
-"Load Module Library"	""
 "Load Parameters"	""
 "Load Point Cloud"	""
 "Load Project"	""
@@ -2325,6 +2494,7 @@ TEXT	TRANSLATION
 "Load TIN"	""
 "Load Table"	""
 "Load Text"	""
+"Load Tool Library"	""
 "Load all bands"	""
 "Load grid"	""
 "Load library"	""
@@ -2382,11 +2552,13 @@ TEXT	TRANSLATION
 "Lookup table used in method \"table\""	""
 "Lookup table used in method \"user supplied table\""	""
 "Lookup table."	""
+"Loop"	""
 "Lotsa"	""
 "Low Pass"	""
 "Low Pass Filter"	""
 "Low Resolution Grid System"	""
 "Low Value"	""
+"Low moisture (WI <= 0.1"	""
 "Low value < grid value < high value"	""
 "Low value <= grid value < high value"	""
 "Low variation for low sizes"	""
@@ -2394,10 +2566,8 @@ TEXT	TRANSLATION
 "Low-pass 2"	""
 "Lower"	""
 "Lower Border (Y)"	""
-"Lower Limit of real data"	""
 "Lower Tolerance"	""
 "Lower left corner"	""
-"LowerLimit"	""
 "Lumped Atmospheric Transmittance"	""
 "Lumped Atmospheric Transmittance [Percent]"	""
 "Luv Factor"	""
@@ -2422,9 +2592,8 @@ TEXT	TRANSLATION
 "MSL Height [m]"	""
 "Maehweide"	""
 "Mahalanobis Distance"	""
+"Main"	""
 "Main Basin ID"	""
-"Main Layer"	""
-"Main Layer. Output layer will have the same field in the attributes table as this layer"	""
 "Main Point Cloud"	""
 "Main Radius"	""
 "Main channel routing velocity [m/h]"	""
@@ -2438,7 +2607,10 @@ TEXT	TRANSLATION
 "Manhattan"	""
 "Manning's N"	""
 "Manning's Roughness"	""
+"Manning-Strickler Coefficient"	""
+"Manning-Strickler coefficient for flow travel time estimation (reciprocal of Manning's Roughness Coefficient)"	""
 "Map"	""
+"Map Draping"	""
 "Map Draping Interpolation"	""
 "Map Extent"	""
 "Map File"	""
@@ -2461,6 +2633,8 @@ TEXT	TRANSLATION
 "Masked Grid"	""
 "Mass Balance Index"	""
 "Massivity Coefficient"	""
+"Match"	""
+"Match Fields by Name"	""
 "Material"	""
 "Matrix signular\n"	""
 "Max"	""
@@ -2496,6 +2670,7 @@ TEXT	TRANSLATION
 "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 Time Span (Seconds)"	""
@@ -2509,6 +2684,7 @@ TEXT	TRANSLATION
 "Maximum number of classes in the entire grid."	""
 "Maximum number of grid cells used for trend analysis as required by C correction."	""
 "Maximum number of iterations"	""
+"Maximum number of rows/columns in selection of grid cells."	""
 "Maximum resolution as percentage of the diameter of the DEM."	""
 "Maximum root zone storage deficit [m]"	""
 "Maximum size"	""
@@ -2534,6 +2710,7 @@ TEXT	TRANSLATION
 "Mean soil loss"	""
 "Mean temperature"	""
 "Measure Distance"	""
+"Measured Points (PC)"	""
 "Median"	""
 "Melton Ruggedness Number"	""
 "Membership Function Type"	""
@@ -2543,10 +2720,14 @@ TEXT	TRANSLATION
 "Memory Size"	""
 "Menu"	""
 "Mercator"	""
+"Merge Layers"	""
 "Merge Point Clouds"	""
-"Merge Shapes Layers"	""
+"Merge Selection"	""
+"Merge Tables"	""
 "Merged Layer"	""
+"Merged Layers"	""
 "Merged Point Cloud"	""
+"Merged Table"	""
 "Meridional Grid Statistics"	""
 "Meridional Statistics"	""
 "Mesh Denoise"	""
@@ -2575,9 +2756,6 @@ TEXT	TRANSLATION
 "Min. Size"	""
 "Min. Size (Cells)"	""
 "Min./Max. Number of m_Points"	""
-"MinDist"	""
-"MinDist Region"	""
-"MinDistDir"	""
 "Mine Sweeper"	""
 "Minima"	""
 "Minimal Curvature"	""
@@ -2594,15 +2772,21 @@ TEXT	TRANSLATION
 "Minimum Height"	""
 "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 Resolution (Degree)"	""
 "Minimum Segment Length (Cells)"	""
 "Minimum Size [%]"	""
 "Minimum Slope"	""
 "Minimum Slope [Degree]"	""
 "Minimum Standard Deviation"	""
 "Minimum Temperature"	""
+"Minimum Threshold"	""
 "Minimum Value"	""
+"Minimum and maximum x-coordinate of AOI."	""
+"Minimum and maximum y-coordinate of AOI."	""
+"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 shade brightness must be lower than maximum shade brightness!"	""
@@ -2641,17 +2825,8 @@ TEXT	TRANSLATION
 "Modified Catchment Area"	""
 "Modify: post-processing..."	""
 "Modify: pre-processing..."	""
-"Module"	""
-"Module Description Source"	""
-"Module Execution"	""
-"Module Libraries"	""
-"Module Library"	""
 "Module Library Template"	""
-"Module Manager"	""
 "Module My_Module"	""
-"Module execution failed"	""
-"Module execution succeeded"	""
-"Modules"	""
 "Modules for GPS data handling."	""
 "Mollweide"	""
 "Moment [h]"	""
@@ -2663,6 +2838,9 @@ TEXT	TRANSLATION
 "Moore et al. 1991"	""
 "Moran's I"	""
 "Morphological Filter"	""
+"Morphological Filter (OpenCV)"	""
+"Morphological Filter (ViGrA)"	""
+"Morphologically filtered binary mask"	""
 "Morphometric Features"	""
 "Morphometric Protection Index"	""
 "Mosaic"	""
@@ -2682,12 +2860,12 @@ TEXT	TRANSLATION
 "Multi Level to Surface Interpolation"	""
 "Multi Scale Factor"	""
 "Multi-Band Variation"	""
-"Multi-Grid 3D Viewer"	""
 "Multilevel B-Spline Interpolation"	""
 "Multilevel B-Spline Interpolation (from Grid)"	""
 "Multiple Flow Direction"	""
 "Multiple Flow Direction (FD8)"	""
 "Multiple Flow Direction (Quinn et al. 1991)"	""
+"Multiple Grids Viewer"	""
 "Multiple Input Features"	""
 "Multiple Linear Regression Analysis"	""
 "Multiple Linear Regression Analysis (Shapes)"	""
@@ -2707,6 +2885,7 @@ TEXT	TRANSLATION
 "NCELLS"	""
 "NEIGHBORS"	""
 "NEON"	""
+"NO DATA"	""
 "NODATA_CELLS"	""
 "NODE_A"	""
 "NODE_B"	""
@@ -2726,6 +2905,7 @@ TEXT	TRANSLATION
 "Navaladi, Schoeller, Conrad (c) 2009"	""
 "Near Infrared (TM 4)"	""
 "Near Infrared Reflectance"	""
+"Near Points"	""
 "Nearest Neigbhor"	""
 "Nearest Neighbor"	""
 "Nearest Neighbour"	""
@@ -2739,9 +2919,10 @@ TEXT	TRANSLATION
 "NetCDF Files (*.nc)"	""
 "Network topology"	""
 "Neumann"	""
+"Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	""
+"Neural Networks (OpenCV)"	""
 "New"	""
 "New Grid Dimensions"	""
-"New Project"	""
 "New Shapes Layer"	""
 "New Table"	""
 "New Value"	""
@@ -2764,13 +2945,15 @@ TEXT	TRANSLATION
 "No Data"	""
 "No Data Cells"	""
 "No Data Value"	""
+"No Failure"	""
 "No Flats"	""
 "No Height"	""
 "No INPUT vector normalization"	""
 "No ODBC connection available!"	""
 "No OUTPUT vector normalization"	""
 "No PostgreSQL connection available!"	""
-"No attributes in selection."	""
+"No attribute fields specified!"	""
+"No data"	""
 "No data loaded."	""
 "No description available"	""
 "No duplicates found."	""
@@ -2782,16 +2965,18 @@ TEXT	TRANSLATION
 "No shapes in selection"	""
 "No sinks have been detected."	""
 "No translation set by user"	""
+"NoData Output Grid"	""
 "NoData Value"	""
 "NoData encountered in input grid %s: x %d (%.2f), y %d (%.2f)"	""
+"NoData value of input grid"	""
 "NoData value(s) in statistic grid(s)!"	""
-"NoDataValue"	""
 "Node"	""
 "Nodes"	""
 "Non-Linear Module"	""
 "None"	""
 "Normal"	""
 "Normal Updating"	""
+"Normal escarpment"	""
 "Normalisation"	""
 "Normalise"	""
 "Normalised"	""
@@ -2802,17 +2987,21 @@ TEXT	TRANSLATION
 "Normalized Height"	""
 "Normalized Ratio Vegetation Index"	""
 "North"	""
+"North Arrow"	""
 "North []"	""
 "North|South|"	""
 "Not Null"	""
 "Not a valid PostGIS database!"	""
 "Nothing to do be done. Raster splitting is not supported."	""
+"Nothing to do! Merging needs more than one input data set."	""
 "Nothing to do. Raster is already within target range."	""
 "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]"	""
@@ -2833,6 +3022,7 @@ TEXT	TRANSLATION
 "Number of Fields"	""
 "Number of Grid Cells"	""
 "Number of Grids"	""
+"Number of Intervals"	""
 "Number of Iterations for Normal Updating"	""
 "Number of Iterations for Vertex Updating"	""
 "Number of No-Data Cells"	""
@@ -2858,6 +3048,9 @@ TEXT	TRANSLATION
 "Number of classes in the cloud temperature histogram"	""
 "Number of clusters"	""
 "Number of decimals when writing floating point values in ASCII format."	""
+"Number of discrete intervals (bins) used for sampling"	""
+"Number of examples required for a node to be split. Choose 1 for complete growing."	""
+"Number of fields a flow path visits downhill starting at a cell. For D8 only."	""
 "Number of fields and precisions must be equal!"	""
 "Number of horizontal tiles"	""
 "Number of iterations, starts with search radius and increments with one cell by iteration."	""
@@ -2899,7 +3092,7 @@ TEXT	TRANSLATION
 "OUTPUT"	""
 "OUTPUT certainty"	""
 "OUTPUT classes"	""
-"Object Properties"	""
+"Object Grid"	""
 "Objective Function"	""
 "Objects removed from input grid"	""
 "Oblique Mercator"	""
@@ -2913,10 +3106,13 @@ TEXT	TRANSLATION
 "Offset Z"	""
 "Offset and Range (X)"	""
 "Offset and Range (Y)"	""
+"Offset given as percentage of map size"	""
 "Ok"	""
 "Okay"	""
+"Old Style Namings"	""
 "Old Version"	""
 "Olkin & Pratt"	""
+"Omega"	""
 "Omega [degree]"	""
 "One per x"	""
 "Online Help"	""
@@ -2929,10 +3125,6 @@ TEXT	TRANSLATION
 "Open"	""
 "Open Database Connection"	""
 "Open Slopes"	""
-"OpenCV - Basic Morphological Operations"	""
-"OpenCV - Fourier Transformation"	""
-"OpenCV - Single Value Decomposition"	""
-"OpenCV Neural Networks"	""
 "Opening"	""
 "Operation"	""
 "Operation Control"	""
@@ -2941,9 +3133,8 @@ TEXT	TRANSLATION
 "Opposite Neighbours"	""
 "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"	""
 "Options"	""
-"Options for Data Thumbnails"	""
-"Options for Map Thumbnails"	""
 "Options:\n - Less than\n - Equals\n - Greater than\nControls under which condition a channel is initiated."	""
 "Order"	""
 "Order by"	""
@@ -2958,6 +3149,7 @@ TEXT	TRANSLATION
 "Original Channels"	""
 "Original Image"	""
 "Orographic Coefficient"	""
+"Orthoclinal slope"	""
 "Orthographic"	""
 "Ouput"	""
 "Outlet"	""
@@ -2965,9 +3157,8 @@ TEXT	TRANSLATION
 "Outlet X"	""
 "Outlet Y"	""
 "Outline"	""
+"Outlines"	""
 "Output"	""
-"Output (imaginary)"	""
-"Output (real)"	""
 "Output Directory"	""
 "Output Features"	""
 "Output Field Name"	""
@@ -2976,6 +3167,7 @@ TEXT	TRANSLATION
 "Output Grid"	""
 "Output Lod"	""
 "Output Seeds"	""
+"Output Text File"	""
 "Output Type"	""
 "Output Unit"	""
 "Output Values"	""
@@ -2990,9 +3182,13 @@ TEXT	TRANSLATION
 "Output of Regression Parameters"	""
 "Output of module calculations."	""
 "Output parameters"	""
+"Output will inherit shape type and table structure from the first layer in this list."	""
+"Overdip slope"	""
 "Overland Flow - Kinematic Wave D8"	""
 "Overland Flow Distance"	""
 "Overland Flow Distance to Channel Network"	""
+"Overlap"	""
+"Overlap [map units]"	""
 "Overlapping Areas"	""
 "Overlapping Cells"	""
 "Overlay 1"	""
@@ -3022,6 +3218,7 @@ TEXT	TRANSLATION
 "PNG Files"	""
 "PRECISION"	""
 "PREDICTED"	""
+"PT_ID"	""
 "Page Setup"	""
 "Pairwise Comparisons Table "	""
 "Pan"	""
@@ -3048,11 +3245,13 @@ TEXT	TRANSLATION
 "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."	""
 "Parsing %s ... "	""
 "Partial D."	""
+"Partially wet (WI = 0.1 - 1)"	""
 "Partition Coefficients"	""
 "Parts"	""
 "Pass"	""
@@ -3095,7 +3294,11 @@ TEXT	TRANSLATION
 "Perspectivic Distance"	""
 "Peucker & Douglas"	""
 "Phi [degree]"	""
+"Photogrammetry tools."	""
 "Pit"	""
+"Pixel Centers?"	""
+"Pixel Width (um)"	""
+"Pixel Width in micro meters"	""
 "Plain"	""
 "Plains"	""
 "Plan Curvature"	""
@@ -3107,19 +3310,28 @@ TEXT	TRANSLATION
 "Plant Height"	""
 "Platform"	""
 "Play And Save As Images..."	""
+"Play Loop [Ctrl + L]"	""
 "Play Loop [L]"	""
+"Play Once [Ctrl + P]"	""
 "Play Once [P]"	""
+"Play and Save to Image"	""
 "Please choose a method of module operation."	""
 "Please enter a numeric value:"	""
 "Please enter a text:"	""
 "Please provide a path for the output files."	""
+"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 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 an attribute field with z-information!"	""
 "Please provide an output file name!"	""
 "Please provide at least one column to export!"	""
-"Please stop module execution before exiting SAGA."	""
+"Please provide some input files!"	""
+"Please stop tool execution before exiting SAGA."	""
 "Plot Holes"	""
 "Point"	""
 "Point Cloud"	""
@@ -3140,6 +3352,7 @@ TEXT	TRANSLATION
 "Point Cloud with attribute dropped."	""
 "Point Clouds"	""
 "Point Data Record Format"	""
+"Point Distances"	""
 "Point Grid"	""
 "Point Position"	""
 "Point Size"	""
@@ -3148,7 +3361,6 @@ TEXT	TRANSLATION
 "Point Statistics for Polygons"	""
 "Point clouds viewer."	""
 "Point shapefile with source point(s)"	""
-"Point shapes import from text formated XYZ-table."	""
 "Point summary contains no points!"	""
 "Point to Keep"	""
 "Point(s)"	""
@@ -3158,6 +3370,7 @@ TEXT	TRANSLATION
 "Points Thinning"	""
 "Points per Cell"	""
 "Points per Square"	""
+"Points to be Colorised"	""
 "Polar Angle Units"	""
 "Polar Coordinate System"	""
 "Polar Coordinates"	""
@@ -3173,6 +3386,8 @@ TEXT	TRANSLATION
 "Polygon Properties"	""
 "Polygon Self-Intersection"	""
 "Polygon Shape Indices"	""
+"Polygon outlines of object regions"	""
+"Polygon shapefile describing the bounding boxes of spcvf tiles."	""
 "Polygon with less than 3 vertices encountered!"	""
 "Polygon(s)"	""
 "Polygon-Line Intersection"	""
@@ -3232,13 +3447,17 @@ TEXT	TRANSLATION
 "Predefined Standard Ellipsoids"	""
 "Predicted responses (probabilities) for corresponding samples."	""
 "Prediction INPUT"	""
+"Prediction Probability"	""
 "Predictor"	""
 "Predictors"	""
+"Preferred Routing"	""
 "Preferred Target Grid Type"	""
 "Preferred data storage type"	""
 "Preliminary scene analysis:"	""
 "Preprocessed DEM"	""
 "Preprocessed DEM. If this is not set changes will be stored in the original DEM grid."	""
+"Preprocessing"	""
+"Preserve 1px border Yes/No"	""
 "Preserve Data Type"	""
 "Preset Selection"	""
 "Presets"	""
@@ -3247,6 +3466,11 @@ TEXT	TRANSLATION
 "Primary Name"	""
 "Primary key)"	""
 "Principal Components"	""
+"Principal Point Offset in X"	""
+"Principal Point Offset in X (pixels)"	""
+"Principal Point Offset in X (pixles)"	""
+"Principal Point Offset in Y"	""
+"Principal Point Offset in Y (pixels)"	""
 "Principle Components"	""
 "Principle Components Analysis"	""
 "Principle Components Based Image Sharpening"	""
@@ -3256,6 +3480,7 @@ TEXT	TRANSLATION
 "Print Setup"	""
 "Print only information available in LAS header."	""
 "Priority Index"	""
+"Probability"	""
 "Probability Estimates"	""
 "Probability Reference"	""
 "Probability Threshold (Percent)"	""
@@ -3282,6 +3507,7 @@ TEXT	TRANSLATION
 "Profiles"	""
 "Profiles from Lines"	""
 "Proj.4"	""
+"Proj.4 Version is "	""
 "Proj4 Parameters"	""
 "Project"	""
 "Project File"	""
@@ -3295,9 +3521,14 @@ TEXT	TRANSLATION
 "Projection - GeoTRANS"	""
 "Projection - Georeferencing"	""
 "Projection - Proj.4"	""
+"Projection Centre"	""
+"Projection Centre - X"	""
+"Projection Centre - Y"	""
+"Projection Centre - Z"	""
 "Projection Parameters"	""
 "Projection Settings"	""
 "Projection Type"	""
+"Projection routines make use of the Proj.4 Cartographic Projections library."	""
 "Projection_GeoTRANS_Datum_3.dat,\n"	""
 "Projection_GeoTRANS_Datum_7.dat,\n\n"	""
 "Projection_GeoTRANS_Ellipsoid.dat,\n"	""
@@ -3306,6 +3537,8 @@ TEXT	TRANSLATION
 "Projection|Georeferencing"	""
 "Properties"	""
 "Protection Index"	""
+"Provide Radial Distortion Parameters?"	""
+"Provide Time stamp of Image?"	""
 "Proximity"	""
 "Proximity Grid"	""
 "Pythagoras' Tree"	""
@@ -3332,7 +3565,6 @@ TEXT	TRANSLATION
 "R,G,B value range"	""
 "R2"	""
 "R:Alternatives"	""
-"R:Buffers"	""
 "R:Catchment Area"	""
 "R:Classification"	""
 "R:Conversion"	""
@@ -3340,7 +3572,6 @@ TEXT	TRANSLATION
 "R:Cost Analysis"	""
 "R:Dynamics"	""
 "R:Export"	""
-"R:Fourier Analysis"	""
 "R:Fragmentation Analysis"	""
 "R:GWR"	""
 "R:Grid Generation"	""
@@ -3352,6 +3583,7 @@ TEXT	TRANSLATION
 "R:Landsat"	""
 "R:Miscellaneous"	""
 "R:Overlay"	""
+"R:Point Cloud"	""
 "R:Principle Components"	""
 "R:Shapes"	""
 "R:Soil Analysis"	""
@@ -3361,7 +3593,6 @@ TEXT	TRANSLATION
 "R:Terrain Analysis"	""
 "R:Tools"	""
 "R:Topographic Indices"	""
-"R:Values"	""
 "R:Vectorization"	""
 "R:Without Variogram Fit"	""
 "RAINBOW"	""
@@ -3377,10 +3608,11 @@ TEXT	TRANSLATION
 "RGA"	""
 "RGB"	""
 "RGB Composite"	""
+"RGB Image"	""
 "RGB Overlay"	""
+"RGB Values"	""
 "RGB coded data"	""
 "RGB to IHS"	""
-"RGBOverlay"	""
 "RMSE"	""
 "ROI_N"	""
 "RPROP parameters"	""
@@ -3405,6 +3637,8 @@ TEXT	TRANSLATION
 "Rainfall intensity"	""
 "Random"	""
 "Random Field"	""
+"Random Forest (ViGrA)"	""
+"Random Forest Classification"	""
 "Random Terrain Generation"	""
 "Range"	""
 "Range of R,G,B values in LAS file."	""
@@ -3425,7 +3659,6 @@ TEXT	TRANSLATION
 "Rc"	""
 "Real"	""
 "Real Surface Area"	""
-"Recalculating all Regions Minimum Distances\n"	""
 "Reciprocal Flattening (rf)"	""
 "Reclassification of distance grid to buffer zones with a width equal to the equidistance value."	""
 "Reclassified Grid"	""
@@ -3435,6 +3668,7 @@ TEXT	TRANSLATION
 "Reclassify buffer distance to intervals of euqidistance ..."	""
 "Reclassify|Extract Subset|"	""
 "Recognised Files"	""
+"Reconstruction result"	""
 "Records"	""
 "Rectangles"	""
 "Rectify Grid"	""
@@ -3452,8 +3686,6 @@ TEXT	TRANSLATION
 "Referencing"	""
 "Reflectance"	""
 "Refresh"	""
-"Regions Count of No-DataValue-Pixels"	""
-"Regions MinPixel"	""
 "Regression"	""
 "Regression Analysis"	""
 "Regression Analysis (Points/Grid)"	""
@@ -3475,8 +3707,10 @@ TEXT	TRANSLATION
 "Relative from cell value"	""
 "Relative heights calculation..."	""
 "Relaxation"	""
+"Remove Border Regions?"	""
 "Remove Duplicate Points"	""
 "Remove every i-th point."	""
+"Remove regions which have contact with (are adjacent to) the image borders?"	""
 "Removed Objects"	""
 "Removing ambiguous pixels..."	""
 "Rename"	""
@@ -3499,6 +3733,7 @@ TEXT	TRANSLATION
 "Rescale to 0 - 1"	""
 "Rescale to 0 - 1.0"	""
 "Rescale to 0 - 255"	""
+"Resection (Terrestrial)"	""
 "Residual Analysis (Grid)"	""
 "Residual Correction"	""
 "Residual standard error"	""
@@ -3522,12 +3757,16 @@ TEXT	TRANSLATION
 "Ridge Detection Threshold"	""
 "Ridge Level"	""
 "Right"	""
+"Right [*]"	""
+"Right [Del]"	""
 "Right [F4]"	""
 "Rill/Interrill Erosivity"	""
 "River Heads"	""
 "River Mouths"	""
 "Rn, number of rain days in timespan [-]"	""
 "Road Width"	""
+"Roll Left [F4]"	""
+"Roll Right[F3]"	""
 "Rook"	""
 "Rook's case"	""
 "Roots"	""
@@ -3537,6 +3776,7 @@ TEXT	TRANSLATION
 "Rotate Y"	""
 "Rotate Z"	""
 "Rotation"	""
+"Rotation Angle"	""
 "Rotation X"	""
 "Rotation Y"	""
 "Rotation Z"	""
@@ -3548,19 +3788,22 @@ TEXT	TRANSLATION
 "Routing"	""
 "Routing Error"	""
 "Rows"	""
+"Run Tool"	""
 "Running Average"	""
 "Running Script"	""
 "Runoff"	""
 "S, slope [rad]"	""
+"SAFETYFACTOR"	""
 "SAGA Colors"	""
 "SAGA Help"	""
-"SAGA Module Libraries"	""
 "SAGA Parameter Files"	""
+"SAGA Point Cloud Virtual Format (*.spcvf)"	""
 "SAGA Point Clouds"	""
 "SAGA Projects"	""
 "SAGA RGB"	""
 "SAGA RGB color"	""
 "SAGA RGB to R,G,B"	""
+"SAGA Tool Libraries"	""
 "SAGA User Group Associaton (c) 2002"	""
 "SAGA User Group Associaton (c) 2002-2013"	""
 "SAGA User Group Associaton (c) 2008"	""
@@ -3568,11 +3811,13 @@ TEXT	TRANSLATION
 "SAGA: Print Map"	""
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	""
 "SECTIONS"	""
+"SHALSTAB"	""
 "SIZE"	""
 "SL, estimation of mean soil loss [kg]"	""
 "SLc"	""
 "SLs"	""
 "SLz"	""
+"SPCVF successfully created from %d dataset(s)."	""
 "SPECIFIC"	""
 "SQL Statement"	""
 "SQL Statment"	""
@@ -3595,9 +3840,12 @@ TEXT	TRANSLATION
 "SVR Epsilon"	""
 "Saddle"	""
 "Sample Variogram"	""
+"Sample from training population with or without replacement?"	""
 "Sample weights"	""
+"Sample with Replacement"	""
 "Samples"	""
 "Samples in range"	""
+"Samples per Tree"	""
 "Sand"	""
 "Sandy Clay"	""
 "Sandy Clay-Loam"	""
@@ -3605,15 +3853,17 @@ TEXT	TRANSLATION
 "Sat. lateral permeability"	""
 "Satellite Height [m]"	""
 "Saturation overland flow [m/dt]"	""
+"Saturation zone (WI > 1)"	""
 "Save"	""
 "Save 3D Image Options"	""
-"Save All Attributes"	""
+"Save All"	""
 "Save As Image"	""
 "Save As Image to Workspace"	""
 "Save As Image when changed"	""
 "Save As Image..."	""
 "Save As..."	""
 "Save Colors"	""
+"Save Configuration"	""
 "Save Georeference"	""
 "Save Georeference (world file)"	""
 "Save Grid"	""
@@ -3622,6 +3872,7 @@ TEXT	TRANSLATION
 "Save Headline"	""
 "Save KML file"	""
 "Save Map as Image..."	""
+"Save Modified Data"	""
 "Save Parameters"	""
 "Save Point"	""
 "Save Point Cloud"	""
@@ -3674,8 +3925,8 @@ TEXT	TRANSLATION
 "Search Options"	""
 "Search Radius"	""
 "Search Range"	""
+"Search Result"	""
 "Search Shape"	""
-"Search Text"	""
 "Search chip size set to %d"	""
 "Search for..."	""
 "Search radius of kernel in cells."	""
@@ -3690,6 +3941,7 @@ TEXT	TRANSLATION
 "Sediment Balance Sand"	""
 "Sediment Balance Silt"	""
 "Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"	""
+"Sediment Yield Delivery Ratio"	""
 "Seed Generation"	""
 "Seed Points"	""
 "Seed Value"	""
@@ -3755,6 +4007,7 @@ TEXT	TRANSLATION
 "Separator (other)"	""
 "September"	""
 "Sequencer"	""
+"Sequencer Positions"	""
 "Server"	""
 "Server Connection"	""
 "Set Coordinate Reference System"	""
@@ -3775,6 +4028,7 @@ TEXT	TRANSLATION
 "Shadow"	""
 "Shall I activate file caching for new grid."	""
 "Shall execution be stopped?"	""
+"Shape"	""
 "Shape Index"	""
 "Shape Parameter for Elevation Percentile"	""
 "Shape Parameter for Slope"	""
@@ -3784,6 +4038,7 @@ TEXT	TRANSLATION
 "Shape type to generate."	""
 "Shape(s)"	""
 "Shape(s) to fit extent to"	""
+"Shapefile describing the AOI."	""
 "Shapes"	""
 "Shapes - Grid"	""
 "Shapes - Lines"	""
@@ -3806,7 +4061,6 @@ TEXT	TRANSLATION
 "Shapes to TIN"	""
 "Shapes to project"	""
 "Shapes with Text Replacements"	""
-"Shapes_Merge"	""
 "Shapes|Grid"	""
 "Shapes|Lines"	""
 "Shapes|Lines|Transects"	""
@@ -3825,10 +4079,12 @@ TEXT	TRANSLATION
 "Shift X"	""
 "Shift Y"	""
 "Shift Z"	""
+"Shift value"	""
 "Short Dashed"	""
 "Short Field Names"	""
 "Short Wave Radiation [kW/m2]"	""
 "Short dashed style"	""
+"Should the output shapes contain the centers of the border pixels instead of the corners?"	""
 "Shoulder Hollow"	""
 "Shoulder Slope"	""
 "Shoulder Spur"	""
@@ -3861,9 +4117,12 @@ TEXT	TRANSLATION
 "Show Vertices"	""
 "Show at all scales"	""
 "Shrink"	""
+"Shrink and Expand"	""
 "Shrinking"	""
 "Sibson"	""
 "Side Slope"	""
+"Sieved Classes"	""
+"Sieving Classes"	""
 "Sigmoid"	""
 "Sill"	""
 "Silt"	""
@@ -3872,7 +4131,6 @@ TEXT	TRANSLATION
 "Silty Clay-Loam"	""
 "Similarity"	""
 "Simple"	""
-"Simple 3D Shapes Viewer"	""
 "Simple Filter"	""
 "Simple Region Growing"	""
 "Simple, flow path and swath profiles."	""
@@ -3901,9 +4159,11 @@ TEXT	TRANSLATION
 "Simulation|Hydrology"	""
 "Simulation|Hydrology|IHACRES"	""
 "Single Cell"	""
+"Single Colour"	""
 "Single Flow Direction"	""
 "Single Storage"	""
 "Single Symbol"	""
+"Single Value Decomposition (OpenCV)"	""
 "Single value"	""
 "Sink Drainage Route Detection"	""
 "Sink Removal"	""
@@ -3913,8 +4173,10 @@ TEXT	TRANSLATION
 "Sinusoidal"	""
 "Size"	""
 "Size Range"	""
+"Size Scaling"	""
 "Size by Attribute"	""
 "Size field"	""
+"Size given as percentage of map size"	""
 "Size of Analysis Window"	""
 "Size of processing window (= 1 + 2 * radius) given as number of cells"	""
 "Size of smoothing filter"	""
@@ -3925,6 +4187,7 @@ TEXT	TRANSLATION
 "Skip cells (step value)."	""
 "Skip first line"	""
 "Skip first line as it contains column names."	""
+"Skipping dataset %s because of incompatibility with the first input dataset!"	""
 "Sky View Factor"	""
 "Sky View Factor (Simplified)"	""
 "Slope"	""
@@ -3932,6 +4195,9 @@ TEXT	TRANSLATION
 "Slope Height"	""
 "Slope Index"	""
 "Slope Length"	""
+"Slope Limited Flow Accumulation"	""
+"Slope Minimum"	""
+"Slope Threshold"	""
 "Slope Thresholds [Degree]"	""
 "Slope Tolerance"	""
 "Slope Units"	""
@@ -3940,11 +4206,13 @@ TEXT	TRANSLATION
 "Slope gradient to left neighbour [Degree]"	""
 "Slope grid, in radians."	""
 "Slope of Soil Line"	""
+"Slope threshold, given as degree, above which flow transport is unlimited."	""
 "Slope tolerance that defines a 'flat' surface (degrees)"	""
 "Slope, Aspect, Curvature"	""
 "Smith"	""
 "Smooth"	""
 "Smooth Rep"	""
+"Smoothing (ViGrA)"	""
 "Snap Distance"	""
 "Snap Features"	""
 "Snap Points to Grid"	""
@@ -3981,17 +4249,17 @@ TEXT	TRANSLATION
 "Solid"	""
 "Solid style"	""
 "Some Grid Analysis Tools."	""
+"Some OGR drivers are unable to determine the geometry type automatically, please choose the appropriate one in this case"	""
 "Sommergerste"	""
 "Sort"	""
 "Sort Fields"	""
-"Sort Grid"	""
 "Sort Selection to Top"	""
 "Sort Table"	""
 "Sort first by"	""
 "Sort second by"	""
 "Sort third by"	""
-"Sorted Grid"	""
 "Sorted Levels"	""
+"Sorting Order"	""
 "Source"	""
 "Source Coordinate System Error"	""
 "Source Coordinate System Type Error"	""
@@ -4009,6 +4277,7 @@ TEXT	TRANSLATION
 "South-North"	""
 "Spacecraft Sensor"	""
 "Spatial Point Pattern Analysis"	""
+"Spatial Reference"	""
 "Spatial Reference System Files (*.srs)"	""
 "Spatial and Geostatistics - Grids"	""
 "Spatial and Geostatistics - Kriging"	""
@@ -4025,21 +4294,28 @@ TEXT	TRANSLATION
 "Specific Catchment Area (SCA)"	""
 "Specification"	""
 "Specifie options used for the training and test data."	""
+"Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."	""
+"Specifies the fraction of the total number of samples used per tree for learning."	""
 "Specify a threshold value as minimum difference between neighboured segments."	""
 "Spectral"	""
 "Spectral Angle Mapping"	""
 "Spectral Angle Threshold (Degree)"	""
 "Spectral Information Divergence"	""
 "Speed (m/s)"	""
+"Spherical Harmonic Synthesis"	""
 "Spherical Model"	""
 "Spline"	""
 "Spline sensitivity, reduce to get smoother results, recommended: 80 < Tolerance < 200"	""
 "Split Channels"	""
+"Split Features"	""
+"Split Lines with Lines"	""
 "Split Parts"	""
 "Split Shapes Layer"	""
 "Split Shapes Layer Completely"	""
 "Split Shapes Layer Randomly"	""
 "Split Table/Shapes by Attribute"	""
+"Split with Line"	""
+"Splitted"	""
 "Spring"	""
 "Spur"	""
 "Square"	""
@@ -4061,6 +4337,9 @@ TEXT	TRANSLATION
 "Standardised Grid"	""
 "Standardize"	""
 "Standardized Height"	""
+"Start Degree"	""
+"Start Latitude"	""
+"Start Longitude"	""
 "Start Project"	""
 "Start Size"	""
 "Start Value"	""
@@ -4074,6 +4353,7 @@ TEXT	TRANSLATION
 "Statistics for Grids"	""
 "Std.Dev."	""
 "StdDev"	""
+"Steepened escarpment"	""
 "Steepest gradient (first version)"	""
 "Steepest gradient (second version)"	""
 "Stems"	""
@@ -4085,6 +4365,7 @@ TEXT	TRANSLATION
 "Steps"	""
 "Steps to Next"	""
 "Stepwidth"	""
+"Stereo Anaglyph"	""
 "Stereo Eye Distance [Degree]"	""
 "Stereographic"	""
 "Stop [ka]"	""
@@ -4095,6 +4376,7 @@ TEXT	TRANSLATION
 "Store Model to File"	""
 "Strahler Order"	""
 "Strahler order to begin a channel."	""
+"Stratification"	""
 "Stream Order"	""
 "Stream Power Index"	""
 "Streamflow (obs.) Column"	""
@@ -4111,6 +4393,7 @@ TEXT	TRANSLATION
 "Subbasin Flow Distance"	""
 "Subbasin Inflow"	""
 "Subbasins"	""
+"Subdued escarpment"	""
 "Subsurface flow [m/dt]"	""
 "Subtitle"	""
 "Subtract Volumes Below Base Level"	""
@@ -4125,7 +4408,6 @@ TEXT	TRANSLATION
 "Summary table."	""
 "Summary:\n"	""
 "Summary_"	""
-"Sum|Min|Max|"	""
 "Sun's height above horizon in degree"	""
 "Sunrise"	""
 "Suns's Height"	""
@@ -4150,9 +4432,12 @@ TEXT	TRANSLATION
 "Switch to Linear Flow"	""
 "Symbol Image"	""
 "Symbol Type"	""
+"Symbolic Image"	""
 "Symmetrical Difference"	""
 "Synchronise Map Extents"	""
+"Synchronize Map Extents"	""
 "Syntax error at position #%d: \n%s\n"	""
+"Synthesized Grid"	""
 "System"	""
 "T Curvature"	""
 "T Slope"	""
@@ -4173,6 +4458,7 @@ TEXT	TRANSLATION
 "TIN Viewer"	""
 "TIN Viewer Settings"	""
 "TIN Voronoi"	""
+"TIN creation failed"	""
 "TIN list"	""
 "TIN to Shapes"	""
 "TIN viewer."	""
@@ -4180,6 +4466,7 @@ TEXT	TRANSLATION
 "TINs"	""
 "TIN|Visualisation"	""
 "TMP Column: Subbasin: "	""
+"TOBIA"	""
 "TOPMODEL"	""
 "TOPMODEL - Simulation Output"	""
 "TOPOGRAPHY"	""
@@ -4267,6 +4554,7 @@ TEXT	TRANSLATION
 "Terrain Analysis - Morphometry"	""
 "Terrain Analysis - Preprocessing"	""
 "Terrain Analysis - Profiles"	""
+"Terrain Analysis - Slope Stability"	""
 "Terrain Analysis: Compound Analyses.\nThis library depends on the following SAGA module libraries:\n- ta_channels\n- ta_flow\n- ta_indices\n- ta_lighting\n- ta_morphometry\n- ta_preproc\n"	""
 "Terrain Analysis|Channels"	""
 "Terrain Analysis|Hydrology"	""
@@ -4274,6 +4562,7 @@ TEXT	TRANSLATION
 "Terrain Analysis|Morphometry"	""
 "Terrain Analysis|Preprocessing"	""
 "Terrain Analysis|Profiles"	""
+"Terrain Analysis|Slope Stability"	""
 "Terrain Path Cross Sections"	""
 "Terrain Ruggedness Index (TRI)"	""
 "Terrain Surface Classification"	""
@@ -4305,6 +4594,7 @@ TEXT	TRANSLATION
 "The column holding the X-coordinate."	""
 "The column holding the Y-coordinate."	""
 "The column holding the Z-coordinate."	""
+"The converted shapefile."	""
 "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."	""
@@ -4312,13 +4602,18 @@ TEXT	TRANSLATION
 "The field with G values (0-255)"	""
 "The field with R values (0-255)"	""
 "The field with SAGA RGB values"	""
+"The file to write the Calculation Results to."	""
 "The file to write the point cloud to."	""
+"The final symbolic image"	""
 "The first DTM used to assign height information to grid 1"	""
 "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 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 input point cloud files to use"	""
 "The input table"	""
 "The inverse selection is not implemented for input shapefiles with more than one polygon!"	""
 "The merged point cloud."	""
@@ -4329,15 +4624,19 @@ TEXT	TRANSLATION
 "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\""	""
 "The numbers (starting from 1) of the fields to use for clustering, separated by semicolon, e.g. \"4;5;7\""	""
+"The output point cloud"	""
 "The output table"	""
 "The point cloud to export."	""
 "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"	""
 "The second grid to correlate"	""
+"The shapefile to convert."	""
 "The shapefile to use for clipping."	""
 "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 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."	""
 "The values of the resultant grid can be either the seed value (e.g. the local maximum) or the enumerated segment id."	""
 "The values of this grid are checked against the linear flow threshold to decide on the flow-routing algorithm."	""
@@ -4380,7 +4679,6 @@ TEXT	TRANSLATION
 "This will contain your output data of type grid."	""
 "This will contain your output data of type shapes."	""
 "Thomas Schorr (c) 2007"	""
-"Thomas Wutzler (c) 2004"	""
 "Threshold"	""
 "Threshold (Grid Units)"	""
 "Threshold (Init.)"	""
@@ -4412,11 +4710,14 @@ TEXT	TRANSLATION
 "Tile Size Definition"	""
 "Tile Vertically"	""
 "Tiles"	""
+"Tileshape"	""
+"Tileshape_%s"	""
 "Tiling"	""
 "Tilt"	""
 "Time"	""
 "Time Delay (Rain-Runoff)"	""
 "Time Delay after Start of Rainfall (INTEGER)"	""
+"Time Difference between Image & Points"	""
 "Time Field"	""
 "Time Interval [a]"	""
 "Time Out (h)"	""
@@ -4434,13 +4735,24 @@ TEXT	TRANSLATION
 "Time [a]"	""
 "Time interval is to large for a stable solution."	""
 "Time span used for the calculation of daily radiation sums."	""
+"Time stamp of Image"	""
 "Time step size for a day's calculation given in hours."	""
 "Time step size for a range of days calculation given in days."	""
 "Timespan (days)"	""
 "Tip of the Day..."	""
+"Tissot's Indicatrix"	""
 "Tolerance"	""
 "Tolerance (Degree)"	""
 "Tolerance [Degree]"	""
+"Tool"	""
+"Tool Description Source"	""
+"Tool Execution"	""
+"Tool Libraries"	""
+"Tool Library"	""
+"Tool Manager"	""
+"Tool execution failed"	""
+"Tool execution succeeded"	""
+"Tools"	""
 "Tools for (grid based) digital terrain analysis."	""
 "Tools for Triangulated Irregular Network (TIN) processing."	""
 "Tools for digital terrain analysis."	""
@@ -4451,6 +4763,7 @@ TEXT	TRANSLATION
 "Tools for spatial and geostatistical analyses."	""
 "Tools for the georeferencing of spatial data."	""
 "Tools for the gridding of points and other vector data."	""
+"Tools for the handling of virtual datasets."	""
 "Tools for the import and export of ASPRS LAS files."	""
 "Tools for the import and export of DXF files."	""
 "Tools for the import and export of gridded data."	""
@@ -4479,6 +4792,7 @@ TEXT	TRANSLATION
 "Total Insolation"	""
 "Total Kinetic Energy"	""
 "Total accumulated Material"	""
+"Total area is zero or minimum elevation is equal or lower than maximum elevation!"	""
 "Total flow (in watershed) [m^3/dt]"	""
 "Total flow [m/dt]"	""
 "Total insolation, the sum of direct and diffuse incoming solar radiation."	""
@@ -4526,6 +4840,7 @@ TEXT	TRANSLATION
 "Transverse Cylindrical Equal Area"	""
 "Transverse Mercator"	""
 "Tree"	""
+"Tree Count"	""
 "Trend"	""
 "Trend Analysis"	""
 "Trend Analysis (Shapes)"	""
@@ -4552,15 +4867,21 @@ TEXT	TRANSLATION
 "UNRECOGNISED COMMAND ID"	""
 "USGS SRTM Grids (*.hgt)|*.hgt|All Files|*.*"	""
 "Unable to connect to server."	""
+"Unable to create filtered mask grid!"	""
+"Unable to create grid for the eroded image!"	""
 "Unable to get capabilities."	""
 "Unable to get map."	""
 "Unable to open LAS file!"	""
 "Unable to open input file!"	""
 "Unable to open output file %s!"	""
 "Unable to read points from LAS file!"	""
+"Unable to save %s file!"	""
 "Unclassified"	""
+"Uncond. stable"	""
+"Uncond. unstable"	""
 "Undefined"	""
 "Undefined Coordinate System"	""
+"Underdip slope"	""
 "Undetermined"	""
 "Uniform"	""
 "Union"	""
@@ -4579,6 +4900,8 @@ TEXT	TRANSLATION
 "Unreferenced Grids"	""
 "Unsaturated zone time delay per unit storage deficit [h]"	""
 "Up"	""
+"Up [-]"	""
+"Up [Home]"	""
 "Up-Scaling"	""
 "Up/Down"	""
 "Update"	""
@@ -4608,6 +4931,8 @@ TEXT	TRANSLATION
 "Use Confidence Interval"	""
 "Use D8 if catchment area becomes higher than specified threshold (Cells)."	""
 "Use D8 if catchment area becomes higher than specified threshold."	""
+"Use Flow Threshold"	""
+"Use Label as Identifier"	""
 "Use NoData"	""
 "Use Offset"	""
 "Use Pyramids"	""
@@ -4615,12 +4940,15 @@ TEXT	TRANSLATION
 "Use Surfer's No-Data Value"	""
 "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 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."	""
 "Use the stipple bitmap"	""
 "Use the user dashes"	""
 "Use this option to reclassify No-Data values independently of the method settings."	""
 "Use this option to reclassify all other values that are not specified in the options above."	""
+"Use training area labels as identifier in classification result, assumes all label values are integer numbers!"	""
 "Use x -Values"	""
 "User"	""
 "User Defined"	""
@@ -4636,12 +4964,14 @@ TEXT	TRANSLATION
 "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 specified elevation range"	""
 "Username"	""
 "Using temperature data?"	""
 "Using the snow-melt module?"	""
@@ -4670,8 +5000,8 @@ TEXT	TRANSLATION
 "Value Preparation"	""
 "Value Range"	""
 "Value Type"	""
+"Value as RGB"	""
 "Value as RGB Code"	""
-"Value for 'no data'"	""
 "Value in Grid 1"	""
 "Value in Grid 2"	""
 "Value of Target Function"	""
@@ -4725,25 +5055,16 @@ TEXT	TRANSLATION
 "Vertical Distance"	""
 "Vertical Distance to Channel Network"	""
 "Vertical Interpolation Method"	""
+"Vertical Offset"	""
 "Vertical Overland Flow Distance"	""
 "Vertical Range"	""
 "Vertical Scaling"	""
 "Vertical hatch"	""
 "Vertical scaling factor"	""
 "Vertically mirrored"	""
-"ViGrA - Basic Morphological Operations"	""
-"ViGrA - Distance"	""
-"ViGrA - Edge Detection"	""
-"ViGrA - Fourier Filter"	""
-"ViGrA - Fourier Transform"	""
-"ViGrA - Fourier Transform (Real)"	""
-"ViGrA - Fourier Transform Inverse"	""
-"ViGrA - Smoothing"	""
-"ViGrA - Watershed Segmentation"	""
 "Victor Olaya (c) 2004"	""
 "Victor Olaya (c) 2005"	""
 "View Distance"	""
-"Viewer Settings"	""
 "Visibility"	""
 "Visibility (points)"	""
 "Visibility (single point)"	""
@@ -4751,16 +5072,22 @@ TEXT	TRANSLATION
 "Vol. +"	""
 "Vol. -"	""
 "Volker Wichmann (c) 2010, LASERDATA GmbH"	""
+"Volker Wichmann (c) 2010-213, LASERDATA GmbH"	""
 "Volker Wichmann (c) 2012, LASERDATA GmbH"	""
+"Volker Wichmann (c) 2013, LASERDATA GmbH"	""
 "Volume: %f"	""
 "Volumes"	""
 "Votes"	""
 "W"	""
 "WARNING"	""
+"WARNING: %d dataset(s) skipped because of incompatibilities!"	""
+"WARNING: %d dataset(s) skipped because they are empty!"	""
 "WARNING: %d invalid points skipped!"	""
 "WARNING: Skipping misformatted line: %d!"	""
 "WARNING: selected attribute is not numeric; generating unique identifiers instead."	""
 "WASP Map Files (*.map)"	""
+"WEDGEFAIL"	""
+"WETNESS"	""
 "WHITE_BLUE"	""
 "WHITE_GREEN"	""
 "WHITE_RED"	""
@@ -4782,9 +5109,9 @@ TEXT	TRANSLATION
 "Watershed Basins"	""
 "Watershed Basins (Extended)"	""
 "Watershed Segmentation"	""
+"Watershed Segmentation (ViGrA)"	""
 "Weather Records"	""
 "Weight"	""
-"Weight for Red Grid out of range (0..100) - Cannot execute module"	""
 "Weight for grid "	""
 "Weight gradient term"	""
 "Weighted"	""
@@ -4806,6 +5133,7 @@ TEXT	TRANSLATION
 "Wherry 2"	""
 "Width"	""
 "Width (Cells)"	""
+"Width given as percentage of map size"	""
 "Width of gradient filter"	""
 "Wind Direction"	""
 "Wind Direction (degrees clockwise from north)"	""
@@ -4842,9 +5170,11 @@ TEXT	TRANSLATION
 "X Column"	""
 "X Component"	""
 "X Coordinates"	""
+"X Grid 1"	""
 "X Position"	""
 "X Range"	""
 "X Values"	""
+"X World"	""
 "X is Column ..."	""
 "X offset"	""
 "X, Y"	""
@@ -4856,7 +5186,6 @@ TEXT	TRANSLATION
 "X-Rotation"	""
 "X11 Pixel Map"	""
 "XYZ Files (*.xyz)"	""
-"XYZ export filter for shapes. "	""
 "XYZ files (*.xyz)"	""
 "Y"	""
 "Y = a * X^b (power)"	""
@@ -4869,9 +5198,11 @@ TEXT	TRANSLATION
 "Y Column"	""
 "Y Component"	""
 "Y Coordinates"	""
+"Y Grid 1"	""
 "Y Position"	""
 "Y Range"	""
 "Y Values"	""
+"Y World"	""
 "Y is Column ..."	""
 "Y offset"	""
 "Y-Coordinate"	""
@@ -4979,15 +5310,16 @@ TEXT	TRANSLATION
 "accufractionflux / state"	""
 "accuthresholdflux / state"	""
 "accutriggerflux / state"	""
+"add buffer (map units) to extent"	""
 "add to current selection"	""
+"add value"	""
 "additive"	""
 "adjusted"	""
 "after"	""
 "aggregated"	""
-"aggregating inside regions\n"	""
-"aggregating over all the grid\n"	""
 "align grid to coordinate system"	""
 "align to grid system"	""
+"all"	""
 "all attributes"	""
 "all classes"	""
 "all directions"	""
@@ -4997,6 +5329,7 @@ TEXT	TRANSLATION
 "all quadrants"	""
 "all shapes"	""
 "already in transaction"	""
+"alternating scale bar"	""
 "alternative"	""
 "analyzing known classes"	""
 "angle calculation is only available when exact two features are compared"	""
@@ -5058,13 +5391,12 @@ TEXT	TRANSLATION
 "calculate averages"	""
 "calculate gradient magnitude"	""
 "calculate gradients"	""
-"calculating initial distances\n"	""
 "calculating splines..."	""
-"cannot execute interactive module"	""
 "cartesian"	""
 "catchment area and slope..."	""
 "catchment length (square root of catchment area)"	""
 "catchment slope"	""
+"catchment specific parameter for sediment delivery ratio calculation"	""
 "categorical"	""
 "cell"	""
 "cell area"	""
@@ -5092,7 +5424,8 @@ TEXT	TRANSLATION
 "class identification"	""
 "classification"	""
 "clay content given as percentage"	""
-"clean up temporary data structures\n"	""
+"clean inner rings"	""
+"clip extent does not match grid's extent"	""
 "clip features"	""
 "clipped"	""
 "clockwise"	""
@@ -5107,6 +5440,7 @@ TEXT	TRANSLATION
 "comma (,)"	""
 "commit"	""
 "commit transaction command failed"	""
+"complete input times near points matrix"	""
 "completely contain"	""
 "completely contained"	""
 "confirm"	""
@@ -5138,7 +5472,10 @@ TEXT	TRANSLATION
 "could not disconnect ODBC source"	""
 "could not disconnect PostgreSQL source"	""
 "could not execute module"	""
+"could not execute tool"	""
 "could not find module"	""
+"could not find tool"	""
+"could not import random forest"	""
 "could not initialize cluster engine"	""
 "could not initialize data objects"	""
 "could not initialize module"	""
@@ -5146,6 +5483,8 @@ TEXT	TRANSLATION
 "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 open GetMap stream"	""
 "could not open data source"	""
 "could not open file"	""
@@ -5164,7 +5503,7 @@ TEXT	TRANSLATION
 "create model from training areas"	""
 "creating batch file example"	""
 "creating interpolator"	""
-"creating module documentation files"	""
+"creating tool documentation files"	""
 "cross"	""
 "cubic convolution"	""
 "cubic surface"	""
@@ -5181,6 +5520,7 @@ TEXT	TRANSLATION
 "dark - bright"	""
 "data / no-data"	""
 "data file could not be openend"	""
+"data set has no attributes"	""
 "database table does not exist"	""
 "date"	""
 "date (dd.mm.yyyy)"	""
@@ -5213,6 +5553,8 @@ TEXT	TRANSLATION
 "direction of sun (degree, clockwise from North)"	""
 "direction to the center cell"	""
 "directional1 average for Grids"	""
+"disabling might help to shut down faster, particularly if started from slow devices"	""
+"dissolved inner rings"	""
 "distance"	""
 "distance weighted average catchment slope"	""
 "do not confirm"	""
@@ -5232,13 +5574,13 @@ TEXT	TRANSLATION
 "duplicates have been identified."	""
 "e"	""
 "each island as separated polygon"	""
+"each pair with a single record"	""
 "each shape"	""
 "each shape's part"	""
 "edge collection"	""
 "edge detection"	""
 "edge of flight line flag"	""
 "effective flow length"	""
-"eight points"	""
 "elevation"	""
 "elevation and roughness"	""
 "elevation threshold used to identify hills/valleys"	""
@@ -5249,6 +5591,7 @@ TEXT	TRANSLATION
 "enumeration"	""
 "epsilon in loss function of epsilon-SVR"	""
 "epsilon-SVR"	""
+"equal"	""
 "equal intervals"	""
 "erosion"	""
 "error"	""
@@ -5258,9 +5601,12 @@ TEXT	TRANSLATION
 "error saving data file"	""
 "error saving index file"	""
 "exclude range"	""
-"executing module"	""
+"executing tool"	""
 "existing grid or grid system"	""
 "existing grid system"	""
+"expand"	""
+"expand and shrink"	""
+"expected"	""
 "expected to be the second of day"	""
 "explained cumulative variance"	""
 "explained variance"	""
@@ -5274,6 +5620,7 @@ TEXT	TRANSLATION
 "failed"	""
 "failed to create index for grid"	""
 "failed to create index for table"	""
+"failed to create polygon clipping mask"	""
 "failed to create searche engine"	""
 "failed to initialise search engine"	""
 "failed: could not find a suitable import driver"	""
@@ -5285,26 +5632,30 @@ TEXT	TRANSLATION
 "file could not be opened."	""
 "file does not exist."	""
 "file not found"	""
+"file path, name and type used to save frames to image files"	""
+"find inner rings"	""
 "find local minima"	""
 "first"	""
 "first point"	""
 "first value"	""
 "fit to each grid"	""
-"fit to overall 1.5 standard deviation"	""
-"fit to overall 2.0 standard deviation"	""
 "fit to overall range"	""
+"fit to overall standard deviation"	""
 "fit to page"	""
 "fit to value"	""
+"fitted interval"	""
 "fitting a polynom of ith order needs at least i + 1 samples"	""
 "fixed"	""
 "fixed cell height"	""
+"fixed interval"	""
 "fixed value"	""
 "floating"	""
 "floating point"	""
+"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)"	""
 "forward"	""
-"four points"	""
 "from list"	""
 "full frame"	""
 "function fitting failed !"	""
@@ -5351,6 +5702,7 @@ TEXT	TRANSLATION
 "hhmmss, fix size"	""
 "high"	""
 "highest z"	""
+"histogram match"	""
 "horizontal"	""
 "hours"	""
 "how to request values if step size is more than one cell"	""
@@ -5359,6 +5711,7 @@ TEXT	TRANSLATION
 "if set, only values with level heights above DEM will be used"	""
 "ignore"	""
 "ignored if set to zero"	""
+"ignored if set to zero (consider all pairs)"	""
 "image"	""
 "immediate"	""
 "improper function syntax"	""
@@ -5367,6 +5720,7 @@ TEXT	TRANSLATION
 "include all"	""
 "include range"	""
 "incompatible file."	""
+"incompatible items have been removed from input list"	""
 "index"	""
 "index file could not be opened"	""
 "index number"	""
@@ -5380,8 +5734,10 @@ TEXT	TRANSLATION
 "input"	""
 "input file"	""
 "instable (thawing)"	""
+"insufficient training samples"	""
 "intensity"	""
 "interactive"	""
+"interpolate values if projection is needed"	""
 "interpolating"	""
 "interpolation method to use if grid needs to be aligned to coordinate system"	""
 "intersect"	""
@@ -5399,14 +5755,18 @@ TEXT	TRANSLATION
 "invalid geographic coordinate system / datum"	""
 "invalid geogrid file name"	""
 "invalid grid system"	""
+"invalid image file path"	""
 "invalid input"	""
+"invalid input data"	""
 "invalid input!"	""
 "invalid lines layer"	""
 "invalid lookup table."	""
+"invalid number of features"	""
 "invalid number of parameters"	""
 "invalid or empty polygons layer"	""
 "invalid or empty shapes layer"	""
 "invalid or unsupported shape or vertex type"	""
+"invalid point cloud"	""
 "invalid points have been skipped"	""
 "invalid points layer"	""
 "invalid production date"	""
@@ -5432,10 +5792,12 @@ TEXT	TRANSLATION
 "last point"	""
 "last value"	""
 "layer uses undefined coordinate system, assuming geographic coordinates"	""
+"learning"	""
 "least significant first"	""
 "least squares fitted plane (Horn 1981, Costa-Cabral & Burgess 1996)"	""
 "leave one out"	""
 "left"	""
+"less than two polygons in layer, nothing to do!"	""
 "level"	""
 "level 1"	""
 "level 2"	""
@@ -5451,7 +5813,7 @@ TEXT	TRANSLATION
 "list order"	""
 "listing of database tables failed"	""
 "listing of table columns failed"	""
-"loaded module libraries"	""
+"loaded tool libraries"	""
 "loading"	""
 "loading OSM data"	""
 "loading band"	""
@@ -5461,6 +5823,7 @@ TEXT	TRANSLATION
 "local time"	""
 "local water depth or absolute water level at the user specified cell"	""
 "localhost"	""
+"logarithmic"	""
 "lookup table"	""
 "low"	""
 "lower and upper thresholds for semantic import model, planar vs. sloped areas"	""
@@ -5474,10 +5837,12 @@ TEXT	TRANSLATION
 "m2/h"	""
 "magenta - white"	""
 "main basins..."	""
+"majority"	""
 "map units"	""
 "mark breaks in first line"	""
 "masking..."	""
 "match input data"	""
+"matching histogram"	""
 "mathematical"	""
 "matrix initialisation failed"	""
 "matrix inversion failed"	""
@@ -5524,16 +5889,11 @@ TEXT	TRANSLATION
 "missing operand"	""
 "model application"	""
 "model creation"	""
-"module"	""
-"module name "	""
-"modules"	""
 "moment"	""
 "more than one field in selection"	""
 "morpological gradient"	""
 "most significant first"	""
 "multi scale"	""
-"multi-grid viewer can only be run from graphical user interface"	""
-"multi-grid viewer will not be started"	""
 "multiplicative"	""
 "n"	""
 "n-fold cross validation: n must > 1"	""
@@ -5560,7 +5920,6 @@ TEXT	TRANSLATION
 "no database connection"	""
 "no distance weighting"	""
 "no edges found"	""
-"no features have been selected"	""
 "no features in selection"	""
 "no features to buffer."	""
 "no fields in selection"	""
@@ -5572,9 +5931,9 @@ TEXT	TRANSLATION
 "no grids in selection"	""
 "no histogram for unclassified data"	""
 "no input"	""
-"no input data"	""
 "no intersection with mask grid."	""
 "no layers in data source"	""
+"no lines for splitting"	""
 "no memory"	""
 "no options"	""
 "no output parameter in selection"	""
@@ -5606,6 +5965,7 @@ TEXT	TRANSLATION
 "no training areas could be analysed."	""
 "no translation available"	""
 "no valid data found in grid(s)"	""
+"no valid grid in features list."	""
 "no valid grid in list."	""
 "no valid samples in data set"	""
 "no variation in point pattern"	""
@@ -5648,6 +6008,7 @@ TEXT	TRANSLATION
 "number of dropped shapes"	""
 "number of grid cells per tile"	""
 "number of initial and final state grids differs"	""
+"number of inner rings"	""
 "number of order"	""
 "number of pits above threshold level"	""
 "number of points"	""
@@ -5692,6 +6053,7 @@ TEXT	TRANSLATION
 "original name + variable type"	""
 "other"	""
 "other values"	""
+"out-of-bag error"	""
 "output"	""
 "ovalooblonga-rectangularoblonga"	""
 "ovaloredonda-ovalooblonga"	""
@@ -5727,7 +6089,9 @@ TEXT	TRANSLATION
 "points read"	""
 "points written"	""
 "polar coordinates given in degree"	""
+"polygon"	""
 "polygons"	""
+"polylines"	""
 "polynomial"	""
 "polynomial trend"	""
 "polynomial trend (coefficient interpolation)"	""
@@ -5738,6 +6102,7 @@ TEXT	TRANSLATION
 "press any key"	""
 "processed DEM"	""
 "projection initialization failure"	""
+"proportional"	""
 "quadrants"	""
 "quadratic surface"	""
 "quantiles"	""
@@ -5776,14 +6141,13 @@ TEXT	TRANSLATION
 "red=this, green=1, blue=2"	""
 "red=this, green=2, blue=1"	""
 "redonda-ovaloredonda"	""
+"regression"	""
 "relative"	""
 "remove above percentile"	""
 "remove below percentile"	""
 "remove from current selection"	""
 "remove maxima (with tolerance)"	""
 "remove minima (with tolerance)"	""
-"removing orphants\n"	""
-"renaming classes\n"	""
 "replace existing table"	""
 "replacements"	""
 "resampling"	""
@@ -5817,6 +6181,7 @@ TEXT	TRANSLATION
 "sand content given as percentage"	""
 "save output to file instead of memory"	""
 "save point added"	""
+"scale line"	""
 "scale to size range"	""
 "scan angle"	""
 "search distance is less than half of grid cell size"	""
@@ -5833,17 +6198,22 @@ TEXT	TRANSLATION
 "selected table does not have numeric attributes"	""
 "self-intersection"	""
 "separate layer for each polygon"	""
+"separate lines"	""
 "sequential write"	""
+"set constant value"	""
 "shading"	""
 "shading (fixed light source)"	""
 "shape file could not be opened."	""
 "shape in process"	""
 "shape wise, supports overlapping polygons"	""
 "shapes"	""
+"shapes extent"	""
 "shapes have been dropped"	""
 "shapes layer extent"	""
 "show direct insolation for each time step."	""
 "shows cell values when zoomed"	""
+"shrink"	""
+"shrink and expand"	""
 "sigmoid"	""
 "sigmoidal"	""
 "signed 1 byte integer"	""
@@ -5855,14 +6225,17 @@ TEXT	TRANSLATION
 "simple planar surface"	""
 "simply decrease cell's value by epsilon"	""
 "sin(x*x + y*y)"	""
+"single class"	""
 "single|range|simple table|user supplied table|"	""
 "size range as percentage of step"	""
+"slope threshold must not be zero!"	""
 "slope value has to be greater than zero"	""
 "slower but memory saving"	""
 "smoothed surface"	""
 "snap move"	""
 "snapped"	""
 "soil texture"	""
+"solve inner rings"	""
 "source"	""
 "space"	""
 "specific catchment area"	""
@@ -5873,6 +6246,7 @@ TEXT	TRANSLATION
 "splitting polygon parts"	""
 "sql excution error"	""
 "square"	""
+"square root"	""
 "square root (catchment length)"	""
 "square root of catchment area"	""
 "stable"	""
@@ -5890,7 +6264,9 @@ TEXT	TRANSLATION
 "stretch to specified value range"	""
 "string"	""
 "subbasins..."	""
+"subtract value"	""
 "success"	""
+"sum"	""
 "sums-of-squares-and-cross-products matrix"	""
 "surface and result grids have to share the same grid system"	""
 "symmetric"	""
@@ -5915,11 +6291,14 @@ TEXT	TRANSLATION
 "time of sunrise/sunset is only calculated if time span is set to single day"	""
 "tolerance as absolute values"	""
 "tolerance of termination criterion"	""
-"tomaschTool"	""
 "too few parameters"	""
 "too many constants"	""
 "too many input grids"	""
 "too many parameters"	""
+"tool"	""
+"tool name   "	""
+"tool needs graphical user interface"	""
+"tools"	""
 "top"	""
 "top / right"	""
 "top hat"	""
@@ -5970,6 +6349,7 @@ TEXT	TRANSLATION
 "use old version (no acceleration option) with constant wind direction"	""
 "user data"	""
 "user defined"	""
+"user defined NoData value"	""
 "user defined grid system"	""
 "user defined kernel"	""
 "user defined reference"	""
diff --git a/src/saga_core/saga_gui/res/xpm/tb_map_north_arrow.xpm b/src/saga_core/saga_gui/res/xpm/tb_map_north_arrow.xpm
new file mode 100644
index 0000000..0e42ed0
--- /dev/null
+++ b/src/saga_core/saga_gui/res/xpm/tb_map_north_arrow.xpm
@@ -0,0 +1,23 @@
+/* XPM */
+static const char * tb_map_north_arrow_xpm[] = {
+"16 16 4 1",
+" 	c None",
+".	c #000000",
+"+	c #B5B5B5",
+"@	c #FFFFFF",
+"       .+       ",
+"       .+       ",
+"      .. at +      ",
+"      .. at +      ",
+"     ...@@+     ",
+"     ...@@+     ",
+"    ....@@@+    ",
+"    ....@@@+    ",
+"   .....@@@@+   ",
+"   .....@@@@+   ",
+"  ......@@@@@+  ",
+"  ......@@@@@+  ",
+"  .....  @@@@+  ",
+" ....      @@@+ ",
+" ...        @@+ ",
+" .           @+ "};
diff --git a/src/saga_core/saga_gui/res/xpm/wksp_map_graticule.xpm b/src/saga_core/saga_gui/res/xpm/wksp_map_graticule.xpm
new file mode 100644
index 0000000..173b8ce
--- /dev/null
+++ b/src/saga_core/saga_gui/res/xpm/wksp_map_graticule.xpm
@@ -0,0 +1,30 @@
+/* XPM */
+static const char *wksp_map_graticule_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 8 1",
+". c Black",
+"X c #FFFFFF",
+"# c #000084",
+"o c #00FFFF",
+"+ c #00FFFF",
+"@ c #0000FF",
+"  c None",
+"O c #00C6FF",
+/* pixels */
+"       ..       ",
+"     ......     ",
+"   ..+.++.+..   ",
+"  .++.++++.++.  ",
+" .............. ",
+".+++.++++++.+++.",
+".++.++++++++.++.",
+"................",
+".++.++++++++.++.",
+".+++.++++++.+++.",
+" .............. ",
+"  .++.++++.++.  ",
+"   ..+.++.+..   ",
+"     ......     ",
+"       ..       ",
+"                "
+};
diff --git a/src/saga_core/saga_gui/res_commands.cpp b/src/saga_core/saga_gui/res_commands.cpp
index 529ad29..22eb0c1 100644
--- a/src/saga_core/saga_gui/res_commands.cpp
+++ b/src/saga_core/saga_gui/res_commands.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_commands.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: res_commands.cpp 2039 2014-03-05 13:26:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -113,7 +113,8 @@ wxString CMD_Get_Name(int Cmd_ID)
 	case ID_CMD_WKSP_ITEM_SETTINGS_COPY:return( _TL("Copy Settings from other Layer") );
 	case ID_CMD_WKSP_ITEM_SEARCH:		return( _TL("Search for...") );
 
-	case ID_CMD_WKSP_OPEN:				return( _TL("Load") );
+	case ID_CMD_WKSP_OPEN:				return( _TL("Open") );
+	case ID_CMD_WKSP_SAVE:				return( _TL("Save All") );
 
 	case ID_CMD_INFO_CLEAR:				return( _TL("Clear") );
 	case ID_CMD_INFO_COPY:				return( _TL("Copy") );
@@ -131,11 +132,12 @@ wxString CMD_Get_Name(int Cmd_ID)
 	case ID_CMD_DB_TABLE_INFO:			return( _TL("Field Description") );
 	case ID_CMD_DB_TABLE_FROM_QUERY:	return( _TL("Query") );
 
-	case ID_CMD_MODULES_OPEN:			return( _TL("Load Module Library") );
+	case ID_CMD_MODULES_OPEN:			return( _TL("Load Tool Library") );
+	case ID_CMD_MODULES_SEARCH:			return( _TL("Find and Run Tool") );
 	case ID_CMD_MODULES_SAVE_SCRIPT:	return( _TL("Create Script Command File") );
-	case ID_CMD_MODULES_SAVE_DOCS:		return( _TL("Create Module Description Files") );
+	case ID_CMD_MODULES_SAVE_DOCS:		return( _TL("Create Tool Description Files") );
 
-	case ID_CMD_DATA_PROJECT_NEW:		return( _TL("New Project") );
+	case ID_CMD_DATA_PROJECT_NEW:		return( _TL("Close All") );
 	case ID_CMD_DATA_PROJECT_OPEN:		return( _TL("Load Project") );
 	case ID_CMD_DATA_PROJECT_OPEN_ADD:	return( _TL("Add Project") );
 	case ID_CMD_DATA_PROJECT_SAVE:		return( _TL("Save Project") );
@@ -144,6 +146,7 @@ wxString CMD_Get_Name(int Cmd_ID)
 	case ID_CMD_DATA_LEGEND_SIZE_INC:	return( _TL("Increase Legend Size") );
 	case ID_CMD_DATA_LEGEND_SIZE_DEC:	return( _TL("Decrease Legend Size") );
 	case ID_CMD_DATA_HISTORY_CLEAR:		return( _TL("Clear History") );
+	case ID_CMD_DATA_PROJECTION:		return( _TL("Spatial Reference") );
 
 	case ID_CMD_GRIDS_OPEN:
 	case ID_CMD_SHAPES_OPEN:
@@ -197,50 +200,58 @@ wxString CMD_Get_Name(int Cmd_ID)
 	case ID_CMD_SHAPES_EDIT_DEL_SHAPE:	return( _TL("Delete Selected Shape(s)") );
 	case ID_CMD_SHAPES_EDIT_DEL_PART:	return( _TL("Delete Selected Part") );
 	case ID_CMD_SHAPES_EDIT_DEL_POINT:	return( _TL("Delete Selected Point") );
+	case ID_CMD_SHAPES_EDIT_SPLIT:		return( _TL("Split with Line") );
+	case ID_CMD_SHAPES_EDIT_MERGE:		return( _TL("Merge Selection") );
+	case ID_CMD_SHAPES_EDIT_MOVE:		return( _TL("Move") );
 
 	case ID_CMD_POINTCLOUD_RANGE_MINMAX:		return( _TL("Set Range to Minmum/Maximum") );
 	case ID_CMD_POINTCLOUD_RANGE_STDDEV150:		return( _TL("Set Range to Standard Deviation (1.5)") );
 	case ID_CMD_POINTCLOUD_RANGE_STDDEV200:		return( _TL("Set Range to Standard Deviation (2.0)") );
 
-	case ID_CMD_MAP_3D_SHOW:
+	case ID_CMD_MAPS_SHOW:						return( _TL("Show Map") );
 	case ID_CMD_MAPS_3D_SHOW:					return( _TL("Show 3D-View") );
-	case ID_CMD_MAP_LAYOUT_SHOW:
 	case ID_CMD_MAPS_LAYOUT_SHOW:				return( _TL("Show Print Layout") );
-	case ID_CMD_MAP_SAVE_IMAGE_ON_CHANGE:
+	case ID_CMD_MAPS_SAVE_IMAGE:				return( _TL("Save As Image...") );
 	case ID_CMD_MAPS_SAVE_IMAGE_ON_CHANGE:		return( _TL("Save As Image when changed") );
 	case ID_CMD_MAPS_SAVE_IMAGE_TO_MEMORY:		return( _TL("Save As Image to Workspace") );
-	case ID_CMD_MAP_SAVE_IMAGE:
-	case ID_CMD_MAPS_SAVE_IMAGE:				return( _TL("Save As Image...") );
 	case ID_CMD_MAPS_SAVE_TO_CLIPBOARD:			return( _TL("Copy Map to Clipboard [Ctrl+C]") );
 	case ID_CMD_MAPS_SAVE_TO_CLIPBOARD_LEGEND:	return( _TL("Copy Legend to Clipboard [Ctrl+L]") );
-	case ID_CMD_MAP_SYNCHRONIZE:				return( _TL("Synchronise Map Extents") );
-	case ID_CMD_MAP_SCALEBAR:					return( _TL("Scale Bar") );
-
-	case ID_CMD_MAPS_SHOW:				return( _TL("Show Map") );
-	case ID_CMD_MAPS_LAYER_SHOW:		return( _TL("Show Layer") );
-	case ID_CMD_MAPS_MOVE_TOP:			return( _TL("Move To Top") );
-	case ID_CMD_MAPS_MOVE_BOTTOM:		return( _TL("Move To Bottom") );
-	case ID_CMD_MAPS_MOVE_UP:			return( _TL("Move Up") );
-	case ID_CMD_MAPS_MOVE_DOWN:			return( _TL("Move Down") );
-	case ID_CMD_MAPS_GRID_FITCOLORS:	return( _TL("Fit Grid Colors To Map Extent") );
+	case ID_CMD_MAPS_SYNCHRONIZE:				return( _TL("Synchronise Map Extents") );
+	case ID_CMD_MAPS_SCALEBAR:					return( _TL("Scale Bar") );
+	case ID_CMD_MAPS_PROJECTION:				return( _TL("Spatial Reference") );
+	case ID_CMD_MAPS_GRATICULE_ADD:				return( _TL("Add Graticule") );
+	case ID_CMD_MAPS_LAYER_SHOW:				return( _TL("Show Layer") );
+	case ID_CMD_MAPS_MOVE_TOP:					return( _TL("Move To Top") );
+	case ID_CMD_MAPS_MOVE_BOTTOM:				return( _TL("Move To Bottom") );
+	case ID_CMD_MAPS_MOVE_UP:					return( _TL("Move Up") );
+	case ID_CMD_MAPS_MOVE_DOWN:					return( _TL("Move Down") );
+	case ID_CMD_MAPS_GRID_FITCOLORS:			return( _TL("Fit Grid Colors To Map Extent") );
 
 	//-----------------------------------------------------
 	// Views...
 
-	case ID_CMD_MAP_MODE_ZOOM:			return( _TL("Zoom") );
-	case ID_CMD_MAP_MODE_PAN:			return( _TL("Pan") );
-	case ID_CMD_MAP_MODE_SELECT:		return( _TL("Action") );
-	case ID_CMD_MAP_MODE_DISTANCE:		return( _TL("Measure Distance") );
-	case ID_CMD_MAP_CLOSE:				return( _TL("Close") );
-	case ID_CMD_MAP_TOOLBAR:			return( _TL("Show Toolbar") );
-	case ID_CMD_MAP_LEGEND_VERTICAL:	return( _TL("Show Vertical Legend") );
-	case ID_CMD_MAP_LEGEND_HORIZONTAL:	return( _TL("Show Horizontal Legend") );
-	case ID_CMD_MAP_ZOOM_BACK:			return( _TL("Zoom To Previous Extent") );
-	case ID_CMD_MAP_ZOOM_FORWARD:		return( _TL("Zoom To Next Extent") );
-	case ID_CMD_MAP_ZOOM_FULL:			return( _TL("Zoom To Full Extent") );
-	case ID_CMD_MAP_ZOOM_ACTIVE:		return( _TL("Zoom To Active Layer") );
-	case ID_CMD_MAP_ZOOM_SELECTION:		return( _TL("Zoom To Selection") );
-	case ID_CMD_MAP_ZOOM_EXTENT:		return( _TL("Zoom To Extent") );
+	case ID_CMD_MAP_CLOSE:						return( _TL("Close") );
+	case ID_CMD_MAP_TOOLBAR:					return( _TL("Show Toolbar") );
+	case ID_CMD_MAP_3D_SHOW:					return( CMD_Get_Name(ID_CMD_MAPS_3D_SHOW) );
+	case ID_CMD_MAP_LAYOUT_SHOW:				return( CMD_Get_Name(ID_CMD_MAPS_LAYOUT_SHOW) );
+	case ID_CMD_MAP_SCALEBAR:					return( CMD_Get_Name(ID_CMD_MAPS_SCALEBAR) );
+	case ID_CMD_MAP_GRATICULE_ADD:				return( CMD_Get_Name(ID_CMD_MAPS_GRATICULE_ADD) );
+	case ID_CMD_MAP_SAVE_IMAGE:					return( CMD_Get_Name(ID_CMD_MAPS_SAVE_IMAGE) );
+	case ID_CMD_MAP_SAVE_IMAGE_ON_CHANGE:		return( CMD_Get_Name(ID_CMD_MAPS_SAVE_IMAGE_ON_CHANGE) );
+	case ID_CMD_MAP_SYNCHRONIZE:				return( CMD_Get_Name(ID_CMD_MAPS_SYNCHRONIZE) );
+	case ID_CMD_MAP_NORTH_ARROW:				return( _TL("North Arrow") );
+	case ID_CMD_MAP_LEGEND_VERTICAL:			return( _TL("Show Vertical Legend") );
+	case ID_CMD_MAP_LEGEND_HORIZONTAL:			return( _TL("Show Horizontal Legend") );
+	case ID_CMD_MAP_MODE_ZOOM:					return( _TL("Zoom") );
+	case ID_CMD_MAP_MODE_PAN:					return( _TL("Pan") );
+	case ID_CMD_MAP_MODE_SELECT:				return( _TL("Action") );
+	case ID_CMD_MAP_MODE_DISTANCE:				return( _TL("Measure Distance") );
+	case ID_CMD_MAP_ZOOM_FULL:					return( _TL("Zoom To Full Extent") );
+	case ID_CMD_MAP_ZOOM_BACK:					return( _TL("Zoom To Previous Extent") );
+	case ID_CMD_MAP_ZOOM_FORWARD:				return( _TL("Zoom To Next Extent") );
+	case ID_CMD_MAP_ZOOM_ACTIVE:				return( _TL("Zoom To Active Layer") );
+	case ID_CMD_MAP_ZOOM_SELECTION:				return( _TL("Zoom To Selection") );
+	case ID_CMD_MAP_ZOOM_EXTENT:				return( _TL("Zoom To Extent") );
 
 	case ID_CMD_MAP3D_PARAMETERS:		return( _TL("Properties") );
 	case ID_CMD_MAP3D_ROTATE_X_LESS:	return( _TL("Up") );
@@ -335,7 +346,9 @@ int CMD_Get_ImageID(int Cmd_ID)
 	case ID_CMD_FRAME_INFO_SHOW:		return( ID_IMG_TB_INFO );
 	case ID_CMD_FRAME_HELP:				return( ID_IMG_TB_HELP );
 	case ID_CMD_WKSP_OPEN:				return( ID_IMG_TB_OPEN );
+	case ID_CMD_WKSP_SAVE:				return( ID_IMG_TB_SAVE );
 	case ID_CMD_MODULES_OPEN:			return( ID_IMG_TB_OPEN_MODULE );
+	case ID_CMD_MODULES_SEARCH:			return( ID_IMG_NB_WKSP_MODULES );
 	case ID_CMD_TABLES_OPEN:			return( ID_IMG_TB_OPEN_TABLE );
 	case ID_CMD_SHAPES_OPEN:			return( ID_IMG_TB_OPEN_SHAPES );
 	case ID_CMD_GRIDS_OPEN:				return( ID_IMG_TB_OPEN_GRID );
@@ -359,8 +372,10 @@ int CMD_Get_ImageID(int Cmd_ID)
 	case ID_CMD_MAPS_SAVE_TO_CLIPBOARD:			break;
 	case ID_CMD_MAPS_SAVE_TO_CLIPBOARD_LEGEND:	break;
 	case ID_CMD_MAPS_SAVE_IMAGE:				break;
+	case ID_CMD_MAP_NORTH_ARROW:		return( ID_IMG_TB_MAP_NORTH_ARROW );
 	case ID_CMD_MAP_SYNCHRONIZE:		return( ID_IMG_TB_MAP_SYNCHRONIZE );
 	case ID_CMD_MAP_SCALEBAR:			return( ID_IMG_TB_MAP_SCALEBAR );
+	case ID_CMD_MAP_GRATICULE_ADD:				break;
 	case ID_CMD_MAP_LEGEND_VERTICAL:	return( ID_IMG_TB_MAP_LEGEND_VERTICAL );
 	case ID_CMD_MAP_LEGEND_HORIZONTAL:	return( ID_IMG_TB_MAP_LEGEND_HORIZONTAL );
 
diff --git a/src/saga_core/saga_gui/res_commands.h b/src/saga_core/saga_gui/res_commands.h
index 8e1acf0..dbbd3a6 100644
--- a/src/saga_core/saga_gui/res_commands.h
+++ b/src/saga_core/saga_gui/res_commands.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_commands.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: res_commands.h 2017 2014-02-25 15:48:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -114,6 +114,7 @@ enum ID_COMMANDS
 	//-----------------------------------------------------
 	ID_CMD_WKSP_FIRST,
 	ID_CMD_WKSP_OPEN,
+	ID_CMD_WKSP_SAVE,
 	ID_CMD_WKSP_ITEM_RETURN,
 	ID_CMD_WKSP_ITEM_CLOSE,
 	ID_CMD_WKSP_ITEM_SETTINGS_LOAD,
@@ -141,6 +142,7 @@ enum ID_COMMANDS
 	ID_CMD_MODULES_RECENT_FIRST,
 	ID_CMD_MODULES_RECENT_LAST		= RECENT_COUNT + ID_CMD_MODULES_RECENT_FIRST,
 	ID_CMD_MODULES_OPEN,
+	ID_CMD_MODULES_SEARCH,
 	ID_CMD_MODULES_SAVE_SCRIPT,
 	ID_CMD_MODULES_SAVE_DOCS,
 	ID_CMD_MODULES_LAST,
@@ -157,6 +159,7 @@ enum ID_COMMANDS
 	ID_CMD_DATA_LEGEND_SIZE_INC,
 	ID_CMD_DATA_LEGEND_SIZE_DEC,
 	ID_CMD_DATA_HISTORY_CLEAR,
+	ID_CMD_DATA_PROJECTION,
 	ID_CMD_DATA_LAST,
 
 	ID_CMD_GRIDS_FIRST,
@@ -198,6 +201,9 @@ enum ID_COMMANDS
 	ID_CMD_SHAPES_EDIT_DEL_SHAPE,
 	ID_CMD_SHAPES_EDIT_DEL_PART,
 	ID_CMD_SHAPES_EDIT_DEL_POINT,
+	ID_CMD_SHAPES_EDIT_SPLIT,
+	ID_CMD_SHAPES_EDIT_MERGE,
+	ID_CMD_SHAPES_EDIT_MOVE,
 	ID_CMD_SHAPES_LAST,
 
 	ID_CMD_TABLES_FIRST,
@@ -237,10 +243,14 @@ enum ID_COMMANDS
 	ID_CMD_MAPS_3D_SHOW,
 	ID_CMD_MAPS_LAYOUT_SHOW,
 	ID_CMD_MAPS_SAVE_IMAGE,
-	ID_CMD_MAPS_SAVE_TO_CLIPBOARD,
-	ID_CMD_MAPS_SAVE_TO_CLIPBOARD_LEGEND,
 	ID_CMD_MAPS_SAVE_IMAGE_ON_CHANGE,
 	ID_CMD_MAPS_SAVE_IMAGE_TO_MEMORY,
+	ID_CMD_MAPS_SAVE_TO_CLIPBOARD,
+	ID_CMD_MAPS_SAVE_TO_CLIPBOARD_LEGEND,
+	ID_CMD_MAPS_SYNCHRONIZE,
+	ID_CMD_MAPS_SCALEBAR,
+	ID_CMD_MAPS_PROJECTION,
+	ID_CMD_MAPS_GRATICULE_ADD,
 	ID_CMD_MAPS_LAYER_SHOW,
 	ID_CMD_MAPS_MOVE_TOP,
 	ID_CMD_MAPS_MOVE_BOTTOM,
@@ -252,7 +262,7 @@ enum ID_COMMANDS
 	ID_CMD_WKSP_LAST,
 
 	//-----------------------------------------------------
-	ID_CMD_CHILD_FIRST,
+	ID_CMD_CHILD_FIRST,	// Child Window Commands
 
 	ID_CMD_MAP_FIRST,
 	ID_CMD_MAP_CLOSE,
@@ -260,21 +270,23 @@ enum ID_COMMANDS
 	ID_CMD_MAP_3D_SHOW,
 	ID_CMD_MAP_LAYOUT_SHOW,
 	ID_CMD_MAP_SCALEBAR,
+	ID_CMD_MAP_GRATICULE_ADD,
 	ID_CMD_MAP_SAVE_IMAGE,
 	ID_CMD_MAP_SAVE_IMAGE_ON_CHANGE,
 	ID_CMD_MAP_SYNCHRONIZE,
+	ID_CMD_MAP_NORTH_ARROW,
 	ID_CMD_MAP_LEGEND_VERTICAL,
 	ID_CMD_MAP_LEGEND_HORIZONTAL,
+	ID_CMD_MAP_MODE_ZOOM,
+	ID_CMD_MAP_MODE_PAN,
+	ID_CMD_MAP_MODE_SELECT,
+	ID_CMD_MAP_MODE_DISTANCE,
 	ID_CMD_MAP_ZOOM_FULL,
 	ID_CMD_MAP_ZOOM_BACK,
 	ID_CMD_MAP_ZOOM_FORWARD,
 	ID_CMD_MAP_ZOOM_ACTIVE,
 	ID_CMD_MAP_ZOOM_SELECTION,
 	ID_CMD_MAP_ZOOM_EXTENT,
-	ID_CMD_MAP_MODE_ZOOM,
-	ID_CMD_MAP_MODE_PAN,
-	ID_CMD_MAP_MODE_SELECT,
-	ID_CMD_MAP_MODE_DISTANCE,
 	ID_CMD_MAP_LAST,
 
 	ID_CMD_MAP3D_FIRST,
@@ -358,7 +370,7 @@ enum ID_COMMANDS
 	ID_CMD_LAYOUT_FIT_SCALE,
 	ID_CMD_LAYOUT_LAST,
 
-	ID_CMD_CHILD_LAST,
+	ID_CMD_CHILD_LAST,	// Child Window Commands
 
 	//-----------------------------------------------------
 	ID_CMD_MODULE_FIRST,
diff --git a/src/saga_core/saga_gui/res_controls.h b/src/saga_core/saga_gui/res_controls.h
index e7321e9..bc21d13 100644
--- a/src/saga_core/saga_gui/res_controls.h
+++ b/src/saga_core/saga_gui/res_controls.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_controls.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: res_controls.h 1939 2014-01-14 16:48:06Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -111,8 +111,6 @@ enum ID_CONTROLS
 	ID_WND_DATA_SOURCE_WEBSERVICE,
 
 	ID_WND_PARM,
-	ID_WND_PARM_PG_ACTIVE,
-	ID_WND_PARM_PG_DIALOG,
 
 	ID_WND_WKSP,
 	ID_WND_WKSP_MODULES,
diff --git a/src/saga_core/saga_gui/res_dialogs.cpp b/src/saga_core/saga_gui/res_dialogs.cpp
index 53b55b8..548bd9f 100644
--- a/src/saga_core/saga_gui/res_dialogs.cpp
+++ b/src/saga_core/saga_gui/res_dialogs.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_dialogs.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: res_dialogs.cpp 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -148,7 +148,7 @@ wxString DLG_Get_FILE_Caption(int ID_DLG)
 	{
 	case ID_DLG_WKSP_OPEN:			return( _TL("Load") );
 
-	case ID_DLG_MODULES_OPEN:		return( _TL("Load Module Library") );
+	case ID_DLG_MODULES_OPEN:		return( _TL("Load Tool Library") );
 
 	case ID_DLG_PROJECT_OPEN:		return( _TL("Load Project") );
 	case ID_DLG_PROJECT_SAVE:		return( _TL("Save Project") );
@@ -216,7 +216,7 @@ wxString DLG_Get_FILE_Filter(int ID_DLG)
 			wxT("%s|*.*"),
 			_TL("All Recognised Files"),
 			_TL("SAGA Projects"),
-			_TL("SAGA Module Libraries"),
+			_TL("SAGA Tool Libraries"),
 			_TL("Grids"),
 			_TL("ESRI Shape Files"),
 			_TL("Tables"),
@@ -228,7 +228,7 @@ wxString DLG_Get_FILE_Filter(int ID_DLG)
 		return( wxString::Format(
 			wxT("%s (*.dll, *.so)|*.mlb;*.dll;*.so|")
 			wxT("%s|*.*"),
-			_TL("SAGA Module Libraries"),
+			_TL("SAGA Tool Libraries"),
 			_TL("All Files")
 		));
 
diff --git a/src/saga_core/saga_gui/res_images.cpp b/src/saga_core/saga_gui/res_images.cpp
index 296e986..563e1f2 100644
--- a/src/saga_core/saga_gui/res_images.cpp
+++ b/src/saga_core/saga_gui/res_images.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_images.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: res_images.cpp 2039 2014-03-05 13:26:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -151,6 +151,7 @@
 #include "./res/xpm/tb_map_mode_select.xpm"
 #include "./res/xpm/tb_map_mode_zoom.xpm"
 #include "./res/xpm/tb_map_scalebar.xpm"
+#include "./res/xpm/tb_map_north_arrow.xpm"
 #include "./res/xpm/tb_map_synchronize.xpm"
 #include "./res/xpm/tb_map_zoom_active.xpm"
 #include "./res/xpm/tb_map_zoom_full.xpm"
@@ -180,6 +181,7 @@
 #include "./res/xpm/wksp_grid_system.xpm"
 #include "./res/xpm/wksp_map.xpm"
 #include "./res/xpm/wksp_map_manager.xpm"
+#include "./res/xpm/wksp_map_graticule.xpm"
 #include "./res/xpm/wksp_module.xpm"
 #include "./res/xpm/wksp_module_library.xpm"
 #include "./res/xpm/wksp_module_manager.xpm"
@@ -290,6 +292,7 @@ const char ** IMG_Get_XPM(int ID_IMG)
 	case ID_IMG_TB_MAP_MODE_SELECT:	return( tb_map_mode_select_xpm );
 	case ID_IMG_TB_MAP_MODE_ZOOM:	return( tb_map_mode_zoom_xpm );
     case ID_IMG_TB_MAP_SCALEBAR:	return( tb_map_scalebar_xpm );
+	case ID_IMG_TB_MAP_NORTH_ARROW:	return( tb_map_north_arrow_xpm );
 	case ID_IMG_TB_MAP_SYNCHRONIZE:	return( tb_map_synchronize_xpm );
 	case ID_IMG_TB_MAP_ZOOM_ACTIVE:	return( tb_map_zoom_active_xpm );
 	case ID_IMG_TB_MAP_ZOOM_FULL:	return( tb_map_zoom_full_xpm );
@@ -318,6 +321,7 @@ const char ** IMG_Get_XPM(int ID_IMG)
 	case ID_IMG_WKSP_GRID_MANAGER:	return( wksp_grid_manager_xpm );
 	case ID_IMG_WKSP_GRID_SYSTEM:	return( wksp_grid_system_xpm );
 	case ID_IMG_WKSP_MAP:	return( wksp_map_xpm );
+	case ID_IMG_WKSP_MAP_GRATICULE:	return( wksp_map_graticule_xpm );
 	case ID_IMG_WKSP_MAP_MANAGER:	return( wksp_map_manager_xpm );
 	case ID_IMG_WKSP_MODULE:	return( wksp_module_xpm );
 	case ID_IMG_WKSP_MODULE_LIBRARY:	return( wksp_module_library_xpm );
diff --git a/src/saga_core/saga_gui/res_images.h b/src/saga_core/saga_gui/res_images.h
index 74f2255..9905342 100644
--- a/src/saga_core/saga_gui/res_images.h
+++ b/src/saga_core/saga_gui/res_images.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_images.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: res_images.h 2039 2014-03-05 13:26:00Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -167,6 +167,7 @@ enum ID_IMAGES
 	ID_IMG_TB_MAP_MODE_SELECT,
 	ID_IMG_TB_MAP_MODE_ZOOM,
 	ID_IMG_TB_MAP_SCALEBAR,
+	ID_IMG_TB_MAP_NORTH_ARROW,
 	ID_IMG_TB_MAP_SYNCHRONIZE,
 	ID_IMG_TB_MAP_ZOOM_ACTIVE,
 	ID_IMG_TB_MAP_ZOOM_FULL,
@@ -197,6 +198,7 @@ enum ID_IMAGES
 	ID_IMG_WKSP_GRID_SYSTEM,
 	ID_IMG_WKSP_MAP,
 	ID_IMG_WKSP_MAP_MANAGER,
+	ID_IMG_WKSP_MAP_GRATICULE,
 	ID_IMG_WKSP_MODULE,
 	ID_IMG_WKSP_MODULE_LIBRARY,
 	ID_IMG_WKSP_MODULE_MANAGER,
diff --git a/src/saga_core/saga_gui/saga.cpp b/src/saga_core/saga_gui/saga.cpp
index 666cbc9..24b8e85 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: saga.cpp 2070 2014-03-28 11:18:40Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -105,13 +105,7 @@ END_EVENT_TABLE()
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#define SAGA_GUI_BUILD			wxT("20130701")
-
-//---------------------------------------------------------
-const wxChar *	SAGA_GUI_Get_Build(void)
-{
-	return( SAGA_GUI_BUILD );
-}
+#define SAGA_GUI_BUILD	"20140214"
 
 
 ///////////////////////////////////////////////////////////
@@ -141,13 +135,16 @@ bool CSAGA::OnInit(void)
 	//-----------------------------------------------------
 	g_pSAGA				= this;
 
-	SetVendorName		(wxT("SAGA-GIS.org"));
-	SetAppName			(wxT("SAGA"));
+	SetVendorName		("SAGA-GIS.org");
+	SetAppName			("SAGA");
 
 	wxInitAllImageHandlers();
 
 	m_App_Path			= wxFileName(argv[0]).GetPath();
 
+#if !defined(_DEBUG)
+	wxSetAssertHandler(NULL);		// disable all wx asserts in SAGA release builds
+#endif
 
 	/* workaround: wxwidgets 2.9.3 is complaining about setlocale
 	 * mismatch between c setlocale and wxLocale. since saga has its own
@@ -157,21 +154,20 @@ bool CSAGA::OnInit(void)
 	 * implemented (wxPrintf_l and similar still missing). */
 	//setlocale(LC_NUMERIC, "C");
 	m_wxLocale.Init(wxLANGUAGE_ENGLISH);
-	
-	
+
+
 	_Init_Config();
 
 	//-----------------------------------------------------
 	long			lValue;
 
 	m_Process_bContinue	= true;
-	m_Process_Frequency	= CONFIG_Read(wxT("/MODULES"), wxT("PROC_FREQ"), lValue) ? lValue : 0;
+	m_Process_Frequency	= CONFIG_Read("/MODULES", "PROCESS_UPDATE", lValue) ? lValue : 0;
 
 	//-----------------------------------------------------
-	long			iLogo;
 	wxSplashScreen	*pLogo;
 
-	iLogo	= CONFIG_Read(wxT("/MODULES"), wxT("START_LOGO"), iLogo) ? iLogo : 1;
+	long	iLogo		= CONFIG_Read("/MODULES", "START_LOGO"    , iLogo ) ? iLogo : 1;
 
 	switch( iLogo )
 	{
@@ -195,41 +191,55 @@ bool CSAGA::OnInit(void)
 #if defined(_SAGA_MSW)
 	wxString	Path;
 
-	if( wxGetEnv(wxT("PATH"), &Path) && Path.Length() > 0 )
+	if( wxGetEnv("PATH", &Path) && Path.Length() > 0 )
 	{
-		wxSetEnv("PATH", Get_App_Path() + wxT("\\dll;") + Path);
+		wxSetEnv("PATH", Get_App_Path() + "\\dll;" + Path);
 	}
 	else
 	{
-		wxSetEnv("PATH", Get_App_Path() + wxT("\\dll"));
+		wxSetEnv("PATH", Get_App_Path() + "\\dll");
 	}
 
-	wxSetEnv(wxT("GDAL_DRIVER_PATH"), Get_App_Path() + wxT("\\dll"));
+	wxSetEnv("GDAL_DRIVER_PATH", Get_App_Path() + "\\dll");
 #endif // defined(_SAGA_MSW)
 
 	//-----------------------------------------------------
 	wxString	File;
 
 	//-----------------------------------------------------
-	if( !CONFIG_Read(wxT("/MODULES"), wxT("LNG_FILE_DIC"), File) || !wxFileExists(File) )
+	if( !CONFIG_Read("/MODULES", "LNG_FILE_DIC", File) || !wxFileExists(File) )
 	{
-		File	= SG_File_Make_Path(Get_App_Path(), SG_T("saga"), SG_T("lng")).c_str();
+		File	= wxFileName(Get_App_Path(), "saga", "lng").GetFullPath();
 	}
 
 	SG_Get_Translator().Create(&File, false);
 
 	//-----------------------------------------------------
-	if( !CONFIG_Read(wxT("/MODULES"), wxT("CRS_FILE_DIC"), File) || !wxFileExists(File) )
+	long oldstyle; if( CONFIG_Read("/MODULES", "LNG_OLDSTYLE", oldstyle) && oldstyle ) SG_Set_OldStyle_Naming();
+	//-----------------------------------------------------
+
+	//-----------------------------------------------------
+	if( !CONFIG_Read("/MODULES", "CRS_FILE_DIC", File) || !wxFileExists(File) )
 	{
-		File	= SG_File_Make_Path(Get_App_Path(), SG_T("saga_prj"), SG_T("dic")).c_str();
+#if defined(_SAGA_LINUX)
+		File	= wxFileName(SHARE_PATH, "saga_prj", "dic").GetFullPath();
+#endif
+#if defined(_SAGA_MSW)
+		File	= wxFileName(Get_App_Path(), "saga_prj", "dic").GetFullPath();
+#endif
 	}
 
 	SG_Get_Projections().Load_Dictionary(&File);
 
 	//-----------------------------------------------------
-	if( !CONFIG_Read(wxT("/MODULES"), wxT("CRS_FILE_SRS"), File) || !wxFileExists(File) )
+	if( !CONFIG_Read("/MODULES", "CRS_FILE_SRS", File) || !wxFileExists(File) )
 	{
-		File	= SG_File_Make_Path(Get_App_Path(), SG_T("saga_prj"), SG_T("srs")).c_str();
+#if defined(_SAGA_LINUX)
+		File	= wxFileName(SHARE_PATH, "saga_prj", "srs").GetFullPath();
+#endif
+#if defined(_SAGA_MSW)
+		File	= wxFileName(Get_App_Path(), "saga_prj", "srs").GetFullPath();
+#endif
 	}
 
 	SG_Get_Projections().Load_DB(&File);
@@ -281,13 +291,13 @@ void CSAGA::_Init_Config(void)
 	wxConfigBase	*pConfig;
 
 #if defined(_SAGA_MSW)
-	wxFileName	fConfig(Get_App_Path(), wxT("saga_gui"), wxT("ini"));
+	wxFileName	fConfig(Get_App_Path(), "saga_gui", "ini");
 
 	if(	( fConfig.FileExists() && (!fConfig.IsFileReadable() || !fConfig.IsFileWritable()))
 	||	(!fConfig.FileExists() && (!fConfig.IsDirReadable () || !fConfig.IsDirWritable ())) )
 	{
-		fConfig.Assign(wxGetHomeDir(), wxT("saga_gui"), wxT("ini"));
-		//fConfig.Assign(wxFileName::GetTempDir(), wxT("saga_gui"), wxT("ini"));
+		fConfig.Assign(wxGetHomeDir(), "saga_gui", "ini");
+		//fConfig.Assign(wxFileName::GetTempDir(), "saga_gui", "ini");
 	}
 
 	pConfig = new wxFileConfig(wxEmptyString, wxEmptyString, fConfig.GetFullPath(), fConfig.GetFullPath(), wxCONFIG_USE_LOCAL_FILE|wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_RELATIVE_PATH);
@@ -300,11 +310,11 @@ void CSAGA::_Init_Config(void)
 	//-----------------------------------------------------
 	wxString	s;
 
-	if( !CONFIG_Read(wxT("Version"), wxT("Build"), s) || s.Cmp(SAGA_GUI_Get_Build()) )
+	if( !CONFIG_Read("Version", "Build", s) || s.Cmp(SAGA_GUI_BUILD) )
 	{
 		long	l;
 
-		pConfig->SetPath(wxT("/"));
+		pConfig->SetPath("/");
 
 		while( pConfig->GetFirstGroup(s, l) )
 		{
@@ -313,7 +323,7 @@ void CSAGA::_Init_Config(void)
 
 		pConfig->Flush();
 
-		CONFIG_Write(wxT("Version"), wxT("Build"), SAGA_GUI_Get_Build());
+		CONFIG_Write("Version", "Build", SAGA_GUI_BUILD);
 	}
 }
 
diff --git a/src/saga_core/saga_gui/saga.h b/src/saga_core/saga_gui/saga.h
index 30a2b84..9b150ae 100644
--- a/src/saga_core/saga_gui/saga.h
+++ b/src/saga_core/saga_gui/saga.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: saga.h 1993 2014-02-13 16:38:16Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -82,16 +82,6 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-const wxChar *	SAGA_GUI_Get_Build		(void);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
 class CSAGA : public wxApp
 {
 public:
diff --git a/src/saga_core/saga_gui/saga_frame.cpp b/src/saga_core/saga_gui/saga_frame.cpp
index 0d5fafc..4f38fb0 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: saga_frame.cpp 2047 2014-03-06 13:02:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -431,7 +431,7 @@ void CSAGA_Frame::On_Close(wxCloseEvent &event)
 		{
 			if( g_pModule )
 			{
-				DLG_Message_Show(_TL("Please stop module execution before exiting SAGA."), _TL("Exit SAGA"));
+				DLG_Message_Show(_TL("Please stop tool execution before exiting SAGA."), _TL("Exit SAGA"));
 			}
 
 			event.Veto();
@@ -752,7 +752,7 @@ bool CSAGA_Frame::Process_Set_Okay(bool bOkay)
 {
 	StatusBar_Set_Text(_TL("ready"));
 
-	ProgressBar_Set_Position(0);
+	ProgressBar_Set_Position(-1);
 
 	g_pSAGA->Process_Set_Okay(bOkay);
 
@@ -764,16 +764,19 @@ bool CSAGA_Frame::ProgressBar_Set_Position(int Position)
 {
 	if( Position < 0 )
 	{
-		Position	= 0;
+		m_pProgressBar->SetValue(0);
 	}
-	else if( Position > 100 )
+	else
 	{
-		Position	= 100;
-	}
+		if( Position > 100 )
+		{
+			Position	= 100;
+		}
 
-	if( m_pProgressBar->GetValue() != Position )
-	{
-		m_pProgressBar->SetValue(Position);
+		if( m_pProgressBar->GetValue() != Position )
+		{
+			m_pProgressBar->SetValue(Position);
+		}
 	}
 
 	return( Process_Get_Okay(false) );
@@ -890,6 +893,7 @@ void CSAGA_Frame::On_Child_Activates(int View_ID)
 	}
 
 	//-----------------------------------------------------
+	_Bar_Show(m_pTB_Main		, true);
 	_Bar_Show(m_pTB_Table		, pToolBar == m_pTB_Table);
 	_Bar_Show(m_pTB_Diagram		, pToolBar == m_pTB_Diagram);
 	_Bar_Show(m_pTB_Map			, pToolBar == m_pTB_Map);
@@ -969,10 +973,10 @@ wxMenuBar * CSAGA_Frame::_Create_MenuBar(void)
 	//-----------------------------------------------------
 	wxMenuBar	*pMenuBar	= new wxMenuBar;
 
-	pMenuBar->Append(g_pData   ->Get_Menu_Files  ()->Get_Menu(), _TL("File"   ));	// 0
-	pMenuBar->Append(g_pModules->Get_Menu_Modules()->Get_Menu(), _TL("Modules"));	// 1
-	pMenuBar->Append(pMenu_Window                              , _TL("Window" ));	// 2
-	pMenuBar->Append(pMenu_Help                                , _TL("?"      ));	// 3
+	pMenuBar->Append(g_pData   ->Get_Menu_Files  ()->Get_Menu(), _TL("File"         ));	// 0
+	pMenuBar->Append(g_pModules->Get_Menu_Modules()->Get_Menu(), _TL("Geoprocessing"));	// 1
+	pMenuBar->Append(pMenu_Window                              , _TL("Window"       ));	// 2
+	pMenuBar->Append(pMenu_Help                                , _TL("?"            ));	// 3
 
 	SetMenuBar(pMenuBar);
 
@@ -999,57 +1003,56 @@ void CSAGA_Frame::Set_Pane_Caption(wxWindow *pWindow, const wxString &Caption)
 //---------------------------------------------------------
 void CSAGA_Frame::_Bar_Add(wxWindow *pWindow, int Position, int Row)
 {
-	wxAuiPaneInfo	Info;
+	wxAuiPaneInfo	Pane;
 
-	Info.Name			(pWindow->GetName());
-	Info.Caption		(pWindow->GetName());
-	Info.MinSize		(100, 100);
-	Info.BestSize		(400, 400);
-	Info.FloatingSize	(400, 400);
-	Info.Position		(0);
-	Info.Layer			(Row);
-	Info.Row			(Row);
+	Pane.Name			(pWindow->GetName());
+	Pane.Caption		(pWindow->GetName());
+	Pane.MinSize		(100, 100);
+	Pane.BestSize		(400, 400);
+	Pane.FloatingSize	(400, 400);
+	Pane.Position		(0);
+	Pane.Layer			(Row);
+	Pane.Row			(Row);
 
 	switch( Position )
 	{
 	default:
-	case 0:	Info.Bottom();	break;
-	case 1:	Info.Right ();	break;
-	case 2:	Info.Left  ();	break;
-	case 3:	Info.Top   ();	break;
-	case 4:	Info.Center();	break;
+	case 0:	Pane.Bottom();	break;
+	case 1:	Pane.Right ();	break;
+	case 2:	Pane.Left  ();	break;
+	case 3:	Pane.Top   ();	break;
+	case 4:	Pane.Center();	break;
 	}
 
-	m_pLayout->AddPane(pWindow, Info);
+	m_pLayout->AddPane(pWindow, Pane);
 }
 
 //---------------------------------------------------------
 void CSAGA_Frame::_Bar_Toggle(wxWindow *pWindow)
 {
-	if( pWindow->IsShown() && m_pLayout->GetPane(pWindow).IsShown() )
+	if( m_pLayout->GetPane(pWindow).IsOk() )
 	{
-		m_pLayout->GetPane(pWindow).Hide();
-
-		if( m_pLayout->GetPane(pWindow).IsToolbar() )
-			pWindow->Hide();
+		_Bar_Show(pWindow, !m_pLayout->GetPane(pWindow).IsShown());
 	}
-	else
-	{
-		if( m_pLayout->GetPane(pWindow).IsToolbar() )
-			pWindow->Show();
-
-		m_pLayout->GetPane(pWindow).Show();
-	}
-
-	m_pLayout->Update();
 }
 
 //---------------------------------------------------------
 void CSAGA_Frame::_Bar_Show(wxWindow *pWindow, bool bShow)
 {
-	if( pWindow && pWindow->IsShown() != bShow )
+	wxAuiPaneInfo	Pane(m_pLayout->GetPane(pWindow));
+
+	if( Pane.IsOk() && Pane.IsShown() != bShow )
 	{
-		_Bar_Toggle(pWindow);
+		Pane.Show(bShow);
+
+		if( bShow && Pane.IsToolbar() && Pane.IsDocked() )
+		{
+			Pane.Position(pWindow == m_pTB_Main ? 0 : 1);
+		}
+
+		m_pLayout->GetPane(pWindow)	= Pane;
+
+		m_pLayout->Update();
 	}
 }
 
@@ -1077,10 +1080,8 @@ wxToolBarBase * CSAGA_Frame::TB_Create(int ID)
 void CSAGA_Frame::TB_Add(wxToolBarBase *pToolBar, const wxString &Name)
 {
 	pToolBar->Realize();
-	pToolBar->Hide();
 
 	m_pLayout->AddPane(pToolBar, wxAuiPaneInfo()
-	//	.Name			(pToolBar->GetName())
 		.Name			(Name)
 		.Caption		(Name)
 		.ToolbarPane	()
@@ -1113,15 +1114,18 @@ wxToolBarBase * CSAGA_Frame::_Create_ToolBar(void)
 	wxToolBarBase	*pToolBar	= TB_Create(ID_TB_MAIN);
 
 	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_WKSP_OPEN);
+	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_WKSP_SAVE);
 	CMD_ToolBar_Add_Separator(pToolBar);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_FRAME_WKSP_SHOW);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_FRAME_ACTIVE_SHOW);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_FRAME_DATA_SOURCE_SHOW);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_FRAME_INFO_SHOW);
 	CMD_ToolBar_Add_Separator(pToolBar);
+	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_MODULES_SEARCH);
+	CMD_ToolBar_Add_Separator(pToolBar);
 	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_FRAME_HELP);
 
-	TB_Add(pToolBar, _TL("Standard"));
+	TB_Add(pToolBar, _TL("Main"));
 
 	return( pToolBar );
 }
diff --git a/src/saga_core/saga_gui/view_base.cpp b/src/saga_core/saga_gui/view_base.cpp
index e1fba24..5fabd27 100644
--- a/src/saga_core/saga_gui/view_base.cpp
+++ b/src/saga_core/saga_gui/view_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_base.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_base.cpp 2066 2014-03-24 08:55:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,6 +76,9 @@
 
 #include "view_base.h"
 
+#include "wksp_data_item.h"
+#include "wksp_map.h"
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -100,9 +103,10 @@ END_EVENT_TABLE()
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CVIEW_Base::CVIEW_Base(int View_ID, wxString Caption, int Icon_ID)
+CVIEW_Base::CVIEW_Base(class CWKSP_Base_Item *pOwner, int View_ID, wxString Caption, int Icon_ID, bool bShow)
 	: wxMDIChildFrame(g_pSAGA_Frame, -1, Caption, MDI_Get_Def_Position(), MDI_Get_Def_Size(), wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
 {
+	m_pOwner		= pOwner;
 	m_View_ID		= View_ID;
 
 	m_Size_Min.x	= 0;
@@ -112,12 +116,29 @@ CVIEW_Base::CVIEW_Base(int View_ID, wxString Caption, int Icon_ID)
 
 	SetIcon(IMG_Get_Icon(Icon_ID));
 
-	Show(true);
+	if( bShow )
+	{
+		Do_Show();
+	}
 }
 
 //---------------------------------------------------------
 CVIEW_Base::~CVIEW_Base(void)
 {
+	if( m_pOwner )
+	{
+		switch( m_pOwner->Get_Type() )
+		{
+		case WKSP_ITEM_Map:
+			((CWKSP_Map       *)m_pOwner)->View_Closes(this);
+			break;
+
+		default:
+			((CWKSP_Data_Item *)m_pOwner)->View_Closes(this);
+			break;
+		}
+	}
+
 	if( g_pSAGA_Frame )
 	{
 		g_pSAGA_Frame->On_Child_Activates(-1);
@@ -132,6 +153,46 @@ CVIEW_Base::~CVIEW_Base(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Base::Do_Show(void)
+{
+	switch( m_pOwner->Get_Type() )
+	{
+	case WKSP_ITEM_Map:
+		((CWKSP_Map       *)m_pOwner)->View_Opened(this);
+		break;
+
+	default:
+		((CWKSP_Data_Item *)m_pOwner)->View_Opened(this);
+		break;
+	}
+
+	Show();
+
+	Activate();
+}
+
+//---------------------------------------------------------
+void CVIEW_Base::Do_Destroy(void)
+{
+	m_pOwner	= NULL;
+
+	Destroy();
+}
+
+//---------------------------------------------------------
+void CVIEW_Base::Do_Update(void)
+{
+	// NOP
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 void CVIEW_Base::Set_Size_Min(int x, int y)
 {
 	m_Size_Min.x	= x;
diff --git a/src/saga_core/saga_gui/view_base.h b/src/saga_core/saga_gui/view_base.h
index 05e49a2..a131e57 100644
--- a/src/saga_core/saga_gui/view_base.h
+++ b/src/saga_core/saga_gui/view_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_base.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_base.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,21 +86,28 @@
 class CVIEW_Base : public wxMDIChildFrame
 {
 public:
-	CVIEW_Base(int View_ID, wxString Caption, int Icon_ID);
+	CVIEW_Base(class CWKSP_Base_Item *pOwner, int View_ID, wxString Caption, int Icon_ID, bool bShow = true);
 	virtual ~CVIEW_Base(void);
 
-	void						On_Size				(wxSizeEvent     &event);
-	void						On_Activate			(wxActivateEvent &event);
-
-	void						On_Quit				(wxCommandEvent  &event);
+	virtual void				Do_Destroy			(void);
+	virtual void				Do_Update			(void);
 
 	virtual void				On_Command_UI		(wxUpdateUIEvent &event);
 
 
 protected:
 
+	class CWKSP_Base_Item		*m_pOwner;
+
+
+	void						Do_Show				(void);
+
 	void						Set_Size_Min		(int x, int y);
 
+	void						On_Size				(wxSizeEvent     &event);
+	void						On_Activate			(wxActivateEvent &event);
+	void						On_Quit				(wxCommandEvent  &event);
+
 
 private:
 
@@ -109,10 +116,10 @@ private:
 	wxSize						m_Size_Min;
 
 
-private:
-
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Base)
+	DECLARE_EVENT_TABLE()
+
 };
 
 
diff --git a/src/saga_core/saga_gui/view_histogram.cpp b/src/saga_core/saga_gui/view_histogram.cpp
index bb6f21a..c3125d2 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_histogram.cpp 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -477,18 +477,11 @@ END_EVENT_TABLE()
 
 //---------------------------------------------------------
 CVIEW_Histogram::CVIEW_Histogram(CWKSP_Layer *pLayer)
-	: CVIEW_Base(ID_VIEW_HISTOGRAM, pLayer->Get_Name(), ID_IMG_WND_HISTOGRAM)
+	: CVIEW_Base(pLayer, ID_VIEW_HISTOGRAM, pLayer->Get_Name(), ID_IMG_WND_HISTOGRAM)
 {
-	m_pLayer	= pLayer;
 	m_pControl	= new CVIEW_Histogram_Control(this, pLayer);
 }
 
-//---------------------------------------------------------
-CVIEW_Histogram::~CVIEW_Histogram(void)
-{
-	m_pLayer->View_Closes(this);
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -524,6 +517,17 @@ wxToolBarBase * CVIEW_Histogram::_Create_ToolBar(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Histogram::Do_Update(void)
+{
+	m_pControl->Update_Histogram();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 void CVIEW_Histogram::On_Command_UI(wxUpdateUIEvent &event)
 {
 	switch( event.GetId() )
@@ -551,50 +555,45 @@ void CVIEW_Histogram::On_Cumulative_UI(wxUpdateUIEvent &event)
 //---------------------------------------------------------
 void CVIEW_Histogram::On_AsTable(wxCommandEvent &event)
 {
-	int					i, n;
-	double				dArea	= m_pLayer->Get_Type() == WKSP_ITEM_Grid ? ((CSG_Grid *)m_pLayer->Get_Object())->Get_Cellarea() : 1.0;
-	CSG_Table			*pTable;
-	CSG_Table_Record	*pRecord;
+	CWKSP_Layer_Classify	*pClassifier	= ((CWKSP_Layer *)m_pOwner)->Get_Classifier();
 
-	if( (n = m_pLayer->Get_Classifier()->Get_Class_Count()) > 0 )
+	if( pClassifier->Get_Class_Count() > 0 )
 	{
-		pTable	= new CSG_Table;
+		CSG_Data_Object	*pObject	= ((CWKSP_Layer *)m_pOwner)->Get_Object();
+
+		CSG_Table	*pTable	= new CSG_Table;
+
+		pTable->Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Histogram"), pObject->Get_Name()));
 
-		pTable->Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Histogram"), m_pLayer->Get_Object()->Get_Name()));
+		pTable->Add_Field(_TL("CLASS" ), SG_DATATYPE_Int);
+		pTable->Add_Field(_TL("AREA"  ), SG_DATATYPE_Double);
+		pTable->Add_Field(_TL("COUNT" ), SG_DATATYPE_Int);
+		pTable->Add_Field(_TL("CUMUL" ), SG_DATATYPE_Int);
+		pTable->Add_Field(_TL("NAME"  ), SG_DATATYPE_String);
+		pTable->Add_Field(_TL("MIN"   ), SG_DATATYPE_Double);
+		pTable->Add_Field(_TL("CENTER"), SG_DATATYPE_Double);
+		pTable->Add_Field(_TL("MAX"   ), SG_DATATYPE_Double);
 
-		pTable->Add_Field(_TL("CLASS")	, SG_DATATYPE_Int);
-		pTable->Add_Field(_TL("AREA")	, SG_DATATYPE_Double);
-		pTable->Add_Field(_TL("COUNT")	, SG_DATATYPE_Int);
-		pTable->Add_Field(_TL("CUMUL")	, SG_DATATYPE_Int);
-		pTable->Add_Field(_TL("NAME")	, SG_DATATYPE_String);
-		pTable->Add_Field(_TL("MIN")	, SG_DATATYPE_Double);
-		pTable->Add_Field(_TL("CENTER")	, SG_DATATYPE_Double);
-		pTable->Add_Field(_TL("MAX")	, SG_DATATYPE_Double);
+		double	dArea	= pObject->asGrid() != NULL ? pObject->asGrid()->Get_Cellarea() : 1.0;
 
-		for(i=0; i<n; i++)
+		for(int i=0; i<pClassifier->Get_Class_Count(); i++)
 		{
-			pRecord	= pTable->Add_Record();
+			CSG_Table_Record	*pRecord	= pTable->Add_Record();
 
 			pRecord->Set_Value(0, i + 1);
-			pRecord->Set_Value(2, m_pLayer->Get_Classifier()->Histogram_Get_Count     (i, false) * dArea);
-			pRecord->Set_Value(1, m_pLayer->Get_Classifier()->Histogram_Get_Count     (i, false));
-			pRecord->Set_Value(3, m_pLayer->Get_Classifier()->Histogram_Get_Cumulative(i, false));
-			pRecord->Set_Value(4, m_pLayer->Get_Classifier()->Get_Class_Name          (i).wx_str());
-			pRecord->Set_Value(5, m_pLayer->Get_Classifier()->Get_Class_Value_Minimum (i));
-			pRecord->Set_Value(6, m_pLayer->Get_Classifier()->Get_Class_Value_Center  (i));
-			pRecord->Set_Value(7, m_pLayer->Get_Classifier()->Get_Class_Value_Maximum (i));
+			pRecord->Set_Value(2, pClassifier->Histogram_Get_Count     (i, false) * dArea);
+			pRecord->Set_Value(1, 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));
+			pRecord->Set_Value(6, pClassifier->Get_Class_Value_Center  (i));
+			pRecord->Set_Value(7, pClassifier->Get_Class_Value_Maximum (i));
 		}
 
 		g_pData->Add(pTable);
 	}
 }
 
-//---------------------------------------------------------
-bool CVIEW_Histogram::Update_Histogram(void)
-{
-	return( m_pControl->Update_Histogram() );
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_gui/view_histogram.h b/src/saga_core/saga_gui/view_histogram.h
index fc0ff3a..1d8685f 100644
--- a/src/saga_core/saga_gui/view_histogram.h
+++ b/src/saga_core/saga_gui/view_histogram.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_histogram.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_histogram.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,30 +86,28 @@ class CVIEW_Histogram : public CVIEW_Base
 {
 public:
 	CVIEW_Histogram(class CWKSP_Layer *pLayer);
-	virtual ~CVIEW_Histogram(void);
 
 	static class wxToolBarBase *	_Create_ToolBar		(void);
 	static class wxMenu *			_Create_Menu		(void);
 
-	bool							Update_Histogram	(void);
+	virtual void					Do_Update			(void);
 
+	virtual void					On_Command_UI		(wxUpdateUIEvent &event);
 
-private:
 
-	class CWKSP_Layer				*m_pLayer;
+private:
 
 	class CVIEW_Histogram_Control	*m_pControl;
 
 
-	virtual void					On_Command_UI		(wxUpdateUIEvent &event);
-
 	void							On_Cumulative		(wxCommandEvent  &event);
 	void							On_Cumulative_UI	(wxUpdateUIEvent &event);
 	void							On_AsTable			(wxCommandEvent  &event);
 
 
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Histogram)
+	DECLARE_EVENT_TABLE()
 
 };
 
diff --git a/src/saga_core/saga_gui/view_layout.cpp b/src/saga_core/saga_gui/view_layout.cpp
index f8760e1..d24cc09 100644
--- a/src/saga_core/saga_gui/view_layout.cpp
+++ b/src/saga_core/saga_gui/view_layout.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_layout.cpp 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -109,7 +109,7 @@ END_EVENT_TABLE()
 
 //---------------------------------------------------------
 CVIEW_Layout::CVIEW_Layout(CVIEW_Layout_Info *pInfo)
-	: CVIEW_Base(ID_VIEW_LAYOUT, _TL("Layout"), ID_IMG_WND_LAYOUT)
+: CVIEW_Base(pInfo->Get_Map(), ID_VIEW_LAYOUT, _TL("Layout"), ID_IMG_WND_LAYOUT, false)
 {
 	SetTitle(wxString::Format(wxT("%s [%s]"), pInfo->Get_Map()->Get_Name().c_str(), _TL("Layout")));
 
@@ -121,12 +121,8 @@ CVIEW_Layout::CVIEW_Layout(CVIEW_Layout_Info *pInfo)
 	m_pRuler_Y	= new CVIEW_Ruler(this, RULER_VERTICAL  |RULER_EDGE_SUNKEN);
 
 	m_pControl	= new CVIEW_Layout_Control(this);
-}
 
-//---------------------------------------------------------
-CVIEW_Layout::~CVIEW_Layout(void)
-{
-	m_pInfo->Get_Map()->View_Closes(this);
+	Do_Show();
 }
 
 
@@ -174,6 +170,19 @@ wxToolBarBase * CVIEW_Layout::_Create_ToolBar(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Layout::Do_Update(void)
+{
+	m_pControl->Refresh_Layout();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 void CVIEW_Layout::On_Size(wxSizeEvent &event)
 {
 	int		A, B, d, dX, dY;
@@ -230,19 +239,6 @@ void CVIEW_Layout::Ruler_Refresh(double xMin, double xMax, double yMin, double y
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CVIEW_Layout::Refresh_Layout(void)
-{
-	return( m_pControl->Refresh_Layout() );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
 void CVIEW_Layout::On_Print_Setup(wxCommandEvent &event)
 {
 	if( m_pInfo->Setup_Print() )
diff --git a/src/saga_core/saga_gui/view_layout.h b/src/saga_core/saga_gui/view_layout.h
index b87f558..518d06b 100644
--- a/src/saga_core/saga_gui/view_layout.h
+++ b/src/saga_core/saga_gui/view_layout.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_layout.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,26 +86,17 @@ class CVIEW_Layout : public CVIEW_Base
 {
 public:
 	CVIEW_Layout(class CVIEW_Layout_Info *pInfo);
-	virtual ~CVIEW_Layout(void);
 
 	static class wxToolBarBase *	_Create_ToolBar		(void);
 	static class wxMenu *			_Create_Menu		(void);
 
-	void							On_Size				(wxSizeEvent  &event);
-
-	void							On_Page_Setup		(wxCommandEvent &event);
-	void							On_Print_Setup		(wxCommandEvent &event);
-	void							On_Print			(wxCommandEvent &event);
-	void							On_Print_Preview	(wxCommandEvent &event);
-	void							On_Fit_Scale		(wxCommandEvent &event);
+	virtual void					Do_Update			(void);
 
 	class CVIEW_Layout_Info *		Get_Info			(void)	{	return( m_pInfo );	}
 
 	void							Ruler_Set_Position	(int x, int y);
 	void							Ruler_Refresh		(double xMin, double xMax, double yMin, double yMax);
 
-	bool							Refresh_Layout		(void);
-
 
 private:
 
@@ -116,10 +107,18 @@ private:
 	class CVIEW_Layout_Control		*m_pControl;
 
 
-private:
+	void							On_Size				(wxSizeEvent  &event);
 
-	DECLARE_EVENT_TABLE()
+	void							On_Page_Setup		(wxCommandEvent &event);
+	void							On_Print_Setup		(wxCommandEvent &event);
+	void							On_Print			(wxCommandEvent &event);
+	void							On_Print_Preview	(wxCommandEvent &event);
+	void							On_Fit_Scale		(wxCommandEvent &event);
+
+
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Layout)
+	DECLARE_EVENT_TABLE()
 
 };
 
diff --git a/src/saga_core/saga_gui/view_map.cpp b/src/saga_core/saga_gui/view_map.cpp
index 35e6b00..737564a 100644
--- a/src/saga_core/saga_gui/view_map.cpp
+++ b/src/saga_core/saga_gui/view_map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map.cpp 2066 2014-03-24 08:55:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -69,6 +69,9 @@
 
 #include "helper.h"
 
+#include "active.h"
+
+#include "wksp_layer.h"
 #include "wksp_map.h"
 
 #include "view_ruler.h"
@@ -94,6 +97,8 @@ BEGIN_EVENT_TABLE(CVIEW_Map, CVIEW_Base)
 	EVT_MENU			(ID_CMD_MAP_3D_SHOW						, CVIEW_Map::On_Map_3D_Show)
 	EVT_MENU			(ID_CMD_MAP_LAYOUT_SHOW					, CVIEW_Map::On_Map_Layout_Show)
 	EVT_MENU			(ID_CMD_MAP_SCALEBAR					, CVIEW_Map::On_Map_ScaleBar)
+	EVT_MENU			(ID_CMD_MAP_NORTH_ARROW					, CVIEW_Map::On_Map_North_Arrow)
+	EVT_MENU			(ID_CMD_MAP_GRATICULE_ADD				, CVIEW_Map::On_Map_Graticule)
 	EVT_MENU			(ID_CMD_MAP_SAVE_IMAGE					, CVIEW_Map::On_Map_Save_Image)
 	EVT_MENU			(ID_CMD_MAP_SAVE_IMAGE_ON_CHANGE		, CVIEW_Map::On_Map_Save_Image_On_Change)
 	EVT_MENU			(ID_CMD_MAPS_SAVE_IMAGE_TO_MEMORY		, CVIEW_Map::On_Map_Save_Image_To_Memory)
@@ -123,7 +128,7 @@ END_EVENT_TABLE()
 
 //---------------------------------------------------------
 CVIEW_Map::CVIEW_Map(CWKSP_Map *pMap, int Frame_Width)
-	: CVIEW_Base(ID_VIEW_MAP, pMap->Get_Name(), ID_IMG_WND_MAP)
+	: CVIEW_Base(pMap, ID_VIEW_MAP, pMap->Get_Name(), ID_IMG_WND_MAP, false)
 {
 	SYS_Set_Color_BG_Window(this);
 
@@ -139,12 +144,8 @@ CVIEW_Map::CVIEW_Map(CWKSP_Map *pMap, int Frame_Width)
 	m_Ruler_Size	= 20;
 
 	Ruler_Set_Width(Frame_Width);
-}
 
-//---------------------------------------------------------
-CVIEW_Map::~CVIEW_Map(void)
-{
-	m_pMap->View_Closes(this);
+	Do_Show();
 }
 
 
@@ -164,6 +165,8 @@ wxMenu * CVIEW_Map::_Create_Menu(void)
 	CMD_Menu_Add_Item(pMenu, true , ID_CMD_MAP_3D_SHOW);
 	CMD_Menu_Add_Item(pMenu, true , ID_CMD_MAP_LAYOUT_SHOW);
 	CMD_Menu_Add_Item(pMenu, true , ID_CMD_MAP_SCALEBAR);
+	CMD_Menu_Add_Item(pMenu, true , ID_CMD_MAP_NORTH_ARROW);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAP_GRATICULE_ADD);
 	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAP_SAVE_IMAGE);
 //	CMD_Menu_Add_Item(pMenu, true , ID_CMD_MAP_SAVE_IMAGE_ON_CHANGE);
@@ -207,7 +210,9 @@ wxToolBarBase * CVIEW_Map::_Create_ToolBar(void)
 	CMD_ToolBar_Add_Separator(pToolBar);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_MAP_3D_SHOW);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_MAP_LAYOUT_SHOW);
+	CMD_ToolBar_Add_Separator(pToolBar);
 	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_MAP_SCALEBAR);
+	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_MAP_NORTH_ARROW);
 
 	CMD_ToolBar_Add(pToolBar, _TL("Map"));
 
@@ -222,6 +227,19 @@ wxToolBarBase * CVIEW_Map::_Create_ToolBar(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Map::Do_Update(void)
+{
+	m_pControl->Refresh_Map();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 void CVIEW_Map::On_Paint(wxPaintEvent &event)
 {
 	if( m_Ruler_Size > 1 )
@@ -380,9 +398,13 @@ void CVIEW_Map::On_Command_UI(wxUpdateUIEvent &event)
 		event.Check(m_pMap->is_ScaleBar());
 		break;
 
+	case ID_CMD_MAP_NORTH_ARROW:
+		event.Check(m_pMap->is_North_Arrow());
+		break;
+
 	case ID_CMD_MAP_SYNCHRONIZE:
 		event.Enable(m_pMap->Get_Manager()->Get_Count() > 1);
-		event.Check(m_pMap->is_Synchronising());
+		event.Check (m_pMap->is_Synchronising());
 		break;
 
 	case ID_CMD_MAP_SAVE_IMAGE_ON_CHANGE:
@@ -405,6 +427,17 @@ void CVIEW_Map::On_Command_UI(wxUpdateUIEvent &event)
 		event.Check(m_pControl->Get_Mode() == MAP_MODE_DISTANCE);
 		break;
 
+	case ID_CMD_MAP_ZOOM_ACTIVE:
+		event.Enable(g_pACTIVE->Get_Active_Layer() != NULL);
+		break;
+
+	case ID_CMD_MAP_ZOOM_SELECTION:
+		event.Enable(g_pACTIVE->Get_Active_Layer()
+			&& g_pACTIVE->Get_Active_Layer()->Get_Object()->asShapes()
+			&& g_pACTIVE->Get_Active_Layer()->Get_Object()->asShapes()->Get_Selection_Count() > 0
+		);
+		break;
+
 	case ID_CMD_MAP_ZOOM_BACK:
 		event.Enable(m_pMap->Set_Extent_Back(true));
 		break;
@@ -412,6 +445,10 @@ void CVIEW_Map::On_Command_UI(wxUpdateUIEvent &event)
 	case ID_CMD_MAP_ZOOM_FORWARD:
 		event.Enable(m_pMap->Set_Extent_Forward(true));
 		break;
+
+	case ID_CMD_MAP_GRATICULE_ADD:
+		event.Enable(m_pMap->Get_Count() > 0 && m_pMap->Get_Projection().is_Okay());
+		break;
 	}
 }
 
@@ -514,6 +551,18 @@ void CVIEW_Map::On_Map_ScaleBar(wxCommandEvent &event)
 }
 
 //---------------------------------------------------------
+void CVIEW_Map::On_Map_North_Arrow(wxCommandEvent &event)
+{
+	m_pMap->Set_North_Arrow(!m_pMap->is_North_Arrow());
+}
+
+//---------------------------------------------------------
+void CVIEW_Map::On_Map_Graticule(wxCommandEvent &event)
+{
+	m_pMap->Add_Graticule();
+}
+
+//---------------------------------------------------------
 void CVIEW_Map::On_Map_Zoom_Synchronize(wxCommandEvent &event)
 {
 	m_pMap->Set_Synchronising(!m_pMap->is_Synchronising());
@@ -551,16 +600,3 @@ void CVIEW_Map::On_Map_Mode_Distance(wxCommandEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CVIEW_Map::Refresh_Map(void)
-{
-	m_pControl->Refresh_Map();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/view_map.h b/src/saga_core/saga_gui/view_map.h
index c62b439..c387651 100644
--- a/src/saga_core/saga_gui/view_map.h
+++ b/src/saga_core/saga_gui/view_map.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,11 +86,32 @@ class CVIEW_Map : public CVIEW_Base
 {
 public:
 	CVIEW_Map(class CWKSP_Map *pMap, int Frame_Width);
-	virtual ~CVIEW_Map(void);
 
 	static class wxToolBarBase *	_Create_ToolBar				(void);
 	static class wxMenu *			_Create_Menu				(void);
 
+	virtual void					Do_Update					(void);
+
+	class CVIEW_Map_Control *		Get_Map_Control				(void)	{	return( m_pControl );	}
+
+	void							Ruler_Set_Width				(int Width);
+	void							Ruler_Set_Position			(int x, int y);
+	void							Ruler_Refresh				(void);
+
+
+private:
+
+	int								m_Ruler_Size;
+
+	class CWKSP_Map					*m_pMap;
+
+	class CVIEW_Map_Control			*m_pControl;
+
+	class CVIEW_Ruler				*m_pRuler_X1, *m_pRuler_X2, *m_pRuler_Y1, *m_pRuler_Y2;
+
+
+	void							_Set_Positions				(void);
+
 	void							On_Paint					(wxPaintEvent    &event);
 	void							On_Size						(wxSizeEvent     &event);
 	void							On_Key_Down					(wxKeyEvent      &event);
@@ -113,39 +134,18 @@ public:
 	void							On_Map_Zoom_Extent			(wxCommandEvent  &event);
 	void							On_Map_Zoom_Synchronize		(wxCommandEvent  &event);
 	void							On_Map_ScaleBar				(wxCommandEvent  &event);
+	void							On_Map_North_Arrow			(wxCommandEvent  &event);
+	void							On_Map_Graticule			(wxCommandEvent  &event);
 
 	void							On_Map_Mode_Zoom			(wxCommandEvent  &event);
 	void							On_Map_Mode_Pan				(wxCommandEvent  &event);
 	void							On_Map_Mode_Select			(wxCommandEvent  &event);
 	void							On_Map_Mode_Distance		(wxCommandEvent  &event);
 
-	class CVIEW_Map_Control *		Get_Map_Control				(void)	{	return( m_pControl );	}
-
-	void							Refresh_Map					(void);
 
-	void							Ruler_Set_Width				(int Width);
-	void							Ruler_Set_Position			(int x, int y);
-	void							Ruler_Refresh				(void);
-
-
-private:
-
-	int								m_Ruler_Size;
-
-	class CWKSP_Map					*m_pMap;
-
-	class CVIEW_Map_Control			*m_pControl;
-
-	class CVIEW_Ruler				*m_pRuler_X1, *m_pRuler_X2, *m_pRuler_Y1, *m_pRuler_Y2;
-
-
-	void							_Set_Positions				(void);
-
-
-private:
-
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Map)
+	DECLARE_EVENT_TABLE()
 
 };
 
diff --git a/src/saga_core/saga_gui/view_map_3d.cpp b/src/saga_core/saga_gui/view_map_3d.cpp
index 851432a..427fd30 100644
--- a/src/saga_core/saga_gui/view_map_3d.cpp
+++ b/src/saga_core/saga_gui/view_map_3d.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_3d.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map_3d.cpp 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -165,32 +165,39 @@ END_EVENT_TABLE()
 
 //---------------------------------------------------------
 CVIEW_Map_3D::CVIEW_Map_3D(CWKSP_Map *pMap)
-	: CVIEW_Base(ID_VIEW_MAP_3D, _TL("3D View"), ID_IMG_WND_MAP3D)
+	: CVIEW_Base(pMap, ID_VIEW_MAP_3D, _TL("3D View"), ID_IMG_WND_MAP3D, false)
 {
 	SetTitle(wxString::Format(wxT("%s [%s]"), pMap->Get_Name().c_str(), _TL("3D View")));
 
 	CreateStatusBar(MAP3D_STATUSBAR_COUNT);
 
 	//-----------------------------------------------------
-	m_pMap		= pMap;
 	m_pImage	= new CVIEW_Map_3D_Image(this, pMap);
 
 	//-----------------------------------------------------
 	m_Play_Mode	= PLAY_MODE_NONE;
 
-	m_Play.Add_Field(_TL("Rotate X")			, SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Rotate Y")			, SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Rotate Z")			, SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Shift X")			, SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Shift Y")			, SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Shift Z")			, SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Exaggeration")		, SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Rotate X"          ), SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Rotate Y"          ), SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Rotate Z"          ), SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Shift X"           ), SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Shift Y"           ), SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Shift Z"           ), SG_DATATYPE_Double);
+	m_Play.Add_Field(_TL("Exaggeration"      ), SG_DATATYPE_Double);
 	m_Play.Add_Field(_TL("Central Projection"), SG_DATATYPE_Double);
-	m_Play.Add_Field(_TL("Steps to Next")		, SG_DATATYPE_Int);
+	m_Play.Add_Field(_TL("Steps to Next"     ), SG_DATATYPE_Int);
 
 	//-----------------------------------------------------
 	_Parms_Create();
-	_Parms_Dlg();
+
+	if( _Parms_Dlg() )
+	{
+		Do_Show();
+	}
+	else
+	{
+		Destroy();
+	}
 }
 
 //---------------------------------------------------------
@@ -199,8 +206,6 @@ CVIEW_Map_3D::~CVIEW_Map_3D(void)
 	_Play_Stop();
 
 	delete(m_pImage);
-
-	m_pMap->View_Closes(this);
 }
 
 
@@ -310,6 +315,21 @@ wxToolBarBase * CVIEW_Map_3D::_Create_ToolBar(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Map_3D::Do_Update(void)
+{
+	m_pImage->m_Src_bUpdate	= true;
+
+	m_pImage->Set_Source();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 void CVIEW_Map_3D::On_Size(wxSizeEvent &event)
 {
 	m_pImage->Set_Image(GetClientSize().x, GetClientSize().y);
@@ -588,21 +608,6 @@ void CVIEW_Map_3D::On_Command_UI(wxUpdateUIEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CVIEW_Map_3D::On_Source_Changed(void)
-{
-	m_pImage->m_Src_bUpdate	= true;
-
-	m_pImage->Set_Source();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
 void CVIEW_Map_3D::_Parms_Create(void)
 {
 	CSG_Parameter	*pNode;
diff --git a/src/saga_core/saga_gui/view_map_3d.h b/src/saga_core/saga_gui/view_map_3d.h
index 08e94c0..14027d9 100644
--- a/src/saga_core/saga_gui/view_map_3d.h
+++ b/src/saga_core/saga_gui/view_map_3d.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_3d.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map_3d.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -95,24 +95,7 @@ public:
 	static class wxToolBarBase *	_Create_ToolBar			(void);
 	static class wxMenu *			_Create_Menu			(void);
 
-	void							On_Size					(wxSizeEvent &event);
-	void							On_Paint				(wxPaintEvent &event);
-
-	void							On_Key_Down				(wxKeyEvent &event);
-
-	void							On_Mouse_LDown			(wxMouseEvent &event);
-	void							On_Mouse_LUp			(wxMouseEvent &event);
-	void							On_Mouse_RDown			(wxMouseEvent &event);
-	void							On_Mouse_RUp			(wxMouseEvent &event);
-	void							On_Mouse_MDown			(wxMouseEvent &event);
-	void							On_Mouse_MUp			(wxMouseEvent &event);
-	void							On_Mouse_Motion			(wxMouseEvent &event);
-	void							On_Mouse_Wheel			(wxMouseEvent &event);
-
-	void							On_Command				(wxCommandEvent &event);
-	void							On_Command_UI			(wxUpdateUIEvent &event);
-
-	void							On_Source_Changed		(void);
+	virtual void					Do_Update				(void);
 
 
 private:
@@ -121,17 +104,32 @@ private:
 
 	double							m_xDown, m_yDown;
 
-	CSG_Parameters						m_Parameters;
+	CSG_Parameters					m_Parameters;
 
-	CSG_Table							m_Play;
+	CSG_Table						m_Play;
 
 	wxPoint							m_Mouse_Down;
 
-	class CWKSP_Map					*m_pMap;
-
 	class CVIEW_Map_3D_Image		*m_pImage;
 
 
+	void							On_Command				(wxCommandEvent  &event);
+	void							On_Command_UI			(wxUpdateUIEvent &event);
+
+	void							On_Size					(wxSizeEvent  &event);
+	void							On_Paint				(wxPaintEvent &event);
+
+	void							On_Key_Down				(wxKeyEvent   &event);
+
+	void							On_Mouse_LDown			(wxMouseEvent &event);
+	void							On_Mouse_LUp			(wxMouseEvent &event);
+	void							On_Mouse_RDown			(wxMouseEvent &event);
+	void							On_Mouse_RUp			(wxMouseEvent &event);
+	void							On_Mouse_MDown			(wxMouseEvent &event);
+	void							On_Mouse_MUp			(wxMouseEvent &event);
+	void							On_Mouse_Motion			(wxMouseEvent &event);
+	void							On_Mouse_Wheel			(wxMouseEvent &event);
+
 	void							_Paint					(void);
 	void							_Paint					(wxDC &dc);
 
@@ -154,10 +152,9 @@ private:
 	bool							_Play					(void);
 
 
-private:
-
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Map_3D)
+	DECLARE_EVENT_TABLE()
 
 };
 
diff --git a/src/saga_core/saga_gui/view_map_3d_image.cpp b/src/saga_core/saga_gui/view_map_3d_image.cpp
index 883694a..4e368e5 100644
--- a/src/saga_core/saga_gui/view_map_3d_image.cpp
+++ b/src/saga_core/saga_gui/view_map_3d_image.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_3d_image.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map_3d_image.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -203,7 +203,7 @@ void CVIEW_Map_3D_Image::Save(const wxString &file, int type)
 {
 	if( m_img.Ok() && file.Length() > 0 )
 	{
-		m_img.SaveFile(file, type);
+		m_img.SaveFile(file, (wxBitmapType)type);
 	}
 }
 
diff --git a/src/saga_core/saga_gui/view_map_control.cpp b/src/saga_core/saga_gui/view_map_control.cpp
index bd8f1b1..94c7e7a 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map_control.cpp 2027 2014-02-27 15:14:20Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -105,20 +105,21 @@
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CVIEW_Map_Control, wxPanel)
-	EVT_PAINT			(CVIEW_Map_Control::On_Paint)
-	EVT_SIZE			(CVIEW_Map_Control::On_Size)
-	EVT_KEY_DOWN		(CVIEW_Map_Control::On_Key_Down)
-
-	EVT_MOUSEWHEEL		(CVIEW_Map_Control::On_Mouse_Wheel)
-	EVT_MOTION			(CVIEW_Map_Control::On_Mouse_Motion)
-	EVT_LEFT_DOWN		(CVIEW_Map_Control::On_Mouse_LDown)
-	EVT_LEFT_UP			(CVIEW_Map_Control::On_Mouse_LUp)
-	EVT_LEFT_DCLICK		(CVIEW_Map_Control::On_Mouse_LDClick)
-	EVT_RIGHT_DOWN		(CVIEW_Map_Control::On_Mouse_RDown)
-	EVT_RIGHT_UP		(CVIEW_Map_Control::On_Mouse_RUp)
-	EVT_RIGHT_DCLICK	(CVIEW_Map_Control::On_Mouse_RDClick)
-	EVT_MIDDLE_DOWN		(CVIEW_Map_Control::On_Mouse_MDown)
-	EVT_MIDDLE_UP		(CVIEW_Map_Control::On_Mouse_MUp)
+	EVT_PAINT				(CVIEW_Map_Control::On_Paint)
+	EVT_SIZE				(CVIEW_Map_Control::On_Size)
+	EVT_KEY_DOWN			(CVIEW_Map_Control::On_Key_Down)
+
+	EVT_MOUSEWHEEL			(CVIEW_Map_Control::On_Mouse_Wheel)
+	EVT_MOTION				(CVIEW_Map_Control::On_Mouse_Motion)
+	EVT_LEFT_DOWN			(CVIEW_Map_Control::On_Mouse_LDown)
+	EVT_LEFT_UP				(CVIEW_Map_Control::On_Mouse_LUp)
+	EVT_LEFT_DCLICK			(CVIEW_Map_Control::On_Mouse_LDClick)
+	EVT_RIGHT_DOWN			(CVIEW_Map_Control::On_Mouse_RDown)
+	EVT_RIGHT_UP			(CVIEW_Map_Control::On_Mouse_RUp)
+	EVT_RIGHT_DCLICK		(CVIEW_Map_Control::On_Mouse_RDClick)
+	EVT_MIDDLE_DOWN			(CVIEW_Map_Control::On_Mouse_MDown)
+	EVT_MIDDLE_UP			(CVIEW_Map_Control::On_Mouse_MUp)
+	EVT_MOUSE_CAPTURE_LOST	(CVIEW_Map_Control::On_Mouse_Lost)
 END_EVENT_TABLE()
 
 
@@ -668,7 +669,7 @@ void CVIEW_Map_Control::On_Mouse_LDown(wxMouseEvent &event)
 	}
 
 	//-----------------------------------------------------
-	if( bCaptureMouse )
+	if( bCaptureMouse && !HasCapture() )
 	{
 		CaptureMouse();
 	}
@@ -777,6 +778,10 @@ void CVIEW_Map_Control::On_Mouse_RDown(wxMouseEvent &event)
 		{
 			g_pModule->Execute(_Get_World(event.GetPosition()), MODULE_INTERACTIVE_RDOWN, GET_KEYS(event));
 		}
+		else if( m_pMap->Find_Layer(Get_Active_Layer()) )
+		{
+			Get_Active_Layer()->Edit_On_Mouse_Down(_Get_World(event.GetPosition()), _Get_World(1.0), GET_KEYS(event));
+		}
 		break;
 
 	//-----------------------------------------------------
@@ -920,7 +925,7 @@ void CVIEW_Map_Control::On_Mouse_MDown(wxMouseEvent &event)
 	}
 
 	//-----------------------------------------------------
-	if( bCaptureMouse )
+	if( bCaptureMouse && !HasCapture() )
 	{
 		CaptureMouse();
 	}
@@ -1070,3 +1075,15 @@ void CVIEW_Map_Control::On_Mouse_Wheel(wxMouseEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Map_Control::On_Mouse_Lost(wxMouseCaptureLostEvent &event)
+{
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/view_map_control.h b/src/saga_core/saga_gui/view_map_control.h
index 338d33b..ef38b3e 100644
--- a/src/saga_core/saga_gui/view_map_control.h
+++ b/src/saga_core/saga_gui/view_map_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_map_control.h 2027 2014-02-27 15:14:20Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -113,8 +113,6 @@ public:
 	void						On_Size				(wxSizeEvent  &event);
 	void						On_Key_Down			(wxKeyEvent   &event);
 
-	void						On_Mouse_Wheel		(wxMouseEvent &event);
-	void						On_Mouse_Motion		(wxMouseEvent &event);
 	void						On_Mouse_LDown		(wxMouseEvent &event);
 	void						On_Mouse_LUp		(wxMouseEvent &event);
 	void						On_Mouse_LDClick	(wxMouseEvent &event);
@@ -123,6 +121,10 @@ public:
 	void						On_Mouse_RDClick	(wxMouseEvent &event);
 	void						On_Mouse_MDown		(wxMouseEvent &event);
 	void						On_Mouse_MUp		(wxMouseEvent &event);
+	void						On_Mouse_Motion		(wxMouseEvent &event);
+	void						On_Mouse_Wheel		(wxMouseEvent &event);
+
+	void						On_Mouse_Lost		(wxMouseCaptureLostEvent &event);
 
 	bool						Set_Mode			(int Mode);
 	int							Get_Mode			(void)	{	return( m_Mode );	}
diff --git a/src/saga_core/saga_gui/view_scatterplot.cpp b/src/saga_core/saga_gui/view_scatterplot.cpp
index 807a892..655e332 100644
--- a/src/saga_core/saga_gui/view_scatterplot.cpp
+++ b/src/saga_core/saga_gui/view_scatterplot.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_scatterplot.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_scatterplot.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -145,18 +145,6 @@ int Scatter_Plot_On_Parameter_Changed(CSG_Parameter *pParameter, int Flags)
 	return( 0 );
 }
 
-//---------------------------------------------------------
-void		Add_ScatterPlot(CSG_Grid *pGrid)
-{
-	new CVIEW_ScatterPlot(pGrid);
-}
-
-//---------------------------------------------------------
-void		Add_ScatterPlot(CSG_Table *pTable)
-{
-	new CVIEW_ScatterPlot(pTable);
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -187,27 +175,52 @@ END_EVENT_TABLE()
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CVIEW_ScatterPlot::CVIEW_ScatterPlot(CSG_Grid *pGrid)
-	: CVIEW_Base(ID_VIEW_SCATTERPLOT, _TL("Scatterplot"), ID_IMG_WND_SCATTERPLOT)
+CVIEW_ScatterPlot::CVIEW_ScatterPlot(CWKSP_Data_Item *pItem)
+	: CVIEW_Base(pItem, ID_VIEW_SCATTERPLOT, wxString::Format("%s: %s", _TL("Scatterplot"), pItem->Get_Object()->Get_Name()), ID_IMG_WND_SCATTERPLOT, false)
 {
-	m_pGrid		= pGrid;
+	m_pItem		= pItem;
+
+	m_pGrid		= NULL;
 	m_pTable	= NULL;
 
-	m_Parameters.Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Scatterplot"), m_pGrid->Get_Name()));
+	switch( m_pItem->Get_Type() )
+	{
+	case WKSP_ITEM_Grid:
+		m_pGrid		= pItem->Get_Object()->asGrid();
+		break;
+
+	default:
+		m_pTable	= (CSG_Table *)pItem->Get_Object();
+		break;
+	}
+
+	m_Parameters.Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Scatterplot"), m_pItem->Get_Object()->Get_Name()));
 
 	_On_Construction();
+
+	if( DLG_Parameters(&m_Parameters) )
+	{
+		_Update_Data();
+
+		Do_Show();
+	}
+	else
+	{
+		Destroy();
+	}
 }
 
-//---------------------------------------------------------
-CVIEW_ScatterPlot::CVIEW_ScatterPlot(CSG_Table *pTable)
-	: CVIEW_Base(ID_VIEW_SCATTERPLOT, _TL("Scatterplot"), ID_IMG_WND_SCATTERPLOT)
-{
-	m_pGrid		= NULL;
-	m_pTable	= pTable;
 
-	m_Parameters.Set_Name(CSG_String::Format(SG_T("%s: %s"), _TL("Scatterplot"), m_pTable->Get_Name()));
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
 
-	_On_Construction();
+//---------------------------------------------------------
+void CVIEW_ScatterPlot::Do_Update(void)
+{
+	_Update_Data();
 }
 
 
@@ -382,11 +395,6 @@ void CVIEW_ScatterPlot::_On_Construction(void)
 
 	//-----------------------------------------------------
 	m_Parameters.Set_Callback_On_Parameter_Changed(&Scatter_Plot_On_Parameter_Changed);
-
-	if( DLG_Parameters(&m_Parameters) )
-	{
-		_Initialize();
-	}
 }
 
 
@@ -401,7 +409,7 @@ void CVIEW_ScatterPlot::On_Parameters(wxCommandEvent &event)
 {
 	if( DLG_Parameters(&m_Parameters) )
 	{
-		_Initialize();
+		_Update_Data();
 	}
 }
 
@@ -410,14 +418,14 @@ void CVIEW_ScatterPlot::On_Options(wxCommandEvent &event)
 {
 	if( DLG_Parameters(&m_Options) )
 	{
-		_Initialize();
+		_Update_Data();
 	}
 }
 
 //---------------------------------------------------------
 void CVIEW_ScatterPlot::On_Update(wxCommandEvent &event)
 {
-	_Initialize();
+	_Update_Data();
 }
 
 //---------------------------------------------------------
@@ -460,7 +468,7 @@ void CVIEW_ScatterPlot::On_ToClipboard(wxCommandEvent &event)
 	dc.SetBackground(*wxWHITE_BRUSH);
 	dc.Clear();
 
-	Draw(dc, wxRect(BMP.GetSize()));
+	_Draw(dc, wxRect(BMP.GetSize()));
 
 	dc.SelectObject(wxNullBitmap);
 
@@ -507,11 +515,11 @@ void CVIEW_ScatterPlot::On_Paint(wxPaintEvent &event)
 
 	Draw_Edge(dc, EDGE_STYLE_SUNKEN, r);
 
-	Draw(dc, r);
+	_Draw(dc, r);
 }
 
 //---------------------------------------------------------
-void CVIEW_ScatterPlot::Draw(wxDC &dc, wxRect r)
+void CVIEW_ScatterPlot::_Draw(wxDC &dc, wxRect r)
 {
 	r	= _Draw_Get_rDiagram(r);
 
@@ -731,7 +739,7 @@ void CVIEW_ScatterPlot::_Draw_Frame(wxDC &dc, wxRect r)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CVIEW_ScatterPlot::_Initialize(void)
+bool CVIEW_ScatterPlot::_Update_Data(void)
 {
 	bool	bResult;
 
@@ -834,8 +842,8 @@ bool CVIEW_ScatterPlot::_Initialize_Grids()
 				if( !pGrid_Y->is_NoData((long)i) )
 				{
 					m_Regression.Add_Values(
-						m_pGrid->asDouble((long)i, true),
-						pGrid_Y->asDouble((long)i, true)
+						m_pGrid->asDouble((sLong)i, true),
+						pGrid_Y->asDouble((sLong)i, true)
 					);
 				}
 			}
@@ -847,7 +855,7 @@ bool CVIEW_ScatterPlot::_Initialize_Grids()
 
 				if(	pGrid_Y->Get_Value(m_pGrid->Get_System().Get_Grid_to_World(x, y), z, Interpolation, true) )
 				{
-					m_Regression.Add_Values(m_pGrid->asDouble((long)i, true), z);
+					m_Regression.Add_Values(m_pGrid->asDouble((sLong)i, true), z);
 				}
 			}
 		}
diff --git a/src/saga_core/saga_gui/view_scatterplot.h b/src/saga_core/saga_gui/view_scatterplot.h
index e87705c..80d687a 100644
--- a/src/saga_core/saga_gui/view_scatterplot.h
+++ b/src/saga_core/saga_gui/view_scatterplot.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_scatterplot.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_scatterplot.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -84,40 +84,21 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void		Add_ScatterPlot(CSG_Grid *pGrid);
-void		Add_ScatterPlot(CSG_Table *pTable);
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
 class CVIEW_ScatterPlot : public CVIEW_Base
 {
 public:
-	CVIEW_ScatterPlot(CSG_Grid  *pGrid);
-	CVIEW_ScatterPlot(CSG_Table *pTable);
+	CVIEW_ScatterPlot(CWKSP_Data_Item *pItem);
 
 	static class wxToolBarBase *	_Create_ToolBar				(void);
 	static class wxMenu *			_Create_Menu				(void);
 
-	void							On_Size						(wxSizeEvent    &event);
-	void							On_Paint					(wxPaintEvent   &event);
-
-	void							On_Parameters				(wxCommandEvent &event);
-	void							On_Options					(wxCommandEvent &event);
-	void							On_Update					(wxCommandEvent &event);
-	void							On_AsTable					(wxCommandEvent &event);
-	void							On_ToClipboard				(wxCommandEvent &event);
-
-	void							Draw						(wxDC &dc, wxRect r);
+	virtual void					Do_Update					(void);
 
 
 private:
 
+	class CWKSP_Data_Item			*m_pItem;
+
 	CSG_Grid						*m_pGrid, m_Count;
 
 	CSG_Table						*m_pTable;
@@ -129,14 +110,25 @@ private:
 	CSG_String						m_sTitle, m_sX, m_sY;
 
 
+	void							On_Size						(wxSizeEvent    &event);
+	void							On_Paint					(wxPaintEvent   &event);
+
+	void							On_Parameters				(wxCommandEvent &event);
+	void							On_Options					(wxCommandEvent &event);
+	void							On_Update					(wxCommandEvent &event);
+	void							On_AsTable					(wxCommandEvent &event);
+	void							On_ToClipboard				(wxCommandEvent &event);
+
 	void							_On_Construction			(void);
 
-	bool							_Initialize					(void);
+	bool							_Update_Data				(void);
+
 	bool							_Initialize_Count			(void);
 	bool							_Initialize_Grids			(void);
 	bool							_Initialize_Shapes			(void);
 	bool							_Initialize_Table			(void);
 
+	void							_Draw						(wxDC &dc, wxRect r);
 	wxRect							_Draw_Get_rDiagram			(wxRect r);
 	void							_Draw_Legend				(wxDC &dc, wxRect r);
 	void							_Draw_Image					(wxDC &dc, wxRect r);
@@ -145,10 +137,9 @@ private:
 	void							_Draw_Frame					(wxDC &dc, wxRect r);
 
 
-private:
-
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_ScatterPlot)
+	DECLARE_EVENT_TABLE()
 
 };
 
diff --git a/src/saga_core/saga_gui/view_table.cpp b/src/saga_core/saga_gui/view_table.cpp
index 4c6f6a8..165d6a1 100644
--- a/src/saga_core/saga_gui/view_table.cpp
+++ b/src/saga_core/saga_gui/view_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_table.cpp 2067 2014-03-24 10:53:19Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -118,17 +118,11 @@ END_EVENT_TABLE()
 
 //---------------------------------------------------------
 CVIEW_Table::CVIEW_Table(CWKSP_Table *pTable)
-	: CVIEW_Base(ID_VIEW_TABLE, pTable->Get_Name(), ID_IMG_WND_TABLE)
+	: CVIEW_Base(pTable, ID_VIEW_TABLE, pTable->Get_Name(), ID_IMG_WND_TABLE, false)
 {
-	m_pTable	= pTable;
+	m_pControl	= new CVIEW_Table_Control(this, pTable->Get_Table(), 0);
 
-	m_pControl	= new CVIEW_Table_Control(this, m_pTable->Get_Table(), 0);
-}
-
-//---------------------------------------------------------
-CVIEW_Table::~CVIEW_Table(void)
-{
-	m_pTable->View_Closes(this);
+	Do_Show();
 }
 
 
@@ -180,6 +174,25 @@ wxToolBarBase * CVIEW_Table::_Create_ToolBar(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CVIEW_Table::Do_Update(void)
+{
+	m_pControl->Update_Table();
+}
+
+//---------------------------------------------------------
+void CVIEW_Table::Update_Selection(void)
+{
+	m_pControl->Update_Selection();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 void CVIEW_Table::On_Field_Add(wxCommandEvent &event)
 {
 	m_pControl->On_Field_Add(event);
@@ -297,22 +310,3 @@ void CVIEW_Table::On_Sel_To_Top_UI(wxUpdateUIEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CVIEW_Table::Update_Table(void)
-{
-	m_pControl->Update_Table();
-}
-
-//---------------------------------------------------------
-void CVIEW_Table::Update_Selection(void)
-{
-	m_pControl->Update_Selection();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/view_table.h b/src/saga_core/saga_gui/view_table.h
index 04473d2..34292eb 100644
--- a/src/saga_core/saga_gui/view_table.h
+++ b/src/saga_core/saga_gui/view_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_table.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -84,15 +84,24 @@
 //---------------------------------------------------------
 class CVIEW_Table : public CVIEW_Base
 {
-	DECLARE_CLASS(CVIEW_Table)
-
 public:
 	CVIEW_Table(class CWKSP_Table *pTable);
-	virtual ~CVIEW_Table(void);
 
 	static class wxToolBarBase *	_Create_ToolBar		(void);
 	static class wxMenu *			_Create_Menu		(void);
 
+	virtual void					Do_Update			(void);
+
+	void							Update_Selection	(void);
+
+
+private:
+
+	class CWKSP_Table				*m_pTable;
+
+	class CVIEW_Table_Control		*m_pControl;
+
+
 	void							On_Field_Add		(wxCommandEvent  &event);
 	void							On_Field_Add_UI		(wxUpdateUIEvent &event);
 	void							On_Field_Del		(wxCommandEvent  &event);
@@ -115,19 +124,10 @@ public:
 	void							On_Sel_To_Top		(wxCommandEvent  &event);
 	void							On_Sel_To_Top_UI	(wxUpdateUIEvent &event);
 
-	void							Update_Table		(void);
-	void							Update_Selection	(void);
-
-
-private:
-
-	class CWKSP_Table				*m_pTable;
-
-	class CVIEW_Table_Control		*m_pControl;
 
-
-//---------------------------------------------------------
-DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
+	DECLARE_CLASS(CVIEW_Table)
+	DECLARE_EVENT_TABLE()
 };
 
 
diff --git a/src/saga_core/saga_gui/view_table_control.cpp b/src/saga_core/saga_gui/view_table_control.cpp
index e73f628..f605b9e 100644
--- a/src/saga_core/saga_gui/view_table_control.cpp
+++ b/src/saga_core/saga_gui/view_table_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_table_control.cpp 2074 2014-03-31 10:32:12Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -68,6 +68,9 @@
 #include "res_commands.h"
 #include "res_dialogs.h"
 
+#include "active.h"
+#include "active_attributes.h"
+
 #include "helper.h"
 
 #include "wksp_data_manager.h"
@@ -98,15 +101,18 @@ IMPLEMENT_CLASS(CVIEW_Table_Control, wxGrid)
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CVIEW_Table_Control, wxGrid)
-	EVT_GRID_CELL_CHANGE		(CVIEW_Table_Control::On_Change)
+	EVT_SIZE					(CVIEW_Table_Control::On_Size)
+	EVT_KEY_DOWN				(CVIEW_Table_Control::On_Key)
+
+	EVT_GRID_EDITOR_SHOWN		(CVIEW_Table_Control::On_Edit_Start)
+	EVT_GRID_EDITOR_HIDDEN		(CVIEW_Table_Control::On_Edit_Stop)
+	EVT_GRID_CELL_CHANGED		(CVIEW_Table_Control::On_Changed)
 	EVT_GRID_CELL_LEFT_CLICK	(CVIEW_Table_Control::On_LClick)
 	EVT_GRID_LABEL_LEFT_CLICK	(CVIEW_Table_Control::On_LClick_Label)
 	EVT_GRID_LABEL_LEFT_DCLICK	(CVIEW_Table_Control::On_LDClick_Label)
 	EVT_GRID_LABEL_RIGHT_CLICK	(CVIEW_Table_Control::On_RClick_Label)
 	EVT_GRID_RANGE_SELECT		(CVIEW_Table_Control::On_Select)
-
-	EVT_SIZE					(CVIEW_Table_Control::On_Size)
-
+
 	EVT_MENU					(ID_CMD_TABLE_FIELD_ADD			, CVIEW_Table_Control::On_Field_Add)
 	EVT_UPDATE_UI				(ID_CMD_TABLE_FIELD_ADD			, CVIEW_Table_Control::On_Field_Add_UI)
 	EVT_MENU					(ID_CMD_TABLE_FIELD_DEL			, CVIEW_Table_Control::On_Field_Del)
@@ -152,6 +158,7 @@ CVIEW_Table_Control::CVIEW_Table_Control(wxWindow *pParent, CSG_Table *pTable, i
 	m_pRecords		= NULL;
 	m_Constraint	= Constraint;
 	m_bSelOnly		= false;
+	m_bEditing		= false;
 
 	Set_Labeling(false);
 
@@ -179,17 +186,26 @@ CVIEW_Table_Control::~CVIEW_Table_Control(void)
 //---------------------------------------------------------
 void CVIEW_Table_Control::Set_Labeling(bool bOn)
 {
-	if( bOn )
+	if( bOn && m_Field_Offset == 0 )
 	{
 		m_Field_Offset	= 1;
 
 		SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE);
 	}
-	else
+	else if( !bOn && m_Field_Offset != 0 )
 	{
 		m_Field_Offset	= 0;
 
 		SetRowLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);
+
+		Freeze();
+
+		for(int i=0; i<GetRows(); i++)
+		{
+			SetRowLabelValue(i, wxString::Format("%d", 1 + i));
+		}
+
+		Thaw();
 	}
 }
 
@@ -515,7 +531,7 @@ bool CVIEW_Table_Control::Save(const wxString &File_Name, int Format)
 //---------------------------------------------------------
 void CVIEW_Table_Control::On_Size(wxSizeEvent &event)//&WXUNUSED(event))
 {
-	if( m_Field_Offset && GetNumberCols() )
+	if( m_Field_Offset && GetNumberCols() && GetClientSize().x > GetRowLabelSize() )
 	{
 		SetColSize(0, GetClientSize().x - GetRowLabelSize());
 	}
@@ -524,16 +540,52 @@ void CVIEW_Table_Control::On_Size(wxSizeEvent &event)//&WXUNUSED(event))
 }
 
 //---------------------------------------------------------
-void CVIEW_Table_Control::On_Change(wxGridEvent &event)
+void CVIEW_Table_Control::On_Key(wxKeyEvent &event)
+{
+	event.Skip(true);
+
+	if( event.GetKeyCode() == WXK_RETURN )
+	{
+		if( !m_bEditing && GetParent() == g_pACTIVE->Get_Attributes() )
+		{
+			event.Skip(false);
+
+			g_pACTIVE->Get_Attributes()->Save_Changes(false);
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CVIEW_Table_Control::On_Edit_Start(wxGridEvent &event)
+{
+	m_bEditing	= true;
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
+void CVIEW_Table_Control::On_Edit_Stop(wxGridEvent &event)
+{
+	m_bEditing	= false;
+
+	event.Skip();
+}
+
+//---------------------------------------------------------
+void CVIEW_Table_Control::On_Changed(wxGridEvent &event)
 {
-	int					iField		= m_Field_Offset + event.GetCol();
 	CSG_Table_Record	*pRecord	= m_pRecords[event.GetRow()];
 
-	if( pRecord && iField >= m_Field_Offset && iField < m_pTable->Get_Field_Count() )
+	if( pRecord )
 	{
-		pRecord->Set_Value(iField, GetCellValue(event.GetRow(), event.GetCol()).wx_str());
+		int	iField	= m_Field_Offset + event.GetCol();
 
-		SetCellValue(event.GetRow(), event.GetCol(), pRecord->asString(iField));
+		if( iField >= m_Field_Offset && iField < m_pTable->Get_Field_Count() )
+		{
+			pRecord->Set_Value(iField, GetCellValue(event.GetRow(), event.GetCol()).wx_str());
+
+			SetCellValue(event.GetRow(), event.GetCol(), pRecord->asString(iField));
+		}
 	}
 }
 
diff --git a/src/saga_core/saga_gui/view_table_control.h b/src/saga_core/saga_gui/view_table_control.h
index 01a9860..32b51bf 100644
--- a/src/saga_core/saga_gui/view_table_control.h
+++ b/src/saga_core/saga_gui/view_table_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_table_control.h 2074 2014-03-31 10:32:12Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -132,12 +132,16 @@ public:
 	void						On_Autosize_Cols	(wxCommandEvent  &event);
 	void						On_Autosize_Rows	(wxCommandEvent  &event);
 
-	void						On_Size				(wxSizeEvent &event);
-	void						On_Change			(wxGridEvent &event);
-	void						On_LClick			(wxGridEvent &event);
-	void						On_LClick_Label		(wxGridEvent &event);
-	void						On_RClick_Label		(wxGridEvent &event);
-	void						On_LDClick_Label	(wxGridEvent &event);
+	void						On_Size				(wxSizeEvent     &event);
+	void						On_Key				(wxKeyEvent      &event);
+
+	void						On_Edit_Start		(wxGridEvent     &event);
+	void						On_Edit_Stop		(wxGridEvent     &event);
+	void						On_Changed			(wxGridEvent     &event);
+	void						On_LClick			(wxGridEvent     &event);
+	void						On_LClick_Label		(wxGridEvent     &event);
+	void						On_RClick_Label		(wxGridEvent     &event);
+	void						On_LDClick_Label	(wxGridEvent     &event);
 	void						On_Select			(wxGridRangeSelectEvent &event);
 
 	void						Set_Labeling		(bool bOn);
@@ -157,7 +161,7 @@ public:
 
 private:
 
-	bool						m_bSelOnly;
+	bool						m_bSelOnly, m_bEditing;
 
 	int							m_Constraint, m_Field_Offset;
 
diff --git a/src/saga_core/saga_gui/view_table_diagram.cpp b/src/saga_core/saga_gui/view_table_diagram.cpp
index 7521e2f..b8f8d3b 100644
--- a/src/saga_core/saga_gui/view_table_diagram.cpp
+++ b/src/saga_core/saga_gui/view_table_diagram.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_diagram.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_table_diagram.cpp 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -159,8 +159,9 @@ private:
 	void							_Draw_Bars			(wxDC &dc, wxRect r, double dx, double dy, int iField);
 
 
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Table_Diagram_Control)
+	DECLARE_EVENT_TABLE()
 
 };
 
@@ -200,8 +201,6 @@ CVIEW_Table_Diagram_Control::CVIEW_Table_Diagram_Control(wxWindow *pParent, CWKS
 	Fit_Size();
 
 	_Initialize();
-
-	Set_Parameters();
 }
 
 //---------------------------------------------------------
@@ -1001,23 +1000,22 @@ END_EVENT_TABLE()
 
 //---------------------------------------------------------
 CVIEW_Table_Diagram::CVIEW_Table_Diagram(CWKSP_Table *pTable)
-	: CVIEW_Base(ID_VIEW_TABLE_DIAGRAM, wxString::Format(wxT("%s [%s]"), _TL("Diagram"), pTable->Get_Name().c_str()), ID_IMG_WND_DIAGRAM)
+	: CVIEW_Base(pTable, ID_VIEW_TABLE_DIAGRAM, wxString::Format(wxT("%s [%s]"), _TL("Diagram"), pTable->Get_Name().c_str()), ID_IMG_WND_DIAGRAM, false)
 {
 	SYS_Set_Color_BG_Window(this);
 
-	m_pOwner	= pTable;
-
 	m_pControl	= new CVIEW_Table_Diagram_Control(this, pTable);
 
-	wxCommandEvent	dummy;
-
-	On_Size_Fit(dummy);
-}
+	if( m_pControl->Set_Parameters() )
+	{
+		m_pControl->Fit_Size();
 
-//---------------------------------------------------------
-CVIEW_Table_Diagram::~CVIEW_Table_Diagram(void)
-{
-	m_pOwner->View_Closes(this);
+		Do_Show();
+	}
+	else
+	{
+		Destroy();
+	}
 }
 
 
@@ -1060,9 +1058,9 @@ wxToolBarBase * CVIEW_Table_Diagram::_Create_ToolBar(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CVIEW_Table_Diagram::Update_Diagram(void)
+void CVIEW_Table_Diagram::Do_Update(void)
 {
-	return( m_pControl->Update_Diagram() );
+	m_pControl->Update_Diagram();
 }
 
 
diff --git a/src/saga_core/saga_gui/view_table_diagram.h b/src/saga_core/saga_gui/view_table_diagram.h
index c54130f..db15764 100644
--- a/src/saga_core/saga_gui/view_table_diagram.h
+++ b/src/saga_core/saga_gui/view_table_diagram.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_diagram.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_table_diagram.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,20 +86,17 @@ class CVIEW_Table_Diagram : public CVIEW_Base
 {
 public:
 	CVIEW_Table_Diagram(class CWKSP_Table *pTable);
-	virtual ~CVIEW_Table_Diagram(void);
 
 	static class wxToolBarBase *		_Create_ToolBar		(void);
 	static class wxMenu *				_Create_Menu		(void);
 
-	bool								Update_Diagram		(void);
+	virtual void						Do_Update			(void);
 
 
 private:
 
 	class CVIEW_Table_Diagram_Control	*m_pControl;
 
-	class CWKSP_Table					*m_pOwner;
-
 
 	void								On_Parameters		(wxCommandEvent &event);
 	void								On_Size_Fit			(wxCommandEvent &event);
@@ -109,10 +106,9 @@ private:
 	void								On_Key_Down			(wxKeyEvent     &event);
 
 
-private:
-
-	DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
 	DECLARE_CLASS(CVIEW_Table_Diagram)
+	DECLARE_EVENT_TABLE()
 
 };
 
diff --git a/src/saga_core/saga_gui/wksp.cpp b/src/saga_core/saga_gui/wksp.cpp
index 9d84c7c..60318ba 100644
--- a/src/saga_core/saga_gui/wksp.cpp
+++ b/src/saga_core/saga_gui/wksp.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp.cpp 1995 2014-02-14 12:02:16Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -183,28 +183,42 @@ void CWKSP::Add_Pages(void)
 {
 	long	lValue;
 
-	AddPage(m_pModules				, _TL("Modules")	, false, IMG_MODULES);
-	AddPage(m_pData->GetParent()	, _TL("Data")		, false, IMG_DATA);
-	AddPage(m_pMaps->GetParent()	, _TL("Maps")		, false, IMG_MAPS);
+	//-----------------------------------------------------
+	AddPage(m_pModules          , _TL("Tools"), false, IMG_MODULES);
+	AddPage(m_pData->GetParent(), _TL("Data" ), false, IMG_DATA);
+	AddPage(m_pMaps->GetParent(), _TL("Maps" ), false, IMG_MAPS);
+
+	if( CONFIG_Read("/DATA", "TAB", lValue) )
+	{
+		SetSelection((size_t)lValue);
+	}
 
+	//-----------------------------------------------------
 	((wxNotebook *)m_pData->GetParent())->AddPage(m_pData			, SUBNB_CAPTION_TREE	, false, 0);
 	((wxNotebook *)m_pData->GetParent())->AddPage(m_pData_Buttons	, SUBNB_CAPTION_BUTTONS	, false, 1);
 
-	if( CONFIG_Read(wxT("/BUTTONS_DATA"), wxT("TAB"), lValue) )
+	if( CONFIG_Read("/DATA/BUTTONS", "TAB", lValue) )
+	{
 		((wxNotebook *)m_pData->GetParent())->SetSelection((size_t)lValue);
+	}
 
+	//-----------------------------------------------------
 	((wxNotebook *)m_pMaps->GetParent())->AddPage(m_pMaps			, SUBNB_CAPTION_TREE	, false, 0);
 	((wxNotebook *)m_pMaps->GetParent())->AddPage(m_pMaps_Buttons	, SUBNB_CAPTION_BUTTONS	, false, 1);
 
-	if( CONFIG_Read(wxT("/BUTTONS_MAPS"), wxT("TAB"), lValue) )
+	if( CONFIG_Read("/MAPS/BUTTONS", "TAB", lValue) )
+	{
 		((wxNotebook *)m_pMaps->GetParent())->SetSelection((size_t)lValue);
+	}
 }
 
 //---------------------------------------------------------
 CWKSP::~CWKSP(void)
 {
-	CONFIG_Write(wxT("/BUTTONS_DATA"), wxT("TAB"), (long)((wxNotebook *)m_pData->GetParent())->GetSelection());
-	CONFIG_Write(wxT("/BUTTONS_MAPS"), wxT("TAB"), (long)((wxNotebook *)m_pMaps->GetParent())->GetSelection());
+	CONFIG_Write("/DATA", "TAB", (long)GetSelection());
+
+	CONFIG_Write("/DATA/BUTTONS", "TAB", (long)((wxNotebook *)m_pData->GetParent())->GetSelection());
+	CONFIG_Write("/MAPS/BUTTONS", "TAB", (long)((wxNotebook *)m_pMaps->GetParent())->GetSelection());
 
 	g_pWKSP		= NULL;
 }
@@ -303,6 +317,10 @@ void CWKSP::On_Command(wxCommandEvent &event)
 		m_pModules->On_Command(event);
 		break;
 
+	case ID_CMD_MODULES_SEARCH:
+		m_pModules->On_Command(event);
+		break;
+
 	case ID_CMD_DATA_PROJECT_NEW:
 	case ID_CMD_DATA_PROJECT_OPEN:
 	case ID_CMD_DATA_PROJECT_OPEN_ADD:
@@ -313,12 +331,16 @@ void CWKSP::On_Command(wxCommandEvent &event)
 	case ID_CMD_TIN_OPEN:
 	case ID_CMD_POINTCLOUD_OPEN:
 	case ID_CMD_GRIDS_OPEN:
-		m_pData   ->On_Command(event);
+		m_pData->On_Command(event);
 		break;
 
 	case ID_CMD_WKSP_OPEN:
 		Open();
 		break;
+
+	case ID_CMD_WKSP_SAVE:
+		g_pData->On_Command(ID_CMD_DATA_PROJECT_SAVE);
+		break;
 	}
 }
 
@@ -349,6 +371,14 @@ void CWKSP::On_Command_UI(wxUpdateUIEvent &event)
 
 	case ID_CMD_WKSP_OPEN:
 		break;
+
+	case ID_CMD_MODULES_SEARCH:
+		m_pModules->On_Command_UI(event);
+		break;
+
+	case ID_CMD_WKSP_SAVE:
+		event.Enable(g_pData->Get_Count() > 0);
+		break;
 	}
 }
 
diff --git a/src/saga_core/saga_gui/wksp_base_control.cpp b/src/saga_core/saga_gui/wksp_base_control.cpp
index 33d41a2..bdd1633 100644
--- a/src/saga_core/saga_gui/wksp_base_control.cpp
+++ b/src/saga_core/saga_gui/wksp_base_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_base_control.cpp 2020 2014-02-26 11:21:04Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -150,6 +150,7 @@ CWKSP_Base_Control::CWKSP_Base_Control(wxWindow *pParent, wxWindowID id)
 	: wxTreeCtrl(pParent, id, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS)
 {
 	m_pManager	= NULL;
+	m_bUpdating	= false;
 
 	AssignImageList(new wxImageList(IMG_SIZE_TREECTRL, IMG_SIZE_TREECTRL, true, 0));
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_NOITEMS);
@@ -157,8 +158,7 @@ CWKSP_Base_Control::CWKSP_Base_Control(wxWindow *pParent, wxWindowID id)
 
 //---------------------------------------------------------
 CWKSP_Base_Control::~CWKSP_Base_Control(void)
-{
-}
+{}
 
 
 ///////////////////////////////////////////////////////////
@@ -194,76 +194,53 @@ bool CWKSP_Base_Control::_Set_Manager(CWKSP_Base_Manager *pManager)
 //---------------------------------------------------------
 void CWKSP_Base_Control::On_Command(wxCommandEvent &event)
 {
-	//-----------------------------------------------------
-	if( event.GetId() == ID_CMD_WKSP_ITEM_CLOSE )
+	switch( event.GetId() )
 	{
+	case ID_CMD_WKSP_ITEM_CLOSE:
 		_Del_Active(false);
+		break;
 
-		return;
-	}
-
-	//-----------------------------------------------------
-	if( event.GetId() == ID_CMD_WKSP_ITEM_SHOW )
-	{
+	case ID_CMD_WKSP_ITEM_SHOW:
 		_Show_Active();
+		break;
 
-		return;
-	}
-
-	//-----------------------------------------------------
-	if( event.GetId() == ID_CMD_WKSP_ITEM_SETTINGS_LOAD && Get_Selection_Count() > 1 )
-	{
+	case ID_CMD_WKSP_ITEM_SETTINGS_LOAD:
 		_Load_Settings();
+		break;
 
-		return;
-	}
-
-	//-----------------------------------------------------
-	if( event.GetId() == ID_CMD_WKSP_ITEM_SETTINGS_COPY && Get_Selection_Count() > 0 )
-	{
+	case ID_CMD_WKSP_ITEM_SETTINGS_COPY:
 		_Copy_Settings();
+		break;
 
-		return;
-	}
-
-	//-----------------------------------------------------
-	if( event.GetId() == ID_CMD_WKSP_ITEM_SEARCH )
-	{
+	case ID_CMD_WKSP_ITEM_SEARCH:
 		_Search_Item();
-
-		return;
-	}
-
-	//-----------------------------------------------------
-	if( m_pManager->On_Command(event.GetId()) )
-	{
-		return;
-	}
+		break;
 
 	//-----------------------------------------------------
-	CWKSP_Base_Item	*pItem	= Get_Item_Selected();
+	default:
+		if( !m_pManager->On_Command(event.GetId()) )
+		{
+			CWKSP_Base_Item	*pItem	= Get_Item_Selected();
 
-	if( pItem )
-	{
-		pItem->On_Command(event.GetId());
+			if( pItem )
+			{
+				pItem->On_Command(event.GetId());
+			}
+		}
 	}
 }
 
 //---------------------------------------------------------
 void CWKSP_Base_Control::On_Command_UI(wxUpdateUIEvent &event)
 {
-	//-----------------------------------------------------
-	if( m_pManager->On_Command_UI(event) )
+	if( !m_pManager->On_Command_UI(event) )
 	{
-		return;
-	}
-
-	//-----------------------------------------------------
-	CWKSP_Base_Item	*pItem	= Get_Item_Selected();
+		CWKSP_Base_Item	*pItem	= Get_Item_Selected();
 
-	if( pItem )
-	{
-		pItem->On_Command_UI(event);
+		if( pItem )
+		{
+			pItem->On_Command_UI(event);
+		}
 	}
 }
 
@@ -445,6 +422,23 @@ bool CWKSP_Base_Control::_Del_Item_Confirm(CWKSP_Base_Item *pItem)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+int CWKSP_Base_Control::Get_Selection_Count(void)
+{
+	if( GetWindowStyle() & wxTR_MULTIPLE )
+	{
+		wxArrayTreeItemIds	IDs;
+
+		return( GetSelections(IDs) );
+	}
+	else
+	{
+		wxTreeItemId	ID	= GetSelection();
+
+		return( ID.IsOk() ? 1 : 0 );
+	}
+}
+
+//---------------------------------------------------------
 CWKSP_Base_Item * CWKSP_Base_Control::Get_Item_Selected(void)
 {
 	wxTreeItemId	ID;
@@ -471,42 +465,43 @@ bool CWKSP_Base_Control::Set_Item_Selected(CWKSP_Base_Item *pItem, bool bKeepMul
 {
 	if( pItem && pItem->Get_Control() == this && pItem->GetId().IsOk() )
 	{
-		g_pACTIVE->Freeze();
-
-		bool	bSelect	= bKeepMultipleSelection ? !IsSelected(pItem->GetId()) : true;
+		if( GetWindowStyle() & wxTR_MULTIPLE )
+		{
+			if( bKeepMultipleSelection )
+			{
+				ToggleItemSelection(pItem->GetId());
+			}
+			else
+			{
+				m_bUpdating	= true;
+				SelectItem(pItem->GetId());
+				m_bUpdating	= false;
 
-		if( !bKeepMultipleSelection )
+				wxArrayTreeItemIds	IDs;
+				
+				if( GetSelections(IDs) > 1 )
+				{
+					for(size_t i=0; i<IDs.Count(); i++)
+					{
+						if( IDs[i] != pItem->GetId() )
+						{
+							UnselectItem(IDs[i]);
+						}
+					}
+				}
+			}
+		}
+		else
 		{
-			UnselectAll();
+			SelectItem(pItem->GetId());
 		}
 
-		SelectItem(pItem->GetId(), bSelect);
-
-		g_pACTIVE->Thaw();
-
 		return( true );
 	}
 
 	return( false );
 }
 
-//---------------------------------------------------------
-int CWKSP_Base_Control::Get_Selection_Count(void)
-{
-	if( GetWindowStyle() & wxTR_MULTIPLE )
-	{
-		wxArrayTreeItemIds	IDs;
-
-		return( GetSelections(IDs) );
-	}
-	else
-	{
-		wxTreeItemId	ID	= GetSelection();
-
-		return( ID.IsOk() ? 1 : 0 );
-	}
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -557,19 +552,6 @@ wxMenu * CWKSP_Base_Control::Get_Context_Menu(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Base_Control::_Set_Active(void)
-{
-	if( g_pACTIVE )
-	{
-		g_pACTIVE->Set_Active(Get_Item_Selected());
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
 bool CWKSP_Base_Control::_Del_Active(bool bSilent)
 {
 	if( GetWindowStyle() & wxTR_MULTIPLE )
@@ -858,28 +840,31 @@ bool CWKSP_Base_Control::_Search_Compare(wxString A, wxString B, bool bCase)
 }
 
 //---------------------------------------------------------
-bool CWKSP_Base_Control::_Search_Get_List(CSG_Table *pList, CWKSP_Base_Item *pItem, const wxString &String, bool bName, bool bDesc, bool bCase)
+bool CWKSP_Base_Control::_Search_Get_List(CSG_Table *pList, CWKSP_Base_Item *pItem, const wxString &String, bool bName, bool bDesc, bool bCase, TWKSP_Item Type)
 {
 	if( pItem == NULL )
 	{
 		return( false );
 	}
 
-	if(	(bName && _Search_Compare(String, pItem->Get_Name       (), bCase))
-	||	(bDesc && _Search_Compare(String, pItem->Get_Description(), bCase)) )
+	if(	Type == WKSP_ITEM_Undefined || Type == pItem->Get_Type() )
 	{
-		CSG_Table_Record	*pRecord	= pList->Add_Record();
+		if( (bName && _Search_Compare(String, pItem->Get_Name       (), bCase))
+		||  (bDesc && _Search_Compare(String, pItem->Get_Description(), bCase)) )
+		{
+			CSG_Table_Record	*pRecord	= pList->Add_Record();
 
-		pRecord->Set_Value(0, pItem->Get_Name().wx_str());
-		pRecord->Set_Value(1, pItem->Get_Type_Name(pItem->Get_Type()).wx_str());
-		pRecord->Set_Value(2, (long)pItem);
+			pRecord->Set_Value(0, pItem->Get_Name().wx_str());
+			pRecord->Set_Value(1, pItem->Get_Type_Name(pItem->Get_Type()).wx_str());
+			pRecord->Set_Value(2, (long)pItem);
+		}
 	}
 
 	if( pItem->is_Manager() )
 	{
 		for(int i=0; i<((CWKSP_Base_Manager *)pItem)->Get_Count(); i++)
 		{
-			_Search_Get_List(pList, ((CWKSP_Base_Manager *)pItem)->Get_Item(i), String, bName, bDesc, bCase);
+			_Search_Get_List(pList, ((CWKSP_Base_Manager *)pItem)->Get_Item(i), String, bName, bDesc, bCase, Type);
 		}
 	}
 
@@ -887,9 +872,9 @@ bool CWKSP_Base_Control::_Search_Get_List(CSG_Table *pList, CWKSP_Base_Item *pIt
 }
 
 //---------------------------------------------------------
-bool CWKSP_Base_Control::_Search_Item(void)
+CWKSP_Base_Item * CWKSP_Base_Control::Search_Item(const wxString &Caption, TWKSP_Item Type)
 {
-	static CSG_Parameters	Search(NULL, _TL("Search for..."), _TL(""));
+	static CSG_Parameters	Search(NULL, Caption, _TL(""));
 
 	if( Search.Get_Count() == 0 )
 	{
@@ -901,7 +886,7 @@ bool CWKSP_Base_Control::_Search_Item(void)
 
 	if( !DLG_Parameters(&Search) )
 	{
-		return( false );
+		return( NULL );
 	}
 
 	//-----------------------------------------------------
@@ -911,42 +896,61 @@ bool CWKSP_Base_Control::_Search_Item(void)
 	List.Add_Field(_TL("TYPE")	, SG_DATATYPE_String);
 	List.Add_Field(_TL("ADDR")	, SG_DATATYPE_Long);
 
-	_Search_Get_List(&List, m_pManager, Search("STRING")->asString(), Search("NAME")->asBool(), Search("DESC")->asBool(), Search("CASE")->asBool());
+	_Search_Get_List(&List, m_pManager, Search("STRING")->asString(), Search("NAME")->asBool(), Search("DESC")->asBool(), Search("CASE")->asBool(), Type);
 
 	if( List.Get_Count() <= 0 )
 	{
 		wxMessageBox(_TL("Search text not found"), _TL("Search for..."), wxOK|wxICON_EXCLAMATION);
 
-		return( false );
+		return( NULL );
 	}
 
 	//-----------------------------------------------------
+	List.Set_Index(1, TABLE_INDEX_Ascending, 0, TABLE_INDEX_Ascending);
+
 	wxArrayString	Items;
 
 	for(int i=0; i<List.Get_Count(); i++)
 	{
-		Items.Add(wxString::Format(wxT("[%s] %s"), List[i].asString(1), List[i].asString(0)));
+		if( Type == WKSP_ITEM_Undefined )
+		{
+			Items.Add(wxString::Format(wxT("[%s] %s"), List[i].asString(1), List[i].asString(0)));
+		}
+		else
+		{
+			Items.Add(List[i].asString(0));
+		}
 	}
 
 	wxSingleChoiceDialog	dlg(MDI_Get_Top_Window(),
-		_TL("Locate..."),
-		wxString::Format(wxT("%s: %s"), _TL("Search Text"), Search("STRING")->asString()),
-		Items
+		wxString::Format(wxT("%s: '%s'"), _TL("Search Result"), Search("STRING")->asString()),
+		Caption, Items
 	);
 
 	if( dlg.ShowModal() != wxID_OK )
 	{
-		return( false );
+		return( NULL );
 	}
 
 	//-----------------------------------------------------
-	CWKSP_Base_Item	*pItem	= (CWKSP_Base_Item *)List.Get_Record(dlg.GetSelection())->asInt(2);
+	return( (CWKSP_Base_Item *)List[dlg.GetSelection()].asInt(2) );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Base_Control::_Search_Item(void)
+{
+	CWKSP_Base_Item	*pItem	= Search_Item(_TL("Locate..."));
 
-	EnsureVisible	(pItem->GetId());
-	SelectItem		(pItem->GetId());
-	ScrollTo		(pItem->GetId());
+	if( pItem && pItem->GetId().IsOk() )
+	{
+		EnsureVisible	(pItem->GetId());
+		SelectItem		(pItem->GetId());
+		ScrollTo		(pItem->GetId());
 
-	return( true );
+		return( true );
+	}
+
+	return( false );
 }
 
 
@@ -959,7 +963,7 @@ bool CWKSP_Base_Control::_Search_Item(void)
 //---------------------------------------------------------
 void CWKSP_Base_Control::On_Item_LClick(wxMouseEvent &event)
 {
-	_Set_Active();
+	g_pACTIVE->Set_Active(Get_Item_Selected());
 
 	event.Skip();
 }
@@ -982,7 +986,7 @@ void CWKSP_Base_Control::On_Item_RClick(wxTreeEvent &event)
 	{
 	//	SelectItem(event.GetItem());
 
-		_Set_Active();
+		g_pACTIVE->Set_Active(Get_Item_Selected());
 	}
 
 	wxMenu	*pMenu	= Get_Context_Menu();
@@ -1024,7 +1028,10 @@ void CWKSP_Base_Control::On_Item_KeyDown(wxTreeEvent &event)
 //---------------------------------------------------------
 void CWKSP_Base_Control::On_Item_SelChanged(wxTreeEvent &event)
 {
-	_Set_Active();
+	if( g_pACTIVE && (!m_bUpdating || Get_Item_Selected()) )
+	{
+		g_pACTIVE->Set_Active(Get_Item_Selected());
+	}
 
 	event.Skip();
 }
diff --git a/src/saga_core/saga_gui/wksp_base_control.h b/src/saga_core/saga_gui/wksp_base_control.h
index 72f61c1..521869b 100644
--- a/src/saga_core/saga_gui/wksp_base_control.h
+++ b/src/saga_core/saga_gui/wksp_base_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_base_control.h 2009 2014-02-21 14:42:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,7 +72,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <wx/treectrl.h>
+#include "wksp_base_item.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -90,9 +90,9 @@ public:
 	CWKSP_Base_Control(wxWindow *pParent, wxWindowID id);
 	virtual ~CWKSP_Base_Control(void);
 
+	int							Get_Selection_Count	(void);
 	class CWKSP_Base_Item *		Get_Item_Selected	(void);
 	bool						Set_Item_Selected	(class CWKSP_Base_Item *pItem, bool bKeepMultipleSelection = false);
-	int							Get_Selection_Count	(void);
 
 	void						On_Command			(wxCommandEvent  &event);
 	void						On_Command_UI		(wxUpdateUIEvent &event);
@@ -106,9 +106,13 @@ public:
 
 	wxMenu *					Get_Context_Menu	(void);
 
+	CWKSP_Base_Item	*			Search_Item			(const wxString &Caption, TWKSP_Item Type = WKSP_ITEM_Undefined);
+
 
 protected:
 
+	bool						m_bUpdating;
+
 	class CWKSP_Base_Manager	*m_pManager;
 
 
@@ -118,7 +122,6 @@ protected:
 	bool						_Del_Item			(class CWKSP_Base_Item *pItem, bool bSilent);
 	bool						_Del_Item_Confirm	(class CWKSP_Base_Item *pItem);
 
-	bool						_Set_Active			(void);
 	bool						_Del_Active			(bool bSilent);
 
 	bool						_Show_Active		(void);
@@ -130,8 +133,8 @@ protected:
 	bool						_Copy_Settings		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem);
 
 	bool						_Search_Compare		(wxString A, wxString B, bool bCase);
+	bool						_Search_Get_List	(class CSG_Table *pList, class CWKSP_Base_Item *pItem, const wxString &String, bool bName, bool bDesc, bool bCase, TWKSP_Item Type);
 	bool						_Search_Item		(void);
-	bool						_Search_Get_List	(class CSG_Table *pList, class CWKSP_Base_Item *pItem, const wxString &String, bool bName, bool bDesc, bool bCase);
 
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_base_item.cpp b/src/saga_core/saga_gui/wksp_base_item.cpp
index f346ecb..04fcd1e 100644
--- a/src/saga_core/saga_gui/wksp_base_item.cpp
+++ b/src/saga_core/saga_gui/wksp_base_item.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_item.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_base_item.cpp 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -85,9 +85,9 @@ wxString CWKSP_Base_Item::Get_Type_Name(TWKSP_Item Type)
 {
 	switch( Type )
 	{
-	case WKSP_ITEM_Module_Manager:		return( _TL("Module Manager") );
-	case WKSP_ITEM_Module_Library:		return( _TL("Module Library") );
-	case WKSP_ITEM_Module:				return( _TL("Module") );
+	case WKSP_ITEM_Module_Manager:		return( _TL("Tool Manager") );
+	case WKSP_ITEM_Module_Library:		return( _TL("Tool Library") );
+	case WKSP_ITEM_Module:				return( _TL("Tool") );
 
 	case WKSP_ITEM_Data_Manager:		return( _TL("Data Manager") );
 
@@ -205,6 +205,7 @@ CWKSP_Base_Control * CWKSP_Base_Item::Get_Control(void)
 	case WKSP_ITEM_Map_Manager:
 	case WKSP_ITEM_Map:
 	case WKSP_ITEM_Map_Layer:
+	case WKSP_ITEM_Map_Graticule:
 		return( g_pMap_Ctrl );
 	}
 }
diff --git a/src/saga_core/saga_gui/wksp_base_item.h b/src/saga_core/saga_gui/wksp_base_item.h
index f754da9..869e244 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_base_item.h 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,10 +72,11 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <wx/event.h>
 #include <wx/menu.h>
 #include <wx/treectrl.h>
 
+#include <saga_api/saga_api.h>
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -112,6 +113,7 @@ typedef enum
 	WKSP_ITEM_Map_Manager,
 	WKSP_ITEM_Map,
 	WKSP_ITEM_Map_Layer,
+	WKSP_ITEM_Map_Graticule,
 
 	WKSP_ITEM_Undefined
 }
diff --git a/src/saga_core/saga_gui/wksp_data_item.cpp b/src/saga_core/saga_gui/wksp_data_item.cpp
index cb68823..b2b7f16 100644
--- a/src/saga_core/saga_gui/wksp_data_item.cpp
+++ b/src/saga_core/saga_gui/wksp_data_item.cpp
@@ -66,6 +66,7 @@
 
 #include "active.h"
 #include "active_parameters.h"
+#include "active_attributes.h"
 
 #include "wksp_base_control.h"
 
@@ -81,6 +82,7 @@
 #include "wksp_data_item.h"
 
 #include "view_histogram.h"
+#include "view_scatterplot.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -100,6 +102,12 @@ CWKSP_Data_Item::CWKSP_Data_Item(CSG_Data_Object *pObject)
 //---------------------------------------------------------
 CWKSP_Data_Item::~CWKSP_Data_Item(void)
 {
+	for(int i=m_Views.GetCount()-1; i>=0; i--)
+	{
+		((CVIEW_Base *)m_Views[i])->Do_Destroy();
+	}
+
+	//-----------------------------------------------------
 	if( m_pObject )
 	{
 		CSG_Data_Object	*pObject	= m_pObject;	m_pObject	= NULL;
@@ -287,19 +295,17 @@ bool CWKSP_Data_Item::Save(const wxString &File_Name)
 //---------------------------------------------------------
 void CWKSP_Data_Item::Parameters_Changed(void)
 {
-	static bool	bUpdates	= false;
-
-	if( !bUpdates )
+	if( !m_bUpdating )
 	{
-		bUpdates	= true;
+		m_bUpdating	= true;
 
 		On_Parameters_Changed();
 
 		CWKSP_Base_Item::Parameters_Changed();
 
-		Update_Views(true);
+		m_bUpdating	= false;
 
-		bUpdates	= false;
+		Update_Views(true);
 	}
 }
 
@@ -364,6 +370,47 @@ void CWKSP_Data_Item::On_DataObject_Changed(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+bool CWKSP_Data_Item::Add_ScatterPlot(void)
+{
+	new CVIEW_ScatterPlot(this);
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Data_Item::View_Opened(wxMDIChildFrame *pView)
+{
+	if( m_Views.Index(pView) == wxNOT_FOUND )	// only add once
+	{
+		m_Views.Add(pView);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Data_Item::View_Closes(wxMDIChildFrame *pView)
+{
+	if( m_Views.Index(pView) != wxNOT_FOUND )
+	{
+		m_Views.Remove(pView);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
 bool CWKSP_Data_Item::Update_Views(bool bAll)
 {
 	if( !m_bUpdating )
@@ -372,6 +419,19 @@ bool CWKSP_Data_Item::Update_Views(bool bAll)
 
 		On_Update_Views(bAll);
 
+		if( bAll )
+		{
+			for(size_t i=0; i<m_Views.Count(); i++)
+			{
+				((CVIEW_Base *)m_Views[i])->Do_Update();
+			}
+		}
+
+		if( g_pACTIVE->Get_Active_Data_Item() == this )
+		{
+			g_pACTIVE->Get_Attributes()->Set_Attributes();
+		}
+
 		m_bUpdating	= false;
 
 		return( true );
diff --git a/src/saga_core/saga_gui/wksp_data_item.h b/src/saga_core/saga_gui/wksp_data_item.h
index c7d97b9..0acf9c6 100644
--- a/src/saga_core/saga_gui/wksp_data_item.h
+++ b/src/saga_core/saga_gui/wksp_data_item.h
@@ -72,6 +72,8 @@
 //---------------------------------------------------------
 #include <saga_api/saga_api.h>
 
+#include <wx/dynarray.h>
+
 #include "wksp_base_item.h"
 
 
@@ -107,8 +109,10 @@ public:
 	virtual bool					Show					(int Flags = 0)	= 0;
 	virtual bool					Update					(CWKSP_Data_Item *pChanged)		{	return( pChanged == this );	}
 
+	virtual bool					View_Opened				(class wxMDIChildFrame *pView);
+	virtual bool					View_Closes				(class wxMDIChildFrame *pView);
+
 	virtual bool					Update_Views			(bool bAll = true);
-	virtual bool					View_Closes				(class wxMDIChildFrame *pView)	{	return( true );	}
 
 
 protected:
@@ -121,11 +125,15 @@ protected:
 	virtual void					On_DataObject_Changed	(void);
 	virtual void					On_Update_Views			(bool bAll)	{}
 
+	bool							Add_ScatterPlot			(void);
+
 
 private:
 
 	bool							m_bUpdating;
 
+	wxArrayPtrVoid					m_Views;
+
 };
 
 
diff --git a/src/saga_core/saga_gui/wksp_data_layers.cpp b/src/saga_core/saga_gui/wksp_data_layers.cpp
index 13bcb42..d136147 100644
--- a/src/saga_core/saga_gui/wksp_data_layers.cpp
+++ b/src/saga_core/saga_gui/wksp_data_layers.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_layers.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_layers.cpp 2021 2014-02-26 15:49:51Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -68,6 +68,7 @@
 #include "res_controls.h"
 #include "res_commands.h"
 #include "res_dialogs.h"
+#include "res_images.h"
 
 #include "helper.h"
 #include "dc_helper.h"
@@ -90,136 +91,141 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#define SCROLL_RATE		5
-
-#define SCROLL_BAR_DX	wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)
-#define SCROLL_BAR_DY	wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y)
+IMPLEMENT_CLASS(CWKSP_Data_Button, wxPanel)
 
 //---------------------------------------------------------
-#define THUMBNAIL_SIZE	75
-#define THUMBNAIL_DIST	5
-
-#define TITLE_FONT		wxFont(8, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)
+BEGIN_EVENT_TABLE(CWKSP_Data_Button, wxPanel)
+	EVT_PAINT			(CWKSP_Data_Button::On_Paint)
+	EVT_KEY_DOWN		(CWKSP_Data_Button::On_Key)
+	EVT_LEFT_DOWN		(CWKSP_Data_Button::On_Mouse_LDown)
+	EVT_LEFT_DCLICK		(CWKSP_Data_Button::On_Mouse_LDClick)
+	EVT_RIGHT_DOWN		(CWKSP_Data_Button::On_Mouse_RDown)
+END_EVENT_TABLE()
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CWKSP_Data_Buttons	*g_pData_Buttons	= NULL;
+CWKSP_Data_Button::CWKSP_Data_Button(wxWindow *pParent, CWKSP_Base_Item *pItem)
+	: wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_RAISED)
+{
+	m_pItem		= pItem;
+
+	if( is_Manager() )
+	{
+		wxClientDC	dc(this);
+
+		SetSize(wxDefaultSize.GetWidth(), dc.GetTextExtent(m_pItem->Get_Name()).GetHeight() + 10);
+	}
+}
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-IMPLEMENT_CLASS(CWKSP_Data_Button, wxPanel)
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(CWKSP_Data_Button, wxPanel)
-	EVT_PAINT			(CWKSP_Data_Button::On_Paint)
-	EVT_LEFT_DOWN		(CWKSP_Data_Button::On_Mouse_LDown)
-	EVT_LEFT_DCLICK		(CWKSP_Data_Button::On_Mouse_LDClick)
-	EVT_RIGHT_DOWN		(CWKSP_Data_Button::On_Mouse_RDown)
-END_EVENT_TABLE()
-
-//---------------------------------------------------------
-CWKSP_Data_Button::CWKSP_Data_Button(wxWindow *pParent, class CWKSP_Layer *pLayer)
-	: wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER)
+bool CWKSP_Data_Button::is_Manager(void)
 {
-	m_pLayer	= pLayer;
-	m_pObject	= pLayer->Get_Object();
-	m_Title		= pLayer->Get_Name();
+	return( m_pItem && m_pItem->is_Manager() );
 }
 
-//---------------------------------------------------------
-CWKSP_Data_Button::CWKSP_Data_Button(wxWindow *pParent, const wxString &Title)
-	: wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, 0)
-{
-	m_pLayer	= NULL;
-	m_pObject	= NULL;
-	m_Title		= Title;
-
-	int			x, y, d, e;
-	wxClientDC	dc(this);
-	wxFont		Font(TITLE_FONT);
-	dc.GetTextExtent(m_Title, &x, &y, &d, &e, &Font);
-	SetSize(-1, -1, x + 4, y + d + e + 4);
-}
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
 void CWKSP_Data_Button::On_Paint(wxPaintEvent &event)
 {
-	wxPaintDC	dc(this);
-	wxRect		r(wxPoint(0, 0), GetClientSize());
-
-	if( m_pLayer && m_pLayer->GetId().IsOk() && m_pLayer->Get_Object() == m_pObject && g_pData->Get(m_pObject) )
+	if( m_pItem )
 	{
-		if( !GetToolTip() || GetToolTip()->GetTip().Cmp(m_pLayer->Get_Name()) )
+		if( !GetToolTip() || GetToolTip()->GetTip().Cmp(m_pItem->Get_Name()) )
 		{
-			SetToolTip(m_pLayer->Get_Name());
+			SetToolTip(m_pItem->Get_Name());
 		}
 
-		dc.DrawBitmap(m_pLayer->Get_Thumbnail(r.GetWidth() - 1, r.GetHeight() - 1), r.GetLeft(), r.GetTop(), true);
+		//-------------------------------------------------
+		wxPaintDC	dc(this);
 
-		if( m_pLayer->is_Selected() )
+		if( is_Manager() )
 		{
-			dc.SetPen(wxPen(((CWKSP_Data_Buttons *)GetParent())->Get_Active_Color()));
-			Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
-			Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
-			Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);
+			dc.DrawText(m_pItem->Get_Name(), 2, 2);
+		}
+
+		//-------------------------------------------------
+		else
+		{
+			wxRect		r(GetClientRect());
+
+			if( m_pItem->Get_Type() == WKSP_ITEM_Table )
+			{
+				dc.DrawBitmap(wxBitmap(IMG_Get_Bitmap(ID_IMG_WKSP_TABLE, r.GetWidth() - 1)),
+					r.GetLeft(), r.GetTop(), true
+				);
+			}
+			else
+			{
+				dc.DrawBitmap(((CWKSP_Layer *)m_pItem)->Get_Thumbnail(r.GetWidth() - 1, r.GetHeight() - 1),
+					r.GetLeft(), r.GetTop(), true
+				);
+			}
+
+			//---------------------------------------------
+			if( m_pItem->is_Selected() )
+			{
+				dc.SetPen(wxPen(Get_Color_asWX(g_pData->Get_Parameter("THUMBNAIL_SELCOLOR")->asColor())));
+
+				Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
+				Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
+				Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);
+			}
 		}
-	}
-	else
-	{
-		dc.DrawLine(0, 0, r.GetWidth(), 0);
-		dc.DrawLine(0, 1, r.GetWidth(), 1);
-		dc.SetFont(TITLE_FONT);
-		dc.DrawText(m_Title, 2, 2);
-		dc.DrawLine(0, r.GetBottom(), r.GetWidth(), r.GetBottom());
 	}
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-bool CWKSP_Data_Button::_Select(bool bKeepOthers)
+void CWKSP_Data_Button::On_Key(wxKeyEvent &event)
 {
-	if( m_pLayer && SG_Get_Data_Manager().Exists(m_pObject) )
-	{
-		g_pData_Ctrl->Set_Item_Selected(m_pLayer, bKeepOthers);
-
-		GetParent()->Refresh();
+	wxCommandEvent	Command;
 
-		return( true );
+	switch( event.GetKeyCode() )
+	{
+	case WXK_RETURN:
+		Command.SetId(ID_CMD_WKSP_ITEM_RETURN);
+		g_pData_Ctrl->On_Command(Command);
+		break;
+
+	case WXK_DELETE:
+		Command.SetId(ID_CMD_WKSP_ITEM_CLOSE);
+		g_pData_Ctrl->On_Command(Command);
+		break;
+
+	default:
+		break;
 	}
-
-	m_pObject	= NULL;
-
-	return( false );
 }
 
 //---------------------------------------------------------
 void CWKSP_Data_Button::On_Mouse_LDown(wxMouseEvent &event)
 {
-	_Select(event.ControlDown());
-
-	event.Skip();
+	_Set_Active(event.ControlDown());
 }
 
 //---------------------------------------------------------
 void CWKSP_Data_Button::On_Mouse_LDClick(wxMouseEvent &event)
 {
-	if( _Select(false) )
+	if( _Set_Active(false) && m_pItem )
 	{
-		m_pLayer->On_Command(ID_CMD_WKSP_ITEM_RETURN);
+		m_pItem->On_Command(ID_CMD_WKSP_ITEM_RETURN);
 	}
-
-	event.Skip();
 }
 
 //---------------------------------------------------------
@@ -227,7 +233,7 @@ void CWKSP_Data_Button::On_Mouse_RDown(wxMouseEvent &event)
 {
 	if( g_pData_Ctrl->Get_Selection_Count() <= 1 )
 	{
-		_Select(false);
+		_Set_Active(false);
 	}
 
 	wxMenu	*pMenu	= g_pData_Ctrl->Get_Context_Menu();
@@ -237,11 +243,43 @@ void CWKSP_Data_Button::On_Mouse_RDown(wxMouseEvent &event)
 		GetParent()->PopupMenu(pMenu, GetParent()->ScreenToClient(ClientToScreen(event.GetPosition())));
 
 		delete(pMenu);
+	}
+}
 
-		return;
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Data_Button::_Set_Active(bool bKeepOthers)
+{
+	if( is_Manager() )
+	{
+		SetFocus();
+
+		g_pData_Ctrl->SelectChildren(m_pItem->GetId());
+
+		g_pData_Buttons->Refresh(false);
+
+		return( true );
 	}
 
-	event.Skip();
+	if( m_pItem && SG_Get_Data_Manager().Exists(((CWKSP_Data_Item *)m_pItem)->Get_Object()) )
+	{
+		SetFocus();
+
+		if( g_pData_Ctrl->Set_Item_Selected(m_pItem, bKeepOthers) )
+		{
+			g_pData_Buttons->Refresh(false);
+		}
+
+		return( true );
+	}
+
+	m_pItem	= NULL;
+
+	return( false );
 }
 
 
@@ -252,19 +290,31 @@ void CWKSP_Data_Button::On_Mouse_RDown(wxMouseEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define THUMBNAIL_DIST	5
+#define SCROLL_RATE		5
+#define SCROLL_BAR_DX	wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)
+#define SCROLL_BAR_DY	wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y)
+
+//---------------------------------------------------------
+CWKSP_Data_Buttons	*g_pData_Buttons	= NULL;
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 IMPLEMENT_CLASS(CWKSP_Data_Buttons, wxScrolledWindow)
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CWKSP_Data_Buttons, wxScrolledWindow)
-	EVT_RIGHT_DOWN		(CWKSP_Data_Buttons::On_Mouse_RDown)
 	EVT_SIZE			(CWKSP_Data_Buttons::On_Size)
+	EVT_LEFT_DOWN		(CWKSP_Data_Buttons::On_Mouse_LDown)
 END_EVENT_TABLE()
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -278,82 +328,42 @@ CWKSP_Data_Buttons::CWKSP_Data_Buttons(wxWindow *pParent)
 
 	m_Items			= NULL;
 	m_nItems		= 0;
-
-	//-----------------------------------------------------
-	bool	bValue;
-	long	lValue;
-
-	m_Size			= CONFIG_Read(wxT("/BUTTONS_DATA"), wxT("SIZE")		, lValue) ? (int)lValue : 75;
-	m_bCategorised	= CONFIG_Read(wxT("/BUTTONS_DATA"), wxT("CATEGORY")	, bValue) ?      bValue : true;
-	m_Active_Color	= CONFIG_Read(wxT("/BUTTONS_DATA"), wxT("SELCOLOR")	, lValue) ?      lValue : Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW));
-
-	//-----------------------------------------------------
-	m_Parameters.Create(this, _TL("Options for Data Thumbnails"), _TL(""));
-
-	m_Parameters.Add_Value(
-		NULL, "SIZE"		, _TL("Thumbnail Size"),
-		_TL(""),
-		PARAMETER_TYPE_Int, m_Size, 10, true
-	);
-
-	m_Parameters.Add_Value(
-		NULL, "CATEGORY"	, _TL("Show Categories"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, m_bCategorised
-	);
-
-	m_Parameters.Add_Value(
-		NULL, "SELCOLOR"	, _TL("Selection Color"),
-		_TL(""),
-		PARAMETER_TYPE_Color, m_Active_Color
-	);
 }
 
 //---------------------------------------------------------
 CWKSP_Data_Buttons::~CWKSP_Data_Buttons(void)
 {
-	CONFIG_Write(wxT("/BUTTONS_DATA"), wxT("SIZE")    , (long)m_Parameters("SIZE")	  ->asInt());
-	CONFIG_Write(wxT("/BUTTONS_DATA"), wxT("CATEGORY"),       m_Parameters("CATEGORY")->asBool());
-	CONFIG_Write(wxT("/BUTTONS_DATA"), wxT("SELCOLOR"),       m_Parameters("SELCOLOR")->asColor());
+	g_pData_Buttons	= NULL;
 
 	_Del_Items();
-
-	g_pData_Buttons	= NULL;
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Data_Buttons::On_Mouse_RDown(wxMouseEvent &event)
+void CWKSP_Data_Buttons::On_Size(wxSizeEvent &event)
 {
-	if( DLG_Parameters(&m_Parameters) )
-	{
-		m_Size			= m_Parameters("SIZE")		->asInt();
-		m_bCategorised	= m_Parameters("CATEGORY")	->asBool();
-		m_Active_Color	= m_Parameters("SELCOLOR")	->asColor();
-
-		Update_Buttons();
-	}
+	_Set_Positions();
 
 	event.Skip();
 }
 
 //---------------------------------------------------------
-void CWKSP_Data_Buttons::On_Size(wxSizeEvent &event)
+void CWKSP_Data_Buttons::On_Mouse_LDown(wxMouseEvent &event)
 {
-	_Set_Positions();
+	g_pData_Ctrl->UnselectAll();
+
+	g_pACTIVE->Set_Active(NULL);
+
+	Refresh(false);
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -362,6 +372,7 @@ void CWKSP_Data_Buttons::Update_Buttons(void)
 	Freeze();
 
 	_Del_Items();
+
 	_Add_Items(g_pData);
 
 	Scroll(0, 0);
@@ -374,81 +385,27 @@ void CWKSP_Data_Buttons::Update_Buttons(void)
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Data_Buttons::_Set_Positions(void)
+bool CWKSP_Data_Buttons::_Del_Items(void)
 {
-	int		xSize, ySize, xPos, yPos, xAdd, yAdd, i, x, y;
-
-	xSize	= GetClientSize().x - SCROLL_BAR_DX;
-
-	if( xSize < m_Size + THUMBNAIL_DIST )
-	{
-		xSize	= m_Size + THUMBNAIL_DIST;
-	}
-
-	xPos	= THUMBNAIL_DIST;
-	yPos	= THUMBNAIL_DIST;
-	xAdd	= 0;
-	yAdd	= 0;
-
-	for(i=0; i<m_nItems; i++)
+	if( m_nItems > 0 )
 	{
-		CWKSP_Data_Button	*pItem	= m_Items[i];
-
-		if( pItem->is_Title() )
+		for(int i=0; i<m_nItems; i++)
 		{
-			xPos	 = THUMBNAIL_DIST;
-			yPos	+= THUMBNAIL_DIST + yAdd;
-
-			CalcScrolledPosition(0, yPos, &x, &y);
-			pItem->SetSize(x, y, xSize + SCROLL_BAR_DX, -1, wxSIZE_USE_EXISTING);
-
-			yPos	+= THUMBNAIL_DIST + pItem->GetSize().y;
-			yAdd	 = 0;
+			delete(m_Items[i]);
 		}
-		else
-		{
-			xAdd	= m_Size;
 
-			if( xPos + xAdd >= xSize )
-			{
-				xPos	 = THUMBNAIL_DIST;
-				yPos	+= yAdd;
-				yAdd	 = THUMBNAIL_DIST + m_Size;
-			}
-
-			yAdd	= m_Size + THUMBNAIL_DIST;
-
-			CalcScrolledPosition(xPos, yPos, &x, &y);
-			pItem->SetSize(x, y, m_Size, m_Size);
-
-			xPos	+= THUMBNAIL_DIST + xAdd;
-		}
+		SG_Free(m_Items);
 	}
 
-	xSize	+= SCROLL_BAR_DX;
-	ySize	 = SCROLL_BAR_DY + yPos + yAdd;
-
-	if(	m_xScroll != xSize || m_yScroll != ySize )
-	{
-		m_xScroll	= xSize;
-		m_yScroll	= ySize;
+	m_Items		= NULL;
+	m_nItems	= 0;
 
-		SetScrollbars(SCROLL_RATE, SCROLL_RATE, m_xScroll / SCROLL_RATE, m_yScroll / SCROLL_RATE);
-	}
+	return( true );
 }
 
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
 //---------------------------------------------------------
 bool CWKSP_Data_Buttons::_Add_Items(CWKSP_Base_Item *pItem)
 {
@@ -459,26 +416,28 @@ bool CWKSP_Data_Buttons::_Add_Items(CWKSP_Base_Item *pItem)
 		default:
 			return( false );
 
+		case WKSP_ITEM_Table:
 		case WKSP_ITEM_Shapes:
 		case WKSP_ITEM_TIN:
 		case WKSP_ITEM_PointCloud:
 		case WKSP_ITEM_Grid:
-			return( _Add_Item((CWKSP_Layer *)pItem) );
-
-		case WKSP_ITEM_Data_Manager:
-		case WKSP_ITEM_Grid_Manager:
-		case WKSP_ITEM_Shapes_Manager:
-			break;
+			return( _Add_Item((CWKSP_Data_Item *)pItem) );
 
-		case WKSP_ITEM_Grid_System:
+		case WKSP_ITEM_Table_Manager:
 		case WKSP_ITEM_Shapes_Type:
 		case WKSP_ITEM_TIN_Manager:
 		case WKSP_ITEM_PointCloud_Manager:
-			if( m_bCategorised )
+		case WKSP_ITEM_Grid_System:
+			if( g_pData->Get_Parameter("THUMBNAIL_CATEGORY")->asBool() )
 			{
-				_Add_Item(pItem->Get_Name());
+				_Add_Item((CWKSP_Base_Manager *)pItem);
 			}
 			break;
+
+		case WKSP_ITEM_Data_Manager:
+		case WKSP_ITEM_Grid_Manager:
+		case WKSP_ITEM_Shapes_Manager:
+			break;
 		}
 
 		for(int i=0; i<((CWKSP_Base_Manager *)pItem)->Get_Count(); i++)
@@ -493,12 +452,12 @@ bool CWKSP_Data_Buttons::_Add_Items(CWKSP_Base_Item *pItem)
 }
 
 //---------------------------------------------------------
-bool CWKSP_Data_Buttons::_Add_Item(CWKSP_Layer *pLayer)
+bool CWKSP_Data_Buttons::_Add_Item(CWKSP_Data_Item *pItem)
 {
-	if( pLayer )
+	if( pItem )
 	{
 		m_Items	= (CWKSP_Data_Button **)SG_Realloc(m_Items, (m_nItems + 1) * sizeof(CWKSP_Data_Button *));
-		m_Items[m_nItems++]	= new CWKSP_Data_Button(this, pLayer);
+		m_Items[m_nItems++]	= new CWKSP_Data_Button(this, pItem);
 
 		return( true );
 	}
@@ -507,12 +466,12 @@ bool CWKSP_Data_Buttons::_Add_Item(CWKSP_Layer *pLayer)
 }
 
 //---------------------------------------------------------
-bool CWKSP_Data_Buttons::_Add_Item(const wxString &Title)
+bool CWKSP_Data_Buttons::_Add_Item(CWKSP_Base_Manager *pItem)
 {
-	if( Title.Length() > 0 )
+	if( pItem )
 	{
 		m_Items	= (CWKSP_Data_Button **)SG_Realloc(m_Items, (m_nItems + 1) * sizeof(CWKSP_Data_Button *));
-		m_Items[m_nItems++]	= new CWKSP_Data_Button(this, Title);
+		m_Items[m_nItems++]	= new CWKSP_Data_Button(this, pItem);
 
 		return( true );
 	}
@@ -520,23 +479,77 @@ bool CWKSP_Data_Buttons::_Add_Item(const wxString &Title)
 	return( false );
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-bool CWKSP_Data_Buttons::_Del_Items(void)
+void CWKSP_Data_Buttons::_Set_Positions(void)
 {
-	if( m_nItems > 0 )
+	int		Size, xSize, ySize, xPos, yPos, xAdd, yAdd;
+
+	Size	= g_pData->Get_Parameter("THUMBNAIL_SIZE")->asInt();
+
+	xSize	= GetClientSize().x - SCROLL_BAR_DX;
+
+	if( xSize < Size + THUMBNAIL_DIST )
 	{
-		for(int i=0; i<m_nItems; i++)
+		xSize	= Size + THUMBNAIL_DIST;
+	}
+
+	xPos	= 0;
+	yPos	= 0;
+	xAdd	= 0;
+	yAdd	= 0;
+
+	//-----------------------------------------------------
+	for(int i=0, x, y; i<m_nItems; i++)
+	{
+		CWKSP_Data_Button	*pItem	= m_Items[i];
+
+		if( pItem->is_Manager() )
 		{
-			delete(m_Items[i]);
+			xPos	 = THUMBNAIL_DIST;
+			yPos	+= yAdd;	if( yPos > 0 )	yPos	+= THUMBNAIL_DIST;
+
+			CalcScrolledPosition(0, yPos, &x, &y);
+			pItem->SetSize(x, y, xSize + SCROLL_BAR_DX, -1, wxSIZE_USE_EXISTING);
+
+			yPos	+= THUMBNAIL_DIST + pItem->GetSize().y;
+			yAdd	 = 0;
 		}
+		else
+		{
+			xAdd	= Size;
 
-		SG_Free(m_Items);
+			if( xPos + xAdd >= xSize )
+			{
+				xPos	 = THUMBNAIL_DIST;
+				yPos	+= yAdd;
+				yAdd	 = THUMBNAIL_DIST + Size;
+			}
+
+			yAdd	= Size + THUMBNAIL_DIST;
+
+			CalcScrolledPosition(xPos, yPos, &x, &y);
+			pItem->SetSize(x, y, Size, Size);
+
+			xPos	+= THUMBNAIL_DIST + xAdd;
+		}
 	}
 
-	m_Items		= NULL;
-	m_nItems	= 0;
+	//-----------------------------------------------------
+	xSize	+= SCROLL_BAR_DX;
+	ySize	 = SCROLL_BAR_DY + yPos + yAdd;
 
-	return( true );
+	if(	m_xScroll != xSize || m_yScroll != ySize )
+	{
+		m_xScroll	= xSize;
+		m_yScroll	= ySize;
+
+		SetScrollbars(SCROLL_RATE, SCROLL_RATE, m_xScroll / SCROLL_RATE, m_yScroll / SCROLL_RATE);
+	}
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_data_layers.h b/src/saga_core/saga_gui/wksp_data_layers.h
index 19d3cdf..3d60c26 100644
--- a/src/saga_core/saga_gui/wksp_data_layers.h
+++ b/src/saga_core/saga_gui/wksp_data_layers.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_layers.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_layers.h 2020 2014-02-26 11:21:04Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -74,8 +74,6 @@
 //---------------------------------------------------------
 #include <wx/scrolwin.h>
 
-#include <saga_api/saga_api.h>
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -89,34 +87,32 @@ class CWKSP_Data_Button : public wxPanel
 	DECLARE_CLASS(CWKSP_Data_Button)
 
 public:
-	CWKSP_Data_Button(wxWindow *pParent, class CWKSP_Layer *pLayer);
-	CWKSP_Data_Button(wxWindow *pParent, const wxString &Title);
-	virtual ~CWKSP_Data_Button(void)	{}
-
-	void						On_Paint			(wxPaintEvent &event);
-
-	void						On_Mouse_LDown		(wxMouseEvent &event);
-	void						On_Mouse_LDClick	(wxMouseEvent &event);
-	void						On_Mouse_RDown		(wxMouseEvent &event);
+	CWKSP_Data_Button(wxWindow *pParent, class CWKSP_Base_Item *pItem);
 
-	bool						is_Title			(void)		{	return( m_pLayer == NULL );	}
+	bool						is_Manager			(void);
 
 
 private:
 
-	wxString					m_Title;
+	class CWKSP_Base_Item		*m_pItem;
 
-	class CWKSP_Layer			*m_pLayer;
 
-	CSG_Data_Object				*m_pObject;
+	void						On_Paint			(wxPaintEvent &event);
+	void						On_Key				(wxKeyEvent   &event);
+	void						On_Mouse_LDown		(wxMouseEvent &event);
+	void						On_Mouse_LDClick	(wxMouseEvent &event);
+	void						On_Mouse_RDown		(wxMouseEvent &event);
 
+	bool						_Set_Active			(bool bKeepOthers);
 
-	bool						_Select				(bool bKeepOthers);
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
+};
 
 
-//---------------------------------------------------------
-DECLARE_EVENT_TABLE()
-};
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
 class CWKSP_Data_Buttons : public wxScrolledWindow
@@ -127,39 +123,28 @@ public:
 	CWKSP_Data_Buttons(wxWindow *pParent);
 	virtual ~CWKSP_Data_Buttons(void);
 
-	void						On_Mouse_RDown		(wxMouseEvent &event);
-
-	void						On_Size				(wxSizeEvent  &event);
-
 	void						Update_Buttons		(void);
 
-	int							Get_Item_Size		(void)		{	return( m_Size );	}
-	long						Get_Active_Color	(void)		{	return( m_Active_Color );	}
-
 
 private:
 
-	bool						m_bCategorised;
-
-	int							m_xScroll, m_yScroll, m_nItems, m_Size;
-
-	long						m_Active_Color;
+	int							m_nItems, m_xScroll, m_yScroll;
 
 	CWKSP_Data_Button			**m_Items;
 
-	CSG_Parameters				m_Parameters;
-
 
-	void						_Set_Positions		(void);
+	void						On_Size				(wxSizeEvent  &event);
+	void						On_Mouse_LDown		(wxMouseEvent &event);
 
-	bool						_Add_Items			(class CWKSP_Base_Item *pItem);
-	bool						_Add_Item			(class CWKSP_Layer *pLayer);
-	bool						_Add_Item			(const wxString &Title);
 	bool						_Del_Items			(void);
+	bool						_Add_Items			(class CWKSP_Base_Item    *pItem);
+	bool						_Add_Item			(class CWKSP_Data_Item    *pItem);
+	bool						_Add_Item			(class CWKSP_Base_Manager *pItem);
 
+	void						_Set_Positions		(void);
 
-//---------------------------------------------------------
-DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
 };
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_data_manager.cpp b/src/saga_core/saga_gui/wksp_data_manager.cpp
index de89689..8fa1fbc 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_manager.cpp 2096 2014-04-11 12:49:32Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -79,10 +79,12 @@
 #include "wksp_data_control.h"
 #include "wksp_data_manager.h"
 #include "wksp_data_menu_files.h"
+#include "wksp_data_layers.h"
 
 #include "wksp_layer.h"
 
 #include "wksp_table_manager.h"
+#include "wksp_table.h"
 #include "wksp_shapes_manager.h"
 #include "wksp_tin_manager.h"
 #include "wksp_pointcloud_manager.h"
@@ -115,6 +117,8 @@ CWKSP_Data_Manager	*g_pData	= NULL;
 //---------------------------------------------------------
 CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 {
+	g_pData			= this;
+
 	m_pTables		= NULL;
 	m_pShapes		= NULL;
 	m_pTINs			= NULL;
@@ -124,159 +128,136 @@ CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 	m_pProject		= new CWKSP_Project;
 	m_pMenu_Files	= new CWKSP_Data_Menu_Files;
 
-	g_pData			= this;
-
 	//-----------------------------------------------------
-	bool		bValue;
-	long		lValue;
-	double		dValue;
-	wxString	sValue;
-
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("CACHE_TMP_DIR")	, sValue) )
-	{
-		SG_Grid_Cache_Set_Directory(sValue);
-	}
-
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("CACHE_AUTO")		, bValue) )
-	{
-		SG_Grid_Cache_Set_Automatic(bValue);
-	}
-
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("CACHE_THRESHOLD")	, lValue) )
-	{
-		SG_Grid_Cache_Set_Threshold(lValue);
-	}
-
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("CACHE_CONFIRM")	, lValue) )
-	{
-		SG_Grid_Cache_Set_Confirm  (lValue);
-	}
+	CSG_Parameter	*pNode, *pNode_1;
 
 	//-----------------------------------------------------
-	CSG_Parameter	*pNode;
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_GENERAL", _TL("General"), _TL(""));
 
-	m_Parameters.Create(this, _TL(""), _TL(""));
+	m_Parameters.Add_Choice(
+		pNode	, "PROJECT_START"			, _TL("Start Project"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("empty"),
+			_TL("last opened"),
+			_TL("automatically save and load")
+		), 2
+	);
 
-	pNode	= m_Parameters.Add_Node(NULL, "NODE_GRID_MEM", _TL("Grid File Caching"), _TL(""));
+	m_Parameters.Add_Value(
+		pNode	, "NUMBERING"				, _TL("Numbering of Data Sets"),
+		_TL("Leading zeros for data set numbering. Set to -1 for not using numbers at all."),
+		PARAMETER_TYPE_Int, m_Numbering = 2, -1, true
+	);
 
-	m_Parameters.Add_FilePath(
-		pNode	, "GRID_MEM_CACHE_TMPDIR"	, _TL("Temporary files"),
-		_TL("Directory, where temporary cache files shall be saved."),
-		NULL, SG_Grid_Cache_Get_Directory(), true, true
+	m_Parameters.Add_Value(
+		pNode	, "HISTORY_DEPTH"			, _TL("History Depth"),
+		_TL("Depth to which data history is stored. Set -1 keeps all history entries (default), 0 switches history option off."),
+		PARAMETER_TYPE_Int, SG_Get_History_Depth(), -1, true
 	);
 
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_THUMBNAILS", _TL("Thumbnails"), _TL(""));
+
 	m_Parameters.Add_Value(
-		pNode	, "GRID_MEM_CACHE_AUTO"		, _TL("Automatic mode"),
-		_TL("Activate file caching automatically, if memory size exceeds the threshold value."),
-		PARAMETER_TYPE_Bool, SG_Grid_Cache_Get_Automatic()
+		pNode	, "THUMBNAIL_SIZE"		, _TL("Thumbnail Size"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 75, 10, true
 	);
 
 	m_Parameters.Add_Value(
-		pNode	, "GRID_MEM_CACHE_THRSHLD"	, _TL("Threshold for automatic mode [MB]"),
+		pNode	, "THUMBNAIL_CATEGORY"	, _TL("Show Categories"),
 		_TL(""),
-		PARAMETER_TYPE_Double, SG_Grid_Cache_Get_Threshold_MB(), 0.0, true
+		PARAMETER_TYPE_Bool, true
 	);
 
-	m_Parameters.Add_Choice(
-		pNode	, "GRID_MEM_CACHE_CONFIRM"	, _TL("Confirm file caching"),
+	m_Parameters.Add_Value(
+		pNode	, "THUMBNAIL_SELCOLOR"	, _TL("Selection Color"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("do not confirm"),
-			_TL("confirm"),
-			_TL("confirm with options")
-		),
-		SG_Grid_Cache_Get_Confirm()
+		PARAMETER_TYPE_Color, Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW))
 	);
 
 	//-----------------------------------------------------
-	pNode	= m_Parameters.Add_Node(NULL, "NODE_GRID_DISPLAY", _TL("Grid Display Defaults"), _TL(""));
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_GRID", _TL("Grids"), _TL(""));
 
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("DISPLAY_RANGEFIT")	, lValue) == false )
-	{
-		lValue	= 2;
-	}
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_GRID_DISPLAY", _TL("Display"), _TL(""));
 
 	m_Parameters.Add_Choice(
-		pNode	, "GRID_DISPLAY_RANGEFIT"	, _TL("Display Range"),
+		pNode_1	, "GRID_COLORS_FIT"			, _TL("Fit Colors"),
 		_TL(""),
 		CSG_String::Format(SG_T("%s|%s|"),
 			_TL("Minimum/Maximum"),
 			_TL("Standard Deviation")
-		), lValue
+		), 1
 	);
 
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("FIT_STDDEV")	, dValue) == false )
-	{
-		dValue	= 2.0;
-	}
-
 	m_Parameters.Add_Value(
-		pNode	, "FIT_STDDEV"				, _TL("Fit to Standard Deviation"),
+		pNode_1	, "GRID_COLORS_FIT_STDDEV"	, _TL("Fit to Standard Deviation"),
 		_TL("Multiple of Standard Deviation used as default for colour classifications."),
-		PARAMETER_TYPE_Double, dValue, 0.01, true
+		PARAMETER_TYPE_Double, 2.0, 0.01, true
 	);
 
-	if( CONFIG_Read(wxT("/DATA/GRIDS"), wxT("SELECT_MAX")	, lValue) == false )
-	{
-		lValue	= 100;
-	}
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_GRID_SELECTION", _TL("Selection"), _TL(""));
 
 	m_Parameters.Add_Value(
-		pNode	, "SELECT_MAX"				, _TL("Maximum Selection"),
+		pNode_1	, "GRID_SELECT_MAX"			, _TL("Maximum Selection"),
 		_TL("Maximum number of rows/columns in selection of grid cells."),
-		PARAMETER_TYPE_Int, lValue, 1, true
+		PARAMETER_TYPE_Int, 100, 1, true
 	);
 
 	//-----------------------------------------------------
-	pNode	= m_Parameters.Add_Node(NULL, "NODE_GENERAL", _TL("General"), _TL(""));
+	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_GRID_CACHE", _TL("File Caching"), _TL(""));
 
-	if( CONFIG_Read(wxT("/DATA"), wxT("PROJECT_START")			, lValue) == false )
-	{
-		lValue	= 2;
-	}
+	m_Parameters.Add_Value(
+		pNode_1	, "GRID_CACHE_AUTO"		, _TL("Automatic"),
+		_TL("Activate file caching automatically, if memory size exceeds the threshold value."),
+		PARAMETER_TYPE_Bool, SG_Grid_Cache_Get_Automatic()
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "GRID_CACHE_THRSHLD"	, _TL("Threshold for automatic mode [MB]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, SG_Grid_Cache_Get_Threshold_MB(), 0.0, true
+	);
 
 	m_Parameters.Add_Choice(
-		pNode	, "PROJECT_START"			, _TL("Start Project"),
+		pNode_1	, "GRID_CACHE_CONFIRM"	, _TL("Confirm file caching"),
 		_TL(""),
 		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("empty"),
-			_TL("last opened"),
-			_TL("automatically save and load")
-		), lValue
+			_TL("do not confirm"),
+			_TL("confirm"),
+			_TL("confirm with options")
+		), SG_Grid_Cache_Get_Confirm()
 	);
 
-	//-----------------------------------------------------
-	if( CONFIG_Read(wxT("/DATA"), wxT("NUMBERING")				, lValue) == false )
-	{
-		lValue	= 2;
-	}
-
-	m_Parameters.Add_Value(
-		pNode	, "NUMBERING"				, _TL("Numbering of Data Sets"),
-		_TL("Leading zeros for data set numbering. Set to -1 for not using numbers at all."),
-		PARAMETER_TYPE_Int, m_Numbering = lValue, -1, true
+	m_Parameters.Add_FilePath(
+		pNode_1	, "GRID_CACHE_TMPDIR"	, _TL("Temporary files"),
+		_TL("Directory, where temporary cache files shall be saved."),
+		NULL, SG_Grid_Cache_Get_Directory(), true, true
 	);
 
 	//-----------------------------------------------------
-	if( CONFIG_Read(wxT("/DATA"), wxT("HISTORY_DEPTH")			, lValue) == true )
-	{
-		SG_Set_History_Depth(lValue);
-	}
+	CONFIG_Read("/DATA", &m_Parameters);
 
-	m_Parameters.Add_Value(
-		pNode	, "HISTORY_DEPTH"			, _TL("History Depth"),
-		_TL("Depth to which data history is stored. Set -1 keeps all history entries (default), 0 switches history option off."),
-		PARAMETER_TYPE_Int, SG_Get_History_Depth(), -1, true
-	);
+	SG_Grid_Cache_Set_Directory   (m_Parameters("GRID_CACHE_TMPDIR" )->asString());
+	SG_Grid_Cache_Set_Automatic   (m_Parameters("GRID_CACHE_AUTO"   )->asBool  ());
+	SG_Grid_Cache_Set_Threshold_MB(m_Parameters("GRID_CACHE_THRSHLD")->asDouble());
+	SG_Grid_Cache_Set_Confirm     (m_Parameters("GRID_CACHE_CONFIRM")->asInt   ());
+
+	SG_Set_History_Depth(m_Parameters("HISTORY_DEPTH")->asInt());
+
+	m_Numbering	= m_Parameters("NUMBERING")->asInt();
 }
 
 //---------------------------------------------------------
 CWKSP_Data_Manager::~CWKSP_Data_Manager(void)
 {
-	g_pData	= NULL;
-
 	delete(m_pProject);
 	delete(m_pMenu_Files);
+
+	g_pData	= NULL;
 }
 
 
@@ -297,7 +278,7 @@ bool CWKSP_Data_Manager::Initialise(void)
 	}
 	else
 	{
-		return( CONFIG_Read(wxT("/DATA"), wxT("PROJECT_FILE"), FileName) && wxFileExists(FileName) && m_pProject->Load(FileName, false, false) );
+		return( CONFIG_Read("/DATA", "PROJECT_FILE", FileName) && wxFileExists(FileName) && m_pProject->Load(FileName, false, false) );
 	}
 
 	return( false );
@@ -307,59 +288,49 @@ bool CWKSP_Data_Manager::Initialise(void)
 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"));
-	wxFileName	fProject(sHome.c_str(), wxT("saga_gui"), wxT("cfg"));
+	wxFileName	fProject(sHome.c_str(), "saga_gui", "cfg");
 #else
-	wxFileName	fProject(g_pSAGA->Get_App_Path(), wxT("saga_gui"), wxT("cfg"));
-
+	wxFileName	fProject(g_pSAGA->Get_App_Path(), "saga_gui", "cfg");
+	wxString(getenv("HOME"));
 	if(	( fProject.FileExists() && (!fProject.IsFileReadable() || !fProject.IsFileWritable()))
 	||	(!fProject.FileExists() && (!fProject.IsDirReadable () || !fProject.IsDirWritable ())) )
 	{
-		fProject.Assign(wxGetHomeDir(), wxT("saga_gui"), wxT("cfg"));
+		fProject.Assign(wxGetHomeDir(), "saga_gui", "cfg");
 	}
 #endif
 
-	//-----------------------------------------------------
-	CONFIG_Write(wxT("/DATA/GRIDS"), wxT("CACHE_TMP_DIR"   ),		SG_Grid_Cache_Get_Directory());
-	CONFIG_Write(wxT("/DATA/GRIDS"), wxT("CACHE_AUTO"      ),		SG_Grid_Cache_Get_Automatic());
-	CONFIG_Write(wxT("/DATA/GRIDS"), wxT("CACHE_THRESHOLD" ), (long)SG_Grid_Cache_Get_Threshold());
-	CONFIG_Write(wxT("/DATA/GRIDS"), wxT("CACHE_CONFIRM"   ), (long)SG_Grid_Cache_Get_Confirm  ());
-
-	CONFIG_Write(wxT("/DATA/GRIDS"), wxT("DISPLAY_RANGEFIT"), (long)m_Parameters("GRID_DISPLAY_RANGEFIT")->asInt());
-	CONFIG_Write(wxT("/DATA/GRIDS"), wxT("FIT_STDDEV"      ),       m_Parameters("FIT_STDDEV"   )->asDouble());
-
-	CONFIG_Write(wxT("/DATA"      ), wxT("PROJECT_START"   ), (long)m_Parameters("PROJECT_START")->asInt());
-	CONFIG_Write(wxT("/DATA"      ), wxT("NUMBERING"       ), (long)m_Parameters("NUMBERING"    )->asInt());
+	fProject.Normalize();
 
-	CONFIG_Write(wxT("/DATA"      ), wxT("HISTORY_DEPTH"   ), (long)m_Parameters("HISTORY_DEPTH")->asInt());
-
-	if( Get_Count() == 0 )
-	{
+	//-----------------------------------------------------
+	if( Get_Count() == 0 || m_Parameters("PROJECT_START")->asInt() == 0 )
+	{	// empty
 		if( fProject.FileExists() )
+		{
 			wxRemoveFile(fProject.GetFullPath());
+		}
 
-		CONFIG_Write(wxT("/DATA"), wxT("PROJECT_FILE"), _TL(""));
+		CONFIG_Write("/DATA", "PROJECT_FILE", "");
 	}
-	else switch( m_Parameters("PROJECT_START")->asInt() )
-	{
-	case 0:	// empty
+	else if( m_Parameters("PROJECT_START")->asInt() == 1 )
+	{	// last opened
         if( fProject.FileExists() )
+		{
             wxRemoveFile(fProject.GetFullPath());
-		CONFIG_Write(wxT("/DATA"), wxT("PROJECT_FILE"), _TL(""));
-		break;
+		}
 
-	case 1:	// last opened
-        if( fProject.FileExists() )
-            wxRemoveFile(fProject.GetFullPath());
 		CONFIG_Write(wxT("/DATA"), wxT("PROJECT_FILE"), m_pProject->Get_File_Name());
-		break;
-
-	case 2:	// automatically save and load
+	}
+	else
+	{	// automatically save and load
 		m_pProject->Save(fProject.GetFullPath(), false);
+
 		CONFIG_Write(wxT("/DATA"), wxT("PROJECT_FILE"), fProject.GetFullPath());
-		break;
 	}
 
 	m_pProject->Clr_File_Name();
@@ -566,14 +537,16 @@ bool CWKSP_Data_Manager::On_Command_UI(wxUpdateUIEvent &event)
 //---------------------------------------------------------
 void CWKSP_Data_Manager::Parameters_Changed(void)
 {
-	SG_Grid_Cache_Set_Automatic		(m_Parameters("GRID_MEM_CACHE_AUTO")	->asBool());
-	SG_Grid_Cache_Set_Threshold_MB	(m_Parameters("GRID_MEM_CACHE_THRSHLD")	->asDouble());
-	SG_Grid_Cache_Set_Confirm		(m_Parameters("GRID_MEM_CACHE_CONFIRM")	->asInt());
-	SG_Grid_Cache_Set_Directory		(m_Parameters("GRID_MEM_CACHE_TMPDIR")	->asString());
+	SG_Grid_Cache_Set_Directory   (m_Parameters("GRID_CACHE_TMPDIR" )->asString());
+	SG_Grid_Cache_Set_Automatic   (m_Parameters("GRID_CACHE_AUTO"   )->asBool  ());
+	SG_Grid_Cache_Set_Threshold_MB(m_Parameters("GRID_CACHE_THRSHLD")->asDouble());
+	SG_Grid_Cache_Set_Confirm     (m_Parameters("GRID_CACHE_CONFIRM")->asInt   ());
+
+	SG_Set_History_Depth(m_Parameters("HISTORY_DEPTH")->asInt());
 
 	m_Numbering	= m_Parameters("NUMBERING")->asInt();
 
-	SG_Set_History_Depth(m_Parameters("HISTORY_DEPTH")->asInt());
+	g_pData_Buttons->Update_Buttons();
 
 	CWKSP_Base_Manager::Parameters_Changed();
 }
@@ -707,15 +680,241 @@ bool CWKSP_Data_Manager::Open_CMD(int Cmd_ID)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Data_Manager::Save_Modified(CWKSP_Base_Item *pItem)
+bool CWKSP_Data_Manager::Save_Modified(CWKSP_Base_Item *pItem, bool bSelections)
 {
-	return( m_pProject->Save_Modified(pItem) );
+	CSG_Parameters	Parameters(this, _TL("Save Modified Data"), _TL(""));
+
+	Parameters.Add_Value(NULL, "SAVE_ALL", _TL("Save all"), _TL(""), PARAMETER_TYPE_Bool, false);
+
+	wxFileName	Directory(m_pProject->Get_File_Name());
+
+	if( !Directory.DirExists() )
+	{
+		Directory.AssignDir(wxFileName::GetTempDir() + wxFileName::GetPathSeparator() + "saga");
+
+		Directory.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL);
+	}
+
+	_Modified_Get(&Parameters, pItem ? pItem : this, Directory.GetPath(), bSelections);
+
+	if( Parameters.Get_Count() > 1 )
+	{
+		Parameters.Set_Callback_On_Parameter_Changed(&_Modified_Changed);
+
+		if( !DLG_Parameters(&Parameters) )
+		{
+			return( false );
+		}
+
+		_Modified_Save(&Parameters);
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int CWKSP_Data_Manager::_Modified_Changed(CSG_Parameter *pParameter, int Flags)
+{
+	if( !pParameter || !pParameter->Get_Owner() || !pParameter->Get_Owner()->Get_Owner() )
+	{
+		return( 0 );
+	}
+
+	CSG_Parameters	*pParameters	= pParameter->Get_Owner();
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SAVE_ALL")) )
+	{
+		for(int i=0; i<pParameters->Get_Count(); i++)
+		{
+			CSG_Parameter	*pFile	= pParameters->Get_Parameter(i);
+
+			if( pFile->Get_Type() == PARAMETER_TYPE_Bool )
+			{
+				pFile->Set_Value(pParameter->asBool());
+
+				for(int j=0; j<pFile->Get_Children_Count(); j++)
+				{
+					pFile->Get_Child(j)->Set_Enabled(pParameter->asBool());
+				}
+			}
+		}
+	}
+
+	else if( pParameter->Get_Type() == PARAMETER_TYPE_Bool )
+	{
+		if( !pParameter->asBool() && pParameters->Get_Parameter("SAVE_ALL") )
+		{
+			pParameters->Get_Parameter("SAVE_ALL")->Set_Value(0);
+		}
+
+		for(int j=0; j<pParameter->Get_Children_Count(); j++)
+		{
+			pParameter->Get_Child(j)->Set_Enabled(pParameter->asBool());
+		}
+	}
+
+	return( 0 );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Data_Manager::_Modified_Get(CSG_Parameters *pParameters, CWKSP_Base_Item *pItem, const wxString &Directory, bool bSelections)
+{
+	int		i;
+
+	if( pItem && pParameters )
+	{
+		switch( pItem->Get_Type() )
+		{
+		default:
+			break;
+
+		//-------------------------------------------------
+		case WKSP_ITEM_Data_Manager:
+		case WKSP_ITEM_Table_Manager:
+		case WKSP_ITEM_Shapes_Manager:
+		case WKSP_ITEM_Shapes_Type:
+		case WKSP_ITEM_TIN_Manager:
+		case WKSP_ITEM_PointCloud_Manager:
+		case WKSP_ITEM_Grid_Manager:
+		case WKSP_ITEM_Grid_System:
+			for(i=0; i<((CWKSP_Base_Manager *)pItem)->Get_Count(); i++)
+			{
+				_Modified_Get(pParameters, ((CWKSP_Base_Manager *)pItem)->Get_Item(i), Directory, bSelections && !pItem->is_Selected());
+			}
+			break;
+
+		//-------------------------------------------------
+		case WKSP_ITEM_Table:
+			if( !bSelections || pItem->is_Selected() )
+			{
+				_Modified_Get(pParameters, pItem, Directory, ((CWKSP_Table *)pItem)->Get_Table() );
+			}
+			break;
+
+		case WKSP_ITEM_Shapes:
+		case WKSP_ITEM_TIN:
+		case WKSP_ITEM_PointCloud:
+		case WKSP_ITEM_Grid:
+			if( !bSelections || pItem->is_Selected() )
+			{
+				_Modified_Get(pParameters, pItem, Directory, ((CWKSP_Layer *)pItem)->Get_Object());
+			}
+			break;
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Data_Manager::_Modified_Get(CSG_Parameters *pParameters, CWKSP_Base_Item *pItem, const wxString &Directory, CSG_Data_Object *pObject)
+{
+	if( !pObject->is_Modified() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	wxString	Filter, Extension;
+
+	switch( pItem->Get_Type() )
+	{
+	default:	return( false );
+	case WKSP_ITEM_Table:		Extension	= "txt" ;	Filter	= DLG_Get_FILE_Filter(ID_DLG_TABLES_SAVE    );	break;
+	case WKSP_ITEM_Shapes:		Extension	= "shp" ;	Filter	= DLG_Get_FILE_Filter(ID_DLG_SHAPES_SAVE    );	break;
+	case WKSP_ITEM_TIN:			Extension	= "shp" ;	Filter	= DLG_Get_FILE_Filter(ID_DLG_TIN_SAVE       );	break;
+	case WKSP_ITEM_PointCloud:	Extension	= "spc" ;	Filter	= DLG_Get_FILE_Filter(ID_DLG_POINTCLOUD_SAVE);	break;
+	case WKSP_ITEM_Grid:		Extension	= "sgrd";	Filter	= DLG_Get_FILE_Filter(ID_DLG_GRIDS_SAVE     );	break;
+	}
+
+	//-----------------------------------------------------
+	wxFileName	Path(pObject->Get_File_Name());
+
+	if( !Path.FileExists() )
+	{
+		wxString	Name(pObject->Get_Name());
+
+		Name.Replace(".", "-");
+		Name.Replace(":", "-");
+
+		Path.SetPath(Directory);
+		Path.SetExt (Extension);
+
+		for(int i=0, bOkay=false; !bOkay; i++)
+		{
+			if( i == 0 )
+			{
+				Path.SetName(Name);
+			}
+			else
+			{
+				Path.SetName(Name + wxString::Format("_%d", i));
+			}
+
+			bOkay	= !Path.FileExists();
+
+			for(int j=0; bOkay && j<pParameters->Get_Count(); j++)
+			{
+				CSG_Parameter	*p	= pParameters->Get_Parameter(j);
+
+				if( p->Get_Type() == PARAMETER_TYPE_FilePath && Path == p->asString() )
+				{
+					bOkay	= false;
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode;
+
+	if( (pNode = pParameters->Get_Parameter(CSG_String::Format(SG_T("%d"), (long)pItem->Get_Manager()))) == NULL )
+	{
+		pNode	= pParameters->Add_Node(NULL, CSG_String::Format(SG_T("%d"), (long)pItem->Get_Manager()), pItem->Get_Manager()->Get_Name().wx_str(), SG_T(""));
+	}			
+
+	pNode	= pParameters->Add_Value(
+		pNode, CSG_String::Format(SG_T("%d")     , (long)pObject),
+		pItem->Get_Name().wx_str(), SG_T(""), PARAMETER_TYPE_Bool, false
+	);
+
+	pParameters->Add_FilePath(
+		pNode, CSG_String::Format(SG_T("%d FILE"), (long)pObject),
+		_TL("File"), SG_T(""), Filter, Path.GetFullPath(), true
+	);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Data_Manager::_Modified_Save(CSG_Parameters *pParameters)
+{
+	for(int i=0; i<pParameters->Get_Count(); i++)
+	{
+		long long		Pointer;
+		CSG_Data_Object	*pObject;
+		CSG_Parameter	*pParameter	= pParameters->Get_Parameter(i);
+
+		if(	pParameter->Get_Type() == PARAMETER_TYPE_Bool && pParameter->asBool()
+		&&  SG_SSCANF(pParameter->Get_Identifier(), SG_T("%lld"), (&Pointer)) == 1
+		&&  SG_Get_Data_Manager().Exists(pObject = (CSG_Data_Object *)Pointer) )
+		{
+			pParameter	= pParameters->Get_Parameter(CSG_String::Format(SG_T("%d FILE"), (long)pObject));
+
+			if(	pParameter && pParameter->asString() && pParameter->asString()[0] )
+			{
+				pObject->Save(pParameter->asString());
+			}
+		}
+	}
+
+	return( true );
 }
 
 //---------------------------------------------------------
 bool CWKSP_Data_Manager::Save_Modified_Sel(void)
 {
-	return( m_pProject->Save_Modified(this, true) );
+	return( Save_Modified(this, true) );
 }
 
 //---------------------------------------------------------
@@ -727,7 +926,8 @@ bool CWKSP_Data_Manager::Close(bool bSilent)
 
 		return( true );
 	}
-	else if( (bSilent || DLG_Message_Confirm(_TL("Close all data sets"), _TL("Close"))) && Save_Modified(this) )
+
+	if( (bSilent || DLG_Message_Confirm(_TL("Close all data sets"), _TL("Close"))) && Save_Modified(this) )
 	{
 		Finalise();
 
@@ -787,7 +987,7 @@ CWKSP_Data_Item * CWKSP_Data_Manager::Get(CSG_Data_Object *pObject)
 //---------------------------------------------------------
 CWKSP_Data_Item * CWKSP_Data_Manager::Add(CSG_Data_Object *pObject)
 {
-	if( pObject && pObject != DATAOBJECT_CREATE && Get_Manager(pObject->Get_ObjectType(), true) )
+	if( SG_Get_Data_Manager().Add(pObject) && Get_Manager(pObject->Get_ObjectType(), true) )
 	{
 		switch( pObject->Get_ObjectType() )
 		{
diff --git a/src/saga_core/saga_gui/wksp_data_manager.h b/src/saga_core/saga_gui/wksp_data_manager.h
index 123bafd..a35b053 100644
--- a/src/saga_core/saga_gui/wksp_data_manager.h
+++ b/src/saga_core/saga_gui/wksp_data_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_manager.h 1955 2014-01-23 13:49:11Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -109,8 +109,6 @@ public:
 	CWKSP_Base_Manager *			Get_Manager			(int i)		{	return( (CWKSP_Base_Manager *)Get_Item(i) );	}
 	void							Del_Manager			(CWKSP_Base_Item *pItem);
 
-	class CWKSP_Project *			Get_Project			(void)		{	return( m_pProject     );	}
-
 	class CWKSP_Table_Manager *		Get_Tables			(void)		{	return( m_pTables      );	}
 	class CWKSP_Shapes_Manager *	Get_Shapes			(void)		{	return( m_pShapes      );	}
 	class CWKSP_TIN_Manager *		Get_TINs			(void)		{	return( m_pTINs        );	}
@@ -126,7 +124,7 @@ public:
 	bool							Open				(int DataType);
 	bool							Open_CMD			(int Cmd_ID);
 
-	bool							Save_Modified		(class CWKSP_Base_Item *pItem);
+	bool							Save_Modified		(class CWKSP_Base_Item *pItem = NULL, bool bSelections = false);
 	bool							Save_Modified_Sel	(void);
 	bool							Close				(bool bSilent);
 
@@ -163,6 +161,11 @@ private:
 
 	class CWKSP_Grid_Manager		*m_pGrids;
 
+	static int						_Modified_Changed	(class CSG_Parameter  *pParameter, int Flags);
+	bool							_Modified_Get		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem, const wxString &Directory, bool bSelections);
+	bool							_Modified_Get		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem, const wxString &Directory, class CSG_Data_Object *pObject);
+	bool							_Modified_Save		(class CSG_Parameters *pParameters);
+
 
 };
 
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 2d43901..3cc82cf 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_menu_file.cpp 1955 2014-01-23 13:49:11Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -67,8 +67,6 @@
 
 #include "res_commands.h"
 
-#include "project.h"
-
 #include "wksp_data_manager.h"
 #include "wksp_data_menu_file.h"
 
@@ -220,10 +218,10 @@ void CWKSP_Data_Menu_File::Update(wxMenu *pMenu)
 			return;
 
 		case DATAOBJECT_TYPE_Undefined:
-			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_NEW);
+//			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_NEW);
 			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_OPEN);
 //			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_OPEN_ADD);
-			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_SAVE);
+//			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_SAVE);
 			CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECT_SAVE_AS);
 			break;
 
@@ -340,7 +338,7 @@ bool CWKSP_Data_Menu_File::Open(int Cmd_ID)
 		switch( m_DataType )
 		{
 		case DATAOBJECT_TYPE_Undefined:
-			bSuccess	= g_pData->Get_Project()->Load(File, false, true);
+			bSuccess	= g_pData->Open(File);
 			break;
 
 		case DATAOBJECT_TYPE_Table:
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 1dfcb58..94827eb 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_menu_files.cpp 2029 2014-02-27 16:00:28Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -61,7 +61,6 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <wx/string.h>
 #include <wx/menu.h>
 
 #include <saga_api/saga_api.h>
@@ -71,6 +70,8 @@
 #include "wksp_data_menu_files.h"
 #include "wksp_data_menu_file.h"
 
+#include "saga_frame.h"
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -82,18 +83,21 @@
 CWKSP_Data_Menu_Files::CWKSP_Data_Menu_Files(void)
 {
 	m_bUpdate	= true;
-
 	m_pMenu		= new wxMenu;
 
-	//-----------------------------------------------------
-	m_pMenu->Append(ID_CMD_DATA_FIRST      , _TL("Project")    , m_Projects   .Create(DATAOBJECT_TYPE_Undefined));
+	CMD_Menu_Add_Item(m_pMenu, false, ID_CMD_WKSP_OPEN);
+	CMD_Menu_Add_Item(m_pMenu, false, ID_CMD_WKSP_SAVE);
+	CMD_Menu_Add_Item(m_pMenu, false, ID_CMD_DATA_PROJECT_NEW);
+
 	m_pMenu->AppendSeparator();
+	m_pMenu->Append(ID_CMD_DATA_FIRST      , _TL("Project")    , m_Projects   .Create(DATAOBJECT_TYPE_Undefined));
 	m_pMenu->Append(ID_CMD_TABLES_FIRST    , _TL("Table")      , m_Tables     .Create(DATAOBJECT_TYPE_Table));
 	m_pMenu->Append(ID_CMD_SHAPES_FIRST    , _TL("Shapes")     , m_Shapes     .Create(DATAOBJECT_TYPE_Shapes));
-	m_pMenu->Append(ID_CMD_TIN_FIRST       , _TL("TIN")        , m_TINs       .Create(DATAOBJECT_TYPE_TIN));
 	m_pMenu->Append(ID_CMD_POINTCLOUD_FIRST, _TL("Point Cloud"), m_PointClouds.Create(DATAOBJECT_TYPE_PointCloud));
+	m_pMenu->Append(ID_CMD_TIN_FIRST       , _TL("TIN")        , m_TINs       .Create(DATAOBJECT_TYPE_TIN));
 	m_pMenu->Append(ID_CMD_GRIDS_FIRST     , _TL("Grid")       , m_Grids      .Create(DATAOBJECT_TYPE_Grid));
 	m_pMenu->AppendSeparator();
+
 	CMD_Menu_Add_Item(m_pMenu, false, ID_CMD_FRAME_QUIT);
 }
 
@@ -168,12 +172,14 @@ inline CWKSP_Data_Menu_File * CWKSP_Data_Menu_Files::_Get_Menu(int DataType)
 //---------------------------------------------------------
 void CWKSP_Data_Menu_Files::_Update(void)
 {
+	g_pSAGA_Frame->Freeze();
 	m_Projects   .Update(m_pMenu->FindItem(ID_CMD_DATA_FIRST      )->GetSubMenu());
 	m_Tables     .Update(m_pMenu->FindItem(ID_CMD_TABLES_FIRST    )->GetSubMenu());
 	m_Shapes     .Update(m_pMenu->FindItem(ID_CMD_SHAPES_FIRST    )->GetSubMenu());
 	m_TINs       .Update(m_pMenu->FindItem(ID_CMD_TIN_FIRST       )->GetSubMenu());
 	m_PointClouds.Update(m_pMenu->FindItem(ID_CMD_POINTCLOUD_FIRST)->GetSubMenu());
 	m_Grids      .Update(m_pMenu->FindItem(ID_CMD_GRIDS_FIRST     )->GetSubMenu());
+	g_pSAGA_Frame->Thaw();
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_grid.cpp b/src/saga_core/saga_gui/wksp_grid.cpp
index 54b66d0..e0c4bdf 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_grid.cpp 2064 2014-03-21 13:20:57Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -84,8 +84,6 @@
 #include "wksp_grid_manager.h"
 #include "wksp_grid.h"
 
-#include "view_scatterplot.h"
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -148,7 +146,7 @@ wxString CWKSP_Grid::Get_Description(void)
 	DESC_ADD_STR (_TL("No Data Value")		, Get_Grid()->Get_NoData_Value() < Get_Grid()->Get_NoData_hiValue() ? CSG_String::Format(SG_T("%f - %f"), Get_Grid()->Get_NoData_Value(), Get_Grid()->Get_NoData_hiValue()).c_str() : SG_Get_String(Get_Grid()->Get_NoData_Value(), -2).c_str());
 	DESC_ADD_FLT (_TL("Arithmetic Mean")	, Get_Grid()->Get_ArithMean(true));
 	DESC_ADD_FLT (_TL("Standard Deviation")	, Get_Grid()->Get_StdDev(true));
-	DESC_ADD_STR (_TL("Memory Size")		, Get_nBytes_asString(Get_Grid()->Get_NCells() * Get_Grid()->Get_nValueBytes(), 2).c_str());
+	DESC_ADD_STR (_TL("Memory Size")		, Get_nBytes_asString(Get_Grid()->Get_Memory_Size(), 2).c_str());
 
 	if( Get_Grid()->is_Compressed() )
 	{
@@ -175,27 +173,25 @@ wxMenu * CWKSP_Grid::Get_Menu(void)
 {
 	wxMenu	*pMenu	= new wxMenu(m_pObject->Get_Name());
 
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_WKSP_ITEM_CLOSE);
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_GRIDS_SAVE);
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_GRIDS_SAVEAS);
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_GRIDS_SAVEAS_IMAGE);
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_GRIDS_SHOW);
-
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_GRIDS_SHOW);
 	pMenu->AppendSeparator();
-
-	CMD_Menu_Add_Item(pMenu		, true , ID_CMD_GRIDS_HISTOGRAM);
-
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_GRIDS_SCATTERPLOT);
-	CMD_Menu_Add_Item(pMenu		, false, ID_CMD_WKSP_ITEM_SETTINGS_COPY);
-
-	//-----------------------------------------------------
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_GRIDS_SAVE);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_GRIDS_SAVEAS);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_GRIDS_SAVEAS_IMAGE);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECTION);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, true , ID_CMD_GRIDS_HISTOGRAM);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_GRIDS_SCATTERPLOT);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_SETTINGS_COPY);
 
 	//-----------------------------------------------------
 	wxMenu	*pSubMenu	= new wxMenu(_TL("Classification"));
 
-	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_GRIDS_SET_LUT);
-	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_GRIDS_FIT_MINMAX);
-	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_GRIDS_FIT_STDDEV);
+	CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_GRIDS_SET_LUT);
+	CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_GRIDS_FIT_MINMAX);
+	CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_GRIDS_FIT_STDDEV);
 
 	pMenu->Append(ID_CMD_WKSP_FIRST, _TL("Classification"), pSubMenu);
 
@@ -226,7 +222,7 @@ bool CWKSP_Grid::On_Command(int Cmd_ID)
 		break;
 
 	case ID_CMD_GRIDS_SCATTERPLOT:
-		Add_ScatterPlot(Get_Grid());
+		Add_ScatterPlot();
 		break;
 
 	case ID_CMD_GRIDS_FIT_MINMAX:
@@ -238,7 +234,7 @@ bool CWKSP_Grid::On_Command(int Cmd_ID)
 
 	case ID_CMD_GRIDS_FIT_STDDEV:
 		{
-			double	d	= g_pData->Get_Parameter("FIT_STDDEV")->asDouble();
+			double	d	= g_pData->Get_Parameter("GRID_COLORS_FIT_STDDEV")->asDouble();
 
 			Set_Color_Range(
 				Get_Grid()->Get_ArithMean(true) - d * Get_Grid()->Get_StdDev(true),
@@ -654,7 +650,7 @@ void CWKSP_Grid::_LUT_Create(void)
 		{
 			double		Value;
 
-			for(long iCell=0, jCell; iCell<Get_Grid()->Get_NCells() && PROGRESSBAR_Set_Position(iCell, Get_Grid()->Get_NCells()); iCell++)
+			for(sLong iCell=0, jCell; iCell<Get_Grid()->Get_NCells() && PROGRESSBAR_Set_Position(iCell, Get_Grid()->Get_NCells()); iCell++)
 			{
 				if( Get_Grid()->Get_Sorted(iCell, jCell, false) && (pLUT->Get_Record_Count() == 0 || Value != Get_Grid()->asDouble(jCell)) )
 				{
@@ -714,7 +710,7 @@ void CWKSP_Grid::_LUT_Create(void)
 				pColors->Set_Count(Get_Grid()->Get_NCells());
 			}
 
-			long	jCell, nCells;
+			sLong	jCell, nCells;
 			double	Minimum, Maximum, iCell, Count;
 
 			Maximum	= Get_Grid()->Get_ZMin();
@@ -723,7 +719,7 @@ void CWKSP_Grid::_LUT_Create(void)
 
 			for(iCell=0.0; iCell<Get_Grid()->Get_NCells(); iCell++)
 			{
-				if( Get_Grid()->Get_Sorted((long)iCell, jCell, false) )
+				if( Get_Grid()->Get_Sorted(iCell, jCell, false) )
 				{
 					break;
 				}
@@ -733,7 +729,7 @@ void CWKSP_Grid::_LUT_Create(void)
 
 			for(int iClass=0; iClass<pColors->Get_Count(); iClass++, iCell+=Count)
 			{
-				Get_Grid()->Get_Sorted((long)iCell, jCell, false);
+				Get_Grid()->Get_Sorted(iCell, jCell, false);
 
 				Minimum	= Maximum;
 				Maximum	= iCell < Get_Grid()->Get_NCells() ? Get_Grid()->asDouble(jCell) : Get_Grid()->Get_ZMax() + 1.0;
@@ -828,7 +824,7 @@ double CWKSP_Grid::Get_Value_Range(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-wxMenu * CWKSP_Grid::On_Edit_Get_Menu(void)
+wxMenu * CWKSP_Grid::Edit_Get_Menu(void)
 {
 	if( m_Edit_Attributes.Get_Count() < 1 )
 	{
@@ -844,7 +840,23 @@ wxMenu * CWKSP_Grid::On_Edit_Get_Menu(void)
 }
 
 //---------------------------------------------------------
-bool CWKSP_Grid::On_Edit_On_Key_Down(int KeyCode)
+TSG_Rect CWKSP_Grid::Edit_Get_Extent(void)
+{
+	if( m_Edit_Attributes.Get_Count() > 0 )
+	{
+		return( CSG_Rect(
+			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_xGrid_to_World(m_xSel),
+			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_yGrid_to_World(m_ySel),
+			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_xGrid_to_World(m_xSel + m_Edit_Attributes.Get_Field_Count()),
+			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_yGrid_to_World(m_ySel + m_Edit_Attributes.Get_Count()))
+		);
+	}
+
+	return( Get_Grid()->Get_Extent().m_rect );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Grid::Edit_On_Key_Down(int KeyCode)
 {
 	switch( KeyCode )
 	{
@@ -857,7 +869,7 @@ bool CWKSP_Grid::On_Edit_On_Key_Down(int KeyCode)
 }
 
 //---------------------------------------------------------
-bool CWKSP_Grid::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
+bool CWKSP_Grid::Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
 {
 	if( Key & MODULE_INTERACTIVE_KEY_LEFT )
 	{
@@ -877,7 +889,7 @@ bool CWKSP_Grid::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int
 
 		if( nx > 0 && ny > 0 )
 		{
-			int	x, y, Maximum = g_pData->Get_Parameter("SELECT_MAX")->asInt();
+			int	x, y, Maximum = g_pData->Get_Parameter("GRID_SELECT_MAX")->asInt();
 
 			if( nx > Maximum )
 			{
@@ -925,7 +937,7 @@ bool CWKSP_Grid::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int
 }
 
 //---------------------------------------------------------
-bool CWKSP_Grid::On_Edit_Set_Attributes(void)
+bool CWKSP_Grid::Edit_Set_Attributes(void)
 {
 	if( m_Edit_Attributes.Get_Count() > 0 )
 	{
@@ -954,22 +966,6 @@ bool CWKSP_Grid::On_Edit_Set_Attributes(void)
 	return( false );
 }
 
-//---------------------------------------------------------
-TSG_Rect CWKSP_Grid::On_Edit_Get_Extent(void)
-{
-	if( m_Edit_Attributes.Get_Count() > 0 )
-	{
-		return( CSG_Rect(
-			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_xGrid_to_World(m_xSel),
-			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_yGrid_to_World(m_ySel),
-			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_xGrid_to_World(m_xSel + m_Edit_Attributes.Get_Field_Count()),
-			-Get_Grid()->Get_Cellsize() / 2.0 + Get_Grid()->Get_System().Get_yGrid_to_World(m_ySel + m_Edit_Attributes.Get_Count()))
-		);
-	}
-
-	return( Get_Grid()->Get_Extent().m_rect );
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -1031,7 +1027,7 @@ bool CWKSP_Grid::Fit_Color_Range(void)
 {
 	double		zMin, zMax;
 
-	int		Method	= g_pData->Get_Parameter("GRID_DISPLAY_RANGEFIT")->asInt();
+	int		Method	= g_pData->Get_Parameter("GRID_COLORS_FIT")->asInt();
 
 	if( Method == 0 )
 	{
@@ -1040,7 +1036,7 @@ bool CWKSP_Grid::Fit_Color_Range(void)
 	}
 	else
 	{
-		double	d	= g_pData->Get_Parameter("FIT_STDDEV")->asDouble();
+		double	d	= g_pData->Get_Parameter("GRID_COLORS_FIT_STDDEV")->asDouble();
 
 		zMin	= Get_Grid()->Get_ArithMean(true) - Get_Grid()->Get_StdDev(true) * d;
 		zMax	= Get_Grid()->Get_ArithMean(true) + Get_Grid()->Get_StdDev(true) * d;
diff --git a/src/saga_core/saga_gui/wksp_grid.h b/src/saga_core/saga_gui/wksp_grid.h
index ceb7a73..1cfb6a1 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_grid.h 2003 2014-02-19 17:08:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -108,6 +108,12 @@ public:
 
 	virtual bool				Update					(CWKSP_Layer *pChanged)	{	return( pChanged == this || pChanged == m_pOverlay[0] || pChanged == m_pOverlay[1] );	}
 
+	virtual wxMenu *			Edit_Get_Menu			(void);
+	virtual TSG_Rect			Edit_Get_Extent			(void);
+	virtual bool				Edit_On_Key_Down		(int KeyCode);
+	virtual bool				Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool				Edit_Set_Attributes		(void);
+
 
 protected:
 
@@ -119,12 +125,6 @@ protected:
 	virtual void				On_Parameters_Changed	(void);
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual wxMenu *			On_Edit_Get_Menu		(void);
-	virtual bool				On_Edit_On_Key_Down		(int KeyCode);
-	virtual bool				On_Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
-	virtual bool				On_Edit_Set_Attributes	(void);
-	virtual TSG_Rect			On_Edit_Get_Extent		(void);
-
 	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
 
 
diff --git a/src/saga_core/saga_gui/wksp_layer.cpp b/src/saga_core/saga_gui/wksp_layer.cpp
index 5deae1d..ef0b537 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_layer.cpp 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -147,13 +147,13 @@ CWKSP_Layer::CWKSP_Layer(CSG_Data_Object *pObject)
 	m_pLegend		= new CWKSP_Layer_Legend(this);
 
 	m_pHistogram	= NULL;
+
+	m_Edit_Index	= 0;
 }
 
 //---------------------------------------------------------
 CWKSP_Layer::~CWKSP_Layer(void)
 {
-	Histogram_Show(false);
-
 	if( g_pMaps     )	{	g_pMaps->Del(this);	}
 
 	if( m_pClassify )	{	delete(m_pClassify);	}
@@ -182,6 +182,10 @@ bool CWKSP_Layer::On_Command(int Cmd_ID)
 	case ID_CMD_POINTCLOUD_SHOW:
 		g_pMaps->Add(this);
 		break;
+
+	case ID_CMD_DATA_PROJECTION:
+		_Set_Projection();
+		break;
 	}
 
 	return( true );
@@ -408,6 +412,8 @@ void CWKSP_Layer::On_Parameters_Changed(void)
 	);
 
 	//-----------------------------------------------------
+	m_pClassify->Initialise(this, m_Parameters("LUT")->asTable(), m_Parameters("METRIC_COLORS")->asColors());
+
 	m_pClassify->Set_Mode(m_Parameters("COLORS_TYPE")->asInt());
 
 	m_pClassify->Set_Unique_Color(m_Parameters("UNISYMBOL_COLOR")->asInt());
@@ -517,6 +523,36 @@ CSG_Rect CWKSP_Layer::Get_Extent(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CWKSP_Layer::_Set_Projection(void)
+{
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("pj_proj4"), 15);	// CCRS_Picker
+
+	if(	pModule && Get_Object() )
+	{
+		CSG_Parameters	P; P.Assign(pModule->Get_Parameters());
+
+		if( pModule->Get_Parameters()->Set_Parameter("CRS_PROJ4", Get_Object()->Get_Projection().Get_Proj4())
+		&&	pModule->On_Before_Execution() && DLG_Parameters(pModule->Get_Parameters())
+		&&  pModule->Execute() )
+		{
+			Get_Object()->Get_Projection().Create(pModule->Get_Parameters()->Get_Parameter("CRS_PROJ4")->asString(), SG_PROJ_FMT_Proj4);
+			Get_Object()->Set_Modified();
+
+			DataObject_Changed();
+		}
+
+		pModule->Get_Parameters()->Assign_Values(&P);
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 CSG_Colors * CWKSP_Layer::Get_Colors(void)
 {
 	return( m_pClassify->Get_Metric_Colors() );
@@ -666,17 +702,12 @@ bool CWKSP_Layer::Update(CWKSP_Layer *pChanged)
 //---------------------------------------------------------
 void CWKSP_Layer::On_Update_Views(bool bAll)
 {
+	_Set_Thumbnail(true);
+
 	g_pMaps->Update(this, !bAll);
 
 	if( bAll )
 	{
-		_Set_Thumbnail(true);
-
-		if( Histogram_Get() )
-		{
-			Histogram_Get()->Update_Histogram();
-		}
-
 		On_Update_Views();
 	}
 }
@@ -684,12 +715,12 @@ void CWKSP_Layer::On_Update_Views(bool bAll)
 //---------------------------------------------------------
 bool CWKSP_Layer::View_Closes(wxMDIChildFrame *pView)
 {
-	if( wxDynamicCast(pView, CVIEW_Histogram) != NULL )
+	if( pView == m_pHistogram )
 	{
 		m_pHistogram	= NULL;
 	}
 
-	return( true );
+	return( CWKSP_Data_Item::View_Closes(pView) );
 }
 
 
@@ -726,48 +757,55 @@ void CWKSP_Layer::Histogram_Toggle(void)
 //														 //
 ///////////////////////////////////////////////////////////
 
+
 //---------------------------------------------------------
 wxMenu * CWKSP_Layer::Edit_Get_Menu(void)
 {
-	return( On_Edit_Get_Menu() );
+	return( NULL );
 }
 
 //---------------------------------------------------------
-TSG_Rect CWKSP_Layer::Edit_Get_Extent(void)
+bool CWKSP_Layer::Edit_On_Key_Down(int KeyCode)
 {
-	return( On_Edit_Get_Extent() );
+	return( false );
 }
 
 //---------------------------------------------------------
-bool CWKSP_Layer::Edit_Set_Attributes(void)
+bool CWKSP_Layer::Edit_On_Mouse_Down(CSG_Point Point, double ClientToWorld, int Key)
 {
-	return( On_Edit_Set_Attributes() );
+	m_Edit_Mouse_Down	= Point;
+
+	return( true );
 }
 
 //---------------------------------------------------------
-bool CWKSP_Layer::Edit_On_Key_Down(int KeyCode)
+bool CWKSP_Layer::Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
 {
-	return( On_Edit_On_Key_Down(KeyCode) );
+	return( false );
 }
 
 //---------------------------------------------------------
-bool CWKSP_Layer::Edit_On_Mouse_Down(CSG_Point Point, double ClientToWorld, int Key)
+bool CWKSP_Layer::Edit_On_Mouse_Move(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key)
 {
-	m_Edit_Mouse_Down	= Point;
+	return( false );
+}
 
-	return( On_Edit_On_Mouse_Down(Point, ClientToWorld, Key) );
+//---------------------------------------------------------
+bool CWKSP_Layer::Edit_Set_Index(int Index)
+{
+	return( true );
 }
 
 //---------------------------------------------------------
-bool CWKSP_Layer::Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
+int CWKSP_Layer::Edit_Get_Index(void)
 {
-	return( On_Edit_On_Mouse_Up(Point, ClientToWorld, Key) );
+	return( m_Edit_Index );
 }
 
 //---------------------------------------------------------
-bool CWKSP_Layer::Edit_On_Mouse_Move(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key)
+CSG_Table * CWKSP_Layer::Edit_Get_Attributes(void)
 {
-	return( On_Edit_On_Mouse_Move(pMap, rWorld, pt, ptLast, Key) );
+	return( &m_Edit_Attributes );
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_layer.h b/src/saga_core/saga_gui/wksp_layer.h
index 359c9ab..14ef9b1 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_layer.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -121,22 +121,25 @@ public:
 
 	const wxBitmap &				Get_Thumbnail			(int dx, int dy);
 
-	class CVIEW_Histogram *			Histogram_Get			(void)	{	return( m_pHistogram );	}
 	void							Histogram_Show			(bool bShow);
 	void							Histogram_Toggle		(void);
 
-	wxMenu *						Edit_Get_Menu			(void);
-	TSG_Rect						Edit_Get_Extent			(void);
-	CSG_Table *						Edit_Get_Attributes		(void)	{	return( &m_Edit_Attributes );	}
-	bool							Edit_Set_Attributes		(void);
-	bool							Edit_On_Key_Down		(int KeyCode);
-	bool							Edit_On_Mouse_Down		(CSG_Point Point, double WorldToClient, int Key);
-	bool							Edit_On_Mouse_Up		(CSG_Point Point, double WorldToClient, int Key);
-	bool							Edit_On_Mouse_Move		(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key);
+	virtual wxMenu *				Edit_Get_Menu			(void);
+	virtual TSG_Rect				Edit_Get_Extent			(void)	= 0;
+	virtual bool					Edit_On_Key_Down		(int KeyCode);
+	virtual bool					Edit_On_Mouse_Down		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool					Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool					Edit_On_Mouse_Move		(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key);
+	virtual bool					Edit_Set_Index			(int Index);
+	virtual bool					Edit_Set_Attributes		(void)	= 0;
+	int								Edit_Get_Index			(void);
+	CSG_Table *						Edit_Get_Attributes		(void);
 
 
 protected:
 
+	int								m_Edit_Index;
+
 	CSG_Parameter_Range				*m_pZRange;
 
 	CSG_Point						m_Edit_Mouse_Down;
@@ -162,19 +165,13 @@ protected:
 
 	virtual void					On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit)	= 0;
 
-	virtual wxMenu *				On_Edit_Get_Menu		(void)			{	return( NULL );	}
-	virtual TSG_Rect				On_Edit_Get_Extent		(void)	= 0;
-	virtual bool					On_Edit_Set_Attributes	(void)	= 0;
-	virtual bool					On_Edit_On_Key_Down		(int KeyCode)	{	return( false );	}
-	virtual bool					On_Edit_On_Mouse_Down	(CSG_Point Point, double ClientToWorld, int Key)	{	return( false );	}
-	virtual bool					On_Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key)	{	return( false );	}
-	virtual bool					On_Edit_On_Mouse_Move	(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key)	{	return( false );	}
-
 
 private:
 
 	bool							_Set_Thumbnail			(bool bRefresh);
 
+	void							_Set_Projection			(void);
+
 };
 
 
diff --git a/src/saga_core/saga_gui/wksp_layer_classify.cpp b/src/saga_core/saga_gui/wksp_layer_classify.cpp
index 75372f7..ad0899d 100644
--- a/src/saga_core/saga_gui/wksp_layer_classify.cpp
+++ b/src/saga_core/saga_gui/wksp_layer_classify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer_classify.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_layer_classify.cpp 2079 2014-04-02 16:37:16Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -117,7 +117,6 @@ bool CWKSP_Layer_Classify::Initialise(CWKSP_Layer *pLayer, CSG_Table *pLUT, CSG_
 	m_pLayer	= pLayer;
 	m_pLUT		= pLUT;
 	m_pColors	= pColors;
-	m_pColors	->Set_Count(11);
 
 	//-----------------------------------------------------
 	if( m_pLUT && m_pLUT->Get_Record_Count() == 0 )
@@ -139,6 +138,11 @@ bool CWKSP_Layer_Classify::Initialise(CWKSP_Layer *pLayer, CSG_Table *pLUT, CSG_
 		pRecord->Set_Value(LUT_MAX			, 2.0);
 	}
 
+	if( m_pLUT )
+	{
+		m_pLUT->Set_Index(LUT_MIN, TABLE_INDEX_Ascending);
+	}
+
 	return( true );
 }
 
diff --git a/src/saga_core/saga_gui/wksp_map.cpp b/src/saga_core/saga_gui/wksp_map.cpp
index 127e52f..11b1f94 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map.cpp 2096 2014-04-11 12:49:32Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -80,6 +80,7 @@
 #include "wksp_map_manager.h"
 #include "wksp_map.h"
 #include "wksp_map_layer.h"
+#include "wksp_map_graticule.h"
 #include "wksp_map_buttons.h"
 
 #include "wksp_layer_legend.h"
@@ -198,8 +199,6 @@ CWKSP_Map::CWKSP_Map(void)
 	m_pLayout		= NULL;
 	m_pLayout_Info	= new CVIEW_Layout_Info(this);
 
-	m_bScaleBar		= g_pMaps->Get_Parameter("SCALE_BAR")->asBool();
-	m_bSynchronise	= false;
 	m_Img_bSave		= false;
 
 	On_Create_Parameters();
@@ -208,9 +207,9 @@ CWKSP_Map::CWKSP_Map(void)
 //---------------------------------------------------------
 CWKSP_Map::~CWKSP_Map(void)
 {
-	View_Show			(false);
-	View_3D_Show		(false);
-	View_Layout_Show	(false);
+	if( m_pView    )	m_pView   ->Do_Destroy();
+	if( m_pView_3D )	m_pView_3D->Do_Destroy();
+	if( m_pLayout  )	m_pLayout ->Do_Destroy();
 
 	delete(m_pLayout_Info);
 }
@@ -233,19 +232,17 @@ wxString CWKSP_Map::Get_Description(void)
 {
 	wxString	s;
 
-	s.Append(wxString::Format(wxT("<b>%s</b><table border=\"0\">"),
-		_TL("Map")
-	));
+	s	+= wxString::Format("<b>%s</b>", _TL("Map"));
 
-	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>%s</td></tr>"),
-		_TL("Name")					, m_Name.c_str()
-	));
+	s	+= "<table border=\"0\">";
 
-	s.Append(wxString::Format(wxT("<tr><td>%s</td><td>%d</td></tr>"),
-		_TL("Layers")					, Get_Count()
-	));
+	s	+= wxString::Format("<tr><td>%s</td><td>%s</td></tr>", _TL("Name")  , m_Name.c_str());
 
-	s.Append(wxT("</table>"));
+	s	+= wxString::Format("<tr><td>%s</td><td>%d</td></tr>", _TL("Layers"), Get_Count());
+
+	s	+= wxString::Format("<tr><td>%s</td><td>%s</td></tr>", _TL("Coordinate System"), m_Projection.Get_Description().c_str());
+
+	s	+= "</table>";
 
 	return( s );
 }
@@ -259,14 +256,18 @@ wxMenu * CWKSP_Map::Get_Menu(void)
 
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
 	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_SHOW);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_3D_SHOW);
+	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_LAYOUT_SHOW);
+	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_SCALEBAR);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_GRATICULE_ADD);
+	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_SYNCHRONIZE);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_PROJECTION);
+	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_SAVE_IMAGE);
 	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_SAVE_IMAGE_ON_CHANGE);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_SAVE_TO_CLIPBOARD);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_SAVE_TO_CLIPBOARD_LEGEND);
-	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_3D_SHOW);
-	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_LAYOUT_SHOW);
-	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAP_SYNCHRONIZE);
-	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAP_SCALEBAR);
 
 	return( pMenu );
 }
@@ -306,12 +307,20 @@ bool CWKSP_Map::On_Command(int Cmd_ID)
 		SaveAs_Image_Clipboard(true);
 		break;
 
-	case ID_CMD_MAP_SCALEBAR:
-		Set_ScaleBar(!m_bScaleBar);
+	case ID_CMD_MAPS_SCALEBAR:
+		Set_ScaleBar(!m_Parameters("SCALE_SHOW")->asBool());
+		break;
+
+	case ID_CMD_MAPS_SYNCHRONIZE:
+		Set_Synchronising(!m_Parameters("SYNC_MAPS")->asBool());
+		break;
+
+	case ID_CMD_MAPS_GRATICULE_ADD:
+		Add_Graticule();
 		break;
 
-	case ID_CMD_MAP_SYNCHRONIZE:
-		Set_Synchronising(!m_bSynchronise);
+	case ID_CMD_MAPS_PROJECTION:
+		Set_Projection();
 		break;
 
 	case ID_CMD_MAPS_SHOW:
@@ -354,9 +363,13 @@ bool CWKSP_Map::On_Command_UI(wxUpdateUIEvent &event)
 		event.Check(is_Image_Save_Mode());
 		break;
 
-	case ID_CMD_MAP_SCALEBAR:
+	case ID_CMD_MAPS_SCALEBAR:
 		event.Check(is_ScaleBar());
 		break;
+
+	case ID_CMD_MAPS_GRATICULE_ADD:
+		event.Enable(Get_Count() > 0 && m_Projection.is_Okay());
+		break;
 	}
 
 	return( true );
@@ -392,32 +405,110 @@ void CWKSP_Map::On_Create_Parameters(void)
 		PARAMETER_TYPE_Bool, g_pMaps->Get_Parameter("GOTO_NEWLAYER")->asBool()
 	);
 
-	//-----------------------------------------------------
-	pNode_0	= m_Parameters.Add_Node(
-		NULL	, "NODE_FRAME"		, _TL("Frame"),
-		_TL("")
+	m_Parameters.Add_Value(
+		pNode_0	, "SYNC_MAPS"		, _TL("Synchronize Map Extents"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
 	);
 
-	m_Parameters.Add_Value(
-		pNode_0	, "FRAME_SHOW"		, _TL("Show"),
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode_0	, "FRAME_SHOW"		, _TL("Frame"),
 		_TL(""),
 		PARAMETER_TYPE_Bool, g_pMaps->Get_Parameter("FRAME_SHOW")->asBool()
 	);
 
 	m_Parameters.Add_Value(
-		pNode_0	, "FRAME_WIDTH"		, _TL("Width"),
+		pNode_1	, "FRAME_WIDTH"		, _TL("Size"),
 		_TL(""),
 		PARAMETER_TYPE_Int, g_pMaps->Get_Parameter("FRAME_WIDTH")->asInt(), 5, true
 	);
 
 	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode_0	, "NORTH_SHOW"		, _TL("North Arrow"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "NORTH_ANGLE"		, _TL("Direction"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, -180.0, true, 360.0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "NORTH_SIZE"		, _TL("Size"),
+		_TL("Size given as percentage of map size"),
+		PARAMETER_TYPE_Double, 5, 1, true, 100, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "NORTH_OFFSET_X"	, _TL("Horizontal Offset"),
+		_TL("Offset given as percentage of map size"),
+		PARAMETER_TYPE_Double, 5, 0, true, 100, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "NORTH_OFFSET_Y"	, _TL("Vertical Offset"),
+		_TL("Offset given as percentage of map size"),
+		PARAMETER_TYPE_Double, 90, 0, true, 100, true
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode_0	, "SCALE_SHOW"		, _TL("Scale Bar"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, g_pMaps->Get_Parameter("SCALE_BAR")->asBool()
+	);
+
+	m_Parameters.Add_Choice(
+		pNode_1	, "SCALE_STYLE"		, _TL("Style"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("scale line"),
+			_TL("alternating scale bar")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SCALE_UNIT"		, _TL("Unit"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SCALE_WIDTH"		, _TL("Width"),
+		_TL("Width given as percentage of map size"),
+		PARAMETER_TYPE_Double, 40, 1, true, 100, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SCALE_HEIGHT"	, _TL("Height"),
+		_TL("Height given as percentage of map size"),
+		PARAMETER_TYPE_Double, 4, 0.1, true, 100, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SCALE_OFFSET_X"	, _TL("Horizontal Offset"),
+		_TL("Offset given as percentage of map size"),
+		PARAMETER_TYPE_Double, 5, 0, true, 100, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "SCALE_OFFSET_Y"	, _TL("Vertical Offset"),
+		_TL("Offset given as percentage of map size"),
+		PARAMETER_TYPE_Double, 7.5, 0, true, 100, true
+	);
+
+	//-----------------------------------------------------
 	pNode_0	= m_Parameters.Add_Node(
-		NULL	, "NODE_PRINT"		, _TL("Print Layout"),
+		NULL	, "NODE_PRINT"			, _TL("Print Layout"),
 		_TL("")
 	);
 
 	m_Parameters.Add_Choice(
-		pNode_0	, "PRINT_LEGEND"	, _TL("Show Legend"),
+		pNode_0	, "PRINT_LEGEND"		, _TL("Show Legend"),
 		_TL(""),
 		CSG_String::Format(SG_T("%s|%s|"),
 			_TL("no"),
@@ -426,6 +517,12 @@ void CWKSP_Map::On_Create_Parameters(void)
 	);
 
 	m_Parameters.Add_Value(
+		pNode_0	, "PRINT_SCALE_SHOW"	, _TL("Show Scale"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Value(
 		pNode_0	, "PRINT_RESOLUTION"	, _TL("Display Resolution"),
 		_TL(""),
 		PARAMETER_TYPE_Int, 2, 1, true
@@ -448,12 +545,6 @@ void CWKSP_Map::On_Create_Parameters(void)
 		PARAMETER_TYPE_Int, 7, 5, true
 	);
 
-	m_Parameters.Add_Value(
-		pNode_0	, "PRINT_SCALE_SHOW"	, _TL("Show Scale"),
-		_TL(""),
-		PARAMETER_TYPE_Bool, true
-	);
-
 	//-----------------------------------------------------
 	m_Img_Parms.Set_Name(_TL("Save Map as Image..."));
 
@@ -531,6 +622,32 @@ int CWKSP_Map::Get_Print_Legend(void)
 //---------------------------------------------------------
 int CWKSP_Map::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags)
 {
+	if( Flags & PARAMETER_CHECK_ENABLE )
+	{
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "FRAME_SHOW") )
+		{
+			pParameters->Get_Parameter("FRAME_WIDTH"   )->Set_Enabled(pParameter->asBool());
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "NORTH_SHOW") )
+		{
+			pParameters->Get_Parameter("NORTH_ANGLE"   )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("NORTH_SIZE"    )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("NORTH_OFFSET_X")->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("NORTH_OFFSET_Y")->Set_Enabled(pParameter->asBool());
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "SCALE_SHOW") )
+		{
+			pParameters->Get_Parameter("SCALE_STYLE"   )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("SCALE_UNIT"    )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("SCALE_WIDTH"   )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("SCALE_HEIGHT"  )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("SCALE_OFFSET_X")->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("SCALE_OFFSET_Y")->Set_Enabled(pParameter->asBool());
+		}
+	}
+
 	return( CWKSP_Base_Manager::On_Parameter_Changed(pParameters, pParameter, Flags) );
 }
 
@@ -548,6 +665,8 @@ void CWKSP_Map::Parameters_Changed(void)
 
 	View_Refresh(false);
 
+	Set_Synchronising(m_Parameters("SYNC_MAPS")->asBool());
+
 	CWKSP_Base_Manager::Parameters_Changed();
 }
 
@@ -559,17 +678,36 @@ void CWKSP_Map::Parameters_Changed(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CWKSP_Map_Layer * CWKSP_Map::Find_Layer(CWKSP_Layer *pLayer)
+bool CWKSP_Map::Update(CWKSP_Layer *pLayer, bool bMapOnly)
 {
+	bool	bRefresh	= false;
+
 	for(int i=0; i<Get_Count(); i++)
 	{
-		if( pLayer == Get_Layer(i)->Get_Layer() )
+		if( Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer && ((CWKSP_Map_Layer *)Get_Item(i))->Get_Layer()->Update(pLayer) )
 		{
-			return( Get_Layer(i) );
+			bRefresh	= true;
+
+			if( !bMapOnly )
+			{
+				Get_Item(i)->Parameters_Changed();
+			}
 		}
 	}
 
-	return( NULL );
+	if( bRefresh )
+	{
+		if( m_pView )
+		{
+			View_Refresh(bMapOnly);
+		}
+
+		_Img_Save_On_Change();
+
+		return( true );
+	}
+
+	return( false );
 }
 
 //---------------------------------------------------------
@@ -577,7 +715,7 @@ int CWKSP_Map::Get_Layer(CWKSP_Layer *pLayer)
 {
 	for(int i=0; i<Get_Count(); i++)
 	{
-		if( pLayer == Get_Layer(i)->Get_Layer() )
+		if( Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer && ((CWKSP_Map_Layer *)Get_Item(i))->Get_Layer() == pLayer )
 		{
 			return( i );
 		}
@@ -587,6 +725,20 @@ int CWKSP_Map::Get_Layer(CWKSP_Layer *pLayer)
 }
 
 //---------------------------------------------------------
+CWKSP_Map_Layer * CWKSP_Map::Find_Layer(CWKSP_Layer *pLayer)
+{
+	for(int i=0; i<Get_Count(); i++)
+	{
+		if( Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer && ((CWKSP_Map_Layer *)Get_Item(i))->Get_Layer() == pLayer )
+		{
+			return( (CWKSP_Map_Layer *)Get_Item(i) );
+		}
+	}
+
+	return( NULL );
+}
+
+//---------------------------------------------------------
 CWKSP_Map_Layer * CWKSP_Map::Add_Layer(CWKSP_Layer *pLayer)
 {
 	CWKSP_Map_Layer	*pItem;
@@ -614,6 +766,11 @@ CWKSP_Map_Layer * CWKSP_Map::Add_Layer(CWKSP_Layer *pLayer)
 
 		Move_Top(pItem);
 
+		if( !m_Projection.is_Okay() && pLayer->Get_Object()->Get_Projection().is_Okay() )
+		{
+			m_Projection	= pLayer->Get_Object()->Get_Projection();
+		}
+
 		return( pItem );
 	}
 
@@ -621,36 +778,47 @@ CWKSP_Map_Layer * CWKSP_Map::Add_Layer(CWKSP_Layer *pLayer)
 }
 
 //---------------------------------------------------------
-bool CWKSP_Map::Update(CWKSP_Layer *pLayer, bool bMapOnly)
+CWKSP_Map_Graticule * CWKSP_Map::Add_Graticule(CSG_MetaData *pEntry)
 {
-	bool	bRefresh	= false;
+	CWKSP_Map_Graticule	*pItem;
 
-	for(int i=0; i<Get_Count(); i++)
+	if( (Get_Count() > 0 && m_Projection.is_Okay()) || pEntry )
 	{
-		if( Get_Layer(i)->Get_Layer()->Update(pLayer) )
-		{
-			bRefresh	= true;
+		g_pMaps->Add(this);
 
-			if( !bMapOnly )
-			{
-				Get_Layer(i)->Parameters_Changed();
-			}
-		}
+		Add_Item(pItem = new CWKSP_Map_Graticule(pEntry));
+
+		Move_Top(pItem);
+
+		View_Refresh(true);
+
+		return( pItem );
 	}
 
-	if( bRefresh )
+	return( NULL );
+}
+
+//---------------------------------------------------------
+CWKSP_Base_Item * CWKSP_Map::Add_Copy(CWKSP_Base_Item *pItem)
+{
+	if( pItem )
 	{
-		if( m_pView )
+		if( pItem->Get_Type() == WKSP_ITEM_Map_Layer )
 		{
-			View_Refresh(bMapOnly);
+			return( Add_Layer(((CWKSP_Map_Layer *)pItem)->Get_Layer()) );
 		}
 
-		_Img_Save_On_Change();
+		if( pItem->Get_Type() == WKSP_ITEM_Map_Graticule )
+		{
+			CWKSP_Map_Graticule	*pGraticule	= Add_Graticule();
 
-		return( true );
+			pGraticule->Get_Parameters()->Assign_Values(pItem->Get_Parameters());
+
+			return( pGraticule );
+		}
 	}
 
-	return( false );
+	return( NULL );
 }
 
 
@@ -667,7 +835,7 @@ void CWKSP_Map::_Set_Extent(const CSG_Rect &Extent)
 	{
 		View_Refresh(true);
 
-		if( m_bSynchronise )
+		if( m_Parameters("SYNC_MAPS")->asBool() )
 		{
 			_Synchronise_Extents();
 		}
@@ -719,17 +887,26 @@ void CWKSP_Map::Set_Extent(void)
 //---------------------------------------------------------
 void CWKSP_Map::Set_Extent_Full(void)
 {
-	if( Get_Count() > 0 )
-	{
-		CSG_Rect	Extent(Get_Layer(0)->Get_Layer()->Get_Extent());
+	CSG_Rect	Extent;
 
-		for(int i=1; i<Get_Count(); i++)
+	for(int i=0, n=0; i<Get_Count(); i++)
+	{
+		if( Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer )
 		{
-			Extent.Union(Get_Layer(i)->Get_Layer()->Get_Extent());
-		}
+			CWKSP_Layer	*pLayer	= ((CWKSP_Map_Layer *)Get_Item(i))->Get_Layer();
 
-		Set_Extent(Extent);
+			if( n++ == 0 )
+			{
+				Extent.Assign(pLayer->Get_Extent());
+			}
+			else
+			{
+				Extent.Union (pLayer->Get_Extent());
+			}
+		}
 	}
+
+	Set_Extent(Extent);
 }
 
 //---------------------------------------------------------
@@ -783,23 +960,58 @@ bool CWKSP_Map::Set_Extent_Forward(bool bCheck_Only)
 }
 
 //---------------------------------------------------------
-void CWKSP_Map::Set_ScaleBar(bool bOn)
+bool CWKSP_Map::is_North_Arrow(void)
 {
-	m_bScaleBar	= bOn;
+	return( m_Parameters("NORTH_SHOW")->asBool() );
+}
 
-	if( m_pView )
+void CWKSP_Map::Set_North_Arrow(bool bOn)
+{
+	if( m_Parameters("NORTH_SHOW")->asBool() != bOn )
+	{
+		m_Parameters("NORTH_SHOW")->Set_Value(bOn ? 1 : 0);
+
+		if( m_pView )
+		{
+			m_pView->Do_Update();
+		}
+	}
+}
+
+//---------------------------------------------------------
+bool CWKSP_Map::is_ScaleBar(void)
+{
+	return( m_Parameters("SCALE_SHOW")->asBool() );
+}
+
+void CWKSP_Map::Set_ScaleBar(bool bOn)
+{
+	if( m_Parameters("SCALE_SHOW")->asBool() != bOn )
 	{
-		m_pView->Refresh_Map();
-		m_pView->Ruler_Refresh();
+		m_Parameters("SCALE_SHOW")->Set_Value(bOn ? 1 : 0);
+
+		if( m_pView )
+		{
+			m_pView->Do_Update();
+			m_pView->Ruler_Refresh();
+		}
 	}
 }
 
 //---------------------------------------------------------
+bool CWKSP_Map::is_Synchronising(void)
+{
+	return( m_Parameters("SYNC_MAPS")->asBool() );
+}
+
 void CWKSP_Map::Set_Synchronising(bool bOn)
 {
-	m_bSynchronise	= bOn;
+	if( m_Parameters("SYNC_MAPS")->asBool() != bOn )
+	{
+		m_Parameters("SYNC_MAPS")->Set_Value(bOn ? 1 : 0);
+	}
 
-	if( m_bSynchronise )
+	if( bOn )
 	{
 		_Synchronise_Extents();
 	}
@@ -825,8 +1037,25 @@ void CWKSP_Map::_Synchronise_Extents(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Map::On_Delete(CWKSP_Map_Layer *pLayer)
+void CWKSP_Map::Set_Projection(void)
 {
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("pj_proj4"), 15);	// CCRS_Picker
+
+	if(	pModule )
+	{
+		CSG_Parameters	P; P.Assign(pModule->Get_Parameters());
+
+		if( pModule->Get_Parameters()->Set_Parameter("CRS_PROJ4" , m_Projection.Get_Proj4())
+		&&	pModule->On_Before_Execution() && DLG_Parameters(pModule->Get_Parameters())
+		&&  pModule->Execute() )
+		{
+			m_Projection.Assign(pModule->Get_Parameters()->Get_Parameter("CRS_PROJ4")->asString(), SG_PROJ_FMT_Proj4);
+
+			View_Refresh(false);
+		}
+
+		pModule->Get_Parameters()->Assign_Values(&P);
+	}
 }
 
 
@@ -837,47 +1066,35 @@ void CWKSP_Map::On_Delete(CWKSP_Map_Layer *pLayer)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Map::View_Closes(wxMDIChildFrame *pView)
+bool CWKSP_Map::View_Opened(wxMDIChildFrame *pView)
 {
-	if( wxDynamicCast(pView, CVIEW_Map) != NULL )
-	{
-		m_pView		= NULL;
-	}
+    if( wxDynamicCast(pView, CVIEW_Map   ) != NULL )    {	m_pView		= (CVIEW_Map    *)pView;	return( true );	}
+    if( wxDynamicCast(pView, CVIEW_Map_3D) != NULL )	{	m_pView_3D	= (CVIEW_Map_3D *)pView;	return( true );	}
+	if( wxDynamicCast(pView, CVIEW_Layout) != NULL )	{	m_pLayout	= (CVIEW_Layout *)pView;	return( true );	}
 
-	if( wxDynamicCast(pView, CVIEW_Map_3D) != NULL )
-	{
-		m_pView_3D	= NULL;
-	}
+    return( false );
+}
 
-	if( wxDynamicCast(pView, CVIEW_Layout) != NULL )
-	{
-		m_pLayout	= NULL;
-	}
+//---------------------------------------------------------
+void CWKSP_Map::View_Closes(wxMDIChildFrame *pView)
+{
+	if( pView == m_pView    )	m_pView		= NULL;
+	if( pView == m_pView_3D )	m_pView_3D	= NULL;
+	if( pView == m_pLayout  )	m_pLayout	= NULL;
 }
 
 //---------------------------------------------------------
 void CWKSP_Map::View_Refresh(bool bMapOnly)
 {
+	if( m_pView    )	m_pView   ->Do_Update();
+	if( m_pView_3D )	m_pView_3D->Do_Update();
+	if( m_pLayout  )	m_pLayout ->Do_Update();
+
 	if( !bMapOnly && g_pACTIVE && g_pACTIVE->Get_Legend() )
 	{
 		g_pACTIVE->Get_Legend()->Refresh(true);
 	}
 
-	if( m_pView )
-	{
-		m_pView->Refresh_Map();
-	}
-
-	if( m_pView_3D )
-	{
-		m_pView_3D->On_Source_Changed();
-	}
-
-	if( m_pLayout )
-	{
-		m_pLayout->Refresh_Layout();
-	}
-
 	_Set_Thumbnail();
 
 	if( g_pMap_Buttons )
@@ -893,18 +1110,18 @@ void CWKSP_Map::View_Show(bool bShow)
 	{
 		if( !m_pView )
 		{
-			m_pView	= new CVIEW_Map(this, Get_Frame_Width());
+			new CVIEW_Map(this, Get_Frame_Width());
 		}
 		else
 		{
 			View_Refresh(false);
+
 			m_pView->Activate();
 		}
 	}
 	else if( m_pView )
 	{
 		m_pView->Destroy();
-		delete(m_pView);
 	}
 }
 
@@ -919,12 +1136,11 @@ void CWKSP_Map::View_3D_Show(bool bShow)
 {
 	if( bShow && !m_pView_3D )
 	{
-		m_pView_3D	= new CVIEW_Map_3D(this);
+		new CVIEW_Map_3D(this);
 	}
 	else if( !bShow && m_pView_3D )
 	{
 		m_pView_3D->Destroy();
-		delete(m_pView_3D);
 	}
 }
 
@@ -939,12 +1155,11 @@ void CWKSP_Map::View_Layout_Show(bool bShow)
 {
 	if( bShow && !m_pLayout )
 	{
-		m_pLayout	= new CVIEW_Layout(m_pLayout_Info);
+		new CVIEW_Layout(m_pLayout_Info);
 	}
 	else if( !bShow && m_pLayout )
 	{
 		m_pLayout->Destroy();
-		delete(m_pLayout);
 	}
 }
 
@@ -1167,7 +1382,7 @@ void CWKSP_Map::SaveAs_Image_To_Memory(int nx, int ny)
 
 	if( !DLG_Parameters(&P) || P("CELLSIZE")->asDouble() <= 0.0 )
 		return;
-	
+
 	nx	= Extent.Get_XRange() / P("CELLSIZE")->asDouble();
 	ny	= Extent.Get_YRange() / P("CELLSIZE")->asDouble();
 
@@ -1190,10 +1405,10 @@ void CWKSP_Map::SaveAs_Image_To_Memory(int nx, int ny)
 
 		g_pData->Add(pGrid);
 		g_pData->Get_Parameters(pGrid, &P);
-		
+
 		if( P("COLORS_TYPE") )
 		{
-			P("COLORS_TYPE")->Set_Value(3);
+			P("COLORS_TYPE")->Set_Value(6);	// RGB
 
 			g_pData->Set_Parameters(pGrid, &P);
 		}
@@ -1268,7 +1483,7 @@ void CWKSP_Map::_Img_Save(wxString file, int type)
 		case wxBITMAP_TYPE_JPEG:	fn.SetExt(wxT("jgw"));		break;
 		case wxBITMAP_TYPE_PNG:		fn.SetExt(wxT("pgw"));		break;
 		case wxBITMAP_TYPE_PCX:		fn.SetExt(wxT("pxw"));		break;
-		case wxBITMAP_TYPE_TIF:		fn.SetExt(wxT("tfw"));		break; 
+		case wxBITMAP_TYPE_TIF:		fn.SetExt(wxT("tfw"));		break;
 		}
 
 		if( Stream.Open(fn.GetFullPath().wx_str(), SG_FILE_W, false) )
@@ -1404,37 +1619,43 @@ void CWKSP_Map::Draw_Map(wxDC &dc, const CSG_Rect &rWorld, double Zoom, const wx
 {
 	CWKSP_Map_DC	dc_Map(rWorld, rClient, Zoom, Background);
 
+	//-----------------------------------------------------
 	for(int i=Get_Count()-1; i>=0; i--)
 	{
-		if( Get_Layer(i)->do_Show() && Get_Layer(i)->Get_Layer()->do_Show(Get_Extent()) )
+		switch( Get_Item(i)->Get_Type() )
 		{
-			Get_Layer(i)->Get_Layer()->Draw(dc_Map, bEdit && Get_Layer(i)->Get_Layer() == Get_Active_Layer());
-		}
-	}
-
-	if( m_bScaleBar )
-	{
-		double	dScale	= 0.4 * rWorld.Get_XRange();
-		wxRect	r, rScale(10, rClient.GetHeight() - 25, (int)(0.5 + dc_Map.xWorld2DC(rWorld.Get_XMin() + dScale)), 20);
+		case WKSP_ITEM_Map_Layer:
+			{
+				CWKSP_Map_Layer	*pLayer	= (CWKSP_Map_Layer *)Get_Item(i);
 
-		dc_Map.dc.SetPen(wxPen(*wxWHITE));
-		dc_Map.dc.SetTextForeground(*wxWHITE);
+				if( pLayer->do_Show() && pLayer->Get_Layer()->do_Show(Get_Extent()) )
+				{
+					pLayer->Get_Layer()->Draw(dc_Map, bEdit && pLayer->Get_Layer() == Get_Active_Layer());
+				}
+			}
+			break;
 
-		r	= rScale; r.Offset( 0,  1); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset( 1,  1); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset( 1,  0); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset( 1, -1); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset( 0, -1); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset(-1, -1); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset(-1,  0); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
-		r	= rScale; r.Offset(-1,  1); Draw_Scale(dc_Map.dc, r, 0.0, dScale, true, true, true, true);
+		case WKSP_ITEM_Map_Graticule:
+			{
+				CWKSP_Map_Graticule	*pLayer	= (CWKSP_Map_Graticule *)Get_Item(i);
 
-		dc_Map.dc.SetPen(wxPen(*wxBLACK));
-		dc_Map.dc.SetTextForeground(*wxBLACK);
+				if( pLayer->do_Show() )//&& pLayer->Get_Graticule(Get_Extent()) )
+				{
+					pLayer->Draw(dc_Map);
+				}
+			}
+			break;
 
-		Draw_Scale(dc_Map.dc, rScale, 0.0, dScale, true, true, true, true);
+		default:
+			break;
+		}
 	}
 
+	//-----------------------------------------------------
+	Draw_ScaleBar   (dc_Map.dc, rWorld, rClient);
+	Draw_North_Arrow(dc_Map.dc, rWorld, rClient);
+
+	//-----------------------------------------------------
 	dc_Map.Draw(dc);
 }
 
@@ -1470,37 +1691,36 @@ void CWKSP_Map::Draw_Frame(wxDC &dc, const CSG_Rect &rWorld, wxRect rMap, int Wi
 //---------------------------------------------------------
 bool CWKSP_Map::Draw_Legend(wxDC &dc, double Zoom_Map, double Zoom, wxPoint Position, wxSize *pSize)
 {
-	int		i, n;
-	wxSize	s, Size;
-
-	Size.x		= 0;
-	Size.y		= 0;
+	wxSize	s, Size(0, 0);
 
-	for(i=0, n=0; i<Get_Count(); i++)
+	for(int i=0; i<Get_Count(); i++)
 	{
-		if( Get_Layer(i)->Get_Layer()->do_Legend() )
+		if( Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer )
 		{
-			n++;
-
-			Get_Layer(i)->Get_Layer()->Get_Legend()->Draw(dc, Zoom, Zoom_Map, Position, &s);
+			CWKSP_Layer	*pLayer	= ((CWKSP_Map_Layer *)Get_Item(i))->Get_Layer();
 
-			if( Get_Layer(i)->Get_Layer()->Get_Legend()->Get_Orientation() == LEGEND_VERTICAL )
+			if( pLayer->do_Legend() )
 			{
-				s.y			+= (int)(Zoom * LEGEND_SPACE);
-				Position.y	+= s.y;
-				Size.y		+= s.y;
-
-				if( Size.x < s.x )
-					Size.x	= s.x;
-			}
-			else
-			{
-				s.x			+= (int)(Zoom * LEGEND_SPACE);
-				Position.x	+= s.x;
-				Size.x		+= s.x;
-
-				if( Size.y < s.y )
-					Size.y	= s.y;
+				pLayer->Get_Legend()->Draw(dc, Zoom, Zoom_Map, Position, &s);
+
+				if( 1 )	// m_pLayout->Get_Legend()->Get_Orientation() == LEGEND_VERTICAL )
+				{
+					s.y			+= (int)(Zoom * LEGEND_SPACE);
+					Position.y	+= s.y;
+					Size.y		+= s.y;
+
+					if( Size.x < s.x )
+						Size.x	= s.x;
+				}
+				else
+				{
+					s.x			+= (int)(Zoom * LEGEND_SPACE);
+					Position.x	+= s.x;
+					Size.x		+= s.x;
+
+					if( Size.y < s.y )
+						Size.y	= s.y;
+				}
 			}
 		}
 	}
@@ -1510,7 +1730,7 @@ bool CWKSP_Map::Draw_Legend(wxDC &dc, double Zoom_Map, double Zoom, wxPoint Posi
 		*pSize	= Size;
 	}
 
-	return( n > 0 );
+	return( Size.GetX() > 0 || Size.GetY() > 0 );
 }
 
 //---------------------------------------------------------
@@ -1522,6 +1742,102 @@ bool CWKSP_Map::Get_Legend_Size(wxSize &Size, double Zoom_Map, double Zoom)
 	return( Draw_Legend(dc, Zoom_Map, Zoom, wxPoint(0, 0), &Size) );
 }
 
+//---------------------------------------------------------
+bool CWKSP_Map::Draw_North_Arrow(wxDC &dc, const CSG_Rect &rWorld, const wxRect &rClient)
+{
+	if( !m_Parameters("NORTH_SHOW")->asBool() )
+	{
+		return( true );
+	}
+
+	const double	Arrow[3][2]	= { { 0.0, 1.0 }, { 0.5, -1.0 }, { 0.0, -0.50 } };
+
+	double	cos_a	= cos(-m_Parameters("NORTH_ANGLE")->asDouble() * M_DEG_TO_RAD);
+	double	sin_a	= sin(-m_Parameters("NORTH_ANGLE")->asDouble() * M_DEG_TO_RAD);
+	double	scale	= m_Parameters("NORTH_SIZE")->asDouble() * 0.01 * M_GET_MIN(rClient.GetWidth(), rClient.GetHeight());
+
+	int		xOff	= (int)(0.5 +                       m_Parameters("NORTH_OFFSET_X")->asDouble() * 0.01 * rClient.GetWidth ());
+	int		yOff	= (int)(0.5 + rClient.GetHeight() - m_Parameters("NORTH_OFFSET_Y")->asDouble() * 0.01 * rClient.GetHeight());
+
+	for(int side=0; side<=1; side++)
+	{
+		wxPoint	Points[3];
+
+		for(int i=0; i<3; i++)
+		{
+			double	x	= scale * Arrow[i][0] * (side ? 1 : -1);
+			double	y	= scale * Arrow[i][1];
+
+			Points[i].x	= xOff + (int)(0.5 + cos_a * x - sin_a * y);
+			Points[i].y	= yOff - (int)(0.5 + sin_a * x + cos_a * y);
+		}
+
+		if( side == 0 )
+		{
+		//	dc.SetPen     (wxPen  (*wxWHITE, 3));
+		//	dc.DrawLines  (3, Points);
+
+			dc.SetPen     (wxPen  (*wxBLACK, 0));
+			dc.SetBrush   (wxBrush(*wxBLACK));
+			dc.DrawPolygon(3, Points);
+            dc.DrawPolygon(3, Points);
+		}
+		else
+		{
+			dc.SetPen     (wxPen  (*wxBLACK, 0));
+			dc.SetBrush   (wxBrush(*wxWHITE));
+			dc.DrawPolygon(3, Points);
+		//	dc.DrawLines  (3, Points);
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Map::Draw_ScaleBar(wxDC &dc, const CSG_Rect &rWorld, const wxRect &rClient)
+{
+	if( !m_Parameters("SCALE_SHOW")->asBool() )
+	{
+		return( true );
+	}
+
+	double	dWidth	= 0.01 * m_Parameters("SCALE_WIDTH")->asDouble();
+
+	wxRect	r(
+		(int)(0.5 + rClient.GetWidth () * 0.01 * m_Parameters("SCALE_OFFSET_X")->asDouble()), rClient.GetHeight() -
+		(int)(0.5 + rClient.GetHeight() * 0.01 * m_Parameters("SCALE_OFFSET_Y")->asDouble()),
+		(int)(0.5 + rClient.GetWidth () * dWidth),
+		(int)(0.5 + rClient.GetHeight() * 0.01 * m_Parameters("SCALE_HEIGHT"  )->asDouble())
+	);
+
+	dWidth	*= rWorld.Get_XRange();
+
+	CSG_String	Unit;
+
+	if( m_Projection.is_Okay() && m_Parameters("SCALE_UNIT")->asBool() )
+	{
+		Unit	= SG_Get_Projection_Unit_Name(m_Projection.Get_Unit(), true);
+
+		if( Unit.is_Empty() )	Unit	= m_Projection.Get_Unit_Name();
+
+		if( m_Projection.Get_Unit() == SG_PROJ_UNIT_Meter && dWidth > 10000.0 )
+		{
+			Unit	 = SG_Get_Projection_Unit_Name(SG_PROJ_UNIT_Kilometer, true);
+			dWidth	/= 1000.0;
+		}
+	}
+
+	int	Style	= SCALE_STYLE_LINECONN|SCALE_STYLE_GLOOMING;
+
+	if( m_Parameters("SCALE_STYLE")->asInt() == 1 )
+		Style	|= SCALE_STYLE_BLACKWHITE;
+
+	Draw_Scale(dc, r, 0.0, dWidth, SCALE_HORIZONTAL, SCALE_TICK_TOP, Style, Unit.c_str());
+
+	return( true );
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_gui/wksp_map.h b/src/saga_core/saga_gui/wksp_map.h
index 5b56de6..1412761 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map.h 2066 2014-03-24 08:55:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -142,22 +142,25 @@ public:
 	bool						Set_Extent_Back			(bool bCheck_Only = false);
 	bool						Set_Extent_Forward		(bool bCheck_Only = false);
 
-	void						Set_Synchronising		(bool bOn);
-	bool						is_Synchronising		(void)	{	return( m_bSynchronise );	}
+	bool						is_North_Arrow			(void);
+	void						Set_North_Arrow			(bool bOn);
 
+	bool						is_ScaleBar				(void);
 	void						Set_ScaleBar			(bool bOn);
-	bool						is_ScaleBar				(void)	{	return( m_bScaleBar );	}
+
+	bool						is_Synchronising		(void);
+	void						Set_Synchronising		(bool bOn);
 
 	bool						is_Image_Save_Mode		(void)	{	return( m_Img_bSave );		}
 
-	class CWKSP_Map_Layer *		Add_Layer				(class CWKSP_Layer *pLayer);
-	int							Get_Layer				(class CWKSP_Layer *pLayer);
-	class CWKSP_Map_Layer *		Get_Layer				(int i)		{	return( (class CWKSP_Map_Layer *)Get_Item(i) );	}
 	bool						Update					(class CWKSP_Layer *pLayer, bool bMapOnly);
+	int							Get_Layer				(class CWKSP_Layer *pLayer);
 	class CWKSP_Map_Layer *		Find_Layer				(class CWKSP_Layer *pLayer);
+	class CWKSP_Map_Layer *		Add_Layer				(class CWKSP_Layer *pLayer);
+	class CWKSP_Map_Graticule *	Add_Graticule			(CSG_MetaData *pEntry = NULL);
+	class CWKSP_Base_Item *		Add_Copy				(CWKSP_Base_Item *pItem);
 
-	void						On_Delete				(class CWKSP_Map_Layer *pLayer);
-
+    bool                        View_Opened             (class wxMDIChildFrame *pView);
 	void						View_Closes				(class wxMDIChildFrame *pView);
 	void						View_Refresh			(bool bMapOnly);
 	class CVIEW_Map *			View_Get				(void)		{	return( m_pView );		}
@@ -185,6 +188,8 @@ public:
 	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);
+	bool						Draw_North_Arrow		(wxDC &dc, const CSG_Rect &rWorld, const wxRect &rClient);
+	bool						Draw_ScaleBar			(wxDC &dc, const CSG_Rect &rWorld, const wxRect &rClient);
 
 	const wxBitmap &			Get_Thumbnail			(int dx, int dy);
 
@@ -195,6 +200,9 @@ public:
 	int							Get_Print_Frame			(void);
 	int							Get_Print_Legend		(void);
 
+	void						Set_Projection			(void);
+	CSG_Projection &			Get_Projection			(void)	{	return( m_Projection );	}
+
 
 protected:
 
@@ -205,7 +213,7 @@ protected:
 
 private:
 
-	bool						m_bScaleBar, m_bSynchronise, m_Img_bSave;
+	bool						m_Img_bSave;
 
 	int							m_Img_Type, m_Img_Count;
 
@@ -215,6 +223,8 @@ private:
 
 	CSG_Parameters				m_Img_Parms;
 
+	CSG_Projection				m_Projection;
+
 	CWKSP_Map_Extents			m_Extents;
 
 	class CVIEW_Map				*m_pView;
diff --git a/src/saga_core/saga_gui/wksp_map_buttons.cpp b/src/saga_core/saga_gui/wksp_map_buttons.cpp
index f5fedbc..25f3d79 100644
--- a/src/saga_core/saga_gui/wksp_map_buttons.cpp
+++ b/src/saga_core/saga_gui/wksp_map_buttons.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_buttons.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_buttons.cpp 2020 2014-02-26 11:21:04Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -89,155 +89,141 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#define SCROLL_RATE		5
-
-#define SCROLL_BAR_DX	wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)
-#define SCROLL_BAR_DY	wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y)
-
-//---------------------------------------------------------
-#define THUMBNAIL_SIZE	75
-#define THUMBNAIL_DIST	5
-
-#define TITLE_FONT		wxFont(8, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CWKSP_Map_Buttons	*g_pMap_Buttons	= NULL;
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
 IMPLEMENT_CLASS(CWKSP_Map_Button, wxPanel)
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CWKSP_Map_Button, wxPanel)
 	EVT_PAINT			(CWKSP_Map_Button::On_Paint)
+	EVT_KEY_DOWN		(CWKSP_Map_Button::On_Key)
 	EVT_LEFT_DOWN		(CWKSP_Map_Button::On_Mouse_LDown)
 	EVT_LEFT_DCLICK		(CWKSP_Map_Button::On_Mouse_LDClick)
 	EVT_RIGHT_DOWN		(CWKSP_Map_Button::On_Mouse_RDown)
 END_EVENT_TABLE()
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-CWKSP_Map_Button::CWKSP_Map_Button(wxWindow *pParent, class CWKSP_Map *pMap)
+CWKSP_Map_Button::CWKSP_Map_Button(wxWindow *pParent, CWKSP_Map *pMap)
 	: wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER)
 {
-	m_pMap		= pMap;
-	m_Title		= pMap->Get_Name();
+	m_pMap	= pMap;
 }
 
-//---------------------------------------------------------
-CWKSP_Map_Button::CWKSP_Map_Button(wxWindow *pParent, const wxString &Title)
-	: wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, 0)
-{
-	m_pMap		= NULL;
-	m_Title		= Title;
-
-	int			x, y, d, e;
-	wxClientDC	dc(this);
-	wxFont		Font(TITLE_FONT);
-	dc.GetTextExtent(m_Title, &x, &y, &d, &e, &Font);
-	SetSize(-1, -1, x + 4, y + d + e + 4);
-}
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
 void CWKSP_Map_Button::On_Paint(wxPaintEvent &event)
 {
-	wxPaintDC	dc(this);
-	wxRect		r(wxPoint(0, 0), GetClientSize());
-
-	if( m_pMap )
+	if( g_pMaps->Exists(m_pMap) )
 	{
-		if( g_pMaps->Exists(m_pMap) )
+		if( !GetToolTip() || GetToolTip()->GetTip().Cmp(m_pMap->Get_Name()) )
 		{
-			if( !GetToolTip() || GetToolTip()->GetTip().Cmp(m_pMap->Get_Name()) )
-			{
-				SetToolTip(m_pMap->Get_Name());
-			}
+			SetToolTip(m_pMap->Get_Name());
+		}
 
-			dc.DrawBitmap(m_pMap->Get_Thumbnail(r.GetWidth() - 1, r.GetHeight() - 1), r.GetLeft(), r.GetTop(), true);
+		//-------------------------------------------------
+		wxPaintDC	dc(this);
 
-			if( g_pACTIVE->Get_Active_Map() == m_pMap )
-			{
-				dc.SetPen(wxPen(((CWKSP_Map_Buttons *)GetParent())->Get_Active_Color()));
-				Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
-				Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
-				Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);
-			}
+		wxRect		r(GetClientRect());
+
+		dc.DrawBitmap(m_pMap->Get_Thumbnail(r.GetWidth() - 1, r.GetHeight() - 1),
+			r.GetLeft(), r.GetTop(), true
+		);
+
+		//-------------------------------------------------
+		if( m_pMap->is_Selected() )
+		{
+			dc.SetPen(wxPen(Get_Color_asWX(g_pMaps->Get_Parameter("THUMBNAIL_SELCOLOR")->asColor())));
+
+			Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
+			Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);	r.Deflate(1);
+			Draw_Edge(dc, EDGE_STYLE_SIMPLE, r);
 		}
 	}
-	else
-	{
-		dc.DrawLine(0, 0, r.GetWidth(), 0);
-		dc.DrawLine(0, 1, r.GetWidth(), 1);
-		dc.SetFont(TITLE_FONT);
-		dc.DrawText(m_Title, 2, 2);
-		dc.DrawLine(0, r.GetBottom(), GetClientSize().x, r.GetBottom());
-	}
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-bool CWKSP_Map_Button::_Set_Layer_Active(void)
+void CWKSP_Map_Button::On_Key(wxKeyEvent &event)
 {
-	if( m_pMap && g_pMaps->Exists(m_pMap) )
-	{
-		g_pMap_Ctrl->Set_Item_Selected(m_pMap);
+	wxCommandEvent	Command;
 
-		return( true );
+	switch( event.GetKeyCode() )
+	{
+	case WXK_RETURN:
+		Command.SetId(ID_CMD_WKSP_ITEM_RETURN);
+		g_pMap_Ctrl->On_Command(Command);
+		break;
+
+	case WXK_DELETE:
+		Command.SetId(ID_CMD_WKSP_ITEM_CLOSE);
+		g_pMap_Ctrl->On_Command(Command);
+		break;
+
+	default:
+		break;
 	}
-
-	m_pMap	= NULL;
-
-	return( false );
 }
 
 //---------------------------------------------------------
 void CWKSP_Map_Button::On_Mouse_LDown(wxMouseEvent &event)
 {
-	_Set_Layer_Active();
-
-	event.Skip();
+	_Set_Active();
 }
 
 //---------------------------------------------------------
 void CWKSP_Map_Button::On_Mouse_LDClick(wxMouseEvent &event)
 {
-	if( _Set_Layer_Active() )
+	if( _Set_Active() )
 	{
 		m_pMap->On_Command(ID_CMD_WKSP_ITEM_RETURN);
 	}
-
-	event.Skip();
 }
 
 //---------------------------------------------------------
 void CWKSP_Map_Button::On_Mouse_RDown(wxMouseEvent &event)
 {
-	if( _Set_Layer_Active() )
+	if( _Set_Active() )
 	{
-		wxMenu	*pMenu;
+		wxMenu	*pMenu	= m_pMap->Get_Menu();
 
-		if( (pMenu = m_pMap->Get_Menu()) != NULL )
+		if( pMenu )
 		{
 			GetParent()->PopupMenu(pMenu, GetParent()->ScreenToClient(ClientToScreen(event.GetPosition())));
 
 			delete(pMenu);
-
-			return;
 		}
 	}
+}
 
-	event.Skip();
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Map_Button::_Set_Active(void)
+{
+	if( g_pMaps->Exists(m_pMap) )
+	{
+		SetFocus();
+
+		return( g_pMap_Ctrl->Set_Item_Selected(m_pMap) );
+	}
+
+	m_pMap	= NULL;
+
+	return( false );
 }
 
 
@@ -248,19 +234,31 @@ void CWKSP_Map_Button::On_Mouse_RDown(wxMouseEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define THUMBNAIL_DIST	5
+#define SCROLL_RATE		5
+#define SCROLL_BAR_DX	wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)
+#define SCROLL_BAR_DY	wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y)
+
+//---------------------------------------------------------
+CWKSP_Map_Buttons	*g_pMap_Buttons	= NULL;
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 IMPLEMENT_CLASS(CWKSP_Map_Buttons, wxScrolledWindow)
 
 //---------------------------------------------------------
 BEGIN_EVENT_TABLE(CWKSP_Map_Buttons, wxScrolledWindow)
-	EVT_RIGHT_DOWN		(CWKSP_Map_Buttons::On_Mouse_RDown)
 	EVT_SIZE			(CWKSP_Map_Buttons::On_Size)
+	EVT_LEFT_DOWN		(CWKSP_Map_Buttons::On_Mouse_LDown)
 END_EVENT_TABLE()
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -274,72 +272,42 @@ CWKSP_Map_Buttons::CWKSP_Map_Buttons(wxWindow *pParent)
 
 	m_Items			= NULL;
 	m_nItems		= 0;
-
-	//-----------------------------------------------------
-	long	lValue;
-
-	m_Size			= CONFIG_Read(wxT("/BUTTONS_MAPS"), wxT("SIZE")		, lValue) ? (int)lValue : 75;
-	m_Active_Color	= CONFIG_Read(wxT("/BUTTONS_MAPS"), wxT("SELCOLOR")	, lValue) ?      lValue : Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW));
-
-	//-----------------------------------------------------
-	m_Parameters.Create(this, _TL("Options for Map Thumbnails"), _TL(""));
-
-	m_Parameters.Add_Value(
-		NULL, "SIZE"		, _TL("Thumbnail Size"),
-		_TL(""),
-		PARAMETER_TYPE_Int, m_Size, 10, true
-	);
-
-	m_Parameters.Add_Value(
-		NULL, "SELCOLOR"	, _TL("Selection Color"),
-		_TL(""),
-		PARAMETER_TYPE_Color, m_Active_Color
-	);
 }
 
 //---------------------------------------------------------
 CWKSP_Map_Buttons::~CWKSP_Map_Buttons(void)
 {
-	CONFIG_Write(wxT("/BUTTONS_MAPS"), wxT("SIZE")    , (long)m_Parameters("SIZE")    ->asInt());
-	CONFIG_Write(wxT("/BUTTONS_MAPS"), wxT("SELCOLOR"),       m_Parameters("SELCOLOR")->asColor());
+	g_pMap_Buttons	= NULL;
 
 	_Del_Items();
-
-	g_pMap_Buttons	= NULL;
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Map_Buttons::On_Mouse_RDown(wxMouseEvent &event)
+void CWKSP_Map_Buttons::On_Size(wxSizeEvent &event)
 {
-	if( DLG_Parameters(&m_Parameters) )
-	{
-		m_Size			= m_Parameters("SIZE")		->asInt();
-		m_Active_Color	= m_Parameters("SELCOLOR")	->asColor();
-
-		Update_Buttons();
-	}
+	_Set_Positions();
 
 	event.Skip();
 }
 
 //---------------------------------------------------------
-void CWKSP_Map_Buttons::On_Size(wxSizeEvent &event)
+void CWKSP_Map_Buttons::On_Mouse_LDown(wxMouseEvent &event)
 {
-	_Set_Positions();
+	g_pMap_Ctrl->UnselectAll();
+
+	g_pACTIVE->Set_Active(NULL);
+
+	Refresh(false);
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -348,6 +316,7 @@ void CWKSP_Map_Buttons::Update_Buttons(void)
 	Freeze();
 
 	_Del_Items();
+
 	_Add_Items(g_pMaps);
 
 	Scroll(0, 0);
@@ -360,81 +329,27 @@ void CWKSP_Map_Buttons::Update_Buttons(void)
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Map_Buttons::_Set_Positions(void)
+bool CWKSP_Map_Buttons::_Del_Items(void)
 {
-	int		xSize, ySize, xPos, yPos, xAdd, yAdd, i, x, y;
-
-	xSize	= GetClientSize().x - SCROLL_BAR_DX;
-
-	if( xSize < m_Size + THUMBNAIL_DIST )
-	{
-		xSize	= m_Size + THUMBNAIL_DIST;
-	}
-
-	xPos	= THUMBNAIL_DIST;
-	yPos	= THUMBNAIL_DIST;
-	xAdd	= 0;
-	yAdd	= 0;
-
-	for(i=0; i<m_nItems; i++)
+	if( m_nItems > 0 )
 	{
-		CWKSP_Map_Button	*pItem	= m_Items[i];
-
-		if( pItem->is_Title() )
+		for(int i=0; i<m_nItems; i++)
 		{
-			xPos	 = THUMBNAIL_DIST;
-			yPos	+= THUMBNAIL_DIST + yAdd;
-
-			CalcScrolledPosition(0, yPos, &x, &y);
-			pItem->SetSize(x, y, xSize + SCROLL_BAR_DX, -1);
-
-			yPos	+= THUMBNAIL_DIST + pItem->GetSize().y;
-			yAdd	 = 0;
+			delete(m_Items[i]);
 		}
-		else
-		{
-			xAdd	= m_Size;
-
-			if( xPos + xAdd >= xSize )
-			{
-				xPos	 = THUMBNAIL_DIST;
-				yPos	+= yAdd;
-				yAdd	 = THUMBNAIL_DIST + m_Size;
-			}
-
-			yAdd	= m_Size + THUMBNAIL_DIST;
 
-			CalcScrolledPosition(xPos, yPos, &x, &y);
-			pItem->SetSize(x, y, m_Size, m_Size);
-
-			xPos	+= THUMBNAIL_DIST + xAdd;
-		}
+		SG_Free(m_Items);
 	}
 
-	xSize	+= SCROLL_BAR_DX;
-	ySize	 = SCROLL_BAR_DY + yPos + yAdd;
-
-	if(	m_xScroll != xSize || m_yScroll != ySize )
-	{
-		m_xScroll	= xSize;
-		m_yScroll	= ySize;
+	m_Items		= NULL;
+	m_nItems	= 0;
 
-		SetScrollbars(SCROLL_RATE, SCROLL_RATE, m_xScroll / SCROLL_RATE, m_yScroll / SCROLL_RATE);
-	}
+	return( true );
 }
 
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
 //---------------------------------------------------------
 bool CWKSP_Map_Buttons::_Add_Items(CWKSP_Base_Item *pItem)
 {
@@ -477,37 +392,65 @@ bool CWKSP_Map_Buttons::_Add_Item(CWKSP_Map *pMap)
 	return( false );
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
-bool CWKSP_Map_Buttons::_Add_Item(const wxString &Title)
+void CWKSP_Map_Buttons::_Set_Positions(void)
 {
-	if( Title.Length() > 0 )
-	{
-		m_Items	= (CWKSP_Map_Button **)SG_Realloc(m_Items, (m_nItems + 1) * sizeof(CWKSP_Map_Button *));
-		m_Items[m_nItems++]	= new CWKSP_Map_Button(this, Title);
+	int		Size, xSize, ySize, xPos, yPos, xAdd, yAdd;
 
-		return( true );
+	Size	= g_pMaps->Get_Parameter("THUMBNAIL_SIZE")->asInt();
+
+	xSize	= GetClientSize().x - SCROLL_BAR_DX;
+
+	if( xSize < Size + THUMBNAIL_DIST )
+	{
+		xSize	= Size + THUMBNAIL_DIST;
 	}
 
-	return( false );
-}
+	xPos	= THUMBNAIL_DIST;
+	yPos	= THUMBNAIL_DIST;
+	xAdd	= 0;
+	yAdd	= 0;
 
-//---------------------------------------------------------
-bool CWKSP_Map_Buttons::_Del_Items(void)
-{
-	if( m_nItems > 0 )
+	//-----------------------------------------------------
+	for(int i=0, x, y; i<m_nItems; i++)
 	{
-		for(int i=0; i<m_nItems; i++)
+		CWKSP_Map_Button	*pItem	= m_Items[i];
+
 		{
-			delete(m_Items[i]);
-		}
+			xAdd	= Size;
 
-		SG_Free(m_Items);
+			if( xPos + xAdd >= xSize )
+			{
+				xPos	 = THUMBNAIL_DIST;
+				yPos	+= yAdd;
+				yAdd	 = THUMBNAIL_DIST + Size;
+			}
+
+			yAdd	= Size + THUMBNAIL_DIST;
+
+			CalcScrolledPosition(xPos, yPos, &x, &y);
+			pItem->SetSize(x, y, Size, Size);
+
+			xPos	+= THUMBNAIL_DIST + xAdd;
+		}
 	}
 
-	m_Items		= NULL;
-	m_nItems	= 0;
+	//-----------------------------------------------------
+	xSize	+= SCROLL_BAR_DX;
+	ySize	 = SCROLL_BAR_DY + yPos + yAdd;
 
-	return( true );
+	if(	m_xScroll != xSize || m_yScroll != ySize )
+	{
+		m_xScroll	= xSize;
+		m_yScroll	= ySize;
+
+		SetScrollbars(SCROLL_RATE, SCROLL_RATE, m_xScroll / SCROLL_RATE, m_yScroll / SCROLL_RATE);
+	}
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_map_buttons.h b/src/saga_core/saga_gui/wksp_map_buttons.h
index 1f00034..79e6218 100644
--- a/src/saga_core/saga_gui/wksp_map_buttons.h
+++ b/src/saga_core/saga_gui/wksp_map_buttons.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_buttons.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_buttons.h 2020 2014-02-26 11:21:04Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -74,8 +74,6 @@
 //---------------------------------------------------------
 #include <wx/scrolwin.h>
 
-#include <saga_api/saga_api.h>
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -90,32 +88,30 @@ class CWKSP_Map_Button : public wxPanel
 
 public:
 	CWKSP_Map_Button(wxWindow *pParent, class CWKSP_Map *pMap);
-	CWKSP_Map_Button(wxWindow *pParent, const wxString &Title);
-	virtual ~CWKSP_Map_Button(void)	{}
-
-	void						On_Paint			(wxPaintEvent &event);
-
-	void						On_Mouse_LDown		(wxMouseEvent &event);
-	void						On_Mouse_LDClick	(wxMouseEvent &event);
-	void						On_Mouse_RDown		(wxMouseEvent &event);
-
-	bool						is_Title			(void)		{	return( m_pMap == NULL );	}
 
 
 private:
 
-	wxString					m_Title;
-
 	class CWKSP_Map				*m_pMap;
 
 
-	bool						_Set_Layer_Active	(void);
+	void						On_Paint			(wxPaintEvent &event);
+	void						On_Key				(wxKeyEvent   &event);
+	void						On_Mouse_LDown		(wxMouseEvent &event);
+	void						On_Mouse_LDClick	(wxMouseEvent &event);
+	void						On_Mouse_RDown		(wxMouseEvent &event);
 
+	bool						_Set_Active			(void);
 
-//---------------------------------------------------------
-DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
 };
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 class CWKSP_Map_Buttons : public wxScrolledWindow
 {
@@ -125,37 +121,28 @@ public:
 	CWKSP_Map_Buttons(wxWindow *pParent);
 	virtual ~CWKSP_Map_Buttons(void);
 
-	void						On_Mouse_RDown		(wxMouseEvent &event);
-
-	void						On_Size				(wxSizeEvent  &event);
-
 	void						Update_Buttons		(void);
 
-	int							Get_Item_Size		(void)		{	return( m_Size );	}
-	long						Get_Active_Color	(void)		{	return( m_Active_Color );	}
-
 
 private:
 
-	int							m_xScroll, m_yScroll, m_nItems, m_Size;
-
-	long						m_Active_Color;
+	int							m_nItems, m_xScroll, m_yScroll;
 
 	CWKSP_Map_Button			**m_Items;
 
-	CSG_Parameters				m_Parameters;
-
 
-	void						_Set_Positions		(void);
+	void						On_Size				(wxSizeEvent  &event);
+	void						On_Mouse_LDown		(wxMouseEvent &event);
 
+	bool						_Del_Items			(void);
 	bool						_Add_Items			(class CWKSP_Base_Item *pItem);
 	bool						_Add_Item			(class CWKSP_Map *pMap);
-	bool						_Add_Item			(const wxString &Title);
-	bool						_Del_Items			(void);
+
+	void						_Set_Positions		(void);
 
 
-//---------------------------------------------------------
-DECLARE_EVENT_TABLE()
+	//-----------------------------------------------------
+	DECLARE_EVENT_TABLE()
 };
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_map_control.cpp b/src/saga_core/saga_gui/wksp_map_control.cpp
index d07cfef..a1b2c00 100644
--- a/src/saga_core/saga_gui/wksp_map_control.cpp
+++ b/src/saga_core/saga_gui/wksp_map_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_control.cpp 2068 2014-03-25 16:04:16Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -91,7 +91,7 @@ enum
 {
 	IMG_MAP_MANAGER		= 1,
 	IMG_MAP,
-
+	IMG_MAP_GRATICULE,
 	IMG_SHAPES_POINT,
 	IMG_SHAPES_POINTS,
 	IMG_SHAPES_LINE,
@@ -143,7 +143,7 @@ CWKSP_Map_Control::CWKSP_Map_Control(wxWindow *pParent)
 	//-----------------------------------------------------
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_MAP_MANAGER);
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_MAP);
-
+	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_MAP_GRATICULE);
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POINT);
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POINTS);
 	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_LINE);
@@ -176,8 +176,8 @@ int CWKSP_Map_Control::OnCompareItems(const wxTreeItemId &item1, const wxTreeIte
 {
 	CWKSP_Base_Item	*p1, *p2;
 
-	if(	(p1 = (CWKSP_Base_Item *)GetItemData(item1)) != NULL && p1->Get_Type() == WKSP_ITEM_Map_Layer
-	&&	(p2 = (CWKSP_Base_Item *)GetItemData(item2)) != NULL && p2->Get_Type() == WKSP_ITEM_Map_Layer )
+	if(	(p1 = (CWKSP_Base_Item *)GetItemData(item1)) != NULL && (p1->Get_Type() == WKSP_ITEM_Map_Layer || p1->Get_Type() == WKSP_ITEM_Map_Graticule)
+	&&	(p2 = (CWKSP_Base_Item *)GetItemData(item2)) != NULL && (p2->Get_Type() == WKSP_ITEM_Map_Layer || p2->Get_Type() == WKSP_ITEM_Map_Graticule) )
 	{
 		return( p1->Get_Index() - p2->Get_Index() );
 	}
@@ -195,28 +195,33 @@ int CWKSP_Map_Control::OnCompareItems(const wxTreeItemId &item1, const wxTreeIte
 //---------------------------------------------------------
 inline int CWKSP_Map_Control::_Get_Image_ID(CWKSP_Base_Item *pItem)
 {
-	if( pItem && pItem->Get_Type() == WKSP_ITEM_Map_Layer )
+	if( pItem )
 	{
-		pItem	= ((CWKSP_Map_Layer *)pItem)->Get_Layer();
+		if( pItem->Get_Type() == WKSP_ITEM_Map_Graticule )
+		{
+			return( IMG_MAP_GRATICULE );
+		}
 
-		switch( pItem->Get_Type() )
+		if( pItem->Get_Type() == WKSP_ITEM_Map_Layer )
 		{
-		default:
-			break;
+			pItem	= ((CWKSP_Map_Layer *)pItem)->Get_Layer();
 
-		case WKSP_ITEM_Shapes:
-			switch( ((CWKSP_Shapes *)pItem)->Get_Shapes()->Get_Type() )
+			switch( pItem->Get_Type() )
 			{
-			default:
-			case SHAPE_TYPE_Point:		return( IMG_SHAPES_POINT );
-			case SHAPE_TYPE_Points:		return( IMG_SHAPES_POINTS );
-			case SHAPE_TYPE_Line:		return( IMG_SHAPES_LINE );
-			case SHAPE_TYPE_Polygon:	return( IMG_SHAPES_POLYGON );
+			default:						break;
+			case WKSP_ITEM_Grid:			return( IMG_GRID );
+			case WKSP_ITEM_TIN:				return( IMG_TIN );
+			case WKSP_ITEM_PointCloud:		return( IMG_POINTCLOUD );
+			case WKSP_ITEM_Shapes:
+				switch( ((CWKSP_Shapes *)pItem)->Get_Shapes()->Get_Type() )
+				{
+				case SHAPE_TYPE_Point:		return( IMG_SHAPES_POINT );
+				case SHAPE_TYPE_Points:		return( IMG_SHAPES_POINTS );
+				case SHAPE_TYPE_Line:		return( IMG_SHAPES_LINE );
+				case SHAPE_TYPE_Polygon:	return( IMG_SHAPES_POLYGON );
+				default:	break;
+				}
 			}
-
-		case WKSP_ITEM_TIN:				return( IMG_TIN );
-		case WKSP_ITEM_PointCloud:		return( IMG_POINTCLOUD );
-		case WKSP_ITEM_Grid:			return( IMG_GRID );
 		}
 	}
 
@@ -247,22 +252,25 @@ void CWKSP_Map_Control::Add_Item(CWKSP_Base_Manager *pManager, CWKSP_Base_Item *
 }
 
 //---------------------------------------------------------
-bool CWKSP_Map_Control::Del_Item(CWKSP_Map *pMap, CWKSP_Layer *pLayer)
+bool CWKSP_Map_Control::Del_Item(CWKSP_Map *pMap, CWKSP_Base_Item *pItem)
 {
-	CWKSP_Map_Layer	*pItem;
-
-	if( pMap && (pItem = pMap->Find_Layer(pLayer)) != NULL )
+	if( pMap && pItem )
 	{
-		bool	bRefresh	= pMap->Get_Count() > 1;
+		pItem	= pItem->Get_Type() == WKSP_ITEM_Map_Layer
+				? pMap->Find_Layer(((CWKSP_Map_Layer *)pItem)->Get_Layer())
+				: pMap->Find_Layer( (CWKSP_Layer     *)pItem);
 
-		_Del_Item(pItem, true);
+		bool	bRefresh	= pMap->Get_Count() > 1;
 
-		if( bRefresh )
+		if( pItem && _Del_Item(pItem, true) )
 		{
-			pMap->View_Refresh(false);
-		}
+			if( bRefresh )
+			{
+				pMap->View_Refresh(false);
+			}
 
-		return( true );
+			return( true );
+		}
 	}
 
 	return( false );
@@ -280,7 +288,7 @@ void CWKSP_Map_Control::On_Drag_Begin(wxTreeEvent &event)
 {
 	CWKSP_Base_Item	*pItem	= (CWKSP_Base_Item *)GetItemData(event.GetItem());
 
-	if( pItem && pItem->Get_Type() == WKSP_ITEM_Map_Layer )
+	if( pItem && (pItem->Get_Type() == WKSP_ITEM_Map_Layer || pItem->Get_Type() == WKSP_ITEM_Map_Graticule) )
 	{
 		m_draggedItem	= event.GetItem();
 
@@ -291,53 +299,57 @@ void CWKSP_Map_Control::On_Drag_Begin(wxTreeEvent &event)
 //---------------------------------------------------------
 void CWKSP_Map_Control::On_Drag_End(wxTreeEvent &event)
 {
-	if( event.GetItem().IsOk() )
+	if( event.GetItem().IsOk()
+	&& (  ((CWKSP_Base_Item *)GetItemData(m_draggedItem))->Get_Type() == WKSP_ITEM_Map_Layer
+	   || ((CWKSP_Base_Item *)GetItemData(m_draggedItem))->Get_Type() == WKSP_ITEM_Map_Graticule ) )
 	{
 		CWKSP_Map		*pDst_Map, *pSrc_Map;
 		CWKSP_Base_Item	*pSrc, *pDst, *pCpy;
 
-		if( ((CWKSP_Base_Item *)GetItemData(m_draggedItem))->Get_Type() == WKSP_ITEM_Map_Layer )
+		pDst		= (CWKSP_Base_Item *)GetItemData(event.GetItem());
+		pSrc		= (CWKSP_Base_Item *)GetItemData(m_draggedItem);
+		pSrc_Map	= (CWKSP_Map *)pSrc->Get_Manager();
+
+		switch( pDst->Get_Type() )
 		{
-			pDst		= (CWKSP_Base_Item *)GetItemData(event.GetItem());
-			pSrc		= (CWKSP_Base_Item *)GetItemData(m_draggedItem);
-			pSrc_Map	= (CWKSP_Map *)pSrc->Get_Manager();
+		default:
+			pDst_Map	= NULL;
+			break;
+
+		case WKSP_ITEM_Map:
+			pDst_Map	= (CWKSP_Map *)pDst;
+			pDst		= NULL;
+			break;
+
+		case WKSP_ITEM_Map_Layer:
+		case WKSP_ITEM_Map_Graticule:
+			pDst_Map	= (CWKSP_Map *)pDst->Get_Manager();
+			break;
+		}
+
+		if( pDst_Map )
+		{
+			Freeze();
 
-			switch( pDst->Get_Type() )
+			if( pDst_Map == pSrc_Map )
 			{
-			default:
-				pDst_Map	= NULL;
-				break;
-
-			case WKSP_ITEM_Map:
-				pDst_Map	= (CWKSP_Map *)pDst;
-				pDst		= NULL;
-				break;
-
-			case WKSP_ITEM_Map_Layer:
-				pDst_Map	= (CWKSP_Map *)pDst->Get_Manager();
-				break;
-			}
+				pDst_Map->Move_To(pSrc, pDst);
 
-			if( pDst_Map )
+				pDst_Map->View_Refresh(false);
+			}
+			else if( (pCpy = pDst_Map->Add_Copy(pSrc)) != NULL )
 			{
-				if( pDst_Map == pSrc_Map )
-				{
-					pDst_Map->Move_To(pSrc, pDst);
+				pDst_Map->Move_To(pCpy, pDst);
 
-					pDst_Map->View_Refresh(false);
-				}
-				else if( (pCpy = pDst_Map->Add_Layer(((CWKSP_Map_Layer *)pSrc)->Get_Layer())) != NULL )
+				if( pCpy && !wxGetKeyState(WXK_CONTROL) )
 				{
-					pDst_Map->Move_To(pCpy, pDst);
-
-					if( pCpy && !wxGetKeyState(WXK_CONTROL) )
-					{
-						Del_Item(pSrc_Map, ((CWKSP_Map_Layer *)pSrc)->Get_Layer());
-					}
-
-					pDst_Map->View_Refresh(false);
+					Del_Item(pSrc_Map, pSrc);
 				}
+
+				pDst_Map->View_Refresh(false);
 			}
+
+			Thaw();
 		}
 	}
 
diff --git a/src/saga_core/saga_gui/wksp_map_control.h b/src/saga_core/saga_gui/wksp_map_control.h
index ddb1920..6ad9764 100644
--- a/src/saga_core/saga_gui/wksp_map_control.h
+++ b/src/saga_core/saga_gui/wksp_map_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_control.h 2066 2014-03-24 08:55:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -100,7 +100,7 @@ public:
 	bool						Close			(bool bSilent);
 
 	void						Add_Item		(class CWKSP_Base_Manager *pManager, class CWKSP_Base_Item *pItem);
-	bool						Del_Item		(class CWKSP_Map *pMap, class CWKSP_Layer *pLayer);
+	bool						Del_Item		(class CWKSP_Map *pMap             , class CWKSP_Base_Item *pItem);
 
 
 private:
diff --git a/src/saga_core/saga_gui/wksp_map_graticule.cpp b/src/saga_core/saga_gui/wksp_map_graticule.cpp
new file mode 100644
index 0000000..fd31f01
--- /dev/null
+++ b/src/saga_core/saga_gui/wksp_map_graticule.cpp
@@ -0,0 +1,625 @@
+/**********************************************************
+ * Version $Id: wksp_map_graticule.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    User Interface                     //
+//                                                       //
+//                    Program: SAGA                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                wksp_map_graticule.cpp                 //
+//                                                       //
+//          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.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include <wx/window.h>
+
+#include <saga_api/saga_api.h>
+
+#include "helper.h"
+#include "dc_helper.h"
+
+#include "res_commands.h"
+
+#include "wksp_map.h"
+#include "wksp_map_graticule.h"
+#include "wksp_map_dc.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWKSP_Map_Graticule::CWKSP_Map_Graticule(CSG_MetaData *pEntry)
+{
+	m_bShow		= true;
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode, *pNode_1;
+
+	m_Parameters.Set_Name      ("GRATICULE");
+	m_Parameters.Set_Identifier("GRATICULE");
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_GENERAL"	,_TL("General")	, _TL(""));
+
+	m_Parameters.Add_String(
+		pNode	, "NAME"		, _TL("Name"),
+		_TL(""),
+		_TL("Graticule")
+	);
+
+	pNode_1	= m_Parameters.Add_Choice(
+		pNode	, "INTERVAL"	, _TL("Interval"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("fixed interval"),
+			_TL("fitted interval")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "FIXED"		, _TL("Fixed Interval (Degree)"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 5.0, 0.0, true, 20.0
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "FITTED"		, _TL("Number of Intervals"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 5, 1, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "RESOLUTION"	, _TL("Minimum Resolution (Degree)"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.5, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "SHOW_ALWAYS"	, _TL("Show at all scales"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Range(
+		pNode_1	, "SHOW_RANGE"	, _TL("Scale Range"),
+		_TL("only show within scale range; values are given as extent measured in map units"),
+		100.0, 1000.0, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_DISPLAY"	,_TL("Display")	, _TL(""));
+
+	m_Parameters.Add_Value(
+		pNode	, "COLOR"		, _TL("Color"),
+		_TL(""),
+		PARAMETER_TYPE_Color, SG_COLOR_GREY
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "SIZE"		, _TL("Size"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 0, 0, true
+	);
+
+	m_Parameters.Add_Value(
+		pNode	, "TRANSPARENCY", _TL("Transparency [%]"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 100.0, true
+	);
+
+	m_Parameters.Add_Choice(
+		pNode	, "LINE_STYLE"	, _TL("Line Style"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("Solid style"),
+			_TL("Dotted style"),
+			_TL("Long dashed style"),
+			_TL("Short dashed style"), 
+			_TL("Dot and dash style"),
+			_TL("Backward diagonal hatch"),
+			_TL("Cross-diagonal hatch"),
+			_TL("Forward diagonal hatch"),
+			_TL("Cross hatch"),
+			_TL("Horizontal hatch"),
+			_TL("Vertical hatch")
+		//	_TL("Use the stipple bitmap")
+		//	_TL("Use the user dashes")
+		//	_TL("No pen is used")
+		), 4
+	);
+
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Value(
+		pNode	, "LABEL"		, _TL("Label"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, true
+	);
+
+	m_Parameters.Add_Font(
+		pNode_1	, "LABEL_FONT"	, _TL("Font"),
+		_TL("")
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "LABEL_SIZE"	, _TL("Size"),
+		_TL("Font size given as percentage of map size."),
+		PARAMETER_TYPE_Double, 2, 0.0, true, 10.0, true
+	);
+
+	m_Parameters.Add_Choice(
+		pNode_1	, "LABEL_EFFECT", _TL("Boundary Effect"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
+			_TL("none"),
+			_TL("full frame"),
+			_TL("top"),
+			_TL("top left"),
+			_TL("left"),
+			_TL("bottom left"),
+			_TL("bottom"),
+			_TL("bottom right"),
+			_TL("right"),
+			_TL("top right")
+		), 1
+	);
+
+	m_Parameters.Add_Value(
+		pNode_1	, "LABEL_EFFCOL", _TL("Boundary Effect Color"),
+		_TL(""),
+		PARAMETER_TYPE_Color, SG_GET_RGB(255, 255, 255)
+	);
+
+	//-----------------------------------------------------
+	if( pEntry )
+	{
+		Load(*pEntry);
+	}
+}
+
+//---------------------------------------------------------
+CWKSP_Map_Graticule::~CWKSP_Map_Graticule(void)
+{}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Map_Graticule::Load(CSG_MetaData &Entry)
+{
+	return( m_Parameters.Serialize(Entry, false) );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Map_Graticule::Save(CSG_MetaData &Entry)
+{
+	return( m_Parameters.Serialize(*Entry.Add_Child("GRATICULE"), true) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+wxString CWKSP_Map_Graticule::Get_Name(void)
+{
+	wxString	Name(m_Parameters("NAME")->asString());
+
+	if( !m_bShow )
+	{
+		return( "[" + Name + "]" );
+	}
+
+	return( Name );
+}
+
+//---------------------------------------------------------
+wxString CWKSP_Map_Graticule::Get_Description(void)
+{
+	wxString	s;
+
+	s	+= wxString::Format(wxT("<b>%s</b>"), _TL("Shapes"));
+
+	s	+= wxT("<table border=\"0\">");
+
+	//-----------------------------------------------------
+	DESC_ADD_STR(_TL("Name")			, m_Parameters("NAME")->asString());
+	DESC_ADD_STR(_TL("Projection")		, Get_Map()->Get_Projection().Get_Description().c_str());
+
+	//-----------------------------------------------------
+	s	+= wxT("</table>");
+
+	return( s );
+}
+
+//---------------------------------------------------------
+wxMenu * CWKSP_Map_Graticule::Get_Menu(void)
+{
+	wxMenu	*pMenu	= new wxMenu(m_Parameters("NAME")->asString());
+
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
+	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_LAYER_SHOW);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_TOP);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_UP);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_DOWN);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_BOTTOM);
+
+	return( pMenu );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Map_Graticule::On_Command(int Cmd_ID)
+{
+	switch( Cmd_ID )
+	{
+	default:
+		return( CWKSP_Base_Item::On_Command(Cmd_ID) );
+
+	case ID_CMD_WKSP_ITEM_RETURN:
+	case ID_CMD_MAPS_LAYER_SHOW:
+		m_bShow	= !m_bShow;
+		((wxTreeCtrl *)Get_Control())->SetItemText(GetId(), Get_Name());
+		((CWKSP_Map *)Get_Manager())->View_Refresh(true);
+		break;
+
+	case ID_CMD_MAPS_MOVE_TOP:
+		if( Get_Manager()->Move_Top(this) )
+			((CWKSP_Map *)Get_Manager())->View_Refresh(false);
+		break;
+
+	case ID_CMD_MAPS_MOVE_BOTTOM:
+		if( Get_Manager()->Move_Bottom(this) )
+			((CWKSP_Map *)Get_Manager())->View_Refresh(false);
+		break;
+
+	case ID_CMD_MAPS_MOVE_UP:
+		if( Get_Manager()->Move_Up(this) )
+			((CWKSP_Map *)Get_Manager())->View_Refresh(false);
+		break;
+
+	case ID_CMD_MAPS_MOVE_DOWN:
+		if( Get_Manager()->Move_Down(this) )
+			((CWKSP_Map *)Get_Manager())->View_Refresh(false);
+		break;
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Map_Graticule::On_Command_UI(wxUpdateUIEvent &event)
+{
+	switch( event.GetId() )
+	{
+	default:
+		return( CWKSP_Base_Item::On_Command_UI(event) );
+
+	case ID_CMD_MAPS_LAYER_SHOW:
+		event.Check(m_bShow);
+		break;
+
+	case ID_CMD_MAPS_MOVE_TOP:
+	case ID_CMD_MAPS_MOVE_UP:
+		event.Enable(Get_Index() > 0);
+		break;
+
+	case ID_CMD_MAPS_MOVE_DOWN:
+	case ID_CMD_MAPS_MOVE_BOTTOM:
+		event.Enable(Get_Index() < Get_Manager()->Get_Count() - 1);
+		break;
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CWKSP_Map_Graticule::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags)
+{
+	if( Flags & PARAMETER_CHECK_ENABLE )
+	{
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INTERVAL")) )
+		{
+			pParameters->Get_Parameter("FIXED" )->Set_Enabled(pParameter->asInt() == 0);
+			pParameters->Get_Parameter("FITTED")->Set_Enabled(pParameter->asInt() == 1);
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SHOW_ALWAYS")) )
+		{
+			pParameters->Get_Parameter("SHOW_RANGE")->Set_Enabled(pParameter->asBool() == false);
+		}
+
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LABEL")) )
+		{
+			pParameters->Get_Parameter("LABEL_FONT"  )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("LABEL_SIZE"  )->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("LABEL_EFFECT")->Set_Enabled(pParameter->asBool());
+			pParameters->Get_Parameter("LABEL_EFFCOL")->Set_Enabled(pParameter->asBool());
+		}
+	}
+
+	return( CWKSP_Base_Item::On_Parameter_Changed(pParameters, pParameter, Flags) );
+}
+
+//---------------------------------------------------------
+void CWKSP_Map_Graticule::Parameters_Changed(void)
+{
+	CWKSP_Base_Item::Parameters_Changed();
+
+	Get_Map()->View_Refresh(true);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Map_Graticule::Get_Graticule(const CSG_Rect &Extent)
+{
+	m_Graticule  .Create(SHAPE_TYPE_Line);
+	m_Coordinates.Create(SHAPE_TYPE_Point);
+
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module(SG_T("pj_proj4"), 14);
+
+	if(	pModule && Get_Map()->Get_Projection().is_Okay() )
+	{
+		CSG_Parameters	P; P.Assign(pModule->Get_Parameters());
+
+		pModule->Set_Manager(NULL);
+
+		SG_UI_Msg_Lock     (true);
+		SG_UI_Progress_Lock(true);
+
+		if( pModule->Get_Parameters()->Set_Parameter("XMIN"      , Extent.Get_XMin())
+		&&  pModule->Get_Parameters()->Set_Parameter("XMAX"      , Extent.Get_XMax())
+		&&  pModule->Get_Parameters()->Set_Parameter("YMIN"      , Extent.Get_YMin())
+		&&  pModule->Get_Parameters()->Set_Parameter("YMAX"      , Extent.Get_YMax())
+		&&  pModule->Get_Parameters()->Set_Parameter("INTERVAL"  , m_Parameters("INTERVAL"))
+		&&  pModule->Get_Parameters()->Set_Parameter("FIXED"     , m_Parameters("FIXED"))
+		&&  pModule->Get_Parameters()->Set_Parameter("FITTED"    , m_Parameters("FITTED"))
+		&&  pModule->Get_Parameters()->Set_Parameter("RESOLUTION", m_Parameters("RESOLUTION"))
+		&&  pModule->Get_Parameters()->Set_Parameter("GRATICULE" , &m_Graticule)
+		&&  pModule->Get_Parameters()->Set_Parameter("COORDS"    , &m_Coordinates)
+		&&  pModule->Get_Parameters()->Set_Parameter("CRS_PROJ4" , Get_Map()->Get_Projection().Get_Proj4())
+		&&  pModule->On_Before_Execution() && pModule->Execute() )
+		{
+			SG_UI_Msg_Lock     (false);
+			SG_UI_Progress_Lock(false);
+
+			pModule->Get_Parameters()->Assign_Values(&P);
+			pModule->Set_Manager(P.Get_Manager());
+
+			return( true );
+		}
+
+		SG_UI_Progress_Lock(false);
+
+		pModule->Get_Parameters()->Assign_Values(&P);
+		pModule->Set_Manager(P.Get_Manager());
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWKSP_Map_Graticule::Draw(CWKSP_Map_DC &dc_Map)
+{
+	if( !Get_Graticule(dc_Map.m_rWorld) || m_Graticule.Get_Count() <= 0 )
+	{
+		return( false );
+	}
+
+	if( !m_Parameters("SHOW_ALWAYS")->asBool() )
+	{
+		CSG_Parameter_Range	*pRange	= m_Parameters("SHOW_RANGE")->asRange();
+		double	dRange	= dc_Map.m_rWorld.Get_XRange() > dc_Map.m_rWorld.Get_YRange() ? dc_Map.m_rWorld.Get_XRange() : dc_Map.m_rWorld.Get_YRange();
+
+		if( dRange < pRange->Get_LoVal() || pRange->Get_HiVal() < dRange )
+		{
+			return( false );
+		}
+	}
+
+	//-----------------------------------------------------
+	CWKSP_Map_DC	*pDC	= m_Parameters("TRANSPARENCY")->asDouble() > 0.0 ? new CWKSP_Map_DC(dc_Map.m_rWorld, dc_Map.m_rDC, dc_Map.m_Scale, SG_GET_RGB(255, 255, 255)) : NULL;
+	CWKSP_Map_DC	&dc		= pDC ? *pDC : dc_Map;
+
+	//-----------------------------------------------------
+	wxPen	Pen(m_Parameters("COLOR")->asColor(), m_Parameters("SIZE")->asInt());
+
+	switch( m_Parameters("LINE_STYLE")->asInt() )
+	{
+	default:
+	case  0:	Pen.SetStyle(wxSOLID           );	break; // Solid style.
+	case  1:	Pen.SetStyle(wxDOT             );	break; // Dotted style.
+	case  2:	Pen.SetStyle(wxLONG_DASH       );	break; // Long dashed style.
+	case  3:	Pen.SetStyle(wxSHORT_DASH      );	break; // Short dashed style.
+	case  4:	Pen.SetStyle(wxDOT_DASH        );	break; // Dot and dash style.
+	case  5:	Pen.SetStyle(wxBDIAGONAL_HATCH );	break; // Backward diagonal hatch.
+	case  6:	Pen.SetStyle(wxCROSSDIAG_HATCH );	break; // Cross-diagonal hatch.
+	case  7:	Pen.SetStyle(wxFDIAGONAL_HATCH );	break; // Forward diagonal hatch.
+	case  8:	Pen.SetStyle(wxCROSS_HATCH     );	break; // Cross hatch.
+	case  9:	Pen.SetStyle(wxHORIZONTAL_HATCH);	break; // Horizontal hatch.
+	case 10:	Pen.SetStyle(wxVERTICAL_HATCH  );	break; // Vertical hatch.
+//	case 11:	Pen.SetStyle(wxSTIPPLE         );	break; // Use the stipple bitmap. 
+//	case 12:	Pen.SetStyle(wxUSER_DASH       );	break; // Use the user dashes: see wxPen::SetDashes.
+//	case 13:	Pen.SetStyle(wxTRANSPARENT     );	break; // No pen is used.
+	}
+
+	dc.dc.SetPen(Pen);
+
+	//-----------------------------------------------------
+	for(int iLine=0; iLine<m_Graticule.Get_Count(); iLine++)
+	{
+		CSG_Shape	*pLine	= m_Graticule.Get_Shape(iLine);
+
+		for(int iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
+		{
+			if( pLine->Get_Point_Count(iPart) > 1 )
+			{
+				TSG_Point_Int	B, A	= dc.World2DC(pLine->Get_Point(0, iPart));
+
+				for(int iPoint=1; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+				{
+					B		= A;
+					A		= dc.World2DC(pLine->Get_Point(iPoint, iPart));
+
+					dc.dc.DrawLine(A.x, A.y, B.x, B.y);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( m_Parameters("LABEL")->asBool() )
+	{
+		int	Size	= (int)(0.5 + 0.01 * m_Parameters("LABEL_SIZE")->asDouble()
+		*	( dc.m_rDC.GetWidth() < dc.m_rDC.GetHeight()
+			? dc.m_rDC.GetWidth() : dc.m_rDC.GetHeight() )
+		);
+
+		if( Size > 2 )
+		{
+			int			Effect;
+			wxColour	Effect_Color	= Get_Color_asWX(m_Parameters("LABEL_EFFCOL")->asInt());
+			wxFont		Font	= Get_Font(m_Parameters("LABEL_FONT"));
+
+			Font.SetPointSize(Size);
+
+			dc.dc.SetFont(Font);
+			dc.dc.SetTextForeground(m_Parameters("LABEL_FONT")->asColor());
+
+			switch( m_Parameters("LABEL_EFFECT")->asInt() )
+			{
+			default:	Effect	= TEXTEFFECT_NONE;			break;
+			case 1:		Effect	= TEXTEFFECT_FRAME;			break;
+			case 2:		Effect	= TEXTEFFECT_TOP;			break;
+			case 3:		Effect	= TEXTEFFECT_TOPLEFT;		break;
+			case 4:		Effect	= TEXTEFFECT_LEFT;			break;
+			case 5:		Effect	= TEXTEFFECT_BOTTOMLEFT;	break;
+			case 6:		Effect	= TEXTEFFECT_BOTTOM;		break;
+			case 7:		Effect	= TEXTEFFECT_BOTTOMRIGHT;	break;
+			case 8:		Effect	= TEXTEFFECT_RIGHT;			break;
+			case 9:		Effect	= TEXTEFFECT_TOPRIGHT;		break;
+			}
+
+			for(int iPoint=0; iPoint<m_Coordinates.Get_Count(); iPoint++)
+			{
+				CSG_Shape	*pPoint	= m_Coordinates.Get_Shape(iPoint);
+
+				TSG_Point_Int	p(dc.World2DC(pPoint->Get_Point(0)));
+				wxString		Type(pPoint->asString(0));
+
+				int	Align	= !Type.Cmp("LAT_MIN") ? TEXTALIGN_CENTERLEFT
+							: !Type.Cmp("LAT_MAX") ? TEXTALIGN_CENTERRIGHT
+							: !Type.Cmp("LON_MIN") ? TEXTALIGN_BOTTOMCENTER
+							: !Type.Cmp("LON_MAX") ? TEXTALIGN_TOPCENTER
+							: TEXTALIGN_CENTER;
+
+				Draw_Text(dc.dc, Align, p.x, p.y, 0.0, pPoint->asString(1), Effect, Effect_Color);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( pDC )
+	{
+		dc_Map.Draw_DC(dc, m_Parameters("TRANSPARENCY")->asDouble() / 100.0);
+
+		delete(pDC);
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_map_graticule.h b/src/saga_core/saga_gui/wksp_map_graticule.h
new file mode 100644
index 0000000..3702993
--- /dev/null
+++ b/src/saga_core/saga_gui/wksp_map_graticule.h
@@ -0,0 +1,131 @@
+/**********************************************************
+ * Version $Id: wksp_map_graticule.h 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    User Interface                     //
+//                                                       //
+//                    Program: SAGA                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 wksp_map_graticule.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.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef _HEADER_INCLUDED__SAGA_GUI__wksp_map_graticule_H
+#define _HEADER_INCLUDED__SAGA_GUI__wksp_map_graticule_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "wksp_base_item.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CWKSP_Map_Graticule : public CWKSP_Base_Item
+{
+public:
+	CWKSP_Map_Graticule(CSG_MetaData *pEntry = NULL);
+	virtual ~CWKSP_Map_Graticule(void);
+
+	virtual TWKSP_Item			Get_Type				(void)	{	return( WKSP_ITEM_Map_Graticule );	}
+
+	virtual wxString			Get_Name				(void);
+	virtual wxString			Get_Description			(void);
+
+	virtual wxMenu *			Get_Menu				(void);
+
+	virtual bool				On_Command				(int Cmd_ID);
+	virtual bool				On_Command_UI			(wxUpdateUIEvent &event);
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
+	virtual void				Parameters_Changed		(void);
+
+	bool						do_Show					(void)	{	return( m_bShow );	}
+
+	class CWKSP_Map *			Get_Map					(void)	{	return( (class CWKSP_Map *)Get_Manager() );	}
+
+	bool						Draw					(class CWKSP_Map_DC &dc);
+
+	bool						Load					(CSG_MetaData &Entry);
+	bool						Save					(CSG_MetaData &Entry);
+
+
+private:
+
+	bool						m_bShow;
+
+	CSG_Shapes					m_Graticule, m_Coordinates;
+
+
+	bool						Get_Graticule			(const CSG_Rect &Extent);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__wksp_map_graticule_H
diff --git a/src/saga_core/saga_gui/wksp_map_layer.cpp b/src/saga_core/saga_gui/wksp_map_layer.cpp
index fdfdff2..8569cf9 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_layer.cpp 1985 2014-02-11 17:00:31Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,9 +90,7 @@ CWKSP_Map_Layer::CWKSP_Map_Layer(CWKSP_Layer *pLayer)
 
 //---------------------------------------------------------
 CWKSP_Map_Layer::~CWKSP_Map_Layer(void)
-{
-	((CWKSP_Map *)Get_Manager())->On_Delete(this);
-}
+{}
 
 
 ///////////////////////////////////////////////////////////
@@ -163,6 +161,16 @@ bool CWKSP_Map_Layer::On_Command(int Cmd_ID)
 	default:
 		return( CWKSP_Base_Item::On_Command(Cmd_ID) );
 
+	case ID_CMD_SHAPES_EDIT_SHAPE:
+	case ID_CMD_SHAPES_EDIT_ADD_SHAPE:
+	case ID_CMD_SHAPES_EDIT_DEL_SHAPE:
+	case ID_CMD_SHAPES_EDIT_ADD_PART:
+	case ID_CMD_SHAPES_EDIT_DEL_PART:
+	case ID_CMD_SHAPES_EDIT_DEL_POINT:
+	case ID_CMD_SHAPES_EDIT_SEL_CLEAR:
+	case ID_CMD_SHAPES_EDIT_SEL_INVERT:
+		return( m_pLayer->On_Command(Cmd_ID) );
+
 	case ID_CMD_WKSP_ITEM_RETURN:
 	case ID_CMD_MAPS_LAYER_SHOW:
 		m_bShow	= !m_bShow;
@@ -207,6 +215,16 @@ bool CWKSP_Map_Layer::On_Command_UI(wxUpdateUIEvent &event)
 	default:
 		return( CWKSP_Base_Item::On_Command_UI(event) );
 
+	case ID_CMD_SHAPES_EDIT_SHAPE:
+	case ID_CMD_SHAPES_EDIT_ADD_SHAPE:
+	case ID_CMD_SHAPES_EDIT_DEL_SHAPE:
+	case ID_CMD_SHAPES_EDIT_ADD_PART:
+	case ID_CMD_SHAPES_EDIT_DEL_PART:
+	case ID_CMD_SHAPES_EDIT_DEL_POINT:
+	case ID_CMD_SHAPES_EDIT_SEL_CLEAR:
+	case ID_CMD_SHAPES_EDIT_SEL_INVERT:
+		return( m_pLayer->On_Command_UI(event) );
+
 	case ID_CMD_MAPS_LAYER_SHOW:
 		event.Check(m_bShow);
 		break;
diff --git a/src/saga_core/saga_gui/wksp_map_manager.cpp b/src/saga_core/saga_gui/wksp_map_manager.cpp
index c938fb7..1dea1d9 100644
--- a/src/saga_core/saga_gui/wksp_map_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_map_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_manager.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_manager.cpp 2006 2014-02-20 13:52:10Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -69,6 +69,8 @@
 #include "helper.h"
 
 #include "wksp_data_manager.h"
+#include "wksp_map_buttons.h"
+
 #include "wksp_layer.h"
 
 #include "wksp_map_control.h"
@@ -98,118 +100,104 @@ CWKSP_Map_Manager::CWKSP_Map_Manager(void)
 {
 	g_pMaps		= this;
 
-	///////////////////////////////////////////////////////
 	//-----------------------------------------------------
-	bool			bValue;
-	double			dValue;
-	long			lValue;
-	CSG_Parameter	*pNode_0, *pNode_1;
-
-	m_Parameters.Create(this, _TL(""), _TL(""));
+	CSG_Parameter	*pNode, *pNode_1;
 
 	//-----------------------------------------------------
-	pNode_0	= m_Parameters.Add_Node(
-		NULL	, "NODE_DEFAULTS"	, _TL("Defaults"),
-		_TL("")
-	);
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_DEFAULTS", _TL("Defaults for New Maps"), _TL(""));
 
 	m_Parameters.Add_Value(
-		pNode_0	, "GOTO_NEWLAYER"	, _TL("Zoom to added layer"),
+		pNode	, "GOTO_NEWLAYER"	, _TL("Zoom to added layer"),
 		_TL(""),
-		PARAMETER_TYPE_Bool,
-		CONFIG_Read(wxT("/MAPS"), wxT("GOTO_NEWLAYER"), bValue) ? bValue : true
+		PARAMETER_TYPE_Bool, true
 	);
 
 	m_Parameters.Add_Value(
-		pNode_0	, "SCALE_BAR"		, _TL("Show Scale Bar"),
+		pNode	, "SCALE_BAR"		, _TL("Show Scale Bar"),
 		_TL(""),
-		PARAMETER_TYPE_Bool,
-		CONFIG_Read(wxT("/MAPS"), wxT("SCALE_BAR"), bValue) ? bValue : true
+		PARAMETER_TYPE_Bool, true
 	);
 
 	//-----------------------------------------------------
-	pNode_1	= m_Parameters.Add_Node(
-		pNode_0	, "NODE_FRAME"		, _TL("Frame"),
-		_TL("")
-	);
+	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_FRAME", _TL("Frame"), _TL(""));
 
 	m_Parameters.Add_Value(
 		pNode_1	, "FRAME_SHOW"		, _TL("Show"),
 		_TL(""),
-		PARAMETER_TYPE_Bool,
-		CONFIG_Read(wxT("/MAPS"), wxT("FRAME_SHOW"), bValue) ? bValue : true
+		PARAMETER_TYPE_Bool, true
 	);
 
 	m_Parameters.Add_Value(
 		pNode_1	, "FRAME_WIDTH"		, _TL("Width"),
 		_TL(""),
-		PARAMETER_TYPE_Int,
-		CONFIG_Read(wxT("/MAPS"), wxT("FRAME_WIDTH"), lValue) ? lValue : 17,
-		5, true
+		PARAMETER_TYPE_Int, 17, 5, true
 	);
 
 	//-----------------------------------------------------
-	pNode_1	= m_Parameters.Add_Node(
-		pNode_0	, "NODE_CLIPBOARD"	, _TL("Clipboard"),
-		_TL("")
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_CLIPBOARD", _TL("Clipboard"), _TL(""));
+
+	m_Parameters.Add_Value(
+		pNode	, "CLIP_NX"			, _TL("Width"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 400, 10, true
 	);
 
 	m_Parameters.Add_Value(
-		pNode_1	, "CLIP_NX"			, _TL("Width"),
+		pNode	, "CLIP_NY"			, _TL("Height"),
 		_TL(""),
-		PARAMETER_TYPE_Int,
-		CONFIG_Read(wxT("/MAPS"), wxT("CLIP_NX"), lValue) ? lValue : 400
+		PARAMETER_TYPE_Int, 400, 10, true
 	);
 
 	m_Parameters.Add_Value(
-		pNode_1	, "CLIP_NY"			, _TL("Height"),
+		pNode	, "CLIP_FRAME"		, _TL("Frame Width"),
 		_TL(""),
-		PARAMETER_TYPE_Int,
-		CONFIG_Read(wxT("/MAPS"), wxT("CLIP_NY"), lValue) ? lValue : 400
+		PARAMETER_TYPE_Int, 17, 0, true
 	);
 
+	//-----------------------------------------------------
+	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_CLIP_LEGEND", _TL("Legend"), _TL(""));
+
 	m_Parameters.Add_Value(
-		pNode_1	, "CLIP_FRAME"		, _TL("Frame Width"),
+		pNode_1	, "CLIP_LEGEND_SCALE", _TL("Scale"),
 		_TL(""),
-		PARAMETER_TYPE_Int,
-		CONFIG_Read(wxT("/MAPS"), wxT("CLIP_FRAME"), lValue) ? lValue : 17,
-		0, true
+		PARAMETER_TYPE_Double, 2.0, 1.0, true
 	);
 
 	m_Parameters.Add_Value(
-		pNode_1	, "CLIP_LEGEND_SCALE", _TL("Legend Scale"),
+		pNode_1	, "CLIP_LEGEND_FRAME", _TL("Frame Width"),
 		_TL(""),
-		PARAMETER_TYPE_Double,
-		CONFIG_Read(wxT("/MAPS"), wxT("CLIP_LEGEND_SCALE"), dValue) ? dValue : 2.0,
-		1.0, true
+		PARAMETER_TYPE_Int, 10, 0, true
 	);
 
 	m_Parameters.Add_Value(
-		pNode_1	, "CLIP_LEGEND_FRAME", _TL("Legend Frame Width"),
+		pNode_1	, "CLIP_LEGEND_COLOR", _TL("Border Color"),
 		_TL(""),
-		PARAMETER_TYPE_Int,
-		CONFIG_Read(wxT("/MAPS"), wxT("CLIP_LEGEND_FRAME"), lValue) ? lValue : 10,
-		0, true
+		PARAMETER_TYPE_Color, SG_GET_RGB(0, 0, 0)
 	);
 
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_THUMBNAILS", _TL("Thumbnails"), _TL(""));
+
 	m_Parameters.Add_Value(
-		pNode_1	, "CLIP_LEGEND_COLOR", _TL("Legend Border Colour"),
+		pNode	, "THUMBNAIL_SIZE"		, _TL("Thumbnail Size"),
 		_TL(""),
-		PARAMETER_TYPE_Color,
-		CONFIG_Read(wxT("/MAPS"), wxT("CLIP_LEGEND_COLOR"), lValue) ? lValue : SG_GET_RGB(0, 0, 0)
+		PARAMETER_TYPE_Int, 75, 10, true
 	);
+
+	m_Parameters.Add_Value(
+		pNode	, "THUMBNAIL_SELCOLOR"	, _TL("Selection Color"),
+		_TL(""),
+		PARAMETER_TYPE_Color, Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW))
+	);
+
+	//-----------------------------------------------------
+	CONFIG_Read("/MAPS", &m_Parameters);
 }
 
 //---------------------------------------------------------
 CWKSP_Map_Manager::~CWKSP_Map_Manager(void)
 {
-	CONFIG_Write(wxT("/MAPS"), wxT("GOTO_NEWLAYER"),       m_Parameters("GOTO_NEWLAYER")->asBool());
-	CONFIG_Write(wxT("/MAPS"), wxT("SCALE_BAR"    ),       m_Parameters("SCALE_BAR"    )->asBool());
-	CONFIG_Write(wxT("/MAPS"), wxT("FRAME_SHOW"   ),       m_Parameters("FRAME_SHOW"   )->asBool());
-	CONFIG_Write(wxT("/MAPS"), wxT("FRAME_WIDTH"  ), (long)m_Parameters("FRAME_WIDTH"  )->asInt());
-	CONFIG_Write(wxT("/MAPS"), wxT("CLIP_NX"      ), (long)m_Parameters("CLIP_NX"      )->asInt());
-	CONFIG_Write(wxT("/MAPS"), wxT("CLIP_NY"      ), (long)m_Parameters("CLIP_NY"      )->asInt());
-	CONFIG_Write(wxT("/MAPS"), wxT("CLIP_FRAME"   ), (long)m_Parameters("CLIP_FRAME"   )->asInt());
+	CONFIG_Write("/MAPS", &m_Parameters);
 
 	g_pMaps		= NULL;
 }
@@ -284,6 +272,21 @@ bool CWKSP_Map_Manager::On_Command(int Cmd_ID)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CWKSP_Map_Manager::Parameters_Changed(void)
+{
+	g_pMap_Buttons->Update_Buttons();
+
+	CWKSP_Base_Manager::Parameters_Changed();
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 bool CWKSP_Map_Manager::Exists(CWKSP_Map *pMap)
 {
 	if( pMap )
@@ -307,6 +310,21 @@ bool CWKSP_Map_Manager::Close(bool bSilent)
 }
 
 //---------------------------------------------------------
+bool CWKSP_Map_Manager::Add(CWKSP_Map *pMap)
+{
+	if( pMap )
+	{
+		if( !Exists(pMap) )
+		{
+			Add_Item(pMap);
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
 bool CWKSP_Map_Manager::Add(CWKSP_Layer *pLayer)
 {
 	int		iMap;
diff --git a/src/saga_core/saga_gui/wksp_map_manager.h b/src/saga_core/saga_gui/wksp_map_manager.h
index 9260daf..1a0109e 100644
--- a/src/saga_core/saga_gui/wksp_map_manager.h
+++ b/src/saga_core/saga_gui/wksp_map_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_manager.h 2006 2014-02-20 13:52:10Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,25 +90,28 @@ public:
 	CWKSP_Map_Manager(void);
 	virtual ~CWKSP_Map_Manager(void);
 
-	virtual TWKSP_Item			Get_Type		(void)		{	return( WKSP_ITEM_Map_Manager );	}
+	virtual TWKSP_Item			Get_Type			(void)		{	return( WKSP_ITEM_Map_Manager );	}
 
-	virtual wxString			Get_Name		(void);
-	virtual wxString			Get_Description	(void);
+	virtual wxString			Get_Name			(void);
+	virtual wxString			Get_Description		(void);
 
-	virtual wxMenu *			Get_Menu		(void);
+	virtual wxMenu *			Get_Menu			(void);
 
-	virtual bool				On_Command		(int Cmd_ID);
+	virtual bool				On_Command			(int Cmd_ID);
 
-	class CWKSP_Map *			Get_Map			(int i)		{	return( (class CWKSP_Map *)Get_Item(i) );	}
+	virtual void				Parameters_Changed	(void);
 
-	bool						Exists			(class CWKSP_Map *pMap);
+	class CWKSP_Map *			Get_Map				(int i)		{	return( (class CWKSP_Map *)Get_Item(i) );	}
 
-	bool						Close			(bool bSilent);
+	bool						Exists				(class CWKSP_Map *pMap);
 
-	bool						Add				(class CWKSP_Layer *pLayer);
-	bool						Add				(class CWKSP_Layer *pLayer, class CWKSP_Map *pMap);
-	bool						Del				(class CWKSP_Layer *pLayer);
-	bool						Update			(class CWKSP_Layer *pLayer, bool bMapsOnly);
+	bool						Close				(bool bSilent);
+
+	bool						Add					(class CWKSP_Map   *pMap);
+	bool						Add					(class CWKSP_Layer *pLayer);
+	bool						Add					(class CWKSP_Layer *pLayer, class CWKSP_Map *pMap);
+	bool						Del					(class CWKSP_Layer *pLayer);
+	bool						Update				(class CWKSP_Layer *pLayer, bool bMapsOnly);
 
 
 private:
diff --git a/src/saga_core/saga_gui/wksp_module.cpp b/src/saga_core/saga_gui/wksp_module.cpp
index e1faa10..c4d993e 100644
--- a/src/saga_core/saga_gui/wksp_module.cpp
+++ b/src/saga_core/saga_gui/wksp_module.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_module.cpp 2102 2014-04-19 16:29:45Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -194,7 +194,7 @@ wxMenu * CWKSP_Module::Get_Menu(void)
 
 	pMenu	= new wxMenu(Get_Name());
 
-	pMenu->AppendCheckItem(Get_Menu_ID(), _TL("Execute"), _TL("Execute Module"));
+	pMenu->AppendCheckItem(Get_Menu_ID(), _TL("Execute"), _TL("Execute Tool"));
 
 	pMenu->AppendSeparator();
 
@@ -308,31 +308,57 @@ void CWKSP_Module::_Save_Script(void)
 		}
 		else if( SG_File_Cmp_Extension(FileName, SG_T("py" )) )
 		{
-			Command	+= SG_T("# Python script template for SAGA module execution (automatically created, experimental)\n\n");
+			#ifndef _SAGA_MSW
+			Command	+= SG_T("#! /usr/bin/env python\n");
+			#endif
+			Command	+= SG_T("# Python script template for SAGA tool execution (automatically created, experimental)\n\n");
 			Command	+= SG_T("import saga_api, sys, os\n");
 			Command	+= SG_T("\n");
-			Command	+= SG_T("def Call_SAGA_Module(in__grid, out_grid, in__shapes, out_shapes):\n");
-			Command	+= SG_T("    print saga_api.SAGA_API_Get_Version()\n");
+			Command	+= SG_T("##########################################\n");
+			Command	+= SG_T("def Call_SAGA_Module(fDEM):            # pass your input file(s) here\n");
 			Command	+= SG_T("\n");
-			Command	+= SG_T("    Library = saga_api.CSG_Module_Library()\n");
-			Command	+= SG_T("    if Library.Create(saga_api.CSG_String('");
-			Command	+= ((CWKSP_Module_Library *)Get_Manager())->Get_File_Name().wc_str();
-			Command	+= SG_T("')) == 0:\n");
-			Command	+= SG_T("        print 'unable to load SAGA module library'\n");
+			Command	+= SG_T("    # ------------------------------------\n");
+			Command	+= SG_T("    # initialize input dataset(s)\n");
+			Command	+= SG_T("    dem    = saga_api.SG_Get_Data_Manager().Add_Grid(unicode(fDEM))\n");
+			Command	+= SG_T("    if dem == None or dem.is_Valid() == 0:\n");
+			Command	+= SG_T("        print 'ERROR: loading grid [' + fDEM + ']'\n");
 			Command	+= SG_T("        return 0\n");
 			Command	+= SG_T("\n");
+			Command	+= SG_T("    # ------------------------------------\n");
+			Command	+= SG_T("    # initialize output dataset(s)\n");
+			Command	+= SG_T("    outgrid = saga_api.SG_Get_Data_Manager().Add_Grid(dem.Get_System())\n");
+			Command	+= SG_T("\n");
+			Command	+= SG_T("    # ------------------------------------\n");
+			Command	+= SG_T("    # call module\n");
+//			Command	+= SG_T("    Library = saga_api.CSG_Module_Library()\n");
+//			Command	+= SG_T("    if Library.Create(saga_api.CSG_String('");
+//			Command	+= ((CWKSP_Module_Library *)Get_Manager())->Get_File_Name().wc_str();
+//			Command	+= SG_T("')) == 0:\n");
+//			Command	+= SG_T("        print 'unable to load SAGA tool library'\n");
+//			Command	+= SG_T("        return 0\n");
+//			Command	+= SG_T("\n");
 
-			switch( m_pModule->Get_Type() )
+			#ifdef _SAGA_MSW
+			Command	+= CSG_String::Format(SG_T("    Module = saga_api.SG_Get_Module_Library_Manager().Get_Module('%s','%s')\n"), SG_File_Get_Name(((CWKSP_Module_Library *)Get_Manager())->Get_File_Name(), false).c_str(), m_pModule->Get_Name().c_str());
+			#else
+			Command	+= CSG_String::Format(SG_T("    Module = saga_api.SG_Get_Module_Library_Manager().Get_Module('%s','%s')\n"), SG_File_Get_Name(((CWKSP_Module_Library *)Get_Manager())->Get_File_Name(), false).Remove(0, 3).c_str(), m_pModule->Get_Name().c_str());
+			#endif
+
+			if( m_pModule->Get_Type() )
+			{
+				Command	+= SG_T("    Module.Get_Parameters().Get_Grid_System().Assign(dem.Get_System())\n");
+			}
+/*			switch( m_pModule->Get_Type() )
 			{
 			default:
-				Command	+= CSG_String::Format(SG_T("    Module = Library.Get_Module('%s')\n")		, m_pModule->Get_Name().c_str());
+				Command	+= CSG_String::Format(SG_T("    Module = saga_api.SG_Get_Module_Library_Manager().Get_Module('%s')\n")		, m_pModule->Get_Name().c_str());
 				break;
 
 			case MODULE_TYPE_Grid:
-				Command	+= CSG_String::Format(SG_T("    Module = Library.Get_Module_Grid('%s')\n")	, m_pModule->Get_Name().c_str());
-				Command	+= SG_T("    Module.Get_System().Assign(in__grid.Get_System())\n");
+				Command	+= CSG_String::Format(SG_T("    Module = saga_api.SG_Get_Module_Library_Manager().Get_Module_Grid('%s')\n")	, m_pModule->Get_Name().c_str());
+				Command	+= SG_T("    Module.Get_Parameters().Get_Grid_System().Assign(dem.Get_System())\n");
 				break;
-			}
+			}*/
 
 			Command	+= SG_T("\n");
 			Command	+= SG_T("    Parms = Module.Get_Parameters() # default parameter list\n");
@@ -347,25 +373,62 @@ void CWKSP_Module::_Save_Script(void)
 
 			Command	+= SG_T("\n");
 			Command	+= SG_T("    if Module.Execute() == 0:\n");
-			Command	+= SG_T("        print 'module execution failed'\n");
+			Command	+= SG_T("        print 'Module execution failed!'\n");
 			Command	+= SG_T("        return 0\n");
-			Command	+= SG_T("    print 'module successfully executed'\n");
+			Command	+= SG_T("\n");
+			Command	+= SG_T("\n");
+			Command	+= SG_T("    print\n");
+			Command	+= SG_T("    print 'The module has been executed.'\n");
+			Command	+= SG_T("    print 'Now you would like to save your output datasets, please edit the script to do so.'\n");
+			Command	+= SG_T("    return 0                           # remove this line once you have edited the script\n");
+			Command	+= SG_T("\n");
+			Command	+= SG_T("\n");
+			Command	+= SG_T("    # ------------------------------------\n");
+			Command	+= SG_T("    # save results\n");
+			Command	+= SG_T("    path   = os.path.split(fDEM)[0]\n");
+			Command	+= SG_T("    if path == '':\n");
+			Command	+= SG_T("        path = './'\n");
+			Command	+= SG_T("    outgrid.Save(saga_api.CSG_String(path + '/outgrid'))\n");
+			Command	+= SG_T("\n");
+			Command	+= SG_T("    print\n");
+			Command	+= SG_T("    print 'Module successfully executed!'\n");
 			Command	+= SG_T("    return 1\n");
 			Command	+= SG_T("\n");
 			Command	+= SG_T("\n");
+			Command	+= SG_T("##########################################\n");
 			Command	+= SG_T("if __name__ == '__main__':\n");
-			Command	+= SG_T("    if len( sys.argv ) != 4:\n");
-			Command	+= SG_T("        print 'Usage: this_script.py <in: gridfile> <out: gridfile> <in: shapefile> <out: shapefile>'\n");
-			Command	+= SG_T("\n");
-			Command	+= SG_T("    else:\n");
-			Command	+= SG_T("        in__grid    = saga_api.SG_Create_Grid(saga_api.CSG_String(sys.argv[1]))\n");
-			Command	+= SG_T("        out_grid    = saga_api.SG_Create_Grid(grid_in.Get_System())\n");
-			Command	+= SG_T("        in__shapes  = saga_api.SG_Create_Shapes(saga_api.CSG_String(sys.argv[3]))\n");
-			Command	+= SG_T("        out_shapes  = saga_api.SG_Create_Shapes()\n");
+			Command	+= SG_T("    print 'Python - Version ' + sys.version\n");
+			Command	+= SG_T("    print saga_api.SAGA_API_Get_Version()\n");
+			Command	+= SG_T("    print\n");
+			Command	+= CSG_String::Format(SG_T("    print 'Usage: %s <in: filename>'\n"), FileName.wc_str());
+			Command	+= SG_T("    print\n");
+			Command	+= SG_T("    print 'This is a simple template, please edit the script and add the necessary input and output file(s)!'\n");
+			Command	+= SG_T("    print 'We will exit the script for now.'\n");
+			Command	+= SG_T("    sys.exit()                         # remove this line once you have edited the script\n");
+			Command	+= SG_T("    # This might look like this:\n");
+			Command	+= SG_T("    # fDEM    = sys.argv[1]\n");
+			Command	+= SG_T("    # if os.path.split(fDEM)[0] == '':\n");
+			Command	+= SG_T("    #    fDEM    = './' + fDEM\n");
+			Command	+= SG_T("    fDEM = './../test_data/test.sgrd'  # remove this line once you have edited the script\n");
+			Command	+= SG_T("\n\n");
+			Command	+= SG_T("    saga_api.SG_UI_Msg_Lock(1)\n");
+			Command	+= SG_T("    if os.name == 'nt':    # Windows\n");
+			Command	+= SG_T("        os.environ['PATH'] = os.environ['PATH'] + ';' + os.environ['SAGA'] + '/bin/saga_vc_Win32/dll'\n");
+			Command	+= SG_T("        saga_api.SG_Get_Module_Library_Manager().Add_Directory(os.environ['SAGA'] + '/bin/saga_vc_Win32/modules', 0)\n");
+			Command	+= SG_T("    else:                  # Linux\n");
+			Command	+= SG_T("        saga_api.SG_Get_Module_Library_Manager().Add_Directory(os.environ['SAGA_MLB'], 0)\n");
+			Command	+= SG_T("    saga_api.SG_UI_Msg_Lock(0)\n");
 			Command	+= SG_T("\n");
-			Command	+= SG_T("        if Call_SAGA_Module(in__grid, out_grid, in__shapes, out_shapes) != 0:\n");
-			Command	+= SG_T("            grid_out  .Save(saga_api.CSG_String(sys.argv[2]))\n");
-			Command	+= SG_T("            shapes_out.Save(saga_api.CSG_String(sys.argv[4]))\n");
+			Command	+= SG_T("    Call_SAGA_Module(fDEM)             # pass your input file(s) here\n");
+//			Command	+= SG_T("    else:\n");
+//			Command	+= SG_T("        in__grid    = saga_api.SG_Create_Grid(saga_api.CSG_String(sys.argv[1]))\n");
+//			Command	+= SG_T("        out_grid    = saga_api.SG_Create_Grid(grid_in.Get_System())\n");
+//			Command	+= SG_T("        in__shapes  = saga_api.SG_Create_Shapes(saga_api.CSG_String(sys.argv[3]))\n");
+//			Command	+= SG_T("        out_shapes  = saga_api.SG_Create_Shapes()\n");
+//			Command	+= SG_T("\n");
+//			Command	+= SG_T("        if Call_SAGA_Module(in__grid, out_grid, in__shapes, out_shapes) != 0:\n");
+//			Command	+= SG_T("            grid_out  .Save(saga_api.CSG_String(sys.argv[2]))\n");
+//			Command	+= SG_T("            shapes_out.Save(saga_api.CSG_String(sys.argv[4]))\n");
 		}
 
 		if( File.Open(&FileName, SG_FILE_W, false) && Command.Length() > 0 )
@@ -495,43 +558,43 @@ void CWKSP_Module::_Save_Script_Python(CSG_String &Command, CSG_Parameters *pPar
 			break;
 
 		case PARAMETER_TYPE_Bool:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(%d)\n"), p->Get_Identifier(), p->asBool() ? 1 : 0);
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(%d)\n"), p->Get_Identifier(), p->asBool() ? 1 : 0);
 			break;
 
 		case PARAMETER_TYPE_Int:
 		case PARAMETER_TYPE_Choice:
 		case PARAMETER_TYPE_Table_Field:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(%d)\n"), p->Get_Identifier(), p->asInt());
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(%d)\n"), p->Get_Identifier(), p->asInt());
 			break;
 
 		case PARAMETER_TYPE_Table_Fields:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(%s)\n"), p->Get_Identifier(), p->asString());
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(%s)\n"), p->Get_Identifier(), p->asString());
 			break;
 
 		case PARAMETER_TYPE_Double:
 		case PARAMETER_TYPE_Degree:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(%f)\n"), p->Get_Identifier(), p->asDouble());
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(%f)\n"), p->Get_Identifier(), p->asDouble());
 			break;
 
 		case PARAMETER_TYPE_Range:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').asRange().Set_LoVal(%f)\n"), p->Get_Identifier(), p->asRange()->Get_LoVal());
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').asRange().Set_HiVal(%f)\n"), p->Get_Identifier(), p->asRange()->Get_HiVal());
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).asRange().Set_LoVal(%f)\n"), p->Get_Identifier(), p->asRange()->Get_LoVal());
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).asRange().Set_HiVal(%f)\n"), p->Get_Identifier(), p->asRange()->Get_HiVal());
 			break;
 
 		case PARAMETER_TYPE_String:
 		case PARAMETER_TYPE_Text:
 		case PARAMETER_TYPE_FilePath:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(%s)\n"), p->Get_Identifier(), p->asString());
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(%s)\n"), p->Get_Identifier(), p->asString());
 			break;
 
 		case PARAMETER_TYPE_FixedTable:
-			Command	+= CSG_String::Format(SG_T("#   Parms('%s').Set_Value(saga_api.SG_Create_Table('table.txt'))\n"), p->Get_Identifier());
+			Command	+= CSG_String::Format(SG_T("#   Parms.Get(unicode('%s')).Set_Value(saga_api.SG_Create_Table('table.txt'))\n"), p->Get_Identifier());
 			break;
 
 		case PARAMETER_TYPE_Grid_System:
 			if( p->Get_Children_Count() == 0 )
 			{
-				Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(saga_api.CSG_Grid_System(%f, %f, %f, %d, %d))\n"), p->Get_Identifier(),
+				Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(saga_api.CSG_Grid_System(%f, %f, %f, %d, %d))\n"), p->Get_Identifier(),
 					p->asGrid_System()->Get_Cellsize(),
 					p->asGrid_System()->Get_XMin()	, p->asGrid_System()->Get_YMin(),
 					p->asGrid_System()->Get_NX()	, p->asGrid_System()->Get_NY());
@@ -539,25 +602,25 @@ void CWKSP_Module::_Save_Script_Python(CSG_String &Command, CSG_Parameters *pPar
 			break;
 
 		case PARAMETER_TYPE_Grid:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(0) # %s %s grid\n"), p->Get_Identifier(),
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(use_variable_of_dataset_here) # %s %s grid\n"), p->Get_Identifier(),
 				p->is_Input()    ? SG_T("input")    : SG_T("output"), p->is_Optional() ? SG_T("optional") : SG_T("NOT optional")
 			);
 			break;
 
 		case PARAMETER_TYPE_Table:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(0) # %s %s table\n"), p->Get_Identifier(),
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(use_variable_of_dataset_here) # %s %s table\n"), p->Get_Identifier(),
 				p->is_Input()    ? SG_T("input")    : SG_T("output"), p->is_Optional() ? SG_T("optional") : SG_T("NOT optional")
 			);
 			break;
 
 		case PARAMETER_TYPE_Shapes:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(0) # %s %s shapes\n"), p->Get_Identifier(),
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(use_variable_of_dataset_here) # %s %s shapes\n"), p->Get_Identifier(),
 				p->is_Input()    ? SG_T("input")    : SG_T("output"), p->is_Optional() ? SG_T("optional") : SG_T("NOT optional")
 			);
 			break;
 
 		case PARAMETER_TYPE_TIN:
-			Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(0) # %s %s TIN\n"), p->Get_Identifier(),
+			Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(use_variable_of_dataset_here) # %s %s TIN\n"), p->Get_Identifier(),
 				p->is_Input()    ? SG_T("input")    : SG_T("output"), p->is_Optional() ? SG_T("optional") : SG_T("NOT optional")
 			);
 			break;
@@ -570,9 +633,9 @@ void CWKSP_Module::_Save_Script_Python(CSG_String &Command, CSG_Parameters *pPar
 			if( p->is_Input() )
 			{
 				if( !p->is_Optional() )
-					Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(0) # data object list\n"), p->Get_Identifier());
+					Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(use_variable_of_dataset_here) # data object list\n"), p->Get_Identifier());
 				else
-					Command	+= CSG_String::Format(SG_T("    Parms('%s').Set_Value(0) # optional data object list\n"), p->Get_Identifier());
+					Command	+= CSG_String::Format(SG_T("    Parms.Get(unicode('%s')).Set_Value(use_variable_of_dataset_here) # optional data object list\n"), p->Get_Identifier());
 			}
 			break;
 		}
@@ -637,14 +700,14 @@ bool CWKSP_Module::Execute(bool bDialog)
 		{
 			if( g_pModule->is_Executing() )
 			{
-				if( !bDialog || DLG_Message_Confirm(_TL("Shall execution be stopped?"), _TL("Module Execution")) )
+				if( !bDialog || DLG_Message_Confirm(_TL("Shall execution be stopped?"), _TL("Tool Execution")) )
 				{
 					PROCESS_Set_Okay(false);
 				}
 			}
 			else if( m_pModule->is_Interactive() )
 			{
-				if( !bDialog || DLG_Message_Confirm(_TL("Shall execution be stopped?"), _TL("Module Execution")) )
+				if( !bDialog || DLG_Message_Confirm(_TL("Shall execution be stopped?"), _TL("Tool Execution")) )
 				{
 					bResult		= ((CSG_Module_Interactive *)m_pModule)->Execute_Finish();
 					g_pModule	= NULL;
@@ -652,15 +715,15 @@ bool CWKSP_Module::Execute(bool bDialog)
 					PROCESS_Set_Okay(true);
 
 					MSG_ADD2(bResult,
-						_TL("Interactive module execution has been stopped"),
-						_TL("Interactive module execution failed")
+						_TL("Interactive tool execution has been stopped"),
+						_TL("Interactive tool execution failed")
 					);
 				}
 			}
 		}
 		else
 		{
-			DLG_Message_Show(_TL("Can't execute a module while another runs"), _TL("Module Execution"));
+			DLG_Message_Show(_TL("Can't execute a tool while another runs"), _TL("Tool Execution"));
 		}
 	}
 
@@ -675,7 +738,7 @@ bool CWKSP_Module::Execute(bool bDialog)
 
 			MSG_General_Add_Line();
 			MSG_Execution_Add_Line();
-			MSG_ADD(wxString::Format(wxT("%s: %s"), _TL("Executing module"), m_pModule->Get_Name().c_str()));
+			MSG_ADD(wxString::Format(wxT("%s: %s"), _TL("Executing tool"), m_pModule->Get_Name().c_str()));
 
 			STATUSBAR_Set_Text(m_pModule->Get_Name().w_str());
 
@@ -686,15 +749,15 @@ bool CWKSP_Module::Execute(bool bDialog)
 			if( m_pModule->is_Interactive() )
 			{
 				MSG_ADD2(bResult,
-					_TL("Interactive module execution has been started"),
-					_TL("Interactive module execution failed")
+					_TL("Interactive tool execution has been started"),
+					_TL("Interactive tool execution failed")
 				);
 			}
 			else
 			{
 				MSG_ADD2(bResult,
-					_TL("Module execution succeeded"),
-					_TL("Module execution failed")
+					_TL("Tool execution succeeded"),
+					_TL("Tool execution failed")
 				);
 			}
 
diff --git a/src/saga_core/saga_gui/wksp_module_library.cpp b/src/saga_core/saga_gui/wksp_module_library.cpp
index 9651cb9..6e023ba 100644
--- a/src/saga_core/saga_gui/wksp_module_library.cpp
+++ b/src/saga_core/saga_gui/wksp_module_library.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_library.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_module_library.cpp 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -128,7 +128,7 @@ wxString CWKSP_Module_Library::Get_Description(void)
 	wxString	s;
 
 	//-----------------------------------------------------
-	s	+= wxString::Format(wxT("<b>%s</b>"), _TL("Module Library"));
+	s	+= wxString::Format(wxT("<b>%s</b>"), _TL("Tool Library"));
 
 	s	+= wxT("<table border=\"0\">");
 
@@ -152,7 +152,7 @@ wxString CWKSP_Module_Library::Get_Description(void)
 	s	+= sDesc.Length() > 0 ? sDesc.c_str() : m_pLibrary->Get_Description().c_str();
 
 	//-----------------------------------------------------
-	s	+= wxString::Format(wxT("<hr><b>%s:<ul>"), _TL("Modules"));
+	s	+= wxString::Format(wxT("<hr><b>%s:<ul>"), _TL("Tools"));
 
 	for(int iModule=0; iModule<Get_Count(); iModule++)
 	{
diff --git a/src/saga_core/saga_gui/wksp_module_manager.cpp b/src/saga_core/saga_gui/wksp_module_manager.cpp
index aad5aef..6ad9da5 100644
--- a/src/saga_core/saga_gui/wksp_module_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_module_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_manager.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_module_manager.cpp 2087 2014-04-04 09:08:54Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,6 +72,7 @@
 
 #include "helper.h"
 
+#include "wksp_module_control.h"
 #include "wksp_module_manager.h"
 #include "wksp_module_library.h"
 #include "wksp_module_menu.h"
@@ -102,16 +103,13 @@ CWKSP_Module_Manager::CWKSP_Module_Manager(void)
 	m_pMenu_Modules	= new CWKSP_Menu_Modules;
 
 	//-----------------------------------------------------
-	m_Parameters.Create(this, _TL(""), _TL(""));
+	CSG_Parameter	*pNode;
 
-	m_Parameters.Add_Value(
-		NULL	, "BEEP"		, _TL("Beep when finished"),
-		_TL(""),
-		PARAMETER_TYPE_Bool	, true
-	);
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_GENERAL", _TL("General"), _TL(""));
 
 	m_Parameters.Add_Choice(
-		NULL	, "START_LOGO"	, _TL("Show Logo at Start Up"),
+		pNode	, "START_LOGO"		, _TL("Show Logo at Start Up"),
 		_TL(""),
 		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
 			_TL("do not show"),
@@ -121,24 +119,21 @@ CWKSP_Module_Manager::CWKSP_Module_Manager(void)
 		), 1
 	);
 
-	m_Parameters.Add_Choice(
-		NULL	, "HELP_SOURCE"	, _TL("Module Description Source"),
+	m_Parameters.Add_Value(
+		pNode	, "PROCESS_UPDATE"	, _TL("Process Update Frequency [milliseconds]"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("built-in"),
-			_TL("online")
-		), 0
+		PARAMETER_TYPE_Int	, 0, 0, true
 	);
 
 	m_Parameters.Add_Value(
-		NULL	, "PROC_FREQ"	, _TL("Process Update Frequency [milliseconds]"),
-		_TL(""),
-		PARAMETER_TYPE_Int	, 0, 0, true
+		pNode	, "SAVE_CONFIG"		, _TL("Save Configuration"),
+		_TL("disabling might help to shut down faster, particularly if started from slow devices"),
+		PARAMETER_TYPE_Bool	, true
 	);
 
 #ifdef _OPENMP
 	m_Parameters.Add_Value(
-		NULL	, "MAX_NUM_THREADS_OMP"	, _TL("Number of CPU Cores [# physical processors]"),
+		pNode	, "OMP_THREADS_MAX"	, _TL("Number of CPU Cores [# physical processors]"),
 		_TW("Number of processors to use for parallelization. Should be set to the number "
 		    "of physical processors, and not to the total number of physical and logical processors "
 			"on systems supporting hyper-threading."),
@@ -146,9 +141,36 @@ CWKSP_Module_Manager::CWKSP_Module_Manager(void)
 	);
 #endif
 
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_MODULES", _TL("Tools"), _TL(""));
+
+	m_Parameters.Add_Value(
+		pNode	, "BEEP"			, _TL("Beep when finished"),
+		_TL(""),
+		PARAMETER_TYPE_Bool	, true
+	);
+
+	m_Parameters.Add_Choice(
+		pNode	, "HELP_SOURCE"		, _TL("Tool Description Source"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("built-in"),
+			_TL("online")
+		), 0
+	);
+
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_FILES", _TL("Files"), _TL(""));
+
+	m_Parameters.Add_Value(
+		pNode	, "LNG_OLDSTYLE"	, _TL("Old Style Namings"),
+		_TL("Use old style namings (e.g. 'modules' instead of 'tools'). Ignored if translation file is used. You need to restart SAGA to apply changes."),
+		PARAMETER_TYPE_Bool, false
+	);
+
 	m_Parameters.Add_FilePath(
-		NULL	, "LNG_FILE_DIC", _TL("Language Translations"),
-		_TL("Dictionary for translations from built-in (English) to local language (editable text table)"),
+		pNode	, "LNG_FILE_DIC"	, _TL("Language Translations"),
+		_TL("Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply changes."),
 		CSG_String::Format(SG_T("%s|*.lng|%s|*.txt|%s|*.*"),
 			_TL("Dictionary Files (*.lng)"),
 			_TL("Text Table (*.txt)"),
@@ -157,7 +179,7 @@ CWKSP_Module_Manager::CWKSP_Module_Manager(void)
 	);
 
 	m_Parameters.Add_FilePath(
-		NULL	, "CRS_FILE_SRS", _TL("CRS Database"),
+		pNode	, "CRS_FILE_SRS"		, _TL("CRS Database"),
 		_TL("Database with Coordinate Reference System (CRS) definitions. You have to restart SAGA to make changes take affect!"),
 		CSG_String::Format(SG_T("%s|*.srs|%s|*.*"),
 			_TL("Spatial Reference System Files (*.srs)"),
@@ -166,7 +188,7 @@ CWKSP_Module_Manager::CWKSP_Module_Manager(void)
 	);
 
 	m_Parameters.Add_FilePath(
-		NULL	, "CRS_FILE_DIC", _TL("CRS Dictionary"),
+		pNode	, "CRS_FILE_DIC"		, _TL("CRS Dictionary"),
 		_TL("Dictionary for Proj.4/OGC WKT translations. You have to restart SAGA to make changes take affect!"),
 		CSG_String::Format(SG_T("%s|*.dic|%s|*.*"),
 			_TL("Dictionary Files (*.dic)"),
@@ -191,9 +213,25 @@ CWKSP_Module_Manager::~CWKSP_Module_Manager(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define CFG_LIBS	wxT("/LIBS")
+#define CFG_LIBF	wxT("LIB_%03d")
+
+//---------------------------------------------------------
 bool CWKSP_Module_Manager::Initialise(void)
 {
-	_Config_Read();
+	CONFIG_Read("/MODULES", &m_Parameters);
+
+#ifdef _OPENMP
+	SG_Set_Max_Num_Threads_Omp(m_Parameters("OMP_THREADS_MAX")->asInt());
+#endif
+
+	//-----------------------------------------------------
+	wxString	Library;
+
+	for(int i=0; CONFIG_Read(CFG_LIBS, wxString::Format(CFG_LIBF, i), Library); i++)
+	{
+		Open(Library);
+	}
 
 	if( Get_Count() == 0 )
 	{
@@ -201,17 +239,35 @@ bool CWKSP_Module_Manager::Initialise(void)
 	if( _Open_Directory(wxT(MODULE_LIBRARY_PATH)) == 0 )
 #endif
 		_Open_Directory(g_pSAGA->Get_App_Path(), true);
-
-		m_pMenu_Modules->Update();
 	}
 
+	m_pMenu_Modules->Update();
+
 	return( true );
 }
 
 //---------------------------------------------------------
 bool CWKSP_Module_Manager::Finalise(void)
 {
-	_Config_Write();
+	CONFIG_Write("/MODULES", &m_Parameters);
+
+	CONFIG_Delete(CFG_LIBS);
+
+	for(int i=0; i<Get_Count(); i++)
+	{
+#ifdef _SAGA_MSW
+		wxFileName	fLib(Get_Library(i)->Get_File_Name());
+
+		if( fLib.GetPath().Find(g_pSAGA->Get_App_Path()) == 0 )
+		{
+			fLib.MakeRelativeTo(g_pSAGA->Get_App_Path());
+		}
+
+		CONFIG_Write(CFG_LIBS, wxString::Format(CFG_LIBF, i), fLib.GetFullPath());
+#else
+		CONFIG_Write(CFG_LIBS, wxString::Format(CFG_LIBF, i), Get_Library(i)->Get_File_Name());
+#endif
+	}
 
 	return( true );
 }
@@ -226,7 +282,7 @@ bool CWKSP_Module_Manager::Finalise(void)
 //---------------------------------------------------------
 wxString CWKSP_Module_Manager::Get_Name(void)
 {
-	return( _TL("Module Libraries") );
+	return( _TL("Tool Libraries") );
 }
 
 //---------------------------------------------------------
@@ -240,7 +296,7 @@ wxMenu * CWKSP_Module_Manager::Get_Menu(void)
 {
 	wxMenu	*pMenu;
 
-	pMenu	= new wxMenu(_TL("Module Libraries"));
+	pMenu	= new wxMenu(_TL("Tool Libraries"));
 
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MODULES_OPEN);
 
@@ -275,13 +331,24 @@ bool CWKSP_Module_Manager::On_Command(int Cmd_ID)
 		Open();
 		break;
 
+	case ID_CMD_MODULES_SEARCH:
+		{
+			CWKSP_Base_Item	*pItem	= g_pModule_Ctrl->Search_Item(_TL("Run Tool"), WKSP_ITEM_Module);
+
+			if( pItem && pItem->GetId().IsOk() && pItem->Get_Type() == WKSP_ITEM_Module )
+			{
+				((CWKSP_Module *)pItem)->Execute(true);
+			}
+		}
+		break;
+
 	case ID_CMD_MODULES_SAVE_DOCS:
 		{
 			wxString	Path;
 
-			if( DLG_Directory(Path, _TL("Create Module Description Files")) )
+			if( DLG_Directory(Path, _TL("Create Tool Description Files")) )
 			{
-				MSG_General_Add(wxString::Format(SG_T("%s..."), _TL("Create Module Description Files")), true, true);
+				MSG_General_Add(wxString::Format(SG_T("%s..."), _TL("Create Tool Description Files")), true, true);
 
 				SG_Get_Module_Library_Manager().Get_Summary(&Path);
 
@@ -303,6 +370,8 @@ bool CWKSP_Module_Manager::On_Command_UI(wxUpdateUIEvent &event)
 		return( CWKSP_Base_Manager::On_Command_UI(event) );
 
 	case ID_CMD_WKSP_ITEM_CLOSE:
+	case ID_CMD_MODULES_SEARCH:
+	case ID_CMD_MODULES_SAVE_DOCS:
 		event.Enable(Get_Count() > 0 && g_pModule == NULL);
 		break;
 	}
@@ -354,110 +423,26 @@ void CWKSP_Module_Manager::On_Execute_UI(wxUpdateUIEvent &event)
 //---------------------------------------------------------
 void CWKSP_Module_Manager::Parameters_Changed(void)
 {
-	g_pSAGA->Process_Set_Frequency(m_Parameters("PROC_FREQ")->asInt());
-
-#ifdef _OPENMP
-	SG_Set_Max_Num_Threads_Omp(m_Parameters("MAX_NUM_THREADS_OMP")->asInt());
-#endif
-
 	CWKSP_Base_Item::Parameters_Changed();
-}
-
-//---------------------------------------------------------
-bool CWKSP_Module_Manager::Do_Beep(void)
-{
-	return( m_Parameters("BEEP")->asBool() );
-}
 
+	g_pSAGA->Process_Set_Frequency(m_Parameters("PROCESS_UPDATE")->asInt());
 
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#define CFG_LIBS	wxT("/LIBS")
-#define CFG_LIBF	wxT("LIB_%03d")
-
-//---------------------------------------------------------
-void CWKSP_Module_Manager::_Config_Read(void)
-{
-	bool		bValue;
-	long		lValue;
-	wxString	sValue;
-
-	if( CONFIG_Read(wxT("/MODULES"), wxT("BEEP")		, bValue) )
+	if( m_Parameters("SAVE_CONFIG")->asBool() == false )
 	{
-		m_Parameters("BEEP")		->Set_Value(bValue);
+		CONFIG_Write("/MODULES", &m_Parameters);
 	}
 
-	if( CONFIG_Read(wxT("/MODULES"), wxT("START_LOGO")	, lValue) )
-	{
-		m_Parameters("START_LOGO")	->Set_Value((int)lValue);
-	}
-
-	if( CONFIG_Read(wxT("/MODULES"), wxT("HELP_SOURCE")	, lValue) )
-	{
-		m_Parameters("HELP_SOURCE")	->Set_Value((int)lValue);
-	}
-
-	if( CONFIG_Read(wxT("/MODULES"), wxT("PROC_FREQ")	, lValue) )
-	{
-		m_Parameters("PROC_FREQ")	->Set_Value((int)lValue);
-	}
+	CONFIG_Do_Save(m_Parameters("SAVE_CONFIG")->asBool());
 
 #ifdef _OPENMP
-	if( CONFIG_Read(wxT("/MODULES"), wxT("MAX_NUM_THREADS_OMP"), lValue) )
-	{
-		m_Parameters("MAX_NUM_THREADS_OMP")->Set_Value((int)lValue);
-		SG_Set_Max_Num_Threads_Omp((int)lValue);
-	}
+	SG_Set_Max_Num_Threads_Omp(m_Parameters("OMP_THREADS_MAX")->asInt());
 #endif
-
-	if( CONFIG_Read(wxT("/MODULES"), wxT("LNG_FILE_DIC"), sValue) )
-	{
-		m_Parameters("LNG_FILE_DIC")->Set_Value(CSG_String(&sValue));
-	}
-
-	if( CONFIG_Read(wxT("/MODULES"), wxT("CRS_FILE_SRS"), sValue) )
-	{
-		m_Parameters("CRS_FILE_SRS")->Set_Value(CSG_String(&sValue));
-	}
-
-	if( CONFIG_Read(wxT("/MODULES"), wxT("CRS_FILE_DIC"), sValue) )
-	{
-		m_Parameters("CRS_FILE_DIC")->Set_Value(CSG_String(&sValue));
-	}
-
-	for(int i=0; CONFIG_Read(CFG_LIBS, wxString::Format(CFG_LIBF, i), sValue); i++)
-	{
-		Open(sValue);
-	}
-
-	m_pMenu_Modules->Update();
 }
 
 //---------------------------------------------------------
-void CWKSP_Module_Manager::_Config_Write(void)
+bool CWKSP_Module_Manager::Do_Beep(void)
 {
-	CONFIG_Write(wxT("/MODULES"), wxT("BEEP")		 ,       m_Parameters("BEEP")        ->asBool());
-	CONFIG_Write(wxT("/MODULES"), wxT("START_LOGO")	 , (long)m_Parameters("START_LOGO")  ->asInt());
-	CONFIG_Write(wxT("/MODULES"), wxT("HELP_SOURCE") , (long)m_Parameters("HELP_SOURCE") ->asInt());
-	CONFIG_Write(wxT("/MODULES"), wxT("PROC_FREQ")	 , (long)m_Parameters("PROC_FREQ")   ->asInt());
-#ifdef _OPENMP
-	CONFIG_Write(wxT("/MODULES"), wxT("MAX_NUM_THREADS_OMP"), (long)m_Parameters("MAX_NUM_THREADS_OMP")->asInt());
-#endif
-	CONFIG_Write(wxT("/MODULES"), wxT("LNG_FILE_DIC"),       m_Parameters("LNG_FILE_DIC")->asString());
-	CONFIG_Write(wxT("/MODULES"), wxT("CRS_FILE_SRS"),       m_Parameters("CRS_FILE_SRS")->asString());
-	CONFIG_Write(wxT("/MODULES"), wxT("CRS_FILE_DIC"),       m_Parameters("CRS_FILE_DIC")->asString());
-
-	CONFIG_Delete(CFG_LIBS);
-
-	for(int i=0; i<Get_Count(); i++)
-	{
-		CONFIG_Write(CFG_LIBS, wxString::Format(CFG_LIBF, i), Get_Library(i)->Get_File_Name());
-	}
+	return( m_Parameters("BEEP")->asBool() );
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_module_manager.h b/src/saga_core/saga_gui/wksp_module_manager.h
index 0e920b2..0481e04 100644
--- a/src/saga_core/saga_gui/wksp_module_manager.h
+++ b/src/saga_core/saga_gui/wksp_module_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_module_manager.h 1993 2014-02-13 16:38:16Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -127,9 +127,6 @@ private:
 	class CWKSP_Menu_Modules		*m_pMenu_Modules;
 
 
-	void							_Config_Read		(void);
-	void							_Config_Write		(void);
-
 	int								_Open_Directory		(const wxString &sDirectory, bool bOnlySubDirectories = false);
 
 };
diff --git a/src/saga_core/saga_gui/wksp_module_menu.cpp b/src/saga_core/saga_gui/wksp_module_menu.cpp
index 3905f98..28db669 100644
--- a/src/saga_core/saga_gui/wksp_module_menu.cpp
+++ b/src/saga_core/saga_gui/wksp_module_menu.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_menu.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_module_menu.cpp 1994 2014-02-14 10:55:29Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -143,8 +143,8 @@ void CWKSP_Menu_Modules::Update(void)
 		}
 
 		m_pMenu->InsertSeparator(0);
-		CMD_Menu_Ins_Item(m_pMenu, false, ID_CMD_WKSP_ITEM_CLOSE, 0);
 		CMD_Menu_Ins_Item(m_pMenu, false, ID_CMD_MODULES_OPEN	, 0);
+		CMD_Menu_Ins_Item(m_pMenu, false, ID_CMD_MODULES_SEARCH	, 1);
 
 		_Set_Recent(m_pMenu);
 	}
diff --git a/src/saga_core/saga_gui/wksp_pointcloud.cpp b/src/saga_core/saga_gui/wksp_pointcloud.cpp
index 3dcd3ee..e2f77a7 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_pointcloud.cpp 2003 2014-02-19 17:08:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -162,8 +162,12 @@ wxMenu * CWKSP_PointCloud::Get_Menu(void)
 
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_POINTCLOUD_SHOW);
+	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_POINTCLOUD_SAVE);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_POINTCLOUD_SAVEAS);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECTION);
+	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_SHAPES_HISTOGRAM);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_SET_LUT);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_SETTINGS_COPY);
@@ -171,7 +175,7 @@ wxMenu * CWKSP_PointCloud::Get_Menu(void)
 	pMenu->AppendSeparator();
 
 	//-----------------------------------------------------
-	wxMenu	*pSubMenu	= new wxMenu(_TL("Classificaton"));
+	wxMenu	*pSubMenu	= new wxMenu(_TL("Classification"));
 
 	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_POINTCLOUD_RANGE_MINMAX);
 	CMD_Menu_Add_Item(pSubMenu	, false, ID_CMD_POINTCLOUD_RANGE_STDDEV150);
@@ -788,11 +792,9 @@ bool CWKSP_PointCloud::asImage(CSG_Grid *pImage)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-wxMenu * CWKSP_PointCloud::On_Edit_Get_Menu(void)
+wxMenu * CWKSP_PointCloud::Edit_Get_Menu(void)
 {
-	wxMenu	*pMenu;
-
-	pMenu	= new wxMenu;
+	wxMenu	*pMenu	= new wxMenu;
 
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_SHAPE);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_CLEAR);
@@ -802,7 +804,18 @@ wxMenu * CWKSP_PointCloud::On_Edit_Get_Menu(void)
 }
 
 //---------------------------------------------------------
-bool CWKSP_PointCloud::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
+TSG_Rect CWKSP_PointCloud::Edit_Get_Extent(void)
+{
+	if( Get_PointCloud()->Get_Selection_Count() > 0 )
+	{
+		return( Get_PointCloud()->Get_Selection_Extent().m_rect );
+	}
+
+	return( Get_PointCloud()->Get_Extent() );
+}
+
+//---------------------------------------------------------
+bool CWKSP_PointCloud::Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
 {
 	if( Key & MODULE_INTERACTIVE_KEY_RIGHT )
 	{
@@ -846,15 +859,15 @@ bool CWKSP_PointCloud::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld
 }
 
 //---------------------------------------------------------
-bool CWKSP_PointCloud::On_Edit_Set_Attributes(void)
+bool CWKSP_PointCloud::Edit_Set_Attributes(void)
 {
-	CSG_Table_Record	*pRecord;
+	CSG_Table_Record	*pSelection	= Get_PointCloud()->Get_Selection(m_Edit_Index);
 
-	if( (pRecord = Get_PointCloud()->Get_Selection()) != NULL )
+	if( pSelection )
 	{
 		for(int i=0; i<m_Edit_Attributes.Get_Record_Count(); i++)
 		{
-			pRecord->Set_Value(i, m_Edit_Attributes.Get_Record(i)->asString(1));
+			pSelection->Set_Value(i, m_Edit_Attributes.Get_Record(i)->asString(1));
 		}
 
 		Update_Views(false);
@@ -865,12 +878,6 @@ bool CWKSP_PointCloud::On_Edit_Set_Attributes(void)
 	return( false );
 }
 
-//---------------------------------------------------------
-TSG_Rect CWKSP_PointCloud::On_Edit_Get_Extent(void)
-{
-	return( Get_PointCloud()->Get_Extent() );
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_gui/wksp_pointcloud.h b/src/saga_core/saga_gui/wksp_pointcloud.h
index c9fc929..ac5989d 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_pointcloud.h 2003 2014-02-19 17:08:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -107,6 +107,11 @@ public:
 
 	wxString					Get_Name_Attribute		(void);
 
+	virtual wxMenu *			Edit_Get_Menu			(void);
+	virtual TSG_Rect			Edit_Get_Extent			(void);
+	virtual bool				Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool				Edit_Set_Attributes		(void);
+
 
 protected:
 
@@ -125,11 +130,6 @@ protected:
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 	virtual void				On_Update_Views			(void);
 
-	virtual wxMenu *			On_Edit_Get_Menu		(void);
-	virtual bool				On_Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
-	virtual bool				On_Edit_Set_Attributes	(void);
-	virtual TSG_Rect			On_Edit_Get_Extent		(void);
-
 	void						_LUT_Create				(void);
 
 	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
diff --git a/src/saga_core/saga_gui/wksp_shapes.cpp b/src/saga_core/saga_gui/wksp_shapes.cpp
index 5bf4904..bfb6de7 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes.cpp 2053 2014-03-18 09:47:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,8 +72,6 @@
 #include "wksp_shapes.h"
 #include "wksp_table.h"
 
-#include "view_scatterplot.h"
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -95,6 +93,10 @@ CWKSP_Shapes::CWKSP_Shapes(CSG_Shapes *pShapes)
 	m_Edit_Attributes.Add_Field(_TL("Value"), SG_DATATYPE_String);
 
 	m_Edit_Color    = wxColor(0, 0, 0);
+
+	m_Edit_Mode		= EDIT_SHAPE_MODE_Normal;
+
+	m_bVertices		= false;
 }
 
 //---------------------------------------------------------
@@ -153,9 +155,13 @@ wxMenu * CWKSP_Shapes::Get_Menu(void)
 	wxMenu	*pMenu	= new wxMenu(m_pObject->Get_Name());
 
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_SHOW);
+	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_SAVE);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_SAVEAS);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_SHOW);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECTION);
+	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_SHAPES_HISTOGRAM);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_SET_LUT);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_SETTINGS_COPY);
@@ -189,33 +195,20 @@ bool CWKSP_Shapes::On_Command(int Cmd_ID)
 	default:
 		return( CWKSP_Layer::On_Command(Cmd_ID) );
 
-	case ID_CMD_SHAPES_SET_LUT:
-		_LUT_Create();
-		break;
-
-	case ID_CMD_SHAPES_EDIT_SHAPE:
-		_Edit_Shape();
-		break;
-
-	case ID_CMD_SHAPES_EDIT_ADD_SHAPE:
-		_Edit_Shape_Add();
-		break;
-
-	case ID_CMD_SHAPES_EDIT_DEL_SHAPE:
-		_Edit_Shape_Del();
-		break;
-
-	case ID_CMD_SHAPES_EDIT_ADD_PART:
-		_Edit_Part_Add();
-		break;
-
-	case ID_CMD_SHAPES_EDIT_DEL_PART:
-		_Edit_Part_Del();
-		break;
+	//-----------------------------------------------------
+	case ID_CMD_SHAPES_SET_LUT       :	_LUT_Create     ();	break;
+	case ID_CMD_SHAPES_HISTOGRAM     :	Histogram_Toggle();	break;
 
-	case ID_CMD_SHAPES_EDIT_DEL_POINT:
-		_Edit_Point_Del();
-		break;
+	//-----------------------------------------------------
+	case ID_CMD_SHAPES_EDIT_SHAPE    :	_Edit_Shape    ();	break;
+	case ID_CMD_SHAPES_EDIT_ADD_SHAPE:	_Edit_Shape_Add();	break;
+	case ID_CMD_SHAPES_EDIT_DEL_SHAPE:	_Edit_Shape_Del();	break;
+	case ID_CMD_SHAPES_EDIT_ADD_PART :	_Edit_Part_Add ();	break;
+	case ID_CMD_SHAPES_EDIT_DEL_PART :	_Edit_Part_Del ();	break;
+	case ID_CMD_SHAPES_EDIT_DEL_POINT:	_Edit_Point_Del();	break;
+	case ID_CMD_SHAPES_EDIT_MERGE    :	_Edit_Merge    ();	break;
+	case ID_CMD_SHAPES_EDIT_SPLIT    :	_Edit_Split    ();	break;
+	case ID_CMD_SHAPES_EDIT_MOVE     :	_Edit_Move     ();	break;
 
 	case ID_CMD_SHAPES_EDIT_SEL_CLEAR:
 		Get_Shapes()->Select();
@@ -227,16 +220,12 @@ bool CWKSP_Shapes::On_Command(int Cmd_ID)
 		Update_Views();
 		break;
 
-	case ID_CMD_TABLES_SHOW:
-		m_pTable->Toggle_View();
-		break;
-
-	case ID_CMD_TABLES_DIAGRAM:
-		m_pTable->Toggle_Diagram();
-		break;
+	//-----------------------------------------------------
+	case ID_CMD_TABLES_SHOW   :	m_pTable->Toggle_View   ();	break;
+	case ID_CMD_TABLES_DIAGRAM:	m_pTable->Toggle_Diagram();	break;
 
 	case ID_CMD_TABLES_SCATTERPLOT:
-		Add_ScatterPlot(Get_Table()->Get_Table());
+		Add_ScatterPlot();
 		break;
 
 	case ID_CMD_TABLES_SAVEAS:
@@ -251,10 +240,6 @@ bool CWKSP_Shapes::On_Command(int Cmd_ID)
 			}
 		}
 		break;
-
-	case ID_CMD_SHAPES_HISTOGRAM:
-		Histogram_Toggle();
-		break;
 	}
 
 	return( true );
@@ -312,6 +297,10 @@ bool CWKSP_Shapes::On_Command_UI(wxUpdateUIEvent &event)
 	case ID_CMD_SHAPES_HISTOGRAM:
 		event.Check(m_pHistogram != NULL);
 		break;
+
+	case ID_CMD_SHAPES_EDIT_MOVE:
+		event.Check(m_Edit_Mode == EDIT_SHAPE_MODE_Move);
+		break;
 	}
 
 	return( true );
@@ -332,12 +321,12 @@ void CWKSP_Shapes::On_Create_Parameters(void)
 	//-----------------------------------------------------
 	// Classification...
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("NODE_LUT")		, "LUT_ATTRIB"				, _TL("Attribute"),
 		_TL("")
 	);
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("NODE_METRIC")		, "METRIC_ATTRIB"			, _TL("Attribute"),
 		_TL("")
 	);
@@ -353,7 +342,7 @@ void CWKSP_Shapes::On_Create_Parameters(void)
 	//-----------------------------------------------------
 	// Label...
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("NODE_LABEL")		, "LABEL_ATTRIB"			, _TL("Attribute"),
 		_TL("")
 	);
@@ -405,7 +394,7 @@ void CWKSP_Shapes::On_Create_Parameters(void)
 		PARAMETER_TYPE_Color, SG_GET_RGB(255, 255, 255)
 	);
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("LABEL_ATTRIB")	, "LABEL_ATTRIB_SIZE_BY"	, _TL("Size by Attribute"),
 		_TL("")
 	);
@@ -455,7 +444,7 @@ void CWKSP_Shapes::On_Create_Parameters(void)
 		_TL("")
 	);
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("NODE_EXTRAINFO")	, "EXTRAINFO_ATTRIB"		, _TL("Attribute"),
 		_TL("")
 	);
@@ -477,17 +466,17 @@ void CWKSP_Shapes::On_DataObject_Changed(void)
 {
 	CWKSP_Layer::On_DataObject_Changed();
 
-	_AttributeList_Set(m_Parameters("LUT_ATTRIB")			, false);
-	_AttributeList_Set(m_Parameters("METRIC_ATTRIB")		, false);
-	_AttributeList_Set(m_Parameters("LABEL_ATTRIB")			, true);
-	_AttributeList_Set(m_Parameters("LABEL_ATTRIB_SIZE_BY")	, true);
+	AttributeList_Set(m_Parameters("LUT_ATTRIB")			, false);
+	AttributeList_Set(m_Parameters("METRIC_ATTRIB")		, false);
+	AttributeList_Set(m_Parameters("LABEL_ATTRIB")			, true);
+	AttributeList_Set(m_Parameters("LABEL_ATTRIB_SIZE_BY")	, true);
 
 	_Chart_Set_Options();
 
 	m_pTable->DataObject_Changed();
 
 #ifdef USE_HTMLINFO
-	_AttributeList_Set(m_Parameters("EXTRAINFO_ATTRIB") , true);
+	AttributeList_Set(m_Parameters("EXTRAINFO_ATTRIB") , true);
 #endif
 }
 
@@ -524,11 +513,6 @@ void CWKSP_Shapes::On_Parameters_Changed(void)
 		m_iLabel	= -1;
 	}
 
-	if( (m_iLabel_Size = m_Parameters("LABEL_ATTRIB_SIZE_BY")->asInt()) >= Get_Shapes()->Get_Field_Count() )
-	{
-		m_iLabel_Size	= -1;
-	}
-
 	m_Label_Prec		= m_Parameters("LABEL_ATTRIB_PREC")->asInt() - 2;
 
 	switch( m_Parameters("LABEL_ATTRIB_EFFECT")->asInt() )
@@ -548,14 +532,6 @@ void CWKSP_Shapes::On_Parameters_Changed(void)
 	m_Label_Eff_Color	= m_Parameters("LABEL_ATTRIB_EFFECT_COLOR")->asColor();
 
 	//-----------------------------------------------------
-#ifdef USE_HTMLINFO
-	if( (m_iExtraInfo = m_Parameters("EXTRAINFO_ATTRIB")->asInt()) >= Get_Shapes()->Get_Field_Count() )
-	{
-		m_iExtraInfo	= -1;
-	}
-#endif
-
-	//-----------------------------------------------------
 	_Chart_Get_Options();
 }
 
@@ -572,8 +548,8 @@ int CWKSP_Shapes::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Paramete
 	//-----------------------------------------------------
 	if( Flags & PARAMETER_CHECK_VALUES )
 	{
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), wxT("COLORS_TYPE"))
-		||	!SG_STR_CMP(pParameter->Get_Identifier(), wxT("METRIC_ATTRIB")) )
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "COLORS_TYPE")
+		||	!SG_STR_CMP(pParameter->Get_Identifier(), "METRIC_ATTRIB") )
 		{
 			int		zField	= pParameters->Get_Parameter("METRIC_ATTRIB")->asInt();
 
@@ -583,7 +559,7 @@ int CWKSP_Shapes::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Paramete
 			);
 		}
 
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), wxT("LUT_ATTRIB"))
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "LUT_ATTRIB")
 		&&  pParameter->asInt() >= 0 && pParameter->asInt() < Get_Shapes()->Get_Field_Count() )
 		{
 			TSG_Data_Type	Type	= SG_Data_Type_is_Numeric(Get_Shapes()->Get_Field_Type(pParameter->asInt()))
@@ -597,50 +573,51 @@ int CWKSP_Shapes::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Paramete
 	//-----------------------------------------------------
 	if( Flags & PARAMETER_CHECK_ENABLE )
 	{
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OUTLINE")) )
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "OUTLINE") )
 		{
 			pParameters->Get_Parameter("OUTLINE_COLOR")->Set_Enabled(pParameter->asBool());
 			pParameters->Get_Parameter("OUTLINE_SIZE" )->Set_Enabled(pParameter->asBool());
 		}
 
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LABEL_ATTRIB")) )
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "LABEL_ATTRIB") )
 		{
 			bool	Value	= pParameter->asInt() < Get_Shapes()->Get_Field_Count();
 
 			pParameters->Get_Parameter("LABEL_ATTRIB_FONT"     )->Set_Enabled(Value);
 			pParameters->Get_Parameter("LABEL_ATTRIB_SIZE_TYPE")->Set_Enabled(Value);
 			pParameters->Get_Parameter("LABEL_ATTRIB_PREC"     )->Set_Enabled(Value);
-			pParameters->Get_Parameter("LABEL_ATTRIB_SIZE"     )->Set_Enabled(Value);
 			pParameters->Get_Parameter("LABEL_ATTRIB_SIZE_BY"  )->Set_Enabled(Value);
 			pParameters->Get_Parameter("LABEL_ATTRIB_EFFECT"   )->Set_Enabled(Value);
 		}
 
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LABEL_ATTRIB_SIZE_BY")) )
+		if( !SG_STR_CMP(pParameter->Get_Identifier(), "LABEL_ATTRIB_SIZE_TYPE")
+		||  !SG_STR_CMP(pParameter->Get_Identifier(), "LABEL_ATTRIB_SIZE_BY"  ) )
 		{
-			bool	Value	= pParameter->asInt() >= Get_Shapes()->Get_Field_Count();
+			bool	Value	= pParameters->Get_Parameter("LABEL_ATTRIB_SIZE_TYPE")->asInt() != 0
+						||    pParameters->Get_Parameter("LABEL_ATTRIB_SIZE_BY"  )->asInt() < Get_Shapes()->Get_Field_Count();
 
 			pParameters->Get_Parameter("LABEL_ATTRIB_SIZE")->Set_Enabled(Value);
 		}
 
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LABEL_ATTRIB_EFFECT")) )
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "LABEL_ATTRIB_EFFECT") )
 		{
 			bool	Value	= pParameter->asInt() > 0;
 
 			pParameters->Get_Parameter("LABEL_ATTRIB_EFFECT_COLOR")->Set_Enabled(Value);
 		}
 
-		if(	!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("EDIT_SNAP_LIST")) )
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "EDIT_SNAP_LIST") )
 		{
 			pParameters->Get_Parameter("EDIT_SNAP_DIST")->Set_Enabled(pParameter->asList()->Get_Count() > 0);
 		}
 
-		if(	!SG_STR_CMP(pParameters->Get_Identifier(), SG_T("DISPLAY_CHART")) )
+		if(	!SG_STR_CMP(pParameters->Get_Identifier(), "DISPLAY_CHART") )
 		{
 			CSG_String	s(pParameter->Get_Identifier());
 
-			if( s.Find(wxT("FIELD_")) == 0 )
+			if( s.Find("FIELD_") == 0 )
 			{
-				s.Replace(wxT("FIELD_"), wxT("COLOR_"));
+				s.Replace("FIELD_", "COLOR_");
 
 				if( pParameters->Get_Parameter(s) )
 				{
@@ -931,57 +908,68 @@ wxString CWKSP_Shapes::Get_Name_Attribute(void)
 //---------------------------------------------------------
 void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 {
-	int			iShape;
-	CSG_Shape	*pShape;
-
 	//-----------------------------------------------------
 	if( Get_Extent().Intersects(dc_Map.m_rWorld) != INTERSECTION_None )
 	{
+		int		iShape;
+
 		double	Transparency	= m_Parameters("DISPLAY_TRANSPARENCY")->asDouble() / 100.0;
 
 		CWKSP_Map_DC	*pDC	= Transparency > 0.0 ? new CWKSP_Map_DC(dc_Map.m_rWorld, dc_Map.m_rDC, dc_Map.m_Scale, SG_GET_RGB(255, 255, 255)) : NULL;
 		CWKSP_Map_DC	&dc		= pDC ? *pDC : dc_Map;
 
-		m_Sel_Color		= Get_Color_asWX(m_Parameters("SEL_COLOR") ->asInt());
+		m_Sel_Color		= Get_Color_asWX(m_Parameters("SEL_COLOR" )->asInt());
 		m_Edit_Color	= Get_Color_asWX(m_Parameters("EDIT_COLOR")->asInt());
 
-		_Draw_Initialize(dc);
+		Draw_Initialize(dc);
 
 		//-------------------------------------------------
 		if( bEdit && (m_Edit_pShape || Get_Shapes()->Get_Selection_Count() > 0) )
 		{
 			for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
 			{
-				pShape	= Get_Shapes()->Get_Shape(iShape);
-
-				if( !pShape->is_Selected() && dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+				if( !Get_Shapes()->Get_Shape(iShape)->is_Selected() )
 				{
-					_Draw_Shape(dc, pShape, false);
+					_Draw_Shape(dc, Get_Shapes()->Get_Shape(iShape));
 				}
 			}
 
-			//---------------------------------------------
-			for(iShape=1; iShape<Get_Shapes()->Get_Selection_Count(); iShape++)
+			for(iShape=0; iShape<Get_Shapes()->Get_Selection_Count(); iShape++)
 			{
-				pShape	= Get_Shapes()->Get_Selection(iShape);
-
-				if( dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+				if( iShape != m_Edit_Index )
 				{
-					_Draw_Shape(dc, pShape, true);
+					_Draw_Shape(dc, Get_Shapes()->Get_Selection(iShape), 2);
 				}
 			}
 
-			if( m_Edit_pShape )
+			if( !m_Edit_pShape )
 			{
-				_Edit_Shape_Draw(dc);
+				_Draw_Shape(dc, Get_Shapes()->Get_Selection(m_Edit_Index), 1);
 			}
 			else
 			{
-				pShape	= Get_Shapes()->Get_Selection(0);
+				Edit_Shape_Draw(dc);
+			}
+
+			if( m_Edit_Mode == EDIT_SHAPE_MODE_Split )
+			{
+				CSG_Shape	*pSplit	= m_Edit_Shapes.Get_Shape(1);
 
-				if( dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+				if( pSplit && pSplit->Get_Point_Count() > 1 )
 				{
-					_Draw_Shape(dc, pShape, true);
+					for(int i=0; i<=1; i++)
+					{
+						dc_Map.dc.SetPen(wxPen(i == 0 ? *wxWHITE : *wxBLACK, i == 0 ? 3 : 1));
+
+						TSG_Point_Int	B, A	= dc_Map.World2DC(pSplit->Get_Point(0));
+
+						for(int iPoint=1; iPoint<pSplit->Get_Point_Count(); iPoint++)
+						{
+							B	= A;	A	= dc_Map.World2DC(pSplit->Get_Point(iPoint));
+
+							dc_Map.dc.DrawLine(A.x, A.y, B.x, B.y);
+						}
+					}
 				}
 			}
 		}
@@ -991,12 +979,9 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 		{
 			for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
 			{
-				pShape	= Get_Shapes()->Get_Shape(iShape);
-
-				if( (m_pClassify->Get_Mode() != CLASSIFY_METRIC || m_iColor < 0 || !pShape->is_NoData(m_iColor))
-				&&	dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+				if( (m_pClassify->Get_Mode() != CLASSIFY_METRIC || m_iColor < 0 || !Get_Shapes()->Get_Shape(iShape)->is_NoData(m_iColor)) )
 				{
-					_Draw_Shape(dc, pShape, false);
+					_Draw_Shape(dc, Get_Shapes()->Get_Shape(iShape));
 				}
 			}
 
@@ -1004,12 +989,7 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 			{
 				for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
 				{
-					pShape	= Get_Shapes()->Get_Shape(iShape);
-
-					if( dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
-					{
-						_Draw_Chart(dc, pShape);
-					}
+					_Draw_Chart(dc, Get_Shapes()->Get_Shape(iShape));
 				}
 			}
 		}
@@ -1017,51 +997,34 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 		//-------------------------------------------------
 		if( m_iLabel >= 0 )
 		{
-			int		Size;
-			double	dSize;
-			wxFont	Font	= Get_Font(m_Parameters("LABEL_ATTRIB_FONT"));
-
-			switch( m_Parameters("LABEL_ATTRIB_SIZE_TYPE")->asInt() )
-			{
-			case 0:	default:
-				dSize	= m_iLabel_Size < 0 ? Font.GetPointSize() : 1.0;
-				break;
-
-			case 1:
-				dSize	= dc.m_World2DC * m_Parameters("LABEL_ATTRIB_SIZE")->asDouble();
-				break;
-			}
+			int		iSize	= m_Parameters("LABEL_ATTRIB_SIZE_BY"  )->asInt();
+			double	dSize	= m_Parameters("LABEL_ATTRIB_SIZE_TYPE")->asInt() == 1 ?
+				dc.m_World2DC * m_Parameters("LABEL_ATTRIB_SIZE")->asDouble() : 1.0;
 
+			dc.dc.SetFont(Get_Font (m_Parameters("LABEL_ATTRIB_FONT")));
 			dc.dc.SetTextForeground(m_Parameters("LABEL_ATTRIB_FONT")->asColor());
 
-			if( m_iLabel_Size < 0 && (Size = (int)(0.5 + dSize)) > 0 )
+			if( iSize < 0 || iSize >= Get_Shapes()->Get_Field_Count() )
 			{
-				Font.SetPointSize(Size);
-				dc.dc.SetFont(Font);
+				int	Size	= m_Parameters("LABEL_ATTRIB_SIZE_TYPE")->asInt() == 1 ? (int)(0.5 + dSize) : dc.dc.GetFont().GetPointSize();
 
-				for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
+				if( Size > 0 )
 				{
-					pShape	= Get_Shapes()->Get_Shape(iShape);
-
-					if( dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+					for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
 					{
-						_Draw_Label(dc, pShape);
+						_Draw_Label(dc, Get_Shapes()->Get_Shape(iShape), Size);
 					}
 				}
 			}
-			else
+			else if( iSize >= 0 )
 			{
 				for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
 				{
-					pShape	= Get_Shapes()->Get_Shape(iShape);
+					int	Size	= (int)(0.5 + dSize * Get_Shapes()->Get_Shape(iShape)->asDouble(iSize));
 
-					if( dc.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None
-					&&	(Size = (int)(0.5 + dSize * pShape->asDouble(m_iLabel_Size))) > 0 )
+					if( Size > 0 )
 					{
-						Font.SetPointSize(Size);
-						dc.dc.SetFont(Font);
-
-						_Draw_Label(dc, pShape);
+						_Draw_Label(dc, Get_Shapes()->Get_Shape(iShape), Size);
 					}
 				}
 			}
@@ -1079,7 +1042,7 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 	//-----------------------------------------------------
 	else if( m_Edit_pShape )
 	{
-		_Edit_Shape_Draw(dc_Map);
+		Edit_Shape_Draw(dc_Map);
 	}
 
 	//-----------------------------------------------------
@@ -1087,6 +1050,54 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 	dc_Map.dc.SetPen  (wxNullPen);
 }
 
+//---------------------------------------------------------
+void CWKSP_Shapes::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)
+{
+	if( pShape && dc_Map.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+	{
+		Draw_Shape(dc_Map, pShape, Selection);
+
+		if( m_bVertices )
+		{
+			dc_Map.dc.SetPen  (*wxBLACK_PEN  );
+			dc_Map.dc.SetBrush(*wxWHITE_BRUSH);
+
+			for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+			{
+				for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+				{
+					TSG_Point_Int	A	= dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
+
+					dc_Map.dc.DrawCircle(A.x, A.y, 2);
+				}
+			}
+		}
+	}
+}
+
+//---------------------------------------------------------
+void CWKSP_Shapes::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int PointSize)
+{
+	if( pShape && dc_Map.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
+	{
+		wxString	Label(pShape->asString(m_iLabel, m_Label_Prec));	Label.Trim(true).Trim(false);
+
+		if( !Label.IsEmpty() )
+		{
+			if( PointSize > 0 && PointSize != dc_Map.dc.GetFont().GetPointSize() )
+			{
+				wxFont	Font(dc_Map.dc.GetFont());
+
+				Font.SetPointSize(PointSize);
+
+				dc_Map.dc.SetFont(Font);
+			}
+
+			Draw_Label(dc_Map, pShape, Label);
+		}
+	}
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -1095,7 +1106,7 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_Parameter * CWKSP_Shapes::_AttributeList_Add(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
+CSG_Parameter * CWKSP_Shapes::AttributeList_Add(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
 {
 	CSG_Parameter *pParameter;
 
@@ -1108,7 +1119,7 @@ CSG_Parameter * CWKSP_Shapes::_AttributeList_Add(CSG_Parameter *pNode, const CSG
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes::_AttributeList_Set(CSG_Parameter *pFields, bool bAddNoField)
+void CWKSP_Shapes::AttributeList_Set(CSG_Parameter *pFields, bool bAddNoField)
 {
 	if( pFields && pFields->Get_Type() == PARAMETER_TYPE_Choice )
 	{
@@ -1141,7 +1152,7 @@ void CWKSP_Shapes::_AttributeList_Set(CSG_Parameter *pFields, bool bAddNoField)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_Parameter * CWKSP_Shapes::_BrushList_Add(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
+CSG_Parameter * CWKSP_Shapes::BrushList_Add(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
 {
 	CSG_Parameter *pParameter;
 
@@ -1163,7 +1174,7 @@ CSG_Parameter * CWKSP_Shapes::_BrushList_Add(CSG_Parameter *pNode, const CSG_Str
 }
 
 //---------------------------------------------------------
-int CWKSP_Shapes::_BrushList_Get_Style(int Index)
+int CWKSP_Shapes::BrushList_Get_Style(int Index)
 {
 	switch( Index )
 	{
@@ -1180,7 +1191,7 @@ int CWKSP_Shapes::_BrushList_Get_Style(int Index)
 }
 
 //---------------------------------------------------------
-CSG_Parameter * CWKSP_Shapes::_PenList_Add(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
+CSG_Parameter * CWKSP_Shapes::PenList_Add(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description)
 {
 	CSG_Parameter *pParameter;
 
@@ -1199,7 +1210,7 @@ CSG_Parameter * CWKSP_Shapes::_PenList_Add(CSG_Parameter *pNode, const CSG_Strin
 }
 
 //---------------------------------------------------------
-int CWKSP_Shapes::_PenList_Get_Style(int Index)
+int CWKSP_Shapes::PenList_Get_Style(int Index)
 {
 	switch( Index )
 	{
@@ -1220,7 +1231,7 @@ int CWKSP_Shapes::_PenList_Get_Style(int Index)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::_Get_Class_Color(CSG_Shape *pShape, int &Color)
+bool CWKSP_Shapes::Get_Class_Color(CSG_Shape *pShape, int &Color)
 {
 	if( pShape && Get_Shapes() && m_iColor >= 0 )
 	{
@@ -1378,7 +1389,7 @@ bool CWKSP_Shapes::_Chart_Get_Options(void)
 //---------------------------------------------------------
 void CWKSP_Shapes::_Draw_Chart(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
 {
-	if( _Chart_is_Valid() )
+	if( dc_Map.m_rWorld.Intersects(pShape->Get_Extent()) != INTERSECTION_None )
 	{
 		int			s;
 		double		dSize	= m_Chart_sSize;
diff --git a/src/saga_core/saga_gui/wksp_shapes.h b/src/saga_core/saga_gui/wksp_shapes.h
index 31db204..98c7f67 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes.h 2017 2014-02-25 15:48:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -82,6 +82,21 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+enum
+{
+	EDIT_SHAPE_MODE_Normal	= 0,
+	EDIT_SHAPE_MODE_Split,
+	EDIT_SHAPE_MODE_Move
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 class CWKSP_Shapes : public CWKSP_Layer
 {
 public:
@@ -110,23 +125,26 @@ public:
 
 	bool						is_Editing				(void)	{	return( m_Edit_pShape != NULL );	}
 
+	virtual wxMenu *			Edit_Get_Menu			(void);
+	virtual TSG_Rect			Edit_Get_Extent			(void);
+	virtual bool				Edit_On_Key_Down		(int KeyCode);
+	virtual bool				Edit_On_Mouse_Down		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool				Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool				Edit_On_Mouse_Move		(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key);
+	virtual bool				Edit_Set_Index			(int Index);
+	virtual bool				Edit_Set_Attributes		(void);
+
 
 protected:
 
-	int							m_iColor, m_iLabel, m_iLabel_Size, m_Label_Prec, m_Label_Eff, m_iExtraInfo, m_Edit_iPart, m_Edit_iPoint, m_Chart_Type, m_Chart_sField, m_Chart_sType;
+	bool						m_bVertices;
 
-	double						m_Chart_sSize, m_Chart_sRange;
+	int							m_iColor, m_iLabel, m_Label_Prec, m_Label_Eff, m_Edit_Mode, m_Edit_iPart, m_Edit_iPoint;
 
 	wxColour					m_Def_Color, m_Edit_Color, m_Sel_Color, m_Label_Eff_Color;
 
-	CSG_Points_Int				m_Chart;
-
-	CSG_Parameters				m_Chart_Options;
-
 	CSG_Shape					*m_Edit_pShape;
 
-	CSG_Shapes					m_Edit_Shapes;
-
 	class CWKSP_Table			*m_pTable;
 
 
@@ -140,45 +158,62 @@ protected:
 
 	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
 
-	CSG_Parameter *				_AttributeList_Add		(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
-	void						_AttributeList_Set		(CSG_Parameter *pFields, bool bAddNoField);
+	bool						Get_Class_Color			(CSG_Shape *pShape, int &Color);
 
-	CSG_Parameter *				_BrushList_Add			(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
-	int							_BrushList_Get_Style	(int Index);
+	CSG_Parameter *				AttributeList_Add		(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
+	void						AttributeList_Set		(CSG_Parameter *pFields, bool bAddNoField);
 
-	CSG_Parameter *				_PenList_Add			(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
-	int							_PenList_Get_Style		(int Index);
+	CSG_Parameter *				BrushList_Add			(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
+	int							BrushList_Get_Style		(int Index);
 
-	virtual void				_Draw_Initialize		(CWKSP_Map_DC &dc_Map)										= 0;
-	virtual void				_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection)	= 0;
-	virtual void				_Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)					= 0;
+	CSG_Parameter *				PenList_Add				(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
+	int							PenList_Get_Style		(int Index);
 
-	bool						_Get_Class_Color		(CSG_Shape *pShape, int &Color);
+	virtual void				Draw_Initialize			(CWKSP_Map_DC &dc_Map)												= 0;
+	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)			= 0;
+	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)	= 0;
+
+	virtual void				Edit_Shape_Draw_Move	(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point, const TSG_Point &ptWorld);
+	virtual void				Edit_Shape_Draw_Move	(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point);
+	virtual void				Edit_Shape_Draw			(CWKSP_Map_DC &dc_Map);
+	virtual int					Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
+	virtual void				Edit_Snap_Point_ToLine	(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
+
+
+private:
+
+	void						_LUT_Create				(void);
+
+	void						_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection = 0);
+	void						_Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int PointSize = 0);
+
+
+	//-----------------------------------------------------
+	// Charts...
+
+	int							m_Chart_Type, m_Chart_sField, m_Chart_sType;
+
+	double						m_Chart_sSize, m_Chart_sRange;
+
+	CSG_Points_Int				m_Chart;
+
+	CSG_Parameters				m_Chart_Options;
 
-	void						_Draw_Chart				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape);
-	void						_Draw_Chart_Pie			(CWKSP_Map_DC &dc_Map, CSG_Table_Record *pRecord, bool bOutline, int x, int y, int size);
-	void						_Draw_Chart_Bar			(CWKSP_Map_DC &dc_Map, CSG_Table_Record *pRecord, bool bOutline, int x, int y, int sx, int sy);
 
 	bool						_Chart_is_Valid			(void)	{	return( m_Chart.Get_Count() > 0 );	}
 	bool						_Chart_Set_Options		(void);
 	bool						_Chart_Get_Options		(void);
 
+	void						_Draw_Chart				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape);
+	void						_Draw_Chart_Pie			(CWKSP_Map_DC &dc_Map, CSG_Table_Record *pRecord, bool bOutline, int x, int y, int size);
+	void						_Draw_Chart_Bar			(CWKSP_Map_DC &dc_Map, CSG_Table_Record *pRecord, bool bOutline, int x, int y, int sx, int sy);
+
 
 	//-----------------------------------------------------
 	// Editing...
 
-	virtual wxMenu *			On_Edit_Get_Menu		(void);
-	virtual TSG_Rect			On_Edit_Get_Extent		(void);
-	virtual bool				On_Edit_Set_Attributes	(void);
-
-	virtual bool				On_Edit_On_Key_Down		(int KeyCode);
-	virtual bool				On_Edit_On_Mouse_Down	(CSG_Point Point, double ClientToWorld, int Key);
-	virtual bool				On_Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
-	virtual bool				On_Edit_On_Mouse_Move	(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key);
-
-	void						_LUT_Create				(void);
+	CSG_Shapes					m_Edit_Shapes;
 
-	bool						_Edit_Set_Attributes	(void);
 
 	bool						_Edit_Shape				(void);
 	bool						_Edit_Shape_Start		(void);
@@ -189,18 +224,16 @@ protected:
 	bool						_Edit_Part_Add			(void);
 	bool						_Edit_Part_Del			(void);
 	bool						_Edit_Point_Del			(void);
+	bool						_Edit_Merge				(void);
+	bool						_Edit_Split				(void);
+	bool						_Edit_Move				(bool bToggle = true);
 
 	void						_Edit_Shape_Draw_Point	(wxDC &dc, TSG_Point_Int Point, bool bSelected);
 	void						_Edit_Shape_Draw_Point	(wxDC &dc, int x, int y, bool bSelected);
-	virtual void				_Edit_Shape_Draw_Move	(wxDC &dc, CSG_Rect rWorld, double ClientToWorld, wxPoint Point);
-	virtual void				_Edit_Shape_Draw		(CWKSP_Map_DC &dc_Map);
-
-	virtual int					_Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
 
 	void						_Edit_Snap_Point		(CSG_Point &Point, double ClientToWorld);
 	void						_Edit_Snap_Point		(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shapes *pShapes, bool bLine);
 	void						_Edit_Snap_Point		(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
-	virtual void				_Edit_Snap_Point_ToLine (CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
 
 };
 
diff --git a/src/saga_core/saga_gui/wksp_shapes_edit.cpp b/src/saga_core/saga_gui/wksp_shapes_edit.cpp
index 4628da8..7a59b2c 100644
--- a/src/saga_core/saga_gui/wksp_shapes_edit.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_edit.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_edit.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_edit.cpp 2081 2014-04-03 09:55:43Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -96,24 +96,59 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-wxMenu * CWKSP_Shapes::On_Edit_Get_Menu(void)
+wxMenu * CWKSP_Shapes::Edit_Get_Menu(void)
 {
 	wxMenu	*pMenu	= new wxMenu;
 
 	CMD_Menu_Add_Item(pMenu, true , ID_CMD_SHAPES_EDIT_SHAPE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_ADD_SHAPE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_SHAPE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_ADD_PART);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_PART);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_POINT);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_CLEAR);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_INVERT);
+
+	if( !is_Editing() )
+	{
+		pMenu->AppendSeparator();
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_ADD_SHAPE);
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_SHAPE);
+		pMenu->AppendSeparator();
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_INVERT);
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_CLEAR);
+
+		if( Get_Shapes()->Get_Selection_Count()  > 1
+		&&  Get_Shapes()->Get_Type() != SHAPE_TYPE_Point )
+		{
+			pMenu->AppendSeparator();
+			CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_MERGE);
+		}
+
+		if( Get_Shapes()->Get_Selection_Count() == 1
+		&& (Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon
+		||  Get_Shapes()->Get_Type() == SHAPE_TYPE_Line) )
+		{
+			pMenu->AppendSeparator();
+			CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SPLIT);
+		}
+	}
+	else if( Get_Shapes()->Get_Type() != SHAPE_TYPE_Point )
+	{
+		pMenu->AppendSeparator();
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_ADD_PART);
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_PART);
+		CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_POINT);
+
+		pMenu->AppendSeparator();
+
+		if( Get_Shapes()->Get_Type() == SHAPE_TYPE_Line
+		||  Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon )
+		{
+			CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SPLIT);
+		}
+
+		CMD_Menu_Add_Item(pMenu,  true, ID_CMD_SHAPES_EDIT_MOVE);
+	}
 
 	return( pMenu );
 }
 
 //---------------------------------------------------------
-TSG_Rect CWKSP_Shapes::On_Edit_Get_Extent(void)
+TSG_Rect CWKSP_Shapes::Edit_Get_Extent(void)
 {
 	if( m_Edit_pShape )
 	{
@@ -136,7 +171,7 @@ TSG_Rect CWKSP_Shapes::On_Edit_Get_Extent(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::On_Edit_On_Key_Down(int KeyCode)
+bool CWKSP_Shapes::Edit_On_Key_Down(int KeyCode)
 {
 	switch( KeyCode )
 	{
@@ -169,41 +204,77 @@ bool CWKSP_Shapes::On_Edit_On_Key_Down(int KeyCode)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::On_Edit_On_Mouse_Down(CSG_Point Point, double ClientToWorld, int Key)
+bool CWKSP_Shapes::Edit_On_Mouse_Down(CSG_Point Point, double ClientToWorld, int Key)
 {
-	int		iPart, iPoint;
+	CWKSP_Layer::Edit_On_Mouse_Down(Point, ClientToWorld, Key);
+
+	if( !(Key & MODULE_INTERACTIVE_KEY_LEFT) )
+	{
+		return( false );
+	}
 
 	//-----------------------------------------------------
-	if( m_Edit_pShape )
+	switch( m_Edit_Mode )
 	{
-		if( m_Edit_iPart >= 0 && m_Edit_iPoint < 0 )
+	case EDIT_SHAPE_MODE_Split:
+		if( m_Edit_Shapes.Get_Count() > 1 )
 		{
+			m_Edit_Shapes.Get_Shape(1)->Add_Point(Point);
+
+			Update_Views(false);
+
+			return( true );
 		}
-		else switch( _Edit_Shape_HitTest(Point, EDIT_TICKMARK_SIZE * ClientToWorld, iPart, iPoint) )
+		break;
+
+	case EDIT_SHAPE_MODE_Move:
+		if( m_Edit_Shapes.Get_Count() > 1 && m_Edit_Shapes.Get_Shape(1)->Get_Point_Count() == 0 )
 		{
-		//-------------------------------------------------
-		case 0:	default:
-		case 1:
-			if( m_Edit_iPart != iPart || m_Edit_iPoint != iPoint )
-			{
-				m_Edit_iPart	= iPart;
-				m_Edit_iPoint	= iPoint;
+			m_Edit_Shapes.Get_Shape(1)->Add_Point(Point);
 
-				Update_Views(false);
+			return( true );
+		}
+		break;
+
+	case EDIT_SHAPE_MODE_Normal: default:
+		if( m_Edit_pShape )
+		{
+			if( m_Edit_iPart >= 0 && m_Edit_iPoint < 0 )
+			{
+				// NOP
 			}
+			else
+			{
+				int		iPart, iPoint;
 
-			return( true );
+				switch( Edit_Shape_HitTest(Point, EDIT_TICKMARK_SIZE * ClientToWorld, iPart, iPoint) )
+				{
+				//-----------------------------------------
+				case 0:	default:
+				case 1:
+					if( m_Edit_iPart != iPart || m_Edit_iPoint != iPoint )
+					{
+						m_Edit_iPart	= iPart;
+						m_Edit_iPoint	= iPoint;
 
-		//-------------------------------------------------
-		case 2:
-			m_Edit_pShape->Ins_Point(Point, iPoint, iPart);
+						Update_Views(false);
+					}
 
-			m_Edit_iPart	= iPart;
-			m_Edit_iPoint	= iPoint;
+					return( true );
 
-			Update_Views(false);
+				//-----------------------------------------
+				case 2:
+					m_Edit_pShape->Ins_Point(Point, iPoint, iPart);
 
-			return( true );
+					m_Edit_iPart	= iPart;
+					m_Edit_iPoint	= iPoint;
+
+					Update_Views(false);
+
+					return( true );
+				}
+			}
+			break;
 		}
 	}
 
@@ -212,30 +283,42 @@ bool CWKSP_Shapes::On_Edit_On_Mouse_Down(CSG_Point Point, double ClientToWorld,
 }
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
+bool CWKSP_Shapes::Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
 {
-	CSG_Rect		rWorld(m_Edit_Mouse_Down, Point);
-	CSG_Table_Record	*pRecord;
-	wxFileName		FileName;
-
-
 	//-----------------------------------------------------
 	if( Key & MODULE_INTERACTIVE_KEY_RIGHT )
 	{
-		if( m_Edit_pShape && m_Edit_iPart >= 0 && m_Edit_iPoint < 0 )
+		switch( m_Edit_Mode )
 		{
-			m_Edit_iPart	= -1;
+		case EDIT_SHAPE_MODE_Split:
+			return( _Edit_Split() );
 
-			Update_Views(false);
+		case EDIT_SHAPE_MODE_Normal:
+			if( m_Edit_pShape && m_Edit_iPart >= 0 && m_Edit_iPoint < 0 )
+			{
+				m_Edit_iPart	= -1;
 
-			return( true );
+				Update_Views(false);
+
+				return( true );
+			}
+			break;
 		}
 	}
 
 	//-----------------------------------------------------
 	else if( m_Edit_pShape )
 	{
-		if( m_Edit_iPart >= 0 )
+		if( m_Edit_Mode == EDIT_SHAPE_MODE_Move )
+		{
+			if( m_Edit_Shapes.Get_Count() > 1 && m_Edit_Shapes.Get_Shape(1)->Get_Point_Count() > 0 )
+			{
+				m_Edit_Shapes.Get_Shape(1)->Add_Point(Point);
+
+				return( _Edit_Move(false) );
+			}
+		}
+		else if( m_Edit_iPart >= 0 )
 		{
 			if( m_Edit_iPoint >= 0 )
 			{
@@ -264,33 +347,31 @@ bool CWKSP_Shapes::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, in
 	}
 
 	//-----------------------------------------------------
-	else
+	else if( m_Edit_Mode == EDIT_SHAPE_MODE_Normal )
 	{
-		rWorld.Assign(m_Edit_Mouse_Down, Point);
+		g_pACTIVE->Get_Attributes()->Save_Changes(true);
+
+		CSG_Rect	rWorld(m_Edit_Mouse_Down, Point);
 
 		if( rWorld.Get_XRange() == 0.0 && rWorld.Get_YRange() == 0.0 )
 		{
 			rWorld.Inflate(2.0 * ClientToWorld, false);
 		}
 
-		g_pACTIVE->Get_Attributes()->Set_Attributes();
+		int		Count	= Get_Shapes()->Get_Selection_Count();
 
-		pRecord	= Get_Shapes()->Get_Selection();
-		
 		Get_Shapes()->Select(rWorld, (Key & MODULE_INTERACTIVE_KEY_CTRL) != 0);
 
+		Edit_Set_Index((Key & MODULE_INTERACTIVE_KEY_CTRL) == 0 ? 0 :
+			Count < Get_Shapes()->Get_Selection_Count() || m_Edit_Index >= Get_Shapes()->Get_Selection_Count()
+			? Get_Shapes()->Get_Selection_Count() - 1 : m_Edit_Index
+		);
+
 		if( m_pTable->Get_View() )
 		{
 			m_pTable->Get_View()->Update_Selection();
 		}
 
-		if( pRecord != Get_Shapes()->Get_Selection() )
-		{
-			_Edit_Set_Attributes();
-		}
-
-		pRecord	= Get_Shapes()->Get_Selection();
-
 		Update_Views(false);
 
 		return( true );
@@ -300,49 +381,57 @@ bool CWKSP_Shapes::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, in
 }
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::On_Edit_On_Mouse_Move(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key)
+bool CWKSP_Shapes::Edit_On_Mouse_Move(wxWindow *pMap, CSG_Rect rWorld, wxPoint pt, wxPoint ptLast, int Key)
 {
-	if( m_Edit_pShape )
+	switch( m_Edit_Mode )
 	{
-		double	ClientToWorld	= rWorld.Get_XRange() / (double)pMap->GetClientSize().x;
-
-		//-------------------------------------------------
-		if( m_Edit_iPart >= 0 && (m_Edit_iPoint < 0 || Key & MODULE_INTERACTIVE_KEY_LEFT) )
+	case EDIT_SHAPE_MODE_Split:
+	case EDIT_SHAPE_MODE_Move:
 		{
-			if( pt.x != ptLast.x || pt.y != ptLast.y )
+			CSG_Shape	*pShape	= m_Edit_Shapes.Get_Shape(1);
+
+			if( pShape && pShape->Get_Point_Count() > 0 && (pt.x != ptLast.x || pt.y != ptLast.y) )
 			{
-				wxClientDC	dc(pMap);
-				dc.SetLogicalFunction(wxINVERT);
+				wxClientDC	dc(pMap);	dc.SetLogicalFunction(wxINVERT);
 
-				_Edit_Shape_Draw_Move(dc, rWorld, ClientToWorld, ptLast);
-				_Edit_Shape_Draw_Move(dc, rWorld, ClientToWorld, pt);
+				Edit_Shape_Draw_Move(dc, rWorld, ptLast, pShape->Get_Point(0, 0, false));
+				Edit_Shape_Draw_Move(dc, rWorld, pt    , pShape->Get_Point(0, 0, false));
 			}
 
 			return( true );
 		}
 
-		//-------------------------------------------------
-		else
+	//-----------------------------------------------------
+	case EDIT_SHAPE_MODE_Normal: default:
+		if( m_Edit_pShape )
 		{
-			int			iPart, iPoint;
-			CSG_Point	Point(rWorld.Get_XMin() + pt.x * ClientToWorld, rWorld.Get_YMax() - pt.y * ClientToWorld);
-
-			switch( _Edit_Shape_HitTest(Point, EDIT_TICKMARK_SIZE * ClientToWorld, iPart, iPoint) )
+			//---------------------------------------------
+			if( m_Edit_iPart >= 0 && (m_Edit_iPoint < 0 || Key & MODULE_INTERACTIVE_KEY_LEFT) && (pt.x != ptLast.x || pt.y != ptLast.y) )
 			{
-			case 0:	default:
-				pMap->SetCursor(IMG_Get_Cursor(ID_IMG_CRS_SELECT));
-				break;
+				wxClientDC	dc(pMap);	dc.SetLogicalFunction(wxINVERT);
 
-			case 1:
-				pMap->SetCursor(IMG_Get_Cursor(ID_IMG_CRS_EDIT_POINT_MOVE));
-				break;
+				Edit_Shape_Draw_Move(dc, rWorld, ptLast);
+				Edit_Shape_Draw_Move(dc, rWorld, pt);
 
-			case 2:
-				pMap->SetCursor(IMG_Get_Cursor(ID_IMG_CRS_EDIT_POINT_ADD));
-				break;
+				return( true );
 			}
 
-			return( true );
+			//---------------------------------------------
+			else
+			{
+				int			iPart, iPoint;
+				double		ClientToWorld	= rWorld.Get_XRange() / (double)pMap->GetClientSize().x;
+				CSG_Point	Point(rWorld.Get_XMin() + pt.x * ClientToWorld, rWorld.Get_YMax() - pt.y * ClientToWorld);
+
+				switch( Edit_Shape_HitTest(Point, EDIT_TICKMARK_SIZE * ClientToWorld, iPart, iPoint) )
+				{
+				default:	pMap->SetCursor(IMG_Get_Cursor(ID_IMG_CRS_SELECT         ));	break;
+				case  1:	pMap->SetCursor(IMG_Get_Cursor(ID_IMG_CRS_EDIT_POINT_MOVE));	break;
+				case  2:	pMap->SetCursor(IMG_Get_Cursor(ID_IMG_CRS_EDIT_POINT_ADD ));	break;
+				}
+
+				return( true );
+			}
 		}
 	}
 
@@ -357,37 +446,50 @@ bool CWKSP_Shapes::On_Edit_On_Mouse_Move(wxWindow *pMap, CSG_Rect rWorld, wxPoin
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::_Edit_Set_Attributes(void)
+bool CWKSP_Shapes::Edit_Set_Index(int Index)
 {
-	CSG_Table_Record	*pAttribute, *pRecord;
-
 	m_Edit_Attributes.Del_Records();
 
-	if( (pRecord = Get_Shapes()->Get_Selection()) != NULL )
+	if( Index > Get_Shapes()->Get_Selection_Count() )
+	{
+		Index	= Get_Shapes()->Get_Selection_Count();
+	}
+
+	CSG_Table_Record	*pSelection	= Get_Shapes()->Get_Selection(Index);
+
+	if( pSelection )
 	{
+		m_Edit_Index	= Index;
+
 		for(int i=0; i<Get_Shapes()->Get_Field_Count(); i++)
 		{
-			pAttribute	= m_Edit_Attributes.Add_Record();
-			pAttribute->Set_Value(0, pRecord->Get_Table()->Get_Field_Name(i));
-			pAttribute->Set_Value(1, pRecord->asString(i));
+			CSG_Table_Record	*pRecord	= m_Edit_Attributes.Add_Record();
+
+			pRecord->Set_Value(0, pSelection->Get_Table()->Get_Field_Name(i));
+			pRecord->Set_Value(1, pSelection->asString(i));
 		}
 	}
-
-	g_pACTIVE->Get_Attributes()->Set_Attributes();
+	else
+	{
+		m_Edit_Index	= 0;
+	}
 
 	return( true );
 }
 
 //---------------------------------------------------------
-bool CWKSP_Shapes::On_Edit_Set_Attributes(void)
+bool CWKSP_Shapes::Edit_Set_Attributes(void)
 {
-	CSG_Table_Record	*pRecord;
+	CSG_Table_Record	*pSelection	= Get_Shapes()->Get_Selection(m_Edit_Index);
 
-	if( (pRecord = Get_Shapes()->Get_Selection()) != NULL )
+	if( pSelection )
 	{
 		for(int i=0; i<m_Edit_Attributes.Get_Record_Count(); i++)
 		{
-			pRecord->Set_Value(i, m_Edit_Attributes.Get_Record(i)->asString(1));
+			if( !pSelection->Set_Value(i, m_Edit_Attributes.Get_Record(i)->asString(1)) )
+			{
+				m_Edit_Attributes.Get_Record(i)->Set_Value(1, pSelection->asString(i));
+			}
 		}
 
 		Update_Views(false);
@@ -406,6 +508,245 @@ bool CWKSP_Shapes::On_Edit_Set_Attributes(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+bool CWKSP_Shapes::_Edit_Merge(void)
+{
+	if( Get_Shapes()->Get_Selection_Count() < 2 || Get_Shapes()->Get_Type() == SHAPE_TYPE_Point )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Shape	*pMerged	= Get_Shapes()->Get_Selection(0);
+
+	for(int i=1; i<Get_Shapes()->Get_Selection_Count(); i++)
+	{
+		CSG_Shape	*pShape	= Get_Shapes()->Get_Selection(i);
+
+		for(int iPart=0, jPart=pMerged->Get_Part_Count(); iPart<pShape->Get_Part_Count(); iPart++, jPart++)
+		{
+			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			{
+				pMerged->Add_Point(pShape->Get_Point(iPoint, iPart), jPart);
+			}
+		}
+	}
+
+	if( Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon )
+	{
+		SG_Polygon_Dissolve(pMerged);
+	}
+
+	Get_Shapes()->Select(pMerged, true);
+	Get_Shapes()->Del_Selection();
+	Get_Shapes()->Select(pMerged, false);
+
+	Update_Views(true);
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Shapes::_Edit_Split(void)
+{
+	if( Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon
+	||  Get_Shapes()->Get_Type() == SHAPE_TYPE_Line )
+	{
+		switch( m_Edit_Mode )
+		{
+		default:
+			break;
+
+		//-------------------------------------------------
+		case EDIT_SHAPE_MODE_Normal:
+			m_Edit_Mode	= EDIT_SHAPE_MODE_Split;
+
+			if( m_Edit_Shapes.Get_Count() == 0 )
+			{
+				m_Edit_Shapes.Add_Shape(Get_Shapes()->Get_Selection());
+			}
+
+			if( m_Edit_Shapes.Get_Count() > 1 )
+			{
+				m_Edit_Shapes.Get_Shape(1)->Del_Parts();
+			}
+			else
+			{
+				m_Edit_Shapes.Add_Shape();
+			}
+
+			return( true );
+
+		//-------------------------------------------------
+		case EDIT_SHAPE_MODE_Split:
+			m_Edit_Mode	= EDIT_SHAPE_MODE_Normal;
+
+			CSG_Module	*pModule	= Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon
+			?	SG_Get_Module_Library_Manager().Get_Module(SG_T("shapes_polygons"), 8)	// Polygon-Line Intersection
+			:	SG_Get_Module_Library_Manager().Get_Module(SG_T("shapes_lines"   ), 6); // Split Lines with Lines
+
+			if(	pModule )
+			{
+				CSG_Shapes	Line(SHAPE_TYPE_Line), Split(Get_Shapes()->Get_Type());
+
+				Line.Add_Shape();
+
+				for(int i=0; i<m_Edit_Shapes.Get_Shape(1)->Get_Point_Count(); i++)
+				{
+					Line.Get_Shape(0)->Add_Point(m_Edit_Shapes.Get_Shape(1)->Get_Point(i));
+				}
+
+				m_Edit_Shapes.Del_Shape(1);
+
+				//-----------------------------------------
+				bool	bResult;
+
+				CSG_Parameters	P; P.Assign(pModule->Get_Parameters());
+
+				pModule->Set_Manager(NULL);
+
+				if( Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon )
+				{
+					bResult	= pModule->Get_Parameters()->Set_Parameter("POLYGONS" , &m_Edit_Shapes)
+						&&    pModule->Get_Parameters()->Set_Parameter("LINES"    , &Line)
+						&&    pModule->Get_Parameters()->Set_Parameter("INTERSECT", &Split)
+						&&    pModule->Execute();
+				}
+				else //	if( Get_Shapes()->Get_Type() == SHAPE_TYPE_Line )
+				{
+					bResult	= pModule->Get_Parameters()->Set_Parameter("LINES"    , &m_Edit_Shapes)
+						&&    pModule->Get_Parameters()->Set_Parameter("SPLIT"    , &Line)
+						&&    pModule->Get_Parameters()->Set_Parameter("INTERSECT", &Split)
+						&&    pModule->Execute();
+				}
+
+				//-----------------------------------------
+				if( bResult )
+				{
+					if( m_Edit_pShape )
+					{
+						m_Edit_pShape->Assign(Split.Get_Shape(0), false);
+
+						for(int iSplit=1; iSplit<Split.Get_Count(); iSplit++)
+						{
+							CSG_Shape	*pSplit	= Split.Get_Shape(iSplit);
+
+							for(int iPart=0; iPart<pSplit->Get_Part_Count(); iPart++)
+							{
+								for(int iPoint=0, jPart=m_Edit_pShape->Get_Part_Count(); iPoint<pSplit->Get_Point_Count(iPart); iPoint++)
+								{
+									m_Edit_pShape->Add_Point(pSplit->Get_Point(iPoint, iPart), jPart);
+								}
+							}
+						}
+					}
+					else if( Get_Shapes()->Get_Selection_Count() == 1 ) // if( !m_Edit_pShape )
+					{
+						CSG_Shape	*pSelection	= Get_Shapes()->Get_Selection();
+						
+						pSelection->Assign(Split.Get_Shape(0), false);
+
+						for(int iSplit=1; iSplit<Split.Get_Count(); iSplit++)
+						{
+							CSG_Shape	*pSplit	= Get_Shapes()->Add_Shape(Split.Get_Shape(iSplit));
+
+							((CSG_Table_Record *)pSplit)->Assign(pSelection);
+
+							Get_Shapes()->Select(pSplit, true);
+						}
+
+						m_Edit_Shapes.Del_Shapes();
+					}
+				}
+
+				pModule->Get_Parameters()->Assign_Values(&P);
+				pModule->Set_Manager(P.Get_Manager());
+			}
+
+			Update_Views(false);
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Shapes::_Edit_Move(bool bToggle)
+{
+	if( m_Edit_pShape )
+	{
+		if( bToggle )
+		{
+			switch( m_Edit_Mode )
+			{
+			default:
+				break;
+
+			//---------------------------------------------
+			case EDIT_SHAPE_MODE_Normal:
+				m_Edit_Mode	= EDIT_SHAPE_MODE_Move;
+
+				if( m_Edit_Shapes.Get_Count() > 1 )
+				{
+					m_Edit_Shapes.Get_Shape(1)->Del_Parts();
+				}
+				else
+				{
+					m_Edit_Shapes.Add_Shape();
+				}
+
+				return( true );
+
+			//---------------------------------------------
+			case EDIT_SHAPE_MODE_Move:
+				m_Edit_Mode	= EDIT_SHAPE_MODE_Normal;
+
+				m_Edit_Shapes.Del_Shape(1);
+
+				return( true );
+			}
+		}
+
+		//-------------------------------------------------
+		else // if( !bToggle )
+		{
+			if( m_Edit_Shapes.Get_Count() > 1 && m_Edit_Shapes.Get_Shape(1)->Get_Point_Count() > 1 )
+			{
+				CSG_Point	Move	= CSG_Point(m_Edit_Shapes.Get_Shape(1)->Get_Point(1))
+									- CSG_Point(m_Edit_Shapes.Get_Shape(1)->Get_Point(0));
+
+				m_Edit_Shapes.Get_Shape(1)->Del_Parts();
+
+				if( SG_Get_Length(Move.Get_X(), Move.Get_Y()) > 0.0 )
+				{
+					for(int iPart=0; iPart<m_Edit_pShape->Get_Part_Count(); iPart++)
+					{
+						for(int iPoint=0; iPoint<m_Edit_pShape->Get_Point_Count(iPart); iPoint++)
+						{
+							m_Edit_pShape->Set_Point(Move + m_Edit_pShape->Get_Point(iPoint, iPart), iPoint, iPart);
+						}
+					}
+
+					Update_Views(false);
+
+					return( true );
+				}
+			}
+		}
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 bool CWKSP_Shapes::_Edit_Shape(void)
 {
 	return( m_Edit_pShape ? _Edit_Shape_Stop() : _Edit_Shape_Start() );
@@ -414,10 +755,11 @@ bool CWKSP_Shapes::_Edit_Shape(void)
 //---------------------------------------------------------
 bool CWKSP_Shapes::_Edit_Shape_Start(void)
 {
-	if( m_Edit_pShape == NULL && Get_Shapes()->Get_Selection(0) != NULL )
+	if( m_Edit_pShape == NULL && Get_Shapes()->Get_Selection(m_Edit_Index) != NULL )
 	{
-		m_Edit_pShape	= m_Edit_Shapes.Add_Shape();
-		m_Edit_pShape->Assign(Get_Shapes()->Get_Selection(0), false);
+		m_Edit_Mode		= EDIT_SHAPE_MODE_Normal;
+
+		m_Edit_pShape	= m_Edit_Shapes.Add_Shape(Get_Shapes()->Get_Selection(m_Edit_Index), SHAPE_COPY_GEOM);
 
 		m_Edit_iPart	= -1;
 		m_Edit_iPoint	= -1;
@@ -442,14 +784,13 @@ bool CWKSP_Shapes::_Edit_Shape_Stop(bool bSave)
 	{
 		if( bSave )
 		{
-			CSG_Shape	*pShape;
+			CSG_Shape	*pShape	= Get_Shapes()->Get_Selection(m_Edit_Index);
 
-			if( (pShape = Get_Shapes()->Get_Selection(0)) == NULL )
+			if( pShape == NULL )
 			{
-				if( (pShape = Get_Shapes()->Add_Shape()) != NULL )
-				{
-					Get_Shapes()->Select(pShape);
-				}
+				Get_Shapes()->Select(pShape = Get_Shapes()->Add_Shape());
+
+				m_Edit_Index	= 0;
 			}
 
 			if( pShape != NULL )
@@ -460,9 +801,11 @@ bool CWKSP_Shapes::_Edit_Shape_Stop(bool bSave)
 
 		m_Edit_Shapes.Del_Shapes();
 		m_Edit_pShape	= NULL;
+		m_Edit_Mode		= EDIT_SHAPE_MODE_Normal;
+
+		Edit_Set_Index(m_Edit_Index);
 
 		Update_Views();
-		_Edit_Set_Attributes();
 
 		return( true );
 	}
@@ -477,7 +820,7 @@ bool CWKSP_Shapes::_Edit_Shape_Add(void)
 	{
 		if( Get_Shapes()->Get_Selection_Count() > 0 )
 		{
-			Get_Shapes()->Select((CSG_Shape*)NULL);
+			Get_Shapes()->Select();	// deselect
 		}
 
 		m_Edit_pShape	= m_Edit_Shapes.Add_Shape();
@@ -515,13 +858,15 @@ bool CWKSP_Shapes::_Edit_Shape_Del(void)
 			{
 				_Edit_Shape_Stop(false);
 
-				Get_Shapes()->Del_Shape(Get_Shapes()->Get_Selection(0));
+				Get_Shapes()->Del_Shape(Get_Shapes()->Get_Selection(m_Edit_Index));
 			}
 			else
 			{
 				Get_Shapes()->Del_Selection();
 			}
 
+			Edit_Set_Index(0);
+
 			Update_Views();
 
 			return( true );
@@ -634,13 +979,24 @@ void CWKSP_Shapes::_Edit_Shape_Draw_Point(wxDC &dc, int x, int y, bool bSelected
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes::_Edit_Shape_Draw_Move(wxDC &dc, CSG_Rect rWorld, double ClientToWorld, wxPoint Point)
+void CWKSP_Shapes::Edit_Shape_Draw_Move(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point)
 {
 	_Edit_Shape_Draw_Point(dc, Point.x, Point.y, false);
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes::_Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
+void CWKSP_Shapes::Edit_Shape_Draw_Move(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point, const TSG_Point &ptWorld)
+{
+	double	ClientToWorld	= rWorld.Get_XRange() / (double)dc.GetSize().x;
+
+	dc.DrawLine(Point.x, Point.y,
+		(int)((ptWorld.x - rWorld.Get_XMin()) / ClientToWorld),
+		(int)((rWorld.Get_YMax() - ptWorld.y) / ClientToWorld)
+	);
+}
+
+//---------------------------------------------------------
+void CWKSP_Shapes::Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
 {
 	int		iPart, iPoint;
 
@@ -719,7 +1075,7 @@ void CWKSP_Shapes::_Edit_Snap_Point(CSG_Point &Point, double ClientToWorld)
 //---------------------------------------------------------
 void CWKSP_Shapes::_Edit_Snap_Point(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shapes *pShapes, bool bLine)
 {
-	CSG_Shape	*pSelected	= pShapes->Get_Selection();
+	CSG_Shape	*pSelected	= pShapes->Get_Selection(m_Edit_Index);
 
 	if( pShapes->Select(CSG_Rect(Point.Get_X() - snap_Dist, Point.Get_Y() - snap_Dist, Point.Get_X() + snap_Dist, Point.Get_Y() + snap_Dist)) )
 	{
@@ -729,11 +1085,11 @@ void CWKSP_Shapes::_Edit_Snap_Point(CSG_Point Point, CSG_Point &snap_Point, doub
 			{
 				if( bLine )
 				{
-					_Edit_Snap_Point_ToLine(Point, snap_Point, snap_Dist, pShapes->Get_Selection(i));
+					Edit_Snap_Point_ToLine(Point, snap_Point, snap_Dist, pShapes->Get_Selection(i));
 				}
 				else
 				{
-					_Edit_Snap_Point       (Point, snap_Point, snap_Dist, pShapes->Get_Selection(i));
+					_Edit_Snap_Point      (Point, snap_Point, snap_Dist, pShapes->Get_Selection(i));
 				}
 			}
 		}
@@ -768,9 +1124,8 @@ void CWKSP_Shapes::_Edit_Snap_Point(CSG_Point pos_Point, CSG_Point &snap_Point,
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes::_Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape)
-{
-}
+void CWKSP_Shapes::Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape)
+{}
 
 
 ///////////////////////////////////////////////////////////
@@ -780,7 +1135,7 @@ void CWKSP_Shapes::_Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-int CWKSP_Shapes::_Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist, int &pos_iPart, int &pos_iPoint)
+int CWKSP_Shapes::Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist, int &pos_iPart, int &pos_iPoint)
 {
 	int			Result, iPart, iPoint;
 	double		d, dx, dy;
diff --git a/src/saga_core/saga_gui/wksp_shapes_line.cpp b/src/saga_core/saga_gui/wksp_shapes_line.cpp
index d1e4f07..15f6a68 100644
--- a/src/saga_core/saga_gui/wksp_shapes_line.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_line.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_line.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_line.cpp 2017 2014-02-25 15:48:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -137,7 +137,7 @@ void CWKSP_Shapes_Line::On_Create_Parameters(void)
 		), 0
 	);
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("NODE_SIZE")		, "SIZE_ATTRIB"		, _TL("Attribute"),
 		_TL("")
 	);
@@ -167,7 +167,7 @@ void CWKSP_Shapes_Line::On_DataObject_Changed(void)
 {
 	CWKSP_Shapes::On_DataObject_Changed();
 
-	_AttributeList_Set(m_Parameters("SIZE_ATTRIB"), true);
+	AttributeList_Set(m_Parameters("SIZE_ATTRIB"), true);
 }
 
 //---------------------------------------------------------
@@ -193,7 +193,7 @@ void CWKSP_Shapes_Line::On_Parameters_Changed(void)
 	//-----------------------------------------------------
 	m_Pen		= wxPen(m_Def_Color, (int)m_Size, m_Line_Style);
 
-	m_bPoints	= m_Parameters("DISPLAY_POINTS")->asBool();
+	m_bVertices	= m_Parameters("DISPLAY_POINTS")->asBool();
 }
 
 
@@ -257,7 +257,7 @@ bool CWKSP_Shapes_Line::Get_Style_Size(int &min_Size, int &max_Size, double &min
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Line::_Draw_Initialize(CWKSP_Map_DC &dc_Map)
+void CWKSP_Shapes_Line::Draw_Initialize(CWKSP_Map_DC &dc_Map)
 {
 	switch( m_Parameters("LINE_STYLE")->asInt() )
 	{
@@ -283,7 +283,7 @@ void CWKSP_Shapes_Line::_Draw_Initialize(CWKSP_Map_DC &dc_Map)
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Line::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection)
+void CWKSP_Shapes_Line::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)
 {
 	if( m_iSize >= 0 && pShape->is_NoData(m_iSize) )
 	{
@@ -291,16 +291,16 @@ void CWKSP_Shapes_Line::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, boo
 	}
 
 	//-----------------------------------------------------
-	if( bSelection )
+	if( Selection )
 	{
-		dc_Map.dc.SetPen(wxPen(m_Sel_Color, m_Size + (pShape == Get_Shapes()->Get_Selection(0) ? 2 : 0), m_Line_Style));
+		dc_Map.dc.SetPen(wxPen(m_Sel_Color, m_Size + (Selection == 1 ? 2 : 0), m_Line_Style));
 	}
 	else if( m_iColor >= 0 || m_iSize >= 0 )
 	{
 		int		Color;
 		wxPen	Pen(m_Pen);
 
-		if( _Get_Class_Color(pShape, Color) )
+		if( Get_Class_Color(pShape, Color) )
 		{
 			Pen.SetColour(SG_GET_R(Color), SG_GET_G(Color), SG_GET_B(Color));
 		}
@@ -324,42 +324,23 @@ void CWKSP_Shapes_Line::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, boo
 	}
 
 	//-----------------------------------------------------
-	int				iPart, iPoint;
-	TSG_Point_Int	A, B;
-
-	for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+	for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
 	{
 		if( pShape->Get_Point_Count(iPart) > 1 )
 		{
-			A		= dc_Map.World2DC(pShape->Get_Point(0, iPart));
+			TSG_Point_Int	B, A	= dc_Map.World2DC(pShape->Get_Point(0, iPart));
 
-			for(iPoint=1; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			for(int iPoint=1; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
 			{
-				B		= A;
-				A		= dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
+				B	= A;	A	= dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
 
 				dc_Map.dc.DrawLine(A.x, A.y, B.x, B.y);
 			}
 		}
 	}
 
-	if( m_bPoints )
-	{
-		dc_Map.dc.SetPen(*wxBLACK_PEN);
-		dc_Map.dc.SetBrush(*wxWHITE_BRUSH);
-
-		for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
-		{
-			for(iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
-			{
-				A		= dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
-				dc_Map.dc.DrawCircle(A.x, A.y, 2);
-			}
-		}
-	}
-
 	//-----------------------------------------------------
-	if( bSelection )
+	if( Selection )
 	{
 		dc_Map.dc.SetPen(m_Pen);
 	}
@@ -369,27 +350,24 @@ void CWKSP_Shapes_Line::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, boo
 #define GET_ANGLE(a, b)	M_RAD_TO_DEG * (b.x != a.x ? M_PI_180 - atan2((double)(b.y - a.y), (double)(b.x - a.x)) : (b.y > a.y ? M_PI_270 : (b.y < a.y ? M_PI_090 : 0.0)))
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Line::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
+void CWKSP_Shapes_Line::Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
 {
-	bool			bLabel;
-	int				iPart, iPoint;
-	double			d;
-	TSG_Point_Int	A, B;
-	wxCoord			sx, sy;
-	wxString		s(pShape->asString(m_iLabel, m_Label_Prec));	s.Trim(true).Trim(false);
+	wxCoord			Width, Height;
 
-	m_Label_Freq	= 10;
+	dc_Map.dc.GetTextExtent(Label, &Width, &Height);
 
-	dc_Map.dc.GetTextExtent(s, &sx, &sy);
+	m_Label_Freq	= 10;
 
 	//-----------------------------------------------------
-	for(iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+	for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
 	{
-		if( dc_Map.m_World2DC * ((CSG_Shape_Line *)pShape)->Get_Length(iPart) > (2 * m_Label_Freq) * sx )
+		if( dc_Map.m_World2DC * ((CSG_Shape_Line *)pShape)->Get_Length(iPart) > (2 * m_Label_Freq) * Width )
 		{
-			A		= dc_Map.World2DC(pShape->Get_Point(0, iPart));
+			bool			bLabel	= false;
+			double			d		= 0.0;
+			TSG_Point_Int	B, A	= dc_Map.World2DC(pShape->Get_Point(0, iPart));
 
-			for(iPoint=1, d=0.0, bLabel=false; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			for(int iPoint=1; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
 			{
 				//-----------------------------------------
 				if( !bLabel )
@@ -397,7 +375,7 @@ void CWKSP_Shapes_Line::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
 					B		= A;
 					A		= dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
 
-					if( (d += SG_Get_Distance(A.x, A.y, B.x, B.y)) > m_Label_Freq * sx )
+					if( (d += SG_Get_Distance(A.x, A.y, B.x, B.y)) > m_Label_Freq * Width )
 					{
 						bLabel	= true;
 						B		= A;
@@ -409,12 +387,12 @@ void CWKSP_Shapes_Line::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
 				{
 					A		= dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
 
-					if( SG_Get_Distance(A.x, A.y, B.x, B.y) > sx )
+					if( SG_Get_Distance(A.x, A.y, B.x, B.y) > Width )
 					{
 						bLabel	= false;
 						d		= 0.0;
 
-						Draw_Text(dc_Map.dc, TEXTALIGN_TOPLEFT, B.x, B.y, GET_ANGLE(A, B), s, m_Label_Eff, m_Label_Eff_Color);
+						Draw_Text(dc_Map.dc, TEXTALIGN_TOPLEFT, B.x, B.y, GET_ANGLE(A, B), Label, m_Label_Eff, m_Label_Eff_Color);
 
 					//	dc_Map.dc.DrawRotatedText(s, B.x, B.y, GET_ANGLE(A, B));
 					//	dc_Map.dc.DrawCircle(A.x, A.y, 3);	dc_Map.dc.DrawCircle(B.x, B.y, 3);
@@ -433,26 +411,19 @@ void CWKSP_Shapes_Line::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#define DRAW_MOVELINE(i)	{	ptWorld	= m_Edit_pShape->Get_Point(i, m_Edit_iPart);\
-								dc.DrawLine(Point.x, Point.y,\
-									(int)((ptWorld.x - rWorld.Get_XMin()) / ClientToWorld),\
-									(int)((rWorld.Get_YMax() - ptWorld.y) / ClientToWorld));	}
-
-//---------------------------------------------------------
-void CWKSP_Shapes_Line::_Edit_Shape_Draw_Move(wxDC &dc, CSG_Rect rWorld, double ClientToWorld, wxPoint Point)
+void CWKSP_Shapes_Line::Edit_Shape_Draw_Move(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point)
 {
-	int			nPoints;
-	TSG_Point	ptWorld;
-
 	if( m_Edit_pShape && m_Edit_iPart >= 0 )
 	{
-		nPoints	= m_Edit_pShape->Get_Point_Count(m_Edit_iPart);
+		int	nPoints	= m_Edit_pShape->Get_Point_Count(m_Edit_iPart);
 
 		if( m_Edit_iPoint < 0 )
 		{
 			if( nPoints > 0 )
 			{
-				DRAW_MOVELINE(nPoints - 1);
+				CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point,
+					m_Edit_pShape->Get_Point(nPoints - 1, m_Edit_iPart)
+				);
 			}
 		}
 		else
@@ -460,19 +431,27 @@ void CWKSP_Shapes_Line::_Edit_Shape_Draw_Move(wxDC &dc, CSG_Rect rWorld, double
 			if( nPoints > 1 )
 			{
 				if( m_Edit_iPoint > 0 )
-					DRAW_MOVELINE(m_Edit_iPoint - 1);
+				{
+					CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point,
+						m_Edit_pShape->Get_Point(m_Edit_iPoint - 1, m_Edit_iPart)
+					);
+				}
 
 				if( m_Edit_iPoint < nPoints - 1 )
-					DRAW_MOVELINE(m_Edit_iPoint + 1);
+				{
+					CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point,
+						m_Edit_pShape->Get_Point(m_Edit_iPoint + 1, m_Edit_iPart)
+					);
+				}
 			}
 
-			CWKSP_Shapes::_Edit_Shape_Draw_Move(dc, rWorld, ClientToWorld, Point);
+			CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point);
 		}
 	}
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Line::_Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
+void CWKSP_Shapes_Line::Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
 {
 	int			iPart, iPoint;
 	TSG_Point_Int	ptA, ptB;
@@ -497,18 +476,18 @@ void CWKSP_Shapes_Line::_Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
 			}
 		}
 
-		CWKSP_Shapes::_Edit_Shape_Draw(dc_Map);
+		CWKSP_Shapes::Edit_Shape_Draw(dc_Map);
 	}
 }
 
 //---------------------------------------------------------
-int CWKSP_Shapes_Line::_Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist, int &pos_iPart, int &pos_iPoint)
+int CWKSP_Shapes_Line::Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist, int &pos_iPart, int &pos_iPoint)
 {
 	int			Result, iPart, iPoint;
 	double		d;
 	TSG_Point	A, B, Point, hit_Point;
 
-	Result	= CWKSP_Shapes::_Edit_Shape_HitTest(pos_Point, max_Dist, pos_iPart, pos_iPoint);
+	Result	= CWKSP_Shapes::Edit_Shape_HitTest(pos_Point, max_Dist, pos_iPart, pos_iPoint);
 
 	if( Result == 0 && m_Edit_pShape )
 	{
@@ -543,7 +522,7 @@ int CWKSP_Shapes_Line::_Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist,
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Line::_Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape)
+void CWKSP_Shapes_Line::Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape)
 {
 	int			iPart, iPoint;
 	double		d;
diff --git a/src/saga_core/saga_gui/wksp_shapes_line.h b/src/saga_core/saga_gui/wksp_shapes_line.h
index f580edf..563ebd5 100644
--- a/src/saga_core/saga_gui/wksp_shapes_line.h
+++ b/src/saga_core/saga_gui/wksp_shapes_line.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_line.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_line.h 2017 2014-02-25 15:48:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -108,14 +108,14 @@ protected:
 
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual void				_Draw_Initialize		(CWKSP_Map_DC &dc_Map);
-	virtual void				_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection);
-	virtual void				_Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape);
+	virtual void				Draw_Initialize			(CWKSP_Map_DC &dc_Map);
+	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection);
+	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label);
 
-	virtual void				_Edit_Shape_Draw_Move	(wxDC &dc, CSG_Rect rWorld, double ClientToWorld, wxPoint Point);
-	virtual void				_Edit_Shape_Draw		(CWKSP_Map_DC &dc_Map);
-	virtual int					_Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
-	virtual void				_Edit_Snap_Point_ToLine (CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
+	virtual void				Edit_Shape_Draw_Move	(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point);
+	virtual void				Edit_Shape_Draw			(CWKSP_Map_DC &dc_Map);
+	virtual int					Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
+	virtual void				Edit_Snap_Point_ToLine	(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
 
 };
 
diff --git a/src/saga_core/saga_gui/wksp_shapes_point.cpp b/src/saga_core/saga_gui/wksp_shapes_point.cpp
index 1317340..9409bb3 100644
--- a/src/saga_core/saga_gui/wksp_shapes_point.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_point.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_point.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_point.cpp 2007 2014-02-20 13:53:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -99,7 +99,7 @@ void CWKSP_Shapes_Point::On_Create_Parameters(void)
 {
 	CWKSP_Shapes::On_Create_Parameters();
 
-	_BrushList_Add(
+	BrushList_Add(
 		m_Parameters("NODE_DISPLAY")	, "DISPLAY_BRUSH"			, _TL("Fill Style"),
 		_TL("")
 	);
@@ -171,7 +171,7 @@ void CWKSP_Shapes_Point::On_Create_Parameters(void)
 	//-----------------------------------------------------
 	// Label...
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("LABEL_ATTRIB")	, "LABEL_ANGLE_ATTRIB"	, _TL("Rotation by Attribute"),
 		_TL("")
 	);
@@ -214,7 +214,7 @@ void CWKSP_Shapes_Point::On_Create_Parameters(void)
 		), 0
 	);
 
-	_AttributeList_Add(
+	AttributeList_Add(
 		m_Parameters("NODE_SIZE")		, "SIZE_ATTRIB"		, _TL("Attribute"),
 		_TL("")
 	);
@@ -262,8 +262,8 @@ void CWKSP_Shapes_Point::On_DataObject_Changed(void)
 {
 	CWKSP_Shapes::On_DataObject_Changed();
 
-	_AttributeList_Set(m_Parameters("SIZE_ATTRIB")			, true);
-	_AttributeList_Set(m_Parameters("LABEL_ANGLE_ATTRIB")	, true);
+	AttributeList_Set(m_Parameters("SIZE_ATTRIB")			, true);
+	AttributeList_Set(m_Parameters("LABEL_ANGLE_ATTRIB")	, true);
 }
 
 //---------------------------------------------------------
@@ -321,7 +321,7 @@ void CWKSP_Shapes_Point::On_Parameters_Changed(void)
 	//-----------------------------------------------------
 	m_bOutline	= m_Parameters("OUTLINE")->asBool();
 	m_Pen		= wxPen(!m_bOutline ? m_Def_Color : Get_Color_asWX(m_Parameters("OUTLINE_COLOR")->asColor()), m_Parameters("OUTLINE_SIZE")->asInt(), wxSOLID);
-	m_Brush		= wxBrush(m_Def_Color, _BrushList_Get_Style(m_Parameters("DISPLAY_BRUSH")->asInt()));
+	m_Brush		= wxBrush(m_Def_Color, BrushList_Get_Style(m_Parameters("DISPLAY_BRUSH")->asInt()));
 }
 
 
@@ -420,7 +420,7 @@ bool CWKSP_Shapes_Point::Get_Style_Size(int &min_Size, int &max_Size, double &mi
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-inline void CWKSP_Shapes_Point::_Draw_Initialize(CWKSP_Map_DC &dc_Map)
+inline void CWKSP_Shapes_Point::Draw_Initialize(CWKSP_Map_DC &dc_Map)
 {
 	dc_Map.dc.SetBrush	(m_Brush);
 	dc_Map.dc.SetPen	(m_Pen);
@@ -429,7 +429,7 @@ inline void CWKSP_Shapes_Point::_Draw_Initialize(CWKSP_Map_DC &dc_Map)
 }
 
 //---------------------------------------------------------
-inline bool CWKSP_Shapes_Point::_Draw_Initialize(CWKSP_Map_DC &dc_Map, int &Size, CSG_Shape *pShape, bool bSelection)
+inline bool CWKSP_Shapes_Point::Draw_Initialize(CWKSP_Map_DC &dc_Map, int &Size, CSG_Shape *pShape, int Selection)
 {
 	//-----------------------------------------------------
 	double	dSize;
@@ -462,16 +462,16 @@ inline bool CWKSP_Shapes_Point::_Draw_Initialize(CWKSP_Map_DC &dc_Map, int &Size
 	//-----------------------------------------------------
 	if( Size > 0 )
 	{
-		if( bSelection )
+		if( Selection )
 		{
-			dc_Map.dc.SetBrush	(wxBrush(m_Sel_Color_Fill	, wxSOLID));
-			dc_Map.dc.SetPen	(wxPen	(m_Sel_Color     , 0, wxSOLID));
+			dc_Map.dc.SetBrush(wxBrush(m_Sel_Color_Fill	, wxSOLID));
+			dc_Map.dc.SetPen  (wxPen(m_Sel_Color, Selection == 1 ? 2 : 0, wxSOLID));
 		}
 		else
 		{
 			int		Color;
 
-			if( _Get_Class_Color(pShape, Color) )
+			if( Get_Class_Color(pShape, Color) )
 			{
 				wxBrush	Brush(m_Brush);
 				Brush.SetColour(SG_GET_R(Color), SG_GET_G(Color), SG_GET_B(Color));
@@ -493,7 +493,7 @@ inline bool CWKSP_Shapes_Point::_Draw_Initialize(CWKSP_Map_DC &dc_Map, int &Size
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Point::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection)
+void CWKSP_Shapes_Point::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)
 {
 	if( m_iSize >= 0 && pShape->is_NoData(m_iSize) )
 	{
@@ -503,29 +503,28 @@ void CWKSP_Shapes_Point::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bo
 	//-----------------------------------------------------
 	int		Size;
 
-	if( _Draw_Initialize(dc_Map, Size, pShape, bSelection) )
+	if( Draw_Initialize(dc_Map, Size, pShape, Selection) )
 	{
 		TSG_Point_Int	p(dc_Map.World2DC(pShape->Get_Point(0)));
 
 		Draw_Symbol(dc_Map.dc, p.x, p.y, Size);
 
 		//-------------------------------------------------
-		if( bSelection )
+		if( Selection )
 		{
-			_Draw_Initialize(dc_Map);
+			Draw_Initialize(dc_Map);
 		}
 	}
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Point::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
+void CWKSP_Shapes_Point::Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
 {
 	TSG_Point_Int	p(dc_Map.World2DC(pShape->Get_Point(0)));
-	wxString		s(pShape->asString(m_iLabel, m_Label_Prec));	s.Trim(true).Trim(false);
 
 	double	Angle	= m_iLabel_Angle < 0 ? m_Label_Angle : pShape->asDouble(m_iLabel_Angle);
 
-	Draw_Text(dc_Map.dc, m_Label_Align, p.x, p.y, Angle, s, m_Label_Eff, m_Label_Eff_Color);
+	Draw_Text(dc_Map.dc, m_Label_Align, p.x, p.y, Angle, Label, m_Label_Eff, m_Label_Eff_Color);
 }
 
 
@@ -671,26 +670,3 @@ void CWKSP_Shapes_Point::Draw_Symbol(wxDC &dc, int x, int y, int size)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-wxMenu * CWKSP_Shapes_Point::On_Edit_Get_Menu(void)
-{
-	wxMenu	*pMenu;
-
-	pMenu	= new wxMenu;
-
-	CMD_Menu_Add_Item(pMenu, true , ID_CMD_SHAPES_EDIT_SHAPE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_ADD_SHAPE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_DEL_SHAPE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_CLEAR);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_SHAPES_EDIT_SEL_INVERT);
-
-	return( pMenu );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_shapes_point.h b/src/saga_core/saga_gui/wksp_shapes_point.h
index 35abbf9..308bfb5 100644
--- a/src/saga_core/saga_gui/wksp_shapes_point.h
+++ b/src/saga_core/saga_gui/wksp_shapes_point.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_point.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_point.h 2007 2014-02-20 13:53:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -119,12 +119,10 @@ protected:
 
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual void				_Draw_Initialize		(CWKSP_Map_DC &dc_Map);
-	virtual bool				_Draw_Initialize		(CWKSP_Map_DC &dc_Map, int &Size, CSG_Shape *pShape, bool bSelection);
-	virtual void				_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection);
-	virtual void				_Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape);
-
-	virtual wxMenu *			On_Edit_Get_Menu		(void);
+	virtual void				Draw_Initialize			(CWKSP_Map_DC &dc_Map);
+	virtual bool				Draw_Initialize			(CWKSP_Map_DC &dc_Map, int &Size, CSG_Shape *pShape, int Selection);
+	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection);
+	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label);
 
 };
 
diff --git a/src/saga_core/saga_gui/wksp_shapes_points.cpp b/src/saga_core/saga_gui/wksp_shapes_points.cpp
index 63f9a5d..53f4171 100644
--- a/src/saga_core/saga_gui/wksp_shapes_points.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_points.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_points.cpp 2007 2014-02-20 13:53:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -85,7 +85,7 @@ CWKSP_Shapes_Points::CWKSP_Shapes_Points(CSG_Shapes *pShapes)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Points::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection)
+void CWKSP_Shapes_Points::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)
 {
 	if( (m_iSize >= 0 && pShape->is_NoData(m_iSize)) || (m_iColor >= 0 && pShape->is_NoData(m_iColor)) )
 		return;
@@ -93,7 +93,7 @@ void CWKSP_Shapes_Points::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, b
 	//-----------------------------------------------------
 	int		Size;
 
-	if( CWKSP_Shapes_Point::_Draw_Initialize(dc_Map, Size, pShape, bSelection) )
+	if( CWKSP_Shapes_Point::Draw_Initialize(dc_Map, Size, pShape, Selection) )
 	{
 		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
 		{
@@ -106,19 +106,19 @@ void CWKSP_Shapes_Points::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, b
 		}
 
 		//-------------------------------------------------
-		if( bSelection )
+		if( Selection )
 		{
-			CWKSP_Shapes_Point::_Draw_Initialize(dc_Map);
+			CWKSP_Shapes_Point::Draw_Initialize(dc_Map);
 		}
 	}
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Points::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
+void CWKSP_Shapes_Points::Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
 {
 	TSG_Point_Int	p(dc_Map.World2DC(pShape->Get_Extent().Get_Center()));
 
-	Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, pShape->asString(m_iLabel, m_Label_Prec), m_Label_Eff, m_Label_Eff_Color);
+	Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, Label, m_Label_Eff, m_Label_Eff_Color);
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_shapes_points.h b/src/saga_core/saga_gui/wksp_shapes_points.h
index d378474..6010062 100644
--- a/src/saga_core/saga_gui/wksp_shapes_points.h
+++ b/src/saga_core/saga_gui/wksp_shapes_points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_points.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_points.h 2007 2014-02-20 13:53:13Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -90,8 +90,8 @@ public:
 
 protected:
 
-	virtual void				_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection);
-	virtual void				_Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape);
+	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection);
+	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label);
 
 };
 
diff --git a/src/saga_core/saga_gui/wksp_shapes_polygon.cpp b/src/saga_core/saga_gui/wksp_shapes_polygon.cpp
index 04d91b4..8862250 100644
--- a/src/saga_core/saga_gui/wksp_shapes_polygon.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_polygon.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_polygon.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_polygon.cpp 2017 2014-02-25 15:48:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -99,7 +99,7 @@ void CWKSP_Shapes_Polygon::On_Create_Parameters(void)
 	//-----------------------------------------------------
 	// Display...
 
-	_BrushList_Add(
+	BrushList_Add(
 		m_Parameters("NODE_DISPLAY")	, "DISPLAY_BRUSH"			, _TL("Fill Style"),
 		_TL("")
 	);
@@ -162,10 +162,10 @@ void CWKSP_Shapes_Polygon::On_Parameters_Changed(void)
 	//-----------------------------------------------------
 	m_bOutline	= m_Parameters("OUTLINE")->asBool();
 	m_Pen		= wxPen(!m_bOutline ? m_Def_Color : Get_Color_asWX(m_Parameters("OUTLINE_COLOR")->asColor()), m_Parameters("OUTLINE_SIZE")->asInt(), wxSOLID);
-	m_Brush		= wxBrush(m_Def_Color, _BrushList_Get_Style(m_Parameters("DISPLAY_BRUSH")->asInt()));
+	m_Brush		= wxBrush(m_Def_Color, BrushList_Get_Style(m_Parameters("DISPLAY_BRUSH")->asInt()));
 
-	m_bPoints	= m_Parameters("DISPLAY_POINTS")	->asBool();
-	m_bCentroid	= m_Parameters("DISPLAY_CENTROID")	->asBool();
+	m_bVertices	= m_Parameters("DISPLAY_POINTS"  )->asBool();
+	m_bCentroid	= m_Parameters("DISPLAY_CENTROID")->asBool();
 }
 
 
@@ -189,7 +189,7 @@ int CWKSP_Shapes_Polygon::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Draw_Initialize(CWKSP_Map_DC &dc_Map)
+void CWKSP_Shapes_Polygon::Draw_Initialize(CWKSP_Map_DC &dc_Map)
 {
 	dc_Map.dc.SetBrush(m_Brush);
 	dc_Map.dc.SetPen(m_Pen);
@@ -198,13 +198,13 @@ void CWKSP_Shapes_Polygon::_Draw_Initialize(CWKSP_Map_DC &dc_Map)
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection)
+void CWKSP_Shapes_Polygon::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)
 {
 	//-----------------------------------------------------
-	if( bSelection )
+	if( Selection )
 	{
 		dc_Map.dc.SetBrush(wxBrush(m_Sel_Color_Fill, wxSOLID));
-		dc_Map.dc.SetPen(wxPen(m_Sel_Color, 0, wxSOLID));
+		dc_Map.dc.SetPen(wxPen(m_Sel_Color, Selection == 1 ? 2 : 0, wxSOLID));
 
 		dc_Map.Draw_Polygon((CSG_Shape_Polygon *)pShape);
 
@@ -219,7 +219,7 @@ void CWKSP_Shapes_Polygon::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape,
 	{
 		int		Color;
 
-		if( _Get_Class_Color(pShape, Color) )
+		if( Get_Class_Color(pShape, Color) )
 		{
 			m_Brush.SetColour(SG_GET_R(Color), SG_GET_G(Color), SG_GET_B(Color));
 			dc_Map.dc.SetBrush(m_Brush);
@@ -240,23 +240,16 @@ void CWKSP_Shapes_Polygon::_Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape,
 
 		dc_Map.dc.DrawCircle((int)dc_Map.xWorld2DC(Point.x), (int)dc_Map.yWorld2DC(Point.y), 2);
 	}
-
-	if( m_bPoints )
-	{
-		_Draw_Polygon_Points(dc_Map, (CSG_Shape_Polygon *)pShape);
-	}
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
+void CWKSP_Shapes_Polygon::Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
 {
-	wxString	s(pShape->asString(m_iLabel, m_Label_Prec));	s.Trim(true).Trim(false);
-
 	if( 0 )
 	{
 		TSG_Point_Int	p	= dc_Map.World2DC(((CSG_Shape_Polygon *)pShape)->Get_Centroid());
 
-		Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, s, m_Label_Eff, m_Label_Eff_Color);
+		Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, Label, m_Label_Eff, m_Label_Eff_Color);
 	}
 	else
 	{
@@ -266,7 +259,7 @@ void CWKSP_Shapes_Polygon::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
 			{
 				TSG_Point_Int	p	= dc_Map.World2DC(((CSG_Shape_Polygon *)pShape)->Get_Centroid());
 
-				Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, s, m_Label_Eff, m_Label_Eff_Color);
+				Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, Label, m_Label_Eff, m_Label_Eff_Color);
 			}
 		}
 	}
@@ -280,48 +273,51 @@ void CWKSP_Shapes_Polygon::_Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#define DRAW_MOVELINE(i)	{	ptWorld	= m_Edit_pShape->Get_Point(i, m_Edit_iPart);\
-								dc.DrawLine(Point.x, Point.y,\
-									(int)((ptWorld.x - rWorld.Get_XMin()) / ClientToWorld),\
-									(int)((rWorld.Get_YMax() - ptWorld.y) / ClientToWorld));	}
-
-//---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Edit_Shape_Draw_Move(wxDC &dc, CSG_Rect rWorld, double ClientToWorld, wxPoint Point)
+void CWKSP_Shapes_Polygon::Edit_Shape_Draw_Move(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point)
 {
-	int			nPoints;
-	TSG_Point	ptWorld;
-
 	if( m_Edit_pShape && m_Edit_iPart >= 0 )
 	{
-		nPoints	= m_Edit_pShape->Get_Point_Count(m_Edit_iPart);
+		int	nPoints	= m_Edit_pShape->Get_Point_Count(m_Edit_iPart);
 
 		if( m_Edit_iPoint < 0 )
 		{
 			if( nPoints > 0 )
 			{
-				DRAW_MOVELINE(0);
+				CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point,
+					m_Edit_pShape->Get_Point(0, m_Edit_iPart)
+				);
 
 				if( nPoints > 1 )
-					DRAW_MOVELINE(nPoints - 1);
+				{
+					CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point,
+						m_Edit_pShape->Get_Point(nPoints - 1, m_Edit_iPart)
+					);
+				}
 			}
 		}
 		else
 		{
 			if( nPoints > 1 )
 			{
-				DRAW_MOVELINE(m_Edit_iPoint > 0 ? m_Edit_iPoint - 1 : nPoints - 1);
+				CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point, m_Edit_pShape->Get_Point(
+					m_Edit_iPoint > 0 ? m_Edit_iPoint - 1 : nPoints - 1, m_Edit_iPart, true)
+				);
 
 				if( nPoints > 2 )
-					DRAW_MOVELINE(m_Edit_iPoint >= nPoints - 1 ? 0 : m_Edit_iPoint + 1);
+				{
+					CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point, m_Edit_pShape->Get_Point(
+						m_Edit_iPoint >= nPoints - 1 ? 0 : m_Edit_iPoint + 1, m_Edit_iPart, true)
+					);
+				}
 			}
 
-			CWKSP_Shapes::_Edit_Shape_Draw_Move(dc, rWorld, ClientToWorld, Point);
+			CWKSP_Shapes::Edit_Shape_Draw_Move(dc, rWorld, Point);
 		}
 	}
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
+void CWKSP_Shapes_Polygon::Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
 {
 	int			iPart, iPoint;
 	TSG_Point_Int	ptA, ptB;
@@ -353,18 +349,18 @@ void CWKSP_Shapes_Polygon::_Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
 			}
 		}
 
-		CWKSP_Shapes::_Edit_Shape_Draw(dc_Map);
+		CWKSP_Shapes::Edit_Shape_Draw(dc_Map);
 	}
 }
 
 //---------------------------------------------------------
-int CWKSP_Shapes_Polygon::_Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist, int &pos_iPart, int &pos_iPoint)
+int CWKSP_Shapes_Polygon::Edit_Shape_HitTest(CSG_Point pos_Point, double max_Dist, int &pos_iPart, int &pos_iPoint)
 {
 	int			Result, iPart, iPoint;
 	double		d;
 	TSG_Point	A, B, Point, hit_Point;
 
-	Result	= CWKSP_Shapes::_Edit_Shape_HitTest(pos_Point, max_Dist, pos_iPart, pos_iPoint);
+	Result	= CWKSP_Shapes::Edit_Shape_HitTest(pos_Point, max_Dist, pos_iPart, pos_iPoint);
 
 	if( Result == 0 && m_Edit_pShape )
 	{
@@ -399,7 +395,7 @@ int CWKSP_Shapes_Polygon::_Edit_Shape_HitTest(CSG_Point pos_Point, double max_Di
 }
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape)
+void CWKSP_Shapes_Polygon::Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape)
 {
 	int			iPart, iPoint;
 	double		d;
@@ -432,33 +428,3 @@ void CWKSP_Shapes_Polygon::_Edit_Snap_Point_ToLine(CSG_Point pos_Point, CSG_Poin
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Shapes_Polygon::_Draw_Polygon_Points(CWKSP_Map_DC &dc_Map, CSG_Shape_Polygon *pPolygon)
-{
-	int			iPart, iPoint;
-	TSG_Point	Point;
-
-	dc_Map.dc.SetPen(*wxBLACK_PEN);
-	dc_Map.dc.SetBrush(*wxWHITE_BRUSH);
-
-	for(iPart=0; iPart<pPolygon->Get_Part_Count(); iPart++)
-	{
-		if( pPolygon->Get_Point_Count(iPart) > 2 )
-		{
-			for(iPoint=0; iPoint<pPolygon->Get_Point_Count(iPart); iPoint++)
-			{
-				Point	= pPolygon->Get_Point(iPoint, iPart);
-
-				dc_Map.dc.DrawCircle((int)dc_Map.xWorld2DC(Point.x), (int)dc_Map.yWorld2DC(Point.y), 2);
-			}
-		}
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_shapes_polygon.h b/src/saga_core/saga_gui/wksp_shapes_polygon.h
index 933ef5b..90cd84a 100644
--- a/src/saga_core/saga_gui/wksp_shapes_polygon.h
+++ b/src/saga_core/saga_gui/wksp_shapes_polygon.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_polygon.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_shapes_polygon.h 2017 2014-02-25 15:48:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -94,7 +94,7 @@ public:
 
 protected:
 
-	bool						m_bPoints, m_bCentroid, m_bOutline;
+	bool						m_bCentroid, m_bOutline;
 
 	wxColour					m_Sel_Color_Fill;
 
@@ -109,16 +109,15 @@ protected:
 
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual void				_Draw_Initialize		(CWKSP_Map_DC &dc_Map);
-	virtual void				_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, bool bSelection);
-	virtual void				_Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape);
+	virtual void				Draw_Initialize			(CWKSP_Map_DC &dc_Map);
+	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection);
+	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label);
 
-	void						_Draw_Polygon_Points	(CWKSP_Map_DC &dc_Map, CSG_Shape_Polygon *pPolygon);
+	virtual void				Edit_Shape_Draw_Move	(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point);
+	virtual void				Edit_Shape_Draw			(CWKSP_Map_DC &dc_Map);
+	virtual int					Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
+	virtual void				Edit_Snap_Point_ToLine	(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
 
-	virtual void				_Edit_Shape_Draw_Move	(wxDC &dc, CSG_Rect rWorld, double ClientToWorld, wxPoint Point);
-	virtual void				_Edit_Shape_Draw		(CWKSP_Map_DC &dc_Map);
-	virtual int					_Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
-	virtual void				_Edit_Snap_Point_ToLine (CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
 
 };
 
diff --git a/src/saga_core/saga_gui/wksp_table.cpp b/src/saga_core/saga_gui/wksp_table.cpp
index ec2e0d2..23da969 100644
--- a/src/saga_core/saga_gui/wksp_table.cpp
+++ b/src/saga_core/saga_gui/wksp_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_table.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_table.cpp 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,7 +72,6 @@
 
 #include "view_table.h"
 #include "view_table_diagram.h"
-#include "view_scatterplot.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -97,9 +96,6 @@ CWKSP_Table::CWKSP_Table(CSG_Table *pTable)
 //---------------------------------------------------------
 CWKSP_Table::~CWKSP_Table(void)
 {
-	Set_View	(false);
-	Set_Diagram	(false);
-
 	if( m_pObject->Get_ObjectType() != DATAOBJECT_TYPE_Table )
 	{
 		m_pObject	= NULL;
@@ -192,7 +188,7 @@ bool CWKSP_Table::On_Command(int Cmd_ID)
 		break;
 
 	case ID_CMD_TABLES_SCATTERPLOT:
-		Add_ScatterPlot(Get_Table());
+		Add_ScatterPlot();
 		break;
 	}
 
@@ -236,15 +232,13 @@ void CWKSP_Table::Set_View(bool bShow)
 	else if( !bShow && m_pView )
 	{
 		m_pView->Destroy();
-
-		delete(m_pView);
 	}
 }
 
 //---------------------------------------------------------
 void CWKSP_Table::Toggle_View(void)
 {
-	Set_View( m_pView == NULL );
+	Set_View(m_pView == NULL);
 }
 
 
@@ -264,15 +258,13 @@ void CWKSP_Table::Set_Diagram(bool bShow)
 	else if( !bShow && m_pDiagram )
 	{
 		m_pDiagram->Destroy();
-
-		delete(m_pDiagram);
 	}
 }
 
 //---------------------------------------------------------
 void CWKSP_Table::Toggle_Diagram(void)
 {
-	Set_Diagram( m_pDiagram == NULL );
+	Set_Diagram(m_pDiagram == NULL);
 }
 
 
@@ -291,32 +283,12 @@ bool CWKSP_Table::Show(int Flags)
 }
 
 //---------------------------------------------------------
-void CWKSP_Table::On_Update_Views(bool bAll)
-{
-	if( m_pView )
-	{
-		m_pView->Update_Table();
-	}
-
-	if( m_pDiagram )
-	{
-		m_pDiagram->Update_Diagram();
-	}
-}
-
-//---------------------------------------------------------
 bool CWKSP_Table::View_Closes(wxMDIChildFrame *pView)
 {
-	if		( wxDynamicCast(pView, CVIEW_Table) )
-	{
-		m_pView		= NULL;
-	}
-	else if	( wxDynamicCast(pView, CVIEW_Table_Diagram) )
-	{
-		m_pDiagram	= NULL;
-	}
+	if( pView == m_pView    )	m_pView		= NULL;
+	if( pView == m_pDiagram )	m_pDiagram	= NULL;
 
-	return( true );
+	return( CWKSP_Data_Item::View_Closes(pView) );
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_table.h b/src/saga_core/saga_gui/wksp_table.h
index b0f3bb8..679211f 100644
--- a/src/saga_core/saga_gui/wksp_table.h
+++ b/src/saga_core/saga_gui/wksp_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_table.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_table.h 2061 2014-03-20 11:48:01Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -111,11 +111,6 @@ public:
 	virtual bool					View_Closes				(class wxMDIChildFrame *pView);
 
 
-protected:
-
-	virtual void					On_Update_Views			(bool bAll);
-
-
 private:
 
 	class CVIEW_Table				*m_pView;
diff --git a/src/saga_core/saga_gui/wksp_tin.cpp b/src/saga_core/saga_gui/wksp_tin.cpp
index 14aace0..59faa97 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_tin.cpp 2053 2014-03-18 09:47:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,8 +72,6 @@
 #include "wksp_tin.h"
 #include "wksp_table.h"
 
-#include "view_scatterplot.h"
-
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -153,6 +151,9 @@ wxMenu * CWKSP_TIN::Get_Menu(void)
 
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_TIN_SHOW);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_DATA_PROJECTION);
+	pMenu->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_SETTINGS_COPY);
 
 	pMenu->AppendSeparator();
@@ -190,7 +191,7 @@ bool CWKSP_TIN::On_Command(int Cmd_ID)
 		break;
 
 	case ID_CMD_TABLES_SCATTERPLOT:
-		Add_ScatterPlot(Get_Table()->Get_Table());
+		Add_ScatterPlot();
 		break;
 	}
 
@@ -368,7 +369,13 @@ bool CWKSP_TIN::asImage(CSG_Grid *pImage)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_TIN::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
+TSG_Rect CWKSP_TIN::Edit_Get_Extent(void)
+{
+	return( Get_TIN()->Get_Extent() );
+}
+
+//---------------------------------------------------------
+bool CWKSP_TIN::Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int Key)
 {
 	CSG_Rect	rWorld(m_Edit_Mouse_Down, Point);
 
@@ -381,17 +388,11 @@ bool CWKSP_TIN::On_Edit_On_Mouse_Up(CSG_Point Point, double ClientToWorld, int K
 }
 
 //---------------------------------------------------------
-bool CWKSP_TIN::On_Edit_Set_Attributes(void)
+bool CWKSP_TIN::Edit_Set_Attributes(void)
 {
 	return( true );
 }
 
-//---------------------------------------------------------
-TSG_Rect CWKSP_TIN::On_Edit_Get_Extent(void)
-{
-	return( Get_TIN()->Get_Extent() );
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_gui/wksp_tin.h b/src/saga_core/saga_gui/wksp_tin.h
index 128f38b..dbcb05a 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 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_tin.h 2003 2014-02-19 17:08:18Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -107,6 +107,10 @@ public:
 
 	wxString					Get_Name_Attribute		(void);
 
+	virtual TSG_Rect			Edit_Get_Extent			(void);
+	virtual bool				Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
+	virtual bool				Edit_Set_Attributes		(void);
+
 
 protected:
 
@@ -133,12 +137,11 @@ protected:
 	virtual void				On_Parameters_Changed	(void);
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual bool				On_Edit_On_Mouse_Up		(CSG_Point Point, double ClientToWorld, int Key);
-	virtual bool				On_Edit_Set_Attributes	(void);
-	virtual TSG_Rect			On_Edit_Get_Extent		(void);
-
 	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
 
+
+private:
+
 	void						_Draw_Points			(CWKSP_Map_DC &dc_Map);
 	void						_Draw_Edges				(CWKSP_Map_DC &dc_Map);
 	void						_Draw_Triangles			(CWKSP_Map_DC &dc_Map);

-- 
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